@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
package/dist/index.js
CHANGED
|
@@ -6097,14 +6097,14 @@ var CardTabRoot = (props) => {
|
|
|
6097
6097
|
);
|
|
6098
6098
|
return /* @__PURE__ */ jsxs195("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
|
|
6099
6099
|
/* @__PURE__ */ jsx304("div", { className: "card-tab-bar", children: tabs.map((tab) => {
|
|
6100
|
-
const
|
|
6100
|
+
const isActive2 = tab.value === activeValue;
|
|
6101
6101
|
return /* @__PURE__ */ jsx304(
|
|
6102
6102
|
"button",
|
|
6103
6103
|
{
|
|
6104
|
-
className: clsx_default("card-tab-trigger",
|
|
6104
|
+
className: clsx_default("card-tab-trigger", isActive2 && "active"),
|
|
6105
6105
|
onClick: () => handleTabClick(tab),
|
|
6106
6106
|
role: "tab",
|
|
6107
|
-
"aria-selected":
|
|
6107
|
+
"aria-selected": isActive2,
|
|
6108
6108
|
children: tab.title
|
|
6109
6109
|
},
|
|
6110
6110
|
tab.value
|
|
@@ -7479,12 +7479,12 @@ import React14 from "react";
|
|
|
7479
7479
|
import React13 from "react";
|
|
7480
7480
|
import { jsx as jsx317 } from "react/jsx-runtime";
|
|
7481
7481
|
var TabItem = React13.forwardRef((props, ref) => {
|
|
7482
|
-
const { isActive, title, onClick } = props;
|
|
7482
|
+
const { isActive: isActive2, title, onClick } = props;
|
|
7483
7483
|
return /* @__PURE__ */ jsx317(
|
|
7484
7484
|
"div",
|
|
7485
7485
|
{
|
|
7486
7486
|
ref,
|
|
7487
|
-
className: clsx_default("tab-item",
|
|
7487
|
+
className: clsx_default("tab-item", isActive2 ? "active" : null),
|
|
7488
7488
|
onClick,
|
|
7489
7489
|
children: title
|
|
7490
7490
|
}
|
|
@@ -7907,24 +7907,731 @@ var Dropdown = (props) => {
|
|
|
7907
7907
|
Dropdown.displayName = "Dropdown";
|
|
7908
7908
|
var Dropdown_default = Dropdown;
|
|
7909
7909
|
|
|
7910
|
-
// src/components/
|
|
7910
|
+
// src/components/Editor/Editor.tsx
|
|
7911
|
+
import React21 from "react";
|
|
7911
7912
|
import { jsx as jsx324, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
7913
|
+
var DEFAULT_TOOLBAR = [
|
|
7914
|
+
"bold",
|
|
7915
|
+
"italic",
|
|
7916
|
+
"underline",
|
|
7917
|
+
"strikethrough",
|
|
7918
|
+
"code",
|
|
7919
|
+
"heading",
|
|
7920
|
+
"list",
|
|
7921
|
+
"ordered-list",
|
|
7922
|
+
"blockquote",
|
|
7923
|
+
"code-block",
|
|
7924
|
+
"link",
|
|
7925
|
+
"image",
|
|
7926
|
+
"divider"
|
|
7927
|
+
];
|
|
7928
|
+
var ALLOWED_TAGS = /* @__PURE__ */ new Set([
|
|
7929
|
+
"p",
|
|
7930
|
+
"br",
|
|
7931
|
+
"h1",
|
|
7932
|
+
"h2",
|
|
7933
|
+
"h3",
|
|
7934
|
+
"h4",
|
|
7935
|
+
"h5",
|
|
7936
|
+
"h6",
|
|
7937
|
+
"ul",
|
|
7938
|
+
"ol",
|
|
7939
|
+
"li",
|
|
7940
|
+
"blockquote",
|
|
7941
|
+
"pre",
|
|
7942
|
+
"code",
|
|
7943
|
+
"strong",
|
|
7944
|
+
"b",
|
|
7945
|
+
"em",
|
|
7946
|
+
"i",
|
|
7947
|
+
"u",
|
|
7948
|
+
"s",
|
|
7949
|
+
"strike",
|
|
7950
|
+
"del",
|
|
7951
|
+
"a",
|
|
7952
|
+
"img",
|
|
7953
|
+
"hr",
|
|
7954
|
+
"span",
|
|
7955
|
+
"div"
|
|
7956
|
+
]);
|
|
7957
|
+
var ALLOWED_ATTRS = {
|
|
7958
|
+
a: ["href", "target", "rel"],
|
|
7959
|
+
img: ["src", "alt"]
|
|
7960
|
+
};
|
|
7961
|
+
var sanitizeHtml = (input) => {
|
|
7962
|
+
const doc = new DOMParser().parseFromString(`<div>${input}</div>`, "text/html");
|
|
7963
|
+
const root = doc.body.firstElementChild;
|
|
7964
|
+
if (!root) return "";
|
|
7965
|
+
const walk = (node) => {
|
|
7966
|
+
const children = Array.from(node.children);
|
|
7967
|
+
for (const child of children) {
|
|
7968
|
+
const tag = child.tagName.toLowerCase();
|
|
7969
|
+
if (!ALLOWED_TAGS.has(tag)) {
|
|
7970
|
+
while (child.firstChild) node.insertBefore(child.firstChild, child);
|
|
7971
|
+
node.removeChild(child);
|
|
7972
|
+
continue;
|
|
7973
|
+
}
|
|
7974
|
+
const allowed = ALLOWED_ATTRS[tag] || [];
|
|
7975
|
+
for (const attr of Array.from(child.attributes)) {
|
|
7976
|
+
if (!allowed.includes(attr.name)) {
|
|
7977
|
+
child.removeAttribute(attr.name);
|
|
7978
|
+
}
|
|
7979
|
+
if (attr.name === "href" || attr.name === "src") {
|
|
7980
|
+
const val = attr.value.trim().toLowerCase();
|
|
7981
|
+
if (val.startsWith("javascript:") || val.startsWith("data:text/html")) {
|
|
7982
|
+
child.removeAttribute(attr.name);
|
|
7983
|
+
}
|
|
7984
|
+
}
|
|
7985
|
+
}
|
|
7986
|
+
walk(child);
|
|
7987
|
+
}
|
|
7988
|
+
};
|
|
7989
|
+
walk(root);
|
|
7990
|
+
return root.innerHTML;
|
|
7991
|
+
};
|
|
7992
|
+
var escapeHtml = (text) => {
|
|
7993
|
+
const div = document.createElement("div");
|
|
7994
|
+
div.textContent = text;
|
|
7995
|
+
return div.innerHTML.replace(/\n/g, "<br>");
|
|
7996
|
+
};
|
|
7997
|
+
var SLASH_ITEMS = [
|
|
7998
|
+
{ key: "paragraph", label: "\uB2E8\uB77D", hint: "\uAE30\uBCF8 \uD14D\uC2A4\uD2B8" },
|
|
7999
|
+
{ key: "heading", label: "\uC81C\uBAA9 1", hint: "\uD070 \uC81C\uBAA9" },
|
|
8000
|
+
{ key: "list", label: "\uAE00\uBA38\uB9AC \uAE30\uD638 \uBAA9\uB85D", hint: "\u2022 \uD56D\uBAA9" },
|
|
8001
|
+
{ key: "ordered-list", label: "\uBC88\uD638 \uB9E4\uAE30\uAE30 \uBAA9\uB85D", hint: "1. \uD56D\uBAA9" },
|
|
8002
|
+
{ key: "blockquote", label: "\uC778\uC6A9", hint: "" },
|
|
8003
|
+
{ key: "code-block", label: "\uCF54\uB4DC \uBE14\uB85D", hint: "" },
|
|
8004
|
+
{ key: "divider", label: "\uAD6C\uBD84\uC120", hint: "\u2500" },
|
|
8005
|
+
{ key: "image", label: "\uC774\uBBF8\uC9C0", hint: "" }
|
|
8006
|
+
];
|
|
8007
|
+
var Editor = (props) => {
|
|
8008
|
+
const {
|
|
8009
|
+
value = "",
|
|
8010
|
+
onChange,
|
|
8011
|
+
placeholder = "\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",
|
|
8012
|
+
readOnly = false,
|
|
8013
|
+
toolbar = DEFAULT_TOOLBAR,
|
|
8014
|
+
enableSlashCommand = true,
|
|
8015
|
+
enableMarkdownShortcuts = true,
|
|
8016
|
+
onImageUpload,
|
|
8017
|
+
minHeight = 200
|
|
8018
|
+
} = props;
|
|
8019
|
+
const editorRef = React21.useRef(null);
|
|
8020
|
+
const lastRangeRef = React21.useRef(null);
|
|
8021
|
+
const composingRef = React21.useRef(false);
|
|
8022
|
+
const [isFocused, setIsFocused] = React21.useState(false);
|
|
8023
|
+
const [isEmpty, setIsEmpty] = React21.useState(!value);
|
|
8024
|
+
const [activeFormats, setActiveFormats] = React21.useState(/* @__PURE__ */ new Set());
|
|
8025
|
+
const [slashOpen, setSlashOpen] = React21.useState(false);
|
|
8026
|
+
const [slashFilter, setSlashFilter] = React21.useState("");
|
|
8027
|
+
const [slashIdx, setSlashIdx] = React21.useState(0);
|
|
8028
|
+
const [slashPos, setSlashPos] = React21.useState({ top: 0, left: 0 });
|
|
8029
|
+
const slashStartRangeRef = React21.useRef(null);
|
|
8030
|
+
const [linkOpen, setLinkOpen] = React21.useState(false);
|
|
8031
|
+
const [linkValue, setLinkValue] = React21.useState("");
|
|
8032
|
+
const [linkPos, setLinkPos] = React21.useState({ top: 0, left: 0 });
|
|
8033
|
+
React21.useEffect(() => {
|
|
8034
|
+
if (!editorRef.current) return;
|
|
8035
|
+
if (editorRef.current.innerHTML !== value) {
|
|
8036
|
+
editorRef.current.innerHTML = sanitizeHtml(value || "");
|
|
8037
|
+
updateEmpty();
|
|
8038
|
+
}
|
|
8039
|
+
}, [value]);
|
|
8040
|
+
const updateEmpty = () => {
|
|
8041
|
+
const el = editorRef.current;
|
|
8042
|
+
if (!el) return;
|
|
8043
|
+
const text = el.textContent || "";
|
|
8044
|
+
const childCount = el.children.length;
|
|
8045
|
+
setIsEmpty(text.length === 0 && childCount <= 1);
|
|
8046
|
+
};
|
|
8047
|
+
const saveSelection = () => {
|
|
8048
|
+
const sel = window.getSelection();
|
|
8049
|
+
if (sel && sel.rangeCount > 0 && editorRef.current?.contains(sel.anchorNode)) {
|
|
8050
|
+
lastRangeRef.current = sel.getRangeAt(0).cloneRange();
|
|
8051
|
+
}
|
|
8052
|
+
};
|
|
8053
|
+
const restoreSelection = () => {
|
|
8054
|
+
if (!lastRangeRef.current) return;
|
|
8055
|
+
const sel = window.getSelection();
|
|
8056
|
+
sel?.removeAllRanges();
|
|
8057
|
+
sel?.addRange(lastRangeRef.current);
|
|
8058
|
+
};
|
|
8059
|
+
const updateActiveFormats = () => {
|
|
8060
|
+
if (!editorRef.current) return;
|
|
8061
|
+
const sel = window.getSelection();
|
|
8062
|
+
if (!sel || !editorRef.current.contains(sel.anchorNode)) return;
|
|
8063
|
+
const next = /* @__PURE__ */ new Set();
|
|
8064
|
+
try {
|
|
8065
|
+
if (document.queryCommandState("bold")) next.add("bold");
|
|
8066
|
+
if (document.queryCommandState("italic")) next.add("italic");
|
|
8067
|
+
if (document.queryCommandState("underline")) next.add("underline");
|
|
8068
|
+
if (document.queryCommandState("strikethrough")) next.add("strikethrough");
|
|
8069
|
+
if (document.queryCommandState("insertUnorderedList")) next.add("list");
|
|
8070
|
+
if (document.queryCommandState("insertOrderedList")) next.add("ordered-list");
|
|
8071
|
+
const block = String(document.queryCommandValue("formatBlock") || "").toLowerCase();
|
|
8072
|
+
if (block) next.add(`block:${block}`);
|
|
8073
|
+
} catch {
|
|
8074
|
+
}
|
|
8075
|
+
setActiveFormats(next);
|
|
8076
|
+
};
|
|
8077
|
+
const exec = (cmd, val) => {
|
|
8078
|
+
document.execCommand(cmd, false, val);
|
|
8079
|
+
editorRef.current?.focus();
|
|
8080
|
+
updateActiveFormats();
|
|
8081
|
+
handleInput();
|
|
8082
|
+
};
|
|
8083
|
+
const setBlock = (tag) => {
|
|
8084
|
+
exec("formatBlock", tag);
|
|
8085
|
+
};
|
|
8086
|
+
const insertDivider = () => {
|
|
8087
|
+
exec("insertHorizontalRule");
|
|
8088
|
+
const el = editorRef.current;
|
|
8089
|
+
if (el && el.lastElementChild?.tagName === "HR") {
|
|
8090
|
+
const p = document.createElement("p");
|
|
8091
|
+
p.innerHTML = "<br>";
|
|
8092
|
+
el.appendChild(p);
|
|
8093
|
+
handleInput();
|
|
8094
|
+
}
|
|
8095
|
+
};
|
|
8096
|
+
const insertImageByUrl = (url) => {
|
|
8097
|
+
if (!url) return;
|
|
8098
|
+
exec("insertImage", url);
|
|
8099
|
+
};
|
|
8100
|
+
const triggerImageUpload = async () => {
|
|
8101
|
+
if (!onImageUpload) {
|
|
8102
|
+
const url = window.prompt("\uC774\uBBF8\uC9C0 URL");
|
|
8103
|
+
if (url) {
|
|
8104
|
+
restoreSelection();
|
|
8105
|
+
insertImageByUrl(url);
|
|
8106
|
+
}
|
|
8107
|
+
return;
|
|
8108
|
+
}
|
|
8109
|
+
const input = document.createElement("input");
|
|
8110
|
+
input.type = "file";
|
|
8111
|
+
input.accept = "image/*";
|
|
8112
|
+
input.onchange = async () => {
|
|
8113
|
+
const file = input.files?.[0];
|
|
8114
|
+
if (!file) return;
|
|
8115
|
+
try {
|
|
8116
|
+
const url = await onImageUpload(file);
|
|
8117
|
+
restoreSelection();
|
|
8118
|
+
insertImageByUrl(url);
|
|
8119
|
+
} catch (err) {
|
|
8120
|
+
console.error("\uC774\uBBF8\uC9C0 \uC5C5\uB85C\uB4DC \uC2E4\uD328:", err);
|
|
8121
|
+
}
|
|
8122
|
+
};
|
|
8123
|
+
input.click();
|
|
8124
|
+
};
|
|
8125
|
+
const openSlashMenu = () => {
|
|
8126
|
+
if (!enableSlashCommand) return;
|
|
8127
|
+
const sel = window.getSelection();
|
|
8128
|
+
if (!sel || sel.rangeCount === 0) return;
|
|
8129
|
+
const range = sel.getRangeAt(0);
|
|
8130
|
+
slashStartRangeRef.current = range.cloneRange();
|
|
8131
|
+
const rect = range.getBoundingClientRect();
|
|
8132
|
+
const editorRect = editorRef.current.getBoundingClientRect();
|
|
8133
|
+
setSlashPos({
|
|
8134
|
+
top: rect.bottom - editorRect.top + 4,
|
|
8135
|
+
left: rect.left - editorRect.left
|
|
8136
|
+
});
|
|
8137
|
+
setSlashFilter("");
|
|
8138
|
+
setSlashIdx(0);
|
|
8139
|
+
setSlashOpen(true);
|
|
8140
|
+
};
|
|
8141
|
+
const closeSlashMenu = () => {
|
|
8142
|
+
setSlashOpen(false);
|
|
8143
|
+
setSlashFilter("");
|
|
8144
|
+
setSlashIdx(0);
|
|
8145
|
+
slashStartRangeRef.current = null;
|
|
8146
|
+
};
|
|
8147
|
+
const filteredSlashItems = React21.useMemo(() => {
|
|
8148
|
+
if (!slashFilter) return SLASH_ITEMS;
|
|
8149
|
+
const f = slashFilter.toLowerCase();
|
|
8150
|
+
return SLASH_ITEMS.filter((it) => it.label.toLowerCase().includes(f) || it.key.includes(f));
|
|
8151
|
+
}, [slashFilter]);
|
|
8152
|
+
const removeSlashTrigger = () => {
|
|
8153
|
+
const sel = window.getSelection();
|
|
8154
|
+
if (!sel || sel.rangeCount === 0) return;
|
|
8155
|
+
const range = sel.getRangeAt(0);
|
|
8156
|
+
const node = range.startContainer;
|
|
8157
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
8158
|
+
const text = node.textContent || "";
|
|
8159
|
+
const idx = text.lastIndexOf("/");
|
|
8160
|
+
if (idx >= 0) {
|
|
8161
|
+
node.textContent = text.slice(0, idx) + text.slice(range.startOffset);
|
|
8162
|
+
const newRange = document.createRange();
|
|
8163
|
+
newRange.setStart(node, idx);
|
|
8164
|
+
newRange.collapse(true);
|
|
8165
|
+
sel.removeAllRanges();
|
|
8166
|
+
sel.addRange(newRange);
|
|
8167
|
+
}
|
|
8168
|
+
}
|
|
8169
|
+
};
|
|
8170
|
+
const applySlashItem = (item) => {
|
|
8171
|
+
removeSlashTrigger();
|
|
8172
|
+
closeSlashMenu();
|
|
8173
|
+
switch (item.key) {
|
|
8174
|
+
case "paragraph":
|
|
8175
|
+
setBlock("p");
|
|
8176
|
+
break;
|
|
8177
|
+
case "heading":
|
|
8178
|
+
setBlock("h2");
|
|
8179
|
+
break;
|
|
8180
|
+
case "list":
|
|
8181
|
+
exec("insertUnorderedList");
|
|
8182
|
+
break;
|
|
8183
|
+
case "ordered-list":
|
|
8184
|
+
exec("insertOrderedList");
|
|
8185
|
+
break;
|
|
8186
|
+
case "blockquote":
|
|
8187
|
+
setBlock("blockquote");
|
|
8188
|
+
break;
|
|
8189
|
+
case "code-block":
|
|
8190
|
+
setBlock("pre");
|
|
8191
|
+
break;
|
|
8192
|
+
case "divider":
|
|
8193
|
+
insertDivider();
|
|
8194
|
+
break;
|
|
8195
|
+
case "image":
|
|
8196
|
+
triggerImageUpload();
|
|
8197
|
+
break;
|
|
8198
|
+
default:
|
|
8199
|
+
break;
|
|
8200
|
+
}
|
|
8201
|
+
};
|
|
8202
|
+
const openLinkEditor = () => {
|
|
8203
|
+
saveSelection();
|
|
8204
|
+
const sel = window.getSelection();
|
|
8205
|
+
if (!sel || sel.rangeCount === 0) return;
|
|
8206
|
+
const range = sel.getRangeAt(0);
|
|
8207
|
+
const rect = range.getBoundingClientRect();
|
|
8208
|
+
const editorRect = editorRef.current.getBoundingClientRect();
|
|
8209
|
+
setLinkPos({
|
|
8210
|
+
top: rect.bottom - editorRect.top + 4,
|
|
8211
|
+
left: rect.left - editorRect.left
|
|
8212
|
+
});
|
|
8213
|
+
const anchor = sel.anchorNode?.parentElement?.closest("a");
|
|
8214
|
+
setLinkValue(anchor?.getAttribute("href") || "");
|
|
8215
|
+
setLinkOpen(true);
|
|
8216
|
+
};
|
|
8217
|
+
const applyLink = () => {
|
|
8218
|
+
restoreSelection();
|
|
8219
|
+
if (linkValue) {
|
|
8220
|
+
exec("createLink", linkValue);
|
|
8221
|
+
const sel = window.getSelection();
|
|
8222
|
+
const anchor = sel?.anchorNode?.parentElement?.closest("a");
|
|
8223
|
+
if (anchor) {
|
|
8224
|
+
anchor.setAttribute("target", "_blank");
|
|
8225
|
+
anchor.setAttribute("rel", "noopener noreferrer");
|
|
8226
|
+
}
|
|
8227
|
+
} else {
|
|
8228
|
+
exec("unlink");
|
|
8229
|
+
}
|
|
8230
|
+
setLinkOpen(false);
|
|
8231
|
+
};
|
|
8232
|
+
const tryMarkdownShortcut = () => {
|
|
8233
|
+
if (!enableMarkdownShortcuts) return false;
|
|
8234
|
+
const sel = window.getSelection();
|
|
8235
|
+
if (!sel || sel.rangeCount === 0) return false;
|
|
8236
|
+
const range = sel.getRangeAt(0);
|
|
8237
|
+
const node = range.startContainer;
|
|
8238
|
+
if (node.nodeType !== Node.TEXT_NODE) return false;
|
|
8239
|
+
const text = (node.textContent || "").slice(0, range.startOffset);
|
|
8240
|
+
const patterns = [
|
|
8241
|
+
[/^###\s$/, () => setBlock("h3")],
|
|
8242
|
+
[/^##\s$/, () => setBlock("h2")],
|
|
8243
|
+
[/^#\s$/, () => setBlock("h1")],
|
|
8244
|
+
[/^-\s$/, () => exec("insertUnorderedList")],
|
|
8245
|
+
[/^\*\s$/, () => exec("insertUnorderedList")],
|
|
8246
|
+
[/^1\.\s$/, () => exec("insertOrderedList")],
|
|
8247
|
+
[/^>\s$/, () => setBlock("blockquote")]
|
|
8248
|
+
];
|
|
8249
|
+
for (const [re, fn] of patterns) {
|
|
8250
|
+
if (re.test(text)) {
|
|
8251
|
+
node.textContent = (node.textContent || "").slice(range.startOffset);
|
|
8252
|
+
const newRange = document.createRange();
|
|
8253
|
+
newRange.setStart(node, 0);
|
|
8254
|
+
newRange.collapse(true);
|
|
8255
|
+
sel.removeAllRanges();
|
|
8256
|
+
sel.addRange(newRange);
|
|
8257
|
+
fn();
|
|
8258
|
+
return true;
|
|
8259
|
+
}
|
|
8260
|
+
}
|
|
8261
|
+
return false;
|
|
8262
|
+
};
|
|
8263
|
+
const handleInput = () => {
|
|
8264
|
+
if (composingRef.current) return;
|
|
8265
|
+
const el = editorRef.current;
|
|
8266
|
+
if (!el) return;
|
|
8267
|
+
onChange?.(el.innerHTML);
|
|
8268
|
+
updateEmpty();
|
|
8269
|
+
updateActiveFormats();
|
|
8270
|
+
if (slashOpen) {
|
|
8271
|
+
const sel = window.getSelection();
|
|
8272
|
+
if (sel && sel.rangeCount > 0) {
|
|
8273
|
+
const range = sel.getRangeAt(0);
|
|
8274
|
+
const node = range.startContainer;
|
|
8275
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
8276
|
+
const text = node.textContent || "";
|
|
8277
|
+
const lastSlash = text.lastIndexOf("/", range.startOffset - 1);
|
|
8278
|
+
if (lastSlash >= 0) {
|
|
8279
|
+
const filter = text.slice(lastSlash + 1, range.startOffset);
|
|
8280
|
+
if (filter.includes(" ") || filter.includes("\n")) {
|
|
8281
|
+
closeSlashMenu();
|
|
8282
|
+
} else {
|
|
8283
|
+
setSlashFilter(filter);
|
|
8284
|
+
setSlashIdx(0);
|
|
8285
|
+
}
|
|
8286
|
+
} else {
|
|
8287
|
+
closeSlashMenu();
|
|
8288
|
+
}
|
|
8289
|
+
}
|
|
8290
|
+
}
|
|
8291
|
+
}
|
|
8292
|
+
};
|
|
8293
|
+
const handleKeyDown = (e) => {
|
|
8294
|
+
if (readOnly) return;
|
|
8295
|
+
if (slashOpen) {
|
|
8296
|
+
if (e.key === "ArrowDown") {
|
|
8297
|
+
e.preventDefault();
|
|
8298
|
+
setSlashIdx((i) => Math.min(i + 1, filteredSlashItems.length - 1));
|
|
8299
|
+
return;
|
|
8300
|
+
}
|
|
8301
|
+
if (e.key === "ArrowUp") {
|
|
8302
|
+
e.preventDefault();
|
|
8303
|
+
setSlashIdx((i) => Math.max(i - 1, 0));
|
|
8304
|
+
return;
|
|
8305
|
+
}
|
|
8306
|
+
if (e.key === "Enter") {
|
|
8307
|
+
e.preventDefault();
|
|
8308
|
+
const item = filteredSlashItems[slashIdx];
|
|
8309
|
+
if (item) applySlashItem(item);
|
|
8310
|
+
return;
|
|
8311
|
+
}
|
|
8312
|
+
if (e.key === "Escape") {
|
|
8313
|
+
e.preventDefault();
|
|
8314
|
+
closeSlashMenu();
|
|
8315
|
+
return;
|
|
8316
|
+
}
|
|
8317
|
+
}
|
|
8318
|
+
if ((e.metaKey || e.ctrlKey) && !e.shiftKey && !e.altKey) {
|
|
8319
|
+
const k = e.key.toLowerCase();
|
|
8320
|
+
if (k === "b") {
|
|
8321
|
+
e.preventDefault();
|
|
8322
|
+
exec("bold");
|
|
8323
|
+
return;
|
|
8324
|
+
}
|
|
8325
|
+
if (k === "i") {
|
|
8326
|
+
e.preventDefault();
|
|
8327
|
+
exec("italic");
|
|
8328
|
+
return;
|
|
8329
|
+
}
|
|
8330
|
+
if (k === "u") {
|
|
8331
|
+
e.preventDefault();
|
|
8332
|
+
exec("underline");
|
|
8333
|
+
return;
|
|
8334
|
+
}
|
|
8335
|
+
if (k === "k") {
|
|
8336
|
+
e.preventDefault();
|
|
8337
|
+
openLinkEditor();
|
|
8338
|
+
return;
|
|
8339
|
+
}
|
|
8340
|
+
}
|
|
8341
|
+
if (enableSlashCommand && e.key === "/") {
|
|
8342
|
+
setTimeout(openSlashMenu, 0);
|
|
8343
|
+
}
|
|
8344
|
+
if (enableMarkdownShortcuts && e.key === " ") {
|
|
8345
|
+
if (tryMarkdownShortcut()) {
|
|
8346
|
+
e.preventDefault();
|
|
8347
|
+
}
|
|
8348
|
+
}
|
|
8349
|
+
};
|
|
8350
|
+
const handlePaste = (e) => {
|
|
8351
|
+
if (readOnly) return;
|
|
8352
|
+
e.preventDefault();
|
|
8353
|
+
const html = e.clipboardData.getData("text/html");
|
|
8354
|
+
const text = e.clipboardData.getData("text/plain");
|
|
8355
|
+
const clean = html ? sanitizeHtml(html) : escapeHtml(text);
|
|
8356
|
+
document.execCommand("insertHTML", false, clean);
|
|
8357
|
+
handleInput();
|
|
8358
|
+
};
|
|
8359
|
+
const handleCompositionStart = () => {
|
|
8360
|
+
composingRef.current = true;
|
|
8361
|
+
};
|
|
8362
|
+
const handleCompositionEnd = () => {
|
|
8363
|
+
composingRef.current = false;
|
|
8364
|
+
handleInput();
|
|
8365
|
+
};
|
|
8366
|
+
const handleFocus = () => {
|
|
8367
|
+
setIsFocused(true);
|
|
8368
|
+
updateActiveFormats();
|
|
8369
|
+
};
|
|
8370
|
+
const handleBlur = () => {
|
|
8371
|
+
setIsFocused(false);
|
|
8372
|
+
saveSelection();
|
|
8373
|
+
};
|
|
8374
|
+
const handleSelectionUpdate = () => {
|
|
8375
|
+
updateActiveFormats();
|
|
8376
|
+
};
|
|
8377
|
+
const onToolbarAction = (item) => {
|
|
8378
|
+
switch (item) {
|
|
8379
|
+
case "bold":
|
|
8380
|
+
exec("bold");
|
|
8381
|
+
break;
|
|
8382
|
+
case "italic":
|
|
8383
|
+
exec("italic");
|
|
8384
|
+
break;
|
|
8385
|
+
case "underline":
|
|
8386
|
+
exec("underline");
|
|
8387
|
+
break;
|
|
8388
|
+
case "strikethrough":
|
|
8389
|
+
exec("strikethrough");
|
|
8390
|
+
break;
|
|
8391
|
+
case "code": {
|
|
8392
|
+
const sel = window.getSelection();
|
|
8393
|
+
if (!sel || sel.rangeCount === 0 || sel.isCollapsed) return;
|
|
8394
|
+
const range = sel.getRangeAt(0);
|
|
8395
|
+
const code = document.createElement("code");
|
|
8396
|
+
try {
|
|
8397
|
+
range.surroundContents(code);
|
|
8398
|
+
} catch {
|
|
8399
|
+
const frag = range.extractContents();
|
|
8400
|
+
code.appendChild(frag);
|
|
8401
|
+
range.insertNode(code);
|
|
8402
|
+
}
|
|
8403
|
+
handleInput();
|
|
8404
|
+
break;
|
|
8405
|
+
}
|
|
8406
|
+
case "heading":
|
|
8407
|
+
setBlock("h2");
|
|
8408
|
+
break;
|
|
8409
|
+
case "list":
|
|
8410
|
+
exec("insertUnorderedList");
|
|
8411
|
+
break;
|
|
8412
|
+
case "ordered-list":
|
|
8413
|
+
exec("insertOrderedList");
|
|
8414
|
+
break;
|
|
8415
|
+
case "blockquote":
|
|
8416
|
+
setBlock("blockquote");
|
|
8417
|
+
break;
|
|
8418
|
+
case "code-block":
|
|
8419
|
+
setBlock("pre");
|
|
8420
|
+
break;
|
|
8421
|
+
case "link":
|
|
8422
|
+
openLinkEditor();
|
|
8423
|
+
break;
|
|
8424
|
+
case "image":
|
|
8425
|
+
triggerImageUpload();
|
|
8426
|
+
break;
|
|
8427
|
+
case "divider":
|
|
8428
|
+
insertDivider();
|
|
8429
|
+
break;
|
|
8430
|
+
}
|
|
8431
|
+
};
|
|
8432
|
+
return /* @__PURE__ */ jsxs208("div", { className: clsx_default("lib-xplat-editor", isFocused && "focused", readOnly && "readonly"), children: [
|
|
8433
|
+
!readOnly && /* @__PURE__ */ jsx324(
|
|
8434
|
+
EditorToolbar,
|
|
8435
|
+
{
|
|
8436
|
+
items: toolbar,
|
|
8437
|
+
active: activeFormats,
|
|
8438
|
+
onAction: onToolbarAction
|
|
8439
|
+
}
|
|
8440
|
+
),
|
|
8441
|
+
/* @__PURE__ */ jsxs208("div", { className: "lib-xplat-editor__content", style: { minHeight }, children: [
|
|
8442
|
+
isEmpty && !isFocused && /* @__PURE__ */ jsx324("div", { className: "lib-xplat-editor__placeholder", children: placeholder }),
|
|
8443
|
+
/* @__PURE__ */ jsx324(
|
|
8444
|
+
"div",
|
|
8445
|
+
{
|
|
8446
|
+
ref: editorRef,
|
|
8447
|
+
contentEditable: !readOnly,
|
|
8448
|
+
suppressContentEditableWarning: true,
|
|
8449
|
+
className: "lib-xplat-editor__editable",
|
|
8450
|
+
onInput: handleInput,
|
|
8451
|
+
onKeyDown: handleKeyDown,
|
|
8452
|
+
onKeyUp: handleSelectionUpdate,
|
|
8453
|
+
onMouseUp: handleSelectionUpdate,
|
|
8454
|
+
onPaste: handlePaste,
|
|
8455
|
+
onCompositionStart: handleCompositionStart,
|
|
8456
|
+
onCompositionEnd: handleCompositionEnd,
|
|
8457
|
+
onFocus: handleFocus,
|
|
8458
|
+
onBlur: handleBlur,
|
|
8459
|
+
spellCheck: true
|
|
8460
|
+
}
|
|
8461
|
+
),
|
|
8462
|
+
slashOpen && filteredSlashItems.length > 0 && /* @__PURE__ */ jsx324(
|
|
8463
|
+
SlashMenu,
|
|
8464
|
+
{
|
|
8465
|
+
position: slashPos,
|
|
8466
|
+
items: filteredSlashItems,
|
|
8467
|
+
activeIndex: slashIdx,
|
|
8468
|
+
onSelect: applySlashItem,
|
|
8469
|
+
onClose: closeSlashMenu
|
|
8470
|
+
}
|
|
8471
|
+
),
|
|
8472
|
+
linkOpen && /* @__PURE__ */ jsx324(
|
|
8473
|
+
LinkPopover,
|
|
8474
|
+
{
|
|
8475
|
+
position: linkPos,
|
|
8476
|
+
value: linkValue,
|
|
8477
|
+
onChange: setLinkValue,
|
|
8478
|
+
onConfirm: applyLink,
|
|
8479
|
+
onClose: () => setLinkOpen(false)
|
|
8480
|
+
}
|
|
8481
|
+
)
|
|
8482
|
+
] })
|
|
8483
|
+
] });
|
|
8484
|
+
};
|
|
8485
|
+
Editor.displayName = "Editor";
|
|
8486
|
+
var Editor_default = Editor;
|
|
8487
|
+
var TOOLBAR_LABEL = {
|
|
8488
|
+
bold: "B",
|
|
8489
|
+
italic: "I",
|
|
8490
|
+
underline: "U",
|
|
8491
|
+
strikethrough: "S",
|
|
8492
|
+
code: "<>",
|
|
8493
|
+
heading: "H",
|
|
8494
|
+
list: "\u2022",
|
|
8495
|
+
"ordered-list": "1.",
|
|
8496
|
+
blockquote: "\u275D",
|
|
8497
|
+
"code-block": "[ ]",
|
|
8498
|
+
link: "\u{1F517}",
|
|
8499
|
+
image: "\u{1F5BC}",
|
|
8500
|
+
divider: "\u2014"
|
|
8501
|
+
};
|
|
8502
|
+
var TOOLBAR_TITLE = {
|
|
8503
|
+
bold: "\uAD75\uAC8C (\u2318B)",
|
|
8504
|
+
italic: "\uAE30\uC6B8\uC784 (\u2318I)",
|
|
8505
|
+
underline: "\uBC11\uC904 (\u2318U)",
|
|
8506
|
+
strikethrough: "\uCDE8\uC18C\uC120",
|
|
8507
|
+
code: "\uC778\uB77C\uC778 \uCF54\uB4DC",
|
|
8508
|
+
heading: "\uC81C\uBAA9",
|
|
8509
|
+
list: "\uAE00\uBA38\uB9AC \uAE30\uD638 \uBAA9\uB85D",
|
|
8510
|
+
"ordered-list": "\uBC88\uD638 \uB9E4\uAE30\uAE30 \uBAA9\uB85D",
|
|
8511
|
+
blockquote: "\uC778\uC6A9",
|
|
8512
|
+
"code-block": "\uCF54\uB4DC \uBE14\uB85D",
|
|
8513
|
+
link: "\uB9C1\uD06C (\u2318K)",
|
|
8514
|
+
image: "\uC774\uBBF8\uC9C0",
|
|
8515
|
+
divider: "\uAD6C\uBD84\uC120"
|
|
8516
|
+
};
|
|
8517
|
+
var isActive = (item, active) => {
|
|
8518
|
+
if (item === "heading") return active.has("block:h1") || active.has("block:h2") || active.has("block:h3");
|
|
8519
|
+
if (item === "blockquote") return active.has("block:blockquote");
|
|
8520
|
+
if (item === "code-block") return active.has("block:pre");
|
|
8521
|
+
return active.has(item);
|
|
8522
|
+
};
|
|
8523
|
+
var EditorToolbar = ({ items, active, onAction }) => {
|
|
8524
|
+
return /* @__PURE__ */ jsx324("div", { className: "lib-xplat-editor__toolbar", children: items.map((item) => /* @__PURE__ */ jsx324(
|
|
8525
|
+
"button",
|
|
8526
|
+
{
|
|
8527
|
+
type: "button",
|
|
8528
|
+
className: clsx_default("lib-xplat-editor__toolbar-btn", isActive(item, active) && "active"),
|
|
8529
|
+
title: TOOLBAR_TITLE[item],
|
|
8530
|
+
onMouseDown: (e) => {
|
|
8531
|
+
e.preventDefault();
|
|
8532
|
+
onAction(item);
|
|
8533
|
+
},
|
|
8534
|
+
children: TOOLBAR_LABEL[item]
|
|
8535
|
+
},
|
|
8536
|
+
item
|
|
8537
|
+
)) });
|
|
8538
|
+
};
|
|
8539
|
+
var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
8540
|
+
React21.useEffect(() => {
|
|
8541
|
+
const handleClickOutside = (e) => {
|
|
8542
|
+
const target = e.target;
|
|
8543
|
+
const menu = document.querySelector(".lib-xplat-editor__slash-menu");
|
|
8544
|
+
if (menu && !menu.contains(target)) onClose();
|
|
8545
|
+
};
|
|
8546
|
+
window.addEventListener("mousedown", handleClickOutside);
|
|
8547
|
+
return () => window.removeEventListener("mousedown", handleClickOutside);
|
|
8548
|
+
}, [onClose]);
|
|
8549
|
+
return /* @__PURE__ */ jsx324(
|
|
8550
|
+
"div",
|
|
8551
|
+
{
|
|
8552
|
+
className: "lib-xplat-editor__slash-menu",
|
|
8553
|
+
style: { top: position.top, left: position.left },
|
|
8554
|
+
children: items.map((item, i) => /* @__PURE__ */ jsxs208(
|
|
8555
|
+
"button",
|
|
8556
|
+
{
|
|
8557
|
+
type: "button",
|
|
8558
|
+
className: clsx_default("lib-xplat-editor__slash-item", i === activeIndex && "active"),
|
|
8559
|
+
onMouseDown: (e) => {
|
|
8560
|
+
e.preventDefault();
|
|
8561
|
+
onSelect(item);
|
|
8562
|
+
},
|
|
8563
|
+
children: [
|
|
8564
|
+
/* @__PURE__ */ jsx324("span", { className: "label", children: item.label }),
|
|
8565
|
+
item.hint && /* @__PURE__ */ jsx324("span", { className: "hint", children: item.hint })
|
|
8566
|
+
]
|
|
8567
|
+
},
|
|
8568
|
+
item.key
|
|
8569
|
+
))
|
|
8570
|
+
}
|
|
8571
|
+
);
|
|
8572
|
+
};
|
|
8573
|
+
var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
8574
|
+
const inputRef = React21.useRef(null);
|
|
8575
|
+
React21.useEffect(() => {
|
|
8576
|
+
inputRef.current?.focus();
|
|
8577
|
+
}, []);
|
|
8578
|
+
return /* @__PURE__ */ jsxs208(
|
|
8579
|
+
"div",
|
|
8580
|
+
{
|
|
8581
|
+
className: "lib-xplat-editor__link-popover",
|
|
8582
|
+
style: { top: position.top, left: position.left },
|
|
8583
|
+
children: [
|
|
8584
|
+
/* @__PURE__ */ jsx324(
|
|
8585
|
+
"input",
|
|
8586
|
+
{
|
|
8587
|
+
ref: inputRef,
|
|
8588
|
+
type: "url",
|
|
8589
|
+
placeholder: "https://",
|
|
8590
|
+
value,
|
|
8591
|
+
onChange: (e) => onChange(e.target.value),
|
|
8592
|
+
onKeyDown: (e) => {
|
|
8593
|
+
if (e.key === "Enter") {
|
|
8594
|
+
e.preventDefault();
|
|
8595
|
+
onConfirm();
|
|
8596
|
+
}
|
|
8597
|
+
if (e.key === "Escape") {
|
|
8598
|
+
e.preventDefault();
|
|
8599
|
+
onClose();
|
|
8600
|
+
}
|
|
8601
|
+
}
|
|
8602
|
+
}
|
|
8603
|
+
),
|
|
8604
|
+
/* @__PURE__ */ jsx324("button", { type: "button", onMouseDown: (e) => {
|
|
8605
|
+
e.preventDefault();
|
|
8606
|
+
onConfirm();
|
|
8607
|
+
}, children: "\uC801\uC6A9" }),
|
|
8608
|
+
/* @__PURE__ */ jsx324("button", { type: "button", onMouseDown: (e) => {
|
|
8609
|
+
e.preventDefault();
|
|
8610
|
+
onClose();
|
|
8611
|
+
}, children: "\uCDE8\uC18C" })
|
|
8612
|
+
]
|
|
8613
|
+
}
|
|
8614
|
+
);
|
|
8615
|
+
};
|
|
8616
|
+
|
|
8617
|
+
// src/components/EmptyState/EmptyState.tsx
|
|
8618
|
+
import { jsx as jsx325, jsxs as jsxs209 } from "react/jsx-runtime";
|
|
7912
8619
|
var EmptyState = (props) => {
|
|
7913
8620
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
7914
|
-
return /* @__PURE__ */
|
|
7915
|
-
icon && /* @__PURE__ */
|
|
7916
|
-
!icon && /* @__PURE__ */
|
|
7917
|
-
/* @__PURE__ */
|
|
7918
|
-
description && /* @__PURE__ */
|
|
7919
|
-
action && /* @__PURE__ */
|
|
8621
|
+
return /* @__PURE__ */ jsxs209("div", { className: "lib-xplat-empty-state", children: [
|
|
8622
|
+
icon && /* @__PURE__ */ jsx325("div", { className: "empty-icon", children: icon }),
|
|
8623
|
+
!icon && /* @__PURE__ */ jsx325("div", { className: "empty-icon", children: /* @__PURE__ */ jsx325("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx325("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" }) }) }),
|
|
8624
|
+
/* @__PURE__ */ jsx325("p", { className: "empty-title", children: title }),
|
|
8625
|
+
description && /* @__PURE__ */ jsx325("p", { className: "empty-description", children: description }),
|
|
8626
|
+
action && /* @__PURE__ */ jsx325("div", { className: "empty-action", children: action })
|
|
7920
8627
|
] });
|
|
7921
8628
|
};
|
|
7922
8629
|
EmptyState.displayName = "EmptyState";
|
|
7923
8630
|
var EmptyState_default = EmptyState;
|
|
7924
8631
|
|
|
7925
8632
|
// src/components/FileUpload/FileUpload.tsx
|
|
7926
|
-
import
|
|
7927
|
-
import { jsx as
|
|
8633
|
+
import React22 from "react";
|
|
8634
|
+
import { jsx as jsx326, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
7928
8635
|
var FileUpload = (props) => {
|
|
7929
8636
|
const {
|
|
7930
8637
|
accept,
|
|
@@ -7934,8 +8641,8 @@ var FileUpload = (props) => {
|
|
|
7934
8641
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
7935
8642
|
description
|
|
7936
8643
|
} = props;
|
|
7937
|
-
const [isDragOver, setIsDragOver] =
|
|
7938
|
-
const inputRef =
|
|
8644
|
+
const [isDragOver, setIsDragOver] = React22.useState(false);
|
|
8645
|
+
const inputRef = React22.useRef(null);
|
|
7939
8646
|
const handleFiles = (fileList) => {
|
|
7940
8647
|
let files = Array.from(fileList);
|
|
7941
8648
|
if (maxSize) {
|
|
@@ -7965,7 +8672,7 @@ var FileUpload = (props) => {
|
|
|
7965
8672
|
handleFiles(e.target.files);
|
|
7966
8673
|
}
|
|
7967
8674
|
};
|
|
7968
|
-
return /* @__PURE__ */
|
|
8675
|
+
return /* @__PURE__ */ jsxs210(
|
|
7969
8676
|
"div",
|
|
7970
8677
|
{
|
|
7971
8678
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -7974,7 +8681,7 @@ var FileUpload = (props) => {
|
|
|
7974
8681
|
onDragLeave: handleDragLeave,
|
|
7975
8682
|
onClick: () => inputRef.current?.click(),
|
|
7976
8683
|
children: [
|
|
7977
|
-
/* @__PURE__ */
|
|
8684
|
+
/* @__PURE__ */ jsx326(
|
|
7978
8685
|
"input",
|
|
7979
8686
|
{
|
|
7980
8687
|
ref: inputRef,
|
|
@@ -7984,9 +8691,9 @@ var FileUpload = (props) => {
|
|
|
7984
8691
|
onChange: handleChange
|
|
7985
8692
|
}
|
|
7986
8693
|
),
|
|
7987
|
-
/* @__PURE__ */
|
|
7988
|
-
/* @__PURE__ */
|
|
7989
|
-
description && /* @__PURE__ */
|
|
8694
|
+
/* @__PURE__ */ jsx326("div", { className: "upload-icon", children: /* @__PURE__ */ jsx326(UploadIcon_default, {}) }),
|
|
8695
|
+
/* @__PURE__ */ jsx326("p", { className: "upload-label", children: label }),
|
|
8696
|
+
description && /* @__PURE__ */ jsx326("p", { className: "upload-description", children: description })
|
|
7990
8697
|
]
|
|
7991
8698
|
}
|
|
7992
8699
|
);
|
|
@@ -7995,10 +8702,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
7995
8702
|
var FileUpload_default = FileUpload;
|
|
7996
8703
|
|
|
7997
8704
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
7998
|
-
import
|
|
8705
|
+
import React24 from "react";
|
|
7999
8706
|
|
|
8000
8707
|
// src/components/HtmlTypeWriter/utils.ts
|
|
8001
|
-
import
|
|
8708
|
+
import React23 from "react";
|
|
8002
8709
|
var voidTags = /* @__PURE__ */ new Set([
|
|
8003
8710
|
"br",
|
|
8004
8711
|
"img",
|
|
@@ -8066,41 +8773,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
8066
8773
|
props[attr.name] = attr.value;
|
|
8067
8774
|
});
|
|
8068
8775
|
if (voidTags.has(tag)) {
|
|
8069
|
-
return
|
|
8776
|
+
return React23.createElement(tag, props);
|
|
8070
8777
|
}
|
|
8071
8778
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
8072
|
-
return
|
|
8779
|
+
return React23.createElement(tag, props, ...children);
|
|
8073
8780
|
};
|
|
8074
8781
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
8075
8782
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
8076
8783
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
8077
|
-
return node == null ? null :
|
|
8784
|
+
return node == null ? null : React23.createElement(React23.Fragment, { key: idx }, node);
|
|
8078
8785
|
}).filter(Boolean);
|
|
8079
8786
|
return nodes.length === 0 ? null : nodes;
|
|
8080
8787
|
};
|
|
8081
8788
|
|
|
8082
8789
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
8083
|
-
import { jsx as
|
|
8790
|
+
import { jsx as jsx327 } from "react/jsx-runtime";
|
|
8084
8791
|
var HtmlTypeWriter = ({
|
|
8085
8792
|
html,
|
|
8086
8793
|
duration = 20,
|
|
8087
8794
|
onDone,
|
|
8088
8795
|
onChange
|
|
8089
8796
|
}) => {
|
|
8090
|
-
const [typedLen, setTypedLen] =
|
|
8091
|
-
const doneCalledRef =
|
|
8092
|
-
const { doc, rangeMap, totalLength } =
|
|
8797
|
+
const [typedLen, setTypedLen] = React24.useState(0);
|
|
8798
|
+
const doneCalledRef = React24.useRef(false);
|
|
8799
|
+
const { doc, rangeMap, totalLength } = React24.useMemo(() => {
|
|
8093
8800
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
8094
8801
|
const decoded = decodeHtmlEntities(html);
|
|
8095
8802
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
8096
8803
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
8097
8804
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
8098
8805
|
}, [html]);
|
|
8099
|
-
|
|
8806
|
+
React24.useEffect(() => {
|
|
8100
8807
|
setTypedLen(0);
|
|
8101
8808
|
doneCalledRef.current = false;
|
|
8102
8809
|
}, [html]);
|
|
8103
|
-
|
|
8810
|
+
React24.useEffect(() => {
|
|
8104
8811
|
if (!totalLength) return;
|
|
8105
8812
|
if (typedLen >= totalLength) return;
|
|
8106
8813
|
const timer = window.setInterval(() => {
|
|
@@ -8108,33 +8815,33 @@ var HtmlTypeWriter = ({
|
|
|
8108
8815
|
}, duration);
|
|
8109
8816
|
return () => window.clearInterval(timer);
|
|
8110
8817
|
}, [typedLen, totalLength, duration]);
|
|
8111
|
-
|
|
8818
|
+
React24.useEffect(() => {
|
|
8112
8819
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
8113
8820
|
onChange?.();
|
|
8114
8821
|
}
|
|
8115
8822
|
}, [typedLen, totalLength, onChange]);
|
|
8116
|
-
|
|
8823
|
+
React24.useEffect(() => {
|
|
8117
8824
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
8118
8825
|
doneCalledRef.current = true;
|
|
8119
8826
|
onDone?.();
|
|
8120
8827
|
}
|
|
8121
8828
|
}, [typedLen, totalLength, onDone]);
|
|
8122
|
-
const parsed =
|
|
8829
|
+
const parsed = React24.useMemo(
|
|
8123
8830
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
8124
8831
|
[doc, typedLen, rangeMap]
|
|
8125
8832
|
);
|
|
8126
|
-
return /* @__PURE__ */
|
|
8833
|
+
return /* @__PURE__ */ jsx327("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
8127
8834
|
};
|
|
8128
8835
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
8129
8836
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
8130
8837
|
|
|
8131
8838
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
8132
|
-
import
|
|
8133
|
-
import { jsx as
|
|
8839
|
+
import React25 from "react";
|
|
8840
|
+
import { jsx as jsx328, jsxs as jsxs211 } from "react/jsx-runtime";
|
|
8134
8841
|
var ImageSelector = (props) => {
|
|
8135
8842
|
const { value, label, onChange } = props;
|
|
8136
|
-
const [previewUrl, setPreviewUrl] =
|
|
8137
|
-
|
|
8843
|
+
const [previewUrl, setPreviewUrl] = React25.useState();
|
|
8844
|
+
React25.useEffect(() => {
|
|
8138
8845
|
if (!value) {
|
|
8139
8846
|
setPreviewUrl(void 0);
|
|
8140
8847
|
return;
|
|
@@ -8143,7 +8850,7 @@ var ImageSelector = (props) => {
|
|
|
8143
8850
|
setPreviewUrl(url);
|
|
8144
8851
|
return () => URL.revokeObjectURL(url);
|
|
8145
8852
|
}, [value]);
|
|
8146
|
-
const inputRef =
|
|
8853
|
+
const inputRef = React25.useRef(null);
|
|
8147
8854
|
const handleFileChange = (e) => {
|
|
8148
8855
|
const selectedFile = e.target.files?.[0];
|
|
8149
8856
|
if (selectedFile) {
|
|
@@ -8156,8 +8863,8 @@ var ImageSelector = (props) => {
|
|
|
8156
8863
|
const handleOpenFileDialog = () => {
|
|
8157
8864
|
inputRef.current?.click();
|
|
8158
8865
|
};
|
|
8159
|
-
return /* @__PURE__ */
|
|
8160
|
-
/* @__PURE__ */
|
|
8866
|
+
return /* @__PURE__ */ jsxs211("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
8867
|
+
/* @__PURE__ */ jsx328(
|
|
8161
8868
|
"input",
|
|
8162
8869
|
{
|
|
8163
8870
|
type: "file",
|
|
@@ -8167,13 +8874,13 @@ var ImageSelector = (props) => {
|
|
|
8167
8874
|
ref: inputRef
|
|
8168
8875
|
}
|
|
8169
8876
|
),
|
|
8170
|
-
value && /* @__PURE__ */
|
|
8171
|
-
/* @__PURE__ */
|
|
8172
|
-
/* @__PURE__ */
|
|
8877
|
+
value && /* @__PURE__ */ jsxs211("div", { className: "action-bar", children: [
|
|
8878
|
+
/* @__PURE__ */ jsx328("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ jsx328(UploadIcon_default, {}) }),
|
|
8879
|
+
/* @__PURE__ */ jsx328("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ jsx328(DeleteIcon_default, {}) })
|
|
8173
8880
|
] }),
|
|
8174
|
-
/* @__PURE__ */
|
|
8175
|
-
/* @__PURE__ */
|
|
8176
|
-
/* @__PURE__ */
|
|
8881
|
+
/* @__PURE__ */ jsx328("div", { className: "content", children: previewUrl ? /* @__PURE__ */ jsx328("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ jsxs211("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
8882
|
+
/* @__PURE__ */ jsx328("div", { className: "icon-wrapper", children: /* @__PURE__ */ jsx328(ImageIcon_default, {}) }),
|
|
8883
|
+
/* @__PURE__ */ jsx328("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
8177
8884
|
] }) })
|
|
8178
8885
|
] });
|
|
8179
8886
|
};
|
|
@@ -8181,7 +8888,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
8181
8888
|
var ImageSelector_default = ImageSelector;
|
|
8182
8889
|
|
|
8183
8890
|
// src/components/Pagination/Pagination.tsx
|
|
8184
|
-
import { jsx as
|
|
8891
|
+
import { jsx as jsx329, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
8185
8892
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
8186
8893
|
const totalNumbers = siblingCount * 2 + 5;
|
|
8187
8894
|
if (totalPages <= totalNumbers) {
|
|
@@ -8224,19 +8931,19 @@ var Pagination = (props) => {
|
|
|
8224
8931
|
onChange?.(page);
|
|
8225
8932
|
}
|
|
8226
8933
|
};
|
|
8227
|
-
return /* @__PURE__ */
|
|
8228
|
-
/* @__PURE__ */
|
|
8934
|
+
return /* @__PURE__ */ jsxs212("nav", { className: clsx_default("lib-xplat-pagination", size, type), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
8935
|
+
/* @__PURE__ */ jsx329(
|
|
8229
8936
|
"button",
|
|
8230
8937
|
{
|
|
8231
8938
|
className: "page-btn prev",
|
|
8232
8939
|
disabled: current <= 1,
|
|
8233
8940
|
onClick: () => handleClick(current - 1),
|
|
8234
8941
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
8235
|
-
children: /* @__PURE__ */
|
|
8942
|
+
children: /* @__PURE__ */ jsx329(ChevronLeftIcon_default, {})
|
|
8236
8943
|
}
|
|
8237
8944
|
),
|
|
8238
8945
|
pages.map(
|
|
8239
|
-
(page, i) => page === "..." ? /* @__PURE__ */
|
|
8946
|
+
(page, i) => page === "..." ? /* @__PURE__ */ jsx329("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ jsx329(
|
|
8240
8947
|
"button",
|
|
8241
8948
|
{
|
|
8242
8949
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -8247,14 +8954,14 @@ var Pagination = (props) => {
|
|
|
8247
8954
|
page
|
|
8248
8955
|
)
|
|
8249
8956
|
),
|
|
8250
|
-
/* @__PURE__ */
|
|
8957
|
+
/* @__PURE__ */ jsx329(
|
|
8251
8958
|
"button",
|
|
8252
8959
|
{
|
|
8253
8960
|
className: "page-btn next",
|
|
8254
8961
|
disabled: current >= totalPages,
|
|
8255
8962
|
onClick: () => handleClick(current + 1),
|
|
8256
8963
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
8257
|
-
children: /* @__PURE__ */
|
|
8964
|
+
children: /* @__PURE__ */ jsx329(ChevronRightIcon_default, {})
|
|
8258
8965
|
}
|
|
8259
8966
|
)
|
|
8260
8967
|
] });
|
|
@@ -8263,17 +8970,17 @@ Pagination.displayName = "Pagination";
|
|
|
8263
8970
|
var Pagination_default = Pagination;
|
|
8264
8971
|
|
|
8265
8972
|
// src/components/PopOver/PopOver.tsx
|
|
8266
|
-
import
|
|
8267
|
-
import { jsx as
|
|
8973
|
+
import React26 from "react";
|
|
8974
|
+
import { jsx as jsx330, jsxs as jsxs213 } from "react/jsx-runtime";
|
|
8268
8975
|
var PopOver = (props) => {
|
|
8269
8976
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
8270
|
-
const popRef =
|
|
8271
|
-
const triggerRef =
|
|
8272
|
-
const [localOpen, setLocalOpen] =
|
|
8273
|
-
const [eventTrigger, setEventTrigger] =
|
|
8977
|
+
const popRef = React26.useRef(null);
|
|
8978
|
+
const triggerRef = React26.useRef(null);
|
|
8979
|
+
const [localOpen, setLocalOpen] = React26.useState(false);
|
|
8980
|
+
const [eventTrigger, setEventTrigger] = React26.useState(false);
|
|
8274
8981
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
8275
8982
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
8276
|
-
|
|
8983
|
+
React26.useEffect(() => {
|
|
8277
8984
|
if (isOpen) {
|
|
8278
8985
|
setLocalOpen(isOpen);
|
|
8279
8986
|
setTimeout(() => {
|
|
@@ -8286,7 +8993,7 @@ var PopOver = (props) => {
|
|
|
8286
8993
|
}, 200);
|
|
8287
8994
|
}
|
|
8288
8995
|
}, [isOpen]);
|
|
8289
|
-
return /* @__PURE__ */
|
|
8996
|
+
return /* @__PURE__ */ jsxs213(
|
|
8290
8997
|
"div",
|
|
8291
8998
|
{
|
|
8292
8999
|
className: "lib-xplat-pop-over",
|
|
@@ -8296,7 +9003,7 @@ var PopOver = (props) => {
|
|
|
8296
9003
|
},
|
|
8297
9004
|
children: [
|
|
8298
9005
|
children,
|
|
8299
|
-
localOpen && /* @__PURE__ */
|
|
9006
|
+
localOpen && /* @__PURE__ */ jsx330(Portal_default, { children: /* @__PURE__ */ jsx330(
|
|
8300
9007
|
"div",
|
|
8301
9008
|
{
|
|
8302
9009
|
className: clsx_default(
|
|
@@ -8319,7 +9026,7 @@ PopOver.displayName = "PopOver";
|
|
|
8319
9026
|
var PopOver_default = PopOver;
|
|
8320
9027
|
|
|
8321
9028
|
// src/components/Progress/Progress.tsx
|
|
8322
|
-
import { jsx as
|
|
9029
|
+
import { jsx as jsx331, jsxs as jsxs214 } from "react/jsx-runtime";
|
|
8323
9030
|
var Progress = (props) => {
|
|
8324
9031
|
const {
|
|
8325
9032
|
value,
|
|
@@ -8329,8 +9036,8 @@ var Progress = (props) => {
|
|
|
8329
9036
|
showLabel = false
|
|
8330
9037
|
} = props;
|
|
8331
9038
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
8332
|
-
return /* @__PURE__ */
|
|
8333
|
-
/* @__PURE__ */
|
|
9039
|
+
return /* @__PURE__ */ jsxs214("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
9040
|
+
/* @__PURE__ */ jsx331(
|
|
8334
9041
|
"div",
|
|
8335
9042
|
{
|
|
8336
9043
|
className: "track",
|
|
@@ -8338,7 +9045,7 @@ var Progress = (props) => {
|
|
|
8338
9045
|
"aria-valuenow": value,
|
|
8339
9046
|
"aria-valuemin": 0,
|
|
8340
9047
|
"aria-valuemax": max,
|
|
8341
|
-
children: /* @__PURE__ */
|
|
9048
|
+
children: /* @__PURE__ */ jsx331(
|
|
8342
9049
|
"div",
|
|
8343
9050
|
{
|
|
8344
9051
|
className: "bar",
|
|
@@ -8347,7 +9054,7 @@ var Progress = (props) => {
|
|
|
8347
9054
|
)
|
|
8348
9055
|
}
|
|
8349
9056
|
),
|
|
8350
|
-
showLabel && /* @__PURE__ */
|
|
9057
|
+
showLabel && /* @__PURE__ */ jsxs214("span", { className: "label", children: [
|
|
8351
9058
|
Math.round(percentage),
|
|
8352
9059
|
"%"
|
|
8353
9060
|
] })
|
|
@@ -8357,17 +9064,17 @@ Progress.displayName = "Progress";
|
|
|
8357
9064
|
var Progress_default = Progress;
|
|
8358
9065
|
|
|
8359
9066
|
// src/components/Radio/RadioGroupContext.tsx
|
|
8360
|
-
import
|
|
8361
|
-
var RadioGroupContext =
|
|
9067
|
+
import React27 from "react";
|
|
9068
|
+
var RadioGroupContext = React27.createContext(
|
|
8362
9069
|
null
|
|
8363
9070
|
);
|
|
8364
9071
|
var useRadioGroupContext = () => {
|
|
8365
|
-
return
|
|
9072
|
+
return React27.useContext(RadioGroupContext);
|
|
8366
9073
|
};
|
|
8367
9074
|
var RadioGroupContext_default = RadioGroupContext;
|
|
8368
9075
|
|
|
8369
9076
|
// src/components/Radio/Radio.tsx
|
|
8370
|
-
import { jsx as
|
|
9077
|
+
import { jsx as jsx332, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
8371
9078
|
var Radio = (props) => {
|
|
8372
9079
|
const {
|
|
8373
9080
|
label,
|
|
@@ -8385,7 +9092,7 @@ var Radio = (props) => {
|
|
|
8385
9092
|
value,
|
|
8386
9093
|
onChange: rest.onChange
|
|
8387
9094
|
};
|
|
8388
|
-
return /* @__PURE__ */
|
|
9095
|
+
return /* @__PURE__ */ jsxs215(
|
|
8389
9096
|
"label",
|
|
8390
9097
|
{
|
|
8391
9098
|
className: clsx_default(
|
|
@@ -8395,18 +9102,18 @@ var Radio = (props) => {
|
|
|
8395
9102
|
localChecked ? "checked" : void 0
|
|
8396
9103
|
),
|
|
8397
9104
|
children: [
|
|
8398
|
-
/* @__PURE__ */
|
|
8399
|
-
/* @__PURE__ */
|
|
9105
|
+
/* @__PURE__ */ jsx332("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
9106
|
+
/* @__PURE__ */ jsx332(
|
|
8400
9107
|
"div",
|
|
8401
9108
|
{
|
|
8402
9109
|
className: clsx_default(
|
|
8403
9110
|
"circle",
|
|
8404
9111
|
localChecked ? "checked" : void 0
|
|
8405
9112
|
),
|
|
8406
|
-
children: localChecked && /* @__PURE__ */
|
|
9113
|
+
children: localChecked && /* @__PURE__ */ jsx332("div", { className: "inner-circle" })
|
|
8407
9114
|
}
|
|
8408
9115
|
),
|
|
8409
|
-
label && /* @__PURE__ */
|
|
9116
|
+
label && /* @__PURE__ */ jsx332("span", { children: label })
|
|
8410
9117
|
]
|
|
8411
9118
|
}
|
|
8412
9119
|
);
|
|
@@ -8415,28 +9122,28 @@ Radio.displayName = "Radio";
|
|
|
8415
9122
|
var Radio_default = Radio;
|
|
8416
9123
|
|
|
8417
9124
|
// src/components/Radio/RadioGroup.tsx
|
|
8418
|
-
import { Fragment as Fragment4, jsx as
|
|
9125
|
+
import { Fragment as Fragment4, jsx as jsx333 } from "react/jsx-runtime";
|
|
8419
9126
|
var RadioGroup = (props) => {
|
|
8420
9127
|
const { children, ...rest } = props;
|
|
8421
|
-
return /* @__PURE__ */
|
|
9128
|
+
return /* @__PURE__ */ jsx333(Fragment4, { children: /* @__PURE__ */ jsx333(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
8422
9129
|
};
|
|
8423
9130
|
RadioGroup.displayName = "RadioGroup";
|
|
8424
9131
|
var RadioGroup_default = RadioGroup;
|
|
8425
9132
|
|
|
8426
9133
|
// src/components/Select/Select.tsx
|
|
8427
|
-
import
|
|
9134
|
+
import React30 from "react";
|
|
8428
9135
|
|
|
8429
9136
|
// src/components/Select/context.ts
|
|
8430
|
-
import
|
|
8431
|
-
var SelectContext =
|
|
9137
|
+
import React28 from "react";
|
|
9138
|
+
var SelectContext = React28.createContext(null);
|
|
8432
9139
|
var context_default = SelectContext;
|
|
8433
9140
|
|
|
8434
9141
|
// src/components/Select/SelectItem.tsx
|
|
8435
|
-
import
|
|
8436
|
-
import { jsx as
|
|
9142
|
+
import React29 from "react";
|
|
9143
|
+
import { jsx as jsx334 } from "react/jsx-runtime";
|
|
8437
9144
|
var SelectItem = (props) => {
|
|
8438
9145
|
const { children, value, onClick, disabled = false } = props;
|
|
8439
|
-
const ctx =
|
|
9146
|
+
const ctx = React29.useContext(context_default);
|
|
8440
9147
|
const handleClick = (e) => {
|
|
8441
9148
|
e.preventDefault();
|
|
8442
9149
|
e.stopPropagation();
|
|
@@ -8445,7 +9152,7 @@ var SelectItem = (props) => {
|
|
|
8445
9152
|
ctx?.close();
|
|
8446
9153
|
onClick?.();
|
|
8447
9154
|
};
|
|
8448
|
-
return /* @__PURE__ */
|
|
9155
|
+
return /* @__PURE__ */ jsx334(
|
|
8449
9156
|
"div",
|
|
8450
9157
|
{
|
|
8451
9158
|
className: clsx_default("select-item", disabled && "disabled"),
|
|
@@ -8466,7 +9173,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
8466
9173
|
var SelectItem_default = SelectItem;
|
|
8467
9174
|
|
|
8468
9175
|
// src/components/Select/Select.tsx
|
|
8469
|
-
import { jsx as
|
|
9176
|
+
import { jsx as jsx335, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
8470
9177
|
var ANIMATION_DURATION_MS3 = 200;
|
|
8471
9178
|
var SelectRoot = (props) => {
|
|
8472
9179
|
const {
|
|
@@ -8478,26 +9185,26 @@ var SelectRoot = (props) => {
|
|
|
8478
9185
|
error = false,
|
|
8479
9186
|
size = "md"
|
|
8480
9187
|
} = props;
|
|
8481
|
-
const itemChildren =
|
|
8482
|
-
(child) =>
|
|
9188
|
+
const itemChildren = React30.Children.toArray(children).filter(
|
|
9189
|
+
(child) => React30.isValidElement(child) && child.type === SelectItem_default
|
|
8483
9190
|
);
|
|
8484
9191
|
const isControlled = valueProp !== void 0;
|
|
8485
|
-
const [isOpen, setOpen] =
|
|
8486
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
8487
|
-
const controlledLabel =
|
|
9192
|
+
const [isOpen, setOpen] = React30.useState(false);
|
|
9193
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React30.useState(null);
|
|
9194
|
+
const controlledLabel = React30.useMemo(() => {
|
|
8488
9195
|
if (!isControlled) return null;
|
|
8489
9196
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
8490
9197
|
return match ? match.props.children : null;
|
|
8491
9198
|
}, [isControlled, valueProp, itemChildren]);
|
|
8492
9199
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
8493
|
-
const triggerRef =
|
|
8494
|
-
const contentRef =
|
|
8495
|
-
const [mounted, setMounted] =
|
|
8496
|
-
const [visible, setVisible] =
|
|
8497
|
-
|
|
9200
|
+
const triggerRef = React30.useRef(null);
|
|
9201
|
+
const contentRef = React30.useRef(null);
|
|
9202
|
+
const [mounted, setMounted] = React30.useState(false);
|
|
9203
|
+
const [visible, setVisible] = React30.useState(false);
|
|
9204
|
+
React30.useEffect(() => {
|
|
8498
9205
|
if (disabled && isOpen) setOpen(false);
|
|
8499
9206
|
}, [disabled, isOpen]);
|
|
8500
|
-
|
|
9207
|
+
React30.useEffect(() => {
|
|
8501
9208
|
if (isOpen) {
|
|
8502
9209
|
setMounted(true);
|
|
8503
9210
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8507,12 +9214,12 @@ var SelectRoot = (props) => {
|
|
|
8507
9214
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
8508
9215
|
return () => clearTimeout(t);
|
|
8509
9216
|
}, [isOpen]);
|
|
8510
|
-
const open =
|
|
8511
|
-
const close =
|
|
8512
|
-
const toggle =
|
|
9217
|
+
const open = React30.useCallback(() => setOpen(true), []);
|
|
9218
|
+
const close = React30.useCallback(() => setOpen(false), []);
|
|
9219
|
+
const toggle = React30.useCallback(() => setOpen((prev) => !prev), []);
|
|
8513
9220
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
8514
9221
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
8515
|
-
const setSelected =
|
|
9222
|
+
const setSelected = React30.useCallback(
|
|
8516
9223
|
(label, itemValue) => {
|
|
8517
9224
|
if (!isControlled) {
|
|
8518
9225
|
setUncontrolledLabel(label);
|
|
@@ -8521,7 +9228,7 @@ var SelectRoot = (props) => {
|
|
|
8521
9228
|
},
|
|
8522
9229
|
[isControlled, onChange]
|
|
8523
9230
|
);
|
|
8524
|
-
const ctxValue =
|
|
9231
|
+
const ctxValue = React30.useMemo(
|
|
8525
9232
|
() => ({
|
|
8526
9233
|
isOpen,
|
|
8527
9234
|
mounted,
|
|
@@ -8542,7 +9249,7 @@ var SelectRoot = (props) => {
|
|
|
8542
9249
|
if (disabled) return;
|
|
8543
9250
|
toggle();
|
|
8544
9251
|
};
|
|
8545
|
-
return /* @__PURE__ */
|
|
9252
|
+
return /* @__PURE__ */ jsx335(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs216(
|
|
8546
9253
|
"div",
|
|
8547
9254
|
{
|
|
8548
9255
|
className: clsx_default(
|
|
@@ -8553,7 +9260,7 @@ var SelectRoot = (props) => {
|
|
|
8553
9260
|
mounted && "is-open"
|
|
8554
9261
|
),
|
|
8555
9262
|
children: [
|
|
8556
|
-
/* @__PURE__ */
|
|
9263
|
+
/* @__PURE__ */ jsxs216(
|
|
8557
9264
|
"div",
|
|
8558
9265
|
{
|
|
8559
9266
|
ref: triggerRef,
|
|
@@ -8577,7 +9284,7 @@ var SelectRoot = (props) => {
|
|
|
8577
9284
|
}
|
|
8578
9285
|
},
|
|
8579
9286
|
children: [
|
|
8580
|
-
/* @__PURE__ */
|
|
9287
|
+
/* @__PURE__ */ jsx335(
|
|
8581
9288
|
"span",
|
|
8582
9289
|
{
|
|
8583
9290
|
className: clsx_default(
|
|
@@ -8587,25 +9294,25 @@ var SelectRoot = (props) => {
|
|
|
8587
9294
|
children: selectedLabel ?? placeholder
|
|
8588
9295
|
}
|
|
8589
9296
|
),
|
|
8590
|
-
/* @__PURE__ */
|
|
9297
|
+
/* @__PURE__ */ jsx335(
|
|
8591
9298
|
"span",
|
|
8592
9299
|
{
|
|
8593
9300
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
8594
9301
|
"aria-hidden": true,
|
|
8595
|
-
children: /* @__PURE__ */
|
|
9302
|
+
children: /* @__PURE__ */ jsx335(ChevronDownIcon_default, {})
|
|
8596
9303
|
}
|
|
8597
9304
|
)
|
|
8598
9305
|
]
|
|
8599
9306
|
}
|
|
8600
9307
|
),
|
|
8601
|
-
mounted && /* @__PURE__ */
|
|
9308
|
+
mounted && /* @__PURE__ */ jsx335(Portal_default, { children: /* @__PURE__ */ jsx335(
|
|
8602
9309
|
"div",
|
|
8603
9310
|
{
|
|
8604
9311
|
className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
|
|
8605
9312
|
ref: contentRef,
|
|
8606
9313
|
style: { ...position.position, width: triggerRef.current?.offsetWidth },
|
|
8607
9314
|
role: "listbox",
|
|
8608
|
-
children: /* @__PURE__ */
|
|
9315
|
+
children: /* @__PURE__ */ jsx335(context_default.Provider, { value: ctxValue, children: itemChildren })
|
|
8609
9316
|
}
|
|
8610
9317
|
) })
|
|
8611
9318
|
]
|
|
@@ -8619,7 +9326,7 @@ var Select = Object.assign(SelectRoot, {
|
|
|
8619
9326
|
var Select_default = Select;
|
|
8620
9327
|
|
|
8621
9328
|
// src/components/Skeleton/Skeleton.tsx
|
|
8622
|
-
import { jsx as
|
|
9329
|
+
import { jsx as jsx336 } from "react/jsx-runtime";
|
|
8623
9330
|
var SIZE_MAP = {
|
|
8624
9331
|
xs: "var(--spacing-size-1)",
|
|
8625
9332
|
sm: "var(--spacing-size-2)",
|
|
@@ -8635,7 +9342,7 @@ var Skeleton = (props) => {
|
|
|
8635
9342
|
...width != null && { width: SIZE_MAP[width] },
|
|
8636
9343
|
...height != null && { height: SIZE_MAP[height] }
|
|
8637
9344
|
};
|
|
8638
|
-
return /* @__PURE__ */
|
|
9345
|
+
return /* @__PURE__ */ jsx336(
|
|
8639
9346
|
"div",
|
|
8640
9347
|
{
|
|
8641
9348
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -8648,20 +9355,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
8648
9355
|
var Skeleton_default = Skeleton;
|
|
8649
9356
|
|
|
8650
9357
|
// src/components/Spinner/Spinner.tsx
|
|
8651
|
-
import { jsx as
|
|
9358
|
+
import { jsx as jsx337, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
8652
9359
|
var Spinner = (props) => {
|
|
8653
9360
|
const {
|
|
8654
9361
|
size = "md",
|
|
8655
9362
|
type = "brand"
|
|
8656
9363
|
} = props;
|
|
8657
|
-
return /* @__PURE__ */
|
|
9364
|
+
return /* @__PURE__ */ jsx337(
|
|
8658
9365
|
"div",
|
|
8659
9366
|
{
|
|
8660
9367
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
8661
9368
|
role: "status",
|
|
8662
9369
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
8663
|
-
children: /* @__PURE__ */
|
|
8664
|
-
/* @__PURE__ */
|
|
9370
|
+
children: /* @__PURE__ */ jsxs217("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
9371
|
+
/* @__PURE__ */ jsx337(
|
|
8665
9372
|
"circle",
|
|
8666
9373
|
{
|
|
8667
9374
|
className: "track",
|
|
@@ -8671,7 +9378,7 @@ var Spinner = (props) => {
|
|
|
8671
9378
|
strokeWidth: "3"
|
|
8672
9379
|
}
|
|
8673
9380
|
),
|
|
8674
|
-
/* @__PURE__ */
|
|
9381
|
+
/* @__PURE__ */ jsx337(
|
|
8675
9382
|
"circle",
|
|
8676
9383
|
{
|
|
8677
9384
|
className: "indicator",
|
|
@@ -8690,20 +9397,20 @@ Spinner.displayName = "Spinner";
|
|
|
8690
9397
|
var Spinner_default = Spinner;
|
|
8691
9398
|
|
|
8692
9399
|
// src/components/Steps/Steps.tsx
|
|
8693
|
-
import { jsx as
|
|
9400
|
+
import { jsx as jsx338, jsxs as jsxs218 } from "react/jsx-runtime";
|
|
8694
9401
|
var Steps = (props) => {
|
|
8695
9402
|
const {
|
|
8696
9403
|
items,
|
|
8697
9404
|
current,
|
|
8698
9405
|
type = "brand"
|
|
8699
9406
|
} = props;
|
|
8700
|
-
return /* @__PURE__ */
|
|
9407
|
+
return /* @__PURE__ */ jsx338("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
8701
9408
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
8702
|
-
return /* @__PURE__ */
|
|
8703
|
-
/* @__PURE__ */
|
|
8704
|
-
/* @__PURE__ */
|
|
8705
|
-
/* @__PURE__ */
|
|
8706
|
-
item.description && /* @__PURE__ */
|
|
9409
|
+
return /* @__PURE__ */ jsxs218("div", { className: clsx_default("step-item", status), children: [
|
|
9410
|
+
/* @__PURE__ */ jsx338("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx338(CheckIcon_default, {}) : /* @__PURE__ */ jsx338("span", { children: index + 1 }) }),
|
|
9411
|
+
/* @__PURE__ */ jsxs218("div", { className: "step-content", children: [
|
|
9412
|
+
/* @__PURE__ */ jsx338("span", { className: "step-title", children: item.title }),
|
|
9413
|
+
item.description && /* @__PURE__ */ jsx338("span", { className: "step-description", children: item.description })
|
|
8707
9414
|
] })
|
|
8708
9415
|
] }, index);
|
|
8709
9416
|
}) });
|
|
@@ -8712,8 +9419,8 @@ Steps.displayName = "Steps";
|
|
|
8712
9419
|
var Steps_default = Steps;
|
|
8713
9420
|
|
|
8714
9421
|
// src/components/Swiper/Swiper.tsx
|
|
8715
|
-
import
|
|
8716
|
-
import { jsx as
|
|
9422
|
+
import React31 from "react";
|
|
9423
|
+
import { jsx as jsx339, jsxs as jsxs219 } from "react/jsx-runtime";
|
|
8717
9424
|
var Swiper = (props) => {
|
|
8718
9425
|
const {
|
|
8719
9426
|
auto = false,
|
|
@@ -8737,25 +9444,25 @@ var Swiper = (props) => {
|
|
|
8737
9444
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
8738
9445
|
const useLoop = loop && canSlide;
|
|
8739
9446
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
8740
|
-
const extendedItems =
|
|
9447
|
+
const extendedItems = React31.useMemo(() => {
|
|
8741
9448
|
if (!useLoop) return items;
|
|
8742
9449
|
return [...items, ...items, ...items];
|
|
8743
9450
|
}, [items, useLoop]);
|
|
8744
9451
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
8745
|
-
const [innerIndex, setInnerIndex] =
|
|
9452
|
+
const [innerIndex, setInnerIndex] = React31.useState(
|
|
8746
9453
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
8747
9454
|
);
|
|
8748
|
-
const [isDragging, setIsDragging] =
|
|
8749
|
-
const [dragOffset, setDragOffset] =
|
|
8750
|
-
const [animated, setAnimated] =
|
|
8751
|
-
const [containerWidth, setContainerWidth] =
|
|
8752
|
-
const containerRef =
|
|
8753
|
-
const startXRef =
|
|
8754
|
-
const startTimeRef =
|
|
8755
|
-
const autoplayTimerRef =
|
|
8756
|
-
const resumeTimeoutRef =
|
|
8757
|
-
const [paused, setPaused] =
|
|
8758
|
-
|
|
9455
|
+
const [isDragging, setIsDragging] = React31.useState(false);
|
|
9456
|
+
const [dragOffset, setDragOffset] = React31.useState(0);
|
|
9457
|
+
const [animated, setAnimated] = React31.useState(true);
|
|
9458
|
+
const [containerWidth, setContainerWidth] = React31.useState(0);
|
|
9459
|
+
const containerRef = React31.useRef(null);
|
|
9460
|
+
const startXRef = React31.useRef(0);
|
|
9461
|
+
const startTimeRef = React31.useRef(0);
|
|
9462
|
+
const autoplayTimerRef = React31.useRef(null);
|
|
9463
|
+
const resumeTimeoutRef = React31.useRef(null);
|
|
9464
|
+
const [paused, setPaused] = React31.useState(false);
|
|
9465
|
+
React31.useEffect(() => {
|
|
8759
9466
|
const el = containerRef.current;
|
|
8760
9467
|
if (!el) return;
|
|
8761
9468
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -8774,7 +9481,7 @@ var Swiper = (props) => {
|
|
|
8774
9481
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
8775
9482
|
};
|
|
8776
9483
|
const realIndex = getRealIndex(innerIndex);
|
|
8777
|
-
const moveToInner =
|
|
9484
|
+
const moveToInner = React31.useCallback(
|
|
8778
9485
|
(idx, withAnim = true) => {
|
|
8779
9486
|
if (!useLoop) {
|
|
8780
9487
|
setAnimated(withAnim);
|
|
@@ -8802,7 +9509,7 @@ var Swiper = (props) => {
|
|
|
8802
9509
|
},
|
|
8803
9510
|
[useLoop, cloneCount, totalSlides]
|
|
8804
9511
|
);
|
|
8805
|
-
const handleTransitionEnd =
|
|
9512
|
+
const handleTransitionEnd = React31.useCallback(() => {
|
|
8806
9513
|
if (!useLoop) return;
|
|
8807
9514
|
const real = getRealIndex(innerIndex);
|
|
8808
9515
|
const canonical = cloneCount + real;
|
|
@@ -8812,7 +9519,7 @@ var Swiper = (props) => {
|
|
|
8812
9519
|
}
|
|
8813
9520
|
onChange?.(Math.min(real, maxIndex));
|
|
8814
9521
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
8815
|
-
const slideTo =
|
|
9522
|
+
const slideTo = React31.useCallback(
|
|
8816
9523
|
(logicalIndex) => {
|
|
8817
9524
|
if (!canSlide) return;
|
|
8818
9525
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -8822,7 +9529,7 @@ var Swiper = (props) => {
|
|
|
8822
9529
|
},
|
|
8823
9530
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
8824
9531
|
);
|
|
8825
|
-
const slideNext =
|
|
9532
|
+
const slideNext = React31.useCallback(() => {
|
|
8826
9533
|
if (!canSlide) return;
|
|
8827
9534
|
const nextInner = innerIndex + slideBy;
|
|
8828
9535
|
if (useLoop) {
|
|
@@ -8831,7 +9538,7 @@ var Swiper = (props) => {
|
|
|
8831
9538
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
8832
9539
|
}
|
|
8833
9540
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
8834
|
-
const slidePrev =
|
|
9541
|
+
const slidePrev = React31.useCallback(() => {
|
|
8835
9542
|
if (!canSlide) return;
|
|
8836
9543
|
const prevInner = innerIndex - slideBy;
|
|
8837
9544
|
if (useLoop) {
|
|
@@ -8840,7 +9547,7 @@ var Swiper = (props) => {
|
|
|
8840
9547
|
moveToInner(Math.max(prevInner, 0), true);
|
|
8841
9548
|
}
|
|
8842
9549
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
8843
|
-
|
|
9550
|
+
React31.useEffect(() => {
|
|
8844
9551
|
if (indexProp === void 0) return;
|
|
8845
9552
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
8846
9553
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -8848,12 +9555,12 @@ var Swiper = (props) => {
|
|
|
8848
9555
|
moveToInner(target, true);
|
|
8849
9556
|
}
|
|
8850
9557
|
}, [indexProp]);
|
|
8851
|
-
|
|
9558
|
+
React31.useImperativeHandle(swiperRef, () => ({
|
|
8852
9559
|
slidePrev,
|
|
8853
9560
|
slideNext,
|
|
8854
9561
|
slideTo
|
|
8855
9562
|
}));
|
|
8856
|
-
|
|
9563
|
+
React31.useEffect(() => {
|
|
8857
9564
|
if (!auto || !canSlide || paused) return;
|
|
8858
9565
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
8859
9566
|
return () => {
|
|
@@ -8879,7 +9586,7 @@ var Swiper = (props) => {
|
|
|
8879
9586
|
resumeTimeoutRef.current = null;
|
|
8880
9587
|
}, pauseOnInteraction);
|
|
8881
9588
|
};
|
|
8882
|
-
|
|
9589
|
+
React31.useEffect(() => {
|
|
8883
9590
|
return () => {
|
|
8884
9591
|
if (resumeTimeoutRef.current) clearTimeout(resumeTimeoutRef.current);
|
|
8885
9592
|
};
|
|
@@ -8897,7 +9604,7 @@ var Swiper = (props) => {
|
|
|
8897
9604
|
startXRef.current = getClientX(e);
|
|
8898
9605
|
startTimeRef.current = Date.now();
|
|
8899
9606
|
};
|
|
8900
|
-
|
|
9607
|
+
React31.useEffect(() => {
|
|
8901
9608
|
if (!isDragging) return;
|
|
8902
9609
|
const handleMove = (e) => {
|
|
8903
9610
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -8936,8 +9643,8 @@ var Swiper = (props) => {
|
|
|
8936
9643
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
8937
9644
|
const slideWidthPercent = 100 / viewItemCount;
|
|
8938
9645
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
8939
|
-
const slideElements =
|
|
8940
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */
|
|
9646
|
+
const slideElements = React31.useMemo(
|
|
9647
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ jsx339(
|
|
8941
9648
|
"div",
|
|
8942
9649
|
{
|
|
8943
9650
|
className: "lib-xplat-swiper__slide",
|
|
@@ -8956,14 +9663,14 @@ var Swiper = (props) => {
|
|
|
8956
9663
|
Math.floor(realIndex / slideBy),
|
|
8957
9664
|
totalSteps - 1
|
|
8958
9665
|
);
|
|
8959
|
-
return /* @__PURE__ */
|
|
8960
|
-
/* @__PURE__ */
|
|
9666
|
+
return /* @__PURE__ */ jsxs219("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
9667
|
+
/* @__PURE__ */ jsx339(
|
|
8961
9668
|
"div",
|
|
8962
9669
|
{
|
|
8963
9670
|
className: "lib-xplat-swiper__viewport",
|
|
8964
9671
|
onMouseDown: handleDragStart,
|
|
8965
9672
|
onTouchStart: handleDragStart,
|
|
8966
|
-
children: /* @__PURE__ */
|
|
9673
|
+
children: /* @__PURE__ */ jsx339(
|
|
8967
9674
|
"div",
|
|
8968
9675
|
{
|
|
8969
9676
|
className: clsx_default(
|
|
@@ -8981,7 +9688,7 @@ var Swiper = (props) => {
|
|
|
8981
9688
|
)
|
|
8982
9689
|
}
|
|
8983
9690
|
),
|
|
8984
|
-
showProgress && canSlide && /* @__PURE__ */
|
|
9691
|
+
showProgress && canSlide && /* @__PURE__ */ jsx339("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ jsx339("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ jsx339(
|
|
8985
9692
|
"span",
|
|
8986
9693
|
{
|
|
8987
9694
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -8991,7 +9698,7 @@ var Swiper = (props) => {
|
|
|
8991
9698
|
}
|
|
8992
9699
|
}
|
|
8993
9700
|
) }) }),
|
|
8994
|
-
canSlide && /* @__PURE__ */
|
|
9701
|
+
canSlide && /* @__PURE__ */ jsx339("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ jsx339(
|
|
8995
9702
|
"button",
|
|
8996
9703
|
{
|
|
8997
9704
|
className: clsx_default(
|
|
@@ -9009,8 +9716,8 @@ Swiper.displayName = "Swiper";
|
|
|
9009
9716
|
var Swiper_default = Swiper;
|
|
9010
9717
|
|
|
9011
9718
|
// src/components/Switch/Switch.tsx
|
|
9012
|
-
import
|
|
9013
|
-
import { jsx as
|
|
9719
|
+
import React32 from "react";
|
|
9720
|
+
import { jsx as jsx340 } from "react/jsx-runtime";
|
|
9014
9721
|
var KNOB_TRANSITION_MS = 250;
|
|
9015
9722
|
var Switch = (props) => {
|
|
9016
9723
|
const {
|
|
@@ -9020,9 +9727,9 @@ var Switch = (props) => {
|
|
|
9020
9727
|
disabled,
|
|
9021
9728
|
onChange
|
|
9022
9729
|
} = props;
|
|
9023
|
-
const [isAnimating, setIsAnimating] =
|
|
9024
|
-
const timeoutRef =
|
|
9025
|
-
|
|
9730
|
+
const [isAnimating, setIsAnimating] = React32.useState(false);
|
|
9731
|
+
const timeoutRef = React32.useRef(null);
|
|
9732
|
+
React32.useEffect(() => {
|
|
9026
9733
|
return () => {
|
|
9027
9734
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
9028
9735
|
};
|
|
@@ -9037,7 +9744,7 @@ var Switch = (props) => {
|
|
|
9037
9744
|
timeoutRef.current = null;
|
|
9038
9745
|
}, KNOB_TRANSITION_MS);
|
|
9039
9746
|
};
|
|
9040
|
-
return /* @__PURE__ */
|
|
9747
|
+
return /* @__PURE__ */ jsx340(
|
|
9041
9748
|
"div",
|
|
9042
9749
|
{
|
|
9043
9750
|
className: clsx_default(
|
|
@@ -9050,7 +9757,7 @@ var Switch = (props) => {
|
|
|
9050
9757
|
),
|
|
9051
9758
|
onClick: handleClick,
|
|
9052
9759
|
"aria-disabled": disabled || isAnimating,
|
|
9053
|
-
children: /* @__PURE__ */
|
|
9760
|
+
children: /* @__PURE__ */ jsx340("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
9054
9761
|
}
|
|
9055
9762
|
);
|
|
9056
9763
|
};
|
|
@@ -9058,17 +9765,17 @@ Switch.displayName = "Switch";
|
|
|
9058
9765
|
var Switch_default = Switch;
|
|
9059
9766
|
|
|
9060
9767
|
// src/components/Table/TableContext.tsx
|
|
9061
|
-
import
|
|
9062
|
-
var TableContext =
|
|
9768
|
+
import React33 from "react";
|
|
9769
|
+
var TableContext = React33.createContext(null);
|
|
9063
9770
|
var useTableContext = () => {
|
|
9064
|
-
const ctx =
|
|
9771
|
+
const ctx = React33.useContext(TableContext);
|
|
9065
9772
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
9066
9773
|
return ctx;
|
|
9067
9774
|
};
|
|
9068
9775
|
var TableContext_default = TableContext;
|
|
9069
9776
|
|
|
9070
9777
|
// src/components/Table/Table.tsx
|
|
9071
|
-
import { jsx as
|
|
9778
|
+
import { jsx as jsx341 } from "react/jsx-runtime";
|
|
9072
9779
|
var Table = (props) => {
|
|
9073
9780
|
const {
|
|
9074
9781
|
children,
|
|
@@ -9078,7 +9785,7 @@ var Table = (props) => {
|
|
|
9078
9785
|
headerSticky = false,
|
|
9079
9786
|
stickyShadow = true
|
|
9080
9787
|
} = props;
|
|
9081
|
-
return /* @__PURE__ */
|
|
9788
|
+
return /* @__PURE__ */ jsx341("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ jsx341(
|
|
9082
9789
|
TableContext_default.Provider,
|
|
9083
9790
|
{
|
|
9084
9791
|
value: {
|
|
@@ -9087,7 +9794,7 @@ var Table = (props) => {
|
|
|
9087
9794
|
headerSticky,
|
|
9088
9795
|
stickyShadow
|
|
9089
9796
|
},
|
|
9090
|
-
children: /* @__PURE__ */
|
|
9797
|
+
children: /* @__PURE__ */ jsx341("table", { className: "lib-xplat-table", children })
|
|
9091
9798
|
}
|
|
9092
9799
|
) });
|
|
9093
9800
|
};
|
|
@@ -9095,41 +9802,41 @@ Table.displayName = "Table";
|
|
|
9095
9802
|
var Table_default = Table;
|
|
9096
9803
|
|
|
9097
9804
|
// src/components/Table/TableBody.tsx
|
|
9098
|
-
import { jsx as
|
|
9805
|
+
import { jsx as jsx342 } from "react/jsx-runtime";
|
|
9099
9806
|
var TableBody = (props) => {
|
|
9100
9807
|
const { children } = props;
|
|
9101
|
-
return /* @__PURE__ */
|
|
9808
|
+
return /* @__PURE__ */ jsx342("tbody", { children });
|
|
9102
9809
|
};
|
|
9103
9810
|
TableBody.displayName = "TableBody";
|
|
9104
9811
|
var TableBody_default = TableBody;
|
|
9105
9812
|
|
|
9106
9813
|
// src/components/Table/TableCell.tsx
|
|
9107
|
-
import
|
|
9814
|
+
import React36 from "react";
|
|
9108
9815
|
|
|
9109
9816
|
// src/components/Table/TableHeadContext.tsx
|
|
9110
|
-
import
|
|
9111
|
-
var TableHeadContext =
|
|
9817
|
+
import React34 from "react";
|
|
9818
|
+
var TableHeadContext = React34.createContext(
|
|
9112
9819
|
null
|
|
9113
9820
|
);
|
|
9114
9821
|
var useTableHeadContext = () => {
|
|
9115
|
-
const ctx =
|
|
9822
|
+
const ctx = React34.useContext(TableHeadContext);
|
|
9116
9823
|
return ctx;
|
|
9117
9824
|
};
|
|
9118
9825
|
var TableHeadContext_default = TableHeadContext;
|
|
9119
9826
|
|
|
9120
9827
|
// src/components/Table/TableRowContext.tsx
|
|
9121
|
-
import
|
|
9122
|
-
var TableRowContext =
|
|
9828
|
+
import React35 from "react";
|
|
9829
|
+
var TableRowContext = React35.createContext(null);
|
|
9123
9830
|
var useTableRowContext = () => {
|
|
9124
|
-
const ctx =
|
|
9831
|
+
const ctx = React35.useContext(TableRowContext);
|
|
9125
9832
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
9126
9833
|
return ctx;
|
|
9127
9834
|
};
|
|
9128
9835
|
var TableRowContext_default = TableRowContext;
|
|
9129
9836
|
|
|
9130
9837
|
// src/components/Table/TableCell.tsx
|
|
9131
|
-
import { jsx as
|
|
9132
|
-
var TableCell =
|
|
9838
|
+
import { jsx as jsx343 } from "react/jsx-runtime";
|
|
9839
|
+
var TableCell = React36.memo((props) => {
|
|
9133
9840
|
const {
|
|
9134
9841
|
children,
|
|
9135
9842
|
align = "center",
|
|
@@ -9141,9 +9848,9 @@ var TableCell = React35.memo((props) => {
|
|
|
9141
9848
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
9142
9849
|
const { stickyShadow } = useTableContext();
|
|
9143
9850
|
const headContext = useTableHeadContext();
|
|
9144
|
-
const [left, setLeft] =
|
|
9145
|
-
const cellRef =
|
|
9146
|
-
const calculateLeft =
|
|
9851
|
+
const [left, setLeft] = React36.useState(0);
|
|
9852
|
+
const cellRef = React36.useRef(null);
|
|
9853
|
+
const calculateLeft = React36.useCallback(() => {
|
|
9147
9854
|
if (!cellRef.current) return 0;
|
|
9148
9855
|
let totalLeft = 0;
|
|
9149
9856
|
for (const ref of stickyCells) {
|
|
@@ -9152,7 +9859,7 @@ var TableCell = React35.memo((props) => {
|
|
|
9152
9859
|
}
|
|
9153
9860
|
return totalLeft;
|
|
9154
9861
|
}, [stickyCells]);
|
|
9155
|
-
|
|
9862
|
+
React36.useEffect(() => {
|
|
9156
9863
|
if (!isSticky || !cellRef.current) return;
|
|
9157
9864
|
registerStickyCell(cellRef);
|
|
9158
9865
|
setLeft(calculateLeft());
|
|
@@ -9170,7 +9877,7 @@ var TableCell = React35.memo((props) => {
|
|
|
9170
9877
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
9171
9878
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
9172
9879
|
const enableHover = headContext && headContext.cellHover;
|
|
9173
|
-
return /* @__PURE__ */
|
|
9880
|
+
return /* @__PURE__ */ jsx343(
|
|
9174
9881
|
CellTag,
|
|
9175
9882
|
{
|
|
9176
9883
|
ref: cellRef,
|
|
@@ -9195,21 +9902,21 @@ TableCell.displayName = "TableCell";
|
|
|
9195
9902
|
var TableCell_default = TableCell;
|
|
9196
9903
|
|
|
9197
9904
|
// src/components/Table/TableHead.tsx
|
|
9198
|
-
import { jsx as
|
|
9905
|
+
import { jsx as jsx344 } from "react/jsx-runtime";
|
|
9199
9906
|
var TableHead = ({
|
|
9200
9907
|
children,
|
|
9201
9908
|
cellHover = false
|
|
9202
9909
|
}) => {
|
|
9203
9910
|
const { headerSticky } = useTableContext();
|
|
9204
|
-
return /* @__PURE__ */
|
|
9911
|
+
return /* @__PURE__ */ jsx344(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ jsx344("thead", { className: clsx_default(headerSticky ? "table-sticky" : null), children }) });
|
|
9205
9912
|
};
|
|
9206
9913
|
TableHead.displayName = "TableHead";
|
|
9207
9914
|
var TableHead_default = TableHead;
|
|
9208
9915
|
|
|
9209
9916
|
// src/components/Table/TableRow.tsx
|
|
9210
|
-
import
|
|
9211
|
-
import { jsx as
|
|
9212
|
-
var TableRow =
|
|
9917
|
+
import React37 from "react";
|
|
9918
|
+
import { jsx as jsx345 } from "react/jsx-runtime";
|
|
9919
|
+
var TableRow = React37.memo((props) => {
|
|
9213
9920
|
const {
|
|
9214
9921
|
children,
|
|
9215
9922
|
type = "secondary",
|
|
@@ -9218,14 +9925,14 @@ var TableRow = React36.memo((props) => {
|
|
|
9218
9925
|
onClick
|
|
9219
9926
|
} = props;
|
|
9220
9927
|
const { rowBorderUse } = useTableContext();
|
|
9221
|
-
const [stickyCells, setStickyCells] =
|
|
9928
|
+
const [stickyCells, setStickyCells] = React37.useState([]);
|
|
9222
9929
|
const registerStickyCell = (ref) => {
|
|
9223
9930
|
setStickyCells((prev) => {
|
|
9224
9931
|
if (prev.includes(ref)) return prev;
|
|
9225
9932
|
return [...prev, ref];
|
|
9226
9933
|
});
|
|
9227
9934
|
};
|
|
9228
|
-
return /* @__PURE__ */
|
|
9935
|
+
return /* @__PURE__ */ jsx345(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ jsx345(
|
|
9229
9936
|
"tr",
|
|
9230
9937
|
{
|
|
9231
9938
|
className: clsx_default(
|
|
@@ -9249,7 +9956,7 @@ TableRow.displayName = "TableRow";
|
|
|
9249
9956
|
var TableRow_default = TableRow;
|
|
9250
9957
|
|
|
9251
9958
|
// src/components/Tag/Tag.tsx
|
|
9252
|
-
import { jsx as
|
|
9959
|
+
import { jsx as jsx346, jsxs as jsxs220 } from "react/jsx-runtime";
|
|
9253
9960
|
var Tag = (props) => {
|
|
9254
9961
|
const {
|
|
9255
9962
|
children,
|
|
@@ -9259,7 +9966,7 @@ var Tag = (props) => {
|
|
|
9259
9966
|
disabled = false,
|
|
9260
9967
|
colorIndex
|
|
9261
9968
|
} = props;
|
|
9262
|
-
return /* @__PURE__ */
|
|
9969
|
+
return /* @__PURE__ */ jsxs220(
|
|
9263
9970
|
"span",
|
|
9264
9971
|
{
|
|
9265
9972
|
className: clsx_default(
|
|
@@ -9270,8 +9977,8 @@ var Tag = (props) => {
|
|
|
9270
9977
|
disabled && "disabled"
|
|
9271
9978
|
),
|
|
9272
9979
|
children: [
|
|
9273
|
-
/* @__PURE__ */
|
|
9274
|
-
onClose && /* @__PURE__ */
|
|
9980
|
+
/* @__PURE__ */ jsx346("span", { className: "tag-label", children }),
|
|
9981
|
+
onClose && /* @__PURE__ */ jsx346("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", disabled, children: /* @__PURE__ */ jsx346(XIcon_default, {}) })
|
|
9275
9982
|
]
|
|
9276
9983
|
}
|
|
9277
9984
|
);
|
|
@@ -9280,12 +9987,12 @@ Tag.displayName = "Tag";
|
|
|
9280
9987
|
var Tag_default = Tag;
|
|
9281
9988
|
|
|
9282
9989
|
// src/components/TextArea/TextArea.tsx
|
|
9283
|
-
import
|
|
9284
|
-
import { jsx as
|
|
9285
|
-
var TextArea =
|
|
9990
|
+
import React38 from "react";
|
|
9991
|
+
import { jsx as jsx347 } from "react/jsx-runtime";
|
|
9992
|
+
var TextArea = React38.forwardRef(
|
|
9286
9993
|
(props, ref) => {
|
|
9287
9994
|
const { value, onChange, disabled, ...textareaProps } = props;
|
|
9288
|
-
const localRef =
|
|
9995
|
+
const localRef = React38.useRef(null);
|
|
9289
9996
|
const setRefs = (el) => {
|
|
9290
9997
|
localRef.current = el;
|
|
9291
9998
|
if (!ref) return;
|
|
@@ -9305,21 +10012,21 @@ var TextArea = React37.forwardRef(
|
|
|
9305
10012
|
onChange(event);
|
|
9306
10013
|
}
|
|
9307
10014
|
};
|
|
9308
|
-
|
|
10015
|
+
React38.useEffect(() => {
|
|
9309
10016
|
const el = localRef.current;
|
|
9310
10017
|
if (!el) return;
|
|
9311
10018
|
el.style.height = "0px";
|
|
9312
10019
|
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
9313
10020
|
el.style.height = `${nextHeight}px`;
|
|
9314
10021
|
}, [value]);
|
|
9315
|
-
return /* @__PURE__ */
|
|
10022
|
+
return /* @__PURE__ */ jsx347("div", { className: "lib-xplat-textarea-wrapper", children: /* @__PURE__ */ jsx347(
|
|
9316
10023
|
"div",
|
|
9317
10024
|
{
|
|
9318
10025
|
className: clsx_default(
|
|
9319
10026
|
"lib-xplat-textarea",
|
|
9320
10027
|
disabled ? "disabled" : void 0
|
|
9321
10028
|
),
|
|
9322
|
-
children: /* @__PURE__ */
|
|
10029
|
+
children: /* @__PURE__ */ jsx347(
|
|
9323
10030
|
"textarea",
|
|
9324
10031
|
{
|
|
9325
10032
|
...textareaProps,
|
|
@@ -9337,25 +10044,25 @@ TextArea.displayName = "TextArea";
|
|
|
9337
10044
|
var TextArea_default = TextArea;
|
|
9338
10045
|
|
|
9339
10046
|
// src/components/Toast/Toast.tsx
|
|
9340
|
-
import
|
|
10047
|
+
import React39 from "react";
|
|
9341
10048
|
import { createPortal as createPortal3 } from "react-dom";
|
|
9342
|
-
import { jsx as
|
|
9343
|
-
var ToastContext =
|
|
10049
|
+
import { jsx as jsx348, jsxs as jsxs221 } from "react/jsx-runtime";
|
|
10050
|
+
var ToastContext = React39.createContext(null);
|
|
9344
10051
|
var useToast = () => {
|
|
9345
|
-
const ctx =
|
|
10052
|
+
const ctx = React39.useContext(ToastContext);
|
|
9346
10053
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
9347
10054
|
return ctx;
|
|
9348
10055
|
};
|
|
9349
10056
|
var EXIT_DURATION = 300;
|
|
9350
10057
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
9351
|
-
const ref =
|
|
9352
|
-
const [height, setHeight] =
|
|
9353
|
-
|
|
10058
|
+
const ref = React39.useRef(null);
|
|
10059
|
+
const [height, setHeight] = React39.useState(void 0);
|
|
10060
|
+
React39.useEffect(() => {
|
|
9354
10061
|
if (ref.current && !isExiting) {
|
|
9355
10062
|
setHeight(ref.current.offsetHeight);
|
|
9356
10063
|
}
|
|
9357
10064
|
}, [isExiting]);
|
|
9358
|
-
return /* @__PURE__ */
|
|
10065
|
+
return /* @__PURE__ */ jsx348(
|
|
9359
10066
|
"div",
|
|
9360
10067
|
{
|
|
9361
10068
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -9363,15 +10070,15 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
9363
10070
|
maxHeight: isExiting ? 0 : height ?? "none",
|
|
9364
10071
|
marginBottom: isExiting ? 0 : void 0
|
|
9365
10072
|
},
|
|
9366
|
-
children: /* @__PURE__ */
|
|
10073
|
+
children: /* @__PURE__ */ jsxs221(
|
|
9367
10074
|
"div",
|
|
9368
10075
|
{
|
|
9369
10076
|
ref,
|
|
9370
10077
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
9371
10078
|
role: "alert",
|
|
9372
10079
|
children: [
|
|
9373
|
-
/* @__PURE__ */
|
|
9374
|
-
/* @__PURE__ */
|
|
10080
|
+
/* @__PURE__ */ jsx348("span", { className: "message", children: item.message }),
|
|
10081
|
+
/* @__PURE__ */ jsx348("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
9375
10082
|
]
|
|
9376
10083
|
}
|
|
9377
10084
|
)
|
|
@@ -9382,13 +10089,13 @@ var ToastProvider = ({
|
|
|
9382
10089
|
children,
|
|
9383
10090
|
position = "top-right"
|
|
9384
10091
|
}) => {
|
|
9385
|
-
const [toasts, setToasts] =
|
|
9386
|
-
const [removing, setRemoving] =
|
|
9387
|
-
const [mounted, setMounted] =
|
|
9388
|
-
|
|
10092
|
+
const [toasts, setToasts] = React39.useState([]);
|
|
10093
|
+
const [removing, setRemoving] = React39.useState(/* @__PURE__ */ new Set());
|
|
10094
|
+
const [mounted, setMounted] = React39.useState(false);
|
|
10095
|
+
React39.useEffect(() => {
|
|
9389
10096
|
setMounted(true);
|
|
9390
10097
|
}, []);
|
|
9391
|
-
const remove =
|
|
10098
|
+
const remove = React39.useCallback((id) => {
|
|
9392
10099
|
setRemoving((prev) => new Set(prev).add(id));
|
|
9393
10100
|
setTimeout(() => {
|
|
9394
10101
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -9399,7 +10106,7 @@ var ToastProvider = ({
|
|
|
9399
10106
|
});
|
|
9400
10107
|
}, EXIT_DURATION);
|
|
9401
10108
|
}, []);
|
|
9402
|
-
const toast =
|
|
10109
|
+
const toast = React39.useCallback(
|
|
9403
10110
|
(type, message, duration = 3e3) => {
|
|
9404
10111
|
const id = `${Date.now()}-${Math.random()}`;
|
|
9405
10112
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -9409,10 +10116,10 @@ var ToastProvider = ({
|
|
|
9409
10116
|
},
|
|
9410
10117
|
[remove]
|
|
9411
10118
|
);
|
|
9412
|
-
return /* @__PURE__ */
|
|
10119
|
+
return /* @__PURE__ */ jsxs221(ToastContext.Provider, { value: { toast }, children: [
|
|
9413
10120
|
children,
|
|
9414
10121
|
mounted && createPortal3(
|
|
9415
|
-
/* @__PURE__ */
|
|
10122
|
+
/* @__PURE__ */ jsx348("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ jsx348(
|
|
9416
10123
|
ToastItemComponent,
|
|
9417
10124
|
{
|
|
9418
10125
|
item: t,
|
|
@@ -9428,8 +10135,8 @@ var ToastProvider = ({
|
|
|
9428
10135
|
ToastProvider.displayName = "ToastProvider";
|
|
9429
10136
|
|
|
9430
10137
|
// src/components/Tooltip/Tooltip.tsx
|
|
9431
|
-
import
|
|
9432
|
-
import { Fragment as Fragment5, jsx as
|
|
10138
|
+
import React40 from "react";
|
|
10139
|
+
import { Fragment as Fragment5, jsx as jsx349, jsxs as jsxs222 } from "react/jsx-runtime";
|
|
9433
10140
|
var OFFSET = 12;
|
|
9434
10141
|
var SHOW_DELAY = 300;
|
|
9435
10142
|
var Tooltip = (props) => {
|
|
@@ -9440,12 +10147,12 @@ var Tooltip = (props) => {
|
|
|
9440
10147
|
children,
|
|
9441
10148
|
disabled = false
|
|
9442
10149
|
} = props;
|
|
9443
|
-
const triggerRef =
|
|
9444
|
-
const tooltipRef =
|
|
9445
|
-
const [visible, setVisible] =
|
|
9446
|
-
const [pos, setPos] =
|
|
9447
|
-
const delayTimer =
|
|
9448
|
-
const calculatePos =
|
|
10150
|
+
const triggerRef = React40.useRef(null);
|
|
10151
|
+
const tooltipRef = React40.useRef(null);
|
|
10152
|
+
const [visible, setVisible] = React40.useState(false);
|
|
10153
|
+
const [pos, setPos] = React40.useState({ left: 0, top: 0 });
|
|
10154
|
+
const delayTimer = React40.useRef(0);
|
|
10155
|
+
const calculatePos = React40.useCallback((clientX, clientY) => {
|
|
9449
10156
|
const el = tooltipRef.current;
|
|
9450
10157
|
if (!el) return;
|
|
9451
10158
|
const w = el.offsetWidth;
|
|
@@ -9458,38 +10165,38 @@ var Tooltip = (props) => {
|
|
|
9458
10165
|
if (left < 8) left = 8;
|
|
9459
10166
|
setPos({ left, top });
|
|
9460
10167
|
}, []);
|
|
9461
|
-
const handleMouseEnter =
|
|
10168
|
+
const handleMouseEnter = React40.useCallback(() => {
|
|
9462
10169
|
if (disabled) return;
|
|
9463
10170
|
delayTimer.current = window.setTimeout(() => {
|
|
9464
10171
|
setVisible(true);
|
|
9465
10172
|
}, SHOW_DELAY);
|
|
9466
10173
|
}, [disabled]);
|
|
9467
|
-
const handleMouseMove =
|
|
10174
|
+
const handleMouseMove = React40.useCallback((e) => {
|
|
9468
10175
|
if (!visible) return;
|
|
9469
10176
|
calculatePos(e.clientX, e.clientY);
|
|
9470
10177
|
}, [visible, calculatePos]);
|
|
9471
|
-
const handleMouseLeave =
|
|
10178
|
+
const handleMouseLeave = React40.useCallback(() => {
|
|
9472
10179
|
window.clearTimeout(delayTimer.current);
|
|
9473
10180
|
setVisible(false);
|
|
9474
10181
|
}, []);
|
|
9475
|
-
const handleClick =
|
|
10182
|
+
const handleClick = React40.useCallback(() => {
|
|
9476
10183
|
window.clearTimeout(delayTimer.current);
|
|
9477
10184
|
setVisible(false);
|
|
9478
10185
|
}, []);
|
|
9479
|
-
const handleFocus =
|
|
10186
|
+
const handleFocus = React40.useCallback(() => {
|
|
9480
10187
|
if (disabled) return;
|
|
9481
10188
|
setVisible(true);
|
|
9482
10189
|
}, [disabled]);
|
|
9483
|
-
const handleBlur =
|
|
10190
|
+
const handleBlur = React40.useCallback(() => {
|
|
9484
10191
|
setVisible(false);
|
|
9485
10192
|
}, []);
|
|
9486
|
-
|
|
10193
|
+
React40.useLayoutEffect(() => {
|
|
9487
10194
|
if (!visible || !triggerRef.current) return;
|
|
9488
10195
|
const rect = triggerRef.current.getBoundingClientRect();
|
|
9489
10196
|
calculatePos(rect.right, rect.top);
|
|
9490
10197
|
}, [visible, calculatePos]);
|
|
9491
|
-
if (!title && !description) return /* @__PURE__ */
|
|
9492
|
-
return /* @__PURE__ */
|
|
10198
|
+
if (!title && !description) return /* @__PURE__ */ jsx349(Fragment5, { children });
|
|
10199
|
+
return /* @__PURE__ */ jsxs222(
|
|
9493
10200
|
"div",
|
|
9494
10201
|
{
|
|
9495
10202
|
ref: triggerRef,
|
|
@@ -9502,15 +10209,15 @@ var Tooltip = (props) => {
|
|
|
9502
10209
|
onBlur: handleBlur,
|
|
9503
10210
|
children: [
|
|
9504
10211
|
children,
|
|
9505
|
-
visible && /* @__PURE__ */
|
|
10212
|
+
visible && /* @__PURE__ */ jsx349(Portal_default, { children: /* @__PURE__ */ jsxs222(
|
|
9506
10213
|
"div",
|
|
9507
10214
|
{
|
|
9508
10215
|
ref: tooltipRef,
|
|
9509
10216
|
className: clsx_default("lib-xplat-tooltip", type),
|
|
9510
10217
|
style: { position: "fixed", left: pos.left, top: pos.top },
|
|
9511
10218
|
children: [
|
|
9512
|
-
title && /* @__PURE__ */
|
|
9513
|
-
description && /* @__PURE__ */
|
|
10219
|
+
title && /* @__PURE__ */ jsx349("div", { className: "tooltip-title", children: title }),
|
|
10220
|
+
description && /* @__PURE__ */ jsx349("div", { className: "tooltip-desc", children: description })
|
|
9514
10221
|
]
|
|
9515
10222
|
}
|
|
9516
10223
|
) })
|
|
@@ -9522,11 +10229,11 @@ Tooltip.displayName = "Tooltip";
|
|
|
9522
10229
|
var Tooltip_default = Tooltip;
|
|
9523
10230
|
|
|
9524
10231
|
// src/components/Video/Video.tsx
|
|
9525
|
-
import
|
|
9526
|
-
import { jsx as
|
|
9527
|
-
var PipIcon = () => /* @__PURE__ */
|
|
9528
|
-
/* @__PURE__ */
|
|
9529
|
-
/* @__PURE__ */
|
|
10232
|
+
import React41 from "react";
|
|
10233
|
+
import { jsx as jsx350, jsxs as jsxs223 } from "react/jsx-runtime";
|
|
10234
|
+
var PipIcon = () => /* @__PURE__ */ jsxs223("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
10235
|
+
/* @__PURE__ */ jsx350("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
10236
|
+
/* @__PURE__ */ jsx350("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
|
|
9530
10237
|
] });
|
|
9531
10238
|
var formatTime = (sec) => {
|
|
9532
10239
|
if (!Number.isFinite(sec) || sec < 0) return "0:00";
|
|
@@ -9534,7 +10241,7 @@ var formatTime = (sec) => {
|
|
|
9534
10241
|
const s = Math.floor(sec % 60);
|
|
9535
10242
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
9536
10243
|
};
|
|
9537
|
-
var Video =
|
|
10244
|
+
var Video = React41.forwardRef((props, ref) => {
|
|
9538
10245
|
const {
|
|
9539
10246
|
src,
|
|
9540
10247
|
poster,
|
|
@@ -9558,21 +10265,21 @@ var Video = React40.forwardRef((props, ref) => {
|
|
|
9558
10265
|
children,
|
|
9559
10266
|
...rest
|
|
9560
10267
|
} = props;
|
|
9561
|
-
const containerRef =
|
|
9562
|
-
const videoRef =
|
|
9563
|
-
const [isPlaying, setIsPlaying] =
|
|
9564
|
-
const [isLoaded, setIsLoaded] =
|
|
9565
|
-
const [currentTime, setCurrentTime] =
|
|
9566
|
-
const [duration, setDuration] =
|
|
9567
|
-
const [buffered, setBuffered] =
|
|
9568
|
-
const [volume, setVolume] =
|
|
9569
|
-
const [isMuted, setIsMuted] =
|
|
9570
|
-
const [isFullscreen, setIsFullscreen] =
|
|
9571
|
-
const [playbackRate, setPlaybackRate] =
|
|
9572
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
9573
|
-
const [captionsOn, setCaptionsOn] =
|
|
9574
|
-
const [isPip, setIsPip] =
|
|
9575
|
-
const setRefs =
|
|
10268
|
+
const containerRef = React41.useRef(null);
|
|
10269
|
+
const videoRef = React41.useRef(null);
|
|
10270
|
+
const [isPlaying, setIsPlaying] = React41.useState(Boolean(autoPlay));
|
|
10271
|
+
const [isLoaded, setIsLoaded] = React41.useState(false);
|
|
10272
|
+
const [currentTime, setCurrentTime] = React41.useState(0);
|
|
10273
|
+
const [duration, setDuration] = React41.useState(0);
|
|
10274
|
+
const [buffered, setBuffered] = React41.useState(0);
|
|
10275
|
+
const [volume, setVolume] = React41.useState(1);
|
|
10276
|
+
const [isMuted, setIsMuted] = React41.useState(Boolean(muted));
|
|
10277
|
+
const [isFullscreen, setIsFullscreen] = React41.useState(false);
|
|
10278
|
+
const [playbackRate, setPlaybackRate] = React41.useState(1);
|
|
10279
|
+
const [rateMenuOpen, setRateMenuOpen] = React41.useState(false);
|
|
10280
|
+
const [captionsOn, setCaptionsOn] = React41.useState(false);
|
|
10281
|
+
const [isPip, setIsPip] = React41.useState(false);
|
|
10282
|
+
const setRefs = React41.useCallback(
|
|
9576
10283
|
(el) => {
|
|
9577
10284
|
videoRef.current = el;
|
|
9578
10285
|
if (typeof ref === "function") ref(el);
|
|
@@ -9580,14 +10287,14 @@ var Video = React40.forwardRef((props, ref) => {
|
|
|
9580
10287
|
},
|
|
9581
10288
|
[ref]
|
|
9582
10289
|
);
|
|
9583
|
-
|
|
10290
|
+
React41.useEffect(() => {
|
|
9584
10291
|
const onFsChange = () => {
|
|
9585
10292
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
9586
10293
|
};
|
|
9587
10294
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
9588
10295
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
9589
10296
|
}, []);
|
|
9590
|
-
|
|
10297
|
+
React41.useEffect(() => {
|
|
9591
10298
|
const v = videoRef.current;
|
|
9592
10299
|
if (!v) return;
|
|
9593
10300
|
const onEnter = () => setIsPip(true);
|
|
@@ -9701,13 +10408,13 @@ var Video = React40.forwardRef((props, ref) => {
|
|
|
9701
10408
|
const volumePct = (isMuted ? 0 : volume) * 100;
|
|
9702
10409
|
const VolumeGlyph = isMuted || volume === 0 ? VolumeXIcon_default : volume < 0.5 ? VolumeIcon_default : Volume2Icon_default;
|
|
9703
10410
|
const pipSupported = typeof document !== "undefined" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled;
|
|
9704
|
-
return /* @__PURE__ */
|
|
10411
|
+
return /* @__PURE__ */ jsxs223(
|
|
9705
10412
|
"div",
|
|
9706
10413
|
{
|
|
9707
10414
|
ref: containerRef,
|
|
9708
10415
|
className: clsx_default("lib-xplat-video", showControls && "has-controls"),
|
|
9709
10416
|
children: [
|
|
9710
|
-
/* @__PURE__ */
|
|
10417
|
+
/* @__PURE__ */ jsx350(
|
|
9711
10418
|
"video",
|
|
9712
10419
|
{
|
|
9713
10420
|
ref: setRefs,
|
|
@@ -9728,7 +10435,7 @@ var Video = React40.forwardRef((props, ref) => {
|
|
|
9728
10435
|
children
|
|
9729
10436
|
}
|
|
9730
10437
|
),
|
|
9731
|
-
showCenterPlay && /* @__PURE__ */
|
|
10438
|
+
showCenterPlay && /* @__PURE__ */ jsx350(
|
|
9732
10439
|
"button",
|
|
9733
10440
|
{
|
|
9734
10441
|
type: "button",
|
|
@@ -9740,11 +10447,11 @@ var Video = React40.forwardRef((props, ref) => {
|
|
|
9740
10447
|
onClick: togglePlay,
|
|
9741
10448
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
9742
10449
|
tabIndex: -1,
|
|
9743
|
-
children: /* @__PURE__ */
|
|
10450
|
+
children: /* @__PURE__ */ jsx350("span", { className: "center-play-icon", children: /* @__PURE__ */ jsx350(PlayCircleIcon_default, {}) })
|
|
9744
10451
|
}
|
|
9745
10452
|
),
|
|
9746
|
-
showControls && /* @__PURE__ */
|
|
9747
|
-
/* @__PURE__ */
|
|
10453
|
+
showControls && /* @__PURE__ */ jsxs223("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
|
|
10454
|
+
/* @__PURE__ */ jsx350(
|
|
9748
10455
|
"input",
|
|
9749
10456
|
{
|
|
9750
10457
|
type: "range",
|
|
@@ -9761,29 +10468,29 @@ var Video = React40.forwardRef((props, ref) => {
|
|
|
9761
10468
|
}
|
|
9762
10469
|
}
|
|
9763
10470
|
),
|
|
9764
|
-
/* @__PURE__ */
|
|
9765
|
-
/* @__PURE__ */
|
|
10471
|
+
/* @__PURE__ */ jsxs223("div", { className: "controls-row", children: [
|
|
10472
|
+
/* @__PURE__ */ jsx350(
|
|
9766
10473
|
"button",
|
|
9767
10474
|
{
|
|
9768
10475
|
type: "button",
|
|
9769
10476
|
className: "control-btn",
|
|
9770
10477
|
onClick: togglePlay,
|
|
9771
10478
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
9772
|
-
children: isPlaying ? /* @__PURE__ */
|
|
10479
|
+
children: isPlaying ? /* @__PURE__ */ jsx350(PauseIcon_default, {}) : /* @__PURE__ */ jsx350(PlayIcon_default, {})
|
|
9773
10480
|
}
|
|
9774
10481
|
),
|
|
9775
|
-
/* @__PURE__ */
|
|
9776
|
-
/* @__PURE__ */
|
|
10482
|
+
/* @__PURE__ */ jsxs223("div", { className: "volume-group", children: [
|
|
10483
|
+
/* @__PURE__ */ jsx350(
|
|
9777
10484
|
"button",
|
|
9778
10485
|
{
|
|
9779
10486
|
type: "button",
|
|
9780
10487
|
className: "control-btn",
|
|
9781
10488
|
onClick: toggleMute,
|
|
9782
10489
|
"aria-label": isMuted ? "\uC74C\uC18C\uAC70 \uD574\uC81C" : "\uC74C\uC18C\uAC70",
|
|
9783
|
-
children: /* @__PURE__ */
|
|
10490
|
+
children: /* @__PURE__ */ jsx350(VolumeGlyph, {})
|
|
9784
10491
|
}
|
|
9785
10492
|
),
|
|
9786
|
-
/* @__PURE__ */
|
|
10493
|
+
/* @__PURE__ */ jsx350(
|
|
9787
10494
|
"input",
|
|
9788
10495
|
{
|
|
9789
10496
|
type: "range",
|
|
@@ -9798,14 +10505,14 @@ var Video = React40.forwardRef((props, ref) => {
|
|
|
9798
10505
|
}
|
|
9799
10506
|
)
|
|
9800
10507
|
] }),
|
|
9801
|
-
/* @__PURE__ */
|
|
10508
|
+
/* @__PURE__ */ jsxs223("span", { className: "time", children: [
|
|
9802
10509
|
formatTime(currentTime),
|
|
9803
10510
|
" / ",
|
|
9804
10511
|
formatTime(duration)
|
|
9805
10512
|
] }),
|
|
9806
|
-
/* @__PURE__ */
|
|
9807
|
-
playbackRates && playbackRates.length > 0 && /* @__PURE__ */
|
|
9808
|
-
/* @__PURE__ */
|
|
10513
|
+
/* @__PURE__ */ jsx350("div", { className: "controls-spacer" }),
|
|
10514
|
+
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs223("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
|
|
10515
|
+
/* @__PURE__ */ jsxs223(
|
|
9809
10516
|
"button",
|
|
9810
10517
|
{
|
|
9811
10518
|
type: "button",
|
|
@@ -9819,7 +10526,7 @@ var Video = React40.forwardRef((props, ref) => {
|
|
|
9819
10526
|
]
|
|
9820
10527
|
}
|
|
9821
10528
|
),
|
|
9822
|
-
rateMenuOpen && /* @__PURE__ */
|
|
10529
|
+
rateMenuOpen && /* @__PURE__ */ jsx350("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ jsx350("li", { children: /* @__PURE__ */ jsxs223(
|
|
9823
10530
|
"button",
|
|
9824
10531
|
{
|
|
9825
10532
|
type: "button",
|
|
@@ -9833,7 +10540,7 @@ var Video = React40.forwardRef((props, ref) => {
|
|
|
9833
10540
|
}
|
|
9834
10541
|
) }, r2)) })
|
|
9835
10542
|
] }),
|
|
9836
|
-
showCaptions && /* @__PURE__ */
|
|
10543
|
+
showCaptions && /* @__PURE__ */ jsx350(
|
|
9837
10544
|
"button",
|
|
9838
10545
|
{
|
|
9839
10546
|
type: "button",
|
|
@@ -9841,37 +10548,37 @@ var Video = React40.forwardRef((props, ref) => {
|
|
|
9841
10548
|
onClick: toggleCaptions,
|
|
9842
10549
|
"aria-label": captionsOn ? "\uC790\uB9C9 \uB044\uAE30" : "\uC790\uB9C9 \uCF1C\uAE30",
|
|
9843
10550
|
"aria-pressed": captionsOn,
|
|
9844
|
-
children: /* @__PURE__ */
|
|
10551
|
+
children: /* @__PURE__ */ jsx350(TypeIcon_default, {})
|
|
9845
10552
|
}
|
|
9846
10553
|
),
|
|
9847
|
-
showPip && pipSupported && /* @__PURE__ */
|
|
10554
|
+
showPip && pipSupported && /* @__PURE__ */ jsx350(
|
|
9848
10555
|
"button",
|
|
9849
10556
|
{
|
|
9850
10557
|
type: "button",
|
|
9851
10558
|
className: clsx_default("control-btn", isPip && "is-active"),
|
|
9852
10559
|
onClick: togglePip,
|
|
9853
10560
|
"aria-label": isPip ? "PIP \uC885\uB8CC" : "PIP",
|
|
9854
|
-
children: /* @__PURE__ */
|
|
10561
|
+
children: /* @__PURE__ */ jsx350(PipIcon, {})
|
|
9855
10562
|
}
|
|
9856
10563
|
),
|
|
9857
|
-
showDownload && /* @__PURE__ */
|
|
10564
|
+
showDownload && /* @__PURE__ */ jsx350(
|
|
9858
10565
|
"a",
|
|
9859
10566
|
{
|
|
9860
10567
|
className: "control-btn",
|
|
9861
10568
|
href: src,
|
|
9862
10569
|
download: downloadFileName ?? true,
|
|
9863
10570
|
"aria-label": "\uB2E4\uC6B4\uB85C\uB4DC",
|
|
9864
|
-
children: /* @__PURE__ */
|
|
10571
|
+
children: /* @__PURE__ */ jsx350(DownloadIcon_default, {})
|
|
9865
10572
|
}
|
|
9866
10573
|
),
|
|
9867
|
-
/* @__PURE__ */
|
|
10574
|
+
/* @__PURE__ */ jsx350(
|
|
9868
10575
|
"button",
|
|
9869
10576
|
{
|
|
9870
10577
|
type: "button",
|
|
9871
10578
|
className: "control-btn",
|
|
9872
10579
|
onClick: toggleFullscreen,
|
|
9873
10580
|
"aria-label": isFullscreen ? "\uC804\uCCB4\uD654\uBA74 \uC885\uB8CC" : "\uC804\uCCB4\uD654\uBA74",
|
|
9874
|
-
children: isFullscreen ? /* @__PURE__ */
|
|
10581
|
+
children: isFullscreen ? /* @__PURE__ */ jsx350(MinimizeIcon_default, {}) : /* @__PURE__ */ jsx350(MaximizeIcon_default, {})
|
|
9875
10582
|
}
|
|
9876
10583
|
)
|
|
9877
10584
|
] })
|
|
@@ -9884,7 +10591,7 @@ Video.displayName = "Video";
|
|
|
9884
10591
|
var Video_default = Video;
|
|
9885
10592
|
|
|
9886
10593
|
// src/layout/Grid/FullGrid/FullGrid.tsx
|
|
9887
|
-
import { jsx as
|
|
10594
|
+
import { jsx as jsx351 } from "react/jsx-runtime";
|
|
9888
10595
|
var GAP_MAP = {
|
|
9889
10596
|
none: "var(--spacing-space-none)",
|
|
9890
10597
|
xs: "var(--spacing-space-1)",
|
|
@@ -9897,13 +10604,13 @@ var GAP_MAP = {
|
|
|
9897
10604
|
var FullGrid = (props) => {
|
|
9898
10605
|
const { children, gap } = props;
|
|
9899
10606
|
const style = gap != null ? { gap: GAP_MAP[gap] } : void 0;
|
|
9900
|
-
return /* @__PURE__ */
|
|
10607
|
+
return /* @__PURE__ */ jsx351("div", { className: "lib-xplat-full-grid", style, children });
|
|
9901
10608
|
};
|
|
9902
10609
|
FullGrid.displayName = "FullGrid";
|
|
9903
10610
|
var FullGrid_default = FullGrid;
|
|
9904
10611
|
|
|
9905
10612
|
// src/layout/Grid/FullScreen/FullScreen.tsx
|
|
9906
|
-
import { jsx as
|
|
10613
|
+
import { jsx as jsx352 } from "react/jsx-runtime";
|
|
9907
10614
|
var GAP_MAP2 = {
|
|
9908
10615
|
none: "var(--spacing-space-none)",
|
|
9909
10616
|
xs: "var(--spacing-space-1)",
|
|
@@ -9916,13 +10623,13 @@ var GAP_MAP2 = {
|
|
|
9916
10623
|
var FullScreen = (props) => {
|
|
9917
10624
|
const { children, gap } = props;
|
|
9918
10625
|
const style = gap != null ? { gap: GAP_MAP2[gap] } : void 0;
|
|
9919
|
-
return /* @__PURE__ */
|
|
10626
|
+
return /* @__PURE__ */ jsx352("div", { className: "lib-xplat-full-screen", style, children });
|
|
9920
10627
|
};
|
|
9921
10628
|
FullScreen.displayName = "FullScreen";
|
|
9922
10629
|
var FullScreen_default = FullScreen;
|
|
9923
10630
|
|
|
9924
10631
|
// src/layout/Grid/Item/Item.tsx
|
|
9925
|
-
import { jsx as
|
|
10632
|
+
import { jsx as jsx353 } from "react/jsx-runtime";
|
|
9926
10633
|
var calculateSpans = (column) => {
|
|
9927
10634
|
const spans = {};
|
|
9928
10635
|
let inherited = column.default;
|
|
@@ -9939,35 +10646,35 @@ var GridItem = ({ column, children, className }) => {
|
|
|
9939
10646
|
Object.entries(spans).forEach(([key, value]) => {
|
|
9940
10647
|
style[`--column-${key}`] = value;
|
|
9941
10648
|
});
|
|
9942
|
-
return /* @__PURE__ */
|
|
10649
|
+
return /* @__PURE__ */ jsx353("div", { className: clsx_default("lib-xplat-grid-item", className), style, children });
|
|
9943
10650
|
};
|
|
9944
10651
|
GridItem.displayName = "GridItem";
|
|
9945
10652
|
var Item_default = GridItem;
|
|
9946
10653
|
|
|
9947
10654
|
// src/layout/Header/Header.tsx
|
|
9948
|
-
import { jsx as
|
|
10655
|
+
import { jsx as jsx354, jsxs as jsxs224 } from "react/jsx-runtime";
|
|
9949
10656
|
var Header = ({
|
|
9950
10657
|
logo,
|
|
9951
10658
|
centerContent,
|
|
9952
10659
|
rightContent
|
|
9953
10660
|
}) => {
|
|
9954
|
-
return /* @__PURE__ */
|
|
9955
|
-
/* @__PURE__ */
|
|
9956
|
-
/* @__PURE__ */
|
|
9957
|
-
/* @__PURE__ */
|
|
10661
|
+
return /* @__PURE__ */ jsxs224("div", { className: "lib-xplat-layout-header", children: [
|
|
10662
|
+
/* @__PURE__ */ jsx354("div", { children: logo }),
|
|
10663
|
+
/* @__PURE__ */ jsx354("div", { children: centerContent }),
|
|
10664
|
+
/* @__PURE__ */ jsx354("div", { children: rightContent })
|
|
9958
10665
|
] });
|
|
9959
10666
|
};
|
|
9960
10667
|
Header.displayName = "Header";
|
|
9961
10668
|
var Header_default = Header;
|
|
9962
10669
|
|
|
9963
10670
|
// src/layout/Layout/Layout.tsx
|
|
9964
|
-
import { Fragment as Fragment6, jsx as
|
|
10671
|
+
import { Fragment as Fragment6, jsx as jsx355, jsxs as jsxs225 } from "react/jsx-runtime";
|
|
9965
10672
|
var Layout = (props) => {
|
|
9966
10673
|
const { header, sideBar, children } = props;
|
|
9967
|
-
return /* @__PURE__ */
|
|
9968
|
-
sideBar && /* @__PURE__ */
|
|
9969
|
-
/* @__PURE__ */
|
|
9970
|
-
header && /* @__PURE__ */
|
|
10674
|
+
return /* @__PURE__ */ jsx355("div", { className: "lib-xplat-layout", children: /* @__PURE__ */ jsxs225("div", { className: "lib-xplat-layout-content-wrapper", children: [
|
|
10675
|
+
sideBar && /* @__PURE__ */ jsx355(Fragment6, { children: sideBar }),
|
|
10676
|
+
/* @__PURE__ */ jsxs225("div", { className: "lib-xplat-layout-content", children: [
|
|
10677
|
+
header && /* @__PURE__ */ jsx355("div", { className: "lib-xplat-layout-conent-header", children: header }),
|
|
9971
10678
|
children
|
|
9972
10679
|
] })
|
|
9973
10680
|
] }) });
|
|
@@ -9976,31 +10683,31 @@ Layout.displayName = "Layout";
|
|
|
9976
10683
|
var Layout_default = Layout;
|
|
9977
10684
|
|
|
9978
10685
|
// src/layout/SideBar/SideBar.tsx
|
|
9979
|
-
import
|
|
10686
|
+
import React43 from "react";
|
|
9980
10687
|
|
|
9981
10688
|
// src/layout/SideBar/SideBarContext.tsx
|
|
9982
|
-
import
|
|
9983
|
-
var SideBarContext =
|
|
10689
|
+
import React42 from "react";
|
|
10690
|
+
var SideBarContext = React42.createContext(null);
|
|
9984
10691
|
var useSideBarContext = () => {
|
|
9985
|
-
const ctx =
|
|
10692
|
+
const ctx = React42.useContext(SideBarContext);
|
|
9986
10693
|
if (!ctx) throw new Error("Error");
|
|
9987
10694
|
return ctx;
|
|
9988
10695
|
};
|
|
9989
10696
|
var SideBarContext_default = SideBarContext;
|
|
9990
10697
|
|
|
9991
10698
|
// src/layout/SideBar/SideBar.tsx
|
|
9992
|
-
import { jsx as
|
|
10699
|
+
import { jsx as jsx356 } from "react/jsx-runtime";
|
|
9993
10700
|
var SideBar = (props) => {
|
|
9994
10701
|
const { children, className } = props;
|
|
9995
|
-
const [isOpen, setIsOpen] =
|
|
10702
|
+
const [isOpen, setIsOpen] = React43.useState(true);
|
|
9996
10703
|
const handleSwitchSideBar = () => {
|
|
9997
10704
|
setIsOpen((prev) => !prev);
|
|
9998
10705
|
};
|
|
9999
|
-
return /* @__PURE__ */
|
|
10706
|
+
return /* @__PURE__ */ jsx356(
|
|
10000
10707
|
SideBarContext_default.Provider,
|
|
10001
10708
|
{
|
|
10002
10709
|
value: { isSidebarOpen: isOpen, handleSwitchSideBar },
|
|
10003
|
-
children: /* @__PURE__ */
|
|
10710
|
+
children: /* @__PURE__ */ jsx356(
|
|
10004
10711
|
"div",
|
|
10005
10712
|
{
|
|
10006
10713
|
className: clsx_default(
|
|
@@ -10142,6 +10849,7 @@ export {
|
|
|
10142
10849
|
Edit2Icon_default as Edit2Icon,
|
|
10143
10850
|
Edit3Icon_default as Edit3Icon,
|
|
10144
10851
|
EditIcon_default as EditIcon,
|
|
10852
|
+
Editor_default as Editor,
|
|
10145
10853
|
EmptyState_default as EmptyState,
|
|
10146
10854
|
ErrorIcon_default as ErrorIcon,
|
|
10147
10855
|
ExternalLinkIcon_default as ExternalLinkIcon,
|