@aeriz/wysiwyg 1.0.1 → 1.0.2
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 +1 -1
- package/dist/aeriz-wysiwyg.esm.js +24 -4
- package/dist/aeriz-wysiwyg.esm.min.js +273 -258
- package/dist/aeriz-wysiwyg.js +24 -4
- package/dist/aeriz-wysiwyg.min.js +11 -11
- package/dist-types/core/blocks.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var w = (n, e, t) =>
|
|
4
|
-
const
|
|
1
|
+
var Ke = Object.defineProperty;
|
|
2
|
+
var Ve = (n, e, t) => e in n ? Ke(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var w = (n, e, t) => Ve(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
const Ye = {
|
|
5
5
|
items: [
|
|
6
6
|
// undo / redo 는 브라우저 네이티브 (Ctrl+Z / Ctrl+Y) 가 처리하므로 기본
|
|
7
7
|
// 툴바에서 제외. ToolbarItemName 멤버는 유지 — 커스텀 toolbar 에서
|
|
@@ -70,7 +70,7 @@ const Ve = {
|
|
|
70
70
|
cellBg: '<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="12" x2="21" y2="12"/><line x1="12" y1="3" x2="12" y2="21"/><rect x="3" y="3" width="9" height="9" fill="currentColor" opacity="0.35" stroke="none"/></svg>',
|
|
71
71
|
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>',
|
|
72
72
|
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>'
|
|
73
|
-
},
|
|
73
|
+
}, Ge = {
|
|
74
74
|
undo: { name: "undo", label: "되돌리기", icon: "undo", shortcut: "Ctrl+Z" },
|
|
75
75
|
redo: { name: "redo", label: "다시 실행", icon: "redo", shortcut: "Ctrl+Y" },
|
|
76
76
|
blockType: { name: "blockType", label: "블록 유형", icon: "blockType", hasDropdown: !0 },
|
|
@@ -96,7 +96,7 @@ const Ve = {
|
|
|
96
96
|
hr: { name: "hr", label: "구분선", icon: "hr" },
|
|
97
97
|
clearFormat: { name: "clearFormat", label: "서식 지우기", icon: "clearFormat", shortcut: "Ctrl+\\" }
|
|
98
98
|
};
|
|
99
|
-
class
|
|
99
|
+
class Ze {
|
|
100
100
|
constructor(e, t) {
|
|
101
101
|
w(this, "element");
|
|
102
102
|
w(this, "buttons", /* @__PURE__ */ new Map());
|
|
@@ -108,7 +108,7 @@ class Ge {
|
|
|
108
108
|
o = this.createGroup(), this.element.appendChild(o);
|
|
109
109
|
continue;
|
|
110
110
|
}
|
|
111
|
-
const i =
|
|
111
|
+
const i = Ge[l];
|
|
112
112
|
if (!i) continue;
|
|
113
113
|
const r = this.createButton(i, t);
|
|
114
114
|
this.buttons.set(i.name, r), o.appendChild(r);
|
|
@@ -188,7 +188,7 @@ function R(n, e) {
|
|
|
188
188
|
const o = document.createElement("label");
|
|
189
189
|
return o.className = "aw-field-label", o.textContent = n, t.appendChild(o), t.appendChild(e), t;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function Xe(n = {}, e) {
|
|
192
192
|
return new Promise((t) => {
|
|
193
193
|
const { overlay: o, body: l, footer: i, close: r } = P("링크 삽입", e), s = document.createElement("input");
|
|
194
194
|
s.type = "text", s.className = "aw-input", s.placeholder = "링크에 표시할 텍스트", s.value = n.text ?? "";
|
|
@@ -215,7 +215,7 @@ function Ze(n = {}, e) {
|
|
|
215
215
|
}), document.body.appendChild(o), setTimeout(() => a.focus(), 0);
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function Qe(n = {}, e) {
|
|
219
219
|
return new Promise((t) => {
|
|
220
220
|
const { overlay: o, body: l, footer: i, close: r } = P("이미지", e), s = document.createElement("div");
|
|
221
221
|
s.className = "aw-tabs";
|
|
@@ -293,7 +293,7 @@ function me(n) {
|
|
|
293
293
|
const t = document.createElement("input");
|
|
294
294
|
return t.type = "file", t.accept = "image/*", t.style.display = "none", e.appendChild(t), { dropzone: e, input: t };
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function Je(n) {
|
|
297
297
|
return new Promise((e) => {
|
|
298
298
|
const { overlay: t, body: o, footer: l, close: i } = P("HTML", n), r = document.createElement("input");
|
|
299
299
|
r.type = "file", r.accept = ".html,.htm,text/html", r.style.display = "none";
|
|
@@ -344,7 +344,7 @@ function Qe(n) {
|
|
|
344
344
|
}), document.body.appendChild(t);
|
|
345
345
|
});
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function et(n) {
|
|
348
348
|
return new Promise((e) => {
|
|
349
349
|
const { overlay: t, body: o, footer: l, close: i } = P("Markdown", n), r = document.createElement("input");
|
|
350
350
|
r.type = "file", r.accept = ".md,.markdown,text/markdown,text/plain", r.style.display = "none";
|
|
@@ -395,7 +395,7 @@ function Je(n) {
|
|
|
395
395
|
}), document.body.appendChild(t);
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function tt(n = {}, e) {
|
|
399
399
|
return new Promise((t) => {
|
|
400
400
|
const { overlay: o, body: l, footer: i, close: r } = P("파일 첨부", e), s = document.createElement("div");
|
|
401
401
|
s.className = "aw-tabs";
|
|
@@ -478,7 +478,7 @@ function et(n = {}, e) {
|
|
|
478
478
|
}), document.body.appendChild(o);
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function nt(n) {
|
|
482
482
|
return new Promise((e) => {
|
|
483
483
|
const { overlay: t, body: o, footer: l, close: i } = P("유튜브 임베드", n), r = document.createElement("input");
|
|
484
484
|
r.type = "url", r.className = "aw-input", r.placeholder = "https://www.youtube.com/watch?v=…", o.appendChild(R("YouTube URL", r));
|
|
@@ -494,9 +494,9 @@ function tt(n) {
|
|
|
494
494
|
}), document.body.appendChild(t), setTimeout(() => r.focus(), 0);
|
|
495
495
|
});
|
|
496
496
|
}
|
|
497
|
-
const
|
|
497
|
+
const ot = "system", W = [
|
|
498
498
|
{
|
|
499
|
-
id:
|
|
499
|
+
id: ot,
|
|
500
500
|
label: "시스템 기본",
|
|
501
501
|
stack: '-apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif'
|
|
502
502
|
},
|
|
@@ -554,7 +554,7 @@ const nt = "system", W = [
|
|
|
554
554
|
for (const e of W) n[e.id] = e;
|
|
555
555
|
return n;
|
|
556
556
|
})();
|
|
557
|
-
const
|
|
557
|
+
const lt = [
|
|
558
558
|
12,
|
|
559
559
|
13,
|
|
560
560
|
14,
|
|
@@ -568,7 +568,7 @@ const ot = [
|
|
|
568
568
|
40,
|
|
569
569
|
48
|
|
570
570
|
];
|
|
571
|
-
function
|
|
571
|
+
function it(n) {
|
|
572
572
|
if (!n) return null;
|
|
573
573
|
const e = n.trim(), t = /^(\d+(?:\.\d+)?)px$/i.exec(e);
|
|
574
574
|
if (t && t[1]) return Math.round(Number(t[1]));
|
|
@@ -576,7 +576,7 @@ function lt(n) {
|
|
|
576
576
|
return o && o[1] ? Math.round(Number(o[1]) * 16) : null;
|
|
577
577
|
}
|
|
578
578
|
let fe = !1;
|
|
579
|
-
function
|
|
579
|
+
function rt() {
|
|
580
580
|
if (fe || (fe = !0, typeof document > "u")) return;
|
|
581
581
|
const n = W.map((e) => e.googleFonts).filter((e) => typeof e == "string" && e.length > 0);
|
|
582
582
|
if (n.length > 0) {
|
|
@@ -593,7 +593,7 @@ function ge(n) {
|
|
|
593
593
|
const t = document.createElement("link");
|
|
594
594
|
t.rel = "stylesheet", t.href = n, document.head.appendChild(t);
|
|
595
595
|
}
|
|
596
|
-
function
|
|
596
|
+
function st(n) {
|
|
597
597
|
var o;
|
|
598
598
|
if (!n) return null;
|
|
599
599
|
const e = be(n);
|
|
@@ -614,7 +614,7 @@ const B = {
|
|
|
614
614
|
lineComment: "//",
|
|
615
615
|
blockComment: { start: "/*", end: "*/" },
|
|
616
616
|
stringDelims: ['"', "'"]
|
|
617
|
-
},
|
|
617
|
+
}, Me = /* @__PURE__ */ new Set([
|
|
618
618
|
"abstract",
|
|
619
619
|
"arguments",
|
|
620
620
|
"async",
|
|
@@ -669,8 +669,8 @@ const B = {
|
|
|
669
669
|
"while",
|
|
670
670
|
"with",
|
|
671
671
|
"yield"
|
|
672
|
-
]),
|
|
673
|
-
...
|
|
672
|
+
]), at = /* @__PURE__ */ new Set([
|
|
673
|
+
...Me,
|
|
674
674
|
"any",
|
|
675
675
|
"as",
|
|
676
676
|
"asserts",
|
|
@@ -693,7 +693,7 @@ const B = {
|
|
|
693
693
|
"type",
|
|
694
694
|
"unique",
|
|
695
695
|
"unknown"
|
|
696
|
-
]),
|
|
696
|
+
]), ct = /* @__PURE__ */ new Set([
|
|
697
697
|
"False",
|
|
698
698
|
"None",
|
|
699
699
|
"True",
|
|
@@ -729,7 +729,7 @@ const B = {
|
|
|
729
729
|
"while",
|
|
730
730
|
"with",
|
|
731
731
|
"yield"
|
|
732
|
-
]),
|
|
732
|
+
]), dt = /* @__PURE__ */ new Set([
|
|
733
733
|
"abs",
|
|
734
734
|
"all",
|
|
735
735
|
"any",
|
|
@@ -757,7 +757,7 @@ const B = {
|
|
|
757
757
|
"zip",
|
|
758
758
|
"self",
|
|
759
759
|
"cls"
|
|
760
|
-
]),
|
|
760
|
+
]), Be = /* @__PURE__ */ new Set([
|
|
761
761
|
"auto",
|
|
762
762
|
"break",
|
|
763
763
|
"case",
|
|
@@ -794,8 +794,8 @@ const B = {
|
|
|
794
794
|
"restrict",
|
|
795
795
|
"_Bool",
|
|
796
796
|
"NULL"
|
|
797
|
-
]),
|
|
798
|
-
...
|
|
797
|
+
]), ut = /* @__PURE__ */ new Set([
|
|
798
|
+
...Be,
|
|
799
799
|
"class",
|
|
800
800
|
"new",
|
|
801
801
|
"delete",
|
|
@@ -829,7 +829,7 @@ const B = {
|
|
|
829
829
|
"noexcept",
|
|
830
830
|
"final",
|
|
831
831
|
"auto"
|
|
832
|
-
]),
|
|
832
|
+
]), pt = /* @__PURE__ */ new Set([
|
|
833
833
|
"abstract",
|
|
834
834
|
"async",
|
|
835
835
|
"await",
|
|
@@ -914,7 +914,7 @@ const B = {
|
|
|
914
914
|
"init",
|
|
915
915
|
"nameof",
|
|
916
916
|
"when"
|
|
917
|
-
]),
|
|
917
|
+
]), ht = /* @__PURE__ */ new Set([
|
|
918
918
|
"abstract",
|
|
919
919
|
"assert",
|
|
920
920
|
"boolean",
|
|
@@ -974,7 +974,7 @@ const B = {
|
|
|
974
974
|
"sealed",
|
|
975
975
|
"permits",
|
|
976
976
|
"non-sealed"
|
|
977
|
-
]),
|
|
977
|
+
]), mt = /* @__PURE__ */ new Set([
|
|
978
978
|
"abstract",
|
|
979
979
|
"actual",
|
|
980
980
|
"annotation",
|
|
@@ -1041,7 +1041,7 @@ const B = {
|
|
|
1041
1041
|
"when",
|
|
1042
1042
|
"where",
|
|
1043
1043
|
"while"
|
|
1044
|
-
]),
|
|
1044
|
+
]), ft = /* @__PURE__ */ new Set([
|
|
1045
1045
|
"break",
|
|
1046
1046
|
"case",
|
|
1047
1047
|
"chan",
|
|
@@ -1071,7 +1071,7 @@ const B = {
|
|
|
1071
1071
|
"false",
|
|
1072
1072
|
"nil",
|
|
1073
1073
|
"iota"
|
|
1074
|
-
]),
|
|
1074
|
+
]), gt = /* @__PURE__ */ new Set([
|
|
1075
1075
|
"as",
|
|
1076
1076
|
"async",
|
|
1077
1077
|
"await",
|
|
@@ -1120,7 +1120,7 @@ const B = {
|
|
|
1120
1120
|
"unsized",
|
|
1121
1121
|
"virtual",
|
|
1122
1122
|
"yield"
|
|
1123
|
-
]),
|
|
1123
|
+
]), bt = /* @__PURE__ */ new Set([
|
|
1124
1124
|
"if",
|
|
1125
1125
|
"then",
|
|
1126
1126
|
"else",
|
|
@@ -1151,7 +1151,7 @@ const B = {
|
|
|
1151
1151
|
"source",
|
|
1152
1152
|
"true",
|
|
1153
1153
|
"false"
|
|
1154
|
-
]),
|
|
1154
|
+
]), yt = /* @__PURE__ */ new Set([
|
|
1155
1155
|
"select",
|
|
1156
1156
|
"from",
|
|
1157
1157
|
"where",
|
|
@@ -1220,7 +1220,7 @@ const B = {
|
|
|
1220
1220
|
"max",
|
|
1221
1221
|
"asc",
|
|
1222
1222
|
"desc"
|
|
1223
|
-
]),
|
|
1223
|
+
]), wt = /* @__PURE__ */ new Set(["true", "false", "null"]), $e = [
|
|
1224
1224
|
{
|
|
1225
1225
|
id: "plaintext",
|
|
1226
1226
|
label: "Plain Text",
|
|
@@ -1229,54 +1229,54 @@ const B = {
|
|
|
1229
1229
|
{
|
|
1230
1230
|
id: "javascript",
|
|
1231
1231
|
label: "JavaScript",
|
|
1232
|
-
keywords:
|
|
1232
|
+
keywords: Me,
|
|
1233
1233
|
...B,
|
|
1234
1234
|
stringDelims: ['"', "'", "`"]
|
|
1235
1235
|
},
|
|
1236
1236
|
{
|
|
1237
1237
|
id: "typescript",
|
|
1238
1238
|
label: "TypeScript",
|
|
1239
|
-
keywords:
|
|
1239
|
+
keywords: at,
|
|
1240
1240
|
...B,
|
|
1241
1241
|
stringDelims: ['"', "'", "`"]
|
|
1242
1242
|
},
|
|
1243
1243
|
{
|
|
1244
1244
|
id: "python",
|
|
1245
1245
|
label: "Python",
|
|
1246
|
-
keywords:
|
|
1247
|
-
builtins:
|
|
1246
|
+
keywords: ct,
|
|
1247
|
+
builtins: dt,
|
|
1248
1248
|
lineComment: "#",
|
|
1249
1249
|
stringDelims: ['"', "'"]
|
|
1250
1250
|
},
|
|
1251
1251
|
{
|
|
1252
1252
|
id: "json",
|
|
1253
1253
|
label: "JSON",
|
|
1254
|
-
keywords:
|
|
1254
|
+
keywords: wt,
|
|
1255
1255
|
stringDelims: ['"']
|
|
1256
1256
|
},
|
|
1257
1257
|
{
|
|
1258
1258
|
id: "html",
|
|
1259
1259
|
label: "HTML",
|
|
1260
1260
|
keywords: /* @__PURE__ */ new Set(),
|
|
1261
|
-
custom: (n) =>
|
|
1261
|
+
custom: (n) => Et(n)
|
|
1262
1262
|
},
|
|
1263
1263
|
{
|
|
1264
1264
|
id: "css",
|
|
1265
1265
|
label: "CSS",
|
|
1266
1266
|
keywords: /* @__PURE__ */ new Set(),
|
|
1267
|
-
custom: (n) =>
|
|
1267
|
+
custom: (n) => At(n)
|
|
1268
1268
|
},
|
|
1269
1269
|
{
|
|
1270
1270
|
id: "bash",
|
|
1271
1271
|
label: "Bash",
|
|
1272
|
-
keywords:
|
|
1272
|
+
keywords: bt,
|
|
1273
1273
|
lineComment: "#",
|
|
1274
1274
|
stringDelims: ['"', "'"]
|
|
1275
1275
|
},
|
|
1276
1276
|
{
|
|
1277
1277
|
id: "sql",
|
|
1278
1278
|
label: "SQL",
|
|
1279
|
-
keywords:
|
|
1279
|
+
keywords: yt,
|
|
1280
1280
|
caseInsensitiveKeywords: !0,
|
|
1281
1281
|
lineComment: "--",
|
|
1282
1282
|
blockComment: { start: "/*", end: "*/" },
|
|
@@ -1286,26 +1286,26 @@ const B = {
|
|
|
1286
1286
|
id: "markdown",
|
|
1287
1287
|
label: "Markdown",
|
|
1288
1288
|
keywords: /* @__PURE__ */ new Set(),
|
|
1289
|
-
custom: (n) =>
|
|
1289
|
+
custom: (n) => St(n)
|
|
1290
1290
|
},
|
|
1291
|
-
{ id: "c", label: "C", keywords:
|
|
1292
|
-
{ id: "cpp", label: "C++", keywords:
|
|
1293
|
-
{ id: "csharp", label: "C#", keywords:
|
|
1294
|
-
{ id: "java", label: "Java", keywords:
|
|
1295
|
-
{ id: "kotlin", label: "Kotlin", keywords:
|
|
1296
|
-
{ id: "go", label: "Go", keywords:
|
|
1297
|
-
{ id: "rust", label: "Rust", keywords:
|
|
1298
|
-
],
|
|
1291
|
+
{ id: "c", label: "C", keywords: Be, ...B },
|
|
1292
|
+
{ id: "cpp", label: "C++", keywords: ut, ...B },
|
|
1293
|
+
{ id: "csharp", label: "C#", keywords: pt, ...B },
|
|
1294
|
+
{ id: "java", label: "Java", keywords: ht, ...B },
|
|
1295
|
+
{ id: "kotlin", label: "Kotlin", keywords: mt, ...B },
|
|
1296
|
+
{ id: "go", label: "Go", keywords: ft, ...B },
|
|
1297
|
+
{ id: "rust", label: "Rust", keywords: gt, ...B }
|
|
1298
|
+
], kt = (() => {
|
|
1299
1299
|
const n = /* @__PURE__ */ new Map();
|
|
1300
|
-
for (const e of
|
|
1300
|
+
for (const e of $e) n.set(e.id, e);
|
|
1301
1301
|
return n;
|
|
1302
1302
|
})();
|
|
1303
|
-
function
|
|
1303
|
+
function vt(n, e) {
|
|
1304
1304
|
if (!e) return k(n);
|
|
1305
|
-
const t =
|
|
1306
|
-
return t ? t.custom ? t.custom(n) :
|
|
1305
|
+
const t = kt.get(e);
|
|
1306
|
+
return t ? t.custom ? t.custom(n) : Ct(n, t) : k(n);
|
|
1307
1307
|
}
|
|
1308
|
-
function
|
|
1308
|
+
function Ct(n, e) {
|
|
1309
1309
|
var r, s;
|
|
1310
1310
|
const t = !!e.caseInsensitiveKeywords;
|
|
1311
1311
|
let o = "", l = 0;
|
|
@@ -1344,7 +1344,7 @@ function vt(n, e) {
|
|
|
1344
1344
|
}
|
|
1345
1345
|
const c = n[l] ?? "";
|
|
1346
1346
|
if (/[0-9]/.test(c)) {
|
|
1347
|
-
const d =
|
|
1347
|
+
const d = xt.exec(n.slice(l));
|
|
1348
1348
|
if (d) {
|
|
1349
1349
|
o += `<span class="hl-number">${k(d[0])}</span>`, l += d[0].length;
|
|
1350
1350
|
continue;
|
|
@@ -1370,8 +1370,8 @@ function vt(n, e) {
|
|
|
1370
1370
|
}
|
|
1371
1371
|
return o;
|
|
1372
1372
|
}
|
|
1373
|
-
const
|
|
1374
|
-
function
|
|
1373
|
+
const xt = /^(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]*/;
|
|
1374
|
+
function Et(n) {
|
|
1375
1375
|
let e = "", t = 0;
|
|
1376
1376
|
const o = n.length;
|
|
1377
1377
|
for (; t < o; ) {
|
|
@@ -1387,14 +1387,14 @@ function xt(n) {
|
|
|
1387
1387
|
break;
|
|
1388
1388
|
}
|
|
1389
1389
|
const i = n.slice(t, l + 1);
|
|
1390
|
-
e +=
|
|
1390
|
+
e += Lt(i), t = l + 1;
|
|
1391
1391
|
continue;
|
|
1392
1392
|
}
|
|
1393
1393
|
e += k(n[t] ?? ""), t++;
|
|
1394
1394
|
}
|
|
1395
1395
|
return e;
|
|
1396
1396
|
}
|
|
1397
|
-
function
|
|
1397
|
+
function Lt(n) {
|
|
1398
1398
|
const e = n.slice(1, -1);
|
|
1399
1399
|
let t = '<span class="hl-punct"><</span>';
|
|
1400
1400
|
const o = /^\/?[a-zA-Z][a-zA-Z0-9-]*/.exec(e);
|
|
@@ -1419,7 +1419,7 @@ function Et(n) {
|
|
|
1419
1419
|
t += k(e);
|
|
1420
1420
|
return t += '<span class="hl-punct">></span>', t;
|
|
1421
1421
|
}
|
|
1422
|
-
function
|
|
1422
|
+
function At(n) {
|
|
1423
1423
|
let e = "", t = 0;
|
|
1424
1424
|
const o = n.length;
|
|
1425
1425
|
let l = !1;
|
|
@@ -1472,12 +1472,12 @@ function Lt(n) {
|
|
|
1472
1472
|
}
|
|
1473
1473
|
return e;
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1475
|
+
function St(n) {
|
|
1476
1476
|
return n.split(`
|
|
1477
|
-
`).map(
|
|
1477
|
+
`).map(Tt).join(`
|
|
1478
1478
|
`);
|
|
1479
1479
|
}
|
|
1480
|
-
function
|
|
1480
|
+
function Tt(n) {
|
|
1481
1481
|
const e = /^(#{1,6})\s+(.*)$/.exec(n);
|
|
1482
1482
|
if (e)
|
|
1483
1483
|
return `<span class="hl-keyword">${k(e[1] ?? "")}</span> <span class="hl-tag">${ee(e[2] ?? "")}</span>`;
|
|
@@ -1557,7 +1557,7 @@ function te(n, e, t = []) {
|
|
|
1557
1557
|
}
|
|
1558
1558
|
I(o, n);
|
|
1559
1559
|
}
|
|
1560
|
-
const
|
|
1560
|
+
const Nt = [
|
|
1561
1561
|
{ label: "본문", kind: "paragraph", attrs: {}, glyph: "¶" },
|
|
1562
1562
|
{ label: "제목 1", kind: "heading", attrs: { level: 1 }, glyph: "H1", weight: "700" },
|
|
1563
1563
|
{ label: "제목 2", kind: "heading", attrs: { level: 2 }, glyph: "H2", weight: "700" },
|
|
@@ -1654,11 +1654,11 @@ const Tt = [
|
|
|
1654
1654
|
glyphIsSvg: !0
|
|
1655
1655
|
}
|
|
1656
1656
|
];
|
|
1657
|
-
function
|
|
1657
|
+
function Mt(n, e) {
|
|
1658
1658
|
D();
|
|
1659
1659
|
const t = document.createElement("div");
|
|
1660
1660
|
t.className = "aw-popover aw-block-type-popover", t.dataset.popover = "true", S(t);
|
|
1661
|
-
for (const o of
|
|
1661
|
+
for (const o of Nt) {
|
|
1662
1662
|
if (o.divider) {
|
|
1663
1663
|
const s = document.createElement("div");
|
|
1664
1664
|
s.className = "aw-popover-divider", t.appendChild(s);
|
|
@@ -1674,7 +1674,7 @@ function Nt(n, e) {
|
|
|
1674
1674
|
}
|
|
1675
1675
|
I(t, n);
|
|
1676
1676
|
}
|
|
1677
|
-
function
|
|
1677
|
+
function Bt(n, e) {
|
|
1678
1678
|
D();
|
|
1679
1679
|
const t = document.createElement("div");
|
|
1680
1680
|
t.className = "aw-popover aw-align-popover", t.dataset.popover = "true", S(t);
|
|
@@ -1692,8 +1692,8 @@ function Mt(n, e) {
|
|
|
1692
1692
|
}
|
|
1693
1693
|
I(t, n);
|
|
1694
1694
|
}
|
|
1695
|
-
function
|
|
1696
|
-
|
|
1695
|
+
function $t(n, e, t) {
|
|
1696
|
+
rt(), D();
|
|
1697
1697
|
const o = document.createElement("div");
|
|
1698
1698
|
o.className = "aw-popover aw-font-family-popover", o.dataset.popover = "true", S(o);
|
|
1699
1699
|
for (const l of W) {
|
|
@@ -1708,11 +1708,11 @@ function Bt(n, e, t) {
|
|
|
1708
1708
|
}
|
|
1709
1709
|
I(o, n);
|
|
1710
1710
|
}
|
|
1711
|
-
function
|
|
1711
|
+
function zt(n, e, t) {
|
|
1712
1712
|
D();
|
|
1713
1713
|
const o = document.createElement("div");
|
|
1714
1714
|
o.className = "aw-popover aw-code-lang-popover", o.dataset.popover = "true", S(o);
|
|
1715
|
-
for (const l of
|
|
1715
|
+
for (const l of $e) {
|
|
1716
1716
|
const i = document.createElement("button");
|
|
1717
1717
|
i.type = "button", i.className = "aw-popover-item aw-code-lang-item", t === l.id && i.classList.add("aw-popover-item-active"), i.title = l.label;
|
|
1718
1718
|
const r = document.createElement("span");
|
|
@@ -1722,7 +1722,7 @@ function $t(n, e, t) {
|
|
|
1722
1722
|
}
|
|
1723
1723
|
I(o, n);
|
|
1724
1724
|
}
|
|
1725
|
-
const
|
|
1725
|
+
const Rt = [
|
|
1726
1726
|
{ action: "rowAbove", label: "위에 행 추가" },
|
|
1727
1727
|
{ action: "rowBelow", label: "아래에 행 추가" },
|
|
1728
1728
|
{ action: "colLeft", label: "왼쪽에 열 추가", divider: !0 },
|
|
@@ -1730,11 +1730,11 @@ const zt = [
|
|
|
1730
1730
|
{ action: "deleteRow", label: "행 삭제", divider: !0 },
|
|
1731
1731
|
{ action: "deleteCol", label: "열 삭제" }
|
|
1732
1732
|
];
|
|
1733
|
-
function
|
|
1733
|
+
function It(n, e) {
|
|
1734
1734
|
D();
|
|
1735
1735
|
const t = document.createElement("div");
|
|
1736
1736
|
t.className = "aw-popover aw-table-menu-popover", t.dataset.popover = "true", S(t);
|
|
1737
|
-
for (const o of
|
|
1737
|
+
for (const o of Rt) {
|
|
1738
1738
|
if (o.divider) {
|
|
1739
1739
|
const i = document.createElement("div");
|
|
1740
1740
|
i.className = "aw-popover-divider", t.appendChild(i);
|
|
@@ -1746,11 +1746,11 @@ function Rt(n, e) {
|
|
|
1746
1746
|
}
|
|
1747
1747
|
I(t, n);
|
|
1748
1748
|
}
|
|
1749
|
-
function
|
|
1749
|
+
function Dt(n, e, t) {
|
|
1750
1750
|
D();
|
|
1751
1751
|
const o = document.createElement("div");
|
|
1752
1752
|
o.className = "aw-popover aw-font-size-popover", o.dataset.popover = "true", S(o);
|
|
1753
|
-
for (const l of
|
|
1753
|
+
for (const l of lt) {
|
|
1754
1754
|
const i = document.createElement("button");
|
|
1755
1755
|
i.type = "button", i.className = "aw-popover-item aw-font-size-item", t === l && i.classList.add("aw-popover-item-active"), i.title = `${l}px`;
|
|
1756
1756
|
const r = document.createElement("span");
|
|
@@ -1760,7 +1760,7 @@ function It(n, e, t) {
|
|
|
1760
1760
|
}
|
|
1761
1761
|
I(o, n);
|
|
1762
1762
|
}
|
|
1763
|
-
function
|
|
1763
|
+
function Ht(n, e) {
|
|
1764
1764
|
D();
|
|
1765
1765
|
const t = 2, o = 12, l = document.createElement("div");
|
|
1766
1766
|
l.className = "aw-popover aw-table-popover", l.dataset.popover = "true";
|
|
@@ -1835,7 +1835,7 @@ function I(n, e) {
|
|
|
1835
1835
|
function D() {
|
|
1836
1836
|
document.querySelectorAll('[data-popover="true"]').forEach((n) => n.remove());
|
|
1837
1837
|
}
|
|
1838
|
-
const
|
|
1838
|
+
const Ft = ["script", "noscript", "meta", "link", "style", "base"], Pt = /* @__PURE__ */ new Set([
|
|
1839
1839
|
// CSS 2.1
|
|
1840
1840
|
"border-collapse",
|
|
1841
1841
|
"border-spacing",
|
|
@@ -1948,7 +1948,7 @@ const Ht = ["script", "noscript", "meta", "link", "style", "base"], Ft = /* @__P
|
|
|
1948
1948
|
"stroke-width",
|
|
1949
1949
|
"text-anchor"
|
|
1950
1950
|
]);
|
|
1951
|
-
async function
|
|
1951
|
+
async function qt(n, e = {}) {
|
|
1952
1952
|
const t = e.settleMs ?? 1e3, o = e.timeoutMs ?? 3e4, l = e.width ?? 1024, i = e.mountTarget ?? null;
|
|
1953
1953
|
return new Promise((r, s) => {
|
|
1954
1954
|
const a = document.createElement("iframe");
|
|
@@ -1978,7 +1978,7 @@ async function Pt(n, e = {}) {
|
|
|
1978
1978
|
window.clearTimeout(h), u(new Error("iframe document 접근 실패"));
|
|
1979
1979
|
return;
|
|
1980
1980
|
}
|
|
1981
|
-
const M =
|
|
1981
|
+
const M = Ot(A.body, L, i);
|
|
1982
1982
|
window.clearTimeout(h), m(M);
|
|
1983
1983
|
} catch (L) {
|
|
1984
1984
|
window.clearTimeout(h), u(L instanceof Error ? L : new Error(String(L)));
|
|
@@ -1991,31 +1991,31 @@ async function Pt(n, e = {}) {
|
|
|
1991
1991
|
a.addEventListener("load", f), a.srcdoc = n, document.body.appendChild(a);
|
|
1992
1992
|
});
|
|
1993
1993
|
}
|
|
1994
|
-
function
|
|
1994
|
+
function Ot(n, e, t) {
|
|
1995
1995
|
var r;
|
|
1996
1996
|
const o = n.ownerDocument;
|
|
1997
1997
|
if (!o) throw new Error("body has no ownerDocument");
|
|
1998
|
-
const l = document.createElement("div"), i =
|
|
1998
|
+
const l = document.createElement("div"), i = _t(o, e, t);
|
|
1999
1999
|
try {
|
|
2000
2000
|
for (let a = 0; a < n.attributes.length; a++) {
|
|
2001
2001
|
const c = n.attributes.item(a);
|
|
2002
2002
|
c && c.name !== "style" && l.setAttribute(c.name, c.value);
|
|
2003
2003
|
}
|
|
2004
|
-
const s =
|
|
2004
|
+
const s = ze(n, null, "div", i.get, e);
|
|
2005
2005
|
s.length > 0 && l.setAttribute("style", s);
|
|
2006
2006
|
for (const a of Array.from(n.children)) {
|
|
2007
2007
|
const c = document.importNode(a, !0);
|
|
2008
|
-
|
|
2008
|
+
Re(a, c, n, i.get, e), l.appendChild(c);
|
|
2009
2009
|
}
|
|
2010
2010
|
} finally {
|
|
2011
2011
|
i.cleanup();
|
|
2012
2012
|
}
|
|
2013
|
-
for (const s of
|
|
2013
|
+
for (const s of Ft)
|
|
2014
2014
|
for (const a of Array.from(l.querySelectorAll(s)))
|
|
2015
2015
|
(r = a.parentNode) == null || r.removeChild(a);
|
|
2016
2016
|
return l.style.width = "auto", l.style.maxWidth = "none", l.style.height = "auto", l.style.maxHeight = "none", l.setAttribute("data-imported-html", "true"), [l];
|
|
2017
2017
|
}
|
|
2018
|
-
function
|
|
2018
|
+
function _t(n, e, t) {
|
|
2019
2019
|
var d;
|
|
2020
2020
|
let o, l, i;
|
|
2021
2021
|
const r = ((d = t == null ? void 0 : t.ownerDocument) == null ? void 0 : d.defaultView) ?? null;
|
|
@@ -2044,7 +2044,7 @@ function Ot(n, e, t) {
|
|
|
2044
2044
|
i.parentNode && i.parentNode.removeChild(i);
|
|
2045
2045
|
} };
|
|
2046
2046
|
}
|
|
2047
|
-
function
|
|
2047
|
+
function ze(n, e, t, o, l) {
|
|
2048
2048
|
const i = l.getComputedStyle(n), r = e ? l.getComputedStyle(e) : null, s = o(t);
|
|
2049
2049
|
let a = "";
|
|
2050
2050
|
for (let c = 0; c < i.length; c++) {
|
|
@@ -2052,7 +2052,7 @@ function $e(n, e, t, o, l) {
|
|
|
2052
2052
|
if (!d) continue;
|
|
2053
2053
|
const u = i.getPropertyValue(d);
|
|
2054
2054
|
if (u) {
|
|
2055
|
-
if (
|
|
2055
|
+
if (Pt.has(d)) {
|
|
2056
2056
|
if (r && r.getPropertyValue(d) === u) continue;
|
|
2057
2057
|
} else if (s.get(d) === u) continue;
|
|
2058
2058
|
a += `${d}:${u};`;
|
|
@@ -2060,9 +2060,9 @@ function $e(n, e, t, o, l) {
|
|
|
2060
2060
|
}
|
|
2061
2061
|
return a;
|
|
2062
2062
|
}
|
|
2063
|
-
function
|
|
2063
|
+
function Re(n, e, t, o, l) {
|
|
2064
2064
|
if (n.nodeType === 1 && e.nodeType === 1) {
|
|
2065
|
-
const a =
|
|
2065
|
+
const a = ze(
|
|
2066
2066
|
n,
|
|
2067
2067
|
t,
|
|
2068
2068
|
n.tagName.toLowerCase(),
|
|
@@ -2074,18 +2074,18 @@ function ze(n, e, t, o, l) {
|
|
|
2074
2074
|
const i = n.children, r = e.children, s = Math.min(i.length, r.length);
|
|
2075
2075
|
for (let a = 0; a < s; a++) {
|
|
2076
2076
|
const c = i[a], d = r[a];
|
|
2077
|
-
c && d &&
|
|
2077
|
+
c && d && Re(c, d, n, o, l);
|
|
2078
2078
|
}
|
|
2079
2079
|
}
|
|
2080
|
-
function
|
|
2081
|
-
const e =
|
|
2080
|
+
function jt(n) {
|
|
2081
|
+
const e = Ut(n), t = document.createElement("div");
|
|
2082
2082
|
t.innerHTML = e;
|
|
2083
2083
|
const o = [];
|
|
2084
2084
|
for (const l of Array.from(t.children))
|
|
2085
2085
|
l instanceof HTMLElement && o.push(l);
|
|
2086
2086
|
return o;
|
|
2087
2087
|
}
|
|
2088
|
-
function
|
|
2088
|
+
function Ut(n) {
|
|
2089
2089
|
const t = n.replace(/\r\n?/g, `
|
|
2090
2090
|
`).replace(/\s+$/, "").split(`
|
|
2091
2091
|
`), o = [];
|
|
@@ -2119,11 +2119,11 @@ function jt(n) {
|
|
|
2119
2119
|
o.push("<hr>"), l++;
|
|
2120
2120
|
continue;
|
|
2121
2121
|
}
|
|
2122
|
-
if (
|
|
2122
|
+
if (Ie(i, t[l + 1] ?? "")) {
|
|
2123
2123
|
const c = [i];
|
|
2124
2124
|
for (l++, c.push(t[l] ?? ""), l++; l < t.length && (t[l] ?? "").includes("|") && (t[l] ?? "").trim() !== ""; )
|
|
2125
2125
|
c.push(t[l] ?? ""), l++;
|
|
2126
|
-
o.push(
|
|
2126
|
+
o.push(Kt(c));
|
|
2127
2127
|
continue;
|
|
2128
2128
|
}
|
|
2129
2129
|
if (i.startsWith(">")) {
|
|
@@ -2145,20 +2145,20 @@ function jt(n) {
|
|
|
2145
2145
|
continue;
|
|
2146
2146
|
}
|
|
2147
2147
|
const a = [];
|
|
2148
|
-
for (; l < t.length && (t[l] ?? "").trim() !== "" && !
|
|
2148
|
+
for (; l < t.length && (t[l] ?? "").trim() !== "" && !Wt(t[l] ?? "", t[l + 1] ?? ""); )
|
|
2149
2149
|
a.push(t[l] ?? ""), l++;
|
|
2150
|
-
a.length > 0 && o.push(`<p>${H(
|
|
2150
|
+
a.length > 0 && o.push(`<p>${H(Vt(a))}</p>`);
|
|
2151
2151
|
}
|
|
2152
2152
|
return o.join(`
|
|
2153
2153
|
`);
|
|
2154
2154
|
}
|
|
2155
|
-
function
|
|
2156
|
-
return /^#{1,6}\s/.test(n) || /^[\s]*[-*+]\s+/.test(n) || /^[\s]*\d+\.\s+/.test(n) || n.startsWith(">") || /^```/.test(n) || /^[\s]*([-*_])(\s*\1){2,}[\s]*$/.test(n) ||
|
|
2155
|
+
function Wt(n, e) {
|
|
2156
|
+
return /^#{1,6}\s/.test(n) || /^[\s]*[-*+]\s+/.test(n) || /^[\s]*\d+\.\s+/.test(n) || n.startsWith(">") || /^```/.test(n) || /^[\s]*([-*_])(\s*\1){2,}[\s]*$/.test(n) || Ie(n, e);
|
|
2157
2157
|
}
|
|
2158
|
-
function
|
|
2158
|
+
function Ie(n, e) {
|
|
2159
2159
|
return n.includes("|") ? /^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/.test(e) : !1;
|
|
2160
2160
|
}
|
|
2161
|
-
function
|
|
2161
|
+
function Kt(n) {
|
|
2162
2162
|
if (n.length < 2) return "";
|
|
2163
2163
|
const e = ne(n[0] ?? ""), o = ne(n[1] ?? "").map((s) => {
|
|
2164
2164
|
const a = s.trim(), c = a.startsWith(":"), d = a.endsWith(":");
|
|
@@ -2194,7 +2194,7 @@ function ye(n, e, t) {
|
|
|
2194
2194
|
}
|
|
2195
2195
|
return { html: o.join(""), next: l };
|
|
2196
2196
|
}
|
|
2197
|
-
function
|
|
2197
|
+
function Vt(n) {
|
|
2198
2198
|
const e = [];
|
|
2199
2199
|
for (let t = 0; t < n.length; t++) {
|
|
2200
2200
|
const o = n[t] ?? "", l = t === n.length - 1;
|
|
@@ -2232,7 +2232,7 @@ const Q = [
|
|
|
2232
2232
|
"italic",
|
|
2233
2233
|
"underline",
|
|
2234
2234
|
"strike"
|
|
2235
|
-
],
|
|
2235
|
+
], Yt = {
|
|
2236
2236
|
kind: "paragraph",
|
|
2237
2237
|
label: "단락",
|
|
2238
2238
|
allowsInlineFormat: !0,
|
|
@@ -2242,7 +2242,7 @@ const Q = [
|
|
|
2242
2242
|
matches: (n) => n.tagName === "P" ? { kind: "paragraph", attrs: {} } : null,
|
|
2243
2243
|
create: () => J(document.createElement("p")),
|
|
2244
2244
|
isEmpty: (n) => q(n)
|
|
2245
|
-
},
|
|
2245
|
+
}, Gt = {
|
|
2246
2246
|
kind: "heading",
|
|
2247
2247
|
label: "제목",
|
|
2248
2248
|
allowsInlineFormat: !0,
|
|
@@ -2258,11 +2258,11 @@ const Q = [
|
|
|
2258
2258
|
return e ? { kind: "heading", attrs: { level: Number(e[1]) } } : null;
|
|
2259
2259
|
},
|
|
2260
2260
|
create: (n) => {
|
|
2261
|
-
const e =
|
|
2261
|
+
const e = En(n == null ? void 0 : n.level);
|
|
2262
2262
|
return J(document.createElement(`h${e}`));
|
|
2263
2263
|
},
|
|
2264
2264
|
isEmpty: (n) => q(n)
|
|
2265
|
-
},
|
|
2265
|
+
}, Zt = {
|
|
2266
2266
|
kind: "bulletList",
|
|
2267
2267
|
label: "글머리 목록",
|
|
2268
2268
|
allowsInlineFormat: !0,
|
|
@@ -2270,9 +2270,9 @@ const Q = [
|
|
|
2270
2270
|
allowsColor: !0,
|
|
2271
2271
|
allowsFontSize: !0,
|
|
2272
2272
|
matches: (n) => n.tagName === "UL" ? { kind: "bulletList", attrs: {} } : null,
|
|
2273
|
-
create: () =>
|
|
2274
|
-
isEmpty: (n) =>
|
|
2275
|
-
},
|
|
2273
|
+
create: () => Ue("ul"),
|
|
2274
|
+
isEmpty: (n) => We(n)
|
|
2275
|
+
}, Xt = {
|
|
2276
2276
|
kind: "orderedList",
|
|
2277
2277
|
label: "번호 매기기 목록",
|
|
2278
2278
|
allowsInlineFormat: !0,
|
|
@@ -2280,9 +2280,9 @@ const Q = [
|
|
|
2280
2280
|
allowsColor: !0,
|
|
2281
2281
|
allowsFontSize: !0,
|
|
2282
2282
|
matches: (n) => n.tagName === "OL" ? { kind: "orderedList", attrs: {} } : null,
|
|
2283
|
-
create: () =>
|
|
2284
|
-
isEmpty: (n) =>
|
|
2285
|
-
},
|
|
2283
|
+
create: () => Ue("ol"),
|
|
2284
|
+
isEmpty: (n) => We(n)
|
|
2285
|
+
}, Qt = {
|
|
2286
2286
|
kind: "blockquote",
|
|
2287
2287
|
label: "인용구",
|
|
2288
2288
|
allowsInlineFormat: !0,
|
|
@@ -2298,7 +2298,7 @@ const Q = [
|
|
|
2298
2298
|
return n.appendChild(J(document.createElement("p"))), n;
|
|
2299
2299
|
},
|
|
2300
2300
|
isEmpty: (n) => q(n)
|
|
2301
|
-
},
|
|
2301
|
+
}, Jt = {
|
|
2302
2302
|
kind: "codeBlock",
|
|
2303
2303
|
label: "코드 블록",
|
|
2304
2304
|
allowsInlineFormat: !1,
|
|
@@ -2317,7 +2317,7 @@ const Q = [
|
|
|
2317
2317
|
return n != null && n.language && t.setAttribute("data-language", n.language), e.appendChild(t), e;
|
|
2318
2318
|
},
|
|
2319
2319
|
isEmpty: (n) => q(n)
|
|
2320
|
-
},
|
|
2320
|
+
}, en = {
|
|
2321
2321
|
kind: "image",
|
|
2322
2322
|
label: "이미지",
|
|
2323
2323
|
allowsInlineFormat: !1,
|
|
@@ -2326,10 +2326,10 @@ const Q = [
|
|
|
2326
2326
|
allowsFontSize: !1,
|
|
2327
2327
|
matches: (n) => {
|
|
2328
2328
|
if (n.tagName === "FIGURE") {
|
|
2329
|
-
const e = n.querySelector(":scope > img"), t =
|
|
2329
|
+
const e = n.querySelector(":scope > img"), t = Ee(e), o = n.getAttribute("style");
|
|
2330
2330
|
return o && (t.wrapperStyle = o), { kind: "image", attrs: t };
|
|
2331
2331
|
}
|
|
2332
|
-
return n.tagName === "IMG" ? { kind: "image", attrs:
|
|
2332
|
+
return n.tagName === "IMG" ? { kind: "image", attrs: Ee(n) } : null;
|
|
2333
2333
|
},
|
|
2334
2334
|
create: (n) => {
|
|
2335
2335
|
const e = document.createElement("figure");
|
|
@@ -2351,15 +2351,15 @@ function he() {
|
|
|
2351
2351
|
n.className = "aw-block-align-controls", n.setAttribute("contenteditable", "false"), n.setAttribute("aria-hidden", "true");
|
|
2352
2352
|
for (const e of ["left", "center", "right"]) {
|
|
2353
2353
|
const t = document.createElement("button");
|
|
2354
|
-
t.type = "button", t.className = "aw-block-align-btn", t.dataset.align = e, t.title = e === "left" ? "왼쪽 정렬" : e === "center" ? "가운데 정렬" : "오른쪽 정렬", t.setAttribute("aria-label", t.title), t.innerHTML =
|
|
2354
|
+
t.type = "button", t.className = "aw-block-align-btn", t.dataset.align = e, t.title = e === "left" ? "왼쪽 정렬" : e === "center" ? "가운데 정렬" : "오른쪽 정렬", t.setAttribute("aria-label", t.title), t.innerHTML = tn[e], n.appendChild(t);
|
|
2355
2355
|
}
|
|
2356
2356
|
return n;
|
|
2357
2357
|
}
|
|
2358
|
-
const
|
|
2358
|
+
const tn = {
|
|
2359
2359
|
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>',
|
|
2360
2360
|
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>',
|
|
2361
2361
|
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>'
|
|
2362
|
-
},
|
|
2362
|
+
}, nn = {
|
|
2363
2363
|
kind: "table",
|
|
2364
2364
|
label: "표",
|
|
2365
2365
|
allowsInlineFormat: !0,
|
|
@@ -2385,7 +2385,7 @@ const en = {
|
|
|
2385
2385
|
return o.appendChild(l), o;
|
|
2386
2386
|
},
|
|
2387
2387
|
isEmpty: (n) => n.querySelectorAll(":scope tr").length === 0
|
|
2388
|
-
},
|
|
2388
|
+
}, on = {
|
|
2389
2389
|
kind: "hr",
|
|
2390
2390
|
label: "구분선",
|
|
2391
2391
|
allowsInlineFormat: !1,
|
|
@@ -2398,7 +2398,7 @@ const en = {
|
|
|
2398
2398
|
return n.setAttribute("contenteditable", "false"), n;
|
|
2399
2399
|
},
|
|
2400
2400
|
isEmpty: () => !1
|
|
2401
|
-
},
|
|
2401
|
+
}, ln = {
|
|
2402
2402
|
kind: "youtube",
|
|
2403
2403
|
label: "유튜브",
|
|
2404
2404
|
allowsInlineFormat: !1,
|
|
@@ -2422,7 +2422,7 @@ const en = {
|
|
|
2422
2422
|
), o.setAttribute("allowfullscreen", ""), o.setAttribute("frameborder", "0"), o.setAttribute("referrerpolicy", "strict-origin-when-cross-origin"), t.appendChild(o), t.appendChild(he()), t.appendChild(pe()), t;
|
|
2423
2423
|
},
|
|
2424
2424
|
isEmpty: (n) => !n.getAttribute("data-youtube-id")
|
|
2425
|
-
},
|
|
2425
|
+
}, rn = {
|
|
2426
2426
|
kind: "linkCard",
|
|
2427
2427
|
label: "링크",
|
|
2428
2428
|
allowsInlineFormat: !1,
|
|
@@ -2436,7 +2436,7 @@ const en = {
|
|
|
2436
2436
|
return e && (r.href = e), t && (r.text = t), o && (r.description = o), l && (r.image = l), i && (r.favicon = i), { kind: "linkCard", attrs: r };
|
|
2437
2437
|
},
|
|
2438
2438
|
create: (n) => {
|
|
2439
|
-
const e = (n == null ? void 0 : n.href) ?? "#", t = n != null && n.text && n.text.length > 0 ? n.text :
|
|
2439
|
+
const e = (n == null ? void 0 : n.href) ?? "#", t = n != null && n.text && n.text.length > 0 ? n.text : De(e) || e, o = (n == null ? void 0 : n.description) ?? "", l = (n == null ? void 0 : n.image) ?? "", i = (n == null ? void 0 : n.favicon) ?? sn(e), r = document.createElement("a");
|
|
2440
2440
|
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) {
|
|
2441
2441
|
const u = document.createElement("img");
|
|
2442
2442
|
u.className = "aw-link-card-image", u.src = l, u.alt = "", u.loading = "lazy", r.appendChild(u);
|
|
@@ -2458,18 +2458,18 @@ const en = {
|
|
|
2458
2458
|
},
|
|
2459
2459
|
isEmpty: (n) => !n.getAttribute("href")
|
|
2460
2460
|
};
|
|
2461
|
-
function
|
|
2461
|
+
function De(n) {
|
|
2462
2462
|
try {
|
|
2463
2463
|
return new URL(n).hostname;
|
|
2464
2464
|
} catch {
|
|
2465
2465
|
return "";
|
|
2466
2466
|
}
|
|
2467
2467
|
}
|
|
2468
|
-
function
|
|
2469
|
-
const e =
|
|
2468
|
+
function sn(n) {
|
|
2469
|
+
const e = De(n);
|
|
2470
2470
|
return e ? `https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64` : "";
|
|
2471
2471
|
}
|
|
2472
|
-
const
|
|
2472
|
+
const an = {
|
|
2473
2473
|
kind: "file",
|
|
2474
2474
|
label: "파일",
|
|
2475
2475
|
allowsInlineFormat: !1,
|
|
@@ -2490,8 +2490,8 @@ const sn = {
|
|
|
2490
2490
|
o.className = "aw-file-meta";
|
|
2491
2491
|
const l = document.createElement("span");
|
|
2492
2492
|
l.className = "aw-file-name", l.textContent = (n == null ? void 0 : n.fileName) ?? "파일", o.appendChild(l);
|
|
2493
|
-
const i = [], r =
|
|
2494
|
-
if (r && i.push(r), (n == null ? void 0 : n.fileSize) !== void 0 && i.push(
|
|
2493
|
+
const i = [], r = dn(n == null ? void 0 : n.fileName, n == null ? void 0 : n.fileType);
|
|
2494
|
+
if (r && i.push(r), (n == null ? void 0 : n.fileSize) !== void 0 && i.push(cn(n.fileSize)), i.length > 0) {
|
|
2495
2495
|
const a = document.createElement("span");
|
|
2496
2496
|
a.className = "aw-file-info", a.textContent = i.join(" · "), o.appendChild(a);
|
|
2497
2497
|
}
|
|
@@ -2500,10 +2500,10 @@ const sn = {
|
|
|
2500
2500
|
},
|
|
2501
2501
|
isEmpty: (n) => !n.getAttribute("href")
|
|
2502
2502
|
};
|
|
2503
|
-
function
|
|
2503
|
+
function cn(n) {
|
|
2504
2504
|
return n < 1024 ? `${n} B` : n < 1024 * 1024 ? `${(n / 1024).toFixed(1)} KB` : n < 1024 * 1024 * 1024 ? `${(n / 1024 / 1024).toFixed(1)} MB` : `${(n / 1024 / 1024 / 1024).toFixed(1)} GB`;
|
|
2505
2505
|
}
|
|
2506
|
-
function
|
|
2506
|
+
function dn(n, e) {
|
|
2507
2507
|
if (n) {
|
|
2508
2508
|
const t = n.lastIndexOf(".");
|
|
2509
2509
|
if (t > 0 && t < n.length - 1)
|
|
@@ -2511,7 +2511,7 @@ function cn(n, e) {
|
|
|
2511
2511
|
}
|
|
2512
2512
|
return e ? (e.split("/").pop() ?? "").toUpperCase() : "";
|
|
2513
2513
|
}
|
|
2514
|
-
const
|
|
2514
|
+
const un = {
|
|
2515
2515
|
kind: "importedHtml",
|
|
2516
2516
|
label: "HTML",
|
|
2517
2517
|
allowsInlineFormat: !1,
|
|
@@ -2530,7 +2530,7 @@ const dn = {
|
|
|
2530
2530
|
return e.setAttribute("data-imported-html", "true"), n != null && n.importedStyle && e.setAttribute("style", n.importedStyle), n != null && n.importedClass && e.setAttribute("class", n.importedClass), e;
|
|
2531
2531
|
},
|
|
2532
2532
|
isEmpty: () => !1
|
|
2533
|
-
},
|
|
2533
|
+
}, He = {
|
|
2534
2534
|
kind: "unknown",
|
|
2535
2535
|
label: "알 수 없음",
|
|
2536
2536
|
allowsInlineFormat: !1,
|
|
@@ -2540,34 +2540,34 @@ const dn = {
|
|
|
2540
2540
|
matches: () => null,
|
|
2541
2541
|
create: () => J(document.createElement("p")),
|
|
2542
2542
|
isEmpty: (n) => q(n)
|
|
2543
|
-
},
|
|
2544
|
-
Vt,
|
|
2543
|
+
}, Fe = [
|
|
2545
2544
|
Yt,
|
|
2546
2545
|
Gt,
|
|
2547
2546
|
Zt,
|
|
2548
2547
|
Xt,
|
|
2549
2548
|
Qt,
|
|
2550
2549
|
Jt,
|
|
2551
|
-
|
|
2550
|
+
en,
|
|
2552
2551
|
nn,
|
|
2553
|
-
ln,
|
|
2554
2552
|
on,
|
|
2555
|
-
|
|
2556
|
-
|
|
2553
|
+
rn,
|
|
2554
|
+
ln,
|
|
2555
|
+
an,
|
|
2556
|
+
un
|
|
2557
2557
|
], N = (() => {
|
|
2558
|
-
const n = { unknown:
|
|
2559
|
-
for (const e of
|
|
2558
|
+
const n = { unknown: He };
|
|
2559
|
+
for (const e of Fe) n[e.kind] = e;
|
|
2560
2560
|
return n;
|
|
2561
2561
|
})();
|
|
2562
2562
|
function U(n) {
|
|
2563
|
-
for (const e of
|
|
2563
|
+
for (const e of Fe) {
|
|
2564
2564
|
const t = e.matches(n);
|
|
2565
2565
|
if (t) return { type: e, match: t };
|
|
2566
2566
|
}
|
|
2567
|
-
return { type:
|
|
2567
|
+
return { type: He, match: { kind: "unknown", attrs: {} } };
|
|
2568
2568
|
}
|
|
2569
2569
|
const F = "data-block-id";
|
|
2570
|
-
class
|
|
2570
|
+
class Pe {
|
|
2571
2571
|
constructor() {
|
|
2572
2572
|
w(this, "counter", 0);
|
|
2573
2573
|
w(this, "seen", /* @__PURE__ */ new Set());
|
|
@@ -2636,7 +2636,7 @@ function we(n) {
|
|
|
2636
2636
|
for (const e of Array.from(n.querySelectorAll("figure, div.aw-youtube-embed")))
|
|
2637
2637
|
e instanceof HTMLElement && (e.querySelector(":scope > .aw-block-align-controls") || e.appendChild(he()), e.querySelector(":scope > .aw-resize-handle") || e.appendChild(pe()));
|
|
2638
2638
|
}
|
|
2639
|
-
function
|
|
2639
|
+
function pn(n) {
|
|
2640
2640
|
switch (n.kind) {
|
|
2641
2641
|
case "paragraph":
|
|
2642
2642
|
return "단락";
|
|
@@ -2668,7 +2668,7 @@ function un(n) {
|
|
|
2668
2668
|
return "?";
|
|
2669
2669
|
}
|
|
2670
2670
|
}
|
|
2671
|
-
function
|
|
2671
|
+
function hn(n) {
|
|
2672
2672
|
return {
|
|
2673
2673
|
id: n.id,
|
|
2674
2674
|
kind: n.kind,
|
|
@@ -2676,17 +2676,17 @@ function pn(n) {
|
|
|
2676
2676
|
html: n.element.innerHTML
|
|
2677
2677
|
};
|
|
2678
2678
|
}
|
|
2679
|
-
function
|
|
2680
|
-
return n.map(
|
|
2679
|
+
function qe(n) {
|
|
2680
|
+
return n.map(hn);
|
|
2681
2681
|
}
|
|
2682
|
-
function
|
|
2682
|
+
function mn(n) {
|
|
2683
2683
|
const t = (N[n.kind] ?? N.unknown).create(n.attrs);
|
|
2684
2684
|
return t.setAttribute(F, n.id), n.html.length > 0 && (t.innerHTML = n.html), t;
|
|
2685
2685
|
}
|
|
2686
|
-
function
|
|
2686
|
+
function fn(n, e) {
|
|
2687
2687
|
for (; n.firstChild; ) n.removeChild(n.firstChild);
|
|
2688
2688
|
for (const t of e)
|
|
2689
|
-
n.appendChild(
|
|
2689
|
+
n.appendChild(mn(t));
|
|
2690
2690
|
}
|
|
2691
2691
|
function de(n, e) {
|
|
2692
2692
|
const t = [];
|
|
@@ -2718,7 +2718,7 @@ function ue(n, e, t) {
|
|
|
2718
2718
|
}
|
|
2719
2719
|
return null;
|
|
2720
2720
|
}
|
|
2721
|
-
function
|
|
2721
|
+
function gn(n) {
|
|
2722
2722
|
const e = n.element;
|
|
2723
2723
|
switch (n.kind) {
|
|
2724
2724
|
case "paragraph":
|
|
@@ -2748,7 +2748,7 @@ function ke(n) {
|
|
|
2748
2748
|
for (const l of Array.from(t.childNodes)) e.push(l);
|
|
2749
2749
|
}), e;
|
|
2750
2750
|
}
|
|
2751
|
-
function
|
|
2751
|
+
function bn(n, e, t) {
|
|
2752
2752
|
if (t.length === 0) return;
|
|
2753
2753
|
let o = null;
|
|
2754
2754
|
switch (e) {
|
|
@@ -2773,9 +2773,9 @@ function gn(n, e, t) {
|
|
|
2773
2773
|
for (; o.firstChild; ) o.removeChild(o.firstChild);
|
|
2774
2774
|
for (const i of t) o.appendChild(i);
|
|
2775
2775
|
const l = N[e];
|
|
2776
|
-
l &&
|
|
2776
|
+
l && yn(o, l);
|
|
2777
2777
|
}
|
|
2778
|
-
function
|
|
2778
|
+
function yn(n, e) {
|
|
2779
2779
|
const t = new Set(e.allowedMarks);
|
|
2780
2780
|
for (const o of Array.from(n.querySelectorAll("*"))) {
|
|
2781
2781
|
if (!(o instanceof HTMLElement) || !o.parentNode) continue;
|
|
@@ -2811,8 +2811,8 @@ function ve(n) {
|
|
|
2811
2811
|
e.removeChild(n);
|
|
2812
2812
|
}
|
|
2813
2813
|
}
|
|
2814
|
-
function
|
|
2815
|
-
const e = n.fg || "currentColor", t = n.bg || "transparent", o = n.mode === "dark" ? !0 : n.mode === "light" ? !1 :
|
|
2814
|
+
function wn(n = {}) {
|
|
2815
|
+
const e = n.fg || "currentColor", t = n.bg || "transparent", o = n.mode === "dark" ? !0 : n.mode === "light" ? !1 : kn(e, t);
|
|
2816
2816
|
return {
|
|
2817
2817
|
primary: n.primary || "#64c8ff",
|
|
2818
2818
|
fg: e,
|
|
@@ -2822,7 +2822,7 @@ function yn(n = {}) {
|
|
|
2822
2822
|
isDark: o
|
|
2823
2823
|
};
|
|
2824
2824
|
}
|
|
2825
|
-
function
|
|
2825
|
+
function kn(n, e) {
|
|
2826
2826
|
const t = Ce(n);
|
|
2827
2827
|
if (t !== null) return t > 0.5;
|
|
2828
2828
|
const o = Ce(e);
|
|
@@ -2842,14 +2842,14 @@ function Ce(n) {
|
|
|
2842
2842
|
}
|
|
2843
2843
|
return t < 0 ? null : (0.299 * t + 0.587 * o + 0.114 * l) / 255;
|
|
2844
2844
|
}
|
|
2845
|
-
function
|
|
2845
|
+
function Oe(n) {
|
|
2846
2846
|
const e = getComputedStyle(n), t = (c) => {
|
|
2847
2847
|
const d = e.getPropertyValue(c).trim();
|
|
2848
2848
|
return d.length > 0 ? d : void 0;
|
|
2849
2849
|
}, o = {}, l = t("--aw-primary"), i = t("--aw-fg"), r = t("--aw-bg"), s = t("--aw-border"), a = t("--aw-fg-muted");
|
|
2850
2850
|
return l && (o.primary = l), i && (o.fg = i), r && (o.bg = r), s && (o.border = s), a && (o.fgMuted = a), o;
|
|
2851
2851
|
}
|
|
2852
|
-
function
|
|
2852
|
+
function vn(n) {
|
|
2853
2853
|
const e = `color-mix(in srgb, ${n.primary} 8%, transparent)`, t = `color-mix(in srgb, ${n.fg} 6%, ${n.bg})`;
|
|
2854
2854
|
return `${n.fg}${n.bg}`, {
|
|
2855
2855
|
H1: `font-size:1.875rem;font-weight:700;line-height:1.3;margin:.6em 0 .4em;padding-bottom:.25em;border-bottom:1px solid ${n.border};color:${n.fg};`,
|
|
@@ -2869,7 +2869,7 @@ function kn(n) {
|
|
|
2869
2869
|
A: `display:block;text-decoration:none;margin:1em 0;padding:12px 16px;border:1px solid ${n.border};border-radius:8px;background-color:${e};color:${n.fg};`
|
|
2870
2870
|
};
|
|
2871
2871
|
}
|
|
2872
|
-
function
|
|
2872
|
+
function Cn(n) {
|
|
2873
2873
|
const e = `color-mix(in srgb, ${n.fg} 5%, ${n.bg})`, t = `color-mix(in srgb, ${n.primary} 12%, transparent)`;
|
|
2874
2874
|
return {
|
|
2875
2875
|
"pre > code": "background:transparent;padding:0;font:inherit;color:inherit;display:block;",
|
|
@@ -2903,8 +2903,8 @@ function vn(n) {
|
|
|
2903
2903
|
"pre > code .hl-punct": `color:${n.fgMuted};`
|
|
2904
2904
|
};
|
|
2905
2905
|
}
|
|
2906
|
-
function
|
|
2907
|
-
const t =
|
|
2906
|
+
function _e(n, e = {}) {
|
|
2907
|
+
const t = wn(e), o = vn(t), l = Cn(t);
|
|
2908
2908
|
for (const i of Array.from(n.children)) {
|
|
2909
2909
|
if (!(i instanceof HTMLElement) || i.getAttribute("data-imported-html") === "true") continue;
|
|
2910
2910
|
if (i.tagName === "A" && i.classList.contains("aw-file-attachment")) {
|
|
@@ -2924,13 +2924,28 @@ function Oe(n, e = {}) {
|
|
|
2924
2924
|
function oe(n, e) {
|
|
2925
2925
|
const t = (n.getAttribute("style") ?? "").trim();
|
|
2926
2926
|
if (!t) {
|
|
2927
|
-
|
|
2927
|
+
const s = e.replace(/;\s*$/, "").trim();
|
|
2928
|
+
s && n.setAttribute("style", s);
|
|
2928
2929
|
return;
|
|
2929
2930
|
}
|
|
2930
|
-
const o =
|
|
2931
|
-
|
|
2931
|
+
const o = xe(t), l = new Set(o.map((s) => s.prop)), r = [...xe(e).filter(
|
|
2932
|
+
(s) => !l.has(s.prop)
|
|
2933
|
+
), ...o].map((s) => `${s.prop}:${s.value}`).join(";");
|
|
2934
|
+
r ? n.setAttribute("style", r) : n.removeAttribute("style");
|
|
2932
2935
|
}
|
|
2933
|
-
function
|
|
2936
|
+
function xe(n) {
|
|
2937
|
+
const e = [];
|
|
2938
|
+
for (const t of n.split(";")) {
|
|
2939
|
+
const o = t.trim();
|
|
2940
|
+
if (!o) continue;
|
|
2941
|
+
const l = o.indexOf(":");
|
|
2942
|
+
if (l <= 0) continue;
|
|
2943
|
+
const i = o.slice(0, l).trim().toLowerCase(), r = o.slice(l + 1).trim();
|
|
2944
|
+
!i || !r || e.push({ prop: i, value: r });
|
|
2945
|
+
}
|
|
2946
|
+
return e;
|
|
2947
|
+
}
|
|
2948
|
+
function je(n) {
|
|
2934
2949
|
for (const e of Array.from(n.querySelectorAll("[data-block-kind]")))
|
|
2935
2950
|
e.removeAttribute("data-block-kind");
|
|
2936
2951
|
for (const e of Array.from(n.querySelectorAll("[data-block-label]")))
|
|
@@ -2947,12 +2962,12 @@ function O(n) {
|
|
|
2947
2962
|
if (n.tagName === "HR")
|
|
2948
2963
|
t.setStartAfter(n);
|
|
2949
2964
|
else {
|
|
2950
|
-
const o =
|
|
2965
|
+
const o = xn(n);
|
|
2951
2966
|
t.selectNodeContents(o), t.collapse(!0);
|
|
2952
2967
|
}
|
|
2953
2968
|
e.removeAllRanges(), e.addRange(t);
|
|
2954
2969
|
}
|
|
2955
|
-
function
|
|
2970
|
+
function xn(n) {
|
|
2956
2971
|
switch (n.tagName) {
|
|
2957
2972
|
case "UL":
|
|
2958
2973
|
case "OL": {
|
|
@@ -2978,32 +2993,32 @@ function Cn(n) {
|
|
|
2978
2993
|
function J(n) {
|
|
2979
2994
|
return n.appendChild(document.createElement("br")), n;
|
|
2980
2995
|
}
|
|
2981
|
-
function
|
|
2996
|
+
function Ue(n) {
|
|
2982
2997
|
const e = document.createElement(n), t = document.createElement("li");
|
|
2983
2998
|
return t.appendChild(document.createElement("br")), e.appendChild(t), e;
|
|
2984
2999
|
}
|
|
2985
|
-
function
|
|
3000
|
+
function We(n) {
|
|
2986
3001
|
const e = n.querySelectorAll(":scope > li");
|
|
2987
3002
|
return e.length === 0 ? !0 : e.length === 1 ? q(e[0]) : !1;
|
|
2988
3003
|
}
|
|
2989
3004
|
function q(n) {
|
|
2990
3005
|
return (n.textContent ?? "").replace(//g, "").trim().length === 0;
|
|
2991
3006
|
}
|
|
2992
|
-
function
|
|
3007
|
+
function En(n) {
|
|
2993
3008
|
return n === void 0 || n < 1 ? 1 : n > 6 ? 6 : n;
|
|
2994
3009
|
}
|
|
2995
|
-
function
|
|
3010
|
+
function Ee(n) {
|
|
2996
3011
|
if (!n) return {};
|
|
2997
3012
|
const e = {}, t = n.getAttribute("src"), o = n.getAttribute("alt");
|
|
2998
3013
|
return t && (e.src = t), o && (e.alt = o), e;
|
|
2999
3014
|
}
|
|
3000
|
-
const
|
|
3015
|
+
const Le = {
|
|
3001
3016
|
bulletList: "bulletList",
|
|
3002
3017
|
orderedList: "orderedList",
|
|
3003
3018
|
blockquote: "blockquote",
|
|
3004
3019
|
codeBlock: "codeBlock"
|
|
3005
3020
|
}, le = "application/x-aeriz-block";
|
|
3006
|
-
class
|
|
3021
|
+
class In {
|
|
3007
3022
|
constructor(e) {
|
|
3008
3023
|
w(this, "root");
|
|
3009
3024
|
w(this, "content");
|
|
@@ -3020,12 +3035,12 @@ class Rn {
|
|
|
3020
3035
|
w(this, "statusSourceEl");
|
|
3021
3036
|
w(this, "options");
|
|
3022
3037
|
w(this, "observer");
|
|
3023
|
-
w(this, "blockIds", new
|
|
3038
|
+
w(this, "blockIds", new Pe());
|
|
3024
3039
|
w(this, "idFor", (e) => this.blockIds.ensure(e));
|
|
3025
3040
|
w(this, "listeners", /* @__PURE__ */ new Set());
|
|
3026
3041
|
w(this, "handleSelectionChange", () => this.queueSync());
|
|
3027
3042
|
w(this, "handleResize", () => this.repositionHandles());
|
|
3028
|
-
w(this, "state",
|
|
3043
|
+
w(this, "state", Bn());
|
|
3029
3044
|
w(this, "destroyed", !1);
|
|
3030
3045
|
w(this, "syncQueued", !1);
|
|
3031
3046
|
w(this, "lastSerialized", "");
|
|
@@ -3043,8 +3058,8 @@ class Rn {
|
|
|
3043
3058
|
if (!(e.element instanceof HTMLElement))
|
|
3044
3059
|
throw new TypeError("AerizEditor: options.element must be an HTMLElement");
|
|
3045
3060
|
if (this.options = e, e.locale && (e.locale, void 0), this.root = document.createElement("div"), this.root.className = "aeriz-wysiwyg", e.theme && (this.root.dataset.theme = e.theme), e.toolbar !== !1) {
|
|
3046
|
-
const r = e.toolbar ??
|
|
3047
|
-
this.toolbar = new
|
|
3061
|
+
const r = e.toolbar ?? Ye;
|
|
3062
|
+
this.toolbar = new Ze(r, {
|
|
3048
3063
|
onAction: (s, a) => this.handleToolbarAction(s, a)
|
|
3049
3064
|
}), this.root.appendChild(this.toolbar.element);
|
|
3050
3065
|
}
|
|
@@ -3055,9 +3070,9 @@ class Rn {
|
|
|
3055
3070
|
}), this.contentWrap.appendChild(this.blockLabelPill), this.root.appendChild(this.contentWrap), this.statusBar = document.createElement("div"), this.statusBar.className = "aw-status-bar";
|
|
3056
3071
|
const t = document.createElement("div");
|
|
3057
3072
|
t.className = "aw-status-left";
|
|
3058
|
-
const o =
|
|
3073
|
+
const o = Ne("되돌리기 (Ctrl+Z)", E.undo, () => {
|
|
3059
3074
|
this.content.focus(), document.execCommand("undo");
|
|
3060
|
-
}), l =
|
|
3075
|
+
}), l = Ne("다시 실행 (Ctrl+Y)", E.redo, () => {
|
|
3061
3076
|
this.content.focus(), document.execCommand("redo");
|
|
3062
3077
|
});
|
|
3063
3078
|
this.statusBlockEl = document.createElement("span"), this.statusBlockEl.className = "aw-status-item", t.appendChild(o), t.appendChild(l), t.appendChild(this.statusBlockEl);
|
|
@@ -3083,8 +3098,8 @@ class Rn {
|
|
|
3083
3098
|
* data-block-id 는 보존.
|
|
3084
3099
|
*/
|
|
3085
3100
|
getHTML() {
|
|
3086
|
-
const e = this.content.cloneNode(!0), t =
|
|
3087
|
-
return o && (t.mode = o),
|
|
3101
|
+
const e = this.content.cloneNode(!0), t = Oe(this.root), o = this.currentTheme();
|
|
3102
|
+
return o && (t.mode = o), _e(e, t), je(e), e.innerHTML;
|
|
3088
3103
|
}
|
|
3089
3104
|
/** 가공 없는 원본 innerHTML. 직렬화 검증/디버그 용도. */
|
|
3090
3105
|
getRawHTML() {
|
|
@@ -3110,7 +3125,7 @@ class Rn {
|
|
|
3110
3125
|
* AerizViewer.setBlocks(snapshots) 가 받아 동일한 트리를 렌더할 수 있다.
|
|
3111
3126
|
*/
|
|
3112
3127
|
serialize() {
|
|
3113
|
-
return
|
|
3128
|
+
return qe(this.getBlocks());
|
|
3114
3129
|
}
|
|
3115
3130
|
/**
|
|
3116
3131
|
* data-block-id 로 본문에서 블록을 찾아 반환. 없으면 null.
|
|
@@ -3138,8 +3153,8 @@ class Rn {
|
|
|
3138
3153
|
this.flush(), this.content.focus(), O(r);
|
|
3139
3154
|
}
|
|
3140
3155
|
replaceBlock(e, t, o) {
|
|
3141
|
-
const l =
|
|
3142
|
-
return
|
|
3156
|
+
const l = gn(e), i = t.create(o);
|
|
3157
|
+
return bn(i, t.kind, l), i.setAttribute("data-block-explicit", "true"), e.element.replaceWith(i), i;
|
|
3143
3158
|
}
|
|
3144
3159
|
appendBlock(e, t) {
|
|
3145
3160
|
const o = e.create(t);
|
|
@@ -3172,9 +3187,9 @@ class Rn {
|
|
|
3172
3187
|
break;
|
|
3173
3188
|
}
|
|
3174
3189
|
case "fontFamily": {
|
|
3175
|
-
if (!
|
|
3190
|
+
if (!Ae(this.getActiveBlock())) return;
|
|
3176
3191
|
const o = this.detectActiveFontId();
|
|
3177
|
-
|
|
3192
|
+
$t(
|
|
3178
3193
|
t,
|
|
3179
3194
|
(l) => this.applyFontFamily(l.stack),
|
|
3180
3195
|
o ?? void 0
|
|
@@ -3182,9 +3197,9 @@ class Rn {
|
|
|
3182
3197
|
break;
|
|
3183
3198
|
}
|
|
3184
3199
|
case "fontSize": {
|
|
3185
|
-
if (!
|
|
3200
|
+
if (!Se(this.getActiveBlock())) return;
|
|
3186
3201
|
const o = this.detectActiveFontSize();
|
|
3187
|
-
|
|
3202
|
+
Dt(
|
|
3188
3203
|
t,
|
|
3189
3204
|
(l) => this.applyFontSize(l.px),
|
|
3190
3205
|
o ?? void 0
|
|
@@ -3211,7 +3226,7 @@ class Rn {
|
|
|
3211
3226
|
}
|
|
3212
3227
|
case "align": {
|
|
3213
3228
|
if (!ie(this.getActiveBlock())) return;
|
|
3214
|
-
|
|
3229
|
+
Bt(t, (o) => this.applyAlign(o));
|
|
3215
3230
|
break;
|
|
3216
3231
|
}
|
|
3217
3232
|
case "cellBg": {
|
|
@@ -3227,14 +3242,14 @@ class Rn {
|
|
|
3227
3242
|
}
|
|
3228
3243
|
case "tableMenu": {
|
|
3229
3244
|
if (!Y(this.getActiveBlock())) return;
|
|
3230
|
-
|
|
3245
|
+
It(t, (o) => this.runTableMenu(o));
|
|
3231
3246
|
break;
|
|
3232
3247
|
}
|
|
3233
3248
|
case "codeLang": {
|
|
3234
3249
|
const o = this.getActiveBlock();
|
|
3235
3250
|
if (!o || o.kind !== "codeBlock") return;
|
|
3236
3251
|
const l = o.element.querySelector(":scope > code"), i = (l == null ? void 0 : l.getAttribute("data-language")) ?? void 0;
|
|
3237
|
-
|
|
3252
|
+
zt(
|
|
3238
3253
|
t,
|
|
3239
3254
|
(r) => this.applyCodeLanguage(o.element, r.id),
|
|
3240
3255
|
i
|
|
@@ -3490,8 +3505,8 @@ class Rn {
|
|
|
3490
3505
|
* code 안에 있다면 textContent offset 으로 caret 위치 보존.
|
|
3491
3506
|
*/
|
|
3492
3507
|
rehighlightCode(e, t) {
|
|
3493
|
-
const o = e.textContent ?? "", l =
|
|
3494
|
-
e.innerHTML =
|
|
3508
|
+
const o = e.textContent ?? "", l = An(e);
|
|
3509
|
+
e.innerHTML = vt(o, t), l && Sn(e, l);
|
|
3495
3510
|
}
|
|
3496
3511
|
/**
|
|
3497
3512
|
* 본문에서 모든 codeBlock 을 순회하며 highlight 적용. setHTML / 초기 로드
|
|
@@ -3534,7 +3549,7 @@ class Rn {
|
|
|
3534
3549
|
this.content.style.cursor = "";
|
|
3535
3550
|
return;
|
|
3536
3551
|
}
|
|
3537
|
-
const o =
|
|
3552
|
+
const o = Te(t, e.clientX, e.clientY);
|
|
3538
3553
|
this.content.style.cursor = o === "right" ? "col-resize" : o === "bottom" ? "row-resize" : "";
|
|
3539
3554
|
}
|
|
3540
3555
|
/**
|
|
@@ -3555,7 +3570,7 @@ class Rn {
|
|
|
3555
3570
|
}
|
|
3556
3571
|
const l = (a = t == null ? void 0 : t.closest) == null ? void 0 : a.call(t, "td, th");
|
|
3557
3572
|
if (!(l instanceof HTMLTableCellElement)) return;
|
|
3558
|
-
const i =
|
|
3573
|
+
const i = Te(l, e.clientX, e.clientY);
|
|
3559
3574
|
if (!i) return;
|
|
3560
3575
|
if (e.preventDefault(), e.stopPropagation(), i === "right") {
|
|
3561
3576
|
const c = l.closest("tr"), d = c ? Array.from(c.children).indexOf(l) : -1, u = l.closest("table");
|
|
@@ -3654,7 +3669,7 @@ class Rn {
|
|
|
3654
3669
|
let t = e.getRangeAt(0).startContainer;
|
|
3655
3670
|
if (!t || !this.content.contains(t) || (t.nodeType !== Node.ELEMENT_NODE && (t = t.parentElement), !(t instanceof Element))) return null;
|
|
3656
3671
|
const o = getComputedStyle(t).fontFamily;
|
|
3657
|
-
return
|
|
3672
|
+
return st(o);
|
|
3658
3673
|
}
|
|
3659
3674
|
/**
|
|
3660
3675
|
* 선택 영역에 글자 크기를 적용한다. execCommand('fontSize') 는 1~7 만 받기
|
|
@@ -3720,7 +3735,7 @@ class Rn {
|
|
|
3720
3735
|
let t = e.getRangeAt(0).startContainer;
|
|
3721
3736
|
if (!t || !this.content.contains(t) || (t.nodeType !== Node.ELEMENT_NODE && (t = t.parentElement), !(t instanceof Element))) return null;
|
|
3722
3737
|
const o = getComputedStyle(t).fontSize;
|
|
3723
|
-
return
|
|
3738
|
+
return it(o);
|
|
3724
3739
|
}
|
|
3725
3740
|
/**
|
|
3726
3741
|
* 블록 유형 드롭다운을 열어 사용자 선택 결과를 처리한다.
|
|
@@ -3728,7 +3743,7 @@ class Rn {
|
|
|
3728
3743
|
* 로직(리치 블록 다이얼로그 분기 + targetId 보존) 을 공유한다.
|
|
3729
3744
|
*/
|
|
3730
3745
|
openBlockTypeMenu(e, t) {
|
|
3731
|
-
|
|
3746
|
+
Mt(e, (o) => {
|
|
3732
3747
|
if (o.kind === "linkCard") {
|
|
3733
3748
|
this.openLinkDialogAndApply(t);
|
|
3734
3749
|
return;
|
|
@@ -3742,7 +3757,7 @@ class Rn {
|
|
|
3742
3757
|
return;
|
|
3743
3758
|
}
|
|
3744
3759
|
if (o.kind === "table") {
|
|
3745
|
-
|
|
3760
|
+
Ht(e, (l) => {
|
|
3746
3761
|
this.setBlockType(
|
|
3747
3762
|
"table",
|
|
3748
3763
|
{ rows: l.rows, cols: l.cols },
|
|
@@ -3772,7 +3787,7 @@ class Rn {
|
|
|
3772
3787
|
* 그 id 의 블록을 정확히 변환 대상으로 삼는다.
|
|
3773
3788
|
*/
|
|
3774
3789
|
openLinkDialogAndApply(e) {
|
|
3775
|
-
|
|
3790
|
+
Xe({}, this.currentTheme()).then((t) => {
|
|
3776
3791
|
var r;
|
|
3777
3792
|
if (!t.confirmed || !t.href) return;
|
|
3778
3793
|
const o = t.href, l = ((r = t.text) == null ? void 0 : r.trim()) ?? "", i = l.length > 0 ? l : o;
|
|
@@ -3785,7 +3800,7 @@ class Rn {
|
|
|
3785
3800
|
*/
|
|
3786
3801
|
openImageDialogAndApply(e) {
|
|
3787
3802
|
const t = this.resolveImageUploadFn();
|
|
3788
|
-
|
|
3803
|
+
Qe(
|
|
3789
3804
|
{ ...t ? { onUpload: t } : {} },
|
|
3790
3805
|
this.currentTheme()
|
|
3791
3806
|
).then((o) => {
|
|
@@ -3797,9 +3812,9 @@ class Rn {
|
|
|
3797
3812
|
* 변환/추가. 잘못된 URL 이면 무시.
|
|
3798
3813
|
*/
|
|
3799
3814
|
openYouTubeDialogAndApply(e) {
|
|
3800
|
-
|
|
3815
|
+
nt(this.currentTheme()).then((t) => {
|
|
3801
3816
|
if (!t.confirmed || !t.url) return;
|
|
3802
|
-
const o =
|
|
3817
|
+
const o = Tn(t.url);
|
|
3803
3818
|
o && this.setBlockType("youtube", { videoId: o }, e);
|
|
3804
3819
|
});
|
|
3805
3820
|
}
|
|
@@ -3811,7 +3826,7 @@ class Rn {
|
|
|
3811
3826
|
* - 삽입된 element 는 MutationObserver flush 가 새 data-block-id 를 발급.
|
|
3812
3827
|
*/
|
|
3813
3828
|
openImportHtmlDialogAndApply(e) {
|
|
3814
|
-
|
|
3829
|
+
Je(this.currentTheme()).then(async (t) => {
|
|
3815
3830
|
if (!t.confirmed) return;
|
|
3816
3831
|
if (!t.html || t.html.length === 0) {
|
|
3817
3832
|
window.alert("가져올 HTML 이 비어 있습니다.");
|
|
@@ -3819,7 +3834,7 @@ class Rn {
|
|
|
3819
3834
|
}
|
|
3820
3835
|
let o;
|
|
3821
3836
|
try {
|
|
3822
|
-
o = await
|
|
3837
|
+
o = await qt(t.html, {
|
|
3823
3838
|
mountTarget: this.content
|
|
3824
3839
|
});
|
|
3825
3840
|
} catch (s) {
|
|
@@ -3834,7 +3849,7 @@ class Rn {
|
|
|
3834
3849
|
}
|
|
3835
3850
|
const l = e ? this.content.querySelector(`[data-block-id="${e}"]`) : null, i = [];
|
|
3836
3851
|
for (const s of o) {
|
|
3837
|
-
const a =
|
|
3852
|
+
const a = zn(s.tagName) ? s : (() => {
|
|
3838
3853
|
const c = document.createElement("p");
|
|
3839
3854
|
return c.appendChild(s), c;
|
|
3840
3855
|
})();
|
|
@@ -3866,7 +3881,7 @@ class Rn {
|
|
|
3866
3881
|
* 본문에 element 들을 삽입한다. importHtml 과 동일한 삽입 정책을 따른다.
|
|
3867
3882
|
*/
|
|
3868
3883
|
openMarkdownImportDialogAndApply(e) {
|
|
3869
|
-
|
|
3884
|
+
et(this.currentTheme()).then((t) => {
|
|
3870
3885
|
if (!t.confirmed) return;
|
|
3871
3886
|
if (!t.markdown || t.markdown.length === 0) {
|
|
3872
3887
|
window.alert("가져올 Markdown 이 비어 있습니다.");
|
|
@@ -3874,7 +3889,7 @@ class Rn {
|
|
|
3874
3889
|
}
|
|
3875
3890
|
let o;
|
|
3876
3891
|
try {
|
|
3877
|
-
o =
|
|
3892
|
+
o = jt(t.markdown);
|
|
3878
3893
|
} catch (r) {
|
|
3879
3894
|
console.error("Markdown 파싱 실패:", r);
|
|
3880
3895
|
const s = r instanceof Error ? r.message : String(r);
|
|
@@ -3915,7 +3930,7 @@ class Rn {
|
|
|
3915
3930
|
*/
|
|
3916
3931
|
openFileAttachmentDialogAndApply(e) {
|
|
3917
3932
|
const t = this.resolveFileUploadFn();
|
|
3918
|
-
|
|
3933
|
+
tt(
|
|
3919
3934
|
{ ...t ? { onUpload: t } : {} },
|
|
3920
3935
|
this.currentTheme()
|
|
3921
3936
|
).then((o) => {
|
|
@@ -3924,7 +3939,7 @@ class Rn {
|
|
|
3924
3939
|
window.alert("파일 URL 이 비어 있습니다.");
|
|
3925
3940
|
return;
|
|
3926
3941
|
}
|
|
3927
|
-
const l = { fileSrc: o.src }, i = o.name && o.name.length > 0 ? o.name :
|
|
3942
|
+
const l = { fileSrc: o.src }, i = o.name && o.name.length > 0 ? o.name : Nn(o.src);
|
|
3928
3943
|
i && (l.fileName = i), o.size !== void 0 && (l.fileSize = o.size), o.type && (l.fileType = o.type), this.setBlockType("file", l, e);
|
|
3929
3944
|
});
|
|
3930
3945
|
}
|
|
@@ -4174,7 +4189,7 @@ class Rn {
|
|
|
4174
4189
|
const o = (this.content.textContent ?? "").replace(/\s+/g, ""), l = Array.from(o).length;
|
|
4175
4190
|
this.statusCharsEl.textContent = `텍스트 ${l} 자`;
|
|
4176
4191
|
const i = this.content.innerHTML.length;
|
|
4177
|
-
this.statusSourceEl.textContent = `소스 ${
|
|
4192
|
+
this.statusSourceEl.textContent = `소스 ${Mn(i)}`;
|
|
4178
4193
|
}
|
|
4179
4194
|
syncBlockMarkers(e) {
|
|
4180
4195
|
for (const t of Array.from(this.content.children)) {
|
|
@@ -4189,39 +4204,39 @@ class Rn {
|
|
|
4189
4204
|
applyToolbarState(e, t) {
|
|
4190
4205
|
if (this.toolbar) {
|
|
4191
4206
|
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);
|
|
4192
|
-
for (const o of Object.keys(
|
|
4193
|
-
const l =
|
|
4207
|
+
for (const o of Object.keys(Le)) {
|
|
4208
|
+
const l = Le[o];
|
|
4194
4209
|
this.toolbar.setActive(o, (t == null ? void 0 : t.kind) === l);
|
|
4195
4210
|
}
|
|
4196
|
-
this.toolbar.setVisible("bold", _(t, "bold")), this.toolbar.setVisible("italic", _(t, "italic")), this.toolbar.setVisible("underline", _(t, "underline")), this.toolbar.setVisible("strike", _(t, "strike")), this.toolbar.setVisible("fontFamily",
|
|
4211
|
+
this.toolbar.setVisible("bold", _(t, "bold")), this.toolbar.setVisible("italic", _(t, "italic")), this.toolbar.setVisible("underline", _(t, "underline")), this.toolbar.setVisible("strike", _(t, "strike")), this.toolbar.setVisible("fontFamily", Ae(t)), this.toolbar.setVisible("fontSize", Se(t)), this.toolbar.setVisible("color", V(t)), this.toolbar.setVisible("backgroundColor", V(t)), this.toolbar.setVisible("align", ie(t)), this.toolbar.setVisible("cellBg", Y(t)), this.toolbar.setVisible("tableMenu", Y(t)), this.toolbar.setVisible("codeLang", (t == null ? void 0 : t.kind) === "codeBlock"), this.toolbar.syncGroupVisibility();
|
|
4197
4212
|
}
|
|
4198
4213
|
}
|
|
4199
4214
|
}
|
|
4200
4215
|
function _(n, e) {
|
|
4201
4216
|
return n ? (N[n.kind] ?? N.unknown).allowedMarks.includes(e) : !1;
|
|
4202
4217
|
}
|
|
4203
|
-
function
|
|
4218
|
+
function Ae(n) {
|
|
4204
4219
|
return n ? (N[n.kind] ?? N.unknown).allowsInlineFormat : !1;
|
|
4205
4220
|
}
|
|
4206
|
-
function
|
|
4221
|
+
function Se(n) {
|
|
4207
4222
|
return n ? (N[n.kind] ?? N.unknown).allowsFontSize : !1;
|
|
4208
4223
|
}
|
|
4209
4224
|
function V(n) {
|
|
4210
4225
|
return n ? (N[n.kind] ?? N.unknown).allowsColor : !1;
|
|
4211
4226
|
}
|
|
4212
|
-
const
|
|
4227
|
+
const Ln = /* @__PURE__ */ new Set([
|
|
4213
4228
|
"paragraph",
|
|
4214
4229
|
"heading",
|
|
4215
4230
|
"blockquote",
|
|
4216
4231
|
"table"
|
|
4217
4232
|
]);
|
|
4218
4233
|
function ie(n) {
|
|
4219
|
-
return n ?
|
|
4234
|
+
return n ? Ln.has(n.kind) : !1;
|
|
4220
4235
|
}
|
|
4221
4236
|
function Y(n) {
|
|
4222
4237
|
return (n == null ? void 0 : n.kind) === "table";
|
|
4223
4238
|
}
|
|
4224
|
-
function
|
|
4239
|
+
function An(n) {
|
|
4225
4240
|
const e = document.getSelection();
|
|
4226
4241
|
if (!e || e.rangeCount === 0) return null;
|
|
4227
4242
|
const t = e.getRangeAt(0);
|
|
@@ -4233,7 +4248,7 @@ function Ln(n) {
|
|
|
4233
4248
|
const i = o.toString().length;
|
|
4234
4249
|
return { start: l, end: i };
|
|
4235
4250
|
}
|
|
4236
|
-
function
|
|
4251
|
+
function Sn(n, e) {
|
|
4237
4252
|
var u;
|
|
4238
4253
|
const t = document.createTreeWalker(n, NodeFilter.SHOW_TEXT);
|
|
4239
4254
|
let o = 0, l = null, i = 0, r = null, s = 0, a = t.nextNode();
|
|
@@ -4276,14 +4291,14 @@ function re(n, e, t) {
|
|
|
4276
4291
|
}
|
|
4277
4292
|
return f;
|
|
4278
4293
|
}
|
|
4279
|
-
function
|
|
4294
|
+
function Te(n, e, t) {
|
|
4280
4295
|
const o = n.getBoundingClientRect(), l = 6;
|
|
4281
4296
|
return e < o.left - l || e > o.right + l || t < o.top - l || t > o.bottom + l ? null : e >= o.right - l ? "right" : t >= o.bottom - l ? "bottom" : null;
|
|
4282
4297
|
}
|
|
4283
4298
|
function se(n, e, t) {
|
|
4284
|
-
return n.getAttribute("data-block-explicit") === "true" || !e.isEmpty(n) ? t.kind === "unknown" ? n.tagName.toLowerCase() :
|
|
4299
|
+
return n.getAttribute("data-block-explicit") === "true" || !e.isEmpty(n) ? t.kind === "unknown" ? n.tagName.toLowerCase() : pn(t) : "?";
|
|
4285
4300
|
}
|
|
4286
|
-
function
|
|
4301
|
+
function Tn(n) {
|
|
4287
4302
|
const e = n.trim();
|
|
4288
4303
|
if (!e) return null;
|
|
4289
4304
|
let t;
|
|
@@ -4301,7 +4316,7 @@ function Sn(n) {
|
|
|
4301
4316
|
}
|
|
4302
4317
|
return null;
|
|
4303
4318
|
}
|
|
4304
|
-
function
|
|
4319
|
+
function Nn(n) {
|
|
4305
4320
|
var e;
|
|
4306
4321
|
try {
|
|
4307
4322
|
const l = new URL(n, "http://localhost").pathname.split("/").filter(Boolean).pop();
|
|
@@ -4310,14 +4325,14 @@ function Tn(n) {
|
|
|
4310
4325
|
return (((e = n.split("?")[0]) == null ? void 0 : e.split("#")[0]) ?? "").split("/").filter(Boolean).pop() ?? "";
|
|
4311
4326
|
}
|
|
4312
4327
|
}
|
|
4313
|
-
function
|
|
4328
|
+
function Mn(n) {
|
|
4314
4329
|
return n >= 1e6 ? `${(n / 1e6).toFixed(1)}M` : n >= 1e3 ? `${(n / 1e3).toFixed(1)}K` : `${n}`;
|
|
4315
4330
|
}
|
|
4316
|
-
function
|
|
4331
|
+
function Ne(n, e, t) {
|
|
4317
4332
|
const o = document.createElement("button");
|
|
4318
4333
|
return o.type = "button", o.className = "aw-status-action", o.title = n, o.setAttribute("aria-label", n), o.innerHTML = e, o.addEventListener("mousedown", (l) => l.preventDefault()), o.addEventListener("click", t), o;
|
|
4319
4334
|
}
|
|
4320
|
-
function
|
|
4335
|
+
function Bn() {
|
|
4321
4336
|
return {
|
|
4322
4337
|
blocks: [],
|
|
4323
4338
|
activeBlockId: null,
|
|
@@ -4331,7 +4346,7 @@ function Z(n) {
|
|
|
4331
4346
|
return !1;
|
|
4332
4347
|
}
|
|
4333
4348
|
}
|
|
4334
|
-
const
|
|
4349
|
+
const $n = /* @__PURE__ */ new Set([
|
|
4335
4350
|
"P",
|
|
4336
4351
|
"DIV",
|
|
4337
4352
|
"SECTION",
|
|
@@ -4363,14 +4378,14 @@ const Bn = /* @__PURE__ */ new Set([
|
|
|
4363
4378
|
"FIELDSET",
|
|
4364
4379
|
"ADDRESS"
|
|
4365
4380
|
]);
|
|
4366
|
-
function
|
|
4367
|
-
return
|
|
4381
|
+
function zn(n) {
|
|
4382
|
+
return $n.has(n.toUpperCase());
|
|
4368
4383
|
}
|
|
4369
|
-
class
|
|
4384
|
+
class Dn {
|
|
4370
4385
|
constructor(e) {
|
|
4371
4386
|
w(this, "root");
|
|
4372
4387
|
w(this, "content");
|
|
4373
|
-
w(this, "blockIds", new
|
|
4388
|
+
w(this, "blockIds", new Pe());
|
|
4374
4389
|
w(this, "idFor", (e) => this.blockIds.ensure(e));
|
|
4375
4390
|
w(this, "destroyed", !1);
|
|
4376
4391
|
if (!(e.element instanceof HTMLElement))
|
|
@@ -4385,11 +4400,11 @@ class In {
|
|
|
4385
4400
|
* 경로를 거치지 않는다.
|
|
4386
4401
|
*/
|
|
4387
4402
|
setBlocks(e) {
|
|
4388
|
-
|
|
4403
|
+
fn(this.content, e), ce(this.content, this.blockIds);
|
|
4389
4404
|
}
|
|
4390
4405
|
/** 현재 본문의 BlockSnapshot 배열을 반환한다. */
|
|
4391
4406
|
getBlocks() {
|
|
4392
|
-
return
|
|
4407
|
+
return qe(this.listBlocksInternal());
|
|
4393
4408
|
}
|
|
4394
4409
|
/** 임의의 노드를 받아 그 노드가 속한 블록을 반환한다. 본문 밖이면 null. */
|
|
4395
4410
|
getBlockOf(e) {
|
|
@@ -4400,8 +4415,8 @@ class In {
|
|
|
4400
4415
|
* 보이도록 portable 인라인 스타일을 입힌 자급자족적 HTML 을 반환한다.
|
|
4401
4416
|
*/
|
|
4402
4417
|
getHTML() {
|
|
4403
|
-
const e = this.content.cloneNode(!0), t =
|
|
4404
|
-
return (o === "light" || o === "dark") && (t.mode = o),
|
|
4418
|
+
const e = this.content.cloneNode(!0), t = Oe(this.root), o = this.root.dataset.theme;
|
|
4419
|
+
return (o === "light" || o === "dark") && (t.mode = o), _e(e, t), je(e), e.innerHTML;
|
|
4405
4420
|
}
|
|
4406
4421
|
setTheme(e) {
|
|
4407
4422
|
this.root.dataset.theme = e;
|
|
@@ -4416,28 +4431,28 @@ class In {
|
|
|
4416
4431
|
typeof globalThis.AerizWysiwyg == "object" && (globalThis.AerizEditor = globalThis.AerizWysiwyg.AerizEditor, globalThis.AerizViewer = globalThis.AerizWysiwyg.AerizViewer);
|
|
4417
4432
|
export {
|
|
4418
4433
|
Q as ALL_INLINE_MARKS,
|
|
4419
|
-
|
|
4420
|
-
|
|
4434
|
+
In as AerizEditor,
|
|
4435
|
+
Dn as AerizViewer,
|
|
4421
4436
|
F as BLOCK_ID_ATTR,
|
|
4422
|
-
|
|
4437
|
+
Fe as BLOCK_TYPES,
|
|
4423
4438
|
N as BLOCK_TYPE_BY_KIND,
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4439
|
+
Pe as BlockIdRegistry,
|
|
4440
|
+
Ye as DEFAULT_TOOLBAR,
|
|
4441
|
+
_e as applyBlockInlineStyles,
|
|
4427
4442
|
ce as assignMissingIds,
|
|
4428
4443
|
U as classifyBlockElement,
|
|
4429
|
-
|
|
4430
|
-
|
|
4444
|
+
gn as extractInlineContent,
|
|
4445
|
+
bn as fillInlineContent,
|
|
4431
4446
|
ue as findBlockFrom,
|
|
4432
|
-
|
|
4447
|
+
pn as getBlockLabel,
|
|
4433
4448
|
q as isElementBlank,
|
|
4434
4449
|
de as listBlocks,
|
|
4435
4450
|
we as normalizeContent,
|
|
4436
4451
|
O as placeCaretAtStart,
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4452
|
+
Oe as readBlockStyleTheme,
|
|
4453
|
+
mn as renderBlock,
|
|
4454
|
+
fn as renderBlocks,
|
|
4455
|
+
hn as serializeBlock,
|
|
4456
|
+
qe as serializeBlocks,
|
|
4457
|
+
je as stripEditorOnlyAttrs
|
|
4443
4458
|
};
|