@aeriz/wysiwyg 1.0.4 → 1.0.5
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/README.md +13 -13
- package/dist/aeriz-wysiwyg.cjs +153 -3
- package/dist/aeriz-wysiwyg.esm.js +153 -3
- package/dist/aeriz-wysiwyg.esm.min.js +891 -784
- package/dist/aeriz-wysiwyg.js +153 -3
- package/dist/aeriz-wysiwyg.min.cjs +40 -32
- package/dist/aeriz-wysiwyg.min.js +41 -33
- package/dist-types/cjs/core/AerizEditor.d.cts +34 -0
- package/dist-types/cjs/core/highlight.d.cts +2 -0
- package/dist-types/core/AerizEditor.d.ts +34 -0
- package/dist-types/core/AerizEditor.d.ts.map +1 -1
- package/dist-types/core/blocks.d.ts.map +1 -1
- package/dist-types/core/highlight.d.ts +2 -0
- package/dist-types/core/highlight.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var b = (t, e, n) =>
|
|
4
|
-
const
|
|
1
|
+
var pn = Object.defineProperty;
|
|
2
|
+
var hn = (t, e, n) => e in t ? pn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var b = (t, e, n) => hn(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
const fn = {
|
|
5
5
|
items: [
|
|
6
6
|
// undo / redo 는 브라우저 네이티브 (Ctrl+Z / Ctrl+Y) 가 처리하므로 기본
|
|
7
7
|
// 툴바에서 제외. ToolbarItemName 멤버는 유지 — 커스텀 toolbar 에서
|
|
@@ -34,7 +34,7 @@ const dn = {
|
|
|
34
34
|
// 커스텀 toolbar 에서는 여전히 등록 가능.
|
|
35
35
|
],
|
|
36
36
|
sticky: !0
|
|
37
|
-
},
|
|
37
|
+
}, mn = {
|
|
38
38
|
toolbar: {
|
|
39
39
|
ariaLabel: "Formatting toolbar",
|
|
40
40
|
undo: "Undo",
|
|
@@ -207,7 +207,7 @@ const dn = {
|
|
|
207
207
|
chars: "{n} char(s)",
|
|
208
208
|
source: "src {n}"
|
|
209
209
|
}
|
|
210
|
-
},
|
|
210
|
+
}, Bt = {
|
|
211
211
|
toolbar: {
|
|
212
212
|
ariaLabel: "서식 도구 모음",
|
|
213
213
|
undo: "되돌리기",
|
|
@@ -378,7 +378,7 @@ const dn = {
|
|
|
378
378
|
chars: "텍스트 {n} 자",
|
|
379
379
|
source: "소스 {n}"
|
|
380
380
|
}
|
|
381
|
-
},
|
|
381
|
+
}, gn = {
|
|
382
382
|
toolbar: {
|
|
383
383
|
ariaLabel: "書式ツールバー",
|
|
384
384
|
undo: "元に戻す",
|
|
@@ -549,7 +549,7 @@ const dn = {
|
|
|
549
549
|
chars: "テキスト {n} 字",
|
|
550
550
|
source: "ソース {n}"
|
|
551
551
|
}
|
|
552
|
-
},
|
|
552
|
+
}, bn = {
|
|
553
553
|
toolbar: {
|
|
554
554
|
ariaLabel: "格式工具栏",
|
|
555
555
|
undo: "撤销",
|
|
@@ -720,21 +720,21 @@ const dn = {
|
|
|
720
720
|
chars: "文本 {n} 字",
|
|
721
721
|
source: "源 {n}"
|
|
722
722
|
}
|
|
723
|
-
},
|
|
724
|
-
let
|
|
725
|
-
function
|
|
726
|
-
|
|
723
|
+
}, yn = { en: mn, ko: Bt, ja: gn, zh: bn };
|
|
724
|
+
let Mt = Bt, Nt = "ko";
|
|
725
|
+
function kn(t) {
|
|
726
|
+
Nt = t, Mt = yn[t];
|
|
727
727
|
}
|
|
728
|
-
function
|
|
729
|
-
return
|
|
728
|
+
function ui() {
|
|
729
|
+
return Nt;
|
|
730
730
|
}
|
|
731
731
|
function p() {
|
|
732
|
-
return
|
|
732
|
+
return Mt;
|
|
733
733
|
}
|
|
734
734
|
function re(t, e) {
|
|
735
735
|
return t.replace(/\{(\w+)\}/g, (n, o) => String(e[o] ?? ""));
|
|
736
736
|
}
|
|
737
|
-
const
|
|
737
|
+
const A = {
|
|
738
738
|
taskList: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 7 5 9 9 5"/><polyline points="3 17 5 19 9 15"/><line x1="13" y1="7" x2="21" y2="7"/><line x1="13" y1="17" x2="21" y2="17"/></svg>',
|
|
739
739
|
undo: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7v6h6"/><path d="M21 17a9 9 0 0 0-15-6.7L3 13"/></svg>',
|
|
740
740
|
redo: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 7v6h-6"/><path d="M3 17a9 9 0 0 1 15-6.7L21 13"/></svg>',
|
|
@@ -772,7 +772,7 @@ const E = {
|
|
|
772
772
|
tableMenu: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="1.5"/><line x1="3" y1="9" x2="21" y2="9"/><line x1="3" y1="15" x2="21" y2="15"/><line x1="9" y1="3" x2="9" y2="21"/><line x1="15" y1="3" x2="15" y2="21"/></svg>',
|
|
773
773
|
codeLang: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/><line x1="14" y1="4" x2="10" y2="20"/></svg>'
|
|
774
774
|
};
|
|
775
|
-
function
|
|
775
|
+
function wn() {
|
|
776
776
|
const t = p().toolbar;
|
|
777
777
|
return {
|
|
778
778
|
undo: { name: "undo", label: t.undo, icon: "undo", shortcut: "Ctrl+Z" },
|
|
@@ -801,12 +801,12 @@ function gn() {
|
|
|
801
801
|
clearFormat: { name: "clearFormat", label: t.clearFormat, icon: "clearFormat" }
|
|
802
802
|
};
|
|
803
803
|
}
|
|
804
|
-
class
|
|
804
|
+
class vn {
|
|
805
805
|
constructor(e, n) {
|
|
806
806
|
b(this, "element");
|
|
807
807
|
b(this, "buttons", /* @__PURE__ */ new Map());
|
|
808
808
|
this.element = document.createElement("div"), this.element.className = "aw-toolbar", this.element.setAttribute("role", "toolbar"), this.element.setAttribute("aria-label", p().toolbar.ariaLabel), e.sticky !== !1 && this.element.classList.add("aw-toolbar-sticky");
|
|
809
|
-
const o =
|
|
809
|
+
const o = wn();
|
|
810
810
|
let l = this.createGroup();
|
|
811
811
|
this.element.appendChild(l);
|
|
812
812
|
for (const i of e.items) {
|
|
@@ -855,8 +855,8 @@ class bn {
|
|
|
855
855
|
o.type = "button", o.className = "aw-toolbar-btn", e.hasDropdown && o.classList.add("aw-toolbar-btn-dropdown");
|
|
856
856
|
const l = e.shortcut ? `${e.label} (${e.shortcut})` : e.label;
|
|
857
857
|
o.title = l, o.setAttribute("aria-label", l), o.dataset.command = e.name;
|
|
858
|
-
const i =
|
|
859
|
-
return o.innerHTML = `<span class="aw-toolbar-btn-icon">${i}</span>`, e.hasDropdown && (o.innerHTML += `<span class="aw-toolbar-btn-chevron">${
|
|
858
|
+
const i = A[e.icon] ?? "";
|
|
859
|
+
return o.innerHTML = `<span class="aw-toolbar-btn-icon">${i}</span>`, e.hasDropdown && (o.innerHTML += `<span class="aw-toolbar-btn-chevron">${A.chevronDown}</span>`), o.addEventListener("mousedown", (r) => {
|
|
860
860
|
r.preventDefault();
|
|
861
861
|
}), o.addEventListener("click", () => {
|
|
862
862
|
n.onAction(e.name, o);
|
|
@@ -873,7 +873,7 @@ function oe(t, e, n) {
|
|
|
873
873
|
const r = document.createElement("h2");
|
|
874
874
|
r.className = "aw-dialog-title", r.textContent = t;
|
|
875
875
|
const s = document.createElement("button");
|
|
876
|
-
s.type = "button", s.className = "aw-dialog-close", s.innerHTML =
|
|
876
|
+
s.type = "button", s.className = "aw-dialog-close", s.innerHTML = A.close, i.appendChild(r), i.appendChild(s);
|
|
877
877
|
const a = document.createElement("div");
|
|
878
878
|
a.className = "aw-dialog-body";
|
|
879
879
|
const c = document.createElement("div");
|
|
@@ -896,7 +896,7 @@ function F(t, e) {
|
|
|
896
896
|
const o = document.createElement("label");
|
|
897
897
|
return o.className = "aw-field-label", o.textContent = t, n.appendChild(o), n.appendChild(e), n;
|
|
898
898
|
}
|
|
899
|
-
function
|
|
899
|
+
function Cn(t = {}, e) {
|
|
900
900
|
return new Promise((n) => {
|
|
901
901
|
const { overlay: o, body: l, footer: i, close: r } = oe(
|
|
902
902
|
p().link.title,
|
|
@@ -927,7 +927,7 @@ function yn(t = {}, e) {
|
|
|
927
927
|
}), document.body.appendChild(o), setTimeout(() => a.focus(), 0);
|
|
928
928
|
});
|
|
929
929
|
}
|
|
930
|
-
function
|
|
930
|
+
function Ln(t = {}, e) {
|
|
931
931
|
return new Promise((n) => {
|
|
932
932
|
const { overlay: o, body: l, footer: i, close: r } = oe(
|
|
933
933
|
p().image.title,
|
|
@@ -945,7 +945,7 @@ function kn(t = {}, e) {
|
|
|
945
945
|
u ? d.title = p().image.uploadTabTitle : (d.disabled = !0, d.classList.add("aw-tab-disabled"), d.title = p().image.uploadDisabledTitle), s.appendChild(a), s.appendChild(c), s.appendChild(d), l.appendChild(s);
|
|
946
946
|
const h = document.createElement("div");
|
|
947
947
|
h.className = "aw-pane";
|
|
948
|
-
const m =
|
|
948
|
+
const m = ot(p().image.embedDropzone), f = document.createElement("div");
|
|
949
949
|
f.className = "aw-preview", f.style.display = "none", h.appendChild(m.dropzone), h.appendChild(f);
|
|
950
950
|
const g = document.createElement("div");
|
|
951
951
|
g.className = "aw-pane";
|
|
@@ -953,15 +953,15 @@ function kn(t = {}, e) {
|
|
|
953
953
|
k.type = "url", k.className = "aw-input", k.placeholder = p().image.urlPlaceholder, g.appendChild(F(p().image.urlLabel, k));
|
|
954
954
|
const y = document.createElement("div");
|
|
955
955
|
if (y.className = "aw-pane", u) {
|
|
956
|
-
const w =
|
|
957
|
-
|
|
958
|
-
var
|
|
959
|
-
const I = (
|
|
956
|
+
const w = ot(p().image.uploadDropzone), E = document.createElement("div");
|
|
957
|
+
E.className = "aw-preview", E.style.display = "none", y.appendChild(w.dropzone), y.appendChild(E), w.input.addEventListener("change", async () => {
|
|
958
|
+
var D;
|
|
959
|
+
const I = (D = w.input.files) == null ? void 0 : D[0];
|
|
960
960
|
if (!(!I || !t.onUpload))
|
|
961
961
|
try {
|
|
962
962
|
w.dropzone.classList.add("aw-dropzone-loading");
|
|
963
963
|
const de = await t.onUpload(I);
|
|
964
|
-
|
|
964
|
+
v = de, E.style.backgroundImage = `url(${JSON.stringify(de)})`, E.style.display = "block";
|
|
965
965
|
} catch (de) {
|
|
966
966
|
console.error(de);
|
|
967
967
|
} finally {
|
|
@@ -973,43 +973,43 @@ function kn(t = {}, e) {
|
|
|
973
973
|
w.className = "aw-pane-notice", w.textContent = p().image.noUploadApi, y.appendChild(w);
|
|
974
974
|
}
|
|
975
975
|
l.appendChild(h), l.appendChild(g), l.appendChild(y);
|
|
976
|
-
let
|
|
977
|
-
const
|
|
978
|
-
w === "upload" && !u || (
|
|
976
|
+
let L = "embed", S, v;
|
|
977
|
+
const x = (w) => {
|
|
978
|
+
w === "upload" && !u || (L = w, a.classList.toggle("aw-tab-active", w === "embed"), c.classList.toggle("aw-tab-active", w === "url"), d.classList.toggle("aw-tab-active", w === "upload"), h.style.display = w === "embed" ? "block" : "none", g.style.display = w === "url" ? "block" : "none", y.style.display = w === "upload" ? "block" : "none");
|
|
979
979
|
};
|
|
980
|
-
|
|
980
|
+
x(L), a.addEventListener("click", () => x("embed")), c.addEventListener("click", () => x("url")), d.addEventListener("click", () => x("upload")), m.input.addEventListener("change", () => {
|
|
981
981
|
var I;
|
|
982
982
|
const w = (I = m.input.files) == null ? void 0 : I[0];
|
|
983
983
|
if (!w) return;
|
|
984
|
-
const
|
|
985
|
-
|
|
986
|
-
const
|
|
987
|
-
|
|
988
|
-
},
|
|
984
|
+
const E = new FileReader();
|
|
985
|
+
E.onload = () => {
|
|
986
|
+
const D = String(E.result ?? "");
|
|
987
|
+
S = D, f.style.backgroundImage = `url(${JSON.stringify(D)})`, f.style.display = "block", m.input.value = "";
|
|
988
|
+
}, E.readAsDataURL(w);
|
|
989
989
|
});
|
|
990
|
-
const
|
|
991
|
-
|
|
990
|
+
const $ = document.createElement("button");
|
|
991
|
+
$.type = "button", $.className = "aw-btn aw-btn-ghost", $.textContent = p().dialogs.cancel;
|
|
992
992
|
const N = document.createElement("button");
|
|
993
|
-
N.type = "button", N.className = "aw-btn aw-btn-primary", N.textContent = p().dialogs.confirm, i.appendChild(
|
|
993
|
+
N.type = "button", N.className = "aw-btn aw-btn-primary", N.textContent = p().dialogs.confirm, i.appendChild($), i.appendChild(N), $.addEventListener("click", () => {
|
|
994
994
|
r(), n({ confirmed: !1 });
|
|
995
995
|
}), N.addEventListener("click", () => {
|
|
996
996
|
let w;
|
|
997
|
-
|
|
998
|
-
const
|
|
999
|
-
w && (
|
|
997
|
+
L === "embed" ? w = S : L === "url" ? w = k.value || void 0 : L === "upload" && (w = v), r();
|
|
998
|
+
const E = { confirmed: !0 };
|
|
999
|
+
w && (E.src = w), n(E);
|
|
1000
1000
|
}), document.body.appendChild(o);
|
|
1001
1001
|
});
|
|
1002
1002
|
}
|
|
1003
|
-
function
|
|
1003
|
+
function ot(t) {
|
|
1004
1004
|
const e = document.createElement("label");
|
|
1005
1005
|
e.className = "aw-dropzone", e.innerHTML = `
|
|
1006
|
-
${
|
|
1006
|
+
${A.upload}
|
|
1007
1007
|
<div class="aw-dropzone-text">${t}<br/>${p().dialogs.dropOrClick}</div>
|
|
1008
1008
|
`;
|
|
1009
1009
|
const n = document.createElement("input");
|
|
1010
1010
|
return n.type = "file", n.accept = "image/*", n.style.display = "none", e.appendChild(n), { dropzone: e, input: n };
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1012
|
+
function xn(t) {
|
|
1013
1013
|
return new Promise((e) => {
|
|
1014
1014
|
const { overlay: n, body: o, footer: l, close: i } = oe(
|
|
1015
1015
|
p().importHtml.title,
|
|
@@ -1019,7 +1019,7 @@ function wn(t) {
|
|
|
1019
1019
|
r.type = "file", r.accept = ".html,.htm,text/html", r.style.display = "none";
|
|
1020
1020
|
const s = document.createElement("label");
|
|
1021
1021
|
s.className = "aw-dropzone", s.innerHTML = `
|
|
1022
|
-
${
|
|
1022
|
+
${A.importHtml}
|
|
1023
1023
|
<div class="aw-dropzone-text">${p().importHtml.fileSelect}<br/>${p().dialogs.dropOrClick}</div>
|
|
1024
1024
|
`, s.appendChild(r);
|
|
1025
1025
|
const a = document.createElement("div");
|
|
@@ -1042,9 +1042,9 @@ function wn(t) {
|
|
|
1042
1042
|
}), s.addEventListener("dragleave", () => {
|
|
1043
1043
|
s.classList.remove("aw-dropzone-loading");
|
|
1044
1044
|
}), s.addEventListener("drop", (f) => {
|
|
1045
|
-
var y,
|
|
1045
|
+
var y, L;
|
|
1046
1046
|
f.preventDefault(), s.classList.remove("aw-dropzone-loading");
|
|
1047
|
-
const g = (
|
|
1047
|
+
const g = (L = (y = f.dataTransfer) == null ? void 0 : y.files) == null ? void 0 : L[0];
|
|
1048
1048
|
if (!g) return;
|
|
1049
1049
|
const k = new FileReader();
|
|
1050
1050
|
k.onload = () => {
|
|
@@ -1064,7 +1064,7 @@ function wn(t) {
|
|
|
1064
1064
|
}), document.body.appendChild(n);
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
1067
|
+
function En(t) {
|
|
1068
1068
|
return new Promise((e) => {
|
|
1069
1069
|
const { overlay: n, body: o, footer: l, close: i } = oe(
|
|
1070
1070
|
p().importMarkdown.title,
|
|
@@ -1074,7 +1074,7 @@ function vn(t) {
|
|
|
1074
1074
|
r.type = "file", r.accept = ".md,.markdown,text/markdown,text/plain", r.style.display = "none";
|
|
1075
1075
|
const s = document.createElement("label");
|
|
1076
1076
|
s.className = "aw-dropzone", s.innerHTML = `
|
|
1077
|
-
${
|
|
1077
|
+
${A.importMarkdown}
|
|
1078
1078
|
<div class="aw-dropzone-text">${p().importMarkdown.fileSelect}<br/>${p().dialogs.dropOrClick}</div>
|
|
1079
1079
|
`, s.appendChild(r);
|
|
1080
1080
|
const a = document.createElement("div");
|
|
@@ -1102,8 +1102,8 @@ function vn(t) {
|
|
|
1102
1102
|
if (!f) return;
|
|
1103
1103
|
const g = new FileReader();
|
|
1104
1104
|
g.onload = () => {
|
|
1105
|
-
const
|
|
1106
|
-
c.value =
|
|
1105
|
+
const L = String(g.result ?? "");
|
|
1106
|
+
c.value = L, a.textContent = `${f.name} (${f.size.toLocaleString()} bytes)`;
|
|
1107
1107
|
}, g.readAsText(f);
|
|
1108
1108
|
});
|
|
1109
1109
|
const u = document.createElement("button");
|
|
@@ -1119,7 +1119,7 @@ function vn(t) {
|
|
|
1119
1119
|
}), document.body.appendChild(n);
|
|
1120
1120
|
});
|
|
1121
1121
|
}
|
|
1122
|
-
function
|
|
1122
|
+
function An(t = {}, e) {
|
|
1123
1123
|
return new Promise((n) => {
|
|
1124
1124
|
const { overlay: o, body: l, footer: i, close: r } = oe(
|
|
1125
1125
|
p().fileAttach.title,
|
|
@@ -1143,70 +1143,70 @@ function Cn(t = {}, e) {
|
|
|
1143
1143
|
f.className = "aw-pane";
|
|
1144
1144
|
let g;
|
|
1145
1145
|
if (d) {
|
|
1146
|
-
const
|
|
1147
|
-
|
|
1148
|
-
${
|
|
1146
|
+
const v = document.createElement("label");
|
|
1147
|
+
v.className = "aw-dropzone", v.innerHTML = `
|
|
1148
|
+
${A.upload}
|
|
1149
1149
|
<div class="aw-dropzone-text">${p().fileAttach.uploadDropzone}<br/>${p().dialogs.dropOrClick}</div>
|
|
1150
1150
|
`;
|
|
1151
|
-
const
|
|
1152
|
-
|
|
1153
|
-
const
|
|
1154
|
-
|
|
1151
|
+
const x = document.createElement("input");
|
|
1152
|
+
x.type = "file", x.style.display = "none", v.appendChild(x);
|
|
1153
|
+
const $ = document.createElement("div");
|
|
1154
|
+
$.className = "aw-dialog-hint", $.textContent = p().dialogs.selectedFileNone, f.appendChild(v), f.appendChild($);
|
|
1155
1155
|
const N = async (w) => {
|
|
1156
1156
|
if (t.onUpload)
|
|
1157
1157
|
try {
|
|
1158
|
-
|
|
1158
|
+
v.classList.add("aw-dropzone-loading"), g = {
|
|
1159
1159
|
src: await t.onUpload(w),
|
|
1160
1160
|
name: w.name,
|
|
1161
1161
|
size: w.size,
|
|
1162
1162
|
type: w.type || ""
|
|
1163
|
-
},
|
|
1164
|
-
} catch (
|
|
1165
|
-
console.error(
|
|
1163
|
+
}, $.textContent = `${w.name} (${w.size.toLocaleString()} bytes)${p().fileAttach.uploadComplete}`;
|
|
1164
|
+
} catch (E) {
|
|
1165
|
+
console.error(E), $.textContent = `${p().fileAttach.uploadFailed}${E instanceof Error ? E.message : String(E)}`;
|
|
1166
1166
|
} finally {
|
|
1167
|
-
|
|
1167
|
+
v.classList.remove("aw-dropzone-loading"), x.value = "";
|
|
1168
1168
|
}
|
|
1169
1169
|
};
|
|
1170
|
-
|
|
1171
|
-
var
|
|
1172
|
-
const w = (
|
|
1170
|
+
x.addEventListener("change", () => {
|
|
1171
|
+
var E;
|
|
1172
|
+
const w = (E = x.files) == null ? void 0 : E[0];
|
|
1173
1173
|
w && N(w);
|
|
1174
|
-
}),
|
|
1175
|
-
w.preventDefault(),
|
|
1176
|
-
}),
|
|
1177
|
-
|
|
1178
|
-
}),
|
|
1179
|
-
var I,
|
|
1174
|
+
}), v.addEventListener("dragover", (w) => {
|
|
1175
|
+
w.preventDefault(), v.classList.add("aw-dropzone-loading");
|
|
1176
|
+
}), v.addEventListener("dragleave", () => {
|
|
1177
|
+
v.classList.remove("aw-dropzone-loading");
|
|
1178
|
+
}), v.addEventListener("drop", (w) => {
|
|
1179
|
+
var I, D;
|
|
1180
1180
|
w.preventDefault();
|
|
1181
|
-
const
|
|
1182
|
-
|
|
1181
|
+
const E = (D = (I = w.dataTransfer) == null ? void 0 : I.files) == null ? void 0 : D[0];
|
|
1182
|
+
E && N(E);
|
|
1183
1183
|
});
|
|
1184
1184
|
} else {
|
|
1185
|
-
const
|
|
1186
|
-
|
|
1185
|
+
const v = document.createElement("div");
|
|
1186
|
+
v.className = "aw-pane-notice", v.textContent = p().fileAttach.noUploadApi, f.appendChild(v);
|
|
1187
1187
|
}
|
|
1188
1188
|
l.appendChild(u), l.appendChild(f);
|
|
1189
1189
|
let k = "url";
|
|
1190
|
-
const y = (
|
|
1191
|
-
|
|
1190
|
+
const y = (v) => {
|
|
1191
|
+
v === "upload" && !d || (k = v, a.classList.toggle("aw-tab-active", v === "url"), c.classList.toggle("aw-tab-active", v === "upload"), u.style.display = v === "url" ? "block" : "none", f.style.display = v === "upload" ? "block" : "none");
|
|
1192
1192
|
};
|
|
1193
1193
|
y(k), a.addEventListener("click", () => y("url")), c.addEventListener("click", () => y("upload"));
|
|
1194
|
-
const
|
|
1195
|
-
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1194
|
+
const L = document.createElement("button");
|
|
1195
|
+
L.type = "button", L.className = "aw-btn aw-btn-ghost", L.textContent = p().dialogs.cancel;
|
|
1196
|
+
const S = document.createElement("button");
|
|
1197
|
+
S.type = "button", S.className = "aw-btn aw-btn-primary", S.textContent = p().dialogs.confirm, i.appendChild(L), i.appendChild(S), L.addEventListener("click", () => {
|
|
1198
1198
|
r(), n({ confirmed: !1 });
|
|
1199
|
-
}),
|
|
1200
|
-
const
|
|
1199
|
+
}), S.addEventListener("click", () => {
|
|
1200
|
+
const v = { confirmed: !0 };
|
|
1201
1201
|
if (k === "url") {
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1204
|
-
} else g && (
|
|
1205
|
-
r(), n(
|
|
1202
|
+
const x = h.value.trim(), $ = m.value.trim();
|
|
1203
|
+
x.length > 0 && (v.src = x), $.length > 0 && (v.name = $);
|
|
1204
|
+
} else g && (v.src = g.src, v.name = g.name, v.size = g.size, g.type && (v.type = g.type));
|
|
1205
|
+
r(), n(v);
|
|
1206
1206
|
}), document.body.appendChild(o);
|
|
1207
1207
|
});
|
|
1208
1208
|
}
|
|
1209
|
-
function
|
|
1209
|
+
function Tn(t) {
|
|
1210
1210
|
return new Promise((e) => {
|
|
1211
1211
|
const { overlay: n, body: o, footer: l, close: i } = oe(
|
|
1212
1212
|
p().youtube.title,
|
|
@@ -1226,9 +1226,9 @@ function Ln(t) {
|
|
|
1226
1226
|
}), document.body.appendChild(n), setTimeout(() => r.focus(), 0);
|
|
1227
1227
|
});
|
|
1228
1228
|
}
|
|
1229
|
-
const
|
|
1229
|
+
const Rt = "system", ne = [
|
|
1230
1230
|
{
|
|
1231
|
-
id:
|
|
1231
|
+
id: Rt,
|
|
1232
1232
|
label: "시스템 기본",
|
|
1233
1233
|
stack: '-apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif'
|
|
1234
1234
|
},
|
|
@@ -1283,10 +1283,10 @@ const Tt = "system", te = [
|
|
|
1283
1283
|
];
|
|
1284
1284
|
(() => {
|
|
1285
1285
|
const t = {};
|
|
1286
|
-
for (const e of
|
|
1286
|
+
for (const e of ne) t[e.id] = e;
|
|
1287
1287
|
return t;
|
|
1288
1288
|
})();
|
|
1289
|
-
const
|
|
1289
|
+
const Sn = [
|
|
1290
1290
|
12,
|
|
1291
1291
|
13,
|
|
1292
1292
|
14,
|
|
@@ -1300,24 +1300,24 @@ const xn = [
|
|
|
1300
1300
|
40,
|
|
1301
1301
|
48
|
|
1302
1302
|
];
|
|
1303
|
-
function
|
|
1303
|
+
function $n(t) {
|
|
1304
1304
|
if (!t) return null;
|
|
1305
1305
|
const e = t.trim(), n = /^(\d+(?:\.\d+)?)px$/i.exec(e);
|
|
1306
1306
|
if (n && n[1]) return Math.round(Number(n[1]));
|
|
1307
1307
|
const o = /^(\d+(?:\.\d+)?)rem$/i.exec(e);
|
|
1308
1308
|
return o && o[1] ? Math.round(Number(o[1]) * 16) : null;
|
|
1309
1309
|
}
|
|
1310
|
-
let
|
|
1311
|
-
const ye = /* @__PURE__ */ new Set(), ze = /* @__PURE__ */ new Set(),
|
|
1312
|
-
function
|
|
1313
|
-
return ye.size === 0 ?
|
|
1310
|
+
let lt = !1;
|
|
1311
|
+
const ye = /* @__PURE__ */ new Set(), ze = /* @__PURE__ */ new Set(), Bn = "가A";
|
|
1312
|
+
function Mn() {
|
|
1313
|
+
return ye.size === 0 ? ne : ne.filter((t) => !ye.has(t.id));
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function Nn(t) {
|
|
1316
1316
|
return ze.add(t), () => {
|
|
1317
1317
|
ze.delete(t);
|
|
1318
1318
|
};
|
|
1319
1319
|
}
|
|
1320
|
-
function
|
|
1320
|
+
function Rn(t) {
|
|
1321
1321
|
const e = ke(t);
|
|
1322
1322
|
if (!e) return !1;
|
|
1323
1323
|
const n = document.createElement("canvas").getContext("2d");
|
|
@@ -1327,50 +1327,50 @@ function $n(t) {
|
|
|
1327
1327
|
(l) => o(`"${e}", ${l}`) !== o(l)
|
|
1328
1328
|
);
|
|
1329
1329
|
}
|
|
1330
|
-
function
|
|
1330
|
+
function Fe(t) {
|
|
1331
1331
|
let e = !1;
|
|
1332
1332
|
for (const n of t)
|
|
1333
|
-
ye.has(n.id) ||
|
|
1333
|
+
ye.has(n.id) || Rn(n.stack) || (ye.add(n.id), e = !0);
|
|
1334
1334
|
if (e)
|
|
1335
1335
|
for (const n of ze) n();
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function it(t) {
|
|
1338
1338
|
const e = document.fonts;
|
|
1339
1339
|
if (!(!e || typeof e.load != "function"))
|
|
1340
1340
|
for (const n of t) {
|
|
1341
1341
|
const o = ke(n.stack);
|
|
1342
|
-
o && e.load(`16px "${o}"`,
|
|
1343
|
-
l.length === 0 &&
|
|
1344
|
-
}).catch(() =>
|
|
1342
|
+
o && e.load(`16px "${o}"`, Bn).then((l) => {
|
|
1343
|
+
l.length === 0 && Fe([n]);
|
|
1344
|
+
}).catch(() => Fe([n]));
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1348
|
-
if (
|
|
1349
|
-
const t =
|
|
1347
|
+
function Hn() {
|
|
1348
|
+
if (lt || (lt = !0, typeof document > "u")) return;
|
|
1349
|
+
const t = ne.filter((e) => e.googleFonts);
|
|
1350
1350
|
if (t.length > 0) {
|
|
1351
1351
|
const e = "https://fonts.googleapis.com/css2?" + t.map((n) => `family=${n.googleFonts}`).join("&") + "&display=swap";
|
|
1352
|
-
|
|
1352
|
+
rt(e, t);
|
|
1353
1353
|
}
|
|
1354
|
-
for (const e of
|
|
1355
|
-
e.cssUrl &&
|
|
1354
|
+
for (const e of ne)
|
|
1355
|
+
e.cssUrl && rt(e.cssUrl, [e]);
|
|
1356
1356
|
}
|
|
1357
|
-
function
|
|
1357
|
+
function rt(t, e) {
|
|
1358
1358
|
if (document.querySelector(
|
|
1359
1359
|
`link[rel="stylesheet"][href="${t}"]`
|
|
1360
1360
|
)) {
|
|
1361
|
-
|
|
1361
|
+
it(e);
|
|
1362
1362
|
return;
|
|
1363
1363
|
}
|
|
1364
1364
|
const o = document.createElement("link");
|
|
1365
|
-
o.rel = "stylesheet", o.href = t, o.addEventListener("error", () =>
|
|
1365
|
+
o.rel = "stylesheet", o.href = t, o.addEventListener("error", () => Fe(e)), o.addEventListener("load", () => it(e)), document.head.appendChild(o);
|
|
1366
1366
|
}
|
|
1367
|
-
function
|
|
1367
|
+
function In(t) {
|
|
1368
1368
|
var o;
|
|
1369
1369
|
if (!t) return null;
|
|
1370
1370
|
const e = ke(t);
|
|
1371
1371
|
if (!e) return null;
|
|
1372
1372
|
const n = e.toLowerCase();
|
|
1373
|
-
for (const l of
|
|
1373
|
+
for (const l of ne) {
|
|
1374
1374
|
const i = (o = ke(l.stack)) == null ? void 0 : o.toLowerCase();
|
|
1375
1375
|
if (i && i === n) return l.id;
|
|
1376
1376
|
}
|
|
@@ -1381,11 +1381,11 @@ function ke(t) {
|
|
|
1381
1381
|
const e = (n = t.split(",")[0]) == null ? void 0 : n.trim();
|
|
1382
1382
|
return e ? e.replace(/^["']|["']$/g, "") : null;
|
|
1383
1383
|
}
|
|
1384
|
-
const
|
|
1384
|
+
const H = {
|
|
1385
1385
|
lineComment: "//",
|
|
1386
1386
|
blockComment: { start: "/*", end: "*/" },
|
|
1387
1387
|
stringDelims: ['"', "'"]
|
|
1388
|
-
},
|
|
1388
|
+
}, Ht = /* @__PURE__ */ new Set([
|
|
1389
1389
|
"abstract",
|
|
1390
1390
|
"arguments",
|
|
1391
1391
|
"async",
|
|
@@ -1440,8 +1440,8 @@ const R = {
|
|
|
1440
1440
|
"while",
|
|
1441
1441
|
"with",
|
|
1442
1442
|
"yield"
|
|
1443
|
-
]),
|
|
1444
|
-
...
|
|
1443
|
+
]), Dn = /* @__PURE__ */ new Set([
|
|
1444
|
+
...Ht,
|
|
1445
1445
|
"any",
|
|
1446
1446
|
"as",
|
|
1447
1447
|
"asserts",
|
|
@@ -1464,7 +1464,7 @@ const R = {
|
|
|
1464
1464
|
"type",
|
|
1465
1465
|
"unique",
|
|
1466
1466
|
"unknown"
|
|
1467
|
-
]),
|
|
1467
|
+
]), zn = /* @__PURE__ */ new Set([
|
|
1468
1468
|
"False",
|
|
1469
1469
|
"None",
|
|
1470
1470
|
"True",
|
|
@@ -1500,7 +1500,7 @@ const R = {
|
|
|
1500
1500
|
"while",
|
|
1501
1501
|
"with",
|
|
1502
1502
|
"yield"
|
|
1503
|
-
]),
|
|
1503
|
+
]), Fn = /* @__PURE__ */ new Set([
|
|
1504
1504
|
"abs",
|
|
1505
1505
|
"all",
|
|
1506
1506
|
"any",
|
|
@@ -1528,7 +1528,7 @@ const R = {
|
|
|
1528
1528
|
"zip",
|
|
1529
1529
|
"self",
|
|
1530
1530
|
"cls"
|
|
1531
|
-
]),
|
|
1531
|
+
]), It = /* @__PURE__ */ new Set([
|
|
1532
1532
|
"auto",
|
|
1533
1533
|
"break",
|
|
1534
1534
|
"case",
|
|
@@ -1565,8 +1565,8 @@ const R = {
|
|
|
1565
1565
|
"restrict",
|
|
1566
1566
|
"_Bool",
|
|
1567
1567
|
"NULL"
|
|
1568
|
-
]),
|
|
1569
|
-
|
|
1568
|
+
]), Pn = /* @__PURE__ */ new Set([
|
|
1569
|
+
...It,
|
|
1570
1570
|
"class",
|
|
1571
1571
|
"new",
|
|
1572
1572
|
"delete",
|
|
@@ -1600,7 +1600,7 @@ const R = {
|
|
|
1600
1600
|
"noexcept",
|
|
1601
1601
|
"final",
|
|
1602
1602
|
"auto"
|
|
1603
|
-
]),
|
|
1603
|
+
]), On = /* @__PURE__ */ new Set([
|
|
1604
1604
|
"abstract",
|
|
1605
1605
|
"async",
|
|
1606
1606
|
"await",
|
|
@@ -1685,7 +1685,7 @@ const R = {
|
|
|
1685
1685
|
"init",
|
|
1686
1686
|
"nameof",
|
|
1687
1687
|
"when"
|
|
1688
|
-
]),
|
|
1688
|
+
]), _n = /* @__PURE__ */ new Set([
|
|
1689
1689
|
"abstract",
|
|
1690
1690
|
"assert",
|
|
1691
1691
|
"boolean",
|
|
@@ -1745,7 +1745,7 @@ const R = {
|
|
|
1745
1745
|
"sealed",
|
|
1746
1746
|
"permits",
|
|
1747
1747
|
"non-sealed"
|
|
1748
|
-
]),
|
|
1748
|
+
]), qn = /* @__PURE__ */ new Set([
|
|
1749
1749
|
"abstract",
|
|
1750
1750
|
"actual",
|
|
1751
1751
|
"annotation",
|
|
@@ -1812,7 +1812,7 @@ const R = {
|
|
|
1812
1812
|
"when",
|
|
1813
1813
|
"where",
|
|
1814
1814
|
"while"
|
|
1815
|
-
]),
|
|
1815
|
+
]), Un = /* @__PURE__ */ new Set([
|
|
1816
1816
|
"break",
|
|
1817
1817
|
"case",
|
|
1818
1818
|
"chan",
|
|
@@ -1842,7 +1842,7 @@ const R = {
|
|
|
1842
1842
|
"false",
|
|
1843
1843
|
"nil",
|
|
1844
1844
|
"iota"
|
|
1845
|
-
]),
|
|
1845
|
+
]), jn = /* @__PURE__ */ new Set([
|
|
1846
1846
|
"as",
|
|
1847
1847
|
"async",
|
|
1848
1848
|
"await",
|
|
@@ -1891,7 +1891,7 @@ const R = {
|
|
|
1891
1891
|
"unsized",
|
|
1892
1892
|
"virtual",
|
|
1893
1893
|
"yield"
|
|
1894
|
-
]),
|
|
1894
|
+
]), Wn = /* @__PURE__ */ new Set([
|
|
1895
1895
|
"if",
|
|
1896
1896
|
"then",
|
|
1897
1897
|
"else",
|
|
@@ -1922,7 +1922,7 @@ const R = {
|
|
|
1922
1922
|
"source",
|
|
1923
1923
|
"true",
|
|
1924
1924
|
"false"
|
|
1925
|
-
]),
|
|
1925
|
+
]), Kn = /* @__PURE__ */ new Set([
|
|
1926
1926
|
"select",
|
|
1927
1927
|
"from",
|
|
1928
1928
|
"where",
|
|
@@ -1991,7 +1991,7 @@ const R = {
|
|
|
1991
1991
|
"max",
|
|
1992
1992
|
"asc",
|
|
1993
1993
|
"desc"
|
|
1994
|
-
]),
|
|
1994
|
+
]), Gn = /* @__PURE__ */ new Set(["true", "false", "null"]), Dt = [
|
|
1995
1995
|
{
|
|
1996
1996
|
id: "plaintext",
|
|
1997
1997
|
label: "Plain Text",
|
|
@@ -2000,54 +2000,54 @@ const R = {
|
|
|
2000
2000
|
{
|
|
2001
2001
|
id: "javascript",
|
|
2002
2002
|
label: "JavaScript",
|
|
2003
|
-
keywords:
|
|
2004
|
-
...
|
|
2003
|
+
keywords: Ht,
|
|
2004
|
+
...H,
|
|
2005
2005
|
stringDelims: ['"', "'", "`"]
|
|
2006
2006
|
},
|
|
2007
2007
|
{
|
|
2008
2008
|
id: "typescript",
|
|
2009
2009
|
label: "TypeScript",
|
|
2010
|
-
keywords:
|
|
2011
|
-
...
|
|
2010
|
+
keywords: Dn,
|
|
2011
|
+
...H,
|
|
2012
2012
|
stringDelims: ['"', "'", "`"]
|
|
2013
2013
|
},
|
|
2014
2014
|
{
|
|
2015
2015
|
id: "python",
|
|
2016
2016
|
label: "Python",
|
|
2017
|
-
keywords:
|
|
2018
|
-
builtins:
|
|
2017
|
+
keywords: zn,
|
|
2018
|
+
builtins: Fn,
|
|
2019
2019
|
lineComment: "#",
|
|
2020
2020
|
stringDelims: ['"', "'"]
|
|
2021
2021
|
},
|
|
2022
2022
|
{
|
|
2023
2023
|
id: "json",
|
|
2024
2024
|
label: "JSON",
|
|
2025
|
-
keywords:
|
|
2025
|
+
keywords: Gn,
|
|
2026
2026
|
stringDelims: ['"']
|
|
2027
2027
|
},
|
|
2028
2028
|
{
|
|
2029
2029
|
id: "html",
|
|
2030
2030
|
label: "HTML",
|
|
2031
2031
|
keywords: /* @__PURE__ */ new Set(),
|
|
2032
|
-
custom: (t) =>
|
|
2032
|
+
custom: (t) => Jn(t)
|
|
2033
2033
|
},
|
|
2034
2034
|
{
|
|
2035
2035
|
id: "css",
|
|
2036
2036
|
label: "CSS",
|
|
2037
2037
|
keywords: /* @__PURE__ */ new Set(),
|
|
2038
|
-
custom: (t) =>
|
|
2038
|
+
custom: (t) => eo(t)
|
|
2039
2039
|
},
|
|
2040
2040
|
{
|
|
2041
2041
|
id: "bash",
|
|
2042
2042
|
label: "Bash",
|
|
2043
|
-
keywords:
|
|
2043
|
+
keywords: Wn,
|
|
2044
2044
|
lineComment: "#",
|
|
2045
2045
|
stringDelims: ['"', "'"]
|
|
2046
2046
|
},
|
|
2047
2047
|
{
|
|
2048
2048
|
id: "sql",
|
|
2049
2049
|
label: "SQL",
|
|
2050
|
-
keywords:
|
|
2050
|
+
keywords: Kn,
|
|
2051
2051
|
caseInsensitiveKeywords: !0,
|
|
2052
2052
|
lineComment: "--",
|
|
2053
2053
|
blockComment: { start: "/*", end: "*/" },
|
|
@@ -2057,26 +2057,26 @@ const R = {
|
|
|
2057
2057
|
id: "markdown",
|
|
2058
2058
|
label: "Markdown",
|
|
2059
2059
|
keywords: /* @__PURE__ */ new Set(),
|
|
2060
|
-
custom: (t) =>
|
|
2060
|
+
custom: (t) => to(t)
|
|
2061
2061
|
},
|
|
2062
|
-
{ id: "c", label: "C", keywords:
|
|
2063
|
-
{ id: "cpp", label: "C++", keywords:
|
|
2064
|
-
{ id: "csharp", label: "C#", keywords:
|
|
2065
|
-
{ id: "java", label: "Java", keywords:
|
|
2066
|
-
{ id: "kotlin", label: "Kotlin", keywords:
|
|
2067
|
-
{ id: "go", label: "Go", keywords:
|
|
2068
|
-
{ id: "rust", label: "Rust", keywords:
|
|
2069
|
-
],
|
|
2062
|
+
{ id: "c", label: "C", keywords: It, ...H },
|
|
2063
|
+
{ id: "cpp", label: "C++", keywords: Pn, ...H },
|
|
2064
|
+
{ id: "csharp", label: "C#", keywords: On, ...H },
|
|
2065
|
+
{ id: "java", label: "Java", keywords: _n, ...H },
|
|
2066
|
+
{ id: "kotlin", label: "Kotlin", keywords: qn, ...H },
|
|
2067
|
+
{ id: "go", label: "Go", keywords: Un, ...H },
|
|
2068
|
+
{ id: "rust", label: "Rust", keywords: jn, ...H }
|
|
2069
|
+
], Yn = (() => {
|
|
2070
2070
|
const t = /* @__PURE__ */ new Map();
|
|
2071
|
-
for (const e of
|
|
2071
|
+
for (const e of Dt) t.set(e.id, e);
|
|
2072
2072
|
return t;
|
|
2073
|
-
})();
|
|
2074
|
-
function
|
|
2075
|
-
if (!e) return
|
|
2076
|
-
const n =
|
|
2077
|
-
return n ? n.custom ? n.custom(t) :
|
|
2073
|
+
})(), Vn = "plaintext";
|
|
2074
|
+
function st(t, e) {
|
|
2075
|
+
if (!e || e === Vn) return C(t);
|
|
2076
|
+
const n = Yn.get(e);
|
|
2077
|
+
return n ? n.custom ? n.custom(t) : Zn(t, n) : C(t);
|
|
2078
2078
|
}
|
|
2079
|
-
function
|
|
2079
|
+
function Zn(t, e) {
|
|
2080
2080
|
var r, s;
|
|
2081
2081
|
const n = !!e.caseInsensitiveKeywords;
|
|
2082
2082
|
let o = "", l = 0;
|
|
@@ -2085,12 +2085,12 @@ function Kn(t, e) {
|
|
|
2085
2085
|
if (e.lineComment && t.startsWith(e.lineComment, l)) {
|
|
2086
2086
|
const d = t.indexOf(`
|
|
2087
2087
|
`, l), u = d === -1 ? i : d;
|
|
2088
|
-
o += `<span class="hl-comment">${
|
|
2088
|
+
o += `<span class="hl-comment">${C(t.slice(l, u))}</span>`, l = u;
|
|
2089
2089
|
continue;
|
|
2090
2090
|
}
|
|
2091
2091
|
if (e.blockComment && t.startsWith(e.blockComment.start, l)) {
|
|
2092
2092
|
const d = t.indexOf(e.blockComment.end, l + e.blockComment.start.length), u = d === -1 ? i : d + e.blockComment.end.length;
|
|
2093
|
-
o += `<span class="hl-comment">${
|
|
2093
|
+
o += `<span class="hl-comment">${C(t.slice(l, u))}</span>`, l = u;
|
|
2094
2094
|
continue;
|
|
2095
2095
|
}
|
|
2096
2096
|
const a = (r = e.stringDelims) == null ? void 0 : r.find((d) => t.startsWith(d, l));
|
|
@@ -2110,14 +2110,14 @@ function Kn(t, e) {
|
|
|
2110
2110
|
` && a !== "`") break;
|
|
2111
2111
|
d++;
|
|
2112
2112
|
}
|
|
2113
|
-
o += `<span class="hl-string">${
|
|
2113
|
+
o += `<span class="hl-string">${C(t.slice(l, d))}</span>`, l = d;
|
|
2114
2114
|
continue;
|
|
2115
2115
|
}
|
|
2116
2116
|
const c = t[l] ?? "";
|
|
2117
2117
|
if (/[0-9]/.test(c)) {
|
|
2118
|
-
const d =
|
|
2118
|
+
const d = Xn.exec(t.slice(l));
|
|
2119
2119
|
if (d) {
|
|
2120
|
-
o += `<span class="hl-number">${
|
|
2120
|
+
o += `<span class="hl-number">${C(d[0])}</span>`, l += d[0].length;
|
|
2121
2121
|
continue;
|
|
2122
2122
|
}
|
|
2123
2123
|
}
|
|
@@ -2126,87 +2126,87 @@ function Kn(t, e) {
|
|
|
2126
2126
|
for (; d < i && /[a-zA-Z0-9_$]/.test(t[d] ?? ""); ) d++;
|
|
2127
2127
|
const u = t.slice(l, d), h = n ? u.toLowerCase() : u;
|
|
2128
2128
|
if (e.keywords.has(h))
|
|
2129
|
-
o += `<span class="hl-keyword">${
|
|
2129
|
+
o += `<span class="hl-keyword">${C(u)}</span>`;
|
|
2130
2130
|
else if ((s = e.builtins) != null && s.has(h))
|
|
2131
|
-
o += `<span class="hl-builtin">${
|
|
2131
|
+
o += `<span class="hl-builtin">${C(u)}</span>`;
|
|
2132
2132
|
else {
|
|
2133
2133
|
let m = d;
|
|
2134
2134
|
for (; m < i && (t[m] === " " || t[m] === " "); ) m++;
|
|
2135
|
-
t[m] === "(" ? o += `<span class="hl-fn">${
|
|
2135
|
+
t[m] === "(" ? o += `<span class="hl-fn">${C(u)}</span>` : o += C(u);
|
|
2136
2136
|
}
|
|
2137
2137
|
l = d;
|
|
2138
2138
|
continue;
|
|
2139
2139
|
}
|
|
2140
|
-
o +=
|
|
2140
|
+
o += C(c), l++;
|
|
2141
2141
|
}
|
|
2142
2142
|
return o;
|
|
2143
2143
|
}
|
|
2144
|
-
const
|
|
2145
|
-
function
|
|
2144
|
+
const Xn = /^(0[xX][0-9a-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|[0-9][0-9_]*(?:\.[0-9_]+)?(?:[eE][-+]?[0-9_]+)?)[a-zA-Z]*/;
|
|
2145
|
+
function Jn(t) {
|
|
2146
2146
|
let e = "", n = 0;
|
|
2147
2147
|
const o = t.length;
|
|
2148
2148
|
for (; n < o; ) {
|
|
2149
2149
|
if (t.startsWith("<!--", n)) {
|
|
2150
2150
|
const l = t.indexOf("-->", n + 4), i = l === -1 ? o : l + 3;
|
|
2151
|
-
e += `<span class="hl-comment">${
|
|
2151
|
+
e += `<span class="hl-comment">${C(t.slice(n, i))}</span>`, n = i;
|
|
2152
2152
|
continue;
|
|
2153
2153
|
}
|
|
2154
2154
|
if (t[n] === "<") {
|
|
2155
2155
|
const l = t.indexOf(">", n);
|
|
2156
2156
|
if (l === -1) {
|
|
2157
|
-
e +=
|
|
2157
|
+
e += C(t.slice(n));
|
|
2158
2158
|
break;
|
|
2159
2159
|
}
|
|
2160
2160
|
const i = t.slice(n, l + 1);
|
|
2161
|
-
e +=
|
|
2161
|
+
e += Qn(i), n = l + 1;
|
|
2162
2162
|
continue;
|
|
2163
2163
|
}
|
|
2164
|
-
e +=
|
|
2164
|
+
e += C(t[n] ?? ""), n++;
|
|
2165
2165
|
}
|
|
2166
2166
|
return e;
|
|
2167
2167
|
}
|
|
2168
|
-
function
|
|
2168
|
+
function Qn(t) {
|
|
2169
2169
|
const e = t.slice(1, -1);
|
|
2170
2170
|
let n = '<span class="hl-punct"><</span>';
|
|
2171
2171
|
const o = /^\/?[a-zA-Z][a-zA-Z0-9-]*/.exec(e);
|
|
2172
2172
|
if (o) {
|
|
2173
|
-
n += `<span class="hl-tag">${
|
|
2173
|
+
n += `<span class="hl-tag">${C(o[0])}</span>`;
|
|
2174
2174
|
let l = e.slice(o[0].length);
|
|
2175
2175
|
const i = /\s+([a-zA-Z_:][a-zA-Z0-9_:.-]*)(\s*=\s*("([^"]*)"|'([^']*)'|([^\s>]+)))?/g;
|
|
2176
2176
|
let r = 0, s;
|
|
2177
2177
|
for (; s = i.exec(l); ) {
|
|
2178
|
-
n +=
|
|
2178
|
+
n += C(l.slice(r, s.index)), n += C(l.slice(s.index, s.index + s[0].indexOf(s[1] ?? ""))), n += `<span class="hl-attr">${C(s[1] ?? "")}</span>`;
|
|
2179
2179
|
const a = l.slice(s.index + (s[0].indexOf(s[1] ?? "") + (s[1] ?? "").length), s.index + s[0].length);
|
|
2180
2180
|
if (a.includes("=")) {
|
|
2181
2181
|
const c = a.indexOf("=");
|
|
2182
|
-
n +=
|
|
2182
|
+
n += C(a.slice(0, c + 1));
|
|
2183
2183
|
const d = a.slice(c + 1);
|
|
2184
|
-
n += `<span class="hl-string">${
|
|
2184
|
+
n += `<span class="hl-string">${C(d)}</span>`;
|
|
2185
2185
|
}
|
|
2186
2186
|
r = s.index + s[0].length;
|
|
2187
2187
|
}
|
|
2188
|
-
n +=
|
|
2188
|
+
n += C(l.slice(r));
|
|
2189
2189
|
} else
|
|
2190
|
-
n +=
|
|
2190
|
+
n += C(e);
|
|
2191
2191
|
return n += '<span class="hl-punct">></span>', n;
|
|
2192
2192
|
}
|
|
2193
|
-
function
|
|
2193
|
+
function eo(t) {
|
|
2194
2194
|
let e = "", n = 0;
|
|
2195
2195
|
const o = t.length;
|
|
2196
2196
|
let l = !1;
|
|
2197
2197
|
for (; n < o; ) {
|
|
2198
2198
|
if (t.startsWith("/*", n)) {
|
|
2199
2199
|
const r = t.indexOf("*/", n + 2), s = r === -1 ? o : r + 2;
|
|
2200
|
-
e += `<span class="hl-comment">${
|
|
2200
|
+
e += `<span class="hl-comment">${C(t.slice(n, s))}</span>`, n = s;
|
|
2201
2201
|
continue;
|
|
2202
2202
|
}
|
|
2203
2203
|
const i = t[n] ?? "";
|
|
2204
2204
|
if (i === "{") {
|
|
2205
|
-
l = !0, e +=
|
|
2205
|
+
l = !0, e += C(i), n++;
|
|
2206
2206
|
continue;
|
|
2207
2207
|
}
|
|
2208
2208
|
if (i === "}") {
|
|
2209
|
-
l = !1, e +=
|
|
2209
|
+
l = !1, e += C(i), n++;
|
|
2210
2210
|
continue;
|
|
2211
2211
|
}
|
|
2212
2212
|
if (i === '"' || i === "'") {
|
|
@@ -2214,7 +2214,7 @@ function Zn(t) {
|
|
|
2214
2214
|
let s = n + 1;
|
|
2215
2215
|
for (; s < o && t[s] !== r; )
|
|
2216
2216
|
t[s] === "\\" ? s += 2 : s++;
|
|
2217
|
-
s = Math.min(s + 1, o), e += `<span class="hl-string">${
|
|
2217
|
+
s = Math.min(s + 1, o), e += `<span class="hl-string">${C(t.slice(n, s))}</span>`, n = s;
|
|
2218
2218
|
continue;
|
|
2219
2219
|
}
|
|
2220
2220
|
if (/[a-zA-Z_-]/.test(i) || i === "@" || i === "#" || i === "." || i === ":") {
|
|
@@ -2222,57 +2222,57 @@ function Zn(t) {
|
|
|
2222
2222
|
for (; r < o && /[a-zA-Z0-9_-]/.test(t[r] ?? ""); ) r++;
|
|
2223
2223
|
const s = t.slice(n, r);
|
|
2224
2224
|
if (i === "@")
|
|
2225
|
-
e += `<span class="hl-keyword">${
|
|
2225
|
+
e += `<span class="hl-keyword">${C(s)}</span>`;
|
|
2226
2226
|
else if (l && /^[a-zA-Z-]+$/.test(s)) {
|
|
2227
2227
|
let a = r;
|
|
2228
2228
|
for (; a < o && (t[a] === " " || t[a] === " "); ) a++;
|
|
2229
|
-
t[a] === ":" ? e += `<span class="hl-prop">${
|
|
2229
|
+
t[a] === ":" ? e += `<span class="hl-prop">${C(s)}</span>` : e += C(s);
|
|
2230
2230
|
} else
|
|
2231
|
-
e += `<span class="hl-tag">${
|
|
2231
|
+
e += `<span class="hl-tag">${C(s)}</span>`;
|
|
2232
2232
|
n = r;
|
|
2233
2233
|
continue;
|
|
2234
2234
|
}
|
|
2235
2235
|
if (/[0-9]/.test(i)) {
|
|
2236
2236
|
const r = /^[0-9.]+(px|em|rem|%|vh|vw|s|ms|deg|fr)?/.exec(t.slice(n));
|
|
2237
2237
|
if (r) {
|
|
2238
|
-
e += `<span class="hl-number">${
|
|
2238
|
+
e += `<span class="hl-number">${C(r[0])}</span>`, n += r[0].length;
|
|
2239
2239
|
continue;
|
|
2240
2240
|
}
|
|
2241
2241
|
}
|
|
2242
|
-
e +=
|
|
2242
|
+
e += C(i), n++;
|
|
2243
2243
|
}
|
|
2244
2244
|
return e;
|
|
2245
2245
|
}
|
|
2246
|
-
function
|
|
2246
|
+
function to(t) {
|
|
2247
2247
|
return t.split(`
|
|
2248
|
-
`).map(
|
|
2248
|
+
`).map(no).join(`
|
|
2249
2249
|
`);
|
|
2250
2250
|
}
|
|
2251
|
-
function
|
|
2251
|
+
function no(t) {
|
|
2252
2252
|
const e = /^(#{1,6})\s+(.*)$/.exec(t);
|
|
2253
2253
|
if (e)
|
|
2254
|
-
return `<span class="hl-keyword">${
|
|
2254
|
+
return `<span class="hl-keyword">${C(e[1] ?? "")}</span> <span class="hl-tag">${Se(e[2] ?? "")}</span>`;
|
|
2255
2255
|
if (t.startsWith(">"))
|
|
2256
|
-
return `<span class="hl-comment">${
|
|
2256
|
+
return `<span class="hl-comment">${C(t)}</span>`;
|
|
2257
2257
|
if (t.startsWith("```"))
|
|
2258
|
-
return `<span class="hl-keyword">${
|
|
2258
|
+
return `<span class="hl-keyword">${C(t)}</span>`;
|
|
2259
2259
|
const n = /^(\s*)([-*+]|\d+\.)\s+(.*)$/.exec(t);
|
|
2260
|
-
return n ? `${n[1] ?? ""}<span class="hl-keyword">${
|
|
2260
|
+
return n ? `${n[1] ?? ""}<span class="hl-keyword">${C(n[2] ?? "")}</span> ${Se(n[3] ?? "")}` : Se(t);
|
|
2261
2261
|
}
|
|
2262
|
-
function
|
|
2263
|
-
let e =
|
|
2262
|
+
function Se(t) {
|
|
2263
|
+
let e = C(t);
|
|
2264
2264
|
return e = e.replace(/\*\*([^*]+)\*\*/g, '<span class="hl-keyword">**$1**</span>'), e = e.replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)", "g"), '<span class="hl-string">*$1*</span>'), e = e.replace(/`([^`]+)`/g, '<span class="hl-builtin">`$1`</span>'), e = e.replace(
|
|
2265
2265
|
/\[([^\]]+)\]\(([^)]+)\)/g,
|
|
2266
2266
|
'<span class="hl-tag">[$1]</span><span class="hl-string">($2)</span>'
|
|
2267
2267
|
), e;
|
|
2268
2268
|
}
|
|
2269
|
-
function
|
|
2269
|
+
function C(t) {
|
|
2270
2270
|
return t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
2271
2271
|
}
|
|
2272
|
-
function
|
|
2272
|
+
function B(t) {
|
|
2273
2273
|
t.addEventListener("mousedown", (e) => e.preventDefault());
|
|
2274
2274
|
}
|
|
2275
|
-
const
|
|
2275
|
+
const Pe = [
|
|
2276
2276
|
"#000000",
|
|
2277
2277
|
"#5c5c5c",
|
|
2278
2278
|
"#9c9c9c",
|
|
@@ -2290,28 +2290,28 @@ const Fe = [
|
|
|
2290
2290
|
"#37b24d",
|
|
2291
2291
|
"#1098ad"
|
|
2292
2292
|
];
|
|
2293
|
-
function
|
|
2293
|
+
function $e(t, e, n = []) {
|
|
2294
2294
|
_();
|
|
2295
2295
|
const o = document.createElement("div");
|
|
2296
|
-
o.className = "aw-popover aw-color-popover", o.dataset.popover = "true",
|
|
2296
|
+
o.className = "aw-popover aw-color-popover", o.dataset.popover = "true", B(o);
|
|
2297
2297
|
const l = (d) => {
|
|
2298
2298
|
e(d), o.remove();
|
|
2299
2299
|
}, i = (d) => {
|
|
2300
2300
|
const u = document.createElement("button");
|
|
2301
|
-
return u.type = "button", u.className = "aw-color-swatch", u.style.backgroundColor = d, u.setAttribute("aria-label", d), u.title = d,
|
|
2301
|
+
return u.type = "button", u.className = "aw-color-swatch", u.style.backgroundColor = d, u.setAttribute("aria-label", d), u.title = d, B(u), u.addEventListener("click", (h) => {
|
|
2302
2302
|
h.stopPropagation(), l(d);
|
|
2303
2303
|
}), u;
|
|
2304
2304
|
}, r = document.createElement("div");
|
|
2305
2305
|
r.className = "aw-color-grid";
|
|
2306
|
-
for (const d of
|
|
2306
|
+
for (const d of Pe)
|
|
2307
2307
|
r.appendChild(i(d));
|
|
2308
2308
|
o.appendChild(r);
|
|
2309
2309
|
const s = document.createElement("button");
|
|
2310
|
-
s.type = "button", s.className = "aw-popover-action", s.textContent = p().color.defaultColor,
|
|
2310
|
+
s.type = "button", s.className = "aw-popover-action", s.textContent = p().color.defaultColor, B(s), s.addEventListener("click", (d) => {
|
|
2311
2311
|
d.stopPropagation(), l(null);
|
|
2312
2312
|
});
|
|
2313
2313
|
const a = document.createElement("button");
|
|
2314
|
-
a.type = "button", a.className = "aw-popover-action", a.textContent = p().color.customColor,
|
|
2314
|
+
a.type = "button", a.className = "aw-popover-action", a.textContent = p().color.customColor, B(a);
|
|
2315
2315
|
const c = document.createElement("input");
|
|
2316
2316
|
if (c.type = "color", c.tabIndex = -1, c.setAttribute("aria-hidden", "true"), c.style.position = "absolute", c.style.left = "-9999px", c.style.width = "0", c.style.height = "0", c.style.opacity = "0", c.style.pointerEvents = "none", c.addEventListener("change", () => {
|
|
2317
2317
|
l(c.value);
|
|
@@ -2328,7 +2328,7 @@ function Se(t, e, n = []) {
|
|
|
2328
2328
|
}
|
|
2329
2329
|
O(o, t);
|
|
2330
2330
|
}
|
|
2331
|
-
function
|
|
2331
|
+
function oo() {
|
|
2332
2332
|
const t = p().blockMenu;
|
|
2333
2333
|
return [
|
|
2334
2334
|
{ label: t.body, kind: "paragraph", attrs: {}, glyph: "¶" },
|
|
@@ -2339,7 +2339,7 @@ function Qn() {
|
|
|
2339
2339
|
label: t.bulletList,
|
|
2340
2340
|
kind: "bulletList",
|
|
2341
2341
|
attrs: {},
|
|
2342
|
-
glyph:
|
|
2342
|
+
glyph: A.bulletList,
|
|
2343
2343
|
glyphIsSvg: !0,
|
|
2344
2344
|
divider: !0
|
|
2345
2345
|
},
|
|
@@ -2347,21 +2347,21 @@ function Qn() {
|
|
|
2347
2347
|
label: t.orderedList,
|
|
2348
2348
|
kind: "orderedList",
|
|
2349
2349
|
attrs: {},
|
|
2350
|
-
glyph:
|
|
2350
|
+
glyph: A.orderedList,
|
|
2351
2351
|
glyphIsSvg: !0
|
|
2352
2352
|
},
|
|
2353
2353
|
{
|
|
2354
2354
|
label: t.taskList,
|
|
2355
2355
|
kind: "taskList",
|
|
2356
2356
|
attrs: {},
|
|
2357
|
-
glyph:
|
|
2357
|
+
glyph: A.taskList,
|
|
2358
2358
|
glyphIsSvg: !0
|
|
2359
2359
|
},
|
|
2360
2360
|
{
|
|
2361
2361
|
label: t.blockquote,
|
|
2362
2362
|
kind: "blockquote",
|
|
2363
2363
|
attrs: {},
|
|
2364
|
-
glyph:
|
|
2364
|
+
glyph: A.blockquote,
|
|
2365
2365
|
glyphIsSvg: !0,
|
|
2366
2366
|
divider: !0
|
|
2367
2367
|
},
|
|
@@ -2369,7 +2369,7 @@ function Qn() {
|
|
|
2369
2369
|
label: t.codeBlock,
|
|
2370
2370
|
kind: "codeBlock",
|
|
2371
2371
|
attrs: {},
|
|
2372
|
-
glyph:
|
|
2372
|
+
glyph: A.codeBlock,
|
|
2373
2373
|
glyphIsSvg: !0
|
|
2374
2374
|
},
|
|
2375
2375
|
// ── 리치 블록 그룹 (링크/이미지/표/유튜브/파일/구분선) ────────────────
|
|
@@ -2378,7 +2378,7 @@ function Qn() {
|
|
|
2378
2378
|
label: t.link,
|
|
2379
2379
|
kind: "linkCard",
|
|
2380
2380
|
attrs: {},
|
|
2381
|
-
glyph:
|
|
2381
|
+
glyph: A.link,
|
|
2382
2382
|
glyphIsSvg: !0,
|
|
2383
2383
|
divider: !0
|
|
2384
2384
|
},
|
|
@@ -2386,35 +2386,35 @@ function Qn() {
|
|
|
2386
2386
|
label: t.image,
|
|
2387
2387
|
kind: "image",
|
|
2388
2388
|
attrs: {},
|
|
2389
|
-
glyph:
|
|
2389
|
+
glyph: A.image,
|
|
2390
2390
|
glyphIsSvg: !0
|
|
2391
2391
|
},
|
|
2392
2392
|
{
|
|
2393
2393
|
label: t.table,
|
|
2394
2394
|
kind: "table",
|
|
2395
2395
|
attrs: {},
|
|
2396
|
-
glyph:
|
|
2396
|
+
glyph: A.table,
|
|
2397
2397
|
glyphIsSvg: !0
|
|
2398
2398
|
},
|
|
2399
2399
|
{
|
|
2400
2400
|
label: t.youtube,
|
|
2401
2401
|
kind: "youtube",
|
|
2402
2402
|
attrs: {},
|
|
2403
|
-
glyph:
|
|
2403
|
+
glyph: A.youtube,
|
|
2404
2404
|
glyphIsSvg: !0
|
|
2405
2405
|
},
|
|
2406
2406
|
{
|
|
2407
2407
|
label: t.file,
|
|
2408
2408
|
kind: "file",
|
|
2409
2409
|
attrs: {},
|
|
2410
|
-
glyph:
|
|
2410
|
+
glyph: A.attachFile,
|
|
2411
2411
|
glyphIsSvg: !0
|
|
2412
2412
|
},
|
|
2413
2413
|
{
|
|
2414
2414
|
label: t.hr,
|
|
2415
2415
|
kind: "hr",
|
|
2416
2416
|
attrs: {},
|
|
2417
|
-
glyph:
|
|
2417
|
+
glyph: A.hr,
|
|
2418
2418
|
glyphIsSvg: !0
|
|
2419
2419
|
},
|
|
2420
2420
|
// ── 외부 소스 가져오기 ─────────────────────────────────────────────
|
|
@@ -2422,7 +2422,7 @@ function Qn() {
|
|
|
2422
2422
|
label: t.importHtml,
|
|
2423
2423
|
kind: "importHtml",
|
|
2424
2424
|
attrs: {},
|
|
2425
|
-
glyph:
|
|
2425
|
+
glyph: A.importHtml,
|
|
2426
2426
|
glyphIsSvg: !0,
|
|
2427
2427
|
divider: !0
|
|
2428
2428
|
},
|
|
@@ -2430,16 +2430,16 @@ function Qn() {
|
|
|
2430
2430
|
label: t.importMarkdown,
|
|
2431
2431
|
kind: "importMarkdown",
|
|
2432
2432
|
attrs: {},
|
|
2433
|
-
glyph:
|
|
2433
|
+
glyph: A.importMarkdown,
|
|
2434
2434
|
glyphIsSvg: !0
|
|
2435
2435
|
}
|
|
2436
2436
|
];
|
|
2437
2437
|
}
|
|
2438
|
-
function
|
|
2438
|
+
function lo(t, e) {
|
|
2439
2439
|
_();
|
|
2440
2440
|
const n = document.createElement("div");
|
|
2441
|
-
n.className = "aw-popover aw-block-type-popover", n.dataset.popover = "true",
|
|
2442
|
-
for (const o of
|
|
2441
|
+
n.className = "aw-popover aw-block-type-popover", n.dataset.popover = "true", B(n);
|
|
2442
|
+
for (const o of oo()) {
|
|
2443
2443
|
if (o.divider) {
|
|
2444
2444
|
const s = document.createElement("div");
|
|
2445
2445
|
s.className = "aw-popover-divider", n.appendChild(s);
|
|
@@ -2449,16 +2449,16 @@ function eo(t, e) {
|
|
|
2449
2449
|
const i = document.createElement("span");
|
|
2450
2450
|
i.className = "aw-popover-item-glyph", o.glyphIsSvg ? i.innerHTML = o.glyph : i.textContent = o.glyph;
|
|
2451
2451
|
const r = document.createElement("span");
|
|
2452
|
-
r.className = "aw-popover-item-label", r.textContent = o.label, o.size && (r.style.fontSize = o.size), o.weight && (r.style.fontWeight = o.weight), l.appendChild(i), l.appendChild(r),
|
|
2452
|
+
r.className = "aw-popover-item-label", r.textContent = o.label, o.size && (r.style.fontSize = o.size), o.weight && (r.style.fontWeight = o.weight), l.appendChild(i), l.appendChild(r), B(l), l.addEventListener("click", (s) => {
|
|
2453
2453
|
s.stopPropagation(), n.remove(), e({ kind: o.kind, attrs: o.attrs });
|
|
2454
2454
|
}), n.appendChild(l);
|
|
2455
2455
|
}
|
|
2456
2456
|
O(n, t);
|
|
2457
2457
|
}
|
|
2458
|
-
function
|
|
2458
|
+
function io(t, e) {
|
|
2459
2459
|
_();
|
|
2460
2460
|
const n = document.createElement("div");
|
|
2461
|
-
n.className = "aw-popover aw-align-popover", n.dataset.popover = "true",
|
|
2461
|
+
n.className = "aw-popover aw-align-popover", n.dataset.popover = "true", B(n);
|
|
2462
2462
|
const o = p().align, l = [
|
|
2463
2463
|
{ icon: "alignLeft", value: "left", label: o.left },
|
|
2464
2464
|
{ icon: "alignCenter", value: "center", label: o.center },
|
|
@@ -2467,33 +2467,33 @@ function to(t, e) {
|
|
|
2467
2467
|
];
|
|
2468
2468
|
for (const i of l) {
|
|
2469
2469
|
const r = document.createElement("button");
|
|
2470
|
-
r.type = "button", r.className = "aw-popover-item aw-popover-item-icon", r.setAttribute("aria-label", i.label), r.title = i.label, r.innerHTML =
|
|
2470
|
+
r.type = "button", r.className = "aw-popover-item aw-popover-item-icon", r.setAttribute("aria-label", i.label), r.title = i.label, r.innerHTML = A[i.icon] ?? "", B(r), r.addEventListener("click", (s) => {
|
|
2471
2471
|
s.stopPropagation(), n.remove(), e(i.value);
|
|
2472
2472
|
}), n.appendChild(r);
|
|
2473
2473
|
}
|
|
2474
2474
|
O(n, t);
|
|
2475
2475
|
}
|
|
2476
|
-
function
|
|
2477
|
-
|
|
2476
|
+
function ro(t, e, n) {
|
|
2477
|
+
Hn(), _();
|
|
2478
2478
|
const o = document.createElement("div");
|
|
2479
|
-
o.className = "aw-popover aw-font-family-popover", o.dataset.popover = "true",
|
|
2479
|
+
o.className = "aw-popover aw-font-family-popover", o.dataset.popover = "true", B(o);
|
|
2480
2480
|
const l = () => {
|
|
2481
2481
|
o.replaceChildren();
|
|
2482
|
-
for (const r of
|
|
2482
|
+
for (const r of Mn()) {
|
|
2483
2483
|
const s = document.createElement("button");
|
|
2484
2484
|
s.type = "button", s.className = "aw-popover-item aw-font-family-item", n && n === r.id && s.classList.add("aw-popover-item-active");
|
|
2485
|
-
const a = r.id ===
|
|
2485
|
+
const a = r.id === Rt ? p().fontFamily.systemDefault : r.label;
|
|
2486
2486
|
s.title = a;
|
|
2487
2487
|
const c = document.createElement("span");
|
|
2488
2488
|
c.className = "aw-font-family-name", c.textContent = a;
|
|
2489
2489
|
const d = document.createElement("span");
|
|
2490
|
-
d.className = "aw-font-family-preview", d.textContent = "가A", d.style.fontFamily = r.stack, s.appendChild(c), s.appendChild(d),
|
|
2490
|
+
d.className = "aw-font-family-preview", d.textContent = "가A", d.style.fontFamily = r.stack, s.appendChild(c), s.appendChild(d), B(s), s.addEventListener("click", (u) => {
|
|
2491
2491
|
u.stopPropagation(), o.remove(), e({ id: r.id, label: r.label, stack: r.stack });
|
|
2492
2492
|
}), o.appendChild(s);
|
|
2493
2493
|
}
|
|
2494
2494
|
};
|
|
2495
2495
|
l();
|
|
2496
|
-
const i =
|
|
2496
|
+
const i = Nn(() => {
|
|
2497
2497
|
if (!o.isConnected) {
|
|
2498
2498
|
i();
|
|
2499
2499
|
return;
|
|
@@ -2502,21 +2502,21 @@ function no(t, e, n) {
|
|
|
2502
2502
|
});
|
|
2503
2503
|
O(o, t);
|
|
2504
2504
|
}
|
|
2505
|
-
function
|
|
2505
|
+
function so(t, e, n) {
|
|
2506
2506
|
_();
|
|
2507
2507
|
const o = document.createElement("div");
|
|
2508
|
-
o.className = "aw-popover aw-code-lang-popover", o.dataset.popover = "true",
|
|
2509
|
-
for (const l of
|
|
2508
|
+
o.className = "aw-popover aw-code-lang-popover", o.dataset.popover = "true", B(o);
|
|
2509
|
+
for (const l of Dt) {
|
|
2510
2510
|
const i = document.createElement("button");
|
|
2511
2511
|
i.type = "button", i.className = "aw-popover-item aw-code-lang-item", n === l.id && i.classList.add("aw-popover-item-active"), i.title = l.label;
|
|
2512
2512
|
const r = document.createElement("span");
|
|
2513
|
-
r.className = "aw-popover-item-label", r.textContent = l.label, i.appendChild(r),
|
|
2513
|
+
r.className = "aw-popover-item-label", r.textContent = l.label, i.appendChild(r), B(i), i.addEventListener("click", (s) => {
|
|
2514
2514
|
s.stopPropagation(), o.remove(), e({ id: l.id, label: l.label });
|
|
2515
2515
|
}), o.appendChild(i);
|
|
2516
2516
|
}
|
|
2517
2517
|
O(o, t);
|
|
2518
2518
|
}
|
|
2519
|
-
function
|
|
2519
|
+
function ao() {
|
|
2520
2520
|
const t = p().tableMenu;
|
|
2521
2521
|
return [
|
|
2522
2522
|
{ action: "rowAbove", label: t.rowAbove },
|
|
@@ -2527,37 +2527,37 @@ function lo() {
|
|
|
2527
2527
|
{ action: "deleteCol", label: t.deleteCol }
|
|
2528
2528
|
];
|
|
2529
2529
|
}
|
|
2530
|
-
function
|
|
2530
|
+
function co(t, e) {
|
|
2531
2531
|
_();
|
|
2532
2532
|
const n = document.createElement("div");
|
|
2533
|
-
n.className = "aw-popover aw-table-menu-popover", n.dataset.popover = "true",
|
|
2534
|
-
for (const o of
|
|
2533
|
+
n.className = "aw-popover aw-table-menu-popover", n.dataset.popover = "true", B(n);
|
|
2534
|
+
for (const o of ao()) {
|
|
2535
2535
|
if (o.divider) {
|
|
2536
2536
|
const i = document.createElement("div");
|
|
2537
2537
|
i.className = "aw-popover-divider", n.appendChild(i);
|
|
2538
2538
|
}
|
|
2539
2539
|
const l = document.createElement("button");
|
|
2540
|
-
l.type = "button", l.className = "aw-popover-item aw-table-menu-item", l.textContent = o.label,
|
|
2540
|
+
l.type = "button", l.className = "aw-popover-item aw-table-menu-item", l.textContent = o.label, B(l), l.addEventListener("click", (i) => {
|
|
2541
2541
|
i.stopPropagation(), n.remove(), e(o.action);
|
|
2542
2542
|
}), n.appendChild(l);
|
|
2543
2543
|
}
|
|
2544
2544
|
O(n, t);
|
|
2545
2545
|
}
|
|
2546
|
-
function
|
|
2546
|
+
function uo(t, e, n) {
|
|
2547
2547
|
_();
|
|
2548
2548
|
const o = document.createElement("div");
|
|
2549
|
-
o.className = "aw-popover aw-font-size-popover", o.dataset.popover = "true",
|
|
2550
|
-
for (const l of
|
|
2549
|
+
o.className = "aw-popover aw-font-size-popover", o.dataset.popover = "true", B(o);
|
|
2550
|
+
for (const l of Sn) {
|
|
2551
2551
|
const i = document.createElement("button");
|
|
2552
2552
|
i.type = "button", i.className = "aw-popover-item aw-font-size-item", n === l && i.classList.add("aw-popover-item-active"), i.title = `${l}px`;
|
|
2553
2553
|
const r = document.createElement("span");
|
|
2554
|
-
r.className = "aw-font-size-label", r.textContent = String(l), i.appendChild(r),
|
|
2554
|
+
r.className = "aw-font-size-label", r.textContent = String(l), i.appendChild(r), B(i), i.addEventListener("click", (s) => {
|
|
2555
2555
|
s.stopPropagation(), o.remove(), e({ px: l });
|
|
2556
2556
|
}), o.appendChild(i);
|
|
2557
2557
|
}
|
|
2558
2558
|
O(o, t);
|
|
2559
2559
|
}
|
|
2560
|
-
function
|
|
2560
|
+
function at(t, e) {
|
|
2561
2561
|
_();
|
|
2562
2562
|
const n = 2, o = 12, l = document.createElement("div");
|
|
2563
2563
|
l.className = "aw-popover aw-table-popover", l.dataset.popover = "true";
|
|
@@ -2595,8 +2595,8 @@ function lt(t, e) {
|
|
|
2595
2595
|
if (!g.classList.contains("aw-table-cell")) return;
|
|
2596
2596
|
const k = parseInt(g.dataset.row ?? "0", 10), y = parseInt(g.dataset.col ?? "0", 10);
|
|
2597
2597
|
c = k, d = y;
|
|
2598
|
-
let
|
|
2599
|
-
k >= s && s < o && (s = Math.min(o, k + 1),
|
|
2598
|
+
let L = !1;
|
|
2599
|
+
k >= s && s < o && (s = Math.min(o, k + 1), L = !0), y >= a && a < o && (a = Math.min(o, y + 1), L = !0), L ? m() : h();
|
|
2600
2600
|
}), i.addEventListener("click", (f) => {
|
|
2601
2601
|
const g = f.target;
|
|
2602
2602
|
if (!g.classList.contains("aw-table-cell")) return;
|
|
@@ -2632,10 +2632,10 @@ function O(t, e) {
|
|
|
2632
2632
|
function _() {
|
|
2633
2633
|
document.querySelectorAll('[data-popover="true"]').forEach((t) => t.remove());
|
|
2634
2634
|
}
|
|
2635
|
-
function
|
|
2635
|
+
function zt(t) {
|
|
2636
2636
|
return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : t < 1024 * 1024 * 1024 ? `${(t / 1024 / 1024).toFixed(1)} MB` : `${(t / 1024 / 1024 / 1024).toFixed(1)} GB`;
|
|
2637
2637
|
}
|
|
2638
|
-
function
|
|
2638
|
+
function Ft(t, e) {
|
|
2639
2639
|
if (t) {
|
|
2640
2640
|
const n = t.lastIndexOf(".");
|
|
2641
2641
|
if (n > 0 && n < t.length - 1)
|
|
@@ -2643,24 +2643,24 @@ function Nt(t, e) {
|
|
|
2643
2643
|
}
|
|
2644
2644
|
return e ? (e.split("/").pop() ?? "").toUpperCase() : "";
|
|
2645
2645
|
}
|
|
2646
|
-
function
|
|
2646
|
+
function We(t) {
|
|
2647
2647
|
try {
|
|
2648
2648
|
return new URL(t).hostname;
|
|
2649
2649
|
} catch {
|
|
2650
2650
|
return "";
|
|
2651
2651
|
}
|
|
2652
2652
|
}
|
|
2653
|
-
function
|
|
2654
|
-
const e =
|
|
2653
|
+
function Pt(t) {
|
|
2654
|
+
const e = We(t);
|
|
2655
2655
|
return e ? `https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64` : "";
|
|
2656
2656
|
}
|
|
2657
|
-
const
|
|
2657
|
+
const Ot = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"/><path d="M14 3v6h6"/></svg>', _t = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>', qt = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", ae = "https://www.youtube-nocookie.com/embed/", Ut = "파일", G = "data-block-id", Ke = /[-]/g, Ge = [
|
|
2658
2658
|
"id",
|
|
2659
2659
|
"class",
|
|
2660
2660
|
"dir",
|
|
2661
2661
|
"lang",
|
|
2662
2662
|
"title"
|
|
2663
|
-
],
|
|
2663
|
+
], po = /* @__PURE__ */ new Set([
|
|
2664
2664
|
"div",
|
|
2665
2665
|
"section",
|
|
2666
2666
|
"article",
|
|
@@ -2681,12 +2681,12 @@ const Rt = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-wi
|
|
|
2681
2681
|
"small",
|
|
2682
2682
|
"span"
|
|
2683
2683
|
]);
|
|
2684
|
-
function
|
|
2684
|
+
function jt(t) {
|
|
2685
2685
|
if (!t) return "div";
|
|
2686
2686
|
const e = t.toLowerCase();
|
|
2687
|
-
return
|
|
2687
|
+
return po.has(e) ? e : "div";
|
|
2688
2688
|
}
|
|
2689
|
-
function
|
|
2689
|
+
function Wt(...t) {
|
|
2690
2690
|
const e = /* @__PURE__ */ new Set();
|
|
2691
2691
|
for (const n of t)
|
|
2692
2692
|
if (n)
|
|
@@ -2694,23 +2694,23 @@ function Pt(...t) {
|
|
|
2694
2694
|
o && e.add(o);
|
|
2695
2695
|
return [...e].join(" ");
|
|
2696
2696
|
}
|
|
2697
|
-
const P = "aw-task-list", W = "data-checked",
|
|
2697
|
+
const P = "aw-task-list", W = "data-checked", ho = /* @__PURE__ */ new Set([
|
|
2698
2698
|
"http:",
|
|
2699
2699
|
"https:",
|
|
2700
2700
|
"mailto:",
|
|
2701
2701
|
"tel:",
|
|
2702
2702
|
"ftp:",
|
|
2703
2703
|
"sms:"
|
|
2704
|
-
]),
|
|
2704
|
+
]), fo = /* @__PURE__ */ new Set([
|
|
2705
2705
|
"http:",
|
|
2706
2706
|
"https:",
|
|
2707
2707
|
"blob:"
|
|
2708
|
-
]),
|
|
2709
|
-
function
|
|
2710
|
-
return t.replace(
|
|
2708
|
+
]), mo = /^data:image\/[a-z0-9.+-]+[,;]/i;
|
|
2709
|
+
function Kt(t) {
|
|
2710
|
+
return t.replace(go, "");
|
|
2711
2711
|
}
|
|
2712
|
-
const
|
|
2713
|
-
function
|
|
2712
|
+
const go = new RegExp("[\\u0000-\\u0020\\u007f]", "g");
|
|
2713
|
+
function Gt(t) {
|
|
2714
2714
|
const e = /^([a-z][a-z0-9+.-]*):/i.exec(t);
|
|
2715
2715
|
return e && e[1] ? `${e[1].toLowerCase()}:` : null;
|
|
2716
2716
|
}
|
|
@@ -2718,25 +2718,25 @@ function q(t) {
|
|
|
2718
2718
|
if (!t) return "";
|
|
2719
2719
|
const e = t.trim();
|
|
2720
2720
|
if (!e) return "";
|
|
2721
|
-
const n =
|
|
2722
|
-
return n === null ||
|
|
2721
|
+
const n = Gt(Kt(e));
|
|
2722
|
+
return n === null || ho.has(n) ? e : "";
|
|
2723
2723
|
}
|
|
2724
|
-
function
|
|
2724
|
+
function R(t) {
|
|
2725
2725
|
if (!t) return "";
|
|
2726
2726
|
const e = t.trim();
|
|
2727
2727
|
if (!e) return "";
|
|
2728
|
-
const n =
|
|
2729
|
-
return o === null ? e : o === "data:" ?
|
|
2728
|
+
const n = Kt(e), o = Gt(n);
|
|
2729
|
+
return o === null ? e : o === "data:" ? mo.test(n) ? e : "" : fo.has(o) ? e : "";
|
|
2730
2730
|
}
|
|
2731
|
-
function
|
|
2731
|
+
function Ye(t) {
|
|
2732
2732
|
return t && /^[A-Za-z0-9_-]{6,20}$/.test(t) ? t : "";
|
|
2733
2733
|
}
|
|
2734
|
-
const
|
|
2735
|
-
function
|
|
2734
|
+
const bo = 1;
|
|
2735
|
+
function yo(t) {
|
|
2736
2736
|
const e = t.version;
|
|
2737
2737
|
return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : 1;
|
|
2738
2738
|
}
|
|
2739
|
-
const
|
|
2739
|
+
const ko = /* @__PURE__ */ new Set([
|
|
2740
2740
|
"paragraph",
|
|
2741
2741
|
"heading",
|
|
2742
2742
|
"bulletList",
|
|
@@ -2753,11 +2753,11 @@ const mo = /* @__PURE__ */ new Set([
|
|
|
2753
2753
|
"importedHtml",
|
|
2754
2754
|
"unknown"
|
|
2755
2755
|
]);
|
|
2756
|
-
function
|
|
2757
|
-
return t.map((e) =>
|
|
2756
|
+
function Ee(t) {
|
|
2757
|
+
return t.map((e) => Yt(e));
|
|
2758
2758
|
}
|
|
2759
|
-
function
|
|
2760
|
-
const e =
|
|
2759
|
+
function Yt(t) {
|
|
2760
|
+
const e = ko.has(t.kind) ? t.kind : "unknown", n = Math.max(yo(t), 1);
|
|
2761
2761
|
return {
|
|
2762
2762
|
...t,
|
|
2763
2763
|
kind: e,
|
|
@@ -2770,7 +2770,7 @@ const ce = [
|
|
|
2770
2770
|
"italic",
|
|
2771
2771
|
"underline",
|
|
2772
2772
|
"strike"
|
|
2773
|
-
],
|
|
2773
|
+
], wo = {
|
|
2774
2774
|
kind: "paragraph",
|
|
2775
2775
|
// 표시용 라벨은 로케일에 따라 달라지므로 `getBlockLabel()` 을 쓴다.
|
|
2776
2776
|
// 이 필드는 로케일 무관 기본값(한국어) 이다.
|
|
@@ -2780,9 +2780,9 @@ const ce = [
|
|
|
2780
2780
|
allowsColor: !0,
|
|
2781
2781
|
allowsFontSize: !0,
|
|
2782
2782
|
matches: (t) => t.tagName === "P" ? { kind: "paragraph", attrs: {} } : null,
|
|
2783
|
-
create: () =>
|
|
2783
|
+
create: () => X(document.createElement("p")),
|
|
2784
2784
|
isEmpty: (t) => U(t)
|
|
2785
|
-
},
|
|
2785
|
+
}, vo = {
|
|
2786
2786
|
kind: "heading",
|
|
2787
2787
|
label: "제목",
|
|
2788
2788
|
allowsInlineFormat: !0,
|
|
@@ -2798,11 +2798,11 @@ const ce = [
|
|
|
2798
2798
|
return e ? { kind: "heading", attrs: { level: Number(e[1]) } } : null;
|
|
2799
2799
|
},
|
|
2800
2800
|
create: (t) => {
|
|
2801
|
-
const e =
|
|
2802
|
-
return
|
|
2801
|
+
const e = ol(t == null ? void 0 : t.level);
|
|
2802
|
+
return X(document.createElement(`h${e}`));
|
|
2803
2803
|
},
|
|
2804
2804
|
isEmpty: (t) => U(t)
|
|
2805
|
-
},
|
|
2805
|
+
}, Co = {
|
|
2806
2806
|
kind: "bulletList",
|
|
2807
2807
|
label: "글머리 목록",
|
|
2808
2808
|
allowsInlineFormat: !0,
|
|
@@ -2810,9 +2810,9 @@ const ce = [
|
|
|
2810
2810
|
allowsColor: !0,
|
|
2811
2811
|
allowsFontSize: !0,
|
|
2812
2812
|
matches: (t) => t.tagName === "UL" ? { kind: "bulletList", attrs: {} } : null,
|
|
2813
|
-
create: () =>
|
|
2814
|
-
isEmpty: (t) =>
|
|
2815
|
-
},
|
|
2813
|
+
create: () => Je("ul"),
|
|
2814
|
+
isEmpty: (t) => Qe(t)
|
|
2815
|
+
}, Lo = {
|
|
2816
2816
|
kind: "orderedList",
|
|
2817
2817
|
label: "번호 매기기 목록",
|
|
2818
2818
|
allowsInlineFormat: !0,
|
|
@@ -2820,9 +2820,9 @@ const ce = [
|
|
|
2820
2820
|
allowsColor: !0,
|
|
2821
2821
|
allowsFontSize: !0,
|
|
2822
2822
|
matches: (t) => t.tagName === "OL" ? { kind: "orderedList", attrs: {} } : null,
|
|
2823
|
-
create: () =>
|
|
2824
|
-
isEmpty: (t) =>
|
|
2825
|
-
},
|
|
2823
|
+
create: () => Je("ol"),
|
|
2824
|
+
isEmpty: (t) => Qe(t)
|
|
2825
|
+
}, xo = {
|
|
2826
2826
|
kind: "taskList",
|
|
2827
2827
|
label: "체크리스트",
|
|
2828
2828
|
allowsInlineFormat: !0,
|
|
@@ -2831,11 +2831,11 @@ const ce = [
|
|
|
2831
2831
|
allowsFontSize: !0,
|
|
2832
2832
|
matches: (t) => t.tagName === "UL" && t.classList.contains(P) ? { kind: "taskList", attrs: {} } : null,
|
|
2833
2833
|
create: () => {
|
|
2834
|
-
const t =
|
|
2834
|
+
const t = Je("ul");
|
|
2835
2835
|
return t.classList.add(P), t;
|
|
2836
2836
|
},
|
|
2837
|
-
isEmpty: (t) =>
|
|
2838
|
-
},
|
|
2837
|
+
isEmpty: (t) => Qe(t)
|
|
2838
|
+
}, Eo = {
|
|
2839
2839
|
kind: "blockquote",
|
|
2840
2840
|
label: "인용구",
|
|
2841
2841
|
allowsInlineFormat: !0,
|
|
@@ -2848,10 +2848,10 @@ const ce = [
|
|
|
2848
2848
|
matches: (t) => t.tagName === "BLOCKQUOTE" ? { kind: "blockquote", attrs: {} } : null,
|
|
2849
2849
|
create: () => {
|
|
2850
2850
|
const t = document.createElement("blockquote");
|
|
2851
|
-
return t.appendChild(
|
|
2851
|
+
return t.appendChild(X(document.createElement("p"))), t;
|
|
2852
2852
|
},
|
|
2853
2853
|
isEmpty: (t) => U(t)
|
|
2854
|
-
},
|
|
2854
|
+
}, Ao = {
|
|
2855
2855
|
kind: "codeBlock",
|
|
2856
2856
|
label: "코드 블록",
|
|
2857
2857
|
allowsInlineFormat: !1,
|
|
@@ -2867,10 +2867,10 @@ const ce = [
|
|
|
2867
2867
|
},
|
|
2868
2868
|
create: (t) => {
|
|
2869
2869
|
const e = document.createElement("pre"), n = document.createElement("code");
|
|
2870
|
-
return t != null && t.language && n.setAttribute("data-language", t.language), e.appendChild(n), e;
|
|
2870
|
+
return t != null && t.language && n.setAttribute("data-language", t.language), X(n), e.appendChild(n), e;
|
|
2871
2871
|
},
|
|
2872
2872
|
isEmpty: (t) => U(t)
|
|
2873
|
-
},
|
|
2873
|
+
}, To = {
|
|
2874
2874
|
kind: "image",
|
|
2875
2875
|
label: "이미지",
|
|
2876
2876
|
allowsInlineFormat: !1,
|
|
@@ -2880,53 +2880,53 @@ const ce = [
|
|
|
2880
2880
|
matches: (t) => {
|
|
2881
2881
|
var e;
|
|
2882
2882
|
if (t.tagName === "FIGURE") {
|
|
2883
|
-
const n = t.querySelector(":scope > img"), o =
|
|
2883
|
+
const n = t.querySelector(":scope > img"), o = ht(n), l = ((e = t.querySelector(":scope > figcaption")) == null ? void 0 : e.textContent) ?? "";
|
|
2884
2884
|
l.trim() && (o.caption = l);
|
|
2885
2885
|
const i = t.getAttribute("style");
|
|
2886
2886
|
return i && (o.wrapperStyle = i), { kind: "image", attrs: o };
|
|
2887
2887
|
}
|
|
2888
|
-
return t.tagName === "IMG" ? { kind: "image", attrs:
|
|
2888
|
+
return t.tagName === "IMG" ? { kind: "image", attrs: ht(t) } : null;
|
|
2889
2889
|
},
|
|
2890
2890
|
create: (t) => {
|
|
2891
2891
|
const e = document.createElement("figure");
|
|
2892
2892
|
t != null && t.wrapperStyle && e.setAttribute("style", t.wrapperStyle);
|
|
2893
|
-
const n = document.createElement("img"), o =
|
|
2893
|
+
const n = document.createElement("img"), o = R(t == null ? void 0 : t.src);
|
|
2894
2894
|
if (o && (n.src = o), t != null && t.alt && (n.alt = t.alt), e.appendChild(n), t != null && t.caption) {
|
|
2895
2895
|
const l = document.createElement("figcaption");
|
|
2896
2896
|
l.textContent = t.caption, e.appendChild(l);
|
|
2897
2897
|
}
|
|
2898
|
-
return e.appendChild(
|
|
2898
|
+
return e.appendChild(Ze({ caption: !0 })), e.appendChild(Ve()), e;
|
|
2899
2899
|
},
|
|
2900
2900
|
isEmpty: (t) => {
|
|
2901
2901
|
const e = t.tagName === "IMG" ? t : t.querySelector(":scope > img");
|
|
2902
2902
|
return !e || !e.getAttribute("src");
|
|
2903
2903
|
}
|
|
2904
2904
|
};
|
|
2905
|
-
function
|
|
2905
|
+
function Ve() {
|
|
2906
2906
|
const t = document.createElement("span");
|
|
2907
2907
|
return t.className = "aw-resize-handle", t.setAttribute("contenteditable", "false"), t.setAttribute("aria-hidden", "true"), t;
|
|
2908
2908
|
}
|
|
2909
|
-
function
|
|
2909
|
+
function Ze(t = {}) {
|
|
2910
2910
|
const e = document.createElement("span");
|
|
2911
2911
|
e.className = "aw-block-align-controls", e.setAttribute("contenteditable", "false"), e.setAttribute("aria-hidden", "true");
|
|
2912
2912
|
const n = p().blockAlign;
|
|
2913
2913
|
for (const o of ["left", "center", "right"]) {
|
|
2914
2914
|
const l = document.createElement("button");
|
|
2915
|
-
l.type = "button", l.className = "aw-block-align-btn", l.dataset.align = o, l.title = n[o], l.setAttribute("aria-label", l.title), l.innerHTML =
|
|
2915
|
+
l.type = "button", l.className = "aw-block-align-btn", l.dataset.align = o, l.title = n[o], l.setAttribute("aria-label", l.title), l.innerHTML = $o[o], e.appendChild(l);
|
|
2916
2916
|
}
|
|
2917
2917
|
if (t.caption) {
|
|
2918
2918
|
const o = document.createElement("span");
|
|
2919
2919
|
o.className = "aw-block-ctl-divider", e.appendChild(o);
|
|
2920
2920
|
const l = document.createElement("button");
|
|
2921
|
-
l.type = "button", l.className = "aw-block-caption-btn", l.dataset.action = "caption", l.title = p().image.captionAdd, l.setAttribute("aria-label", l.title), l.innerHTML =
|
|
2921
|
+
l.type = "button", l.className = "aw-block-caption-btn", l.dataset.action = "caption", l.title = p().image.captionAdd, l.setAttribute("aria-label", l.title), l.innerHTML = So, e.appendChild(l);
|
|
2922
2922
|
}
|
|
2923
2923
|
return e;
|
|
2924
2924
|
}
|
|
2925
|
-
const
|
|
2925
|
+
const So = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="11" rx="1.5"/><line x1="6" y1="19" x2="18" y2="19"/></svg>', $o = {
|
|
2926
2926
|
left: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="17" y1="10" x2="3" y2="10"/><line x1="21" y1="6" x2="3" y2="6"/><line x1="21" y1="14" x2="3" y2="14"/><line x1="17" y1="18" x2="3" y2="18"/></svg>',
|
|
2927
2927
|
center: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="10" x2="6" y2="10"/><line x1="21" y1="6" x2="3" y2="6"/><line x1="21" y1="14" x2="3" y2="14"/><line x1="18" y1="18" x2="6" y2="18"/></svg>',
|
|
2928
2928
|
right: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="21" y1="10" x2="7" y2="10"/><line x1="21" y1="6" x2="3" y2="6"/><line x1="21" y1="14" x2="3" y2="14"/><line x1="21" y1="18" x2="7" y2="18"/></svg>'
|
|
2929
|
-
},
|
|
2929
|
+
}, Bo = {
|
|
2930
2930
|
kind: "table",
|
|
2931
2931
|
label: "표",
|
|
2932
2932
|
allowsInlineFormat: !0,
|
|
@@ -2952,7 +2952,7 @@ const xo = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-wi
|
|
|
2952
2952
|
return o.appendChild(l), o;
|
|
2953
2953
|
},
|
|
2954
2954
|
isEmpty: (t) => t.querySelectorAll(":scope tr").length === 0
|
|
2955
|
-
},
|
|
2955
|
+
}, Mo = {
|
|
2956
2956
|
kind: "hr",
|
|
2957
2957
|
label: "구분선",
|
|
2958
2958
|
allowsInlineFormat: !1,
|
|
@@ -2965,7 +2965,7 @@ const xo = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-wi
|
|
|
2965
2965
|
return t.setAttribute("contenteditable", "false"), t;
|
|
2966
2966
|
},
|
|
2967
2967
|
isEmpty: () => !1
|
|
2968
|
-
},
|
|
2968
|
+
}, No = {
|
|
2969
2969
|
kind: "youtube",
|
|
2970
2970
|
label: "유튜브",
|
|
2971
2971
|
allowsInlineFormat: !1,
|
|
@@ -2980,13 +2980,13 @@ const xo = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-wi
|
|
|
2980
2980
|
return o && (n.wrapperStyle = o), { kind: "youtube", attrs: n };
|
|
2981
2981
|
},
|
|
2982
2982
|
create: (t) => {
|
|
2983
|
-
const e =
|
|
2983
|
+
const e = Ye(t == null ? void 0 : t.videoId), n = document.createElement("div");
|
|
2984
2984
|
n.className = "aw-youtube-embed", n.setAttribute("contenteditable", "false"), e && n.setAttribute("data-youtube-id", e), t != null && t.wrapperStyle && n.setAttribute("style", t.wrapperStyle);
|
|
2985
2985
|
const o = document.createElement("iframe");
|
|
2986
|
-
return e && (o.src = `${ae}${e}`), o.setAttribute("allow",
|
|
2986
|
+
return e && (o.src = `${ae}${e}`), o.setAttribute("allow", qt), o.setAttribute("allowfullscreen", ""), o.setAttribute("frameborder", "0"), o.setAttribute("referrerpolicy", "strict-origin-when-cross-origin"), n.appendChild(o), n.appendChild(Ze()), n.appendChild(Ve()), n;
|
|
2987
2987
|
},
|
|
2988
2988
|
isEmpty: (t) => !t.getAttribute("data-youtube-id")
|
|
2989
|
-
},
|
|
2989
|
+
}, Ro = {
|
|
2990
2990
|
kind: "linkCard",
|
|
2991
2991
|
label: "링크",
|
|
2992
2992
|
allowsInlineFormat: !1,
|
|
@@ -3000,7 +3000,7 @@ const xo = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-wi
|
|
|
3000
3000
|
return e && (r.href = e), n && (r.text = n), o && (r.description = o), l && (r.image = l), i && (r.favicon = i), { kind: "linkCard", attrs: r };
|
|
3001
3001
|
},
|
|
3002
3002
|
create: (t) => {
|
|
3003
|
-
const e = q(t == null ? void 0 : t.href) || "#", n = t != null && t.text && t.text.length > 0 ? t.text :
|
|
3003
|
+
const e = q(t == null ? void 0 : t.href) || "#", n = t != null && t.text && t.text.length > 0 ? t.text : We(e) || e, o = (t == null ? void 0 : t.description) ?? "", l = R(t == null ? void 0 : t.image), i = t != null && t.favicon ? R(t.favicon) : Pt(e), r = document.createElement("a");
|
|
3004
3004
|
if (r.className = "aw-link-card", l && r.classList.add("aw-link-card-with-image"), r.href = e, r.target = "_blank", r.rel = "noopener", r.setAttribute("contenteditable", "false"), l) {
|
|
3005
3005
|
const u = document.createElement("img");
|
|
3006
3006
|
u.className = "aw-link-card-image", u.src = l, u.alt = "", u.loading = "lazy", r.appendChild(u);
|
|
@@ -3021,7 +3021,7 @@ const xo = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-wi
|
|
|
3021
3021
|
return d.className = "aw-link-card-url-text", d.textContent = e, c.appendChild(d), s.appendChild(c), r.appendChild(s), r;
|
|
3022
3022
|
},
|
|
3023
3023
|
isEmpty: (t) => !t.getAttribute("href")
|
|
3024
|
-
},
|
|
3024
|
+
}, Ho = {
|
|
3025
3025
|
kind: "file",
|
|
3026
3026
|
label: "파일",
|
|
3027
3027
|
allowsInlineFormat: !1,
|
|
@@ -3039,21 +3039,21 @@ const xo = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-wi
|
|
|
3039
3039
|
const n = q(t == null ? void 0 : t.fileSrc);
|
|
3040
3040
|
n && (e.href = n), e.setAttribute("download", (t == null ? void 0 : t.fileName) ?? ""), t != null && t.fileName && e.setAttribute("data-file-name", t.fileName), (t == null ? void 0 : t.fileSize) !== void 0 && e.setAttribute("data-file-size", String(t.fileSize)), t != null && t.fileType && e.setAttribute("data-file-type", t.fileType);
|
|
3041
3041
|
const o = document.createElement("span");
|
|
3042
|
-
o.className = "aw-file-icon", o.setAttribute("aria-hidden", "true"), o.innerHTML =
|
|
3042
|
+
o.className = "aw-file-icon", o.setAttribute("aria-hidden", "true"), o.innerHTML = Ot;
|
|
3043
3043
|
const l = document.createElement("span");
|
|
3044
3044
|
l.className = "aw-file-meta";
|
|
3045
3045
|
const i = document.createElement("span");
|
|
3046
|
-
i.className = "aw-file-name", i.textContent = (t == null ? void 0 : t.fileName) ??
|
|
3047
|
-
const r = [], s =
|
|
3048
|
-
if (s && r.push(s), (t == null ? void 0 : t.fileSize) !== void 0 && r.push(
|
|
3046
|
+
i.className = "aw-file-name", i.textContent = (t == null ? void 0 : t.fileName) ?? Ut, l.appendChild(i);
|
|
3047
|
+
const r = [], s = Ft(t == null ? void 0 : t.fileName, t == null ? void 0 : t.fileType);
|
|
3048
|
+
if (s && r.push(s), (t == null ? void 0 : t.fileSize) !== void 0 && r.push(zt(t.fileSize)), r.length > 0) {
|
|
3049
3049
|
const c = document.createElement("span");
|
|
3050
3050
|
c.className = "aw-file-info", c.textContent = r.join(" · "), l.appendChild(c);
|
|
3051
3051
|
}
|
|
3052
3052
|
const a = document.createElement("span");
|
|
3053
|
-
return a.className = "aw-file-action", a.setAttribute("aria-hidden", "true"), a.innerHTML =
|
|
3053
|
+
return a.className = "aw-file-action", a.setAttribute("aria-hidden", "true"), a.innerHTML = _t, e.appendChild(o), e.appendChild(l), e.appendChild(a), e;
|
|
3054
3054
|
},
|
|
3055
3055
|
isEmpty: (t) => !t.getAttribute("href")
|
|
3056
|
-
},
|
|
3056
|
+
}, Io = {
|
|
3057
3057
|
kind: "importedHtml",
|
|
3058
3058
|
label: "HTML",
|
|
3059
3059
|
allowsInlineFormat: !1,
|
|
@@ -3072,7 +3072,7 @@ const xo = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-wi
|
|
|
3072
3072
|
return e.setAttribute("data-imported-html", "true"), t != null && t.importedStyle && e.setAttribute("style", t.importedStyle), t != null && t.importedClass && e.setAttribute("class", t.importedClass), e;
|
|
3073
3073
|
},
|
|
3074
3074
|
isEmpty: () => !1
|
|
3075
|
-
},
|
|
3075
|
+
}, Vt = {
|
|
3076
3076
|
kind: "unknown",
|
|
3077
3077
|
label: "알 수 없음",
|
|
3078
3078
|
allowsInlineFormat: !1,
|
|
@@ -3084,41 +3084,41 @@ const xo = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-wi
|
|
|
3084
3084
|
// 그 html 에 블록 레벨 요소가 들어 있을 수 있다. `<p>` 로 감싸면 브라우저가
|
|
3085
3085
|
// 단락을 조기에 닫아 내용이 래퍼 밖으로 튀어나간다 (문자열 렌더러
|
|
3086
3086
|
// render-string.ts 도 같은 이유로 div 를 쓴다 — 두 경로가 일치해야 한다).
|
|
3087
|
-
create: (t) =>
|
|
3087
|
+
create: (t) => X(document.createElement(jt(t == null ? void 0 : t.tag))),
|
|
3088
3088
|
isEmpty: (t) => U(t)
|
|
3089
|
-
},
|
|
3090
|
-
go,
|
|
3091
|
-
bo,
|
|
3092
|
-
// 체크리스트가 글머리 목록보다 앞이어야 한다 — 둘 다 `<ul>` 이고 구분은
|
|
3093
|
-
// 클래스뿐이라, 순서가 뒤집히면 체크리스트가 글머리 목록으로 잡힌다.
|
|
3089
|
+
}, Zt = [
|
|
3094
3090
|
wo,
|
|
3095
|
-
yo,
|
|
3096
|
-
ko,
|
|
3097
3091
|
vo,
|
|
3092
|
+
// 체크리스트가 글머리 목록보다 앞이어야 한다 — 둘 다 `<ul>` 이고 구분은
|
|
3093
|
+
// 클래스뿐이라, 순서가 뒤집히면 체크리스트가 글머리 목록으로 잡힌다.
|
|
3094
|
+
xo,
|
|
3098
3095
|
Co,
|
|
3099
3096
|
Lo,
|
|
3097
|
+
Eo,
|
|
3100
3098
|
Ao,
|
|
3101
3099
|
To,
|
|
3102
|
-
$o,
|
|
3103
|
-
So,
|
|
3104
3100
|
Bo,
|
|
3105
|
-
Mo
|
|
3101
|
+
Mo,
|
|
3102
|
+
Ro,
|
|
3103
|
+
No,
|
|
3104
|
+
Ho,
|
|
3105
|
+
Io
|
|
3106
3106
|
], Z = (() => {
|
|
3107
|
-
const t = { unknown:
|
|
3108
|
-
for (const e of
|
|
3107
|
+
const t = { unknown: Vt };
|
|
3108
|
+
for (const e of Zt) t[e.kind] = e;
|
|
3109
3109
|
return t;
|
|
3110
3110
|
})();
|
|
3111
3111
|
function Y(t) {
|
|
3112
|
-
for (const e of
|
|
3112
|
+
for (const e of Zt) {
|
|
3113
3113
|
const n = e.matches(t);
|
|
3114
3114
|
if (n) return { type: e, match: n };
|
|
3115
3115
|
}
|
|
3116
3116
|
return {
|
|
3117
|
-
type:
|
|
3117
|
+
type: Vt,
|
|
3118
3118
|
match: { kind: "unknown", attrs: { tag: t.tagName.toLowerCase() } }
|
|
3119
3119
|
};
|
|
3120
3120
|
}
|
|
3121
|
-
class
|
|
3121
|
+
class Xt {
|
|
3122
3122
|
constructor() {
|
|
3123
3123
|
b(this, "counter", 0);
|
|
3124
3124
|
b(this, "seen", /* @__PURE__ */ new Set());
|
|
@@ -3166,9 +3166,9 @@ function me(t, e) {
|
|
|
3166
3166
|
o.setAttribute(G, i), n.add(i);
|
|
3167
3167
|
}
|
|
3168
3168
|
}
|
|
3169
|
-
function
|
|
3169
|
+
function Be(t, e = {}) {
|
|
3170
3170
|
var n;
|
|
3171
|
-
|
|
3171
|
+
tl(t);
|
|
3172
3172
|
for (const o of Array.from(t.childNodes)) {
|
|
3173
3173
|
if (o.nodeType !== Node.TEXT_NODE) continue;
|
|
3174
3174
|
if ((o.textContent ?? "").trim().length === 0) {
|
|
@@ -3182,7 +3182,7 @@ function $e(t, e = {}) {
|
|
|
3182
3182
|
t.querySelectorAll(`ul.${P} > li[style]`)
|
|
3183
3183
|
))
|
|
3184
3184
|
o.style.removeProperty("list-style-type"), ((n = o.getAttribute("style")) == null ? void 0 : n.trim()) === "" && o.removeAttribute("style");
|
|
3185
|
-
|
|
3185
|
+
Fo(t);
|
|
3186
3186
|
for (const o of Array.from(t.querySelectorAll("hr")))
|
|
3187
3187
|
o.getAttribute("contenteditable") !== "false" && o.setAttribute("contenteditable", "false");
|
|
3188
3188
|
for (const o of Array.from(t.querySelectorAll("a.aw-link-card")))
|
|
@@ -3192,10 +3192,14 @@ function $e(t, e = {}) {
|
|
|
3192
3192
|
for (const o of Array.from(t.querySelectorAll("a.aw-file-attachment")))
|
|
3193
3193
|
o.getAttribute("contenteditable") !== "false" && o.setAttribute("contenteditable", "false");
|
|
3194
3194
|
for (const o of Array.from(t.querySelectorAll("figure, div.aw-youtube-embed")))
|
|
3195
|
-
o instanceof HTMLElement && (o.querySelector(":scope > .aw-block-align-controls") || o.appendChild(
|
|
3196
|
-
|
|
3195
|
+
o instanceof HTMLElement && (o.querySelector(":scope > .aw-block-align-controls") || o.appendChild(Ze({ caption: o.tagName === "FIGURE" })), o.querySelector(":scope > .aw-resize-handle") || o.appendChild(Ve()));
|
|
3196
|
+
Do(t), zo(t), e.writableTail !== !1 && Oo(t);
|
|
3197
|
+
}
|
|
3198
|
+
function Do(t) {
|
|
3199
|
+
for (const e of Array.from(t.querySelectorAll("pre > code")))
|
|
3200
|
+
e.childNodes.length === 0 && e.appendChild(document.createElement("br"));
|
|
3197
3201
|
}
|
|
3198
|
-
function
|
|
3202
|
+
function zo(t) {
|
|
3199
3203
|
var o;
|
|
3200
3204
|
const e = t.querySelectorAll("figure > figcaption");
|
|
3201
3205
|
if (e.length === 0) return;
|
|
@@ -3203,7 +3207,7 @@ function No(t) {
|
|
|
3203
3207
|
for (const l of Array.from(e))
|
|
3204
3208
|
U(l) && (n && l.contains(n) || l.remove());
|
|
3205
3209
|
}
|
|
3206
|
-
function
|
|
3210
|
+
function Fo(t) {
|
|
3207
3211
|
for (const e of Array.from(t.querySelectorAll("[href]"))) {
|
|
3208
3212
|
const n = e.getAttribute("href");
|
|
3209
3213
|
n && !q(n) && e.removeAttribute("href");
|
|
@@ -3215,11 +3219,11 @@ function Ho(t) {
|
|
|
3215
3219
|
n.startsWith(ae) || e.removeAttribute("src");
|
|
3216
3220
|
continue;
|
|
3217
3221
|
}
|
|
3218
|
-
|
|
3222
|
+
R(n) || e.removeAttribute("src");
|
|
3219
3223
|
}
|
|
3220
3224
|
}
|
|
3221
3225
|
}
|
|
3222
|
-
const
|
|
3226
|
+
const Po = /* @__PURE__ */ new Set([
|
|
3223
3227
|
"hr",
|
|
3224
3228
|
"image",
|
|
3225
3229
|
"youtube",
|
|
@@ -3227,20 +3231,20 @@ const Ro = /* @__PURE__ */ new Set([
|
|
|
3227
3231
|
"file",
|
|
3228
3232
|
"importedHtml"
|
|
3229
3233
|
]);
|
|
3230
|
-
function
|
|
3234
|
+
function Oo(t) {
|
|
3231
3235
|
const e = Array.from(t.children).filter(
|
|
3232
3236
|
(l) => l instanceof HTMLElement
|
|
3233
3237
|
);
|
|
3234
3238
|
if (e.length === 0) {
|
|
3235
|
-
t.appendChild(
|
|
3239
|
+
t.appendChild(X(document.createElement("p")));
|
|
3236
3240
|
return;
|
|
3237
3241
|
}
|
|
3238
3242
|
const n = e[e.length - 1];
|
|
3239
3243
|
if (!n) return;
|
|
3240
3244
|
const { match: o } = Y(n);
|
|
3241
|
-
|
|
3245
|
+
Po.has(o.kind) && t.appendChild(X(document.createElement("p")));
|
|
3242
3246
|
}
|
|
3243
|
-
function
|
|
3247
|
+
function _o(t) {
|
|
3244
3248
|
const e = p().blocks;
|
|
3245
3249
|
switch (t.kind) {
|
|
3246
3250
|
case "paragraph":
|
|
@@ -3275,43 +3279,43 @@ function zo(t) {
|
|
|
3275
3279
|
return e.unknown;
|
|
3276
3280
|
}
|
|
3277
3281
|
}
|
|
3278
|
-
function
|
|
3279
|
-
const e = t.element.getAttribute("style"), n =
|
|
3282
|
+
function qo(t) {
|
|
3283
|
+
const e = t.element.getAttribute("style"), n = Uo(t.element);
|
|
3280
3284
|
return {
|
|
3281
|
-
version:
|
|
3285
|
+
version: bo,
|
|
3282
3286
|
id: t.id,
|
|
3283
3287
|
kind: t.kind,
|
|
3284
3288
|
attrs: { ...t.attrs },
|
|
3285
|
-
html:
|
|
3289
|
+
html: jo(t.element),
|
|
3286
3290
|
// 빈 값은 굳이 싣지 않는다 — 스냅샷이 커지기만 한다.
|
|
3287
3291
|
...e ? { style: e } : {},
|
|
3288
3292
|
...n ? { attributes: n } : {}
|
|
3289
3293
|
};
|
|
3290
3294
|
}
|
|
3291
|
-
function
|
|
3295
|
+
function Uo(t) {
|
|
3292
3296
|
let e;
|
|
3293
|
-
for (const n of
|
|
3297
|
+
for (const n of Ge) {
|
|
3294
3298
|
const o = t.getAttribute(n);
|
|
3295
3299
|
o === null || o === "" || ((e ?? (e = {}))[n] = o);
|
|
3296
3300
|
}
|
|
3297
3301
|
return e;
|
|
3298
3302
|
}
|
|
3299
|
-
function
|
|
3303
|
+
function jo(t) {
|
|
3300
3304
|
if (!t.querySelector(".aw-block-align-controls, .aw-resize-handle"))
|
|
3301
3305
|
return t.innerHTML;
|
|
3302
3306
|
const e = t.cloneNode(!0);
|
|
3303
|
-
return
|
|
3307
|
+
return Xe(e), e.innerHTML;
|
|
3304
3308
|
}
|
|
3305
|
-
function
|
|
3306
|
-
return t.map(
|
|
3309
|
+
function Jt(t) {
|
|
3310
|
+
return t.map(qo);
|
|
3307
3311
|
}
|
|
3308
|
-
function
|
|
3312
|
+
function Wo(t) {
|
|
3309
3313
|
const n = (Z[t.kind] ?? Z.unknown).create(t.attrs);
|
|
3310
3314
|
if (n.setAttribute(G, t.id), t.style && n.setAttribute("style", t.style), t.attributes) {
|
|
3311
3315
|
for (const [o, l] of Object.entries(t.attributes))
|
|
3312
|
-
if (
|
|
3316
|
+
if (Ge.includes(o)) {
|
|
3313
3317
|
if (o === "class") {
|
|
3314
|
-
n.setAttribute("class",
|
|
3318
|
+
n.setAttribute("class", Wt(n.getAttribute("class"), l));
|
|
3315
3319
|
continue;
|
|
3316
3320
|
}
|
|
3317
3321
|
n.setAttribute(o, l);
|
|
@@ -3319,12 +3323,12 @@ function Oo(t) {
|
|
|
3319
3323
|
}
|
|
3320
3324
|
return t.html.length > 0 && (n.innerHTML = t.html), n;
|
|
3321
3325
|
}
|
|
3322
|
-
function
|
|
3326
|
+
function Ko(t, e) {
|
|
3323
3327
|
for (; t.firstChild; ) t.removeChild(t.firstChild);
|
|
3324
|
-
for (const n of
|
|
3325
|
-
t.appendChild(
|
|
3328
|
+
for (const n of Ee(e))
|
|
3329
|
+
t.appendChild(Wo(n));
|
|
3326
3330
|
}
|
|
3327
|
-
function
|
|
3331
|
+
function Oe(t, e) {
|
|
3328
3332
|
const n = [];
|
|
3329
3333
|
for (const o of Array.from(t.children)) {
|
|
3330
3334
|
if (!(o instanceof HTMLElement)) continue;
|
|
@@ -3338,7 +3342,7 @@ function Pe(t, e) {
|
|
|
3338
3342
|
}
|
|
3339
3343
|
return n;
|
|
3340
3344
|
}
|
|
3341
|
-
function
|
|
3345
|
+
function _e(t, e, n) {
|
|
3342
3346
|
let o = t;
|
|
3343
3347
|
for (; o && o !== e; ) {
|
|
3344
3348
|
if (o.parentNode === e && o.nodeType === Node.ELEMENT_NODE) {
|
|
@@ -3354,7 +3358,7 @@ function Oe(t, e, n) {
|
|
|
3354
3358
|
}
|
|
3355
3359
|
return null;
|
|
3356
3360
|
}
|
|
3357
|
-
function
|
|
3361
|
+
function Go(t) {
|
|
3358
3362
|
const e = t.element;
|
|
3359
3363
|
switch (t.kind) {
|
|
3360
3364
|
case "paragraph":
|
|
@@ -3364,11 +3368,11 @@ function qo(t) {
|
|
|
3364
3368
|
case "orderedList":
|
|
3365
3369
|
case "taskList": {
|
|
3366
3370
|
const n = Array.from(e.querySelectorAll(":scope > li"));
|
|
3367
|
-
return
|
|
3371
|
+
return ct(n);
|
|
3368
3372
|
}
|
|
3369
3373
|
case "blockquote": {
|
|
3370
3374
|
const n = Array.from(e.querySelectorAll(":scope > p"));
|
|
3371
|
-
return n.length > 0 ?
|
|
3375
|
+
return n.length > 0 ? ct(n) : Array.from(e.childNodes);
|
|
3372
3376
|
}
|
|
3373
3377
|
case "codeBlock": {
|
|
3374
3378
|
const n = e.querySelector(":scope > code");
|
|
@@ -3387,14 +3391,14 @@ function qo(t) {
|
|
|
3387
3391
|
return [];
|
|
3388
3392
|
}
|
|
3389
3393
|
}
|
|
3390
|
-
function
|
|
3394
|
+
function ct(t) {
|
|
3391
3395
|
const e = [];
|
|
3392
3396
|
return t.forEach((n, o) => {
|
|
3393
3397
|
o > 0 && e.push(document.createElement("br"));
|
|
3394
3398
|
for (const l of Array.from(n.childNodes)) e.push(l);
|
|
3395
3399
|
}), e;
|
|
3396
3400
|
}
|
|
3397
|
-
function
|
|
3401
|
+
function Yo(t, e, n) {
|
|
3398
3402
|
if (n.length === 0) return;
|
|
3399
3403
|
let o = null;
|
|
3400
3404
|
switch (e) {
|
|
@@ -3420,15 +3424,15 @@ function Uo(t, e, n) {
|
|
|
3420
3424
|
for (; o.firstChild; ) o.removeChild(o.firstChild);
|
|
3421
3425
|
for (const i of n) o.appendChild(i);
|
|
3422
3426
|
const l = Z[e];
|
|
3423
|
-
l &&
|
|
3427
|
+
l && Vo(o, l);
|
|
3424
3428
|
}
|
|
3425
|
-
function
|
|
3429
|
+
function Vo(t, e) {
|
|
3426
3430
|
const n = new Set(e.allowedMarks);
|
|
3427
3431
|
for (const o of Array.from(t.querySelectorAll("*"))) {
|
|
3428
3432
|
if (!(o instanceof HTMLElement) || !o.parentNode) continue;
|
|
3429
3433
|
const l = o.tagName.toLowerCase();
|
|
3430
3434
|
if ((l === "b" || l === "strong") && !n.has("bold") || (l === "i" || l === "em") && !n.has("italic") || l === "u" && !n.has("underline") || (l === "s" || l === "strike" || l === "del") && !n.has("strike")) {
|
|
3431
|
-
|
|
3435
|
+
dt(o);
|
|
3432
3436
|
continue;
|
|
3433
3437
|
}
|
|
3434
3438
|
if (l === "span" || l === "font") {
|
|
@@ -3447,19 +3451,19 @@ function jo(t, e) {
|
|
|
3447
3451
|
const s = i.cssText.trim().length > 0, a = Array.from(o.attributes).some(
|
|
3448
3452
|
(c) => c.name !== "style"
|
|
3449
3453
|
);
|
|
3450
|
-
!s && !a &&
|
|
3454
|
+
!s && !a && dt(o);
|
|
3451
3455
|
}
|
|
3452
3456
|
}
|
|
3453
3457
|
}
|
|
3454
|
-
function
|
|
3458
|
+
function dt(t) {
|
|
3455
3459
|
const e = t.parentNode;
|
|
3456
3460
|
if (e) {
|
|
3457
3461
|
for (; t.firstChild; ) e.insertBefore(t.firstChild, t);
|
|
3458
3462
|
e.removeChild(t);
|
|
3459
3463
|
}
|
|
3460
3464
|
}
|
|
3461
|
-
function
|
|
3462
|
-
const e = t.fg || "currentColor", n = t.bg || "transparent", o = t.mode === "dark" ? !0 : t.mode === "light" ? !1 :
|
|
3465
|
+
function Zo(t = {}) {
|
|
3466
|
+
const e = t.fg || "currentColor", n = t.bg || "transparent", o = t.mode === "dark" ? !0 : t.mode === "light" ? !1 : Xo(e, n);
|
|
3463
3467
|
return {
|
|
3464
3468
|
primary: t.primary || "#64c8ff",
|
|
3465
3469
|
fg: e,
|
|
@@ -3469,13 +3473,13 @@ function Wo(t = {}) {
|
|
|
3469
3473
|
isDark: o
|
|
3470
3474
|
};
|
|
3471
3475
|
}
|
|
3472
|
-
function
|
|
3473
|
-
const n =
|
|
3476
|
+
function Xo(t, e) {
|
|
3477
|
+
const n = ut(t);
|
|
3474
3478
|
if (n !== null) return n > 0.5;
|
|
3475
|
-
const o =
|
|
3479
|
+
const o = ut(e);
|
|
3476
3480
|
return o !== null ? o < 0.5 : !0;
|
|
3477
3481
|
}
|
|
3478
|
-
function
|
|
3482
|
+
function ut(t) {
|
|
3479
3483
|
if (!t) return null;
|
|
3480
3484
|
const e = t.trim();
|
|
3481
3485
|
let n = -1, o = -1, l = -1;
|
|
@@ -3489,14 +3493,14 @@ function st(t) {
|
|
|
3489
3493
|
}
|
|
3490
3494
|
return n < 0 ? null : (0.299 * n + 0.587 * o + 0.114 * l) / 255;
|
|
3491
3495
|
}
|
|
3492
|
-
function
|
|
3496
|
+
function Qt(t) {
|
|
3493
3497
|
const e = getComputedStyle(t), n = (c) => {
|
|
3494
3498
|
const d = e.getPropertyValue(c).trim();
|
|
3495
3499
|
return d.length > 0 ? d : void 0;
|
|
3496
3500
|
}, o = {}, l = n("--aw-primary"), i = n("--aw-fg"), r = n("--aw-bg"), s = n("--aw-border"), a = n("--aw-fg-muted");
|
|
3497
3501
|
return l && (o.primary = l), i && (o.fg = i), r && (o.bg = r), s && (o.border = s), a && (o.fgMuted = a), o;
|
|
3498
3502
|
}
|
|
3499
|
-
function
|
|
3503
|
+
function Jo(t) {
|
|
3500
3504
|
const e = `color-mix(in srgb, ${t.primary} 8%, transparent)`, n = `color-mix(in srgb, ${t.fg} 6%, ${t.bg})`;
|
|
3501
3505
|
return {
|
|
3502
3506
|
H1: `font-size:1.875rem;font-weight:700;line-height:1.3;margin:.6em 0 .4em;padding-bottom:.25em;border-bottom:1px solid ${t.border};color:${t.fg};`,
|
|
@@ -3516,7 +3520,7 @@ function Go(t) {
|
|
|
3516
3520
|
A: `display:block;text-decoration:none;margin:1em 0;padding:12px 16px;border:1px solid ${t.border};border-radius:8px;background-color:${e};color:${t.fg};`
|
|
3517
3521
|
};
|
|
3518
3522
|
}
|
|
3519
|
-
function
|
|
3523
|
+
function Qo(t) {
|
|
3520
3524
|
const e = `color-mix(in srgb, ${t.fg} 5%, ${t.bg})`, n = `color-mix(in srgb, ${t.primary} 12%, transparent)`;
|
|
3521
3525
|
return {
|
|
3522
3526
|
"pre > code": "background:transparent;padding:0;font:inherit;color:inherit;display:block;",
|
|
@@ -3550,8 +3554,8 @@ function Yo(t) {
|
|
|
3550
3554
|
"pre > code .hl-punct": `color:${t.fgMuted};`
|
|
3551
3555
|
};
|
|
3552
3556
|
}
|
|
3553
|
-
function
|
|
3554
|
-
const n =
|
|
3557
|
+
function en(t, e = {}) {
|
|
3558
|
+
const n = Zo(e), o = Jo(n), l = Qo(n);
|
|
3555
3559
|
for (const i of Array.from(t.children)) {
|
|
3556
3560
|
if (!(i instanceof HTMLElement) || i.getAttribute("data-imported-html") === "true") continue;
|
|
3557
3561
|
if (i.tagName === "A" && i.classList.contains("aw-file-attachment")) {
|
|
@@ -3588,12 +3592,12 @@ function le(t, e) {
|
|
|
3588
3592
|
s && t.setAttribute("style", s);
|
|
3589
3593
|
return;
|
|
3590
3594
|
}
|
|
3591
|
-
const o =
|
|
3595
|
+
const o = pt(n), l = new Set(o.map((s) => s.prop)), r = [...pt(e).filter(
|
|
3592
3596
|
(s) => !l.has(s.prop)
|
|
3593
3597
|
), ...o].map((s) => `${s.prop}:${s.value}`).join(";");
|
|
3594
3598
|
r ? t.setAttribute("style", r) : t.removeAttribute("style");
|
|
3595
3599
|
}
|
|
3596
|
-
function
|
|
3600
|
+
function pt(t) {
|
|
3597
3601
|
const e = [];
|
|
3598
3602
|
for (const n of t.split(";")) {
|
|
3599
3603
|
const o = n.trim();
|
|
@@ -3605,38 +3609,38 @@ function at(t) {
|
|
|
3605
3609
|
}
|
|
3606
3610
|
return e;
|
|
3607
3611
|
}
|
|
3608
|
-
const
|
|
3612
|
+
const qe = {
|
|
3609
3613
|
left: "aw-align-left",
|
|
3610
3614
|
center: "aw-align-center",
|
|
3611
3615
|
right: "aw-align-right",
|
|
3612
3616
|
justify: "aw-align-justify"
|
|
3613
3617
|
};
|
|
3614
|
-
function
|
|
3618
|
+
function tn(t) {
|
|
3615
3619
|
for (const e of Array.from(t.children)) {
|
|
3616
3620
|
if (!(e instanceof HTMLElement)) continue;
|
|
3617
3621
|
const { match: n } = Y(e);
|
|
3618
3622
|
e.classList.add("aw-block", `aw-block-${n.kind}`);
|
|
3619
3623
|
}
|
|
3620
3624
|
for (const e of Array.from(t.querySelectorAll("[style]")))
|
|
3621
|
-
e.closest("[data-imported-html]") ||
|
|
3625
|
+
e.closest("[data-imported-html]") || el(e);
|
|
3622
3626
|
}
|
|
3623
|
-
function
|
|
3627
|
+
function el(t) {
|
|
3624
3628
|
var l;
|
|
3625
|
-
const e = t.style.textAlign.trim().toLowerCase(), n =
|
|
3629
|
+
const e = t.style.textAlign.trim().toLowerCase(), n = qe[e], o = Object.values(qe).filter(
|
|
3626
3630
|
(i) => i !== n && t.classList.contains(i)
|
|
3627
3631
|
);
|
|
3628
3632
|
for (const i of o) t.classList.remove(i);
|
|
3629
3633
|
n && (t.classList.add(n), t.style.removeProperty("text-align"), ((l = t.getAttribute("style")) == null ? void 0 : l.trim()) === "" && t.removeAttribute("style"));
|
|
3630
3634
|
}
|
|
3631
|
-
function
|
|
3635
|
+
function tl(t) {
|
|
3632
3636
|
var e;
|
|
3633
|
-
for (const [n, o] of Object.entries(
|
|
3637
|
+
for (const [n, o] of Object.entries(qe))
|
|
3634
3638
|
for (const l of Array.from(
|
|
3635
3639
|
t.querySelectorAll(`.${o}`)
|
|
3636
3640
|
))
|
|
3637
3641
|
l.style.textAlign || (l.style.textAlign = n), l.classList.remove(o), ((e = l.getAttribute("class")) == null ? void 0 : e.trim()) === "" && l.removeAttribute("class");
|
|
3638
3642
|
}
|
|
3639
|
-
function
|
|
3643
|
+
function Xe(t) {
|
|
3640
3644
|
const e = t.querySelectorAll(
|
|
3641
3645
|
".aw-block-align-controls, .aw-resize-handle"
|
|
3642
3646
|
);
|
|
@@ -3644,7 +3648,7 @@ function Ye(t) {
|
|
|
3644
3648
|
for (const n of Array.from(t.querySelectorAll("[contenteditable]")))
|
|
3645
3649
|
n.removeAttribute("contenteditable");
|
|
3646
3650
|
}
|
|
3647
|
-
function
|
|
3651
|
+
function nn(t) {
|
|
3648
3652
|
for (const e of Array.from(t.querySelectorAll("[data-block-kind]")))
|
|
3649
3653
|
e.removeAttribute("data-block-kind");
|
|
3650
3654
|
for (const e of Array.from(t.querySelectorAll("[data-block-label]")))
|
|
@@ -3663,12 +3667,12 @@ function M(t) {
|
|
|
3663
3667
|
if (t.tagName === "HR")
|
|
3664
3668
|
n.setStartAfter(t);
|
|
3665
3669
|
else {
|
|
3666
|
-
const o =
|
|
3670
|
+
const o = nl(t);
|
|
3667
3671
|
n.selectNodeContents(o), n.collapse(!0);
|
|
3668
3672
|
}
|
|
3669
3673
|
e.removeAllRanges(), e.addRange(n);
|
|
3670
3674
|
}
|
|
3671
|
-
function
|
|
3675
|
+
function nl(t) {
|
|
3672
3676
|
switch (t.tagName) {
|
|
3673
3677
|
case "UL":
|
|
3674
3678
|
case "OL": {
|
|
@@ -3691,63 +3695,63 @@ function Xo(t) {
|
|
|
3691
3695
|
return t;
|
|
3692
3696
|
}
|
|
3693
3697
|
}
|
|
3694
|
-
function
|
|
3698
|
+
function X(t) {
|
|
3695
3699
|
return t.appendChild(document.createElement("br")), t;
|
|
3696
3700
|
}
|
|
3697
|
-
function
|
|
3701
|
+
function Je(t) {
|
|
3698
3702
|
const e = document.createElement(t), n = document.createElement("li");
|
|
3699
3703
|
return n.appendChild(document.createElement("br")), e.appendChild(n), e;
|
|
3700
3704
|
}
|
|
3701
|
-
function
|
|
3705
|
+
function Qe(t) {
|
|
3702
3706
|
const e = t.querySelectorAll(":scope > li");
|
|
3703
3707
|
return e.length === 0 ? !0 : e.length === 1 ? U(e[0]) : !1;
|
|
3704
3708
|
}
|
|
3705
3709
|
function U(t) {
|
|
3706
3710
|
return (t.textContent ?? "").replace(//g, "").trim().length === 0;
|
|
3707
3711
|
}
|
|
3708
|
-
function
|
|
3712
|
+
function ol(t) {
|
|
3709
3713
|
return t === void 0 || t < 1 ? 1 : t > 6 ? 6 : t;
|
|
3710
3714
|
}
|
|
3711
|
-
function
|
|
3715
|
+
function ht(t) {
|
|
3712
3716
|
if (!t) return {};
|
|
3713
3717
|
const e = {}, n = t.getAttribute("src"), o = t.getAttribute("alt");
|
|
3714
3718
|
return n && (e.src = n), o && (e.alt = o), e;
|
|
3715
3719
|
}
|
|
3716
|
-
function
|
|
3720
|
+
function Ae(t) {
|
|
3717
3721
|
return t ? Z[t.kind] ?? Z.unknown : null;
|
|
3718
3722
|
}
|
|
3719
3723
|
function ie(t, e) {
|
|
3720
3724
|
var n;
|
|
3721
|
-
return ((n =
|
|
3725
|
+
return ((n = Ae(t)) == null ? void 0 : n.allowedMarks.includes(e)) ?? !1;
|
|
3722
3726
|
}
|
|
3723
|
-
function
|
|
3727
|
+
function ft(t) {
|
|
3724
3728
|
var e;
|
|
3725
|
-
return ((e =
|
|
3729
|
+
return ((e = Ae(t)) == null ? void 0 : e.allowsInlineFormat) ?? !1;
|
|
3726
3730
|
}
|
|
3727
|
-
function
|
|
3731
|
+
function mt(t) {
|
|
3728
3732
|
var e;
|
|
3729
|
-
return ((e =
|
|
3733
|
+
return ((e = Ae(t)) == null ? void 0 : e.allowsFontSize) ?? !1;
|
|
3730
3734
|
}
|
|
3731
3735
|
function ue(t) {
|
|
3732
3736
|
var e;
|
|
3733
|
-
return ((e =
|
|
3737
|
+
return ((e = Ae(t)) == null ? void 0 : e.allowsColor) ?? !1;
|
|
3734
3738
|
}
|
|
3735
|
-
const
|
|
3739
|
+
const ll = /* @__PURE__ */ new Set([
|
|
3736
3740
|
"paragraph",
|
|
3737
3741
|
"heading",
|
|
3738
3742
|
"blockquote",
|
|
3739
3743
|
"table"
|
|
3740
3744
|
]);
|
|
3741
|
-
function
|
|
3742
|
-
return t !== null &&
|
|
3745
|
+
function Me(t) {
|
|
3746
|
+
return t !== null && ll.has(t.kind);
|
|
3743
3747
|
}
|
|
3744
3748
|
function pe(t) {
|
|
3745
3749
|
return (t == null ? void 0 : t.kind) === "table";
|
|
3746
3750
|
}
|
|
3747
|
-
function
|
|
3748
|
-
return e.kind === "unknown" ? t.tagName.toLowerCase() :
|
|
3751
|
+
function Ne(t, e) {
|
|
3752
|
+
return e.kind === "unknown" ? t.tagName.toLowerCase() : _o(e);
|
|
3749
3753
|
}
|
|
3750
|
-
const
|
|
3754
|
+
const gt = {
|
|
3751
3755
|
paragraph: "¶",
|
|
3752
3756
|
heading: "H",
|
|
3753
3757
|
bulletList: "•",
|
|
@@ -3764,10 +3768,10 @@ const pt = {
|
|
|
3764
3768
|
importedHtml: "</>",
|
|
3765
3769
|
unknown: "?"
|
|
3766
3770
|
};
|
|
3767
|
-
function
|
|
3768
|
-
return t.kind === "heading" ? `H${t.attrs.level ?? 1}` :
|
|
3771
|
+
function il(t) {
|
|
3772
|
+
return t.kind === "heading" ? `H${t.attrs.level ?? 1}` : gt[t.kind] ?? gt.unknown;
|
|
3769
3773
|
}
|
|
3770
|
-
const
|
|
3774
|
+
const rl = {
|
|
3771
3775
|
0: { kind: "paragraph" },
|
|
3772
3776
|
1: { kind: "heading", attrs: { level: 1 } },
|
|
3773
3777
|
2: { kind: "heading", attrs: { level: 2 } },
|
|
@@ -3780,22 +3784,22 @@ const tl = {
|
|
|
3780
3784
|
9: { kind: "blockquote" },
|
|
3781
3785
|
c: { kind: "codeBlock" },
|
|
3782
3786
|
t: { kind: "taskList" }
|
|
3783
|
-
},
|
|
3784
|
-
function
|
|
3785
|
-
const e = t.replace(
|
|
3787
|
+
}, on = new RegExp(" ", "g");
|
|
3788
|
+
function sl(t) {
|
|
3789
|
+
const e = t.replace(on, " "), n = /^(#{1,6}) $/.exec(e);
|
|
3786
3790
|
return n && n[1] ? { kind: "heading", attrs: { level: Math.min(6, n[1].length) } } : /^[-*+] $/.test(e) ? { kind: "bulletList" } : /^\d+[.)] $/.test(e) ? { kind: "orderedList" } : e === "> " ? { kind: "blockquote" } : e === "```" || e === "~~~" ? { kind: "codeBlock" } : e === "---" || e === "***" ? { kind: "hr" } : null;
|
|
3787
3791
|
}
|
|
3788
|
-
function
|
|
3789
|
-
const e = /^\[([ xX])\] $/.exec(t.replace(
|
|
3792
|
+
function al(t) {
|
|
3793
|
+
const e = /^\[([ xX])\] $/.exec(t.replace(on, " "));
|
|
3790
3794
|
return e ? { checked: (e[1] ?? " ").toLowerCase() === "x" } : null;
|
|
3791
3795
|
}
|
|
3792
|
-
function
|
|
3793
|
-
return
|
|
3796
|
+
function cl(t) {
|
|
3797
|
+
return Ue(t);
|
|
3794
3798
|
}
|
|
3795
|
-
function
|
|
3796
|
-
|
|
3799
|
+
function dl(t, e) {
|
|
3800
|
+
je(t, e);
|
|
3797
3801
|
}
|
|
3798
|
-
function
|
|
3802
|
+
function Ue(t) {
|
|
3799
3803
|
const e = document.getSelection();
|
|
3800
3804
|
if (!e || e.rangeCount === 0) return null;
|
|
3801
3805
|
const n = e.getRangeAt(0);
|
|
@@ -3810,8 +3814,8 @@ function Jt(t) {
|
|
|
3810
3814
|
return null;
|
|
3811
3815
|
}
|
|
3812
3816
|
}
|
|
3813
|
-
function
|
|
3814
|
-
const n =
|
|
3817
|
+
function je(t, e) {
|
|
3818
|
+
const n = bt(t, e.start), o = bt(t, e.end);
|
|
3815
3819
|
if (!n || !o) return;
|
|
3816
3820
|
const l = document.createRange();
|
|
3817
3821
|
try {
|
|
@@ -3822,7 +3826,7 @@ function Qt(t, e) {
|
|
|
3822
3826
|
const i = document.getSelection();
|
|
3823
3827
|
i == null || i.removeAllRanges(), i == null || i.addRange(l);
|
|
3824
3828
|
}
|
|
3825
|
-
function
|
|
3829
|
+
function bt(t, e) {
|
|
3826
3830
|
var r;
|
|
3827
3831
|
const n = document.createTreeWalker(t, NodeFilter.SHOW_TEXT);
|
|
3828
3832
|
let o = 0, l = null, i = n.nextNode();
|
|
@@ -3834,7 +3838,7 @@ function ht(t, e) {
|
|
|
3834
3838
|
}
|
|
3835
3839
|
return l ?? { node: t, offset: 0 };
|
|
3836
3840
|
}
|
|
3837
|
-
function
|
|
3841
|
+
function ul(t) {
|
|
3838
3842
|
const e = document.getSelection();
|
|
3839
3843
|
if (!e || e.rangeCount === 0) return !1;
|
|
3840
3844
|
const n = e.getRangeAt(0);
|
|
@@ -3846,9 +3850,9 @@ function rl(t) {
|
|
|
3846
3850
|
} catch {
|
|
3847
3851
|
return !1;
|
|
3848
3852
|
}
|
|
3849
|
-
return o.toString().replace(
|
|
3853
|
+
return o.toString().replace(Ke, "").trim() === "";
|
|
3850
3854
|
}
|
|
3851
|
-
function
|
|
3855
|
+
function yt(t) {
|
|
3852
3856
|
const e = document.getSelection();
|
|
3853
3857
|
if (!e || e.rangeCount === 0 || !e.isCollapsed) return null;
|
|
3854
3858
|
const n = e.getRangeAt(0);
|
|
@@ -3868,19 +3872,19 @@ function he(t) {
|
|
|
3868
3872
|
const n = e.closest("td, th");
|
|
3869
3873
|
return n instanceof HTMLTableCellElement ? n : null;
|
|
3870
3874
|
}
|
|
3871
|
-
function
|
|
3872
|
-
const n =
|
|
3875
|
+
function pl(t, e) {
|
|
3876
|
+
const n = ln(e), o = n.indexOf(t);
|
|
3873
3877
|
if (o < 0) return null;
|
|
3874
3878
|
const l = n[o + 1];
|
|
3875
|
-
return l ||
|
|
3879
|
+
return l || fl(t);
|
|
3876
3880
|
}
|
|
3877
|
-
function
|
|
3881
|
+
function hl(t) {
|
|
3878
3882
|
const e = t.closest("table");
|
|
3879
3883
|
if (!e) return null;
|
|
3880
|
-
const n =
|
|
3884
|
+
const n = ln(e), o = n.indexOf(t);
|
|
3881
3885
|
return o > 0 ? n[o - 1] ?? null : null;
|
|
3882
3886
|
}
|
|
3883
|
-
function
|
|
3887
|
+
function Re(t, e, n) {
|
|
3884
3888
|
const o = e.parentElement, l = n.parentElement;
|
|
3885
3889
|
if (!(o instanceof HTMLTableRowElement) || !(l instanceof HTMLTableRowElement))
|
|
3886
3890
|
return [e];
|
|
@@ -3901,15 +3905,15 @@ function Ne(t, e, n) {
|
|
|
3901
3905
|
}
|
|
3902
3906
|
return d;
|
|
3903
3907
|
}
|
|
3904
|
-
const
|
|
3905
|
-
function
|
|
3908
|
+
const J = 6;
|
|
3909
|
+
function kt(t, e, n) {
|
|
3906
3910
|
const o = t.getBoundingClientRect();
|
|
3907
|
-
return e < o.left -
|
|
3911
|
+
return e < o.left - J || e > o.right + J || n < o.top - J || n > o.bottom + J ? null : e >= o.right - J ? "right" : n >= o.bottom - J ? "bottom" : null;
|
|
3908
3912
|
}
|
|
3909
|
-
function
|
|
3913
|
+
function ln(t) {
|
|
3910
3914
|
return Array.from(t.querySelectorAll("td, th"));
|
|
3911
3915
|
}
|
|
3912
|
-
function
|
|
3916
|
+
function fl(t) {
|
|
3913
3917
|
const e = t.closest("tr");
|
|
3914
3918
|
if (!e || !e.parentNode) return null;
|
|
3915
3919
|
const n = document.createElement("tr");
|
|
@@ -3921,8 +3925,8 @@ function cl(t) {
|
|
|
3921
3925
|
const o = n.firstElementChild;
|
|
3922
3926
|
return o instanceof HTMLTableCellElement ? o : null;
|
|
3923
3927
|
}
|
|
3924
|
-
const
|
|
3925
|
-
class
|
|
3928
|
+
const ml = 600, gl = 200, bl = 64;
|
|
3929
|
+
class yl {
|
|
3926
3930
|
constructor(e) {
|
|
3927
3931
|
b(this, "past", []);
|
|
3928
3932
|
b(this, "future", []);
|
|
@@ -3949,8 +3953,8 @@ class hl {
|
|
|
3949
3953
|
this.present = e;
|
|
3950
3954
|
return;
|
|
3951
3955
|
}
|
|
3952
|
-
const l = Math.abs(e.html.length - this.present.html.length) >
|
|
3953
|
-
n === "typing" && this.lastKind === "typing" && !l && o - this.lastPushAt <
|
|
3956
|
+
const l = Math.abs(e.html.length - this.present.html.length) > bl;
|
|
3957
|
+
n === "typing" && this.lastKind === "typing" && !l && o - this.lastPushAt < ml || (this.past.push(this.present), this.past.length > gl && this.past.shift(), this.lastPushAt = o), this.lastKind = n, this.present = e, this.future.length = 0;
|
|
3954
3958
|
}
|
|
3955
3959
|
/** 되돌린다. 되돌릴 것이 없으면 null. */
|
|
3956
3960
|
undo() {
|
|
@@ -3974,7 +3978,7 @@ class hl {
|
|
|
3974
3978
|
this.past.length = 0, this.future.length = 0, this.present = e, this.lastKind = "structural", this.lastPushAt = 0;
|
|
3975
3979
|
}
|
|
3976
3980
|
}
|
|
3977
|
-
const
|
|
3981
|
+
const kl = /* @__PURE__ */ new Set([
|
|
3978
3982
|
"P",
|
|
3979
3983
|
"DIV",
|
|
3980
3984
|
"SECTION",
|
|
@@ -4006,10 +4010,10 @@ const fl = /* @__PURE__ */ new Set([
|
|
|
4006
4010
|
"FIELDSET",
|
|
4007
4011
|
"ADDRESS"
|
|
4008
4012
|
]);
|
|
4009
|
-
function
|
|
4010
|
-
return
|
|
4013
|
+
function wl(t) {
|
|
4014
|
+
return kl.has(t.toUpperCase());
|
|
4011
4015
|
}
|
|
4012
|
-
const
|
|
4016
|
+
const vl = ["script", "noscript", "meta", "link", "style", "base"], Cl = /* @__PURE__ */ new Set([
|
|
4013
4017
|
// CSS 2.1
|
|
4014
4018
|
"border-collapse",
|
|
4015
4019
|
"border-spacing",
|
|
@@ -4121,7 +4125,7 @@ const gl = ["script", "noscript", "meta", "link", "style", "base"], bl = /* @__P
|
|
|
4121
4125
|
"stroke-opacity",
|
|
4122
4126
|
"stroke-width",
|
|
4123
4127
|
"text-anchor"
|
|
4124
|
-
]),
|
|
4128
|
+
]), Ll = /* @__PURE__ */ new Set([
|
|
4125
4129
|
"border-block-end-color",
|
|
4126
4130
|
"border-block-start-color",
|
|
4127
4131
|
"border-bottom-color",
|
|
@@ -4139,7 +4143,7 @@ const gl = ["script", "noscript", "meta", "link", "style", "base"], bl = /* @__P
|
|
|
4139
4143
|
"-webkit-text-fill-color",
|
|
4140
4144
|
"-webkit-text-stroke-color"
|
|
4141
4145
|
]);
|
|
4142
|
-
async function
|
|
4146
|
+
async function xl(t, e = {}) {
|
|
4143
4147
|
const n = e.settleMs ?? 1e3, o = e.timeoutMs ?? 3e4, l = e.width ?? 1024, i = e.mountTarget ?? null;
|
|
4144
4148
|
return new Promise((r, s) => {
|
|
4145
4149
|
const a = document.createElement("iframe");
|
|
@@ -4154,59 +4158,59 @@ async function kl(t, e = {}) {
|
|
|
4154
4158
|
}, m = window.setTimeout(() => {
|
|
4155
4159
|
u(new Error("HTML 로드 시간 초과"));
|
|
4156
4160
|
}, o), f = () => {
|
|
4157
|
-
var
|
|
4161
|
+
var S;
|
|
4158
4162
|
const g = a.contentDocument;
|
|
4159
4163
|
if (!g || !g.body || g.body.children.length === 0 && (g.body.textContent ?? "").trim() === "")
|
|
4160
4164
|
return;
|
|
4161
4165
|
const k = a.contentWindow, y = (k == null ? void 0 : k.requestAnimationFrame) ?? window.requestAnimationFrame;
|
|
4162
|
-
(g.fonts && typeof ((
|
|
4163
|
-
const
|
|
4166
|
+
(g.fonts && typeof ((S = g.fonts.ready) == null ? void 0 : S.then) == "function" ? g.fonts.ready : Promise.resolve()).then(() => {
|
|
4167
|
+
const v = () => {
|
|
4164
4168
|
window.setTimeout(() => {
|
|
4165
4169
|
if (!c)
|
|
4166
4170
|
try {
|
|
4167
|
-
const
|
|
4168
|
-
if (!
|
|
4171
|
+
const x = a.contentWindow, $ = a.contentDocument;
|
|
4172
|
+
if (!x || !$ || !$.body) {
|
|
4169
4173
|
window.clearTimeout(m), u(new Error("iframe document 접근 실패"));
|
|
4170
4174
|
return;
|
|
4171
4175
|
}
|
|
4172
|
-
const N =
|
|
4176
|
+
const N = El($.body, x, i);
|
|
4173
4177
|
window.clearTimeout(m), h(N);
|
|
4174
|
-
} catch (
|
|
4175
|
-
window.clearTimeout(m), u(
|
|
4178
|
+
} catch (x) {
|
|
4179
|
+
window.clearTimeout(m), u(x instanceof Error ? x : new Error(String(x)));
|
|
4176
4180
|
}
|
|
4177
4181
|
}, n);
|
|
4178
4182
|
};
|
|
4179
|
-
y(() => y(
|
|
4183
|
+
y(() => y(v));
|
|
4180
4184
|
});
|
|
4181
4185
|
};
|
|
4182
4186
|
a.addEventListener("load", f), a.srcdoc = t, document.body.appendChild(a);
|
|
4183
4187
|
});
|
|
4184
4188
|
}
|
|
4185
|
-
function
|
|
4189
|
+
function El(t, e, n) {
|
|
4186
4190
|
var r;
|
|
4187
4191
|
const o = t.ownerDocument;
|
|
4188
4192
|
if (!o) throw new Error("body has no ownerDocument");
|
|
4189
|
-
const l = document.createElement("div"), i =
|
|
4193
|
+
const l = document.createElement("div"), i = Al(o, e, n);
|
|
4190
4194
|
try {
|
|
4191
4195
|
for (let a = 0; a < t.attributes.length; a++) {
|
|
4192
4196
|
const c = t.attributes.item(a);
|
|
4193
4197
|
c && c.name !== "style" && l.setAttribute(c.name, c.value);
|
|
4194
4198
|
}
|
|
4195
|
-
const s =
|
|
4199
|
+
const s = et(t, null, "div", i.get, e);
|
|
4196
4200
|
s.length > 0 && l.setAttribute("style", s);
|
|
4197
4201
|
for (const a of Array.from(t.children)) {
|
|
4198
4202
|
const c = document.importNode(a, !0);
|
|
4199
|
-
|
|
4203
|
+
rn(a, c, t, i.get, e), l.appendChild(c);
|
|
4200
4204
|
}
|
|
4201
4205
|
} finally {
|
|
4202
4206
|
i.cleanup();
|
|
4203
4207
|
}
|
|
4204
|
-
for (const s of
|
|
4208
|
+
for (const s of vl)
|
|
4205
4209
|
for (const a of Array.from(l.querySelectorAll(s)))
|
|
4206
4210
|
(r = a.parentNode) == null || r.removeChild(a);
|
|
4207
4211
|
return l.style.width = "auto", l.style.maxWidth = "none", l.style.height = "auto", l.style.maxHeight = "none", l.setAttribute("data-imported-html", "true"), [l];
|
|
4208
4212
|
}
|
|
4209
|
-
function
|
|
4213
|
+
function Al(t, e, n) {
|
|
4210
4214
|
var d;
|
|
4211
4215
|
let o, l, i;
|
|
4212
4216
|
const r = ((d = n == null ? void 0 : n.ownerDocument) == null ? void 0 : d.defaultView) ?? null;
|
|
@@ -4235,15 +4239,15 @@ function vl(t, e, n) {
|
|
|
4235
4239
|
i.parentNode && i.parentNode.removeChild(i);
|
|
4236
4240
|
} };
|
|
4237
4241
|
}
|
|
4238
|
-
function
|
|
4242
|
+
function et(t, e, n, o, l, i) {
|
|
4239
4243
|
const r = l.getComputedStyle(t, i ?? null), s = e ? l.getComputedStyle(e) : null, a = o(n);
|
|
4240
4244
|
let c = "";
|
|
4241
4245
|
for (let d = 0; d < r.length; d++) {
|
|
4242
4246
|
const u = r.item(d);
|
|
4243
4247
|
if (!u) continue;
|
|
4244
4248
|
const h = r.getPropertyValue(u);
|
|
4245
|
-
if (h && !(i && u === "content") && !(
|
|
4246
|
-
if (
|
|
4249
|
+
if (h && !(i && u === "content") && !(Ll.has(u) && h === r.getPropertyValue("color"))) {
|
|
4250
|
+
if (Cl.has(u)) {
|
|
4247
4251
|
if (s && s.getPropertyValue(u) === h) continue;
|
|
4248
4252
|
} else if (a.get(u) === h) continue;
|
|
4249
4253
|
c += `${u}:${h};`;
|
|
@@ -4251,7 +4255,7 @@ function Xe(t, e, n, o, l, i) {
|
|
|
4251
4255
|
}
|
|
4252
4256
|
return c;
|
|
4253
4257
|
}
|
|
4254
|
-
function
|
|
4258
|
+
function Tl(t) {
|
|
4255
4259
|
let e = "";
|
|
4256
4260
|
const n = /"((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)'/g;
|
|
4257
4261
|
let o;
|
|
@@ -4264,7 +4268,7 @@ function Cl(t) {
|
|
|
4264
4268
|
}
|
|
4265
4269
|
return e;
|
|
4266
4270
|
}
|
|
4267
|
-
const
|
|
4271
|
+
const Sl = /* @__PURE__ */ new Set([
|
|
4268
4272
|
"TABLE",
|
|
4269
4273
|
"THEAD",
|
|
4270
4274
|
"TBODY",
|
|
@@ -4276,11 +4280,11 @@ const Ll = /* @__PURE__ */ new Set([
|
|
|
4276
4280
|
"SELECT",
|
|
4277
4281
|
"OPTGROUP"
|
|
4278
4282
|
]);
|
|
4279
|
-
function
|
|
4280
|
-
if (
|
|
4283
|
+
function wt(t, e, n, o, l) {
|
|
4284
|
+
if (Sl.has(e.tagName)) return;
|
|
4281
4285
|
const i = n === "before" ? "::before" : "::after", r = l.getComputedStyle(t, i), s = r.getPropertyValue("content");
|
|
4282
4286
|
if (!s || s === "none" || s === "normal" || r.getPropertyValue("display") === "none") return;
|
|
4283
|
-
const a =
|
|
4287
|
+
const a = Tl(s), c = /url\((["']?)([^"')]+)\1\)/.exec(s), d = et(t, t, "span", o, l, i);
|
|
4284
4288
|
if (!a && !c && !d) return;
|
|
4285
4289
|
const u = e.ownerDocument, h = u.createElement("span");
|
|
4286
4290
|
if (h.setAttribute("data-imported-pseudo", n), d && h.setAttribute("style", d), c != null && c[2]) {
|
|
@@ -4289,9 +4293,9 @@ function gt(t, e, n, o, l) {
|
|
|
4289
4293
|
}
|
|
4290
4294
|
a && h.appendChild(u.createTextNode(a)), n === "before" ? e.insertBefore(h, e.firstChild) : e.appendChild(h);
|
|
4291
4295
|
}
|
|
4292
|
-
function
|
|
4296
|
+
function rn(t, e, n, o, l) {
|
|
4293
4297
|
if (t.nodeType === 1 && e.nodeType === 1) {
|
|
4294
|
-
const a =
|
|
4298
|
+
const a = et(
|
|
4295
4299
|
t,
|
|
4296
4300
|
n,
|
|
4297
4301
|
t.tagName.toLowerCase(),
|
|
@@ -4303,19 +4307,19 @@ function tn(t, e, n, o, l) {
|
|
|
4303
4307
|
const i = t.children, r = e.children, s = Math.min(i.length, r.length);
|
|
4304
4308
|
for (let a = 0; a < s; a++) {
|
|
4305
4309
|
const c = i[a], d = r[a];
|
|
4306
|
-
c && d &&
|
|
4310
|
+
c && d && rn(c, d, t, o, l);
|
|
4307
4311
|
}
|
|
4308
|
-
t.nodeType === 1 && e.nodeType === 1 && (
|
|
4312
|
+
t.nodeType === 1 && e.nodeType === 1 && (wt(t, e, "before", o, l), wt(t, e, "after", o, l));
|
|
4309
4313
|
}
|
|
4310
|
-
function
|
|
4311
|
-
const e =
|
|
4314
|
+
function $l(t) {
|
|
4315
|
+
const e = Bl(t), n = document.createElement("div");
|
|
4312
4316
|
n.innerHTML = e;
|
|
4313
4317
|
const o = [];
|
|
4314
4318
|
for (const l of Array.from(n.children))
|
|
4315
4319
|
l instanceof HTMLElement && o.push(l);
|
|
4316
4320
|
return o;
|
|
4317
4321
|
}
|
|
4318
|
-
function
|
|
4322
|
+
function Bl(t) {
|
|
4319
4323
|
const n = t.replace(/\r\n?/g, `
|
|
4320
4324
|
`).replace(/\s+$/, "").split(`
|
|
4321
4325
|
`), o = [];
|
|
@@ -4332,7 +4336,7 @@ function El(t) {
|
|
|
4332
4336
|
for (l++; l < n.length && !/^```\s*$/.test(n[l] ?? ""); )
|
|
4333
4337
|
d.push(n[l] ?? ""), l++;
|
|
4334
4338
|
l < n.length && l++;
|
|
4335
|
-
const u = c ? ` data-language="${
|
|
4339
|
+
const u = c ? ` data-language="${Te(c)}"` : "";
|
|
4336
4340
|
o.push(
|
|
4337
4341
|
`<pre><code${u}>${ge(d.join(`
|
|
4338
4342
|
`))}</code></pre>`
|
|
@@ -4349,11 +4353,11 @@ function El(t) {
|
|
|
4349
4353
|
o.push("<hr>"), l++;
|
|
4350
4354
|
continue;
|
|
4351
4355
|
}
|
|
4352
|
-
if (
|
|
4356
|
+
if (sn(i, n[l + 1] ?? "")) {
|
|
4353
4357
|
const c = [i];
|
|
4354
4358
|
for (l++, c.push(n[l] ?? ""), l++; l < n.length && (n[l] ?? "").includes("|") && (n[l] ?? "").trim() !== ""; )
|
|
4355
4359
|
c.push(n[l] ?? ""), l++;
|
|
4356
|
-
o.push(
|
|
4360
|
+
o.push(Nl(c));
|
|
4357
4361
|
continue;
|
|
4358
4362
|
}
|
|
4359
4363
|
if (i.startsWith(">")) {
|
|
@@ -4365,35 +4369,35 @@ function El(t) {
|
|
|
4365
4369
|
continue;
|
|
4366
4370
|
}
|
|
4367
4371
|
if (/^[\s]*[-*+]\s+\[[ xX]\]\s+/.test(i)) {
|
|
4368
|
-
const c =
|
|
4372
|
+
const c = Rl(n, l);
|
|
4369
4373
|
l = c.next, o.push(`<ul class="${P}">${c.html}</ul>`);
|
|
4370
4374
|
continue;
|
|
4371
4375
|
}
|
|
4372
4376
|
if (/^[\s]*[-*+]\s+/.test(i)) {
|
|
4373
|
-
const c =
|
|
4377
|
+
const c = vt(n, l, /^[\s]*[-*+]\s+(.*)$/);
|
|
4374
4378
|
l = c.next, o.push(`<ul>${c.html}</ul>`);
|
|
4375
4379
|
continue;
|
|
4376
4380
|
}
|
|
4377
4381
|
if (/^[\s]*\d+\.\s+/.test(i)) {
|
|
4378
|
-
const c =
|
|
4382
|
+
const c = vt(n, l, /^[\s]*\d+\.\s+(.*)$/);
|
|
4379
4383
|
l = c.next, o.push(`<ol>${c.html}</ol>`);
|
|
4380
4384
|
continue;
|
|
4381
4385
|
}
|
|
4382
4386
|
const a = [];
|
|
4383
|
-
for (; l < n.length && (n[l] ?? "").trim() !== "" && !
|
|
4387
|
+
for (; l < n.length && (n[l] ?? "").trim() !== "" && !Ml(n[l] ?? "", n[l + 1] ?? ""); )
|
|
4384
4388
|
a.push(n[l] ?? ""), l++;
|
|
4385
|
-
a.length > 0 && o.push(`<p>${V(
|
|
4389
|
+
a.length > 0 && o.push(`<p>${V(Hl(a))}</p>`);
|
|
4386
4390
|
}
|
|
4387
4391
|
return o.join(`
|
|
4388
4392
|
`);
|
|
4389
4393
|
}
|
|
4390
|
-
function
|
|
4391
|
-
return /^#{1,6}\s/.test(t) || /^[\s]*[-*+]\s+/.test(t) || /^[\s]*\d+\.\s+/.test(t) || t.startsWith(">") || /^```/.test(t) || /^[\s]*([-*_])(\s*\1){2,}[\s]*$/.test(t) ||
|
|
4394
|
+
function Ml(t, e) {
|
|
4395
|
+
return /^#{1,6}\s/.test(t) || /^[\s]*[-*+]\s+/.test(t) || /^[\s]*\d+\.\s+/.test(t) || t.startsWith(">") || /^```/.test(t) || /^[\s]*([-*_])(\s*\1){2,}[\s]*$/.test(t) || sn(t, e);
|
|
4392
4396
|
}
|
|
4393
|
-
function
|
|
4397
|
+
function sn(t, e) {
|
|
4394
4398
|
return t.includes("|") ? /^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/.test(e) : !1;
|
|
4395
4399
|
}
|
|
4396
|
-
function
|
|
4400
|
+
function Nl(t) {
|
|
4397
4401
|
if (t.length < 2) return "";
|
|
4398
4402
|
const e = He(t[0] ?? ""), o = He(t[1] ?? "").map((s) => {
|
|
4399
4403
|
const a = s.trim(), c = a.startsWith(":"), d = a.endsWith(":");
|
|
@@ -4410,7 +4414,7 @@ function Tl(t) {
|
|
|
4410
4414
|
function He(t) {
|
|
4411
4415
|
return t.trim().replace(/^\|/, "").replace(/\|$/, "").split("|");
|
|
4412
4416
|
}
|
|
4413
|
-
function
|
|
4417
|
+
function vt(t, e, n) {
|
|
4414
4418
|
const o = [];
|
|
4415
4419
|
let l = e;
|
|
4416
4420
|
for (; l < t.length; ) {
|
|
@@ -4429,7 +4433,7 @@ function bt(t, e, n) {
|
|
|
4429
4433
|
}
|
|
4430
4434
|
return { html: o.join(""), next: l };
|
|
4431
4435
|
}
|
|
4432
|
-
function
|
|
4436
|
+
function Rl(t, e) {
|
|
4433
4437
|
const n = /^[\s]*[-*+]\s+\[([ xX])\]\s+(.*)$/, o = [];
|
|
4434
4438
|
let l = e;
|
|
4435
4439
|
for (; l < t.length; ) {
|
|
@@ -4440,7 +4444,7 @@ function Sl(t, e) {
|
|
|
4440
4444
|
}
|
|
4441
4445
|
return { html: o.join(""), next: l };
|
|
4442
4446
|
}
|
|
4443
|
-
function
|
|
4447
|
+
function Hl(t) {
|
|
4444
4448
|
const e = [];
|
|
4445
4449
|
for (let n = 0; n < t.length; n++) {
|
|
4446
4450
|
const o = t[n] ?? "", l = n === t.length - 1;
|
|
@@ -4450,7 +4454,7 @@ function $l(t) {
|
|
|
4450
4454
|
}
|
|
4451
4455
|
return e.join("");
|
|
4452
4456
|
}
|
|
4453
|
-
const we = "",
|
|
4457
|
+
const we = "", Il = new RegExp(we + "([0-9]+)" + we, "g");
|
|
4454
4458
|
function V(t) {
|
|
4455
4459
|
const e = [];
|
|
4456
4460
|
let n = t.replace(/(`+)([\s\S]+?)\1/g, (o, l, i) => {
|
|
@@ -4459,39 +4463,38 @@ function V(t) {
|
|
|
4459
4463
|
});
|
|
4460
4464
|
return n = ge(n), n = n.replace(
|
|
4461
4465
|
/<(https?:\/\/[^\s&]+)>/g,
|
|
4462
|
-
(o, l) => `<a${
|
|
4466
|
+
(o, l) => `<a${Ct(l)} target="_blank" rel="noopener">${ge(l)}</a>`
|
|
4463
4467
|
), n = n.replace(
|
|
4464
4468
|
/!\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g,
|
|
4465
|
-
(o, l, i) => `<img${
|
|
4469
|
+
(o, l, i) => `<img${Dl(i)} alt="${Te(l)}">`
|
|
4466
4470
|
), n = n.replace(
|
|
4467
4471
|
/\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g,
|
|
4468
|
-
(o, l, i) => `<a${
|
|
4469
|
-
), n = n.replace(/\*\*([^*\n]+?)\*\*/g, "<strong>$1</strong>"), n = n.replace(/__([^_\n]+?)__/g, "<strong>$1</strong>"), n = n.replace(/(^|[^*])\*([^*\n]+?)\*(?!\*)/g, "$1<em>$2</em>"), n = n.replace(/(^|[^_])_([^_\n]+?)_(?!_)/g, "$1<em>$2</em>"), n = n.replace(/~~([^~\n]+?)~~/g, "<s>$1</s>"), n = n.replace(
|
|
4472
|
+
(o, l, i) => `<a${Ct(i)} target="_blank" rel="noopener">${l}</a>`
|
|
4473
|
+
), n = n.replace(/\*\*([^*\n]+?)\*\*/g, "<strong>$1</strong>"), n = n.replace(/__([^_\n]+?)__/g, "<strong>$1</strong>"), n = n.replace(/(^|[^*])\*([^*\n]+?)\*(?!\*)/g, "$1<em>$2</em>"), n = n.replace(/(^|[^_])_([^_\n]+?)_(?!_)/g, "$1<em>$2</em>"), n = n.replace(/~~([^~\n]+?)~~/g, "<s>$1</s>"), n = n.replace(Il, (o, l) => {
|
|
4470
4474
|
const i = Number(l);
|
|
4471
4475
|
return e[i] ?? "";
|
|
4472
4476
|
}), n;
|
|
4473
4477
|
}
|
|
4474
|
-
function
|
|
4478
|
+
function Ct(t) {
|
|
4475
4479
|
const e = q(t);
|
|
4476
|
-
return e ? ` href="${
|
|
4480
|
+
return e ? ` href="${Te(e)}"` : "";
|
|
4477
4481
|
}
|
|
4478
|
-
function
|
|
4479
|
-
const e =
|
|
4480
|
-
return e ? ` src="${
|
|
4482
|
+
function Dl(t) {
|
|
4483
|
+
const e = R(t);
|
|
4484
|
+
return e ? ` src="${Te(e)}"` : "";
|
|
4481
4485
|
}
|
|
4482
4486
|
function ge(t) {
|
|
4483
4487
|
return t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
4484
4488
|
}
|
|
4485
|
-
function
|
|
4489
|
+
function Te(t) {
|
|
4486
4490
|
return t.replace(/&/g, "&").replace(/"/g, """);
|
|
4487
4491
|
}
|
|
4488
|
-
const
|
|
4492
|
+
const Ie = {
|
|
4489
4493
|
bulletList: "bulletList",
|
|
4490
4494
|
orderedList: "orderedList",
|
|
4491
4495
|
blockquote: "blockquote",
|
|
4492
4496
|
codeBlock: "codeBlock"
|
|
4493
|
-
},
|
|
4494
|
-
class si {
|
|
4497
|
+
}, De = "application/x-aeriz-block", Lt = 80, xe = class xe {
|
|
4495
4498
|
constructor(e) {
|
|
4496
4499
|
b(this, "root");
|
|
4497
4500
|
b(this, "content");
|
|
@@ -4512,14 +4515,14 @@ class si {
|
|
|
4512
4515
|
b(this, "statusSourceEl");
|
|
4513
4516
|
b(this, "options");
|
|
4514
4517
|
b(this, "observer");
|
|
4515
|
-
b(this, "blockIds", new
|
|
4518
|
+
b(this, "blockIds", new Xt());
|
|
4516
4519
|
b(this, "idFor", (e) => this.blockIds.ensure(e));
|
|
4517
4520
|
b(this, "listeners", /* @__PURE__ */ new Set());
|
|
4518
4521
|
b(this, "handleSelectionChange", () => this.queueSync());
|
|
4519
4522
|
b(this, "handleResize", () => this.repositionHandles());
|
|
4520
4523
|
/** document 에 붙는다 — destroy() 에서 반드시 떼야 인스턴스가 GC 된다. */
|
|
4521
4524
|
b(this, "handleDocumentMouseUp", () => this.handleCellSelEnd());
|
|
4522
|
-
b(this, "state",
|
|
4525
|
+
b(this, "state", Ol());
|
|
4523
4526
|
b(this, "destroyed", !1);
|
|
4524
4527
|
b(this, "syncQueued", !1);
|
|
4525
4528
|
b(this, "lastSerialized", "");
|
|
@@ -4529,6 +4532,11 @@ class si {
|
|
|
4529
4532
|
b(this, "hoverRaf", null);
|
|
4530
4533
|
/** 라벨 pill 의 등장 애니메이션을 블록이 **바뀔 때만** 다시 재생하기 위한 표식. */
|
|
4531
4534
|
b(this, "pillBlockId", null);
|
|
4535
|
+
/**
|
|
4536
|
+
* IME 조합이 진행 중인지. 한글 · 일본어 · 중국어 입력은 글자 하나가 여러
|
|
4537
|
+
* 입력에 걸쳐 만들어지는데, 그 사이에 DOM 을 다시 쓰면 조합이 끊긴다.
|
|
4538
|
+
*/
|
|
4539
|
+
b(this, "composing", !1);
|
|
4532
4540
|
/**
|
|
4533
4541
|
* 편집 이력. 브라우저 기본 undo 는 우리가 직접 한 DOM 조작(블록 이동 · 표
|
|
4534
4542
|
* 편집 · 유형 변경) 을 모르기 때문에 자체 스택을 둔다.
|
|
@@ -4567,9 +4575,9 @@ class si {
|
|
|
4567
4575
|
});
|
|
4568
4576
|
if (!(e.element instanceof HTMLElement))
|
|
4569
4577
|
throw new TypeError("AerizEditor: options.element must be an HTMLElement");
|
|
4570
|
-
if (this.options = e, e.locale &&
|
|
4571
|
-
const l = e.toolbar ??
|
|
4572
|
-
this.toolbar = new
|
|
4578
|
+
if (this.options = e, e.locale && kn(e.locale), this.root = document.createElement("div"), this.root.className = "aeriz-wysiwyg", e.theme && (this.root.dataset.theme = e.theme), e.toolbar !== !1) {
|
|
4579
|
+
const l = e.toolbar ?? fn;
|
|
4580
|
+
this.toolbar = new vn(l, {
|
|
4573
4581
|
onAction: (i, r) => this.handleToolbarAction(i, r)
|
|
4574
4582
|
}), this.root.appendChild(this.toolbar.element);
|
|
4575
4583
|
}
|
|
@@ -4579,15 +4587,15 @@ class si {
|
|
|
4579
4587
|
), this.content.style.setProperty(
|
|
4580
4588
|
"--aw-caption-hint",
|
|
4581
4589
|
JSON.stringify(p().image.captionPlaceholder)
|
|
4582
|
-
), this.content.innerHTML = e.initialHTML ?? "<p><br></p>",
|
|
4590
|
+
), this.content.innerHTML = e.initialHTML ?? "<p><br></p>", Be(this.content), me(this.content, this.blockIds), this.rehighlightAllCodeBlocks(), this.lastSerialized = this.content.innerHTML, this.history = new yl({ html: this.lastSerialized, selection: null }), this.contentWrap.appendChild(this.content), this.handlesLayer = document.createElement("div"), this.handlesLayer.className = "aw-block-handles", this.contentWrap.appendChild(this.handlesLayer), this.dropIndicator = document.createElement("div"), this.dropIndicator.className = "aw-block-drop-indicator", this.dropIndicator.style.display = "none", this.contentWrap.appendChild(this.dropIndicator), this.blockLabelPill = document.createElement("button"), this.blockLabelPill.type = "button", this.blockLabelPill.className = "aw-block-label-pill", this.blockLabelPill.style.display = "none", this.blockLabelPill.title = p().toolbar.blockTypeChangeTooltip, this.pillGlyphEl = document.createElement("span"), this.pillGlyphEl.className = "aw-pill-glyph", this.pillGlyphEl.setAttribute("aria-hidden", "true"), this.pillTextEl = document.createElement("span"), this.pillTextEl.className = "aw-pill-text", this.blockLabelPill.appendChild(this.pillGlyphEl), this.blockLabelPill.appendChild(this.pillTextEl), this.blockLabelPill.addEventListener("mousedown", (l) => l.preventDefault()), this.blockLabelPill.addEventListener("click", (l) => {
|
|
4583
4591
|
l.stopPropagation();
|
|
4584
4592
|
const i = this.state.activeBlockId ?? void 0;
|
|
4585
4593
|
this.openBlockTypeMenu(this.blockLabelPill, i);
|
|
4586
4594
|
}), this.contentWrap.appendChild(this.blockLabelPill), this.root.appendChild(this.contentWrap), this.statusBar = document.createElement("div"), this.statusBar.className = "aw-status-bar";
|
|
4587
4595
|
const n = document.createElement("div");
|
|
4588
|
-
n.className = "aw-status-left", this.undoBtn =
|
|
4596
|
+
n.className = "aw-status-left", this.undoBtn = At(`${p().toolbar.undo} (Ctrl+Z)`, A.undo, () => {
|
|
4589
4597
|
this.undo();
|
|
4590
|
-
}), this.redoBtn =
|
|
4598
|
+
}), this.redoBtn = At(`${p().toolbar.redo} (Ctrl+Y)`, A.redo, () => {
|
|
4591
4599
|
this.redo();
|
|
4592
4600
|
}), this.statusBlockEl = document.createElement("span"), this.statusBlockEl.className = "aw-status-item", n.appendChild(this.undoBtn), n.appendChild(this.redoBtn), n.appendChild(this.statusBlockEl);
|
|
4593
4601
|
const o = document.createElement("div");
|
|
@@ -4598,7 +4606,11 @@ class si {
|
|
|
4598
4606
|
characterData: !0
|
|
4599
4607
|
}), this.content.addEventListener("keyup", this.handleSelectionChange), this.content.addEventListener("mouseup", this.handleSelectionChange), this.content.addEventListener("focus", this.handleSelectionChange), this.content.addEventListener("blur", () => {
|
|
4600
4608
|
this.handleSelectionChange(), this.rehighlightAllCodeBlocks();
|
|
4601
|
-
}), this.content.addEventListener("keydown", (l) => this.handleKeyDown(l)), document.addEventListener("selectionchange", this.handleSelectionChange), this.content.addEventListener("mousemove", (l) => this.handleTableCursor(l)), this.content.addEventListener("mousedown", (l) => this.handleTableResizeStart(l)), this.content.addEventListener("click", (l) => this.handleBlockAlignClick(l)), this.content.addEventListener("mousedown", (l) => this.handleTaskToggle(l)), this.content.addEventListener("mousedown", (l) => this.handleCellSelStart(l)), this.content.addEventListener("mousemove", (l) => this.handleCellSelMove(l)), document.addEventListener("mouseup", this.handleDocumentMouseUp), this.content.addEventListener("input", () => this.scheduleCodeHighlight()), this.content.addEventListener("input", (l) => this.handleInputRule(l)), this.content.addEventListener("
|
|
4609
|
+
}), this.content.addEventListener("keydown", (l) => this.handleKeyDown(l)), document.addEventListener("selectionchange", this.handleSelectionChange), this.content.addEventListener("mousemove", (l) => this.handleTableCursor(l)), this.content.addEventListener("mousedown", (l) => this.handleTableResizeStart(l)), this.content.addEventListener("click", (l) => this.handleBlockAlignClick(l)), this.content.addEventListener("mousedown", (l) => this.handleTaskToggle(l)), this.content.addEventListener("mousedown", (l) => this.handleCellSelStart(l)), this.content.addEventListener("mousemove", (l) => this.handleCellSelMove(l)), document.addEventListener("mouseup", this.handleDocumentMouseUp), this.content.addEventListener("input", () => this.scheduleCodeHighlight()), this.content.addEventListener("input", (l) => this.handleInputRule(l)), this.content.addEventListener("compositionstart", () => {
|
|
4610
|
+
this.composing = !0;
|
|
4611
|
+
}), this.content.addEventListener("compositionend", () => {
|
|
4612
|
+
this.composing = !1, this.scheduleCodeHighlight();
|
|
4613
|
+
}), this.content.addEventListener("dragstart", (l) => {
|
|
4602
4614
|
const i = l.target;
|
|
4603
4615
|
i && (i.closest(".aw-block-handle") || i.closest("table") && l.preventDefault());
|
|
4604
4616
|
}), this.contentWrap.addEventListener("mousemove", this.handleHoverMove), this.contentWrap.addEventListener("mouseleave", this.handleHoverLeave), this.content.addEventListener("dragover", (l) => this.handleDragOver(l)), this.content.addEventListener("drop", (l) => this.handleDrop(l)), this.content.addEventListener("dragleave", (l) => this.handleDragLeave(l)), window.addEventListener("resize", this.handleResize), this.sync();
|
|
@@ -4625,12 +4637,12 @@ class si {
|
|
|
4625
4637
|
getHTML(e = {}) {
|
|
4626
4638
|
const n = this.content.cloneNode(!0);
|
|
4627
4639
|
if ((e.styles ?? this.options.htmlStyles ?? "inline") === "class")
|
|
4628
|
-
|
|
4640
|
+
tn(n);
|
|
4629
4641
|
else {
|
|
4630
|
-
const l =
|
|
4631
|
-
i && (l.mode = i),
|
|
4642
|
+
const l = Qt(this.root), i = this.currentTheme();
|
|
4643
|
+
i && (l.mode = i), en(n, l);
|
|
4632
4644
|
}
|
|
4633
|
-
return
|
|
4645
|
+
return nn(n), Xe(n), n.innerHTML;
|
|
4634
4646
|
}
|
|
4635
4647
|
/** 가공 없는 원본 innerHTML. 직렬화 검증/디버그 용도. */
|
|
4636
4648
|
getRawHTML() {
|
|
@@ -4652,27 +4664,27 @@ class si {
|
|
|
4652
4664
|
return this.state;
|
|
4653
4665
|
}
|
|
4654
4666
|
getBlocks() {
|
|
4655
|
-
return
|
|
4667
|
+
return Oe(this.content, this.idFor);
|
|
4656
4668
|
}
|
|
4657
4669
|
/**
|
|
4658
4670
|
* 본문 블록들을 직렬화 가능한 BlockSnapshot 배열로 반환한다.
|
|
4659
4671
|
* AerizViewer.setBlocks(snapshots) 가 받아 동일한 트리를 렌더할 수 있다.
|
|
4660
4672
|
*/
|
|
4661
4673
|
serialize() {
|
|
4662
|
-
return
|
|
4674
|
+
return Jt(this.getBlocks());
|
|
4663
4675
|
}
|
|
4664
4676
|
/**
|
|
4665
4677
|
* data-block-id 로 본문에서 블록을 찾아 반환. 없으면 null.
|
|
4666
4678
|
*/
|
|
4667
4679
|
findBlockById(e) {
|
|
4668
4680
|
const n = this.content.querySelector(`[data-block-id="${e}"]`);
|
|
4669
|
-
return n ?
|
|
4681
|
+
return n ? _e(n, this.content, this.idFor) : null;
|
|
4670
4682
|
}
|
|
4671
4683
|
getActiveBlock() {
|
|
4672
4684
|
const e = document.getSelection();
|
|
4673
4685
|
if (!e || e.rangeCount === 0) return null;
|
|
4674
4686
|
const n = e.getRangeAt(0).commonAncestorContainer;
|
|
4675
|
-
return this.content.contains(n) ?
|
|
4687
|
+
return this.content.contains(n) ? _e(n, this.content, this.idFor) : null;
|
|
4676
4688
|
}
|
|
4677
4689
|
/**
|
|
4678
4690
|
* 블록 유형을 변경/추가한다.
|
|
@@ -4688,8 +4700,8 @@ class si {
|
|
|
4688
4700
|
this.flush(), this.content.focus(), M(r), this.flashBlock(r);
|
|
4689
4701
|
}
|
|
4690
4702
|
replaceBlock(e, n, o) {
|
|
4691
|
-
const l =
|
|
4692
|
-
return
|
|
4703
|
+
const l = Go(e), i = n.create(o);
|
|
4704
|
+
return Yo(i, n.kind, l), e.element.replaceWith(i), i;
|
|
4693
4705
|
}
|
|
4694
4706
|
appendBlock(e, n) {
|
|
4695
4707
|
const o = e.create(n);
|
|
@@ -4710,7 +4722,7 @@ class si {
|
|
|
4710
4722
|
flush() {
|
|
4711
4723
|
var n, o;
|
|
4712
4724
|
if (this.destroyed) return;
|
|
4713
|
-
|
|
4725
|
+
Be(this.content), me(this.content, this.blockIds), this.observer.takeRecords();
|
|
4714
4726
|
const e = this.content.innerHTML;
|
|
4715
4727
|
e !== this.lastSerialized && (this.lastSerialized = e, this.recordHistory(), (o = (n = this.options).onChange) == null || o.call(n, this.getHTML())), this.queueSync();
|
|
4716
4728
|
}
|
|
@@ -4724,7 +4736,7 @@ class si {
|
|
|
4724
4736
|
this.applyingHistory || (this.history.record(
|
|
4725
4737
|
{
|
|
4726
4738
|
html: this.lastSerialized,
|
|
4727
|
-
selection:
|
|
4739
|
+
selection: Ue(this.content)
|
|
4728
4740
|
},
|
|
4729
4741
|
this.pendingChangeKind,
|
|
4730
4742
|
Date.now()
|
|
@@ -4775,7 +4787,7 @@ class si {
|
|
|
4775
4787
|
if (e) {
|
|
4776
4788
|
this.applyingHistory = !0;
|
|
4777
4789
|
try {
|
|
4778
|
-
this.content.innerHTML = e.html,
|
|
4790
|
+
this.content.innerHTML = e.html, Be(this.content), me(this.content, this.blockIds), this.rehighlightAllCodeBlocks(), this.observer.takeRecords(), this.lastSerialized = this.content.innerHTML, this.content.focus(), e.selection && je(this.content, e.selection), (o = (n = this.options).onChange) == null || o.call(n, this.getHTML());
|
|
4779
4791
|
} finally {
|
|
4780
4792
|
this.applyingHistory = !1;
|
|
4781
4793
|
}
|
|
@@ -4790,9 +4802,9 @@ class si {
|
|
|
4790
4802
|
break;
|
|
4791
4803
|
}
|
|
4792
4804
|
case "fontFamily": {
|
|
4793
|
-
if (!
|
|
4805
|
+
if (!ft(this.getActiveBlock())) return;
|
|
4794
4806
|
const o = this.detectActiveFontId();
|
|
4795
|
-
|
|
4807
|
+
ro(
|
|
4796
4808
|
n,
|
|
4797
4809
|
(l) => this.applyFontFamily(l.stack),
|
|
4798
4810
|
o ?? void 0
|
|
@@ -4800,9 +4812,9 @@ class si {
|
|
|
4800
4812
|
break;
|
|
4801
4813
|
}
|
|
4802
4814
|
case "fontSize": {
|
|
4803
|
-
if (!
|
|
4815
|
+
if (!mt(this.getActiveBlock())) return;
|
|
4804
4816
|
const o = this.detectActiveFontSize();
|
|
4805
|
-
|
|
4817
|
+
uo(
|
|
4806
4818
|
n,
|
|
4807
4819
|
(l) => this.applyFontSize(l.px),
|
|
4808
4820
|
o ?? void 0
|
|
@@ -4811,7 +4823,7 @@ class si {
|
|
|
4811
4823
|
}
|
|
4812
4824
|
case "color": {
|
|
4813
4825
|
if (!ue(this.getActiveBlock())) return;
|
|
4814
|
-
|
|
4826
|
+
$e(
|
|
4815
4827
|
n,
|
|
4816
4828
|
(o) => this.handleColorPick(o, "foreColor"),
|
|
4817
4829
|
this.recentCustomColors
|
|
@@ -4820,7 +4832,7 @@ class si {
|
|
|
4820
4832
|
}
|
|
4821
4833
|
case "backgroundColor": {
|
|
4822
4834
|
if (!ue(this.getActiveBlock())) return;
|
|
4823
|
-
|
|
4835
|
+
$e(
|
|
4824
4836
|
n,
|
|
4825
4837
|
(o) => this.handleColorPick(o, "hiliteColor"),
|
|
4826
4838
|
this.recentCustomColors
|
|
@@ -4828,15 +4840,15 @@ class si {
|
|
|
4828
4840
|
break;
|
|
4829
4841
|
}
|
|
4830
4842
|
case "align": {
|
|
4831
|
-
if (!
|
|
4832
|
-
|
|
4843
|
+
if (!Me(this.getActiveBlock())) return;
|
|
4844
|
+
io(n, (o) => this.applyAlign(o));
|
|
4833
4845
|
break;
|
|
4834
4846
|
}
|
|
4835
4847
|
case "cellBg": {
|
|
4836
4848
|
if (!pe(this.getActiveBlock())) return;
|
|
4837
4849
|
const o = this.getSelectedTableCells();
|
|
4838
4850
|
if (o.length === 0) return;
|
|
4839
|
-
|
|
4851
|
+
$e(
|
|
4840
4852
|
n,
|
|
4841
4853
|
(l) => this.applyCellBgToCells(o, l),
|
|
4842
4854
|
this.recentCustomColors
|
|
@@ -4845,14 +4857,14 @@ class si {
|
|
|
4845
4857
|
}
|
|
4846
4858
|
case "tableMenu": {
|
|
4847
4859
|
if (!pe(this.getActiveBlock())) return;
|
|
4848
|
-
|
|
4860
|
+
co(n, (o) => this.runTableMenu(o));
|
|
4849
4861
|
break;
|
|
4850
4862
|
}
|
|
4851
4863
|
case "codeLang": {
|
|
4852
4864
|
const o = this.getActiveBlock();
|
|
4853
4865
|
if (!o || o.kind !== "codeBlock") return;
|
|
4854
4866
|
const l = o.element.querySelector(":scope > code"), i = (l == null ? void 0 : l.getAttribute("data-language")) ?? void 0;
|
|
4855
|
-
|
|
4867
|
+
so(
|
|
4856
4868
|
n,
|
|
4857
4869
|
(r) => this.applyCodeLanguage(o.element, r.id),
|
|
4858
4870
|
i
|
|
@@ -4875,7 +4887,7 @@ class si {
|
|
|
4875
4887
|
case "orderedList":
|
|
4876
4888
|
case "blockquote":
|
|
4877
4889
|
case "codeBlock": {
|
|
4878
|
-
const o =
|
|
4890
|
+
const o = Ie[e];
|
|
4879
4891
|
if (!o) break;
|
|
4880
4892
|
const l = this.getActiveBlock();
|
|
4881
4893
|
this.setBlockType((l == null ? void 0 : l.kind) === o ? "paragraph" : o);
|
|
@@ -4892,7 +4904,7 @@ class si {
|
|
|
4892
4904
|
break;
|
|
4893
4905
|
case "table": {
|
|
4894
4906
|
const o = this.state.activeBlockId ?? void 0;
|
|
4895
|
-
|
|
4907
|
+
at(n, (l) => {
|
|
4896
4908
|
this.setBlockType("table", { rows: l.rows, cols: l.cols }, o);
|
|
4897
4909
|
});
|
|
4898
4910
|
break;
|
|
@@ -4928,7 +4940,7 @@ class si {
|
|
|
4928
4940
|
* `command` 가 'foreColor' 면 글자색, 'hiliteColor' 면 글 배경색.
|
|
4929
4941
|
*/
|
|
4930
4942
|
handleColorPick(e, n) {
|
|
4931
|
-
e && !
|
|
4943
|
+
e && !Pe.includes(e) && (this.recentCustomColors = [
|
|
4932
4944
|
e,
|
|
4933
4945
|
...this.recentCustomColors.filter((o) => o !== e)
|
|
4934
4946
|
].slice(0, 8)), this.applyColor(n, e), this.queueSync();
|
|
@@ -4956,7 +4968,7 @@ class si {
|
|
|
4956
4968
|
*/
|
|
4957
4969
|
applyAlign(e) {
|
|
4958
4970
|
const n = this.getActiveBlock();
|
|
4959
|
-
if (!n || !
|
|
4971
|
+
if (!n || !Me(n)) return;
|
|
4960
4972
|
const o = Array.from(
|
|
4961
4973
|
this.content.querySelectorAll(
|
|
4962
4974
|
"td.aw-cell-selected, th.aw-cell-selected"
|
|
@@ -5011,7 +5023,7 @@ class si {
|
|
|
5011
5023
|
if (!r || !o.contains(r)) return [];
|
|
5012
5024
|
if (i.collapsed) return [r];
|
|
5013
5025
|
const s = he(i.endContainer);
|
|
5014
|
-
return !s || !o.contains(s) || s === r ? [r] :
|
|
5026
|
+
return !s || !o.contains(s) || s === r ? [r] : Re(o, r, s);
|
|
5015
5027
|
}
|
|
5016
5028
|
handleCellSelStart(e) {
|
|
5017
5029
|
if (e.button !== 0) return;
|
|
@@ -5030,7 +5042,7 @@ class si {
|
|
|
5030
5042
|
if (!(o instanceof HTMLTableCellElement) || o === this.cellSelStart && !this.cellSelDrag) return;
|
|
5031
5043
|
const l = o.closest("table");
|
|
5032
5044
|
if (!(l instanceof HTMLTableElement)) return;
|
|
5033
|
-
const i =
|
|
5045
|
+
const i = Re(l, this.cellSelStart, o);
|
|
5034
5046
|
if (!(i.length <= 1)) {
|
|
5035
5047
|
this.cellSelDrag = !0, this.clearCellSelection();
|
|
5036
5048
|
for (const r of i) r.classList.add("aw-cell-selected");
|
|
@@ -5063,7 +5075,7 @@ class si {
|
|
|
5063
5075
|
let o = 0;
|
|
5064
5076
|
for (const l of e)
|
|
5065
5077
|
l.isConnected && (n ? l.style.setProperty("background-color", n, "important") : l.style.removeProperty("background-color"), o++);
|
|
5066
|
-
o !== 0 && (n && !
|
|
5078
|
+
o !== 0 && (n && !Pe.includes(n) && (this.recentCustomColors = [
|
|
5067
5079
|
n,
|
|
5068
5080
|
...this.recentCustomColors.filter((l) => l !== n)
|
|
5069
5081
|
].slice(0, 8)), this.clearCellSelection(), this.flush());
|
|
@@ -5134,7 +5146,7 @@ class si {
|
|
|
5134
5146
|
}
|
|
5135
5147
|
scheduleCodeHighlight() {
|
|
5136
5148
|
this.codeHighlightTimer !== null && window.clearTimeout(this.codeHighlightTimer), this.codeHighlightTimer = window.setTimeout(() => {
|
|
5137
|
-
this.codeHighlightTimer = null;
|
|
5149
|
+
if (this.codeHighlightTimer = null, this.composing) return;
|
|
5138
5150
|
const e = this.getActiveBlock();
|
|
5139
5151
|
if ((e == null ? void 0 : e.kind) !== "codeBlock") return;
|
|
5140
5152
|
const n = e.element.querySelector(":scope > code");
|
|
@@ -5156,8 +5168,8 @@ class si {
|
|
|
5156
5168
|
* code 안에 있다면 textContent offset 으로 caret 위치 보존.
|
|
5157
5169
|
*/
|
|
5158
5170
|
rehighlightCode(e, n) {
|
|
5159
|
-
const o = e
|
|
5160
|
-
e.innerHTML =
|
|
5171
|
+
const o = Et(e), l = cl(e);
|
|
5172
|
+
e.innerHTML = st(o, n), l && dl(e, l);
|
|
5161
5173
|
}
|
|
5162
5174
|
/**
|
|
5163
5175
|
* 본문에서 모든 codeBlock 을 순회하며 highlight 적용. setHTML / 초기 로드
|
|
@@ -5200,7 +5212,7 @@ class si {
|
|
|
5200
5212
|
this.content.style.cursor = "";
|
|
5201
5213
|
return;
|
|
5202
5214
|
}
|
|
5203
|
-
const o =
|
|
5215
|
+
const o = kt(n, e.clientX, e.clientY);
|
|
5204
5216
|
this.content.style.cursor = o === "right" ? "col-resize" : o === "bottom" ? "row-resize" : "";
|
|
5205
5217
|
}
|
|
5206
5218
|
/**
|
|
@@ -5221,7 +5233,7 @@ class si {
|
|
|
5221
5233
|
}
|
|
5222
5234
|
const l = (a = n == null ? void 0 : n.closest) == null ? void 0 : a.call(n, "td, th");
|
|
5223
5235
|
if (!(l instanceof HTMLTableCellElement)) return;
|
|
5224
|
-
const i =
|
|
5236
|
+
const i = kt(l, e.clientX, e.clientY);
|
|
5225
5237
|
if (!i) return;
|
|
5226
5238
|
if (e.preventDefault(), e.stopPropagation(), i === "right") {
|
|
5227
5239
|
const c = l.closest("tr"), d = c ? Array.from(c.children).indexOf(l) : -1, u = l.closest("table");
|
|
@@ -5342,7 +5354,7 @@ class si {
|
|
|
5342
5354
|
const o = e.getBoundingClientRect().width, l = this.contentInnerWidth();
|
|
5343
5355
|
document.body.style.cursor = "nwse-resize", e.classList.add("aw-resizing");
|
|
5344
5356
|
const i = (s) => {
|
|
5345
|
-
const a = s.clientX - n, c = Math.max(
|
|
5357
|
+
const a = s.clientX - n, c = Math.max(Lt, o + a);
|
|
5346
5358
|
e.style.width = `${Math.round(Math.min(c, l))}px`;
|
|
5347
5359
|
}, r = () => {
|
|
5348
5360
|
document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", r), document.body.style.cursor = "", e.classList.remove("aw-resizing"), this.flush();
|
|
@@ -5355,7 +5367,7 @@ class si {
|
|
|
5355
5367
|
*/
|
|
5356
5368
|
contentInnerWidth() {
|
|
5357
5369
|
const e = getComputedStyle(this.content), n = this.content.clientWidth - (Number.parseFloat(e.paddingLeft) || 0) - (Number.parseFloat(e.paddingRight) || 0);
|
|
5358
|
-
return Math.max(
|
|
5370
|
+
return Math.max(Lt, n);
|
|
5359
5371
|
}
|
|
5360
5372
|
currentTheme() {
|
|
5361
5373
|
const e = this.root.dataset.theme;
|
|
@@ -5380,7 +5392,7 @@ class si {
|
|
|
5380
5392
|
let n = e.getRangeAt(0).startContainer;
|
|
5381
5393
|
if (!n || !this.content.contains(n) || (n.nodeType !== Node.ELEMENT_NODE && (n = n.parentElement), !(n instanceof Element))) return null;
|
|
5382
5394
|
const o = getComputedStyle(n).fontFamily;
|
|
5383
|
-
return
|
|
5395
|
+
return In(o);
|
|
5384
5396
|
}
|
|
5385
5397
|
/**
|
|
5386
5398
|
* 선택 영역에 글자 크기를 적용한다. execCommand('fontSize') 는 1~7 만 받기
|
|
@@ -5407,7 +5419,7 @@ class si {
|
|
|
5407
5419
|
if (a && c && a !== c && this.content.contains(a) && this.content.contains(c)) {
|
|
5408
5420
|
const d = a.closest("table");
|
|
5409
5421
|
if (d instanceof HTMLTableElement) {
|
|
5410
|
-
this.applyFontSizeToCells(
|
|
5422
|
+
this.applyFontSizeToCells(Re(d, a, c), e);
|
|
5411
5423
|
return;
|
|
5412
5424
|
}
|
|
5413
5425
|
}
|
|
@@ -5446,7 +5458,7 @@ class si {
|
|
|
5446
5458
|
let n = e.getRangeAt(0).startContainer;
|
|
5447
5459
|
if (!n || !this.content.contains(n) || (n.nodeType !== Node.ELEMENT_NODE && (n = n.parentElement), !(n instanceof Element))) return null;
|
|
5448
5460
|
const o = getComputedStyle(n).fontSize;
|
|
5449
|
-
return
|
|
5461
|
+
return $n(o);
|
|
5450
5462
|
}
|
|
5451
5463
|
/**
|
|
5452
5464
|
* 블록 유형 드롭다운을 열어 사용자 선택 결과를 처리한다.
|
|
@@ -5454,7 +5466,7 @@ class si {
|
|
|
5454
5466
|
* 로직(리치 블록 다이얼로그 분기 + targetId 보존) 을 공유한다.
|
|
5455
5467
|
*/
|
|
5456
5468
|
openBlockTypeMenu(e, n) {
|
|
5457
|
-
|
|
5469
|
+
lo(e, (o) => {
|
|
5458
5470
|
if (o.kind === "linkCard") {
|
|
5459
5471
|
this.openLinkDialogAndApply(n);
|
|
5460
5472
|
return;
|
|
@@ -5468,7 +5480,7 @@ class si {
|
|
|
5468
5480
|
return;
|
|
5469
5481
|
}
|
|
5470
5482
|
if (o.kind === "table") {
|
|
5471
|
-
|
|
5483
|
+
at(e, (l) => {
|
|
5472
5484
|
this.setBlockType(
|
|
5473
5485
|
"table",
|
|
5474
5486
|
{ rows: l.rows, cols: l.cols },
|
|
@@ -5498,7 +5510,7 @@ class si {
|
|
|
5498
5510
|
* 그 id 의 블록을 정확히 변환 대상으로 삼는다.
|
|
5499
5511
|
*/
|
|
5500
5512
|
openLinkDialogAndApply(e) {
|
|
5501
|
-
|
|
5513
|
+
Cn({}, this.currentTheme()).then((n) => {
|
|
5502
5514
|
var r;
|
|
5503
5515
|
if (!n.confirmed || !n.href) return;
|
|
5504
5516
|
const o = n.href, l = ((r = n.text) == null ? void 0 : r.trim()) ?? "", i = l.length > 0 ? l : o;
|
|
@@ -5511,7 +5523,7 @@ class si {
|
|
|
5511
5523
|
*/
|
|
5512
5524
|
openImageDialogAndApply(e) {
|
|
5513
5525
|
const n = this.resolveImageUploadFn();
|
|
5514
|
-
|
|
5526
|
+
Ln(
|
|
5515
5527
|
{ ...n ? { onUpload: n } : {} },
|
|
5516
5528
|
this.currentTheme()
|
|
5517
5529
|
).then((o) => {
|
|
@@ -5523,9 +5535,9 @@ class si {
|
|
|
5523
5535
|
* 변환/추가. 잘못된 URL 이면 무시.
|
|
5524
5536
|
*/
|
|
5525
5537
|
openYouTubeDialogAndApply(e) {
|
|
5526
|
-
|
|
5538
|
+
Tn(this.currentTheme()).then((n) => {
|
|
5527
5539
|
if (!n.confirmed || !n.url) return;
|
|
5528
|
-
const o =
|
|
5540
|
+
const o = zl(n.url);
|
|
5529
5541
|
o && this.setBlockType("youtube", { videoId: o }, e);
|
|
5530
5542
|
});
|
|
5531
5543
|
}
|
|
@@ -5537,7 +5549,7 @@ class si {
|
|
|
5537
5549
|
* - 삽입된 element 는 MutationObserver flush 가 새 data-block-id 를 발급.
|
|
5538
5550
|
*/
|
|
5539
5551
|
openImportHtmlDialogAndApply(e) {
|
|
5540
|
-
|
|
5552
|
+
xn(this.currentTheme()).then(async (n) => {
|
|
5541
5553
|
if (!n.confirmed) return;
|
|
5542
5554
|
if (!n.html || n.html.length === 0) {
|
|
5543
5555
|
window.alert(p().importHtml.errEmpty);
|
|
@@ -5545,7 +5557,7 @@ class si {
|
|
|
5545
5557
|
}
|
|
5546
5558
|
let o;
|
|
5547
5559
|
try {
|
|
5548
|
-
o = await
|
|
5560
|
+
o = await xl(n.html, {
|
|
5549
5561
|
mountTarget: this.content
|
|
5550
5562
|
});
|
|
5551
5563
|
} catch (s) {
|
|
@@ -5560,7 +5572,7 @@ class si {
|
|
|
5560
5572
|
}
|
|
5561
5573
|
const l = e ? this.content.querySelector(`[data-block-id="${e}"]`) : null, i = [];
|
|
5562
5574
|
for (const s of o) {
|
|
5563
|
-
const a =
|
|
5575
|
+
const a = wl(s.tagName) ? s : (() => {
|
|
5564
5576
|
const c = document.createElement("p");
|
|
5565
5577
|
return c.appendChild(s), c;
|
|
5566
5578
|
})();
|
|
@@ -5592,7 +5604,7 @@ class si {
|
|
|
5592
5604
|
* 본문에 element 들을 삽입한다. importHtml 과 동일한 삽입 정책을 따른다.
|
|
5593
5605
|
*/
|
|
5594
5606
|
openMarkdownImportDialogAndApply(e) {
|
|
5595
|
-
|
|
5607
|
+
En(this.currentTheme()).then((n) => {
|
|
5596
5608
|
if (!n.confirmed) return;
|
|
5597
5609
|
if (!n.markdown || n.markdown.length === 0) {
|
|
5598
5610
|
window.alert(p().importMarkdown.errEmpty);
|
|
@@ -5600,7 +5612,7 @@ class si {
|
|
|
5600
5612
|
}
|
|
5601
5613
|
let o;
|
|
5602
5614
|
try {
|
|
5603
|
-
o =
|
|
5615
|
+
o = $l(n.markdown);
|
|
5604
5616
|
} catch (r) {
|
|
5605
5617
|
console.error("Markdown parse failed:", r);
|
|
5606
5618
|
const s = r instanceof Error ? r.message : String(r);
|
|
@@ -5640,7 +5652,7 @@ class si {
|
|
|
5640
5652
|
*/
|
|
5641
5653
|
openFileAttachmentDialogAndApply(e) {
|
|
5642
5654
|
const n = this.resolveFileUploadFn();
|
|
5643
|
-
|
|
5655
|
+
An(
|
|
5644
5656
|
{ ...n ? { onUpload: n } : {} },
|
|
5645
5657
|
this.currentTheme()
|
|
5646
5658
|
).then((o) => {
|
|
@@ -5649,7 +5661,7 @@ class si {
|
|
|
5649
5661
|
window.alert(p().fileAttach.errEmpty);
|
|
5650
5662
|
return;
|
|
5651
5663
|
}
|
|
5652
|
-
const l = { fileSrc: o.src }, i = o.name && o.name.length > 0 ? o.name :
|
|
5664
|
+
const l = { fileSrc: o.src }, i = o.name && o.name.length > 0 ? o.name : Fl(o.src);
|
|
5653
5665
|
i && (l.fileName = i), o.size !== void 0 && (l.fileSize = o.size), o.type && (l.fileType = o.type), this.setBlockType("file", l, e);
|
|
5654
5666
|
});
|
|
5655
5667
|
}
|
|
@@ -5699,7 +5711,7 @@ class si {
|
|
|
5699
5711
|
}));
|
|
5700
5712
|
}
|
|
5701
5713
|
sync() {
|
|
5702
|
-
const e =
|
|
5714
|
+
const e = Oe(this.content, this.idFor), n = this.getActiveBlock(), l = n !== null ? {
|
|
5703
5715
|
bold: fe("bold"),
|
|
5704
5716
|
italic: fe("italic"),
|
|
5705
5717
|
underline: fe("underline"),
|
|
@@ -5734,7 +5746,14 @@ class si {
|
|
|
5734
5746
|
return;
|
|
5735
5747
|
}
|
|
5736
5748
|
}
|
|
5737
|
-
if (this.handleBlockShortcut(e) || e.key === "Tab" && !e.isComposing && this.handleTabKey(e) || e.key === "Backspace" && !e.isComposing && this.handleBackspaceKey(e)
|
|
5749
|
+
if (this.handleBlockShortcut(e) || e.key === "Tab" && !e.isComposing && this.handleTabKey(e) || e.key === "Backspace" && !e.isComposing && this.handleBackspaceKey(e))
|
|
5750
|
+
return;
|
|
5751
|
+
if (e.key === "Enter" && e.shiftKey && !e.isComposing) {
|
|
5752
|
+
const l = this.getActiveBlock();
|
|
5753
|
+
(l == null ? void 0 : l.kind) === "codeBlock" && this.insertCodeLineBreak(e, l);
|
|
5754
|
+
return;
|
|
5755
|
+
}
|
|
5756
|
+
if (e.key !== "Enter" || e.shiftKey || e.isComposing) return;
|
|
5738
5757
|
const n = document.getSelection();
|
|
5739
5758
|
if (!n || n.rangeCount === 0 || !n.isCollapsed) return;
|
|
5740
5759
|
const o = this.getActiveBlock();
|
|
@@ -5743,7 +5762,7 @@ class si {
|
|
|
5743
5762
|
this.exitBlockOnEnter(e, o.element);
|
|
5744
5763
|
return;
|
|
5745
5764
|
}
|
|
5746
|
-
o.kind === "heading" &&
|
|
5765
|
+
o.kind === "heading" && ul(o.element) && this.exitBlockOnEnter(e, o.element);
|
|
5747
5766
|
}
|
|
5748
5767
|
}
|
|
5749
5768
|
/**
|
|
@@ -5766,9 +5785,9 @@ class si {
|
|
|
5766
5785
|
return;
|
|
5767
5786
|
}
|
|
5768
5787
|
if (n.kind !== "paragraph") return;
|
|
5769
|
-
const o =
|
|
5788
|
+
const o = yt(n.element);
|
|
5770
5789
|
if (!o) return;
|
|
5771
|
-
const l =
|
|
5790
|
+
const l = sl(o.text);
|
|
5772
5791
|
l && (o.range.deleteContents(), this.setBlockType(l.kind, l.attrs));
|
|
5773
5792
|
}
|
|
5774
5793
|
/**
|
|
@@ -5784,9 +5803,9 @@ class si {
|
|
|
5784
5803
|
if (!o) return;
|
|
5785
5804
|
const l = (s = o.nodeType === Node.ELEMENT_NODE ? o : o.parentElement) == null ? void 0 : s.closest("li");
|
|
5786
5805
|
if (!l || l.parentElement !== e.element) return;
|
|
5787
|
-
const i =
|
|
5806
|
+
const i = yt(l);
|
|
5788
5807
|
if (!i) return;
|
|
5789
|
-
const r =
|
|
5808
|
+
const r = al(i.text);
|
|
5790
5809
|
r && (this.markStructuralChange(), i.range.deleteContents(), U(l) && !l.querySelector("br") && l.appendChild(document.createElement("br")), e.element.classList.add(P), r.checked && l.setAttribute(W, "true"), this.flush(), this.content.focus(), M(l));
|
|
5791
5810
|
}
|
|
5792
5811
|
/**
|
|
@@ -5812,7 +5831,7 @@ class si {
|
|
|
5812
5831
|
return l === "arrowup" || l === "arrowdown" ? (e.preventDefault(), this.moveActiveBlock(l === "arrowup" ? "up" : "down"), !0) : l === "d" ? (e.preventDefault(), this.deleteActiveBlock(), !0) : !1;
|
|
5813
5832
|
}
|
|
5814
5833
|
if (!e.altKey) return !1;
|
|
5815
|
-
const o =
|
|
5834
|
+
const o = rl[e.key.toLowerCase()];
|
|
5816
5835
|
return o ? (e.preventDefault(), this.setBlockType(o.kind, o.attrs), !0) : !1;
|
|
5817
5836
|
}
|
|
5818
5837
|
/**
|
|
@@ -5854,10 +5873,52 @@ class si {
|
|
|
5854
5873
|
const o = this.getActiveTableCell();
|
|
5855
5874
|
if (!o) return !1;
|
|
5856
5875
|
e.preventDefault();
|
|
5857
|
-
const l = e.shiftKey ?
|
|
5876
|
+
const l = e.shiftKey ? hl(o) : pl(o, n.element);
|
|
5858
5877
|
return l && M(l), this.flush(), !0;
|
|
5859
5878
|
}
|
|
5860
|
-
return n.kind === "bulletList" || n.kind === "orderedList" ? (e.preventDefault(), this.content.focus(), document.execCommand(e.shiftKey ? "outdent" : "indent"), this.queueSync(), !0) : !1;
|
|
5879
|
+
return n.kind === "bulletList" || n.kind === "orderedList" ? (e.preventDefault(), this.content.focus(), document.execCommand(e.shiftKey ? "outdent" : "indent"), this.queueSync(), !0) : n.kind === "codeBlock" ? this.indentCode(e, n, e.shiftKey) : !1;
|
|
5880
|
+
}
|
|
5881
|
+
/**
|
|
5882
|
+
* 코드 블록 들여쓰기 / 내어쓰기 (Tab · Shift+Tab).
|
|
5883
|
+
*
|
|
5884
|
+
* 코드를 쓰는 자리에서 Tab 이 포커스를 툴바로 옮겨 버리면 들여쓰기를 할
|
|
5885
|
+
* 방법이 없다. 다른 블록에서는 그 탈출구가 필요하지만(§7.5) 코드 블록은
|
|
5886
|
+
* 예외다.
|
|
5887
|
+
*
|
|
5888
|
+
* 선택 영역이 여러 줄에 걸치면 **걸친 줄 전체**를 옮긴다. 한 줄 안에 캐럿만
|
|
5889
|
+
* 있으면 그 자리에 들여쓰기를 넣는다 — 편집기들이 공통으로 하는 동작이다.
|
|
5890
|
+
*
|
|
5891
|
+
* 텍스트를 통째로 다시 쓰고 캐럿은 문자 오프셋으로 되돌린다. 하이라이트가
|
|
5892
|
+
* 이미 같은 방식으로 동작하므로 경로가 하나로 모인다.
|
|
5893
|
+
*/
|
|
5894
|
+
indentCode(e, n, o) {
|
|
5895
|
+
const l = n.element.querySelector(":scope > code");
|
|
5896
|
+
if (!l) return !1;
|
|
5897
|
+
const i = Ue(l) ?? { start: 0, end: 0 }, r = Et(l), s = xe.CODE_INDENT;
|
|
5898
|
+
let a, c, d;
|
|
5899
|
+
if (!o && i.start === i.end)
|
|
5900
|
+
a = r.slice(0, i.start) + s + r.slice(i.start), c = d = i.start + s.length;
|
|
5901
|
+
else {
|
|
5902
|
+
const h = r.lastIndexOf(`
|
|
5903
|
+
`, i.start - 1) + 1, m = r.indexOf(`
|
|
5904
|
+
`, i.end), f = m === -1 ? r.length : m;
|
|
5905
|
+
let g = 0, k = 0;
|
|
5906
|
+
const y = r.slice(h, f).split(`
|
|
5907
|
+
`).map((L, S) => {
|
|
5908
|
+
if (o) {
|
|
5909
|
+
const v = /^(\t| {1,2})/.exec(L), x = (v == null ? void 0 : v[0].length) ?? 0;
|
|
5910
|
+
return S === 0 && (g = -x), k -= x, L.slice(x);
|
|
5911
|
+
}
|
|
5912
|
+
return L === "" ? L : (S === 0 && (g = s.length), k += s.length, s + L);
|
|
5913
|
+
}).join(`
|
|
5914
|
+
`);
|
|
5915
|
+
if (k === 0)
|
|
5916
|
+
return e.preventDefault(), !0;
|
|
5917
|
+
a = r.slice(0, h) + y + r.slice(f), c = Math.max(h, i.start + g), d = Math.max(c, i.end + k);
|
|
5918
|
+
}
|
|
5919
|
+
e.preventDefault(), this.markStructuralChange();
|
|
5920
|
+
const u = l.getAttribute("data-language") ?? void 0;
|
|
5921
|
+
return l.innerHTML = st(a, u), this.content.focus(), je(l, { start: c, end: d }), this.flush(), !0;
|
|
5861
5922
|
}
|
|
5862
5923
|
/**
|
|
5863
5924
|
* Backspace 처리. 처리했으면 `true`.
|
|
@@ -5878,6 +5939,37 @@ class si {
|
|
|
5878
5939
|
const i = document.createElement("p");
|
|
5879
5940
|
return i.appendChild(document.createElement("br")), o.element.replaceWith(i), this.flush(), this.content.focus(), M(i), !0;
|
|
5880
5941
|
}
|
|
5942
|
+
/**
|
|
5943
|
+
* 코드 블록 안에 줄바꿈을 넣는다 (Shift+Enter).
|
|
5944
|
+
*
|
|
5945
|
+
* `<pre>` 는 개행 문자를 그대로 보존하므로 줄바꿈은 **문자 하나**여야 한다.
|
|
5946
|
+
* `<br>` 을 쓰면 `textContent` 가 그 자리를 빈 것으로 읽어, 하이라이트가
|
|
5947
|
+
* 다시 그려지는 순간(타이핑 멈춘 뒤 300ms) 줄이 사라진다.
|
|
5948
|
+
*
|
|
5949
|
+
* 맨 끝에서는 개행을 **하나 더** 넣는다. `<pre>` 는 마지막 개행 하나를
|
|
5950
|
+
* 접어 버려서, 하나만 넣으면 새 줄이 화면에 나타나지 않고 캐럿도 앞 줄에
|
|
5951
|
+
* 머문 것처럼 보인다. 뒤쪽 개행은 자리를 만드는 용도이고, 이어서 글자를
|
|
5952
|
+
* 치면 자연스럽게 그 줄의 내용이 된다.
|
|
5953
|
+
*/
|
|
5954
|
+
insertCodeLineBreak(e, n) {
|
|
5955
|
+
const o = n.element.querySelector(":scope > code");
|
|
5956
|
+
if (!o) return;
|
|
5957
|
+
const l = document.getSelection();
|
|
5958
|
+
if (!l || l.rangeCount === 0) return;
|
|
5959
|
+
e.preventDefault(), o.contains(l.getRangeAt(0).commonAncestorContainer) || M(n.element);
|
|
5960
|
+
const i = l.getRangeAt(0);
|
|
5961
|
+
if (!o.contains(i.commonAncestorContainer)) return;
|
|
5962
|
+
i.deleteContents();
|
|
5963
|
+
const r = document.createRange();
|
|
5964
|
+
r.selectNodeContents(o), r.setStart(i.endContainer, i.endOffset);
|
|
5965
|
+
const s = r.toString() === "", a = document.createTextNode(s ? `
|
|
5966
|
+
|
|
5967
|
+
` : `
|
|
5968
|
+
`);
|
|
5969
|
+
i.insertNode(a);
|
|
5970
|
+
const c = document.createRange();
|
|
5971
|
+
c.setStart(a, 1), c.collapse(!0), l.removeAllRanges(), l.addRange(c), this.flush();
|
|
5972
|
+
}
|
|
5881
5973
|
/**
|
|
5882
5974
|
* 활성 블록 뒤에 새 빈 **본문 블록**을 만들고 캐럿을 그 안에 둔다.
|
|
5883
5975
|
* 인용구 / 코드 블록의 Enter 탈출, 제목 끝 Enter 에 사용.
|
|
@@ -5948,7 +6040,7 @@ class si {
|
|
|
5948
6040
|
const o = document.createElement("div");
|
|
5949
6041
|
o.className = "aw-block-handle", o.draggable = !0, o.setAttribute("role", "button"), o.setAttribute("aria-label", p().toolbar.blockMoveTooltip), o.title = p().toolbar.blockMoveTooltip, o.innerHTML = '<svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><circle cx="6" cy="3" r="1.4"/><circle cx="10" cy="3" r="1.4"/><circle cx="6" cy="8" r="1.4"/><circle cx="10" cy="8" r="1.4"/><circle cx="6" cy="13" r="1.4"/><circle cx="10" cy="13" r="1.4"/></svg>', o.addEventListener("dragstart", (i) => {
|
|
5950
6042
|
if (!i.dataTransfer) return;
|
|
5951
|
-
i.dataTransfer.setData(
|
|
6043
|
+
i.dataTransfer.setData(De, e), i.dataTransfer.setData("text/plain", e), i.dataTransfer.effectAllowed = "move", o.classList.add("is-dragging");
|
|
5952
6044
|
const r = this.content.querySelector(
|
|
5953
6045
|
`[data-block-id="${e}"]`
|
|
5954
6046
|
);
|
|
@@ -5985,14 +6077,14 @@ class si {
|
|
|
5985
6077
|
o.appendChild(document.createElement("br")), n.insertAdjacentElement("afterend", o), this.flush(), this.content.focus(), M(o);
|
|
5986
6078
|
}
|
|
5987
6079
|
handleDragOver(e) {
|
|
5988
|
-
if (!e.dataTransfer || !Array.from(e.dataTransfer.types).includes(
|
|
6080
|
+
if (!e.dataTransfer || !Array.from(e.dataTransfer.types).includes(De)) return;
|
|
5989
6081
|
e.preventDefault(), e.dataTransfer.dropEffect = "move";
|
|
5990
6082
|
const n = this.findDropTarget(e.clientY);
|
|
5991
6083
|
n && this.showDropIndicator(n);
|
|
5992
6084
|
}
|
|
5993
6085
|
handleDrop(e) {
|
|
5994
6086
|
if (!e.dataTransfer) return;
|
|
5995
|
-
const n = e.dataTransfer.getData(
|
|
6087
|
+
const n = e.dataTransfer.getData(De);
|
|
5996
6088
|
if (!n) return;
|
|
5997
6089
|
e.preventDefault();
|
|
5998
6090
|
const o = this.findDropTarget(e.clientY);
|
|
@@ -6045,7 +6137,7 @@ class si {
|
|
|
6045
6137
|
this.blockLabelPill.style.display = "none", this.blockLabelPill.classList.remove("is-entering"), this.pillBlockId = null;
|
|
6046
6138
|
return;
|
|
6047
6139
|
}
|
|
6048
|
-
const { match: n } = Y(e.element), o =
|
|
6140
|
+
const { match: n } = Y(e.element), o = Ne(e.element, n), l = il(n);
|
|
6049
6141
|
this.pillGlyphEl.textContent !== l && (this.pillGlyphEl.textContent = l), this.pillTextEl.textContent !== o && (this.pillTextEl.textContent = o), this.blockLabelPill.dataset.kind = n.kind, this.blockLabelPill.style.display = "inline-flex", this.pillBlockId !== e.id && (this.pillBlockId = e.id, this.blockLabelPill.classList.remove("is-entering"), this.blockLabelPill.offsetWidth, this.blockLabelPill.classList.add("is-entering"));
|
|
6050
6142
|
const i = e.element.getBoundingClientRect(), r = this.contentWrap.getBoundingClientRect(), s = 3, a = this.blockLabelPill.offsetHeight || 15, c = Math.max(
|
|
6051
6143
|
0,
|
|
@@ -6061,7 +6153,7 @@ class si {
|
|
|
6061
6153
|
syncStatusBar(e, n) {
|
|
6062
6154
|
if (e) {
|
|
6063
6155
|
const { match: r } = Y(e.element);
|
|
6064
|
-
let s =
|
|
6156
|
+
let s = Ne(e.element, r);
|
|
6065
6157
|
if (e.kind === "codeBlock") {
|
|
6066
6158
|
const a = e.element.querySelector(":scope > code"), c = a == null ? void 0 : a.getAttribute("data-language");
|
|
6067
6159
|
c && (s += ` · ${c}`);
|
|
@@ -6072,11 +6164,11 @@ class si {
|
|
|
6072
6164
|
this.statusBlocksEl.textContent = re(p().status.blocksCount, {
|
|
6073
6165
|
n: n.length
|
|
6074
6166
|
});
|
|
6075
|
-
const o = (this.content.textContent ?? "").replace(
|
|
6167
|
+
const o = (this.content.textContent ?? "").replace(Ke, "").replace(/\s+/g, ""), l = Array.from(o).length;
|
|
6076
6168
|
this.statusCharsEl.textContent = re(p().status.chars, { n: l });
|
|
6077
6169
|
const i = this.content.innerHTML.length;
|
|
6078
6170
|
this.statusSourceEl.textContent = re(p().status.source, {
|
|
6079
|
-
n:
|
|
6171
|
+
n: Pl(i)
|
|
6080
6172
|
});
|
|
6081
6173
|
}
|
|
6082
6174
|
/**
|
|
@@ -6092,7 +6184,7 @@ class si {
|
|
|
6092
6184
|
for (const n of Array.from(this.content.children)) {
|
|
6093
6185
|
if (!(n instanceof HTMLElement)) continue;
|
|
6094
6186
|
const { match: o } = Y(n);
|
|
6095
|
-
n.setAttribute("data-block-kind", o.kind), n.setAttribute("data-block-label",
|
|
6187
|
+
n.setAttribute("data-block-kind", o.kind), n.setAttribute("data-block-label", Ne(n, o));
|
|
6096
6188
|
const l = this.blockIds.get(n);
|
|
6097
6189
|
l && l === e ? n.setAttribute("data-block-focused", "") : n.hasAttribute("data-block-focused") && n.removeAttribute("data-block-focused");
|
|
6098
6190
|
}
|
|
@@ -6101,15 +6193,30 @@ class si {
|
|
|
6101
6193
|
applyToolbarState(e, n) {
|
|
6102
6194
|
if (this.toolbar) {
|
|
6103
6195
|
this.toolbar.setActive("bold", e.inline.bold), this.toolbar.setActive("italic", e.inline.italic), this.toolbar.setActive("underline", e.inline.underline), this.toolbar.setActive("strike", e.inline.strike);
|
|
6104
|
-
for (const o of Object.keys(
|
|
6105
|
-
const l =
|
|
6196
|
+
for (const o of Object.keys(Ie)) {
|
|
6197
|
+
const l = Ie[o];
|
|
6106
6198
|
this.toolbar.setActive(o, (n == null ? void 0 : n.kind) === l);
|
|
6107
6199
|
}
|
|
6108
|
-
this.toolbar.setVisible("bold", ie(n, "bold")), this.toolbar.setVisible("italic", ie(n, "italic")), this.toolbar.setVisible("underline", ie(n, "underline")), this.toolbar.setVisible("strike", ie(n, "strike")), this.toolbar.setVisible("fontFamily",
|
|
6200
|
+
this.toolbar.setVisible("bold", ie(n, "bold")), this.toolbar.setVisible("italic", ie(n, "italic")), this.toolbar.setVisible("underline", ie(n, "underline")), this.toolbar.setVisible("strike", ie(n, "strike")), this.toolbar.setVisible("fontFamily", ft(n)), this.toolbar.setVisible("fontSize", mt(n)), this.toolbar.setVisible("color", ue(n)), this.toolbar.setVisible("backgroundColor", ue(n)), this.toolbar.setVisible("align", Me(n)), this.toolbar.setVisible("cellBg", pe(n)), this.toolbar.setVisible("tableMenu", pe(n)), this.toolbar.setVisible("codeLang", (n == null ? void 0 : n.kind) === "codeBlock"), this.toolbar.syncGroupVisibility();
|
|
6109
6201
|
}
|
|
6110
6202
|
}
|
|
6203
|
+
};
|
|
6204
|
+
/** 코드 블록의 들여쓰기 한 단계. 공백 두 칸 — 이 저장소의 코드 스타일과 같다. */
|
|
6205
|
+
b(xe, "CODE_INDENT", " ");
|
|
6206
|
+
let xt = xe;
|
|
6207
|
+
function Et(t) {
|
|
6208
|
+
var o;
|
|
6209
|
+
if (t.childNodes.length === 1 && ((o = t.firstChild) == null ? void 0 : o.nodeName) === "BR")
|
|
6210
|
+
return "";
|
|
6211
|
+
let e = "";
|
|
6212
|
+
const n = (l) => {
|
|
6213
|
+
for (const i of Array.from(l.childNodes))
|
|
6214
|
+
i.nodeType === Node.TEXT_NODE ? e += i.textContent ?? "" : i.nodeName === "BR" ? e += `
|
|
6215
|
+
` : n(i);
|
|
6216
|
+
};
|
|
6217
|
+
return n(t), e;
|
|
6111
6218
|
}
|
|
6112
|
-
function
|
|
6219
|
+
function zl(t) {
|
|
6113
6220
|
const e = t.trim();
|
|
6114
6221
|
if (!e) return null;
|
|
6115
6222
|
let n;
|
|
@@ -6127,7 +6234,7 @@ function Nl(t) {
|
|
|
6127
6234
|
}
|
|
6128
6235
|
return null;
|
|
6129
6236
|
}
|
|
6130
|
-
function
|
|
6237
|
+
function Fl(t) {
|
|
6131
6238
|
var e;
|
|
6132
6239
|
try {
|
|
6133
6240
|
const l = new URL(t, "http://localhost").pathname.split("/").filter(Boolean).pop();
|
|
@@ -6136,14 +6243,14 @@ function Hl(t) {
|
|
|
6136
6243
|
return (((e = t.split("?")[0]) == null ? void 0 : e.split("#")[0]) ?? "").split("/").filter(Boolean).pop() ?? "";
|
|
6137
6244
|
}
|
|
6138
6245
|
}
|
|
6139
|
-
function
|
|
6246
|
+
function Pl(t) {
|
|
6140
6247
|
return t >= 1e6 ? `${(t / 1e6).toFixed(1)}M` : t >= 1e3 ? `${(t / 1e3).toFixed(1)}K` : `${t}`;
|
|
6141
6248
|
}
|
|
6142
|
-
function
|
|
6249
|
+
function At(t, e, n) {
|
|
6143
6250
|
const o = document.createElement("button");
|
|
6144
6251
|
return o.type = "button", o.className = "aw-status-action", o.title = t, o.setAttribute("aria-label", t), o.innerHTML = e, o.addEventListener("mousedown", (l) => l.preventDefault()), o.addEventListener("click", n), o;
|
|
6145
6252
|
}
|
|
6146
|
-
function
|
|
6253
|
+
function Ol() {
|
|
6147
6254
|
return {
|
|
6148
6255
|
blocks: [],
|
|
6149
6256
|
activeBlockId: null,
|
|
@@ -6157,11 +6264,11 @@ function fe(t) {
|
|
|
6157
6264
|
return !1;
|
|
6158
6265
|
}
|
|
6159
6266
|
}
|
|
6160
|
-
class
|
|
6267
|
+
class pi {
|
|
6161
6268
|
constructor(e) {
|
|
6162
6269
|
b(this, "root");
|
|
6163
6270
|
b(this, "content");
|
|
6164
|
-
b(this, "blockIds", new
|
|
6271
|
+
b(this, "blockIds", new Xt());
|
|
6165
6272
|
b(this, "idFor", (e) => this.blockIds.ensure(e));
|
|
6166
6273
|
/**
|
|
6167
6274
|
* 생성 시 받은 options 객체를 그대로 들고 있는다. `htmlStyles` 를 여기서
|
|
@@ -6182,15 +6289,15 @@ class ai {
|
|
|
6182
6289
|
* 경로를 거치지 않는다.
|
|
6183
6290
|
*/
|
|
6184
6291
|
setBlocks(e) {
|
|
6185
|
-
|
|
6292
|
+
Ko(this.content, e), me(this.content, this.blockIds);
|
|
6186
6293
|
}
|
|
6187
6294
|
/** 현재 본문의 BlockSnapshot 배열을 반환한다. */
|
|
6188
6295
|
getBlocks() {
|
|
6189
|
-
return
|
|
6296
|
+
return Jt(this.listBlocksInternal());
|
|
6190
6297
|
}
|
|
6191
6298
|
/** 임의의 노드를 받아 그 노드가 속한 블록을 반환한다. 본문 밖이면 null. */
|
|
6192
6299
|
getBlockOf(e) {
|
|
6193
|
-
return this.content.contains(e) ?
|
|
6300
|
+
return this.content.contains(e) ? _e(e, this.content, this.idFor) : null;
|
|
6194
6301
|
}
|
|
6195
6302
|
/**
|
|
6196
6303
|
* 본문 HTML 을 반환한다. 전략은 `AerizEditor.getHTML()` 과 동일하다.
|
|
@@ -6202,12 +6309,12 @@ class ai {
|
|
|
6202
6309
|
getHTML(e = {}) {
|
|
6203
6310
|
const n = this.content.cloneNode(!0);
|
|
6204
6311
|
if ((e.styles ?? this.options.htmlStyles ?? "inline") === "class")
|
|
6205
|
-
|
|
6312
|
+
tn(n);
|
|
6206
6313
|
else {
|
|
6207
|
-
const l =
|
|
6208
|
-
(i === "light" || i === "dark") && (l.mode = i),
|
|
6314
|
+
const l = Qt(this.root), i = this.root.dataset.theme;
|
|
6315
|
+
(i === "light" || i === "dark") && (l.mode = i), en(n, l);
|
|
6209
6316
|
}
|
|
6210
|
-
return
|
|
6317
|
+
return nn(n), Xe(n), n.innerHTML;
|
|
6211
6318
|
}
|
|
6212
6319
|
setTheme(e) {
|
|
6213
6320
|
this.root.dataset.theme = e;
|
|
@@ -6216,10 +6323,10 @@ class ai {
|
|
|
6216
6323
|
this.destroyed || (this.destroyed = !0, this.root.remove());
|
|
6217
6324
|
}
|
|
6218
6325
|
listBlocksInternal() {
|
|
6219
|
-
return
|
|
6326
|
+
return Oe(this.content, this.idFor);
|
|
6220
6327
|
}
|
|
6221
6328
|
}
|
|
6222
|
-
const
|
|
6329
|
+
const an = /* @__PURE__ */ new Set([
|
|
6223
6330
|
"area",
|
|
6224
6331
|
"base",
|
|
6225
6332
|
"br",
|
|
@@ -6234,14 +6341,14 @@ const on = /* @__PURE__ */ new Set([
|
|
|
6234
6341
|
"source",
|
|
6235
6342
|
"track",
|
|
6236
6343
|
"wbr"
|
|
6237
|
-
]),
|
|
6344
|
+
]), _l = /* @__PURE__ */ new Set(["script", "style"]), ql = /* @__PURE__ */ new Map([
|
|
6238
6345
|
["li", /* @__PURE__ */ new Set(["li"])],
|
|
6239
6346
|
["p", /* @__PURE__ */ new Set(["p", "div", "ul", "ol", "blockquote", "pre", "table", "h1", "h2", "h3", "h4", "h5", "h6"])],
|
|
6240
6347
|
["td", /* @__PURE__ */ new Set(["td", "th", "tr"])],
|
|
6241
6348
|
["th", /* @__PURE__ */ new Set(["td", "th", "tr"])],
|
|
6242
6349
|
["tr", /* @__PURE__ */ new Set(["tr"])],
|
|
6243
6350
|
["option", /* @__PURE__ */ new Set(["option"])]
|
|
6244
|
-
]),
|
|
6351
|
+
]), Ul = {
|
|
6245
6352
|
amp: "&",
|
|
6246
6353
|
lt: "<",
|
|
6247
6354
|
gt: ">",
|
|
@@ -6272,7 +6379,7 @@ const on = /* @__PURE__ */ new Set([
|
|
|
6272
6379
|
laquo: "«",
|
|
6273
6380
|
raquo: "»"
|
|
6274
6381
|
};
|
|
6275
|
-
function
|
|
6382
|
+
function ee(t) {
|
|
6276
6383
|
return t.includes("&") ? t.replace(
|
|
6277
6384
|
/&(#[Xx][0-9A-Fa-f]+|#\d+|[A-Za-z][A-Za-z0-9]{1,31});/g,
|
|
6278
6385
|
(e, n) => {
|
|
@@ -6285,28 +6392,28 @@ function Q(t) {
|
|
|
6285
6392
|
return e;
|
|
6286
6393
|
}
|
|
6287
6394
|
}
|
|
6288
|
-
return
|
|
6395
|
+
return Ul[n.toLowerCase()] ?? e;
|
|
6289
6396
|
}
|
|
6290
6397
|
) : t;
|
|
6291
6398
|
}
|
|
6292
|
-
function
|
|
6399
|
+
function z(t) {
|
|
6293
6400
|
return t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
6294
6401
|
}
|
|
6295
|
-
function
|
|
6296
|
-
return
|
|
6402
|
+
function T(t) {
|
|
6403
|
+
return z(t).replace(/"/g, """);
|
|
6297
6404
|
}
|
|
6298
|
-
function
|
|
6405
|
+
function jl(t) {
|
|
6299
6406
|
const e = {}, n = /([^\s/=>"']+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;
|
|
6300
6407
|
let o;
|
|
6301
6408
|
for (; (o = n.exec(t)) !== null; ) {
|
|
6302
6409
|
const l = o[1];
|
|
6303
6410
|
if (!l) continue;
|
|
6304
6411
|
const i = o[2] ?? o[3] ?? o[4] ?? "";
|
|
6305
|
-
e[l.toLowerCase()] =
|
|
6412
|
+
e[l.toLowerCase()] = ee(i);
|
|
6306
6413
|
}
|
|
6307
6414
|
return e;
|
|
6308
6415
|
}
|
|
6309
|
-
function
|
|
6416
|
+
function te(t) {
|
|
6310
6417
|
const e = [], n = [], o = () => {
|
|
6311
6418
|
const s = n[n.length - 1];
|
|
6312
6419
|
return s ? s.children : e;
|
|
@@ -6326,10 +6433,10 @@ function ee(t) {
|
|
|
6326
6433
|
for (; r < t.length; ) {
|
|
6327
6434
|
const s = t.indexOf("<", r);
|
|
6328
6435
|
if (s < 0) {
|
|
6329
|
-
l(
|
|
6436
|
+
l(ee(t.slice(r)));
|
|
6330
6437
|
break;
|
|
6331
6438
|
}
|
|
6332
|
-
if (s > r && l(
|
|
6439
|
+
if (s > r && l(ee(t.slice(r, s))), t.startsWith("<!--", s)) {
|
|
6333
6440
|
const y = t.indexOf("-->", s + 4);
|
|
6334
6441
|
r = y < 0 ? t.length : y + 3;
|
|
6335
6442
|
continue;
|
|
@@ -6341,7 +6448,7 @@ function ee(t) {
|
|
|
6341
6448
|
}
|
|
6342
6449
|
const a = t.indexOf(">", s + 1);
|
|
6343
6450
|
if (a < 0) {
|
|
6344
|
-
l(
|
|
6451
|
+
l(ee(t.slice(s)));
|
|
6345
6452
|
break;
|
|
6346
6453
|
}
|
|
6347
6454
|
const c = t.slice(s + 1, a);
|
|
@@ -6352,42 +6459,42 @@ function ee(t) {
|
|
|
6352
6459
|
}
|
|
6353
6460
|
const d = /^([A-Za-z][^\s/>]*)/.exec(c);
|
|
6354
6461
|
if (!d || !d[1]) {
|
|
6355
|
-
l(
|
|
6462
|
+
l(ee(t.slice(s, r)));
|
|
6356
6463
|
continue;
|
|
6357
6464
|
}
|
|
6358
|
-
const u = d[1].toLowerCase(), h = c.slice(d[1].length), m = /\/\s*$/.test(h), f =
|
|
6359
|
-
if (
|
|
6360
|
-
const y = new RegExp(`</${u}\\s*>`, "i"),
|
|
6361
|
-
r =
|
|
6465
|
+
const u = d[1].toLowerCase(), h = c.slice(d[1].length), m = /\/\s*$/.test(h), f = jl(m ? h.replace(/\/\s*$/, "") : h);
|
|
6466
|
+
if (_l.has(u)) {
|
|
6467
|
+
const y = new RegExp(`</${u}\\s*>`, "i"), L = t.slice(r), S = y.exec(L);
|
|
6468
|
+
r = S ? r + S.index + S[0].length : t.length;
|
|
6362
6469
|
continue;
|
|
6363
6470
|
}
|
|
6364
6471
|
const g = n[n.length - 1];
|
|
6365
6472
|
if (g) {
|
|
6366
|
-
const y =
|
|
6473
|
+
const y = ql.get(g.tag);
|
|
6367
6474
|
y != null && y.has(u) && n.pop();
|
|
6368
6475
|
}
|
|
6369
6476
|
const k = { type: "element", tag: u, attrs: f, children: [] };
|
|
6370
|
-
o().push(k), !m && !
|
|
6477
|
+
o().push(k), !m && !an.has(u) && n.push(k);
|
|
6371
6478
|
}
|
|
6372
6479
|
return e;
|
|
6373
6480
|
}
|
|
6374
|
-
function
|
|
6481
|
+
function tt(t) {
|
|
6375
6482
|
let e = "";
|
|
6376
6483
|
for (const n of t) {
|
|
6377
6484
|
if (n.type === "text") {
|
|
6378
|
-
e +=
|
|
6485
|
+
e += z(n.value);
|
|
6379
6486
|
continue;
|
|
6380
6487
|
}
|
|
6381
|
-
const o = Object.entries(n.attrs).map(([l, i]) => i === "" ? ` ${l}` : ` ${l}="${
|
|
6382
|
-
if (
|
|
6488
|
+
const o = Object.entries(n.attrs).map(([l, i]) => i === "" ? ` ${l}` : ` ${l}="${T(i)}"`).join("");
|
|
6489
|
+
if (an.has(n.tag)) {
|
|
6383
6490
|
e += `<${n.tag}${o}>`;
|
|
6384
6491
|
continue;
|
|
6385
6492
|
}
|
|
6386
|
-
e += `<${n.tag}${o}>${
|
|
6493
|
+
e += `<${n.tag}${o}>${tt(n.children)}</${n.tag}>`;
|
|
6387
6494
|
}
|
|
6388
6495
|
return e;
|
|
6389
6496
|
}
|
|
6390
|
-
function
|
|
6497
|
+
function nt(t) {
|
|
6391
6498
|
let e = "";
|
|
6392
6499
|
for (const n of t) {
|
|
6393
6500
|
if (n.type === "text") {
|
|
@@ -6399,11 +6506,11 @@ function Qe(t) {
|
|
|
6399
6506
|
`;
|
|
6400
6507
|
continue;
|
|
6401
6508
|
}
|
|
6402
|
-
e +=
|
|
6509
|
+
e += nt(n.children);
|
|
6403
6510
|
}
|
|
6404
6511
|
return e;
|
|
6405
6512
|
}
|
|
6406
|
-
const
|
|
6513
|
+
const Wl = /* @__PURE__ */ new Set([
|
|
6407
6514
|
"address",
|
|
6408
6515
|
"article",
|
|
6409
6516
|
"aside",
|
|
@@ -6453,7 +6560,7 @@ function ve(t) {
|
|
|
6453
6560
|
`;
|
|
6454
6561
|
continue;
|
|
6455
6562
|
}
|
|
6456
|
-
const o =
|
|
6563
|
+
const o = Wl.has(n.tag);
|
|
6457
6564
|
o && e !== "" && !e.endsWith(`
|
|
6458
6565
|
`) && (e += `
|
|
6459
6566
|
`), e += ve(n.children), o && !e.endsWith(`
|
|
@@ -6467,28 +6574,28 @@ function Ce(t, e) {
|
|
|
6467
6574
|
(n) => n.type === "element" && n.tag === e
|
|
6468
6575
|
);
|
|
6469
6576
|
}
|
|
6470
|
-
function
|
|
6471
|
-
const n = e.blockIds !== !1, o =
|
|
6577
|
+
function hi(t, e = {}) {
|
|
6578
|
+
const n = e.blockIds !== !1, o = Ee(t).map((i) => cn(i, { blockIds: n })).join("");
|
|
6472
6579
|
return e.wrapper !== "content" ? o : `<div class="aeriz-wysiwyg aeriz-wysiwyg-viewer"${e.theme ? ` data-theme="${e.theme}"` : ""}><div class="aw-content-wrap"><div class="aw-content">${o}</div></div></div>`;
|
|
6473
6580
|
}
|
|
6474
|
-
function
|
|
6475
|
-
return
|
|
6581
|
+
function fi(t, e = {}) {
|
|
6582
|
+
return cn(Yt(t), e);
|
|
6476
6583
|
}
|
|
6477
|
-
function
|
|
6478
|
-
const n = e.blockIds === !1 ? "" : ` ${G}="${
|
|
6584
|
+
function cn(t, e = {}) {
|
|
6585
|
+
const n = e.blockIds === !1 ? "" : ` ${G}="${T(t.id)}"`, o = Gl(t.html), l = (t.style ? ` style="${T(t.style)}"` : "") + Kl(t.attributes), i = (r) => {
|
|
6479
6586
|
var a;
|
|
6480
|
-
const s =
|
|
6481
|
-
return s ? ` class="${
|
|
6587
|
+
const s = Wt(r, (a = t.attributes) == null ? void 0 : a.class);
|
|
6588
|
+
return s ? ` class="${T(s)}"` : "";
|
|
6482
6589
|
};
|
|
6483
6590
|
switch (t.kind) {
|
|
6484
6591
|
case "paragraph":
|
|
6485
6592
|
return `<p${n}${l}>${o || "<br>"}</p>`;
|
|
6486
6593
|
case "unknown": {
|
|
6487
|
-
const r =
|
|
6594
|
+
const r = jt(t.attrs.tag);
|
|
6488
6595
|
return `<${r}${n}${l}>${o || "<br>"}</${r}>`;
|
|
6489
6596
|
}
|
|
6490
6597
|
case "heading": {
|
|
6491
|
-
const r =
|
|
6598
|
+
const r = Zl(t.attrs.level);
|
|
6492
6599
|
return `<h${r}${n}${l}>${o || "<br>"}</h${r}>`;
|
|
6493
6600
|
}
|
|
6494
6601
|
case "bulletList":
|
|
@@ -6501,106 +6608,106 @@ function ln(t, e = {}) {
|
|
|
6501
6608
|
return `<blockquote${n}${l}>${o || "<p><br></p>"}</blockquote>`;
|
|
6502
6609
|
case "codeBlock": {
|
|
6503
6610
|
if (o) return `<pre${n}${l}>${o}</pre>`;
|
|
6504
|
-
const r = t.attrs.language, s = r ? ` data-language="${
|
|
6611
|
+
const r = t.attrs.language, s = r ? ` data-language="${T(r)}"` : "";
|
|
6505
6612
|
return `<pre${n}${l}><code${s}></code></pre>`;
|
|
6506
6613
|
}
|
|
6507
6614
|
case "table":
|
|
6508
|
-
return `<table${n}${l}>${o ||
|
|
6615
|
+
return `<table${n}${l}>${o || Xl(t.attrs.rows, t.attrs.cols)}</table>`;
|
|
6509
6616
|
case "hr":
|
|
6510
6617
|
return `<hr${n}${l}>`;
|
|
6511
6618
|
case "image":
|
|
6512
|
-
return o ? `<figure${n}${l}>${Le(o)}</figure>` :
|
|
6619
|
+
return o ? `<figure${n}${l}>${Le(o)}</figure>` : Jl(t.attrs, n, l);
|
|
6513
6620
|
case "youtube": {
|
|
6514
6621
|
if (!o)
|
|
6515
|
-
return
|
|
6516
|
-
const r =
|
|
6622
|
+
return Ql(t.attrs, n, l, i);
|
|
6623
|
+
const r = Ye(t.attrs.videoId), s = r ? ` data-youtube-id="${T(r)}"` : "";
|
|
6517
6624
|
return `<div${i("aw-youtube-embed")}${s}${n}${l}>${Le(o)}</div>`;
|
|
6518
6625
|
}
|
|
6519
6626
|
case "linkCard":
|
|
6520
|
-
return
|
|
6627
|
+
return ei(t.attrs, n, l, o, i);
|
|
6521
6628
|
case "file":
|
|
6522
|
-
return
|
|
6629
|
+
return ti(t.attrs, n, l, o, i);
|
|
6523
6630
|
case "importedHtml": {
|
|
6524
|
-
const r = t.attrs.importedStyle, s = t.style ? l : r ? ` style="${
|
|
6631
|
+
const r = t.attrs.importedStyle, s = t.style ? l : r ? ` style="${T(r)}"` : "";
|
|
6525
6632
|
return `<div data-imported-html="true"${i(t.attrs.importedClass)}${s}${n}>${o}</div>`;
|
|
6526
6633
|
}
|
|
6527
6634
|
default:
|
|
6528
6635
|
return "";
|
|
6529
6636
|
}
|
|
6530
6637
|
}
|
|
6531
|
-
function
|
|
6638
|
+
function Kl(t) {
|
|
6532
6639
|
if (!t) return "";
|
|
6533
6640
|
let e = "";
|
|
6534
|
-
for (const n of
|
|
6641
|
+
for (const n of Ge) {
|
|
6535
6642
|
if (n === "class") continue;
|
|
6536
6643
|
const o = t[n];
|
|
6537
|
-
o === void 0 || o === "" || (e += ` ${n}="${
|
|
6644
|
+
o === void 0 || o === "" || (e += ` ${n}="${T(o)}"`);
|
|
6538
6645
|
}
|
|
6539
6646
|
return e;
|
|
6540
6647
|
}
|
|
6541
|
-
const
|
|
6542
|
-
function
|
|
6543
|
-
return !t || !
|
|
6648
|
+
const Tt = /\s(href|src)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi;
|
|
6649
|
+
function Gl(t) {
|
|
6650
|
+
return !t || !Vl(t) && !Yl.test(t) ? t : tt(te(t).map(dn));
|
|
6544
6651
|
}
|
|
6545
|
-
const
|
|
6546
|
-
function
|
|
6547
|
-
|
|
6652
|
+
const Yl = /<iframe[\s>]/i;
|
|
6653
|
+
function Vl(t) {
|
|
6654
|
+
Tt.lastIndex = 0;
|
|
6548
6655
|
let e;
|
|
6549
|
-
for (; (e =
|
|
6550
|
-
const n = (e[1] ?? "").toLowerCase(), o =
|
|
6551
|
-
if (!(n === "href" ? q(o) :
|
|
6656
|
+
for (; (e = Tt.exec(t)) !== null; ) {
|
|
6657
|
+
const n = (e[1] ?? "").toLowerCase(), o = ee(e[2] ?? e[3] ?? e[4] ?? "");
|
|
6658
|
+
if (!(n === "href" ? q(o) : R(o))) return !0;
|
|
6552
6659
|
}
|
|
6553
6660
|
return !1;
|
|
6554
6661
|
}
|
|
6555
|
-
function
|
|
6662
|
+
function dn(t) {
|
|
6556
6663
|
if (t.type !== "element") return t;
|
|
6557
6664
|
const e = t.tag === "iframe", n = {};
|
|
6558
6665
|
for (const [o, l] of Object.entries(t.attrs))
|
|
6559
|
-
o === "href" && !q(l) || o === "src" && !(e ? l.startsWith(ae) :
|
|
6560
|
-
return { ...t, attrs: n, children: t.children.map(
|
|
6666
|
+
o === "href" && !q(l) || o === "src" && !(e ? l.startsWith(ae) : R(l)) || (n[o] = l);
|
|
6667
|
+
return { ...t, attrs: n, children: t.children.map(dn) };
|
|
6561
6668
|
}
|
|
6562
|
-
const
|
|
6669
|
+
const St = /aw-block-align-controls|aw-resize-handle/;
|
|
6563
6670
|
function Le(t) {
|
|
6564
|
-
if (!
|
|
6565
|
-
const e =
|
|
6566
|
-
(n) => !(n.type === "element" &&
|
|
6671
|
+
if (!St.test(t)) return t;
|
|
6672
|
+
const e = te(t).filter(
|
|
6673
|
+
(n) => !(n.type === "element" && St.test(n.attrs.class ?? ""))
|
|
6567
6674
|
);
|
|
6568
|
-
return
|
|
6675
|
+
return tt(e);
|
|
6569
6676
|
}
|
|
6570
|
-
function
|
|
6677
|
+
function Zl(t) {
|
|
6571
6678
|
return t === void 0 || t < 1 ? 1 : t > 6 ? 6 : t;
|
|
6572
6679
|
}
|
|
6573
|
-
function
|
|
6680
|
+
function Xl(t, e) {
|
|
6574
6681
|
const n = Math.max(1, Number.isFinite(t) ? t : 1), o = Math.max(1, Number.isFinite(e) ? e : 1);
|
|
6575
6682
|
return `<tbody>${`<tr>${"<td><br></td>".repeat(o)}</tr>`.repeat(n)}</tbody>`;
|
|
6576
6683
|
}
|
|
6577
|
-
function
|
|
6578
|
-
const o = n || (t.wrapperStyle ? ` style="${
|
|
6684
|
+
function Jl(t, e, n) {
|
|
6685
|
+
const o = n || (t.wrapperStyle ? ` style="${T(t.wrapperStyle)}"` : ""), l = R(t.src), i = l ? ` src="${T(l)}"` : "", r = ` alt="${T(t.alt ?? "")}"`, s = t.caption ? `<figcaption>${z(t.caption)}</figcaption>` : "";
|
|
6579
6686
|
return `<figure${e}${o}><img${i}${r}>${s}</figure>`;
|
|
6580
6687
|
}
|
|
6581
|
-
function
|
|
6582
|
-
const l =
|
|
6583
|
-
return `<div${o("aw-youtube-embed")}${r}${e}${i}><iframe${s} allow="${
|
|
6688
|
+
function Ql(t, e, n, o) {
|
|
6689
|
+
const l = Ye(t.videoId), i = n || (t.wrapperStyle ? ` style="${T(t.wrapperStyle)}"` : ""), r = l ? ` data-youtube-id="${T(l)}"` : "", s = l ? ` src="${T(`${ae}${l}`)}"` : "";
|
|
6690
|
+
return `<div${o("aw-youtube-embed")}${r}${e}${i}><iframe${s} allow="${T(qt)}" allowfullscreen frameborder="0" referrerpolicy="strict-origin-when-cross-origin"></iframe></div>`;
|
|
6584
6691
|
}
|
|
6585
|
-
function
|
|
6586
|
-
const i = q(t.href) || "#", r = t.text && t.text.length > 0 ? t.text :
|
|
6692
|
+
function ei(t, e, n, o, l) {
|
|
6693
|
+
const i = q(t.href) || "#", r = t.text && t.text.length > 0 ? t.text : We(i) || i, s = t.description ?? "", a = R(t.image), c = t.favicon ? R(t.favicon) : Pt(i), u = `<a${l(a ? "aw-link-card aw-link-card-with-image" : "aw-link-card")} href="${T(i)}" target="_blank" rel="noopener"${e}${n}>`;
|
|
6587
6694
|
if (o) return `${u}${Le(o)}</a>`;
|
|
6588
6695
|
let h = u;
|
|
6589
|
-
return a && (h += `<img class="aw-link-card-image" src="${
|
|
6696
|
+
return a && (h += `<img class="aw-link-card-image" src="${T(a)}" alt="" loading="lazy">`), h += '<span class="aw-link-card-body">', h += `<span class="aw-link-card-title">${z(r)}</span>`, s && (h += `<span class="aw-link-card-desc">${z(s)}</span>`), h += '<span class="aw-link-card-url">', c && (h += `<img class="aw-link-card-favicon" src="${T(c)}" alt="" loading="lazy">`), h += `<span class="aw-link-card-url-text">${z(i)}</span>`, h += "</span></span></a>", h;
|
|
6590
6697
|
}
|
|
6591
|
-
function
|
|
6592
|
-
const i = q(t.fileSrc), r = i ? ` href="${
|
|
6593
|
-
h && u.push(h), t.fileSize !== void 0 && u.push(
|
|
6698
|
+
function ti(t, e, n, o, l) {
|
|
6699
|
+
const i = q(t.fileSrc), r = i ? ` href="${T(i)}"` : "", s = t.fileName ? ` data-file-name="${T(t.fileName)}"` : "", a = t.fileSize !== void 0 ? ` data-file-size="${T(String(t.fileSize))}"` : "", c = t.fileType ? ` data-file-type="${T(t.fileType)}"` : "", d = ` download="${T(t.fileName ?? "")}"`, u = [], h = Ft(t.fileName, t.fileType);
|
|
6700
|
+
h && u.push(h), t.fileSize !== void 0 && u.push(zt(t.fileSize));
|
|
6594
6701
|
const m = `<a${l("aw-file-attachment")} target="_blank" rel="noopener"${r}${d}${s}${a}${c}${e}${n}>`;
|
|
6595
6702
|
if (o) return `${m}${Le(o)}</a>`;
|
|
6596
6703
|
let f = m;
|
|
6597
|
-
return f += `<span class="aw-file-icon" aria-hidden="true">${
|
|
6704
|
+
return f += `<span class="aw-file-icon" aria-hidden="true">${Ot}</span>`, f += '<span class="aw-file-meta">', f += `<span class="aw-file-name">${z(t.fileName ?? Ut)}</span>`, u.length > 0 && (f += `<span class="aw-file-info">${z(u.join(" · "))}</span>`), f += "</span>", f += `<span class="aw-file-action" aria-hidden="true">${_t}</span>`, f += "</a>", f;
|
|
6598
6705
|
}
|
|
6599
|
-
const
|
|
6600
|
-
function
|
|
6706
|
+
const ni = /([\\`*_[\]<])/g, oi = /^([#>|+-]|\d+\.)/;
|
|
6707
|
+
function mi(t, e = {}) {
|
|
6601
6708
|
const n = e.bullet ?? "-", o = e.gfmTables !== !1, l = [];
|
|
6602
|
-
for (const i of
|
|
6603
|
-
const r =
|
|
6709
|
+
for (const i of Ee(t)) {
|
|
6710
|
+
const r = li(i, n, o);
|
|
6604
6711
|
r !== "" && l.push(r);
|
|
6605
6712
|
}
|
|
6606
6713
|
return l.length > 0 ? `${l.join(`
|
|
@@ -6608,14 +6715,14 @@ function ui(t, e = {}) {
|
|
|
6608
6715
|
`)}
|
|
6609
6716
|
` : "";
|
|
6610
6717
|
}
|
|
6611
|
-
function
|
|
6718
|
+
function li(t, e, n) {
|
|
6612
6719
|
var l, i, r, s;
|
|
6613
|
-
const o =
|
|
6720
|
+
const o = te(t.html);
|
|
6614
6721
|
switch (t.kind) {
|
|
6615
6722
|
case "paragraph":
|
|
6616
6723
|
case "unknown": {
|
|
6617
6724
|
const a = K(o).trim();
|
|
6618
|
-
return a === "" ? "" :
|
|
6725
|
+
return a === "" ? "" : $t(a);
|
|
6619
6726
|
}
|
|
6620
6727
|
case "heading": {
|
|
6621
6728
|
const a = Math.min(6, Math.max(1, t.attrs.level ?? 1)), c = K(o).trim();
|
|
@@ -6641,7 +6748,7 @@ function Ql(t, e, n) {
|
|
|
6641
6748
|
`) : "";
|
|
6642
6749
|
}
|
|
6643
6750
|
case "codeBlock": {
|
|
6644
|
-
const a = Ce(o, "code")[0], c =
|
|
6751
|
+
const a = Ce(o, "code")[0], c = nt(a ? a.children : o).replace(/\n$/, ""), d = t.attrs.language ?? (a == null ? void 0 : a.attrs["data-language"]) ?? "", u = "`".repeat(Math.max(3, un(c) + 1));
|
|
6645
6752
|
return `${u}${d}
|
|
6646
6753
|
${c}
|
|
6647
6754
|
${u}`;
|
|
@@ -6654,7 +6761,7 @@ ${u}`;
|
|
|
6654
6761
|
*${j(d)}*` : c;
|
|
6655
6762
|
}
|
|
6656
6763
|
case "table":
|
|
6657
|
-
return n ?
|
|
6764
|
+
return n ? ii(o) : `<table>${t.html}</table>`;
|
|
6658
6765
|
case "hr":
|
|
6659
6766
|
return "---";
|
|
6660
6767
|
case "linkCard": {
|
|
@@ -6663,7 +6770,7 @@ ${u}`;
|
|
|
6663
6770
|
const c = ((i = t.attrs.text) == null ? void 0 : i.trim()) || a, d = `[${j(c)}](${se(a)})`, u = (r = t.attrs.description) == null ? void 0 : r.trim();
|
|
6664
6771
|
return u ? `${d}
|
|
6665
6772
|
|
|
6666
|
-
${
|
|
6773
|
+
${$t(j(u))}` : d;
|
|
6667
6774
|
}
|
|
6668
6775
|
case "youtube": {
|
|
6669
6776
|
const a = t.attrs.videoId;
|
|
@@ -6704,7 +6811,7 @@ ${h}`);
|
|
|
6704
6811
|
}), l.join(`
|
|
6705
6812
|
`);
|
|
6706
6813
|
}
|
|
6707
|
-
function
|
|
6814
|
+
function ii(t) {
|
|
6708
6815
|
const e = [], n = (d) => {
|
|
6709
6816
|
for (const u of d)
|
|
6710
6817
|
if (u.type === "element") {
|
|
@@ -6719,7 +6826,7 @@ function ei(t) {
|
|
|
6719
6826
|
const o = e.map(
|
|
6720
6827
|
(d) => d.children.filter(
|
|
6721
6828
|
(u) => u.type === "element" && (u.tag === "td" || u.tag === "th")
|
|
6722
|
-
).map((u) =>
|
|
6829
|
+
).map((u) => ri(u.children))
|
|
6723
6830
|
), l = o.reduce((d, u) => Math.max(d, u.length), 0);
|
|
6724
6831
|
if (l === 0) return "";
|
|
6725
6832
|
const i = (d) => d.length === l ? d : [...d, ...Array(l - d.length).fill("")], [r, ...s] = o.map(i);
|
|
@@ -6730,7 +6837,7 @@ function ei(t) {
|
|
|
6730
6837
|
].join(`
|
|
6731
6838
|
`);
|
|
6732
6839
|
}
|
|
6733
|
-
function
|
|
6840
|
+
function ri(t) {
|
|
6734
6841
|
return K(t, { inTableCell: !0 }).replace(/\n+/g, "<br>").replace(/\|/g, "\\|").trim();
|
|
6735
6842
|
}
|
|
6736
6843
|
function K(t, e = {}) {
|
|
@@ -6767,7 +6874,7 @@ function K(t, e = {}) {
|
|
|
6767
6874
|
break;
|
|
6768
6875
|
}
|
|
6769
6876
|
case "code": {
|
|
6770
|
-
const i =
|
|
6877
|
+
const i = nt(o.children), r = "`".repeat(un(i) + 1), s = i.startsWith("`") || i.endsWith("`") ? " " : "";
|
|
6771
6878
|
n += `${r}${s}${i}${s}${r}`;
|
|
6772
6879
|
break;
|
|
6773
6880
|
}
|
|
@@ -6795,12 +6902,12 @@ function K(t, e = {}) {
|
|
|
6795
6902
|
return n;
|
|
6796
6903
|
}
|
|
6797
6904
|
function j(t) {
|
|
6798
|
-
return t.replace(
|
|
6905
|
+
return t.replace(ni, "\\$1");
|
|
6799
6906
|
}
|
|
6800
|
-
function
|
|
6801
|
-
return t.replace(
|
|
6907
|
+
function $t(t) {
|
|
6908
|
+
return t.replace(oi, "\\$1");
|
|
6802
6909
|
}
|
|
6803
|
-
function
|
|
6910
|
+
function un(t) {
|
|
6804
6911
|
let e = 0, n = 0;
|
|
6805
6912
|
for (const o of t)
|
|
6806
6913
|
o === "`" ? (n += 1, n > e && (e = n)) : n = 0;
|
|
@@ -6810,42 +6917,42 @@ function se(t) {
|
|
|
6810
6917
|
const e = t.trim();
|
|
6811
6918
|
return /[\s()]/.test(e) ? `<${e.replace(/[<>]/g, "")}>` : e;
|
|
6812
6919
|
}
|
|
6813
|
-
function
|
|
6920
|
+
function gi(t, e = {}) {
|
|
6814
6921
|
const n = e.blockSeparator ?? `
|
|
6815
6922
|
|
|
6816
6923
|
`, o = e.cellSeparator ?? " ", l = [];
|
|
6817
|
-
for (const i of
|
|
6818
|
-
const r =
|
|
6924
|
+
for (const i of Ee(t)) {
|
|
6925
|
+
const r = si(i, o);
|
|
6819
6926
|
r !== "" && l.push(r);
|
|
6820
6927
|
}
|
|
6821
6928
|
return l.join(n);
|
|
6822
6929
|
}
|
|
6823
|
-
function
|
|
6930
|
+
function si(t, e) {
|
|
6824
6931
|
switch (t.kind) {
|
|
6825
6932
|
case "hr":
|
|
6826
6933
|
case "youtube":
|
|
6827
6934
|
return "";
|
|
6828
6935
|
case "image":
|
|
6829
|
-
return
|
|
6936
|
+
return Q(
|
|
6830
6937
|
[t.attrs.alt, t.attrs.caption].filter(Boolean).join(`
|
|
6831
6938
|
`)
|
|
6832
6939
|
);
|
|
6833
6940
|
case "linkCard":
|
|
6834
|
-
return
|
|
6941
|
+
return Q(t.attrs.text ?? t.attrs.href ?? "");
|
|
6835
6942
|
case "file":
|
|
6836
|
-
return
|
|
6943
|
+
return Q(t.attrs.fileName ?? "");
|
|
6837
6944
|
case "bulletList":
|
|
6838
6945
|
case "orderedList":
|
|
6839
6946
|
case "taskList":
|
|
6840
|
-
return Ce(
|
|
6947
|
+
return Ce(te(t.html), "li").map((o) => Q(ve(o.children))).filter((o) => o !== "").join(`
|
|
6841
6948
|
`);
|
|
6842
6949
|
case "table":
|
|
6843
|
-
return
|
|
6950
|
+
return ai(te(t.html), e);
|
|
6844
6951
|
default:
|
|
6845
|
-
return
|
|
6952
|
+
return Q(ve(te(t.html)));
|
|
6846
6953
|
}
|
|
6847
6954
|
}
|
|
6848
|
-
function
|
|
6955
|
+
function ai(t, e) {
|
|
6849
6956
|
const n = [], o = (l) => {
|
|
6850
6957
|
for (const i of l)
|
|
6851
6958
|
i.type === "element" && (i.tag === "tr" ? n.push(i) : ["tbody", "thead", "tfoot"].includes(i.tag) && o(i.children));
|
|
@@ -6853,67 +6960,67 @@ function oi(t, e) {
|
|
|
6853
6960
|
return o(t), n.map(
|
|
6854
6961
|
(l) => l.children.filter(
|
|
6855
6962
|
(i) => i.type === "element" && (i.tag === "td" || i.tag === "th")
|
|
6856
|
-
).map((i) =>
|
|
6857
|
-
).filter((l) => l.replace(new RegExp(
|
|
6963
|
+
).map((i) => Q(ve(i.children)).replace(/\n+/g, " ")).join(e)
|
|
6964
|
+
).filter((l) => l.replace(new RegExp(ci(e), "g"), "").trim() !== "").join(`
|
|
6858
6965
|
`);
|
|
6859
6966
|
}
|
|
6860
|
-
function
|
|
6861
|
-
return t.replace(
|
|
6967
|
+
function Q(t) {
|
|
6968
|
+
return t.replace(Ke, "").split(`
|
|
6862
6969
|
`).map((e) => e.replace(/[^\S\n]+/g, " ").trim()).join(`
|
|
6863
6970
|
`).replace(/\n{3,}/g, `
|
|
6864
6971
|
|
|
6865
6972
|
`).trim();
|
|
6866
6973
|
}
|
|
6867
|
-
function
|
|
6974
|
+
function ci(t) {
|
|
6868
6975
|
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
6869
6976
|
}
|
|
6870
6977
|
typeof globalThis.AerizWysiwyg == "object" && (globalThis.AerizEditor = globalThis.AerizWysiwyg.AerizEditor, globalThis.AerizViewer = globalThis.AerizWysiwyg.AerizViewer);
|
|
6871
6978
|
export {
|
|
6872
|
-
|
|
6979
|
+
qe as ALIGN_CLASS_BY_VALUE,
|
|
6873
6980
|
ce as ALL_INLINE_MARKS,
|
|
6874
|
-
|
|
6875
|
-
|
|
6981
|
+
xt as AerizEditor,
|
|
6982
|
+
pi as AerizViewer,
|
|
6876
6983
|
G as BLOCK_ID_ATTR,
|
|
6877
|
-
|
|
6984
|
+
Zt as BLOCK_TYPES,
|
|
6878
6985
|
Z as BLOCK_TYPE_BY_KIND,
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6986
|
+
Xt as BlockIdRegistry,
|
|
6987
|
+
fn as DEFAULT_TOOLBAR,
|
|
6988
|
+
bo as SNAPSHOT_VERSION,
|
|
6989
|
+
tn as applyBlockClassNames,
|
|
6990
|
+
en as applyBlockInlineStyles,
|
|
6884
6991
|
me as assignMissingIds,
|
|
6885
|
-
|
|
6886
|
-
|
|
6992
|
+
mi as blocksToMarkdown,
|
|
6993
|
+
gi as blocksToPlainText,
|
|
6887
6994
|
Y as classifyBlockElement,
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6995
|
+
ee as decodeEntities,
|
|
6996
|
+
T as escapeAttr,
|
|
6997
|
+
z as escapeHtml,
|
|
6998
|
+
Go as extractInlineContent,
|
|
6999
|
+
Yo as fillInlineContent,
|
|
7000
|
+
_e as findBlockFrom,
|
|
7001
|
+
_o as getBlockLabel,
|
|
7002
|
+
ui as getLocale,
|
|
6896
7003
|
U as isElementBlank,
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
7004
|
+
Oe as listBlocks,
|
|
7005
|
+
Be as normalizeContent,
|
|
7006
|
+
te as parseHtmlFragment,
|
|
6900
7007
|
M as placeCaretAtStart,
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
7008
|
+
Qt as readBlockStyleTheme,
|
|
7009
|
+
Wo as renderBlock,
|
|
7010
|
+
fi as renderBlockToHTML,
|
|
7011
|
+
Ko as renderBlocks,
|
|
7012
|
+
hi as renderBlocksToHTML,
|
|
7013
|
+
tl as restoreAlignFromClasses,
|
|
7014
|
+
qo as serializeBlock,
|
|
7015
|
+
Jt as serializeBlocks,
|
|
7016
|
+
tt as serializeNodes,
|
|
7017
|
+
kn as setLocale,
|
|
7018
|
+
yo as snapshotVersionOf,
|
|
7019
|
+
nn as stripEditorOnlyAttrs,
|
|
7020
|
+
Xe as stripEditorOnlyNodes,
|
|
6914
7021
|
p as t,
|
|
6915
|
-
|
|
7022
|
+
nt as textOf,
|
|
6916
7023
|
ve as textWithBlockBreaks,
|
|
6917
|
-
|
|
6918
|
-
|
|
7024
|
+
Yt as upgradeSnapshot,
|
|
7025
|
+
Ee as upgradeSnapshots
|
|
6919
7026
|
};
|