@editora/core 1.0.16 → 1.0.18

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/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
- import { P as g, E as y, a as b, T as f, R as v } from "./index-B1_vtXRz.mjs";
2
- import { C as G, b as O, F as V, K, c as B, S as W, d as X, e as _, f as Y, g as J, h as Q, i as Z, s as ee, j as te, k as ie } from "./index-B1_vtXRz.mjs";
3
- class L {
1
+ import { P as g, E, a as f, T as y, R as w } from "./index-XsYC_KdJ.mjs";
2
+ import { C as V, b as K, F as B, K as W, c as X, S as _, d as Y, e as J, f as Q, g as Z, h as ee, i as te, s as ie, j as ne, k as oe } from "./index-XsYC_KdJ.mjs";
3
+ class T {
4
4
  constructor(e) {
5
5
  if (this.listeners = [], e instanceof g)
6
6
  this.pluginManager = e;
@@ -11,7 +11,7 @@ class L {
11
11
  }), i.element && (this.domElement = i.element, this.setupDOMElement(i));
12
12
  }
13
13
  const t = this.pluginManager.buildSchema();
14
- this.state = y.create(t), this.commands = this.pluginManager.getCommands();
14
+ this.state = E.create(t), this.commands = this.pluginManager.getCommands();
15
15
  }
