@editora/plugins 1.0.10 → 1.0.12

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 (139) hide show
  1. package/README.md +1 -1
  2. package/dist/_commonjsHelpers-BH3jXuIh.js +1 -0
  3. package/dist/_commonjsHelpers-ByX85dGu.mjs +33 -0
  4. package/dist/a11y-checker.cjs.js +12 -12
  5. package/dist/a11y-checker.esm.js +80 -98
  6. package/dist/anchor.cjs.js +12 -12
  7. package/dist/anchor.esm.js +115 -128
  8. package/dist/anchoredPopover-BzqGPOAE.js +1 -0
  9. package/dist/anchoredPopover-Dts0IrgU.mjs +106 -0
  10. package/dist/approval-workflow.cjs.js +40 -40
  11. package/dist/approval-workflow.esm.js +208 -249
  12. package/dist/background-color.cjs.js +2 -2
  13. package/dist/background-color.esm.js +55 -68
  14. package/dist/blockquote.esm.js +1 -2
  15. package/dist/blocks-library.cjs.js +45 -45
  16. package/dist/blocks-library.esm.js +178 -245
  17. package/dist/capitalization.esm.js +1 -2
  18. package/dist/checklist.cjs.js +1 -1
  19. package/dist/checklist.esm.js +58 -82
  20. package/dist/citations.cjs.js +37 -37
  21. package/dist/citations.esm.js +439 -512
  22. package/dist/clear-formatting.cjs.js +1 -1
  23. package/dist/clear-formatting.esm.js +27 -33
  24. package/dist/code-sample.cjs.js +14 -14
  25. package/dist/code-sample.esm.js +82 -93
  26. package/dist/code.cjs.js +119 -42
  27. package/dist/code.esm.js +2560 -760
  28. package/dist/comments.cjs.js +6 -6
  29. package/dist/comments.esm.js +116 -158
  30. package/dist/conditional-content.cjs.js +90 -90
  31. package/dist/conditional-content.esm.js +371 -432
  32. package/dist/content-rules.cjs.js +7 -7
  33. package/dist/content-rules.esm.js +105 -159
  34. package/dist/data-binding.cjs.js +46 -46
  35. package/dist/data-binding.esm.js +328 -368
  36. package/dist/direction.esm.js +9 -18
  37. package/dist/doc-schema.cjs.js +29 -29
  38. package/dist/doc-schema.esm.js +240 -308
  39. package/dist/document-manager.cjs.js +1 -1
  40. package/dist/document-manager.esm.js +4 -5
  41. package/dist/documentManager-CTqRftU8.mjs +8369 -0
  42. package/dist/documentManager-Jf0RbSks.js +17 -0
  43. package/dist/{editorContainerHelpers-69585c07.mjs → editorContainerHelpers-C7kdWnS0.mjs} +1 -2
  44. package/dist/embed-iframe.cjs.js +4 -4
  45. package/dist/embed-iframe.esm.js +73 -81
  46. package/dist/emojis.cjs.js +8 -8
  47. package/dist/emojis.esm.js +65 -77
  48. package/dist/enterprise.cjs.js +1 -1
  49. package/dist/enterprise.esm.js +54 -56
  50. package/dist/font-family.cjs.js +1 -1
  51. package/dist/font-family.esm.js +39 -47
  52. package/dist/font-size.cjs.js +1 -1
  53. package/dist/font-size.esm.js +37 -53
  54. package/dist/footnote.cjs.js +2 -2
  55. package/dist/footnote.esm.js +76 -117
  56. package/dist/history.cjs.js +1 -1
  57. package/dist/history.esm.js +70 -92
  58. package/dist/html2canvas.esm-B5qzocYs.js +5 -0
  59. package/dist/{html2canvas.esm-1a1724a1.mjs → html2canvas.esm-BWVIUcAF.mjs} +141 -225
  60. package/dist/indent.cjs.js +1 -1
  61. package/dist/indent.esm.js +12 -24
  62. package/dist/{index-f04538f2.mjs → index-BFsKNTTj.mjs} +70 -71
  63. package/dist/index-CvJk4DKa.js +221 -0
  64. package/dist/index-D3CycEFU.mjs +16543 -0
  65. package/dist/index-tqLTHcO6.js +1 -0
  66. package/dist/index.cjs.js +1 -1
  67. package/dist/index.es-CE_A4QSm.js +5 -0
  68. package/dist/index.es-DQ78mYYo.mjs +6665 -0
  69. package/dist/index.esm.js +125 -128
  70. package/dist/italic.cjs.js +1 -1
  71. package/dist/italic.esm.js +8 -9
  72. package/dist/jspdf.es.min-BoS80556.js +77 -0
  73. package/dist/{jspdf.es.min-c36a4fd8.mjs → jspdf.es.min-DQCoX5yh.mjs} +3658 -4682
  74. package/dist/line-height.cjs.js +1 -1
  75. package/dist/line-height.esm.js +11 -24
  76. package/dist/link.cjs.js +5 -5
  77. package/dist/link.esm.js +24 -30
  78. package/dist/list.cjs.js +1 -1
  79. package/dist/list.esm.js +20 -25
  80. package/dist/lite.cjs.js +1 -1
  81. package/dist/lite.esm.js +59 -61
  82. package/dist/math.cjs.js +21 -21
  83. package/dist/math.esm.js +139 -146
  84. package/dist/media-manager.cjs.js +31 -31
  85. package/dist/media-manager.esm.js +285 -300
  86. package/dist/mentions.cjs.js +9 -9
  87. package/dist/mentions.esm.js +238 -286
  88. package/dist/merge-tag.cjs.js +2 -2
  89. package/dist/merge-tag.esm.js +177 -216
  90. package/dist/page-break.cjs.js +2 -2
  91. package/dist/page-break.esm.js +33 -49
  92. package/dist/pii-redaction.cjs.js +19 -19
  93. package/dist/pii-redaction.esm.js +393 -463
  94. package/dist/plugins.css +1 -0
  95. package/dist/preview.esm.js +5 -10
  96. package/dist/print.cjs.js +4 -4
  97. package/dist/print.esm.js +17 -20
  98. package/dist/{purify.es-35a15df8.mjs → purify.es-DHhaBdbu.mjs} +9 -19
  99. package/dist/{purify.es-a8d731c6.js → purify.es-T2a3nLiC.js} +1 -1
  100. package/dist/slash-commands.cjs.js +2 -2
  101. package/dist/slash-commands.esm.js +39 -75
  102. package/dist/smart-paste.cjs.js +27 -27
  103. package/dist/smart-paste.esm.js +280 -336
  104. package/dist/special-characters.cjs.js +7 -7
  105. package/dist/special-characters.esm.js +61 -69
  106. package/dist/spell-check.cjs.js +5 -5
  107. package/dist/spell-check.esm.js +97 -123
  108. package/dist/strikethrough.cjs.js +1 -1
  109. package/dist/strikethrough.esm.js +14 -19
  110. package/dist/table.cjs.js +4 -4
  111. package/dist/table.esm.js +191 -225
  112. package/dist/template.cjs.js +21 -20
  113. package/dist/template.esm.js +715 -196
  114. package/dist/text-alignment.cjs.js +1 -1
  115. package/dist/text-alignment.esm.js +21 -27
  116. package/dist/text-color.cjs.js +3 -3
  117. package/dist/text-color.esm.js +70 -87
  118. package/dist/track-changes.cjs.js +2 -2
  119. package/dist/track-changes.esm.js +100 -162
  120. package/dist/translation-workflow.cjs.js +74 -74
  121. package/dist/translation-workflow.esm.js +602 -678
  122. package/dist/version-diff.cjs.js +14 -14
  123. package/dist/version-diff.esm.js +128 -157
  124. package/package.json +1 -1
  125. package/dist/_commonjsHelpers-6763f629.js +0 -1
  126. package/dist/_commonjsHelpers-c5d32002.mjs +0 -30
  127. package/dist/anchoredPopover-33f1358d.mjs +0 -109
  128. package/dist/anchoredPopover-8151d535.js +0 -1
  129. package/dist/documentManager-25b6203c.mjs +0 -9122
  130. package/dist/documentManager-b69e7054.js +0 -17
  131. package/dist/html2canvas.esm-09133e29.js +0 -22
  132. package/dist/index-656d224b.js +0 -231
  133. package/dist/index-6a8c48bb.js +0 -1
  134. package/dist/index-d027b7e2.mjs +0 -16859
  135. package/dist/index.es-730f2d98.mjs +0 -5775
  136. package/dist/index.es-dd40173b.js +0 -18
  137. package/dist/jspdf.es.min-90db2c97.js +0 -243
  138. package/dist/style.css +0 -1
  139. /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
  };