@editora/core 1.0.6 → 1.0.7

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 (43) hide show
  1. package/dist/{AnchorPlugin.native-C1Rw5m04.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +129 -105
  2. package/dist/{BackgroundColorPlugin.native-BE-p9DRd.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +119 -122
  3. package/dist/CodePlugin.native-DlpTPdkd.mjs +2691 -0
  4. package/dist/{CommentsPlugin.native-tMnWn8a2.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +153 -135
  5. package/dist/{DocumentManagerPlugin.native-BvZL5CSG.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +43 -43
  6. package/dist/{EmbedIframePlugin.native-CSWIB1jm.mjs → EmbedIframePlugin.native-DKJx2OS7.mjs} +61 -58
  7. package/dist/{EmojisPlugin.native-DxTm_DL-.mjs → EmojisPlugin.native-CitxxlWX.mjs} +135 -104
  8. package/dist/{LinkPlugin.native-CS2g-G18.mjs → LinkPlugin.native-DYCIcdTm.mjs} +47 -45
  9. package/dist/{MathPlugin.native-KUxz0o8C.mjs → MathPlugin.native-f_mDp8VL.mjs} +149 -108
  10. package/dist/{MediaManagerPlugin.native-CgP5iInD.mjs → MediaManagerPlugin.native-BiXiK8FC.mjs} +238 -217
  11. package/dist/MergeTagPlugin.native-C3eOfEgw.mjs +559 -0
  12. package/dist/{PageBreakPlugin.native-CGiQxXqR.mjs → PageBreakPlugin.native-CXdX5fAv.mjs} +77 -68
  13. package/dist/{SpecialCharactersPlugin.native-DANrbExJ.mjs → SpecialCharactersPlugin.native-CZDato89.mjs} +143 -98
  14. package/dist/{SpellCheckPlugin.native-C8bPvRHy.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +239 -219
  15. package/dist/{TemplatePlugin.native-4lKEm-WY.mjs → TemplatePlugin.native-CrpfKRJ8.mjs} +167 -143
  16. package/dist/{TextColorPlugin.native-Clgtb50j.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +134 -118
  17. package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
  18. package/dist/anchoredPopover-Bxds0VoB.mjs +110 -0
  19. package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
  20. package/dist/editora.min.js +10 -10
  21. package/dist/editora.umd.js +10 -10
  22. package/dist/html2canvas.esm-AYkPY5LS.mjs +4803 -0
  23. package/dist/{index-CqWQFb3D.js → index-BpE6GFbz.js} +4 -4
  24. package/dist/index-BslAFzmv.mjs +16544 -0
  25. package/dist/{index-OwnkG39N.mjs → index-yzU4NdPT.mjs} +200 -183
  26. package/dist/index.cjs.js +1 -1
  27. package/dist/{index.es-CuicffkQ.mjs → index.es-BYD2KEo6.mjs} +5 -4
  28. package/dist/index.esm.js +2 -2
  29. package/dist/jspdf.es.min-BJGtOnRT.mjs +7890 -0
  30. package/dist/plugin-loader.js +15 -15
  31. package/dist/webcomponent-core.js +241 -224
  32. package/dist/webcomponent-core.min.css +1 -1
  33. package/dist/webcomponent-core.min.js +86 -106
  34. package/dist/webcomponent.cjs.js +1 -1
  35. package/dist/webcomponent.esm.js +1 -1
  36. package/dist/webcomponent.js +205 -188
  37. package/dist/webcomponent.min.css +1 -1
  38. package/dist/webcomponent.min.js +477 -402
  39. package/package.json +1 -1
  40. package/dist/CodePlugin.native-B263UI8O.mjs +0 -2173
  41. package/dist/MergeTagPlugin.native-DIGWhdnF.mjs +0 -419
  42. package/dist/colorSelectionApply-CK1My9N2.mjs +0 -67
  43. package/dist/documentManager-irzj9n3V.mjs +0 -37627
@@ -6,6 +6,7 @@ const D = [
6
6
  { label: "Responsive - 1x1", value: "1x1" }
7
7
  ], u = '[data-theme="dark"], .dark, .editora-theme-dark', h = /* @__PURE__ */ new WeakMap(), s = (e) => (h.has(e) || h.set(e, {
8
8
  dialogElement: null,
9
+ escapeHandler: null,
9
10
  activeTab: "general",
10
11
  formData: {
11
12
  src: "",
@@ -27,7 +28,7 @@ function q(e) {
27
28
  const t = document.activeElement;
28
29
  return t != null && t.closest(u) ? !0 : document.body.matches(u) || document.documentElement.matches(u);
29
30
  }
30
- const H = () => ({
31
+ const A = () => ({
31
32
  name: "embedIframe",
32
33
  toolbar: [
33
34
  {
@@ -39,16 +40,16 @@ const H = () => ({
39
40
  }
40
41
  ],
41
42
  commands: {
42
- openEmbedIframeDialog: (e) => (C(e), !0)
43
+ openEmbedIframeDialog: (e) => (L(e), !0)
43
44
  },
44
45
  keymap: {
45
46
  "Mod-Shift-e": "openEmbedIframeDialog"
46
47
  }
47
48
  });
48
- function C(e) {
49
+ function L(e) {
49
50
  if (!e) {
50
- const o = document.activeElement;
51
- o && o.closest("[data-editora-editor]") && (e = o.closest("[data-editora-editor]"));
51
+ const a = document.activeElement;
52
+ a && a.closest("[data-editora-editor]") && (e = a.closest("[data-editora-editor]"));
52
53
  }
53
54
  if (e || (e = document.querySelector("[data-editora-editor]")), !e) {
54
55
  console.warn("Editor element not found");
@@ -68,10 +69,10 @@ function C(e) {
68
69
  showBorder: !0,
69
70
  enableScrollbar: !0
70
71
  }, t.activeTab = "general";
71
- const a = document.createElement("div");
72
- a.className = "rte-dialog-overlay rte-embed-iframe-overlay", q(e) && a.classList.add("rte-theme-dark"), a.onclick = () => p(e);
72
+ const o = document.createElement("div");
73
+ o.className = "rte-dialog-overlay rte-embed-iframe-overlay", q(e) && o.classList.add("rte-theme-dark"), o.onclick = () => p(e);
73
74
  const r = document.createElement("div");
74
- r.className = "rte-dialog-content embed-iframe-dialog", r.onclick = (o) => o.stopPropagation(), r.innerHTML = `
75
+ r.className = "rte-dialog-content embed-iframe-dialog", r.onclick = (a) => a.stopPropagation(), r.innerHTML = `
75
76
  <div class="rte-dialog-header">
76
77
  <h3>Embed Iframe</h3>
77
78
  <button class="rte-dialog-close">×</button>
@@ -91,7 +92,7 @@ function C(e) {
91
92
  <div class="rte-form-group">
92
93
  <label class="rte-form-label">Size</label>
93
94
  <select class="rte-form-select" id="iframe-size">
94
- ${D.map((o) => `<option value="${o.value}">${o.label}</option>`).join("")}
95
+ ${D.map((a) => `<option value="${a.value}">${a.label}</option>`).join("")}
95
96
  </select>
96
97
  </div>
97
98
  <div class="rte-form-row" id="dimensions-row">
@@ -145,71 +146,73 @@ function C(e) {
145
146
  <button type="button" class="rte-btn rte-btn-secondary" id="cancel-btn">Cancel</button>
146
147
  <button type="submit" class="rte-btn rte-btn-primary" id="save-btn">Save</button>
147
148
  </div>
148
- `, a.appendChild(r), document.body.appendChild(a), t.dialogElement = a, L(r, e), A(), setTimeout(() => {
149
- var o;
150
- (o = r.querySelector("#iframe-src")) == null || o.focus();
149
+ `, o.appendChild(r), document.body.appendChild(o), t.dialogElement = o, t.escapeHandler = (a) => {
150
+ a.key === "Escape" && (a.preventDefault(), a.stopPropagation(), p(e));
151
+ }, document.addEventListener("keydown", t.escapeHandler, !0), $(r, e), T(), setTimeout(() => {
152
+ var a;
153
+ (a = r.querySelector("#iframe-src")) == null || a.focus();
151
154
  }, 100);
152
155
  }
153
- function L(e, t) {
156
+ function $(e, t) {
154
157
  var l, i, d, f;
155
158
  s(t), (l = e.querySelector(".rte-dialog-close")) == null || l.addEventListener("click", () => p(t)), e.querySelectorAll(".rte-tab-button").forEach((n) => {
156
159
  n.addEventListener("click", (m) => {
157
160
  const c = m.target.getAttribute("data-tab");
158
- c && $(e, c, t);
161
+ c && C(e, c, t);
159
162
  });
160
163
  });
161
- const a = e.querySelector("#iframe-size");
162
- a == null || a.addEventListener("change", (n) => z(e, n.target.value, t));
163
- const r = e.querySelector("#iframe-width"), o = e.querySelector("#iframe-height");
164
- r == null || r.addEventListener("input", (n) => I(e, n.target.value, t)), o == null || o.addEventListener("input", (n) => R(e, n.target.value, t)), (i = e.querySelector("#constrain-btn")) == null || i.addEventListener("click", () => E(e, t)), (d = e.querySelector("#cancel-btn")) == null || d.addEventListener("click", () => p(t)), (f = e.querySelector("#save-btn")) == null || f.addEventListener("click", () => P(e, t));
164
+ const o = e.querySelector("#iframe-size");
165
+ o == null || o.addEventListener("change", (n) => H(e, n.target.value, t));
166
+ const r = e.querySelector("#iframe-width"), a = e.querySelector("#iframe-height");
167
+ r == null || r.addEventListener("input", (n) => z(e, n.target.value, t)), a == null || a.addEventListener("input", (n) => E(e, n.target.value, t)), (i = e.querySelector("#constrain-btn")) == null || i.addEventListener("click", () => I(e, t)), (d = e.querySelector("#cancel-btn")) == null || d.addEventListener("click", () => p(t)), (f = e.querySelector("#save-btn")) == null || f.addEventListener("click", () => P(e, t));
165
168
  }
166
- function $(e, t, a) {
167
- const r = s(a);
168
- r.activeTab = t, e.querySelectorAll(".rte-tab-button").forEach((o) => {
169
- o.classList.toggle("active", o.getAttribute("data-tab") === t);
170
- }), e.querySelectorAll(".rte-tab-panel").forEach((o) => {
171
- o.style.display = o.getAttribute("data-panel") === t ? "block" : "none";
169
+ function C(e, t, o) {
170
+ const r = s(o);
171
+ r.activeTab = t, e.querySelectorAll(".rte-tab-button").forEach((a) => {
172
+ a.classList.toggle("active", a.getAttribute("data-tab") === t);
173
+ }), e.querySelectorAll(".rte-tab-panel").forEach((a) => {
174
+ a.style.display = a.getAttribute("data-panel") === t ? "block" : "none";
172
175
  });
173
176
  }
174
- function z(e, t, a) {
175
- const r = s(a);
177
+ function H(e, t, o) {
178
+ const r = s(o);
176
179
  r.formData.selectedSize = t;
177
- const o = e.querySelector("#dimensions-row"), l = e.querySelector("#iframe-width"), i = e.querySelector("#iframe-height");
178
- t === "inline" ? (o.style.display = "flex", l.value = "100%", i.value = "400px", r.formData.width = "100%", r.formData.height = "400px") : (o.style.display = "none", r.formData.width = "100%", r.formData.height = "auto");
180
+ const a = e.querySelector("#dimensions-row"), l = e.querySelector("#iframe-width"), i = e.querySelector("#iframe-height");
181
+ t === "inline" ? (a.style.display = "flex", l.value = "100%", i.value = "400px", r.formData.width = "100%", r.formData.height = "400px") : (a.style.display = "none", r.formData.width = "100%", r.formData.height = "auto");
179
182
  }
180
- function I(e, t, a) {
181
- const r = s(a);
183
+ function z(e, t, o) {
184
+ const r = s(o);
182
185
  if (r.formData.width = t, r.formData.constrainProportions && r.formData.selectedSize === "inline") {
183
- const o = parseFloat(t);
184
- if (!isNaN(o)) {
185
- const l = o * 9 / 16;
186
+ const a = parseFloat(t);
187
+ if (!isNaN(a)) {
188
+ const l = a * 9 / 16;
186
189
  r.formData.height = `${l}px`;
187
190
  const i = e.querySelector("#iframe-height");
188
191
  i && (i.value = r.formData.height);
189
192
  }
190
193
  }
191
194
  }
192
- function R(e, t, a) {
193
- const r = s(a);
195
+ function E(e, t, o) {
196
+ const r = s(o);
194
197
  if (r.formData.height = t, r.formData.constrainProportions && r.formData.selectedSize === "inline") {
195
- const o = parseFloat(t);
196
- if (!isNaN(o)) {
197
- const l = o * 16 / 9;
198
+ const a = parseFloat(t);
199
+ if (!isNaN(a)) {
200
+ const l = a * 16 / 9;
198
201
  r.formData.width = `${l}px`;
199
202
  const i = e.querySelector("#iframe-width");
200
203
  i && (i.value = r.formData.width);
201
204
  }
202
205
  }
203
206
  }
204
- function E(e, t) {
205
- const a = s(t);
206
- a.formData.constrainProportions = !a.formData.constrainProportions;
207
+ function I(e, t) {
208
+ const o = s(t);
209
+ o.formData.constrainProportions = !o.formData.constrainProportions;
207
210
  const r = e.querySelector("#constrain-btn");
208
- r && (r.textContent = a.formData.constrainProportions ? "🔒" : "🔓", r.className = `rte-constrain-btn ${a.formData.constrainProportions ? "locked" : "unlocked"}`, r.title = a.formData.constrainProportions ? "Unlock proportions" : "Lock proportions");
211
+ r && (r.textContent = o.formData.constrainProportions ? "🔒" : "🔓", r.className = `rte-constrain-btn ${o.formData.constrainProportions ? "locked" : "unlocked"}`, r.title = o.formData.constrainProportions ? "Unlock proportions" : "Lock proportions");
209
212
  }
210
213
  function P(e, t) {
211
214
  var c, b, g, v, x, y, k, w, S;
212
- const a = s(t), r = (c = e.querySelector("#iframe-src")) == null ? void 0 : c.value.trim();
215
+ const o = s(t), r = (c = e.querySelector("#iframe-src")) == null ? void 0 : c.value.trim();
213
216
  if (!r) {
214
217
  alert("Please enter a source URL");
215
218
  return;
@@ -218,25 +221,25 @@ function P(e, t) {
218
221
  alert("Please enter a valid URL starting with https:// or http://");
219
222
  return;
220
223
  }
221
- const o = (b = e.querySelector("#iframe-name")) == null ? void 0 : b.value.trim(), l = (g = e.querySelector("#iframe-title")) == null ? void 0 : g.value.trim(), i = (v = e.querySelector("#iframe-longdesc")) == null ? void 0 : v.value.trim();
224
+ const a = (b = e.querySelector("#iframe-name")) == null ? void 0 : b.value.trim(), l = (g = e.querySelector("#iframe-title")) == null ? void 0 : g.value.trim(), i = (v = e.querySelector("#iframe-longdesc")) == null ? void 0 : v.value.trim();
222
225
  (x = e.querySelector("#iframe-desc-url")) == null || x.value.trim();
223
226
  const d = (k = (y = e.querySelector("#iframe-border")) == null ? void 0 : y.checked) != null ? k : !0, f = (S = (w = e.querySelector("#iframe-scrollbar")) == null ? void 0 : w.checked) != null ? S : !0;
224
- let n = a.formData.width, m = a.formData.height;
225
- a.formData.selectedSize !== "inline" && (n = "100%", m = "auto"), T(t, {
227
+ let n = o.formData.width, m = o.formData.height;
228
+ o.formData.selectedSize !== "inline" && (n = "100%", m = "auto"), R(t, {
226
229
  src: r,
227
230
  width: n,
228
231
  height: m,
229
- aspectRatio: a.formData.selectedSize,
230
- name: o || void 0,
232
+ aspectRatio: o.formData.selectedSize,
233
+ name: a || void 0,
231
234
  title: l || void 0,
232
235
  longDescription: i || void 0,
233
236
  showBorder: d,
234
237
  enableScrollbar: f
235
238
  }), p(t);
236
239
  }
237
- function T(e, t) {
238
- const a = e.querySelector('[contenteditable="true"]');
239
- a && (a.focus(), setTimeout(() => {
240
+ function R(e, t) {
241
+ const o = e.querySelector('[contenteditable="true"]');
242
+ o && (o.focus(), setTimeout(() => {
240
243
  const r = [
241
244
  `src="${t.src}"`,
242
245
  `width="${t.width}"`,
@@ -246,9 +249,9 @@ function T(e, t) {
246
249
  `scrolling="${t.enableScrollbar ? "auto" : "no"}"`
247
250
  ];
248
251
  t.name && r.push(`name="${t.name}"`), t.title && r.push(`title="${t.title}"`), t.longDescription && r.push(`longdesc="${t.longDescription}"`);
249
- const o = [];
250
- t.aspectRatio !== "inline" && o.push(`rte-iframe-${t.aspectRatio}`);
251
- const l = o.length > 0 ? `class="${o.join(" ")}"` : "", i = `data-aspect-ratio="${t.aspectRatio}"`, d = `<iframe ${r.join(" ")} ${l} ${i}></iframe>`;
252
+ const a = [];
253
+ t.aspectRatio !== "inline" && a.push(`rte-iframe-${t.aspectRatio}`);
254
+ const l = a.length > 0 ? `class="${a.join(" ")}"` : "", i = `data-aspect-ratio="${t.aspectRatio}"`, d = `<iframe ${r.join(" ")} ${l} ${i}></iframe>`;
252
255
  if (!document.execCommand("insertHTML", !1, d)) {
253
256
  const n = window.getSelection();
254
257
  if (n && n.rangeCount > 0) {
@@ -266,9 +269,9 @@ function T(e, t) {
266
269
  }
267
270
  function p(e) {
268
271
  const t = s(e);
269
- t.dialogElement && (document.body.removeChild(t.dialogElement), t.dialogElement = null);
272
+ t.escapeHandler && (document.removeEventListener("keydown", t.escapeHandler, !0), t.escapeHandler = null), t.dialogElement && (t.dialogElement.remove(), t.dialogElement = null);
270
273
  }
271
- function A() {
274
+ function T() {
272
275
  if (document.getElementById("embed-iframe-dialog-styles")) return;
273
276
  const e = document.createElement("style");
274
277
  e.id = "embed-iframe-dialog-styles", e.textContent = `
@@ -560,6 +563,6 @@ function A() {
560
563
  `, document.head.appendChild(e);
561
564
  }
562
565
  export {
563
- H as EmbedIframePlugin
566
+ A as EmbedIframePlugin
564
567
  };
565
- //# sourceMappingURL=EmbedIframePlugin.native-CSWIB1jm.mjs.map
568
+ //# sourceMappingURL=EmbedIframePlugin.native-DKJx2OS7.mjs.map
@@ -1,4 +1,4 @@
1
- const d = {
1
+ const p = {
2
2
  all: {
3
3
  name: "All",
4
4
  emojis: [
@@ -540,7 +540,7 @@ const d = {
540
540
  "🇳🇿"
541
541
  ]
542
542
  }
543
- }, j = {
543
+ }, w = {
544
544
  "💙": "blue heart",
545
545
  "💚": "green heart",
546
546
  "💛": "yellow heart",
@@ -688,8 +688,8 @@ const d = {
688
688
  "🧹": "broom",
689
689
  "🧸": "teddy bear"
690
690
  };
691
- let l = null, n = "all", c = "", s = null;
692
- const h = '[data-theme="dark"], .dark, .editora-theme-dark', E = () => ({
691
+ let g = null, s = "all", u = "", n = null, l = null, d = null;
692
+ const y = '[data-theme="dark"], .dark, .editora-theme-dark', C = () => ({
693
693
  name: "emojis",
694
694
  toolbar: [
695
695
  {
@@ -701,17 +701,17 @@ const h = '[data-theme="dark"], .dark, .editora-theme-dark', E = () => ({
701
701
  }
702
702
  ],
703
703
  commands: {
704
- openEmojiDialog: (r, o) => {
705
- const e = (o == null ? void 0 : o.contentElement) || u();
706
- return e ? (v(e), !0) : !1;
704
+ openEmojiDialog: (r, t) => {
705
+ const e = (t == null ? void 0 : t.contentElement) || b();
706
+ return e ? (E(e), !0) : !1;
707
707
  },
708
- insertEmoji: (r, o) => {
708
+ insertEmoji: (r, t) => {
709
709
  if (!r) return !1;
710
- const e = (o == null ? void 0 : o.contentElement) || u();
710
+ const e = (t == null ? void 0 : t.contentElement) || b();
711
711
  if (!e) return !1;
712
712
  try {
713
- return p(r, e), !0;
714
- } catch (t) {
713
+ return k(r, e), !0;
714
+ } catch (o) {
715
715
  return !1;
716
716
  }
717
717
  }
@@ -720,25 +720,25 @@ const h = '[data-theme="dark"], .dark, .editora-theme-dark', E = () => ({
720
720
  "Mod-Shift-j": "openEmojiDialog"
721
721
  }
722
722
  });
723
- function v(r) {
724
- n = "all", c = "";
725
- const o = window.getSelection();
726
- s = null, o && o.rangeCount > 0 && r.contains(o.anchorNode) && (s = o.getRangeAt(0).cloneRange());
723
+ function E(r) {
724
+ m(), s = "all", u = "";
725
+ const t = window.getSelection();
726
+ l = null, t && t.rangeCount > 0 && r.contains(t.anchorNode) && (l = t.getRangeAt(0).cloneRange());
727
727
  const e = document.createElement("div");
728
- e.className = "emojis-overlay", y(r) && e.classList.add("rte-ui-theme-dark"), e.onclick = g;
729
- const t = document.createElement("div");
730
- t.className = "emojis-dialog", t.setAttribute("role", "dialog"), t.setAttribute("aria-modal", "true"), t.onclick = (a) => a.stopPropagation();
731
- const i = Object.keys(d);
732
- t.innerHTML = `
728
+ e.className = "emojis-overlay", A(r) && e.classList.add("rte-ui-theme-dark"), e.onclick = m;
729
+ const o = document.createElement("div");
730
+ o.className = "emojis-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.onclick = (i) => i.stopPropagation();
731
+ const a = Object.keys(p);
732
+ o.innerHTML = `
733
733
  <div class="rte-dialog-header emojis-header">
734
734
  <h3>Insert Emojis</h3>
735
735
  <button class="rte-dialog-close emojis-close">×</button>
736
736
  </div>
737
737
  <div class="rte-dialog-body emojis-content">
738
738
  <div class="emojis-tabs">
739
- ${i.map((a) => `
740
- <button class="emojis-tab ${a === n ? "active" : ""}" data-category="${a}">
741
- ${d[a].name}
739
+ ${a.map((i) => `
740
+ <button class="emojis-tab ${i === s ? "active" : ""}" data-category="${i}">
741
+ ${p[i].name}
742
742
  </button>
743
743
  `).join("")}
744
744
  </div>
@@ -756,82 +756,88 @@ function v(r) {
756
756
  />
757
757
  </div>
758
758
  <div class="emojis-grid" id="emojis-grid">
759
- ${f(n, c)}
759
+ ${x(s, u)}
760
760
  </div>
761
761
  </div>
762
762
  </div>
763
- `, e.appendChild(t), document.body.appendChild(e), l = e, x(t, r), k(), setTimeout(() => {
764
- var a;
765
- (a = t.querySelector("#emoji-search-input")) == null || a.focus();
766
- }, 100);
763
+ `, e.appendChild(o), document.body.appendChild(e), g = e, d = (i) => {
764
+ i.key === "Escape" && (i.preventDefault(), i.stopPropagation(), m());
765
+ }, document.addEventListener("keydown", d, !0), z(o, r), L(), requestAnimationFrame(() => {
766
+ var i;
767
+ (i = o.querySelector("#emoji-search-input")) == null || i.focus();
768
+ });
767
769
  }
768
- function x(r, o) {
769
- var t;
770
- (t = r.querySelector(".emojis-close")) == null || t.addEventListener("click", g), r.querySelectorAll(".emojis-tab").forEach((i) => {
771
- i.addEventListener("click", (a) => {
772
- const b = a.target.getAttribute("data-category");
773
- b && w(r, b, o);
770
+ function z(r, t) {
771
+ var a;
772
+ (a = r.querySelector(".emojis-close")) == null || a.addEventListener("click", m), r.querySelectorAll(".emojis-tab").forEach((i) => {
773
+ i.addEventListener("click", (f) => {
774
+ const c = f.target.getAttribute("data-category");
775
+ c && S(r, c);
774
776
  });
775
777
  });
776
778
  const e = r.querySelector("#emoji-search-input");
777
779
  e == null || e.addEventListener("input", (i) => {
778
- c = i.target.value, m(r, o);
779
- }), m(r, o);
780
+ u = i.target.value, n !== null && window.clearTimeout(n), n = window.setTimeout(() => {
781
+ n = null, v(r);
782
+ }, 90);
783
+ });
784
+ const o = r.querySelector("#emojis-grid");
785
+ o == null || o.addEventListener("click", (i) => {
786
+ var j;
787
+ const c = i.target.closest(".emojis-item");
788
+ if (!c) return;
789
+ const h = c.getAttribute("data-emoji") || ((j = c.textContent) == null ? void 0 : j.trim()) || "";
790
+ h && (k(h, t), m());
791
+ });
780
792
  }
781
- function w(r, o, e) {
782
- n = o, r.querySelectorAll(".emojis-tab").forEach((t) => {
783
- t.classList.toggle("active", t.getAttribute("data-category") === o);
784
- }), m(r, e);
793
+ function S(r, t) {
794
+ s = t, r.querySelectorAll(".emojis-tab").forEach((e) => {
795
+ e.classList.toggle("active", e.getAttribute("data-category") === t);
796
+ }), v(r);
785
797
  }
786
- function m(r, o) {
787
- const e = r.querySelector("#emojis-grid");
788
- e && (e.innerHTML = f(n, c), e.querySelectorAll(".emojis-item").forEach((t) => {
789
- t.addEventListener("click", () => {
790
- var a;
791
- const i = ((a = t.textContent) == null ? void 0 : a.trim()) || "";
792
- i && (p(i, o), g());
793
- });
794
- }));
798
+ function v(r) {
799
+ const t = r.querySelector("#emojis-grid");
800
+ t && (t.innerHTML = x(s, u));
795
801
  }
796
- function f(r, o) {
797
- let e = d[r].emojis;
798
- return o.trim() && (e = e.filter((t) => t.toLowerCase().includes(o.toLowerCase()) ? !0 : (j[t] || "").toLowerCase().includes(o.toLowerCase()))), e.length === 0 && o.trim() ? `<div class="emojis-no-results">No emojis found for "${o}"</div>` : e.map((t, i) => `
802
+ function x(r, t) {
803
+ let e = p[r].emojis;
804
+ return t.trim() && (e = e.filter((o) => o.toLowerCase().includes(t.toLowerCase()) ? !0 : (w[o] || "").toLowerCase().includes(t.toLowerCase()))), e.length === 0 && t.trim() ? `<div class="emojis-no-results">No emojis found for "${t}"</div>` : e.map((o, a) => `
799
805
  <button
800
806
  class="emojis-item"
801
- title="Insert ${t}"
802
- data-emoji="${t}"
807
+ title="Insert ${o}"
808
+ data-emoji="${o}"
803
809
  >
804
- ${t}
810
+ ${o}
805
811
  </button>
806
812
  `).join("");
807
813
  }
808
- function g() {
809
- l && (document.body.removeChild(l), l = null);
814
+ function m() {
815
+ d && (document.removeEventListener("keydown", d, !0), d = null), n !== null && (window.clearTimeout(n), n = null), g && (g.remove(), g = null);
810
816
  }
811
- function p(r, o) {
812
- o.focus();
817
+ function k(r, t) {
818
+ t.focus();
813
819
  let e = window.getSelection();
814
- if (s && (e == null || e.removeAllRanges(), e == null || e.addRange(s), s = null), e = window.getSelection(), e && e.rangeCount > 0) {
815
- const t = e.getRangeAt(0);
816
- t.deleteContents();
817
- const i = document.createTextNode(r);
818
- t.insertNode(i), t.setStartAfter(i), t.setEndAfter(i), e.removeAllRanges(), e.addRange(t);
820
+ if (l && (e == null || e.removeAllRanges(), e == null || e.addRange(l), l = null), e = window.getSelection(), e && e.rangeCount > 0) {
821
+ const o = e.getRangeAt(0);
822
+ o.deleteContents();
823
+ const a = document.createTextNode(r);
824
+ o.insertNode(a), o.setStartAfter(a), o.setEndAfter(a), e.removeAllRanges(), e.addRange(o);
819
825
  }
820
826
  }
821
- function u() {
827
+ function b() {
822
828
  const r = window.getSelection();
823
829
  if (r && r.rangeCount > 0) {
824
- const e = r.anchorNode, t = e instanceof HTMLElement ? e : e == null ? void 0 : e.parentElement, i = t == null ? void 0 : t.closest(".editora-content, .rte-content");
825
- if (i) return i;
830
+ const e = r.anchorNode, o = e instanceof HTMLElement ? e : e == null ? void 0 : e.parentElement, a = o == null ? void 0 : o.closest(".editora-content, .rte-content");
831
+ if (a) return a;
826
832
  }
827
- const o = document.activeElement;
828
- return o && (o.classList.contains("editora-content") || o.classList.contains("rte-content")) ? o : document.querySelector(".editora-content, .rte-content");
833
+ const t = document.activeElement;
834
+ return t && (t.classList.contains("editora-content") || t.classList.contains("rte-content")) ? t : document.querySelector(".editora-content, .rte-content");
829
835
  }
830
- function y(r) {
831
- const o = r || u();
832
- return o ? !!o.closest(h) : !1;
836
+ function A(r) {
837
+ const t = r || b();
838
+ return t ? !!t.closest(y) : !1;
833
839
  }
834
- function k() {
840
+ function L() {
835
841
  if (document.getElementById("emojis-dialog-styles")) return;
836
842
  const r = document.createElement("style");
837
843
  r.id = "emojis-dialog-styles", r.textContent = `
@@ -846,6 +852,26 @@ function k() {
846
852
  --rte-emoji-accent: #1f75fe;
847
853
  --rte-emoji-accent-strong: #165fd6;
848
854
  --rte-emoji-ring: rgba(31, 117, 254, 0.18);
855
+ --rte-picker-dialog-width: min(640px, 96vw);
856
+ --rte-picker-dialog-max-height: min(560px, 86vh);
857
+ --rte-picker-dialog-radius: 12px;
858
+ --rte-picker-search-wrap-padding: 12px;
859
+ --rte-picker-search-height: 38px;
860
+ --rte-picker-search-font-size: 13px;
861
+ --rte-picker-search-radius: 8px;
862
+ --rte-picker-tabs-width: 156px;
863
+ --rte-picker-tab-padding-y: 10px;
864
+ --rte-picker-tab-padding-x: 12px;
865
+ --rte-picker-tab-font-size: 13px;
866
+ --rte-picker-grid-padding: 12px;
867
+ --rte-picker-grid-gap: 6px;
868
+ --rte-picker-cell-size: 34px;
869
+ --rte-picker-cell-font-size: 17px;
870
+ --rte-picker-cell-radius: 7px;
871
+ --rte-picker-mobile-tab-min-width: 82px;
872
+ --rte-picker-mobile-cell-size: 32px;
873
+ --rte-picker-mobile-grid-gap: 5px;
874
+ --rte-picker-mobile-dialog-max-height: 88vh;
849
875
  position: fixed;
850
876
  top: 0;
851
877
  left: 0;
@@ -856,7 +882,7 @@ function k() {
856
882
  display: flex;
857
883
  align-items: center;
858
884
  justify-content: center;
859
- z-index: 1000;
885
+ z-index: 10000;
860
886
  padding: 16px;
861
887
  box-sizing: border-box;
862
888
  }
@@ -878,11 +904,10 @@ function k() {
878
904
  background: var(--rte-emoji-dialog-bg);
879
905
  color: var(--rte-emoji-dialog-text);
880
906
  border: 1px solid var(--rte-emoji-border);
881
- border-radius: 12px;
907
+ border-radius: var(--rte-picker-dialog-radius);
882
908
  box-shadow: 0 24px 48px rgba(10, 15, 24, 0.28);
883
- max-width: 800px;
884
- width: 90%;
885
- max-height: 80vh;
909
+ width: var(--rte-picker-dialog-width);
910
+ max-height: var(--rte-picker-dialog-max-height);
886
911
  display: flex;
887
912
  flex-direction: column;
888
913
  overflow: hidden;
@@ -920,31 +945,34 @@ function k() {
920
945
  display: flex;
921
946
  flex-direction: column;
922
947
  overflow: hidden;
948
+ min-width: 0;
923
949
  }
924
950
 
925
951
  .emojis-search {
926
- padding: 16px 16px 0 16px;
952
+ padding: var(--rte-picker-search-wrap-padding) var(--rte-picker-search-wrap-padding) 0 var(--rte-picker-search-wrap-padding);
927
953
  position: relative;
928
954
  }
929
955
 
930
956
  .emojis-search-icon {
931
957
  position: absolute;
932
- left: 28px;
933
- top: 27px;
958
+ left: 24px;
959
+ top: 22px;
934
960
  color: var(--rte-emoji-muted-text);
935
961
  pointer-events: none;
936
962
  z-index: 1;
937
963
  }
938
964
 
939
965
  .emojis-search-input {
940
- width: calc(100% - 24px);
941
- padding: 10px 12px 10px 40px;
966
+ width: 100%;
967
+ height: var(--rte-picker-search-height);
968
+ padding: 8px 12px 8px 36px;
942
969
  border: 1px solid var(--rte-emoji-border);
943
- border-radius: 8px;
944
- font-size: 14px;
970
+ border-radius: var(--rte-picker-search-radius);
971
+ font-size: var(--rte-picker-search-font-size);
945
972
  color: var(--rte-emoji-dialog-text);
946
973
  background-color: var(--rte-emoji-subtle-bg);
947
974
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
975
+ box-sizing: border-box;
948
976
  }
949
977
 
950
978
  .emojis-search-input:focus {
@@ -964,21 +992,23 @@ function k() {
964
992
  .emojis-tabs {
965
993
  display: flex;
966
994
  flex-direction: column;
967
- width: 180px;
995
+ width: var(--rte-picker-tabs-width);
968
996
  border-right: 1px solid var(--rte-emoji-border);
969
997
  background-color: var(--rte-emoji-subtle-bg);
998
+ overflow-y: auto;
970
999
  }
971
1000
 
972
1001
  .emojis-tab {
973
- padding: 12px 16px;
1002
+ padding: var(--rte-picker-tab-padding-y) var(--rte-picker-tab-padding-x);
974
1003
  border: none;
975
1004
  background: none;
976
1005
  text-align: left;
977
1006
  cursor: pointer;
978
- font-size: 14px;
1007
+ font-size: var(--rte-picker-tab-font-size);
979
1008
  color: var(--rte-emoji-muted-text);
980
1009
  border-bottom: 1px solid var(--rte-emoji-border);
981
1010
  transition: all 0.2s ease;
1011
+ line-height: 1.25;
982
1012
  }
983
1013
 
984
1014
  .emojis-tab:hover {
@@ -997,24 +1027,25 @@ function k() {
997
1027
  }
998
1028
 
999
1029
  .emojis-grid {
1000
- padding: 16px;
1030
+ padding: var(--rte-picker-grid-padding);
1001
1031
  overflow-y: auto;
1002
1032
  display: grid;
1003
- grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
1004
- gap: 8px;
1033
+ grid-template-columns: repeat(auto-fill, minmax(var(--rte-picker-cell-size), 1fr));
1034
+ gap: var(--rte-picker-grid-gap);
1035
+ contain: content;
1005
1036
  }
1006
1037
 
1007
1038
  .emojis-item {
1008
- width: 40px;
1009
- height: 40px;
1039
+ width: var(--rte-picker-cell-size);
1040
+ height: var(--rte-picker-cell-size);
1010
1041
  display: flex;
1011
1042
  align-items: center;
1012
1043
  justify-content: center;
1013
1044
  border: 1px solid var(--rte-emoji-border);
1014
1045
  background: var(--rte-emoji-subtle-bg);
1015
- border-radius: 8px;
1046
+ border-radius: var(--rte-picker-cell-radius);
1016
1047
  cursor: pointer;
1017
- font-size: 18px;
1048
+ font-size: var(--rte-picker-cell-font-size);
1018
1049
  transition: all 0.2s ease;
1019
1050
  color: var(--rte-emoji-dialog-text);
1020
1051
  }
@@ -1044,8 +1075,8 @@ function k() {
1044
1075
  /* Responsive design */
1045
1076
  @media (max-width: 768px) {
1046
1077
  .emojis-dialog {
1047
- width: 95%;
1048
- max-height: 90vh;
1078
+ width: 96%;
1079
+ max-height: var(--rte-picker-mobile-dialog-max-height);
1049
1080
  }
1050
1081
 
1051
1082
  .emojis-content {
@@ -1064,23 +1095,23 @@ function k() {
1064
1095
  border-bottom: none;
1065
1096
  border-right: 1px solid var(--rte-emoji-border);
1066
1097
  white-space: nowrap;
1067
- min-width: 80px;
1098
+ min-width: var(--rte-picker-mobile-tab-min-width);
1068
1099
  }
1069
1100
 
1070
1101
  .emojis-grid {
1071
- grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
1072
- gap: 6px;
1102
+ grid-template-columns: repeat(auto-fill, minmax(var(--rte-picker-mobile-cell-size), 1fr));
1103
+ gap: var(--rte-picker-mobile-grid-gap);
1073
1104
  }
1074
1105
 
1075
1106
  .emojis-item {
1076
- width: 36px;
1077
- height: 36px;
1107
+ width: var(--rte-picker-mobile-cell-size);
1108
+ height: var(--rte-picker-mobile-cell-size);
1078
1109
  font-size: 16px;
1079
1110
  }
1080
1111
  }
1081
1112
  `, document.head.appendChild(r);
1082
1113
  }
1083
1114
  export {
1084
- E as EmojisPlugin
1115
+ C as EmojisPlugin
1085
1116
  };
1086
- //# sourceMappingURL=EmojisPlugin.native-DxTm_DL-.mjs.map
1117
+ //# sourceMappingURL=EmojisPlugin.native-CitxxlWX.mjs.map