@editora/core 1.0.15 → 1.0.17

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 (68) hide show
  1. package/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-DIKuCeFw.mjs} +82 -79
  2. package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-DXZdK3zr.mjs} +72 -71
  3. package/dist/{ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs → ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs} +239 -238
  4. package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-H3XyYD7_.mjs} +2 -2
  5. package/dist/{BlocksLibraryPlugin.native-5sdsXsiE.mjs → BlocksLibraryPlugin.native-CownM6Rk.mjs} +140 -116
  6. package/dist/{CapitalizationPlugin.native-DLV4oPmB.mjs → CapitalizationPlugin.native-C-HRbXGh.mjs} +10 -5
  7. package/dist/{ChecklistPlugin.native-BS-kMz9O.mjs → ChecklistPlugin.native-NVrBUkaL.mjs} +141 -103
  8. package/dist/{CitationsPlugin.native-DQgoCd1B.mjs → CitationsPlugin.native-C_7wWQ-k.mjs} +441 -422
  9. package/dist/{ClearFormattingPlugin.native-B6ro3a1h.mjs → ClearFormattingPlugin.native-Pp0O-SBf.mjs} +24 -23
  10. package/dist/{CodePlugin.native-knhM8NNo.mjs → CodePlugin.native-BH-K4xmW.mjs} +474 -342
  11. package/dist/CodePlugin.native-hNgfXlfS.mjs +4767 -0
  12. package/dist/CodeSamplePlugin.native-svbAFWh_.mjs +501 -0
  13. package/dist/CollaborationPlugin.native-oSybCGPW.mjs +7468 -0
  14. package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-CLip9wAO.mjs} +233 -185
  15. package/dist/{ConditionalContentPlugin.native-CfhY46rU.mjs → ConditionalContentPlugin.native-Bf7XgRSW.mjs} +401 -351
  16. package/dist/{DataBindingPlugin.native-BoXwghTz.mjs → DataBindingPlugin.native-B7lpI_0c.mjs} +29 -28
  17. package/dist/{DocumentManagerPlugin.native-D1YHQ2NN.mjs → DocumentManagerPlugin.native-iFip6s4Q.mjs} +94 -45
  18. package/dist/{EmbedIframePlugin.native-BF_-LjTq.mjs → EmbedIframePlugin.native-BfZ_HGlV.mjs} +231 -186
  19. package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-D92aaOKi.mjs} +288 -76
  20. package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-M3cNQ0KA.mjs} +57 -50
  21. package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-DsLrH8eq.mjs} +41 -34
  22. package/dist/{FormatPainterPlugin.native-CsMrKfFU.mjs → FormatPainterPlugin.native-BhjzsiVq.mjs} +3 -2
  23. package/dist/{HistoryPlugin.native-D2wl32jV.mjs → HistoryPlugin.native-DPvhks6h.mjs} +36 -32
  24. package/dist/LinkPlugin.native-BsQXYsK6.mjs +352 -0
  25. package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-Bt0LANbO.mjs} +68 -35
  26. package/dist/{MathPlugin.native-NwWPHVmj.mjs → MathPlugin.native-Byo3WL0f.mjs} +211 -115
  27. package/dist/{MediaManagerPlugin.native-eOsTJFpw.mjs → MediaManagerPlugin.native-BT1NZIJS.mjs} +139 -134
  28. package/dist/{MentionPlugin.native-BMDlOqur.mjs → MentionPlugin.native-S_lwGZQO.mjs} +23 -18
  29. package/dist/{MergeTagPlugin.native-BzRVoD9-.mjs → MergeTagPlugin.native-7-6F3S1Y.mjs} +44 -43
  30. package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-CiR51jql.mjs} +31 -28
  31. package/dist/{SlashCommandsPlugin.native-BiN6ODw5.mjs → SlashCommandsPlugin.native-BDIIwGNs.mjs} +90 -79
  32. package/dist/{SmartPastePlugin.native-CZAEHkyt.mjs → SmartPastePlugin.native-BATLCds5.mjs} +89 -85
  33. package/dist/{SpecialCharactersPlugin.native-DaG4b19I.mjs → SpecialCharactersPlugin.native-CdZoc1GB.mjs} +73 -26
  34. package/dist/SpellCheckPlugin.native-Bef2oTLB.mjs +10935 -0
  35. package/dist/TablePlugin.native-BjIxYZ2X.mjs +772 -0
  36. package/dist/{TemplatePlugin.native-DLjFUaPW.mjs → TemplatePlugin.native-D6n5RUnC.mjs} +288 -262
  37. package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-KMZ2uzlq.mjs} +2 -2
  38. package/dist/{TranslationWorkflowPlugin.native-DdF16tgT.mjs → TranslationWorkflowPlugin.native-CZtG--06.mjs} +67 -65
  39. package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-Ca1fMWUJ.mjs} +42 -42
  40. package/dist/anchoredPopover-DJFD2oAP.mjs +116 -0
  41. package/dist/core.css +1 -1
  42. package/dist/dialogHelpers-DBf7WqYH.mjs +40 -0
  43. package/dist/editora.min.js +26 -24
  44. package/dist/editora.umd.js +26 -24
  45. package/dist/escapeHtml-CX8RelZ1.mjs +7 -0
  46. package/dist/historyHelpers-B0-4mq1E.mjs +15 -0
  47. package/dist/index-XsYC_KdJ.mjs +3923 -0
  48. package/dist/index-_eKRBZPq.js +12 -0
  49. package/dist/index.cjs.js +3 -3
  50. package/dist/index.esm.js +17 -14
  51. package/dist/plugin-loader.js +53 -52
  52. package/dist/webcomponent-core.js +2055 -476
  53. package/dist/webcomponent-core.min.css +1 -1
  54. package/dist/webcomponent-core.min.js +96 -66
  55. package/dist/webcomponent.cjs.js +1 -1
  56. package/dist/webcomponent.esm.js +1 -1
  57. package/dist/webcomponent.js +2223 -643
  58. package/dist/webcomponent.min.css +1 -1
  59. package/dist/webcomponent.min.js +1564 -1198
  60. package/index.d.ts +32 -0
  61. package/package.json +10 -3
  62. package/dist/CodeSamplePlugin.native-CgGoH-X4.mjs +0 -384
  63. package/dist/LinkPlugin.native-DYCIcdTm.mjs +0 -283
  64. package/dist/SpellCheckPlugin.native-BZB9AewP.mjs +0 -1039
  65. package/dist/TablePlugin.native-DrHX-efe.mjs +0 -495
  66. package/dist/anchoredPopover-Bxds0VoB.mjs +0 -110
  67. package/dist/index-BLm1MtzH.js +0 -10
  68. package/dist/index-Cd9jEuZP.mjs +0 -2341
