@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.
- package/README.md +1 -1
- package/dist/_commonjsHelpers-BH3jXuIh.js +1 -0
- package/dist/_commonjsHelpers-ByX85dGu.mjs +33 -0
- package/dist/a11y-checker.cjs.js +12 -12
- package/dist/a11y-checker.esm.js +80 -98
- package/dist/anchor.cjs.js +12 -12
- package/dist/anchor.esm.js +115 -128
- package/dist/anchoredPopover-BzqGPOAE.js +1 -0
- package/dist/anchoredPopover-Dts0IrgU.mjs +106 -0
- package/dist/approval-workflow.cjs.js +40 -40
- package/dist/approval-workflow.esm.js +208 -249
- package/dist/background-color.cjs.js +2 -2
- package/dist/background-color.esm.js +55 -68
- package/dist/blockquote.esm.js +1 -2
- package/dist/blocks-library.cjs.js +45 -45
- package/dist/blocks-library.esm.js +178 -245
- package/dist/capitalization.esm.js +1 -2
- package/dist/checklist.cjs.js +1 -1
- package/dist/checklist.esm.js +58 -82
- package/dist/citations.cjs.js +37 -37
- package/dist/citations.esm.js +439 -512
- package/dist/clear-formatting.cjs.js +1 -1
- package/dist/clear-formatting.esm.js +27 -33
- package/dist/code-sample.cjs.js +14 -14
- package/dist/code-sample.esm.js +82 -93
- package/dist/code.cjs.js +119 -42
- package/dist/code.esm.js +2560 -760
- package/dist/comments.cjs.js +6 -6
- package/dist/comments.esm.js +116 -158
- package/dist/conditional-content.cjs.js +90 -90
- package/dist/conditional-content.esm.js +371 -432
- package/dist/content-rules.cjs.js +7 -7
- package/dist/content-rules.esm.js +105 -159
- package/dist/data-binding.cjs.js +46 -46
- package/dist/data-binding.esm.js +328 -368
- package/dist/direction.esm.js +9 -18
- package/dist/doc-schema.cjs.js +29 -29
- package/dist/doc-schema.esm.js +240 -308
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +4 -5
- package/dist/documentManager-CTqRftU8.mjs +8369 -0
- package/dist/documentManager-Jf0RbSks.js +17 -0
- package/dist/{editorContainerHelpers-69585c07.mjs → editorContainerHelpers-C7kdWnS0.mjs} +1 -2
- package/dist/embed-iframe.cjs.js +4 -4
- package/dist/embed-iframe.esm.js +73 -81
- package/dist/emojis.cjs.js +8 -8
- package/dist/emojis.esm.js +65 -77
- package/dist/enterprise.cjs.js +1 -1
- package/dist/enterprise.esm.js +54 -56
- package/dist/font-family.cjs.js +1 -1
- package/dist/font-family.esm.js +39 -47
- package/dist/font-size.cjs.js +1 -1
- package/dist/font-size.esm.js +37 -53
- package/dist/footnote.cjs.js +2 -2
- package/dist/footnote.esm.js +76 -117
- package/dist/history.cjs.js +1 -1
- package/dist/history.esm.js +70 -92
- package/dist/html2canvas.esm-B5qzocYs.js +5 -0
- package/dist/{html2canvas.esm-1a1724a1.mjs → html2canvas.esm-BWVIUcAF.mjs} +141 -225
- package/dist/indent.cjs.js +1 -1
- package/dist/indent.esm.js +12 -24
- package/dist/{index-f04538f2.mjs → index-BFsKNTTj.mjs} +70 -71
- package/dist/index-CvJk4DKa.js +221 -0
- package/dist/index-D3CycEFU.mjs +16543 -0
- package/dist/index-tqLTHcO6.js +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es-CE_A4QSm.js +5 -0
- package/dist/index.es-DQ78mYYo.mjs +6665 -0
- package/dist/index.esm.js +125 -128
- package/dist/italic.cjs.js +1 -1
- package/dist/italic.esm.js +8 -9
- package/dist/jspdf.es.min-BoS80556.js +77 -0
- package/dist/{jspdf.es.min-c36a4fd8.mjs → jspdf.es.min-DQCoX5yh.mjs} +3658 -4682
- package/dist/line-height.cjs.js +1 -1
- package/dist/line-height.esm.js +11 -24
- package/dist/link.cjs.js +5 -5
- package/dist/link.esm.js +24 -30
- package/dist/list.cjs.js +1 -1
- package/dist/list.esm.js +20 -25
- package/dist/lite.cjs.js +1 -1
- package/dist/lite.esm.js +59 -61
- package/dist/math.cjs.js +21 -21
- package/dist/math.esm.js +139 -146
- package/dist/media-manager.cjs.js +31 -31
- package/dist/media-manager.esm.js +285 -300
- package/dist/mentions.cjs.js +9 -9
- package/dist/mentions.esm.js +238 -286
- package/dist/merge-tag.cjs.js +2 -2
- package/dist/merge-tag.esm.js +177 -216
- package/dist/page-break.cjs.js +2 -2
- package/dist/page-break.esm.js +33 -49
- package/dist/pii-redaction.cjs.js +19 -19
- package/dist/pii-redaction.esm.js +393 -463
- package/dist/plugins.css +1 -0
- package/dist/preview.esm.js +5 -10
- package/dist/print.cjs.js +4 -4
- package/dist/print.esm.js +17 -20
- package/dist/{purify.es-35a15df8.mjs → purify.es-DHhaBdbu.mjs} +9 -19
- package/dist/{purify.es-a8d731c6.js → purify.es-T2a3nLiC.js} +1 -1
- package/dist/slash-commands.cjs.js +2 -2
- package/dist/slash-commands.esm.js +39 -75
- package/dist/smart-paste.cjs.js +27 -27
- package/dist/smart-paste.esm.js +280 -336
- package/dist/special-characters.cjs.js +7 -7
- package/dist/special-characters.esm.js +61 -69
- package/dist/spell-check.cjs.js +5 -5
- package/dist/spell-check.esm.js +97 -123
- package/dist/strikethrough.cjs.js +1 -1
- package/dist/strikethrough.esm.js +14 -19
- package/dist/table.cjs.js +4 -4
- package/dist/table.esm.js +191 -225
- package/dist/template.cjs.js +21 -20
- package/dist/template.esm.js +715 -196
- package/dist/text-alignment.cjs.js +1 -1
- package/dist/text-alignment.esm.js +21 -27
- package/dist/text-color.cjs.js +3 -3
- package/dist/text-color.esm.js +70 -87
- package/dist/track-changes.cjs.js +2 -2
- package/dist/track-changes.esm.js +100 -162
- package/dist/translation-workflow.cjs.js +74 -74
- package/dist/translation-workflow.esm.js +602 -678
- package/dist/version-diff.cjs.js +14 -14
- package/dist/version-diff.esm.js +128 -157
- package/package.json +1 -1
- package/dist/_commonjsHelpers-6763f629.js +0 -1
- package/dist/_commonjsHelpers-c5d32002.mjs +0 -30
- package/dist/anchoredPopover-33f1358d.mjs +0 -109
- package/dist/anchoredPopover-8151d535.js +0 -1
- package/dist/documentManager-25b6203c.mjs +0 -9122
- package/dist/documentManager-b69e7054.js +0 -17
- package/dist/html2canvas.esm-09133e29.js +0 -22
- package/dist/index-656d224b.js +0 -231
- package/dist/index-6a8c48bb.js +0 -1
- package/dist/index-d027b7e2.mjs +0 -16859
- package/dist/index.es-730f2d98.mjs +0 -5775
- package/dist/index.es-dd40173b.js +0 -18
- package/dist/jspdf.es.min-90db2c97.js +0 -243
- package/dist/style.css +0 -1
- /package/dist/{editorContainerHelpers-36b8ddf3.js → editorContainerHelpers-CFbfiOJI.js} +0 -0
package/dist/indent.cjs.js
CHANGED
|
@@ -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)=>{
|
|
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;
|
package/dist/indent.esm.js
CHANGED
|
@@ -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
|
-
|
|
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
|
|
2
|
-
const
|
|
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
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
let
|
|
30
|
-
for (;
|
|
31
|
-
if (
|
|
32
|
-
const i =
|
|
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
|
-
|
|
36
|
+
a = a.parentNode;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
const n = document.activeElement;
|
|
40
|
-
if (
|
|
40
|
+
if (n?.getAttribute("contenteditable") === "true")
|
|
41
41
|
return n;
|
|
42
|
-
const
|
|
43
|
-
return
|
|
44
|
-
},
|
|
45
|
-
return
|
|
46
|
-
|
|
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
|
|
51
|
-
if (
|
|
52
|
-
const { importFromWord:
|
|
53
|
-
|
|
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 (
|
|
56
|
-
console.error("Import failed:",
|
|
54
|
+
} catch (t) {
|
|
55
|
+
console.error("Import failed:", t), alert("Failed to import Word document. Please check the console for details.");
|
|
57
56
|
}
|
|
58
|
-
},
|
|
57
|
+
}, e.click(), !0;
|
|
59
58
|
},
|
|
60
59
|
exportWord: async () => {
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
let
|
|
65
|
-
for (;
|
|
66
|
-
if (
|
|
67
|
-
return
|
|
68
|
-
|
|
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
|
|
72
|
-
return
|
|
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
|
|
76
|
-
if (
|
|
77
|
-
const
|
|
78
|
-
await n(
|
|
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 (
|
|
82
|
-
return console.error("Export failed:",
|
|
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
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
89
|
-
let
|
|
90
|
-
for (;
|
|
91
|
-
if (
|
|
92
|
-
return
|
|
93
|
-
|
|
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
|
|
97
|
-
return
|
|
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
|
|
101
|
-
if (
|
|
102
|
-
const
|
|
103
|
-
await n(
|
|
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 (
|
|
108
|
-
return console.error("PDF Export: Export failed:",
|
|
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
|
-
}),
|
|
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 = { ...
|
|
126
|
-
function
|
|
127
|
-
l = { ...l, ...
|
|
124
|
+
let l = { ...p };
|
|
125
|
+
function f(r) {
|
|
126
|
+
l = { ...l, ...r };
|
|
128
127
|
}
|
|
129
|
-
function
|
|
128
|
+
function c() {
|
|
130
129
|
return { ...l };
|
|
131
130
|
}
|
|
132
|
-
function v(
|
|
133
|
-
const
|
|
134
|
-
return
|
|
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
|
|
137
|
-
const
|
|
138
|
-
return { ...
|
|
135
|
+
function g() {
|
|
136
|
+
const r = u(), o = c().headers || {};
|
|
137
|
+
return { ...r, ...o };
|
|
139
138
|
}
|
|
140
139
|
export {
|
|
141
|
-
|
|
140
|
+
m as D,
|
|
142
141
|
v as a,
|
|
143
|
-
b,
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
g as b,
|
|
143
|
+
c as g,
|
|
144
|
+
f as s
|
|
146
145
|
};
|