@gallop.software/studio 0.1.93 → 0.1.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{StudioUI-2JGXVWM4.mjs → StudioUI-GKE5ZWKW.mjs} +1124 -574
- package/dist/StudioUI-GKE5ZWKW.mjs.map +1 -0
- package/dist/{StudioUI-77EWSAVJ.js → StudioUI-QBIGDYYL.js} +779 -229
- package/dist/StudioUI-QBIGDYYL.js.map +1 -0
- package/dist/{chunk-DTVEVFQ2.mjs → chunk-IHXG2EE4.mjs} +1 -1
- package/dist/chunk-IHXG2EE4.mjs.map +1 -0
- package/dist/{chunk-L36EH3PM.js → chunk-MCJNUXQ6.js} +1 -1
- package/dist/chunk-MCJNUXQ6.js.map +1 -0
- package/dist/handlers/index.d.mts +1 -15
- package/dist/handlers/index.d.ts +1 -15
- package/dist/handlers/index.js +212 -39
- package/dist/handlers/index.js.map +1 -1
- package/dist/handlers/index.mjs +199 -26
- package/dist/handlers/index.mjs.map +1 -1
- package/dist/index.d.mts +62 -2
- package/dist/index.d.ts +62 -2
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/StudioUI-2JGXVWM4.mjs.map +0 -1
- package/dist/StudioUI-77EWSAVJ.js.map +0 -1
- package/dist/chunk-DTVEVFQ2.mjs.map +0 -1
- package/dist/chunk-L36EH3PM.js.map +0 -1
- package/dist/types-C4hCz2w8.d.mts +0 -62
- package/dist/types-C4hCz2w8.d.ts +0 -62
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
} from "./chunk-HXE6XCG2.mjs";
|
|
8
8
|
|
|
9
9
|
// src/components/StudioUI.tsx
|
|
10
|
-
import { useEffect as
|
|
11
|
-
import { css as
|
|
10
|
+
import { useEffect as useEffect5, useCallback as useCallback5, useState as useState10 } from "react";
|
|
11
|
+
import { css as css11 } from "@emotion/react";
|
|
12
12
|
|
|
13
13
|
// src/components/StudioContext.tsx
|
|
14
14
|
import { createContext, useContext } from "react";
|
|
@@ -70,8 +70,8 @@ function useStudio() {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
// src/components/StudioToolbar.tsx
|
|
73
|
-
import { useCallback, useEffect as useEffect2, useRef, useState as
|
|
74
|
-
import { css as
|
|
73
|
+
import { useCallback as useCallback2, useEffect as useEffect2, useRef as useRef2, useState as useState4 } from "react";
|
|
74
|
+
import { css as css5, keyframes as keyframes4 } from "@emotion/react";
|
|
75
75
|
|
|
76
76
|
// src/components/StudioModal.tsx
|
|
77
77
|
import React from "react";
|
|
@@ -1107,14 +1107,386 @@ function R2SetupModal({ isOpen, onClose }) {
|
|
|
1107
1107
|
] }) });
|
|
1108
1108
|
}
|
|
1109
1109
|
|
|
1110
|
-
// src/components/
|
|
1110
|
+
// src/components/AddNewModal.tsx
|
|
1111
|
+
import { useState as useState3, useRef, useCallback } from "react";
|
|
1112
|
+
import { css as css4, keyframes as keyframes3 } from "@emotion/react";
|
|
1111
1113
|
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "@emotion/react/jsx-runtime";
|
|
1114
|
+
var fadeIn3 = keyframes3`
|
|
1115
|
+
from { opacity: 0; }
|
|
1116
|
+
to { opacity: 1; }
|
|
1117
|
+
`;
|
|
1118
|
+
var slideIn3 = keyframes3`
|
|
1119
|
+
from {
|
|
1120
|
+
opacity: 0;
|
|
1121
|
+
transform: translateY(-8px) scale(0.98);
|
|
1122
|
+
}
|
|
1123
|
+
to {
|
|
1124
|
+
opacity: 1;
|
|
1125
|
+
transform: translateY(0) scale(1);
|
|
1126
|
+
}
|
|
1127
|
+
`;
|
|
1128
|
+
var styles4 = {
|
|
1129
|
+
overlay: css4`
|
|
1130
|
+
position: fixed;
|
|
1131
|
+
inset: 0;
|
|
1132
|
+
background-color: rgba(26, 31, 54, 0.4);
|
|
1133
|
+
backdrop-filter: blur(4px);
|
|
1134
|
+
display: flex;
|
|
1135
|
+
align-items: center;
|
|
1136
|
+
justify-content: center;
|
|
1137
|
+
z-index: 10000;
|
|
1138
|
+
animation: ${fadeIn3} 0.15s ease-out;
|
|
1139
|
+
font-family: ${fontStack};
|
|
1140
|
+
`,
|
|
1141
|
+
modal: css4`
|
|
1142
|
+
${baseReset}
|
|
1143
|
+
background-color: ${colors.surface};
|
|
1144
|
+
border-radius: 12px;
|
|
1145
|
+
box-shadow: 0 30px 60px -12px rgba(50, 50, 93, 0.25), 0 18px 36px -18px rgba(0, 0, 0, 0.3);
|
|
1146
|
+
max-width: 520px;
|
|
1147
|
+
width: 90%;
|
|
1148
|
+
animation: ${slideIn3} 0.2s ease-out;
|
|
1149
|
+
overflow: hidden;
|
|
1150
|
+
`,
|
|
1151
|
+
header: css4`
|
|
1152
|
+
padding: 24px 24px 0;
|
|
1153
|
+
`,
|
|
1154
|
+
title: css4`
|
|
1155
|
+
font-size: ${fontSize.lg};
|
|
1156
|
+
font-weight: 600;
|
|
1157
|
+
color: ${colors.text};
|
|
1158
|
+
margin: 0;
|
|
1159
|
+
letter-spacing: -0.02em;
|
|
1160
|
+
`,
|
|
1161
|
+
tabs: css4`
|
|
1162
|
+
display: flex;
|
|
1163
|
+
gap: 0;
|
|
1164
|
+
margin-top: 16px;
|
|
1165
|
+
border-bottom: 1px solid ${colors.border};
|
|
1166
|
+
`,
|
|
1167
|
+
tab: css4`
|
|
1168
|
+
padding: 12px 20px;
|
|
1169
|
+
font-size: ${fontSize.base};
|
|
1170
|
+
font-weight: 500;
|
|
1171
|
+
color: ${colors.textSecondary};
|
|
1172
|
+
background: none;
|
|
1173
|
+
border: none;
|
|
1174
|
+
cursor: pointer;
|
|
1175
|
+
position: relative;
|
|
1176
|
+
transition: color 0.15s;
|
|
1177
|
+
|
|
1178
|
+
&:hover {
|
|
1179
|
+
color: ${colors.text};
|
|
1180
|
+
}
|
|
1181
|
+
`,
|
|
1182
|
+
tabActive: css4`
|
|
1183
|
+
color: ${colors.primary};
|
|
1184
|
+
|
|
1185
|
+
&::after {
|
|
1186
|
+
content: '';
|
|
1187
|
+
position: absolute;
|
|
1188
|
+
bottom: -1px;
|
|
1189
|
+
left: 0;
|
|
1190
|
+
right: 0;
|
|
1191
|
+
height: 2px;
|
|
1192
|
+
background-color: ${colors.primary};
|
|
1193
|
+
}
|
|
1194
|
+
`,
|
|
1195
|
+
body: css4`
|
|
1196
|
+
padding: 24px;
|
|
1197
|
+
min-height: 200px;
|
|
1198
|
+
`,
|
|
1199
|
+
dropzone: css4`
|
|
1200
|
+
border: 2px dashed ${colors.border};
|
|
1201
|
+
border-radius: 8px;
|
|
1202
|
+
padding: 40px 24px;
|
|
1203
|
+
text-align: center;
|
|
1204
|
+
cursor: pointer;
|
|
1205
|
+
transition: all 0.15s;
|
|
1206
|
+
|
|
1207
|
+
&:hover {
|
|
1208
|
+
border-color: ${colors.primary};
|
|
1209
|
+
background-color: ${colors.primaryLight};
|
|
1210
|
+
}
|
|
1211
|
+
`,
|
|
1212
|
+
dropzoneActive: css4`
|
|
1213
|
+
border-color: ${colors.primary};
|
|
1214
|
+
background-color: ${colors.primaryLight};
|
|
1215
|
+
`,
|
|
1216
|
+
dropzoneIcon: css4`
|
|
1217
|
+
width: 48px;
|
|
1218
|
+
height: 48px;
|
|
1219
|
+
margin: 0 auto 16px;
|
|
1220
|
+
color: ${colors.textMuted};
|
|
1221
|
+
`,
|
|
1222
|
+
dropzoneText: css4`
|
|
1223
|
+
font-size: ${fontSize.base};
|
|
1224
|
+
color: ${colors.text};
|
|
1225
|
+
margin: 0 0 4px;
|
|
1226
|
+
`,
|
|
1227
|
+
dropzoneHint: css4`
|
|
1228
|
+
font-size: ${fontSize.sm};
|
|
1229
|
+
color: ${colors.textSecondary};
|
|
1230
|
+
margin: 0;
|
|
1231
|
+
`,
|
|
1232
|
+
textarea: css4`
|
|
1233
|
+
width: 100%;
|
|
1234
|
+
min-height: 150px;
|
|
1235
|
+
padding: 12px;
|
|
1236
|
+
font-size: ${fontSize.sm};
|
|
1237
|
+
font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
|
|
1238
|
+
border: 1px solid ${colors.border};
|
|
1239
|
+
border-radius: 8px;
|
|
1240
|
+
resize: vertical;
|
|
1241
|
+
|
|
1242
|
+
&:focus {
|
|
1243
|
+
outline: none;
|
|
1244
|
+
border-color: ${colors.primary};
|
|
1245
|
+
box-shadow: 0 0 0 3px ${colors.primaryLight};
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
&::placeholder {
|
|
1249
|
+
color: ${colors.textMuted};
|
|
1250
|
+
}
|
|
1251
|
+
`,
|
|
1252
|
+
textareaLabel: css4`
|
|
1253
|
+
font-size: ${fontSize.sm};
|
|
1254
|
+
color: ${colors.textSecondary};
|
|
1255
|
+
margin: 0 0 8px;
|
|
1256
|
+
`,
|
|
1257
|
+
footer: css4`
|
|
1258
|
+
display: flex;
|
|
1259
|
+
justify-content: flex-end;
|
|
1260
|
+
gap: 12px;
|
|
1261
|
+
padding: 16px 24px;
|
|
1262
|
+
border-top: 1px solid ${colors.border};
|
|
1263
|
+
background-color: ${colors.background};
|
|
1264
|
+
`,
|
|
1265
|
+
btn: css4`
|
|
1266
|
+
padding: 10px 18px;
|
|
1267
|
+
font-size: ${fontSize.base};
|
|
1268
|
+
font-weight: 500;
|
|
1269
|
+
border-radius: 6px;
|
|
1270
|
+
cursor: pointer;
|
|
1271
|
+
transition: all 0.15s ease;
|
|
1272
|
+
letter-spacing: -0.01em;
|
|
1273
|
+
`,
|
|
1274
|
+
btnCancel: css4`
|
|
1275
|
+
background-color: ${colors.surface};
|
|
1276
|
+
border: 1px solid ${colors.border};
|
|
1277
|
+
color: ${colors.text};
|
|
1278
|
+
|
|
1279
|
+
&:hover {
|
|
1280
|
+
background-color: ${colors.surfaceHover};
|
|
1281
|
+
border-color: ${colors.borderHover};
|
|
1282
|
+
}
|
|
1283
|
+
`,
|
|
1284
|
+
btnConfirm: css4`
|
|
1285
|
+
background-color: ${colors.primary};
|
|
1286
|
+
border: 1px solid ${colors.primary};
|
|
1287
|
+
color: white;
|
|
1288
|
+
|
|
1289
|
+
&:hover:not(:disabled) {
|
|
1290
|
+
background-color: ${colors.primaryHover};
|
|
1291
|
+
border-color: ${colors.primaryHover};
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
&:disabled {
|
|
1295
|
+
opacity: 0.6;
|
|
1296
|
+
cursor: not-allowed;
|
|
1297
|
+
}
|
|
1298
|
+
`,
|
|
1299
|
+
fileInput: css4`
|
|
1300
|
+
display: none;
|
|
1301
|
+
`,
|
|
1302
|
+
selectedFiles: css4`
|
|
1303
|
+
margin-top: 16px;
|
|
1304
|
+
padding: 12px;
|
|
1305
|
+
background-color: ${colors.background};
|
|
1306
|
+
border-radius: 6px;
|
|
1307
|
+
font-size: ${fontSize.sm};
|
|
1308
|
+
color: ${colors.text};
|
|
1309
|
+
`
|
|
1310
|
+
};
|
|
1311
|
+
function AddNewModal({ currentPath, onClose, onUploadComplete }) {
|
|
1312
|
+
const [activeTab, setActiveTab] = useState3("upload");
|
|
1313
|
+
const [selectedFiles, setSelectedFiles] = useState3([]);
|
|
1314
|
+
const [urlInput, setUrlInput] = useState3("");
|
|
1315
|
+
const [isDragging, setIsDragging] = useState3(false);
|
|
1316
|
+
const [uploading, setUploading] = useState3(false);
|
|
1317
|
+
const [importing, setImporting] = useState3(false);
|
|
1318
|
+
const fileInputRef = useRef(null);
|
|
1319
|
+
const handleFileSelect = useCallback((files) => {
|
|
1320
|
+
if (files) {
|
|
1321
|
+
setSelectedFiles(Array.from(files));
|
|
1322
|
+
}
|
|
1323
|
+
}, []);
|
|
1324
|
+
const handleDrop = useCallback((e) => {
|
|
1325
|
+
e.preventDefault();
|
|
1326
|
+
setIsDragging(false);
|
|
1327
|
+
handleFileSelect(e.dataTransfer.files);
|
|
1328
|
+
}, [handleFileSelect]);
|
|
1329
|
+
const handleUpload = useCallback(async () => {
|
|
1330
|
+
if (selectedFiles.length === 0) return;
|
|
1331
|
+
setUploading(true);
|
|
1332
|
+
try {
|
|
1333
|
+
for (const file of selectedFiles) {
|
|
1334
|
+
const formData = new FormData();
|
|
1335
|
+
formData.append("file", file);
|
|
1336
|
+
formData.append("path", currentPath);
|
|
1337
|
+
await fetch("/api/studio/upload", {
|
|
1338
|
+
method: "POST",
|
|
1339
|
+
body: formData
|
|
1340
|
+
});
|
|
1341
|
+
}
|
|
1342
|
+
onUploadComplete();
|
|
1343
|
+
onClose();
|
|
1344
|
+
} catch (error) {
|
|
1345
|
+
console.error("Upload failed:", error);
|
|
1346
|
+
} finally {
|
|
1347
|
+
setUploading(false);
|
|
1348
|
+
}
|
|
1349
|
+
}, [selectedFiles, currentPath, onUploadComplete, onClose]);
|
|
1350
|
+
const handleImport = useCallback(async () => {
|
|
1351
|
+
const urls = urlInput.split("\n").map((url) => url.trim()).filter((url) => url.length > 0);
|
|
1352
|
+
if (urls.length === 0) return;
|
|
1353
|
+
setImporting(true);
|
|
1354
|
+
try {
|
|
1355
|
+
const response = await fetch("/api/studio/import", {
|
|
1356
|
+
method: "POST",
|
|
1357
|
+
headers: { "Content-Type": "application/json" },
|
|
1358
|
+
body: JSON.stringify({ urls })
|
|
1359
|
+
});
|
|
1360
|
+
const reader = response.body?.getReader();
|
|
1361
|
+
if (!reader) throw new Error("No reader");
|
|
1362
|
+
const decoder = new TextDecoder();
|
|
1363
|
+
while (true) {
|
|
1364
|
+
const { done, value } = await reader.read();
|
|
1365
|
+
if (done) break;
|
|
1366
|
+
const text = decoder.decode(value);
|
|
1367
|
+
const lines = text.split("\n\n").filter((line) => line.startsWith("data: "));
|
|
1368
|
+
for (const line of lines) {
|
|
1369
|
+
const data = JSON.parse(line.replace("data: ", ""));
|
|
1370
|
+
if (data.type === "complete") {
|
|
1371
|
+
onUploadComplete();
|
|
1372
|
+
onClose();
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
} catch (error) {
|
|
1377
|
+
console.error("Import failed:", error);
|
|
1378
|
+
} finally {
|
|
1379
|
+
setImporting(false);
|
|
1380
|
+
}
|
|
1381
|
+
}, [urlInput, onUploadComplete, onClose]);
|
|
1382
|
+
return /* @__PURE__ */ jsx4("div", { css: styles4.overlay, onClick: onClose, children: /* @__PURE__ */ jsxs4("div", { css: styles4.modal, onClick: (e) => e.stopPropagation(), children: [
|
|
1383
|
+
/* @__PURE__ */ jsxs4("div", { css: styles4.header, children: [
|
|
1384
|
+
/* @__PURE__ */ jsx4("h3", { css: styles4.title, children: "Add New" }),
|
|
1385
|
+
/* @__PURE__ */ jsxs4("div", { css: styles4.tabs, children: [
|
|
1386
|
+
/* @__PURE__ */ jsx4(
|
|
1387
|
+
"button",
|
|
1388
|
+
{
|
|
1389
|
+
css: [styles4.tab, activeTab === "upload" && styles4.tabActive],
|
|
1390
|
+
onClick: () => setActiveTab("upload"),
|
|
1391
|
+
children: "Upload Files"
|
|
1392
|
+
}
|
|
1393
|
+
),
|
|
1394
|
+
/* @__PURE__ */ jsx4(
|
|
1395
|
+
"button",
|
|
1396
|
+
{
|
|
1397
|
+
css: [styles4.tab, activeTab === "import" && styles4.tabActive],
|
|
1398
|
+
onClick: () => setActiveTab("import"),
|
|
1399
|
+
children: "Import URLs"
|
|
1400
|
+
}
|
|
1401
|
+
)
|
|
1402
|
+
] })
|
|
1403
|
+
] }),
|
|
1404
|
+
/* @__PURE__ */ jsx4("div", { css: styles4.body, children: activeTab === "upload" ? /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
1405
|
+
/* @__PURE__ */ jsxs4(
|
|
1406
|
+
"div",
|
|
1407
|
+
{
|
|
1408
|
+
css: [styles4.dropzone, isDragging && styles4.dropzoneActive],
|
|
1409
|
+
onClick: () => fileInputRef.current?.click(),
|
|
1410
|
+
onDragOver: (e) => {
|
|
1411
|
+
e.preventDefault();
|
|
1412
|
+
setIsDragging(true);
|
|
1413
|
+
},
|
|
1414
|
+
onDragLeave: () => setIsDragging(false),
|
|
1415
|
+
onDrop: handleDrop,
|
|
1416
|
+
children: [
|
|
1417
|
+
/* @__PURE__ */ jsx4("svg", { css: styles4.dropzoneIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx4("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" }) }),
|
|
1418
|
+
/* @__PURE__ */ jsx4("p", { css: styles4.dropzoneText, children: "Drop files here or click to browse" }),
|
|
1419
|
+
/* @__PURE__ */ jsx4("p", { css: styles4.dropzoneHint, children: "Supports images and other media files" })
|
|
1420
|
+
]
|
|
1421
|
+
}
|
|
1422
|
+
),
|
|
1423
|
+
/* @__PURE__ */ jsx4(
|
|
1424
|
+
"input",
|
|
1425
|
+
{
|
|
1426
|
+
ref: fileInputRef,
|
|
1427
|
+
type: "file",
|
|
1428
|
+
multiple: true,
|
|
1429
|
+
css: styles4.fileInput,
|
|
1430
|
+
onChange: (e) => handleFileSelect(e.target.files)
|
|
1431
|
+
}
|
|
1432
|
+
),
|
|
1433
|
+
selectedFiles.length > 0 && /* @__PURE__ */ jsxs4("div", { css: styles4.selectedFiles, children: [
|
|
1434
|
+
selectedFiles.length,
|
|
1435
|
+
" file",
|
|
1436
|
+
selectedFiles.length !== 1 ? "s" : "",
|
|
1437
|
+
" selected"
|
|
1438
|
+
] })
|
|
1439
|
+
] }) : /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
1440
|
+
/* @__PURE__ */ jsx4("p", { css: styles4.textareaLabel, children: "Paste image URLs (one per line)" }),
|
|
1441
|
+
/* @__PURE__ */ jsx4(
|
|
1442
|
+
"textarea",
|
|
1443
|
+
{
|
|
1444
|
+
css: styles4.textarea,
|
|
1445
|
+
value: urlInput,
|
|
1446
|
+
onChange: (e) => setUrlInput(e.target.value),
|
|
1447
|
+
placeholder: `https://cdn.example.com/photos/image1.jpg
|
|
1448
|
+
https://cdn.example.com/photos/image2.jpg`
|
|
1449
|
+
}
|
|
1450
|
+
)
|
|
1451
|
+
] }) }),
|
|
1452
|
+
/* @__PURE__ */ jsxs4("div", { css: styles4.footer, children: [
|
|
1453
|
+
/* @__PURE__ */ jsx4(
|
|
1454
|
+
"button",
|
|
1455
|
+
{
|
|
1456
|
+
css: [styles4.btn, styles4.btnCancel],
|
|
1457
|
+
onClick: onClose,
|
|
1458
|
+
children: "Cancel"
|
|
1459
|
+
}
|
|
1460
|
+
),
|
|
1461
|
+
activeTab === "upload" ? /* @__PURE__ */ jsx4(
|
|
1462
|
+
"button",
|
|
1463
|
+
{
|
|
1464
|
+
css: [styles4.btn, styles4.btnConfirm],
|
|
1465
|
+
onClick: handleUpload,
|
|
1466
|
+
disabled: selectedFiles.length === 0 || uploading,
|
|
1467
|
+
children: uploading ? "Uploading..." : "Upload"
|
|
1468
|
+
}
|
|
1469
|
+
) : /* @__PURE__ */ jsx4(
|
|
1470
|
+
"button",
|
|
1471
|
+
{
|
|
1472
|
+
css: [styles4.btn, styles4.btnConfirm],
|
|
1473
|
+
onClick: handleImport,
|
|
1474
|
+
disabled: !urlInput.trim() || importing,
|
|
1475
|
+
children: importing ? "Importing..." : "Import"
|
|
1476
|
+
}
|
|
1477
|
+
)
|
|
1478
|
+
] })
|
|
1479
|
+
] }) });
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
// src/components/StudioToolbar.tsx
|
|
1483
|
+
import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs5 } from "@emotion/react/jsx-runtime";
|
|
1112
1484
|
var btnHeight = "36px";
|
|
1113
|
-
var spin =
|
|
1485
|
+
var spin = keyframes4`
|
|
1114
1486
|
to { transform: rotate(360deg); }
|
|
1115
1487
|
`;
|
|
1116
|
-
var
|
|
1117
|
-
toolbar:
|
|
1488
|
+
var styles5 = {
|
|
1489
|
+
toolbar: css5`
|
|
1118
1490
|
display: flex;
|
|
1119
1491
|
flex-wrap: nowrap;
|
|
1120
1492
|
align-items: center;
|
|
@@ -1130,21 +1502,21 @@ var styles4 = {
|
|
|
1130
1502
|
padding: 12px 24px;
|
|
1131
1503
|
}
|
|
1132
1504
|
`,
|
|
1133
|
-
left:
|
|
1505
|
+
left: css5`
|
|
1134
1506
|
display: flex;
|
|
1135
1507
|
flex-wrap: nowrap;
|
|
1136
1508
|
flex-shrink: 0;
|
|
1137
1509
|
align-items: center;
|
|
1138
1510
|
gap: 8px;
|
|
1139
1511
|
`,
|
|
1140
|
-
right:
|
|
1512
|
+
right: css5`
|
|
1141
1513
|
display: flex;
|
|
1142
1514
|
flex-wrap: nowrap;
|
|
1143
1515
|
flex-shrink: 0;
|
|
1144
1516
|
align-items: center;
|
|
1145
1517
|
gap: 8px;
|
|
1146
1518
|
`,
|
|
1147
|
-
btn:
|
|
1519
|
+
btn: css5`
|
|
1148
1520
|
display: inline-flex;
|
|
1149
1521
|
align-items: center;
|
|
1150
1522
|
justify-content: center;
|
|
@@ -1171,10 +1543,10 @@ var styles4 = {
|
|
|
1171
1543
|
opacity: 0.5;
|
|
1172
1544
|
}
|
|
1173
1545
|
`,
|
|
1174
|
-
btnIconOnly:
|
|
1546
|
+
btnIconOnly: css5`
|
|
1175
1547
|
padding: 0 10px;
|
|
1176
1548
|
`,
|
|
1177
|
-
btnPrimary:
|
|
1549
|
+
btnPrimary: css5`
|
|
1178
1550
|
background: ${colors.primary};
|
|
1179
1551
|
border-color: ${colors.primary};
|
|
1180
1552
|
color: white;
|
|
@@ -1184,7 +1556,7 @@ var styles4 = {
|
|
|
1184
1556
|
border-color: ${colors.primaryHover};
|
|
1185
1557
|
}
|
|
1186
1558
|
`,
|
|
1187
|
-
btnDanger:
|
|
1559
|
+
btnDanger: css5`
|
|
1188
1560
|
color: ${colors.danger};
|
|
1189
1561
|
|
|
1190
1562
|
&:hover:not(:disabled) {
|
|
@@ -1192,14 +1564,14 @@ var styles4 = {
|
|
|
1192
1564
|
border-color: ${colors.danger};
|
|
1193
1565
|
}
|
|
1194
1566
|
`,
|
|
1195
|
-
icon:
|
|
1567
|
+
icon: css5`
|
|
1196
1568
|
width: 16px;
|
|
1197
1569
|
height: 16px;
|
|
1198
1570
|
`,
|
|
1199
|
-
iconSpin:
|
|
1571
|
+
iconSpin: css5`
|
|
1200
1572
|
animation: ${spin} 1s linear infinite;
|
|
1201
1573
|
`,
|
|
1202
|
-
selectionCount:
|
|
1574
|
+
selectionCount: css5`
|
|
1203
1575
|
font-size: ${fontSize.base};
|
|
1204
1576
|
color: ${colors.textSecondary};
|
|
1205
1577
|
display: flex;
|
|
@@ -1207,7 +1579,7 @@ var styles4 = {
|
|
|
1207
1579
|
gap: 8px;
|
|
1208
1580
|
margin-right: 8px;
|
|
1209
1581
|
`,
|
|
1210
|
-
clearBtn:
|
|
1582
|
+
clearBtn: css5`
|
|
1211
1583
|
color: ${colors.primary};
|
|
1212
1584
|
background: none;
|
|
1213
1585
|
border: none;
|
|
@@ -1220,13 +1592,13 @@ var styles4 = {
|
|
|
1220
1592
|
text-decoration: underline;
|
|
1221
1593
|
}
|
|
1222
1594
|
`,
|
|
1223
|
-
divider:
|
|
1595
|
+
divider: css5`
|
|
1224
1596
|
width: 1px;
|
|
1225
1597
|
height: 24px;
|
|
1226
1598
|
background: ${colors.border};
|
|
1227
1599
|
margin: 0 4px;
|
|
1228
1600
|
`,
|
|
1229
|
-
viewToggle:
|
|
1601
|
+
viewToggle: css5`
|
|
1230
1602
|
display: flex;
|
|
1231
1603
|
align-items: center;
|
|
1232
1604
|
height: ${btnHeight};
|
|
@@ -1235,12 +1607,12 @@ var styles4 = {
|
|
|
1235
1607
|
border-radius: 6px;
|
|
1236
1608
|
overflow: hidden;
|
|
1237
1609
|
`,
|
|
1238
|
-
searchWrapper:
|
|
1610
|
+
searchWrapper: css5`
|
|
1239
1611
|
position: relative;
|
|
1240
1612
|
display: flex;
|
|
1241
1613
|
align-items: center;
|
|
1242
1614
|
`,
|
|
1243
|
-
searchInput:
|
|
1615
|
+
searchInput: css5`
|
|
1244
1616
|
height: ${btnHeight};
|
|
1245
1617
|
padding: 0 32px 0 12px;
|
|
1246
1618
|
border: 1px solid ${colors.border};
|
|
@@ -1261,7 +1633,7 @@ var styles4 = {
|
|
|
1261
1633
|
color: ${colors.textMuted};
|
|
1262
1634
|
}
|
|
1263
1635
|
`,
|
|
1264
|
-
searchClearBtn:
|
|
1636
|
+
searchClearBtn: css5`
|
|
1265
1637
|
position: absolute;
|
|
1266
1638
|
right: 5px;
|
|
1267
1639
|
top: 5px;
|
|
@@ -1281,7 +1653,7 @@ var styles4 = {
|
|
|
1281
1653
|
background: ${colors.primaryHover};
|
|
1282
1654
|
}
|
|
1283
1655
|
`,
|
|
1284
|
-
viewBtn:
|
|
1656
|
+
viewBtn: css5`
|
|
1285
1657
|
height: 100%;
|
|
1286
1658
|
padding: 0 10px;
|
|
1287
1659
|
background: transparent;
|
|
@@ -1298,7 +1670,7 @@ var styles4 = {
|
|
|
1298
1670
|
background-color: ${colors.surfaceHover};
|
|
1299
1671
|
}
|
|
1300
1672
|
`,
|
|
1301
|
-
viewBtnActive:
|
|
1673
|
+
viewBtnActive: css5`
|
|
1302
1674
|
background-color: ${colors.primaryLight};
|
|
1303
1675
|
color: ${colors.primary};
|
|
1304
1676
|
|
|
@@ -1310,37 +1682,38 @@ var styles4 = {
|
|
|
1310
1682
|
};
|
|
1311
1683
|
function StudioToolbar() {
|
|
1312
1684
|
const { selectedItems, viewMode, setViewMode, clearSelection, currentPath, triggerRefresh, focusedItem, scanRequested, clearScanRequest } = useStudio();
|
|
1313
|
-
const fileInputRef =
|
|
1314
|
-
const abortControllerRef =
|
|
1315
|
-
const [
|
|
1316
|
-
const [
|
|
1317
|
-
const [
|
|
1318
|
-
const [
|
|
1319
|
-
const [
|
|
1320
|
-
const [
|
|
1321
|
-
const [
|
|
1322
|
-
const [
|
|
1323
|
-
const [
|
|
1324
|
-
const [
|
|
1685
|
+
const fileInputRef = useRef2(null);
|
|
1686
|
+
const abortControllerRef = useRef2(null);
|
|
1687
|
+
const [showAddNewModal, setShowAddNewModal] = useState4(false);
|
|
1688
|
+
const [uploading, setUploading] = useState4(false);
|
|
1689
|
+
const [scanning, setScanning] = useState4(false);
|
|
1690
|
+
const [processing, setProcessing] = useState4(false);
|
|
1691
|
+
const [showDeleteConfirm, setShowDeleteConfirm] = useState4(false);
|
|
1692
|
+
const [showProcessConfirm, setShowProcessConfirm] = useState4(false);
|
|
1693
|
+
const [showSyncConfirm, setShowSyncConfirm] = useState4(false);
|
|
1694
|
+
const [syncImageCount, setSyncImageCount] = useState4(0);
|
|
1695
|
+
const [showProgress, setShowProgress] = useState4(false);
|
|
1696
|
+
const [progressTitle, setProgressTitle] = useState4("Processing Images");
|
|
1697
|
+
const [progressState, setProgressState] = useState4({
|
|
1325
1698
|
current: 0,
|
|
1326
1699
|
total: 0,
|
|
1327
1700
|
percent: 0,
|
|
1328
1701
|
status: "processing"
|
|
1329
1702
|
});
|
|
1330
|
-
const [processCount, setProcessCount] =
|
|
1331
|
-
const [processMode, setProcessMode] =
|
|
1332
|
-
const [imagesToProcess, setImagesToProcess] =
|
|
1333
|
-
const [alertMessage, setAlertMessage] =
|
|
1334
|
-
const [showNewFolderModal, setShowNewFolderModal] =
|
|
1335
|
-
const [showRenameFolderModal, setShowRenameFolderModal] =
|
|
1336
|
-
const [showMoveModal, setShowMoveModal] =
|
|
1337
|
-
const [showR2SetupModal, setShowR2SetupModal] =
|
|
1338
|
-
const [pushing, setPushing] =
|
|
1703
|
+
const [processCount, setProcessCount] = useState4(0);
|
|
1704
|
+
const [processMode, setProcessMode] = useState4("all");
|
|
1705
|
+
const [imagesToProcess, setImagesToProcess] = useState4([]);
|
|
1706
|
+
const [alertMessage, setAlertMessage] = useState4(null);
|
|
1707
|
+
const [showNewFolderModal, setShowNewFolderModal] = useState4(false);
|
|
1708
|
+
const [showRenameFolderModal, setShowRenameFolderModal] = useState4(false);
|
|
1709
|
+
const [showMoveModal, setShowMoveModal] = useState4(false);
|
|
1710
|
+
const [showR2SetupModal, setShowR2SetupModal] = useState4(false);
|
|
1711
|
+
const [pushing, setPushing] = useState4(false);
|
|
1339
1712
|
const isInImagesFolder = currentPath === "public/images" || currentPath.startsWith("public/images/");
|
|
1340
|
-
const handleUpload =
|
|
1713
|
+
const handleUpload = useCallback2(() => {
|
|
1341
1714
|
fileInputRef.current?.click();
|
|
1342
1715
|
}, []);
|
|
1343
|
-
const handleScan =
|
|
1716
|
+
const handleScan = useCallback2(async () => {
|
|
1344
1717
|
setScanning(true);
|
|
1345
1718
|
setProgressTitle("Scanning Files");
|
|
1346
1719
|
setShowProgress(true);
|
|
@@ -1425,7 +1798,7 @@ function StudioToolbar() {
|
|
|
1425
1798
|
handleScan();
|
|
1426
1799
|
}
|
|
1427
1800
|
}, [scanRequested, scanning, clearScanRequest, handleScan]);
|
|
1428
|
-
const handleFileChange =
|
|
1801
|
+
const handleFileChange = useCallback2(async (e) => {
|
|
1429
1802
|
const files = e.target.files;
|
|
1430
1803
|
if (!files || files.length === 0) return;
|
|
1431
1804
|
const fileList = Array.from(files);
|
|
@@ -1521,7 +1894,7 @@ function StudioToolbar() {
|
|
|
1521
1894
|
}
|
|
1522
1895
|
}
|
|
1523
1896
|
}, [currentPath, triggerRefresh]);
|
|
1524
|
-
const handleProcessImages =
|
|
1897
|
+
const handleProcessImages = useCallback2(async () => {
|
|
1525
1898
|
const hasSelection2 = selectedItems.size > 0;
|
|
1526
1899
|
if (hasSelection2) {
|
|
1527
1900
|
const selectedPaths2 = Array.from(selectedItems);
|
|
@@ -1581,7 +1954,7 @@ function StudioToolbar() {
|
|
|
1581
1954
|
}
|
|
1582
1955
|
}
|
|
1583
1956
|
}, [selectedItems]);
|
|
1584
|
-
const handleProcessConfirm =
|
|
1957
|
+
const handleProcessConfirm = useCallback2(async () => {
|
|
1585
1958
|
setShowProcessConfirm(false);
|
|
1586
1959
|
setProcessing(true);
|
|
1587
1960
|
abortControllerRef.current = new AbortController();
|
|
@@ -1732,16 +2105,16 @@ function StudioToolbar() {
|
|
|
1732
2105
|
abortControllerRef.current = null;
|
|
1733
2106
|
}
|
|
1734
2107
|
}, [processMode, processCount, imagesToProcess, clearSelection, triggerRefresh]);
|
|
1735
|
-
const handleStopProcessing =
|
|
2108
|
+
const handleStopProcessing = useCallback2(() => {
|
|
1736
2109
|
if (abortControllerRef.current) {
|
|
1737
2110
|
abortControllerRef.current.abort();
|
|
1738
2111
|
}
|
|
1739
2112
|
}, []);
|
|
1740
|
-
const handleDeleteClick =
|
|
2113
|
+
const handleDeleteClick = useCallback2(() => {
|
|
1741
2114
|
if (selectedItems.size === 0) return;
|
|
1742
2115
|
setShowDeleteConfirm(true);
|
|
1743
2116
|
}, [selectedItems]);
|
|
1744
|
-
const handleDeleteConfirm =
|
|
2117
|
+
const handleDeleteConfirm = useCallback2(async () => {
|
|
1745
2118
|
setShowDeleteConfirm(false);
|
|
1746
2119
|
try {
|
|
1747
2120
|
const response = await fetch("/api/studio/delete", {
|
|
@@ -1767,7 +2140,7 @@ function StudioToolbar() {
|
|
|
1767
2140
|
});
|
|
1768
2141
|
}
|
|
1769
2142
|
}, [selectedItems, clearSelection, triggerRefresh]);
|
|
1770
|
-
const handleSyncClick =
|
|
2143
|
+
const handleSyncClick = useCallback2(async () => {
|
|
1771
2144
|
if (selectedItems.size === 0) return;
|
|
1772
2145
|
const selectedPaths2 = Array.from(selectedItems);
|
|
1773
2146
|
const imageExtensions = ["jpg", "jpeg", "png", "gif", "webp", "svg", "ico", "bmp", "tiff", "tif"];
|
|
@@ -1802,7 +2175,7 @@ function StudioToolbar() {
|
|
|
1802
2175
|
setSyncImageCount(selectedImagePaths.length);
|
|
1803
2176
|
setShowSyncConfirm(true);
|
|
1804
2177
|
}, [selectedItems]);
|
|
1805
|
-
const handleSyncConfirm =
|
|
2178
|
+
const handleSyncConfirm = useCallback2(async () => {
|
|
1806
2179
|
setShowSyncConfirm(false);
|
|
1807
2180
|
const selectedPaths2 = Array.from(selectedItems);
|
|
1808
2181
|
const imageExtensions = ["jpg", "jpeg", "png", "gif", "webp", "svg", "ico", "bmp", "tiff", "tif"];
|
|
@@ -1900,7 +2273,7 @@ function StudioToolbar() {
|
|
|
1900
2273
|
});
|
|
1901
2274
|
}
|
|
1902
2275
|
}, [selectedItems, clearSelection, triggerRefresh]);
|
|
1903
|
-
const handleCreateFolder =
|
|
2276
|
+
const handleCreateFolder = useCallback2(async (folderName) => {
|
|
1904
2277
|
setShowNewFolderModal(false);
|
|
1905
2278
|
try {
|
|
1906
2279
|
const response = await fetch("/api/studio/create-folder", {
|
|
@@ -1925,11 +2298,11 @@ function StudioToolbar() {
|
|
|
1925
2298
|
});
|
|
1926
2299
|
}
|
|
1927
2300
|
}, [currentPath, triggerRefresh]);
|
|
1928
|
-
const handleMoveClick =
|
|
2301
|
+
const handleMoveClick = useCallback2(() => {
|
|
1929
2302
|
if (selectedItems.size === 0) return;
|
|
1930
2303
|
setShowMoveModal(true);
|
|
1931
2304
|
}, [selectedItems]);
|
|
1932
|
-
const handleMoveConfirm =
|
|
2305
|
+
const handleMoveConfirm = useCallback2(async (destination) => {
|
|
1933
2306
|
try {
|
|
1934
2307
|
const response = await fetch("/api/studio/move", {
|
|
1935
2308
|
method: "POST",
|
|
@@ -1961,10 +2334,10 @@ function StudioToolbar() {
|
|
|
1961
2334
|
}
|
|
1962
2335
|
}, [selectedItems, clearSelection, triggerRefresh]);
|
|
1963
2336
|
const { searchQuery, setSearchQuery } = useStudio();
|
|
1964
|
-
const handleSearch =
|
|
2337
|
+
const handleSearch = useCallback2((e) => {
|
|
1965
2338
|
setSearchQuery(e.target.value);
|
|
1966
2339
|
}, [setSearchQuery]);
|
|
1967
|
-
const handleSearchKeyDown =
|
|
2340
|
+
const handleSearchKeyDown = useCallback2((e) => {
|
|
1968
2341
|
if (e.key === "Escape") {
|
|
1969
2342
|
e.stopPropagation();
|
|
1970
2343
|
setSearchQuery("");
|
|
@@ -1976,7 +2349,7 @@ function StudioToolbar() {
|
|
|
1976
2349
|
const singleFolderSelected = selectedPaths.length === 1 && !selectedPaths[0].includes(".");
|
|
1977
2350
|
const selectedFolderPath = singleFolderSelected ? selectedPaths[0] : null;
|
|
1978
2351
|
const selectedFolderName = selectedFolderPath ? selectedFolderPath.split("/").pop() || "" : "";
|
|
1979
|
-
const handleRenameFolder =
|
|
2352
|
+
const handleRenameFolder = useCallback2(async (newName) => {
|
|
1980
2353
|
if (!selectedFolderPath) return;
|
|
1981
2354
|
setShowRenameFolderModal(false);
|
|
1982
2355
|
try {
|
|
@@ -1996,8 +2369,8 @@ function StudioToolbar() {
|
|
|
1996
2369
|
if (focusedItem) {
|
|
1997
2370
|
return null;
|
|
1998
2371
|
}
|
|
1999
|
-
return /* @__PURE__ */
|
|
2000
|
-
showDeleteConfirm && /* @__PURE__ */
|
|
2372
|
+
return /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
2373
|
+
showDeleteConfirm && /* @__PURE__ */ jsx5(
|
|
2001
2374
|
ConfirmModal,
|
|
2002
2375
|
{
|
|
2003
2376
|
title: "Delete Items",
|
|
@@ -2008,7 +2381,7 @@ function StudioToolbar() {
|
|
|
2008
2381
|
onCancel: () => setShowDeleteConfirm(false)
|
|
2009
2382
|
}
|
|
2010
2383
|
),
|
|
2011
|
-
showSyncConfirm && /* @__PURE__ */
|
|
2384
|
+
showSyncConfirm && /* @__PURE__ */ jsx5(
|
|
2012
2385
|
ConfirmModal,
|
|
2013
2386
|
{
|
|
2014
2387
|
title: "Push to CDN",
|
|
@@ -2018,7 +2391,7 @@ function StudioToolbar() {
|
|
|
2018
2391
|
onCancel: () => setShowSyncConfirm(false)
|
|
2019
2392
|
}
|
|
2020
2393
|
),
|
|
2021
|
-
showProcessConfirm && /* @__PURE__ */
|
|
2394
|
+
showProcessConfirm && /* @__PURE__ */ jsx5(
|
|
2022
2395
|
ConfirmModal,
|
|
2023
2396
|
{
|
|
2024
2397
|
title: "Process Images",
|
|
@@ -2028,7 +2401,7 @@ function StudioToolbar() {
|
|
|
2028
2401
|
onCancel: () => setShowProcessConfirm(false)
|
|
2029
2402
|
}
|
|
2030
2403
|
),
|
|
2031
|
-
showProgress && /* @__PURE__ */
|
|
2404
|
+
showProgress && /* @__PURE__ */ jsx5(
|
|
2032
2405
|
ProgressModal,
|
|
2033
2406
|
{
|
|
2034
2407
|
title: progressTitle,
|
|
@@ -2045,7 +2418,7 @@ function StudioToolbar() {
|
|
|
2045
2418
|
}
|
|
2046
2419
|
}
|
|
2047
2420
|
),
|
|
2048
|
-
showNewFolderModal && /* @__PURE__ */
|
|
2421
|
+
showNewFolderModal && /* @__PURE__ */ jsx5(
|
|
2049
2422
|
InputModal,
|
|
2050
2423
|
{
|
|
2051
2424
|
title: "New Folder",
|
|
@@ -2056,7 +2429,7 @@ function StudioToolbar() {
|
|
|
2056
2429
|
onCancel: () => setShowNewFolderModal(false)
|
|
2057
2430
|
}
|
|
2058
2431
|
),
|
|
2059
|
-
showMoveModal && /* @__PURE__ */
|
|
2432
|
+
showMoveModal && /* @__PURE__ */ jsx5(
|
|
2060
2433
|
StudioFolderPicker,
|
|
2061
2434
|
{
|
|
2062
2435
|
selectedItems,
|
|
@@ -2068,7 +2441,7 @@ function StudioToolbar() {
|
|
|
2068
2441
|
onCancel: () => setShowMoveModal(false)
|
|
2069
2442
|
}
|
|
2070
2443
|
),
|
|
2071
|
-
showRenameFolderModal && selectedFolderPath && /* @__PURE__ */
|
|
2444
|
+
showRenameFolderModal && selectedFolderPath && /* @__PURE__ */ jsx5(
|
|
2072
2445
|
InputModal,
|
|
2073
2446
|
{
|
|
2074
2447
|
title: "Rename Folder",
|
|
@@ -2080,7 +2453,7 @@ function StudioToolbar() {
|
|
|
2080
2453
|
onCancel: () => setShowRenameFolderModal(false)
|
|
2081
2454
|
}
|
|
2082
2455
|
),
|
|
2083
|
-
alertMessage && /* @__PURE__ */
|
|
2456
|
+
alertMessage && /* @__PURE__ */ jsx5(
|
|
2084
2457
|
AlertModal,
|
|
2085
2458
|
{
|
|
2086
2459
|
title: alertMessage.title,
|
|
@@ -2088,15 +2461,26 @@ function StudioToolbar() {
|
|
|
2088
2461
|
onClose: () => setAlertMessage(null)
|
|
2089
2462
|
}
|
|
2090
2463
|
),
|
|
2091
|
-
/* @__PURE__ */
|
|
2464
|
+
/* @__PURE__ */ jsx5(
|
|
2092
2465
|
R2SetupModal,
|
|
2093
2466
|
{
|
|
2094
2467
|
isOpen: showR2SetupModal,
|
|
2095
2468
|
onClose: () => setShowR2SetupModal(false)
|
|
2096
2469
|
}
|
|
2097
2470
|
),
|
|
2098
|
-
/* @__PURE__ */
|
|
2099
|
-
|
|
2471
|
+
showAddNewModal && /* @__PURE__ */ jsx5(
|
|
2472
|
+
AddNewModal,
|
|
2473
|
+
{
|
|
2474
|
+
currentPath,
|
|
2475
|
+
onClose: () => setShowAddNewModal(false),
|
|
2476
|
+
onUploadComplete: () => {
|
|
2477
|
+
setShowAddNewModal(false);
|
|
2478
|
+
triggerRefresh();
|
|
2479
|
+
}
|
|
2480
|
+
}
|
|
2481
|
+
),
|
|
2482
|
+
/* @__PURE__ */ jsxs5("div", { css: styles5.toolbar, children: [
|
|
2483
|
+
/* @__PURE__ */ jsx5(
|
|
2100
2484
|
"input",
|
|
2101
2485
|
{
|
|
2102
2486
|
ref: fileInputRef,
|
|
@@ -2107,87 +2491,87 @@ function StudioToolbar() {
|
|
|
2107
2491
|
style: { display: "none" }
|
|
2108
2492
|
}
|
|
2109
2493
|
),
|
|
2110
|
-
/* @__PURE__ */
|
|
2111
|
-
/* @__PURE__ */
|
|
2494
|
+
/* @__PURE__ */ jsxs5("div", { css: styles5.left, children: [
|
|
2495
|
+
/* @__PURE__ */ jsxs5(
|
|
2112
2496
|
"button",
|
|
2113
2497
|
{
|
|
2114
|
-
css: [
|
|
2115
|
-
onClick:
|
|
2498
|
+
css: [styles5.btn, styles5.btnPrimary],
|
|
2499
|
+
onClick: () => setShowAddNewModal(true),
|
|
2116
2500
|
disabled: uploading || isInImagesFolder,
|
|
2117
2501
|
children: [
|
|
2118
|
-
/* @__PURE__ */
|
|
2119
|
-
|
|
2502
|
+
/* @__PURE__ */ jsx5(UploadIcon, {}),
|
|
2503
|
+
"Add New"
|
|
2120
2504
|
]
|
|
2121
2505
|
}
|
|
2122
2506
|
),
|
|
2123
|
-
/* @__PURE__ */
|
|
2507
|
+
/* @__PURE__ */ jsxs5(
|
|
2124
2508
|
"button",
|
|
2125
2509
|
{
|
|
2126
|
-
css:
|
|
2510
|
+
css: styles5.btn,
|
|
2127
2511
|
onClick: () => singleFolderSelected ? setShowRenameFolderModal(true) : setShowNewFolderModal(true),
|
|
2128
2512
|
disabled: isInImagesFolder && !singleFolderSelected,
|
|
2129
2513
|
title: isInImagesFolder && !singleFolderSelected ? "Cannot create folders in protected images folder" : void 0,
|
|
2130
2514
|
children: [
|
|
2131
|
-
singleFolderSelected ? /* @__PURE__ */
|
|
2515
|
+
singleFolderSelected ? /* @__PURE__ */ jsx5(RenameIcon, {}) : /* @__PURE__ */ jsx5(FolderPlusIcon, {}),
|
|
2132
2516
|
singleFolderSelected ? "Rename Folder" : "New Folder"
|
|
2133
2517
|
]
|
|
2134
2518
|
}
|
|
2135
2519
|
),
|
|
2136
|
-
/* @__PURE__ */
|
|
2137
|
-
/* @__PURE__ */
|
|
2520
|
+
/* @__PURE__ */ jsx5("div", { css: styles5.divider }),
|
|
2521
|
+
/* @__PURE__ */ jsxs5(
|
|
2138
2522
|
"button",
|
|
2139
2523
|
{
|
|
2140
|
-
css:
|
|
2524
|
+
css: styles5.btn,
|
|
2141
2525
|
onClick: handleProcessImages,
|
|
2142
2526
|
disabled: processing || isInImagesFolder,
|
|
2143
2527
|
title: isInImagesFolder ? "Cannot process images folder" : void 0,
|
|
2144
2528
|
children: [
|
|
2145
|
-
/* @__PURE__ */
|
|
2529
|
+
/* @__PURE__ */ jsx5(ImageStackIcon, {}),
|
|
2146
2530
|
processing ? "Processing..." : "Process Images"
|
|
2147
2531
|
]
|
|
2148
2532
|
}
|
|
2149
2533
|
),
|
|
2150
|
-
/* @__PURE__ */
|
|
2534
|
+
/* @__PURE__ */ jsxs5(
|
|
2151
2535
|
"button",
|
|
2152
2536
|
{
|
|
2153
|
-
css: [
|
|
2537
|
+
css: [styles5.btn, styles5.btnDanger],
|
|
2154
2538
|
onClick: handleDeleteClick,
|
|
2155
2539
|
disabled: !hasSelection,
|
|
2156
2540
|
children: [
|
|
2157
|
-
/* @__PURE__ */
|
|
2541
|
+
/* @__PURE__ */ jsx5(TrashIcon, {}),
|
|
2158
2542
|
"Delete"
|
|
2159
2543
|
]
|
|
2160
2544
|
}
|
|
2161
2545
|
),
|
|
2162
|
-
/* @__PURE__ */
|
|
2546
|
+
/* @__PURE__ */ jsxs5(
|
|
2163
2547
|
"button",
|
|
2164
2548
|
{
|
|
2165
|
-
css:
|
|
2549
|
+
css: styles5.btn,
|
|
2166
2550
|
onClick: handleMoveClick,
|
|
2167
2551
|
disabled: !hasSelection,
|
|
2168
2552
|
children: [
|
|
2169
|
-
/* @__PURE__ */
|
|
2553
|
+
/* @__PURE__ */ jsx5(MoveIcon, {}),
|
|
2170
2554
|
"Move"
|
|
2171
2555
|
]
|
|
2172
2556
|
}
|
|
2173
2557
|
),
|
|
2174
|
-
/* @__PURE__ */
|
|
2558
|
+
/* @__PURE__ */ jsxs5(
|
|
2175
2559
|
"button",
|
|
2176
2560
|
{
|
|
2177
|
-
css:
|
|
2561
|
+
css: styles5.btn,
|
|
2178
2562
|
onClick: handleSyncClick,
|
|
2179
2563
|
disabled: !hasSelection,
|
|
2180
2564
|
children: [
|
|
2181
|
-
/* @__PURE__ */
|
|
2565
|
+
/* @__PURE__ */ jsx5(CloudIcon, {}),
|
|
2182
2566
|
"Push CDN"
|
|
2183
2567
|
]
|
|
2184
2568
|
}
|
|
2185
2569
|
),
|
|
2186
|
-
/* @__PURE__ */
|
|
2187
|
-
/* @__PURE__ */
|
|
2570
|
+
/* @__PURE__ */ jsxs5("div", { css: styles5.searchWrapper, children: [
|
|
2571
|
+
/* @__PURE__ */ jsx5(
|
|
2188
2572
|
"input",
|
|
2189
2573
|
{
|
|
2190
|
-
css:
|
|
2574
|
+
css: styles5.searchInput,
|
|
2191
2575
|
type: "text",
|
|
2192
2576
|
placeholder: "Search images...",
|
|
2193
2577
|
value: searchQuery,
|
|
@@ -2195,52 +2579,52 @@ function StudioToolbar() {
|
|
|
2195
2579
|
onKeyDown: handleSearchKeyDown
|
|
2196
2580
|
}
|
|
2197
2581
|
),
|
|
2198
|
-
searchQuery && /* @__PURE__ */
|
|
2582
|
+
searchQuery && /* @__PURE__ */ jsx5(
|
|
2199
2583
|
"button",
|
|
2200
2584
|
{
|
|
2201
|
-
css:
|
|
2585
|
+
css: styles5.searchClearBtn,
|
|
2202
2586
|
onClick: () => setSearchQuery(""),
|
|
2203
2587
|
title: "Clear search",
|
|
2204
|
-
children: /* @__PURE__ */
|
|
2588
|
+
children: /* @__PURE__ */ jsx5("svg", { width: "14", height: "14", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
2205
2589
|
}
|
|
2206
2590
|
)
|
|
2207
2591
|
] })
|
|
2208
2592
|
] }),
|
|
2209
|
-
/* @__PURE__ */
|
|
2210
|
-
hasSelection && /* @__PURE__ */
|
|
2593
|
+
/* @__PURE__ */ jsxs5("div", { css: styles5.right, children: [
|
|
2594
|
+
hasSelection && /* @__PURE__ */ jsxs5("span", { css: styles5.selectionCount, children: [
|
|
2211
2595
|
selectedItems.size,
|
|
2212
2596
|
" selected",
|
|
2213
|
-
/* @__PURE__ */
|
|
2597
|
+
/* @__PURE__ */ jsx5("button", { css: styles5.clearBtn, onClick: clearSelection, children: "Clear" })
|
|
2214
2598
|
] }),
|
|
2215
|
-
/* @__PURE__ */
|
|
2599
|
+
/* @__PURE__ */ jsxs5(
|
|
2216
2600
|
"button",
|
|
2217
2601
|
{
|
|
2218
|
-
css:
|
|
2602
|
+
css: styles5.btn,
|
|
2219
2603
|
onClick: handleScan,
|
|
2220
2604
|
disabled: scanning,
|
|
2221
2605
|
children: [
|
|
2222
|
-
/* @__PURE__ */
|
|
2606
|
+
/* @__PURE__ */ jsx5(ScanIcon, { spinning: scanning }),
|
|
2223
2607
|
"Scan"
|
|
2224
2608
|
]
|
|
2225
2609
|
}
|
|
2226
2610
|
),
|
|
2227
|
-
/* @__PURE__ */
|
|
2228
|
-
/* @__PURE__ */
|
|
2611
|
+
/* @__PURE__ */ jsxs5("div", { css: styles5.viewToggle, children: [
|
|
2612
|
+
/* @__PURE__ */ jsx5(
|
|
2229
2613
|
"button",
|
|
2230
2614
|
{
|
|
2231
|
-
css: [
|
|
2615
|
+
css: [styles5.viewBtn, viewMode === "grid" && styles5.viewBtnActive],
|
|
2232
2616
|
onClick: () => setViewMode("grid"),
|
|
2233
2617
|
"aria-label": "Grid view",
|
|
2234
|
-
children: /* @__PURE__ */
|
|
2618
|
+
children: /* @__PURE__ */ jsx5(GridIcon, {})
|
|
2235
2619
|
}
|
|
2236
2620
|
),
|
|
2237
|
-
/* @__PURE__ */
|
|
2621
|
+
/* @__PURE__ */ jsx5(
|
|
2238
2622
|
"button",
|
|
2239
2623
|
{
|
|
2240
|
-
css: [
|
|
2624
|
+
css: [styles5.viewBtn, viewMode === "list" && styles5.viewBtnActive],
|
|
2241
2625
|
onClick: () => setViewMode("list"),
|
|
2242
2626
|
"aria-label": "List view",
|
|
2243
|
-
children: /* @__PURE__ */
|
|
2627
|
+
children: /* @__PURE__ */ jsx5(ListIcon, {})
|
|
2244
2628
|
}
|
|
2245
2629
|
)
|
|
2246
2630
|
] })
|
|
@@ -2249,42 +2633,42 @@ function StudioToolbar() {
|
|
|
2249
2633
|
] });
|
|
2250
2634
|
}
|
|
2251
2635
|
function UploadIcon() {
|
|
2252
|
-
return /* @__PURE__ */
|
|
2636
|
+
return /* @__PURE__ */ jsx5("svg", { css: styles5.icon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" }) });
|
|
2253
2637
|
}
|
|
2254
2638
|
function ScanIcon({ spinning }) {
|
|
2255
|
-
return /* @__PURE__ */
|
|
2639
|
+
return /* @__PURE__ */ jsx5("svg", { css: [styles5.icon, spinning && styles5.iconSpin], fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" }) });
|
|
2256
2640
|
}
|
|
2257
2641
|
function TrashIcon() {
|
|
2258
|
-
return /* @__PURE__ */
|
|
2642
|
+
return /* @__PURE__ */ jsx5("svg", { css: styles5.icon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }) });
|
|
2259
2643
|
}
|
|
2260
2644
|
function FolderPlusIcon() {
|
|
2261
|
-
return /* @__PURE__ */
|
|
2645
|
+
return /* @__PURE__ */ jsx5("svg", { css: styles5.icon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z" }) });
|
|
2262
2646
|
}
|
|
2263
2647
|
function RenameIcon() {
|
|
2264
|
-
return /* @__PURE__ */
|
|
2648
|
+
return /* @__PURE__ */ jsx5("svg", { css: styles5.icon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) });
|
|
2265
2649
|
}
|
|
2266
2650
|
function MoveIcon() {
|
|
2267
|
-
return /* @__PURE__ */
|
|
2651
|
+
return /* @__PURE__ */ jsx5("svg", { css: styles5.icon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4" }) });
|
|
2268
2652
|
}
|
|
2269
2653
|
function CloudIcon() {
|
|
2270
|
-
return /* @__PURE__ */
|
|
2654
|
+
return /* @__PURE__ */ jsx5("svg", { css: styles5.icon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" }) });
|
|
2271
2655
|
}
|
|
2272
2656
|
function GridIcon() {
|
|
2273
|
-
return /* @__PURE__ */
|
|
2657
|
+
return /* @__PURE__ */ jsx5("svg", { css: styles5.icon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z" }) });
|
|
2274
2658
|
}
|
|
2275
2659
|
function ListIcon() {
|
|
2276
|
-
return /* @__PURE__ */
|
|
2660
|
+
return /* @__PURE__ */ jsx5("svg", { css: styles5.icon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) });
|
|
2277
2661
|
}
|
|
2278
2662
|
function ImageStackIcon() {
|
|
2279
|
-
return /* @__PURE__ */
|
|
2663
|
+
return /* @__PURE__ */ jsx5("svg", { css: styles5.icon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) });
|
|
2280
2664
|
}
|
|
2281
2665
|
|
|
2282
2666
|
// src/components/StudioFileGrid.tsx
|
|
2283
|
-
import { useState as
|
|
2284
|
-
import { css as
|
|
2667
|
+
import { useState as useState6 } from "react";
|
|
2668
|
+
import { css as css6, keyframes as keyframes5 } from "@emotion/react";
|
|
2285
2669
|
|
|
2286
2670
|
// src/hooks/useFileList.ts
|
|
2287
|
-
import { useEffect as useEffect3, useState as
|
|
2671
|
+
import { useEffect as useEffect3, useState as useState5, useRef as useRef3, useCallback as useCallback3 } from "react";
|
|
2288
2672
|
|
|
2289
2673
|
// src/lib/api.ts
|
|
2290
2674
|
var StudioApiClient = class {
|
|
@@ -2384,11 +2768,11 @@ function useFileList() {
|
|
|
2384
2768
|
searchQuery,
|
|
2385
2769
|
showError
|
|
2386
2770
|
} = useStudio();
|
|
2387
|
-
const [items, setItems] =
|
|
2388
|
-
const [loading, setLoading] =
|
|
2389
|
-
const [metaEmpty, setMetaEmpty] =
|
|
2390
|
-
const isInitialLoad =
|
|
2391
|
-
const lastPath =
|
|
2771
|
+
const [items, setItems] = useState5([]);
|
|
2772
|
+
const [loading, setLoading] = useState5(true);
|
|
2773
|
+
const [metaEmpty, setMetaEmpty] = useState5(false);
|
|
2774
|
+
const isInitialLoad = useRef3(true);
|
|
2775
|
+
const lastPath = useRef3(currentPath);
|
|
2392
2776
|
useEffect3(() => {
|
|
2393
2777
|
async function loadItems() {
|
|
2394
2778
|
const isPathChange = lastPath.current !== currentPath;
|
|
@@ -2420,21 +2804,21 @@ function useFileList() {
|
|
|
2420
2804
|
});
|
|
2421
2805
|
const allItemsSelected = sortedItems.length > 0 && sortedItems.every((item) => selectedItems.has(item.path));
|
|
2422
2806
|
const someItemsSelected = sortedItems.some((item) => selectedItems.has(item.path));
|
|
2423
|
-
const handleItemClick =
|
|
2807
|
+
const handleItemClick = useCallback3((item, e) => {
|
|
2424
2808
|
if (e.shiftKey && lastSelectedPath) {
|
|
2425
2809
|
selectRange(lastSelectedPath, item.path, sortedItems);
|
|
2426
2810
|
} else {
|
|
2427
2811
|
toggleSelection(item.path);
|
|
2428
2812
|
}
|
|
2429
2813
|
}, [lastSelectedPath, selectRange, sortedItems, toggleSelection]);
|
|
2430
|
-
const handleOpen =
|
|
2814
|
+
const handleOpen = useCallback3((item) => {
|
|
2431
2815
|
if (item.type === "folder") {
|
|
2432
2816
|
setCurrentPath(item.path);
|
|
2433
2817
|
} else {
|
|
2434
2818
|
setFocusedItem(item);
|
|
2435
2819
|
}
|
|
2436
2820
|
}, [setCurrentPath, setFocusedItem]);
|
|
2437
|
-
const handleGenerateThumbnail =
|
|
2821
|
+
const handleGenerateThumbnail = useCallback3(async (item) => {
|
|
2438
2822
|
try {
|
|
2439
2823
|
const imageKey = "/" + item.path.replace(/^public\//, "");
|
|
2440
2824
|
await studioApi.reprocess([imageKey]);
|
|
@@ -2444,7 +2828,7 @@ function useFileList() {
|
|
|
2444
2828
|
showError("Processing Error", message);
|
|
2445
2829
|
}
|
|
2446
2830
|
}, [triggerRefresh, showError]);
|
|
2447
|
-
const handleSelectAll =
|
|
2831
|
+
const handleSelectAll = useCallback3(() => {
|
|
2448
2832
|
if (allItemsSelected) {
|
|
2449
2833
|
clearSelection();
|
|
2450
2834
|
} else {
|
|
@@ -2476,19 +2860,19 @@ function useFileList() {
|
|
|
2476
2860
|
}
|
|
2477
2861
|
|
|
2478
2862
|
// src/components/StudioFileGrid.tsx
|
|
2479
|
-
import { jsx as
|
|
2480
|
-
var spin2 =
|
|
2863
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "@emotion/react/jsx-runtime";
|
|
2864
|
+
var spin2 = keyframes5`
|
|
2481
2865
|
to { transform: rotate(360deg); }
|
|
2482
2866
|
`;
|
|
2483
|
-
var
|
|
2484
|
-
loading:
|
|
2867
|
+
var styles6 = {
|
|
2868
|
+
loading: css6`
|
|
2485
2869
|
display: flex;
|
|
2486
2870
|
align-items: center;
|
|
2487
2871
|
justify-content: center;
|
|
2488
2872
|
flex: 1;
|
|
2489
2873
|
min-height: 300px;
|
|
2490
2874
|
`,
|
|
2491
|
-
spinner:
|
|
2875
|
+
spinner: css6`
|
|
2492
2876
|
width: 32px;
|
|
2493
2877
|
height: 32px;
|
|
2494
2878
|
border-radius: 50%;
|
|
@@ -2496,7 +2880,7 @@ var styles5 = {
|
|
|
2496
2880
|
border-top-color: ${colors.primary};
|
|
2497
2881
|
animation: ${spin2} 0.8s linear infinite;
|
|
2498
2882
|
`,
|
|
2499
|
-
empty:
|
|
2883
|
+
empty: css6`
|
|
2500
2884
|
display: flex;
|
|
2501
2885
|
flex-direction: column;
|
|
2502
2886
|
align-items: center;
|
|
@@ -2505,13 +2889,13 @@ var styles5 = {
|
|
|
2505
2889
|
min-height: 300px;
|
|
2506
2890
|
color: ${colors.textSecondary};
|
|
2507
2891
|
`,
|
|
2508
|
-
emptyIcon:
|
|
2892
|
+
emptyIcon: css6`
|
|
2509
2893
|
width: 48px;
|
|
2510
2894
|
height: 48px;
|
|
2511
2895
|
margin-bottom: 16px;
|
|
2512
2896
|
opacity: 0.5;
|
|
2513
2897
|
`,
|
|
2514
|
-
emptyText:
|
|
2898
|
+
emptyText: css6`
|
|
2515
2899
|
font-size: ${fontSize.base};
|
|
2516
2900
|
margin: 0 0 4px 0;
|
|
2517
2901
|
|
|
@@ -2520,7 +2904,7 @@ var styles5 = {
|
|
|
2520
2904
|
font-size: ${fontSize.sm};
|
|
2521
2905
|
}
|
|
2522
2906
|
`,
|
|
2523
|
-
scanButton:
|
|
2907
|
+
scanButton: css6`
|
|
2524
2908
|
margin-top: 16px;
|
|
2525
2909
|
padding: 10px 24px;
|
|
2526
2910
|
font-size: ${fontSize.base};
|
|
@@ -2541,7 +2925,7 @@ var styles5 = {
|
|
|
2541
2925
|
cursor: not-allowed;
|
|
2542
2926
|
}
|
|
2543
2927
|
`,
|
|
2544
|
-
grid:
|
|
2928
|
+
grid: css6`
|
|
2545
2929
|
display: grid;
|
|
2546
2930
|
grid-template-columns: 1fr;
|
|
2547
2931
|
gap: 12px;
|
|
@@ -2551,7 +2935,7 @@ var styles5 = {
|
|
|
2551
2935
|
@media (min-width: 1024px) { grid-template-columns: repeat(4, 1fr); }
|
|
2552
2936
|
@media (min-width: 1280px) { grid-template-columns: repeat(5, 1fr); }
|
|
2553
2937
|
`,
|
|
2554
|
-
item:
|
|
2938
|
+
item: css6`
|
|
2555
2939
|
position: relative;
|
|
2556
2940
|
border-radius: 8px;
|
|
2557
2941
|
border: 1px solid ${colors.border};
|
|
@@ -2567,7 +2951,7 @@ var styles5 = {
|
|
|
2567
2951
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
|
|
2568
2952
|
}
|
|
2569
2953
|
`,
|
|
2570
|
-
itemSelected:
|
|
2954
|
+
itemSelected: css6`
|
|
2571
2955
|
border-color: ${colors.primary};
|
|
2572
2956
|
box-shadow: 0 0 0 1px ${colors.primary};
|
|
2573
2957
|
|
|
@@ -2576,14 +2960,14 @@ var styles5 = {
|
|
|
2576
2960
|
box-shadow: 0 0 0 1px ${colors.primary};
|
|
2577
2961
|
}
|
|
2578
2962
|
`,
|
|
2579
|
-
parentItem:
|
|
2963
|
+
parentItem: css6`
|
|
2580
2964
|
cursor: pointer;
|
|
2581
2965
|
|
|
2582
2966
|
&:hover {
|
|
2583
2967
|
border-color: ${colors.primary};
|
|
2584
2968
|
}
|
|
2585
2969
|
`,
|
|
2586
|
-
checkboxWrapper:
|
|
2970
|
+
checkboxWrapper: css6`
|
|
2587
2971
|
position: absolute;
|
|
2588
2972
|
top: 0;
|
|
2589
2973
|
left: 0;
|
|
@@ -2591,13 +2975,13 @@ var styles5 = {
|
|
|
2591
2975
|
padding: 8px;
|
|
2592
2976
|
cursor: pointer;
|
|
2593
2977
|
`,
|
|
2594
|
-
checkbox:
|
|
2978
|
+
checkbox: css6`
|
|
2595
2979
|
width: 18px;
|
|
2596
2980
|
height: 18px;
|
|
2597
2981
|
accent-color: ${colors.primary};
|
|
2598
2982
|
cursor: pointer;
|
|
2599
2983
|
`,
|
|
2600
|
-
cdnBadge:
|
|
2984
|
+
cdnBadge: css6`
|
|
2601
2985
|
position: absolute;
|
|
2602
2986
|
top: 8px;
|
|
2603
2987
|
right: 8px;
|
|
@@ -2609,7 +2993,7 @@ var styles5 = {
|
|
|
2609
2993
|
padding: 2px 8px;
|
|
2610
2994
|
border-radius: 4px;
|
|
2611
2995
|
`,
|
|
2612
|
-
content:
|
|
2996
|
+
content: css6`
|
|
2613
2997
|
position: relative;
|
|
2614
2998
|
aspect-ratio: 1;
|
|
2615
2999
|
display: flex;
|
|
@@ -2618,20 +3002,20 @@ var styles5 = {
|
|
|
2618
3002
|
padding: 16px;
|
|
2619
3003
|
background: ${colors.background};
|
|
2620
3004
|
`,
|
|
2621
|
-
folderIcon:
|
|
3005
|
+
folderIcon: css6`
|
|
2622
3006
|
width: 56px;
|
|
2623
3007
|
height: 56px;
|
|
2624
3008
|
color: #f9935e;
|
|
2625
3009
|
`,
|
|
2626
|
-
imagesFolderIcon:
|
|
3010
|
+
imagesFolderIcon: css6`
|
|
2627
3011
|
width: 56px;
|
|
2628
3012
|
height: 56px;
|
|
2629
3013
|
color: ${colors.imagesFolder};
|
|
2630
3014
|
`,
|
|
2631
|
-
imagesFolderWrapper:
|
|
3015
|
+
imagesFolderWrapper: css6`
|
|
2632
3016
|
position: relative;
|
|
2633
3017
|
`,
|
|
2634
|
-
lockIcon:
|
|
3018
|
+
lockIcon: css6`
|
|
2635
3019
|
position: absolute;
|
|
2636
3020
|
bottom: 4px;
|
|
2637
3021
|
right: 4px;
|
|
@@ -2642,23 +3026,23 @@ var styles5 = {
|
|
|
2642
3026
|
border-radius: 50%;
|
|
2643
3027
|
padding: 2px;
|
|
2644
3028
|
`,
|
|
2645
|
-
parentIcon:
|
|
3029
|
+
parentIcon: css6`
|
|
2646
3030
|
width: 56px;
|
|
2647
3031
|
height: 56px;
|
|
2648
3032
|
color: ${colors.textMuted};
|
|
2649
3033
|
`,
|
|
2650
|
-
fileIcon:
|
|
3034
|
+
fileIcon: css6`
|
|
2651
3035
|
width: 40px;
|
|
2652
3036
|
height: 40px;
|
|
2653
3037
|
color: ${colors.textMuted};
|
|
2654
3038
|
`,
|
|
2655
|
-
image:
|
|
3039
|
+
image: css6`
|
|
2656
3040
|
max-width: 100%;
|
|
2657
3041
|
max-height: 100%;
|
|
2658
3042
|
object-fit: contain;
|
|
2659
3043
|
border-radius: 4px;
|
|
2660
3044
|
`,
|
|
2661
|
-
noThumbnail:
|
|
3045
|
+
noThumbnail: css6`
|
|
2662
3046
|
display: flex;
|
|
2663
3047
|
flex-direction: column;
|
|
2664
3048
|
align-items: center;
|
|
@@ -2678,31 +3062,31 @@ var styles5 = {
|
|
|
2678
3062
|
background: ${colors.surfaceHover};
|
|
2679
3063
|
}
|
|
2680
3064
|
`,
|
|
2681
|
-
noThumbnailIcon:
|
|
3065
|
+
noThumbnailIcon: css6`
|
|
2682
3066
|
width: 32px;
|
|
2683
3067
|
height: 32px;
|
|
2684
3068
|
color: ${colors.textMuted};
|
|
2685
3069
|
`,
|
|
2686
|
-
noThumbnailText:
|
|
3070
|
+
noThumbnailText: css6`
|
|
2687
3071
|
font-size: ${fontSize.xs};
|
|
2688
3072
|
color: ${colors.textMuted};
|
|
2689
3073
|
text-align: center;
|
|
2690
3074
|
`,
|
|
2691
|
-
label:
|
|
3075
|
+
label: css6`
|
|
2692
3076
|
padding: 10px 12px;
|
|
2693
3077
|
background-color: ${colors.surface};
|
|
2694
3078
|
border-top: 1px solid ${colors.borderLight};
|
|
2695
3079
|
`,
|
|
2696
|
-
labelRow:
|
|
3080
|
+
labelRow: css6`
|
|
2697
3081
|
display: flex;
|
|
2698
3082
|
flex-direction: column;
|
|
2699
3083
|
gap: 2px;
|
|
2700
3084
|
`,
|
|
2701
|
-
labelText:
|
|
3085
|
+
labelText: css6`
|
|
2702
3086
|
flex: 1;
|
|
2703
3087
|
min-width: 0;
|
|
2704
3088
|
`,
|
|
2705
|
-
copyBtn:
|
|
3089
|
+
copyBtn: css6`
|
|
2706
3090
|
position: absolute;
|
|
2707
3091
|
top: 4px;
|
|
2708
3092
|
right: 4px;
|
|
@@ -2724,11 +3108,11 @@ var styles5 = {
|
|
|
2724
3108
|
color: ${colors.text};
|
|
2725
3109
|
}
|
|
2726
3110
|
`,
|
|
2727
|
-
copyIcon:
|
|
3111
|
+
copyIcon: css6`
|
|
2728
3112
|
width: 18px;
|
|
2729
3113
|
height: 18px;
|
|
2730
3114
|
`,
|
|
2731
|
-
tooltip:
|
|
3115
|
+
tooltip: css6`
|
|
2732
3116
|
position: absolute;
|
|
2733
3117
|
top: 50%;
|
|
2734
3118
|
right: 100%;
|
|
@@ -2753,7 +3137,7 @@ var styles5 = {
|
|
|
2753
3137
|
border-left-color: #1a1f36;
|
|
2754
3138
|
}
|
|
2755
3139
|
`,
|
|
2756
|
-
openBtn:
|
|
3140
|
+
openBtn: css6`
|
|
2757
3141
|
position: absolute;
|
|
2758
3142
|
bottom: 8px;
|
|
2759
3143
|
right: 8px;
|
|
@@ -2777,7 +3161,7 @@ var styles5 = {
|
|
|
2777
3161
|
border-color: ${colors.primary};
|
|
2778
3162
|
}
|
|
2779
3163
|
`,
|
|
2780
|
-
name:
|
|
3164
|
+
name: css6`
|
|
2781
3165
|
font-size: ${fontSize.sm};
|
|
2782
3166
|
font-weight: 500;
|
|
2783
3167
|
color: ${colors.text};
|
|
@@ -2787,12 +3171,12 @@ var styles5 = {
|
|
|
2787
3171
|
margin: 0;
|
|
2788
3172
|
letter-spacing: -0.01em;
|
|
2789
3173
|
`,
|
|
2790
|
-
size:
|
|
3174
|
+
size: css6`
|
|
2791
3175
|
font-size: ${fontSize.xs};
|
|
2792
3176
|
color: ${colors.textMuted};
|
|
2793
3177
|
margin: 2px 0 0 0;
|
|
2794
3178
|
`,
|
|
2795
|
-
selectAllRow:
|
|
3179
|
+
selectAllRow: css6`
|
|
2796
3180
|
display: flex;
|
|
2797
3181
|
align-items: center;
|
|
2798
3182
|
margin-bottom: 16px;
|
|
@@ -2801,7 +3185,7 @@ var styles5 = {
|
|
|
2801
3185
|
border-radius: 8px;
|
|
2802
3186
|
border: 1px solid ${colors.border};
|
|
2803
3187
|
`,
|
|
2804
|
-
selectAllLabel:
|
|
3188
|
+
selectAllLabel: css6`
|
|
2805
3189
|
display: flex;
|
|
2806
3190
|
align-items: center;
|
|
2807
3191
|
gap: 10px;
|
|
@@ -2814,7 +3198,7 @@ var styles5 = {
|
|
|
2814
3198
|
color: ${colors.text};
|
|
2815
3199
|
}
|
|
2816
3200
|
`,
|
|
2817
|
-
selectAllCheckbox:
|
|
3201
|
+
selectAllCheckbox: css6`
|
|
2818
3202
|
width: 16px;
|
|
2819
3203
|
height: 16px;
|
|
2820
3204
|
accent-color: ${colors.primary};
|
|
@@ -2838,17 +3222,17 @@ function StudioFileGrid() {
|
|
|
2838
3222
|
triggerScan
|
|
2839
3223
|
} = useFileList();
|
|
2840
3224
|
if (loading) {
|
|
2841
|
-
return /* @__PURE__ */
|
|
3225
|
+
return /* @__PURE__ */ jsx6("div", { css: styles6.loading, children: /* @__PURE__ */ jsx6("div", { css: styles6.spinner }) });
|
|
2842
3226
|
}
|
|
2843
3227
|
if (metaEmpty && isAtRoot) {
|
|
2844
|
-
return /* @__PURE__ */
|
|
2845
|
-
/* @__PURE__ */
|
|
2846
|
-
/* @__PURE__ */
|
|
2847
|
-
/* @__PURE__ */
|
|
2848
|
-
/* @__PURE__ */
|
|
3228
|
+
return /* @__PURE__ */ jsxs6("div", { css: styles6.empty, children: [
|
|
3229
|
+
/* @__PURE__ */ jsx6("svg", { css: styles6.emptyIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }),
|
|
3230
|
+
/* @__PURE__ */ jsx6("p", { css: styles6.emptyText, children: "No files tracked yet" }),
|
|
3231
|
+
/* @__PURE__ */ jsx6("p", { css: styles6.emptyText, children: "Click Scan to discover files in your public folder" }),
|
|
3232
|
+
/* @__PURE__ */ jsx6(
|
|
2849
3233
|
"button",
|
|
2850
3234
|
{
|
|
2851
|
-
css:
|
|
3235
|
+
css: styles6.scanButton,
|
|
2852
3236
|
onClick: triggerScan,
|
|
2853
3237
|
children: "Scan for Files"
|
|
2854
3238
|
}
|
|
@@ -2856,19 +3240,19 @@ function StudioFileGrid() {
|
|
|
2856
3240
|
] });
|
|
2857
3241
|
}
|
|
2858
3242
|
if (sortedItems.length === 0 && isAtRoot) {
|
|
2859
|
-
return /* @__PURE__ */
|
|
2860
|
-
/* @__PURE__ */
|
|
2861
|
-
/* @__PURE__ */
|
|
2862
|
-
/* @__PURE__ */
|
|
3243
|
+
return /* @__PURE__ */ jsxs6("div", { css: styles6.empty, children: [
|
|
3244
|
+
/* @__PURE__ */ jsx6("svg", { css: styles6.emptyIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }),
|
|
3245
|
+
/* @__PURE__ */ jsx6("p", { css: styles6.emptyText, children: "No files in this folder" }),
|
|
3246
|
+
/* @__PURE__ */ jsx6("p", { css: styles6.emptyText, children: "Upload images or click Scan in the toolbar" })
|
|
2863
3247
|
] });
|
|
2864
3248
|
}
|
|
2865
|
-
return /* @__PURE__ */
|
|
2866
|
-
sortedItems.length > 0 && /* @__PURE__ */
|
|
2867
|
-
/* @__PURE__ */
|
|
3249
|
+
return /* @__PURE__ */ jsxs6("div", { children: [
|
|
3250
|
+
sortedItems.length > 0 && /* @__PURE__ */ jsx6("div", { css: styles6.selectAllRow, children: /* @__PURE__ */ jsxs6("label", { css: styles6.selectAllLabel, children: [
|
|
3251
|
+
/* @__PURE__ */ jsx6(
|
|
2868
3252
|
"input",
|
|
2869
3253
|
{
|
|
2870
3254
|
type: "checkbox",
|
|
2871
|
-
css:
|
|
3255
|
+
css: styles6.selectAllCheckbox,
|
|
2872
3256
|
checked: allItemsSelected,
|
|
2873
3257
|
ref: (el) => {
|
|
2874
3258
|
if (el) el.indeterminate = someItemsSelected && !allItemsSelected;
|
|
@@ -2880,22 +3264,22 @@ function StudioFileGrid() {
|
|
|
2880
3264
|
sortedItems.length,
|
|
2881
3265
|
")"
|
|
2882
3266
|
] }) }),
|
|
2883
|
-
/* @__PURE__ */
|
|
2884
|
-
!isAtRoot && !isSearching && /* @__PURE__ */
|
|
3267
|
+
/* @__PURE__ */ jsxs6("div", { css: styles6.grid, children: [
|
|
3268
|
+
!isAtRoot && !isSearching && /* @__PURE__ */ jsxs6(
|
|
2885
3269
|
"div",
|
|
2886
3270
|
{
|
|
2887
|
-
css: [
|
|
3271
|
+
css: [styles6.item, styles6.parentItem],
|
|
2888
3272
|
onClick: navigateUp,
|
|
2889
3273
|
children: [
|
|
2890
|
-
/* @__PURE__ */
|
|
2891
|
-
/* @__PURE__ */
|
|
2892
|
-
/* @__PURE__ */
|
|
2893
|
-
/* @__PURE__ */
|
|
3274
|
+
/* @__PURE__ */ jsx6("div", { css: styles6.content, children: /* @__PURE__ */ jsx6("svg", { css: styles6.parentIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6" }) }) }),
|
|
3275
|
+
/* @__PURE__ */ jsxs6("div", { css: styles6.label, children: [
|
|
3276
|
+
/* @__PURE__ */ jsx6("p", { css: styles6.name, children: ".." }),
|
|
3277
|
+
/* @__PURE__ */ jsx6("p", { css: styles6.size, children: "Parent folder" })
|
|
2894
3278
|
] })
|
|
2895
3279
|
]
|
|
2896
3280
|
}
|
|
2897
3281
|
),
|
|
2898
|
-
sortedItems.map((item) => /* @__PURE__ */
|
|
3282
|
+
sortedItems.map((item) => /* @__PURE__ */ jsx6(
|
|
2899
3283
|
GridItem,
|
|
2900
3284
|
{
|
|
2901
3285
|
item,
|
|
@@ -2910,7 +3294,7 @@ function StudioFileGrid() {
|
|
|
2910
3294
|
] });
|
|
2911
3295
|
}
|
|
2912
3296
|
function GridItem({ item, isSelected, onClick, onOpen, onGenerateThumbnail }) {
|
|
2913
|
-
const [showCopied, setShowCopied] =
|
|
3297
|
+
const [showCopied, setShowCopied] = useState6(false);
|
|
2914
3298
|
const isFolder = item.type === "folder";
|
|
2915
3299
|
const isImage = !isFolder && item.thumbnail !== void 0;
|
|
2916
3300
|
const isImagesFolder = isFolder && (item.name === "images" || item.path.includes("/images/"));
|
|
@@ -2921,46 +3305,46 @@ function GridItem({ item, isSelected, onClick, onOpen, onGenerateThumbnail }) {
|
|
|
2921
3305
|
setShowCopied(true);
|
|
2922
3306
|
setTimeout(() => setShowCopied(false), 1500);
|
|
2923
3307
|
};
|
|
2924
|
-
return /* @__PURE__ */
|
|
3308
|
+
return /* @__PURE__ */ jsxs6(
|
|
2925
3309
|
"div",
|
|
2926
3310
|
{
|
|
2927
|
-
css: [
|
|
3311
|
+
css: [styles6.item, isSelected && styles6.itemSelected],
|
|
2928
3312
|
onClick,
|
|
2929
3313
|
children: [
|
|
2930
|
-
/* @__PURE__ */
|
|
3314
|
+
/* @__PURE__ */ jsx6(
|
|
2931
3315
|
"div",
|
|
2932
3316
|
{
|
|
2933
|
-
css:
|
|
3317
|
+
css: styles6.checkboxWrapper,
|
|
2934
3318
|
onClick: (e) => e.stopPropagation(),
|
|
2935
|
-
children: /* @__PURE__ */
|
|
3319
|
+
children: /* @__PURE__ */ jsx6(
|
|
2936
3320
|
"input",
|
|
2937
3321
|
{
|
|
2938
3322
|
type: "checkbox",
|
|
2939
|
-
css:
|
|
3323
|
+
css: styles6.checkbox,
|
|
2940
3324
|
checked: isSelected,
|
|
2941
3325
|
onChange: () => onClick({})
|
|
2942
3326
|
}
|
|
2943
3327
|
)
|
|
2944
3328
|
}
|
|
2945
3329
|
),
|
|
2946
|
-
item.cdnPushed && /* @__PURE__ */
|
|
2947
|
-
/* @__PURE__ */
|
|
2948
|
-
/* @__PURE__ */
|
|
3330
|
+
item.cdnPushed && /* @__PURE__ */ jsx6("span", { css: styles6.cdnBadge, children: "CDN" }),
|
|
3331
|
+
/* @__PURE__ */ jsxs6("div", { css: styles6.content, children: [
|
|
3332
|
+
/* @__PURE__ */ jsxs6(
|
|
2949
3333
|
"button",
|
|
2950
3334
|
{
|
|
2951
|
-
css:
|
|
3335
|
+
css: styles6.copyBtn,
|
|
2952
3336
|
onClick: handleCopyPath,
|
|
2953
3337
|
title: "Copy file path",
|
|
2954
3338
|
children: [
|
|
2955
|
-
showCopied && /* @__PURE__ */
|
|
2956
|
-
/* @__PURE__ */
|
|
3339
|
+
showCopied && /* @__PURE__ */ jsx6("span", { css: styles6.tooltip, children: "Copied!" }),
|
|
3340
|
+
/* @__PURE__ */ jsx6("svg", { css: styles6.copyIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) })
|
|
2957
3341
|
]
|
|
2958
3342
|
}
|
|
2959
3343
|
),
|
|
2960
|
-
/* @__PURE__ */
|
|
3344
|
+
/* @__PURE__ */ jsx6(
|
|
2961
3345
|
"button",
|
|
2962
3346
|
{
|
|
2963
|
-
css:
|
|
3347
|
+
css: styles6.openBtn,
|
|
2964
3348
|
onClick: (e) => {
|
|
2965
3349
|
e.stopPropagation();
|
|
2966
3350
|
onOpen();
|
|
@@ -2968,40 +3352,40 @@ function GridItem({ item, isSelected, onClick, onOpen, onGenerateThumbnail }) {
|
|
|
2968
3352
|
children: "Open"
|
|
2969
3353
|
}
|
|
2970
3354
|
),
|
|
2971
|
-
isFolder ? isImagesFolder ? /* @__PURE__ */
|
|
2972
|
-
/* @__PURE__ */
|
|
2973
|
-
/* @__PURE__ */
|
|
2974
|
-
] }) : /* @__PURE__ */
|
|
3355
|
+
isFolder ? isImagesFolder ? /* @__PURE__ */ jsxs6("div", { css: styles6.imagesFolderWrapper, children: [
|
|
3356
|
+
/* @__PURE__ */ jsx6("svg", { css: styles6.imagesFolderIcon, fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { d: "M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z" }) }),
|
|
3357
|
+
/* @__PURE__ */ jsx6("svg", { css: styles6.lockIcon, fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx6("path", { fillRule: "evenodd", d: "M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z", clipRule: "evenodd" }) })
|
|
3358
|
+
] }) : /* @__PURE__ */ jsx6("svg", { css: styles6.folderIcon, fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { d: "M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z" }) }) : isImage && item.hasThumbnail ? /* @__PURE__ */ jsx6(
|
|
2975
3359
|
"img",
|
|
2976
3360
|
{
|
|
2977
|
-
css:
|
|
3361
|
+
css: styles6.image,
|
|
2978
3362
|
src: item.thumbnail,
|
|
2979
3363
|
alt: item.name,
|
|
2980
3364
|
loading: "lazy"
|
|
2981
3365
|
}
|
|
2982
|
-
) : isImage && !item.hasThumbnail ? /* @__PURE__ */
|
|
3366
|
+
) : isImage && !item.hasThumbnail ? /* @__PURE__ */ jsxs6(
|
|
2983
3367
|
"button",
|
|
2984
3368
|
{
|
|
2985
|
-
css:
|
|
3369
|
+
css: styles6.noThumbnail,
|
|
2986
3370
|
onClick: (e) => {
|
|
2987
3371
|
e.stopPropagation();
|
|
2988
3372
|
onGenerateThumbnail();
|
|
2989
3373
|
},
|
|
2990
3374
|
title: "Generate thumbnail",
|
|
2991
3375
|
children: [
|
|
2992
|
-
/* @__PURE__ */
|
|
2993
|
-
/* @__PURE__ */
|
|
3376
|
+
/* @__PURE__ */ jsx6("svg", { css: styles6.noThumbnailIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }),
|
|
3377
|
+
/* @__PURE__ */ jsx6("span", { css: styles6.noThumbnailText, children: "Generate" })
|
|
2994
3378
|
]
|
|
2995
3379
|
}
|
|
2996
|
-
) : /* @__PURE__ */
|
|
3380
|
+
) : /* @__PURE__ */ jsx6("svg", { css: styles6.fileIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z" }) })
|
|
2997
3381
|
] }),
|
|
2998
|
-
/* @__PURE__ */
|
|
2999
|
-
/* @__PURE__ */
|
|
3000
|
-
isFolder ? /* @__PURE__ */
|
|
3382
|
+
/* @__PURE__ */ jsx6("div", { css: styles6.label, children: /* @__PURE__ */ jsx6("div", { css: styles6.labelRow, children: /* @__PURE__ */ jsxs6("div", { css: styles6.labelText, children: [
|
|
3383
|
+
/* @__PURE__ */ jsx6("p", { css: styles6.name, title: item.name, children: truncateMiddle(item.name) }),
|
|
3384
|
+
isFolder ? /* @__PURE__ */ jsxs6("p", { css: styles6.size, children: [
|
|
3001
3385
|
item.fileCount !== void 0 ? `${item.fileCount} files` : "",
|
|
3002
3386
|
item.fileCount !== void 0 && item.totalSize !== void 0 ? " \xB7 " : "",
|
|
3003
3387
|
item.totalSize !== void 0 ? formatFileSize(item.totalSize) : ""
|
|
3004
|
-
] }) : item.size !== void 0 && /* @__PURE__ */
|
|
3388
|
+
] }) : item.size !== void 0 && /* @__PURE__ */ jsx6("p", { css: styles6.size, children: formatFileSize(item.size) })
|
|
3005
3389
|
] }) }) })
|
|
3006
3390
|
]
|
|
3007
3391
|
}
|
|
@@ -3027,21 +3411,21 @@ function truncateMiddle(str, maxLength = 24) {
|
|
|
3027
3411
|
}
|
|
3028
3412
|
|
|
3029
3413
|
// src/components/StudioFileList.tsx
|
|
3030
|
-
import { useState as
|
|
3031
|
-
import { css as
|
|
3032
|
-
import { jsx as
|
|
3033
|
-
var spin3 =
|
|
3414
|
+
import { useState as useState7 } from "react";
|
|
3415
|
+
import { css as css7, keyframes as keyframes6 } from "@emotion/react";
|
|
3416
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "@emotion/react/jsx-runtime";
|
|
3417
|
+
var spin3 = keyframes6`
|
|
3034
3418
|
to { transform: rotate(360deg); }
|
|
3035
3419
|
`;
|
|
3036
|
-
var
|
|
3037
|
-
loading:
|
|
3420
|
+
var styles7 = {
|
|
3421
|
+
loading: css7`
|
|
3038
3422
|
display: flex;
|
|
3039
3423
|
align-items: center;
|
|
3040
3424
|
justify-content: center;
|
|
3041
3425
|
flex: 1;
|
|
3042
3426
|
min-height: 300px;
|
|
3043
3427
|
`,
|
|
3044
|
-
spinner:
|
|
3428
|
+
spinner: css7`
|
|
3045
3429
|
width: 32px;
|
|
3046
3430
|
height: 32px;
|
|
3047
3431
|
border-radius: 50%;
|
|
@@ -3049,7 +3433,7 @@ var styles6 = {
|
|
|
3049
3433
|
border-top-color: ${colors.primary};
|
|
3050
3434
|
animation: ${spin3} 0.8s linear infinite;
|
|
3051
3435
|
`,
|
|
3052
|
-
empty:
|
|
3436
|
+
empty: css7`
|
|
3053
3437
|
display: flex;
|
|
3054
3438
|
flex-direction: column;
|
|
3055
3439
|
align-items: center;
|
|
@@ -3058,12 +3442,12 @@ var styles6 = {
|
|
|
3058
3442
|
min-height: 300px;
|
|
3059
3443
|
color: ${colors.textSecondary};
|
|
3060
3444
|
`,
|
|
3061
|
-
emptyHint:
|
|
3445
|
+
emptyHint: css7`
|
|
3062
3446
|
font-size: ${fontSize.sm};
|
|
3063
3447
|
color: ${colors.textMuted};
|
|
3064
3448
|
margin-top: 4px;
|
|
3065
3449
|
`,
|
|
3066
|
-
scanButton:
|
|
3450
|
+
scanButton: css7`
|
|
3067
3451
|
margin-top: 16px;
|
|
3068
3452
|
padding: 10px 24px;
|
|
3069
3453
|
font-size: ${fontSize.base};
|
|
@@ -3084,19 +3468,19 @@ var styles6 = {
|
|
|
3084
3468
|
cursor: not-allowed;
|
|
3085
3469
|
}
|
|
3086
3470
|
`,
|
|
3087
|
-
tableWrapper:
|
|
3471
|
+
tableWrapper: css7`
|
|
3088
3472
|
background: ${colors.surface};
|
|
3089
3473
|
border-radius: 8px;
|
|
3090
3474
|
border: 1px solid ${colors.border};
|
|
3091
3475
|
overflow-x: auto;
|
|
3092
3476
|
`,
|
|
3093
|
-
table:
|
|
3477
|
+
table: css7`
|
|
3094
3478
|
width: 100%;
|
|
3095
3479
|
min-width: 600px;
|
|
3096
3480
|
border-collapse: collapse;
|
|
3097
3481
|
white-space: nowrap;
|
|
3098
3482
|
`,
|
|
3099
|
-
th:
|
|
3483
|
+
th: css7`
|
|
3100
3484
|
text-align: left;
|
|
3101
3485
|
font-size: 11px;
|
|
3102
3486
|
color: ${colors.textMuted};
|
|
@@ -3107,20 +3491,20 @@ var styles6 = {
|
|
|
3107
3491
|
background: ${colors.background};
|
|
3108
3492
|
border-bottom: 1px solid ${colors.border};
|
|
3109
3493
|
`,
|
|
3110
|
-
thCheckbox:
|
|
3494
|
+
thCheckbox: css7`
|
|
3111
3495
|
width: 48px;
|
|
3112
3496
|
`,
|
|
3113
|
-
thSize:
|
|
3497
|
+
thSize: css7`
|
|
3114
3498
|
width: 96px;
|
|
3115
3499
|
`,
|
|
3116
|
-
thDimensions:
|
|
3500
|
+
thDimensions: css7`
|
|
3117
3501
|
width: 128px;
|
|
3118
3502
|
`,
|
|
3119
|
-
thCdn:
|
|
3503
|
+
thCdn: css7`
|
|
3120
3504
|
width: 96px;
|
|
3121
3505
|
`,
|
|
3122
|
-
tbody:
|
|
3123
|
-
row:
|
|
3506
|
+
tbody: css7``,
|
|
3507
|
+
row: css7`
|
|
3124
3508
|
cursor: pointer;
|
|
3125
3509
|
transition: background-color 0.15s ease;
|
|
3126
3510
|
user-select: none;
|
|
@@ -3133,14 +3517,14 @@ var styles6 = {
|
|
|
3133
3517
|
border-bottom: 1px solid ${colors.borderLight};
|
|
3134
3518
|
}
|
|
3135
3519
|
`,
|
|
3136
|
-
rowSelected:
|
|
3520
|
+
rowSelected: css7`
|
|
3137
3521
|
background-color: ${colors.primaryLight};
|
|
3138
3522
|
|
|
3139
3523
|
&:hover {
|
|
3140
3524
|
background-color: ${colors.primaryLight};
|
|
3141
3525
|
}
|
|
3142
3526
|
`,
|
|
3143
|
-
parentRow:
|
|
3527
|
+
parentRow: css7`
|
|
3144
3528
|
cursor: pointer;
|
|
3145
3529
|
border-bottom: 1px solid ${colors.border};
|
|
3146
3530
|
|
|
@@ -3148,22 +3532,22 @@ var styles6 = {
|
|
|
3148
3532
|
background-color: ${colors.surfaceHover};
|
|
3149
3533
|
}
|
|
3150
3534
|
`,
|
|
3151
|
-
td:
|
|
3535
|
+
td: css7`
|
|
3152
3536
|
padding: 12px 16px;
|
|
3153
3537
|
`,
|
|
3154
|
-
checkboxCell:
|
|
3538
|
+
checkboxCell: css7`
|
|
3155
3539
|
padding: 12px 16px;
|
|
3156
3540
|
cursor: pointer;
|
|
3157
3541
|
vertical-align: middle;
|
|
3158
3542
|
`,
|
|
3159
|
-
checkbox:
|
|
3543
|
+
checkbox: css7`
|
|
3160
3544
|
width: 18px;
|
|
3161
3545
|
height: 18px;
|
|
3162
3546
|
accent-color: ${colors.primary};
|
|
3163
3547
|
cursor: pointer;
|
|
3164
3548
|
display: block;
|
|
3165
3549
|
`,
|
|
3166
|
-
actionsCell:
|
|
3550
|
+
actionsCell: css7`
|
|
3167
3551
|
display: flex;
|
|
3168
3552
|
align-items: center;
|
|
3169
3553
|
justify-content: flex-end;
|
|
@@ -3171,7 +3555,7 @@ var styles6 = {
|
|
|
3171
3555
|
margin-left: auto;
|
|
3172
3556
|
flex-shrink: 0;
|
|
3173
3557
|
`,
|
|
3174
|
-
copyBtn:
|
|
3558
|
+
copyBtn: css7`
|
|
3175
3559
|
position: relative;
|
|
3176
3560
|
flex-shrink: 0;
|
|
3177
3561
|
height: 32px;
|
|
@@ -3194,11 +3578,11 @@ var styles6 = {
|
|
|
3194
3578
|
color: ${colors.text};
|
|
3195
3579
|
}
|
|
3196
3580
|
`,
|
|
3197
|
-
copyIcon:
|
|
3581
|
+
copyIcon: css7`
|
|
3198
3582
|
width: 16px;
|
|
3199
3583
|
height: 16px;
|
|
3200
3584
|
`,
|
|
3201
|
-
tooltip:
|
|
3585
|
+
tooltip: css7`
|
|
3202
3586
|
position: absolute;
|
|
3203
3587
|
top: 50%;
|
|
3204
3588
|
right: 100%;
|
|
@@ -3223,13 +3607,13 @@ var styles6 = {
|
|
|
3223
3607
|
border-left-color: #1a1f36;
|
|
3224
3608
|
}
|
|
3225
3609
|
`,
|
|
3226
|
-
nameCell:
|
|
3610
|
+
nameCell: css7`
|
|
3227
3611
|
display: flex;
|
|
3228
3612
|
align-items: center;
|
|
3229
3613
|
gap: 12px;
|
|
3230
3614
|
flex: 1;
|
|
3231
3615
|
`,
|
|
3232
|
-
thumbnailWrapper:
|
|
3616
|
+
thumbnailWrapper: css7`
|
|
3233
3617
|
width: 48px;
|
|
3234
3618
|
height: 36px;
|
|
3235
3619
|
display: flex;
|
|
@@ -3237,7 +3621,7 @@ var styles6 = {
|
|
|
3237
3621
|
justify-content: center;
|
|
3238
3622
|
flex-shrink: 0;
|
|
3239
3623
|
`,
|
|
3240
|
-
folderIconWrapper:
|
|
3624
|
+
folderIconWrapper: css7`
|
|
3241
3625
|
width: 48px;
|
|
3242
3626
|
height: 36px;
|
|
3243
3627
|
display: flex;
|
|
@@ -3245,12 +3629,12 @@ var styles6 = {
|
|
|
3245
3629
|
justify-content: center;
|
|
3246
3630
|
flex-shrink: 0;
|
|
3247
3631
|
`,
|
|
3248
|
-
folderIcon:
|
|
3632
|
+
folderIcon: css7`
|
|
3249
3633
|
width: 24px;
|
|
3250
3634
|
height: 24px;
|
|
3251
3635
|
color: #f9935e;
|
|
3252
3636
|
`,
|
|
3253
|
-
imagesFolderWrapper:
|
|
3637
|
+
imagesFolderWrapper: css7`
|
|
3254
3638
|
width: 48px;
|
|
3255
3639
|
height: 36px;
|
|
3256
3640
|
display: flex;
|
|
@@ -3260,31 +3644,31 @@ var styles6 = {
|
|
|
3260
3644
|
position: relative;
|
|
3261
3645
|
align-items: center;
|
|
3262
3646
|
`,
|
|
3263
|
-
imagesFolderIcon:
|
|
3647
|
+
imagesFolderIcon: css7`
|
|
3264
3648
|
width: 24px;
|
|
3265
3649
|
height: 24px;
|
|
3266
3650
|
color: ${colors.imagesFolder};
|
|
3267
3651
|
`,
|
|
3268
|
-
lockIcon:
|
|
3652
|
+
lockIcon: css7`
|
|
3269
3653
|
width: 10px;
|
|
3270
3654
|
height: 10px;
|
|
3271
3655
|
color: ${colors.imagesFolder};
|
|
3272
3656
|
margin-left: -6px;
|
|
3273
3657
|
margin-top: 8px;
|
|
3274
3658
|
`,
|
|
3275
|
-
parentIcon:
|
|
3659
|
+
parentIcon: css7`
|
|
3276
3660
|
width: 20px;
|
|
3277
3661
|
height: 20px;
|
|
3278
3662
|
color: ${colors.textMuted};
|
|
3279
3663
|
flex-shrink: 0;
|
|
3280
3664
|
`,
|
|
3281
|
-
fileIcon:
|
|
3665
|
+
fileIcon: css7`
|
|
3282
3666
|
width: 20px;
|
|
3283
3667
|
height: 20px;
|
|
3284
3668
|
color: ${colors.textMuted};
|
|
3285
3669
|
flex-shrink: 0;
|
|
3286
3670
|
`,
|
|
3287
|
-
thumbnail:
|
|
3671
|
+
thumbnail: css7`
|
|
3288
3672
|
max-width: 100%;
|
|
3289
3673
|
max-height: 100%;
|
|
3290
3674
|
width: auto;
|
|
@@ -3293,7 +3677,7 @@ var styles6 = {
|
|
|
3293
3677
|
border-radius: 4px;
|
|
3294
3678
|
border: 1px solid ${colors.borderLight};
|
|
3295
3679
|
`,
|
|
3296
|
-
noThumbnail:
|
|
3680
|
+
noThumbnail: css7`
|
|
3297
3681
|
width: 36px;
|
|
3298
3682
|
height: 36px;
|
|
3299
3683
|
display: flex;
|
|
@@ -3311,12 +3695,12 @@ var styles6 = {
|
|
|
3311
3695
|
background: ${colors.surfaceHover};
|
|
3312
3696
|
}
|
|
3313
3697
|
`,
|
|
3314
|
-
noThumbnailIcon:
|
|
3698
|
+
noThumbnailIcon: css7`
|
|
3315
3699
|
width: 16px;
|
|
3316
3700
|
height: 16px;
|
|
3317
3701
|
color: ${colors.textMuted};
|
|
3318
3702
|
`,
|
|
3319
|
-
name:
|
|
3703
|
+
name: css7`
|
|
3320
3704
|
font-size: ${fontSize.base};
|
|
3321
3705
|
font-weight: 500;
|
|
3322
3706
|
color: ${colors.text};
|
|
@@ -3326,11 +3710,11 @@ var styles6 = {
|
|
|
3326
3710
|
white-space: nowrap;
|
|
3327
3711
|
max-width: 300px;
|
|
3328
3712
|
`,
|
|
3329
|
-
meta:
|
|
3713
|
+
meta: css7`
|
|
3330
3714
|
font-size: ${fontSize.sm};
|
|
3331
3715
|
color: ${colors.textSecondary};
|
|
3332
3716
|
`,
|
|
3333
|
-
cdnBadge:
|
|
3717
|
+
cdnBadge: css7`
|
|
3334
3718
|
display: inline-flex;
|
|
3335
3719
|
align-items: center;
|
|
3336
3720
|
gap: 4px;
|
|
@@ -3338,15 +3722,15 @@ var styles6 = {
|
|
|
3338
3722
|
font-weight: 500;
|
|
3339
3723
|
color: ${colors.success};
|
|
3340
3724
|
`,
|
|
3341
|
-
cdnIcon:
|
|
3725
|
+
cdnIcon: css7`
|
|
3342
3726
|
width: 12px;
|
|
3343
3727
|
height: 12px;
|
|
3344
3728
|
`,
|
|
3345
|
-
cdnEmpty:
|
|
3729
|
+
cdnEmpty: css7`
|
|
3346
3730
|
font-size: ${fontSize.sm};
|
|
3347
3731
|
color: ${colors.textMuted};
|
|
3348
3732
|
`,
|
|
3349
|
-
openBtn:
|
|
3733
|
+
openBtn: css7`
|
|
3350
3734
|
height: 32px;
|
|
3351
3735
|
font-size: ${fontSize.sm};
|
|
3352
3736
|
font-weight: 500;
|
|
@@ -3384,16 +3768,16 @@ function StudioFileList() {
|
|
|
3384
3768
|
triggerScan
|
|
3385
3769
|
} = useFileList();
|
|
3386
3770
|
if (loading) {
|
|
3387
|
-
return /* @__PURE__ */
|
|
3771
|
+
return /* @__PURE__ */ jsx7("div", { css: styles7.loading, children: /* @__PURE__ */ jsx7("div", { css: styles7.spinner }) });
|
|
3388
3772
|
}
|
|
3389
3773
|
if (metaEmpty && isAtRoot) {
|
|
3390
|
-
return /* @__PURE__ */
|
|
3391
|
-
/* @__PURE__ */
|
|
3392
|
-
/* @__PURE__ */
|
|
3393
|
-
/* @__PURE__ */
|
|
3774
|
+
return /* @__PURE__ */ jsxs7("div", { css: styles7.empty, children: [
|
|
3775
|
+
/* @__PURE__ */ jsx7("p", { children: "No files tracked yet" }),
|
|
3776
|
+
/* @__PURE__ */ jsx7("p", { css: styles7.emptyHint, children: "Click Scan to discover files in your public folder" }),
|
|
3777
|
+
/* @__PURE__ */ jsx7(
|
|
3394
3778
|
"button",
|
|
3395
3779
|
{
|
|
3396
|
-
css:
|
|
3780
|
+
css: styles7.scanButton,
|
|
3397
3781
|
onClick: triggerScan,
|
|
3398
3782
|
children: "Scan for Files"
|
|
3399
3783
|
}
|
|
@@ -3401,18 +3785,18 @@ function StudioFileList() {
|
|
|
3401
3785
|
] });
|
|
3402
3786
|
}
|
|
3403
3787
|
if (sortedItems.length === 0 && isAtRoot) {
|
|
3404
|
-
return /* @__PURE__ */
|
|
3405
|
-
/* @__PURE__ */
|
|
3406
|
-
/* @__PURE__ */
|
|
3788
|
+
return /* @__PURE__ */ jsxs7("div", { css: styles7.empty, children: [
|
|
3789
|
+
/* @__PURE__ */ jsx7("p", { children: "No files in this folder" }),
|
|
3790
|
+
/* @__PURE__ */ jsx7("p", { css: styles7.emptyHint, children: "Upload images or click Scan in the toolbar" })
|
|
3407
3791
|
] });
|
|
3408
3792
|
}
|
|
3409
|
-
return /* @__PURE__ */
|
|
3410
|
-
/* @__PURE__ */
|
|
3411
|
-
/* @__PURE__ */
|
|
3793
|
+
return /* @__PURE__ */ jsx7("div", { css: styles7.tableWrapper, children: /* @__PURE__ */ jsxs7("table", { css: styles7.table, children: [
|
|
3794
|
+
/* @__PURE__ */ jsx7("thead", { children: /* @__PURE__ */ jsxs7("tr", { children: [
|
|
3795
|
+
/* @__PURE__ */ jsx7("th", { css: [styles7.th, styles7.thCheckbox], children: sortedItems.length > 0 && /* @__PURE__ */ jsx7(
|
|
3412
3796
|
"input",
|
|
3413
3797
|
{
|
|
3414
3798
|
type: "checkbox",
|
|
3415
|
-
css:
|
|
3799
|
+
css: styles7.checkbox,
|
|
3416
3800
|
checked: allItemsSelected,
|
|
3417
3801
|
ref: (el) => {
|
|
3418
3802
|
if (el) el.indeterminate = someItemsSelected && !allItemsSelected;
|
|
@@ -3420,23 +3804,23 @@ function StudioFileList() {
|
|
|
3420
3804
|
onChange: handleSelectAll
|
|
3421
3805
|
}
|
|
3422
3806
|
) }),
|
|
3423
|
-
/* @__PURE__ */
|
|
3424
|
-
/* @__PURE__ */
|
|
3425
|
-
/* @__PURE__ */
|
|
3426
|
-
/* @__PURE__ */
|
|
3807
|
+
/* @__PURE__ */ jsx7("th", { css: styles7.th, children: "Name" }),
|
|
3808
|
+
/* @__PURE__ */ jsx7("th", { css: [styles7.th, styles7.thSize], children: "Size" }),
|
|
3809
|
+
/* @__PURE__ */ jsx7("th", { css: [styles7.th, styles7.thDimensions], children: "Dimensions" }),
|
|
3810
|
+
/* @__PURE__ */ jsx7("th", { css: [styles7.th, styles7.thCdn], children: "CDN" })
|
|
3427
3811
|
] }) }),
|
|
3428
|
-
/* @__PURE__ */
|
|
3429
|
-
!isAtRoot && !isSearching && /* @__PURE__ */
|
|
3430
|
-
/* @__PURE__ */
|
|
3431
|
-
/* @__PURE__ */
|
|
3432
|
-
/* @__PURE__ */
|
|
3433
|
-
/* @__PURE__ */
|
|
3812
|
+
/* @__PURE__ */ jsxs7("tbody", { css: styles7.tbody, children: [
|
|
3813
|
+
!isAtRoot && !isSearching && /* @__PURE__ */ jsxs7("tr", { css: styles7.parentRow, onClick: navigateUp, children: [
|
|
3814
|
+
/* @__PURE__ */ jsx7("td", { css: styles7.td }),
|
|
3815
|
+
/* @__PURE__ */ jsx7("td", { css: styles7.td, children: /* @__PURE__ */ jsxs7("div", { css: styles7.nameCell, children: [
|
|
3816
|
+
/* @__PURE__ */ jsx7("svg", { css: styles7.parentIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx7("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6" }) }),
|
|
3817
|
+
/* @__PURE__ */ jsx7("span", { css: styles7.name, children: ".." })
|
|
3434
3818
|
] }) }),
|
|
3435
|
-
/* @__PURE__ */
|
|
3436
|
-
/* @__PURE__ */
|
|
3437
|
-
/* @__PURE__ */
|
|
3819
|
+
/* @__PURE__ */ jsx7("td", { css: [styles7.td, styles7.meta], children: "--" }),
|
|
3820
|
+
/* @__PURE__ */ jsx7("td", { css: [styles7.td, styles7.meta], children: "Parent folder" }),
|
|
3821
|
+
/* @__PURE__ */ jsx7("td", { css: styles7.td, children: "--" })
|
|
3438
3822
|
] }),
|
|
3439
|
-
sortedItems.map((item) => /* @__PURE__ */
|
|
3823
|
+
sortedItems.map((item) => /* @__PURE__ */ jsx7(
|
|
3440
3824
|
ListRow,
|
|
3441
3825
|
{
|
|
3442
3826
|
item,
|
|
@@ -3451,7 +3835,7 @@ function StudioFileList() {
|
|
|
3451
3835
|
] }) });
|
|
3452
3836
|
}
|
|
3453
3837
|
function ListRow({ item, isSelected, onClick, onOpen, onGenerateThumbnail }) {
|
|
3454
|
-
const [showCopied, setShowCopied] =
|
|
3838
|
+
const [showCopied, setShowCopied] = useState7(false);
|
|
3455
3839
|
const isFolder = item.type === "folder";
|
|
3456
3840
|
const isImage = !isFolder && item.thumbnail !== void 0;
|
|
3457
3841
|
const isImagesFolder = isFolder && (item.name === "images" || item.path.includes("/images/"));
|
|
@@ -3462,62 +3846,62 @@ function ListRow({ item, isSelected, onClick, onOpen, onGenerateThumbnail }) {
|
|
|
3462
3846
|
setShowCopied(true);
|
|
3463
3847
|
setTimeout(() => setShowCopied(false), 1500);
|
|
3464
3848
|
};
|
|
3465
|
-
return /* @__PURE__ */
|
|
3849
|
+
return /* @__PURE__ */ jsxs7(
|
|
3466
3850
|
"tr",
|
|
3467
3851
|
{
|
|
3468
|
-
css: [
|
|
3852
|
+
css: [styles7.row, isSelected && styles7.rowSelected],
|
|
3469
3853
|
onClick,
|
|
3470
3854
|
children: [
|
|
3471
|
-
/* @__PURE__ */
|
|
3855
|
+
/* @__PURE__ */ jsx7(
|
|
3472
3856
|
"td",
|
|
3473
3857
|
{
|
|
3474
|
-
css: [
|
|
3858
|
+
css: [styles7.td, styles7.checkboxCell],
|
|
3475
3859
|
onClick: (e) => e.stopPropagation(),
|
|
3476
|
-
children: /* @__PURE__ */
|
|
3860
|
+
children: /* @__PURE__ */ jsx7(
|
|
3477
3861
|
"input",
|
|
3478
3862
|
{
|
|
3479
3863
|
type: "checkbox",
|
|
3480
|
-
css:
|
|
3864
|
+
css: styles7.checkbox,
|
|
3481
3865
|
checked: isSelected,
|
|
3482
3866
|
onChange: () => onClick({})
|
|
3483
3867
|
}
|
|
3484
3868
|
)
|
|
3485
3869
|
}
|
|
3486
3870
|
),
|
|
3487
|
-
/* @__PURE__ */
|
|
3488
|
-
isFolder ? isImagesFolder ? /* @__PURE__ */
|
|
3489
|
-
/* @__PURE__ */
|
|
3490
|
-
/* @__PURE__ */
|
|
3491
|
-
] }) : /* @__PURE__ */
|
|
3871
|
+
/* @__PURE__ */ jsx7("td", { css: styles7.td, children: /* @__PURE__ */ jsxs7("div", { css: styles7.nameCell, children: [
|
|
3872
|
+
isFolder ? isImagesFolder ? /* @__PURE__ */ jsxs7("div", { css: styles7.imagesFolderWrapper, children: [
|
|
3873
|
+
/* @__PURE__ */ jsx7("svg", { css: styles7.imagesFolderIcon, fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx7("path", { d: "M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z" }) }),
|
|
3874
|
+
/* @__PURE__ */ jsx7("svg", { css: styles7.lockIcon, fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx7("path", { fillRule: "evenodd", d: "M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z", clipRule: "evenodd" }) })
|
|
3875
|
+
] }) : /* @__PURE__ */ jsx7("div", { css: styles7.folderIconWrapper, children: /* @__PURE__ */ jsx7("svg", { css: styles7.folderIcon, fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx7("path", { d: "M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z" }) }) }) : isImage && item.hasThumbnail ? /* @__PURE__ */ jsx7("div", { css: styles7.thumbnailWrapper, children: /* @__PURE__ */ jsx7("img", { css: styles7.thumbnail, src: item.thumbnail, alt: item.name, loading: "lazy" }) }) : isImage && !item.hasThumbnail ? /* @__PURE__ */ jsx7("div", { css: styles7.thumbnailWrapper, children: /* @__PURE__ */ jsx7(
|
|
3492
3876
|
"button",
|
|
3493
3877
|
{
|
|
3494
|
-
css:
|
|
3878
|
+
css: styles7.noThumbnail,
|
|
3495
3879
|
onClick: (e) => {
|
|
3496
3880
|
e.stopPropagation();
|
|
3497
3881
|
onGenerateThumbnail();
|
|
3498
3882
|
},
|
|
3499
3883
|
title: "Generate thumbnail",
|
|
3500
|
-
children: /* @__PURE__ */
|
|
3884
|
+
children: /* @__PURE__ */ jsx7("svg", { css: styles7.noThumbnailIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx7("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) })
|
|
3501
3885
|
}
|
|
3502
|
-
) }) : /* @__PURE__ */
|
|
3503
|
-
/* @__PURE__ */
|
|
3504
|
-
/* @__PURE__ */
|
|
3505
|
-
/* @__PURE__ */
|
|
3886
|
+
) }) : /* @__PURE__ */ jsx7("div", { css: styles7.thumbnailWrapper, children: /* @__PURE__ */ jsx7("svg", { css: styles7.fileIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx7("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z" }) }) }),
|
|
3887
|
+
/* @__PURE__ */ jsx7("span", { css: styles7.name, title: item.name, children: truncateMiddle2(item.name) }),
|
|
3888
|
+
/* @__PURE__ */ jsxs7("div", { css: styles7.actionsCell, children: [
|
|
3889
|
+
/* @__PURE__ */ jsxs7(
|
|
3506
3890
|
"button",
|
|
3507
3891
|
{
|
|
3508
|
-
css:
|
|
3892
|
+
css: styles7.copyBtn,
|
|
3509
3893
|
onClick: handleCopyPath,
|
|
3510
3894
|
title: "Copy file path",
|
|
3511
3895
|
children: [
|
|
3512
|
-
showCopied && /* @__PURE__ */
|
|
3513
|
-
/* @__PURE__ */
|
|
3896
|
+
showCopied && /* @__PURE__ */ jsx7("span", { css: styles7.tooltip, children: "Copied!" }),
|
|
3897
|
+
/* @__PURE__ */ jsx7("svg", { css: styles7.copyIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx7("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) })
|
|
3514
3898
|
]
|
|
3515
3899
|
}
|
|
3516
3900
|
),
|
|
3517
|
-
/* @__PURE__ */
|
|
3901
|
+
/* @__PURE__ */ jsx7(
|
|
3518
3902
|
"button",
|
|
3519
3903
|
{
|
|
3520
|
-
css:
|
|
3904
|
+
css: styles7.openBtn,
|
|
3521
3905
|
onClick: (e) => {
|
|
3522
3906
|
e.stopPropagation();
|
|
3523
3907
|
onOpen();
|
|
@@ -3527,12 +3911,12 @@ function ListRow({ item, isSelected, onClick, onOpen, onGenerateThumbnail }) {
|
|
|
3527
3911
|
)
|
|
3528
3912
|
] })
|
|
3529
3913
|
] }) }),
|
|
3530
|
-
/* @__PURE__ */
|
|
3531
|
-
/* @__PURE__ */
|
|
3532
|
-
/* @__PURE__ */
|
|
3533
|
-
/* @__PURE__ */
|
|
3914
|
+
/* @__PURE__ */ jsx7("td", { css: [styles7.td, styles7.meta], children: isFolder ? item.fileCount !== void 0 ? `${item.fileCount} files` : "--" : item.size !== void 0 ? formatFileSize2(item.size) : "--" }),
|
|
3915
|
+
/* @__PURE__ */ jsx7("td", { css: [styles7.td, styles7.meta], children: isFolder ? item.totalSize !== void 0 ? formatFileSize2(item.totalSize) : "--" : item.dimensions ? `${item.dimensions.width}x${item.dimensions.height}` : "--" }),
|
|
3916
|
+
/* @__PURE__ */ jsx7("td", { css: styles7.td, children: item.cdnPushed ? /* @__PURE__ */ jsxs7("span", { css: styles7.cdnBadge, children: [
|
|
3917
|
+
/* @__PURE__ */ jsx7("svg", { css: styles7.cdnIcon, fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx7("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }),
|
|
3534
3918
|
"Synced"
|
|
3535
|
-
] }) : /* @__PURE__ */
|
|
3919
|
+
] }) : /* @__PURE__ */ jsx7("span", { css: styles7.cdnEmpty, children: "--" }) })
|
|
3536
3920
|
]
|
|
3537
3921
|
}
|
|
3538
3922
|
);
|
|
@@ -3557,9 +3941,9 @@ function truncateMiddle2(str, maxLength = 32) {
|
|
|
3557
3941
|
}
|
|
3558
3942
|
|
|
3559
3943
|
// src/components/StudioDetailView.tsx
|
|
3560
|
-
import { useState as
|
|
3561
|
-
import { css as
|
|
3562
|
-
import { Fragment as
|
|
3944
|
+
import { useState as useState8 } from "react";
|
|
3945
|
+
import { css as css8 } from "@emotion/react";
|
|
3946
|
+
import { Fragment as Fragment4, jsx as jsx8, jsxs as jsxs8 } from "@emotion/react/jsx-runtime";
|
|
3563
3947
|
var IMAGE_EXTENSIONS = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg", ".ico", ".bmp", ".tiff", ".tif"];
|
|
3564
3948
|
var VIDEO_EXTENSIONS = [".mp4", ".webm", ".mov", ".avi", ".mkv", ".m4v"];
|
|
3565
3949
|
function isImageFile(filename) {
|
|
@@ -3570,8 +3954,8 @@ function isVideoFile(filename) {
|
|
|
3570
3954
|
const ext = filename.toLowerCase().substring(filename.lastIndexOf("."));
|
|
3571
3955
|
return VIDEO_EXTENSIONS.includes(ext);
|
|
3572
3956
|
}
|
|
3573
|
-
var
|
|
3574
|
-
overlay:
|
|
3957
|
+
var styles8 = {
|
|
3958
|
+
overlay: css8`
|
|
3575
3959
|
position: absolute;
|
|
3576
3960
|
top: 0;
|
|
3577
3961
|
left: 0;
|
|
@@ -3581,7 +3965,7 @@ var styles7 = {
|
|
|
3581
3965
|
display: flex;
|
|
3582
3966
|
background: transparent;
|
|
3583
3967
|
`,
|
|
3584
|
-
container:
|
|
3968
|
+
container: css8`
|
|
3585
3969
|
display: flex;
|
|
3586
3970
|
flex: 1;
|
|
3587
3971
|
margin: 24px;
|
|
@@ -3591,7 +3975,7 @@ var styles7 = {
|
|
|
3591
3975
|
overflow: hidden;
|
|
3592
3976
|
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
|
|
3593
3977
|
`,
|
|
3594
|
-
main:
|
|
3978
|
+
main: css8`
|
|
3595
3979
|
position: relative;
|
|
3596
3980
|
flex: 1;
|
|
3597
3981
|
display: flex;
|
|
@@ -3602,7 +3986,7 @@ var styles7 = {
|
|
|
3602
3986
|
background: ${colors.background};
|
|
3603
3987
|
overflow: auto;
|
|
3604
3988
|
`,
|
|
3605
|
-
headerButtons:
|
|
3989
|
+
headerButtons: css8`
|
|
3606
3990
|
position: absolute;
|
|
3607
3991
|
top: 16px;
|
|
3608
3992
|
right: 16px;
|
|
@@ -3610,7 +3994,7 @@ var styles7 = {
|
|
|
3610
3994
|
gap: 8px;
|
|
3611
3995
|
z-index: 10;
|
|
3612
3996
|
`,
|
|
3613
|
-
copyBtn:
|
|
3997
|
+
copyBtn: css8`
|
|
3614
3998
|
position: relative;
|
|
3615
3999
|
padding: 8px;
|
|
3616
4000
|
background: ${colors.surface};
|
|
@@ -3628,12 +4012,12 @@ var styles7 = {
|
|
|
3628
4012
|
border-color: ${colors.borderHover};
|
|
3629
4013
|
}
|
|
3630
4014
|
`,
|
|
3631
|
-
copyIcon:
|
|
4015
|
+
copyIcon: css8`
|
|
3632
4016
|
width: 20px;
|
|
3633
4017
|
height: 20px;
|
|
3634
4018
|
color: ${colors.textSecondary};
|
|
3635
4019
|
`,
|
|
3636
|
-
tooltip:
|
|
4020
|
+
tooltip: css8`
|
|
3637
4021
|
position: absolute;
|
|
3638
4022
|
right: 100%;
|
|
3639
4023
|
top: 50%;
|
|
@@ -3658,7 +4042,7 @@ var styles7 = {
|
|
|
3658
4042
|
border-left-color: #1a1f36;
|
|
3659
4043
|
}
|
|
3660
4044
|
`,
|
|
3661
|
-
mainCloseBtn:
|
|
4045
|
+
mainCloseBtn: css8`
|
|
3662
4046
|
padding: 8px;
|
|
3663
4047
|
background: ${colors.surface};
|
|
3664
4048
|
border: 1px solid ${colors.border};
|
|
@@ -3675,32 +4059,32 @@ var styles7 = {
|
|
|
3675
4059
|
border-color: ${colors.borderHover};
|
|
3676
4060
|
}
|
|
3677
4061
|
`,
|
|
3678
|
-
mainCloseIcon:
|
|
4062
|
+
mainCloseIcon: css8`
|
|
3679
4063
|
width: 20px;
|
|
3680
4064
|
height: 20px;
|
|
3681
4065
|
color: ${colors.textSecondary};
|
|
3682
4066
|
`,
|
|
3683
|
-
mediaWrapper:
|
|
4067
|
+
mediaWrapper: css8`
|
|
3684
4068
|
max-width: 100%;
|
|
3685
4069
|
max-height: 100%;
|
|
3686
4070
|
display: flex;
|
|
3687
4071
|
align-items: center;
|
|
3688
4072
|
justify-content: center;
|
|
3689
4073
|
`,
|
|
3690
|
-
image:
|
|
4074
|
+
image: css8`
|
|
3691
4075
|
max-width: 100%;
|
|
3692
4076
|
max-height: calc(100vh - 200px);
|
|
3693
4077
|
object-fit: contain;
|
|
3694
4078
|
border-radius: 8px;
|
|
3695
4079
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
3696
4080
|
`,
|
|
3697
|
-
video:
|
|
4081
|
+
video: css8`
|
|
3698
4082
|
max-width: 100%;
|
|
3699
4083
|
max-height: calc(100vh - 200px);
|
|
3700
4084
|
border-radius: 8px;
|
|
3701
4085
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
3702
4086
|
`,
|
|
3703
|
-
filePlaceholder:
|
|
4087
|
+
filePlaceholder: css8`
|
|
3704
4088
|
display: flex;
|
|
3705
4089
|
flex-direction: column;
|
|
3706
4090
|
align-items: center;
|
|
@@ -3710,19 +4094,19 @@ var styles7 = {
|
|
|
3710
4094
|
border-radius: 12px;
|
|
3711
4095
|
border: 1px solid ${colors.border};
|
|
3712
4096
|
`,
|
|
3713
|
-
fileIcon:
|
|
4097
|
+
fileIcon: css8`
|
|
3714
4098
|
width: 80px;
|
|
3715
4099
|
height: 80px;
|
|
3716
4100
|
color: ${colors.textMuted};
|
|
3717
4101
|
margin-bottom: 16px;
|
|
3718
4102
|
`,
|
|
3719
|
-
fileName:
|
|
4103
|
+
fileName: css8`
|
|
3720
4104
|
font-size: ${fontSize.lg};
|
|
3721
4105
|
font-weight: 600;
|
|
3722
4106
|
color: ${colors.text};
|
|
3723
4107
|
margin: 0;
|
|
3724
4108
|
`,
|
|
3725
|
-
sidebar:
|
|
4109
|
+
sidebar: css8`
|
|
3726
4110
|
width: 280px;
|
|
3727
4111
|
background: ${colors.surface};
|
|
3728
4112
|
border-left: 1px solid ${colors.border};
|
|
@@ -3730,36 +4114,36 @@ var styles7 = {
|
|
|
3730
4114
|
flex-direction: column;
|
|
3731
4115
|
overflow: hidden;
|
|
3732
4116
|
`,
|
|
3733
|
-
sidebarHeader:
|
|
4117
|
+
sidebarHeader: css8`
|
|
3734
4118
|
padding: 16px 20px;
|
|
3735
4119
|
border-bottom: 1px solid ${colors.border};
|
|
3736
4120
|
`,
|
|
3737
|
-
sidebarTitle:
|
|
4121
|
+
sidebarTitle: css8`
|
|
3738
4122
|
font-size: ${fontSize.base};
|
|
3739
4123
|
font-weight: 600;
|
|
3740
4124
|
color: ${colors.text};
|
|
3741
4125
|
margin: 0;
|
|
3742
4126
|
`,
|
|
3743
|
-
sidebarContent:
|
|
4127
|
+
sidebarContent: css8`
|
|
3744
4128
|
flex: 1;
|
|
3745
4129
|
padding: 20px;
|
|
3746
4130
|
overflow: auto;
|
|
3747
4131
|
`,
|
|
3748
|
-
info:
|
|
4132
|
+
info: css8`
|
|
3749
4133
|
display: flex;
|
|
3750
4134
|
flex-direction: column;
|
|
3751
4135
|
gap: 12px;
|
|
3752
4136
|
margin-bottom: 24px;
|
|
3753
4137
|
`,
|
|
3754
|
-
infoRow:
|
|
4138
|
+
infoRow: css8`
|
|
3755
4139
|
display: flex;
|
|
3756
4140
|
justify-content: space-between;
|
|
3757
4141
|
font-size: ${fontSize.sm};
|
|
3758
4142
|
`,
|
|
3759
|
-
infoLabel:
|
|
4143
|
+
infoLabel: css8`
|
|
3760
4144
|
color: ${colors.textSecondary};
|
|
3761
4145
|
`,
|
|
3762
|
-
infoValue:
|
|
4146
|
+
infoValue: css8`
|
|
3763
4147
|
color: ${colors.text};
|
|
3764
4148
|
font-weight: 500;
|
|
3765
4149
|
text-align: right;
|
|
@@ -3768,7 +4152,7 @@ var styles7 = {
|
|
|
3768
4152
|
text-overflow: ellipsis;
|
|
3769
4153
|
white-space: nowrap;
|
|
3770
4154
|
`,
|
|
3771
|
-
infoValueWrap:
|
|
4155
|
+
infoValueWrap: css8`
|
|
3772
4156
|
color: ${colors.text};
|
|
3773
4157
|
font-weight: 500;
|
|
3774
4158
|
text-align: right;
|
|
@@ -3776,12 +4160,12 @@ var styles7 = {
|
|
|
3776
4160
|
word-break: break-all;
|
|
3777
4161
|
white-space: normal;
|
|
3778
4162
|
`,
|
|
3779
|
-
actions:
|
|
4163
|
+
actions: css8`
|
|
3780
4164
|
display: flex;
|
|
3781
4165
|
flex-direction: column;
|
|
3782
4166
|
gap: 8px;
|
|
3783
4167
|
`,
|
|
3784
|
-
actionBtn:
|
|
4168
|
+
actionBtn: css8`
|
|
3785
4169
|
display: flex;
|
|
3786
4170
|
align-items: center;
|
|
3787
4171
|
gap: 10px;
|
|
@@ -3802,7 +4186,7 @@ var styles7 = {
|
|
|
3802
4186
|
border-color: ${colors.borderHover};
|
|
3803
4187
|
}
|
|
3804
4188
|
`,
|
|
3805
|
-
actionBtnDanger:
|
|
4189
|
+
actionBtnDanger: css8`
|
|
3806
4190
|
color: ${colors.danger};
|
|
3807
4191
|
|
|
3808
4192
|
&:hover {
|
|
@@ -3810,7 +4194,7 @@ var styles7 = {
|
|
|
3810
4194
|
border-color: ${colors.danger};
|
|
3811
4195
|
}
|
|
3812
4196
|
`,
|
|
3813
|
-
actionIcon:
|
|
4197
|
+
actionIcon: css8`
|
|
3814
4198
|
width: 16px;
|
|
3815
4199
|
height: 16px;
|
|
3816
4200
|
flex-shrink: 0;
|
|
@@ -3818,14 +4202,14 @@ var styles7 = {
|
|
|
3818
4202
|
};
|
|
3819
4203
|
function StudioDetailView() {
|
|
3820
4204
|
const { focusedItem, setFocusedItem, triggerRefresh, clearSelection } = useStudio();
|
|
3821
|
-
const [showDeleteConfirm, setShowDeleteConfirm] =
|
|
3822
|
-
const [showRenameModal, setShowRenameModal] =
|
|
3823
|
-
const [showProcessConfirm, setShowProcessConfirm] =
|
|
3824
|
-
const [showR2SetupModal, setShowR2SetupModal] =
|
|
3825
|
-
const [processProgress, setProcessProgress] =
|
|
3826
|
-
const [alertMessage, setAlertMessage] =
|
|
3827
|
-
const [showCopied, setShowCopied] =
|
|
3828
|
-
const [pushing, setPushing] =
|
|
4205
|
+
const [showDeleteConfirm, setShowDeleteConfirm] = useState8(false);
|
|
4206
|
+
const [showRenameModal, setShowRenameModal] = useState8(false);
|
|
4207
|
+
const [showProcessConfirm, setShowProcessConfirm] = useState8(false);
|
|
4208
|
+
const [showR2SetupModal, setShowR2SetupModal] = useState8(false);
|
|
4209
|
+
const [processProgress, setProcessProgress] = useState8(null);
|
|
4210
|
+
const [alertMessage, setAlertMessage] = useState8(null);
|
|
4211
|
+
const [showCopied, setShowCopied] = useState8(false);
|
|
4212
|
+
const [pushing, setPushing] = useState8(false);
|
|
3829
4213
|
if (!focusedItem) return null;
|
|
3830
4214
|
const isImage = isImageFile(focusedItem.name);
|
|
3831
4215
|
const isVideo = isVideoFile(focusedItem.name);
|
|
@@ -3989,18 +4373,18 @@ function StudioDetailView() {
|
|
|
3989
4373
|
};
|
|
3990
4374
|
const renderMedia = () => {
|
|
3991
4375
|
if (isImage) {
|
|
3992
|
-
return /* @__PURE__ */
|
|
4376
|
+
return /* @__PURE__ */ jsx8("img", { css: styles8.image, src: imageSrc, alt: focusedItem.name });
|
|
3993
4377
|
}
|
|
3994
4378
|
if (isVideo) {
|
|
3995
|
-
return /* @__PURE__ */
|
|
4379
|
+
return /* @__PURE__ */ jsx8("video", { css: styles8.video, src: imageSrc, controls: true });
|
|
3996
4380
|
}
|
|
3997
|
-
return /* @__PURE__ */
|
|
3998
|
-
/* @__PURE__ */
|
|
3999
|
-
/* @__PURE__ */
|
|
4381
|
+
return /* @__PURE__ */ jsxs8("div", { css: styles8.filePlaceholder, children: [
|
|
4382
|
+
/* @__PURE__ */ jsx8("svg", { css: styles8.fileIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z" }) }),
|
|
4383
|
+
/* @__PURE__ */ jsx8("p", { css: styles8.fileName, children: focusedItem.name })
|
|
4000
4384
|
] });
|
|
4001
4385
|
};
|
|
4002
|
-
return /* @__PURE__ */
|
|
4003
|
-
showDeleteConfirm && /* @__PURE__ */
|
|
4386
|
+
return /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
4387
|
+
showDeleteConfirm && /* @__PURE__ */ jsx8(
|
|
4004
4388
|
ConfirmModal,
|
|
4005
4389
|
{
|
|
4006
4390
|
title: "Delete File",
|
|
@@ -4011,7 +4395,7 @@ function StudioDetailView() {
|
|
|
4011
4395
|
onCancel: () => setShowDeleteConfirm(false)
|
|
4012
4396
|
}
|
|
4013
4397
|
),
|
|
4014
|
-
alertMessage && /* @__PURE__ */
|
|
4398
|
+
alertMessage && /* @__PURE__ */ jsx8(
|
|
4015
4399
|
AlertModal,
|
|
4016
4400
|
{
|
|
4017
4401
|
title: alertMessage.title,
|
|
@@ -4019,14 +4403,14 @@ function StudioDetailView() {
|
|
|
4019
4403
|
onClose: () => setAlertMessage(null)
|
|
4020
4404
|
}
|
|
4021
4405
|
),
|
|
4022
|
-
/* @__PURE__ */
|
|
4406
|
+
/* @__PURE__ */ jsx8(
|
|
4023
4407
|
R2SetupModal,
|
|
4024
4408
|
{
|
|
4025
4409
|
isOpen: showR2SetupModal,
|
|
4026
4410
|
onClose: () => setShowR2SetupModal(false)
|
|
4027
4411
|
}
|
|
4028
4412
|
),
|
|
4029
|
-
showRenameModal && /* @__PURE__ */
|
|
4413
|
+
showRenameModal && /* @__PURE__ */ jsx8(
|
|
4030
4414
|
InputModal,
|
|
4031
4415
|
{
|
|
4032
4416
|
title: "Rename File",
|
|
@@ -4038,7 +4422,7 @@ function StudioDetailView() {
|
|
|
4038
4422
|
onCancel: () => setShowRenameModal(false)
|
|
4039
4423
|
}
|
|
4040
4424
|
),
|
|
4041
|
-
showProcessConfirm && /* @__PURE__ */
|
|
4425
|
+
showProcessConfirm && /* @__PURE__ */ jsx8(
|
|
4042
4426
|
ConfirmModal,
|
|
4043
4427
|
{
|
|
4044
4428
|
title: "Process Image",
|
|
@@ -4048,7 +4432,7 @@ function StudioDetailView() {
|
|
|
4048
4432
|
onCancel: () => setShowProcessConfirm(false)
|
|
4049
4433
|
}
|
|
4050
4434
|
),
|
|
4051
|
-
processProgress && /* @__PURE__ */
|
|
4435
|
+
processProgress && /* @__PURE__ */ jsx8(
|
|
4052
4436
|
ProgressModal,
|
|
4053
4437
|
{
|
|
4054
4438
|
title: "Processing Image",
|
|
@@ -4056,61 +4440,61 @@ function StudioDetailView() {
|
|
|
4056
4440
|
onClose: () => setProcessProgress(null)
|
|
4057
4441
|
}
|
|
4058
4442
|
),
|
|
4059
|
-
/* @__PURE__ */
|
|
4060
|
-
/* @__PURE__ */
|
|
4061
|
-
/* @__PURE__ */
|
|
4062
|
-
/* @__PURE__ */
|
|
4063
|
-
showCopied && /* @__PURE__ */
|
|
4064
|
-
/* @__PURE__ */
|
|
4443
|
+
/* @__PURE__ */ jsx8("div", { css: styles8.overlay, onClick: handleClose, children: /* @__PURE__ */ jsxs8("div", { css: styles8.container, onClick: (e) => e.stopPropagation(), children: [
|
|
4444
|
+
/* @__PURE__ */ jsxs8("div", { css: styles8.main, children: [
|
|
4445
|
+
/* @__PURE__ */ jsxs8("div", { css: styles8.headerButtons, children: [
|
|
4446
|
+
/* @__PURE__ */ jsxs8("button", { css: styles8.copyBtn, onClick: handleCopyPath, title: "Copy file path", children: [
|
|
4447
|
+
showCopied && /* @__PURE__ */ jsx8("span", { css: styles8.tooltip, children: "Copied!" }),
|
|
4448
|
+
/* @__PURE__ */ jsx8("svg", { css: styles8.copyIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) })
|
|
4065
4449
|
] }),
|
|
4066
|
-
/* @__PURE__ */
|
|
4450
|
+
/* @__PURE__ */ jsx8("button", { css: styles8.mainCloseBtn, onClick: handleClose, "aria-label": "Close", children: /* @__PURE__ */ jsx8("svg", { css: styles8.mainCloseIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })
|
|
4067
4451
|
] }),
|
|
4068
|
-
/* @__PURE__ */
|
|
4452
|
+
/* @__PURE__ */ jsx8("div", { css: styles8.mediaWrapper, children: renderMedia() })
|
|
4069
4453
|
] }),
|
|
4070
|
-
/* @__PURE__ */
|
|
4071
|
-
/* @__PURE__ */
|
|
4072
|
-
/* @__PURE__ */
|
|
4073
|
-
/* @__PURE__ */
|
|
4074
|
-
/* @__PURE__ */
|
|
4075
|
-
/* @__PURE__ */
|
|
4076
|
-
/* @__PURE__ */
|
|
4454
|
+
/* @__PURE__ */ jsxs8("div", { css: styles8.sidebar, children: [
|
|
4455
|
+
/* @__PURE__ */ jsx8("div", { css: styles8.sidebarHeader, children: /* @__PURE__ */ jsx8("h3", { css: styles8.sidebarTitle, children: "Details" }) }),
|
|
4456
|
+
/* @__PURE__ */ jsxs8("div", { css: styles8.sidebarContent, children: [
|
|
4457
|
+
/* @__PURE__ */ jsxs8("div", { css: styles8.info, children: [
|
|
4458
|
+
/* @__PURE__ */ jsxs8("div", { css: styles8.infoRow, children: [
|
|
4459
|
+
/* @__PURE__ */ jsx8("span", { css: styles8.infoLabel, children: "Name" }),
|
|
4460
|
+
/* @__PURE__ */ jsx8("span", { css: styles8.infoValueWrap, children: focusedItem.name })
|
|
4077
4461
|
] }),
|
|
4078
|
-
/* @__PURE__ */
|
|
4079
|
-
/* @__PURE__ */
|
|
4080
|
-
/* @__PURE__ */
|
|
4462
|
+
/* @__PURE__ */ jsxs8("div", { css: styles8.infoRow, children: [
|
|
4463
|
+
/* @__PURE__ */ jsx8("span", { css: styles8.infoLabel, children: "Path" }),
|
|
4464
|
+
/* @__PURE__ */ jsx8("span", { css: styles8.infoValueWrap, children: focusedItem.path.replace(/^public\//, "") })
|
|
4081
4465
|
] }),
|
|
4082
|
-
focusedItem.size !== void 0 && /* @__PURE__ */
|
|
4083
|
-
/* @__PURE__ */
|
|
4084
|
-
/* @__PURE__ */
|
|
4466
|
+
focusedItem.size !== void 0 && /* @__PURE__ */ jsxs8("div", { css: styles8.infoRow, children: [
|
|
4467
|
+
/* @__PURE__ */ jsx8("span", { css: styles8.infoLabel, children: "Size" }),
|
|
4468
|
+
/* @__PURE__ */ jsx8("span", { css: styles8.infoValue, children: formatFileSize3(focusedItem.size) })
|
|
4085
4469
|
] }),
|
|
4086
|
-
focusedItem.dimensions && /* @__PURE__ */
|
|
4087
|
-
/* @__PURE__ */
|
|
4088
|
-
/* @__PURE__ */
|
|
4470
|
+
focusedItem.dimensions && /* @__PURE__ */ jsxs8("div", { css: styles8.infoRow, children: [
|
|
4471
|
+
/* @__PURE__ */ jsx8("span", { css: styles8.infoLabel, children: "Dimensions" }),
|
|
4472
|
+
/* @__PURE__ */ jsxs8("span", { css: styles8.infoValue, children: [
|
|
4089
4473
|
focusedItem.dimensions.width,
|
|
4090
4474
|
" \xD7 ",
|
|
4091
4475
|
focusedItem.dimensions.height
|
|
4092
4476
|
] })
|
|
4093
4477
|
] }),
|
|
4094
|
-
/* @__PURE__ */
|
|
4095
|
-
/* @__PURE__ */
|
|
4096
|
-
/* @__PURE__ */
|
|
4478
|
+
/* @__PURE__ */ jsxs8("div", { css: styles8.infoRow, children: [
|
|
4479
|
+
/* @__PURE__ */ jsx8("span", { css: styles8.infoLabel, children: "CDN Status" }),
|
|
4480
|
+
/* @__PURE__ */ jsx8("span", { css: styles8.infoValue, children: focusedItem.cdnPushed ? "Pushed" : "Not pushed" })
|
|
4097
4481
|
] })
|
|
4098
4482
|
] }),
|
|
4099
|
-
/* @__PURE__ */
|
|
4100
|
-
/* @__PURE__ */
|
|
4101
|
-
/* @__PURE__ */
|
|
4483
|
+
/* @__PURE__ */ jsxs8("div", { css: styles8.actions, children: [
|
|
4484
|
+
/* @__PURE__ */ jsxs8("button", { css: styles8.actionBtn, onClick: () => setShowRenameModal(true), children: [
|
|
4485
|
+
/* @__PURE__ */ jsx8("svg", { css: styles8.actionIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) }),
|
|
4102
4486
|
"Rename"
|
|
4103
4487
|
] }),
|
|
4104
|
-
/* @__PURE__ */
|
|
4105
|
-
/* @__PURE__ */
|
|
4488
|
+
/* @__PURE__ */ jsxs8("button", { css: styles8.actionBtn, onClick: handleSync, disabled: pushing, children: [
|
|
4489
|
+
/* @__PURE__ */ jsx8("svg", { css: styles8.actionIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" }) }),
|
|
4106
4490
|
syncing ? "Pushing..." : "Push to CDN"
|
|
4107
4491
|
] }),
|
|
4108
|
-
/* @__PURE__ */
|
|
4109
|
-
/* @__PURE__ */
|
|
4492
|
+
/* @__PURE__ */ jsxs8("button", { css: styles8.actionBtn, onClick: () => setShowProcessConfirm(true), children: [
|
|
4493
|
+
/* @__PURE__ */ jsx8("svg", { css: styles8.actionIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }),
|
|
4110
4494
|
"Process Image"
|
|
4111
4495
|
] }),
|
|
4112
|
-
/* @__PURE__ */
|
|
4113
|
-
/* @__PURE__ */
|
|
4496
|
+
/* @__PURE__ */ jsxs8("button", { css: [styles8.actionBtn, styles8.actionBtnDanger], onClick: () => setShowDeleteConfirm(true), children: [
|
|
4497
|
+
/* @__PURE__ */ jsx8("svg", { css: styles8.actionIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }) }),
|
|
4114
4498
|
"Delete"
|
|
4115
4499
|
] })
|
|
4116
4500
|
] })
|
|
@@ -4126,12 +4510,12 @@ function formatFileSize3(bytes) {
|
|
|
4126
4510
|
}
|
|
4127
4511
|
|
|
4128
4512
|
// src/components/StudioSettings.tsx
|
|
4129
|
-
import { useState as
|
|
4130
|
-
import { css as
|
|
4131
|
-
import { Fragment as
|
|
4513
|
+
import { useState as useState9, useEffect as useEffect4, useCallback as useCallback4 } from "react";
|
|
4514
|
+
import { css as css9 } from "@emotion/react";
|
|
4515
|
+
import { Fragment as Fragment5, jsx as jsx9, jsxs as jsxs9 } from "@emotion/react/jsx-runtime";
|
|
4132
4516
|
var btnHeight2 = "36px";
|
|
4133
|
-
var
|
|
4134
|
-
btn:
|
|
4517
|
+
var styles9 = {
|
|
4518
|
+
btn: css9`
|
|
4135
4519
|
height: ${btnHeight2};
|
|
4136
4520
|
padding: 0 12px;
|
|
4137
4521
|
background: ${colors.surface};
|
|
@@ -4148,12 +4532,12 @@ var styles8 = {
|
|
|
4148
4532
|
border-color: ${colors.borderHover};
|
|
4149
4533
|
}
|
|
4150
4534
|
`,
|
|
4151
|
-
icon:
|
|
4535
|
+
icon: css9`
|
|
4152
4536
|
width: 16px;
|
|
4153
4537
|
height: 16px;
|
|
4154
4538
|
color: ${colors.textSecondary};
|
|
4155
4539
|
`,
|
|
4156
|
-
overlay:
|
|
4540
|
+
overlay: css9`
|
|
4157
4541
|
position: fixed;
|
|
4158
4542
|
top: 0;
|
|
4159
4543
|
right: 0;
|
|
@@ -4166,7 +4550,7 @@ var styles8 = {
|
|
|
4166
4550
|
background-color: rgba(26, 31, 54, 0.4);
|
|
4167
4551
|
backdrop-filter: blur(4px);
|
|
4168
4552
|
`,
|
|
4169
|
-
panel:
|
|
4553
|
+
panel: css9`
|
|
4170
4554
|
${baseReset}
|
|
4171
4555
|
position: relative;
|
|
4172
4556
|
background-color: ${colors.surface};
|
|
@@ -4176,20 +4560,20 @@ var styles8 = {
|
|
|
4176
4560
|
max-width: 512px;
|
|
4177
4561
|
padding: 24px;
|
|
4178
4562
|
`,
|
|
4179
|
-
header:
|
|
4563
|
+
header: css9`
|
|
4180
4564
|
display: flex;
|
|
4181
4565
|
align-items: center;
|
|
4182
4566
|
justify-content: space-between;
|
|
4183
4567
|
margin-bottom: 24px;
|
|
4184
4568
|
`,
|
|
4185
|
-
title:
|
|
4569
|
+
title: css9`
|
|
4186
4570
|
font-size: ${fontSize.xl};
|
|
4187
4571
|
font-weight: 600;
|
|
4188
4572
|
color: ${colors.text};
|
|
4189
4573
|
margin: 0;
|
|
4190
4574
|
letter-spacing: -0.02em;
|
|
4191
4575
|
`,
|
|
4192
|
-
closeBtn:
|
|
4576
|
+
closeBtn: css9`
|
|
4193
4577
|
padding: 6px;
|
|
4194
4578
|
background: ${colors.surface};
|
|
4195
4579
|
border: 1px solid ${colors.border};
|
|
@@ -4205,26 +4589,26 @@ var styles8 = {
|
|
|
4205
4589
|
border-color: ${colors.borderHover};
|
|
4206
4590
|
}
|
|
4207
4591
|
`,
|
|
4208
|
-
sections:
|
|
4592
|
+
sections: css9`
|
|
4209
4593
|
display: flex;
|
|
4210
4594
|
flex-direction: column;
|
|
4211
4595
|
gap: 24px;
|
|
4212
4596
|
`,
|
|
4213
|
-
sectionTitle:
|
|
4597
|
+
sectionTitle: css9`
|
|
4214
4598
|
font-size: ${fontSize.base};
|
|
4215
4599
|
font-weight: 600;
|
|
4216
4600
|
color: ${colors.text};
|
|
4217
4601
|
margin: 0 0 12px 0;
|
|
4218
4602
|
`,
|
|
4219
|
-
description:
|
|
4603
|
+
description: css9`
|
|
4220
4604
|
font-size: ${fontSize.sm};
|
|
4221
4605
|
color: ${colors.textSecondary};
|
|
4222
4606
|
margin: 0 0 12px 0;
|
|
4223
4607
|
`,
|
|
4224
|
-
codeWrapper:
|
|
4608
|
+
codeWrapper: css9`
|
|
4225
4609
|
position: relative;
|
|
4226
4610
|
`,
|
|
4227
|
-
code:
|
|
4611
|
+
code: css9`
|
|
4228
4612
|
background-color: ${colors.background};
|
|
4229
4613
|
border-radius: 8px;
|
|
4230
4614
|
padding: 12px;
|
|
@@ -4236,7 +4620,7 @@ var styles8 = {
|
|
|
4236
4620
|
overflow-x: auto;
|
|
4237
4621
|
white-space: nowrap;
|
|
4238
4622
|
`,
|
|
4239
|
-
copyBtn:
|
|
4623
|
+
copyBtn: css9`
|
|
4240
4624
|
position: absolute;
|
|
4241
4625
|
top: 8px;
|
|
4242
4626
|
right: 8px;
|
|
@@ -4255,7 +4639,7 @@ var styles8 = {
|
|
|
4255
4639
|
border-color: ${colors.borderHover};
|
|
4256
4640
|
}
|
|
4257
4641
|
`,
|
|
4258
|
-
tooltip:
|
|
4642
|
+
tooltip: css9`
|
|
4259
4643
|
position: absolute;
|
|
4260
4644
|
bottom: 100%;
|
|
4261
4645
|
left: 50%;
|
|
@@ -4280,19 +4664,19 @@ var styles8 = {
|
|
|
4280
4664
|
border-top-color: #1a1f36;
|
|
4281
4665
|
}
|
|
4282
4666
|
`,
|
|
4283
|
-
copyIcon:
|
|
4667
|
+
copyIcon: css9`
|
|
4284
4668
|
width: 14px;
|
|
4285
4669
|
height: 14px;
|
|
4286
4670
|
color: ${colors.textSecondary};
|
|
4287
4671
|
`,
|
|
4288
|
-
codeLine:
|
|
4672
|
+
codeLine: css9`
|
|
4289
4673
|
margin: 0 0 4px 0;
|
|
4290
4674
|
|
|
4291
4675
|
&:last-child {
|
|
4292
4676
|
margin: 0;
|
|
4293
4677
|
}
|
|
4294
4678
|
`,
|
|
4295
|
-
input:
|
|
4679
|
+
input: css9`
|
|
4296
4680
|
width: 100%;
|
|
4297
4681
|
padding: 10px 14px;
|
|
4298
4682
|
border: 1px solid ${colors.border};
|
|
@@ -4312,19 +4696,19 @@ var styles8 = {
|
|
|
4312
4696
|
color: ${colors.textMuted};
|
|
4313
4697
|
}
|
|
4314
4698
|
`,
|
|
4315
|
-
grid:
|
|
4699
|
+
grid: css9`
|
|
4316
4700
|
display: grid;
|
|
4317
4701
|
grid-template-columns: repeat(3, 1fr);
|
|
4318
4702
|
gap: 12px;
|
|
4319
4703
|
`,
|
|
4320
|
-
label:
|
|
4704
|
+
label: css9`
|
|
4321
4705
|
font-size: ${fontSize.xs};
|
|
4322
4706
|
font-weight: 500;
|
|
4323
4707
|
color: ${colors.textSecondary};
|
|
4324
4708
|
display: block;
|
|
4325
4709
|
margin-bottom: 6px;
|
|
4326
4710
|
`,
|
|
4327
|
-
footer:
|
|
4711
|
+
footer: css9`
|
|
4328
4712
|
margin-top: 24px;
|
|
4329
4713
|
padding-top: 20px;
|
|
4330
4714
|
border-top: 1px solid ${colors.border};
|
|
@@ -4332,7 +4716,7 @@ var styles8 = {
|
|
|
4332
4716
|
justify-content: flex-end;
|
|
4333
4717
|
gap: 12px;
|
|
4334
4718
|
`,
|
|
4335
|
-
cancelBtn:
|
|
4719
|
+
cancelBtn: css9`
|
|
4336
4720
|
padding: 10px 18px;
|
|
4337
4721
|
font-size: ${fontSize.base};
|
|
4338
4722
|
font-weight: 500;
|
|
@@ -4348,7 +4732,7 @@ var styles8 = {
|
|
|
4348
4732
|
border-color: ${colors.borderHover};
|
|
4349
4733
|
}
|
|
4350
4734
|
`,
|
|
4351
|
-
saveBtn:
|
|
4735
|
+
saveBtn: css9`
|
|
4352
4736
|
padding: 10px 18px;
|
|
4353
4737
|
font-size: ${fontSize.base};
|
|
4354
4738
|
font-weight: 500;
|
|
@@ -4363,15 +4747,94 @@ var styles8 = {
|
|
|
4363
4747
|
background-color: ${colors.primaryHover};
|
|
4364
4748
|
border-color: ${colors.primaryHover};
|
|
4365
4749
|
}
|
|
4750
|
+
|
|
4751
|
+
&:disabled {
|
|
4752
|
+
opacity: 0.6;
|
|
4753
|
+
cursor: not-allowed;
|
|
4754
|
+
}
|
|
4755
|
+
`,
|
|
4756
|
+
cdnList: css9`
|
|
4757
|
+
display: flex;
|
|
4758
|
+
flex-direction: column;
|
|
4759
|
+
gap: 8px;
|
|
4760
|
+
`,
|
|
4761
|
+
cdnRow: css9`
|
|
4762
|
+
display: flex;
|
|
4763
|
+
gap: 8px;
|
|
4764
|
+
align-items: center;
|
|
4765
|
+
`,
|
|
4766
|
+
cdnInput: css9`
|
|
4767
|
+
flex: 1;
|
|
4768
|
+
padding: 8px 12px;
|
|
4769
|
+
border: 1px solid ${colors.border};
|
|
4770
|
+
border-radius: 6px;
|
|
4771
|
+
font-size: ${fontSize.sm};
|
|
4772
|
+
color: ${colors.text};
|
|
4773
|
+
background: ${colors.surface};
|
|
4774
|
+
transition: all 0.15s ease;
|
|
4775
|
+
|
|
4776
|
+
&:focus {
|
|
4777
|
+
outline: none;
|
|
4778
|
+
border-color: ${colors.primary};
|
|
4779
|
+
box-shadow: 0 0 0 3px ${colors.primaryLight};
|
|
4780
|
+
}
|
|
4781
|
+
`,
|
|
4782
|
+
cdnIndex: css9`
|
|
4783
|
+
font-size: ${fontSize.xs};
|
|
4784
|
+
color: ${colors.textMuted};
|
|
4785
|
+
width: 24px;
|
|
4786
|
+
text-align: center;
|
|
4787
|
+
flex-shrink: 0;
|
|
4788
|
+
`,
|
|
4789
|
+
cdnDeleteBtn: css9`
|
|
4790
|
+
padding: 6px;
|
|
4791
|
+
background: none;
|
|
4792
|
+
border: none;
|
|
4793
|
+
cursor: pointer;
|
|
4794
|
+
color: ${colors.textMuted};
|
|
4795
|
+
transition: color 0.15s;
|
|
4796
|
+
flex-shrink: 0;
|
|
4797
|
+
|
|
4798
|
+
&:hover {
|
|
4799
|
+
color: ${colors.danger};
|
|
4800
|
+
}
|
|
4801
|
+
`,
|
|
4802
|
+
cdnAddBtn: css9`
|
|
4803
|
+
padding: 8px 12px;
|
|
4804
|
+
font-size: ${fontSize.sm};
|
|
4805
|
+
font-weight: 500;
|
|
4806
|
+
color: ${colors.primary};
|
|
4807
|
+
background: ${colors.primaryLight};
|
|
4808
|
+
border: 1px dashed ${colors.primary};
|
|
4809
|
+
border-radius: 6px;
|
|
4810
|
+
cursor: pointer;
|
|
4811
|
+
transition: all 0.15s ease;
|
|
4812
|
+
display: flex;
|
|
4813
|
+
align-items: center;
|
|
4814
|
+
justify-content: center;
|
|
4815
|
+
gap: 6px;
|
|
4816
|
+
margin-top: 8px;
|
|
4817
|
+
|
|
4818
|
+
&:hover {
|
|
4819
|
+
background: ${colors.surface};
|
|
4820
|
+
}
|
|
4821
|
+
`,
|
|
4822
|
+
warning: css9`
|
|
4823
|
+
font-size: ${fontSize.xs};
|
|
4824
|
+
color: ${colors.danger};
|
|
4825
|
+
margin-top: 8px;
|
|
4826
|
+
padding: 8px 12px;
|
|
4827
|
+
background: ${colors.dangerLight};
|
|
4828
|
+
border-radius: 6px;
|
|
4366
4829
|
`
|
|
4367
4830
|
};
|
|
4368
4831
|
function StudioSettings() {
|
|
4369
|
-
const [isOpen, setIsOpen] =
|
|
4370
|
-
return /* @__PURE__ */
|
|
4371
|
-
/* @__PURE__ */
|
|
4832
|
+
const [isOpen, setIsOpen] = useState9(false);
|
|
4833
|
+
return /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
|
4834
|
+
/* @__PURE__ */ jsx9("button", { css: styles9.btn, onClick: () => setIsOpen(true), "aria-label": "Settings", children: /* @__PURE__ */ jsxs9(
|
|
4372
4835
|
"svg",
|
|
4373
4836
|
{
|
|
4374
|
-
css:
|
|
4837
|
+
css: styles9.icon,
|
|
4375
4838
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4376
4839
|
viewBox: "0 0 24 24",
|
|
4377
4840
|
fill: "none",
|
|
@@ -4380,12 +4843,12 @@ function StudioSettings() {
|
|
|
4380
4843
|
strokeLinecap: "round",
|
|
4381
4844
|
strokeLinejoin: "round",
|
|
4382
4845
|
children: [
|
|
4383
|
-
/* @__PURE__ */
|
|
4384
|
-
/* @__PURE__ */
|
|
4846
|
+
/* @__PURE__ */ jsx9("circle", { cx: "12", cy: "12", r: "3" }),
|
|
4847
|
+
/* @__PURE__ */ jsx9("path", { d: "M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-2 2 2 2 0 01-2-2v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83 0 2 2 0 010-2.83l.06-.06a1.65 1.65 0 00.33-1.82 1.65 1.65 0 00-1.51-1H3a2 2 0 01-2-2 2 2 0 012-2h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 010-2.83 2 2 0 012.83 0l.06.06a1.65 1.65 0 001.82.33H9a1.65 1.65 0 001-1.51V3a2 2 0 012-2 2 2 0 012 2v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 0 2 2 0 010 2.83l-.06.06a1.65 1.65 0 00-.33 1.82V9a1.65 1.65 0 001.51 1H21a2 2 0 012 2 2 2 0 01-2 2h-.09a1.65 1.65 0 00-1.51 1z" })
|
|
4385
4848
|
]
|
|
4386
4849
|
}
|
|
4387
4850
|
) }),
|
|
4388
|
-
isOpen && /* @__PURE__ */
|
|
4851
|
+
isOpen && /* @__PURE__ */ jsx9(SettingsPanel, { onClose: () => setIsOpen(false) })
|
|
4389
4852
|
] });
|
|
4390
4853
|
}
|
|
4391
4854
|
var envTemplate = `CLOUDFLARE_R2_ACCOUNT_ID=abc123def456ghi789
|
|
@@ -4394,65 +4857,152 @@ CLOUDFLARE_R2_SECRET_ACCESS_KEY=your_secret_access_key_here
|
|
|
4394
4857
|
CLOUDFLARE_R2_BUCKET_NAME=my-images-bucket
|
|
4395
4858
|
CLOUDFLARE_R2_PUBLIC_URL=https://cdn.yourdomain.com`;
|
|
4396
4859
|
function SettingsPanel({ onClose }) {
|
|
4397
|
-
const
|
|
4860
|
+
const { triggerRefresh } = useStudio();
|
|
4861
|
+
const [copied, setCopied] = useState9(false);
|
|
4862
|
+
const [cdnUrls, setCdnUrls] = useState9([]);
|
|
4863
|
+
const [loading, setLoading] = useState9(true);
|
|
4864
|
+
const [saving, setSaving] = useState9(false);
|
|
4865
|
+
const [hasChanges, setHasChanges] = useState9(false);
|
|
4866
|
+
useEffect4(() => {
|
|
4867
|
+
async function loadCdns() {
|
|
4868
|
+
try {
|
|
4869
|
+
const response = await fetch("/api/studio/cdns");
|
|
4870
|
+
const data = await response.json();
|
|
4871
|
+
setCdnUrls(data.cdns || []);
|
|
4872
|
+
} catch (error) {
|
|
4873
|
+
console.error("Failed to load CDN URLs:", error);
|
|
4874
|
+
} finally {
|
|
4875
|
+
setLoading(false);
|
|
4876
|
+
}
|
|
4877
|
+
}
|
|
4878
|
+
loadCdns();
|
|
4879
|
+
}, []);
|
|
4398
4880
|
const handleCopy = () => {
|
|
4399
4881
|
navigator.clipboard.writeText(envTemplate);
|
|
4400
4882
|
setCopied(true);
|
|
4401
4883
|
setTimeout(() => setCopied(false), 2e3);
|
|
4402
4884
|
};
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4885
|
+
const handleCdnChange = useCallback4((index, value) => {
|
|
4886
|
+
setCdnUrls((prev) => {
|
|
4887
|
+
const updated = [...prev];
|
|
4888
|
+
updated[index] = value;
|
|
4889
|
+
return updated;
|
|
4890
|
+
});
|
|
4891
|
+
setHasChanges(true);
|
|
4892
|
+
}, []);
|
|
4893
|
+
const handleAddCdn = useCallback4(() => {
|
|
4894
|
+
setCdnUrls((prev) => [...prev, ""]);
|
|
4895
|
+
setHasChanges(true);
|
|
4896
|
+
}, []);
|
|
4897
|
+
const handleDeleteCdn = useCallback4((index) => {
|
|
4898
|
+
setCdnUrls((prev) => prev.filter((_, i) => i !== index));
|
|
4899
|
+
setHasChanges(true);
|
|
4900
|
+
}, []);
|
|
4901
|
+
const handleSave = useCallback4(async () => {
|
|
4902
|
+
setSaving(true);
|
|
4903
|
+
try {
|
|
4904
|
+
const response = await fetch("/api/studio/cdns", {
|
|
4905
|
+
method: "POST",
|
|
4906
|
+
headers: { "Content-Type": "application/json" },
|
|
4907
|
+
body: JSON.stringify({ cdns: cdnUrls.filter((url) => url.trim()) })
|
|
4908
|
+
});
|
|
4909
|
+
if (response.ok) {
|
|
4910
|
+
setHasChanges(false);
|
|
4911
|
+
triggerRefresh();
|
|
4912
|
+
onClose();
|
|
4913
|
+
}
|
|
4914
|
+
} catch (error) {
|
|
4915
|
+
console.error("Failed to save CDN URLs:", error);
|
|
4916
|
+
} finally {
|
|
4917
|
+
setSaving(false);
|
|
4918
|
+
}
|
|
4919
|
+
}, [cdnUrls, triggerRefresh, onClose]);
|
|
4920
|
+
return /* @__PURE__ */ jsx9("div", { css: styles9.overlay, onClick: onClose, children: /* @__PURE__ */ jsxs9("div", { css: styles9.panel, onClick: (e) => e.stopPropagation(), children: [
|
|
4921
|
+
/* @__PURE__ */ jsxs9("div", { css: styles9.header, children: [
|
|
4922
|
+
/* @__PURE__ */ jsx9("h2", { css: styles9.title, children: "Settings" }),
|
|
4923
|
+
/* @__PURE__ */ jsx9("button", { css: styles9.closeBtn, onClick: onClose, children: /* @__PURE__ */ jsx9("svg", { css: styles9.icon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx9("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })
|
|
4407
4924
|
] }),
|
|
4408
|
-
/* @__PURE__ */
|
|
4409
|
-
/* @__PURE__ */
|
|
4410
|
-
/* @__PURE__ */
|
|
4411
|
-
/* @__PURE__ */
|
|
4412
|
-
/* @__PURE__ */
|
|
4413
|
-
/* @__PURE__ */
|
|
4414
|
-
|
|
4415
|
-
/* @__PURE__ */
|
|
4925
|
+
/* @__PURE__ */ jsxs9("div", { css: styles9.sections, children: [
|
|
4926
|
+
/* @__PURE__ */ jsxs9("section", { children: [
|
|
4927
|
+
/* @__PURE__ */ jsx9("h3", { css: styles9.sectionTitle, children: "CDN URLs" }),
|
|
4928
|
+
/* @__PURE__ */ jsx9("p", { css: styles9.description, children: "Manage CDN base URLs used by your images:" }),
|
|
4929
|
+
loading ? /* @__PURE__ */ jsx9("p", { css: styles9.description, children: "Loading..." }) : /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
|
4930
|
+
/* @__PURE__ */ jsx9("div", { css: styles9.cdnList, children: cdnUrls.map((url, index) => /* @__PURE__ */ jsxs9("div", { css: styles9.cdnRow, children: [
|
|
4931
|
+
/* @__PURE__ */ jsx9("span", { css: styles9.cdnIndex, children: index }),
|
|
4932
|
+
/* @__PURE__ */ jsx9(
|
|
4933
|
+
"input",
|
|
4934
|
+
{
|
|
4935
|
+
css: styles9.cdnInput,
|
|
4936
|
+
type: "text",
|
|
4937
|
+
value: url,
|
|
4938
|
+
onChange: (e) => handleCdnChange(index, e.target.value),
|
|
4939
|
+
placeholder: "https://cdn.example.com"
|
|
4940
|
+
}
|
|
4941
|
+
),
|
|
4942
|
+
/* @__PURE__ */ jsx9(
|
|
4943
|
+
"button",
|
|
4944
|
+
{
|
|
4945
|
+
css: styles9.cdnDeleteBtn,
|
|
4946
|
+
onClick: () => handleDeleteCdn(index),
|
|
4947
|
+
title: "Delete CDN URL",
|
|
4948
|
+
children: /* @__PURE__ */ jsx9("svg", { width: "16", height: "16", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx9("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }) })
|
|
4949
|
+
}
|
|
4950
|
+
)
|
|
4951
|
+
] }, index)) }),
|
|
4952
|
+
/* @__PURE__ */ jsxs9("button", { css: styles9.cdnAddBtn, onClick: handleAddCdn, children: [
|
|
4953
|
+
/* @__PURE__ */ jsx9("svg", { width: "14", height: "14", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx9("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }),
|
|
4954
|
+
"Add CDN URL"
|
|
4955
|
+
] }),
|
|
4956
|
+
cdnUrls.length > 0 && /* @__PURE__ */ jsx9("p", { css: styles9.warning, children: "Warning: Changing CDN URLs may break image references. The index numbers correspond to image `c` values." })
|
|
4957
|
+
] })
|
|
4958
|
+
] }),
|
|
4959
|
+
/* @__PURE__ */ jsxs9("section", { children: [
|
|
4960
|
+
/* @__PURE__ */ jsx9("h3", { css: styles9.sectionTitle, children: "Cloudflare R2 Credentials" }),
|
|
4961
|
+
/* @__PURE__ */ jsx9("p", { css: styles9.description, children: "Configure in .env.local file:" }),
|
|
4962
|
+
/* @__PURE__ */ jsxs9("div", { css: styles9.codeWrapper, children: [
|
|
4963
|
+
/* @__PURE__ */ jsxs9("button", { css: styles9.copyBtn, onClick: handleCopy, title: "Copy to clipboard", children: [
|
|
4964
|
+
copied && /* @__PURE__ */ jsx9("span", { css: styles9.tooltip, children: "Copied!" }),
|
|
4965
|
+
/* @__PURE__ */ jsx9("svg", { css: styles9.copyIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx9("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) })
|
|
4416
4966
|
] }),
|
|
4417
|
-
/* @__PURE__ */
|
|
4418
|
-
/* @__PURE__ */
|
|
4419
|
-
/* @__PURE__ */
|
|
4420
|
-
/* @__PURE__ */
|
|
4421
|
-
/* @__PURE__ */
|
|
4422
|
-
/* @__PURE__ */
|
|
4967
|
+
/* @__PURE__ */ jsxs9("div", { css: styles9.code, children: [
|
|
4968
|
+
/* @__PURE__ */ jsx9("p", { css: styles9.codeLine, children: "CLOUDFLARE_R2_ACCOUNT_ID=abc123def456ghi789" }),
|
|
4969
|
+
/* @__PURE__ */ jsx9("p", { css: styles9.codeLine, children: "CLOUDFLARE_R2_ACCESS_KEY_ID=your_access_key_id_here" }),
|
|
4970
|
+
/* @__PURE__ */ jsx9("p", { css: styles9.codeLine, children: "CLOUDFLARE_R2_SECRET_ACCESS_KEY=your_secret_access_key_here" }),
|
|
4971
|
+
/* @__PURE__ */ jsx9("p", { css: styles9.codeLine, children: "CLOUDFLARE_R2_BUCKET_NAME=my-images-bucket" }),
|
|
4972
|
+
/* @__PURE__ */ jsx9("p", { css: styles9.codeLine, children: "CLOUDFLARE_R2_PUBLIC_URL=https://cdn.yourdomain.com" })
|
|
4423
4973
|
] })
|
|
4424
4974
|
] })
|
|
4425
4975
|
] }),
|
|
4426
|
-
/* @__PURE__ */
|
|
4427
|
-
/* @__PURE__ */
|
|
4428
|
-
/* @__PURE__ */
|
|
4429
|
-
/* @__PURE__ */
|
|
4430
|
-
/* @__PURE__ */
|
|
4431
|
-
/* @__PURE__ */
|
|
4976
|
+
/* @__PURE__ */ jsxs9("section", { children: [
|
|
4977
|
+
/* @__PURE__ */ jsx9("h3", { css: styles9.sectionTitle, children: "Thumbnail Sizes" }),
|
|
4978
|
+
/* @__PURE__ */ jsxs9("div", { css: styles9.grid, children: [
|
|
4979
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
4980
|
+
/* @__PURE__ */ jsx9("label", { css: styles9.label, children: "Small" }),
|
|
4981
|
+
/* @__PURE__ */ jsx9("input", { css: styles9.input, type: "number", defaultValue: 300 })
|
|
4432
4982
|
] }),
|
|
4433
|
-
/* @__PURE__ */
|
|
4434
|
-
/* @__PURE__ */
|
|
4435
|
-
/* @__PURE__ */
|
|
4983
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
4984
|
+
/* @__PURE__ */ jsx9("label", { css: styles9.label, children: "Medium" }),
|
|
4985
|
+
/* @__PURE__ */ jsx9("input", { css: styles9.input, type: "number", defaultValue: 700 })
|
|
4436
4986
|
] }),
|
|
4437
|
-
/* @__PURE__ */
|
|
4438
|
-
/* @__PURE__ */
|
|
4439
|
-
/* @__PURE__ */
|
|
4987
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
4988
|
+
/* @__PURE__ */ jsx9("label", { css: styles9.label, children: "Large" }),
|
|
4989
|
+
/* @__PURE__ */ jsx9("input", { css: styles9.input, type: "number", defaultValue: 1400 })
|
|
4440
4990
|
] })
|
|
4441
4991
|
] })
|
|
4442
4992
|
] })
|
|
4443
4993
|
] }),
|
|
4444
|
-
/* @__PURE__ */
|
|
4445
|
-
/* @__PURE__ */
|
|
4446
|
-
/* @__PURE__ */
|
|
4994
|
+
/* @__PURE__ */ jsxs9("div", { css: styles9.footer, children: [
|
|
4995
|
+
/* @__PURE__ */ jsx9("button", { css: styles9.cancelBtn, onClick: onClose, children: "Cancel" }),
|
|
4996
|
+
/* @__PURE__ */ jsx9("button", { css: styles9.saveBtn, onClick: handleSave, disabled: saving || !hasChanges, children: saving ? "Saving..." : "Save Changes" })
|
|
4447
4997
|
] })
|
|
4448
4998
|
] }) });
|
|
4449
4999
|
}
|
|
4450
5000
|
|
|
4451
5001
|
// src/components/ErrorModal.tsx
|
|
4452
|
-
import { css as
|
|
4453
|
-
import { jsx as
|
|
4454
|
-
var
|
|
4455
|
-
overlay:
|
|
5002
|
+
import { css as css10 } from "@emotion/react";
|
|
5003
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "@emotion/react/jsx-runtime";
|
|
5004
|
+
var styles10 = {
|
|
5005
|
+
overlay: css10`
|
|
4456
5006
|
position: fixed;
|
|
4457
5007
|
inset: 0;
|
|
4458
5008
|
background: rgba(0, 0, 0, 0.5);
|
|
@@ -4461,7 +5011,7 @@ var styles9 = {
|
|
|
4461
5011
|
justify-content: center;
|
|
4462
5012
|
z-index: 1100;
|
|
4463
5013
|
`,
|
|
4464
|
-
modal:
|
|
5014
|
+
modal: css10`
|
|
4465
5015
|
background: ${colors.surface};
|
|
4466
5016
|
border-radius: 12px;
|
|
4467
5017
|
padding: 24px;
|
|
@@ -4469,31 +5019,31 @@ var styles9 = {
|
|
|
4469
5019
|
width: 90%;
|
|
4470
5020
|
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
|
|
4471
5021
|
`,
|
|
4472
|
-
header:
|
|
5022
|
+
header: css10`
|
|
4473
5023
|
display: flex;
|
|
4474
5024
|
align-items: center;
|
|
4475
5025
|
gap: 12px;
|
|
4476
5026
|
margin-bottom: 12px;
|
|
4477
5027
|
`,
|
|
4478
|
-
icon:
|
|
5028
|
+
icon: css10`
|
|
4479
5029
|
width: 24px;
|
|
4480
5030
|
height: 24px;
|
|
4481
5031
|
color: ${colors.danger};
|
|
4482
5032
|
flex-shrink: 0;
|
|
4483
5033
|
`,
|
|
4484
|
-
title:
|
|
5034
|
+
title: css10`
|
|
4485
5035
|
font-size: ${fontSize.lg};
|
|
4486
5036
|
font-weight: 600;
|
|
4487
5037
|
color: ${colors.text};
|
|
4488
5038
|
margin: 0;
|
|
4489
5039
|
`,
|
|
4490
|
-
message:
|
|
5040
|
+
message: css10`
|
|
4491
5041
|
font-size: ${fontSize.base};
|
|
4492
5042
|
color: ${colors.textSecondary};
|
|
4493
5043
|
margin: 0 0 20px 0;
|
|
4494
5044
|
line-height: 1.5;
|
|
4495
5045
|
`,
|
|
4496
|
-
button:
|
|
5046
|
+
button: css10`
|
|
4497
5047
|
width: 100%;
|
|
4498
5048
|
padding: 10px 16px;
|
|
4499
5049
|
border-radius: 6px;
|
|
@@ -4513,28 +5063,28 @@ var styles9 = {
|
|
|
4513
5063
|
function ErrorModal() {
|
|
4514
5064
|
const { error, clearError } = useStudio();
|
|
4515
5065
|
if (!error) return null;
|
|
4516
|
-
return /* @__PURE__ */
|
|
4517
|
-
/* @__PURE__ */
|
|
4518
|
-
/* @__PURE__ */
|
|
4519
|
-
/* @__PURE__ */
|
|
5066
|
+
return /* @__PURE__ */ jsx10("div", { css: styles10.overlay, onClick: clearError, children: /* @__PURE__ */ jsxs10("div", { css: styles10.modal, onClick: (e) => e.stopPropagation(), children: [
|
|
5067
|
+
/* @__PURE__ */ jsxs10("div", { css: styles10.header, children: [
|
|
5068
|
+
/* @__PURE__ */ jsx10("svg", { css: styles10.icon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx10("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
|
|
5069
|
+
/* @__PURE__ */ jsx10("h3", { css: styles10.title, children: error.title })
|
|
4520
5070
|
] }),
|
|
4521
|
-
/* @__PURE__ */
|
|
4522
|
-
/* @__PURE__ */
|
|
5071
|
+
/* @__PURE__ */ jsx10("p", { css: styles10.message, children: error.message }),
|
|
5072
|
+
/* @__PURE__ */ jsx10("button", { css: styles10.button, onClick: clearError, children: "OK" })
|
|
4523
5073
|
] }) });
|
|
4524
5074
|
}
|
|
4525
5075
|
|
|
4526
5076
|
// src/components/StudioUI.tsx
|
|
4527
|
-
import { jsx as
|
|
5077
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "@emotion/react/jsx-runtime";
|
|
4528
5078
|
var btnHeight3 = "36px";
|
|
4529
|
-
var
|
|
4530
|
-
container:
|
|
5079
|
+
var styles11 = {
|
|
5080
|
+
container: css11`
|
|
4531
5081
|
${baseReset}
|
|
4532
5082
|
display: flex;
|
|
4533
5083
|
flex-direction: column;
|
|
4534
5084
|
height: 100%;
|
|
4535
5085
|
background: ${colors.background};
|
|
4536
5086
|
`,
|
|
4537
|
-
header:
|
|
5087
|
+
header: css11`
|
|
4538
5088
|
display: flex;
|
|
4539
5089
|
align-items: center;
|
|
4540
5090
|
justify-content: space-between;
|
|
@@ -4543,7 +5093,7 @@ var styles10 = {
|
|
|
4543
5093
|
border-bottom: 1px solid ${colors.border};
|
|
4544
5094
|
position: relative;
|
|
4545
5095
|
`,
|
|
4546
|
-
title:
|
|
5096
|
+
title: css11`
|
|
4547
5097
|
font-size: ${fontSize.lg};
|
|
4548
5098
|
font-weight: 600;
|
|
4549
5099
|
color: ${colors.text};
|
|
@@ -4551,14 +5101,14 @@ var styles10 = {
|
|
|
4551
5101
|
letter-spacing: -0.02em;
|
|
4552
5102
|
flex-shrink: 0;
|
|
4553
5103
|
`,
|
|
4554
|
-
headerLeft:
|
|
5104
|
+
headerLeft: css11`
|
|
4555
5105
|
display: flex;
|
|
4556
5106
|
align-items: center;
|
|
4557
5107
|
gap: 12px;
|
|
4558
5108
|
flex: 1;
|
|
4559
5109
|
min-width: 0;
|
|
4560
5110
|
`,
|
|
4561
|
-
headerCenter:
|
|
5111
|
+
headerCenter: css11`
|
|
4562
5112
|
position: absolute;
|
|
4563
5113
|
left: 50%;
|
|
4564
5114
|
transform: translateX(-50%);
|
|
@@ -4566,7 +5116,7 @@ var styles10 = {
|
|
|
4566
5116
|
align-items: center;
|
|
4567
5117
|
max-width: 50%;
|
|
4568
5118
|
`,
|
|
4569
|
-
breadcrumbs:
|
|
5119
|
+
breadcrumbs: css11`
|
|
4570
5120
|
display: flex;
|
|
4571
5121
|
align-items: center;
|
|
4572
5122
|
gap: 6px;
|
|
@@ -4574,11 +5124,11 @@ var styles10 = {
|
|
|
4574
5124
|
color: ${colors.textSecondary};
|
|
4575
5125
|
overflow: hidden;
|
|
4576
5126
|
`,
|
|
4577
|
-
breadcrumbSeparator:
|
|
5127
|
+
breadcrumbSeparator: css11`
|
|
4578
5128
|
color: ${colors.border};
|
|
4579
5129
|
flex-shrink: 0;
|
|
4580
5130
|
`,
|
|
4581
|
-
breadcrumbItem:
|
|
5131
|
+
breadcrumbItem: css11`
|
|
4582
5132
|
color: ${colors.textSecondary};
|
|
4583
5133
|
text-decoration: none;
|
|
4584
5134
|
cursor: pointer;
|
|
@@ -4589,19 +5139,19 @@ var styles10 = {
|
|
|
4589
5139
|
color: ${colors.primary};
|
|
4590
5140
|
}
|
|
4591
5141
|
`,
|
|
4592
|
-
breadcrumbCurrent:
|
|
5142
|
+
breadcrumbCurrent: css11`
|
|
4593
5143
|
color: ${colors.text};
|
|
4594
5144
|
font-weight: 500;
|
|
4595
5145
|
white-space: nowrap;
|
|
4596
5146
|
overflow: hidden;
|
|
4597
5147
|
text-overflow: ellipsis;
|
|
4598
5148
|
`,
|
|
4599
|
-
headerActions:
|
|
5149
|
+
headerActions: css11`
|
|
4600
5150
|
display: flex;
|
|
4601
5151
|
align-items: center;
|
|
4602
5152
|
gap: 8px;
|
|
4603
5153
|
`,
|
|
4604
|
-
headerBtn:
|
|
5154
|
+
headerBtn: css11`
|
|
4605
5155
|
height: ${btnHeight3};
|
|
4606
5156
|
padding: 0 12px;
|
|
4607
5157
|
background: ${colors.surface};
|
|
@@ -4618,17 +5168,17 @@ var styles10 = {
|
|
|
4618
5168
|
border-color: ${colors.borderHover};
|
|
4619
5169
|
}
|
|
4620
5170
|
`,
|
|
4621
|
-
headerIcon:
|
|
5171
|
+
headerIcon: css11`
|
|
4622
5172
|
width: 16px;
|
|
4623
5173
|
height: 16px;
|
|
4624
5174
|
color: ${colors.textSecondary};
|
|
4625
5175
|
`,
|
|
4626
|
-
content:
|
|
5176
|
+
content: css11`
|
|
4627
5177
|
flex: 1;
|
|
4628
5178
|
display: flex;
|
|
4629
5179
|
overflow: hidden;
|
|
4630
5180
|
`,
|
|
4631
|
-
fileBrowser:
|
|
5181
|
+
fileBrowser: css11`
|
|
4632
5182
|
flex: 1;
|
|
4633
5183
|
min-width: 0;
|
|
4634
5184
|
overflow: auto;
|
|
@@ -4636,7 +5186,7 @@ var styles10 = {
|
|
|
4636
5186
|
display: flex;
|
|
4637
5187
|
flex-direction: column;
|
|
4638
5188
|
`,
|
|
4639
|
-
dropOverlay:
|
|
5189
|
+
dropOverlay: css11`
|
|
4640
5190
|
position: absolute;
|
|
4641
5191
|
top: 0;
|
|
4642
5192
|
left: 0;
|
|
@@ -4651,7 +5201,7 @@ var styles10 = {
|
|
|
4651
5201
|
z-index: 50;
|
|
4652
5202
|
pointer-events: none;
|
|
4653
5203
|
`,
|
|
4654
|
-
dropMessage:
|
|
5204
|
+
dropMessage: css11`
|
|
4655
5205
|
display: flex;
|
|
4656
5206
|
flex-direction: column;
|
|
4657
5207
|
align-items: center;
|
|
@@ -4660,50 +5210,50 @@ var styles10 = {
|
|
|
4660
5210
|
font-size: ${fontSize.lg};
|
|
4661
5211
|
font-weight: 600;
|
|
4662
5212
|
`,
|
|
4663
|
-
dropIcon:
|
|
5213
|
+
dropIcon: css11`
|
|
4664
5214
|
width: 48px;
|
|
4665
5215
|
height: 48px;
|
|
4666
5216
|
`
|
|
4667
5217
|
};
|
|
4668
5218
|
function StudioUI({ onClose, isVisible = true }) {
|
|
4669
|
-
const [currentPath, setCurrentPathInternal] =
|
|
4670
|
-
const [selectedItems, setSelectedItems] =
|
|
4671
|
-
const [lastSelectedPath, setLastSelectedPath] =
|
|
4672
|
-
const [viewMode, setViewMode] =
|
|
4673
|
-
const [focusedItem, setFocusedItem] =
|
|
4674
|
-
const [meta, setMeta] =
|
|
4675
|
-
const [isLoading, setIsLoading] =
|
|
4676
|
-
const [refreshKey, setRefreshKey] =
|
|
4677
|
-
const [scanRequested, setScanRequested] =
|
|
4678
|
-
const [searchQuery, setSearchQuery] =
|
|
4679
|
-
const [error, setError] =
|
|
4680
|
-
const [isDragging, setIsDragging] =
|
|
4681
|
-
const triggerRefresh =
|
|
5219
|
+
const [currentPath, setCurrentPathInternal] = useState10("public");
|
|
5220
|
+
const [selectedItems, setSelectedItems] = useState10(/* @__PURE__ */ new Set());
|
|
5221
|
+
const [lastSelectedPath, setLastSelectedPath] = useState10(null);
|
|
5222
|
+
const [viewMode, setViewMode] = useState10("grid");
|
|
5223
|
+
const [focusedItem, setFocusedItem] = useState10(null);
|
|
5224
|
+
const [meta, setMeta] = useState10(null);
|
|
5225
|
+
const [isLoading, setIsLoading] = useState10(false);
|
|
5226
|
+
const [refreshKey, setRefreshKey] = useState10(0);
|
|
5227
|
+
const [scanRequested, setScanRequested] = useState10(false);
|
|
5228
|
+
const [searchQuery, setSearchQuery] = useState10("");
|
|
5229
|
+
const [error, setError] = useState10(null);
|
|
5230
|
+
const [isDragging, setIsDragging] = useState10(false);
|
|
5231
|
+
const triggerRefresh = useCallback5(() => {
|
|
4682
5232
|
setRefreshKey((k) => k + 1);
|
|
4683
5233
|
}, []);
|
|
4684
|
-
const triggerScan =
|
|
5234
|
+
const triggerScan = useCallback5(() => {
|
|
4685
5235
|
setScanRequested(true);
|
|
4686
5236
|
}, []);
|
|
4687
|
-
const clearScanRequest =
|
|
5237
|
+
const clearScanRequest = useCallback5(() => {
|
|
4688
5238
|
setScanRequested(false);
|
|
4689
5239
|
}, []);
|
|
4690
|
-
const showError =
|
|
5240
|
+
const showError = useCallback5((title, message) => {
|
|
4691
5241
|
setError({ title, message });
|
|
4692
5242
|
}, []);
|
|
4693
|
-
const clearError =
|
|
5243
|
+
const clearError = useCallback5(() => {
|
|
4694
5244
|
setError(null);
|
|
4695
5245
|
}, []);
|
|
4696
|
-
const handleDragOver =
|
|
5246
|
+
const handleDragOver = useCallback5((e) => {
|
|
4697
5247
|
e.preventDefault();
|
|
4698
5248
|
e.stopPropagation();
|
|
4699
5249
|
setIsDragging(true);
|
|
4700
5250
|
}, []);
|
|
4701
|
-
const handleDragLeave =
|
|
5251
|
+
const handleDragLeave = useCallback5((e) => {
|
|
4702
5252
|
e.preventDefault();
|
|
4703
5253
|
e.stopPropagation();
|
|
4704
5254
|
setIsDragging(false);
|
|
4705
5255
|
}, []);
|
|
4706
|
-
const handleDrop =
|
|
5256
|
+
const handleDrop = useCallback5(async (e) => {
|
|
4707
5257
|
e.preventDefault();
|
|
4708
5258
|
e.stopPropagation();
|
|
4709
5259
|
setIsDragging(false);
|
|
@@ -4727,19 +5277,19 @@ function StudioUI({ onClose, isVisible = true }) {
|
|
|
4727
5277
|
}
|
|
4728
5278
|
triggerRefresh();
|
|
4729
5279
|
}, [currentPath, triggerRefresh]);
|
|
4730
|
-
const navigateUp =
|
|
5280
|
+
const navigateUp = useCallback5(() => {
|
|
4731
5281
|
if (currentPath === "public") return;
|
|
4732
5282
|
const parts = currentPath.split("/");
|
|
4733
5283
|
parts.pop();
|
|
4734
5284
|
setCurrentPathInternal(parts.join("/") || "public");
|
|
4735
5285
|
setSelectedItems(/* @__PURE__ */ new Set());
|
|
4736
5286
|
}, [currentPath]);
|
|
4737
|
-
const setCurrentPath =
|
|
5287
|
+
const setCurrentPath = useCallback5((path) => {
|
|
4738
5288
|
setCurrentPathInternal(path);
|
|
4739
5289
|
setSelectedItems(/* @__PURE__ */ new Set());
|
|
4740
5290
|
setFocusedItem(null);
|
|
4741
5291
|
}, []);
|
|
4742
|
-
const toggleSelection =
|
|
5292
|
+
const toggleSelection = useCallback5((path) => {
|
|
4743
5293
|
setSelectedItems((prev) => {
|
|
4744
5294
|
const next = new Set(prev);
|
|
4745
5295
|
if (next.has(path)) {
|
|
@@ -4751,7 +5301,7 @@ function StudioUI({ onClose, isVisible = true }) {
|
|
|
4751
5301
|
});
|
|
4752
5302
|
setLastSelectedPath(path);
|
|
4753
5303
|
}, []);
|
|
4754
|
-
const selectRange =
|
|
5304
|
+
const selectRange = useCallback5((fromPath, toPath, allItems) => {
|
|
4755
5305
|
const fromIndex = allItems.findIndex((item) => item.path === fromPath);
|
|
4756
5306
|
const toIndex = allItems.findIndex((item) => item.path === toPath);
|
|
4757
5307
|
if (fromIndex === -1 || toIndex === -1) return;
|
|
@@ -4766,13 +5316,13 @@ function StudioUI({ onClose, isVisible = true }) {
|
|
|
4766
5316
|
});
|
|
4767
5317
|
setLastSelectedPath(toPath);
|
|
4768
5318
|
}, []);
|
|
4769
|
-
const selectAll =
|
|
5319
|
+
const selectAll = useCallback5((items) => {
|
|
4770
5320
|
setSelectedItems(new Set(items.map((item) => item.path)));
|
|
4771
5321
|
}, []);
|
|
4772
|
-
const clearSelection =
|
|
5322
|
+
const clearSelection = useCallback5(() => {
|
|
4773
5323
|
setSelectedItems(/* @__PURE__ */ new Set());
|
|
4774
5324
|
}, []);
|
|
4775
|
-
const handleKeyDown =
|
|
5325
|
+
const handleKeyDown = useCallback5(
|
|
4776
5326
|
(e) => {
|
|
4777
5327
|
if (e.key === "Escape") {
|
|
4778
5328
|
const target = e.target;
|
|
@@ -4788,7 +5338,7 @@ function StudioUI({ onClose, isVisible = true }) {
|
|
|
4788
5338
|
},
|
|
4789
5339
|
[onClose, focusedItem]
|
|
4790
5340
|
);
|
|
4791
|
-
|
|
5341
|
+
useEffect5(() => {
|
|
4792
5342
|
if (isVisible) {
|
|
4793
5343
|
document.addEventListener("keydown", handleKeyDown);
|
|
4794
5344
|
document.body.style.overflow = "hidden";
|
|
@@ -4832,42 +5382,42 @@ function StudioUI({ onClose, isVisible = true }) {
|
|
|
4832
5382
|
showError,
|
|
4833
5383
|
clearError
|
|
4834
5384
|
};
|
|
4835
|
-
return /* @__PURE__ */
|
|
4836
|
-
/* @__PURE__ */
|
|
4837
|
-
/* @__PURE__ */
|
|
4838
|
-
/* @__PURE__ */
|
|
4839
|
-
/* @__PURE__ */
|
|
4840
|
-
/* @__PURE__ */
|
|
4841
|
-
/* @__PURE__ */
|
|
5385
|
+
return /* @__PURE__ */ jsx11(StudioContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs11("div", { css: styles11.container, children: [
|
|
5386
|
+
/* @__PURE__ */ jsxs11("div", { css: styles11.header, children: [
|
|
5387
|
+
/* @__PURE__ */ jsx11("div", { css: styles11.headerLeft, children: /* @__PURE__ */ jsx11("h1", { css: styles11.title, children: "Studio" }) }),
|
|
5388
|
+
/* @__PURE__ */ jsx11("div", { css: styles11.headerCenter, children: /* @__PURE__ */ jsx11(Breadcrumbs, { currentPath, onNavigate: setCurrentPath }) }),
|
|
5389
|
+
/* @__PURE__ */ jsxs11("div", { css: styles11.headerActions, children: [
|
|
5390
|
+
/* @__PURE__ */ jsx11(StudioSettings, {}),
|
|
5391
|
+
/* @__PURE__ */ jsx11(
|
|
4842
5392
|
"button",
|
|
4843
5393
|
{
|
|
4844
|
-
css:
|
|
5394
|
+
css: styles11.headerBtn,
|
|
4845
5395
|
onClick: onClose,
|
|
4846
5396
|
"aria-label": "Close Studio",
|
|
4847
|
-
children: /* @__PURE__ */
|
|
5397
|
+
children: /* @__PURE__ */ jsx11(CloseIcon, {})
|
|
4848
5398
|
}
|
|
4849
5399
|
)
|
|
4850
5400
|
] })
|
|
4851
5401
|
] }),
|
|
4852
|
-
/* @__PURE__ */
|
|
4853
|
-
/* @__PURE__ */
|
|
5402
|
+
/* @__PURE__ */ jsx11(StudioToolbar, {}),
|
|
5403
|
+
/* @__PURE__ */ jsxs11(
|
|
4854
5404
|
"div",
|
|
4855
5405
|
{
|
|
4856
|
-
css:
|
|
5406
|
+
css: styles11.content,
|
|
4857
5407
|
onDragOver: handleDragOver,
|
|
4858
5408
|
onDragLeave: handleDragLeave,
|
|
4859
5409
|
onDrop: handleDrop,
|
|
4860
5410
|
children: [
|
|
4861
|
-
isDragging && /* @__PURE__ */
|
|
4862
|
-
/* @__PURE__ */
|
|
4863
|
-
/* @__PURE__ */
|
|
5411
|
+
isDragging && /* @__PURE__ */ jsx11("div", { css: styles11.dropOverlay, children: /* @__PURE__ */ jsxs11("div", { css: styles11.dropMessage, children: [
|
|
5412
|
+
/* @__PURE__ */ jsx11("svg", { css: styles11.dropIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx11("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" }) }),
|
|
5413
|
+
/* @__PURE__ */ jsx11("span", { children: "Drop files to upload" })
|
|
4864
5414
|
] }) }),
|
|
4865
|
-
/* @__PURE__ */
|
|
5415
|
+
/* @__PURE__ */ jsx11("div", { css: styles11.fileBrowser, children: viewMode === "grid" ? /* @__PURE__ */ jsx11(StudioFileGrid, {}) : /* @__PURE__ */ jsx11(StudioFileList, {}) })
|
|
4866
5416
|
]
|
|
4867
5417
|
}
|
|
4868
5418
|
),
|
|
4869
|
-
focusedItem && /* @__PURE__ */
|
|
4870
|
-
/* @__PURE__ */
|
|
5419
|
+
focusedItem && /* @__PURE__ */ jsx11(StudioDetailView, {}),
|
|
5420
|
+
/* @__PURE__ */ jsx11(ErrorModal, {})
|
|
4871
5421
|
] }) });
|
|
4872
5422
|
}
|
|
4873
5423
|
function Breadcrumbs({ currentPath, onNavigate }) {
|
|
@@ -4876,12 +5426,12 @@ function Breadcrumbs({ currentPath, onNavigate }) {
|
|
|
4876
5426
|
name: part,
|
|
4877
5427
|
path: parts.slice(0, index + 1).join("/")
|
|
4878
5428
|
}));
|
|
4879
|
-
return /* @__PURE__ */
|
|
4880
|
-
index > 0 && /* @__PURE__ */
|
|
4881
|
-
index === breadcrumbs.length - 1 ? /* @__PURE__ */
|
|
5429
|
+
return /* @__PURE__ */ jsx11("div", { css: styles11.breadcrumbs, children: breadcrumbs.map((crumb, index) => /* @__PURE__ */ jsxs11("span", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
5430
|
+
index > 0 && /* @__PURE__ */ jsx11("span", { css: styles11.breadcrumbSeparator, children: "/" }),
|
|
5431
|
+
index === breadcrumbs.length - 1 ? /* @__PURE__ */ jsx11("span", { css: styles11.breadcrumbCurrent, children: crumb.name }) : /* @__PURE__ */ jsx11(
|
|
4882
5432
|
"span",
|
|
4883
5433
|
{
|
|
4884
|
-
css:
|
|
5434
|
+
css: styles11.breadcrumbItem,
|
|
4885
5435
|
onClick: () => onNavigate(crumb.path),
|
|
4886
5436
|
children: crumb.name
|
|
4887
5437
|
}
|
|
@@ -4889,10 +5439,10 @@ function Breadcrumbs({ currentPath, onNavigate }) {
|
|
|
4889
5439
|
] }, crumb.path)) });
|
|
4890
5440
|
}
|
|
4891
5441
|
function CloseIcon() {
|
|
4892
|
-
return /* @__PURE__ */
|
|
5442
|
+
return /* @__PURE__ */ jsxs11(
|
|
4893
5443
|
"svg",
|
|
4894
5444
|
{
|
|
4895
|
-
css:
|
|
5445
|
+
css: styles11.headerIcon,
|
|
4896
5446
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4897
5447
|
viewBox: "0 0 24 24",
|
|
4898
5448
|
fill: "none",
|
|
@@ -4901,8 +5451,8 @@ function CloseIcon() {
|
|
|
4901
5451
|
strokeLinecap: "round",
|
|
4902
5452
|
strokeLinejoin: "round",
|
|
4903
5453
|
children: [
|
|
4904
|
-
/* @__PURE__ */
|
|
4905
|
-
/* @__PURE__ */
|
|
5454
|
+
/* @__PURE__ */ jsx11("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
5455
|
+
/* @__PURE__ */ jsx11("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
4906
5456
|
]
|
|
4907
5457
|
}
|
|
4908
5458
|
);
|
|
@@ -4912,4 +5462,4 @@ export {
|
|
|
4912
5462
|
StudioUI,
|
|
4913
5463
|
StudioUI_default as default
|
|
4914
5464
|
};
|
|
4915
|
-
//# sourceMappingURL=StudioUI-
|
|
5465
|
+
//# sourceMappingURL=StudioUI-GKE5ZWKW.mjs.map
|