16
16
  setupDOMElement(e) {
17
17
  this.domElement && (e.enableToolbar !== !1 && e.toolbarElement ? this.toolbarElement = e.toolbarElement : e.enableToolbar !== !1 && (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.domElement.appendChild(this.toolbarElement)), this.contentElement = document.createElement("div"), this.contentElement.contentEditable = "true", this.contentElement.className = "editora-content", this.contentElement.style.minHeight = "200px", this.contentElement.style.outline = "none", this.contentElement.style.padding = "12px", e.content && (this.contentElement.innerHTML = e.content), this.domElement.appendChild(this.contentElement), this.contentElement.addEventListener("input", () => {
@@ -73,7 +73,7 @@ class L {
73
73
  });
74
74
  }
75
75
  }
76
- class E {
76
+ class x {
77
77
  constructor(e) {
78
78
  this.initialized = !1, this.plugin = e;
79
79
  }
@@ -142,10 +142,17 @@ class E {
142
142
  return this.context;
143
143
  }
144
144
  }
145
- function k(l) {
146
- return new E(l);
145
+ function I(l) {
146
+ return new x(l);
147
+ }
148
+ const b = /* @__PURE__ */ new Set();
149
+ function v(l, e) {
150
+ b.has(l) || (b.add(l), console.warn(
151
+ `[Editora] ${l} from @editora/core is a deprecated, non-functional scaffold: its commands and toolbar buttons do nothing. It will be removed in a future major release - use ${e} instead.`
152
+ ));
147
153
  }
148
- function T(l = {}) {
154
+ function M(l = {}) {
155
+ v("SpellcheckPlugin", "`SpellCheckPlugin` from @editora/spell-check");
149
156
  const {
150
157
  enabled: e = !1,
151
158
  provider: t = "browser",
@@ -198,7 +205,8 @@ function T(l = {}) {
198
205
  ] : []
199
206
  };
200
207
  }
201
- function I(l = {}) {
208
+ function F(l = {}) {
209
+ v("MediaPlugin", "`MediaManagerPlugin` from @editora/media-manager");
202
210
  const {
203
211
  uploadUrl: e = "",
204
212
  libraryUrl: t = "",
@@ -212,7 +220,7 @@ function I(l = {}) {
212
220
  enableChunking: r = !0,
213
221
  onProgress: d,
214
222
  onError: h,
215
- onSuccess: C
223
+ onSuccess: L
216
224
  } = l;
217
225
  return {
218
226
  name: "media",
@@ -391,7 +399,7 @@ class u {
391
399
  this.close();
392
400
  }
393
401
  }
394
- class M {
402
+ class q {
395
403
  constructor(e) {
396
404
  this.isOpen = !1, this.config = e, this.selectedValue = e.value, this.element = this.createElement(), this.attachEventListeners();
397
405
  }
@@ -448,7 +456,7 @@ class M {
448
456
  this.element.remove();
449
457
  }
450
458
  }
451
- class F {
459
+ class j {
452
460
  constructor(e) {
453
461
  this.defaultPresets = [
454
462
  "#000000",
@@ -539,7 +547,7 @@ class F {
539
547
  this.element.remove();
540
548
  }
541
549
  }
542
- class q {
550
+ class P {
543
551
  constructor(e) {
544
552
  const { initialUrl: t = "", initialText: i = "", onSubmit: n, onCancel: o } = e;
545
553
  this.dialog = new u({
@@ -621,7 +629,7 @@ class q {
621
629
  this.dialog.close();
622
630
  }
623
631
  }
624
- class j {
632
+ class $ {
625
633
  constructor(e) {
626
634
  const { onSubmit: t, onCancel: i } = e;
627
635
  this.dialog = new u({
@@ -723,7 +731,7 @@ class j {
723
731
  t == null || t.addEventListener("input", s), i == null || i.addEventListener("input", s), n == null || n.addEventListener("change", s);
724
732
  }
725
733
  }
726
- class $ {
734
+ class H {
727
735
  constructor(e) {
728
736
  this.config = e;
729
737
  const { onSubmit: t, onCancel: i } = e;
@@ -868,7 +876,7 @@ class $ {
868
876
  }
869
877
  }
870
878
  }
871
- class P {
879
+ class z {
872
880
  constructor(e) {
873
881
  this.onSubmit = e.onSubmit;
874
882
  const t = this.createContent();
@@ -1038,7 +1046,7 @@ class P {
1038
1046
  this.dialog.close();
1039
1047
  }
1040
1048
  }
1041
- class H {
1049
+ class A {
1042
1050
  constructor(e) {
1043
1051
  this.characters = {
1044
1052
  common: ["©", "®", "™", "§", "¶", "†", "‡", "•", "‣", "⁃", "◦", "▪", "▫", "◊", "○", "●", "□", "■", "△", "▲", "▽", "▼", "◇", "◆", "★", "☆"],
@@ -1181,7 +1189,7 @@ class H {
1181
1189
  this.dialog.close();
1182
1190
  }
1183
1191
  }
1184
- class z {
1192
+ class D {
1185
1193
  constructor(e) {
1186
1194
  this.emojis = {
1187
1195
  popular: ["😀", "😃", "😄", "😁", "😊", "😍", "🤩", "😘", "😗", "😚", "😙", "🙂", "🤗", "🤔", "🤨", "😐", "😑", "😶", "🙄", "😏", "👍", "👎", "👌", "✌️", "🤞", "🤝", "👏", "🙌", "👋", "🤚", "✋", "🖐️", "🖖", "👊", "✊", "🤛", "🤜", "💪"],
@@ -1330,9 +1338,9 @@ class z {
1330
1338
  this.dialog.close();
1331
1339
  }
1332
1340
  }
1333
- class x {
1341
+ class S {
1334
1342
  constructor(e = {}) {
1335
- this.changeListeners = [], this.options = e, this.engine = new b({
1343
+ this.changeListeners = [], this.options = e, this.engine = new f({
1336
1344
  content: e.content,
1337
1345
  plugins: e.plugins || [],
1338
1346
  readonly: e.readonly
@@ -1345,7 +1353,7 @@ class x {
1345
1353
  * Mount editor to DOM elements
1346
1354
  */
1347
1355
  mount(e, t) {
1348
- this.contentElement = e, this.toolbarElement = t, this.contentElement.contentEditable = this.options.readonly ? "false" : "true", this.contentElement.className = "rte-content", this.options.content && (this.contentElement.innerHTML = this.options.content), this.options.toolbar !== !1 && this.toolbarElement && (this.toolbar = new f(
1356
+ this.contentElement = e, this.toolbarElement = t, this.contentElement.contentEditable = this.options.readonly ? "false" : "true", this.contentElement.className = "rte-content", this.options.content && (this.contentElement.innerHTML = this.options.content), this.options.toolbar !== !1 && this.toolbarElement && (this.toolbar = new y(
1349
1357
  {
1350
1358
  items: typeof this.options.toolbar == "string" ? this.options.toolbar : void 0
1351
1359
  },
@@ -1447,14 +1455,14 @@ class x {
1447
1455
  this.engine.destroy(), (e = this.toolbar) == null || e.destroy(), this.changeListeners = [], this.options.onDestroy && this.options.onDestroy();
1448
1456
  }
1449
1457
  }
1450
- function A(l) {
1451
- return new x(l);
1458
+ function U(l) {
1459
+ return new S(l);
1452
1460
  }
1453
- class w {
1461
+ class C {
1454
1462
  constructor(e) {
1455
1463
  this.options = e, this.containerElement = e.element;
1456
1464
  const t = this.resolvePlugins(e.plugins);
1457
- this.engine = new b({
1465
+ this.engine = new f({
1458
1466
  content: e.content,
1459
1467
  plugins: t,
1460
1468
  readonly: e.readonly
@@ -1470,7 +1478,7 @@ class w {
1470
1478
  * Initialize DOM elements
1471
1479
  */
1472
1480
  initializeDOM() {
1473
- this.containerElement.innerHTML = "", this.containerElement.classList.add("editora-editor"), this.options.enableToolbar !== !1 && this.options.toolbar !== !1 && (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.containerElement.appendChild(this.toolbarElement), this.toolbar = new f(
1481
+ this.containerElement.innerHTML = "", this.containerElement.classList.add("editora-editor"), this.options.enableToolbar !== !1 && this.options.toolbar !== !1 && (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.containerElement.appendChild(this.toolbarElement), this.toolbar = new y(
1474
1482
  {
1475
1483
  items: typeof this.options.toolbar == "string" ? this.options.toolbar : void 0
1476
1484
  },
@@ -1528,52 +1536,52 @@ class w {
1528
1536
  this.engine.destroy(), (e = this.toolbar) == null || e.destroy(), this.containerElement.innerHTML = "";
1529
1537
  }
1530
1538
  }
1531
- function D(l) {
1532
- return new w(l);
1539
+ function R(l) {
1540
+ return new C(l);
1533
1541
  }
1534
- function U() {
1535
- typeof window != "undefined" && !customElements.get("editora-editor") && customElements.define("editora-editor", v);
1542
+ function N() {
1543
+ typeof window != "undefined" && !customElements.get("editora-editor") && customElements.define("editora-editor", w);
1536
1544
  }
1537
1545
  export {
1538
- H as CharacterDialog,
1539
- F as ColorPicker,
1540
- G as CommandRegistry,
1541
- O as ConfigResolver,
1546
+ A as CharacterDialog,
1547
+ j as ColorPicker,
1548
+ V as CommandRegistry,
1549
+ K as ConfigResolver,
1542
1550
  u as Dialog,
1543
1551
  m as DocumentModel,
1544
- M as Dropdown,
1545
- L as Editor,
1546
- b as EditorEngine,
1547
- y as EditorState,
1548
- z as EmojiDialog,
1549
- V as FloatingToolbar,
1550
- $ as ImageDialog,
1551
- K as KeyboardShortcutManager,
1552
- q as LinkDialog,
1553
- P as MathDialog,
1554
- I as MediaPlugin,
1555
- B as PluginLoader,
1552
+ q as Dropdown,
1553
+ T as Editor,
1554
+ f as EditorEngine,
1555
+ E as EditorState,
1556
+ D as EmojiDialog,
1557
+ B as FloatingToolbar,
1558
+ H as ImageDialog,
1559
+ W as KeyboardShortcutManager,
1560
+ P as LinkDialog,
1561
+ z as MathDialog,
1562
+ F as MediaPlugin,
1563
+ X as PluginLoader,
1556
1564
  g as PluginManager,
1557
- E as PluginRuntime,
1558
- x as ReactAdapter,
1559
- v as RichTextEditorElement,
1560
- W as Schema,
1561
- T as SpellcheckPlugin,
1562
- X as StatusBar,
1563
- j as TableDialog,
1564
- f as ToolbarRenderer,
1565
- w as VanillaAdapter,
1566
- _ as calculateTextStats,
1567
- Y as countLines,
1568
- D as createEditor,
1569
- k as createPluginRuntime,
1570
- A as createReactAdapter,
1571
- J as getCursorPosition,
1572
- Q as getSelectionInfo,
1573
- Z as getTextOffset,
1574
- U as initWebComponent,
1575
- ee as sanitizeHTML,
1576
- te as sanitizeInputHTML,
1577
- ie as sanitizePastedHTML
1565
+ x as PluginRuntime,
1566
+ S as ReactAdapter,
1567
+ w as RichTextEditorElement,
1568
+ _ as Schema,
1569
+ M as SpellcheckPlugin,
1570
+ Y as StatusBar,
1571
+ $ as TableDialog,
1572
+ y as ToolbarRenderer,
1573
+ C as VanillaAdapter,
1574
+ J as calculateTextStats,
1575
+ Q as countLines,
1576
+ R as createEditor,
1577
+ I as createPluginRuntime,
1578
+ U as createReactAdapter,
1579
+ Z as getCursorPosition,
1580
+ ee as getSelectionInfo,
1581
+ te as getTextOffset,
1582
+ N as initWebComponent,
1583
+ ie as sanitizeHTML,
1584
+ ne as sanitizeInputHTML,
1585
+ oe as sanitizePastedHTML
1578
1586
  };
1579
1587
  //# sourceMappingURL=index.esm.js.map