@editora/core 1.0.9 → 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.
- package/README.md +1 -1
- package/dist/{A11yCheckerPlugin.native-58d12bed.mjs → A11yCheckerPlugin.native-BRdGYMju.mjs} +12 -23
- package/dist/{AnchorPlugin.native-289a112a.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +102 -112
- package/dist/{ApprovalWorkflowPlugin.native-449ce66c.mjs → ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs} +173 -209
- package/dist/{BackgroundColorPlugin.native-8aceb5cc.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +9 -16
- package/dist/BlockquotePlugin.native-57_Xcjl1.mjs +212 -0
- package/dist/{BlocksLibraryPlugin.native-1cc51e63.mjs → BlocksLibraryPlugin.native-5sdsXsiE.mjs} +149 -205
- package/dist/{BoldPlugin.native-f9d7f8e4.mjs → BoldPlugin.native-CSh_LiIJ.mjs} +11 -7
- package/dist/CapitalizationPlugin.native-DLV4oPmB.mjs +159 -0
- package/dist/ChecklistPlugin.native-BS-kMz9O.mjs +371 -0
- package/dist/{CitationsPlugin.native-169fb1e8.mjs → CitationsPlugin.native-DQgoCd1B.mjs} +196 -261
- package/dist/ClearFormattingPlugin.native-DIS6AN2t.mjs +172 -0
- package/dist/CodePlugin.native-veDC_kx5.mjs +4600 -0
- package/dist/{CodeSamplePlugin.native-6cc0148e.mjs → CodeSamplePlugin.native-CgGoH-X4.mjs} +10 -19
- package/dist/{CommentsPlugin.native-03659874.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +28 -55
- package/dist/{ConditionalContentPlugin.native-4983143a.mjs → ConditionalContentPlugin.native-CfhY46rU.mjs} +51 -108
- package/dist/{ContentRulesPlugin.native-63ed405b.mjs → ContentRulesPlugin.native-vPx5nC73.mjs} +153 -200
- package/dist/{DataBindingPlugin.native-427e9d75.mjs → DataBindingPlugin.native-BoXwghTz.mjs} +88 -124
- package/dist/DirectionPlugin.native-Bl-QLFzO.mjs +153 -0
- package/dist/{DocSchemaPlugin.native-8e41eda0.mjs → DocSchemaPlugin.native-DUSVRHqT.mjs} +112 -166
- package/dist/{DocumentManagerPlugin.native-e69895ad.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +4 -4
- package/dist/EmbedIframePlugin.native-BF_-LjTq.mjs +740 -0
- package/dist/{EmojisPlugin.native-65c5ac47.mjs → EmojisPlugin.native-CitxxlWX.mjs} +6 -11
- package/dist/{FontFamilyPlugin.native-f9bc255a.mjs → FontFamilyPlugin.native-j8hMTbg4.mjs} +4 -7
- package/dist/{FontSizePlugin.native-f5647872.mjs → FontSizePlugin.native-B_jCh7dY.mjs} +10 -19
- package/dist/{FootnotePlugin.native-494657b3.mjs → FootnotePlugin.native-D730OGRm.mjs} +39 -77
- package/dist/{FullscreenPlugin.native-87ce92e9.mjs → FullscreenPlugin.native-ChXyxeNw.mjs} +1 -1
- package/dist/HeadingPlugin.native-DZdvubrQ.mjs +249 -0
- package/dist/{HistoryPlugin.native-92ed4be4.mjs → HistoryPlugin.native-D2wl32jV.mjs} +107 -143
- package/dist/{IndentPlugin.native-e4ee902b.mjs → IndentPlugin.native-BHixp8sP.mjs} +12 -23
- package/dist/{ItalicPlugin.native-7c95cfbc.mjs → ItalicPlugin.native-CmnlwFHB.mjs} +15 -11
- package/dist/{LineHeightPlugin.native-5668f78c.mjs → LineHeightPlugin.native-CM7iXdQj.mjs} +10 -19
- package/dist/{LinkPlugin.native-6df29111.mjs → LinkPlugin.native-DYCIcdTm.mjs} +5 -9
- package/dist/{ListPlugin.native-fe2e115a.mjs → ListPlugin.native-V7EZC1lM.mjs} +5 -9
- package/dist/MathPlugin.native-NwWPHVmj.mjs +369 -0
- package/dist/{MediaManagerPlugin.native-3cf48a00.mjs → MediaManagerPlugin.native-eOsTJFpw.mjs} +11 -21
- package/dist/{MentionPlugin.native-3b1e8c05.mjs → MentionPlugin.native-BMDlOqur.mjs} +45 -89
- package/dist/MergeTagPlugin.native-BzRVoD9-.mjs +580 -0
- package/dist/{PIIRedactionPlugin.native-7ab10b9f.mjs → PIIRedactionPlugin.native-g7j4jOmm.mjs} +210 -260
- package/dist/{PageBreakPlugin.native-1794c5fb.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +16 -31
- package/dist/{PreviewPlugin.native-f7b67cc0.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +6 -11
- package/dist/{PrintPlugin.native-f6a168c2.mjs → PrintPlugin.native-7qt5v7L5.mjs} +3 -5
- package/dist/{SlashCommandsPlugin.native-8d45e511.mjs → SlashCommandsPlugin.native-BiN6ODw5.mjs} +36 -71
- package/dist/{SmartPastePlugin.native-a6c5efec.mjs → SmartPastePlugin.native-CZAEHkyt.mjs} +173 -219
- package/dist/{SpecialCharactersPlugin.native-7f06d4ba.mjs → SpecialCharactersPlugin.native-DaG4b19I.mjs} +101 -85
- package/dist/{SpellCheckPlugin.native-04e20834.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +21 -41
- package/dist/{StrikethroughPlugin.native-905e9501.mjs → StrikethroughPlugin.native-V0TL4F48.mjs} +12 -30
- package/dist/{TablePlugin.native-7d5458c1.mjs → TablePlugin.native-DrHX-efe.mjs} +30 -58
- package/dist/TemplatePlugin.native-DLjFUaPW.mjs +1150 -0
- package/dist/{TextAlignmentPlugin.native-9357b3ed.mjs → TextAlignmentPlugin.native-sM_1s00t.mjs} +6 -11
- package/dist/{TextColorPlugin.native-d53ed459.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +14 -26
- package/dist/{TrackChangesPlugin.native-e96da509.mjs → TrackChangesPlugin.native-Bghu2q4a.mjs} +58 -115
- package/dist/{TranslationWorkflowPlugin.native-4e711b1e.mjs → TranslationWorkflowPlugin.native-DdF16tgT.mjs} +191 -257
- package/dist/{UnderlinePlugin.native-8080c998.mjs → UnderlinePlugin.native-DZzg23rv.mjs} +8 -4
- package/dist/{VersionDiffPlugin.native-5bbeff85.mjs → VersionDiffPlugin.native-Bvxgy--t.mjs} +26 -51
- package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
- package/dist/{anchoredPopover-5cca53ba.mjs → anchoredPopover-Bxds0VoB.mjs} +1 -1
- package/dist/core.css +1 -0
- package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
- package/dist/{editorContainerHelpers-69585c07.mjs → editorContainerHelpers-C7kdWnS0.mjs} +2 -3
- package/dist/editora.min.js +13 -14
- package/dist/editora.umd.js +13 -14
- package/dist/{html2canvas.esm-c51cb3b9.mjs → html2canvas.esm-AYkPY5LS.mjs} +894 -978
- package/dist/index-BslAFzmv.mjs +16544 -0
- package/dist/index-CPMGUZfB.js +10 -0
- package/dist/{index-7da30697.mjs → index-DBoj6QfW.mjs} +127 -164
- package/dist/index.cjs.js +1 -1
- package/dist/index.es-BYD2KEo6.mjs +6666 -0
- package/dist/index.esm.js +7 -12
- package/dist/inlineFormatting-DJ0-NZtx.mjs +97 -0
- package/dist/{jspdf.es.min-780c82db.mjs → jspdf.es.min-BJGtOnRT.mjs} +3784 -4808
- package/dist/plugin-loader.js +67 -67
- package/dist/{purify.es-3bdbcfc5.mjs → purify.es-CKpwg8Tk.mjs} +10 -20
- package/dist/webcomponent-core.js +131 -168
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +147 -65
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +191 -228
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1248 -1346
- package/package.json +1 -1
- package/dist/BlockquotePlugin.native-3541c714.mjs +0 -49
- package/dist/CapitalizationPlugin.native-42c135dc.mjs +0 -80
- package/dist/ChecklistPlugin.native-3b397ee9.mjs +0 -330
- package/dist/ClearFormattingPlugin.native-77baa514.mjs +0 -145
- package/dist/CodePlugin.native-989cf0aa.mjs +0 -2740
- package/dist/DirectionPlugin.native-4e742f42.mjs +0 -139
- package/dist/EmbedIframePlugin.native-55209c87.mjs +0 -568
- package/dist/HeadingPlugin.native-e38c4a16.mjs +0 -64
- package/dist/MathPlugin.native-735bbac2.mjs +0 -296
- package/dist/MergeTagPlugin.native-31cf7d48.mjs +0 -584
- package/dist/TemplatePlugin.native-580f0f63.mjs +0 -617
- package/dist/_commonjsHelpers-69d58be2.mjs +0 -31
- package/dist/documentManager-8327fb6e.mjs +0 -9166
- package/dist/index-072ef022.js +0 -11
- package/dist/index-49d31221.mjs +0 -16860
- package/dist/index.es-b47a189f.mjs +0 -5782
- package/dist/style.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const v = ".rte-content, .editora-content", ee = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor",
|
|
1
|
+
const v = ".rte-content, .editora-content", ee = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", le = "__editoraCommandEditorRoot", ie = "rte-smart-paste-styles", u = "rte-smart-paste-panel", x = "smart-paste", E = "smartPaste", k = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', ke = typeof NodeFilter != "undefined" ? NodeFilter.SHOW_COMMENT : 128, ce = "__editoraSmartPasteHandled", Ce = /* @__PURE__ */ new Set([
|
|
2
2
|
"script",
|
|
3
3
|
"style",
|
|
4
4
|
"meta",
|
|
@@ -15,7 +15,7 @@ const v = ".rte-content, .editora-content", ee = "[data-editora-editor], .rte-ed
|
|
|
15
15
|
"textarea",
|
|
16
16
|
"select",
|
|
17
17
|
"option"
|
|
18
|
-
]),
|
|
18
|
+
]), Te = /* @__PURE__ */ new Set(["table", "thead", "tbody", "tfoot", "tr", "td", "th", "colgroup", "col"]), Ae = /* @__PURE__ */ new Set(["span", "font"]), Pe = /^(https?:|mailto:|tel:|#|\/)/i, Le = /^data:image\/(?:png|gif|jpeg|jpg|webp);base64,/i, we = /* @__PURE__ */ new Set([
|
|
19
19
|
"color",
|
|
20
20
|
"background-color",
|
|
21
21
|
"font-weight",
|
|
@@ -47,7 +47,7 @@ const v = ".rte-content, .editora-content", ee = "[data-editora-editor], .rte-ed
|
|
|
47
47
|
"border-width",
|
|
48
48
|
"border-style",
|
|
49
49
|
"list-style-type"
|
|
50
|
-
]),
|
|
50
|
+
]), $e = {
|
|
51
51
|
panelTitle: "Smart Paste",
|
|
52
52
|
panelAriaLabel: "Smart paste panel",
|
|
53
53
|
enabledText: "Smart paste is enabled",
|
|
@@ -88,11 +88,11 @@ const v = ".rte-content, .editora-content", ee = "[data-editora-editor], .rte-ed
|
|
|
88
88
|
preserveTables: !1
|
|
89
89
|
}
|
|
90
90
|
}, d = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new Set();
|
|
91
|
-
let W = 0,
|
|
91
|
+
let W = 0, Me = 0, O = null, b = null, L = null, w = null, A = null, $ = null;
|
|
92
92
|
function X(e) {
|
|
93
93
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function Oe(e) {
|
|
96
96
|
return e.replace(/\u00A0/g, " ").replace(/\r\n?/g, `
|
|
97
97
|
`);
|
|
98
98
|
}
|
|
@@ -118,10 +118,10 @@ function V(e = {}) {
|
|
|
118
118
|
removeComments: e.removeComments !== !1,
|
|
119
119
|
normalizeWhitespace: e.normalizeWhitespace !== !1,
|
|
120
120
|
labels: {
|
|
121
|
-
|
|
121
|
+
...$e,
|
|
122
122
|
...e.labels || {}
|
|
123
123
|
},
|
|
124
|
-
normalizeText: e.normalizeText ||
|
|
124
|
+
normalizeText: e.normalizeText || Oe,
|
|
125
125
|
profileOptions: {
|
|
126
126
|
fidelity: Z(t.fidelity, Y.fidelity),
|
|
127
127
|
balanced: Z(t.balanced, Y.balanced),
|
|
@@ -129,7 +129,7 @@ function V(e = {}) {
|
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function de(e) {
|
|
133
133
|
return {
|
|
134
134
|
enabled: e.enabled,
|
|
135
135
|
defaultProfile: e.defaultProfile,
|
|
@@ -149,33 +149,27 @@ function te(e) {
|
|
|
149
149
|
return e.closest(ee) || e;
|
|
150
150
|
}
|
|
151
151
|
function D(e) {
|
|
152
|
-
if (!e)
|
|
153
|
-
|
|
154
|
-
if (e.matches(v))
|
|
155
|
-
return e;
|
|
152
|
+
if (!e) return null;
|
|
153
|
+
if (e.matches(v)) return e;
|
|
156
154
|
const t = e.querySelector(v);
|
|
157
155
|
return t instanceof HTMLElement ? t : null;
|
|
158
156
|
}
|
|
159
|
-
function
|
|
160
|
-
if (typeof window == "undefined")
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
return null;
|
|
165
|
-
window[se] = null;
|
|
157
|
+
function Re() {
|
|
158
|
+
if (typeof window == "undefined") return null;
|
|
159
|
+
const e = window[le];
|
|
160
|
+
if (!(e instanceof HTMLElement)) return null;
|
|
161
|
+
window[le] = null;
|
|
166
162
|
const t = D(e);
|
|
167
|
-
if (t)
|
|
168
|
-
return t;
|
|
163
|
+
if (t) return t;
|
|
169
164
|
const a = e.closest(ee);
|
|
170
165
|
if (a) {
|
|
171
166
|
const n = D(a);
|
|
172
|
-
if (n)
|
|
173
|
-
return n;
|
|
167
|
+
if (n) return n;
|
|
174
168
|
}
|
|
175
169
|
const r = e.closest(v);
|
|
176
170
|
return r instanceof HTMLElement ? r : null;
|
|
177
171
|
}
|
|
178
|
-
function
|
|
172
|
+
function ze(e) {
|
|
179
173
|
const t = e.closest("[data-editora-editor]");
|
|
180
174
|
if (t && D(t) === e)
|
|
181
175
|
return t;
|
|
@@ -187,74 +181,64 @@ function Re(e) {
|
|
|
187
181
|
}
|
|
188
182
|
return te(e);
|
|
189
183
|
}
|
|
190
|
-
function
|
|
184
|
+
function me(e) {
|
|
191
185
|
return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
|
|
192
186
|
}
|
|
193
187
|
function T(e, t = !0, a = !0) {
|
|
194
|
-
if (j(), (e == null ? void 0 : e.contentElement) instanceof HTMLElement)
|
|
195
|
-
return e.contentElement;
|
|
188
|
+
if (j(), (e == null ? void 0 : e.contentElement) instanceof HTMLElement) return e.contentElement;
|
|
196
189
|
if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
|
|
197
190
|
const s = D(e.editorElement);
|
|
198
|
-
if (s)
|
|
199
|
-
return s;
|
|
191
|
+
if (s) return s;
|
|
200
192
|
}
|
|
201
|
-
const r =
|
|
202
|
-
if (r)
|
|
203
|
-
return r;
|
|
193
|
+
const r = Re();
|
|
194
|
+
if (r) return r;
|
|
204
195
|
const n = window.getSelection();
|
|
205
196
|
if (n && n.rangeCount > 0) {
|
|
206
|
-
const s =
|
|
207
|
-
if (l)
|
|
208
|
-
return l;
|
|
197
|
+
const s = me(n.getRangeAt(0).startContainer), l = s == null ? void 0 : s.closest(v);
|
|
198
|
+
if (l) return l;
|
|
209
199
|
}
|
|
210
200
|
const o = document.activeElement;
|
|
211
201
|
if (o) {
|
|
212
|
-
if (o.matches(v))
|
|
213
|
-
return o;
|
|
202
|
+
if (o.matches(v)) return o;
|
|
214
203
|
const s = o.closest(v);
|
|
215
|
-
if (s)
|
|
216
|
-
return s;
|
|
204
|
+
if (s) return s;
|
|
217
205
|
}
|
|
218
206
|
if (a) {
|
|
219
|
-
if (b && b.isConnected)
|
|
220
|
-
return b;
|
|
207
|
+
if (b && b.isConnected) return b;
|
|
221
208
|
b && !b.isConnected && (b = null);
|
|
222
209
|
}
|
|
223
210
|
return t ? document.querySelector(v) : null;
|
|
224
211
|
}
|
|
225
|
-
function
|
|
212
|
+
function _e(e) {
|
|
226
213
|
const t = e.target;
|
|
227
214
|
if (t) {
|
|
228
215
|
const r = t.closest(v);
|
|
229
|
-
if (r)
|
|
230
|
-
return r;
|
|
216
|
+
if (r) return r;
|
|
231
217
|
}
|
|
232
218
|
const a = window.getSelection();
|
|
233
219
|
if (a && a.rangeCount > 0) {
|
|
234
|
-
const r =
|
|
235
|
-
if (n)
|
|
236
|
-
return n;
|
|
220
|
+
const r = me(a.getRangeAt(0).startContainer), n = r == null ? void 0 : r.closest(v);
|
|
221
|
+
if (n) return n;
|
|
237
222
|
}
|
|
238
223
|
return null;
|
|
239
224
|
}
|
|
240
|
-
function
|
|
225
|
+
function K(e) {
|
|
241
226
|
return e ? (e.getAttribute("data-theme") || e.getAttribute("theme") || "").toLowerCase() === "dark" ? !0 : e.classList.contains("dark") || e.classList.contains("editora-theme-dark") || e.classList.contains("rte-theme-dark") : !1;
|
|
242
227
|
}
|
|
243
|
-
function
|
|
228
|
+
function He(e) {
|
|
244
229
|
const t = te(e);
|
|
245
|
-
if (
|
|
246
|
-
return !0;
|
|
230
|
+
if (K(t)) return !0;
|
|
247
231
|
const a = t.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
|
|
248
|
-
return
|
|
232
|
+
return K(a) ? !0 : K(document.documentElement) || K(document.body);
|
|
249
233
|
}
|
|
250
234
|
function G(e, t) {
|
|
251
|
-
e.classList.remove("rte-smart-paste-theme-dark"),
|
|
235
|
+
e.classList.remove("rte-smart-paste-theme-dark"), He(t) && e.classList.add("rte-smart-paste-theme-dark");
|
|
252
236
|
}
|
|
253
|
-
function
|
|
237
|
+
function ue(e) {
|
|
254
238
|
return e.getAttribute("contenteditable") === "false" || e.getAttribute("data-readonly") === "true";
|
|
255
239
|
}
|
|
256
240
|
function N(e, t, a) {
|
|
257
|
-
const r =
|
|
241
|
+
const r = ze(e);
|
|
258
242
|
Array.from(
|
|
259
243
|
r.querySelectorAll(
|
|
260
244
|
`.rte-toolbar-button[data-command="${t}"], .editora-toolbar-button[data-command="${t}"]`
|
|
@@ -270,30 +254,29 @@ function m(e, t) {
|
|
|
270
254
|
enabled: t.enabled,
|
|
271
255
|
profile: t.defaultProfile,
|
|
272
256
|
lastReport: null
|
|
273
|
-
}, M.set(e, a)),
|
|
257
|
+
}, M.set(e, a)), et(e), _.add(e), a;
|
|
274
258
|
}
|
|
275
|
-
function
|
|
259
|
+
function be(e) {
|
|
276
260
|
const t = F.get(e);
|
|
277
261
|
t && (e.removeEventListener("paste", t, !0), F.delete(e));
|
|
278
262
|
}
|
|
279
|
-
function
|
|
263
|
+
function ge(e) {
|
|
280
264
|
var t;
|
|
281
|
-
|
|
265
|
+
be(e), (t = h.get(e)) == null || t.remove(), h.delete(e), I.delete(e), d.delete(e), M.delete(e), _.delete(e), b === e && (b = null);
|
|
282
266
|
}
|
|
283
267
|
function j() {
|
|
284
268
|
Array.from(_).forEach((t) => {
|
|
285
|
-
t.isConnected ||
|
|
269
|
+
t.isConnected || ge(t);
|
|
286
270
|
});
|
|
287
271
|
}
|
|
288
|
-
function
|
|
272
|
+
function De(e) {
|
|
289
273
|
var t, a, r, n;
|
|
290
274
|
for (let o = 0; o < e.length; o += 1) {
|
|
291
275
|
const s = e[o];
|
|
292
276
|
if (!(s.type !== "childList" || s.removedNodes.length === 0))
|
|
293
277
|
for (let l = 0; l < s.removedNodes.length; l += 1) {
|
|
294
278
|
const c = s.removedNodes[l];
|
|
295
|
-
if (c.nodeType !== Node.ELEMENT_NODE)
|
|
296
|
-
continue;
|
|
279
|
+
if (c.nodeType !== Node.ELEMENT_NODE) continue;
|
|
297
280
|
const i = c;
|
|
298
281
|
if ((t = i.matches) != null && t.call(i, v) || (a = i.matches) != null && a.call(i, `.${u}`) || (r = i.querySelector) != null && r.call(i, v) || (n = i.querySelector) != null && n.call(i, `.${u}`))
|
|
299
282
|
return !0;
|
|
@@ -316,21 +299,20 @@ function J(e, t) {
|
|
|
316
299
|
|
|
317
300
|
`).trim() : a;
|
|
318
301
|
}
|
|
319
|
-
function
|
|
302
|
+
function Ne(e) {
|
|
320
303
|
return /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office|<o:p\b/i.test(e);
|
|
321
304
|
}
|
|
322
|
-
function
|
|
305
|
+
function qe(e) {
|
|
323
306
|
return /id=["']docs-internal-guid|docs-\w+|data-sheets-value|data-sheets-userformat/i.test(e);
|
|
324
307
|
}
|
|
325
|
-
function
|
|
326
|
-
return e ?
|
|
308
|
+
function Ie(e, t) {
|
|
309
|
+
return e ? Ne(e) ? "word" : qe(e) ? "google-docs" : "html" : t ? "plain" : "html";
|
|
327
310
|
}
|
|
328
|
-
function
|
|
311
|
+
function We(e) {
|
|
329
312
|
return e.split(/\s+/).map((a) => a.trim()).filter(Boolean).filter((a) => !/^mso/i.test(a)).filter((a) => !/^docs-/i.test(a)).filter((a) => !/^c\d+$/i.test(a)).join(" ");
|
|
330
313
|
}
|
|
331
|
-
function
|
|
332
|
-
if (!e)
|
|
333
|
-
return { value: "", changed: !1 };
|
|
314
|
+
function Ke(e) {
|
|
315
|
+
if (!e) return { value: "", changed: !1 };
|
|
334
316
|
const t = e.split(";"), a = [];
|
|
335
317
|
let r = !1;
|
|
336
318
|
return t.forEach((n) => {
|
|
@@ -344,7 +326,7 @@ function We(e) {
|
|
|
344
326
|
r = !0;
|
|
345
327
|
return;
|
|
346
328
|
}
|
|
347
|
-
if (!
|
|
329
|
+
if (!we.has(s)) {
|
|
348
330
|
r = !0;
|
|
349
331
|
return;
|
|
350
332
|
}
|
|
@@ -358,11 +340,11 @@ function We(e) {
|
|
|
358
340
|
changed: r
|
|
359
341
|
};
|
|
360
342
|
}
|
|
361
|
-
function
|
|
343
|
+
function fe(e) {
|
|
362
344
|
const t = e.trim();
|
|
363
|
-
return t && (
|
|
345
|
+
return t && (Pe.test(t) || Le.test(t)) ? t : "";
|
|
364
346
|
}
|
|
365
|
-
function
|
|
347
|
+
function pe(e) {
|
|
366
348
|
const t = e.parentNode;
|
|
367
349
|
if (t) {
|
|
368
350
|
for (; e.firstChild; )
|
|
@@ -372,11 +354,11 @@ function fe(e) {
|
|
|
372
354
|
}
|
|
373
355
|
function Be(e, t, a, r) {
|
|
374
356
|
const n = e.tagName.toLowerCase();
|
|
375
|
-
if (
|
|
357
|
+
if (Ce.has(n)) {
|
|
376
358
|
r.removedElements += 1, e.remove();
|
|
377
359
|
return;
|
|
378
360
|
}
|
|
379
|
-
if (!t.preserveTables &&
|
|
361
|
+
if (!t.preserveTables && Te.has(n)) {
|
|
380
362
|
const s = e.textContent || "", l = document.createTextNode(s);
|
|
381
363
|
e.replaceWith(l), r.removedElements += 1;
|
|
382
364
|
return;
|
|
@@ -392,7 +374,7 @@ function Be(e, t, a, r) {
|
|
|
392
374
|
e.removeAttribute(s.name), r.removedAttributes += 1;
|
|
393
375
|
return;
|
|
394
376
|
}
|
|
395
|
-
const i =
|
|
377
|
+
const i = Ke(c);
|
|
396
378
|
if (!i.value) {
|
|
397
379
|
e.removeAttribute(s.name), r.removedAttributes += 1, i.changed && (r.normalizedStyles += 1);
|
|
398
380
|
return;
|
|
@@ -405,7 +387,7 @@ function Be(e, t, a, r) {
|
|
|
405
387
|
e.removeAttribute(s.name), r.removedAttributes += 1;
|
|
406
388
|
return;
|
|
407
389
|
}
|
|
408
|
-
const i =
|
|
390
|
+
const i = We(c);
|
|
409
391
|
if (!i) {
|
|
410
392
|
e.removeAttribute(s.name), r.removedAttributes += 1;
|
|
411
393
|
return;
|
|
@@ -426,7 +408,7 @@ function Be(e, t, a, r) {
|
|
|
426
408
|
return;
|
|
427
409
|
}
|
|
428
410
|
if (l === "href" || l === "src" || l === "xlink:href") {
|
|
429
|
-
const i =
|
|
411
|
+
const i = fe(c);
|
|
430
412
|
if (!i) {
|
|
431
413
|
e.removeAttribute(s.name), r.removedAttributes += 1;
|
|
432
414
|
return;
|
|
@@ -435,28 +417,28 @@ function Be(e, t, a, r) {
|
|
|
435
417
|
}
|
|
436
418
|
}), n === "a") {
|
|
437
419
|
if (!e.getAttribute("href")) {
|
|
438
|
-
|
|
420
|
+
pe(e), r.removedElements += 1;
|
|
439
421
|
return;
|
|
440
422
|
}
|
|
441
423
|
e.getAttribute("target") === "_blank" && e.setAttribute("rel", "noopener noreferrer");
|
|
442
424
|
}
|
|
443
425
|
if (n === "img") {
|
|
444
426
|
const s = e.getAttribute("src");
|
|
445
|
-
if (!s || !
|
|
427
|
+
if (!s || !fe(s)) {
|
|
446
428
|
r.removedElements += 1, e.remove();
|
|
447
429
|
return;
|
|
448
430
|
}
|
|
449
431
|
}
|
|
450
|
-
if (
|
|
432
|
+
if (Ae.has(n) && !e.attributes.length && !e.className && !e.style.cssText) {
|
|
451
433
|
const s = e.children.length > 0, l = (e.textContent || "").trim().length > 0;
|
|
452
434
|
if (!s && !l) {
|
|
453
435
|
e.remove(), r.removedElements += 1;
|
|
454
436
|
return;
|
|
455
437
|
}
|
|
456
|
-
!s && l && (
|
|
438
|
+
!s && l && (pe(e), r.removedElements += 1);
|
|
457
439
|
}
|
|
458
440
|
}
|
|
459
|
-
function
|
|
441
|
+
function Ve(e, t, a, r, n) {
|
|
460
442
|
const o = document.createElement("template");
|
|
461
443
|
o.innerHTML = e;
|
|
462
444
|
const s = {
|
|
@@ -467,7 +449,7 @@ function Ke(e, t, a, r, n) {
|
|
|
467
449
|
};
|
|
468
450
|
if (r.removeComments)
|
|
469
451
|
try {
|
|
470
|
-
const f = document.createTreeWalker(o.content,
|
|
452
|
+
const f = document.createTreeWalker(o.content, ke, null), p = [];
|
|
471
453
|
let y = f.nextNode();
|
|
472
454
|
for (; y; )
|
|
473
455
|
p.push(y), y = f.nextNode();
|
|
@@ -488,58 +470,53 @@ function Ke(e, t, a, r, n) {
|
|
|
488
470
|
counters: s
|
|
489
471
|
};
|
|
490
472
|
}
|
|
491
|
-
function
|
|
473
|
+
function he(e) {
|
|
492
474
|
const t = window.getSelection();
|
|
493
|
-
if (!t || t.rangeCount === 0)
|
|
494
|
-
return null;
|
|
475
|
+
if (!t || t.rangeCount === 0) return null;
|
|
495
476
|
const a = t.getRangeAt(0);
|
|
496
477
|
return e.contains(a.commonAncestorContainer) ? a : null;
|
|
497
478
|
}
|
|
498
|
-
function
|
|
499
|
-
if (!e.isConnected)
|
|
500
|
-
return;
|
|
479
|
+
function ye(e, t) {
|
|
480
|
+
if (!e.isConnected) return;
|
|
501
481
|
const a = window.getSelection();
|
|
502
482
|
a && (a.removeAllRanges(), a.addRange(t));
|
|
503
483
|
}
|
|
504
|
-
function
|
|
484
|
+
function je(e, t) {
|
|
505
485
|
e.focus({ preventScroll: !0 });
|
|
506
486
|
try {
|
|
507
487
|
if (document.execCommand("insertHTML", !1, t))
|
|
508
488
|
return !0;
|
|
509
489
|
} catch (s) {
|
|
510
490
|
}
|
|
511
|
-
const a =
|
|
512
|
-
if (!a)
|
|
513
|
-
return !1;
|
|
491
|
+
const a = he(e);
|
|
492
|
+
if (!a) return !1;
|
|
514
493
|
a.deleteContents();
|
|
515
494
|
const r = document.createElement("template");
|
|
516
495
|
r.innerHTML = t;
|
|
517
496
|
const n = r.content, o = n.lastChild;
|
|
518
497
|
if (a.insertNode(n), o) {
|
|
519
498
|
const s = document.createRange();
|
|
520
|
-
s.setStartAfter(o), s.collapse(!0),
|
|
499
|
+
s.setStartAfter(o), s.collapse(!0), ye(e, s);
|
|
521
500
|
}
|
|
522
501
|
return !0;
|
|
523
502
|
}
|
|
524
|
-
function
|
|
503
|
+
function Fe(e, t) {
|
|
525
504
|
e.focus({ preventScroll: !0 });
|
|
526
505
|
try {
|
|
527
506
|
if (document.execCommand("insertText", !1, t))
|
|
528
507
|
return !0;
|
|
529
508
|
} catch (o) {
|
|
530
509
|
}
|
|
531
|
-
const a =
|
|
532
|
-
if (!a)
|
|
533
|
-
return !1;
|
|
510
|
+
const a = he(e);
|
|
511
|
+
if (!a) return !1;
|
|
534
512
|
a.deleteContents();
|
|
535
513
|
const r = document.createTextNode(t);
|
|
536
514
|
a.insertNode(r);
|
|
537
515
|
const n = document.createRange();
|
|
538
|
-
return n.setStart(r, r.length), n.collapse(!0),
|
|
516
|
+
return n.setStart(r, r.length), n.collapse(!0), ye(e, n), !0;
|
|
539
517
|
}
|
|
540
|
-
function
|
|
541
|
-
if (t === e.innerHTML)
|
|
542
|
-
return;
|
|
518
|
+
function Ge(e, t) {
|
|
519
|
+
if (t === e.innerHTML) return;
|
|
543
520
|
const a = window.execEditorCommand || window.executeEditorCommand;
|
|
544
521
|
if (typeof a == "function")
|
|
545
522
|
try {
|
|
@@ -547,10 +524,10 @@ function Fe(e, t) {
|
|
|
547
524
|
} catch (r) {
|
|
548
525
|
}
|
|
549
526
|
}
|
|
550
|
-
function
|
|
527
|
+
function Ue(e) {
|
|
551
528
|
e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
552
529
|
}
|
|
553
|
-
function
|
|
530
|
+
function B(e, t, a, r, n, o) {
|
|
554
531
|
return {
|
|
555
532
|
source: e,
|
|
556
533
|
profile: t,
|
|
@@ -564,14 +541,14 @@ function K(e, t, a, r, n, o) {
|
|
|
564
541
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
565
542
|
};
|
|
566
543
|
}
|
|
567
|
-
function
|
|
568
|
-
const n =
|
|
544
|
+
function Ye(e, t, a, r) {
|
|
545
|
+
const n = Ie(e, t);
|
|
569
546
|
if (a === "plain") {
|
|
570
547
|
const l = t || e.replace(/<[^>]*>/g, " "), c = J(l, r);
|
|
571
548
|
return {
|
|
572
549
|
mode: "text",
|
|
573
550
|
value: c,
|
|
574
|
-
report:
|
|
551
|
+
report: B(
|
|
575
552
|
n,
|
|
576
553
|
a,
|
|
577
554
|
e.length,
|
|
@@ -591,7 +568,7 @@ function Ue(e, t, a, r) {
|
|
|
591
568
|
return {
|
|
592
569
|
mode: "text",
|
|
593
570
|
value: l,
|
|
594
|
-
report:
|
|
571
|
+
report: B(
|
|
595
572
|
n,
|
|
596
573
|
a,
|
|
597
574
|
e.length,
|
|
@@ -606,19 +583,19 @@ function Ue(e, t, a, r) {
|
|
|
606
583
|
)
|
|
607
584
|
};
|
|
608
585
|
}
|
|
609
|
-
const o = r.profileOptions[a], s =
|
|
586
|
+
const o = r.profileOptions[a], s = Ve(e, o, n, r, a);
|
|
610
587
|
if (!s.html) {
|
|
611
588
|
const l = J(t || e.replace(/<[^>]*>/g, " "), r);
|
|
612
589
|
return {
|
|
613
590
|
mode: "text",
|
|
614
591
|
value: l,
|
|
615
|
-
report:
|
|
592
|
+
report: B(n, a, e.length, 0, l.length, s.counters)
|
|
616
593
|
};
|
|
617
594
|
}
|
|
618
595
|
return {
|
|
619
596
|
mode: "html",
|
|
620
597
|
value: s.html,
|
|
621
|
-
report:
|
|
598
|
+
report: B(
|
|
622
599
|
n,
|
|
623
600
|
a,
|
|
624
601
|
e.length,
|
|
@@ -634,7 +611,7 @@ function U(e, t) {
|
|
|
634
611
|
function ae(e) {
|
|
635
612
|
return e === "fidelity" ? "balanced" : e === "balanced" ? "plain" : "fidelity";
|
|
636
613
|
}
|
|
637
|
-
function
|
|
614
|
+
function Xe(e, t) {
|
|
638
615
|
e.setAttribute("aria-label", t.labels.panelAriaLabel);
|
|
639
616
|
const a = e.querySelector(".rte-smart-paste-title");
|
|
640
617
|
a && (a.textContent = t.labels.panelTitle);
|
|
@@ -642,8 +619,8 @@ function Ye(e, t) {
|
|
|
642
619
|
r && r.setAttribute("aria-label", t.labels.closeText);
|
|
643
620
|
const n = e.querySelector('[data-action="toggle-enabled"]');
|
|
644
621
|
if (n) {
|
|
645
|
-
const
|
|
646
|
-
n.textContent =
|
|
622
|
+
const Ee = n.getAttribute("data-enabled") === "true";
|
|
623
|
+
n.textContent = Ee ? t.labels.toggleOnText : t.labels.toggleOffText;
|
|
647
624
|
}
|
|
648
625
|
const o = e.querySelector('[data-action="cycle-profile"]');
|
|
649
626
|
o && (o.textContent = t.labels.cycleProfileText);
|
|
@@ -667,16 +644,15 @@ function Ye(e, t) {
|
|
|
667
644
|
P && (P.textContent = t.labels.lastPasteProfileLabel);
|
|
668
645
|
const C = e.querySelector('[data-key="removed-label"]');
|
|
669
646
|
C && (C.textContent = t.labels.lastPasteRemovedLabel);
|
|
670
|
-
const
|
|
671
|
-
|
|
672
|
-
const
|
|
673
|
-
|
|
647
|
+
const ne = e.querySelector('[data-key="chars-label"]');
|
|
648
|
+
ne && (ne.textContent = t.labels.lastPasteCharsLabel);
|
|
649
|
+
const se = e.querySelector(".rte-smart-paste-shortcut");
|
|
650
|
+
se && (se.textContent = t.labels.shortcutText);
|
|
674
651
|
}
|
|
675
652
|
function S(e) {
|
|
676
653
|
const t = h.get(e), a = d.get(e) || O, r = M.get(e);
|
|
677
|
-
if (!t || !a || !r)
|
|
678
|
-
|
|
679
|
-
Ye(t, a);
|
|
654
|
+
if (!t || !a || !r) return;
|
|
655
|
+
Xe(t, a);
|
|
680
656
|
const n = t.querySelector(".rte-smart-paste-status");
|
|
681
657
|
n && (n.textContent = r.enabled ? a.labels.enabledText : a.labels.disabledText);
|
|
682
658
|
const o = t.querySelector('[data-action="toggle-enabled"]');
|
|
@@ -698,8 +674,7 @@ function S(e) {
|
|
|
698
674
|
y && (y.textContent = String(r.lastReport.outputTextLength));
|
|
699
675
|
}
|
|
700
676
|
function Q(e, t) {
|
|
701
|
-
if (!t.classList.contains("show"))
|
|
702
|
-
return;
|
|
677
|
+
if (!t.classList.contains("show")) return;
|
|
703
678
|
const a = te(e).getBoundingClientRect(), r = Math.min(window.innerWidth - 20, 360), n = Math.max(10, window.innerWidth - r - 10), o = Math.min(Math.max(10, a.right - r), n), s = Math.max(10, Math.min(window.innerHeight - 10, a.top + 12));
|
|
704
679
|
t.style.width = `${r}px`, t.style.left = `${o}px`, t.style.top = `${s}px`, t.style.maxHeight = `${Math.max(240, window.innerHeight - 20)}px`;
|
|
705
680
|
}
|
|
@@ -707,11 +682,10 @@ function q(e, t = !1) {
|
|
|
707
682
|
const a = h.get(e);
|
|
708
683
|
a && (a.classList.remove("show"), I.set(e, !1), N(e, "toggleSmartPastePanel", !1), t && e.focus({ preventScroll: !0 }));
|
|
709
684
|
}
|
|
710
|
-
function
|
|
685
|
+
function Ze(e) {
|
|
711
686
|
const t = h.get(e);
|
|
712
|
-
if (t)
|
|
713
|
-
|
|
714
|
-
const a = d.get(e) || O || V(), r = `rte-smart-paste-panel-${$e++}`, n = document.createElement("section");
|
|
687
|
+
if (t) return t;
|
|
688
|
+
const a = d.get(e) || O || V(), r = `rte-smart-paste-panel-${Me++}`, n = document.createElement("section");
|
|
715
689
|
return n.className = u, n.id = r, n.setAttribute("role", "dialog"), n.setAttribute("aria-modal", "false"), n.setAttribute("aria-label", a.labels.panelAriaLabel), n.innerHTML = `
|
|
716
690
|
<header class="rte-smart-paste-header">
|
|
717
691
|
<h2 class="rte-smart-paste-title">${X(a.labels.panelTitle)}</h2>
|
|
@@ -746,8 +720,7 @@ function Xe(e) {
|
|
|
746
720
|
<div class="rte-smart-paste-live" aria-live="polite" aria-atomic="true"></div>
|
|
747
721
|
`, n.addEventListener("click", (o) => {
|
|
748
722
|
const s = o.target, l = s == null ? void 0 : s.closest("[data-action]");
|
|
749
|
-
if (!l)
|
|
750
|
-
return;
|
|
723
|
+
if (!l) return;
|
|
751
724
|
const c = l.getAttribute("data-action");
|
|
752
725
|
if (c) {
|
|
753
726
|
if (c === "close") {
|
|
@@ -774,64 +747,56 @@ function Xe(e) {
|
|
|
774
747
|
o.preventDefault(), q(e, !0);
|
|
775
748
|
return;
|
|
776
749
|
}
|
|
777
|
-
if (o.key !== "ArrowRight" && o.key !== "ArrowLeft")
|
|
778
|
-
return;
|
|
750
|
+
if (o.key !== "ArrowRight" && o.key !== "ArrowLeft") return;
|
|
779
751
|
const s = Array.from(
|
|
780
752
|
n.querySelectorAll('[data-action="set-profile"][data-profile]')
|
|
781
753
|
);
|
|
782
|
-
if (s.length === 0)
|
|
783
|
-
return;
|
|
754
|
+
if (s.length === 0) return;
|
|
784
755
|
const l = s.findIndex((f) => f === document.activeElement);
|
|
785
|
-
if (l < 0)
|
|
786
|
-
return;
|
|
756
|
+
if (l < 0) return;
|
|
787
757
|
const c = o.key === "ArrowRight" ? 1 : -1, i = (l + c + s.length) % s.length;
|
|
788
758
|
o.preventDefault(), s[i].focus();
|
|
789
759
|
}), G(n, e), document.body.appendChild(n), h.set(e, n), I.set(e, !1), S(e), n;
|
|
790
760
|
}
|
|
791
|
-
function
|
|
792
|
-
const t =
|
|
761
|
+
function xe(e) {
|
|
762
|
+
const t = Ze(e);
|
|
793
763
|
h.forEach((r, n) => {
|
|
794
764
|
n !== e && q(n, !1);
|
|
795
765
|
}), t.classList.add("show"), I.set(e, !0), N(e, "toggleSmartPastePanel", !0), G(t, e), Q(e, t);
|
|
796
766
|
const a = t.querySelector('[data-action="toggle-enabled"]');
|
|
797
767
|
a == null || a.focus();
|
|
798
768
|
}
|
|
799
|
-
function
|
|
769
|
+
function ve(e, t) {
|
|
800
770
|
const a = re(e);
|
|
801
|
-
return (typeof t == "boolean" ? t : !a) ?
|
|
771
|
+
return (typeof t == "boolean" ? t : !a) ? xe(e) : q(e, !1), !0;
|
|
802
772
|
}
|
|
803
|
-
function
|
|
773
|
+
function Se(e) {
|
|
804
774
|
return {
|
|
805
775
|
enabled: e.enabled,
|
|
806
776
|
profile: e.profile,
|
|
807
777
|
lastReport: e.lastReport ? { ...e.lastReport } : null
|
|
808
778
|
};
|
|
809
779
|
}
|
|
810
|
-
function
|
|
780
|
+
function Je(e, t) {
|
|
811
781
|
const a = d.get(e) || O;
|
|
812
|
-
if (!a)
|
|
813
|
-
return !1;
|
|
782
|
+
if (!a) return !1;
|
|
814
783
|
const r = m(e, a);
|
|
815
|
-
if (!r.enabled ||
|
|
784
|
+
if (!r.enabled || ue(e)) {
|
|
816
785
|
const p = h.get(e);
|
|
817
|
-
return p &&
|
|
786
|
+
return p && ue(e) && R(p, a.labels.readonlyMessage), !1;
|
|
818
787
|
}
|
|
819
788
|
const n = t.clipboardData;
|
|
820
|
-
if (!n)
|
|
821
|
-
return !1;
|
|
789
|
+
if (!n) return !1;
|
|
822
790
|
const o = n.getData("text/html") || "", s = n.getData("text/plain") || "";
|
|
823
|
-
if (!o && !s)
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
if (!l.value)
|
|
827
|
-
return !1;
|
|
791
|
+
if (!o && !s) return !1;
|
|
792
|
+
const l = Ye(o, s, r.profile, a);
|
|
793
|
+
if (!l.value) return !1;
|
|
828
794
|
const c = e.innerHTML;
|
|
829
|
-
if (!(l.mode === "html" ?
|
|
830
|
-
|
|
831
|
-
r.lastReport = { ...l.report }, M.set(e, r), Fe(e, c), Ge(e), e.dispatchEvent(
|
|
795
|
+
if (!(l.mode === "html" ? je(e, l.value) : Fe(e, l.value))) return !1;
|
|
796
|
+
r.lastReport = { ...l.report }, M.set(e, r), Ge(e, c), Ue(e), e.dispatchEvent(
|
|
832
797
|
new CustomEvent("editora:smart-paste", {
|
|
833
798
|
bubbles: !0,
|
|
834
|
-
detail:
|
|
799
|
+
detail: Se(r)
|
|
835
800
|
})
|
|
836
801
|
), S(e);
|
|
837
802
|
const f = h.get(e);
|
|
@@ -844,68 +809,66 @@ function Ze(e, t) {
|
|
|
844
809
|
}
|
|
845
810
|
return !0;
|
|
846
811
|
}
|
|
847
|
-
function
|
|
812
|
+
function Qe(e) {
|
|
848
813
|
return (t) => {
|
|
849
|
-
t.defaultPrevented || t[
|
|
814
|
+
t.defaultPrevented || t[ce] === !0 || (b = e, !Je(e, t)) || (t[ce] = !0, t.preventDefault(), typeof t.stopImmediatePropagation == "function" ? t.stopImmediatePropagation() : t.stopPropagation());
|
|
850
815
|
};
|
|
851
816
|
}
|
|
852
|
-
function
|
|
853
|
-
if (F.has(e))
|
|
854
|
-
|
|
855
|
-
const t = Je(e);
|
|
817
|
+
function et(e) {
|
|
818
|
+
if (F.has(e)) return;
|
|
819
|
+
const t = Qe(e);
|
|
856
820
|
e.addEventListener("paste", t, !0), F.set(e, t);
|
|
857
821
|
}
|
|
858
822
|
function z(e) {
|
|
859
823
|
const t = M.get(e);
|
|
860
824
|
N(e, "toggleSmartPastePanel", re(e)), N(e, "toggleSmartPasteEnabled", (t == null ? void 0 : t.enabled) === !0);
|
|
861
825
|
}
|
|
862
|
-
function
|
|
863
|
-
|
|
864
|
-
return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "s";
|
|
826
|
+
function oe(e) {
|
|
827
|
+
return typeof e.key == "string" ? e.key.toLowerCase() : "";
|
|
865
828
|
}
|
|
866
829
|
function tt(e) {
|
|
867
|
-
const t = e
|
|
868
|
-
return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "
|
|
830
|
+
const t = oe(e);
|
|
831
|
+
return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "s";
|
|
869
832
|
}
|
|
870
833
|
function rt(e) {
|
|
871
|
-
const t = e
|
|
872
|
-
return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "
|
|
834
|
+
const t = oe(e);
|
|
835
|
+
return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "v";
|
|
873
836
|
}
|
|
874
837
|
function at(e) {
|
|
838
|
+
const t = oe(e);
|
|
839
|
+
return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "g";
|
|
840
|
+
}
|
|
841
|
+
function ot(e) {
|
|
875
842
|
O = e, L || (L = (t) => {
|
|
876
843
|
j();
|
|
877
844
|
const a = t.target, r = a == null ? void 0 : a.closest(v);
|
|
878
|
-
if (!r)
|
|
879
|
-
return;
|
|
845
|
+
if (!r) return;
|
|
880
846
|
const n = d.get(r) || e;
|
|
881
847
|
m(r, n), d.set(r, n), b = r, z(r);
|
|
882
848
|
const o = h.get(r);
|
|
883
849
|
o && (G(o, r), Q(r, o), S(r));
|
|
884
850
|
}, document.addEventListener("focusin", L, !0)), w || (w = (t) => {
|
|
885
|
-
if (t.defaultPrevented)
|
|
886
|
-
return;
|
|
851
|
+
if (t.defaultPrevented) return;
|
|
887
852
|
const a = t.target;
|
|
888
|
-
if (a != null && a.closest(`.${u} input, .${u} textarea, .${u} select`))
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
if (!r)
|
|
892
|
-
return;
|
|
853
|
+
if (a != null && a.closest(`.${u} input, .${u} textarea, .${u} select`)) return;
|
|
854
|
+
const r = _e(t);
|
|
855
|
+
if (!r) return;
|
|
893
856
|
const n = d.get(r) || O || e;
|
|
894
857
|
if (m(r, n), d.set(r, n), b = r, t.key === "Escape" && re(r)) {
|
|
895
858
|
t.preventDefault(), q(r, !0);
|
|
896
859
|
return;
|
|
897
860
|
}
|
|
898
|
-
if (
|
|
899
|
-
t.preventDefault(), t.stopPropagation(),
|
|
861
|
+
if (tt(t)) {
|
|
862
|
+
t.preventDefault(), t.stopPropagation(), ve(r);
|
|
900
863
|
return;
|
|
901
864
|
}
|
|
902
|
-
if (
|
|
865
|
+
if (rt(t)) {
|
|
903
866
|
t.preventDefault(), t.stopPropagation();
|
|
904
867
|
const o = m(r, n);
|
|
905
868
|
o.profile = ae(o.profile), S(r);
|
|
906
869
|
return;
|
|
907
870
|
}
|
|
908
|
-
if (
|
|
871
|
+
if (at(t)) {
|
|
909
872
|
t.preventDefault(), t.stopPropagation();
|
|
910
873
|
const o = m(r, n);
|
|
911
874
|
o.enabled = !o.enabled, z(r), S(r);
|
|
@@ -915,20 +878,19 @@ function at(e) {
|
|
|
915
878
|
!a.isConnected || !t.isConnected || (G(t, a), Q(a, t));
|
|
916
879
|
});
|
|
917
880
|
}, window.addEventListener("scroll", A, !0), window.addEventListener("resize", A)), !$ && typeof MutationObserver != "undefined" && document.body && ($ = new MutationObserver((t) => {
|
|
918
|
-
|
|
881
|
+
De(t) && j();
|
|
919
882
|
}), $.observe(document.body, {
|
|
920
883
|
childList: !0,
|
|
921
884
|
subtree: !0
|
|
922
885
|
}));
|
|
923
886
|
}
|
|
924
|
-
function ot() {
|
|
925
|
-
L && (document.removeEventListener("focusin", L, !0), L = null), w && (document.removeEventListener("keydown", w, !0), w = null), A && (window.removeEventListener("scroll", A, !0), window.removeEventListener("resize", A), A = null), $ && ($.disconnect(), $ = null), h.forEach((e) => e.remove()), h.clear(), _.forEach((e) => me(e)), _.clear(), O = null, b = null;
|
|
926
|
-
}
|
|
927
887
|
function nt() {
|
|
928
|
-
|
|
929
|
-
|
|
888
|
+
L && (document.removeEventListener("focusin", L, !0), L = null), w && (document.removeEventListener("keydown", w, !0), w = null), A && (window.removeEventListener("scroll", A, !0), window.removeEventListener("resize", A), A = null), $ && ($.disconnect(), $ = null), h.forEach((e) => e.remove()), h.clear(), _.forEach((e) => be(e)), _.clear(), O = null, b = null;
|
|
889
|
+
}
|
|
890
|
+
function st() {
|
|
891
|
+
if (typeof document == "undefined" || document.getElementById(ie)) return;
|
|
930
892
|
const e = document.createElement("style");
|
|
931
|
-
e.id =
|
|
893
|
+
e.id = ie, e.textContent = `
|
|
932
894
|
.rte-toolbar-group-items.${x},
|
|
933
895
|
.editora-toolbar-group-items.${x},
|
|
934
896
|
.rte-toolbar-group-items.${E},
|
|
@@ -1290,9 +1252,9 @@ function nt() {
|
|
|
1290
1252
|
}
|
|
1291
1253
|
`, document.head.appendChild(e);
|
|
1292
1254
|
}
|
|
1293
|
-
const
|
|
1255
|
+
const lt = (e = {}) => {
|
|
1294
1256
|
const t = V(e), a = /* @__PURE__ */ new Set();
|
|
1295
|
-
return
|
|
1257
|
+
return st(), {
|
|
1296
1258
|
name: "smartPaste",
|
|
1297
1259
|
toolbar: [
|
|
1298
1260
|
{
|
|
@@ -1328,45 +1290,39 @@ const st = (e = {}) => {
|
|
|
1328
1290
|
commands: {
|
|
1329
1291
|
smartPaste: (r, n) => {
|
|
1330
1292
|
const o = T(n, !1, !1);
|
|
1331
|
-
if (!o)
|
|
1332
|
-
return !1;
|
|
1293
|
+
if (!o) return !1;
|
|
1333
1294
|
const s = d.get(o) || t;
|
|
1334
|
-
return m(o, s), d.set(o, s), b = o,
|
|
1295
|
+
return m(o, s), d.set(o, s), b = o, xe(o), !0;
|
|
1335
1296
|
},
|
|
1336
1297
|
toggleSmartPastePanel: (r, n) => {
|
|
1337
1298
|
const o = T(n, !1, !1);
|
|
1338
|
-
if (!o)
|
|
1339
|
-
return !1;
|
|
1299
|
+
if (!o) return !1;
|
|
1340
1300
|
const s = d.get(o) || t;
|
|
1341
|
-
return m(o, s), d.set(o, s), b = o,
|
|
1301
|
+
return m(o, s), d.set(o, s), b = o, ve(o, typeof r == "boolean" ? r : void 0);
|
|
1342
1302
|
},
|
|
1343
1303
|
cycleSmartPasteProfile: (r, n) => {
|
|
1344
1304
|
const o = T(n, !1, !1);
|
|
1345
|
-
if (!o)
|
|
1346
|
-
return !1;
|
|
1305
|
+
if (!o) return !1;
|
|
1347
1306
|
const s = d.get(o) || t, l = m(o, s);
|
|
1348
1307
|
return d.set(o, s), l.profile = ae(l.profile), S(o), !0;
|
|
1349
1308
|
},
|
|
1350
1309
|
setSmartPasteProfile: (r, n) => {
|
|
1351
1310
|
const o = T(n, !1, !1);
|
|
1352
|
-
if (!o)
|
|
1353
|
-
return !1;
|
|
1311
|
+
if (!o) return !1;
|
|
1354
1312
|
const s = d.get(o) || t, l = m(o, s);
|
|
1355
1313
|
return d.set(o, s), l.profile = H(r), S(o), !0;
|
|
1356
1314
|
},
|
|
1357
1315
|
toggleSmartPasteEnabled: (r, n) => {
|
|
1358
1316
|
const o = T(n, !1, !1);
|
|
1359
|
-
if (!o)
|
|
1360
|
-
return !1;
|
|
1317
|
+
if (!o) return !1;
|
|
1361
1318
|
const s = d.get(o) || t, l = m(o, s);
|
|
1362
1319
|
return d.set(o, s), l.enabled = typeof r == "boolean" ? r : !l.enabled, z(o), S(o), !0;
|
|
1363
1320
|
},
|
|
1364
1321
|
setSmartPasteOptions: (r, n) => {
|
|
1365
1322
|
var f, p, y, g, P, C;
|
|
1366
1323
|
const o = T(n, !1, !1);
|
|
1367
|
-
if (!o || !r || typeof r != "object")
|
|
1368
|
-
|
|
1369
|
-
const s = d.get(o) || t, l = ce(s), c = V({
|
|
1324
|
+
if (!o || !r || typeof r != "object") return !1;
|
|
1325
|
+
const s = d.get(o) || t, l = de(s), c = V({
|
|
1370
1326
|
...l,
|
|
1371
1327
|
...r,
|
|
1372
1328
|
labels: {
|
|
@@ -1397,9 +1353,8 @@ const st = (e = {}) => {
|
|
|
1397
1353
|
},
|
|
1398
1354
|
getSmartPasteState: (r, n) => {
|
|
1399
1355
|
const o = T(n, !1, !1);
|
|
1400
|
-
if (!o)
|
|
1401
|
-
|
|
1402
|
-
const s = d.get(o) || t, l = m(o, s), c = ve(l);
|
|
1356
|
+
if (!o) return !1;
|
|
1357
|
+
const s = d.get(o) || t, l = m(o, s), c = Se(l);
|
|
1403
1358
|
if (typeof r == "function")
|
|
1404
1359
|
try {
|
|
1405
1360
|
r(c);
|
|
@@ -1423,25 +1378,24 @@ const st = (e = {}) => {
|
|
|
1423
1378
|
},
|
|
1424
1379
|
init: function(n) {
|
|
1425
1380
|
W += 1;
|
|
1426
|
-
const o = this && typeof this.__pluginConfig == "object" ? V({ ...
|
|
1427
|
-
|
|
1381
|
+
const o = this && typeof this.__pluginConfig == "object" ? V({ ...de(t), ...this.__pluginConfig }) : t;
|
|
1382
|
+
ot(o);
|
|
1428
1383
|
const s = T(
|
|
1429
1384
|
n != null && n.editorElement ? { editorElement: n.editorElement } : void 0,
|
|
1430
1385
|
!1,
|
|
1431
1386
|
!1
|
|
1432
1387
|
);
|
|
1433
|
-
if (!s)
|
|
1434
|
-
return;
|
|
1388
|
+
if (!s) return;
|
|
1435
1389
|
b = s, a.add(s);
|
|
1436
1390
|
const l = m(s, o);
|
|
1437
1391
|
l.enabled = o.enabled, l.profile = o.defaultProfile, d.set(s, o), z(s);
|
|
1438
1392
|
},
|
|
1439
1393
|
destroy: () => {
|
|
1440
|
-
a.forEach((r) =>
|
|
1394
|
+
a.forEach((r) => ge(r)), a.clear(), W = Math.max(0, W - 1), !(W > 0) && nt();
|
|
1441
1395
|
}
|
|
1442
1396
|
};
|
|
1443
1397
|
};
|
|
1444
1398
|
export {
|
|
1445
|
-
|
|
1399
|
+
lt as SmartPastePlugin
|
|
1446
1400
|
};
|
|
1447
|
-
//# sourceMappingURL=SmartPastePlugin.native-
|
|
1401
|
+
//# sourceMappingURL=SmartPastePlugin.native-CZAEHkyt.mjs.map
|