@@ -1,283 +0,0 @@
1
- let a = null, u = !1, l = null;
2
- const p = '[data-theme="dark"], .dark, .editora-theme-dark', w = (e) => {
3
- if (!e) return null;
4
- let t = e;
5
- for (; t; ) {
6
- if (t.hasAttribute("contenteditable") && t.getAttribute("contenteditable") === "true" || t.hasAttribute("data-editora-content"))
7
- return t;
8
- t = t.parentElement;
9
- }
10
- return null;
11
- }, C = (e) => {
12
- if (e) {
13
- const o = e.startContainer, n = o.nodeType === Node.ELEMENT_NODE ? o : o.parentElement;
14
- if (n != null && n.closest(p)) return !0;
15
- }
16
- const t = document.activeElement;
17
- return t != null && t.closest(p) ? !0 : document.body.matches(p) || document.documentElement.matches(p);
18
- }, T = () => {
19
- if (document.getElementById("rte-link-dialog-theme-styles")) return;
20
- const e = document.createElement("style");
21
- e.id = "rte-link-dialog-theme-styles", e.textContent = `
22
- .link-dialog-overlay.rte-theme-dark .link-dialog {
23
- background: #1f2937 !important;
24
- border: 1px solid #4b5563 !important;
25
- color: #e2e8f0 !important;
26
- box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6) !important;
27
- }
28
-
29
- .link-dialog-overlay.rte-theme-dark .link-dialog-header {
30
- border-bottom-color: #3b4657 !important;
31
- background: #222d3a !important;
32
- }
33
-
34
- .link-dialog-overlay.rte-theme-dark .link-dialog-header h3,
35
- .link-dialog-overlay.rte-theme-dark label {
36
- color: #e2e8f0 !important;
37
- }
38
-
39
- .link-dialog-overlay.rte-theme-dark .link-dialog-close {
40
- color: #94a3b8 !important;
41
- }
42
-
43
- .link-dialog-overlay.rte-theme-dark .link-dialog-close:hover {
44
- background: #334155 !important;
45
- color: #f8fafc !important;
46
- border-radius: 4px;
47
- }
48
-
49
- .link-dialog-overlay.rte-theme-dark .link-dialog-footer {
50
- border-top-color: #3b4657 !important;
51
- background: #222d3a !important;
52
- }
53
-
54
- .link-dialog-overlay.rte-theme-dark input[type='text'],
55
- .link-dialog-overlay.rte-theme-dark input[type='url'] {
56
- background: #111827 !important;
57
- border-color: #4b5563 !important;
58
- color: #e2e8f0 !important;
59
- }
60
-
61
- .link-dialog-overlay.rte-theme-dark input[type='text']::placeholder,
62
- .link-dialog-overlay.rte-theme-dark input[type='url']::placeholder {
63
- color: #94a3b8 !important;
64
- }
65
-
66
- .link-dialog-overlay.rte-theme-dark .btn-cancel {
67
- background: #334155 !important;
68
- border-color: #4b5563 !important;
69
- color: #e2e8f0 !important;
70
- }
71
-
72
- .link-dialog-overlay.rte-theme-dark .btn-cancel:hover {
73
- background: #475569 !important;
74
- border-color: #64748b !important;
75
- }
76
-
77
- .link-dialog-overlay.rte-theme-dark .btn-submit {
78
- background: #3b82f6 !important;
79
- }
80
-
81
- .link-dialog-overlay.rte-theme-dark .btn-submit:hover {
82
- background: #2563eb !important;
83
- }
84
- `, document.head.appendChild(e);
85
- }, A = (e) => {
86
- if (!a) {
87
- console.warn("No selection range stored");
88
- return;
89
- }
90
- const t = a.startContainer, o = t.nodeType === Node.TEXT_NODE ? t.parentElement : t, n = w(o);
91
- if (n) {
92
- if (u && l) {
93
- l.href = e.url, l.textContent = e.text, l.target = e.target, e.target === "_blank" ? l.setAttribute("rel", "noopener noreferrer") : l.removeAttribute("rel"), e.title ? l.title = e.title : l.removeAttribute("title");
94
- const r = document.createRange();
95
- r.selectNodeContents(l);
96
- const i = window.getSelection();
97
- i && (i.removeAllRanges(), i.addRange(r));
98
- } else {
99
- const r = document.createElement("a");
100
- r.href = e.url, r.textContent = e.text, r.target = e.target, e.target === "_blank" && r.setAttribute("rel", "noopener noreferrer"), e.title && (r.title = e.title), a.deleteContents(), a.insertNode(r), a.setStartAfter(r), a.setEndAfter(r);
101
- const i = window.getSelection();
102
- i && (i.removeAllRanges(), i.addRange(a));
103
- }
104
- n.focus(), a = null, u = !1, l = null;
105
- }
106
- }, k = (e, t) => {
107
- T();
108
- const o = document.createElement("div");
109
- o.className = "link-dialog-overlay", t && o.classList.add("rte-theme-dark"), o.style.cssText = `
110
- position: fixed;
111
- top: 0;
112
- left: 0;
113
- right: 0;
114
- bottom: 0;
115
- background: rgba(0, 0, 0, 0.5);
116
- display: flex;
117
- align-items: center;
118
- justify-content: center;
119
- z-index: 10000;
120
- `;
121
- const n = document.createElement("div");
122
- n.className = "link-dialog", n.style.cssText = `
123
- background: white;
124
- border-radius: 8px;
125
- width: 500px;
126
- max-width: 90%;
127
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
128
- `, n.innerHTML = `
129
- <div class="link-dialog-header" style="padding: 16px 20px; border-bottom: 1px solid #ddd; display: flex; justify-content: space-between; align-items: center;">
130
- <h3 style="margin: 0; font-size: 18px;">${e.isEditing ? "Edit Link" : "Insert Link"}</h3>
131
- <button class="link-dialog-close" style="background: none; border: none; font-size: 24px; cursor: pointer; padding: 0; width: 30px; height: 30px;">×</button>
132
- </div>
133
- <form id="link-form">
134
- <div class="link-dialog-body" style="padding: 20px;">
135
- <div class="form-group" style="margin-bottom: 16px;">
136
- <label for="link-text" style="display: block; margin-bottom: 6px; font-weight: 500;">Link Text:</label>
137
- <input
138
- id="link-text"
139
- type="text"
140
- value="${e.text || ""}"
141
- placeholder="Enter link text"
142
- style="width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; line-height: 1.45; box-sizing: border-box;"
143
- />
144
- </div>
145
- <div class="form-group" style="margin-bottom: 16px;">
146
- <label for="link-url" style="display: block; margin-bottom: 6px; font-weight: 500;">URL:</label>
147
- <input
148
- id="link-url"
149
- type="url"
150
- value="${e.url || ""}"
151
- placeholder="https://example.com"
152
- required
153
- style="width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; line-height: 1.45; box-sizing: border-box;"
154
- />
155
- </div>
156
- <div class="form-group" style="margin-bottom: 16px;">
157
- <label for="link-title" style="display: block; margin-bottom: 6px; font-weight: 500;">Title (optional):</label>
158
- <input
159
- id="link-title"
160
- type="text"
161
- value="${e.title || ""}"
162
- placeholder="Link tooltip text"
163
- style="width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; line-height: 1.45; box-sizing: border-box;"
164
- />
165
- </div>
166
- <div class="form-group" style="margin-bottom: 0;">
167
- <label style="display: flex; align-items: center; cursor: pointer;">
168
- <input
169
- id="link-target"
170
- type="checkbox"
171
- ${e.target === "_blank" ? "checked" : ""}
172
- style="margin-right: 8px;"
173
- />
174
- Open in new window/tab
175
- </label>
176
- </div>
177
- </div>
178
- <div class="link-dialog-footer" style="padding: 12px 20px; border-top: 1px solid #ddd; display: flex; justify-content: flex-end; gap: 10px;">
179
- <button type="button" class="btn-cancel" style="padding: 8px 16px; border: 1px solid #ccc; background: white; border-radius: 4px; cursor: pointer;">Cancel</button>
180
- <button type="submit" class="btn-submit" style="padding: 8px 16px; border: none; background: #007bff; color: white; border-radius: 4px; cursor: pointer;">
181
- ${e.isEditing ? "Update Link" : "Insert Link"}
182
- </button>
183
- </div>
184
- </form>
185
- `, o.appendChild(n), document.body.appendChild(o);
186
- const r = n.querySelector("#link-form"), i = n.querySelector("#link-text"), d = n.querySelector("#link-url"), y = n.querySelector("#link-title"), v = n.querySelector("#link-target"), E = n.querySelector(".link-dialog-close"), L = n.querySelector(".btn-cancel"), b = (s) => {
187
- s.key === "Escape" && (s.preventDefault(), s.stopPropagation(), c());
188
- }, c = () => {
189
- document.removeEventListener("keydown", b, !0), o.remove();
190
- };
191
- E.addEventListener("click", c), L.addEventListener("click", c), o.addEventListener("click", (s) => {
192
- s.target === o && c();
193
- }), document.addEventListener("keydown", b, !0), r.addEventListener("submit", (s) => {
194
- s.preventDefault();
195
- const g = d.value.trim();
196
- g && (A({
197
- text: i.value.trim() || g,
198
- url: g,
199
- target: v.checked ? "_blank" : "_self",
200
- title: y.value.trim() || void 0
201
- }), c());
202
- }), setTimeout(() => i.focus(), 100);
203
- }, x = () => {
204
- const e = window.getSelection();
205
- if (!e || e.rangeCount === 0) return !1;
206
- const t = e.getRangeAt(0).cloneRange();
207
- a = t;
208
- const o = C(t), n = e.toString() || "", r = t.startContainer, i = r.nodeType === Node.TEXT_NODE ? r.parentElement : r, d = i == null ? void 0 : i.closest("a");
209
- return d ? (u = !0, l = d, k({
210
- text: d.textContent || "",
211
- url: d.href,
212
- target: d.target || "_self",
213
- title: d.title || "",
214
- isEditing: !0
215
- }, o)) : (u = !1, l = null, k({
216
- text: n,
217
- url: "",
218
- target: "_self",
219
- isEditing: !1
220
- }, o)), !0;
221
- }, h = () => (document.execCommand("unlink", !1), !0), m = (e, t) => {
222
- var o;
223
- typeof window != "undefined" && ((o = window.registerEditorCommand) == null || o.call(window, e, t));
224
- }, f = () => {
225
- m("openLinkDialog", x), m("removeLink", h), m("createLink", (e) => {
226
- e && document.execCommand("createLink", !1, e);
227
- });
228
- };
229
- typeof window != "undefined" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", f) : f());
230
- const S = () => ({
231
- name: "link",
232
- marks: {
233
- link: {
234
- attrs: {
235
- href: {},
236
- title: { default: null },
237
- target: { default: null }
238
- },
239
- parseDOM: [
240
- {
241
- tag: "a[href]",
242
- getAttrs: (e) => ({
243
- href: e.getAttribute("href"),
244
- title: e.getAttribute("title"),
245
- target: e.getAttribute("target")
246
- })
247
- }
248
- ],
249
- toDOM: (e) => [
250
- "a",
251
- {
252
- href: e.attrs.href,
253
- title: e.attrs.title,
254
- target: e.attrs.target,
255
- rel: e.attrs.target === "_blank" ? "noopener noreferrer" : null
256
- },
257
- 0
258
- ]
259
- }
260
- },
261
- toolbar: [
262
- {
263
- label: "Link",
264
- command: "openLinkDialog",
265
- type: "button",
266
- icon: '<svg width="24" height="24" focusable="false"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2Z" fill-rule="nonzero"></path></svg>',
267
- shortcut: "Mod-k"
268
- }
269
- ],
270
- commands: {
271
- openLinkDialog: x,
272
- removeLink: h
273
- },
274
- keymap: {
275
- "Mod-k": "openLinkDialog"
276
- }
277
- });
278
- export {
279
- S as LinkPlugin,
280
- x as openLinkDialog,
281
- h as removeLink
282
- };
283
- //# sourceMappingURL=LinkPlugin.native-DYCIcdTm.mjs.map