key-screen-framework 1.1.0 → 1.2.1
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/chunks/screen-overrides-0d_pEdnM.js +110 -0
- package/chunks/{store-txJwmrlO.js → store-WzFy0ShX.js} +65 -3
- package/chunks/{useArduinoBuild-CVr4XAsL.js → useArduinoBuild-CFMmNokt.js} +1 -1
- package/cli/generate-screen.mjs +24 -7
- package/cli/screen-generation-renderers.mjs +10 -6
- package/cli/screen-module-utils.mjs +22 -5
- package/main/index.js +65 -24
- package/package.json +1 -1
- package/preload/index.js +5 -0
- package/renderer/components/VideoSceneScreen.js +59 -3
- package/renderer/hooks/index.js +1 -1
- package/renderer/index.js +1062 -752
- package/renderer/store.js +1 -1
- package/renderer/styles.css +17 -0
- package/shared/index.js +2 -0
- package/shared/types.js +4 -1
- package/templates/project/README.md +87 -17
- package/types/main/media-manager.d.ts +1 -0
- package/types/renderer/src/components/VideoSceneScreen.d.ts +9 -2
- package/types/renderer/src/screen-types.d.ts +1 -1
- package/types/renderer/src/store.d.ts +8 -1
- package/types/shared/display-settings.d.ts +3 -0
- package/types/shared/screen-overrides.d.ts +11 -0
- package/types/shared/types.d.ts +26 -0
package/renderer/index.js
CHANGED
|
@@ -2,10 +2,12 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { createContext, useContext, useLayoutEffect, useState, useRef, useMemo, useEffect, Suspense, StrictMode } from "react";
|
|
3
3
|
import { createRoot } from "react-dom/client";
|
|
4
4
|
import { buildDefaultGlobalShortcuts, matchesShortcut, DEBUG_DEVICE_LOG_SHORTCUT, RESET_SCREEN_TARGET, KIOSK_QUIT_SHORTCUT, normalizeShortcutAccelerator } from "../shared/screen-shortcuts.js";
|
|
5
|
-
import { c as configureRendererPreview, g as getGameApi, u as useAppStore } from "../chunks/store-
|
|
5
|
+
import { c as configureRendererPreview, g as getGameApi, u as useAppStore } from "../chunks/store-WzFy0ShX.js";
|
|
6
6
|
import { createPortal, flushSync } from "react-dom";
|
|
7
|
-
import { u as useArduinoBuild } from "../chunks/useArduinoBuild-
|
|
8
|
-
import { c, a } from "../chunks/useArduinoBuild-
|
|
7
|
+
import { u as useArduinoBuild } from "../chunks/useArduinoBuild-CFMmNokt.js";
|
|
8
|
+
import { c, a } from "../chunks/useArduinoBuild-CFMmNokt.js";
|
|
9
|
+
import { probeVideoDimensions } from "./components/VideoSceneScreen.js";
|
|
10
|
+
import { ADMIN_ZOOM_LEVELS } from "../shared/types.js";
|
|
9
11
|
import { BOARD_PRESET_FQBN, ARDUINO_BOARD_PRESETS, resolveArduinoBoardFqbn } from "../shared/arduino-board.js";
|
|
10
12
|
import { acceleratorToArduinoKeyboardShortcut } from "../shared/arduino-keyboard-shortcut.js";
|
|
11
13
|
const logTone$1 = {
|
|
@@ -140,21 +142,27 @@ function getActiveScreenDefinition(screens, fallbackScreens, currentStepId) {
|
|
|
140
142
|
return activeScreen;
|
|
141
143
|
}
|
|
142
144
|
const screenModulePreloadPromises = /* @__PURE__ */ new WeakMap();
|
|
143
|
-
|
|
144
|
-
|
|
145
|
+
function getScreenPreloadKey(screen) {
|
|
146
|
+
return JSON.stringify([screen.id, screen.video ?? "", screen.loop ?? false, screen.loopCount ?? 1]);
|
|
147
|
+
}
|
|
148
|
+
async function preloadScreenModule(screenModules, screen) {
|
|
149
|
+
const screenModule = screenModules[screen.componentKey];
|
|
145
150
|
if (!screenModule?.preload) {
|
|
146
151
|
return;
|
|
147
152
|
}
|
|
148
|
-
const
|
|
153
|
+
const preloadKey = getScreenPreloadKey(screen);
|
|
154
|
+
const preloadPromises = screenModulePreloadPromises.get(screenModule) ?? /* @__PURE__ */ new Map();
|
|
155
|
+
screenModulePreloadPromises.set(screenModule, preloadPromises);
|
|
156
|
+
const existingPreload = preloadPromises.get(preloadKey);
|
|
149
157
|
if (existingPreload) {
|
|
150
158
|
await existingPreload;
|
|
151
159
|
return;
|
|
152
160
|
}
|
|
153
|
-
const preloadPromise = Promise.resolve().then(() => screenModule.preload?.()).then(() => void 0).catch((error) => {
|
|
154
|
-
|
|
161
|
+
const preloadPromise = Promise.resolve().then(() => screenModule.preload?.(screen)).then(() => void 0).catch((error) => {
|
|
162
|
+
preloadPromises.delete(preloadKey);
|
|
155
163
|
throw error;
|
|
156
164
|
});
|
|
157
|
-
|
|
165
|
+
preloadPromises.set(preloadKey, preloadPromise);
|
|
158
166
|
await preloadPromise;
|
|
159
167
|
}
|
|
160
168
|
function UnknownScreen({ screenId }) {
|
|
@@ -182,8 +190,11 @@ function SceneStageFrame({
|
|
|
182
190
|
sceneResolution
|
|
183
191
|
}) {
|
|
184
192
|
const [viewportSize, setViewportSize] = useState(() => getViewportSize(sceneResolution));
|
|
193
|
+
const displayFit = useAppStore((state) => state.displayFit);
|
|
185
194
|
const { width, height } = sceneResolution;
|
|
186
|
-
const
|
|
195
|
+
const scaleX = viewportSize.width / width;
|
|
196
|
+
const scaleY = viewportSize.height / height;
|
|
197
|
+
const transform = displayFit === "fill" ? `translate(-50%, -50%) scale(${scaleX}, ${scaleY})` : `translate(-50%, -50%) scale(${Math.min(scaleX, scaleY)})`;
|
|
187
198
|
useEffect(() => {
|
|
188
199
|
const updateViewportSize = () => setViewportSize(getViewportSize(sceneResolution));
|
|
189
200
|
updateViewportSize();
|
|
@@ -198,7 +209,7 @@ function SceneStageFrame({
|
|
|
198
209
|
style: {
|
|
199
210
|
width,
|
|
200
211
|
height,
|
|
201
|
-
transform
|
|
212
|
+
transform,
|
|
202
213
|
transformOrigin: "center"
|
|
203
214
|
},
|
|
204
215
|
children
|
|
@@ -371,7 +382,7 @@ function ScreenRenderer({ gameState, screens }) {
|
|
|
371
382
|
let cancelled = false;
|
|
372
383
|
pendingStartedAtRef.current = performance.now();
|
|
373
384
|
logPreload("start", requestedScreen, `Preparing before transition from ${displayedScreen.id}.`);
|
|
374
|
-
void preloadScreenModule(screenModules, requestedScreen
|
|
385
|
+
void preloadScreenModule(screenModules, requestedScreen).then(() => {
|
|
375
386
|
if (cancelled) {
|
|
376
387
|
return;
|
|
377
388
|
}
|
|
@@ -406,7 +417,7 @@ function ScreenRenderer({ gameState, screens }) {
|
|
|
406
417
|
}
|
|
407
418
|
const startedAt = performance.now();
|
|
408
419
|
logPreload("start", preloadTarget, `Preloading after ${displayedScreen.id}.`);
|
|
409
|
-
void preloadScreenModule(screenModules, preloadTarget
|
|
420
|
+
void preloadScreenModule(screenModules, preloadTarget).then(() => {
|
|
410
421
|
logPreload(
|
|
411
422
|
"done",
|
|
412
423
|
preloadTarget,
|
|
@@ -1276,13 +1287,18 @@ function AdminScreen({ gameState }) {
|
|
|
1276
1287
|
deviceState,
|
|
1277
1288
|
deviceSignalTargets,
|
|
1278
1289
|
disconnect,
|
|
1290
|
+
displayFit,
|
|
1291
|
+
adminZoom,
|
|
1279
1292
|
loading,
|
|
1280
1293
|
moveToScreen,
|
|
1281
1294
|
ports,
|
|
1282
1295
|
screens,
|
|
1283
1296
|
shortcuts,
|
|
1284
1297
|
updateArduinoBoardConfig,
|
|
1298
|
+
updateAdminZoom,
|
|
1299
|
+
updateDisplayFit,
|
|
1285
1300
|
updateGlobalShortcuts,
|
|
1301
|
+
updateScreenOverrides,
|
|
1286
1302
|
updateWindowMode,
|
|
1287
1303
|
windowMode,
|
|
1288
1304
|
windowModeLocked
|
|
@@ -1313,6 +1329,16 @@ function AdminScreen({ gameState }) {
|
|
|
1313
1329
|
const [mediaLibrary, setMediaLibrary] = useState(null);
|
|
1314
1330
|
const [mediaLoading, setMediaLoading] = useState(false);
|
|
1315
1331
|
const [mediaError, setMediaError] = useState("");
|
|
1332
|
+
const [displayModalOpen, setDisplayModalOpen] = useState(false);
|
|
1333
|
+
const [videoDiagnostics, setVideoDiagnostics] = useState([]);
|
|
1334
|
+
const [displayError, setDisplayError] = useState("");
|
|
1335
|
+
const [adminZoomError, setAdminZoomError] = useState("");
|
|
1336
|
+
const [editingScreenId, setEditingScreenId] = useState("");
|
|
1337
|
+
const [screenTitleDraft, setScreenTitleDraft] = useState("");
|
|
1338
|
+
const [screenVideoDraft, setScreenVideoDraft] = useState("");
|
|
1339
|
+
const [screenLoopDraft, setScreenLoopDraft] = useState(false);
|
|
1340
|
+
const [screenLoopCountDraft, setScreenLoopCountDraft] = useState("1");
|
|
1341
|
+
const [screenEditError, setScreenEditError] = useState("");
|
|
1316
1342
|
const [arduinoDraft, setArduinoDraft] = useState(arduinoBoardConfig);
|
|
1317
1343
|
const [arduinoAdvancedFqbn, setArduinoAdvancedFqbn] = useState(false);
|
|
1318
1344
|
const [arduinoSyncState, setArduinoSyncState] = useState(
|
|
@@ -1793,828 +1819,1023 @@ function AdminScreen({ gameState }) {
|
|
|
1793
1819
|
setArduinoError("Arduino 업로드 요청에 실패했습니다.");
|
|
1794
1820
|
}
|
|
1795
1821
|
};
|
|
1822
|
+
const buildCurrentOverrides = () => {
|
|
1823
|
+
const result = {};
|
|
1824
|
+
for (const current of screens.filter((screen) => screen.kind === "scene")) {
|
|
1825
|
+
const base = screenDefinitions.find((screen) => screen.id === current.id);
|
|
1826
|
+
if (!base) continue;
|
|
1827
|
+
const override = {};
|
|
1828
|
+
if (current.title !== base.title) override.title = current.title;
|
|
1829
|
+
if (current.video !== base.video && current.video) override.video = current.video;
|
|
1830
|
+
if ((current.loop ?? false) !== (base.loop ?? false)) override.loop = current.loop ?? false;
|
|
1831
|
+
if ((current.loopCount ?? 1) !== (base.loopCount ?? 1)) override.loopCount = current.loopCount ?? 1;
|
|
1832
|
+
if (Object.keys(override).length > 0) result[current.id] = override;
|
|
1833
|
+
}
|
|
1834
|
+
return result;
|
|
1835
|
+
};
|
|
1836
|
+
const beginScreenEdit = (target) => {
|
|
1837
|
+
setEditingScreenId(target.id);
|
|
1838
|
+
setScreenTitleDraft(target.title);
|
|
1839
|
+
setScreenVideoDraft(target.video ?? "");
|
|
1840
|
+
setScreenLoopDraft(target.loop ?? false);
|
|
1841
|
+
setScreenLoopCountDraft(String(target.loopCount ?? 1));
|
|
1842
|
+
setScreenEditError("");
|
|
1843
|
+
};
|
|
1844
|
+
const saveScreenEdit = async (target) => {
|
|
1845
|
+
const loopCount = Number.parseInt(screenLoopCountDraft, 10);
|
|
1846
|
+
const overrides = buildCurrentOverrides();
|
|
1847
|
+
overrides[target.id] = {
|
|
1848
|
+
title: screenTitleDraft,
|
|
1849
|
+
...screenVideoDraft || target.video ? { video: screenVideoDraft } : {},
|
|
1850
|
+
loop: screenLoopDraft,
|
|
1851
|
+
loopCount
|
|
1852
|
+
};
|
|
1853
|
+
try {
|
|
1854
|
+
await updateScreenOverrides(overrides);
|
|
1855
|
+
setEditingScreenId("");
|
|
1856
|
+
setScreenEditError("");
|
|
1857
|
+
} catch {
|
|
1858
|
+
setScreenEditError("화면 설정을 저장하지 못했습니다. 제목, 영상 파일명과 반복 횟수를 확인하세요.");
|
|
1859
|
+
}
|
|
1860
|
+
};
|
|
1861
|
+
const runDisplayDiagnostics = async () => {
|
|
1862
|
+
const targets = screens.filter((screen) => screen.kind === "scene" && screen.video);
|
|
1863
|
+
setVideoDiagnostics(targets.map((screen) => ({
|
|
1864
|
+
id: screen.id,
|
|
1865
|
+
title: screen.title,
|
|
1866
|
+
video: screen.video ?? "",
|
|
1867
|
+
status: "loading"
|
|
1868
|
+
})));
|
|
1869
|
+
await Promise.all(targets.map(async (screen) => {
|
|
1870
|
+
const dimensions = await probeVideoDimensions(`media://video/${screen.video}`);
|
|
1871
|
+
setVideoDiagnostics((current) => current.map(
|
|
1872
|
+
(entry) => entry.id === screen.id ? { ...entry, status: dimensions ? "ok" : "error", ...dimensions } : entry
|
|
1873
|
+
));
|
|
1874
|
+
}));
|
|
1875
|
+
};
|
|
1876
|
+
const openDisplayDiagnostics = () => {
|
|
1877
|
+
setDisplayModalOpen(true);
|
|
1878
|
+
setDisplayError("");
|
|
1879
|
+
void runDisplayDiagnostics();
|
|
1880
|
+
};
|
|
1881
|
+
const changeDisplayFit = async (mode) => {
|
|
1882
|
+
try {
|
|
1883
|
+
setDisplayError("");
|
|
1884
|
+
await updateDisplayFit(mode);
|
|
1885
|
+
} catch {
|
|
1886
|
+
setDisplayError("화면 표시 방식을 저장하지 못했습니다.");
|
|
1887
|
+
}
|
|
1888
|
+
};
|
|
1889
|
+
const changeAdminZoom = async (level) => {
|
|
1890
|
+
try {
|
|
1891
|
+
setAdminZoomError("");
|
|
1892
|
+
await updateAdminZoom(level);
|
|
1893
|
+
} catch {
|
|
1894
|
+
setAdminZoomError("UI 배율을 저장하지 못했습니다.");
|
|
1895
|
+
}
|
|
1896
|
+
};
|
|
1897
|
+
const adminZoomStyle = { zoom: adminZoom / 100 };
|
|
1796
1898
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1797
|
-
/* @__PURE__ */ jsx(
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
}
|
|
1807
|
-
),
|
|
1808
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
1809
|
-
/* @__PURE__ */ jsx("p", { className: "font-display text-2xl tracking-[0.24em] text-text", children: projectConfig.appName }),
|
|
1810
|
-
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs uppercase tracking-[0.25em] text-text-dim", children: projectConfig.appSubtitle })
|
|
1811
|
-
] })
|
|
1812
|
-
] }),
|
|
1813
|
-
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-stretch gap-3", children: [
|
|
1814
|
-
/* @__PURE__ */ jsxs(
|
|
1815
|
-
"button",
|
|
1816
|
-
{
|
|
1817
|
-
className: "rounded-xl border border-border-soft bg-surface px-4 py-3 text-left text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
1818
|
-
onClick: () => void openMediaModal(),
|
|
1819
|
-
type: "button",
|
|
1820
|
-
children: [
|
|
1821
|
-
/* @__PURE__ */ jsx("span", { className: "block text-[11px] uppercase tracking-[0.25em] text-text-dim", children: "리소스" }),
|
|
1822
|
-
/* @__PURE__ */ jsx("span", { className: "mt-2 block text-sm font-semibold text-text", children: "관리" }),
|
|
1823
|
-
/* @__PURE__ */ jsx("span", { className: "mt-1 block text-xs text-text-subtle", children: mediaLibrary ? `${mediaLibrary.assets.length}개 파일` : "외부 파일" })
|
|
1824
|
-
]
|
|
1825
|
-
}
|
|
1826
|
-
),
|
|
1827
|
-
/* @__PURE__ */ jsxs(
|
|
1828
|
-
"button",
|
|
1829
|
-
{
|
|
1830
|
-
className: "rounded-xl border border-border-soft bg-surface px-4 py-3 text-left text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
1831
|
-
onClick: () => setArduinoFirmwareOpen(true),
|
|
1832
|
-
type: "button",
|
|
1833
|
-
children: [
|
|
1834
|
-
/* @__PURE__ */ jsx("span", { className: "block text-[11px] uppercase tracking-[0.25em] text-text-dim", children: "아두이노" }),
|
|
1835
|
-
/* @__PURE__ */ jsx("span", { className: "mt-2 block text-sm font-semibold text-text", children: "업로드" }),
|
|
1836
|
-
/* @__PURE__ */ jsx("span", { className: "mt-1 block text-xs text-text-subtle", children: arduinoPhaseLabel[arduinoBuild.status.phase] })
|
|
1837
|
-
]
|
|
1838
|
-
}
|
|
1839
|
-
),
|
|
1840
|
-
/* @__PURE__ */ jsxs(
|
|
1841
|
-
"button",
|
|
1842
|
-
{
|
|
1843
|
-
className: "rounded-xl border border-border-soft bg-surface px-4 py-3 text-left text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
1844
|
-
onClick: () => setBenchmarkModalOpen(true),
|
|
1845
|
-
type: "button",
|
|
1846
|
-
children: [
|
|
1847
|
-
/* @__PURE__ */ jsx("span", { className: "block text-[11px] uppercase tracking-[0.25em] text-text-dim", children: "성능" }),
|
|
1848
|
-
/* @__PURE__ */ jsx("span", { className: "mt-2 block text-sm font-semibold text-text", children: "체크" }),
|
|
1849
|
-
/* @__PURE__ */ jsx("span", { className: "mt-1 block text-xs text-text-subtle", children: benchmarkRunning ? "측정 중" : benchmarkResults.length > 0 ? "결과 보기" : "벤치마크" })
|
|
1850
|
-
]
|
|
1851
|
-
}
|
|
1852
|
-
),
|
|
1853
|
-
/* @__PURE__ */ jsxs(
|
|
1854
|
-
"button",
|
|
1855
|
-
{
|
|
1856
|
-
className: "rounded-xl border border-border-soft bg-surface px-4 py-3 text-left text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
1857
|
-
onClick: () => setShortcutGuideOpen(true),
|
|
1858
|
-
type: "button",
|
|
1859
|
-
children: [
|
|
1860
|
-
/* @__PURE__ */ jsx("span", { className: "block text-[11px] uppercase tracking-[0.25em] text-text-dim", children: "단축키" }),
|
|
1861
|
-
/* @__PURE__ */ jsx("span", { className: "mt-2 block text-sm font-semibold text-text", children: "가이드" }),
|
|
1862
|
-
/* @__PURE__ */ jsx("span", { className: "mt-1 block text-xs text-text-subtle", children: "전역 단축키 보기" })
|
|
1863
|
-
]
|
|
1864
|
-
}
|
|
1865
|
-
),
|
|
1866
|
-
/* @__PURE__ */ jsxs("div", { className: "inline-block shrink-0 rounded-xl border border-border-soft bg-surface px-4 py-3", children: [
|
|
1867
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
1868
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
1869
|
-
/* @__PURE__ */ jsx("p", { className: "text-[11px] uppercase tracking-[0.25em] text-text-dim", children: "실행 모드" }),
|
|
1870
|
-
/* @__PURE__ */ jsx("p", { className: "mt-2 text-sm font-semibold text-text", children: getWindowModeLabel(windowMode) }),
|
|
1871
|
-
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-text-subtle", children: "키오스크 OFF 시 창모드로 돌아갑니다." })
|
|
1872
|
-
] }),
|
|
1899
|
+
/* @__PURE__ */ jsx(
|
|
1900
|
+
"main",
|
|
1901
|
+
{
|
|
1902
|
+
className: "h-screen overflow-auto bg-[linear-gradient(180deg,#141414_0%,#FFFFFF05_52%,#1d1d1d_100%)] text-text",
|
|
1903
|
+
"data-testid": "admin-screen-root",
|
|
1904
|
+
style: adminZoomStyle,
|
|
1905
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex h-full min-h-0 flex-col px-4 py-4", children: [
|
|
1906
|
+
/* @__PURE__ */ jsx("header", { className: "rounded-xl px-5 py-4 backdrop-blur", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-4", children: [
|
|
1907
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
1873
1908
|
/* @__PURE__ */ jsx(
|
|
1909
|
+
"img",
|
|
1910
|
+
{
|
|
1911
|
+
alt: projectConfig.appIconAlt,
|
|
1912
|
+
className: "h-12 w-12 rounded-lg border border-border-soft bg-surface-soft p-2",
|
|
1913
|
+
src: appIconUrl
|
|
1914
|
+
}
|
|
1915
|
+
),
|
|
1916
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1917
|
+
/* @__PURE__ */ jsx("p", { className: "font-display text-2xl tracking-[0.24em] text-text", children: projectConfig.appName }),
|
|
1918
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs uppercase tracking-[0.25em] text-text-dim", children: projectConfig.appSubtitle })
|
|
1919
|
+
] })
|
|
1920
|
+
] }),
|
|
1921
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-stretch justify-end gap-3", children: [
|
|
1922
|
+
/* @__PURE__ */ jsxs(
|
|
1874
1923
|
"button",
|
|
1875
1924
|
{
|
|
1876
|
-
className:
|
|
1877
|
-
|
|
1878
|
-
onClick: () => void toggleKioskMode(),
|
|
1925
|
+
className: "rounded-xl border border-border-soft bg-surface px-4 py-3 text-left text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
1926
|
+
onClick: () => void openMediaModal(),
|
|
1879
1927
|
type: "button",
|
|
1880
|
-
children:
|
|
1928
|
+
children: [
|
|
1929
|
+
/* @__PURE__ */ jsx("span", { className: "block text-[11px] uppercase tracking-[0.25em] text-text-dim", children: "리소스" }),
|
|
1930
|
+
/* @__PURE__ */ jsx("span", { className: "mt-2 block text-sm font-semibold text-text", children: "관리" }),
|
|
1931
|
+
/* @__PURE__ */ jsx("span", { className: "mt-1 block text-xs text-text-subtle", children: mediaLibrary ? `${mediaLibrary.assets.length}개 파일` : "외부 파일" })
|
|
1932
|
+
]
|
|
1881
1933
|
}
|
|
1882
|
-
)
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
windowModeError ? /* @__PURE__ */ jsx("p", { className: "mt-3 text-xs text-log-error-label-text", children: windowModeError }) : null
|
|
1886
|
-
] }),
|
|
1887
|
-
/* @__PURE__ */ jsx(
|
|
1888
|
-
"button",
|
|
1889
|
-
{
|
|
1890
|
-
"aria-label": "프로그램 종료",
|
|
1891
|
-
className: "inline-flex h-14 w-14 shrink-0 items-center justify-center rounded-xl border border-transparent bg-transparent text-log-error-label-text transition hover:bg-white/5",
|
|
1892
|
-
onClick: () => void quitApp(),
|
|
1893
|
-
type: "button",
|
|
1894
|
-
title: "프로그램 종료",
|
|
1895
|
-
children: /* @__PURE__ */ jsxs(
|
|
1896
|
-
"svg",
|
|
1934
|
+
),
|
|
1935
|
+
/* @__PURE__ */ jsxs(
|
|
1936
|
+
"button",
|
|
1897
1937
|
{
|
|
1898
|
-
"
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
stroke: "currentColor",
|
|
1902
|
-
strokeLinecap: "round",
|
|
1903
|
-
strokeLinejoin: "round",
|
|
1904
|
-
strokeWidth: "2",
|
|
1905
|
-
viewBox: "0 0 24 24",
|
|
1938
|
+
className: "rounded-xl border border-border-soft bg-surface px-4 py-3 text-left text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
1939
|
+
onClick: openDisplayDiagnostics,
|
|
1940
|
+
type: "button",
|
|
1906
1941
|
children: [
|
|
1907
|
-
/* @__PURE__ */ jsx("
|
|
1908
|
-
/* @__PURE__ */ jsx("
|
|
1942
|
+
/* @__PURE__ */ jsx("span", { className: "block text-[11px] uppercase tracking-[0.25em] text-text-dim", children: "화면" }),
|
|
1943
|
+
/* @__PURE__ */ jsx("span", { className: "mt-2 block text-sm font-semibold text-text", children: "진단" }),
|
|
1944
|
+
/* @__PURE__ */ jsx("span", { className: "mt-1 block text-xs text-text-subtle", children: displayFit === "fill" ? "꽉 채우기" : "비율 유지" })
|
|
1909
1945
|
]
|
|
1910
1946
|
}
|
|
1911
|
-
)
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
] }) }),
|
|
1916
|
-
/* @__PURE__ */ jsx("section", { className: "mt-4 flex min-h-0 flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "grid min-h-0 flex-1 auto-rows-fr gap-4 overflow-hidden lg:grid-cols-[1.2fr_0.8fr]", children: [
|
|
1917
|
-
/* @__PURE__ */ jsxs("article", { className: "flex h-full min-h-0 flex-col overflow-hidden rounded-xl border border-border bg-surface p-5 shadow-2xl backdrop-blur", children: [
|
|
1918
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-start justify-between gap-4", children: /* @__PURE__ */ jsxs("div", { children: [
|
|
1919
|
-
/* @__PURE__ */ jsx("h1", { className: "font-display text-2xl text-white", children: "디바이스 연결" }),
|
|
1920
|
-
/* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-text-muted", children: "시리얼 포트를 선택하고 연결/연결 해제 및 메시지 로그를 확인합니다." })
|
|
1921
|
-
] }) }),
|
|
1922
|
-
/* @__PURE__ */ jsxs("div", { className: "mt-4 grid min-h-0 flex-1 gap-4 xl:grid-cols-[0.82fr_1.18fr]", children: [
|
|
1923
|
-
/* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-col gap-3", children: [
|
|
1924
|
-
/* @__PURE__ */ jsxs("div", { className: "min-h-0 flex-1", children: [
|
|
1925
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
1926
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.25em] text-text-subtle", children: "포트 목록" }),
|
|
1927
|
-
/* @__PURE__ */ jsx(
|
|
1928
|
-
"button",
|
|
1929
|
-
{
|
|
1930
|
-
"aria-label": "포트 새로고침",
|
|
1931
|
-
className: "inline-flex h-8 w-8 items-center justify-center rounded-lg border border-border text-sm text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
1932
|
-
onClick: () => void bootstrap(),
|
|
1933
|
-
type: "button",
|
|
1934
|
-
title: "포트 새로고침",
|
|
1935
|
-
children: "↻"
|
|
1936
|
-
}
|
|
1937
|
-
)
|
|
1938
|
-
] }),
|
|
1939
|
-
/* @__PURE__ */ jsx("div", { className: "grid h-[420px] gap-2 overflow-auto pr-1", children: ports.length === 0 ? /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-dashed border-border px-4 py-5 text-sm text-text-muted", children: "감지된 COM 포트가 없습니다. 장치를 연결한 뒤 새로고침하세요." }) : ports.map((port) => /* @__PURE__ */ jsxs(
|
|
1947
|
+
),
|
|
1948
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-border-soft bg-surface px-3 py-3 text-xs text-text", children: [
|
|
1949
|
+
/* @__PURE__ */ jsx("span", { className: "block text-[11px] uppercase tracking-[0.25em] text-text-dim", children: "UI 배율" }),
|
|
1950
|
+
/* @__PURE__ */ jsx("div", { className: "mt-2 flex gap-1", children: ADMIN_ZOOM_LEVELS.map((level) => /* @__PURE__ */ jsxs(
|
|
1940
1951
|
"button",
|
|
1941
1952
|
{
|
|
1942
|
-
|
|
1943
|
-
|
|
1953
|
+
"aria-pressed": adminZoom === level,
|
|
1954
|
+
className: `rounded-md px-2 py-1 ${adminZoom === level ? "bg-button-primary-bg text-button-primary-text" : "border border-border"}`,
|
|
1955
|
+
onClick: () => void changeAdminZoom(level),
|
|
1944
1956
|
type: "button",
|
|
1945
1957
|
children: [
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
/* @__PURE__ */ jsx("span", { className: "mt-1 block text-sm text-text-muted", children: port.manufacturer ?? "알 수 없는 디바이스" })
|
|
1949
|
-
] }),
|
|
1950
|
-
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
1951
|
-
/* @__PURE__ */ jsx(
|
|
1952
|
-
"span",
|
|
1953
|
-
{
|
|
1954
|
-
"aria-hidden": "true",
|
|
1955
|
-
className: `text-lg leading-none ${port.path === deviceState.selectedPortPath ? statusIconTone[deviceState.status] : "text-text-dim"}`,
|
|
1956
|
-
children: port.path === deviceState.selectedPortPath ? statusIcon[deviceState.status] : "○"
|
|
1957
|
-
}
|
|
1958
|
-
),
|
|
1959
|
-
/* @__PURE__ */ jsx(
|
|
1960
|
-
"span",
|
|
1961
|
-
{
|
|
1962
|
-
className: `text-xs uppercase tracking-[0.25em] ${port.path === deviceState.selectedPortPath ? statusIconTone[deviceState.status] : "text-text-dim"}`,
|
|
1963
|
-
children: port.path === deviceState.selectedPortPath ? statusLabel[deviceState.status] : "대기"
|
|
1964
|
-
}
|
|
1965
|
-
)
|
|
1966
|
-
] })
|
|
1958
|
+
level,
|
|
1959
|
+
"%"
|
|
1967
1960
|
]
|
|
1968
1961
|
},
|
|
1969
|
-
|
|
1970
|
-
)) })
|
|
1962
|
+
level
|
|
1963
|
+
)) }),
|
|
1964
|
+
adminZoomError ? /* @__PURE__ */ jsx("p", { className: "mt-2 text-xs text-log-error-label-text", role: "alert", children: adminZoomError }) : null
|
|
1971
1965
|
] }),
|
|
1972
|
-
/* @__PURE__ */ jsxs(
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
1966
|
+
/* @__PURE__ */ jsxs(
|
|
1967
|
+
"button",
|
|
1968
|
+
{
|
|
1969
|
+
className: "rounded-xl border border-border-soft bg-surface px-4 py-3 text-left text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
1970
|
+
onClick: () => setArduinoFirmwareOpen(true),
|
|
1971
|
+
type: "button",
|
|
1972
|
+
children: [
|
|
1973
|
+
/* @__PURE__ */ jsx("span", { className: "block text-[11px] uppercase tracking-[0.25em] text-text-dim", children: "아두이노" }),
|
|
1974
|
+
/* @__PURE__ */ jsx("span", { className: "mt-2 block text-sm font-semibold text-text", children: "업로드" }),
|
|
1975
|
+
/* @__PURE__ */ jsx("span", { className: "mt-1 block text-xs text-text-subtle", children: arduinoPhaseLabel[arduinoBuild.status.phase] })
|
|
1976
|
+
]
|
|
1977
|
+
}
|
|
1978
|
+
),
|
|
1979
|
+
/* @__PURE__ */ jsxs(
|
|
1980
|
+
"button",
|
|
1981
|
+
{
|
|
1982
|
+
className: "rounded-xl border border-border-soft bg-surface px-4 py-3 text-left text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
1983
|
+
onClick: () => setBenchmarkModalOpen(true),
|
|
1984
|
+
type: "button",
|
|
1985
|
+
children: [
|
|
1986
|
+
/* @__PURE__ */ jsx("span", { className: "block text-[11px] uppercase tracking-[0.25em] text-text-dim", children: "성능" }),
|
|
1987
|
+
/* @__PURE__ */ jsx("span", { className: "mt-2 block text-sm font-semibold text-text", children: "체크" }),
|
|
1988
|
+
/* @__PURE__ */ jsx("span", { className: "mt-1 block text-xs text-text-subtle", children: benchmarkRunning ? "측정 중" : benchmarkResults.length > 0 ? "결과 보기" : "벤치마크" })
|
|
1989
|
+
]
|
|
1990
|
+
}
|
|
1991
|
+
),
|
|
1992
|
+
/* @__PURE__ */ jsxs(
|
|
1993
|
+
"button",
|
|
1994
|
+
{
|
|
1995
|
+
className: "rounded-xl border border-border-soft bg-surface px-4 py-3 text-left text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
1996
|
+
onClick: () => setShortcutGuideOpen(true),
|
|
1997
|
+
type: "button",
|
|
1998
|
+
children: [
|
|
1999
|
+
/* @__PURE__ */ jsx("span", { className: "block text-[11px] uppercase tracking-[0.25em] text-text-dim", children: "단축키" }),
|
|
2000
|
+
/* @__PURE__ */ jsx("span", { className: "mt-2 block text-sm font-semibold text-text", children: "가이드" }),
|
|
2001
|
+
/* @__PURE__ */ jsx("span", { className: "mt-1 block text-xs text-text-subtle", children: "전역 단축키 보기" })
|
|
2002
|
+
]
|
|
2003
|
+
}
|
|
2004
|
+
),
|
|
2005
|
+
/* @__PURE__ */ jsxs("div", { className: "inline-block shrink-0 rounded-xl border border-border-soft bg-surface px-4 py-3", children: [
|
|
2006
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
2007
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2008
|
+
/* @__PURE__ */ jsx("p", { className: "text-[11px] uppercase tracking-[0.25em] text-text-dim", children: "실행 모드" }),
|
|
2009
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2 text-sm font-semibold text-text", children: getWindowModeLabel(windowMode) }),
|
|
2010
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-text-subtle", children: "키오스크 OFF 시 창모드로 돌아갑니다." })
|
|
2011
|
+
] }),
|
|
2009
2012
|
/* @__PURE__ */ jsx(
|
|
2010
2013
|
"button",
|
|
2011
2014
|
{
|
|
2012
|
-
className:
|
|
2013
|
-
|
|
2015
|
+
className: `rounded-lg px-3 py-2 text-xs font-semibold transition ${windowMode === "kiosk" ? "bg-button-primary-bg text-button-primary-text hover:bg-button-primary-hover" : "border border-border text-text hover:border-border-strong hover:bg-surface-hover"} disabled:cursor-not-allowed disabled:opacity-60`,
|
|
2016
|
+
disabled: loading || windowModeLocked,
|
|
2017
|
+
onClick: () => void toggleKioskMode(),
|
|
2014
2018
|
type: "button",
|
|
2015
|
-
children: "
|
|
2019
|
+
children: windowMode === "kiosk" ? "키오스크 끄기" : "키오스크 켜기"
|
|
2016
2020
|
}
|
|
2017
|
-
)
|
|
2018
|
-
|
|
2019
|
-
|
|
2021
|
+
)
|
|
2022
|
+
] }),
|
|
2023
|
+
windowModeLocked ? /* @__PURE__ */ jsx("p", { className: "mt-3 text-xs text-log-error-label-text", children: "환경변수로 키오스크 모드가 강제되어 관리자 화면에서 변경할 수 없습니다." }) : null,
|
|
2024
|
+
windowModeError ? /* @__PURE__ */ jsx("p", { className: "mt-3 text-xs text-log-error-label-text", children: windowModeError }) : null
|
|
2020
2025
|
] }),
|
|
2021
|
-
/* @__PURE__ */ jsx(
|
|
2022
|
-
const origin = entry.origin ?? (entry.direction === "out" ? "out" : entry.direction === "system" ? "system" : "in");
|
|
2023
|
-
return /* @__PURE__ */ jsxs(
|
|
2024
|
-
"div",
|
|
2025
|
-
{
|
|
2026
|
-
className: `w-full max-w-[84%] rounded-lg px-3 py-3 ${logTone[entry.direction]} ${logLayoutTone[origin]}`,
|
|
2027
|
-
children: [
|
|
2028
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
2029
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2030
|
-
/* @__PURE__ */ jsx(
|
|
2031
|
-
"span",
|
|
2032
|
-
{
|
|
2033
|
-
className: `rounded-md px-2 py-1 text-xs uppercase tracking-[0.25em] ${logLabelTone[entry.direction]}`,
|
|
2034
|
-
children: logLabelByOrigin[origin]
|
|
2035
|
-
}
|
|
2036
|
-
),
|
|
2037
|
-
entry.direction === "error" ? /* @__PURE__ */ jsx("span", { className: errorTextTone, children: "ERROR" }) : null
|
|
2038
|
-
] }),
|
|
2039
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs text-text-subtle", children: formatLocalDateTime(entry.createdAt) })
|
|
2040
|
-
] }),
|
|
2041
|
-
/* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-text", children: translateLog(entry.raw) }),
|
|
2042
|
-
/* @__PURE__ */ jsx("p", { className: "mt-1 break-all text-xs text-text-subtle", children: entry.raw })
|
|
2043
|
-
]
|
|
2044
|
-
},
|
|
2045
|
-
entry.id
|
|
2046
|
-
);
|
|
2047
|
-
}) })
|
|
2048
|
-
] }) })
|
|
2049
|
-
] })
|
|
2050
|
-
] }),
|
|
2051
|
-
/* @__PURE__ */ jsxs("article", { className: "flex h-full min-h-0 flex-col overflow-hidden rounded-xl border border-border bg-surface p-5 shadow-2xl backdrop-blur", children: [
|
|
2052
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
2053
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2054
|
-
/* @__PURE__ */ jsx("h2", { className: "font-display text-2xl text-text", children: "화면 전환" }),
|
|
2055
|
-
/* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-text-muted", children: "화면 레지스트리에 등록된 화면을 선택하여 현재 화면을 전환합니다." })
|
|
2056
|
-
] }),
|
|
2057
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2058
|
-
shortcutEditMode ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2059
|
-
/* @__PURE__ */ jsx(
|
|
2060
|
-
"button",
|
|
2061
|
-
{
|
|
2062
|
-
className: "whitespace-nowrap rounded-lg border border-border px-3 py-2 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2063
|
-
disabled: loading,
|
|
2064
|
-
onClick: cancelShortcutEditMode,
|
|
2065
|
-
type: "button",
|
|
2066
|
-
children: "취소"
|
|
2067
|
-
}
|
|
2068
|
-
),
|
|
2069
|
-
/* @__PURE__ */ jsx(
|
|
2070
|
-
"button",
|
|
2071
|
-
{
|
|
2072
|
-
className: "whitespace-nowrap rounded-lg bg-button-primary-bg px-3 py-2 text-xs font-semibold text-button-primary-text transition hover:bg-button-primary-hover disabled:cursor-not-allowed disabled:opacity-60",
|
|
2073
|
-
disabled: loading,
|
|
2074
|
-
onClick: () => void saveShortcutDrafts(),
|
|
2075
|
-
type: "button",
|
|
2076
|
-
children: "저장"
|
|
2077
|
-
}
|
|
2078
|
-
)
|
|
2079
|
-
] }) : /* @__PURE__ */ jsx(
|
|
2026
|
+
/* @__PURE__ */ jsx(
|
|
2080
2027
|
"button",
|
|
2081
2028
|
{
|
|
2082
|
-
|
|
2083
|
-
|
|
2029
|
+
"aria-label": "프로그램 종료",
|
|
2030
|
+
className: "inline-flex h-14 w-14 shrink-0 items-center justify-center rounded-xl border border-transparent bg-transparent text-log-error-label-text transition hover:bg-white/5",
|
|
2031
|
+
onClick: () => void quitApp(),
|
|
2084
2032
|
type: "button",
|
|
2085
|
-
|
|
2033
|
+
title: "프로그램 종료",
|
|
2034
|
+
children: /* @__PURE__ */ jsxs(
|
|
2035
|
+
"svg",
|
|
2036
|
+
{
|
|
2037
|
+
"aria-hidden": "true",
|
|
2038
|
+
className: "h-5 w-5",
|
|
2039
|
+
fill: "none",
|
|
2040
|
+
stroke: "currentColor",
|
|
2041
|
+
strokeLinecap: "round",
|
|
2042
|
+
strokeLinejoin: "round",
|
|
2043
|
+
strokeWidth: "2",
|
|
2044
|
+
viewBox: "0 0 24 24",
|
|
2045
|
+
children: [
|
|
2046
|
+
/* @__PURE__ */ jsx("path", { d: "M12 2v10" }),
|
|
2047
|
+
/* @__PURE__ */ jsx("path", { d: "M18.36 6.64a9 9 0 1 1-12.72 0" })
|
|
2048
|
+
]
|
|
2049
|
+
}
|
|
2050
|
+
)
|
|
2086
2051
|
}
|
|
2087
|
-
)
|
|
2088
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-border-soft bg-surface-soft px-4 py-2 text-sm text-text-muted", children: [
|
|
2089
|
-
"현재 화면: ",
|
|
2090
|
-
gameState.currentStepId ?? "없음"
|
|
2091
|
-
] })
|
|
2052
|
+
)
|
|
2092
2053
|
] })
|
|
2093
|
-
] }),
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
className: `rounded-lg border px-4 py-3 text-left transition ${selected ? "border-border-strong bg-surface-selected" : "border-border-soft bg-surface-subtle"}`,
|
|
2106
|
-
children: [
|
|
2107
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-start gap-4", children: [
|
|
2108
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2109
|
-
/* @__PURE__ */ jsx("p", { className: "font-semibold text-text", children: availableScreen.title }),
|
|
2110
|
-
/* @__PURE__ */ jsx("p", { className: "mt-0.5 text-sm text-text-muted", children: availableScreen.id }),
|
|
2111
|
-
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs uppercase tracking-[0.2em] text-text-subtle", children: availableScreen.kind }),
|
|
2112
|
-
shortcuts.filter(
|
|
2113
|
-
(shortcut) => shortcut.target === availableScreen.id
|
|
2114
|
-
).length > 0 ? /* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: shortcuts.filter((shortcut) => shortcut.target === availableScreen.id).map((shortcut) => /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(ShortcutKeyChips, { accelerator: shortcut.accelerator }) }, `${availableScreen.id}-${shortcut.accelerator}`)) }) : null
|
|
2115
|
-
] }),
|
|
2116
|
-
/* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
2117
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs uppercase tracking-[0.25em] text-text-subtle", children: selected ? "현재" : "대기" }),
|
|
2054
|
+
] }) }),
|
|
2055
|
+
/* @__PURE__ */ jsx("section", { className: "mt-4 flex min-h-0 flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "grid min-h-0 flex-1 auto-rows-fr gap-4 overflow-hidden lg:grid-cols-[1.2fr_0.8fr]", children: [
|
|
2056
|
+
/* @__PURE__ */ jsxs("article", { className: "flex h-full min-h-0 flex-col overflow-hidden rounded-xl border border-border bg-surface p-5 shadow-2xl backdrop-blur", children: [
|
|
2057
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-start justify-between gap-4", children: /* @__PURE__ */ jsxs("div", { children: [
|
|
2058
|
+
/* @__PURE__ */ jsx("h1", { className: "font-display text-2xl text-white", children: "디바이스 연결" }),
|
|
2059
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-text-muted", children: "시리얼 포트를 선택하고 연결/연결 해제 및 메시지 로그를 확인합니다." })
|
|
2060
|
+
] }) }),
|
|
2061
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 grid min-h-0 flex-1 gap-4 xl:grid-cols-[0.82fr_1.18fr]", children: [
|
|
2062
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-col gap-3", children: [
|
|
2063
|
+
/* @__PURE__ */ jsxs("div", { className: "min-h-0 flex-1", children: [
|
|
2064
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
2065
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.25em] text-text-subtle", children: "포트 목록" }),
|
|
2118
2066
|
/* @__PURE__ */ jsx(
|
|
2119
2067
|
"button",
|
|
2120
2068
|
{
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
onClick: () =>
|
|
2124
|
-
if (screenDefinitions.some(
|
|
2125
|
-
(screen) => screen.id === availableScreen.id
|
|
2126
|
-
)) {
|
|
2127
|
-
void moveToScreen(availableScreen.id);
|
|
2128
|
-
}
|
|
2129
|
-
},
|
|
2069
|
+
"aria-label": "포트 새로고침",
|
|
2070
|
+
className: "inline-flex h-8 w-8 items-center justify-center rounded-lg border border-border text-sm text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2071
|
+
onClick: () => void bootstrap(),
|
|
2130
2072
|
type: "button",
|
|
2131
|
-
|
|
2073
|
+
title: "포트 새로고침",
|
|
2074
|
+
children: "↻"
|
|
2132
2075
|
}
|
|
2133
2076
|
)
|
|
2077
|
+
] }),
|
|
2078
|
+
/* @__PURE__ */ jsx("div", { className: "grid h-[420px] gap-2 overflow-auto pr-1", children: ports.length === 0 ? /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-dashed border-border px-4 py-5 text-sm text-text-muted", children: "감지된 COM 포트가 없습니다. 장치를 연결한 뒤 새로고침하세요." }) : ports.map((port) => /* @__PURE__ */ jsxs(
|
|
2079
|
+
"button",
|
|
2080
|
+
{
|
|
2081
|
+
className: `flex items-center justify-between rounded-lg border px-4 py-4 text-left transition ${port.path === deviceState.selectedPortPath ? "border-border-strong bg-surface-selected" : "border-border-soft bg-surface-subtle hover:border-border hover:bg-surface-hover"}`,
|
|
2082
|
+
onClick: () => void connect(port.path),
|
|
2083
|
+
type: "button",
|
|
2084
|
+
children: [
|
|
2085
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
2086
|
+
/* @__PURE__ */ jsx("span", { className: "block font-semibold text-text", children: port.path }),
|
|
2087
|
+
/* @__PURE__ */ jsx("span", { className: "mt-1 block text-sm text-text-muted", children: port.manufacturer ?? "알 수 없는 디바이스" })
|
|
2088
|
+
] }),
|
|
2089
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
2090
|
+
/* @__PURE__ */ jsx(
|
|
2091
|
+
"span",
|
|
2092
|
+
{
|
|
2093
|
+
"aria-hidden": "true",
|
|
2094
|
+
className: `text-lg leading-none ${port.path === deviceState.selectedPortPath ? statusIconTone[deviceState.status] : "text-text-dim"}`,
|
|
2095
|
+
children: port.path === deviceState.selectedPortPath ? statusIcon[deviceState.status] : "○"
|
|
2096
|
+
}
|
|
2097
|
+
),
|
|
2098
|
+
/* @__PURE__ */ jsx(
|
|
2099
|
+
"span",
|
|
2100
|
+
{
|
|
2101
|
+
className: `text-xs uppercase tracking-[0.25em] ${port.path === deviceState.selectedPortPath ? statusIconTone[deviceState.status] : "text-text-dim"}`,
|
|
2102
|
+
children: port.path === deviceState.selectedPortPath ? statusLabel[deviceState.status] : "대기"
|
|
2103
|
+
}
|
|
2104
|
+
)
|
|
2105
|
+
] })
|
|
2106
|
+
]
|
|
2107
|
+
},
|
|
2108
|
+
port.path
|
|
2109
|
+
)) })
|
|
2110
|
+
] }),
|
|
2111
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-3 lg:grid-cols-[1.15fr_0.85fr]", children: [
|
|
2112
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-border-soft bg-surface-soft p-4", children: [
|
|
2113
|
+
/* @__PURE__ */ jsx("dt", { className: "text-xs uppercase tracking-[0.25em] text-text-subtle", children: "선택된 포트" }),
|
|
2114
|
+
/* @__PURE__ */ jsx("dd", { className: "mt-2 break-all text-sm text-text", children: deviceState.selectedPortPath ?? "선택되지 않음" })
|
|
2115
|
+
] }),
|
|
2116
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-border-soft bg-surface-soft p-4", children: [
|
|
2117
|
+
/* @__PURE__ */ jsx("dt", { className: "text-xs uppercase tracking-[0.25em] text-text-subtle", children: "마지막 핸드셰이크" }),
|
|
2118
|
+
/* @__PURE__ */ jsx("dd", { className: "mt-2 break-all text-sm text-text", children: formatLocalDateTime(deviceState.lastHandshakeAt) })
|
|
2134
2119
|
] })
|
|
2135
2120
|
] }),
|
|
2136
|
-
|
|
2137
|
-
/* @__PURE__ */ jsx(
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2121
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-2 sm:grid-cols-2", children: [
|
|
2122
|
+
/* @__PURE__ */ jsx(
|
|
2123
|
+
"button",
|
|
2124
|
+
{
|
|
2125
|
+
className: "rounded-lg bg-button-primary-bg px-4 py-2.5 text-sm font-semibold text-button-primary-text transition hover:bg-button-primary-hover disabled:cursor-not-allowed disabled:opacity-60",
|
|
2126
|
+
disabled: loading,
|
|
2127
|
+
onClick: () => void connect(deviceState.selectedPortPath),
|
|
2128
|
+
type: "button",
|
|
2129
|
+
children: "연결"
|
|
2130
|
+
}
|
|
2131
|
+
),
|
|
2132
|
+
/* @__PURE__ */ jsx(
|
|
2133
|
+
"button",
|
|
2134
|
+
{
|
|
2135
|
+
className: "rounded-lg border border-border px-4 py-2.5 text-sm font-semibold text-text transition hover:border-border-strong hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-60",
|
|
2136
|
+
disabled: loading,
|
|
2137
|
+
onClick: () => void disconnect(),
|
|
2138
|
+
type: "button",
|
|
2139
|
+
children: "연결 해제"
|
|
2140
|
+
}
|
|
2141
|
+
)
|
|
2142
|
+
] })
|
|
2143
|
+
] }),
|
|
2144
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-h-0 flex-col gap-3", children: /* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-1 flex-col rounded-lg border border-border-soft bg-surface-strong p-4", children: [
|
|
2145
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex shrink-0 items-center justify-between", children: [
|
|
2146
|
+
/* @__PURE__ */ jsx("h2", { className: "font-display text-lg text-text", children: "메시지 로그" }),
|
|
2147
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2143
2148
|
/* @__PURE__ */ jsx(
|
|
2144
|
-
"
|
|
2149
|
+
"button",
|
|
2145
2150
|
{
|
|
2146
|
-
className: "rounded-lg border border-border
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
if (event.key === "Backspace" || event.key === "Delete") {
|
|
2151
|
-
updateShortcutDraft(availableScreen.id, "");
|
|
2152
|
-
return;
|
|
2153
|
-
}
|
|
2154
|
-
const shortcut = formatShortcutFromKeyboardEvent(event);
|
|
2155
|
-
if (!shortcut) {
|
|
2156
|
-
return;
|
|
2157
|
-
}
|
|
2158
|
-
updateShortcutDraft(availableScreen.id, shortcut);
|
|
2159
|
-
},
|
|
2160
|
-
placeholder: "키를 누르세요",
|
|
2161
|
-
type: "text",
|
|
2162
|
-
value: shortcutDrafts[availableScreen.id] ?? ""
|
|
2151
|
+
className: "rounded-lg border border-border px-3 py-1.5 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2152
|
+
onClick: () => void openArchiveModal(),
|
|
2153
|
+
type: "button",
|
|
2154
|
+
children: "이전 기록 보기"
|
|
2163
2155
|
}
|
|
2164
|
-
)
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2156
|
+
),
|
|
2157
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-text-subtle", children: "최신 50개" })
|
|
2158
|
+
] })
|
|
2159
|
+
] }),
|
|
2160
|
+
/* @__PURE__ */ jsx("div", { className: "grid min-h-0 flex-1 content-start gap-2 overflow-auto pr-0", children: deviceState.messageLog.length === 0 ? /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-dashed border-border-soft px-4 py-6 text-sm text-text-subtle", children: "아직 기록된 로그가 없습니다." }) : deviceState.messageLog.map((entry) => {
|
|
2161
|
+
const origin = entry.origin ?? (entry.direction === "out" ? "out" : entry.direction === "system" ? "system" : "in");
|
|
2162
|
+
return /* @__PURE__ */ jsxs(
|
|
2163
|
+
"div",
|
|
2164
|
+
{
|
|
2165
|
+
className: `w-full max-w-[84%] rounded-lg px-3 py-3 ${logTone[entry.direction]} ${logLayoutTone[origin]}`,
|
|
2166
|
+
children: [
|
|
2167
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
2168
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2169
|
+
/* @__PURE__ */ jsx(
|
|
2170
|
+
"span",
|
|
2171
|
+
{
|
|
2172
|
+
className: `rounded-md px-2 py-1 text-xs uppercase tracking-[0.25em] ${logLabelTone[entry.direction]}`,
|
|
2173
|
+
children: logLabelByOrigin[origin]
|
|
2174
|
+
}
|
|
2175
|
+
),
|
|
2176
|
+
entry.direction === "error" ? /* @__PURE__ */ jsx("span", { className: errorTextTone, children: "ERROR" }) : null
|
|
2177
|
+
] }),
|
|
2178
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-text-subtle", children: formatLocalDateTime(entry.createdAt) })
|
|
2179
|
+
] }),
|
|
2180
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-text", children: translateLog(entry.raw) }),
|
|
2181
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 break-all text-xs text-text-subtle", children: entry.raw })
|
|
2182
|
+
]
|
|
2183
|
+
},
|
|
2184
|
+
entry.id
|
|
2185
|
+
);
|
|
2186
|
+
}) })
|
|
2187
|
+
] }) })
|
|
2188
|
+
] })
|
|
2189
|
+
] }),
|
|
2190
|
+
/* @__PURE__ */ jsxs("article", { className: "flex h-full min-h-0 flex-col overflow-hidden rounded-xl border border-border bg-surface p-5 shadow-2xl backdrop-blur", children: [
|
|
2191
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
2192
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2193
|
+
/* @__PURE__ */ jsx("h2", { className: "font-display text-2xl text-text", children: "화면 전환" }),
|
|
2194
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-text-muted", children: "화면 레지스트리에 등록된 화면을 선택하여 현재 화면을 전환합니다." })
|
|
2195
|
+
] }),
|
|
2196
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2197
|
+
shortcutEditMode ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2198
|
+
/* @__PURE__ */ jsx(
|
|
2199
|
+
"button",
|
|
2200
|
+
{
|
|
2201
|
+
className: "whitespace-nowrap rounded-lg border border-border px-3 py-2 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2202
|
+
disabled: loading,
|
|
2203
|
+
onClick: cancelShortcutEditMode,
|
|
2204
|
+
type: "button",
|
|
2205
|
+
children: "취소"
|
|
2206
|
+
}
|
|
2207
|
+
),
|
|
2208
|
+
/* @__PURE__ */ jsx(
|
|
2209
|
+
"button",
|
|
2210
|
+
{
|
|
2211
|
+
className: "whitespace-nowrap rounded-lg bg-button-primary-bg px-3 py-2 text-xs font-semibold text-button-primary-text transition hover:bg-button-primary-hover disabled:cursor-not-allowed disabled:opacity-60",
|
|
2212
|
+
disabled: loading,
|
|
2213
|
+
onClick: () => void saveShortcutDrafts(),
|
|
2214
|
+
type: "button",
|
|
2215
|
+
children: "저장"
|
|
2216
|
+
}
|
|
2217
|
+
)
|
|
2218
|
+
] }) : /* @__PURE__ */ jsx(
|
|
2219
|
+
"button",
|
|
2220
|
+
{
|
|
2221
|
+
className: "whitespace-nowrap rounded-lg border border-border px-3 py-2 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2222
|
+
onClick: toggleShortcutEditMode,
|
|
2223
|
+
type: "button",
|
|
2224
|
+
children: "단축키 편집"
|
|
2225
|
+
}
|
|
2226
|
+
),
|
|
2227
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-border-soft bg-surface-soft px-4 py-2 text-sm text-text-muted", children: [
|
|
2228
|
+
"현재 화면: ",
|
|
2229
|
+
gameState.currentStepId ?? "없음"
|
|
2230
|
+
] })
|
|
2231
|
+
] })
|
|
2232
|
+
] }),
|
|
2233
|
+
shortcutEditMode && shortcutError ? /* @__PURE__ */ jsx("p", { className: "mt-3 text-sm text-log-error-label-text", children: shortcutError }) : null,
|
|
2234
|
+
shortcutEditMode && shortcutStatus ? /* @__PURE__ */ jsx("p", { className: "mt-3 text-sm text-aqua_signal", children: shortcutStatus }) : null,
|
|
2235
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 flex min-h-0 flex-1 flex-col gap-2 overflow-auto pr-1", children: registeredSceneScreens.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-dashed border-border-soft bg-surface-soft px-4 py-5 text-sm text-text-muted", children: [
|
|
2236
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-text", children: "등록된 scene 화면이 아직 없습니다." }),
|
|
2237
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2 leading-6", children: "먼저 `npm run generate:screen`을 실행하고 프롬프트에 따라 `id`, `title`, `kind`, `description`을 입력해 화면을 생성하세요. 생성 후 `src/screens`의 컴포넌트를 수정하면 이 패널에 자동으로 나타납니다." }),
|
|
2238
|
+
/* @__PURE__ */ jsx("p", { className: "mt-3 text-xs uppercase tracking-[0.2em] text-text-subtle", children: "guide: README - Screen Framework" })
|
|
2239
|
+
] }) : screens.map((availableScreen) => {
|
|
2240
|
+
const selected = gameState.currentStepId === availableScreen.id;
|
|
2241
|
+
return /* @__PURE__ */ jsxs(
|
|
2242
|
+
"div",
|
|
2180
2243
|
{
|
|
2181
|
-
className:
|
|
2182
|
-
onClick: (event) => event.stopPropagation(),
|
|
2244
|
+
className: `rounded-lg border px-4 py-3 text-left transition ${selected ? "border-border-strong bg-surface-selected" : "border-border-soft bg-surface-subtle"}`,
|
|
2183
2245
|
children: [
|
|
2184
|
-
/* @__PURE__ */
|
|
2246
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-start gap-4", children: [
|
|
2185
2247
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
2186
|
-
/* @__PURE__ */ jsx("p", { className: "
|
|
2187
|
-
/* @__PURE__ */ jsx("
|
|
2188
|
-
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-text-
|
|
2248
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-text", children: availableScreen.title }),
|
|
2249
|
+
/* @__PURE__ */ jsx("p", { className: "mt-0.5 text-sm text-text-muted", children: availableScreen.id }),
|
|
2250
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs uppercase tracking-[0.2em] text-text-subtle", children: availableScreen.kind }),
|
|
2251
|
+
shortcuts.filter(
|
|
2252
|
+
(shortcut) => shortcut.target === availableScreen.id
|
|
2253
|
+
).length > 0 ? /* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: shortcuts.filter((shortcut) => shortcut.target === availableScreen.id).map((shortcut) => /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(ShortcutKeyChips, { accelerator: shortcut.accelerator }) }, `${availableScreen.id}-${shortcut.accelerator}`)) }) : null
|
|
2254
|
+
] }),
|
|
2255
|
+
/* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
2256
|
+
availableScreen.kind === "scene" ? /* @__PURE__ */ jsx(
|
|
2257
|
+
"button",
|
|
2258
|
+
{
|
|
2259
|
+
className: "rounded-lg border border-border px-3 py-2 text-xs text-text",
|
|
2260
|
+
onClick: () => beginScreenEdit(availableScreen),
|
|
2261
|
+
type: "button",
|
|
2262
|
+
children: "편집"
|
|
2263
|
+
}
|
|
2264
|
+
) : null,
|
|
2265
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs uppercase tracking-[0.25em] text-text-subtle", children: selected ? "현재" : "대기" }),
|
|
2266
|
+
/* @__PURE__ */ jsx(
|
|
2267
|
+
"button",
|
|
2268
|
+
{
|
|
2269
|
+
className: "rounded-lg border border-border px-3 py-2 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-60",
|
|
2270
|
+
disabled: loading || selected,
|
|
2271
|
+
onClick: () => {
|
|
2272
|
+
if (screenDefinitions.some(
|
|
2273
|
+
(screen) => screen.id === availableScreen.id
|
|
2274
|
+
)) {
|
|
2275
|
+
void moveToScreen(availableScreen.id);
|
|
2276
|
+
}
|
|
2277
|
+
},
|
|
2278
|
+
type: "button",
|
|
2279
|
+
children: "이동"
|
|
2280
|
+
}
|
|
2281
|
+
)
|
|
2282
|
+
] })
|
|
2283
|
+
] }),
|
|
2284
|
+
editingScreenId === availableScreen.id ? /* @__PURE__ */ jsxs("div", { className: "mt-4 grid gap-3 border-t border-border-soft pt-4 md:grid-cols-2", children: [
|
|
2285
|
+
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2286
|
+
"화면 이름",
|
|
2287
|
+
/* @__PURE__ */ jsx(
|
|
2288
|
+
"input",
|
|
2289
|
+
{
|
|
2290
|
+
className: "rounded-lg border border-border-soft bg-app-bg px-3 py-2 text-sm text-text",
|
|
2291
|
+
onChange: (event) => setScreenTitleDraft(event.target.value),
|
|
2292
|
+
value: screenTitleDraft
|
|
2293
|
+
}
|
|
2294
|
+
)
|
|
2189
2295
|
] }),
|
|
2190
|
-
/* @__PURE__ */ jsxs("
|
|
2296
|
+
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2297
|
+
"영상 파일명",
|
|
2191
2298
|
/* @__PURE__ */ jsx(
|
|
2192
|
-
"
|
|
2299
|
+
"input",
|
|
2193
2300
|
{
|
|
2194
|
-
"
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2301
|
+
className: "rounded-lg border border-border-soft bg-app-bg px-3 py-2 text-sm text-text",
|
|
2302
|
+
onChange: (event) => setScreenVideoDraft(event.target.value),
|
|
2303
|
+
placeholder: "intro.mp4",
|
|
2304
|
+
value: screenVideoDraft
|
|
2305
|
+
}
|
|
2306
|
+
)
|
|
2307
|
+
] }),
|
|
2308
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-xs text-text-subtle", children: [
|
|
2309
|
+
/* @__PURE__ */ jsx(
|
|
2310
|
+
"input",
|
|
2311
|
+
{
|
|
2312
|
+
checked: screenLoopDraft,
|
|
2313
|
+
onChange: (event) => setScreenLoopDraft(event.target.checked),
|
|
2314
|
+
type: "checkbox"
|
|
2315
|
+
}
|
|
2316
|
+
),
|
|
2317
|
+
"무한 반복"
|
|
2318
|
+
] }),
|
|
2319
|
+
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2320
|
+
"총 재생 횟수",
|
|
2321
|
+
/* @__PURE__ */ jsx(
|
|
2322
|
+
"input",
|
|
2323
|
+
{
|
|
2324
|
+
className: "rounded-lg border border-border-soft bg-app-bg px-3 py-2 text-sm text-text disabled:opacity-50",
|
|
2325
|
+
disabled: screenLoopDraft,
|
|
2326
|
+
min: "1",
|
|
2327
|
+
onChange: (event) => setScreenLoopCountDraft(event.target.value),
|
|
2328
|
+
type: "number",
|
|
2329
|
+
value: screenLoopCountDraft
|
|
2330
|
+
}
|
|
2331
|
+
)
|
|
2332
|
+
] }),
|
|
2333
|
+
screenEditError ? /* @__PURE__ */ jsx("p", { className: "text-xs text-log-error-label-text md:col-span-2", children: screenEditError }) : null,
|
|
2334
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2 md:col-span-2", children: [
|
|
2335
|
+
/* @__PURE__ */ jsx(
|
|
2336
|
+
"button",
|
|
2337
|
+
{
|
|
2338
|
+
className: "rounded-lg border border-border px-3 py-2 text-xs text-text",
|
|
2339
|
+
onClick: () => setEditingScreenId(""),
|
|
2340
|
+
type: "button",
|
|
2341
|
+
children: "취소"
|
|
2198
2342
|
}
|
|
2199
2343
|
),
|
|
2200
|
-
/* @__PURE__ */ jsx("span", { className: "rounded-lg border border-border-soft bg-surface px-3 py-2 text-xs text-text-muted", children: arduinoPhaseLabel[arduinoBuild.status.phase] }),
|
|
2201
2344
|
/* @__PURE__ */ jsx(
|
|
2202
2345
|
"button",
|
|
2203
2346
|
{
|
|
2204
|
-
className: "rounded-lg
|
|
2205
|
-
onClick: () =>
|
|
2347
|
+
className: "rounded-lg bg-button-primary-bg px-3 py-2 text-xs font-semibold text-button-primary-text",
|
|
2348
|
+
onClick: () => void saveScreenEdit(availableScreen),
|
|
2206
2349
|
type: "button",
|
|
2207
|
-
children: "
|
|
2350
|
+
children: "화면 설정 저장"
|
|
2208
2351
|
}
|
|
2209
2352
|
)
|
|
2210
2353
|
] })
|
|
2211
|
-
] })
|
|
2212
|
-
|
|
2213
|
-
/* @__PURE__ */
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2354
|
+
] }) : null,
|
|
2355
|
+
shortcutEditMode ? /* @__PURE__ */ jsxs("div", { className: "mt-4 border-t border-border-soft pt-4", children: [
|
|
2356
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { children: [
|
|
2357
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold text-text", children: "단축키" }),
|
|
2358
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-text-subtle", children: "이 화면으로 이동할 키를 누르면 자동으로 입력됩니다." })
|
|
2359
|
+
] }) }),
|
|
2360
|
+
/* @__PURE__ */ jsx("div", { className: "mt-3 grid gap-3", children: /* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2361
|
+
"Shortcut",
|
|
2362
|
+
/* @__PURE__ */ jsx(
|
|
2363
|
+
"input",
|
|
2364
|
+
{
|
|
2365
|
+
className: "rounded-lg border border-border-soft bg-app-bg px-3 py-2 text-sm text-text outline-none transition focus:border-border-strong",
|
|
2366
|
+
onChange: (event) => updateShortcutDraft(availableScreen.id, event.target.value),
|
|
2367
|
+
onKeyDown: (event) => {
|
|
2368
|
+
event.preventDefault();
|
|
2369
|
+
if (event.key === "Backspace" || event.key === "Delete") {
|
|
2370
|
+
updateShortcutDraft(availableScreen.id, "");
|
|
2371
|
+
return;
|
|
2372
|
+
}
|
|
2373
|
+
const shortcut = formatShortcutFromKeyboardEvent(event);
|
|
2374
|
+
if (!shortcut) {
|
|
2375
|
+
return;
|
|
2376
|
+
}
|
|
2377
|
+
updateShortcutDraft(availableScreen.id, shortcut);
|
|
2378
|
+
},
|
|
2379
|
+
placeholder: "키를 누르세요",
|
|
2380
|
+
type: "text",
|
|
2381
|
+
value: shortcutDrafts[availableScreen.id] ?? ""
|
|
2382
|
+
}
|
|
2383
|
+
)
|
|
2384
|
+
] }) })
|
|
2385
|
+
] }) : null
|
|
2386
|
+
]
|
|
2387
|
+
},
|
|
2388
|
+
availableScreen.id
|
|
2389
|
+
);
|
|
2390
|
+
}) }),
|
|
2391
|
+
arduinoFirmwareOpen ? createPortal(
|
|
2392
|
+
/* @__PURE__ */ jsx(
|
|
2393
|
+
"div",
|
|
2394
|
+
{
|
|
2395
|
+
className: "fixed inset-0 z-[70] bg-surface-strong text-text",
|
|
2396
|
+
onClick: () => setArduinoFirmwareOpen(false),
|
|
2397
|
+
children: /* @__PURE__ */ jsxs(
|
|
2398
|
+
"section",
|
|
2399
|
+
{
|
|
2400
|
+
className: "flex h-dvh w-screen flex-col overflow-hidden bg-surface-strong",
|
|
2401
|
+
onClick: (event) => event.stopPropagation(),
|
|
2402
|
+
children: [
|
|
2403
|
+
/* @__PURE__ */ jsx("div", { className: "shrink-0 border-b border-border-soft px-5 py-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
2404
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2405
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.25em] text-text-subtle", children: "Arduino" }),
|
|
2406
|
+
/* @__PURE__ */ jsx("h3", { className: "mt-1 font-display text-lg text-text", children: "펌웨어 생성" }),
|
|
2407
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-text-muted", children: "핀 매핑은 자동 저장되며, 스케치 생성, 컴파일, 업로드를 실행합니다." })
|
|
2408
|
+
] }),
|
|
2409
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2410
|
+
/* @__PURE__ */ jsx(
|
|
2411
|
+
"span",
|
|
2412
|
+
{
|
|
2413
|
+
"aria-label": arduinoSyncLabel,
|
|
2414
|
+
className: `inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border text-sm ${arduinoSyncTone}`,
|
|
2415
|
+
title: arduinoSyncLabel,
|
|
2416
|
+
children: arduinoSyncIcon
|
|
2417
|
+
}
|
|
2418
|
+
),
|
|
2419
|
+
/* @__PURE__ */ jsx("span", { className: "rounded-lg border border-border-soft bg-surface px-3 py-2 text-xs text-text-muted", children: arduinoPhaseLabel[arduinoBuild.status.phase] }),
|
|
2420
|
+
/* @__PURE__ */ jsx(
|
|
2421
|
+
"button",
|
|
2422
|
+
{
|
|
2423
|
+
className: "rounded-lg border border-border px-3 py-2 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2424
|
+
onClick: () => setArduinoFirmwareOpen(false),
|
|
2425
|
+
type: "button",
|
|
2426
|
+
children: "닫기"
|
|
2427
|
+
}
|
|
2428
|
+
)
|
|
2429
|
+
] })
|
|
2430
|
+
] }) }),
|
|
2431
|
+
/* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-hidden px-5 py-4", children: /* @__PURE__ */ jsxs("div", { className: "grid h-full min-h-0 grid-rows-[minmax(0,1fr)_minmax(220px,0.45fr)] gap-4 xl:grid-cols-[minmax(0,1.75fr)_minmax(320px,0.85fr)] xl:grid-rows-1", children: [
|
|
2432
|
+
/* @__PURE__ */ jsxs("div", { className: "min-h-0 overflow-auto pr-1", children: [
|
|
2433
|
+
arduinoError || arduinoBuild.error ? /* @__PURE__ */ jsx("p", { className: "rounded-lg border border-log-error-bg bg-log-error-bg px-3 py-2 text-xs text-log-error-label-text", children: arduinoError || arduinoBuild.error?.message }) : null,
|
|
2434
|
+
arduinoBuild.status.lastResult?.message ? /* @__PURE__ */ jsx("p", { className: "mt-3 rounded-lg border border-border-soft bg-surface px-3 py-2 text-xs text-text-subtle", children: arduinoBuild.status.lastResult.message }) : null,
|
|
2435
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 grid gap-3", children: [
|
|
2436
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-3 lg:grid-cols-[1fr_1fr]", children: [
|
|
2437
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2438
|
+
/* @__PURE__ */ jsx("p", { className: "mb-2 text-xs uppercase tracking-[0.25em] text-text-subtle", children: "보드 프리셋" }),
|
|
2439
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: ARDUINO_BOARD_PRESETS.map((preset) => /* @__PURE__ */ jsx(
|
|
2440
|
+
"button",
|
|
2441
|
+
{
|
|
2442
|
+
className: `rounded-lg border px-3 py-2 text-xs transition ${arduinoDraft.boardPreset === preset ? "border-border-strong bg-surface-selected text-text" : "border-border-soft bg-surface-subtle text-text-muted hover:border-border hover:bg-surface-hover"}`,
|
|
2443
|
+
onClick: () => updateArduinoBoardPreset(preset),
|
|
2444
|
+
type: "button",
|
|
2445
|
+
children: preset
|
|
2446
|
+
},
|
|
2447
|
+
preset
|
|
2448
|
+
)) })
|
|
2449
|
+
] }),
|
|
2450
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-2", children: [
|
|
2451
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-xs text-text-muted", children: [
|
|
2452
|
+
/* @__PURE__ */ jsx(
|
|
2453
|
+
"input",
|
|
2454
|
+
{
|
|
2455
|
+
checked: arduinoAdvancedFqbn,
|
|
2456
|
+
onChange: (event) => {
|
|
2457
|
+
const enabled = event.target.checked;
|
|
2458
|
+
setArduinoAdvancedFqbn(enabled);
|
|
2459
|
+
if (!enabled) {
|
|
2460
|
+
updateArduinoDraft({
|
|
2461
|
+
fqbn: resolveArduinoBoardFqbn(
|
|
2462
|
+
arduinoDraft.boardPreset
|
|
2463
|
+
)
|
|
2464
|
+
});
|
|
2465
|
+
}
|
|
2466
|
+
},
|
|
2467
|
+
type: "checkbox"
|
|
2246
2468
|
}
|
|
2469
|
+
),
|
|
2470
|
+
"고급 FQBN 직접 입력"
|
|
2471
|
+
] }),
|
|
2472
|
+
/* @__PURE__ */ jsx(
|
|
2473
|
+
"input",
|
|
2474
|
+
{
|
|
2475
|
+
className: "rounded-lg border border-border-soft bg-app-bg px-3 py-2 text-xs text-text outline-none transition focus:border-border-strong disabled:opacity-70",
|
|
2476
|
+
disabled: !arduinoAdvancedFqbn,
|
|
2477
|
+
onChange: (event) => updateArduinoDraft({ fqbn: event.target.value }),
|
|
2478
|
+
value: arduinoDraft.fqbn
|
|
2479
|
+
}
|
|
2480
|
+
)
|
|
2481
|
+
] })
|
|
2482
|
+
] }),
|
|
2483
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-3 lg:grid-cols-2", children: [
|
|
2484
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-xs text-text-muted", children: [
|
|
2485
|
+
/* @__PURE__ */ jsx(
|
|
2486
|
+
"input",
|
|
2487
|
+
{
|
|
2488
|
+
checked: arduinoDraft.keyboardFallbackEnabled,
|
|
2489
|
+
onChange: (event) => updateArduinoDraft({
|
|
2490
|
+
keyboardFallbackEnabled: event.target.checked
|
|
2491
|
+
}),
|
|
2492
|
+
type: "checkbox"
|
|
2493
|
+
}
|
|
2494
|
+
),
|
|
2495
|
+
"Serial 통신 실패시 키보드로 동작"
|
|
2496
|
+
] }),
|
|
2497
|
+
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2498
|
+
"시리얼 체크 타임아웃(ms)",
|
|
2499
|
+
/* @__PURE__ */ jsx(
|
|
2500
|
+
"input",
|
|
2501
|
+
{
|
|
2502
|
+
className: "rounded-lg border border-border-soft bg-app-bg px-3 py-2 text-xs text-text outline-none transition focus:border-border-strong",
|
|
2503
|
+
min: 1,
|
|
2504
|
+
onChange: (event) => updateArduinoDraft({
|
|
2505
|
+
serialHealthyTimeoutMs: Number(event.target.value)
|
|
2506
|
+
}),
|
|
2507
|
+
type: "number",
|
|
2508
|
+
value: arduinoDraft.serialHealthyTimeoutMs
|
|
2509
|
+
}
|
|
2510
|
+
),
|
|
2511
|
+
/* @__PURE__ */ jsx("span", { className: "text-[11px] leading-5 text-text-dim", children: "해당 시간동안 Serial 통신 실패시 키보드 제어 방식으로 변경됩니다." })
|
|
2512
|
+
] })
|
|
2513
|
+
] }),
|
|
2514
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-border-soft bg-surface px-3 py-3", children: [
|
|
2515
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
2516
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.25em] text-text-subtle", children: "입력 핀" }),
|
|
2517
|
+
/* @__PURE__ */ jsx(
|
|
2518
|
+
"button",
|
|
2519
|
+
{
|
|
2520
|
+
className: "rounded-lg border border-border px-3 py-1.5 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2521
|
+
onClick: addArduinoInput,
|
|
2522
|
+
type: "button",
|
|
2523
|
+
children: "입력 추가"
|
|
2524
|
+
}
|
|
2525
|
+
)
|
|
2526
|
+
] }),
|
|
2527
|
+
/* @__PURE__ */ jsx("div", { className: "grid gap-2", children: arduinoDraft.inputs.length === 0 ? /* @__PURE__ */ jsx("p", { className: "rounded-lg border border-dashed border-border-soft px-3 py-4 text-xs text-text-subtle", children: "입력 핀 매핑이 없습니다." }) : arduinoDraft.inputs.map((input) => {
|
|
2528
|
+
const preview = getShortcutPreview(
|
|
2529
|
+
input.target,
|
|
2530
|
+
shortcuts
|
|
2531
|
+
);
|
|
2532
|
+
return /* @__PURE__ */ jsxs(
|
|
2533
|
+
"div",
|
|
2534
|
+
{
|
|
2535
|
+
className: "grid gap-2 rounded-lg border border-border-soft bg-surface-subtle px-3 py-3",
|
|
2536
|
+
children: [
|
|
2537
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-2 lg:grid-cols-[0.7fr_1.4fr_0.9fr]", children: [
|
|
2538
|
+
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2539
|
+
"핀",
|
|
2540
|
+
/* @__PURE__ */ jsx(
|
|
2541
|
+
"input",
|
|
2542
|
+
{
|
|
2543
|
+
className: "rounded-lg border border-border-soft bg-app-bg px-2 py-2 text-xs text-text outline-none focus:border-border-strong",
|
|
2544
|
+
min: 0,
|
|
2545
|
+
onChange: (event) => updateArduinoInput(input.id, {
|
|
2546
|
+
pin: Number(event.target.value)
|
|
2547
|
+
}),
|
|
2548
|
+
type: "number",
|
|
2549
|
+
value: input.pin
|
|
2550
|
+
}
|
|
2551
|
+
)
|
|
2552
|
+
] }),
|
|
2553
|
+
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2554
|
+
"대상",
|
|
2555
|
+
/* @__PURE__ */ jsx(
|
|
2556
|
+
"select",
|
|
2557
|
+
{
|
|
2558
|
+
className: "rounded-lg border border-border-soft bg-app-bg px-2 py-2 text-xs text-text outline-none focus:border-border-strong",
|
|
2559
|
+
onChange: (event) => updateArduinoInput(input.id, {
|
|
2560
|
+
target: event.target.value
|
|
2561
|
+
}),
|
|
2562
|
+
value: input.target,
|
|
2563
|
+
children: arduinoTargetOptions.map((target) => /* @__PURE__ */ jsx("option", { value: target, children: formatArduinoTargetOptionLabel(
|
|
2564
|
+
target,
|
|
2565
|
+
screens
|
|
2566
|
+
) }, target))
|
|
2567
|
+
}
|
|
2568
|
+
)
|
|
2569
|
+
] }),
|
|
2570
|
+
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2571
|
+
"디바운스(ms)",
|
|
2572
|
+
/* @__PURE__ */ jsx(
|
|
2573
|
+
"input",
|
|
2574
|
+
{
|
|
2575
|
+
className: "rounded-lg border border-border-soft bg-app-bg px-2 py-2 text-xs text-text outline-none focus:border-border-strong",
|
|
2576
|
+
min: 0,
|
|
2577
|
+
onChange: (event) => updateArduinoInput(input.id, {
|
|
2578
|
+
debounceMs: Number(event.target.value)
|
|
2579
|
+
}),
|
|
2580
|
+
type: "number",
|
|
2581
|
+
value: input.debounceMs
|
|
2582
|
+
}
|
|
2583
|
+
)
|
|
2584
|
+
] })
|
|
2585
|
+
] }),
|
|
2586
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-3 lg:grid-cols-[minmax(0,1fr)_auto]", children: [
|
|
2587
|
+
/* @__PURE__ */ jsxs("div", { className: "grid min-w-0 gap-1", children: [
|
|
2588
|
+
/* @__PURE__ */ jsx(
|
|
2589
|
+
"button",
|
|
2590
|
+
{
|
|
2591
|
+
"aria-pressed": input.activeLow,
|
|
2592
|
+
className: `w-fit rounded-full border px-3 py-1.5 text-xs transition ${input.activeLow ? "border-aqua_signal/50 bg-aqua_signal/10 text-text" : "border-border-soft bg-app-bg text-text-muted hover:border-border"}`,
|
|
2593
|
+
onClick: () => updateArduinoInput(input.id, {
|
|
2594
|
+
activeLow: !input.activeLow
|
|
2595
|
+
}),
|
|
2596
|
+
type: "button",
|
|
2597
|
+
children: input.activeLow ? "LOW 신호에서 동작" : "HIGH 신호에서 동작"
|
|
2598
|
+
}
|
|
2599
|
+
),
|
|
2600
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-text-dim", children: input.activeLow ? "GND와 해당 핀이 쇼트되면 동작합니다." : "GND와 쇼트되어 있던 연결이 끊어져 핀이 HIGH로 올라가면 동작합니다." })
|
|
2601
|
+
] }),
|
|
2602
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-start justify-start gap-2 lg:justify-end", children: [
|
|
2603
|
+
/* @__PURE__ */ jsx(
|
|
2604
|
+
"span",
|
|
2605
|
+
{
|
|
2606
|
+
className: `rounded-md px-2 py-1 text-xs ${preview.warning ? "bg-log-error-bg text-log-error-label-text" : "bg-aqua_signal/10 text-text"}`,
|
|
2607
|
+
title: preview.warning,
|
|
2608
|
+
children: preview.label
|
|
2609
|
+
}
|
|
2610
|
+
),
|
|
2611
|
+
/* @__PURE__ */ jsx(
|
|
2612
|
+
"button",
|
|
2613
|
+
{
|
|
2614
|
+
className: "rounded-lg border border-border px-3 py-1.5 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2615
|
+
onClick: () => updateArduinoDraft({
|
|
2616
|
+
inputs: arduinoDraft.inputs.filter(
|
|
2617
|
+
(current) => current.id !== input.id
|
|
2618
|
+
)
|
|
2619
|
+
}),
|
|
2620
|
+
type: "button",
|
|
2621
|
+
children: "삭제"
|
|
2622
|
+
}
|
|
2623
|
+
)
|
|
2624
|
+
] })
|
|
2625
|
+
] })
|
|
2626
|
+
]
|
|
2247
2627
|
},
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
)
|
|
2251
|
-
"고급 FQBN 직접 입력"
|
|
2628
|
+
input.id
|
|
2629
|
+
);
|
|
2630
|
+
}) })
|
|
2252
2631
|
] }),
|
|
2253
|
-
/* @__PURE__ */
|
|
2254
|
-
"
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2632
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-border-soft bg-surface px-3 py-3", children: [
|
|
2633
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
2634
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.25em] text-text-subtle", children: "출력 핀" }),
|
|
2635
|
+
/* @__PURE__ */ jsx(
|
|
2636
|
+
"button",
|
|
2637
|
+
{
|
|
2638
|
+
className: "rounded-lg border border-border px-3 py-1.5 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2639
|
+
onClick: addArduinoOutput,
|
|
2640
|
+
type: "button",
|
|
2641
|
+
children: "출력 추가"
|
|
2642
|
+
}
|
|
2643
|
+
)
|
|
2644
|
+
] }),
|
|
2645
|
+
/* @__PURE__ */ jsx("div", { className: "grid gap-2", children: arduinoDraft.outputs.length === 0 ? /* @__PURE__ */ jsx("p", { className: "rounded-lg border border-dashed border-border-soft px-3 py-4 text-xs text-text-subtle", children: "출력 핀 매핑이 없습니다." }) : arduinoDraft.outputs.map((output) => {
|
|
2646
|
+
const outputActionOptions = getArduinoOutputActionOptions(
|
|
2647
|
+
output,
|
|
2648
|
+
arduinoOutputSignals
|
|
2649
|
+
);
|
|
2650
|
+
return /* @__PURE__ */ jsxs(
|
|
2651
|
+
"div",
|
|
2652
|
+
{
|
|
2653
|
+
className: "grid gap-2 rounded-lg border border-border-soft bg-surface-subtle px-3 py-3",
|
|
2654
|
+
children: [
|
|
2655
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-2 lg:grid-cols-[1.3fr_1fr_0.7fr]", children: [
|
|
2656
|
+
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2657
|
+
"대상",
|
|
2658
|
+
/* @__PURE__ */ jsx(
|
|
2659
|
+
"select",
|
|
2660
|
+
{
|
|
2661
|
+
className: "rounded-lg border border-border-soft bg-app-bg px-2 py-2 text-xs text-text outline-none focus:border-border-strong",
|
|
2662
|
+
onChange: (event) => {
|
|
2663
|
+
const target = event.target.value;
|
|
2664
|
+
const nextAction = arduinoOutputSignals.find(
|
|
2665
|
+
(signal) => signal.target === target
|
|
2666
|
+
)?.action ?? output.action;
|
|
2667
|
+
updateArduinoOutput(output.id, {
|
|
2668
|
+
target,
|
|
2669
|
+
action: nextAction
|
|
2670
|
+
});
|
|
2671
|
+
},
|
|
2672
|
+
value: output.target,
|
|
2673
|
+
children: arduinoOutputTargetOptions.map((target) => /* @__PURE__ */ jsx("option", { value: target, children: target }, target))
|
|
2674
|
+
}
|
|
2675
|
+
)
|
|
2676
|
+
] }),
|
|
2677
|
+
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2678
|
+
"동작",
|
|
2679
|
+
/* @__PURE__ */ jsx(
|
|
2680
|
+
"select",
|
|
2681
|
+
{
|
|
2682
|
+
className: "rounded-lg border border-border-soft bg-app-bg px-2 py-2 text-xs text-text outline-none focus:border-border-strong",
|
|
2683
|
+
onChange: (event) => updateArduinoOutput(output.id, {
|
|
2684
|
+
action: event.target.value
|
|
2685
|
+
}),
|
|
2686
|
+
value: output.action,
|
|
2687
|
+
children: outputActionOptions.map((action) => /* @__PURE__ */ jsx("option", { value: action, children: action }, action))
|
|
2688
|
+
}
|
|
2689
|
+
)
|
|
2690
|
+
] }),
|
|
2691
|
+
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2692
|
+
"핀",
|
|
2693
|
+
/* @__PURE__ */ jsx(
|
|
2694
|
+
"input",
|
|
2695
|
+
{
|
|
2696
|
+
className: "rounded-lg border border-border-soft bg-app-bg px-2 py-2 text-xs text-text outline-none focus:border-border-strong",
|
|
2697
|
+
min: 0,
|
|
2698
|
+
onChange: (event) => updateArduinoOutput(output.id, {
|
|
2699
|
+
pin: Number(event.target.value)
|
|
2700
|
+
}),
|
|
2701
|
+
type: "number",
|
|
2702
|
+
value: output.pin
|
|
2703
|
+
}
|
|
2704
|
+
)
|
|
2705
|
+
] })
|
|
2706
|
+
] }),
|
|
2707
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
2708
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-xs text-text-muted", children: [
|
|
2709
|
+
/* @__PURE__ */ jsx(
|
|
2710
|
+
"input",
|
|
2711
|
+
{
|
|
2712
|
+
checked: output.activeHigh,
|
|
2713
|
+
onChange: (event) => updateArduinoOutput(output.id, {
|
|
2714
|
+
activeHigh: event.target.checked
|
|
2715
|
+
}),
|
|
2716
|
+
type: "checkbox"
|
|
2717
|
+
}
|
|
2718
|
+
),
|
|
2719
|
+
"HIGH 출력 사용"
|
|
2720
|
+
] }),
|
|
2721
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-xs text-text-subtle", children: [
|
|
2722
|
+
"펄스(ms)",
|
|
2723
|
+
/* @__PURE__ */ jsx(
|
|
2724
|
+
"input",
|
|
2725
|
+
{
|
|
2726
|
+
className: "w-24 rounded-lg border border-border-soft bg-app-bg px-2 py-1.5 text-xs text-text outline-none focus:border-border-strong",
|
|
2727
|
+
min: 0,
|
|
2728
|
+
onChange: (event) => updateArduinoOutput(output.id, {
|
|
2729
|
+
pulseMs: Number(event.target.value)
|
|
2730
|
+
}),
|
|
2731
|
+
type: "number",
|
|
2732
|
+
value: output.pulseMs
|
|
2733
|
+
}
|
|
2734
|
+
)
|
|
2735
|
+
] }),
|
|
2736
|
+
/* @__PURE__ */ jsx(
|
|
2737
|
+
"button",
|
|
2738
|
+
{
|
|
2739
|
+
className: "rounded-lg border border-border px-3 py-1.5 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2740
|
+
onClick: () => updateArduinoDraft({
|
|
2741
|
+
outputs: arduinoDraft.outputs.filter(
|
|
2742
|
+
(current) => current.id !== output.id
|
|
2743
|
+
)
|
|
2744
|
+
}),
|
|
2745
|
+
type: "button",
|
|
2746
|
+
children: "삭제"
|
|
2747
|
+
}
|
|
2748
|
+
)
|
|
2749
|
+
] })
|
|
2750
|
+
]
|
|
2751
|
+
},
|
|
2752
|
+
output.id
|
|
2753
|
+
);
|
|
2754
|
+
}) })
|
|
2755
|
+
] })
|
|
2262
2756
|
] })
|
|
2263
2757
|
] }),
|
|
2264
|
-
/* @__PURE__ */ jsxs("
|
|
2265
|
-
/* @__PURE__ */ jsxs("
|
|
2758
|
+
/* @__PURE__ */ jsxs("aside", { className: "flex min-h-0 flex-col rounded-lg border border-border-soft bg-app-bg px-3 py-3", children: [
|
|
2759
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-3 grid shrink-0 grid-cols-3 gap-2", children: [
|
|
2266
2760
|
/* @__PURE__ */ jsx(
|
|
2267
|
-
"
|
|
2761
|
+
"button",
|
|
2268
2762
|
{
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2763
|
+
className: "rounded-lg border border-border px-3 py-2 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-60",
|
|
2764
|
+
disabled: loading,
|
|
2765
|
+
onClick: () => void previewArduinoSketch(),
|
|
2766
|
+
type: "button",
|
|
2767
|
+
children: "미리보기"
|
|
2274
2768
|
}
|
|
2275
2769
|
),
|
|
2276
|
-
"Serial 통신 실패시 키보드로 동작"
|
|
2277
|
-
] }),
|
|
2278
|
-
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2279
|
-
"시리얼 체크 타임아웃(ms)",
|
|
2280
2770
|
/* @__PURE__ */ jsx(
|
|
2281
|
-
"
|
|
2771
|
+
"button",
|
|
2282
2772
|
{
|
|
2283
|
-
className: "rounded-lg
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
type: "number",
|
|
2289
|
-
value: arduinoDraft.serialHealthyTimeoutMs
|
|
2773
|
+
className: "rounded-lg bg-button-primary-bg px-3 py-2 text-xs font-semibold text-button-primary-text transition hover:bg-button-primary-hover disabled:cursor-not-allowed disabled:opacity-60",
|
|
2774
|
+
disabled: loading || arduinoBuild.compiling || arduinoBuild.uploading,
|
|
2775
|
+
onClick: () => void compileArduinoSketch(),
|
|
2776
|
+
type: "button",
|
|
2777
|
+
children: "컴파일"
|
|
2290
2778
|
}
|
|
2291
2779
|
),
|
|
2292
|
-
/* @__PURE__ */ jsx(
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2780
|
+
arduinoBuild.uploading ? /* @__PURE__ */ jsx(
|
|
2781
|
+
"button",
|
|
2782
|
+
{
|
|
2783
|
+
className: "rounded-lg border border-border px-3 py-2 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2784
|
+
onClick: arduinoBuild.cancel,
|
|
2785
|
+
type: "button",
|
|
2786
|
+
children: "빌드 취소"
|
|
2787
|
+
}
|
|
2788
|
+
) : /* @__PURE__ */ jsx(
|
|
2299
2789
|
"button",
|
|
2300
2790
|
{
|
|
2301
|
-
className: "rounded-lg
|
|
2302
|
-
|
|
2791
|
+
className: "rounded-lg bg-button-primary-bg px-3 py-2 text-xs font-semibold text-button-primary-text transition hover:bg-button-primary-hover disabled:cursor-not-allowed disabled:opacity-60",
|
|
2792
|
+
disabled: loading || arduinoBuild.compiling || !deviceState.selectedPortPath,
|
|
2793
|
+
onClick: () => void uploadArduinoSketch(),
|
|
2303
2794
|
type: "button",
|
|
2304
|
-
children: "
|
|
2795
|
+
children: "업로드"
|
|
2305
2796
|
}
|
|
2306
2797
|
)
|
|
2307
2798
|
] }),
|
|
2308
|
-
/* @__PURE__ */
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
)
|
|
2313
|
-
return /* @__PURE__ */ jsxs(
|
|
2314
|
-
"div",
|
|
2315
|
-
{
|
|
2316
|
-
className: "grid gap-2 rounded-lg border border-border-soft bg-surface-subtle px-3 py-3",
|
|
2317
|
-
children: [
|
|
2318
|
-
/* @__PURE__ */ jsxs("div", { className: "grid gap-2 lg:grid-cols-[0.7fr_1.4fr_0.9fr]", children: [
|
|
2319
|
-
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2320
|
-
"핀",
|
|
2321
|
-
/* @__PURE__ */ jsx(
|
|
2322
|
-
"input",
|
|
2323
|
-
{
|
|
2324
|
-
className: "rounded-lg border border-border-soft bg-app-bg px-2 py-2 text-xs text-text outline-none focus:border-border-strong",
|
|
2325
|
-
min: 0,
|
|
2326
|
-
onChange: (event) => updateArduinoInput(input.id, {
|
|
2327
|
-
pin: Number(event.target.value)
|
|
2328
|
-
}),
|
|
2329
|
-
type: "number",
|
|
2330
|
-
value: input.pin
|
|
2331
|
-
}
|
|
2332
|
-
)
|
|
2333
|
-
] }),
|
|
2334
|
-
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2335
|
-
"대상",
|
|
2336
|
-
/* @__PURE__ */ jsx(
|
|
2337
|
-
"select",
|
|
2338
|
-
{
|
|
2339
|
-
className: "rounded-lg border border-border-soft bg-app-bg px-2 py-2 text-xs text-text outline-none focus:border-border-strong",
|
|
2340
|
-
onChange: (event) => updateArduinoInput(input.id, {
|
|
2341
|
-
target: event.target.value
|
|
2342
|
-
}),
|
|
2343
|
-
value: input.target,
|
|
2344
|
-
children: arduinoTargetOptions.map((target) => /* @__PURE__ */ jsx("option", { value: target, children: formatArduinoTargetOptionLabel(
|
|
2345
|
-
target,
|
|
2346
|
-
screens
|
|
2347
|
-
) }, target))
|
|
2348
|
-
}
|
|
2349
|
-
)
|
|
2350
|
-
] }),
|
|
2351
|
-
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2352
|
-
"디바운스(ms)",
|
|
2353
|
-
/* @__PURE__ */ jsx(
|
|
2354
|
-
"input",
|
|
2355
|
-
{
|
|
2356
|
-
className: "rounded-lg border border-border-soft bg-app-bg px-2 py-2 text-xs text-text outline-none focus:border-border-strong",
|
|
2357
|
-
min: 0,
|
|
2358
|
-
onChange: (event) => updateArduinoInput(input.id, {
|
|
2359
|
-
debounceMs: Number(event.target.value)
|
|
2360
|
-
}),
|
|
2361
|
-
type: "number",
|
|
2362
|
-
value: input.debounceMs
|
|
2363
|
-
}
|
|
2364
|
-
)
|
|
2365
|
-
] })
|
|
2366
|
-
] }),
|
|
2367
|
-
/* @__PURE__ */ jsxs("div", { className: "grid gap-3 lg:grid-cols-[minmax(0,1fr)_auto]", children: [
|
|
2368
|
-
/* @__PURE__ */ jsxs("div", { className: "grid min-w-0 gap-1", children: [
|
|
2369
|
-
/* @__PURE__ */ jsx(
|
|
2370
|
-
"button",
|
|
2371
|
-
{
|
|
2372
|
-
"aria-pressed": input.activeLow,
|
|
2373
|
-
className: `w-fit rounded-full border px-3 py-1.5 text-xs transition ${input.activeLow ? "border-aqua_signal/50 bg-aqua_signal/10 text-text" : "border-border-soft bg-app-bg text-text-muted hover:border-border"}`,
|
|
2374
|
-
onClick: () => updateArduinoInput(input.id, {
|
|
2375
|
-
activeLow: !input.activeLow
|
|
2376
|
-
}),
|
|
2377
|
-
type: "button",
|
|
2378
|
-
children: input.activeLow ? "LOW 신호에서 동작" : "HIGH 신호에서 동작"
|
|
2379
|
-
}
|
|
2380
|
-
),
|
|
2381
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs text-text-dim", children: input.activeLow ? "GND와 해당 핀이 쇼트되면 동작합니다." : "GND와 쇼트되어 있던 연결이 끊어져 핀이 HIGH로 올라가면 동작합니다." })
|
|
2382
|
-
] }),
|
|
2383
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-start justify-start gap-2 lg:justify-end", children: [
|
|
2384
|
-
/* @__PURE__ */ jsx(
|
|
2385
|
-
"span",
|
|
2386
|
-
{
|
|
2387
|
-
className: `rounded-md px-2 py-1 text-xs ${preview.warning ? "bg-log-error-bg text-log-error-label-text" : "bg-aqua_signal/10 text-text"}`,
|
|
2388
|
-
title: preview.warning,
|
|
2389
|
-
children: preview.label
|
|
2390
|
-
}
|
|
2391
|
-
),
|
|
2392
|
-
/* @__PURE__ */ jsx(
|
|
2393
|
-
"button",
|
|
2394
|
-
{
|
|
2395
|
-
className: "rounded-lg border border-border px-3 py-1.5 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2396
|
-
onClick: () => updateArduinoDraft({
|
|
2397
|
-
inputs: arduinoDraft.inputs.filter(
|
|
2398
|
-
(current) => current.id !== input.id
|
|
2399
|
-
)
|
|
2400
|
-
}),
|
|
2401
|
-
type: "button",
|
|
2402
|
-
children: "삭제"
|
|
2403
|
-
}
|
|
2404
|
-
)
|
|
2405
|
-
] })
|
|
2406
|
-
] })
|
|
2407
|
-
]
|
|
2408
|
-
},
|
|
2409
|
-
input.id
|
|
2410
|
-
);
|
|
2411
|
-
}) })
|
|
2412
|
-
] }),
|
|
2413
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-border-soft bg-surface px-3 py-3", children: [
|
|
2414
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
2415
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.25em] text-text-subtle", children: "출력 핀" }),
|
|
2799
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-3 flex shrink-0 items-center justify-between", children: [
|
|
2800
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2801
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.25em] text-text-subtle", children: "빌드 로그" }),
|
|
2802
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-text-dim", children: "컴파일/업로드 출력" })
|
|
2803
|
+
] }),
|
|
2416
2804
|
/* @__PURE__ */ jsx(
|
|
2417
2805
|
"button",
|
|
2418
2806
|
{
|
|
2419
|
-
className: "rounded-lg border border-border px-
|
|
2420
|
-
onClick:
|
|
2807
|
+
className: "rounded-lg border border-border px-2 py-1 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2808
|
+
onClick: arduinoBuild.clearLogs,
|
|
2421
2809
|
type: "button",
|
|
2422
|
-
children: "
|
|
2810
|
+
children: "지우기"
|
|
2423
2811
|
}
|
|
2424
2812
|
)
|
|
2425
2813
|
] }),
|
|
2426
|
-
/* @__PURE__ */ jsx("div", { className: "grid gap-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2438
|
-
"대상",
|
|
2439
|
-
/* @__PURE__ */ jsx(
|
|
2440
|
-
"select",
|
|
2441
|
-
{
|
|
2442
|
-
className: "rounded-lg border border-border-soft bg-app-bg px-2 py-2 text-xs text-text outline-none focus:border-border-strong",
|
|
2443
|
-
onChange: (event) => {
|
|
2444
|
-
const target = event.target.value;
|
|
2445
|
-
const nextAction = arduinoOutputSignals.find(
|
|
2446
|
-
(signal) => signal.target === target
|
|
2447
|
-
)?.action ?? output.action;
|
|
2448
|
-
updateArduinoOutput(output.id, {
|
|
2449
|
-
target,
|
|
2450
|
-
action: nextAction
|
|
2451
|
-
});
|
|
2452
|
-
},
|
|
2453
|
-
value: output.target,
|
|
2454
|
-
children: arduinoOutputTargetOptions.map((target) => /* @__PURE__ */ jsx("option", { value: target, children: target }, target))
|
|
2455
|
-
}
|
|
2456
|
-
)
|
|
2457
|
-
] }),
|
|
2458
|
-
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2459
|
-
"동작",
|
|
2460
|
-
/* @__PURE__ */ jsx(
|
|
2461
|
-
"select",
|
|
2462
|
-
{
|
|
2463
|
-
className: "rounded-lg border border-border-soft bg-app-bg px-2 py-2 text-xs text-text outline-none focus:border-border-strong",
|
|
2464
|
-
onChange: (event) => updateArduinoOutput(output.id, {
|
|
2465
|
-
action: event.target.value
|
|
2466
|
-
}),
|
|
2467
|
-
value: output.action,
|
|
2468
|
-
children: outputActionOptions.map((action) => /* @__PURE__ */ jsx("option", { value: action, children: action }, action))
|
|
2469
|
-
}
|
|
2470
|
-
)
|
|
2471
|
-
] }),
|
|
2472
|
-
/* @__PURE__ */ jsxs("label", { className: "grid gap-1 text-xs text-text-subtle", children: [
|
|
2473
|
-
"핀",
|
|
2474
|
-
/* @__PURE__ */ jsx(
|
|
2475
|
-
"input",
|
|
2476
|
-
{
|
|
2477
|
-
className: "rounded-lg border border-border-soft bg-app-bg px-2 py-2 text-xs text-text outline-none focus:border-border-strong",
|
|
2478
|
-
min: 0,
|
|
2479
|
-
onChange: (event) => updateArduinoOutput(output.id, {
|
|
2480
|
-
pin: Number(event.target.value)
|
|
2481
|
-
}),
|
|
2482
|
-
type: "number",
|
|
2483
|
-
value: output.pin
|
|
2484
|
-
}
|
|
2485
|
-
)
|
|
2486
|
-
] })
|
|
2487
|
-
] }),
|
|
2488
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
2489
|
-
/* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-xs text-text-muted", children: [
|
|
2490
|
-
/* @__PURE__ */ jsx(
|
|
2491
|
-
"input",
|
|
2492
|
-
{
|
|
2493
|
-
checked: output.activeHigh,
|
|
2494
|
-
onChange: (event) => updateArduinoOutput(output.id, {
|
|
2495
|
-
activeHigh: event.target.checked
|
|
2496
|
-
}),
|
|
2497
|
-
type: "checkbox"
|
|
2498
|
-
}
|
|
2499
|
-
),
|
|
2500
|
-
"HIGH 출력 사용"
|
|
2501
|
-
] }),
|
|
2502
|
-
/* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-xs text-text-subtle", children: [
|
|
2503
|
-
"펄스(ms)",
|
|
2504
|
-
/* @__PURE__ */ jsx(
|
|
2505
|
-
"input",
|
|
2506
|
-
{
|
|
2507
|
-
className: "w-24 rounded-lg border border-border-soft bg-app-bg px-2 py-1.5 text-xs text-text outline-none focus:border-border-strong",
|
|
2508
|
-
min: 0,
|
|
2509
|
-
onChange: (event) => updateArduinoOutput(output.id, {
|
|
2510
|
-
pulseMs: Number(event.target.value)
|
|
2511
|
-
}),
|
|
2512
|
-
type: "number",
|
|
2513
|
-
value: output.pulseMs
|
|
2514
|
-
}
|
|
2515
|
-
)
|
|
2516
|
-
] }),
|
|
2517
|
-
/* @__PURE__ */ jsx(
|
|
2518
|
-
"button",
|
|
2519
|
-
{
|
|
2520
|
-
className: "rounded-lg border border-border px-3 py-1.5 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2521
|
-
onClick: () => updateArduinoDraft({
|
|
2522
|
-
outputs: arduinoDraft.outputs.filter(
|
|
2523
|
-
(current) => current.id !== output.id
|
|
2524
|
-
)
|
|
2525
|
-
}),
|
|
2526
|
-
type: "button",
|
|
2527
|
-
children: "삭제"
|
|
2528
|
-
}
|
|
2529
|
-
)
|
|
2530
|
-
] })
|
|
2531
|
-
]
|
|
2532
|
-
},
|
|
2533
|
-
output.id
|
|
2534
|
-
);
|
|
2535
|
-
}) })
|
|
2814
|
+
/* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-auto pr-1", children: /* @__PURE__ */ jsx("div", { className: "grid gap-1", children: arduinoBuild.logs.length === 0 ? /* @__PURE__ */ jsx("p", { className: "rounded-lg border border-dashed border-border-soft px-3 py-4 text-xs text-text-subtle", children: "아직 Arduino 빌드 로그가 없습니다." }) : arduinoBuild.logs.map((entry) => /* @__PURE__ */ jsxs(
|
|
2815
|
+
"div",
|
|
2816
|
+
{
|
|
2817
|
+
className: `rounded-md border px-2 py-2 text-xs ${arduinoLogTone[entry.stream]}`,
|
|
2818
|
+
children: [
|
|
2819
|
+
/* @__PURE__ */ jsx("span", { className: "mr-2 font-mono uppercase", children: entry.stream }),
|
|
2820
|
+
/* @__PURE__ */ jsx("span", { className: "break-all font-mono", children: entry.line })
|
|
2821
|
+
]
|
|
2822
|
+
},
|
|
2823
|
+
entry.id
|
|
2824
|
+
)) }) })
|
|
2536
2825
|
] })
|
|
2537
|
-
] })
|
|
2538
|
-
]
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
/* @__PURE__ */ jsx(
|
|
2542
|
-
"button",
|
|
2543
|
-
{
|
|
2544
|
-
className: "rounded-lg border border-border px-3 py-2 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-60",
|
|
2545
|
-
disabled: loading,
|
|
2546
|
-
onClick: () => void previewArduinoSketch(),
|
|
2547
|
-
type: "button",
|
|
2548
|
-
children: "미리보기"
|
|
2549
|
-
}
|
|
2550
|
-
),
|
|
2551
|
-
/* @__PURE__ */ jsx(
|
|
2552
|
-
"button",
|
|
2553
|
-
{
|
|
2554
|
-
className: "rounded-lg bg-button-primary-bg px-3 py-2 text-xs font-semibold text-button-primary-text transition hover:bg-button-primary-hover disabled:cursor-not-allowed disabled:opacity-60",
|
|
2555
|
-
disabled: loading || arduinoBuild.compiling || arduinoBuild.uploading,
|
|
2556
|
-
onClick: () => void compileArduinoSketch(),
|
|
2557
|
-
type: "button",
|
|
2558
|
-
children: "컴파일"
|
|
2559
|
-
}
|
|
2560
|
-
),
|
|
2561
|
-
arduinoBuild.uploading ? /* @__PURE__ */ jsx(
|
|
2562
|
-
"button",
|
|
2563
|
-
{
|
|
2564
|
-
className: "rounded-lg border border-border px-3 py-2 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2565
|
-
onClick: arduinoBuild.cancel,
|
|
2566
|
-
type: "button",
|
|
2567
|
-
children: "빌드 취소"
|
|
2568
|
-
}
|
|
2569
|
-
) : /* @__PURE__ */ jsx(
|
|
2570
|
-
"button",
|
|
2571
|
-
{
|
|
2572
|
-
className: "rounded-lg bg-button-primary-bg px-3 py-2 text-xs font-semibold text-button-primary-text transition hover:bg-button-primary-hover disabled:cursor-not-allowed disabled:opacity-60",
|
|
2573
|
-
disabled: loading || arduinoBuild.compiling || !deviceState.selectedPortPath,
|
|
2574
|
-
onClick: () => void uploadArduinoSketch(),
|
|
2575
|
-
type: "button",
|
|
2576
|
-
children: "업로드"
|
|
2577
|
-
}
|
|
2578
|
-
)
|
|
2579
|
-
] }),
|
|
2580
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-3 flex shrink-0 items-center justify-between", children: [
|
|
2581
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2582
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.25em] text-text-subtle", children: "빌드 로그" }),
|
|
2583
|
-
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-text-dim", children: "컴파일/업로드 출력" })
|
|
2584
|
-
] }),
|
|
2585
|
-
/* @__PURE__ */ jsx(
|
|
2586
|
-
"button",
|
|
2587
|
-
{
|
|
2588
|
-
className: "rounded-lg border border-border px-2 py-1 text-xs text-text transition hover:border-border-strong hover:bg-surface-hover",
|
|
2589
|
-
onClick: arduinoBuild.clearLogs,
|
|
2590
|
-
type: "button",
|
|
2591
|
-
children: "지우기"
|
|
2592
|
-
}
|
|
2593
|
-
)
|
|
2594
|
-
] }),
|
|
2595
|
-
/* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-auto pr-1", children: /* @__PURE__ */ jsx("div", { className: "grid gap-1", children: arduinoBuild.logs.length === 0 ? /* @__PURE__ */ jsx("p", { className: "rounded-lg border border-dashed border-border-soft px-3 py-4 text-xs text-text-subtle", children: "아직 Arduino 빌드 로그가 없습니다." }) : arduinoBuild.logs.map((entry) => /* @__PURE__ */ jsxs(
|
|
2596
|
-
"div",
|
|
2597
|
-
{
|
|
2598
|
-
className: `rounded-md border px-2 py-2 text-xs ${arduinoLogTone[entry.stream]}`,
|
|
2599
|
-
children: [
|
|
2600
|
-
/* @__PURE__ */ jsx("span", { className: "mr-2 font-mono uppercase", children: entry.stream }),
|
|
2601
|
-
/* @__PURE__ */ jsx("span", { className: "break-all font-mono", children: entry.line })
|
|
2602
|
-
]
|
|
2603
|
-
},
|
|
2604
|
-
entry.id
|
|
2605
|
-
)) }) })
|
|
2606
|
-
] })
|
|
2607
|
-
] }) })
|
|
2608
|
-
]
|
|
2826
|
+
] }) })
|
|
2827
|
+
]
|
|
2828
|
+
}
|
|
2829
|
+
)
|
|
2609
2830
|
}
|
|
2610
|
-
)
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
)
|
|
2831
|
+
),
|
|
2832
|
+
document.body
|
|
2833
|
+
) : null
|
|
2834
|
+
] })
|
|
2835
|
+
] }) })
|
|
2615
2836
|
] })
|
|
2616
|
-
|
|
2617
|
-
|
|
2837
|
+
}
|
|
2838
|
+
),
|
|
2618
2839
|
benchmarkModalOpen ? /* @__PURE__ */ jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/55 px-4 py-6", children: /* @__PURE__ */ jsxs("section", { className: "flex max-h-[82vh] w-full max-w-3xl flex-col overflow-hidden rounded-2xl border border-border bg-surface-strong shadow-2xl", children: [
|
|
2619
2840
|
/* @__PURE__ */ jsx("div", { className: "shrink-0 border-b border-border-soft px-5 py-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
2620
2841
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -2986,6 +3207,95 @@ function AdminScreen({ gameState }) {
|
|
|
2986
3207
|
] }) }),
|
|
2987
3208
|
document.body
|
|
2988
3209
|
) : null,
|
|
3210
|
+
displayModalOpen ? /* @__PURE__ */ jsx(
|
|
3211
|
+
"div",
|
|
3212
|
+
{
|
|
3213
|
+
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 py-6",
|
|
3214
|
+
onClick: () => setDisplayModalOpen(false),
|
|
3215
|
+
style: adminZoomStyle,
|
|
3216
|
+
children: /* @__PURE__ */ jsxs(
|
|
3217
|
+
"section",
|
|
3218
|
+
{
|
|
3219
|
+
className: "max-h-[88vh] w-full max-w-2xl overflow-auto rounded-2xl border border-border bg-surface-strong p-5 shadow-2xl",
|
|
3220
|
+
onClick: (event) => event.stopPropagation(),
|
|
3221
|
+
children: [
|
|
3222
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
3223
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3224
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.25em] text-text-subtle", children: "Display Check" }),
|
|
3225
|
+
/* @__PURE__ */ jsx("h3", { className: "mt-2 font-display text-xl text-text", children: "화면·영상 해상도 진단" })
|
|
3226
|
+
] }),
|
|
3227
|
+
/* @__PURE__ */ jsx(
|
|
3228
|
+
"button",
|
|
3229
|
+
{
|
|
3230
|
+
className: "rounded-lg border border-border px-3 py-1.5 text-xs text-text",
|
|
3231
|
+
onClick: () => setDisplayModalOpen(false),
|
|
3232
|
+
type: "button",
|
|
3233
|
+
children: "닫기"
|
|
3234
|
+
}
|
|
3235
|
+
)
|
|
3236
|
+
] }),
|
|
3237
|
+
/* @__PURE__ */ jsxs("dl", { className: "mt-5 grid gap-3 rounded-xl border border-border-soft bg-surface p-4 text-sm sm:grid-cols-2", children: [
|
|
3238
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3239
|
+
/* @__PURE__ */ jsx("dt", { className: "text-text-subtle", children: "예상 scene 해상도" }),
|
|
3240
|
+
/* @__PURE__ */ jsxs("dd", { className: "mt-1 font-mono text-text", children: [
|
|
3241
|
+
projectConfig.sceneResolution.width,
|
|
3242
|
+
" × ",
|
|
3243
|
+
projectConfig.sceneResolution.height
|
|
3244
|
+
] })
|
|
3245
|
+
] }),
|
|
3246
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3247
|
+
/* @__PURE__ */ jsx("dt", { className: "text-text-subtle", children: "현재 viewport" }),
|
|
3248
|
+
/* @__PURE__ */ jsxs("dd", { className: "mt-1 font-mono text-text", children: [
|
|
3249
|
+
window.innerWidth,
|
|
3250
|
+
" × ",
|
|
3251
|
+
window.innerHeight
|
|
3252
|
+
] })
|
|
3253
|
+
] })
|
|
3254
|
+
] }),
|
|
3255
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex flex-wrap gap-2", children: [
|
|
3256
|
+
/* @__PURE__ */ jsx(
|
|
3257
|
+
"button",
|
|
3258
|
+
{
|
|
3259
|
+
"aria-pressed": displayFit === "contain",
|
|
3260
|
+
className: "rounded-lg border border-border px-3 py-2 text-sm text-text",
|
|
3261
|
+
onClick: () => void changeDisplayFit("contain"),
|
|
3262
|
+
type: "button",
|
|
3263
|
+
children: "비율 유지"
|
|
3264
|
+
}
|
|
3265
|
+
),
|
|
3266
|
+
/* @__PURE__ */ jsx(
|
|
3267
|
+
"button",
|
|
3268
|
+
{
|
|
3269
|
+
"aria-pressed": displayFit === "fill",
|
|
3270
|
+
className: "rounded-lg border border-border px-3 py-2 text-sm text-text",
|
|
3271
|
+
onClick: () => void changeDisplayFit("fill"),
|
|
3272
|
+
type: "button",
|
|
3273
|
+
children: "화면 꽉 채우기"
|
|
3274
|
+
}
|
|
3275
|
+
),
|
|
3276
|
+
/* @__PURE__ */ jsx(
|
|
3277
|
+
"button",
|
|
3278
|
+
{
|
|
3279
|
+
className: "rounded-lg border border-border px-3 py-2 text-sm text-text",
|
|
3280
|
+
onClick: () => void runDisplayDiagnostics(),
|
|
3281
|
+
type: "button",
|
|
3282
|
+
children: "다시 검사"
|
|
3283
|
+
}
|
|
3284
|
+
)
|
|
3285
|
+
] }),
|
|
3286
|
+
displayError ? /* @__PURE__ */ jsx("p", { className: "mt-3 text-xs text-log-error-label-text", children: displayError }) : null,
|
|
3287
|
+
/* @__PURE__ */ jsx("div", { className: "mt-5 grid gap-2", children: videoDiagnostics.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-sm text-text-subtle", children: "video 메타데이터가 등록된 scene이 없습니다." }) : videoDiagnostics.map((entry) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4 rounded-lg border border-border-soft bg-surface px-3 py-3", children: [
|
|
3288
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
3289
|
+
/* @__PURE__ */ jsx("p", { className: "truncate text-sm font-semibold text-text", children: entry.title }),
|
|
3290
|
+
/* @__PURE__ */ jsx("p", { className: "truncate font-mono text-xs text-text-subtle", children: entry.video })
|
|
3291
|
+
] }),
|
|
3292
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 font-mono text-xs text-text-muted", children: entry.status === "loading" ? "검사 중…" : entry.status === "ok" ? `${entry.width} × ${entry.height}` : "읽기 실패" })
|
|
3293
|
+
] }, entry.id)) })
|
|
3294
|
+
]
|
|
3295
|
+
}
|
|
3296
|
+
)
|
|
3297
|
+
}
|
|
3298
|
+
) : null,
|
|
2989
3299
|
shortcutGuideOpen ? /* @__PURE__ */ jsx(
|
|
2990
3300
|
"div",
|
|
2991
3301
|
{
|