@editora/core 1.0.10 → 1.0.12
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/{ClearFormattingPlugin.native-DIS6AN2t.mjs → ClearFormattingPlugin.native-B6ro3a1h.mjs} +49 -39
- package/dist/{CodePlugin.native-C5l1IeSS.mjs → CodePlugin.native-veDC_kx5.mjs} +87 -57
- package/dist/FormatPainterPlugin.native-CsMrKfFU.mjs +676 -0
- package/dist/editora.min.js +1 -1
- package/dist/editora.umd.js +1 -1
- package/dist/{index-CPMGUZfB.js → index-B5BzVUdg.js} +2 -2
- package/dist/{index-DBoj6QfW.mjs → index-YZ5TROdg.mjs} +10 -8
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/plugin-loader.js +3 -0
- package/dist/webcomponent-core.js +5 -3
- package/dist/webcomponent-core.min.js +38 -32
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +24 -19
- package/dist/webcomponent.min.js +703 -697
- package/package.json +1 -1
package/dist/webcomponent.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-B5BzVUdg.js");exports.RichTextEditorElement=e.RichTextEditorElement;exports.initWebComponent=e.initWebComponent;
|
|
2
2
|
//# sourceMappingURL=webcomponent.cjs.js.map
|
package/dist/webcomponent.esm.js
CHANGED
package/dist/webcomponent.js
CHANGED
|
@@ -1473,7 +1473,7 @@ let x = S;
|
|
|
1473
1473
|
const J = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor;fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}';
|
|
1474
1474
|
let y;
|
|
1475
1475
|
const Q = "__editoraCommandEditorRoot", Z = "__editoraLastCommandButton", A = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", T = ".rte-content, .editora-content", E = /* @__PURE__ */ new Set();
|
|
1476
|
-
let
|
|
1476
|
+
let g = null, L = !1, w = null, C = null;
|
|
1477
1477
|
function M(i) {
|
|
1478
1478
|
if (!(i instanceof HTMLElement)) return !1;
|
|
1479
1479
|
const t = i;
|
|
@@ -1517,8 +1517,8 @@ function et() {
|
|
|
1517
1517
|
const n = b(tt(o.getRangeAt(0).startContainer));
|
|
1518
1518
|
if (n) return n;
|
|
1519
1519
|
}
|
|
1520
|
-
if (
|
|
1521
|
-
return
|
|
1520
|
+
if (g && g.isConnected)
|
|
1521
|
+
return g;
|
|
1522
1522
|
for (const n of E)
|
|
1523
1523
|
if (n.isConnected) return n;
|
|
1524
1524
|
return null;
|
|
@@ -1541,12 +1541,12 @@ function it() {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
function nt() {
|
|
1543
1543
|
if (!y) {
|
|
1544
|
-
const i =
|
|
1544
|
+
const i = m.__globalPluginLoader;
|
|
1545
1545
|
i ? y = i : y = new P();
|
|
1546
1546
|
}
|
|
1547
1547
|
return y;
|
|
1548
1548
|
}
|
|
1549
|
-
class
|
|
1549
|
+
class m extends HTMLElement {
|
|
1550
1550
|
constructor() {
|
|
1551
1551
|
if (super(), this.pluginLoader = nt(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new K(), this.lastAutosavedContent = "", this.loadedPlugins = [], this.lastBeforeInputType = null, it(), !this.hasAttribute("data-initial-content")) {
|
|
1552
1552
|
const t = this.innerHTML.trim();
|
|
@@ -1614,13 +1614,13 @@ class g extends HTMLElement {
|
|
|
1614
1614
|
* Wait for the global plugin loader to be available
|
|
1615
1615
|
*/
|
|
1616
1616
|
async waitForPluginLoader() {
|
|
1617
|
-
if (
|
|
1618
|
-
this.pluginLoader =
|
|
1617
|
+
if (m.__globalPluginLoader) {
|
|
1618
|
+
this.pluginLoader = m.__globalPluginLoader;
|
|
1619
1619
|
return;
|
|
1620
1620
|
}
|
|
1621
1621
|
return new Promise((t) => {
|
|
1622
1622
|
const e = () => {
|
|
1623
|
-
|
|
1623
|
+
m.__globalPluginLoader ? (this.pluginLoader = m.__globalPluginLoader, t()) : setTimeout(e, 0);
|
|
1624
1624
|
};
|
|
1625
1625
|
e();
|
|
1626
1626
|
});
|
|
@@ -1649,7 +1649,7 @@ class g extends HTMLElement {
|
|
|
1649
1649
|
async initialize() {
|
|
1650
1650
|
var o;
|
|
1651
1651
|
if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
|
|
1652
|
-
this.setAttribute("data-editora-editor", "true"), E.add(this),
|
|
1652
|
+
this.setAttribute("data-editora-editor", "true"), E.add(this), g || (g = this), ot(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.config.theme && this.classList.add(`editora-theme-${this.config.theme}`);
|
|
1653
1653
|
const t = await this.loadPlugins();
|
|
1654
1654
|
this.loadedPlugins = t, t.forEach((r) => {
|
|
1655
1655
|
if (r.init && typeof r.init == "function")
|
|
@@ -1866,7 +1866,9 @@ class g extends HTMLElement {
|
|
|
1866
1866
|
mentions: ["mention", "mentions"],
|
|
1867
1867
|
mention: ["mention", "mentions"],
|
|
1868
1868
|
slashCommands: ["slashcommands", "slash-commands", "slashCommands"],
|
|
1869
|
-
"slash-commands": ["slashcommands", "slash-commands", "slashCommands"]
|
|
1869
|
+
"slash-commands": ["slashcommands", "slash-commands", "slashCommands"],
|
|
1870
|
+
formatPainter: ["formatpainter", "format-painter", "formatPainter"],
|
|
1871
|
+
"format-painter": ["formatpainter", "format-painter", "formatPainter"]
|
|
1870
1872
|
}, r = [
|
|
1871
1873
|
t,
|
|
1872
1874
|
t.toLowerCase(),
|
|
@@ -2075,7 +2077,7 @@ class g extends HTMLElement {
|
|
|
2075
2077
|
}
|
|
2076
2078
|
a && document.execCommand("insertText", !1, a);
|
|
2077
2079
|
}), this.contentElement.addEventListener("focus", () => {
|
|
2078
|
-
|
|
2080
|
+
g = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
|
|
2079
2081
|
}), this.contentElement.addEventListener("blur", () => {
|
|
2080
2082
|
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
|
|
2081
2083
|
detail: { html: this.contentElement.innerHTML },
|
|
@@ -2288,7 +2290,7 @@ class g extends HTMLElement {
|
|
|
2288
2290
|
*/
|
|
2289
2291
|
destroy() {
|
|
2290
2292
|
var t, e, o, r;
|
|
2291
|
-
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.persistAutosave(this.contentElement.innerHTML || ""), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (r = this.statusBar) == null || r.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, E.delete(this),
|
|
2293
|
+
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.persistAutosave(this.contentElement.innerHTML || ""), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (r = this.statusBar) == null || r.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, E.delete(this), g === this && (g = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
|
|
2292
2294
|
}
|
|
2293
2295
|
// Public API methods
|
|
2294
2296
|
getContent() {
|
|
@@ -2311,17 +2313,17 @@ class g extends HTMLElement {
|
|
|
2311
2313
|
}
|
|
2312
2314
|
}
|
|
2313
2315
|
const k = new P();
|
|
2314
|
-
|
|
2316
|
+
m.__globalPluginLoader = k;
|
|
2315
2317
|
const rt = {
|
|
2316
2318
|
// Core editing plugins (always loaded)
|
|
2317
2319
|
bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((i) => i.BoldPlugin()),
|
|
2318
2320
|
italic: () => import("./ItalicPlugin.native-CmnlwFHB.mjs").then((i) => i.ItalicPlugin()),
|
|
2319
2321
|
underline: () => import("./UnderlinePlugin.native-DZzg23rv.mjs").then((i) => i.UnderlinePlugin()),
|
|
2320
2322
|
strikethrough: () => import("./StrikethroughPlugin.native-V0TL4F48.mjs").then((i) => i.StrikethroughPlugin()),
|
|
2321
|
-
clearFormatting: () => import("./ClearFormattingPlugin.native-
|
|
2323
|
+
clearFormatting: () => import("./ClearFormattingPlugin.native-B6ro3a1h.mjs").then((i) => i.ClearFormattingPlugin()),
|
|
2322
2324
|
heading: () => import("./HeadingPlugin.native-DZdvubrQ.mjs").then((i) => i.HeadingPlugin()),
|
|
2323
2325
|
blockquote: () => import("./BlockquotePlugin.native-57_Xcjl1.mjs").then((i) => i.BlockquotePlugin()),
|
|
2324
|
-
code: () => import("./CodePlugin.native-
|
|
2326
|
+
code: () => import("./CodePlugin.native-veDC_kx5.mjs").then((i) => i.CodePlugin()),
|
|
2325
2327
|
codeSample: () => import("./CodeSamplePlugin.native-CgGoH-X4.mjs").then((i) => i.CodeSamplePlugin()),
|
|
2326
2328
|
list: () => import("./ListPlugin.native-V7EZC1lM.mjs").then((i) => i.ListPlugin()),
|
|
2327
2329
|
checklist: () => import("./ChecklistPlugin.native-BS-kMz9O.mjs").then((i) => i.ChecklistPlugin()),
|
|
@@ -2332,6 +2334,9 @@ const rt = {
|
|
|
2332
2334
|
backgroundColor: () => import("./BackgroundColorPlugin.native-50iAT9xU.mjs").then((i) => i.BackgroundColorPlugin()),
|
|
2333
2335
|
fontSize: () => import("./FontSizePlugin.native-B_jCh7dY.mjs").then((i) => i.FontSizePlugin()),
|
|
2334
2336
|
fontFamily: () => import("./FontFamilyPlugin.native-j8hMTbg4.mjs").then((i) => i.FontFamilyPlugin()),
|
|
2337
|
+
formatPainter: () => import("./FormatPainterPlugin.native-CsMrKfFU.mjs").then((i) => i.FormatPainterPlugin()),
|
|
2338
|
+
"format-painter": () => import("./FormatPainterPlugin.native-CsMrKfFU.mjs").then((i) => i.FormatPainterPlugin()),
|
|
2339
|
+
formatpainter: () => import("./FormatPainterPlugin.native-CsMrKfFU.mjs").then((i) => i.FormatPainterPlugin()),
|
|
2335
2340
|
lineHeight: () => import("./LineHeightPlugin.native-CM7iXdQj.mjs").then((i) => i.LineHeightPlugin()),
|
|
2336
2341
|
capitalization: () => import("./CapitalizationPlugin.native-DLV4oPmB.mjs").then((i) => i.CapitalizationPlugin()),
|
|
2337
2342
|
history: () => import("./HistoryPlugin.native-D2wl32jV.mjs").then((i) => i.HistoryPlugin()),
|
|
@@ -2399,7 +2404,7 @@ async function at() {
|
|
|
2399
2404
|
}), k;
|
|
2400
2405
|
}
|
|
2401
2406
|
typeof window != "undefined" && at().then((i) => {
|
|
2402
|
-
|
|
2407
|
+
m.__globalPluginLoader = i, customElements.get("editora-editor") || customElements.define("editora-editor", m);
|
|
2403
2408
|
const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
|
|
2404
2409
|
t.forEach((n) => {
|
|
2405
2410
|
const a = n.innerHTML.trim();
|
|
@@ -2412,15 +2417,15 @@ typeof window != "undefined" && at().then((i) => {
|
|
|
2412
2417
|
}), window.Editora = {
|
|
2413
2418
|
version: "1.0.0",
|
|
2414
2419
|
plugins: k.getRegisteredPluginNames(),
|
|
2415
|
-
WebComponent:
|
|
2420
|
+
WebComponent: m,
|
|
2416
2421
|
init: async (n, a) => {
|
|
2417
2422
|
const s = document.querySelector(n);
|
|
2418
|
-
return s instanceof
|
|
2423
|
+
return s instanceof m ? (a && await s.setConfig(a), s.getAPI()) : null;
|
|
2419
2424
|
}
|
|
2420
2425
|
};
|
|
2421
2426
|
});
|
|
2422
2427
|
export {
|
|
2423
|
-
|
|
2428
|
+
m as RichTextEditorElement,
|
|
2424
2429
|
at as initWebComponent
|
|
2425
2430
|
};
|
|
2426
2431
|
//# sourceMappingURL=webcomponent.js.map
|