@x-plat/design-system 0.5.49 → 0.5.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Button/index.css +6 -3
- package/dist/components/DatePicker/index.css +14 -7
- package/dist/components/Editor/index.cjs +760 -0
- package/dist/components/Editor/index.css +247 -0
- package/dist/components/Editor/index.d.cts +29 -0
- package/dist/components/Editor/index.d.ts +29 -0
- package/dist/components/Editor/index.js +727 -0
- package/dist/components/Input/index.css +8 -4
- package/dist/components/Select/index.css +10 -5
- package/dist/components/TextArea/index.css +3 -0
- package/dist/components/index.cjs +1002 -293
- package/dist/components/index.css +275 -12
- package/dist/components/index.d.cts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1001 -293
- package/dist/index.cjs +1026 -317
- package/dist/index.css +275 -12
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1025 -317
- package/package.json +1 -1
|
@@ -46,6 +46,7 @@ __export(components_exports, {
|
|
|
46
46
|
Divider: () => Divider_default,
|
|
47
47
|
Drawer: () => Drawer_default,
|
|
48
48
|
Dropdown: () => Dropdown_default,
|
|
49
|
+
Editor: () => Editor_default,
|
|
49
50
|
EmptyState: () => EmptyState_default,
|
|
50
51
|
FileUpload: () => FileUpload_default,
|
|
51
52
|
HtmlTypewriter: () => HtmlTypeWriter_default,
|
|
@@ -2097,14 +2098,14 @@ var CardTabRoot = (props) => {
|
|
|
2097
2098
|
);
|
|
2098
2099
|
return /* @__PURE__ */ (0, import_jsx_runtime304.jsxs)("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
|
|
2099
2100
|
/* @__PURE__ */ (0, import_jsx_runtime304.jsx)("div", { className: "card-tab-bar", children: tabs.map((tab) => {
|
|
2100
|
-
const
|
|
2101
|
+
const isActive2 = tab.value === activeValue;
|
|
2101
2102
|
return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(
|
|
2102
2103
|
"button",
|
|
2103
2104
|
{
|
|
2104
|
-
className: clsx_default("card-tab-trigger",
|
|
2105
|
+
className: clsx_default("card-tab-trigger", isActive2 && "active"),
|
|
2105
2106
|
onClick: () => handleTabClick(tab),
|
|
2106
2107
|
role: "tab",
|
|
2107
|
-
"aria-selected":
|
|
2108
|
+
"aria-selected": isActive2,
|
|
2108
2109
|
children: tab.title
|
|
2109
2110
|
},
|
|
2110
2111
|
tab.value
|
|
@@ -3466,12 +3467,12 @@ var import_react15 = __toESM(require("react"), 1);
|
|
|
3466
3467
|
var import_react14 = __toESM(require("react"), 1);
|
|
3467
3468
|
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
3468
3469
|
var TabItem = import_react14.default.forwardRef((props, ref) => {
|
|
3469
|
-
const { isActive, title, onClick } = props;
|
|
3470
|
+
const { isActive: isActive2, title, onClick } = props;
|
|
3470
3471
|
return /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
3471
3472
|
"div",
|
|
3472
3473
|
{
|
|
3473
3474
|
ref,
|
|
3474
|
-
className: clsx_default("tab-item",
|
|
3475
|
+
className: clsx_default("tab-item", isActive2 ? "active" : null),
|
|
3475
3476
|
onClick,
|
|
3476
3477
|
children: title
|
|
3477
3478
|
}
|
|
@@ -3894,24 +3895,731 @@ var Dropdown = (props) => {
|
|
|
3894
3895
|
Dropdown.displayName = "Dropdown";
|
|
3895
3896
|
var Dropdown_default = Dropdown;
|
|
3896
3897
|
|
|
3897
|
-
// src/components/
|
|
3898
|
+
// src/components/Editor/Editor.tsx
|
|
3899
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
3898
3900
|
var import_jsx_runtime324 = require("react/jsx-runtime");
|
|
3901
|
+
var DEFAULT_TOOLBAR = [
|
|
3902
|
+
"bold",
|
|
3903
|
+
"italic",
|
|
3904
|
+
"underline",
|
|
3905
|
+
"strikethrough",
|
|
3906
|
+
"code",
|
|
3907
|
+
"heading",
|
|
3908
|
+
"list",
|
|
3909
|
+
"ordered-list",
|
|
3910
|
+
"blockquote",
|
|
3911
|
+
"code-block",
|
|
3912
|
+
"link",
|
|
3913
|
+
"image",
|
|
3914
|
+
"divider"
|
|
3915
|
+
];
|
|
3916
|
+
var ALLOWED_TAGS = /* @__PURE__ */ new Set([
|
|
3917
|
+
"p",
|
|
3918
|
+
"br",
|
|
3919
|
+
"h1",
|
|
3920
|
+
"h2",
|
|
3921
|
+
"h3",
|
|
3922
|
+
"h4",
|
|
3923
|
+
"h5",
|
|
3924
|
+
"h6",
|
|
3925
|
+
"ul",
|
|
3926
|
+
"ol",
|
|
3927
|
+
"li",
|
|
3928
|
+
"blockquote",
|
|
3929
|
+
"pre",
|
|
3930
|
+
"code",
|
|
3931
|
+
"strong",
|
|
3932
|
+
"b",
|
|
3933
|
+
"em",
|
|
3934
|
+
"i",
|
|
3935
|
+
"u",
|
|
3936
|
+
"s",
|
|
3937
|
+
"strike",
|
|
3938
|
+
"del",
|
|
3939
|
+
"a",
|
|
3940
|
+
"img",
|
|
3941
|
+
"hr",
|
|
3942
|
+
"span",
|
|
3943
|
+
"div"
|
|
3944
|
+
]);
|
|
3945
|
+
var ALLOWED_ATTRS = {
|
|
3946
|
+
a: ["href", "target", "rel"],
|
|
3947
|
+
img: ["src", "alt"]
|
|
3948
|
+
};
|
|
3949
|
+
var sanitizeHtml = (input) => {
|
|
3950
|
+
const doc = new DOMParser().parseFromString(`<div>${input}</div>`, "text/html");
|
|
3951
|
+
const root = doc.body.firstElementChild;
|
|
3952
|
+
if (!root) return "";
|
|
3953
|
+
const walk = (node) => {
|
|
3954
|
+
const children = Array.from(node.children);
|
|
3955
|
+
for (const child of children) {
|
|
3956
|
+
const tag = child.tagName.toLowerCase();
|
|
3957
|
+
if (!ALLOWED_TAGS.has(tag)) {
|
|
3958
|
+
while (child.firstChild) node.insertBefore(child.firstChild, child);
|
|
3959
|
+
node.removeChild(child);
|
|
3960
|
+
continue;
|
|
3961
|
+
}
|
|
3962
|
+
const allowed = ALLOWED_ATTRS[tag] || [];
|
|
3963
|
+
for (const attr of Array.from(child.attributes)) {
|
|
3964
|
+
if (!allowed.includes(attr.name)) {
|
|
3965
|
+
child.removeAttribute(attr.name);
|
|
3966
|
+
}
|
|
3967
|
+
if (attr.name === "href" || attr.name === "src") {
|
|
3968
|
+
const val = attr.value.trim().toLowerCase();
|
|
3969
|
+
if (val.startsWith("javascript:") || val.startsWith("data:text/html")) {
|
|
3970
|
+
child.removeAttribute(attr.name);
|
|
3971
|
+
}
|
|
3972
|
+
}
|
|
3973
|
+
}
|
|
3974
|
+
walk(child);
|
|
3975
|
+
}
|
|
3976
|
+
};
|
|
3977
|
+
walk(root);
|
|
3978
|
+
return root.innerHTML;
|
|
3979
|
+
};
|
|
3980
|
+
var escapeHtml = (text) => {
|
|
3981
|
+
const div = document.createElement("div");
|
|
3982
|
+
div.textContent = text;
|
|
3983
|
+
return div.innerHTML.replace(/\n/g, "<br>");
|
|
3984
|
+
};
|
|
3985
|
+
var SLASH_ITEMS = [
|
|
3986
|
+
{ key: "paragraph", label: "\uB2E8\uB77D", hint: "\uAE30\uBCF8 \uD14D\uC2A4\uD2B8" },
|
|
3987
|
+
{ key: "heading", label: "\uC81C\uBAA9 1", hint: "\uD070 \uC81C\uBAA9" },
|
|
3988
|
+
{ key: "list", label: "\uAE00\uBA38\uB9AC \uAE30\uD638 \uBAA9\uB85D", hint: "\u2022 \uD56D\uBAA9" },
|
|
3989
|
+
{ key: "ordered-list", label: "\uBC88\uD638 \uB9E4\uAE30\uAE30 \uBAA9\uB85D", hint: "1. \uD56D\uBAA9" },
|
|
3990
|
+
{ key: "blockquote", label: "\uC778\uC6A9", hint: "" },
|
|
3991
|
+
{ key: "code-block", label: "\uCF54\uB4DC \uBE14\uB85D", hint: "" },
|
|
3992
|
+
{ key: "divider", label: "\uAD6C\uBD84\uC120", hint: "\u2500" },
|
|
3993
|
+
{ key: "image", label: "\uC774\uBBF8\uC9C0", hint: "" }
|
|
3994
|
+
];
|
|
3995
|
+
var Editor = (props) => {
|
|
3996
|
+
const {
|
|
3997
|
+
value = "",
|
|
3998
|
+
onChange,
|
|
3999
|
+
placeholder = "\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",
|
|
4000
|
+
readOnly = false,
|
|
4001
|
+
toolbar = DEFAULT_TOOLBAR,
|
|
4002
|
+
enableSlashCommand = true,
|
|
4003
|
+
enableMarkdownShortcuts = true,
|
|
4004
|
+
onImageUpload,
|
|
4005
|
+
minHeight = 200
|
|
4006
|
+
} = props;
|
|
4007
|
+
const editorRef = import_react22.default.useRef(null);
|
|
4008
|
+
const lastRangeRef = import_react22.default.useRef(null);
|
|
4009
|
+
const composingRef = import_react22.default.useRef(false);
|
|
4010
|
+
const [isFocused, setIsFocused] = import_react22.default.useState(false);
|
|
4011
|
+
const [isEmpty, setIsEmpty] = import_react22.default.useState(!value);
|
|
4012
|
+
const [activeFormats, setActiveFormats] = import_react22.default.useState(/* @__PURE__ */ new Set());
|
|
4013
|
+
const [slashOpen, setSlashOpen] = import_react22.default.useState(false);
|
|
4014
|
+
const [slashFilter, setSlashFilter] = import_react22.default.useState("");
|
|
4015
|
+
const [slashIdx, setSlashIdx] = import_react22.default.useState(0);
|
|
4016
|
+
const [slashPos, setSlashPos] = import_react22.default.useState({ top: 0, left: 0 });
|
|
4017
|
+
const slashStartRangeRef = import_react22.default.useRef(null);
|
|
4018
|
+
const [linkOpen, setLinkOpen] = import_react22.default.useState(false);
|
|
4019
|
+
const [linkValue, setLinkValue] = import_react22.default.useState("");
|
|
4020
|
+
const [linkPos, setLinkPos] = import_react22.default.useState({ top: 0, left: 0 });
|
|
4021
|
+
import_react22.default.useEffect(() => {
|
|
4022
|
+
if (!editorRef.current) return;
|
|
4023
|
+
if (editorRef.current.innerHTML !== value) {
|
|
4024
|
+
editorRef.current.innerHTML = sanitizeHtml(value || "");
|
|
4025
|
+
updateEmpty();
|
|
4026
|
+
}
|
|
4027
|
+
}, [value]);
|
|
4028
|
+
const updateEmpty = () => {
|
|
4029
|
+
const el = editorRef.current;
|
|
4030
|
+
if (!el) return;
|
|
4031
|
+
const text = el.textContent || "";
|
|
4032
|
+
const childCount = el.children.length;
|
|
4033
|
+
setIsEmpty(text.length === 0 && childCount <= 1);
|
|
4034
|
+
};
|
|
4035
|
+
const saveSelection = () => {
|
|
4036
|
+
const sel = window.getSelection();
|
|
4037
|
+
if (sel && sel.rangeCount > 0 && editorRef.current?.contains(sel.anchorNode)) {
|
|
4038
|
+
lastRangeRef.current = sel.getRangeAt(0).cloneRange();
|
|
4039
|
+
}
|
|
4040
|
+
};
|
|
4041
|
+
const restoreSelection = () => {
|
|
4042
|
+
if (!lastRangeRef.current) return;
|
|
4043
|
+
const sel = window.getSelection();
|
|
4044
|
+
sel?.removeAllRanges();
|
|
4045
|
+
sel?.addRange(lastRangeRef.current);
|
|
4046
|
+
};
|
|
4047
|
+
const updateActiveFormats = () => {
|
|
4048
|
+
if (!editorRef.current) return;
|
|
4049
|
+
const sel = window.getSelection();
|
|
4050
|
+
if (!sel || !editorRef.current.contains(sel.anchorNode)) return;
|
|
4051
|
+
const next = /* @__PURE__ */ new Set();
|
|
4052
|
+
try {
|
|
4053
|
+
if (document.queryCommandState("bold")) next.add("bold");
|
|
4054
|
+
if (document.queryCommandState("italic")) next.add("italic");
|
|
4055
|
+
if (document.queryCommandState("underline")) next.add("underline");
|
|
4056
|
+
if (document.queryCommandState("strikethrough")) next.add("strikethrough");
|
|
4057
|
+
if (document.queryCommandState("insertUnorderedList")) next.add("list");
|
|
4058
|
+
if (document.queryCommandState("insertOrderedList")) next.add("ordered-list");
|
|
4059
|
+
const block = String(document.queryCommandValue("formatBlock") || "").toLowerCase();
|
|
4060
|
+
if (block) next.add(`block:${block}`);
|
|
4061
|
+
} catch {
|
|
4062
|
+
}
|
|
4063
|
+
setActiveFormats(next);
|
|
4064
|
+
};
|
|
4065
|
+
const exec = (cmd, val) => {
|
|
4066
|
+
document.execCommand(cmd, false, val);
|
|
4067
|
+
editorRef.current?.focus();
|
|
4068
|
+
updateActiveFormats();
|
|
4069
|
+
handleInput();
|
|
4070
|
+
};
|
|
4071
|
+
const setBlock = (tag) => {
|
|
4072
|
+
exec("formatBlock", tag);
|
|
4073
|
+
};
|
|
4074
|
+
const insertDivider = () => {
|
|
4075
|
+
exec("insertHorizontalRule");
|
|
4076
|
+
const el = editorRef.current;
|
|
4077
|
+
if (el && el.lastElementChild?.tagName === "HR") {
|
|
4078
|
+
const p = document.createElement("p");
|
|
4079
|
+
p.innerHTML = "<br>";
|
|
4080
|
+
el.appendChild(p);
|
|
4081
|
+
handleInput();
|
|
4082
|
+
}
|
|
4083
|
+
};
|
|
4084
|
+
const insertImageByUrl = (url) => {
|
|
4085
|
+
if (!url) return;
|
|
4086
|
+
exec("insertImage", url);
|
|
4087
|
+
};
|
|
4088
|
+
const triggerImageUpload = async () => {
|
|
4089
|
+
if (!onImageUpload) {
|
|
4090
|
+
const url = window.prompt("\uC774\uBBF8\uC9C0 URL");
|
|
4091
|
+
if (url) {
|
|
4092
|
+
restoreSelection();
|
|
4093
|
+
insertImageByUrl(url);
|
|
4094
|
+
}
|
|
4095
|
+
return;
|
|
4096
|
+
}
|
|
4097
|
+
const input = document.createElement("input");
|
|
4098
|
+
input.type = "file";
|
|
4099
|
+
input.accept = "image/*";
|
|
4100
|
+
input.onchange = async () => {
|
|
4101
|
+
const file = input.files?.[0];
|
|
4102
|
+
if (!file) return;
|
|
4103
|
+
try {
|
|
4104
|
+
const url = await onImageUpload(file);
|
|
4105
|
+
restoreSelection();
|
|
4106
|
+
insertImageByUrl(url);
|
|
4107
|
+
} catch (err) {
|
|
4108
|
+
console.error("\uC774\uBBF8\uC9C0 \uC5C5\uB85C\uB4DC \uC2E4\uD328:", err);
|
|
4109
|
+
}
|
|
4110
|
+
};
|
|
4111
|
+
input.click();
|
|
4112
|
+
};
|
|
4113
|
+
const openSlashMenu = () => {
|
|
4114
|
+
if (!enableSlashCommand) return;
|
|
4115
|
+
const sel = window.getSelection();
|
|
4116
|
+
if (!sel || sel.rangeCount === 0) return;
|
|
4117
|
+
const range = sel.getRangeAt(0);
|
|
4118
|
+
slashStartRangeRef.current = range.cloneRange();
|
|
4119
|
+
const rect = range.getBoundingClientRect();
|
|
4120
|
+
const editorRect = editorRef.current.getBoundingClientRect();
|
|
4121
|
+
setSlashPos({
|
|
4122
|
+
top: rect.bottom - editorRect.top + 4,
|
|
4123
|
+
left: rect.left - editorRect.left
|
|
4124
|
+
});
|
|
4125
|
+
setSlashFilter("");
|
|
4126
|
+
setSlashIdx(0);
|
|
4127
|
+
setSlashOpen(true);
|
|
4128
|
+
};
|
|
4129
|
+
const closeSlashMenu = () => {
|
|
4130
|
+
setSlashOpen(false);
|
|
4131
|
+
setSlashFilter("");
|
|
4132
|
+
setSlashIdx(0);
|
|
4133
|
+
slashStartRangeRef.current = null;
|
|
4134
|
+
};
|
|
4135
|
+
const filteredSlashItems = import_react22.default.useMemo(() => {
|
|
4136
|
+
if (!slashFilter) return SLASH_ITEMS;
|
|
4137
|
+
const f = slashFilter.toLowerCase();
|
|
4138
|
+
return SLASH_ITEMS.filter((it) => it.label.toLowerCase().includes(f) || it.key.includes(f));
|
|
4139
|
+
}, [slashFilter]);
|
|
4140
|
+
const removeSlashTrigger = () => {
|
|
4141
|
+
const sel = window.getSelection();
|
|
4142
|
+
if (!sel || sel.rangeCount === 0) return;
|
|
4143
|
+
const range = sel.getRangeAt(0);
|
|
4144
|
+
const node = range.startContainer;
|
|
4145
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
4146
|
+
const text = node.textContent || "";
|
|
4147
|
+
const idx = text.lastIndexOf("/");
|
|
4148
|
+
if (idx >= 0) {
|
|
4149
|
+
node.textContent = text.slice(0, idx) + text.slice(range.startOffset);
|
|
4150
|
+
const newRange = document.createRange();
|
|
4151
|
+
newRange.setStart(node, idx);
|
|
4152
|
+
newRange.collapse(true);
|
|
4153
|
+
sel.removeAllRanges();
|
|
4154
|
+
sel.addRange(newRange);
|
|
4155
|
+
}
|
|
4156
|
+
}
|
|
4157
|
+
};
|
|
4158
|
+
const applySlashItem = (item) => {
|
|
4159
|
+
removeSlashTrigger();
|
|
4160
|
+
closeSlashMenu();
|
|
4161
|
+
switch (item.key) {
|
|
4162
|
+
case "paragraph":
|
|
4163
|
+
setBlock("p");
|
|
4164
|
+
break;
|
|
4165
|
+
case "heading":
|
|
4166
|
+
setBlock("h2");
|
|
4167
|
+
break;
|
|
4168
|
+
case "list":
|
|
4169
|
+
exec("insertUnorderedList");
|
|
4170
|
+
break;
|
|
4171
|
+
case "ordered-list":
|
|
4172
|
+
exec("insertOrderedList");
|
|
4173
|
+
break;
|
|
4174
|
+
case "blockquote":
|
|
4175
|
+
setBlock("blockquote");
|
|
4176
|
+
break;
|
|
4177
|
+
case "code-block":
|
|
4178
|
+
setBlock("pre");
|
|
4179
|
+
break;
|
|
4180
|
+
case "divider":
|
|
4181
|
+
insertDivider();
|
|
4182
|
+
break;
|
|
4183
|
+
case "image":
|
|
4184
|
+
triggerImageUpload();
|
|
4185
|
+
break;
|
|
4186
|
+
default:
|
|
4187
|
+
break;
|
|
4188
|
+
}
|
|
4189
|
+
};
|
|
4190
|
+
const openLinkEditor = () => {
|
|
4191
|
+
saveSelection();
|
|
4192
|
+
const sel = window.getSelection();
|
|
4193
|
+
if (!sel || sel.rangeCount === 0) return;
|
|
4194
|
+
const range = sel.getRangeAt(0);
|
|
4195
|
+
const rect = range.getBoundingClientRect();
|
|
4196
|
+
const editorRect = editorRef.current.getBoundingClientRect();
|
|
4197
|
+
setLinkPos({
|
|
4198
|
+
top: rect.bottom - editorRect.top + 4,
|
|
4199
|
+
left: rect.left - editorRect.left
|
|
4200
|
+
});
|
|
4201
|
+
const anchor = sel.anchorNode?.parentElement?.closest("a");
|
|
4202
|
+
setLinkValue(anchor?.getAttribute("href") || "");
|
|
4203
|
+
setLinkOpen(true);
|
|
4204
|
+
};
|
|
4205
|
+
const applyLink = () => {
|
|
4206
|
+
restoreSelection();
|
|
4207
|
+
if (linkValue) {
|
|
4208
|
+
exec("createLink", linkValue);
|
|
4209
|
+
const sel = window.getSelection();
|
|
4210
|
+
const anchor = sel?.anchorNode?.parentElement?.closest("a");
|
|
4211
|
+
if (anchor) {
|
|
4212
|
+
anchor.setAttribute("target", "_blank");
|
|
4213
|
+
anchor.setAttribute("rel", "noopener noreferrer");
|
|
4214
|
+
}
|
|
4215
|
+
} else {
|
|
4216
|
+
exec("unlink");
|
|
4217
|
+
}
|
|
4218
|
+
setLinkOpen(false);
|
|
4219
|
+
};
|
|
4220
|
+
const tryMarkdownShortcut = () => {
|
|
4221
|
+
if (!enableMarkdownShortcuts) return false;
|
|
4222
|
+
const sel = window.getSelection();
|
|
4223
|
+
if (!sel || sel.rangeCount === 0) return false;
|
|
4224
|
+
const range = sel.getRangeAt(0);
|
|
4225
|
+
const node = range.startContainer;
|
|
4226
|
+
if (node.nodeType !== Node.TEXT_NODE) return false;
|
|
4227
|
+
const text = (node.textContent || "").slice(0, range.startOffset);
|
|
4228
|
+
const patterns = [
|
|
4229
|
+
[/^###\s$/, () => setBlock("h3")],
|
|
4230
|
+
[/^##\s$/, () => setBlock("h2")],
|
|
4231
|
+
[/^#\s$/, () => setBlock("h1")],
|
|
4232
|
+
[/^-\s$/, () => exec("insertUnorderedList")],
|
|
4233
|
+
[/^\*\s$/, () => exec("insertUnorderedList")],
|
|
4234
|
+
[/^1\.\s$/, () => exec("insertOrderedList")],
|
|
4235
|
+
[/^>\s$/, () => setBlock("blockquote")]
|
|
4236
|
+
];
|
|
4237
|
+
for (const [re, fn] of patterns) {
|
|
4238
|
+
if (re.test(text)) {
|
|
4239
|
+
node.textContent = (node.textContent || "").slice(range.startOffset);
|
|
4240
|
+
const newRange = document.createRange();
|
|
4241
|
+
newRange.setStart(node, 0);
|
|
4242
|
+
newRange.collapse(true);
|
|
4243
|
+
sel.removeAllRanges();
|
|
4244
|
+
sel.addRange(newRange);
|
|
4245
|
+
fn();
|
|
4246
|
+
return true;
|
|
4247
|
+
}
|
|
4248
|
+
}
|
|
4249
|
+
return false;
|
|
4250
|
+
};
|
|
4251
|
+
const handleInput = () => {
|
|
4252
|
+
if (composingRef.current) return;
|
|
4253
|
+
const el = editorRef.current;
|
|
4254
|
+
if (!el) return;
|
|
4255
|
+
onChange?.(el.innerHTML);
|
|
4256
|
+
updateEmpty();
|
|
4257
|
+
updateActiveFormats();
|
|
4258
|
+
if (slashOpen) {
|
|
4259
|
+
const sel = window.getSelection();
|
|
4260
|
+
if (sel && sel.rangeCount > 0) {
|
|
4261
|
+
const range = sel.getRangeAt(0);
|
|
4262
|
+
const node = range.startContainer;
|
|
4263
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
4264
|
+
const text = node.textContent || "";
|
|
4265
|
+
const lastSlash = text.lastIndexOf("/", range.startOffset - 1);
|
|
4266
|
+
if (lastSlash >= 0) {
|
|
4267
|
+
const filter = text.slice(lastSlash + 1, range.startOffset);
|
|
4268
|
+
if (filter.includes(" ") || filter.includes("\n")) {
|
|
4269
|
+
closeSlashMenu();
|
|
4270
|
+
} else {
|
|
4271
|
+
setSlashFilter(filter);
|
|
4272
|
+
setSlashIdx(0);
|
|
4273
|
+
}
|
|
4274
|
+
} else {
|
|
4275
|
+
closeSlashMenu();
|
|
4276
|
+
}
|
|
4277
|
+
}
|
|
4278
|
+
}
|
|
4279
|
+
}
|
|
4280
|
+
};
|
|
4281
|
+
const handleKeyDown = (e) => {
|
|
4282
|
+
if (readOnly) return;
|
|
4283
|
+
if (slashOpen) {
|
|
4284
|
+
if (e.key === "ArrowDown") {
|
|
4285
|
+
e.preventDefault();
|
|
4286
|
+
setSlashIdx((i) => Math.min(i + 1, filteredSlashItems.length - 1));
|
|
4287
|
+
return;
|
|
4288
|
+
}
|
|
4289
|
+
if (e.key === "ArrowUp") {
|
|
4290
|
+
e.preventDefault();
|
|
4291
|
+
setSlashIdx((i) => Math.max(i - 1, 0));
|
|
4292
|
+
return;
|
|
4293
|
+
}
|
|
4294
|
+
if (e.key === "Enter") {
|
|
4295
|
+
e.preventDefault();
|
|
4296
|
+
const item = filteredSlashItems[slashIdx];
|
|
4297
|
+
if (item) applySlashItem(item);
|
|
4298
|
+
return;
|
|
4299
|
+
}
|
|
4300
|
+
if (e.key === "Escape") {
|
|
4301
|
+
e.preventDefault();
|
|
4302
|
+
closeSlashMenu();
|
|
4303
|
+
return;
|
|
4304
|
+
}
|
|
4305
|
+
}
|
|
4306
|
+
if ((e.metaKey || e.ctrlKey) && !e.shiftKey && !e.altKey) {
|
|
4307
|
+
const k = e.key.toLowerCase();
|
|
4308
|
+
if (k === "b") {
|
|
4309
|
+
e.preventDefault();
|
|
4310
|
+
exec("bold");
|
|
4311
|
+
return;
|
|
4312
|
+
}
|
|
4313
|
+
if (k === "i") {
|
|
4314
|
+
e.preventDefault();
|
|
4315
|
+
exec("italic");
|
|
4316
|
+
return;
|
|
4317
|
+
}
|
|
4318
|
+
if (k === "u") {
|
|
4319
|
+
e.preventDefault();
|
|
4320
|
+
exec("underline");
|
|
4321
|
+
return;
|
|
4322
|
+
}
|
|
4323
|
+
if (k === "k") {
|
|
4324
|
+
e.preventDefault();
|
|
4325
|
+
openLinkEditor();
|
|
4326
|
+
return;
|
|
4327
|
+
}
|
|
4328
|
+
}
|
|
4329
|
+
if (enableSlashCommand && e.key === "/") {
|
|
4330
|
+
setTimeout(openSlashMenu, 0);
|
|
4331
|
+
}
|
|
4332
|
+
if (enableMarkdownShortcuts && e.key === " ") {
|
|
4333
|
+
if (tryMarkdownShortcut()) {
|
|
4334
|
+
e.preventDefault();
|
|
4335
|
+
}
|
|
4336
|
+
}
|
|
4337
|
+
};
|
|
4338
|
+
const handlePaste = (e) => {
|
|
4339
|
+
if (readOnly) return;
|
|
4340
|
+
e.preventDefault();
|
|
4341
|
+
const html = e.clipboardData.getData("text/html");
|
|
4342
|
+
const text = e.clipboardData.getData("text/plain");
|
|
4343
|
+
const clean = html ? sanitizeHtml(html) : escapeHtml(text);
|
|
4344
|
+
document.execCommand("insertHTML", false, clean);
|
|
4345
|
+
handleInput();
|
|
4346
|
+
};
|
|
4347
|
+
const handleCompositionStart = () => {
|
|
4348
|
+
composingRef.current = true;
|
|
4349
|
+
};
|
|
4350
|
+
const handleCompositionEnd = () => {
|
|
4351
|
+
composingRef.current = false;
|
|
4352
|
+
handleInput();
|
|
4353
|
+
};
|
|
4354
|
+
const handleFocus = () => {
|
|
4355
|
+
setIsFocused(true);
|
|
4356
|
+
updateActiveFormats();
|
|
4357
|
+
};
|
|
4358
|
+
const handleBlur = () => {
|
|
4359
|
+
setIsFocused(false);
|
|
4360
|
+
saveSelection();
|
|
4361
|
+
};
|
|
4362
|
+
const handleSelectionUpdate = () => {
|
|
4363
|
+
updateActiveFormats();
|
|
4364
|
+
};
|
|
4365
|
+
const onToolbarAction = (item) => {
|
|
4366
|
+
switch (item) {
|
|
4367
|
+
case "bold":
|
|
4368
|
+
exec("bold");
|
|
4369
|
+
break;
|
|
4370
|
+
case "italic":
|
|
4371
|
+
exec("italic");
|
|
4372
|
+
break;
|
|
4373
|
+
case "underline":
|
|
4374
|
+
exec("underline");
|
|
4375
|
+
break;
|
|
4376
|
+
case "strikethrough":
|
|
4377
|
+
exec("strikethrough");
|
|
4378
|
+
break;
|
|
4379
|
+
case "code": {
|
|
4380
|
+
const sel = window.getSelection();
|
|
4381
|
+
if (!sel || sel.rangeCount === 0 || sel.isCollapsed) return;
|
|
4382
|
+
const range = sel.getRangeAt(0);
|
|
4383
|
+
const code = document.createElement("code");
|
|
4384
|
+
try {
|
|
4385
|
+
range.surroundContents(code);
|
|
4386
|
+
} catch {
|
|
4387
|
+
const frag = range.extractContents();
|
|
4388
|
+
code.appendChild(frag);
|
|
4389
|
+
range.insertNode(code);
|
|
4390
|
+
}
|
|
4391
|
+
handleInput();
|
|
4392
|
+
break;
|
|
4393
|
+
}
|
|
4394
|
+
case "heading":
|
|
4395
|
+
setBlock("h2");
|
|
4396
|
+
break;
|
|
4397
|
+
case "list":
|
|
4398
|
+
exec("insertUnorderedList");
|
|
4399
|
+
break;
|
|
4400
|
+
case "ordered-list":
|
|
4401
|
+
exec("insertOrderedList");
|
|
4402
|
+
break;
|
|
4403
|
+
case "blockquote":
|
|
4404
|
+
setBlock("blockquote");
|
|
4405
|
+
break;
|
|
4406
|
+
case "code-block":
|
|
4407
|
+
setBlock("pre");
|
|
4408
|
+
break;
|
|
4409
|
+
case "link":
|
|
4410
|
+
openLinkEditor();
|
|
4411
|
+
break;
|
|
4412
|
+
case "image":
|
|
4413
|
+
triggerImageUpload();
|
|
4414
|
+
break;
|
|
4415
|
+
case "divider":
|
|
4416
|
+
insertDivider();
|
|
4417
|
+
break;
|
|
4418
|
+
}
|
|
4419
|
+
};
|
|
4420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)("div", { className: clsx_default("lib-xplat-editor", isFocused && "focused", readOnly && "readonly"), children: [
|
|
4421
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
4422
|
+
EditorToolbar,
|
|
4423
|
+
{
|
|
4424
|
+
items: toolbar,
|
|
4425
|
+
active: activeFormats,
|
|
4426
|
+
onAction: onToolbarAction
|
|
4427
|
+
}
|
|
4428
|
+
),
|
|
4429
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsxs)("div", { className: "lib-xplat-editor__content", style: { minHeight }, children: [
|
|
4430
|
+
isEmpty && !isFocused && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("div", { className: "lib-xplat-editor__placeholder", children: placeholder }),
|
|
4431
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
4432
|
+
"div",
|
|
4433
|
+
{
|
|
4434
|
+
ref: editorRef,
|
|
4435
|
+
contentEditable: !readOnly,
|
|
4436
|
+
suppressContentEditableWarning: true,
|
|
4437
|
+
className: "lib-xplat-editor__editable",
|
|
4438
|
+
onInput: handleInput,
|
|
4439
|
+
onKeyDown: handleKeyDown,
|
|
4440
|
+
onKeyUp: handleSelectionUpdate,
|
|
4441
|
+
onMouseUp: handleSelectionUpdate,
|
|
4442
|
+
onPaste: handlePaste,
|
|
4443
|
+
onCompositionStart: handleCompositionStart,
|
|
4444
|
+
onCompositionEnd: handleCompositionEnd,
|
|
4445
|
+
onFocus: handleFocus,
|
|
4446
|
+
onBlur: handleBlur,
|
|
4447
|
+
spellCheck: true
|
|
4448
|
+
}
|
|
4449
|
+
),
|
|
4450
|
+
slashOpen && filteredSlashItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
4451
|
+
SlashMenu,
|
|
4452
|
+
{
|
|
4453
|
+
position: slashPos,
|
|
4454
|
+
items: filteredSlashItems,
|
|
4455
|
+
activeIndex: slashIdx,
|
|
4456
|
+
onSelect: applySlashItem,
|
|
4457
|
+
onClose: closeSlashMenu
|
|
4458
|
+
}
|
|
4459
|
+
),
|
|
4460
|
+
linkOpen && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
4461
|
+
LinkPopover,
|
|
4462
|
+
{
|
|
4463
|
+
position: linkPos,
|
|
4464
|
+
value: linkValue,
|
|
4465
|
+
onChange: setLinkValue,
|
|
4466
|
+
onConfirm: applyLink,
|
|
4467
|
+
onClose: () => setLinkOpen(false)
|
|
4468
|
+
}
|
|
4469
|
+
)
|
|
4470
|
+
] })
|
|
4471
|
+
] });
|
|
4472
|
+
};
|
|
4473
|
+
Editor.displayName = "Editor";
|
|
4474
|
+
var Editor_default = Editor;
|
|
4475
|
+
var TOOLBAR_LABEL = {
|
|
4476
|
+
bold: "B",
|
|
4477
|
+
italic: "I",
|
|
4478
|
+
underline: "U",
|
|
4479
|
+
strikethrough: "S",
|
|
4480
|
+
code: "<>",
|
|
4481
|
+
heading: "H",
|
|
4482
|
+
list: "\u2022",
|
|
4483
|
+
"ordered-list": "1.",
|
|
4484
|
+
blockquote: "\u275D",
|
|
4485
|
+
"code-block": "[ ]",
|
|
4486
|
+
link: "\u{1F517}",
|
|
4487
|
+
image: "\u{1F5BC}",
|
|
4488
|
+
divider: "\u2014"
|
|
4489
|
+
};
|
|
4490
|
+
var TOOLBAR_TITLE = {
|
|
4491
|
+
bold: "\uAD75\uAC8C (\u2318B)",
|
|
4492
|
+
italic: "\uAE30\uC6B8\uC784 (\u2318I)",
|
|
4493
|
+
underline: "\uBC11\uC904 (\u2318U)",
|
|
4494
|
+
strikethrough: "\uCDE8\uC18C\uC120",
|
|
4495
|
+
code: "\uC778\uB77C\uC778 \uCF54\uB4DC",
|
|
4496
|
+
heading: "\uC81C\uBAA9",
|
|
4497
|
+
list: "\uAE00\uBA38\uB9AC \uAE30\uD638 \uBAA9\uB85D",
|
|
4498
|
+
"ordered-list": "\uBC88\uD638 \uB9E4\uAE30\uAE30 \uBAA9\uB85D",
|
|
4499
|
+
blockquote: "\uC778\uC6A9",
|
|
4500
|
+
"code-block": "\uCF54\uB4DC \uBE14\uB85D",
|
|
4501
|
+
link: "\uB9C1\uD06C (\u2318K)",
|
|
4502
|
+
image: "\uC774\uBBF8\uC9C0",
|
|
4503
|
+
divider: "\uAD6C\uBD84\uC120"
|
|
4504
|
+
};
|
|
4505
|
+
var isActive = (item, active) => {
|
|
4506
|
+
if (item === "heading") return active.has("block:h1") || active.has("block:h2") || active.has("block:h3");
|
|
4507
|
+
if (item === "blockquote") return active.has("block:blockquote");
|
|
4508
|
+
if (item === "code-block") return active.has("block:pre");
|
|
4509
|
+
return active.has(item);
|
|
4510
|
+
};
|
|
4511
|
+
var EditorToolbar = ({ items, active, onAction }) => {
|
|
4512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("div", { className: "lib-xplat-editor__toolbar", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
4513
|
+
"button",
|
|
4514
|
+
{
|
|
4515
|
+
type: "button",
|
|
4516
|
+
className: clsx_default("lib-xplat-editor__toolbar-btn", isActive(item, active) && "active"),
|
|
4517
|
+
title: TOOLBAR_TITLE[item],
|
|
4518
|
+
onMouseDown: (e) => {
|
|
4519
|
+
e.preventDefault();
|
|
4520
|
+
onAction(item);
|
|
4521
|
+
},
|
|
4522
|
+
children: TOOLBAR_LABEL[item]
|
|
4523
|
+
},
|
|
4524
|
+
item
|
|
4525
|
+
)) });
|
|
4526
|
+
};
|
|
4527
|
+
var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
4528
|
+
import_react22.default.useEffect(() => {
|
|
4529
|
+
const handleClickOutside = (e) => {
|
|
4530
|
+
const target = e.target;
|
|
4531
|
+
const menu = document.querySelector(".lib-xplat-editor__slash-menu");
|
|
4532
|
+
if (menu && !menu.contains(target)) onClose();
|
|
4533
|
+
};
|
|
4534
|
+
window.addEventListener("mousedown", handleClickOutside);
|
|
4535
|
+
return () => window.removeEventListener("mousedown", handleClickOutside);
|
|
4536
|
+
}, [onClose]);
|
|
4537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
4538
|
+
"div",
|
|
4539
|
+
{
|
|
4540
|
+
className: "lib-xplat-editor__slash-menu",
|
|
4541
|
+
style: { top: position.top, left: position.left },
|
|
4542
|
+
children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)(
|
|
4543
|
+
"button",
|
|
4544
|
+
{
|
|
4545
|
+
type: "button",
|
|
4546
|
+
className: clsx_default("lib-xplat-editor__slash-item", i === activeIndex && "active"),
|
|
4547
|
+
onMouseDown: (e) => {
|
|
4548
|
+
e.preventDefault();
|
|
4549
|
+
onSelect(item);
|
|
4550
|
+
},
|
|
4551
|
+
children: [
|
|
4552
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("span", { className: "label", children: item.label }),
|
|
4553
|
+
item.hint && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("span", { className: "hint", children: item.hint })
|
|
4554
|
+
]
|
|
4555
|
+
},
|
|
4556
|
+
item.key
|
|
4557
|
+
))
|
|
4558
|
+
}
|
|
4559
|
+
);
|
|
4560
|
+
};
|
|
4561
|
+
var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
4562
|
+
const inputRef = import_react22.default.useRef(null);
|
|
4563
|
+
import_react22.default.useEffect(() => {
|
|
4564
|
+
inputRef.current?.focus();
|
|
4565
|
+
}, []);
|
|
4566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)(
|
|
4567
|
+
"div",
|
|
4568
|
+
{
|
|
4569
|
+
className: "lib-xplat-editor__link-popover",
|
|
4570
|
+
style: { top: position.top, left: position.left },
|
|
4571
|
+
children: [
|
|
4572
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
4573
|
+
"input",
|
|
4574
|
+
{
|
|
4575
|
+
ref: inputRef,
|
|
4576
|
+
type: "url",
|
|
4577
|
+
placeholder: "https://",
|
|
4578
|
+
value,
|
|
4579
|
+
onChange: (e) => onChange(e.target.value),
|
|
4580
|
+
onKeyDown: (e) => {
|
|
4581
|
+
if (e.key === "Enter") {
|
|
4582
|
+
e.preventDefault();
|
|
4583
|
+
onConfirm();
|
|
4584
|
+
}
|
|
4585
|
+
if (e.key === "Escape") {
|
|
4586
|
+
e.preventDefault();
|
|
4587
|
+
onClose();
|
|
4588
|
+
}
|
|
4589
|
+
}
|
|
4590
|
+
}
|
|
4591
|
+
),
|
|
4592
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("button", { type: "button", onMouseDown: (e) => {
|
|
4593
|
+
e.preventDefault();
|
|
4594
|
+
onConfirm();
|
|
4595
|
+
}, children: "\uC801\uC6A9" }),
|
|
4596
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("button", { type: "button", onMouseDown: (e) => {
|
|
4597
|
+
e.preventDefault();
|
|
4598
|
+
onClose();
|
|
4599
|
+
}, children: "\uCDE8\uC18C" })
|
|
4600
|
+
]
|
|
4601
|
+
}
|
|
4602
|
+
);
|
|
4603
|
+
};
|
|
4604
|
+
|
|
4605
|
+
// src/components/EmptyState/EmptyState.tsx
|
|
4606
|
+
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
3899
4607
|
var EmptyState = (props) => {
|
|
3900
4608
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
3901
|
-
return /* @__PURE__ */ (0,
|
|
3902
|
-
icon && /* @__PURE__ */ (0,
|
|
3903
|
-
!icon && /* @__PURE__ */ (0,
|
|
3904
|
-
/* @__PURE__ */ (0,
|
|
3905
|
-
description && /* @__PURE__ */ (0,
|
|
3906
|
-
action && /* @__PURE__ */ (0,
|
|
4609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)("div", { className: "lib-xplat-empty-state", children: [
|
|
4610
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "empty-icon", children: icon }),
|
|
4611
|
+
!icon && /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "empty-icon", children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("path", { d: "M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z" }) }) }),
|
|
4612
|
+
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)("p", { className: "empty-title", children: title }),
|
|
4613
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("p", { className: "empty-description", children: description }),
|
|
4614
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "empty-action", children: action })
|
|
3907
4615
|
] });
|
|
3908
4616
|
};
|
|
3909
4617
|
EmptyState.displayName = "EmptyState";
|
|
3910
4618
|
var EmptyState_default = EmptyState;
|
|
3911
4619
|
|
|
3912
4620
|
// src/components/FileUpload/FileUpload.tsx
|
|
3913
|
-
var
|
|
3914
|
-
var
|
|
4621
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
4622
|
+
var import_jsx_runtime326 = require("react/jsx-runtime");
|
|
3915
4623
|
var FileUpload = (props) => {
|
|
3916
4624
|
const {
|
|
3917
4625
|
accept,
|
|
@@ -3921,8 +4629,8 @@ var FileUpload = (props) => {
|
|
|
3921
4629
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
3922
4630
|
description
|
|
3923
4631
|
} = props;
|
|
3924
|
-
const [isDragOver, setIsDragOver] =
|
|
3925
|
-
const inputRef =
|
|
4632
|
+
const [isDragOver, setIsDragOver] = import_react23.default.useState(false);
|
|
4633
|
+
const inputRef = import_react23.default.useRef(null);
|
|
3926
4634
|
const handleFiles = (fileList) => {
|
|
3927
4635
|
let files = Array.from(fileList);
|
|
3928
4636
|
if (maxSize) {
|
|
@@ -3952,7 +4660,7 @@ var FileUpload = (props) => {
|
|
|
3952
4660
|
handleFiles(e.target.files);
|
|
3953
4661
|
}
|
|
3954
4662
|
};
|
|
3955
|
-
return /* @__PURE__ */ (0,
|
|
4663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)(
|
|
3956
4664
|
"div",
|
|
3957
4665
|
{
|
|
3958
4666
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -3961,7 +4669,7 @@ var FileUpload = (props) => {
|
|
|
3961
4669
|
onDragLeave: handleDragLeave,
|
|
3962
4670
|
onClick: () => inputRef.current?.click(),
|
|
3963
4671
|
children: [
|
|
3964
|
-
/* @__PURE__ */ (0,
|
|
4672
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)(
|
|
3965
4673
|
"input",
|
|
3966
4674
|
{
|
|
3967
4675
|
ref: inputRef,
|
|
@@ -3971,9 +4679,9 @@ var FileUpload = (props) => {
|
|
|
3971
4679
|
onChange: handleChange
|
|
3972
4680
|
}
|
|
3973
4681
|
),
|
|
3974
|
-
/* @__PURE__ */ (0,
|
|
3975
|
-
/* @__PURE__ */ (0,
|
|
3976
|
-
description && /* @__PURE__ */ (0,
|
|
4682
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "upload-icon", children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(UploadIcon_default, {}) }),
|
|
4683
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)("p", { className: "upload-label", children: label }),
|
|
4684
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("p", { className: "upload-description", children: description })
|
|
3977
4685
|
]
|
|
3978
4686
|
}
|
|
3979
4687
|
);
|
|
@@ -3982,10 +4690,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
3982
4690
|
var FileUpload_default = FileUpload;
|
|
3983
4691
|
|
|
3984
4692
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
3985
|
-
var
|
|
4693
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
3986
4694
|
|
|
3987
4695
|
// src/components/HtmlTypeWriter/utils.ts
|
|
3988
|
-
var
|
|
4696
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
3989
4697
|
var voidTags = /* @__PURE__ */ new Set([
|
|
3990
4698
|
"br",
|
|
3991
4699
|
"img",
|
|
@@ -4053,41 +4761,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
4053
4761
|
props[attr.name] = attr.value;
|
|
4054
4762
|
});
|
|
4055
4763
|
if (voidTags.has(tag)) {
|
|
4056
|
-
return
|
|
4764
|
+
return import_react24.default.createElement(tag, props);
|
|
4057
4765
|
}
|
|
4058
4766
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
4059
|
-
return
|
|
4767
|
+
return import_react24.default.createElement(tag, props, ...children);
|
|
4060
4768
|
};
|
|
4061
4769
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
4062
4770
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
4063
4771
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
4064
|
-
return node == null ? null :
|
|
4772
|
+
return node == null ? null : import_react24.default.createElement(import_react24.default.Fragment, { key: idx }, node);
|
|
4065
4773
|
}).filter(Boolean);
|
|
4066
4774
|
return nodes.length === 0 ? null : nodes;
|
|
4067
4775
|
};
|
|
4068
4776
|
|
|
4069
4777
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
4070
|
-
var
|
|
4778
|
+
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
4071
4779
|
var HtmlTypeWriter = ({
|
|
4072
4780
|
html,
|
|
4073
4781
|
duration = 20,
|
|
4074
4782
|
onDone,
|
|
4075
4783
|
onChange
|
|
4076
4784
|
}) => {
|
|
4077
|
-
const [typedLen, setTypedLen] =
|
|
4078
|
-
const doneCalledRef =
|
|
4079
|
-
const { doc, rangeMap, totalLength } =
|
|
4785
|
+
const [typedLen, setTypedLen] = import_react25.default.useState(0);
|
|
4786
|
+
const doneCalledRef = import_react25.default.useRef(false);
|
|
4787
|
+
const { doc, rangeMap, totalLength } = import_react25.default.useMemo(() => {
|
|
4080
4788
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
4081
4789
|
const decoded = decodeHtmlEntities(html);
|
|
4082
4790
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
4083
4791
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
4084
4792
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
4085
4793
|
}, [html]);
|
|
4086
|
-
|
|
4794
|
+
import_react25.default.useEffect(() => {
|
|
4087
4795
|
setTypedLen(0);
|
|
4088
4796
|
doneCalledRef.current = false;
|
|
4089
4797
|
}, [html]);
|
|
4090
|
-
|
|
4798
|
+
import_react25.default.useEffect(() => {
|
|
4091
4799
|
if (!totalLength) return;
|
|
4092
4800
|
if (typedLen >= totalLength) return;
|
|
4093
4801
|
const timer = window.setInterval(() => {
|
|
@@ -4095,33 +4803,33 @@ var HtmlTypeWriter = ({
|
|
|
4095
4803
|
}, duration);
|
|
4096
4804
|
return () => window.clearInterval(timer);
|
|
4097
4805
|
}, [typedLen, totalLength, duration]);
|
|
4098
|
-
|
|
4806
|
+
import_react25.default.useEffect(() => {
|
|
4099
4807
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
4100
4808
|
onChange?.();
|
|
4101
4809
|
}
|
|
4102
4810
|
}, [typedLen, totalLength, onChange]);
|
|
4103
|
-
|
|
4811
|
+
import_react25.default.useEffect(() => {
|
|
4104
4812
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
4105
4813
|
doneCalledRef.current = true;
|
|
4106
4814
|
onDone?.();
|
|
4107
4815
|
}
|
|
4108
4816
|
}, [typedLen, totalLength, onDone]);
|
|
4109
|
-
const parsed =
|
|
4817
|
+
const parsed = import_react25.default.useMemo(
|
|
4110
4818
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
4111
4819
|
[doc, typedLen, rangeMap]
|
|
4112
4820
|
);
|
|
4113
|
-
return /* @__PURE__ */ (0,
|
|
4821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
4114
4822
|
};
|
|
4115
4823
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
4116
4824
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
4117
4825
|
|
|
4118
4826
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
4119
|
-
var
|
|
4120
|
-
var
|
|
4827
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
4828
|
+
var import_jsx_runtime328 = require("react/jsx-runtime");
|
|
4121
4829
|
var ImageSelector = (props) => {
|
|
4122
4830
|
const { value, label, onChange } = props;
|
|
4123
|
-
const [previewUrl, setPreviewUrl] =
|
|
4124
|
-
|
|
4831
|
+
const [previewUrl, setPreviewUrl] = import_react26.default.useState();
|
|
4832
|
+
import_react26.default.useEffect(() => {
|
|
4125
4833
|
if (!value) {
|
|
4126
4834
|
setPreviewUrl(void 0);
|
|
4127
4835
|
return;
|
|
@@ -4130,7 +4838,7 @@ var ImageSelector = (props) => {
|
|
|
4130
4838
|
setPreviewUrl(url);
|
|
4131
4839
|
return () => URL.revokeObjectURL(url);
|
|
4132
4840
|
}, [value]);
|
|
4133
|
-
const inputRef =
|
|
4841
|
+
const inputRef = import_react26.default.useRef(null);
|
|
4134
4842
|
const handleFileChange = (e) => {
|
|
4135
4843
|
const selectedFile = e.target.files?.[0];
|
|
4136
4844
|
if (selectedFile) {
|
|
@@ -4143,8 +4851,8 @@ var ImageSelector = (props) => {
|
|
|
4143
4851
|
const handleOpenFileDialog = () => {
|
|
4144
4852
|
inputRef.current?.click();
|
|
4145
4853
|
};
|
|
4146
|
-
return /* @__PURE__ */ (0,
|
|
4147
|
-
/* @__PURE__ */ (0,
|
|
4854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
4855
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)(
|
|
4148
4856
|
"input",
|
|
4149
4857
|
{
|
|
4150
4858
|
type: "file",
|
|
@@ -4154,13 +4862,13 @@ var ImageSelector = (props) => {
|
|
|
4154
4862
|
ref: inputRef
|
|
4155
4863
|
}
|
|
4156
4864
|
),
|
|
4157
|
-
value && /* @__PURE__ */ (0,
|
|
4158
|
-
/* @__PURE__ */ (0,
|
|
4159
|
-
/* @__PURE__ */ (0,
|
|
4865
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)("div", { className: "action-bar", children: [
|
|
4866
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(UploadIcon_default, {}) }),
|
|
4867
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(DeleteIcon_default, {}) })
|
|
4160
4868
|
] }),
|
|
4161
|
-
/* @__PURE__ */ (0,
|
|
4162
|
-
/* @__PURE__ */ (0,
|
|
4163
|
-
/* @__PURE__ */ (0,
|
|
4869
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)("div", { className: "content", children: previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime328.jsx)("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
4870
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)("div", { className: "icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(ImageIcon_default, {}) }),
|
|
4871
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
4164
4872
|
] }) })
|
|
4165
4873
|
] });
|
|
4166
4874
|
};
|
|
@@ -4168,7 +4876,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
4168
4876
|
var ImageSelector_default = ImageSelector;
|
|
4169
4877
|
|
|
4170
4878
|
// src/components/Pagination/Pagination.tsx
|
|
4171
|
-
var
|
|
4879
|
+
var import_jsx_runtime329 = require("react/jsx-runtime");
|
|
4172
4880
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
4173
4881
|
const totalNumbers = siblingCount * 2 + 5;
|
|
4174
4882
|
if (totalPages <= totalNumbers) {
|
|
@@ -4211,19 +4919,19 @@ var Pagination = (props) => {
|
|
|
4211
4919
|
onChange?.(page);
|
|
4212
4920
|
}
|
|
4213
4921
|
};
|
|
4214
|
-
return /* @__PURE__ */ (0,
|
|
4215
|
-
/* @__PURE__ */ (0,
|
|
4922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)("nav", { className: clsx_default("lib-xplat-pagination", size, type), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
4923
|
+
/* @__PURE__ */ (0, import_jsx_runtime329.jsx)(
|
|
4216
4924
|
"button",
|
|
4217
4925
|
{
|
|
4218
4926
|
className: "page-btn prev",
|
|
4219
4927
|
disabled: current <= 1,
|
|
4220
4928
|
onClick: () => handleClick(current - 1),
|
|
4221
4929
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
4222
|
-
children: /* @__PURE__ */ (0,
|
|
4930
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(ChevronLeftIcon_default, {})
|
|
4223
4931
|
}
|
|
4224
4932
|
),
|
|
4225
4933
|
pages.map(
|
|
4226
|
-
(page, i) => page === "..." ? /* @__PURE__ */ (0,
|
|
4934
|
+
(page, i) => page === "..." ? /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(
|
|
4227
4935
|
"button",
|
|
4228
4936
|
{
|
|
4229
4937
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -4234,14 +4942,14 @@ var Pagination = (props) => {
|
|
|
4234
4942
|
page
|
|
4235
4943
|
)
|
|
4236
4944
|
),
|
|
4237
|
-
/* @__PURE__ */ (0,
|
|
4945
|
+
/* @__PURE__ */ (0, import_jsx_runtime329.jsx)(
|
|
4238
4946
|
"button",
|
|
4239
4947
|
{
|
|
4240
4948
|
className: "page-btn next",
|
|
4241
4949
|
disabled: current >= totalPages,
|
|
4242
4950
|
onClick: () => handleClick(current + 1),
|
|
4243
4951
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
4244
|
-
children: /* @__PURE__ */ (0,
|
|
4952
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(ChevronRightIcon_default, {})
|
|
4245
4953
|
}
|
|
4246
4954
|
)
|
|
4247
4955
|
] });
|
|
@@ -4250,17 +4958,17 @@ Pagination.displayName = "Pagination";
|
|
|
4250
4958
|
var Pagination_default = Pagination;
|
|
4251
4959
|
|
|
4252
4960
|
// src/components/PopOver/PopOver.tsx
|
|
4253
|
-
var
|
|
4254
|
-
var
|
|
4961
|
+
var import_react27 = __toESM(require("react"), 1);
|
|
4962
|
+
var import_jsx_runtime330 = require("react/jsx-runtime");
|
|
4255
4963
|
var PopOver = (props) => {
|
|
4256
4964
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
4257
|
-
const popRef =
|
|
4258
|
-
const triggerRef =
|
|
4259
|
-
const [localOpen, setLocalOpen] =
|
|
4260
|
-
const [eventTrigger, setEventTrigger] =
|
|
4965
|
+
const popRef = import_react27.default.useRef(null);
|
|
4966
|
+
const triggerRef = import_react27.default.useRef(null);
|
|
4967
|
+
const [localOpen, setLocalOpen] = import_react27.default.useState(false);
|
|
4968
|
+
const [eventTrigger, setEventTrigger] = import_react27.default.useState(false);
|
|
4261
4969
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
4262
4970
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
4263
|
-
|
|
4971
|
+
import_react27.default.useEffect(() => {
|
|
4264
4972
|
if (isOpen) {
|
|
4265
4973
|
setLocalOpen(isOpen);
|
|
4266
4974
|
setTimeout(() => {
|
|
@@ -4273,7 +4981,7 @@ var PopOver = (props) => {
|
|
|
4273
4981
|
}, 200);
|
|
4274
4982
|
}
|
|
4275
4983
|
}, [isOpen]);
|
|
4276
|
-
return /* @__PURE__ */ (0,
|
|
4984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime330.jsxs)(
|
|
4277
4985
|
"div",
|
|
4278
4986
|
{
|
|
4279
4987
|
className: "lib-xplat-pop-over",
|
|
@@ -4283,7 +4991,7 @@ var PopOver = (props) => {
|
|
|
4283
4991
|
},
|
|
4284
4992
|
children: [
|
|
4285
4993
|
children,
|
|
4286
|
-
localOpen && /* @__PURE__ */ (0,
|
|
4994
|
+
localOpen && /* @__PURE__ */ (0, import_jsx_runtime330.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime330.jsx)(
|
|
4287
4995
|
"div",
|
|
4288
4996
|
{
|
|
4289
4997
|
className: clsx_default(
|
|
@@ -4306,7 +5014,7 @@ PopOver.displayName = "PopOver";
|
|
|
4306
5014
|
var PopOver_default = PopOver;
|
|
4307
5015
|
|
|
4308
5016
|
// src/components/Progress/Progress.tsx
|
|
4309
|
-
var
|
|
5017
|
+
var import_jsx_runtime331 = require("react/jsx-runtime");
|
|
4310
5018
|
var Progress = (props) => {
|
|
4311
5019
|
const {
|
|
4312
5020
|
value,
|
|
@@ -4316,8 +5024,8 @@ var Progress = (props) => {
|
|
|
4316
5024
|
showLabel = false
|
|
4317
5025
|
} = props;
|
|
4318
5026
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
4319
|
-
return /* @__PURE__ */ (0,
|
|
4320
|
-
/* @__PURE__ */ (0,
|
|
5027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
5028
|
+
/* @__PURE__ */ (0, import_jsx_runtime331.jsx)(
|
|
4321
5029
|
"div",
|
|
4322
5030
|
{
|
|
4323
5031
|
className: "track",
|
|
@@ -4325,7 +5033,7 @@ var Progress = (props) => {
|
|
|
4325
5033
|
"aria-valuenow": value,
|
|
4326
5034
|
"aria-valuemin": 0,
|
|
4327
5035
|
"aria-valuemax": max,
|
|
4328
|
-
children: /* @__PURE__ */ (0,
|
|
5036
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(
|
|
4329
5037
|
"div",
|
|
4330
5038
|
{
|
|
4331
5039
|
className: "bar",
|
|
@@ -4334,7 +5042,7 @@ var Progress = (props) => {
|
|
|
4334
5042
|
)
|
|
4335
5043
|
}
|
|
4336
5044
|
),
|
|
4337
|
-
showLabel && /* @__PURE__ */ (0,
|
|
5045
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)("span", { className: "label", children: [
|
|
4338
5046
|
Math.round(percentage),
|
|
4339
5047
|
"%"
|
|
4340
5048
|
] })
|
|
@@ -4344,17 +5052,17 @@ Progress.displayName = "Progress";
|
|
|
4344
5052
|
var Progress_default = Progress;
|
|
4345
5053
|
|
|
4346
5054
|
// src/components/Radio/RadioGroupContext.tsx
|
|
4347
|
-
var
|
|
4348
|
-
var RadioGroupContext =
|
|
5055
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
5056
|
+
var RadioGroupContext = import_react28.default.createContext(
|
|
4349
5057
|
null
|
|
4350
5058
|
);
|
|
4351
5059
|
var useRadioGroupContext = () => {
|
|
4352
|
-
return
|
|
5060
|
+
return import_react28.default.useContext(RadioGroupContext);
|
|
4353
5061
|
};
|
|
4354
5062
|
var RadioGroupContext_default = RadioGroupContext;
|
|
4355
5063
|
|
|
4356
5064
|
// src/components/Radio/Radio.tsx
|
|
4357
|
-
var
|
|
5065
|
+
var import_jsx_runtime332 = require("react/jsx-runtime");
|
|
4358
5066
|
var Radio = (props) => {
|
|
4359
5067
|
const {
|
|
4360
5068
|
label,
|
|
@@ -4372,7 +5080,7 @@ var Radio = (props) => {
|
|
|
4372
5080
|
value,
|
|
4373
5081
|
onChange: rest.onChange
|
|
4374
5082
|
};
|
|
4375
|
-
return /* @__PURE__ */ (0,
|
|
5083
|
+
return /* @__PURE__ */ (0, import_jsx_runtime332.jsxs)(
|
|
4376
5084
|
"label",
|
|
4377
5085
|
{
|
|
4378
5086
|
className: clsx_default(
|
|
@@ -4382,18 +5090,18 @@ var Radio = (props) => {
|
|
|
4382
5090
|
localChecked ? "checked" : void 0
|
|
4383
5091
|
),
|
|
4384
5092
|
children: [
|
|
4385
|
-
/* @__PURE__ */ (0,
|
|
4386
|
-
/* @__PURE__ */ (0,
|
|
5093
|
+
/* @__PURE__ */ (0, import_jsx_runtime332.jsx)("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
5094
|
+
/* @__PURE__ */ (0, import_jsx_runtime332.jsx)(
|
|
4387
5095
|
"div",
|
|
4388
5096
|
{
|
|
4389
5097
|
className: clsx_default(
|
|
4390
5098
|
"circle",
|
|
4391
5099
|
localChecked ? "checked" : void 0
|
|
4392
5100
|
),
|
|
4393
|
-
children: localChecked && /* @__PURE__ */ (0,
|
|
5101
|
+
children: localChecked && /* @__PURE__ */ (0, import_jsx_runtime332.jsx)("div", { className: "inner-circle" })
|
|
4394
5102
|
}
|
|
4395
5103
|
),
|
|
4396
|
-
label && /* @__PURE__ */ (0,
|
|
5104
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime332.jsx)("span", { children: label })
|
|
4397
5105
|
]
|
|
4398
5106
|
}
|
|
4399
5107
|
);
|
|
@@ -4402,28 +5110,28 @@ Radio.displayName = "Radio";
|
|
|
4402
5110
|
var Radio_default = Radio;
|
|
4403
5111
|
|
|
4404
5112
|
// src/components/Radio/RadioGroup.tsx
|
|
4405
|
-
var
|
|
5113
|
+
var import_jsx_runtime333 = require("react/jsx-runtime");
|
|
4406
5114
|
var RadioGroup = (props) => {
|
|
4407
5115
|
const { children, ...rest } = props;
|
|
4408
|
-
return /* @__PURE__ */ (0,
|
|
5116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(import_jsx_runtime333.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
4409
5117
|
};
|
|
4410
5118
|
RadioGroup.displayName = "RadioGroup";
|
|
4411
5119
|
var RadioGroup_default = RadioGroup;
|
|
4412
5120
|
|
|
4413
5121
|
// src/components/Select/Select.tsx
|
|
4414
|
-
var
|
|
5122
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
4415
5123
|
|
|
4416
5124
|
// src/components/Select/context.ts
|
|
4417
|
-
var
|
|
4418
|
-
var SelectContext =
|
|
5125
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
5126
|
+
var SelectContext = import_react29.default.createContext(null);
|
|
4419
5127
|
var context_default = SelectContext;
|
|
4420
5128
|
|
|
4421
5129
|
// src/components/Select/SelectItem.tsx
|
|
4422
|
-
var
|
|
4423
|
-
var
|
|
5130
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
5131
|
+
var import_jsx_runtime334 = require("react/jsx-runtime");
|
|
4424
5132
|
var SelectItem = (props) => {
|
|
4425
5133
|
const { children, value, onClick, disabled = false } = props;
|
|
4426
|
-
const ctx =
|
|
5134
|
+
const ctx = import_react30.default.useContext(context_default);
|
|
4427
5135
|
const handleClick = (e) => {
|
|
4428
5136
|
e.preventDefault();
|
|
4429
5137
|
e.stopPropagation();
|
|
@@ -4432,7 +5140,7 @@ var SelectItem = (props) => {
|
|
|
4432
5140
|
ctx?.close();
|
|
4433
5141
|
onClick?.();
|
|
4434
5142
|
};
|
|
4435
|
-
return /* @__PURE__ */ (0,
|
|
5143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
4436
5144
|
"div",
|
|
4437
5145
|
{
|
|
4438
5146
|
className: clsx_default("select-item", disabled && "disabled"),
|
|
@@ -4453,7 +5161,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
4453
5161
|
var SelectItem_default = SelectItem;
|
|
4454
5162
|
|
|
4455
5163
|
// src/components/Select/Select.tsx
|
|
4456
|
-
var
|
|
5164
|
+
var import_jsx_runtime335 = require("react/jsx-runtime");
|
|
4457
5165
|
var ANIMATION_DURATION_MS3 = 200;
|
|
4458
5166
|
var SelectRoot = (props) => {
|
|
4459
5167
|
const {
|
|
@@ -4465,26 +5173,26 @@ var SelectRoot = (props) => {
|
|
|
4465
5173
|
error = false,
|
|
4466
5174
|
size = "md"
|
|
4467
5175
|
} = props;
|
|
4468
|
-
const itemChildren =
|
|
4469
|
-
(child) =>
|
|
5176
|
+
const itemChildren = import_react31.default.Children.toArray(children).filter(
|
|
5177
|
+
(child) => import_react31.default.isValidElement(child) && child.type === SelectItem_default
|
|
4470
5178
|
);
|
|
4471
5179
|
const isControlled = valueProp !== void 0;
|
|
4472
|
-
const [isOpen, setOpen] =
|
|
4473
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
4474
|
-
const controlledLabel =
|
|
5180
|
+
const [isOpen, setOpen] = import_react31.default.useState(false);
|
|
5181
|
+
const [uncontrolledLabel, setUncontrolledLabel] = import_react31.default.useState(null);
|
|
5182
|
+
const controlledLabel = import_react31.default.useMemo(() => {
|
|
4475
5183
|
if (!isControlled) return null;
|
|
4476
5184
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
4477
5185
|
return match ? match.props.children : null;
|
|
4478
5186
|
}, [isControlled, valueProp, itemChildren]);
|
|
4479
5187
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
4480
|
-
const triggerRef =
|
|
4481
|
-
const contentRef =
|
|
4482
|
-
const [mounted, setMounted] =
|
|
4483
|
-
const [visible, setVisible] =
|
|
4484
|
-
|
|
5188
|
+
const triggerRef = import_react31.default.useRef(null);
|
|
5189
|
+
const contentRef = import_react31.default.useRef(null);
|
|
5190
|
+
const [mounted, setMounted] = import_react31.default.useState(false);
|
|
5191
|
+
const [visible, setVisible] = import_react31.default.useState(false);
|
|
5192
|
+
import_react31.default.useEffect(() => {
|
|
4485
5193
|
if (disabled && isOpen) setOpen(false);
|
|
4486
5194
|
}, [disabled, isOpen]);
|
|
4487
|
-
|
|
5195
|
+
import_react31.default.useEffect(() => {
|
|
4488
5196
|
if (isOpen) {
|
|
4489
5197
|
setMounted(true);
|
|
4490
5198
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -4494,12 +5202,12 @@ var SelectRoot = (props) => {
|
|
|
4494
5202
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
4495
5203
|
return () => clearTimeout(t);
|
|
4496
5204
|
}, [isOpen]);
|
|
4497
|
-
const open =
|
|
4498
|
-
const close =
|
|
4499
|
-
const toggle =
|
|
5205
|
+
const open = import_react31.default.useCallback(() => setOpen(true), []);
|
|
5206
|
+
const close = import_react31.default.useCallback(() => setOpen(false), []);
|
|
5207
|
+
const toggle = import_react31.default.useCallback(() => setOpen((prev) => !prev), []);
|
|
4500
5208
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
4501
5209
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
4502
|
-
const setSelected =
|
|
5210
|
+
const setSelected = import_react31.default.useCallback(
|
|
4503
5211
|
(label, itemValue) => {
|
|
4504
5212
|
if (!isControlled) {
|
|
4505
5213
|
setUncontrolledLabel(label);
|
|
@@ -4508,7 +5216,7 @@ var SelectRoot = (props) => {
|
|
|
4508
5216
|
},
|
|
4509
5217
|
[isControlled, onChange]
|
|
4510
5218
|
);
|
|
4511
|
-
const ctxValue =
|
|
5219
|
+
const ctxValue = import_react31.default.useMemo(
|
|
4512
5220
|
() => ({
|
|
4513
5221
|
isOpen,
|
|
4514
5222
|
mounted,
|
|
@@ -4529,7 +5237,7 @@ var SelectRoot = (props) => {
|
|
|
4529
5237
|
if (disabled) return;
|
|
4530
5238
|
toggle();
|
|
4531
5239
|
};
|
|
4532
|
-
return /* @__PURE__ */ (0,
|
|
5240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime335.jsxs)(
|
|
4533
5241
|
"div",
|
|
4534
5242
|
{
|
|
4535
5243
|
className: clsx_default(
|
|
@@ -4540,7 +5248,7 @@ var SelectRoot = (props) => {
|
|
|
4540
5248
|
mounted && "is-open"
|
|
4541
5249
|
),
|
|
4542
5250
|
children: [
|
|
4543
|
-
/* @__PURE__ */ (0,
|
|
5251
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsxs)(
|
|
4544
5252
|
"div",
|
|
4545
5253
|
{
|
|
4546
5254
|
ref: triggerRef,
|
|
@@ -4564,7 +5272,7 @@ var SelectRoot = (props) => {
|
|
|
4564
5272
|
}
|
|
4565
5273
|
},
|
|
4566
5274
|
children: [
|
|
4567
|
-
/* @__PURE__ */ (0,
|
|
5275
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
4568
5276
|
"span",
|
|
4569
5277
|
{
|
|
4570
5278
|
className: clsx_default(
|
|
@@ -4574,25 +5282,25 @@ var SelectRoot = (props) => {
|
|
|
4574
5282
|
children: selectedLabel ?? placeholder
|
|
4575
5283
|
}
|
|
4576
5284
|
),
|
|
4577
|
-
/* @__PURE__ */ (0,
|
|
5285
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
4578
5286
|
"span",
|
|
4579
5287
|
{
|
|
4580
5288
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
4581
5289
|
"aria-hidden": true,
|
|
4582
|
-
children: /* @__PURE__ */ (0,
|
|
5290
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(ChevronDownIcon_default, {})
|
|
4583
5291
|
}
|
|
4584
5292
|
)
|
|
4585
5293
|
]
|
|
4586
5294
|
}
|
|
4587
5295
|
),
|
|
4588
|
-
mounted && /* @__PURE__ */ (0,
|
|
5296
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
4589
5297
|
"div",
|
|
4590
5298
|
{
|
|
4591
5299
|
className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
|
|
4592
5300
|
ref: contentRef,
|
|
4593
5301
|
style: { ...position.position, width: triggerRef.current?.offsetWidth },
|
|
4594
5302
|
role: "listbox",
|
|
4595
|
-
children: /* @__PURE__ */ (0,
|
|
5303
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(context_default.Provider, { value: ctxValue, children: itemChildren })
|
|
4596
5304
|
}
|
|
4597
5305
|
) })
|
|
4598
5306
|
]
|
|
@@ -4606,7 +5314,7 @@ var Select = Object.assign(SelectRoot, {
|
|
|
4606
5314
|
var Select_default = Select;
|
|
4607
5315
|
|
|
4608
5316
|
// src/components/Skeleton/Skeleton.tsx
|
|
4609
|
-
var
|
|
5317
|
+
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
4610
5318
|
var SIZE_MAP = {
|
|
4611
5319
|
xs: "var(--spacing-size-1)",
|
|
4612
5320
|
sm: "var(--spacing-size-2)",
|
|
@@ -4622,7 +5330,7 @@ var Skeleton = (props) => {
|
|
|
4622
5330
|
...width != null && { width: SIZE_MAP[width] },
|
|
4623
5331
|
...height != null && { height: SIZE_MAP[height] }
|
|
4624
5332
|
};
|
|
4625
|
-
return /* @__PURE__ */ (0,
|
|
5333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
|
|
4626
5334
|
"div",
|
|
4627
5335
|
{
|
|
4628
5336
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -4635,20 +5343,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
4635
5343
|
var Skeleton_default = Skeleton;
|
|
4636
5344
|
|
|
4637
5345
|
// src/components/Spinner/Spinner.tsx
|
|
4638
|
-
var
|
|
5346
|
+
var import_jsx_runtime337 = require("react/jsx-runtime");
|
|
4639
5347
|
var Spinner = (props) => {
|
|
4640
5348
|
const {
|
|
4641
5349
|
size = "md",
|
|
4642
5350
|
type = "brand"
|
|
4643
5351
|
} = props;
|
|
4644
|
-
return /* @__PURE__ */ (0,
|
|
5352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
4645
5353
|
"div",
|
|
4646
5354
|
{
|
|
4647
5355
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
4648
5356
|
role: "status",
|
|
4649
5357
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
4650
|
-
children: /* @__PURE__ */ (0,
|
|
4651
|
-
/* @__PURE__ */ (0,
|
|
5358
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
5359
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
4652
5360
|
"circle",
|
|
4653
5361
|
{
|
|
4654
5362
|
className: "track",
|
|
@@ -4658,7 +5366,7 @@ var Spinner = (props) => {
|
|
|
4658
5366
|
strokeWidth: "3"
|
|
4659
5367
|
}
|
|
4660
5368
|
),
|
|
4661
|
-
/* @__PURE__ */ (0,
|
|
5369
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
4662
5370
|
"circle",
|
|
4663
5371
|
{
|
|
4664
5372
|
className: "indicator",
|
|
@@ -4677,20 +5385,20 @@ Spinner.displayName = "Spinner";
|
|
|
4677
5385
|
var Spinner_default = Spinner;
|
|
4678
5386
|
|
|
4679
5387
|
// src/components/Steps/Steps.tsx
|
|
4680
|
-
var
|
|
5388
|
+
var import_jsx_runtime338 = require("react/jsx-runtime");
|
|
4681
5389
|
var Steps = (props) => {
|
|
4682
5390
|
const {
|
|
4683
5391
|
items,
|
|
4684
5392
|
current,
|
|
4685
5393
|
type = "brand"
|
|
4686
5394
|
} = props;
|
|
4687
|
-
return /* @__PURE__ */ (0,
|
|
5395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime338.jsx)("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
4688
5396
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
4689
|
-
return /* @__PURE__ */ (0,
|
|
4690
|
-
/* @__PURE__ */ (0,
|
|
4691
|
-
/* @__PURE__ */ (0,
|
|
4692
|
-
/* @__PURE__ */ (0,
|
|
4693
|
-
item.description && /* @__PURE__ */ (0,
|
|
5397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime338.jsxs)("div", { className: clsx_default("step-item", status), children: [
|
|
5398
|
+
/* @__PURE__ */ (0, import_jsx_runtime338.jsx)("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ (0, import_jsx_runtime338.jsx)(CheckIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime338.jsx)("span", { children: index + 1 }) }),
|
|
5399
|
+
/* @__PURE__ */ (0, import_jsx_runtime338.jsxs)("div", { className: "step-content", children: [
|
|
5400
|
+
/* @__PURE__ */ (0, import_jsx_runtime338.jsx)("span", { className: "step-title", children: item.title }),
|
|
5401
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime338.jsx)("span", { className: "step-description", children: item.description })
|
|
4694
5402
|
] })
|
|
4695
5403
|
] }, index);
|
|
4696
5404
|
}) });
|
|
@@ -4699,8 +5407,8 @@ Steps.displayName = "Steps";
|
|
|
4699
5407
|
var Steps_default = Steps;
|
|
4700
5408
|
|
|
4701
5409
|
// src/components/Swiper/Swiper.tsx
|
|
4702
|
-
var
|
|
4703
|
-
var
|
|
5410
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
5411
|
+
var import_jsx_runtime339 = require("react/jsx-runtime");
|
|
4704
5412
|
var Swiper = (props) => {
|
|
4705
5413
|
const {
|
|
4706
5414
|
auto = false,
|
|
@@ -4724,25 +5432,25 @@ var Swiper = (props) => {
|
|
|
4724
5432
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
4725
5433
|
const useLoop = loop && canSlide;
|
|
4726
5434
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
4727
|
-
const extendedItems =
|
|
5435
|
+
const extendedItems = import_react32.default.useMemo(() => {
|
|
4728
5436
|
if (!useLoop) return items;
|
|
4729
5437
|
return [...items, ...items, ...items];
|
|
4730
5438
|
}, [items, useLoop]);
|
|
4731
5439
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
4732
|
-
const [innerIndex, setInnerIndex] =
|
|
5440
|
+
const [innerIndex, setInnerIndex] = import_react32.default.useState(
|
|
4733
5441
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
4734
5442
|
);
|
|
4735
|
-
const [isDragging, setIsDragging] =
|
|
4736
|
-
const [dragOffset, setDragOffset] =
|
|
4737
|
-
const [animated, setAnimated] =
|
|
4738
|
-
const [containerWidth, setContainerWidth] =
|
|
4739
|
-
const containerRef =
|
|
4740
|
-
const startXRef =
|
|
4741
|
-
const startTimeRef =
|
|
4742
|
-
const autoplayTimerRef =
|
|
4743
|
-
const resumeTimeoutRef =
|
|
4744
|
-
const [paused, setPaused] =
|
|
4745
|
-
|
|
5443
|
+
const [isDragging, setIsDragging] = import_react32.default.useState(false);
|
|
5444
|
+
const [dragOffset, setDragOffset] = import_react32.default.useState(0);
|
|
5445
|
+
const [animated, setAnimated] = import_react32.default.useState(true);
|
|
5446
|
+
const [containerWidth, setContainerWidth] = import_react32.default.useState(0);
|
|
5447
|
+
const containerRef = import_react32.default.useRef(null);
|
|
5448
|
+
const startXRef = import_react32.default.useRef(0);
|
|
5449
|
+
const startTimeRef = import_react32.default.useRef(0);
|
|
5450
|
+
const autoplayTimerRef = import_react32.default.useRef(null);
|
|
5451
|
+
const resumeTimeoutRef = import_react32.default.useRef(null);
|
|
5452
|
+
const [paused, setPaused] = import_react32.default.useState(false);
|
|
5453
|
+
import_react32.default.useEffect(() => {
|
|
4746
5454
|
const el = containerRef.current;
|
|
4747
5455
|
if (!el) return;
|
|
4748
5456
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -4761,7 +5469,7 @@ var Swiper = (props) => {
|
|
|
4761
5469
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
4762
5470
|
};
|
|
4763
5471
|
const realIndex = getRealIndex(innerIndex);
|
|
4764
|
-
const moveToInner =
|
|
5472
|
+
const moveToInner = import_react32.default.useCallback(
|
|
4765
5473
|
(idx, withAnim = true) => {
|
|
4766
5474
|
if (!useLoop) {
|
|
4767
5475
|
setAnimated(withAnim);
|
|
@@ -4789,7 +5497,7 @@ var Swiper = (props) => {
|
|
|
4789
5497
|
},
|
|
4790
5498
|
[useLoop, cloneCount, totalSlides]
|
|
4791
5499
|
);
|
|
4792
|
-
const handleTransitionEnd =
|
|
5500
|
+
const handleTransitionEnd = import_react32.default.useCallback(() => {
|
|
4793
5501
|
if (!useLoop) return;
|
|
4794
5502
|
const real = getRealIndex(innerIndex);
|
|
4795
5503
|
const canonical = cloneCount + real;
|
|
@@ -4799,7 +5507,7 @@ var Swiper = (props) => {
|
|
|
4799
5507
|
}
|
|
4800
5508
|
onChange?.(Math.min(real, maxIndex));
|
|
4801
5509
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
4802
|
-
const slideTo =
|
|
5510
|
+
const slideTo = import_react32.default.useCallback(
|
|
4803
5511
|
(logicalIndex) => {
|
|
4804
5512
|
if (!canSlide) return;
|
|
4805
5513
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -4809,7 +5517,7 @@ var Swiper = (props) => {
|
|
|
4809
5517
|
},
|
|
4810
5518
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
4811
5519
|
);
|
|
4812
|
-
const slideNext =
|
|
5520
|
+
const slideNext = import_react32.default.useCallback(() => {
|
|
4813
5521
|
if (!canSlide) return;
|
|
4814
5522
|
const nextInner = innerIndex + slideBy;
|
|
4815
5523
|
if (useLoop) {
|
|
@@ -4818,7 +5526,7 @@ var Swiper = (props) => {
|
|
|
4818
5526
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
4819
5527
|
}
|
|
4820
5528
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
4821
|
-
const slidePrev =
|
|
5529
|
+
const slidePrev = import_react32.default.useCallback(() => {
|
|
4822
5530
|
if (!canSlide) return;
|
|
4823
5531
|
const prevInner = innerIndex - slideBy;
|
|
4824
5532
|
if (useLoop) {
|
|
@@ -4827,7 +5535,7 @@ var Swiper = (props) => {
|
|
|
4827
5535
|
moveToInner(Math.max(prevInner, 0), true);
|
|
4828
5536
|
}
|
|
4829
5537
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
4830
|
-
|
|
5538
|
+
import_react32.default.useEffect(() => {
|
|
4831
5539
|
if (indexProp === void 0) return;
|
|
4832
5540
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
4833
5541
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -4835,12 +5543,12 @@ var Swiper = (props) => {
|
|
|
4835
5543
|
moveToInner(target, true);
|
|
4836
5544
|
}
|
|
4837
5545
|
}, [indexProp]);
|
|
4838
|
-
|
|
5546
|
+
import_react32.default.useImperativeHandle(swiperRef, () => ({
|
|
4839
5547
|
slidePrev,
|
|
4840
5548
|
slideNext,
|
|
4841
5549
|
slideTo
|
|
4842
5550
|
}));
|
|
4843
|
-
|
|
5551
|
+
import_react32.default.useEffect(() => {
|
|
4844
5552
|
if (!auto || !canSlide || paused) return;
|
|
4845
5553
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
4846
5554
|
return () => {
|
|
@@ -4866,7 +5574,7 @@ var Swiper = (props) => {
|
|
|
4866
5574
|
resumeTimeoutRef.current = null;
|
|
4867
5575
|
}, pauseOnInteraction);
|
|
4868
5576
|
};
|
|
4869
|
-
|
|
5577
|
+
import_react32.default.useEffect(() => {
|
|
4870
5578
|
return () => {
|
|
4871
5579
|
if (resumeTimeoutRef.current) clearTimeout(resumeTimeoutRef.current);
|
|
4872
5580
|
};
|
|
@@ -4884,7 +5592,7 @@ var Swiper = (props) => {
|
|
|
4884
5592
|
startXRef.current = getClientX(e);
|
|
4885
5593
|
startTimeRef.current = Date.now();
|
|
4886
5594
|
};
|
|
4887
|
-
|
|
5595
|
+
import_react32.default.useEffect(() => {
|
|
4888
5596
|
if (!isDragging) return;
|
|
4889
5597
|
const handleMove = (e) => {
|
|
4890
5598
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -4923,8 +5631,8 @@ var Swiper = (props) => {
|
|
|
4923
5631
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
4924
5632
|
const slideWidthPercent = 100 / viewItemCount;
|
|
4925
5633
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
4926
|
-
const slideElements =
|
|
4927
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0,
|
|
5634
|
+
const slideElements = import_react32.default.useMemo(
|
|
5635
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
4928
5636
|
"div",
|
|
4929
5637
|
{
|
|
4930
5638
|
className: "lib-xplat-swiper__slide",
|
|
@@ -4943,14 +5651,14 @@ var Swiper = (props) => {
|
|
|
4943
5651
|
Math.floor(realIndex / slideBy),
|
|
4944
5652
|
totalSteps - 1
|
|
4945
5653
|
);
|
|
4946
|
-
return /* @__PURE__ */ (0,
|
|
4947
|
-
/* @__PURE__ */ (0,
|
|
5654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime339.jsxs)("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
5655
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
4948
5656
|
"div",
|
|
4949
5657
|
{
|
|
4950
5658
|
className: "lib-xplat-swiper__viewport",
|
|
4951
5659
|
onMouseDown: handleDragStart,
|
|
4952
5660
|
onTouchStart: handleDragStart,
|
|
4953
|
-
children: /* @__PURE__ */ (0,
|
|
5661
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
4954
5662
|
"div",
|
|
4955
5663
|
{
|
|
4956
5664
|
className: clsx_default(
|
|
@@ -4968,7 +5676,7 @@ var Swiper = (props) => {
|
|
|
4968
5676
|
)
|
|
4969
5677
|
}
|
|
4970
5678
|
),
|
|
4971
|
-
showProgress && canSlide && /* @__PURE__ */ (0,
|
|
5679
|
+
showProgress && canSlide && /* @__PURE__ */ (0, import_jsx_runtime339.jsx)("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ (0, import_jsx_runtime339.jsx)("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
4972
5680
|
"span",
|
|
4973
5681
|
{
|
|
4974
5682
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -4978,7 +5686,7 @@ var Swiper = (props) => {
|
|
|
4978
5686
|
}
|
|
4979
5687
|
}
|
|
4980
5688
|
) }) }),
|
|
4981
|
-
canSlide && /* @__PURE__ */ (0,
|
|
5689
|
+
canSlide && /* @__PURE__ */ (0, import_jsx_runtime339.jsx)("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
4982
5690
|
"button",
|
|
4983
5691
|
{
|
|
4984
5692
|
className: clsx_default(
|
|
@@ -4996,8 +5704,8 @@ Swiper.displayName = "Swiper";
|
|
|
4996
5704
|
var Swiper_default = Swiper;
|
|
4997
5705
|
|
|
4998
5706
|
// src/components/Switch/Switch.tsx
|
|
4999
|
-
var
|
|
5000
|
-
var
|
|
5707
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
5708
|
+
var import_jsx_runtime340 = require("react/jsx-runtime");
|
|
5001
5709
|
var KNOB_TRANSITION_MS = 250;
|
|
5002
5710
|
var Switch = (props) => {
|
|
5003
5711
|
const {
|
|
@@ -5007,9 +5715,9 @@ var Switch = (props) => {
|
|
|
5007
5715
|
disabled,
|
|
5008
5716
|
onChange
|
|
5009
5717
|
} = props;
|
|
5010
|
-
const [isAnimating, setIsAnimating] =
|
|
5011
|
-
const timeoutRef =
|
|
5012
|
-
|
|
5718
|
+
const [isAnimating, setIsAnimating] = import_react33.default.useState(false);
|
|
5719
|
+
const timeoutRef = import_react33.default.useRef(null);
|
|
5720
|
+
import_react33.default.useEffect(() => {
|
|
5013
5721
|
return () => {
|
|
5014
5722
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5015
5723
|
};
|
|
@@ -5024,7 +5732,7 @@ var Switch = (props) => {
|
|
|
5024
5732
|
timeoutRef.current = null;
|
|
5025
5733
|
}, KNOB_TRANSITION_MS);
|
|
5026
5734
|
};
|
|
5027
|
-
return /* @__PURE__ */ (0,
|
|
5735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime340.jsx)(
|
|
5028
5736
|
"div",
|
|
5029
5737
|
{
|
|
5030
5738
|
className: clsx_default(
|
|
@@ -5037,7 +5745,7 @@ var Switch = (props) => {
|
|
|
5037
5745
|
),
|
|
5038
5746
|
onClick: handleClick,
|
|
5039
5747
|
"aria-disabled": disabled || isAnimating,
|
|
5040
|
-
children: /* @__PURE__ */ (0,
|
|
5748
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
5041
5749
|
}
|
|
5042
5750
|
);
|
|
5043
5751
|
};
|
|
@@ -5045,17 +5753,17 @@ Switch.displayName = "Switch";
|
|
|
5045
5753
|
var Switch_default = Switch;
|
|
5046
5754
|
|
|
5047
5755
|
// src/components/Table/TableContext.tsx
|
|
5048
|
-
var
|
|
5049
|
-
var TableContext =
|
|
5756
|
+
var import_react34 = __toESM(require("react"), 1);
|
|
5757
|
+
var TableContext = import_react34.default.createContext(null);
|
|
5050
5758
|
var useTableContext = () => {
|
|
5051
|
-
const ctx =
|
|
5759
|
+
const ctx = import_react34.default.useContext(TableContext);
|
|
5052
5760
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
5053
5761
|
return ctx;
|
|
5054
5762
|
};
|
|
5055
5763
|
var TableContext_default = TableContext;
|
|
5056
5764
|
|
|
5057
5765
|
// src/components/Table/Table.tsx
|
|
5058
|
-
var
|
|
5766
|
+
var import_jsx_runtime341 = require("react/jsx-runtime");
|
|
5059
5767
|
var Table = (props) => {
|
|
5060
5768
|
const {
|
|
5061
5769
|
children,
|
|
@@ -5065,7 +5773,7 @@ var Table = (props) => {
|
|
|
5065
5773
|
headerSticky = false,
|
|
5066
5774
|
stickyShadow = true
|
|
5067
5775
|
} = props;
|
|
5068
|
-
return /* @__PURE__ */ (0,
|
|
5776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime341.jsx)("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
5069
5777
|
TableContext_default.Provider,
|
|
5070
5778
|
{
|
|
5071
5779
|
value: {
|
|
@@ -5074,7 +5782,7 @@ var Table = (props) => {
|
|
|
5074
5782
|
headerSticky,
|
|
5075
5783
|
stickyShadow
|
|
5076
5784
|
},
|
|
5077
|
-
children: /* @__PURE__ */ (0,
|
|
5785
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime341.jsx)("table", { className: "lib-xplat-table", children })
|
|
5078
5786
|
}
|
|
5079
5787
|
) });
|
|
5080
5788
|
};
|
|
@@ -5082,41 +5790,41 @@ Table.displayName = "Table";
|
|
|
5082
5790
|
var Table_default = Table;
|
|
5083
5791
|
|
|
5084
5792
|
// src/components/Table/TableBody.tsx
|
|
5085
|
-
var
|
|
5793
|
+
var import_jsx_runtime342 = require("react/jsx-runtime");
|
|
5086
5794
|
var TableBody = (props) => {
|
|
5087
5795
|
const { children } = props;
|
|
5088
|
-
return /* @__PURE__ */ (0,
|
|
5796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime342.jsx)("tbody", { children });
|
|
5089
5797
|
};
|
|
5090
5798
|
TableBody.displayName = "TableBody";
|
|
5091
5799
|
var TableBody_default = TableBody;
|
|
5092
5800
|
|
|
5093
5801
|
// src/components/Table/TableCell.tsx
|
|
5094
|
-
var
|
|
5802
|
+
var import_react37 = __toESM(require("react"), 1);
|
|
5095
5803
|
|
|
5096
5804
|
// src/components/Table/TableHeadContext.tsx
|
|
5097
|
-
var
|
|
5098
|
-
var TableHeadContext =
|
|
5805
|
+
var import_react35 = __toESM(require("react"), 1);
|
|
5806
|
+
var TableHeadContext = import_react35.default.createContext(
|
|
5099
5807
|
null
|
|
5100
5808
|
);
|
|
5101
5809
|
var useTableHeadContext = () => {
|
|
5102
|
-
const ctx =
|
|
5810
|
+
const ctx = import_react35.default.useContext(TableHeadContext);
|
|
5103
5811
|
return ctx;
|
|
5104
5812
|
};
|
|
5105
5813
|
var TableHeadContext_default = TableHeadContext;
|
|
5106
5814
|
|
|
5107
5815
|
// src/components/Table/TableRowContext.tsx
|
|
5108
|
-
var
|
|
5109
|
-
var TableRowContext =
|
|
5816
|
+
var import_react36 = __toESM(require("react"), 1);
|
|
5817
|
+
var TableRowContext = import_react36.default.createContext(null);
|
|
5110
5818
|
var useTableRowContext = () => {
|
|
5111
|
-
const ctx =
|
|
5819
|
+
const ctx = import_react36.default.useContext(TableRowContext);
|
|
5112
5820
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
5113
5821
|
return ctx;
|
|
5114
5822
|
};
|
|
5115
5823
|
var TableRowContext_default = TableRowContext;
|
|
5116
5824
|
|
|
5117
5825
|
// src/components/Table/TableCell.tsx
|
|
5118
|
-
var
|
|
5119
|
-
var TableCell =
|
|
5826
|
+
var import_jsx_runtime343 = require("react/jsx-runtime");
|
|
5827
|
+
var TableCell = import_react37.default.memo((props) => {
|
|
5120
5828
|
const {
|
|
5121
5829
|
children,
|
|
5122
5830
|
align = "center",
|
|
@@ -5128,9 +5836,9 @@ var TableCell = import_react36.default.memo((props) => {
|
|
|
5128
5836
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
5129
5837
|
const { stickyShadow } = useTableContext();
|
|
5130
5838
|
const headContext = useTableHeadContext();
|
|
5131
|
-
const [left, setLeft] =
|
|
5132
|
-
const cellRef =
|
|
5133
|
-
const calculateLeft =
|
|
5839
|
+
const [left, setLeft] = import_react37.default.useState(0);
|
|
5840
|
+
const cellRef = import_react37.default.useRef(null);
|
|
5841
|
+
const calculateLeft = import_react37.default.useCallback(() => {
|
|
5134
5842
|
if (!cellRef.current) return 0;
|
|
5135
5843
|
let totalLeft = 0;
|
|
5136
5844
|
for (const ref of stickyCells) {
|
|
@@ -5139,7 +5847,7 @@ var TableCell = import_react36.default.memo((props) => {
|
|
|
5139
5847
|
}
|
|
5140
5848
|
return totalLeft;
|
|
5141
5849
|
}, [stickyCells]);
|
|
5142
|
-
|
|
5850
|
+
import_react37.default.useEffect(() => {
|
|
5143
5851
|
if (!isSticky || !cellRef.current) return;
|
|
5144
5852
|
registerStickyCell(cellRef);
|
|
5145
5853
|
setLeft(calculateLeft());
|
|
@@ -5157,7 +5865,7 @@ var TableCell = import_react36.default.memo((props) => {
|
|
|
5157
5865
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
5158
5866
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
5159
5867
|
const enableHover = headContext && headContext.cellHover;
|
|
5160
|
-
return /* @__PURE__ */ (0,
|
|
5868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(
|
|
5161
5869
|
CellTag,
|
|
5162
5870
|
{
|
|
5163
5871
|
ref: cellRef,
|
|
@@ -5182,21 +5890,21 @@ TableCell.displayName = "TableCell";
|
|
|
5182
5890
|
var TableCell_default = TableCell;
|
|
5183
5891
|
|
|
5184
5892
|
// src/components/Table/TableHead.tsx
|
|
5185
|
-
var
|
|
5893
|
+
var import_jsx_runtime344 = require("react/jsx-runtime");
|
|
5186
5894
|
var TableHead = ({
|
|
5187
5895
|
children,
|
|
5188
5896
|
cellHover = false
|
|
5189
5897
|
}) => {
|
|
5190
5898
|
const { headerSticky } = useTableContext();
|
|
5191
|
-
return /* @__PURE__ */ (0,
|
|
5899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("thead", { className: clsx_default(headerSticky ? "table-sticky" : null), children }) });
|
|
5192
5900
|
};
|
|
5193
5901
|
TableHead.displayName = "TableHead";
|
|
5194
5902
|
var TableHead_default = TableHead;
|
|
5195
5903
|
|
|
5196
5904
|
// src/components/Table/TableRow.tsx
|
|
5197
|
-
var
|
|
5198
|
-
var
|
|
5199
|
-
var TableRow =
|
|
5905
|
+
var import_react38 = __toESM(require("react"), 1);
|
|
5906
|
+
var import_jsx_runtime345 = require("react/jsx-runtime");
|
|
5907
|
+
var TableRow = import_react38.default.memo((props) => {
|
|
5200
5908
|
const {
|
|
5201
5909
|
children,
|
|
5202
5910
|
type = "secondary",
|
|
@@ -5205,14 +5913,14 @@ var TableRow = import_react37.default.memo((props) => {
|
|
|
5205
5913
|
onClick
|
|
5206
5914
|
} = props;
|
|
5207
5915
|
const { rowBorderUse } = useTableContext();
|
|
5208
|
-
const [stickyCells, setStickyCells] =
|
|
5916
|
+
const [stickyCells, setStickyCells] = import_react38.default.useState([]);
|
|
5209
5917
|
const registerStickyCell = (ref) => {
|
|
5210
5918
|
setStickyCells((prev) => {
|
|
5211
5919
|
if (prev.includes(ref)) return prev;
|
|
5212
5920
|
return [...prev, ref];
|
|
5213
5921
|
});
|
|
5214
5922
|
};
|
|
5215
|
-
return /* @__PURE__ */ (0,
|
|
5923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(
|
|
5216
5924
|
"tr",
|
|
5217
5925
|
{
|
|
5218
5926
|
className: clsx_default(
|
|
@@ -5236,7 +5944,7 @@ TableRow.displayName = "TableRow";
|
|
|
5236
5944
|
var TableRow_default = TableRow;
|
|
5237
5945
|
|
|
5238
5946
|
// src/components/Tag/Tag.tsx
|
|
5239
|
-
var
|
|
5947
|
+
var import_jsx_runtime346 = require("react/jsx-runtime");
|
|
5240
5948
|
var Tag = (props) => {
|
|
5241
5949
|
const {
|
|
5242
5950
|
children,
|
|
@@ -5246,7 +5954,7 @@ var Tag = (props) => {
|
|
|
5246
5954
|
disabled = false,
|
|
5247
5955
|
colorIndex
|
|
5248
5956
|
} = props;
|
|
5249
|
-
return /* @__PURE__ */ (0,
|
|
5957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)(
|
|
5250
5958
|
"span",
|
|
5251
5959
|
{
|
|
5252
5960
|
className: clsx_default(
|
|
@@ -5257,8 +5965,8 @@ var Tag = (props) => {
|
|
|
5257
5965
|
disabled && "disabled"
|
|
5258
5966
|
),
|
|
5259
5967
|
children: [
|
|
5260
|
-
/* @__PURE__ */ (0,
|
|
5261
|
-
onClose && /* @__PURE__ */ (0,
|
|
5968
|
+
/* @__PURE__ */ (0, import_jsx_runtime346.jsx)("span", { className: "tag-label", children }),
|
|
5969
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime346.jsx)("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", disabled, children: /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(XIcon_default, {}) })
|
|
5262
5970
|
]
|
|
5263
5971
|
}
|
|
5264
5972
|
);
|
|
@@ -5267,12 +5975,12 @@ Tag.displayName = "Tag";
|
|
|
5267
5975
|
var Tag_default = Tag;
|
|
5268
5976
|
|
|
5269
5977
|
// src/components/TextArea/TextArea.tsx
|
|
5270
|
-
var
|
|
5271
|
-
var
|
|
5272
|
-
var TextArea =
|
|
5978
|
+
var import_react39 = __toESM(require("react"), 1);
|
|
5979
|
+
var import_jsx_runtime347 = require("react/jsx-runtime");
|
|
5980
|
+
var TextArea = import_react39.default.forwardRef(
|
|
5273
5981
|
(props, ref) => {
|
|
5274
5982
|
const { value, onChange, disabled, ...textareaProps } = props;
|
|
5275
|
-
const localRef =
|
|
5983
|
+
const localRef = import_react39.default.useRef(null);
|
|
5276
5984
|
const setRefs = (el) => {
|
|
5277
5985
|
localRef.current = el;
|
|
5278
5986
|
if (!ref) return;
|
|
@@ -5292,21 +6000,21 @@ var TextArea = import_react38.default.forwardRef(
|
|
|
5292
6000
|
onChange(event);
|
|
5293
6001
|
}
|
|
5294
6002
|
};
|
|
5295
|
-
|
|
6003
|
+
import_react39.default.useEffect(() => {
|
|
5296
6004
|
const el = localRef.current;
|
|
5297
6005
|
if (!el) return;
|
|
5298
6006
|
el.style.height = "0px";
|
|
5299
6007
|
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
5300
6008
|
el.style.height = `${nextHeight}px`;
|
|
5301
6009
|
}, [value]);
|
|
5302
|
-
return /* @__PURE__ */ (0,
|
|
6010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime347.jsx)("div", { className: "lib-xplat-textarea-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
5303
6011
|
"div",
|
|
5304
6012
|
{
|
|
5305
6013
|
className: clsx_default(
|
|
5306
6014
|
"lib-xplat-textarea",
|
|
5307
6015
|
disabled ? "disabled" : void 0
|
|
5308
6016
|
),
|
|
5309
|
-
children: /* @__PURE__ */ (0,
|
|
6017
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
5310
6018
|
"textarea",
|
|
5311
6019
|
{
|
|
5312
6020
|
...textareaProps,
|
|
@@ -5324,25 +6032,25 @@ TextArea.displayName = "TextArea";
|
|
|
5324
6032
|
var TextArea_default = TextArea;
|
|
5325
6033
|
|
|
5326
6034
|
// src/components/Toast/Toast.tsx
|
|
5327
|
-
var
|
|
6035
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
5328
6036
|
var import_react_dom4 = require("react-dom");
|
|
5329
|
-
var
|
|
5330
|
-
var ToastContext =
|
|
6037
|
+
var import_jsx_runtime348 = require("react/jsx-runtime");
|
|
6038
|
+
var ToastContext = import_react40.default.createContext(null);
|
|
5331
6039
|
var useToast = () => {
|
|
5332
|
-
const ctx =
|
|
6040
|
+
const ctx = import_react40.default.useContext(ToastContext);
|
|
5333
6041
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
5334
6042
|
return ctx;
|
|
5335
6043
|
};
|
|
5336
6044
|
var EXIT_DURATION = 300;
|
|
5337
6045
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
5338
|
-
const ref =
|
|
5339
|
-
const [height, setHeight] =
|
|
5340
|
-
|
|
6046
|
+
const ref = import_react40.default.useRef(null);
|
|
6047
|
+
const [height, setHeight] = import_react40.default.useState(void 0);
|
|
6048
|
+
import_react40.default.useEffect(() => {
|
|
5341
6049
|
if (ref.current && !isExiting) {
|
|
5342
6050
|
setHeight(ref.current.offsetHeight);
|
|
5343
6051
|
}
|
|
5344
6052
|
}, [isExiting]);
|
|
5345
|
-
return /* @__PURE__ */ (0,
|
|
6053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(
|
|
5346
6054
|
"div",
|
|
5347
6055
|
{
|
|
5348
6056
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -5350,15 +6058,15 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
5350
6058
|
maxHeight: isExiting ? 0 : height ?? "none",
|
|
5351
6059
|
marginBottom: isExiting ? 0 : void 0
|
|
5352
6060
|
},
|
|
5353
|
-
children: /* @__PURE__ */ (0,
|
|
6061
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime348.jsxs)(
|
|
5354
6062
|
"div",
|
|
5355
6063
|
{
|
|
5356
6064
|
ref,
|
|
5357
6065
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
5358
6066
|
role: "alert",
|
|
5359
6067
|
children: [
|
|
5360
|
-
/* @__PURE__ */ (0,
|
|
5361
|
-
/* @__PURE__ */ (0,
|
|
6068
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsx)("span", { className: "message", children: item.message }),
|
|
6069
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsx)("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
5362
6070
|
]
|
|
5363
6071
|
}
|
|
5364
6072
|
)
|
|
@@ -5369,13 +6077,13 @@ var ToastProvider = ({
|
|
|
5369
6077
|
children,
|
|
5370
6078
|
position = "top-right"
|
|
5371
6079
|
}) => {
|
|
5372
|
-
const [toasts, setToasts] =
|
|
5373
|
-
const [removing, setRemoving] =
|
|
5374
|
-
const [mounted, setMounted] =
|
|
5375
|
-
|
|
6080
|
+
const [toasts, setToasts] = import_react40.default.useState([]);
|
|
6081
|
+
const [removing, setRemoving] = import_react40.default.useState(/* @__PURE__ */ new Set());
|
|
6082
|
+
const [mounted, setMounted] = import_react40.default.useState(false);
|
|
6083
|
+
import_react40.default.useEffect(() => {
|
|
5376
6084
|
setMounted(true);
|
|
5377
6085
|
}, []);
|
|
5378
|
-
const remove =
|
|
6086
|
+
const remove = import_react40.default.useCallback((id) => {
|
|
5379
6087
|
setRemoving((prev) => new Set(prev).add(id));
|
|
5380
6088
|
setTimeout(() => {
|
|
5381
6089
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -5386,7 +6094,7 @@ var ToastProvider = ({
|
|
|
5386
6094
|
});
|
|
5387
6095
|
}, EXIT_DURATION);
|
|
5388
6096
|
}, []);
|
|
5389
|
-
const toast =
|
|
6097
|
+
const toast = import_react40.default.useCallback(
|
|
5390
6098
|
(type, message, duration = 3e3) => {
|
|
5391
6099
|
const id = `${Date.now()}-${Math.random()}`;
|
|
5392
6100
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -5396,10 +6104,10 @@ var ToastProvider = ({
|
|
|
5396
6104
|
},
|
|
5397
6105
|
[remove]
|
|
5398
6106
|
);
|
|
5399
|
-
return /* @__PURE__ */ (0,
|
|
6107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime348.jsxs)(ToastContext.Provider, { value: { toast }, children: [
|
|
5400
6108
|
children,
|
|
5401
6109
|
mounted && (0, import_react_dom4.createPortal)(
|
|
5402
|
-
/* @__PURE__ */ (0,
|
|
6110
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsx)("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(
|
|
5403
6111
|
ToastItemComponent,
|
|
5404
6112
|
{
|
|
5405
6113
|
item: t,
|
|
@@ -5415,8 +6123,8 @@ var ToastProvider = ({
|
|
|
5415
6123
|
ToastProvider.displayName = "ToastProvider";
|
|
5416
6124
|
|
|
5417
6125
|
// src/components/Tooltip/Tooltip.tsx
|
|
5418
|
-
var
|
|
5419
|
-
var
|
|
6126
|
+
var import_react41 = __toESM(require("react"), 1);
|
|
6127
|
+
var import_jsx_runtime349 = require("react/jsx-runtime");
|
|
5420
6128
|
var OFFSET = 12;
|
|
5421
6129
|
var SHOW_DELAY = 300;
|
|
5422
6130
|
var Tooltip = (props) => {
|
|
@@ -5427,12 +6135,12 @@ var Tooltip = (props) => {
|
|
|
5427
6135
|
children,
|
|
5428
6136
|
disabled = false
|
|
5429
6137
|
} = props;
|
|
5430
|
-
const triggerRef =
|
|
5431
|
-
const tooltipRef =
|
|
5432
|
-
const [visible, setVisible] =
|
|
5433
|
-
const [pos, setPos] =
|
|
5434
|
-
const delayTimer =
|
|
5435
|
-
const calculatePos =
|
|
6138
|
+
const triggerRef = import_react41.default.useRef(null);
|
|
6139
|
+
const tooltipRef = import_react41.default.useRef(null);
|
|
6140
|
+
const [visible, setVisible] = import_react41.default.useState(false);
|
|
6141
|
+
const [pos, setPos] = import_react41.default.useState({ left: 0, top: 0 });
|
|
6142
|
+
const delayTimer = import_react41.default.useRef(0);
|
|
6143
|
+
const calculatePos = import_react41.default.useCallback((clientX, clientY) => {
|
|
5436
6144
|
const el = tooltipRef.current;
|
|
5437
6145
|
if (!el) return;
|
|
5438
6146
|
const w = el.offsetWidth;
|
|
@@ -5445,38 +6153,38 @@ var Tooltip = (props) => {
|
|
|
5445
6153
|
if (left < 8) left = 8;
|
|
5446
6154
|
setPos({ left, top });
|
|
5447
6155
|
}, []);
|
|
5448
|
-
const handleMouseEnter =
|
|
6156
|
+
const handleMouseEnter = import_react41.default.useCallback(() => {
|
|
5449
6157
|
if (disabled) return;
|
|
5450
6158
|
delayTimer.current = window.setTimeout(() => {
|
|
5451
6159
|
setVisible(true);
|
|
5452
6160
|
}, SHOW_DELAY);
|
|
5453
6161
|
}, [disabled]);
|
|
5454
|
-
const handleMouseMove =
|
|
6162
|
+
const handleMouseMove = import_react41.default.useCallback((e) => {
|
|
5455
6163
|
if (!visible) return;
|
|
5456
6164
|
calculatePos(e.clientX, e.clientY);
|
|
5457
6165
|
}, [visible, calculatePos]);
|
|
5458
|
-
const handleMouseLeave =
|
|
6166
|
+
const handleMouseLeave = import_react41.default.useCallback(() => {
|
|
5459
6167
|
window.clearTimeout(delayTimer.current);
|
|
5460
6168
|
setVisible(false);
|
|
5461
6169
|
}, []);
|
|
5462
|
-
const handleClick =
|
|
6170
|
+
const handleClick = import_react41.default.useCallback(() => {
|
|
5463
6171
|
window.clearTimeout(delayTimer.current);
|
|
5464
6172
|
setVisible(false);
|
|
5465
6173
|
}, []);
|
|
5466
|
-
const handleFocus =
|
|
6174
|
+
const handleFocus = import_react41.default.useCallback(() => {
|
|
5467
6175
|
if (disabled) return;
|
|
5468
6176
|
setVisible(true);
|
|
5469
6177
|
}, [disabled]);
|
|
5470
|
-
const handleBlur =
|
|
6178
|
+
const handleBlur = import_react41.default.useCallback(() => {
|
|
5471
6179
|
setVisible(false);
|
|
5472
6180
|
}, []);
|
|
5473
|
-
|
|
6181
|
+
import_react41.default.useLayoutEffect(() => {
|
|
5474
6182
|
if (!visible || !triggerRef.current) return;
|
|
5475
6183
|
const rect = triggerRef.current.getBoundingClientRect();
|
|
5476
6184
|
calculatePos(rect.right, rect.top);
|
|
5477
6185
|
}, [visible, calculatePos]);
|
|
5478
|
-
if (!title && !description) return /* @__PURE__ */ (0,
|
|
5479
|
-
return /* @__PURE__ */ (0,
|
|
6186
|
+
if (!title && !description) return /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(import_jsx_runtime349.Fragment, { children });
|
|
6187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime349.jsxs)(
|
|
5480
6188
|
"div",
|
|
5481
6189
|
{
|
|
5482
6190
|
ref: triggerRef,
|
|
@@ -5489,15 +6197,15 @@ var Tooltip = (props) => {
|
|
|
5489
6197
|
onBlur: handleBlur,
|
|
5490
6198
|
children: [
|
|
5491
6199
|
children,
|
|
5492
|
-
visible && /* @__PURE__ */ (0,
|
|
6200
|
+
visible && /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime349.jsxs)(
|
|
5493
6201
|
"div",
|
|
5494
6202
|
{
|
|
5495
6203
|
ref: tooltipRef,
|
|
5496
6204
|
className: clsx_default("lib-xplat-tooltip", type),
|
|
5497
6205
|
style: { position: "fixed", left: pos.left, top: pos.top },
|
|
5498
6206
|
children: [
|
|
5499
|
-
title && /* @__PURE__ */ (0,
|
|
5500
|
-
description && /* @__PURE__ */ (0,
|
|
6207
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime349.jsx)("div", { className: "tooltip-title", children: title }),
|
|
6208
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime349.jsx)("div", { className: "tooltip-desc", children: description })
|
|
5501
6209
|
]
|
|
5502
6210
|
}
|
|
5503
6211
|
) })
|
|
@@ -5509,11 +6217,11 @@ Tooltip.displayName = "Tooltip";
|
|
|
5509
6217
|
var Tooltip_default = Tooltip;
|
|
5510
6218
|
|
|
5511
6219
|
// src/components/Video/Video.tsx
|
|
5512
|
-
var
|
|
5513
|
-
var
|
|
5514
|
-
var PipIcon = () => /* @__PURE__ */ (0,
|
|
5515
|
-
/* @__PURE__ */ (0,
|
|
5516
|
-
/* @__PURE__ */ (0,
|
|
6220
|
+
var import_react42 = __toESM(require("react"), 1);
|
|
6221
|
+
var import_jsx_runtime350 = require("react/jsx-runtime");
|
|
6222
|
+
var PipIcon = () => /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
6223
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsx)("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
6224
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsx)("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
|
|
5517
6225
|
] });
|
|
5518
6226
|
var formatTime = (sec) => {
|
|
5519
6227
|
if (!Number.isFinite(sec) || sec < 0) return "0:00";
|
|
@@ -5521,7 +6229,7 @@ var formatTime = (sec) => {
|
|
|
5521
6229
|
const s = Math.floor(sec % 60);
|
|
5522
6230
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
5523
6231
|
};
|
|
5524
|
-
var Video =
|
|
6232
|
+
var Video = import_react42.default.forwardRef((props, ref) => {
|
|
5525
6233
|
const {
|
|
5526
6234
|
src,
|
|
5527
6235
|
poster,
|
|
@@ -5545,21 +6253,21 @@ var Video = import_react41.default.forwardRef((props, ref) => {
|
|
|
5545
6253
|
children,
|
|
5546
6254
|
...rest
|
|
5547
6255
|
} = props;
|
|
5548
|
-
const containerRef =
|
|
5549
|
-
const videoRef =
|
|
5550
|
-
const [isPlaying, setIsPlaying] =
|
|
5551
|
-
const [isLoaded, setIsLoaded] =
|
|
5552
|
-
const [currentTime, setCurrentTime] =
|
|
5553
|
-
const [duration, setDuration] =
|
|
5554
|
-
const [buffered, setBuffered] =
|
|
5555
|
-
const [volume, setVolume] =
|
|
5556
|
-
const [isMuted, setIsMuted] =
|
|
5557
|
-
const [isFullscreen, setIsFullscreen] =
|
|
5558
|
-
const [playbackRate, setPlaybackRate] =
|
|
5559
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
5560
|
-
const [captionsOn, setCaptionsOn] =
|
|
5561
|
-
const [isPip, setIsPip] =
|
|
5562
|
-
const setRefs =
|
|
6256
|
+
const containerRef = import_react42.default.useRef(null);
|
|
6257
|
+
const videoRef = import_react42.default.useRef(null);
|
|
6258
|
+
const [isPlaying, setIsPlaying] = import_react42.default.useState(Boolean(autoPlay));
|
|
6259
|
+
const [isLoaded, setIsLoaded] = import_react42.default.useState(false);
|
|
6260
|
+
const [currentTime, setCurrentTime] = import_react42.default.useState(0);
|
|
6261
|
+
const [duration, setDuration] = import_react42.default.useState(0);
|
|
6262
|
+
const [buffered, setBuffered] = import_react42.default.useState(0);
|
|
6263
|
+
const [volume, setVolume] = import_react42.default.useState(1);
|
|
6264
|
+
const [isMuted, setIsMuted] = import_react42.default.useState(Boolean(muted));
|
|
6265
|
+
const [isFullscreen, setIsFullscreen] = import_react42.default.useState(false);
|
|
6266
|
+
const [playbackRate, setPlaybackRate] = import_react42.default.useState(1);
|
|
6267
|
+
const [rateMenuOpen, setRateMenuOpen] = import_react42.default.useState(false);
|
|
6268
|
+
const [captionsOn, setCaptionsOn] = import_react42.default.useState(false);
|
|
6269
|
+
const [isPip, setIsPip] = import_react42.default.useState(false);
|
|
6270
|
+
const setRefs = import_react42.default.useCallback(
|
|
5563
6271
|
(el) => {
|
|
5564
6272
|
videoRef.current = el;
|
|
5565
6273
|
if (typeof ref === "function") ref(el);
|
|
@@ -5567,14 +6275,14 @@ var Video = import_react41.default.forwardRef((props, ref) => {
|
|
|
5567
6275
|
},
|
|
5568
6276
|
[ref]
|
|
5569
6277
|
);
|
|
5570
|
-
|
|
6278
|
+
import_react42.default.useEffect(() => {
|
|
5571
6279
|
const onFsChange = () => {
|
|
5572
6280
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
5573
6281
|
};
|
|
5574
6282
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
5575
6283
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
5576
6284
|
}, []);
|
|
5577
|
-
|
|
6285
|
+
import_react42.default.useEffect(() => {
|
|
5578
6286
|
const v = videoRef.current;
|
|
5579
6287
|
if (!v) return;
|
|
5580
6288
|
const onEnter = () => setIsPip(true);
|
|
@@ -5688,13 +6396,13 @@ var Video = import_react41.default.forwardRef((props, ref) => {
|
|
|
5688
6396
|
const volumePct = (isMuted ? 0 : volume) * 100;
|
|
5689
6397
|
const VolumeGlyph = isMuted || volume === 0 ? VolumeXIcon_default : volume < 0.5 ? VolumeIcon_default : Volume2Icon_default;
|
|
5690
6398
|
const pipSupported = typeof document !== "undefined" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled;
|
|
5691
|
-
return /* @__PURE__ */ (0,
|
|
6399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)(
|
|
5692
6400
|
"div",
|
|
5693
6401
|
{
|
|
5694
6402
|
ref: containerRef,
|
|
5695
6403
|
className: clsx_default("lib-xplat-video", showControls && "has-controls"),
|
|
5696
6404
|
children: [
|
|
5697
|
-
/* @__PURE__ */ (0,
|
|
6405
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsx)(
|
|
5698
6406
|
"video",
|
|
5699
6407
|
{
|
|
5700
6408
|
ref: setRefs,
|
|
@@ -5715,7 +6423,7 @@ var Video = import_react41.default.forwardRef((props, ref) => {
|
|
|
5715
6423
|
children
|
|
5716
6424
|
}
|
|
5717
6425
|
),
|
|
5718
|
-
showCenterPlay && /* @__PURE__ */ (0,
|
|
6426
|
+
showCenterPlay && /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(
|
|
5719
6427
|
"button",
|
|
5720
6428
|
{
|
|
5721
6429
|
type: "button",
|
|
@@ -5727,11 +6435,11 @@ var Video = import_react41.default.forwardRef((props, ref) => {
|
|
|
5727
6435
|
onClick: togglePlay,
|
|
5728
6436
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
5729
6437
|
tabIndex: -1,
|
|
5730
|
-
children: /* @__PURE__ */ (0,
|
|
6438
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime350.jsx)("span", { className: "center-play-icon", children: /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(PlayCircleIcon_default, {}) })
|
|
5731
6439
|
}
|
|
5732
6440
|
),
|
|
5733
|
-
showControls && /* @__PURE__ */ (0,
|
|
5734
|
-
/* @__PURE__ */ (0,
|
|
6441
|
+
showControls && /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
|
|
6442
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsx)(
|
|
5735
6443
|
"input",
|
|
5736
6444
|
{
|
|
5737
6445
|
type: "range",
|
|
@@ -5748,29 +6456,29 @@ var Video = import_react41.default.forwardRef((props, ref) => {
|
|
|
5748
6456
|
}
|
|
5749
6457
|
}
|
|
5750
6458
|
),
|
|
5751
|
-
/* @__PURE__ */ (0,
|
|
5752
|
-
/* @__PURE__ */ (0,
|
|
6459
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsxs)("div", { className: "controls-row", children: [
|
|
6460
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsx)(
|
|
5753
6461
|
"button",
|
|
5754
6462
|
{
|
|
5755
6463
|
type: "button",
|
|
5756
6464
|
className: "control-btn",
|
|
5757
6465
|
onClick: togglePlay,
|
|
5758
6466
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
5759
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
6467
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(PauseIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(PlayIcon_default, {})
|
|
5760
6468
|
}
|
|
5761
6469
|
),
|
|
5762
|
-
/* @__PURE__ */ (0,
|
|
5763
|
-
/* @__PURE__ */ (0,
|
|
6470
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsxs)("div", { className: "volume-group", children: [
|
|
6471
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsx)(
|
|
5764
6472
|
"button",
|
|
5765
6473
|
{
|
|
5766
6474
|
type: "button",
|
|
5767
6475
|
className: "control-btn",
|
|
5768
6476
|
onClick: toggleMute,
|
|
5769
6477
|
"aria-label": isMuted ? "\uC74C\uC18C\uAC70 \uD574\uC81C" : "\uC74C\uC18C\uAC70",
|
|
5770
|
-
children: /* @__PURE__ */ (0,
|
|
6478
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(VolumeGlyph, {})
|
|
5771
6479
|
}
|
|
5772
6480
|
),
|
|
5773
|
-
/* @__PURE__ */ (0,
|
|
6481
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsx)(
|
|
5774
6482
|
"input",
|
|
5775
6483
|
{
|
|
5776
6484
|
type: "range",
|
|
@@ -5785,14 +6493,14 @@ var Video = import_react41.default.forwardRef((props, ref) => {
|
|
|
5785
6493
|
}
|
|
5786
6494
|
)
|
|
5787
6495
|
] }),
|
|
5788
|
-
/* @__PURE__ */ (0,
|
|
6496
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsxs)("span", { className: "time", children: [
|
|
5789
6497
|
formatTime(currentTime),
|
|
5790
6498
|
" / ",
|
|
5791
6499
|
formatTime(duration)
|
|
5792
6500
|
] }),
|
|
5793
|
-
/* @__PURE__ */ (0,
|
|
5794
|
-
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ (0,
|
|
5795
|
-
/* @__PURE__ */ (0,
|
|
6501
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsx)("div", { className: "controls-spacer" }),
|
|
6502
|
+
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
|
|
6503
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsxs)(
|
|
5796
6504
|
"button",
|
|
5797
6505
|
{
|
|
5798
6506
|
type: "button",
|
|
@@ -5806,7 +6514,7 @@ var Video = import_react41.default.forwardRef((props, ref) => {
|
|
|
5806
6514
|
]
|
|
5807
6515
|
}
|
|
5808
6516
|
),
|
|
5809
|
-
rateMenuOpen && /* @__PURE__ */ (0,
|
|
6517
|
+
rateMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime350.jsx)("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ (0, import_jsx_runtime350.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)(
|
|
5810
6518
|
"button",
|
|
5811
6519
|
{
|
|
5812
6520
|
type: "button",
|
|
@@ -5820,7 +6528,7 @@ var Video = import_react41.default.forwardRef((props, ref) => {
|
|
|
5820
6528
|
}
|
|
5821
6529
|
) }, r2)) })
|
|
5822
6530
|
] }),
|
|
5823
|
-
showCaptions && /* @__PURE__ */ (0,
|
|
6531
|
+
showCaptions && /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(
|
|
5824
6532
|
"button",
|
|
5825
6533
|
{
|
|
5826
6534
|
type: "button",
|
|
@@ -5828,37 +6536,37 @@ var Video = import_react41.default.forwardRef((props, ref) => {
|
|
|
5828
6536
|
onClick: toggleCaptions,
|
|
5829
6537
|
"aria-label": captionsOn ? "\uC790\uB9C9 \uB044\uAE30" : "\uC790\uB9C9 \uCF1C\uAE30",
|
|
5830
6538
|
"aria-pressed": captionsOn,
|
|
5831
|
-
children: /* @__PURE__ */ (0,
|
|
6539
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(TypeIcon_default, {})
|
|
5832
6540
|
}
|
|
5833
6541
|
),
|
|
5834
|
-
showPip && pipSupported && /* @__PURE__ */ (0,
|
|
6542
|
+
showPip && pipSupported && /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(
|
|
5835
6543
|
"button",
|
|
5836
6544
|
{
|
|
5837
6545
|
type: "button",
|
|
5838
6546
|
className: clsx_default("control-btn", isPip && "is-active"),
|
|
5839
6547
|
onClick: togglePip,
|
|
5840
6548
|
"aria-label": isPip ? "PIP \uC885\uB8CC" : "PIP",
|
|
5841
|
-
children: /* @__PURE__ */ (0,
|
|
6549
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(PipIcon, {})
|
|
5842
6550
|
}
|
|
5843
6551
|
),
|
|
5844
|
-
showDownload && /* @__PURE__ */ (0,
|
|
6552
|
+
showDownload && /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(
|
|
5845
6553
|
"a",
|
|
5846
6554
|
{
|
|
5847
6555
|
className: "control-btn",
|
|
5848
6556
|
href: src,
|
|
5849
6557
|
download: downloadFileName ?? true,
|
|
5850
6558
|
"aria-label": "\uB2E4\uC6B4\uB85C\uB4DC",
|
|
5851
|
-
children: /* @__PURE__ */ (0,
|
|
6559
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(DownloadIcon_default, {})
|
|
5852
6560
|
}
|
|
5853
6561
|
),
|
|
5854
|
-
/* @__PURE__ */ (0,
|
|
6562
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsx)(
|
|
5855
6563
|
"button",
|
|
5856
6564
|
{
|
|
5857
6565
|
type: "button",
|
|
5858
6566
|
className: "control-btn",
|
|
5859
6567
|
onClick: toggleFullscreen,
|
|
5860
6568
|
"aria-label": isFullscreen ? "\uC804\uCCB4\uD654\uBA74 \uC885\uB8CC" : "\uC804\uCCB4\uD654\uBA74",
|
|
5861
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
6569
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(MinimizeIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(MaximizeIcon_default, {})
|
|
5862
6570
|
}
|
|
5863
6571
|
)
|
|
5864
6572
|
] })
|
|
@@ -5887,6 +6595,7 @@ var Video_default = Video;
|
|
|
5887
6595
|
Divider,
|
|
5888
6596
|
Drawer,
|
|
5889
6597
|
Dropdown,
|
|
6598
|
+
Editor,
|
|
5890
6599
|
EmptyState,
|
|
5891
6600
|
FileUpload,
|
|
5892
6601
|
HtmlTypewriter,
|