@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/editora.min.js +15 -15
- package/dist/editora.umd.js +21 -21
- package/dist/{index-B1_vtXRz.mjs → index-XsYC_KdJ.mjs} +316 -303
- package/dist/index-_eKRBZPq.js +12 -0
- package/dist/index.cjs.js +10 -10
- package/dist/index.esm.js +75 -67
- package/dist/webcomponent-core.js +300 -287
- package/dist/webcomponent-core.min.js +39 -39
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +300 -287
- package/dist/webcomponent.min.js +153 -153
- package/package.json +1 -1
- package/dist/index-C6BoNR2t.js +0 -12
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as g, E
|
|
2
|
-
import { C as
|
|
3
|
-
class
|
|
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 =
|
|
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
|
|
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
|
|
146
|
-
return new
|
|
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
|
|
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
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1341
|
+
class S {
|
|
1334
1342
|
constructor(e = {}) {
|
|
1335
|
-
this.changeListeners = [], this.options = e, this.engine = new
|
|
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
|
|
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
|
|
1451
|
-
return new
|
|
1458
|
+
function U(l) {
|
|
1459
|
+
return new S(l);
|
|
1452
1460
|
}
|
|
1453
|
-
class
|
|
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
|
|
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
|
|
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
|
|
1532
|
-
return new
|
|
1539
|
+
function R(l) {
|
|
1540
|
+
return new C(l);
|
|
1533
1541
|
}
|
|
1534
|
-
function
|
|
1535
|
-
typeof window != "undefined" && !customElements.get("editora-editor") && customElements.define("editora-editor",
|
|
1542
|
+
function N() {
|
|
1543
|
+
typeof window != "undefined" && !customElements.get("editora-editor") && customElements.define("editora-editor", w);
|
|
1536
1544
|
}
|
|
1537
1545
|
export {
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
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
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
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
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
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
|