@editora/core 1.0.14 → 1.0.16
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/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-DIKuCeFw.mjs} +82 -79
- package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-DXZdK3zr.mjs} +72 -71
- package/dist/{ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs → ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs} +239 -238
- package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-H3XyYD7_.mjs} +2 -2
- package/dist/{BlocksLibraryPlugin.native-5sdsXsiE.mjs → BlocksLibraryPlugin.native-CownM6Rk.mjs} +140 -116
- package/dist/{CapitalizationPlugin.native-DLV4oPmB.mjs → CapitalizationPlugin.native-C-HRbXGh.mjs} +10 -5
- package/dist/{ChecklistPlugin.native-BS-kMz9O.mjs → ChecklistPlugin.native-NVrBUkaL.mjs} +141 -103
- package/dist/{CitationsPlugin.native-DQgoCd1B.mjs → CitationsPlugin.native-C_7wWQ-k.mjs} +441 -422
- package/dist/{ClearFormattingPlugin.native-B6ro3a1h.mjs → ClearFormattingPlugin.native-Pp0O-SBf.mjs} +24 -23
- package/dist/{CodePlugin.native-veDC_kx5.mjs → CodePlugin.native-BH-K4xmW.mjs} +1049 -917
- package/dist/CodePlugin.native-hNgfXlfS.mjs +4767 -0
- package/dist/CodeSamplePlugin.native-svbAFWh_.mjs +501 -0
- package/dist/CollaborationPlugin.native-oSybCGPW.mjs +7468 -0
- package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-CLip9wAO.mjs} +233 -185
- package/dist/{ConditionalContentPlugin.native-CfhY46rU.mjs → ConditionalContentPlugin.native-Bf7XgRSW.mjs} +401 -351
- package/dist/{DataBindingPlugin.native-BoXwghTz.mjs → DataBindingPlugin.native-B7lpI_0c.mjs} +29 -28
- package/dist/{DocumentManagerPlugin.native-C2cs_1w4.mjs → DocumentManagerPlugin.native-iFip6s4Q.mjs} +94 -45
- package/dist/{EmbedIframePlugin.native-BF_-LjTq.mjs → EmbedIframePlugin.native-BfZ_HGlV.mjs} +231 -186
- package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-D92aaOKi.mjs} +288 -76
- package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-M3cNQ0KA.mjs} +57 -50
- package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-DsLrH8eq.mjs} +41 -34
- package/dist/{FormatPainterPlugin.native-CsMrKfFU.mjs → FormatPainterPlugin.native-BhjzsiVq.mjs} +3 -2
- package/dist/{HistoryPlugin.native-D2wl32jV.mjs → HistoryPlugin.native-DPvhks6h.mjs} +36 -32
- package/dist/LinkPlugin.native-BsQXYsK6.mjs +352 -0
- package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-Bt0LANbO.mjs} +68 -35
- package/dist/{MathPlugin.native-NwWPHVmj.mjs → MathPlugin.native-Byo3WL0f.mjs} +211 -115
- package/dist/{MediaManagerPlugin.native-eOsTJFpw.mjs → MediaManagerPlugin.native-BT1NZIJS.mjs} +139 -134
- package/dist/{MentionPlugin.native-BMDlOqur.mjs → MentionPlugin.native-S_lwGZQO.mjs} +23 -18
- package/dist/{MergeTagPlugin.native-BzRVoD9-.mjs → MergeTagPlugin.native-7-6F3S1Y.mjs} +44 -43
- package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-CiR51jql.mjs} +31 -28
- package/dist/{SlashCommandsPlugin.native-BiN6ODw5.mjs → SlashCommandsPlugin.native-BDIIwGNs.mjs} +90 -79
- package/dist/{SmartPastePlugin.native-CZAEHkyt.mjs → SmartPastePlugin.native-BATLCds5.mjs} +89 -85
- package/dist/{SpecialCharactersPlugin.native-DaG4b19I.mjs → SpecialCharactersPlugin.native-CdZoc1GB.mjs} +73 -26
- package/dist/SpellCheckPlugin.native-Bef2oTLB.mjs +10935 -0
- package/dist/TablePlugin.native-BjIxYZ2X.mjs +772 -0
- package/dist/{TemplatePlugin.native-DLjFUaPW.mjs → TemplatePlugin.native-D6n5RUnC.mjs} +288 -262
- package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-KMZ2uzlq.mjs} +2 -2
- package/dist/{TranslationWorkflowPlugin.native-DdF16tgT.mjs → TranslationWorkflowPlugin.native-CZtG--06.mjs} +67 -65
- package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-Ca1fMWUJ.mjs} +42 -42
- package/dist/anchoredPopover-DJFD2oAP.mjs +116 -0
- package/dist/core.css +1 -1
- package/dist/dialogHelpers-DBf7WqYH.mjs +40 -0
- package/dist/{documentManager-vQ1VkbUY.mjs → documentManager-BcBIv5P-.mjs} +3 -3
- package/dist/editora.min.js +26 -24
- package/dist/editora.umd.js +26 -24
- package/dist/escapeHtml-CX8RelZ1.mjs +7 -0
- package/dist/historyHelpers-B0-4mq1E.mjs +15 -0
- package/dist/index-B1_vtXRz.mjs +3910 -0
- package/dist/index-C6BoNR2t.js +12 -0
- package/dist/{index-BslAFzmv.mjs → index-CavM-mEM.mjs} +6391 -6203
- package/dist/index.cjs.js +3 -3
- package/dist/{index.es-BYD2KEo6.mjs → index.es-BK-4TPv8.mjs} +1562 -1546
- package/dist/index.esm.js +17 -14
- package/dist/{jspdf.es.min-BJGtOnRT.mjs → jspdf.es.min-BsnKYYHL.mjs} +4 -3
- package/dist/plugin-loader.js +53 -52
- package/dist/{purify.es-CKpwg8Tk.mjs → purify.es-DhWKBjsL.mjs} +3 -3
- package/dist/webcomponent-core.js +2039 -473
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +100 -70
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +2208 -641
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1575 -1209
- package/index.d.ts +32 -0
- package/package.json +10 -3
- package/dist/CodeSamplePlugin.native-CgGoH-X4.mjs +0 -384
- package/dist/LinkPlugin.native-DYCIcdTm.mjs +0 -283
- package/dist/SpellCheckPlugin.native-BZB9AewP.mjs +0 -1039
- package/dist/TablePlugin.native-DrHX-efe.mjs +0 -495
- package/dist/anchoredPopover-Bxds0VoB.mjs +0 -110
- package/dist/index-B9MPiUAR.mjs +0 -2341
- package/dist/index-BLm1MtzH.js +0 -10
package/dist/{ClearFormattingPlugin.native-B6ro3a1h.mjs → ClearFormattingPlugin.native-Pp0O-SBf.mjs}
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { r as u } from "./historyHelpers-B0-4mq1E.mjs";
|
|
2
|
+
const S = () => ({
|
|
2
3
|
name: "clearFormatting",
|
|
3
4
|
// Toolbar button configuration
|
|
4
5
|
toolbar: [
|
|
@@ -15,21 +16,21 @@ const T = () => ({
|
|
|
15
16
|
* Remove all formatting from current selection
|
|
16
17
|
*/
|
|
17
18
|
clearFormatting: () => {
|
|
18
|
-
const t =
|
|
19
|
+
const t = m();
|
|
19
20
|
if (!t) return !1;
|
|
20
21
|
const e = window.getSelection();
|
|
21
22
|
if (!e || e.rangeCount === 0) return !1;
|
|
22
23
|
const n = e.getRangeAt(0);
|
|
23
24
|
if (!t.contains(n.commonAncestorContainer)) return !1;
|
|
24
|
-
const r = n.cloneRange();
|
|
25
|
-
return t.focus({ preventScroll: !0 }), C(t, r),
|
|
25
|
+
const r = n.cloneRange(), o = t.innerHTML;
|
|
26
|
+
return t.focus({ preventScroll: !0 }), C(t, r), T(t, r), u(t, o), t.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
|
|
26
27
|
}
|
|
27
28
|
},
|
|
28
29
|
// Keyboard shortcuts
|
|
29
30
|
keymap: {
|
|
30
31
|
"Mod-\\": "clearFormatting"
|
|
31
32
|
}
|
|
32
|
-
}),
|
|
33
|
+
}), d = /* @__PURE__ */ new Set([
|
|
33
34
|
"A",
|
|
34
35
|
"B",
|
|
35
36
|
"STRONG",
|
|
@@ -44,7 +45,7 @@ const T = () => ({
|
|
|
44
45
|
"CODE",
|
|
45
46
|
"SUB",
|
|
46
47
|
"SUP"
|
|
47
|
-
]),
|
|
48
|
+
]), g = /* @__PURE__ */ new Set([
|
|
48
49
|
"H1",
|
|
49
50
|
"H2",
|
|
50
51
|
"H3",
|
|
@@ -53,7 +54,7 @@ const T = () => ({
|
|
|
53
54
|
"H6",
|
|
54
55
|
"BLOCKQUOTE",
|
|
55
56
|
"PRE"
|
|
56
|
-
]),
|
|
57
|
+
]), h = [
|
|
57
58
|
"color",
|
|
58
59
|
"background-color",
|
|
59
60
|
"font-size",
|
|
@@ -69,7 +70,7 @@ const T = () => ({
|
|
|
69
70
|
"text-align",
|
|
70
71
|
"padding-left"
|
|
71
72
|
];
|
|
72
|
-
function
|
|
73
|
+
function m() {
|
|
73
74
|
const t = window.getSelection();
|
|
74
75
|
if (t && t.rangeCount > 0) {
|
|
75
76
|
const n = t.getRangeAt(0).startContainer, r = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement, o = r == null ? void 0 : r.closest('[contenteditable="true"], .rte-content, .editora-content');
|
|
@@ -93,8 +94,8 @@ function a(t) {
|
|
|
93
94
|
e += 1, n = n.parentNode;
|
|
94
95
|
return e;
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
97
|
+
function E(t) {
|
|
98
|
+
h.forEach((e) => {
|
|
98
99
|
t.style.removeProperty(e);
|
|
99
100
|
}), (!t.getAttribute("style") || t.style.length === 0) && t.removeAttribute("style"), t.classList.contains("rte-text-color") && t.classList.remove("rte-text-color"), t.classList.contains("rte-bg-color") && t.classList.remove("rte-bg-color"), t.classList.contains("rte-format-painted") && t.classList.remove("rte-format-painted"), t.classList.length === 0 && t.removeAttribute("class");
|
|
100
101
|
}
|
|
@@ -106,12 +107,12 @@ function i(t) {
|
|
|
106
107
|
e.removeChild(t);
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
|
-
function
|
|
110
|
+
function p(t) {
|
|
110
111
|
return t.tagName !== "P" || t.attributes.length > 0 || (t.textContent || "").trim() !== "" ? !1 : !t.querySelector("img, video, table, iframe, hr, pre, ul, ol");
|
|
111
112
|
}
|
|
112
113
|
function l(t) {
|
|
113
114
|
Array.from(t.children).forEach((e) => {
|
|
114
|
-
|
|
115
|
+
p(e) && e.remove();
|
|
115
116
|
});
|
|
116
117
|
}
|
|
117
118
|
function s(t) {
|
|
@@ -126,17 +127,17 @@ function f(t) {
|
|
|
126
127
|
e.appendChild(t.firstChild);
|
|
127
128
|
e.innerHTML.trim() || (e.innerHTML = "<br>"), (n = t.parentNode) == null || n.replaceChild(e, t);
|
|
128
129
|
}
|
|
129
|
-
function
|
|
130
|
+
function N(t) {
|
|
130
131
|
return !/^(A|B|STRONG|I|EM|U|S|STRIKE|DEL|FONT|MARK|CODE|SUB|SUP|SPAN)$/.test(t.tagName) || (t.textContent || "").trim() !== "" ? !1 : !t.querySelector("img, video, table, iframe, hr, svg, math");
|
|
131
132
|
}
|
|
132
|
-
function
|
|
133
|
+
function A(t) {
|
|
133
134
|
Array.from(
|
|
134
135
|
t.querySelectorAll("a,b,strong,i,em,u,s,strike,del,font,mark,code,sub,sup,span")
|
|
135
136
|
).sort((n, r) => a(r) - a(n)).forEach((n) => {
|
|
136
|
-
n.isConnected &&
|
|
137
|
+
n.isConnected && N(n) && n.remove();
|
|
137
138
|
});
|
|
138
139
|
}
|
|
139
|
-
function
|
|
140
|
+
function y(t) {
|
|
140
141
|
if (l(t), t.parentElement instanceof HTMLLIElement) {
|
|
141
142
|
s(t);
|
|
142
143
|
return;
|
|
@@ -147,13 +148,13 @@ function A(t) {
|
|
|
147
148
|
}
|
|
148
149
|
f(t);
|
|
149
150
|
}
|
|
150
|
-
function
|
|
151
|
+
function T(t, e) {
|
|
151
152
|
Array.from(
|
|
152
153
|
t.querySelectorAll("h1,h2,h3,h4,h5,h6,blockquote,pre")
|
|
153
154
|
).forEach((r) => {
|
|
154
|
-
if (c(e, r) &&
|
|
155
|
+
if (c(e, r) && g.has(r.tagName)) {
|
|
155
156
|
if (r.tagName === "BLOCKQUOTE") {
|
|
156
|
-
|
|
157
|
+
y(r);
|
|
157
158
|
return;
|
|
158
159
|
}
|
|
159
160
|
f(r);
|
|
@@ -168,15 +169,15 @@ function C(t, e) {
|
|
|
168
169
|
);
|
|
169
170
|
n.sort((r, o) => a(o) - a(r)), n.forEach((r) => {
|
|
170
171
|
if (r.isConnected && c(e, r) && !(r.getAttribute("contenteditable") === "false" || r.closest('[contenteditable="false"]'))) {
|
|
171
|
-
if (
|
|
172
|
+
if (E(r), d.has(r.tagName)) {
|
|
172
173
|
i(r);
|
|
173
174
|
return;
|
|
174
175
|
}
|
|
175
176
|
r.tagName === "SPAN" && r.attributes.length === 0 && i(r);
|
|
176
177
|
}
|
|
177
|
-
}),
|
|
178
|
+
}), A(t);
|
|
178
179
|
}
|
|
179
180
|
export {
|
|
180
|
-
|
|
181
|
+
S as ClearFormattingPlugin
|
|
181
182
|
};
|
|
182
|
-
//# sourceMappingURL=ClearFormattingPlugin.native-
|
|
183
|
+
//# sourceMappingURL=ClearFormattingPlugin.native-Pp0O-SBf.mjs.map
|