@gallop.software/studio 1.5.8 → 1.5.10
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-O53YFD6Q.js → StudioUI-GJK45R3T.js} +61 -57
- package/dist/StudioUI-GJK45R3T.js.map +1 -0
- package/dist/{StudioUI-6Q7GX6IY.mjs → StudioUI-QZ54STXE.mjs} +53 -49
- package/dist/StudioUI-QZ54STXE.mjs.map +1 -0
- package/dist/handlers/index.js +7 -8
- package/dist/handlers/index.js.map +1 -1
- package/dist/handlers/index.mjs +7 -8
- package/dist/handlers/index.mjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/StudioUI-6Q7GX6IY.mjs.map +0 -1
- package/dist/StudioUI-O53YFD6Q.js.map +0 -1
|
@@ -1967,12 +1967,14 @@ function StudioToolbar() {
|
|
|
1967
1967
|
const hasSelection2 = selectedItems.size > 0;
|
|
1968
1968
|
if (hasSelection2) {
|
|
1969
1969
|
const selectedPaths2 = Array.from(selectedItems);
|
|
1970
|
-
const
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1970
|
+
const selectedFilePaths = selectedPaths2.filter((p) => {
|
|
1971
|
+
const lastPart = p.split("/").pop() || "";
|
|
1972
|
+
return lastPart.includes(".") && !p.endsWith("/");
|
|
1973
|
+
});
|
|
1974
|
+
const selectedFolders = selectedPaths2.filter((p) => {
|
|
1975
|
+
const lastPart = p.split("/").pop() || "";
|
|
1976
|
+
return !lastPart.includes(".") || p.endsWith("/");
|
|
1974
1977
|
});
|
|
1975
|
-
const selectedFolders = selectedPaths2.filter((p) => !p.includes(".") || p.endsWith("/"));
|
|
1976
1978
|
if (selectedFolders.length > 0) {
|
|
1977
1979
|
try {
|
|
1978
1980
|
const response = await fetch(`/api/studio/folder-images?folders=${encodeURIComponent(selectedFolders.join(","))}`);
|
|
@@ -1980,23 +1982,23 @@ function StudioToolbar() {
|
|
|
1980
1982
|
if (data.images) {
|
|
1981
1983
|
for (const img of data.images) {
|
|
1982
1984
|
const fullPath = `public/${img}`;
|
|
1983
|
-
if (!
|
|
1984
|
-
|
|
1985
|
+
if (!selectedFilePaths.includes(fullPath)) {
|
|
1986
|
+
selectedFilePaths.push(fullPath);
|
|
1985
1987
|
}
|
|
1986
1988
|
}
|
|
1987
1989
|
}
|
|
1988
1990
|
} catch (error) {
|
|
1989
|
-
console.error("Failed to get folder
|
|
1991
|
+
console.error("Failed to get folder files:", error);
|
|
1990
1992
|
}
|
|
1991
1993
|
}
|
|
1992
|
-
if (
|
|
1994
|
+
if (selectedFilePaths.length === 0) {
|
|
1993
1995
|
setAlertMessage({
|
|
1994
|
-
title: "No
|
|
1995
|
-
message: "No
|
|
1996
|
+
title: "No Files Found",
|
|
1997
|
+
message: "No files found in the selected items."
|
|
1996
1998
|
});
|
|
1997
1999
|
return;
|
|
1998
2000
|
}
|
|
1999
|
-
requestProcess(
|
|
2001
|
+
requestProcess(selectedFilePaths);
|
|
2000
2002
|
} else {
|
|
2001
2003
|
try {
|
|
2002
2004
|
const response = await fetch("/api/studio/count-images");
|
|
@@ -2089,12 +2091,14 @@ function StudioToolbar() {
|
|
|
2089
2091
|
const handleSyncClick = useCallback2(async () => {
|
|
2090
2092
|
if (selectedItems.size === 0) return;
|
|
2091
2093
|
const selectedPaths2 = Array.from(selectedItems);
|
|
2092
|
-
const
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2094
|
+
const selectedFilePaths = selectedPaths2.filter((p) => {
|
|
2095
|
+
const lastPart = p.split("/").pop() || "";
|
|
2096
|
+
return lastPart.includes(".") && !p.endsWith("/");
|
|
2097
|
+
});
|
|
2098
|
+
const selectedFolders = selectedPaths2.filter((p) => {
|
|
2099
|
+
const lastPart = p.split("/").pop() || "";
|
|
2100
|
+
return !lastPart.includes(".") || p.endsWith("/");
|
|
2096
2101
|
});
|
|
2097
|
-
const selectedFolders = selectedPaths2.filter((p) => !p.includes(".") || p.endsWith("/"));
|
|
2098
2102
|
if (selectedFolders.length > 0) {
|
|
2099
2103
|
try {
|
|
2100
2104
|
const response = await fetch(`/api/studio/folder-images?folders=${encodeURIComponent(selectedFolders.join(","))}`);
|
|
@@ -2102,26 +2106,26 @@ function StudioToolbar() {
|
|
|
2102
2106
|
if (data.images) {
|
|
2103
2107
|
for (const img of data.images) {
|
|
2104
2108
|
const fullPath = `public/${img}`;
|
|
2105
|
-
if (!
|
|
2106
|
-
|
|
2109
|
+
if (!selectedFilePaths.includes(fullPath)) {
|
|
2110
|
+
selectedFilePaths.push(fullPath);
|
|
2107
2111
|
}
|
|
2108
2112
|
}
|
|
2109
2113
|
}
|
|
2110
2114
|
} catch (error) {
|
|
2111
|
-
console.error("Failed to get folder
|
|
2115
|
+
console.error("Failed to get folder files:", error);
|
|
2112
2116
|
}
|
|
2113
2117
|
}
|
|
2114
|
-
if (
|
|
2118
|
+
if (selectedFilePaths.length === 0) {
|
|
2115
2119
|
setAlertMessage({
|
|
2116
|
-
title: "No
|
|
2117
|
-
message: "No
|
|
2120
|
+
title: "No Files Found",
|
|
2121
|
+
message: "No files found in the selected items."
|
|
2118
2122
|
});
|
|
2119
2123
|
return;
|
|
2120
2124
|
}
|
|
2121
2125
|
let hasRemote = false;
|
|
2122
2126
|
let hasLocal = false;
|
|
2123
|
-
for (const
|
|
2124
|
-
const item = fileItems.find((f) => f.path ===
|
|
2127
|
+
for (const filePath of selectedFilePaths) {
|
|
2128
|
+
const item = fileItems.find((f) => f.path === filePath);
|
|
2125
2129
|
if (item) {
|
|
2126
2130
|
if (item.isRemote) {
|
|
2127
2131
|
hasRemote = true;
|
|
@@ -2130,7 +2134,7 @@ function StudioToolbar() {
|
|
|
2130
2134
|
}
|
|
2131
2135
|
}
|
|
2132
2136
|
}
|
|
2133
|
-
setSyncImageCount(
|
|
2137
|
+
setSyncImageCount(selectedFilePaths.length);
|
|
2134
2138
|
setSyncHasRemote(hasRemote);
|
|
2135
2139
|
setSyncHasLocal(hasLocal);
|
|
2136
2140
|
setShowSyncConfirm(true);
|
|
@@ -2138,12 +2142,14 @@ function StudioToolbar() {
|
|
|
2138
2142
|
const handleSyncConfirm = useCallback2(async () => {
|
|
2139
2143
|
setShowSyncConfirm(false);
|
|
2140
2144
|
const selectedPaths2 = Array.from(selectedItems);
|
|
2141
|
-
const
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
+
const selectedFilePaths = selectedPaths2.filter((p) => {
|
|
2146
|
+
const lastPart = p.split("/").pop() || "";
|
|
2147
|
+
return lastPart.includes(".") && !p.endsWith("/");
|
|
2148
|
+
});
|
|
2149
|
+
const selectedFolders = selectedPaths2.filter((p) => {
|
|
2150
|
+
const lastPart = p.split("/").pop() || "";
|
|
2151
|
+
return !lastPart.includes(".") || p.endsWith("/");
|
|
2145
2152
|
});
|
|
2146
|
-
const selectedFolders = selectedPaths2.filter((p) => !p.includes(".") || p.endsWith("/"));
|
|
2147
2153
|
if (selectedFolders.length > 0) {
|
|
2148
2154
|
try {
|
|
2149
2155
|
const response = await fetch(`/api/studio/folder-images?folders=${encodeURIComponent(selectedFolders.join(","))}`);
|
|
@@ -2151,16 +2157,16 @@ function StudioToolbar() {
|
|
|
2151
2157
|
if (data.images) {
|
|
2152
2158
|
for (const img of data.images) {
|
|
2153
2159
|
const fullPath = `public/${img}`;
|
|
2154
|
-
if (!
|
|
2155
|
-
|
|
2160
|
+
if (!selectedFilePaths.includes(fullPath)) {
|
|
2161
|
+
selectedFilePaths.push(fullPath);
|
|
2156
2162
|
}
|
|
2157
2163
|
}
|
|
2158
2164
|
}
|
|
2159
2165
|
} catch (error) {
|
|
2160
|
-
console.error("Failed to get folder
|
|
2166
|
+
console.error("Failed to get folder files:", error);
|
|
2161
2167
|
}
|
|
2162
2168
|
}
|
|
2163
|
-
const imageKeys =
|
|
2169
|
+
const imageKeys = selectedFilePaths.map((p) => "/" + p.replace(/^public\//, ""));
|
|
2164
2170
|
setProgressTitle("Pushing to CDN");
|
|
2165
2171
|
setProgressState({
|
|
2166
2172
|
current: 0,
|
|
@@ -2247,30 +2253,28 @@ function StudioToolbar() {
|
|
|
2247
2253
|
const handleDownloadClick = useCallback2(async () => {
|
|
2248
2254
|
if (selectedItems.size === 0) return;
|
|
2249
2255
|
const selectedPaths2 = Array.from(selectedItems);
|
|
2250
|
-
const
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
return imageExtensions.includes(ext);
|
|
2256
|
+
const selectedFilePaths = selectedPaths2.filter((p) => {
|
|
2257
|
+
const lastPart = p.split("/").pop() || "";
|
|
2258
|
+
return lastPart.includes(".") && !p.endsWith("/");
|
|
2254
2259
|
});
|
|
2255
|
-
if (
|
|
2260
|
+
if (selectedFilePaths.length === 0) {
|
|
2256
2261
|
setAlertMessage({
|
|
2257
|
-
title: "No
|
|
2258
|
-
message: "No
|
|
2262
|
+
title: "No Files Found",
|
|
2263
|
+
message: "No files found in the selected items."
|
|
2259
2264
|
});
|
|
2260
2265
|
return;
|
|
2261
2266
|
}
|
|
2262
|
-
setDownloadImageCount(
|
|
2267
|
+
setDownloadImageCount(selectedFilePaths.length);
|
|
2263
2268
|
setShowDownloadConfirm(true);
|
|
2264
2269
|
}, [selectedItems]);
|
|
2265
2270
|
const handleDownloadConfirm = useCallback2(async () => {
|
|
2266
2271
|
setShowDownloadConfirm(false);
|
|
2267
2272
|
const selectedPaths2 = Array.from(selectedItems);
|
|
2268
|
-
const
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
return imageExtensions.includes(ext);
|
|
2273
|
+
const selectedFilePaths = selectedPaths2.filter((p) => {
|
|
2274
|
+
const lastPart = p.split("/").pop() || "";
|
|
2275
|
+
return lastPart.includes(".") && !p.endsWith("/");
|
|
2272
2276
|
});
|
|
2273
|
-
const imageKeys =
|
|
2277
|
+
const imageKeys = selectedFilePaths.map((p) => "/" + p.replace(/^public\//, ""));
|
|
2274
2278
|
setProgressTitle("Downloading from CDN");
|
|
2275
2279
|
setShowProgress(true);
|
|
2276
2280
|
setProgressState({
|
|
@@ -6493,4 +6497,4 @@ export {
|
|
|
6493
6497
|
StudioUI,
|
|
6494
6498
|
StudioUI_default as default
|
|
6495
6499
|
};
|
|
6496
|
-
//# sourceMappingURL=StudioUI-
|
|
6500
|
+
//# sourceMappingURL=StudioUI-QZ54STXE.mjs.map
|