@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,617 +0,0 @@
|
|
|
1
|
-
import N from "./purify.es-3bdbcfc5.mjs";
|
|
2
|
-
let n = null, c = null, f = null, o = null, h = "", v = "", T = "insert", k = null, d = null, b = null;
|
|
3
|
-
function H(t, e) {
|
|
4
|
-
if (e === t.innerHTML)
|
|
5
|
-
return;
|
|
6
|
-
const r = window.execEditorCommand || window.executeEditorCommand;
|
|
7
|
-
if (typeof r == "function")
|
|
8
|
-
try {
|
|
9
|
-
r("recordDomTransaction", t, e, t.innerHTML);
|
|
10
|
-
} catch (l) {
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
function z(t) {
|
|
14
|
-
if (!t)
|
|
15
|
-
return null;
|
|
16
|
-
let e = t.startContainer;
|
|
17
|
-
for (; e && e !== document.body; ) {
|
|
18
|
-
if (e.nodeType === Node.ELEMENT_NODE) {
|
|
19
|
-
const r = e;
|
|
20
|
-
if (r.getAttribute("contenteditable") === "true")
|
|
21
|
-
return r;
|
|
22
|
-
}
|
|
23
|
-
e = e.parentNode;
|
|
24
|
-
}
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
const F = [
|
|
28
|
-
{
|
|
29
|
-
id: "formal-letter",
|
|
30
|
-
name: "Formal Letter",
|
|
31
|
-
category: "Letters",
|
|
32
|
-
description: "Professional business letter template",
|
|
33
|
-
html: `<p><strong>{{ Company Name }}</strong></p>
|
|
34
|
-
<p>{{ Today }}</p>
|
|
35
|
-
<p>Dear {{ first_name }} {{ last_name }},</p>
|
|
36
|
-
<p>I hope this letter finds you well. [Your letter content here]</p>
|
|
37
|
-
<p>Thank you for your time and consideration.</p>
|
|
38
|
-
<p>Sincerely,<br>Your Name</p>`
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id: "meeting-notes",
|
|
42
|
-
name: "Meeting Notes",
|
|
43
|
-
category: "Notes",
|
|
44
|
-
description: "Template for meeting notes with attendees and action items",
|
|
45
|
-
html: `<h2>Meeting Notes - {{ today }}</h2>
|
|
46
|
-
<p><strong>Attendees:</strong> [List attendees]</p>
|
|
47
|
-
<p><strong>Agenda:</strong></p>
|
|
48
|
-
<ul>
|
|
49
|
-
<li>[Item 1]</li>
|
|
50
|
-
<li>[Item 2]</li>
|
|
51
|
-
<li>[Item 3]</li>
|
|
52
|
-
</ul>
|
|
53
|
-
<p><strong>Action Items:</strong></p>
|
|
54
|
-
<ul>
|
|
55
|
-
<li>[Owner]: [Task] - [Due Date]</li>
|
|
56
|
-
</ul>
|
|
57
|
-
<p><strong>Next Meeting:</strong> [Date]</p>`
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: "proposal",
|
|
61
|
-
name: "Project Proposal",
|
|
62
|
-
category: "Business",
|
|
63
|
-
description: "Structured project proposal template",
|
|
64
|
-
html: `<h1>Project Proposal</h1>
|
|
65
|
-
<h2>Executive Summary</h2>
|
|
66
|
-
<p>[Summary of the proposal]</p>
|
|
67
|
-
<h2>Objectives</h2>
|
|
68
|
-
<ul>
|
|
69
|
-
<li>[Objective 1]</li>
|
|
70
|
-
<li>[Objective 2]</li>
|
|
71
|
-
</ul>
|
|
72
|
-
<h2>Scope</h2>
|
|
73
|
-
<p>[Project scope details]</p>
|
|
74
|
-
<h2>Timeline</h2>
|
|
75
|
-
<p>[Project timeline]</p>
|
|
76
|
-
<h2>Budget</h2>
|
|
77
|
-
<p>[Budget details]</p>
|
|
78
|
-
<h2>Contact</h2>
|
|
79
|
-
<p>{{ first_name }} {{ last_name }}<br>{{ email }}<br>{{ phone }}</p>`
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
id: "faq",
|
|
83
|
-
name: "FAQ Template",
|
|
84
|
-
category: "Documentation",
|
|
85
|
-
description: "FAQ document structure",
|
|
86
|
-
html: `<h1>Frequently Asked Questions</h1>
|
|
87
|
-
<h2>General Questions</h2>
|
|
88
|
-
<h3>Q: What is this about?</h3>
|
|
89
|
-
<p>A: [Answer here]</p>
|
|
90
|
-
<h3>Q: Who should use this?</h3>
|
|
91
|
-
<p>A: [Answer here]</p>
|
|
92
|
-
<h2>Technical Questions</h2>
|
|
93
|
-
<h3>Q: How do I get started?</h3>
|
|
94
|
-
<p>A: [Answer here]</p>
|
|
95
|
-
<h3>Q: What are the requirements?</h3>
|
|
96
|
-
<p>A: [Answer here]</p>`
|
|
97
|
-
}
|
|
98
|
-
];
|
|
99
|
-
let x = [...F];
|
|
100
|
-
const D = () => x, U = (t) => x.filter((e) => e.category === t), R = () => {
|
|
101
|
-
const t = new Set(x.map((e) => e.category));
|
|
102
|
-
return Array.from(t);
|
|
103
|
-
}, P = (t) => {
|
|
104
|
-
const e = t.toLowerCase();
|
|
105
|
-
return x.filter(
|
|
106
|
-
(r) => {
|
|
107
|
-
var l, p;
|
|
108
|
-
return r.name.toLowerCase().includes(e) || ((l = r.description) == null ? void 0 : l.toLowerCase().includes(e)) || ((p = r.tags) == null ? void 0 : p.some((s) => s.toLowerCase().includes(e)));
|
|
109
|
-
}
|
|
110
|
-
);
|
|
111
|
-
}, $ = (t) => N.sanitize(t, {
|
|
112
|
-
ALLOWED_TAGS: ["p", "br", "strong", "em", "u", "h1", "h2", "h3", "h4", "ul", "ol", "li", "blockquote", "table", "thead", "tbody", "tr", "th", "td", "a", "span"],
|
|
113
|
-
ALLOWED_ATTR: ["href", "target", "class", "data-key", "data-category"]
|
|
114
|
-
}), X = (t) => x.some((e) => e.id === t.id) ? (console.warn(`Template with ID ${t.id} already exists`), !1) : (x.push(t), !0), ee = (t) => !!(t.id && t.name && t.category && t.html && t.html.trim().length > 0);
|
|
115
|
-
function _(t) {
|
|
116
|
-
c = document.createElement("div"), c.className = "rte-dialog-overlay", O(t) && c.classList.add("rte-ui-theme-dark"), c.addEventListener("click", () => u()), n = document.createElement("div"), n.className = "rte-dialog rte-template-dialog", n.addEventListener("click", (r) => r.stopPropagation());
|
|
117
|
-
const e = R();
|
|
118
|
-
e.length > 0 && !h && (h = e[0]), E(), c.appendChild(n), document.body.appendChild(c), I(), Y();
|
|
119
|
-
}
|
|
120
|
-
function I() {
|
|
121
|
-
V(), k = (t) => {
|
|
122
|
-
t.key === "Escape" && (!c || !n || (t.preventDefault(), t.stopPropagation(), u()));
|
|
123
|
-
}, document.addEventListener("keydown", k, !0);
|
|
124
|
-
}
|
|
125
|
-
function V() {
|
|
126
|
-
k && (document.removeEventListener("keydown", k, !0), k = null);
|
|
127
|
-
}
|
|
128
|
-
const Q = '[data-theme="dark"], .dark, .editora-theme-dark', C = () => {
|
|
129
|
-
const t = window.getSelection();
|
|
130
|
-
if (!t || t.rangeCount === 0)
|
|
131
|
-
return null;
|
|
132
|
-
const e = t.anchorNode, r = e instanceof HTMLElement ? e : e == null ? void 0 : e.parentElement;
|
|
133
|
-
return (r == null ? void 0 : r.closest(
|
|
134
|
-
".rte-content, .editora-content"
|
|
135
|
-
)) || null;
|
|
136
|
-
}, O = (t) => {
|
|
137
|
-
const e = t || C();
|
|
138
|
-
return e ? !!e.closest(Q) : !1;
|
|
139
|
-
};
|
|
140
|
-
function A() {
|
|
141
|
-
const t = z(f);
|
|
142
|
-
if (t)
|
|
143
|
-
return t;
|
|
144
|
-
if (b != null && b.isConnected)
|
|
145
|
-
return b;
|
|
146
|
-
const e = C();
|
|
147
|
-
return e || document.querySelector(".rte-content, .editora-content");
|
|
148
|
-
}
|
|
149
|
-
function E() {
|
|
150
|
-
if (!n)
|
|
151
|
-
return;
|
|
152
|
-
const t = R(), e = S();
|
|
153
|
-
n.innerHTML = `
|
|
154
|
-
<div class="rte-dialog-header">
|
|
155
|
-
<h2>Insert Template</h2>
|
|
156
|
-
<button class="rte-dialog-close" aria-label="Close">✕</button>
|
|
157
|
-
</div>
|
|
158
|
-
|
|
159
|
-
<div class="rte-dialog-body">
|
|
160
|
-
<!-- Search -->
|
|
161
|
-
<input
|
|
162
|
-
type="text"
|
|
163
|
-
placeholder="Search templates..."
|
|
164
|
-
value="${v}"
|
|
165
|
-
class="rte-input rte-template-search"
|
|
166
|
-
aria-label="Search templates"
|
|
167
|
-
/>
|
|
168
|
-
|
|
169
|
-
<!-- Category Tabs -->
|
|
170
|
-
<div class="rte-tabs">
|
|
171
|
-
${t.map((r) => `
|
|
172
|
-
<button class="rte-tab ${h === r ? "active" : ""}" data-category="${r}">
|
|
173
|
-
${r}
|
|
174
|
-
</button>
|
|
175
|
-
`).join("")}
|
|
176
|
-
</div>
|
|
177
|
-
|
|
178
|
-
<!-- Template List -->
|
|
179
|
-
<div class="rte-template-list">
|
|
180
|
-
${e.length > 0 ? e.map((r) => `
|
|
181
|
-
<div
|
|
182
|
-
class="rte-template-item ${(o == null ? void 0 : o.id) === r.id ? "selected" : ""}"
|
|
183
|
-
data-template-id="${r.id}"
|
|
184
|
-
>
|
|
185
|
-
<div class="template-name">${r.name}</div>
|
|
186
|
-
${r.description ? `<div class="template-description">${r.description}</div>` : ""}
|
|
187
|
-
</div>
|
|
188
|
-
`).join("") : '<div class="rte-empty-state">No templates found</div>'}
|
|
189
|
-
</div>
|
|
190
|
-
|
|
191
|
-
<!-- Preview -->
|
|
192
|
-
${o ? `
|
|
193
|
-
<div class="rte-template-preview">
|
|
194
|
-
<strong>Preview:</strong>
|
|
195
|
-
<div class="template-preview-content">${o.html}</div>
|
|
196
|
-
</div>
|
|
197
|
-
` : ""}
|
|
198
|
-
|
|
199
|
-
<!-- Insert Mode Toggle -->
|
|
200
|
-
<div class="rte-insert-mode">
|
|
201
|
-
<label>
|
|
202
|
-
<input type="radio" name="insertMode" value="insert" ${T === "insert" ? "checked" : ""} />
|
|
203
|
-
Insert at cursor
|
|
204
|
-
</label>
|
|
205
|
-
<label>
|
|
206
|
-
<input type="radio" name="insertMode" value="replace" ${T === "replace" ? "checked" : ""} />
|
|
207
|
-
Replace document
|
|
208
|
-
</label>
|
|
209
|
-
</div>
|
|
210
|
-
</div>
|
|
211
|
-
|
|
212
|
-
<div class="rte-dialog-footer">
|
|
213
|
-
<button class="rte-button-secondary rte-cancel-btn">Cancel</button>
|
|
214
|
-
<button class="rte-button-primary rte-insert-btn" ${o ? "" : "disabled"}>
|
|
215
|
-
${T === "insert" ? "Insert" : "Replace"}
|
|
216
|
-
</button>
|
|
217
|
-
</div>
|
|
218
|
-
`, Z();
|
|
219
|
-
}
|
|
220
|
-
function W() {
|
|
221
|
-
if (!n)
|
|
222
|
-
return;
|
|
223
|
-
n.innerHTML = `
|
|
224
|
-
<div class="rte-dialog-header">
|
|
225
|
-
<h2>Replace Document?</h2>
|
|
226
|
-
</div>
|
|
227
|
-
<div class="rte-dialog-body">
|
|
228
|
-
<p>This will replace your current document content. Continue?</p>
|
|
229
|
-
</div>
|
|
230
|
-
<div class="rte-dialog-footer">
|
|
231
|
-
<button class="rte-button-secondary rte-cancel-warning-btn">Cancel</button>
|
|
232
|
-
<button class="rte-button-primary rte-confirm-replace-btn">Replace</button>
|
|
233
|
-
</div>
|
|
234
|
-
`;
|
|
235
|
-
const t = n.querySelector(".rte-cancel-warning-btn"), e = n.querySelector(".rte-confirm-replace-btn");
|
|
236
|
-
t == null || t.addEventListener("click", () => E()), e == null || e.addEventListener("click", () => G());
|
|
237
|
-
}
|
|
238
|
-
function S() {
|
|
239
|
-
const t = D();
|
|
240
|
-
return v.trim() ? P(v) : h ? t.filter((e) => e.category === h) : t;
|
|
241
|
-
}
|
|
242
|
-
function Z() {
|
|
243
|
-
if (!n)
|
|
244
|
-
return;
|
|
245
|
-
const t = n.querySelector(".rte-dialog-close");
|
|
246
|
-
t == null || t.addEventListener("click", () => u());
|
|
247
|
-
const e = n.querySelector(".rte-cancel-btn");
|
|
248
|
-
e == null || e.addEventListener("click", () => u());
|
|
249
|
-
const r = n.querySelector(".rte-insert-btn");
|
|
250
|
-
r == null || r.addEventListener("click", () => L());
|
|
251
|
-
const l = n.querySelector(".rte-template-search");
|
|
252
|
-
l == null || l.addEventListener("input", (a) => {
|
|
253
|
-
d !== null && cancelAnimationFrame(d), v = a.target.value, d = requestAnimationFrame(() => {
|
|
254
|
-
d = null, M();
|
|
255
|
-
});
|
|
256
|
-
}), l == null || l.addEventListener("keydown", (a) => {
|
|
257
|
-
a.key === "Enter" && o ? L() : a.key === "Escape" && u();
|
|
258
|
-
});
|
|
259
|
-
const p = n.querySelector(".rte-tabs");
|
|
260
|
-
p == null || p.addEventListener("click", (a) => {
|
|
261
|
-
const y = a.target.closest(".rte-tab");
|
|
262
|
-
if (!y)
|
|
263
|
-
return;
|
|
264
|
-
const w = y.getAttribute("data-category");
|
|
265
|
-
w && (h = w, v = "", d !== null && (cancelAnimationFrame(d), d = null), M());
|
|
266
|
-
});
|
|
267
|
-
const s = n.querySelector(".rte-template-list"), m = (a) => {
|
|
268
|
-
const y = a.target.closest(".rte-template-item");
|
|
269
|
-
if (!y)
|
|
270
|
-
return null;
|
|
271
|
-
const w = y.getAttribute("data-template-id");
|
|
272
|
-
return w && D().find((q) => q.id === w) || null;
|
|
273
|
-
};
|
|
274
|
-
s == null || s.addEventListener("click", (a) => {
|
|
275
|
-
const i = m(a);
|
|
276
|
-
i && (o = i, E());
|
|
277
|
-
}), s == null || s.addEventListener("dblclick", (a) => {
|
|
278
|
-
const i = m(a);
|
|
279
|
-
i && (o = i, L());
|
|
280
|
-
});
|
|
281
|
-
const g = n.querySelector(".rte-insert-mode");
|
|
282
|
-
g == null || g.addEventListener("change", (a) => {
|
|
283
|
-
const i = a.target;
|
|
284
|
-
!i || i.name !== "insertMode" || (T = i.value, E());
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
function M() {
|
|
288
|
-
const t = S();
|
|
289
|
-
t.length > 0 ? (!o || !t.find((e) => e.id === o.id)) && (o = t[0]) : o = null, E();
|
|
290
|
-
}
|
|
291
|
-
function L() {
|
|
292
|
-
var t;
|
|
293
|
-
if (o)
|
|
294
|
-
if (T === "replace") {
|
|
295
|
-
const e = A();
|
|
296
|
-
if ((t = e == null ? void 0 : e.innerHTML) != null && t.trim()) {
|
|
297
|
-
W();
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
j(o), u();
|
|
301
|
-
} else
|
|
302
|
-
K(o), u();
|
|
303
|
-
}
|
|
304
|
-
function G() {
|
|
305
|
-
o && (j(o), u());
|
|
306
|
-
}
|
|
307
|
-
function K(t) {
|
|
308
|
-
var g;
|
|
309
|
-
const e = window.getSelection();
|
|
310
|
-
if (!e)
|
|
311
|
-
return;
|
|
312
|
-
const r = A();
|
|
313
|
-
if (!r)
|
|
314
|
-
return;
|
|
315
|
-
if (f)
|
|
316
|
-
e.removeAllRanges(), e.addRange(f);
|
|
317
|
-
else {
|
|
318
|
-
const a = document.createRange();
|
|
319
|
-
a.selectNodeContents(r), a.collapse(!1), e.removeAllRanges(), e.addRange(a);
|
|
320
|
-
}
|
|
321
|
-
if (e.rangeCount === 0)
|
|
322
|
-
return;
|
|
323
|
-
const l = e.getRangeAt(0), p = (g = r == null ? void 0 : r.innerHTML) != null ? g : "", s = document.createRange().createContextualFragment($(t.html));
|
|
324
|
-
l.deleteContents(), l.insertNode(s);
|
|
325
|
-
const m = document.createRange();
|
|
326
|
-
m.setStartAfter(l.endContainer), m.collapse(!0), e.removeAllRanges(), e.addRange(m), r && (H(r, p), r.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
327
|
-
}
|
|
328
|
-
function j(t) {
|
|
329
|
-
const e = A();
|
|
330
|
-
if (e) {
|
|
331
|
-
const r = e.innerHTML;
|
|
332
|
-
e.innerHTML = $(t.html), H(e, r), e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
function u() {
|
|
336
|
-
V(), d !== null && (cancelAnimationFrame(d), d = null), c && (c.remove(), c = null), n = null, f = null, v = "", b = null;
|
|
337
|
-
}
|
|
338
|
-
function B(t) {
|
|
339
|
-
const e = window.getSelection();
|
|
340
|
-
e && e.rangeCount > 0 ? f = e.getRangeAt(0).cloneRange() : f = null;
|
|
341
|
-
const r = S();
|
|
342
|
-
r.length > 0 && !o && (o = r[0]);
|
|
343
|
-
const l = (t == null ? void 0 : t.contentElement) instanceof HTMLElement ? t.contentElement : C();
|
|
344
|
-
b = l || null, _(l);
|
|
345
|
-
}
|
|
346
|
-
function Y() {
|
|
347
|
-
if (typeof document == "undefined")
|
|
348
|
-
return;
|
|
349
|
-
const t = "template-plugin-dialog-styles";
|
|
350
|
-
if (document.getElementById(t))
|
|
351
|
-
return;
|
|
352
|
-
const e = document.createElement("style");
|
|
353
|
-
e.id = t, e.textContent = `
|
|
354
|
-
.rte-dialog-overlay {
|
|
355
|
-
--rte-tmpl-overlay-bg: rgba(15, 23, 36, 0.56);
|
|
356
|
-
--rte-tmpl-dialog-bg: #fff;
|
|
357
|
-
--rte-tmpl-dialog-text: #101828;
|
|
358
|
-
--rte-tmpl-border: #d6dbe4;
|
|
359
|
-
--rte-tmpl-subtle-bg: #f7f9fc;
|
|
360
|
-
--rte-tmpl-subtle-hover: #eef2f7;
|
|
361
|
-
--rte-tmpl-muted-text: #5f6b7d;
|
|
362
|
-
--rte-tmpl-accent: #1976d2;
|
|
363
|
-
--rte-tmpl-accent-strong: #1565c0;
|
|
364
|
-
--rte-tmpl-ring: rgba(31, 117, 254, 0.18);
|
|
365
|
-
position: fixed;
|
|
366
|
-
top: 0;
|
|
367
|
-
left: 0;
|
|
368
|
-
right: 0;
|
|
369
|
-
bottom: 0;
|
|
370
|
-
background-color: var(--rte-tmpl-overlay-bg);
|
|
371
|
-
backdrop-filter: blur(2px);
|
|
372
|
-
display: flex;
|
|
373
|
-
align-items: center;
|
|
374
|
-
justify-content: center;
|
|
375
|
-
z-index: 10000;
|
|
376
|
-
padding: 16px;
|
|
377
|
-
box-sizing: border-box;
|
|
378
|
-
}
|
|
379
|
-
.rte-dialog-overlay.rte-ui-theme-dark {
|
|
380
|
-
--rte-tmpl-overlay-bg: rgba(2, 8, 20, 0.72);
|
|
381
|
-
--rte-tmpl-dialog-bg: #202938;
|
|
382
|
-
--rte-tmpl-dialog-text: #e8effc;
|
|
383
|
-
--rte-tmpl-border: #49566c;
|
|
384
|
-
--rte-tmpl-subtle-bg: #2a3444;
|
|
385
|
-
--rte-tmpl-subtle-hover: #344256;
|
|
386
|
-
--rte-tmpl-muted-text: #a5b1c5;
|
|
387
|
-
--rte-tmpl-accent: #58a6ff;
|
|
388
|
-
--rte-tmpl-accent-strong: #4598f4;
|
|
389
|
-
--rte-tmpl-ring: rgba(88, 166, 255, 0.22);
|
|
390
|
-
}
|
|
391
|
-
.rte-template-dialog {
|
|
392
|
-
background: var(--rte-tmpl-dialog-bg);
|
|
393
|
-
color: var(--rte-tmpl-dialog-text);
|
|
394
|
-
border: 1px solid var(--rte-tmpl-border);
|
|
395
|
-
border-radius: 12px;
|
|
396
|
-
box-shadow: 0 24px 48px rgba(10, 15, 24, 0.28);
|
|
397
|
-
width: 600px;
|
|
398
|
-
max-height: 700px;
|
|
399
|
-
display: flex;
|
|
400
|
-
flex-direction: column;
|
|
401
|
-
overflow: hidden;
|
|
402
|
-
}
|
|
403
|
-
.rte-dialog-header {
|
|
404
|
-
display: flex;
|
|
405
|
-
justify-content: space-between;
|
|
406
|
-
align-items: center;
|
|
407
|
-
padding: 16px 20px;
|
|
408
|
-
border-bottom: 1px solid var(--rte-tmpl-border);
|
|
409
|
-
background: linear-gradient(180deg, rgba(127, 154, 195, 0.08) 0%, rgba(127, 154, 195, 0) 100%);
|
|
410
|
-
}
|
|
411
|
-
.rte-dialog-header h2 {
|
|
412
|
-
margin: 0;
|
|
413
|
-
font-size: 18px;
|
|
414
|
-
font-weight: 600;
|
|
415
|
-
color: var(--rte-tmpl-dialog-text);
|
|
416
|
-
}
|
|
417
|
-
.rte-dialog-close {
|
|
418
|
-
background: none;
|
|
419
|
-
border: none;
|
|
420
|
-
font-size: 24px;
|
|
421
|
-
cursor: pointer;
|
|
422
|
-
color: var(--rte-tmpl-muted-text);
|
|
423
|
-
padding: 0;
|
|
424
|
-
width: 32px;
|
|
425
|
-
height: 32px;
|
|
426
|
-
display: flex;
|
|
427
|
-
align-items: center;
|
|
428
|
-
justify-content: center;
|
|
429
|
-
border-radius: 8px;
|
|
430
|
-
transition: background-color 0.16s ease, color 0.16s ease;
|
|
431
|
-
}
|
|
432
|
-
.rte-dialog-close:hover {
|
|
433
|
-
background-color: var(--rte-tmpl-subtle-hover);
|
|
434
|
-
color: var(--rte-tmpl-dialog-text);
|
|
435
|
-
}
|
|
436
|
-
.rte-dialog-body {
|
|
437
|
-
padding: 20px;
|
|
438
|
-
flex: 1;
|
|
439
|
-
overflow-y: auto;
|
|
440
|
-
}
|
|
441
|
-
.rte-input {
|
|
442
|
-
width: 100%;
|
|
443
|
-
padding: 8px 12px;
|
|
444
|
-
border: 1px solid var(--rte-tmpl-border);
|
|
445
|
-
border-radius: 4px;
|
|
446
|
-
font-size: 14px;
|
|
447
|
-
box-sizing: border-box;
|
|
448
|
-
background: var(--rte-tmpl-subtle-bg);
|
|
449
|
-
color: var(--rte-tmpl-dialog-text);
|
|
450
|
-
}
|
|
451
|
-
.rte-input:focus {
|
|
452
|
-
outline: none;
|
|
453
|
-
border-color: var(--rte-tmpl-accent);
|
|
454
|
-
}
|
|
455
|
-
.rte-tabs {
|
|
456
|
-
display: flex;
|
|
457
|
-
gap: 8px;
|
|
458
|
-
margin-top: 12px;
|
|
459
|
-
border-bottom: 1px solid var(--rte-tmpl-border);
|
|
460
|
-
padding-bottom: 8px;
|
|
461
|
-
}
|
|
462
|
-
.rte-tab {
|
|
463
|
-
padding: 6px 12px;
|
|
464
|
-
border: none;
|
|
465
|
-
background: none;
|
|
466
|
-
cursor: pointer;
|
|
467
|
-
font-size: 14px;
|
|
468
|
-
color: var(--rte-tmpl-muted-text);
|
|
469
|
-
border-bottom: 2px solid transparent;
|
|
470
|
-
transition: all 0.2s;
|
|
471
|
-
}
|
|
472
|
-
.rte-tab:hover {
|
|
473
|
-
color: var(--rte-tmpl-dialog-text);
|
|
474
|
-
}
|
|
475
|
-
.rte-tab.active {
|
|
476
|
-
color: var(--rte-tmpl-accent);
|
|
477
|
-
border-bottom-color: var(--rte-tmpl-accent);
|
|
478
|
-
font-weight: 600;
|
|
479
|
-
}
|
|
480
|
-
.rte-template-list {
|
|
481
|
-
border: 1px solid var(--rte-tmpl-border);
|
|
482
|
-
border-radius: 4px;
|
|
483
|
-
max-height: 250px;
|
|
484
|
-
overflow-y: auto;
|
|
485
|
-
margin: 12px 0;
|
|
486
|
-
background: var(--rte-tmpl-subtle-bg);
|
|
487
|
-
}
|
|
488
|
-
.rte-template-item {
|
|
489
|
-
padding: 12px;
|
|
490
|
-
border-bottom: 1px solid var(--rte-tmpl-border);
|
|
491
|
-
cursor: pointer;
|
|
492
|
-
transition: background-color 0.2s;
|
|
493
|
-
background: none;
|
|
494
|
-
}
|
|
495
|
-
.rte-template-item:last-child {
|
|
496
|
-
border-bottom: none;
|
|
497
|
-
}
|
|
498
|
-
.rte-template-item:hover,
|
|
499
|
-
.rte-template-item.selected {
|
|
500
|
-
background-color: var(--rte-tmpl-subtle-hover);
|
|
501
|
-
}
|
|
502
|
-
.template-name {
|
|
503
|
-
font-weight: 600;
|
|
504
|
-
color: var(--rte-tmpl-dialog-text);
|
|
505
|
-
margin-bottom: 4px;
|
|
506
|
-
}
|
|
507
|
-
.template-description {
|
|
508
|
-
font-size: 12px;
|
|
509
|
-
color: var(--rte-tmpl-muted-text);
|
|
510
|
-
}
|
|
511
|
-
.rte-template-preview {
|
|
512
|
-
padding: 12px;
|
|
513
|
-
background-color: var(--rte-tmpl-subtle-bg);
|
|
514
|
-
border: 1px solid var(--rte-tmpl-border);
|
|
515
|
-
border-radius: 4px;
|
|
516
|
-
margin-top: 12px;
|
|
517
|
-
max-height: 200px;
|
|
518
|
-
overflow-y: auto;
|
|
519
|
-
}
|
|
520
|
-
.template-preview-content {
|
|
521
|
-
font-size: 13px;
|
|
522
|
-
line-height: 1.5;
|
|
523
|
-
margin-top: 8px;
|
|
524
|
-
}
|
|
525
|
-
.template-preview-content * {
|
|
526
|
-
margin: 4px 0;
|
|
527
|
-
}
|
|
528
|
-
.rte-insert-mode {
|
|
529
|
-
margin-top: 12px;
|
|
530
|
-
padding: 12px;
|
|
531
|
-
background-color: var(--rte-tmpl-subtle-bg);
|
|
532
|
-
border-radius: 4px;
|
|
533
|
-
display: flex;
|
|
534
|
-
gap: 16px;
|
|
535
|
-
}
|
|
536
|
-
.rte-insert-mode label {
|
|
537
|
-
display: flex;
|
|
538
|
-
align-items: center;
|
|
539
|
-
cursor: pointer;
|
|
540
|
-
font-size: 14px;
|
|
541
|
-
}
|
|
542
|
-
.rte-insert-mode input {
|
|
543
|
-
margin-right: 6px;
|
|
544
|
-
cursor: pointer;
|
|
545
|
-
}
|
|
546
|
-
.rte-empty-state {
|
|
547
|
-
padding: 40px;
|
|
548
|
-
text-align: center;
|
|
549
|
-
color: var(--rte-tmpl-muted-text);
|
|
550
|
-
font-size: 14px;
|
|
551
|
-
}
|
|
552
|
-
.rte-dialog-footer {
|
|
553
|
-
padding: 16px 20px;
|
|
554
|
-
border-top: 1px solid var(--rte-tmpl-border);
|
|
555
|
-
background: var(--rte-tmpl-subtle-bg);
|
|
556
|
-
display: flex;
|
|
557
|
-
justify-content: flex-end;
|
|
558
|
-
gap: 12px;
|
|
559
|
-
}
|
|
560
|
-
.rte-button-primary {
|
|
561
|
-
padding: 8px 16px;
|
|
562
|
-
border: none;
|
|
563
|
-
border-radius: 4px;
|
|
564
|
-
font-size: 14px;
|
|
565
|
-
cursor: pointer;
|
|
566
|
-
background-color: var(--rte-tmpl-accent);
|
|
567
|
-
color: white;
|
|
568
|
-
transition: all 0.2s;
|
|
569
|
-
}
|
|
570
|
-
.rte-button-primary:hover:not([disabled]) {
|
|
571
|
-
background-color: var(--rte-tmpl-accent-strong);
|
|
572
|
-
}
|
|
573
|
-
.rte-button-primary[disabled] {
|
|
574
|
-
opacity: 0.5;
|
|
575
|
-
cursor: not-allowed;
|
|
576
|
-
}
|
|
577
|
-
.rte-button-secondary {
|
|
578
|
-
padding: 8px 16px;
|
|
579
|
-
border: 1px solid var(--rte-tmpl-border);
|
|
580
|
-
border-radius: 4px;
|
|
581
|
-
font-size: 14px;
|
|
582
|
-
cursor: pointer;
|
|
583
|
-
background-color: var(--rte-tmpl-subtle-bg);
|
|
584
|
-
color: var(--rte-tmpl-dialog-text);
|
|
585
|
-
transition: all 0.2s;
|
|
586
|
-
}
|
|
587
|
-
.rte-button-secondary:hover {
|
|
588
|
-
background-color: var(--rte-tmpl-subtle-hover);
|
|
589
|
-
}
|
|
590
|
-
`, document.head.appendChild(e);
|
|
591
|
-
}
|
|
592
|
-
const te = () => ({
|
|
593
|
-
name: "template",
|
|
594
|
-
toolbar: [
|
|
595
|
-
{
|
|
596
|
-
label: "Template",
|
|
597
|
-
command: "insertTemplate",
|
|
598
|
-
icon: '<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path fill-rule="evenodd" clip-rule="evenodd" d="M3 3V9H21V3H3ZM19 5H5V7H19V5Z" fill="#000000"></path> <path fill-rule="evenodd" clip-rule="evenodd" d="M3 11V21H11V11H3ZM9 13H5V19H9V13Z" fill="#000000"></path> <path d="M21 11H13V13H21V11Z" fill="#000000"></path> <path d="M13 15H21V17H13V15Z" fill="#000000"></path> <path d="M21 19H13V21H21V19Z" fill="#000000"></path> </g></svg>'
|
|
599
|
-
}
|
|
600
|
-
],
|
|
601
|
-
commands: {
|
|
602
|
-
insertTemplate: (t, e) => (B(e), !0)
|
|
603
|
-
},
|
|
604
|
-
keymap: {}
|
|
605
|
-
});
|
|
606
|
-
export {
|
|
607
|
-
F as PREDEFINED_TEMPLATES,
|
|
608
|
-
te as TemplatePlugin,
|
|
609
|
-
X as addCustomTemplate,
|
|
610
|
-
D as getAllTemplates,
|
|
611
|
-
R as getTemplateCategories,
|
|
612
|
-
U as getTemplatesByCategory,
|
|
613
|
-
$ as sanitizeTemplate,
|
|
614
|
-
P as searchTemplates,
|
|
615
|
-
ee as validateTemplate
|
|
616
|
-
};
|
|
617
|
-
//# sourceMappingURL=TemplatePlugin.native-580f0f63.mjs.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
var u = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : {};
|
|
2
|
-
function f(e) {
|
|
3
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
-
}
|
|
5
|
-
function s(e) {
|
|
6
|
-
if (e.__esModule)
|
|
7
|
-
return e;
|
|
8
|
-
var r = e.default;
|
|
9
|
-
if (typeof r == "function") {
|
|
10
|
-
var t = function o() {
|
|
11
|
-
return this instanceof o ? Reflect.construct(r, arguments, this.constructor) : r.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
t.prototype = r.prototype;
|
|
14
|
-
} else
|
|
15
|
-
t = {};
|
|
16
|
-
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(o) {
|
|
17
|
-
var n = Object.getOwnPropertyDescriptor(e, o);
|
|
18
|
-
Object.defineProperty(t, o, n.get ? n : {
|
|
19
|
-
enumerable: !0,
|
|
20
|
-
get: function() {
|
|
21
|
-
return e[o];
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}), t;
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
f as a,
|
|
28
|
-
u as c,
|
|
29
|
-
s as g
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=_commonjsHelpers-69d58be2.mjs.map
|