@editora/core 1.0.7 → 1.0.8

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 (34) hide show
  1. package/LICENSE +21 -0
  2. package/dist/ApprovalWorkflowPlugin.native-C3jtAYjG.mjs +1076 -0
  3. package/dist/BlocksLibraryPlugin.native-HMWKxWNs.mjs +1327 -0
  4. package/dist/CitationsPlugin.native-BnU0qCwR.mjs +1464 -0
  5. package/dist/ConditionalContentPlugin.native-CfhY46rU.mjs +1367 -0
  6. package/dist/ContentRulesPlugin.native-nBLQ8QFZ.mjs +1099 -0
  7. package/dist/DataBindingPlugin.native-jQ1JPRTp.mjs +917 -0
  8. package/dist/DocSchemaPlugin.native-CHOge18O.mjs +1325 -0
  9. package/dist/MentionPlugin.native-BMDlOqur.mjs +734 -0
  10. package/dist/PIIRedactionPlugin.native-DcsjmtV1.mjs +1396 -0
  11. package/dist/{PageBreakPlugin.native-CXdX5fAv.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +37 -37
  12. package/dist/{PreviewPlugin.native-DBvfpmIv.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +30 -30
  13. package/dist/SlashCommandsPlugin.native-CmxvMEaE.mjs +755 -0
  14. package/dist/SmartPastePlugin.native-BOKKtF07.mjs +1398 -0
  15. package/dist/TrackChangesPlugin.native-Bghu2q4a.mjs +761 -0
  16. package/dist/TranslationWorkflowPlugin.native-Bz6jDGvj.mjs +1728 -0
  17. package/dist/VersionDiffPlugin.native-Bvxgy--t.mjs +776 -0
  18. package/dist/editora.min.js +13 -13
  19. package/dist/editora.umd.js +13 -13
  20. package/dist/index-D1LOqg5C.js +10 -0
  21. package/dist/{index-yzU4NdPT.mjs → index-DqC57IEH.mjs} +424 -331
  22. package/dist/index.cjs.js +1 -1
  23. package/dist/index.esm.js +2 -2
  24. package/dist/plugin-loader.js +77 -40
  25. package/dist/webcomponent-core.js +479 -386
  26. package/dist/webcomponent-core.min.css +1 -1
  27. package/dist/webcomponent-core.min.js +39 -39
  28. package/dist/webcomponent.cjs.js +1 -1
  29. package/dist/webcomponent.esm.js +1 -1
  30. package/dist/webcomponent.js +417 -287
  31. package/dist/webcomponent.min.css +1 -1
  32. package/dist/webcomponent.min.js +5664 -394
  33. package/package.json +2 -2
  34. package/dist/index-BpE6GFbz.js +0 -10
@@ -1,4 +1,4 @@
1
- const u = '.rte-page-break[data-type="page-break"]', g = ".rte-content, .editora-content";
1
+ const u = '.rte-page-break[data-type="page-break"]', f = ".rte-content, .editora-content";
2
2
  let p = null, m = !1;
3
3
  const h = (e, n) => {
4
4
  if (n === e.innerHTML) return;
@@ -8,7 +8,7 @@ const h = (e, n) => {
8
8
  t("recordDomTransaction", e, n, e.innerHTML);
9
9
  } catch (r) {
10
10
  }
11
- }, v = /* @__PURE__ */ new Set([
11
+ }, x = /* @__PURE__ */ new Set([
12
12
  "DIV",
13
13
  "P",
14
14
  "BLOCKQUOTE",
@@ -22,7 +22,7 @@ const h = (e, n) => {
22
22
  "LI",
23
23
  "TD",
24
24
  "TH"
25
- ]), w = () => {
25
+ ]), N = () => {
26
26
  p || typeof document == "undefined" || (p = document.createElement("style"), p.textContent = `
27
27
  .rte-page-break {
28
28
  display: block;
@@ -95,28 +95,28 @@ const h = (e, n) => {
95
95
  }
96
96
  }
97
97
  `, document.head.appendChild(p));
98
- }, N = () => {
98
+ }, T = () => {
99
99
  const e = window.getSelection();
100
100
  if (!e || e.rangeCount === 0) return null;
101
101
  const n = e.getRangeAt(0), t = n.startContainer.nodeType === Node.ELEMENT_NODE ? n.startContainer : n.startContainer.parentElement;
102
- return (t == null ? void 0 : t.closest(g)) || null;
103
- }, k = () => {
104
- const e = N();
102
+ return (t == null ? void 0 : t.closest(f)) || null;
103
+ }, w = () => {
104
+ const e = T();
105
105
  if (e) return e;
106
- const n = document.activeElement, t = n == null ? void 0 : n.closest(g);
107
- return t || document.querySelector(g);
106
+ const n = document.activeElement, t = n == null ? void 0 : n.closest(f);
107
+ return t || document.querySelector(f);
108
108
  }, E = (e, n) => {
109
109
  let t = e;
110
110
  for (; t && t !== n; ) {
111
111
  if (t.nodeType === Node.ELEMENT_NODE) {
112
112
  const r = t;
113
- if (v.has(r.tagName))
113
+ if (x.has(r.tagName))
114
114
  return r;
115
115
  }
116
116
  t = t.parentNode;
117
117
  }
118
118
  return null;
119
- }, T = () => {
119
+ }, C = () => {
120
120
  const e = document.createElement("div");
121
121
  return e.className = "rte-page-break", e.setAttribute("data-page-break", "true"), e.setAttribute("data-type", "page-break"), e.setAttribute("contenteditable", "false"), e.setAttribute("tabindex", "0"), e.setAttribute("role", "separator"), e.setAttribute("aria-label", "Page break"), e;
122
122
  }, S = (e) => {
@@ -130,7 +130,7 @@ const h = (e, n) => {
130
130
  const r = t;
131
131
  t = t.previousElementSibling, r.remove();
132
132
  }
133
- }, x = (e) => {
133
+ }, v = (e) => {
134
134
  var r;
135
135
  const n = e.nextElementSibling;
136
136
  if (n && !n.matches(u))
@@ -152,7 +152,7 @@ const h = (e, n) => {
152
152
  } else
153
153
  t.selectNodeContents(e), t.collapse(!1);
154
154
  n.removeAllRanges(), n.addRange(t);
155
- }, f = (e, n) => {
155
+ }, g = (e, n) => {
156
156
  let t = e;
157
157
  for (; t; ) {
158
158
  if (!(t instanceof HTMLElement && t.matches(u)))
@@ -160,18 +160,18 @@ const h = (e, n) => {
160
160
  t = n === "previous" ? t.previousSibling : t.nextSibling;
161
161
  }
162
162
  return null;
163
- }, L = (e) => {
163
+ }, A = (e) => {
164
164
  const n = window.getSelection();
165
165
  if (!n || !e.parentNode) return;
166
166
  const t = e.parentNode, r = Array.from(t.childNodes).indexOf(e);
167
167
  if (r < 0) return;
168
168
  const o = document.createRange();
169
169
  o.setStart(t, r), o.setEnd(t, r + 1), n.removeAllRanges(), n.addRange(o), e.focus({ preventScroll: !0 });
170
- }, A = (e) => {
170
+ }, y = (e) => {
171
171
  if (e.collapsed || e.startContainer !== e.endContainer || e.endOffset !== e.startOffset + 1 || !(e.startContainer instanceof Element || e.startContainer instanceof DocumentFragment)) return null;
172
172
  const n = e.startContainer.childNodes[e.startOffset];
173
173
  return n instanceof HTMLElement && n.matches(u) ? n : null;
174
- }, R = (e, n, t) => {
174
+ }, B = (e, n, t) => {
175
175
  if (!e.collapsed) return null;
176
176
  const { startContainer: r, startOffset: o } = e, a = (i) => i instanceof HTMLElement && i.matches(u) ? i : null, s = (i) => {
177
177
  if (r.nodeType === Node.ELEMENT_NODE) {
@@ -208,11 +208,11 @@ const h = (e, n) => {
208
208
  }
209
209
  }
210
210
  return a(s(t === "Backspace" ? "previous" : "next"));
211
- }, C = (e, n) => {
211
+ }, k = (e, n) => {
212
212
  var c;
213
- const t = e.closest(g), r = (c = t == null ? void 0 : t.innerHTML) != null ? c : "", o = e.previousSibling, a = e.nextSibling;
213
+ const t = e.closest(f), r = (c = t == null ? void 0 : t.innerHTML) != null ? c : "", o = e.previousSibling, a = e.nextSibling;
214
214
  e.remove();
215
- const s = f(o, "previous"), i = f(a, "next");
215
+ const s = g(o, "previous"), i = g(a, "next");
216
216
  if (n === "Backspace") {
217
217
  if (s)
218
218
  b(s);
@@ -231,76 +231,76 @@ const h = (e, n) => {
231
231
  l.innerHTML = "<br>", t.appendChild(l), d(l);
232
232
  }
233
233
  return t && (h(t, r), t.dispatchEvent(new Event("input", { bubbles: !0 }))), !0;
234
- }, y = () => {
235
- const e = k();
234
+ }, D = () => {
235
+ const e = w();
236
236
  if (!e) return !1;
237
237
  const n = e.innerHTML, t = window.getSelection();
238
238
  if (!t) return !1;
239
239
  let r;
240
240
  t.rangeCount > 0 && e.contains(t.getRangeAt(0).commonAncestorContainer) ? r = t.getRangeAt(0) : (r = document.createRange(), r.selectNodeContents(e), r.collapse(!1), t.removeAllRanges(), t.addRange(r));
241
- const o = E(r.endContainer, e) || E(r.startContainer, e), a = T();
241
+ const o = E(r.endContainer, e) || E(r.startContainer, e), a = C();
242
242
  o && o.parentNode ? o.parentNode.insertBefore(a, o.nextSibling) : e.appendChild(a), S(a);
243
- const s = x(a);
243
+ const s = v(a);
244
244
  return d(s), h(e, n), e.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
245
- }, B = () => {
245
+ }, R = () => {
246
246
  m || typeof document == "undefined" || (m = !0, document.addEventListener("click", (e) => {
247
247
  const n = e.target, t = n == null ? void 0 : n.closest(u);
248
- t && (e.preventDefault(), e.stopPropagation(), L(t));
248
+ t && (e.preventDefault(), e.stopPropagation(), A(t));
249
249
  }), document.addEventListener("keydown", (e) => {
250
250
  const n = e.key;
251
251
  if (!["Backspace", "Delete", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(n))
252
252
  return;
253
253
  const t = window.getSelection();
254
254
  if (!t || t.rangeCount === 0) return;
255
- const r = t.getRangeAt(0), o = k();
255
+ const r = t.getRangeAt(0), o = w();
256
256
  if (!o || !o.contains(r.commonAncestorContainer)) return;
257
- const a = A(r);
257
+ const a = y(r);
258
258
  if (a) {
259
259
  if (n === "Backspace" || n === "Delete") {
260
- e.preventDefault(), e.stopPropagation(), C(a, n);
260
+ e.preventDefault(), e.stopPropagation(), k(a, n);
261
261
  return;
262
262
  }
263
263
  if (n === "ArrowRight" || n === "ArrowDown") {
264
264
  e.preventDefault();
265
- const s = f(a.nextSibling, "next") || x(a);
265
+ const s = g(a.nextSibling, "next") || v(a);
266
266
  d(s);
267
267
  return;
268
268
  }
269
269
  if (n === "ArrowLeft" || n === "ArrowUp") {
270
270
  e.preventDefault();
271
- const s = f(a.previousSibling, "previous");
271
+ const s = g(a.previousSibling, "previous");
272
272
  s ? b(s) : d(o);
273
273
  return;
274
274
  }
275
275
  }
276
276
  if (n === "Backspace" || n === "Delete") {
277
- const s = R(
277
+ const s = B(
278
278
  r,
279
279
  o,
280
280
  n
281
281
  );
282
282
  if (!s) return;
283
- e.preventDefault(), e.stopPropagation(), C(s, n);
283
+ e.preventDefault(), e.stopPropagation(), k(s, n);
284
284
  }
285
285
  }));
286
- }, D = () => (w(), B(), {
286
+ }, P = () => (N(), R(), {
287
287
  name: "pageBreak",
288
288
  toolbar: [
289
289
  {
290
290
  label: "Page Break",
291
291
  command: "insertPageBreak",
292
- icon: '<svg fill="#000000" width="24px" height="24px" viewBox="0 0 14 14" 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 d="M1,6 L3,6 C3.55228475,6 4,6.44771525 4,7 C4,7.55228475 3.55228475,8 3,8 L1,8 C0.44771525,8 0,7.55228475 0,7 C0,6.44771525 0.44771525,6 1,6 Z M11,6 L13,6 C13.5522847,6 14,6.44771525 14,7 C14,7.55228475 13.5522847,8 13,8 L11,8 C10.4477153,8 10,7.55228475 10,7 C10,6.44771525 10.4477153,6 11,6 Z M6,6 L8,6 C8.55228475,6 9,6.44771525 9,7 C9,7.55228475 8.55228475,8 8,8 L6,8 C5.44771525,8 5,7.55228475 5,7 C5,6.44771525 5.44771525,6 6,6 Z M0,1 C0,0.44771525 0.44771525,-2.26485497e-13 1,-2.26485497e-13 C1.55228475,-2.26485497e-13 2,0.44771525 2,1 L2,3.0142458 L12,3.0142458 L12,1 C12,0.44771525 12.4477153,-2.26485497e-13 13,-2.26485497e-13 C13.5522847,-2.26485497e-13 14,0.44771525 14,1 L14,3.0142458 C14,4.1188153 13.1045695,5.0142458 12,5.0142458 L2,5.0142458 C0.8954305,5.0142458 0,4.1188153 0,3.0142458 L0,1 Z M0,13.0142458 L0,11 C0,9.8954305 0.8954305,9 2,9 L12,9 C13.1045695,9 14,9.8954305 14,11 L14,13.0142458 C14,13.5665305 13.5522847,14.0142458 13,14.0142458 C12.4477153,14.0142458 12,13.5665305 12,13.0142458 L12,11 L2,11 L2,13.0142458 C2,13.5665305 1.55228475,14.0142458 1,14.0142458 C0.44771525,14.0142458 0,13.5665305 0,13.0142458 Z"></path></g></svg>',
292
+ icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><path d="M5 5H19" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/><path d="M5 9H19" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/><path d="M5 15H19" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-dasharray="3.2 3.2"/><path d="M5 19H19" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/></svg>',
293
293
  shortcut: "Mod-Enter"
294
294
  }
295
295
  ],
296
296
  commands: {
297
- insertPageBreak: y
297
+ insertPageBreak: D
298
298
  },
299
299
  keymap: {
300
300
  "Mod-Enter": "insertPageBreak"
301
301
  }
302
302
  });
303
303
  export {
304
- D as PageBreakPlugin
304
+ P as PageBreakPlugin
305
305
  };
306
- //# sourceMappingURL=PageBreakPlugin.native-CXdX5fAv.mjs.map
306
+ //# sourceMappingURL=PageBreakPlugin.native-DijGuHJZ.mjs.map
@@ -1,10 +1,10 @@
1
1
  let c = !1;
2
2
  const g = () => {
3
3
  if (typeof document == "undefined") return;
4
- const r = "rte-preview-plugin-styles";
5
- if (document.getElementById(r)) return;
4
+ const i = "rte-preview-plugin-styles";
5
+ if (document.getElementById(i)) return;
6
6
  const t = document.createElement("style");
7
- t.id = r, t.textContent = `
7
+ t.id = i, t.textContent = `
8
8
  /* Preview Editor Dialog Styles */
9
9
  .rte-preview-editor-overlay {
10
10
  position: fixed !important;
@@ -225,14 +225,14 @@ const g = () => {
225
225
  }
226
226
  `, document.head.appendChild(t);
227
227
  }, v = () => {
228
- const r = window.getSelection();
229
- if (r && r.rangeCount > 0) {
230
- let e = r.getRangeAt(0).startContainer;
228
+ const i = window.getSelection();
229
+ if (i && i.rangeCount > 0) {
230
+ let e = i.getRangeAt(0).startContainer;
231
231
  for (; e && e !== document.body; ) {
232
232
  if (e.nodeType === Node.ELEMENT_NODE) {
233
- const o = e;
234
- if (o.getAttribute("contenteditable") === "true")
235
- return o;
233
+ const n = e;
234
+ if (n.getAttribute("contenteditable") === "true")
235
+ return n;
236
236
  }
237
237
  e = e.parentNode;
238
238
  }
@@ -246,36 +246,36 @@ const g = () => {
246
246
  }
247
247
  return document.querySelector('[contenteditable="true"]');
248
248
  }, h = () => {
249
- const r = v();
250
- if (!r) return "";
251
- const t = r.cloneNode(!0);
249
+ const i = v();
250
+ if (!i) return "";
251
+ const t = i.cloneNode(!0);
252
252
  return [
253
253
  ".rte-floating-toolbar",
254
254
  ".rte-selection-marker",
255
255
  ".rte-toolbar",
256
256
  ".rte-resize-handle",
257
257
  "[data-rte-internal]"
258
- ].forEach((o) => {
259
- t.querySelectorAll(o).forEach((i) => i.remove());
258
+ ].forEach((n) => {
259
+ t.querySelectorAll(n).forEach((r) => r.remove());
260
260
  }), t.innerHTML;
261
- }, w = (r) => {
261
+ }, w = (i) => {
262
262
  const t = document.createElement("div");
263
- return t.innerHTML = r, t.querySelectorAll(
263
+ return t.innerHTML = i, t.querySelectorAll(
264
264
  'script, iframe[src^="javascript:"], object, embed, form[action^="javascript:"]'
265
- ).forEach((i) => i.remove()), t.querySelectorAll("*").forEach((i) => {
266
- Array.from(i.attributes).forEach((n) => {
267
- n.name.startsWith("on") && i.removeAttribute(n.name), (n.name === "href" || n.name === "src") && n.value.startsWith("javascript:") && i.removeAttribute(n.name);
268
- });
265
+ ).forEach((r) => r.remove()), t.querySelectorAll("*").forEach((r) => {
266
+ Array.from(r.attributes).forEach((o) => {
267
+ o.name.startsWith("on") && r.removeAttribute(o.name), (o.name === "href" || o.name === "src") && o.value.startsWith("javascript:") && r.removeAttribute(o.name), o.name.toLowerCase() === "contenteditable" && r.removeAttribute(o.name);
268
+ }), r.setAttribute("contenteditable", "false");
269
269
  }), t.innerHTML;
270
270
  }, u = () => {
271
271
  if (typeof window == "undefined" || c) return;
272
272
  c = !0, g();
273
- const r = h(), t = w(r), e = document.createElement("div");
273
+ const i = h(), t = w(i), e = document.createElement("div");
274
274
  e.className = "rte-preview-editor-overlay", e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.setAttribute("aria-labelledby", "preview-editor-title");
275
- const o = document.createElement("div");
276
- o.className = "rte-preview-editor-modal";
277
- const i = document.createElement("div");
278
- i.className = "rte-preview-editor-header", i.innerHTML = `
275
+ const n = document.createElement("div");
276
+ n.className = "rte-preview-editor-modal";
277
+ const r = document.createElement("div");
278
+ r.className = "rte-preview-editor-header", r.innerHTML = `
279
279
  <h2 id="preview-editor-title">Preview Editor</h2>
280
280
  <div class="rte-preview-editor-header-actions">
281
281
  <button class="rte-preview-editor-close-btn" aria-label="Close preview editor">
@@ -286,17 +286,17 @@ const g = () => {
286
286
  </button>
287
287
  </div>
288
288
  `;
289
- const n = document.createElement("div");
290
- n.className = "rte-preview-editor-body";
289
+ const o = document.createElement("div");
290
+ o.className = "rte-preview-editor-body";
291
291
  const a = document.createElement("div");
292
292
  a.className = "rte-preview-editor-content";
293
293
  const l = document.createElement("div");
294
- l.className = "rte-preview-editor-light-editor", l.innerHTML = t, a.appendChild(l), n.appendChild(a), o.appendChild(i), o.appendChild(n), e.appendChild(o);
294
+ l.className = "rte-preview-editor-light-editor", l.innerHTML = t, a.appendChild(l), o.appendChild(a), n.appendChild(r), n.appendChild(o), e.appendChild(n);
295
295
  const p = () => {
296
296
  e.parentNode && e.parentNode.removeChild(e), c = !1, document.removeEventListener("keydown", s);
297
297
  }, s = (d) => {
298
298
  d.key === "Escape" && (d.preventDefault(), d.stopPropagation(), p());
299
- }, m = i.querySelector(".rte-preview-editor-close-btn");
299
+ }, m = r.querySelector(".rte-preview-editor-close-btn");
300
300
  m && m.addEventListener("click", (d) => {
301
301
  d.preventDefault(), d.stopPropagation(), p();
302
302
  }), e.addEventListener("click", (d) => {
@@ -319,4 +319,4 @@ const g = () => {
319
319
  export {
320
320
  f as PreviewPlugin
321
321
  };
322
- //# sourceMappingURL=PreviewPlugin.native-DBvfpmIv.mjs.map
322
+ //# sourceMappingURL=PreviewPlugin.native-WuIwOAOR.mjs.map