@editora/plugins 1.0.10 → 1.0.11

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 (138) hide show
  1. package/dist/_commonjsHelpers-BH3jXuIh.js +1 -0
  2. package/dist/_commonjsHelpers-ByX85dGu.mjs +33 -0
  3. package/dist/a11y-checker.cjs.js +12 -12
  4. package/dist/a11y-checker.esm.js +80 -98
  5. package/dist/anchor.cjs.js +12 -12
  6. package/dist/anchor.esm.js +115 -128
  7. package/dist/anchoredPopover-BzqGPOAE.js +1 -0
  8. package/dist/anchoredPopover-Dts0IrgU.mjs +106 -0
  9. package/dist/approval-workflow.cjs.js +40 -40
  10. package/dist/approval-workflow.esm.js +208 -249
  11. package/dist/background-color.cjs.js +2 -2
  12. package/dist/background-color.esm.js +55 -68
  13. package/dist/blockquote.esm.js +1 -2
  14. package/dist/blocks-library.cjs.js +45 -45
  15. package/dist/blocks-library.esm.js +178 -245
  16. package/dist/capitalization.esm.js +1 -2
  17. package/dist/checklist.cjs.js +1 -1
  18. package/dist/checklist.esm.js +58 -82
  19. package/dist/citations.cjs.js +37 -37
  20. package/dist/citations.esm.js +439 -512
  21. package/dist/clear-formatting.cjs.js +1 -1
  22. package/dist/clear-formatting.esm.js +27 -33
  23. package/dist/code-sample.cjs.js +14 -14
  24. package/dist/code-sample.esm.js +82 -93
  25. package/dist/code.cjs.js +32 -32
  26. package/dist/code.esm.js +501 -506
  27. package/dist/comments.cjs.js +6 -6
  28. package/dist/comments.esm.js +116 -158
  29. package/dist/conditional-content.cjs.js +90 -90
  30. package/dist/conditional-content.esm.js +371 -432
  31. package/dist/content-rules.cjs.js +7 -7
  32. package/dist/content-rules.esm.js +105 -159
  33. package/dist/data-binding.cjs.js +46 -46
  34. package/dist/data-binding.esm.js +328 -368
  35. package/dist/direction.esm.js +9 -18
  36. package/dist/doc-schema.cjs.js +29 -29
  37. package/dist/doc-schema.esm.js +240 -308
  38. package/dist/document-manager.cjs.js +1 -1
  39. package/dist/document-manager.esm.js +4 -5
  40. package/dist/documentManager-CTqRftU8.mjs +8369 -0
  41. package/dist/documentManager-Jf0RbSks.js +17 -0
  42. package/dist/{editorContainerHelpers-69585c07.mjs → editorContainerHelpers-C7kdWnS0.mjs} +1 -2
  43. package/dist/embed-iframe.cjs.js +4 -4
  44. package/dist/embed-iframe.esm.js +73 -81
  45. package/dist/emojis.cjs.js +8 -8
  46. package/dist/emojis.esm.js +65 -77
  47. package/dist/enterprise.cjs.js +1 -1
  48. package/dist/enterprise.esm.js +54 -56
  49. package/dist/font-family.cjs.js +1 -1
  50. package/dist/font-family.esm.js +39 -47
  51. package/dist/font-size.cjs.js +1 -1
  52. package/dist/font-size.esm.js +37 -53
  53. package/dist/footnote.cjs.js +2 -2
  54. package/dist/footnote.esm.js +76 -117
  55. package/dist/history.cjs.js +1 -1
  56. package/dist/history.esm.js +70 -92
  57. package/dist/html2canvas.esm-B5qzocYs.js +5 -0
  58. package/dist/{html2canvas.esm-1a1724a1.mjs → html2canvas.esm-BWVIUcAF.mjs} +141 -225
  59. package/dist/indent.cjs.js +1 -1
  60. package/dist/indent.esm.js +12 -24
  61. package/dist/{index-f04538f2.mjs → index-BFsKNTTj.mjs} +70 -71
  62. package/dist/index-CvJk4DKa.js +221 -0
  63. package/dist/index-D3CycEFU.mjs +16543 -0
  64. package/dist/index-tqLTHcO6.js +1 -0
  65. package/dist/index.cjs.js +1 -1
  66. package/dist/index.es-CE_A4QSm.js +5 -0
  67. package/dist/index.es-DQ78mYYo.mjs +6665 -0
  68. package/dist/index.esm.js +125 -128
  69. package/dist/italic.cjs.js +1 -1
  70. package/dist/italic.esm.js +8 -9
  71. package/dist/jspdf.es.min-BoS80556.js +77 -0
  72. package/dist/{jspdf.es.min-c36a4fd8.mjs → jspdf.es.min-DQCoX5yh.mjs} +3658 -4682
  73. package/dist/line-height.cjs.js +1 -1
  74. package/dist/line-height.esm.js +11 -24
  75. package/dist/link.cjs.js +5 -5
  76. package/dist/link.esm.js +24 -30
  77. package/dist/list.cjs.js +1 -1
  78. package/dist/list.esm.js +20 -25
  79. package/dist/lite.cjs.js +1 -1
  80. package/dist/lite.esm.js +59 -61
  81. package/dist/math.cjs.js +21 -21
  82. package/dist/math.esm.js +139 -146
  83. package/dist/media-manager.cjs.js +31 -31
  84. package/dist/media-manager.esm.js +285 -300
  85. package/dist/mentions.cjs.js +9 -9
  86. package/dist/mentions.esm.js +238 -286
  87. package/dist/merge-tag.cjs.js +2 -2
  88. package/dist/merge-tag.esm.js +177 -216
  89. package/dist/page-break.cjs.js +2 -2
  90. package/dist/page-break.esm.js +33 -49
  91. package/dist/pii-redaction.cjs.js +19 -19
  92. package/dist/pii-redaction.esm.js +393 -463
  93. package/dist/plugins.css +1 -0
  94. package/dist/preview.esm.js +5 -10
  95. package/dist/print.cjs.js +4 -4
  96. package/dist/print.esm.js +17 -20
  97. package/dist/{purify.es-35a15df8.mjs → purify.es-DHhaBdbu.mjs} +9 -19
  98. package/dist/{purify.es-a8d731c6.js → purify.es-T2a3nLiC.js} +1 -1
  99. package/dist/slash-commands.cjs.js +2 -2
  100. package/dist/slash-commands.esm.js +39 -75
  101. package/dist/smart-paste.cjs.js +27 -27
  102. package/dist/smart-paste.esm.js +280 -336
  103. package/dist/special-characters.cjs.js +7 -7
  104. package/dist/special-characters.esm.js +61 -69
  105. package/dist/spell-check.cjs.js +5 -5
  106. package/dist/spell-check.esm.js +97 -123
  107. package/dist/strikethrough.cjs.js +1 -1
  108. package/dist/strikethrough.esm.js +14 -19
  109. package/dist/table.cjs.js +4 -4
  110. package/dist/table.esm.js +191 -225
  111. package/dist/template.cjs.js +21 -20
  112. package/dist/template.esm.js +715 -196
  113. package/dist/text-alignment.cjs.js +1 -1
  114. package/dist/text-alignment.esm.js +21 -27
  115. package/dist/text-color.cjs.js +3 -3
  116. package/dist/text-color.esm.js +70 -87
  117. package/dist/track-changes.cjs.js +2 -2
  118. package/dist/track-changes.esm.js +100 -162
  119. package/dist/translation-workflow.cjs.js +74 -74
  120. package/dist/translation-workflow.esm.js +602 -678
  121. package/dist/version-diff.cjs.js +14 -14
  122. package/dist/version-diff.esm.js +128 -157
  123. package/package.json +1 -1
  124. package/dist/_commonjsHelpers-6763f629.js +0 -1
  125. package/dist/_commonjsHelpers-c5d32002.mjs +0 -30
  126. package/dist/anchoredPopover-33f1358d.mjs +0 -109
  127. package/dist/anchoredPopover-8151d535.js +0 -1
  128. package/dist/documentManager-25b6203c.mjs +0 -9122
  129. package/dist/documentManager-b69e7054.js +0 -17
  130. package/dist/html2canvas.esm-09133e29.js +0 -22
  131. package/dist/index-656d224b.js +0 -231
  132. package/dist/index-6a8c48bb.js +0 -1
  133. package/dist/index-d027b7e2.mjs +0 -16859
  134. package/dist/index.es-730f2d98.mjs +0 -5775
  135. package/dist/index.es-dd40173b.js +0 -18
  136. package/dist/jspdf.es.min-90db2c97.js +0 -243
  137. package/dist/style.css +0 -1
  138. /package/dist/{editorContainerHelpers-36b8ddf3.js → editorContainerHelpers-CFbfiOJI.js} +0 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=40,s=e=>["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"].includes(e.tagName)&&e.getAttribute("contenteditable")!=="true",E=()=>{const e=window.getSelection();if(e&&e.rangeCount>0){let t=e.getRangeAt(0).startContainer;for(;t&&t!==document.body;){if(t.nodeType===Node.ELEMENT_NODE){const o=t;if(o.getAttribute("contenteditable")==="true")return o}t=t.parentNode}}const n=document.activeElement;if(n){if(n.getAttribute("contenteditable")==="true")return n;const t=n.closest('[contenteditable="true"]');if(t)return t}return document.querySelector('[contenteditable="true"]')},l=e=>{let n=e;if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(s(t))return t}for(;n;){if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(s(t))return t;if(t.getAttribute("contenteditable")==="true")break}n=n.parentNode}return null},p=(e,n)=>{const t=[],o=new Set,c=r=>{!r||o.has(r)||n.contains(r)&&s(r)&&(o.add(r),t.push(r))};if(e.collapsed)return c(l(e.startContainer)),t;const i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r;if(!s(a))return NodeFilter.FILTER_SKIP;if(typeof e.intersectsNode=="function")return e.intersectsNode(a)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP;const u=document.createRange();return u.selectNodeContents(a),e.compareBoundaryPoints(Range.END_TO_START,u)>0&&e.compareBoundaryPoints(Range.START_TO_END,u)<0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let d=i.nextNode();for(;d;)c(d),d=i.nextNode();return t.length===0&&c(l(e.commonAncestorContainer)),t},h=e=>{const n=window.getComputedStyle(e),t=n.paddingLeft;if(t.endsWith("px"))return parseFloat(t);if(t.endsWith("em")){const o=parseFloat(n.fontSize);return parseFloat(t)*o}return 0},T=(e,n)=>{if(n===e.innerHTML)return;const t=window.execEditorCommand||window.executeEditorCommand;if(typeof t=="function")try{t("recordDomTransaction",e,n,e.innerHTML)}catch{}},b=()=>{const e=E();if(!e)return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const t=n.getRangeAt(0);if(!e.contains(t.commonAncestorContainer))return!1;const o=p(t,e);if(o.length===0)return!1;const c=e.innerHTML;return o.forEach(i=>{const r=h(i)+m;i.style.paddingLeft=`${r}px`}),T(e,c),e.dispatchEvent(new Event("input",{bubbles:!0})),!0},v=()=>{const e=E();if(!e)return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const t=n.getRangeAt(0);if(!e.contains(t.commonAncestorContainer))return!1;const o=p(t,e);if(o.length===0)return!1;const c=e.innerHTML;return o.forEach(i=>{const d=h(i),r=Math.max(0,d-m);i.style.paddingLeft=`${r}px`}),T(e,c),e.dispatchEvent(new Event("input",{bubbles:!0})),!0},f=(e,n)=>{var t;typeof window<"u"&&((t=window.registerEditorCommand)==null||t.call(window,e,n))},g=()=>{f("increaseIndent",b),f("decreaseIndent",v)};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g());const w=()=>({name:"indent",toolbar:[{label:"Increase Indent",command:"increaseIndent",type:"button",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M3 4h18v2H3V4zm0 14h18v2H3v-2zm8-7h10v2H11v-2zm0 4h10v2H11v-2zM3 8l4 4-4 4V8z"/></svg>',shortcut:"Mod-]"},{label:"Decrease Indent",command:"decreaseIndent",type:"button",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M3 4h18v2H3V4zm0 14h18v2H3v-2zm8-7h10v2H11v-2zm0 4h10v2H11v-2zM7 8v8l-4-4 4-4z"/></svg>',shortcut:"Mod-["}],commands:{increaseIndent:b,decreaseIndent:v},keymap:{"Mod-]":"increaseIndent","Mod-[":"decreaseIndent",Tab:"increaseIndent","Shift-Tab":"decreaseIndent"}});exports.IndentPlugin=w;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=40,s=e=>["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"].includes(e.tagName)&&e.getAttribute("contenteditable")!=="true",E=()=>{const e=window.getSelection();if(e&&e.rangeCount>0){let t=e.getRangeAt(0).startContainer;for(;t&&t!==document.body;){if(t.nodeType===Node.ELEMENT_NODE){const o=t;if(o.getAttribute("contenteditable")==="true")return o}t=t.parentNode}}const n=document.activeElement;if(n){if(n.getAttribute("contenteditable")==="true")return n;const t=n.closest('[contenteditable="true"]');if(t)return t}return document.querySelector('[contenteditable="true"]')},l=e=>{let n=e;if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(s(t))return t}for(;n;){if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(s(t))return t;if(t.getAttribute("contenteditable")==="true")break}n=n.parentNode}return null},p=(e,n)=>{const t=[],o=new Set,c=r=>{!r||o.has(r)||n.contains(r)&&s(r)&&(o.add(r),t.push(r))};if(e.collapsed)return c(l(e.startContainer)),t;const i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r;if(!s(a))return NodeFilter.FILTER_SKIP;if(typeof e.intersectsNode=="function")return e.intersectsNode(a)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP;const u=document.createRange();return u.selectNodeContents(a),e.compareBoundaryPoints(Range.END_TO_START,u)>0&&e.compareBoundaryPoints(Range.START_TO_END,u)<0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let d=i.nextNode();for(;d;)c(d),d=i.nextNode();return t.length===0&&c(l(e.commonAncestorContainer)),t},h=e=>{const n=window.getComputedStyle(e),t=n.paddingLeft;if(t.endsWith("px"))return parseFloat(t);if(t.endsWith("em")){const o=parseFloat(n.fontSize);return parseFloat(t)*o}return 0},T=(e,n)=>{if(n===e.innerHTML)return;const t=window.execEditorCommand||window.executeEditorCommand;if(typeof t=="function")try{t("recordDomTransaction",e,n,e.innerHTML)}catch{}},b=()=>{const e=E();if(!e)return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const t=n.getRangeAt(0);if(!e.contains(t.commonAncestorContainer))return!1;const o=p(t,e);if(o.length===0)return!1;const c=e.innerHTML;return o.forEach(i=>{const r=h(i)+m;i.style.paddingLeft=`${r}px`}),T(e,c),e.dispatchEvent(new Event("input",{bubbles:!0})),!0},v=()=>{const e=E();if(!e)return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const t=n.getRangeAt(0);if(!e.contains(t.commonAncestorContainer))return!1;const o=p(t,e);if(o.length===0)return!1;const c=e.innerHTML;return o.forEach(i=>{const d=h(i),r=Math.max(0,d-m);i.style.paddingLeft=`${r}px`}),T(e,c),e.dispatchEvent(new Event("input",{bubbles:!0})),!0},f=(e,n)=>{typeof window<"u"&&window.registerEditorCommand?.(e,n)},g=()=>{f("increaseIndent",b),f("decreaseIndent",v)};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g());const w=()=>({name:"indent",toolbar:[{label:"Increase Indent",command:"increaseIndent",type:"button",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M3 4h18v2H3V4zm0 14h18v2H3v-2zm8-7h10v2H11v-2zm0 4h10v2H11v-2zM3 8l4 4-4 4V8z"/></svg>',shortcut:"Mod-]"},{label:"Decrease Indent",command:"decreaseIndent",type:"button",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M3 4h18v2H3V4zm0 14h18v2H3v-2zm8-7h10v2H11v-2zm0 4h10v2H11v-2zM7 8v8l-4-4 4-4z"/></svg>',shortcut:"Mod-["}],commands:{increaseIndent:b,decreaseIndent:v},keymap:{"Mod-]":"increaseIndent","Mod-[":"decreaseIndent",Tab:"increaseIndent","Shift-Tab":"decreaseIndent"}});exports.IndentPlugin=w;
@@ -16,8 +16,7 @@ const s = (e) => ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "LI", "BLOCKQU
16
16
  if (n.getAttribute("contenteditable") === "true")
17
17
  return n;
18
18
  const t = n.closest('[contenteditable="true"]');
19
- if (t)
20
- return t;
19
+ if (t) return t;
21
20
  }
22
21
  return document.querySelector('[contenteditable="true"]');
23
22
  }, l = (e) => {
@@ -50,8 +49,7 @@ const s = (e) => ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "LI", "BLOCKQU
50
49
  {
51
50
  acceptNode: (r) => {
52
51
  const a = r;
53
- if (!s(a))
54
- return NodeFilter.FILTER_SKIP;
52
+ if (!s(a)) return NodeFilter.FILTER_SKIP;
55
53
  if (typeof e.intersectsNode == "function")
56
54
  return e.intersectsNode(a) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
57
55
  const u = document.createRange();
@@ -73,8 +71,7 @@ const s = (e) => ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "LI", "BLOCKQU
73
71
  }
74
72
  return 0;
75
73
  }, p = (e, n) => {
76
- if (n === e.innerHTML)
77
- return;
74
+ if (n === e.innerHTML) return;
78
75
  const t = window.execEditorCommand || window.executeEditorCommand;
79
76
  if (typeof t == "function")
80
77
  try {
@@ -83,17 +80,13 @@ const s = (e) => ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "LI", "BLOCKQU
83
80
  }
84
81
  }, h = () => {
85
82
  const e = m();
86
- if (!e)
87
- return !1;
83
+ if (!e) return !1;
88
84
  const n = window.getSelection();
89
- if (!n || n.rangeCount === 0)
90
- return !1;
85
+ if (!n || n.rangeCount === 0) return !1;
91
86
  const t = n.getRangeAt(0);
92
- if (!e.contains(t.commonAncestorContainer))
93
- return !1;
87
+ if (!e.contains(t.commonAncestorContainer)) return !1;
94
88
  const o = E(t, e);
95
- if (o.length === 0)
96
- return !1;
89
+ if (o.length === 0) return !1;
97
90
  const c = e.innerHTML;
98
91
  return o.forEach((i) => {
99
92
  const r = T(i) + 40;
@@ -101,25 +94,20 @@ const s = (e) => ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "LI", "BLOCKQU
101
94
  }), p(e, c), e.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
102
95
  }, N = () => {
103
96
  const e = m();
104
- if (!e)
105
- return !1;
97
+ if (!e) return !1;
106
98
  const n = window.getSelection();
107
- if (!n || n.rangeCount === 0)
108
- return !1;
99
+ if (!n || n.rangeCount === 0) return !1;
109
100
  const t = n.getRangeAt(0);
110
- if (!e.contains(t.commonAncestorContainer))
111
- return !1;
101
+ if (!e.contains(t.commonAncestorContainer)) return !1;
112
102
  const o = E(t, e);
113
- if (o.length === 0)
114
- return !1;
103
+ if (o.length === 0) return !1;
115
104
  const c = e.innerHTML;
116
105
  return o.forEach((i) => {
117
106
  const d = T(i), r = Math.max(0, d - 40);
118
107
  i.style.paddingLeft = `${r}px`;
119
108
  }), p(e, c), e.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
120
109
  }, f = (e, n) => {
121
- var t;
122
- typeof window < "u" && ((t = window.registerEditorCommand) == null || t.call(window, e, n));
110
+ typeof window < "u" && window.registerEditorCommand?.(e, n);
123
111
  }, g = () => {
124
112
  f("increaseIndent", h), f("decreaseIndent", N);
125
113
  };
@@ -1,5 +1,5 @@
1
- import { getGlobalApiConfig as s, buildApiUrl as u, getGlobalApiHeaders as p } from "./shared-config.esm.js";
2
- const g = () => ({
1
+ import { getGlobalApiConfig as d, buildApiUrl as s, getGlobalApiHeaders as u } from "./shared-config.esm.js";
2
+ const m = () => ({
3
3
  name: "document-manager",
4
4
  toolbar: [
5
5
  {
@@ -23,94 +23,93 @@ const g = () => ({
23
23
  ],
24
24
  commands: {
25
25
  importWord: () => {
26
- const a = () => {
27
- const e = window.getSelection();
28
- if (e && e.rangeCount > 0) {
29
- let r = e.getRangeAt(0).startContainer;
30
- for (; r && r !== document.body; ) {
31
- if (r.nodeType === Node.ELEMENT_NODE) {
32
- const i = r;
26
+ const r = () => {
27
+ const o = window.getSelection();
28
+ if (o && o.rangeCount > 0) {
29
+ let a = o.getRangeAt(0).startContainer;
30
+ for (; a && a !== document.body; ) {
31
+ if (a.nodeType === Node.ELEMENT_NODE) {
32
+ const i = a;
33
33
  if (i.getAttribute("contenteditable") === "true")
34
34
  return i;
35
35
  }
36
- r = r.parentNode;
36
+ a = a.parentNode;
37
37
  }
38
38
  }
39
39
  const n = document.activeElement;
40
- if ((n == null ? void 0 : n.getAttribute("contenteditable")) === "true")
40
+ if (n?.getAttribute("contenteditable") === "true")
41
41
  return n;
42
- const o = n == null ? void 0 : n.closest('[contenteditable="true"]');
43
- return o || document.querySelector('[contenteditable="true"]');
44
- }, t = document.createElement("input");
45
- return t.type = "file", t.accept = ".docx", t.onchange = async (e) => {
46
- var o;
47
- const n = (o = e.target.files) == null ? void 0 : o[0];
42
+ const t = n?.closest('[contenteditable="true"]');
43
+ return t || document.querySelector('[contenteditable="true"]');
44
+ }, e = document.createElement("input");
45
+ return e.type = "file", e.accept = ".docx", e.onchange = async (o) => {
46
+ const n = o.target.files?.[0];
48
47
  if (n)
49
48
  try {
50
- const r = a();
51
- if (r) {
52
- const { importFromWord: i } = await import("./documentManager-25b6203c.mjs"), c = await i(n);
53
- r.innerHTML = c, r.dispatchEvent(new Event("input", { bubbles: !0 }));
49
+ const t = r();
50
+ if (t) {
51
+ const { importFromWord: a } = await import("./documentManager-CTqRftU8.mjs"), i = await a(n);
52
+ t.innerHTML = i, t.dispatchEvent(new Event("input", { bubbles: !0 }));
54
53
  }
55
- } catch (r) {
56
- console.error("Import failed:", r), alert("Failed to import Word document. Please check the console for details.");
54
+ } catch (t) {
55
+ console.error("Import failed:", t), alert("Failed to import Word document. Please check the console for details.");
57
56
  }
58
- }, t.click(), !0;
57
+ }, e.click(), !0;
59
58
  },
60
59
  exportWord: async () => {
61
- const a = () => {
62
- const t = window.getSelection();
63
- if (t && t.rangeCount > 0) {
64
- let o = t.getRangeAt(0).startContainer;
65
- for (; o && o !== document.body; ) {
66
- if (o.nodeType === Node.ELEMENT_NODE && o.getAttribute("contenteditable") === "true")
67
- return o;
68
- o = o.parentNode;
60
+ const r = () => {
61
+ const e = window.getSelection();
62
+ if (e && e.rangeCount > 0) {
63
+ let t = e.getRangeAt(0).startContainer;
64
+ for (; t && t !== document.body; ) {
65
+ if (t.nodeType === Node.ELEMENT_NODE && t.getAttribute("contenteditable") === "true")
66
+ return t;
67
+ t = t.parentNode;
69
68
  }
70
69
  }
71
- const e = document.activeElement;
72
- return (e == null ? void 0 : e.getAttribute("contenteditable")) === "true" ? e : (e == null ? void 0 : e.closest('[contenteditable="true"]')) || document.querySelector('[contenteditable="true"]');
70
+ const o = document.activeElement;
71
+ return o?.getAttribute("contenteditable") === "true" ? o : o?.closest('[contenteditable="true"]') || document.querySelector('[contenteditable="true"]');
73
72
  };
74
73
  try {
75
- const t = a();
76
- if (t) {
77
- const e = t.innerHTML, { exportToWord: n } = await import("./documentManager-25b6203c.mjs");
78
- await n(e, "document.docx");
74
+ const e = r();
75
+ if (e) {
76
+ const o = e.innerHTML, { exportToWord: n } = await import("./documentManager-CTqRftU8.mjs");
77
+ await n(o, "document.docx");
79
78
  }
80
79
  return !0;
81
- } catch (t) {
82
- return console.error("Export failed:", t), alert("Failed to export to Word. Please check the console for details."), !1;
80
+ } catch (e) {
81
+ return console.error("Export failed:", e), alert("Failed to export to Word. Please check the console for details."), !1;
83
82
  }
84
83
  },
85
84
  exportPdf: async () => {
86
- const a = () => {
87
- const t = window.getSelection();
88
- if (t && t.rangeCount > 0) {
89
- let o = t.getRangeAt(0).startContainer;
90
- for (; o && o !== document.body; ) {
91
- if (o.nodeType === Node.ELEMENT_NODE && o.getAttribute("contenteditable") === "true")
92
- return o;
93
- o = o.parentNode;
85
+ const r = () => {
86
+ const e = window.getSelection();
87
+ if (e && e.rangeCount > 0) {
88
+ let t = e.getRangeAt(0).startContainer;
89
+ for (; t && t !== document.body; ) {
90
+ if (t.nodeType === Node.ELEMENT_NODE && t.getAttribute("contenteditable") === "true")
91
+ return t;
92
+ t = t.parentNode;
94
93
  }
95
94
  }
96
- const e = document.activeElement;
97
- return (e == null ? void 0 : e.getAttribute("contenteditable")) === "true" ? e : (e == null ? void 0 : e.closest('[contenteditable="true"]')) || document.querySelector('[contenteditable="true"]');
95
+ const o = document.activeElement;
96
+ return o?.getAttribute("contenteditable") === "true" ? o : o?.closest('[contenteditable="true"]') || document.querySelector('[contenteditable="true"]');
98
97
  };
99
98
  try {
100
- const t = a();
101
- if (t) {
102
- const e = t.innerHTML, { exportToPdf: n } = await import("./documentManager-25b6203c.mjs");
103
- await n(e, "document.pdf", t);
99
+ const e = r();
100
+ if (e) {
101
+ const o = e.innerHTML, { exportToPdf: n } = await import("./documentManager-CTqRftU8.mjs");
102
+ await n(o, "document.pdf", e);
104
103
  } else
105
104
  console.error("PDF Export: No editor element found"), alert("No active editor found. Please click in the editor area first.");
106
105
  return !0;
107
- } catch (t) {
108
- return console.error("PDF Export: Export failed:", t), alert("Failed to export to PDF. Please check the console for details."), !1;
106
+ } catch (e) {
107
+ return console.error("PDF Export: Export failed:", e), alert("Failed to export to PDF. Please check the console for details."), !1;
109
108
  }
110
109
  }
111
110
  },
112
111
  keymap: {}
113
- }), h = {
112
+ }), p = {
114
113
  apiEndpoints: {
115
114
  exportWord: "/documents/export-word"
116
115
  },
@@ -122,25 +121,25 @@ const g = () => ({
122
121
  useClientSideFallback: !0
123
122
  // Enable fallback by default
124
123
  };
125
- let l = { ...h };
126
- function m(a) {
127
- l = { ...l, ...a };
124
+ let l = { ...p };
125
+ function f(r) {
126
+ l = { ...l, ...r };
128
127
  }
129
- function d() {
128
+ function c() {
130
129
  return { ...l };
131
130
  }
132
- function v(a) {
133
- const t = d(), e = s(), n = t.apiUrl || e.apiUrl;
134
- return u(n, t.apiEndpoints[a]);
131
+ function v(r) {
132
+ const e = c(), o = d(), n = e.apiUrl || o.apiUrl;
133
+ return s(n, e.apiEndpoints[r]);
135
134
  }
136
- function b() {
137
- const a = p(), e = d().headers || {};
138
- return { ...a, ...e };
135
+ function g() {
136
+ const r = u(), o = c().headers || {};
137
+ return { ...r, ...o };
139
138
  }
140
139
  export {
141
- g as D,
140
+ m as D,
142
141
  v as a,
143
- b,
144
- d as g,
145
- m as s
142
+ g as b,
143
+ c as g,
144
+ f as s
146
145
  };