@gallop.software/studio 0.1.22 → 0.1.23
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-TPVIV5T7.js → StudioUI-2BWLIO4W.js} +423 -478
- package/dist/StudioUI-2BWLIO4W.js.map +1 -0
- package/dist/{StudioUI-3VFEM3VE.mjs → StudioUI-QPAHJJ64.mjs} +538 -593
- package/dist/StudioUI-QPAHJJ64.mjs.map +1 -0
- package/dist/handlers.d.mts +4 -0
- package/dist/handlers.d.ts +4 -0
- package/dist/handlers.js +13 -4
- package/dist/handlers.js.map +1 -1
- package/dist/handlers.mjs +13 -4
- package/dist/handlers.mjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/StudioUI-3VFEM3VE.mjs.map +0 -1
- package/dist/StudioUI-TPVIV5T7.js.map +0 -1
|
@@ -38,6 +38,9 @@ var defaultState = {
|
|
|
38
38
|
viewMode: "grid",
|
|
39
39
|
setViewMode: () => {
|
|
40
40
|
},
|
|
41
|
+
focusedItem: null,
|
|
42
|
+
setFocusedItem: () => {
|
|
43
|
+
},
|
|
41
44
|
meta: null,
|
|
42
45
|
setMeta: () => {
|
|
43
46
|
},
|
|
@@ -204,6 +207,7 @@ function AlertModal({
|
|
|
204
207
|
|
|
205
208
|
// src/components/StudioToolbar.tsx
|
|
206
209
|
|
|
210
|
+
var btnHeight = "36px";
|
|
207
211
|
var spin = _react3.keyframes`
|
|
208
212
|
to { transform: rotate(360deg); }
|
|
209
213
|
`;
|
|
@@ -224,13 +228,15 @@ var styles2 = {
|
|
|
224
228
|
right: _react3.css`
|
|
225
229
|
display: flex;
|
|
226
230
|
align-items: center;
|
|
227
|
-
gap:
|
|
231
|
+
gap: 8px;
|
|
228
232
|
`,
|
|
229
233
|
btn: _react3.css`
|
|
230
234
|
display: inline-flex;
|
|
231
235
|
align-items: center;
|
|
236
|
+
justify-content: center;
|
|
232
237
|
gap: 6px;
|
|
233
|
-
|
|
238
|
+
height: ${btnHeight};
|
|
239
|
+
padding: 0 14px;
|
|
234
240
|
border-radius: 6px;
|
|
235
241
|
font-size: ${_chunkAY2DAS6Wjs.fontSize.base};
|
|
236
242
|
font-weight: 500;
|
|
@@ -251,6 +257,9 @@ var styles2 = {
|
|
|
251
257
|
opacity: 0.5;
|
|
252
258
|
}
|
|
253
259
|
`,
|
|
260
|
+
btnIconOnly: _react3.css`
|
|
261
|
+
padding: 0 10px;
|
|
262
|
+
`,
|
|
254
263
|
btnPrimary: _react3.css`
|
|
255
264
|
background: ${_chunkAY2DAS6Wjs.colors.primary};
|
|
256
265
|
border-color: ${_chunkAY2DAS6Wjs.colors.primary};
|
|
@@ -270,8 +279,8 @@ var styles2 = {
|
|
|
270
279
|
}
|
|
271
280
|
`,
|
|
272
281
|
icon: _react3.css`
|
|
273
|
-
width:
|
|
274
|
-
height:
|
|
282
|
+
width: 16px;
|
|
283
|
+
height: 16px;
|
|
275
284
|
`,
|
|
276
285
|
iconSpin: _react3.css`
|
|
277
286
|
animation: ${spin} 1s linear infinite;
|
|
@@ -282,6 +291,7 @@ var styles2 = {
|
|
|
282
291
|
display: flex;
|
|
283
292
|
align-items: center;
|
|
284
293
|
gap: 8px;
|
|
294
|
+
margin-right: 8px;
|
|
285
295
|
`,
|
|
286
296
|
clearBtn: _react3.css`
|
|
287
297
|
color: ${_chunkAY2DAS6Wjs.colors.primary};
|
|
@@ -305,16 +315,17 @@ var styles2 = {
|
|
|
305
315
|
viewToggle: _react3.css`
|
|
306
316
|
display: flex;
|
|
307
317
|
align-items: center;
|
|
308
|
-
|
|
318
|
+
height: ${btnHeight};
|
|
319
|
+
background-color: ${_chunkAY2DAS6Wjs.colors.surface};
|
|
309
320
|
border: 1px solid ${_chunkAY2DAS6Wjs.colors.border};
|
|
310
321
|
border-radius: 6px;
|
|
311
|
-
|
|
322
|
+
overflow: hidden;
|
|
312
323
|
`,
|
|
313
324
|
viewBtn: _react3.css`
|
|
314
|
-
|
|
325
|
+
height: 100%;
|
|
326
|
+
padding: 0 10px;
|
|
315
327
|
background: transparent;
|
|
316
328
|
border: none;
|
|
317
|
-
border-radius: 4px;
|
|
318
329
|
cursor: pointer;
|
|
319
330
|
color: ${_chunkAY2DAS6Wjs.colors.textSecondary};
|
|
320
331
|
transition: all 0.15s ease;
|
|
@@ -324,16 +335,16 @@ var styles2 = {
|
|
|
324
335
|
|
|
325
336
|
&:hover {
|
|
326
337
|
color: ${_chunkAY2DAS6Wjs.colors.text};
|
|
338
|
+
background-color: ${_chunkAY2DAS6Wjs.colors.surfaceHover};
|
|
327
339
|
}
|
|
328
340
|
`,
|
|
329
341
|
viewBtnActive: _react3.css`
|
|
330
|
-
background-color: ${_chunkAY2DAS6Wjs.colors.
|
|
342
|
+
background-color: ${_chunkAY2DAS6Wjs.colors.background};
|
|
331
343
|
color: ${_chunkAY2DAS6Wjs.colors.text};
|
|
332
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
|
|
333
344
|
`
|
|
334
345
|
};
|
|
335
346
|
function StudioToolbar() {
|
|
336
|
-
const { selectedItems, viewMode, setViewMode, clearSelection, currentPath, triggerRefresh } = useStudio();
|
|
347
|
+
const { selectedItems, viewMode, setViewMode, clearSelection, currentPath, triggerRefresh, focusedItem } = useStudio();
|
|
337
348
|
const fileInputRef = _react.useRef.call(void 0, null);
|
|
338
349
|
const [uploading, setUploading] = _react.useState.call(void 0, false);
|
|
339
350
|
const [refreshing, setRefreshing] = _react.useState.call(void 0, false);
|
|
@@ -431,6 +442,9 @@ function StudioToolbar() {
|
|
|
431
442
|
console.log("Scan clicked");
|
|
432
443
|
}, []);
|
|
433
444
|
const hasSelection = selectedItems.size > 0;
|
|
445
|
+
if (focusedItem) {
|
|
446
|
+
return null;
|
|
447
|
+
}
|
|
434
448
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
435
449
|
showDeleteConfirm && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
436
450
|
ConfirmModal,
|
|
@@ -527,7 +541,7 @@ function StudioToolbar() {
|
|
|
527
541
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
528
542
|
"button",
|
|
529
543
|
{
|
|
530
|
-
css: styles2.btn,
|
|
544
|
+
css: [styles2.btn, styles2.btnIconOnly],
|
|
531
545
|
onClick: handleRefresh,
|
|
532
546
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, RefreshIcon, { spinning: refreshing })
|
|
533
547
|
}
|
|
@@ -578,103 +592,6 @@ function ListIcon() {
|
|
|
578
592
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles2.icon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) });
|
|
579
593
|
}
|
|
580
594
|
|
|
581
|
-
// src/components/StudioBreadcrumb.tsx
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
var styles3 = {
|
|
585
|
-
container: _react3.css`
|
|
586
|
-
display: flex;
|
|
587
|
-
align-items: center;
|
|
588
|
-
gap: 8px;
|
|
589
|
-
padding: 10px 24px;
|
|
590
|
-
background-color: ${_chunkAY2DAS6Wjs.colors.surface};
|
|
591
|
-
border-bottom: 1px solid ${_chunkAY2DAS6Wjs.colors.borderLight};
|
|
592
|
-
`,
|
|
593
|
-
backBtn: _react3.css`
|
|
594
|
-
padding: 6px;
|
|
595
|
-
background: ${_chunkAY2DAS6Wjs.colors.surface};
|
|
596
|
-
border: 1px solid ${_chunkAY2DAS6Wjs.colors.border};
|
|
597
|
-
border-radius: 6px;
|
|
598
|
-
cursor: pointer;
|
|
599
|
-
transition: all 0.15s ease;
|
|
600
|
-
display: flex;
|
|
601
|
-
align-items: center;
|
|
602
|
-
justify-content: center;
|
|
603
|
-
|
|
604
|
-
&:hover {
|
|
605
|
-
background-color: ${_chunkAY2DAS6Wjs.colors.surfaceHover};
|
|
606
|
-
border-color: ${_chunkAY2DAS6Wjs.colors.borderHover};
|
|
607
|
-
}
|
|
608
|
-
`,
|
|
609
|
-
backIcon: _react3.css`
|
|
610
|
-
width: 16px;
|
|
611
|
-
height: 16px;
|
|
612
|
-
color: ${_chunkAY2DAS6Wjs.colors.textSecondary};
|
|
613
|
-
`,
|
|
614
|
-
nav: _react3.css`
|
|
615
|
-
display: flex;
|
|
616
|
-
align-items: center;
|
|
617
|
-
gap: 2px;
|
|
618
|
-
font-size: ${_chunkAY2DAS6Wjs.fontSize.base};
|
|
619
|
-
`,
|
|
620
|
-
item: _react3.css`
|
|
621
|
-
display: flex;
|
|
622
|
-
align-items: center;
|
|
623
|
-
gap: 2px;
|
|
624
|
-
`,
|
|
625
|
-
separator: _react3.css`
|
|
626
|
-
color: ${_chunkAY2DAS6Wjs.colors.textMuted};
|
|
627
|
-
margin: 0 2px;
|
|
628
|
-
`,
|
|
629
|
-
btn: _react3.css`
|
|
630
|
-
padding: 4px 8px;
|
|
631
|
-
background: none;
|
|
632
|
-
border: none;
|
|
633
|
-
border-radius: 4px;
|
|
634
|
-
cursor: pointer;
|
|
635
|
-
transition: all 0.15s ease;
|
|
636
|
-
font-size: ${_chunkAY2DAS6Wjs.fontSize.base};
|
|
637
|
-
letter-spacing: -0.01em;
|
|
638
|
-
|
|
639
|
-
&:hover {
|
|
640
|
-
background-color: ${_chunkAY2DAS6Wjs.colors.surfaceHover};
|
|
641
|
-
}
|
|
642
|
-
`,
|
|
643
|
-
btnActive: _react3.css`
|
|
644
|
-
color: ${_chunkAY2DAS6Wjs.colors.text};
|
|
645
|
-
font-weight: 600;
|
|
646
|
-
`,
|
|
647
|
-
btnInactive: _react3.css`
|
|
648
|
-
color: ${_chunkAY2DAS6Wjs.colors.textSecondary};
|
|
649
|
-
|
|
650
|
-
&:hover {
|
|
651
|
-
color: ${_chunkAY2DAS6Wjs.colors.text};
|
|
652
|
-
}
|
|
653
|
-
`
|
|
654
|
-
};
|
|
655
|
-
function StudioBreadcrumb() {
|
|
656
|
-
const { currentPath, setCurrentPath, navigateUp } = useStudio();
|
|
657
|
-
const parts = currentPath.split("/").filter(Boolean);
|
|
658
|
-
const handleClick = (index) => {
|
|
659
|
-
const newPath = parts.slice(0, index + 1).join("/");
|
|
660
|
-
setCurrentPath(newPath);
|
|
661
|
-
};
|
|
662
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles3.container, children: [
|
|
663
|
-
currentPath !== "public" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { css: styles3.backBtn, onClick: navigateUp, "aria-label": "Go back", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles3.backIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }) }),
|
|
664
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "nav", { css: styles3.nav, children: parts.map((part, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { css: styles3.item, children: [
|
|
665
|
-
index > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css: styles3.separator, children: "/" }),
|
|
666
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
667
|
-
"button",
|
|
668
|
-
{
|
|
669
|
-
css: [styles3.btn, index === parts.length - 1 ? styles3.btnActive : styles3.btnInactive],
|
|
670
|
-
onClick: () => handleClick(index),
|
|
671
|
-
children: part
|
|
672
|
-
}
|
|
673
|
-
)
|
|
674
|
-
] }, index)) })
|
|
675
|
-
] });
|
|
676
|
-
}
|
|
677
|
-
|
|
678
595
|
// src/components/StudioFileGrid.tsx
|
|
679
596
|
|
|
680
597
|
|
|
@@ -682,7 +599,7 @@ function StudioBreadcrumb() {
|
|
|
682
599
|
var spin2 = _react3.keyframes`
|
|
683
600
|
to { transform: rotate(360deg); }
|
|
684
601
|
`;
|
|
685
|
-
var
|
|
602
|
+
var styles3 = {
|
|
686
603
|
loading: _react3.css`
|
|
687
604
|
display: flex;
|
|
688
605
|
align-items: center;
|
|
@@ -754,6 +671,13 @@ var styles4 = {
|
|
|
754
671
|
border-color: ${_chunkAY2DAS6Wjs.colors.primary};
|
|
755
672
|
}
|
|
756
673
|
`,
|
|
674
|
+
parentItem: _react3.css`
|
|
675
|
+
cursor: pointer;
|
|
676
|
+
|
|
677
|
+
&:hover {
|
|
678
|
+
border-color: ${_chunkAY2DAS6Wjs.colors.primary};
|
|
679
|
+
}
|
|
680
|
+
`,
|
|
757
681
|
checkboxWrapper: _react3.css`
|
|
758
682
|
position: absolute;
|
|
759
683
|
top: 0;
|
|
@@ -793,6 +717,11 @@ var styles4 = {
|
|
|
793
717
|
height: 56px;
|
|
794
718
|
color: #f5a623;
|
|
795
719
|
`,
|
|
720
|
+
parentIcon: _react3.css`
|
|
721
|
+
width: 56px;
|
|
722
|
+
height: 56px;
|
|
723
|
+
color: ${_chunkAY2DAS6Wjs.colors.textMuted};
|
|
724
|
+
`,
|
|
796
725
|
fileIcon: _react3.css`
|
|
797
726
|
width: 40px;
|
|
798
727
|
height: 40px;
|
|
@@ -836,15 +765,18 @@ var styles4 = {
|
|
|
836
765
|
`,
|
|
837
766
|
openBtn: _react3.css`
|
|
838
767
|
flex-shrink: 0;
|
|
768
|
+
height: 28px;
|
|
839
769
|
font-size: ${_chunkAY2DAS6Wjs.fontSize.xs};
|
|
840
770
|
font-weight: 500;
|
|
841
771
|
color: ${_chunkAY2DAS6Wjs.colors.primary};
|
|
842
772
|
background: ${_chunkAY2DAS6Wjs.colors.surface};
|
|
843
773
|
border: 1px solid ${_chunkAY2DAS6Wjs.colors.border};
|
|
844
|
-
padding:
|
|
774
|
+
padding: 0 10px;
|
|
845
775
|
cursor: pointer;
|
|
846
776
|
border-radius: 4px;
|
|
847
777
|
transition: all 0.15s ease;
|
|
778
|
+
display: inline-flex;
|
|
779
|
+
align-items: center;
|
|
848
780
|
|
|
849
781
|
&:hover {
|
|
850
782
|
background-color: ${_chunkAY2DAS6Wjs.colors.primaryLight};
|
|
@@ -880,7 +812,7 @@ var styles4 = {
|
|
|
880
812
|
`
|
|
881
813
|
};
|
|
882
814
|
function StudioFileGrid() {
|
|
883
|
-
const { currentPath, setCurrentPath, selectedItems, toggleSelection, selectRange, lastSelectedPath, selectAll, clearSelection, refreshKey } = useStudio();
|
|
815
|
+
const { currentPath, setCurrentPath, navigateUp, selectedItems, toggleSelection, selectRange, lastSelectedPath, selectAll, clearSelection, refreshKey, setFocusedItem } = useStudio();
|
|
884
816
|
const [items, setItems] = _react.useState.call(void 0, []);
|
|
885
817
|
const [loading, setLoading] = _react.useState.call(void 0, true);
|
|
886
818
|
_react.useEffect.call(void 0, () => {
|
|
@@ -900,13 +832,14 @@ function StudioFileGrid() {
|
|
|
900
832
|
loadItems();
|
|
901
833
|
}, [currentPath, refreshKey]);
|
|
902
834
|
if (loading) {
|
|
903
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css:
|
|
835
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles3.loading, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles3.spinner }) });
|
|
904
836
|
}
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "
|
|
909
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css:
|
|
837
|
+
const isAtRoot = currentPath === "public";
|
|
838
|
+
if (items.length === 0 && isAtRoot) {
|
|
839
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles3.empty, children: [
|
|
840
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles3.emptyIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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" }) }),
|
|
841
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles3.emptyText, children: "No files in this folder" }),
|
|
842
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles3.emptyText, children: "Upload images to get started" })
|
|
910
843
|
] });
|
|
911
844
|
}
|
|
912
845
|
const sortedItems = [...items].sort((a, b) => {
|
|
@@ -921,9 +854,11 @@ function StudioFileGrid() {
|
|
|
921
854
|
toggleSelection(item.path);
|
|
922
855
|
}
|
|
923
856
|
};
|
|
924
|
-
const
|
|
857
|
+
const handleOpen = (item) => {
|
|
925
858
|
if (item.type === "folder") {
|
|
926
859
|
setCurrentPath(item.path);
|
|
860
|
+
} else {
|
|
861
|
+
setFocusedItem(item);
|
|
927
862
|
}
|
|
928
863
|
};
|
|
929
864
|
const allItemsSelected = sortedItems.length > 0 && sortedItems.every((item) => selectedItems.has(item.path));
|
|
@@ -936,12 +871,12 @@ function StudioFileGrid() {
|
|
|
936
871
|
}
|
|
937
872
|
};
|
|
938
873
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
939
|
-
sortedItems.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css:
|
|
874
|
+
sortedItems.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles3.selectAllRow, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "label", { css: styles3.selectAllLabel, children: [
|
|
940
875
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
941
876
|
"input",
|
|
942
877
|
{
|
|
943
878
|
type: "checkbox",
|
|
944
|
-
css:
|
|
879
|
+
css: styles3.selectAllCheckbox,
|
|
945
880
|
checked: allItemsSelected,
|
|
946
881
|
ref: (el) => {
|
|
947
882
|
if (el) el.indeterminate = someItemsSelected && !allItemsSelected;
|
|
@@ -953,16 +888,32 @@ function StudioFileGrid() {
|
|
|
953
888
|
sortedItems.length,
|
|
954
889
|
")"
|
|
955
890
|
] }) }),
|
|
956
|
-
/* @__PURE__ */ _jsxruntime.
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
891
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles3.grid, children: [
|
|
892
|
+
!isAtRoot && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
893
|
+
"div",
|
|
894
|
+
{
|
|
895
|
+
css: [styles3.item, styles3.parentItem],
|
|
896
|
+
onClick: navigateUp,
|
|
897
|
+
children: [
|
|
898
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles3.content, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles3.parentIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6" }) }) }),
|
|
899
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles3.label, children: [
|
|
900
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles3.name, children: ".." }),
|
|
901
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles3.size, children: "Parent folder" })
|
|
902
|
+
] })
|
|
903
|
+
]
|
|
904
|
+
}
|
|
905
|
+
),
|
|
906
|
+
sortedItems.map((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
907
|
+
GridItem,
|
|
908
|
+
{
|
|
909
|
+
item,
|
|
910
|
+
isSelected: selectedItems.has(item.path),
|
|
911
|
+
onClick: (e) => handleItemClick(item, e),
|
|
912
|
+
onOpen: () => handleOpen(item)
|
|
913
|
+
},
|
|
914
|
+
item.path
|
|
915
|
+
))
|
|
916
|
+
] })
|
|
966
917
|
] });
|
|
967
918
|
}
|
|
968
919
|
function GridItem({ item, isSelected, onClick, onOpen }) {
|
|
@@ -970,48 +921,48 @@ function GridItem({ item, isSelected, onClick, onOpen }) {
|
|
|
970
921
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
971
922
|
"div",
|
|
972
923
|
{
|
|
973
|
-
css: [
|
|
924
|
+
css: [styles3.item, isSelected && styles3.itemSelected],
|
|
974
925
|
onClick,
|
|
975
926
|
children: [
|
|
976
927
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
977
928
|
"div",
|
|
978
929
|
{
|
|
979
|
-
css:
|
|
930
|
+
css: styles3.checkboxWrapper,
|
|
980
931
|
onClick: (e) => e.stopPropagation(),
|
|
981
932
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
982
933
|
"input",
|
|
983
934
|
{
|
|
984
935
|
type: "checkbox",
|
|
985
|
-
css:
|
|
936
|
+
css: styles3.checkbox,
|
|
986
937
|
checked: isSelected,
|
|
987
938
|
onChange: () => onClick({})
|
|
988
939
|
}
|
|
989
940
|
)
|
|
990
941
|
}
|
|
991
942
|
),
|
|
992
|
-
item.cdnSynced && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css:
|
|
993
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css:
|
|
943
|
+
item.cdnSynced && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css: styles3.cdnBadge, children: "CDN" }),
|
|
944
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles3.content, children: isFolder ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles3.folderIcon, fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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" }) }) : item.thumbnail ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
994
945
|
"img",
|
|
995
946
|
{
|
|
996
|
-
css:
|
|
947
|
+
css: styles3.image,
|
|
997
948
|
src: item.thumbnail,
|
|
998
949
|
alt: item.name,
|
|
999
950
|
loading: "lazy"
|
|
1000
951
|
}
|
|
1001
|
-
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css:
|
|
1002
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css:
|
|
1003
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css:
|
|
1004
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css:
|
|
1005
|
-
isFolder ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { css:
|
|
952
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles3.fileIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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" }) }) }),
|
|
953
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles3.label, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles3.labelRow, children: [
|
|
954
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles3.labelText, children: [
|
|
955
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles3.name, title: item.name, children: item.name }),
|
|
956
|
+
isFolder ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { css: styles3.size, children: [
|
|
1006
957
|
item.fileCount !== void 0 ? `${item.fileCount} files` : "",
|
|
1007
958
|
item.fileCount !== void 0 && item.totalSize !== void 0 ? " \xB7 " : "",
|
|
1008
959
|
item.totalSize !== void 0 ? formatFileSize(item.totalSize) : ""
|
|
1009
|
-
] }) : item.size !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css:
|
|
960
|
+
] }) : item.size !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles3.size, children: formatFileSize(item.size) })
|
|
1010
961
|
] }),
|
|
1011
|
-
|
|
962
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1012
963
|
"button",
|
|
1013
964
|
{
|
|
1014
|
-
css:
|
|
965
|
+
css: styles3.openBtn,
|
|
1015
966
|
onClick: (e) => {
|
|
1016
967
|
e.stopPropagation();
|
|
1017
968
|
onOpen();
|
|
@@ -1037,7 +988,7 @@ function formatFileSize(bytes) {
|
|
|
1037
988
|
var spin3 = _react3.keyframes`
|
|
1038
989
|
to { transform: rotate(360deg); }
|
|
1039
990
|
`;
|
|
1040
|
-
var
|
|
991
|
+
var styles4 = {
|
|
1041
992
|
loading: _react3.css`
|
|
1042
993
|
display: flex;
|
|
1043
994
|
align-items: center;
|
|
@@ -1114,6 +1065,13 @@ var styles5 = {
|
|
|
1114
1065
|
background-color: ${_chunkAY2DAS6Wjs.colors.primaryLight};
|
|
1115
1066
|
}
|
|
1116
1067
|
`,
|
|
1068
|
+
parentRow: _react3.css`
|
|
1069
|
+
cursor: pointer;
|
|
1070
|
+
|
|
1071
|
+
&:hover {
|
|
1072
|
+
background-color: ${_chunkAY2DAS6Wjs.colors.surfaceHover};
|
|
1073
|
+
}
|
|
1074
|
+
`,
|
|
1117
1075
|
td: _react3.css`
|
|
1118
1076
|
padding: 12px 16px;
|
|
1119
1077
|
`,
|
|
@@ -1138,6 +1096,12 @@ var styles5 = {
|
|
|
1138
1096
|
color: #f5a623;
|
|
1139
1097
|
flex-shrink: 0;
|
|
1140
1098
|
`,
|
|
1099
|
+
parentIcon: _react3.css`
|
|
1100
|
+
width: 20px;
|
|
1101
|
+
height: 20px;
|
|
1102
|
+
color: ${_chunkAY2DAS6Wjs.colors.textMuted};
|
|
1103
|
+
flex-shrink: 0;
|
|
1104
|
+
`,
|
|
1141
1105
|
fileIcon: _react3.css`
|
|
1142
1106
|
width: 20px;
|
|
1143
1107
|
height: 20px;
|
|
@@ -1179,15 +1143,19 @@ var styles5 = {
|
|
|
1179
1143
|
color: ${_chunkAY2DAS6Wjs.colors.textMuted};
|
|
1180
1144
|
`,
|
|
1181
1145
|
openBtn: _react3.css`
|
|
1146
|
+
height: 28px;
|
|
1182
1147
|
font-size: ${_chunkAY2DAS6Wjs.fontSize.xs};
|
|
1183
1148
|
font-weight: 500;
|
|
1184
1149
|
color: ${_chunkAY2DAS6Wjs.colors.primary};
|
|
1185
1150
|
background: ${_chunkAY2DAS6Wjs.colors.surface};
|
|
1186
1151
|
border: 1px solid ${_chunkAY2DAS6Wjs.colors.border};
|
|
1187
|
-
padding:
|
|
1152
|
+
padding: 0 12px;
|
|
1188
1153
|
cursor: pointer;
|
|
1189
1154
|
border-radius: 4px;
|
|
1190
1155
|
transition: all 0.15s ease;
|
|
1156
|
+
display: inline-flex;
|
|
1157
|
+
align-items: center;
|
|
1158
|
+
margin-left: auto;
|
|
1191
1159
|
|
|
1192
1160
|
&:hover {
|
|
1193
1161
|
background-color: ${_chunkAY2DAS6Wjs.colors.primaryLight};
|
|
@@ -1196,7 +1164,7 @@ var styles5 = {
|
|
|
1196
1164
|
`
|
|
1197
1165
|
};
|
|
1198
1166
|
function StudioFileList() {
|
|
1199
|
-
const { currentPath, setCurrentPath, selectedItems, toggleSelection, selectRange, lastSelectedPath, selectAll, clearSelection, refreshKey } = useStudio();
|
|
1167
|
+
const { currentPath, setCurrentPath, navigateUp, selectedItems, toggleSelection, selectRange, lastSelectedPath, selectAll, clearSelection, refreshKey, setFocusedItem } = useStudio();
|
|
1200
1168
|
const [items, setItems] = _react.useState.call(void 0, []);
|
|
1201
1169
|
const [loading, setLoading] = _react.useState.call(void 0, true);
|
|
1202
1170
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1216,10 +1184,11 @@ function StudioFileList() {
|
|
|
1216
1184
|
loadItems();
|
|
1217
1185
|
}, [currentPath, refreshKey]);
|
|
1218
1186
|
if (loading) {
|
|
1219
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css:
|
|
1187
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles4.loading, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles4.spinner }) });
|
|
1220
1188
|
}
|
|
1221
|
-
|
|
1222
|
-
|
|
1189
|
+
const isAtRoot = currentPath === "public";
|
|
1190
|
+
if (items.length === 0 && isAtRoot) {
|
|
1191
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles4.empty, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { children: "No files in this folder" }) });
|
|
1223
1192
|
}
|
|
1224
1193
|
const sortedItems = [...items].sort((a, b) => {
|
|
1225
1194
|
if (a.type === "folder" && b.type !== "folder") return -1;
|
|
@@ -1233,9 +1202,11 @@ function StudioFileList() {
|
|
|
1233
1202
|
toggleSelection(item.path);
|
|
1234
1203
|
}
|
|
1235
1204
|
};
|
|
1236
|
-
const
|
|
1205
|
+
const handleOpen = (item) => {
|
|
1237
1206
|
if (item.type === "folder") {
|
|
1238
1207
|
setCurrentPath(item.path);
|
|
1208
|
+
} else {
|
|
1209
|
+
setFocusedItem(item);
|
|
1239
1210
|
}
|
|
1240
1211
|
};
|
|
1241
1212
|
const allItemsSelected = sortedItems.length > 0 && sortedItems.every((item) => selectedItems.has(item.path));
|
|
@@ -1247,13 +1218,13 @@ function StudioFileList() {
|
|
|
1247
1218
|
selectAll(sortedItems);
|
|
1248
1219
|
}
|
|
1249
1220
|
};
|
|
1250
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "table", { css:
|
|
1221
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles4.tableWrapper, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "table", { css: styles4.table, children: [
|
|
1251
1222
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "thead", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "tr", { children: [
|
|
1252
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { css: [
|
|
1223
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { css: [styles4.th, styles4.thCheckbox], children: sortedItems.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1253
1224
|
"input",
|
|
1254
1225
|
{
|
|
1255
1226
|
type: "checkbox",
|
|
1256
|
-
css:
|
|
1227
|
+
css: styles4.checkbox,
|
|
1257
1228
|
checked: allItemsSelected,
|
|
1258
1229
|
ref: (el) => {
|
|
1259
1230
|
if (el) el.indeterminate = someItemsSelected && !allItemsSelected;
|
|
@@ -1261,54 +1232,66 @@ function StudioFileList() {
|
|
|
1261
1232
|
onChange: handleSelectAll
|
|
1262
1233
|
}
|
|
1263
1234
|
) }),
|
|
1264
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { css:
|
|
1265
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { css: [
|
|
1266
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { css: [
|
|
1267
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { css: [
|
|
1235
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { css: styles4.th, children: "Name" }),
|
|
1236
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { css: [styles4.th, styles4.thSize], children: "Size" }),
|
|
1237
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { css: [styles4.th, styles4.thDimensions], children: "Dimensions" }),
|
|
1238
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { css: [styles4.th, styles4.thCdn], children: "CDN" })
|
|
1268
1239
|
] }) }),
|
|
1269
|
-
/* @__PURE__ */ _jsxruntime.
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1240
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "tbody", { css: styles4.tbody, children: [
|
|
1241
|
+
!isAtRoot && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "tr", { css: styles4.parentRow, onClick: navigateUp, children: [
|
|
1242
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { css: styles4.td }),
|
|
1243
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { css: styles4.td, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles4.nameCell, children: [
|
|
1244
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles4.parentIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6" }) }),
|
|
1245
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css: styles4.name, children: ".." })
|
|
1246
|
+
] }) }),
|
|
1247
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { css: [styles4.td, styles4.meta], children: "--" }),
|
|
1248
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { css: [styles4.td, styles4.meta], children: "Parent folder" }),
|
|
1249
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { css: styles4.td, children: "--" })
|
|
1250
|
+
] }),
|
|
1251
|
+
sortedItems.map((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1252
|
+
ListRow,
|
|
1253
|
+
{
|
|
1254
|
+
item,
|
|
1255
|
+
isSelected: selectedItems.has(item.path),
|
|
1256
|
+
onClick: (e) => handleItemClick(item, e),
|
|
1257
|
+
onOpen: () => handleOpen(item)
|
|
1258
|
+
},
|
|
1259
|
+
item.path
|
|
1260
|
+
))
|
|
1261
|
+
] })
|
|
1262
|
+
] }) });
|
|
1280
1263
|
}
|
|
1281
1264
|
function ListRow({ item, isSelected, onClick, onOpen }) {
|
|
1282
1265
|
const isFolder = item.type === "folder";
|
|
1283
1266
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1284
1267
|
"tr",
|
|
1285
1268
|
{
|
|
1286
|
-
css: [
|
|
1269
|
+
css: [styles4.row, isSelected && styles4.rowSelected],
|
|
1287
1270
|
onClick,
|
|
1288
1271
|
children: [
|
|
1289
1272
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1290
1273
|
"td",
|
|
1291
1274
|
{
|
|
1292
|
-
css: [
|
|
1275
|
+
css: [styles4.td, styles4.checkboxCell],
|
|
1293
1276
|
onClick: (e) => e.stopPropagation(),
|
|
1294
1277
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1295
1278
|
"input",
|
|
1296
1279
|
{
|
|
1297
1280
|
type: "checkbox",
|
|
1298
|
-
css:
|
|
1281
|
+
css: styles4.checkbox,
|
|
1299
1282
|
checked: isSelected,
|
|
1300
1283
|
onChange: () => onClick({})
|
|
1301
1284
|
}
|
|
1302
1285
|
)
|
|
1303
1286
|
}
|
|
1304
1287
|
),
|
|
1305
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { css:
|
|
1306
|
-
isFolder ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css:
|
|
1307
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css:
|
|
1308
|
-
|
|
1288
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { css: styles4.td, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles4.nameCell, children: [
|
|
1289
|
+
isFolder ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles4.folderIcon, fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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" }) }) : item.thumbnail ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { css: styles4.thumbnail, src: item.thumbnail, alt: item.name, loading: "lazy" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles4.fileIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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" }) }),
|
|
1290
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css: styles4.name, children: item.name }),
|
|
1291
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1309
1292
|
"button",
|
|
1310
1293
|
{
|
|
1311
|
-
css:
|
|
1294
|
+
css: styles4.openBtn,
|
|
1312
1295
|
onClick: (e) => {
|
|
1313
1296
|
e.stopPropagation();
|
|
1314
1297
|
onOpen();
|
|
@@ -1317,12 +1300,12 @@ function ListRow({ item, isSelected, onClick, onOpen }) {
|
|
|
1317
1300
|
}
|
|
1318
1301
|
)
|
|
1319
1302
|
] }) }),
|
|
1320
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { css: [
|
|
1321
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { css: [
|
|
1322
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { css:
|
|
1323
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css:
|
|
1303
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { css: [styles4.td, styles4.meta], children: isFolder ? item.fileCount !== void 0 ? `${item.fileCount} files` : "--" : item.size !== void 0 ? formatFileSize2(item.size) : "--" }),
|
|
1304
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { css: [styles4.td, styles4.meta], children: isFolder ? item.totalSize !== void 0 ? formatFileSize2(item.totalSize) : "--" : item.dimensions ? `${item.dimensions.width}x${item.dimensions.height}` : "--" }),
|
|
1305
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { css: styles4.td, children: item.cdnSynced ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { css: styles4.cdnBadge, children: [
|
|
1306
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles4.cdnIcon, fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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" }) }),
|
|
1324
1307
|
"Synced"
|
|
1325
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css:
|
|
1308
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css: styles4.cdnEmpty, children: "--" }) })
|
|
1326
1309
|
]
|
|
1327
1310
|
}
|
|
1328
1311
|
);
|
|
@@ -1333,7 +1316,7 @@ function formatFileSize2(bytes) {
|
|
|
1333
1316
|
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
1334
1317
|
}
|
|
1335
1318
|
|
|
1336
|
-
// src/components/
|
|
1319
|
+
// src/components/StudioDetailView.tsx
|
|
1337
1320
|
|
|
1338
1321
|
|
|
1339
1322
|
|
|
@@ -1347,161 +1330,158 @@ function isVideoFile(filename) {
|
|
|
1347
1330
|
const ext = filename.toLowerCase().substring(filename.lastIndexOf("."));
|
|
1348
1331
|
return VIDEO_EXTENSIONS.includes(ext);
|
|
1349
1332
|
}
|
|
1350
|
-
var
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1333
|
+
var styles5 = {
|
|
1334
|
+
container: _react3.css`
|
|
1335
|
+
display: flex;
|
|
1336
|
+
flex: 1;
|
|
1337
|
+
overflow: hidden;
|
|
1338
|
+
`,
|
|
1339
|
+
main: _react3.css`
|
|
1340
|
+
flex: 1;
|
|
1341
|
+
display: flex;
|
|
1342
|
+
flex-direction: column;
|
|
1343
|
+
align-items: center;
|
|
1344
|
+
justify-content: center;
|
|
1345
|
+
padding: 24px;
|
|
1346
|
+
background: ${_chunkAY2DAS6Wjs.colors.background};
|
|
1356
1347
|
overflow: auto;
|
|
1357
1348
|
`,
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
margin: 0 0 16px 0;
|
|
1349
|
+
mediaWrapper: _react3.css`
|
|
1350
|
+
max-width: 100%;
|
|
1351
|
+
max-height: 100%;
|
|
1352
|
+
display: flex;
|
|
1353
|
+
align-items: center;
|
|
1354
|
+
justify-content: center;
|
|
1365
1355
|
`,
|
|
1366
|
-
|
|
1367
|
-
|
|
1356
|
+
image: _react3.css`
|
|
1357
|
+
max-width: 100%;
|
|
1358
|
+
max-height: calc(100vh - 200px);
|
|
1359
|
+
object-fit: contain;
|
|
1368
1360
|
border-radius: 8px;
|
|
1369
|
-
|
|
1370
|
-
padding: 12px;
|
|
1371
|
-
margin-bottom: 20px;
|
|
1361
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
1372
1362
|
`,
|
|
1373
|
-
|
|
1374
|
-
width: 100%;
|
|
1375
|
-
height:
|
|
1376
|
-
border-radius:
|
|
1363
|
+
video: _react3.css`
|
|
1364
|
+
max-width: 100%;
|
|
1365
|
+
max-height: calc(100vh - 200px);
|
|
1366
|
+
border-radius: 8px;
|
|
1367
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
1377
1368
|
`,
|
|
1378
|
-
|
|
1369
|
+
filePlaceholder: _react3.css`
|
|
1379
1370
|
display: flex;
|
|
1380
1371
|
flex-direction: column;
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1372
|
+
align-items: center;
|
|
1373
|
+
justify-content: center;
|
|
1374
|
+
padding: 48px;
|
|
1375
|
+
background: ${_chunkAY2DAS6Wjs.colors.surface};
|
|
1376
|
+
border-radius: 12px;
|
|
1377
|
+
border: 1px solid ${_chunkAY2DAS6Wjs.colors.border};
|
|
1387
1378
|
`,
|
|
1388
|
-
|
|
1389
|
-
|
|
1379
|
+
fileIcon: _react3.css`
|
|
1380
|
+
width: 80px;
|
|
1381
|
+
height: 80px;
|
|
1382
|
+
color: ${_chunkAY2DAS6Wjs.colors.textMuted};
|
|
1383
|
+
margin-bottom: 16px;
|
|
1390
1384
|
`,
|
|
1391
|
-
|
|
1385
|
+
fileName: _react3.css`
|
|
1386
|
+
font-size: ${_chunkAY2DAS6Wjs.fontSize.lg};
|
|
1387
|
+
font-weight: 600;
|
|
1392
1388
|
color: ${_chunkAY2DAS6Wjs.colors.text};
|
|
1393
|
-
|
|
1389
|
+
margin: 0;
|
|
1394
1390
|
`,
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1391
|
+
sidebar: _react3.css`
|
|
1392
|
+
width: 280px;
|
|
1393
|
+
background: ${_chunkAY2DAS6Wjs.colors.surface};
|
|
1394
|
+
border-left: 1px solid ${_chunkAY2DAS6Wjs.colors.border};
|
|
1395
|
+
display: flex;
|
|
1396
|
+
flex-direction: column;
|
|
1398
1397
|
overflow: hidden;
|
|
1399
|
-
text-overflow: ellipsis;
|
|
1400
1398
|
`,
|
|
1401
|
-
|
|
1402
|
-
padding
|
|
1403
|
-
|
|
1404
|
-
border-top: 1px solid ${_chunkAY2DAS6Wjs.colors.borderLight};
|
|
1405
|
-
`,
|
|
1406
|
-
sectionTitle: _react3.css`
|
|
1407
|
-
font-size: ${_chunkAY2DAS6Wjs.fontSize.xs};
|
|
1408
|
-
font-weight: 600;
|
|
1409
|
-
color: ${_chunkAY2DAS6Wjs.colors.textMuted};
|
|
1410
|
-
text-transform: uppercase;
|
|
1411
|
-
letter-spacing: 0.05em;
|
|
1412
|
-
margin: 0 0 10px 0;
|
|
1413
|
-
`,
|
|
1414
|
-
cdnStatus: _react3.css`
|
|
1399
|
+
sidebarHeader: _react3.css`
|
|
1400
|
+
padding: 16px 20px;
|
|
1401
|
+
border-bottom: 1px solid ${_chunkAY2DAS6Wjs.colors.border};
|
|
1415
1402
|
display: flex;
|
|
1416
1403
|
align-items: center;
|
|
1417
|
-
|
|
1418
|
-
font-size: ${_chunkAY2DAS6Wjs.fontSize.sm};
|
|
1419
|
-
color: ${_chunkAY2DAS6Wjs.colors.success};
|
|
1420
|
-
font-weight: 500;
|
|
1404
|
+
justify-content: space-between;
|
|
1421
1405
|
`,
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1406
|
+
sidebarTitle: _react3.css`
|
|
1407
|
+
font-size: ${_chunkAY2DAS6Wjs.fontSize.base};
|
|
1408
|
+
font-weight: 600;
|
|
1409
|
+
color: ${_chunkAY2DAS6Wjs.colors.text};
|
|
1410
|
+
margin: 0;
|
|
1425
1411
|
`,
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
background: none;
|
|
1432
|
-
border: none;
|
|
1412
|
+
closeBtn: _react3.css`
|
|
1413
|
+
padding: 6px;
|
|
1414
|
+
background: ${_chunkAY2DAS6Wjs.colors.surface};
|
|
1415
|
+
border: 1px solid ${_chunkAY2DAS6Wjs.colors.border};
|
|
1416
|
+
border-radius: 6px;
|
|
1433
1417
|
cursor: pointer;
|
|
1434
|
-
|
|
1418
|
+
transition: all 0.15s ease;
|
|
1419
|
+
display: flex;
|
|
1420
|
+
align-items: center;
|
|
1421
|
+
justify-content: center;
|
|
1435
1422
|
|
|
1436
1423
|
&:hover {
|
|
1437
|
-
|
|
1424
|
+
background-color: ${_chunkAY2DAS6Wjs.colors.surfaceHover};
|
|
1425
|
+
border-color: ${_chunkAY2DAS6Wjs.colors.borderHover};
|
|
1438
1426
|
}
|
|
1439
1427
|
`,
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
height:
|
|
1443
|
-
|
|
1444
|
-
border: 1px solid ${_chunkAY2DAS6Wjs.colors.border};
|
|
1428
|
+
closeIcon: _react3.css`
|
|
1429
|
+
width: 16px;
|
|
1430
|
+
height: 16px;
|
|
1431
|
+
color: ${_chunkAY2DAS6Wjs.colors.textSecondary};
|
|
1445
1432
|
`,
|
|
1446
|
-
|
|
1433
|
+
sidebarContent: _react3.css`
|
|
1434
|
+
flex: 1;
|
|
1435
|
+
padding: 20px;
|
|
1436
|
+
overflow: auto;
|
|
1437
|
+
`,
|
|
1438
|
+
info: _react3.css`
|
|
1447
1439
|
display: flex;
|
|
1448
1440
|
flex-direction: column;
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
height: 200px;
|
|
1452
|
-
text-align: center;
|
|
1453
|
-
`,
|
|
1454
|
-
emptyText: _react3.css`
|
|
1455
|
-
font-size: ${_chunkAY2DAS6Wjs.fontSize.sm};
|
|
1456
|
-
color: ${_chunkAY2DAS6Wjs.colors.textMuted};
|
|
1457
|
-
margin: 0;
|
|
1441
|
+
gap: 12px;
|
|
1442
|
+
margin-bottom: 24px;
|
|
1458
1443
|
`,
|
|
1459
|
-
|
|
1444
|
+
infoRow: _react3.css`
|
|
1460
1445
|
display: flex;
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
height: 120px;
|
|
1464
|
-
background: ${_chunkAY2DAS6Wjs.colors.background};
|
|
1465
|
-
border-radius: 6px;
|
|
1466
|
-
`,
|
|
1467
|
-
fileIcon: _react3.css`
|
|
1468
|
-
width: 56px;
|
|
1469
|
-
height: 56px;
|
|
1470
|
-
color: ${_chunkAY2DAS6Wjs.colors.textMuted};
|
|
1446
|
+
justify-content: space-between;
|
|
1447
|
+
font-size: ${_chunkAY2DAS6Wjs.fontSize.sm};
|
|
1471
1448
|
`,
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
height: 56px;
|
|
1475
|
-
color: #f5a623;
|
|
1449
|
+
infoLabel: _react3.css`
|
|
1450
|
+
color: ${_chunkAY2DAS6Wjs.colors.textSecondary};
|
|
1476
1451
|
`,
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1452
|
+
infoValue: _react3.css`
|
|
1453
|
+
color: ${_chunkAY2DAS6Wjs.colors.text};
|
|
1454
|
+
font-weight: 500;
|
|
1455
|
+
text-align: right;
|
|
1456
|
+
max-width: 160px;
|
|
1457
|
+
overflow: hidden;
|
|
1458
|
+
text-overflow: ellipsis;
|
|
1459
|
+
white-space: nowrap;
|
|
1481
1460
|
`,
|
|
1482
1461
|
actions: _react3.css`
|
|
1483
|
-
margin-top: 20px;
|
|
1484
|
-
padding-top: 20px;
|
|
1485
|
-
border-top: 1px solid ${_chunkAY2DAS6Wjs.colors.border};
|
|
1486
1462
|
display: flex;
|
|
1487
1463
|
flex-direction: column;
|
|
1488
1464
|
gap: 8px;
|
|
1489
1465
|
`,
|
|
1490
1466
|
actionBtn: _react3.css`
|
|
1467
|
+
display: flex;
|
|
1468
|
+
align-items: center;
|
|
1469
|
+
gap: 10px;
|
|
1491
1470
|
width: 100%;
|
|
1492
|
-
padding:
|
|
1471
|
+
padding: 12px 14px;
|
|
1493
1472
|
font-size: ${_chunkAY2DAS6Wjs.fontSize.base};
|
|
1494
1473
|
font-weight: 500;
|
|
1495
|
-
background
|
|
1474
|
+
background: ${_chunkAY2DAS6Wjs.colors.surface};
|
|
1496
1475
|
border: 1px solid ${_chunkAY2DAS6Wjs.colors.border};
|
|
1497
1476
|
border-radius: 6px;
|
|
1498
1477
|
cursor: pointer;
|
|
1499
1478
|
transition: all 0.15s ease;
|
|
1500
1479
|
color: ${_chunkAY2DAS6Wjs.colors.text};
|
|
1480
|
+
text-align: left;
|
|
1501
1481
|
|
|
1502
1482
|
&:hover {
|
|
1503
1483
|
background-color: ${_chunkAY2DAS6Wjs.colors.surfaceHover};
|
|
1504
|
-
border-color:
|
|
1484
|
+
border-color: ${_chunkAY2DAS6Wjs.colors.borderHover};
|
|
1505
1485
|
}
|
|
1506
1486
|
`,
|
|
1507
1487
|
actionBtnDanger: _react3.css`
|
|
@@ -1511,27 +1491,42 @@ var styles6 = {
|
|
|
1511
1491
|
background-color: ${_chunkAY2DAS6Wjs.colors.dangerLight};
|
|
1512
1492
|
border-color: ${_chunkAY2DAS6Wjs.colors.danger};
|
|
1513
1493
|
}
|
|
1494
|
+
`,
|
|
1495
|
+
actionIcon: _react3.css`
|
|
1496
|
+
width: 16px;
|
|
1497
|
+
height: 16px;
|
|
1498
|
+
flex-shrink: 0;
|
|
1514
1499
|
`
|
|
1515
1500
|
};
|
|
1516
|
-
function
|
|
1517
|
-
const {
|
|
1501
|
+
function StudioDetailView() {
|
|
1502
|
+
const { focusedItem, setFocusedItem, triggerRefresh, clearSelection } = useStudio();
|
|
1518
1503
|
const [showDeleteConfirm, setShowDeleteConfirm] = _react.useState.call(void 0, false);
|
|
1519
1504
|
const [alertMessage, setAlertMessage] = _react.useState.call(void 0, null);
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1505
|
+
if (!focusedItem) return null;
|
|
1506
|
+
const isImage = isImageFile(focusedItem.name);
|
|
1507
|
+
const isVideo = isVideoFile(focusedItem.name);
|
|
1508
|
+
const imageSrc = focusedItem.path.replace("public", "");
|
|
1509
|
+
const handleClose = () => {
|
|
1510
|
+
setFocusedItem(null);
|
|
1511
|
+
};
|
|
1512
|
+
const handleRename = () => {
|
|
1513
|
+
const newName = prompt("Enter new name:", focusedItem.name);
|
|
1514
|
+
if (newName && newName !== focusedItem.name) {
|
|
1515
|
+
console.log("Rename to:", newName);
|
|
1516
|
+
}
|
|
1523
1517
|
};
|
|
1524
|
-
const
|
|
1518
|
+
const handleDelete = async () => {
|
|
1525
1519
|
setShowDeleteConfirm(false);
|
|
1526
1520
|
try {
|
|
1527
1521
|
const response = await fetch("/api/studio/delete", {
|
|
1528
1522
|
method: "POST",
|
|
1529
1523
|
headers: { "Content-Type": "application/json" },
|
|
1530
|
-
body: JSON.stringify({ paths:
|
|
1524
|
+
body: JSON.stringify({ paths: [focusedItem.path] })
|
|
1531
1525
|
});
|
|
1532
1526
|
if (response.ok) {
|
|
1533
1527
|
clearSelection();
|
|
1534
1528
|
triggerRefresh();
|
|
1529
|
+
setFocusedItem(null);
|
|
1535
1530
|
} else {
|
|
1536
1531
|
const error = await response.json();
|
|
1537
1532
|
setAlertMessage({
|
|
@@ -1547,15 +1542,33 @@ function StudioPreview() {
|
|
|
1547
1542
|
});
|
|
1548
1543
|
}
|
|
1549
1544
|
};
|
|
1550
|
-
const
|
|
1545
|
+
const handleSync = () => {
|
|
1546
|
+
console.log("Sync to CDN:", focusedItem.path);
|
|
1547
|
+
};
|
|
1548
|
+
const handleRegenerate = () => {
|
|
1549
|
+
console.log("Regenerate:", focusedItem.path);
|
|
1550
|
+
};
|
|
1551
|
+
const renderMedia = () => {
|
|
1552
|
+
if (isImage) {
|
|
1553
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { css: styles5.image, src: imageSrc, alt: focusedItem.name });
|
|
1554
|
+
}
|
|
1555
|
+
if (isVideo) {
|
|
1556
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "video", { css: styles5.video, src: imageSrc, controls: true });
|
|
1557
|
+
}
|
|
1558
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles5.filePlaceholder, children: [
|
|
1559
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles5.fileIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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" }) }),
|
|
1560
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles5.fileName, children: focusedItem.name })
|
|
1561
|
+
] });
|
|
1562
|
+
};
|
|
1563
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1551
1564
|
showDeleteConfirm && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1552
1565
|
ConfirmModal,
|
|
1553
1566
|
{
|
|
1554
|
-
title: "Delete
|
|
1555
|
-
message: `Are you sure you want to delete ${
|
|
1567
|
+
title: "Delete File",
|
|
1568
|
+
message: `Are you sure you want to delete "${focusedItem.name}"? This action cannot be undone.`,
|
|
1556
1569
|
confirmLabel: "Delete",
|
|
1557
1570
|
variant: "danger",
|
|
1558
|
-
onConfirm:
|
|
1571
|
+
onConfirm: handleDelete,
|
|
1559
1572
|
onCancel: () => setShowDeleteConfirm(false)
|
|
1560
1573
|
}
|
|
1561
1574
|
),
|
|
@@ -1566,136 +1579,60 @@ function StudioPreview() {
|
|
|
1566
1579
|
message: alertMessage.message,
|
|
1567
1580
|
onClose: () => setAlertMessage(null)
|
|
1568
1581
|
}
|
|
1569
|
-
)
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles6.emptyState, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles6.emptyText, children: "Select an image to preview" }) })
|
|
1577
|
-
] })
|
|
1578
|
-
] });
|
|
1579
|
-
}
|
|
1580
|
-
if (selectedItems.size > 1) {
|
|
1581
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1582
|
-
modals,
|
|
1583
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles6.panel, children: [
|
|
1584
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "h3", { css: styles6.title, children: [
|
|
1585
|
-
selectedItems.size,
|
|
1586
|
-
" items selected"
|
|
1582
|
+
),
|
|
1583
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles5.container, children: [
|
|
1584
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles5.main, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles5.mediaWrapper, children: renderMedia() }) }),
|
|
1585
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles5.sidebar, children: [
|
|
1586
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles5.sidebarHeader, children: [
|
|
1587
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { css: styles5.sidebarTitle, children: "Details" }),
|
|
1588
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { css: styles5.closeBtn, onClick: handleClose, "aria-label": "Close", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles5.closeIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })
|
|
1587
1589
|
] }),
|
|
1588
|
-
/* @__PURE__ */ _jsxruntime.
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
] })
|
|
1594
|
-
] });
|
|
1595
|
-
}
|
|
1596
|
-
const selectedPath = Array.from(selectedItems)[0];
|
|
1597
|
-
const isFolder = !selectedPath.includes(".") || selectedPath.endsWith("/");
|
|
1598
|
-
const filename = selectedPath.split("/").pop() || "";
|
|
1599
|
-
const isImage = isImageFile(filename);
|
|
1600
|
-
const isVideo = isVideoFile(filename);
|
|
1601
|
-
const imageKey = selectedPath.replace(/^public\/images\//, "").replace(/^public\/originals\//, "").replace(/^public\//, "");
|
|
1602
|
-
const imageData = _optionalChain([meta, 'optionalAccess', _4 => _4.images, 'optionalAccess', _5 => _5[imageKey]]);
|
|
1603
|
-
const renderPreview = () => {
|
|
1604
|
-
if (isFolder) {
|
|
1605
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles6.filePlaceholder, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles6.folderIcon, fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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" }) }) });
|
|
1606
|
-
}
|
|
1607
|
-
if (isImage) {
|
|
1608
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1609
|
-
"img",
|
|
1610
|
-
{
|
|
1611
|
-
css: styles6.image,
|
|
1612
|
-
src: selectedPath.replace("public", ""),
|
|
1613
|
-
alt: "Preview"
|
|
1614
|
-
}
|
|
1615
|
-
);
|
|
1616
|
-
}
|
|
1617
|
-
if (isVideo) {
|
|
1618
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1619
|
-
"video",
|
|
1620
|
-
{
|
|
1621
|
-
css: styles6.video,
|
|
1622
|
-
src: selectedPath.replace("public", ""),
|
|
1623
|
-
controls: true,
|
|
1624
|
-
muted: true
|
|
1625
|
-
}
|
|
1626
|
-
);
|
|
1627
|
-
}
|
|
1628
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles6.filePlaceholder, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles6.fileIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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" }) }) });
|
|
1629
|
-
};
|
|
1630
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1631
|
-
modals,
|
|
1632
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles6.panel, children: [
|
|
1633
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { css: styles6.title, children: "Preview" }),
|
|
1634
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles6.imageContainer, children: renderPreview() }),
|
|
1635
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles6.info, children: [
|
|
1636
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "Filename", value: selectedPath.split("/").pop() || "" }),
|
|
1637
|
-
imageData && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1638
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1639
|
-
InfoRow,
|
|
1640
|
-
{
|
|
1641
|
-
label: "Original",
|
|
1642
|
-
value: `${imageData.original.width}x${imageData.original.height}`
|
|
1643
|
-
}
|
|
1644
|
-
),
|
|
1645
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1646
|
-
InfoRow,
|
|
1647
|
-
{
|
|
1648
|
-
label: "File size",
|
|
1649
|
-
value: formatFileSize3(imageData.original.fileSize)
|
|
1650
|
-
}
|
|
1651
|
-
),
|
|
1652
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles6.section, children: [
|
|
1653
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles6.sectionTitle, children: "Generated sizes" }),
|
|
1654
|
-
Object.entries(imageData.sizes).map(([size, data]) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: size, value: `${data.width}x${data.height}` }, size))
|
|
1655
|
-
] }),
|
|
1656
|
-
_optionalChain([imageData, 'access', _6 => _6.cdn, 'optionalAccess', _7 => _7.synced]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles6.section, children: [
|
|
1657
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles6.sectionTitle, children: "CDN" }),
|
|
1658
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles6.cdnStatus, children: [
|
|
1659
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles6.cdnIcon, fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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" }) }),
|
|
1660
|
-
"Synced to CDN"
|
|
1590
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles5.sidebarContent, children: [
|
|
1591
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles5.info, children: [
|
|
1592
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles5.infoRow, children: [
|
|
1593
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css: styles5.infoLabel, children: "Name" }),
|
|
1594
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css: styles5.infoValue, title: focusedItem.name, children: focusedItem.name })
|
|
1661
1595
|
] }),
|
|
1662
|
-
/* @__PURE__ */ _jsxruntime.
|
|
1663
|
-
"
|
|
1664
|
-
{
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1596
|
+
focusedItem.size !== void 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles5.infoRow, children: [
|
|
1597
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css: styles5.infoLabel, children: "Size" }),
|
|
1598
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css: styles5.infoValue, children: formatFileSize3(focusedItem.size) })
|
|
1599
|
+
] }),
|
|
1600
|
+
focusedItem.dimensions && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles5.infoRow, children: [
|
|
1601
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css: styles5.infoLabel, children: "Dimensions" }),
|
|
1602
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { css: styles5.infoValue, children: [
|
|
1603
|
+
focusedItem.dimensions.width,
|
|
1604
|
+
" \xD7 ",
|
|
1605
|
+
focusedItem.dimensions.height
|
|
1606
|
+
] })
|
|
1607
|
+
] }),
|
|
1608
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles5.infoRow, children: [
|
|
1609
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css: styles5.infoLabel, children: "CDN Status" }),
|
|
1610
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css: styles5.infoValue, children: focusedItem.cdnSynced ? "Synced" : "Not synced" })
|
|
1611
|
+
] })
|
|
1672
1612
|
] }),
|
|
1673
|
-
|
|
1674
|
-
/* @__PURE__ */ _jsxruntime.
|
|
1675
|
-
|
|
1676
|
-
"
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1613
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles5.actions, children: [
|
|
1614
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { css: styles5.actionBtn, onClick: handleRename, children: [
|
|
1615
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles5.actionIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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" }) }),
|
|
1616
|
+
"Rename"
|
|
1617
|
+
] }),
|
|
1618
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { css: styles5.actionBtn, onClick: handleSync, children: [
|
|
1619
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles5.actionIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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" }) }),
|
|
1620
|
+
"Sync to CDN"
|
|
1621
|
+
] }),
|
|
1622
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { css: styles5.actionBtn, onClick: handleRegenerate, children: [
|
|
1623
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles5.actionIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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" }) }),
|
|
1624
|
+
"Regenerate"
|
|
1625
|
+
] }),
|
|
1626
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { css: [styles5.actionBtn, styles5.actionBtnDanger], onClick: () => setShowDeleteConfirm(true), children: [
|
|
1627
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles5.actionIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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" }) }),
|
|
1628
|
+
"Delete"
|
|
1629
|
+
] })
|
|
1683
1630
|
] })
|
|
1684
1631
|
] })
|
|
1685
|
-
] }),
|
|
1686
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles6.actions, children: [
|
|
1687
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { css: styles6.actionBtn, children: "Rename" }),
|
|
1688
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { css: [styles6.actionBtn, styles6.actionBtnDanger], onClick: handleDeleteClick, children: "Delete" })
|
|
1689
1632
|
] })
|
|
1690
1633
|
] })
|
|
1691
1634
|
] });
|
|
1692
1635
|
}
|
|
1693
|
-
function InfoRow({ label, value, truncate }) {
|
|
1694
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles6.row, children: [
|
|
1695
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css: styles6.label, children: label }),
|
|
1696
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { css: [styles6.value, truncate && styles6.valueTruncate], title: truncate ? value : void 0, children: value })
|
|
1697
|
-
] });
|
|
1698
|
-
}
|
|
1699
1636
|
function formatFileSize3(bytes) {
|
|
1700
1637
|
if (bytes < 1024) return `${bytes} B`;
|
|
1701
1638
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
@@ -1706,9 +1643,11 @@ function formatFileSize3(bytes) {
|
|
|
1706
1643
|
|
|
1707
1644
|
|
|
1708
1645
|
|
|
1709
|
-
var
|
|
1646
|
+
var btnHeight2 = "36px";
|
|
1647
|
+
var styles6 = {
|
|
1710
1648
|
btn: _react3.css`
|
|
1711
|
-
|
|
1649
|
+
height: ${btnHeight2};
|
|
1650
|
+
padding: 0 12px;
|
|
1712
1651
|
background: ${_chunkAY2DAS6Wjs.colors.surface};
|
|
1713
1652
|
border: 1px solid ${_chunkAY2DAS6Wjs.colors.border};
|
|
1714
1653
|
border-radius: 6px;
|
|
@@ -1724,8 +1663,8 @@ var styles7 = {
|
|
|
1724
1663
|
}
|
|
1725
1664
|
`,
|
|
1726
1665
|
icon: _react3.css`
|
|
1727
|
-
width:
|
|
1728
|
-
height:
|
|
1666
|
+
width: 16px;
|
|
1667
|
+
height: 16px;
|
|
1729
1668
|
color: ${_chunkAY2DAS6Wjs.colors.textSecondary};
|
|
1730
1669
|
`,
|
|
1731
1670
|
overlay: _react3.css`
|
|
@@ -1888,10 +1827,10 @@ var styles7 = {
|
|
|
1888
1827
|
function StudioSettings() {
|
|
1889
1828
|
const [isOpen, setIsOpen] = _react.useState.call(void 0, false);
|
|
1890
1829
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1891
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { css:
|
|
1830
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { css: styles6.btn, onClick: () => setIsOpen(true), "aria-label": "Settings", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1892
1831
|
"svg",
|
|
1893
1832
|
{
|
|
1894
|
-
css:
|
|
1833
|
+
css: styles6.icon,
|
|
1895
1834
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1896
1835
|
viewBox: "0 0 24 24",
|
|
1897
1836
|
fill: "none",
|
|
@@ -1909,56 +1848,57 @@ function StudioSettings() {
|
|
|
1909
1848
|
] });
|
|
1910
1849
|
}
|
|
1911
1850
|
function SettingsPanel({ onClose }) {
|
|
1912
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css:
|
|
1913
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css:
|
|
1914
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { css:
|
|
1915
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { css:
|
|
1851
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles6.overlay, onClick: onClose, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles6.panel, onClick: (e) => e.stopPropagation(), children: [
|
|
1852
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles6.header, children: [
|
|
1853
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { css: styles6.title, children: "Settings" }),
|
|
1854
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { css: styles6.closeBtn, onClick: onClose, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { css: styles6.icon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })
|
|
1916
1855
|
] }),
|
|
1917
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css:
|
|
1856
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles6.sections, children: [
|
|
1918
1857
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { children: [
|
|
1919
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { css:
|
|
1920
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css:
|
|
1921
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css:
|
|
1922
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css:
|
|
1923
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css:
|
|
1924
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css:
|
|
1925
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css:
|
|
1926
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css:
|
|
1858
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { css: styles6.sectionTitle, children: "Cloudflare R2" }),
|
|
1859
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles6.description, children: "Configure in .env.local file:" }),
|
|
1860
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles6.code, children: [
|
|
1861
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles6.codeLine, children: "CLOUDFLARE_R2_ACCOUNT_ID" }),
|
|
1862
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles6.codeLine, children: "CLOUDFLARE_R2_ACCESS_KEY_ID" }),
|
|
1863
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles6.codeLine, children: "CLOUDFLARE_R2_SECRET_ACCESS_KEY" }),
|
|
1864
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles6.codeLine, children: "CLOUDFLARE_R2_BUCKET_NAME" }),
|
|
1865
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles6.codeLine, children: "CLOUDFLARE_R2_PUBLIC_URL" })
|
|
1927
1866
|
] })
|
|
1928
1867
|
] }),
|
|
1929
1868
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { children: [
|
|
1930
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { css:
|
|
1931
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css:
|
|
1932
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { css:
|
|
1869
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { css: styles6.sectionTitle, children: "Custom CDN URL" }),
|
|
1870
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles6.description, children: "Override the default R2 URL with a custom domain:" }),
|
|
1871
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { css: styles6.input, type: "text", placeholder: "https://cdn.yourdomain.com" })
|
|
1933
1872
|
] }),
|
|
1934
1873
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { children: [
|
|
1935
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { css:
|
|
1936
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css:
|
|
1874
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { css: styles6.sectionTitle, children: "Thumbnail Sizes" }),
|
|
1875
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles6.grid, children: [
|
|
1937
1876
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
1938
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { css:
|
|
1939
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { css:
|
|
1877
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { css: styles6.label, children: "Small" }),
|
|
1878
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { css: styles6.input, type: "number", defaultValue: 300 })
|
|
1940
1879
|
] }),
|
|
1941
1880
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
1942
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { css:
|
|
1943
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { css:
|
|
1881
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { css: styles6.label, children: "Medium" }),
|
|
1882
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { css: styles6.input, type: "number", defaultValue: 700 })
|
|
1944
1883
|
] }),
|
|
1945
1884
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
1946
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { css:
|
|
1947
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { css:
|
|
1885
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { css: styles6.label, children: "Large" }),
|
|
1886
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { css: styles6.input, type: "number", defaultValue: 1400 })
|
|
1948
1887
|
] })
|
|
1949
1888
|
] })
|
|
1950
1889
|
] })
|
|
1951
1890
|
] }),
|
|
1952
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css:
|
|
1953
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { css:
|
|
1954
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { css:
|
|
1891
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles6.footer, children: [
|
|
1892
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { css: styles6.cancelBtn, onClick: onClose, children: "Cancel" }),
|
|
1893
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { css: styles6.saveBtn, children: "Save Changes" })
|
|
1955
1894
|
] })
|
|
1956
1895
|
] }) });
|
|
1957
1896
|
}
|
|
1958
1897
|
|
|
1959
1898
|
// src/components/StudioUI.tsx
|
|
1960
1899
|
|
|
1961
|
-
var
|
|
1900
|
+
var btnHeight3 = "36px";
|
|
1901
|
+
var styles7 = {
|
|
1962
1902
|
container: _react3.css`
|
|
1963
1903
|
${_chunkAY2DAS6Wjs.baseReset}
|
|
1964
1904
|
display: flex;
|
|
@@ -1970,12 +1910,12 @@ var styles8 = {
|
|
|
1970
1910
|
display: flex;
|
|
1971
1911
|
align-items: center;
|
|
1972
1912
|
justify-content: space-between;
|
|
1973
|
-
padding:
|
|
1913
|
+
padding: 12px 24px;
|
|
1974
1914
|
background: ${_chunkAY2DAS6Wjs.colors.surface};
|
|
1975
1915
|
border-bottom: 1px solid ${_chunkAY2DAS6Wjs.colors.border};
|
|
1976
1916
|
`,
|
|
1977
1917
|
title: _react3.css`
|
|
1978
|
-
font-size: ${_chunkAY2DAS6Wjs.fontSize.
|
|
1918
|
+
font-size: ${_chunkAY2DAS6Wjs.fontSize.lg};
|
|
1979
1919
|
font-weight: 600;
|
|
1980
1920
|
color: ${_chunkAY2DAS6Wjs.colors.text};
|
|
1981
1921
|
margin: 0;
|
|
@@ -1986,8 +1926,9 @@ var styles8 = {
|
|
|
1986
1926
|
align-items: center;
|
|
1987
1927
|
gap: 8px;
|
|
1988
1928
|
`,
|
|
1989
|
-
|
|
1990
|
-
|
|
1929
|
+
headerBtn: _react3.css`
|
|
1930
|
+
height: ${btnHeight3};
|
|
1931
|
+
padding: 0 12px;
|
|
1991
1932
|
background: ${_chunkAY2DAS6Wjs.colors.surface};
|
|
1992
1933
|
border: 1px solid ${_chunkAY2DAS6Wjs.colors.border};
|
|
1993
1934
|
border-radius: 6px;
|
|
@@ -2002,9 +1943,9 @@ var styles8 = {
|
|
|
2002
1943
|
border-color: ${_chunkAY2DAS6Wjs.colors.borderHover};
|
|
2003
1944
|
}
|
|
2004
1945
|
`,
|
|
2005
|
-
|
|
2006
|
-
width:
|
|
2007
|
-
height:
|
|
1946
|
+
headerIcon: _react3.css`
|
|
1947
|
+
width: 16px;
|
|
1948
|
+
height: 16px;
|
|
2008
1949
|
color: ${_chunkAY2DAS6Wjs.colors.textSecondary};
|
|
2009
1950
|
`,
|
|
2010
1951
|
content: _react3.css`
|
|
@@ -2024,6 +1965,7 @@ function StudioUI({ onClose }) {
|
|
|
2024
1965
|
const [selectedItems, setSelectedItems] = _react.useState.call(void 0, /* @__PURE__ */ new Set());
|
|
2025
1966
|
const [lastSelectedPath, setLastSelectedPath] = _react.useState.call(void 0, null);
|
|
2026
1967
|
const [viewMode, setViewMode] = _react.useState.call(void 0, "grid");
|
|
1968
|
+
const [focusedItem, setFocusedItem] = _react.useState.call(void 0, null);
|
|
2027
1969
|
const [meta, setMeta] = _react.useState.call(void 0, null);
|
|
2028
1970
|
const [isLoading, setIsLoading] = _react.useState.call(void 0, false);
|
|
2029
1971
|
const [refreshKey, setRefreshKey] = _react.useState.call(void 0, 0);
|
|
@@ -2040,6 +1982,7 @@ function StudioUI({ onClose }) {
|
|
|
2040
1982
|
const setCurrentPath = _react.useCallback.call(void 0, (path) => {
|
|
2041
1983
|
setCurrentPathInternal(path);
|
|
2042
1984
|
setSelectedItems(/* @__PURE__ */ new Set());
|
|
1985
|
+
setFocusedItem(null);
|
|
2043
1986
|
}, []);
|
|
2044
1987
|
const toggleSelection = _react.useCallback.call(void 0, (path) => {
|
|
2045
1988
|
setSelectedItems((prev) => {
|
|
@@ -2077,10 +2020,14 @@ function StudioUI({ onClose }) {
|
|
|
2077
2020
|
const handleKeyDown = _react.useCallback.call(void 0,
|
|
2078
2021
|
(e) => {
|
|
2079
2022
|
if (e.key === "Escape") {
|
|
2080
|
-
|
|
2023
|
+
if (focusedItem) {
|
|
2024
|
+
setFocusedItem(null);
|
|
2025
|
+
} else {
|
|
2026
|
+
onClose();
|
|
2027
|
+
}
|
|
2081
2028
|
}
|
|
2082
2029
|
},
|
|
2083
|
-
[onClose]
|
|
2030
|
+
[onClose, focusedItem]
|
|
2084
2031
|
);
|
|
2085
2032
|
_react.useEffect.call(void 0, () => {
|
|
2086
2033
|
document.addEventListener("keydown", handleKeyDown);
|
|
@@ -2107,6 +2054,8 @@ function StudioUI({ onClose }) {
|
|
|
2107
2054
|
lastSelectedPath,
|
|
2108
2055
|
viewMode,
|
|
2109
2056
|
setViewMode,
|
|
2057
|
+
focusedItem,
|
|
2058
|
+
setFocusedItem,
|
|
2110
2059
|
meta,
|
|
2111
2060
|
setMeta,
|
|
2112
2061
|
isLoading,
|
|
@@ -2114,15 +2063,15 @@ function StudioUI({ onClose }) {
|
|
|
2114
2063
|
refreshKey,
|
|
2115
2064
|
triggerRefresh
|
|
2116
2065
|
};
|
|
2117
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StudioContext.Provider, { value: contextValue, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css:
|
|
2118
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css:
|
|
2119
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { css:
|
|
2120
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css:
|
|
2066
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StudioContext.Provider, { value: contextValue, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles7.container, children: [
|
|
2067
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles7.header, children: [
|
|
2068
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { css: styles7.title, children: "Studio" }),
|
|
2069
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles7.headerActions, children: [
|
|
2121
2070
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, StudioSettings, {}),
|
|
2122
2071
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2123
2072
|
"button",
|
|
2124
2073
|
{
|
|
2125
|
-
css:
|
|
2074
|
+
css: styles7.headerBtn,
|
|
2126
2075
|
onClick: onClose,
|
|
2127
2076
|
"aria-label": "Close Studio",
|
|
2128
2077
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CloseIcon, {})
|
|
@@ -2131,18 +2080,14 @@ function StudioUI({ onClose }) {
|
|
|
2131
2080
|
] })
|
|
2132
2081
|
] }),
|
|
2133
2082
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, StudioToolbar, {}),
|
|
2134
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2135
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: styles8.content, children: [
|
|
2136
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles8.fileBrowser, children: viewMode === "grid" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StudioFileGrid, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StudioFileList, {}) }),
|
|
2137
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, StudioPreview, {})
|
|
2138
|
-
] })
|
|
2083
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles7.content, children: focusedItem ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StudioDetailView, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: styles7.fileBrowser, children: viewMode === "grid" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StudioFileGrid, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StudioFileList, {}) }) })
|
|
2139
2084
|
] }) });
|
|
2140
2085
|
}
|
|
2141
2086
|
function CloseIcon() {
|
|
2142
2087
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2143
2088
|
"svg",
|
|
2144
2089
|
{
|
|
2145
|
-
css:
|
|
2090
|
+
css: styles7.headerIcon,
|
|
2146
2091
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2147
2092
|
viewBox: "0 0 24 24",
|
|
2148
2093
|
fill: "none",
|
|
@@ -2162,4 +2107,4 @@ var StudioUI_default = StudioUI;
|
|
|
2162
2107
|
|
|
2163
2108
|
|
|
2164
2109
|
exports.StudioUI = StudioUI; exports.default = StudioUI_default;
|
|
2165
|
-
//# sourceMappingURL=StudioUI-
|
|
2110
|
+
//# sourceMappingURL=StudioUI-2BWLIO4W.js.map
|