@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
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
const C = () => ({
|
|
2
|
+
name: "clearFormatting",
|
|
3
|
+
// Toolbar button configuration
|
|
4
|
+
toolbar: [
|
|
5
|
+
{
|
|
6
|
+
label: "Clear Formatting",
|
|
7
|
+
command: "clearFormatting",
|
|
8
|
+
icon: '<svg width="24" height="24" focusable="false"><path d="M13.2 6a1 1 0 0 1 0 .2l-2.6 10a1 1 0 0 1-1 .8h-.2a.8.8 0 0 1-.8-1l2.6-10H8a1 1 0 1 1 0-2h9a1 1 0 0 1 0 2h-3.8ZM5 18h7a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Zm13 1.5L16.5 18 15 19.5a.7.7 0 0 1-1-1l1.5-1.5-1.5-1.5a.7.7 0 0 1 1-1l1.5 1.5 1.5-1.5a.7.7 0 0 1 1 1L17.5 17l1.5 1.5a.7.7 0 0 1-1 1Z" fill-rule="evenodd"></path></svg>',
|
|
9
|
+
shortcut: "Mod-\\"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
// Native command implementations
|
|
13
|
+
commands: {
|
|
14
|
+
/**
|
|
15
|
+
* Remove all formatting from current selection
|
|
16
|
+
*/
|
|
17
|
+
clearFormatting: () => {
|
|
18
|
+
const t = h();
|
|
19
|
+
if (!t) return !1;
|
|
20
|
+
const e = window.getSelection();
|
|
21
|
+
if (!e || e.rangeCount === 0) return !1;
|
|
22
|
+
const r = e.getRangeAt(0);
|
|
23
|
+
if (!t.contains(r.commonAncestorContainer)) return !1;
|
|
24
|
+
const n = r.cloneRange();
|
|
25
|
+
return t.focus({ preventScroll: !0 }), A(t, n), N(t, n), t.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
// Keyboard shortcuts
|
|
29
|
+
keymap: {
|
|
30
|
+
"Mod-\\": "clearFormatting"
|
|
31
|
+
}
|
|
32
|
+
}), u = /* @__PURE__ */ new Set([
|
|
33
|
+
"A",
|
|
34
|
+
"B",
|
|
35
|
+
"STRONG",
|
|
36
|
+
"I",
|
|
37
|
+
"EM",
|
|
38
|
+
"U",
|
|
39
|
+
"S",
|
|
40
|
+
"STRIKE",
|
|
41
|
+
"DEL",
|
|
42
|
+
"FONT",
|
|
43
|
+
"MARK",
|
|
44
|
+
"CODE",
|
|
45
|
+
"SUB",
|
|
46
|
+
"SUP"
|
|
47
|
+
]), d = /* @__PURE__ */ new Set([
|
|
48
|
+
"H1",
|
|
49
|
+
"H2",
|
|
50
|
+
"H3",
|
|
51
|
+
"H4",
|
|
52
|
+
"H5",
|
|
53
|
+
"H6",
|
|
54
|
+
"BLOCKQUOTE",
|
|
55
|
+
"PRE"
|
|
56
|
+
]), g = [
|
|
57
|
+
"color",
|
|
58
|
+
"background-color",
|
|
59
|
+
"font-size",
|
|
60
|
+
"font-family",
|
|
61
|
+
"font-weight",
|
|
62
|
+
"font-style",
|
|
63
|
+
"text-decoration",
|
|
64
|
+
"text-transform",
|
|
65
|
+
"line-height",
|
|
66
|
+
"letter-spacing",
|
|
67
|
+
"word-spacing",
|
|
68
|
+
"vertical-align",
|
|
69
|
+
"text-align",
|
|
70
|
+
"padding-left"
|
|
71
|
+
];
|
|
72
|
+
function h() {
|
|
73
|
+
const t = window.getSelection();
|
|
74
|
+
if (t && t.rangeCount > 0) {
|
|
75
|
+
const r = t.getRangeAt(0).startContainer, n = r.nodeType === Node.ELEMENT_NODE ? r : r.parentElement, o = n == null ? void 0 : n.closest('[contenteditable="true"], .rte-content, .editora-content');
|
|
76
|
+
if (o) return o;
|
|
77
|
+
}
|
|
78
|
+
const e = document.activeElement;
|
|
79
|
+
return e ? e.getAttribute("contenteditable") === "true" ? e : e.closest('[contenteditable="true"], .rte-content, .editora-content') : null;
|
|
80
|
+
}
|
|
81
|
+
function c(t, e) {
|
|
82
|
+
try {
|
|
83
|
+
if (typeof t.intersectsNode == "function")
|
|
84
|
+
return t.intersectsNode(e);
|
|
85
|
+
} catch (n) {
|
|
86
|
+
}
|
|
87
|
+
const r = document.createRange();
|
|
88
|
+
return e.nodeType === Node.ELEMENT_NODE ? r.selectNodeContents(e) : r.selectNode(e), t.compareBoundaryPoints(Range.END_TO_START, r) > 0 && t.compareBoundaryPoints(Range.START_TO_END, r) < 0;
|
|
89
|
+
}
|
|
90
|
+
function i(t) {
|
|
91
|
+
let e = 0, r = t;
|
|
92
|
+
for (; r && r.parentNode; )
|
|
93
|
+
e += 1, r = r.parentNode;
|
|
94
|
+
return e;
|
|
95
|
+
}
|
|
96
|
+
function m(t) {
|
|
97
|
+
g.forEach((e) => {
|
|
98
|
+
t.style.removeProperty(e);
|
|
99
|
+
}), (!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.length === 0 && t.removeAttribute("class");
|
|
100
|
+
}
|
|
101
|
+
function a(t) {
|
|
102
|
+
const e = t.parentNode;
|
|
103
|
+
if (e) {
|
|
104
|
+
for (; t.firstChild; )
|
|
105
|
+
e.insertBefore(t.firstChild, t);
|
|
106
|
+
e.removeChild(t);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function p(t) {
|
|
110
|
+
return t.tagName !== "P" || t.attributes.length > 0 || (t.textContent || "").trim() !== "" ? !1 : !t.querySelector("img, video, table, iframe, hr, pre, ul, ol");
|
|
111
|
+
}
|
|
112
|
+
function l(t) {
|
|
113
|
+
Array.from(t.children).forEach((e) => {
|
|
114
|
+
p(e) && e.remove();
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function s(t) {
|
|
118
|
+
l(t), a(t);
|
|
119
|
+
}
|
|
120
|
+
function f(t) {
|
|
121
|
+
var r;
|
|
122
|
+
const e = document.createElement("p");
|
|
123
|
+
for (Array.from(t.attributes).forEach((n) => {
|
|
124
|
+
e.setAttribute(n.name, n.value);
|
|
125
|
+
}); t.firstChild; )
|
|
126
|
+
e.appendChild(t.firstChild);
|
|
127
|
+
e.innerHTML.trim() || (e.innerHTML = "<br>"), (r = t.parentNode) == null || r.replaceChild(e, t);
|
|
128
|
+
}
|
|
129
|
+
function E(t) {
|
|
130
|
+
if (l(t), t.parentElement instanceof HTMLLIElement) {
|
|
131
|
+
s(t);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (Array.from(t.childNodes).filter((o) => o.nodeType !== Node.TEXT_NODE || (o.textContent || "").trim() !== "").some((o) => o instanceof HTMLElement && /^(P|DIV|H[1-6]|UL|OL|PRE|TABLE|BLOCKQUOTE)$/.test(o.tagName))) {
|
|
135
|
+
s(t);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
f(t);
|
|
139
|
+
}
|
|
140
|
+
function N(t, e) {
|
|
141
|
+
Array.from(
|
|
142
|
+
t.querySelectorAll("h1,h2,h3,h4,h5,h6,blockquote,pre")
|
|
143
|
+
).forEach((n) => {
|
|
144
|
+
if (c(e, n) && d.has(n.tagName)) {
|
|
145
|
+
if (n.tagName === "BLOCKQUOTE") {
|
|
146
|
+
E(n);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
f(n);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function A(t, e) {
|
|
154
|
+
const r = Array.from(
|
|
155
|
+
t.querySelectorAll(
|
|
156
|
+
"a,b,strong,i,em,u,s,strike,del,font,mark,code,sub,sup,span,[style],[class]"
|
|
157
|
+
)
|
|
158
|
+
);
|
|
159
|
+
r.sort((n, o) => i(o) - i(n)), r.forEach((n) => {
|
|
160
|
+
if (n.isConnected && c(e, n) && !(n.getAttribute("contenteditable") === "false" || n.closest('[contenteditable="false"]'))) {
|
|
161
|
+
if (m(n), u.has(n.tagName)) {
|
|
162
|
+
a(n);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
n.tagName === "SPAN" && n.attributes.length === 0 && a(n);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
export {
|
|
170
|
+
C as ClearFormattingPlugin
|
|
171
|
+
};
|
|
172
|
+
//# sourceMappingURL=ClearFormattingPlugin.native-DIS6AN2t.mjs.map
|