@editora/core 1.0.8 → 1.0.10

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