@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.
@@ -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 imageExtensions = ["jpg", "jpeg", "png", "gif", "webp", "svg", "ico", "bmp", "tiff", "tif"];
1971
- const selectedImagePaths = selectedPaths2.filter((p) => {
1972
- const ext = p.split(".").pop()?.toLowerCase() || "";
1973
- return imageExtensions.includes(ext);
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 (!selectedImagePaths.includes(fullPath)) {
1984
- selectedImagePaths.push(fullPath);
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 images:", error);
1991
+ console.error("Failed to get folder files:", error);
1990
1992
  }
1991
1993
  }
1992
- if (selectedImagePaths.length === 0) {
1994
+ if (selectedFilePaths.length === 0) {
1993
1995
  setAlertMessage({
1994
- title: "No Images Found",
1995
- message: "No images found in the selected items."
1996
+ title: "No Files Found",
1997
+ message: "No files found in the selected items."
1996
1998
  });
1997
1999
  return;
1998
2000
  }
1999
- requestProcess(selectedImagePaths);
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 imageExtensions = ["jpg", "jpeg", "png", "gif", "webp", "svg", "ico", "bmp", "tiff", "tif"];
2093
- const selectedImagePaths = selectedPaths2.filter((p) => {
2094
- const ext = p.split(".").pop()?.toLowerCase() || "";
2095
- return imageExtensions.includes(ext);
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 (!selectedImagePaths.includes(fullPath)) {
2106
- selectedImagePaths.push(fullPath);
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 images:", error);
2115
+ console.error("Failed to get folder files:", error);
2112
2116
  }
2113
2117
  }
2114
- if (selectedImagePaths.length === 0) {
2118
+ if (selectedFilePaths.length === 0) {
2115
2119
  setAlertMessage({
2116
- title: "No Images Found",
2117
- message: "No images found in the selected items."
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 imgPath of selectedImagePaths) {
2124
- const item = fileItems.find((f) => f.path === imgPath);
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(selectedImagePaths.length);
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 imageExtensions = ["jpg", "jpeg", "png", "gif", "webp", "svg", "ico", "bmp", "tiff", "tif"];
2142
- const selectedImagePaths = selectedPaths2.filter((p) => {
2143
- const ext = p.split(".").pop()?.toLowerCase() || "";
2144
- return imageExtensions.includes(ext);
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 (!selectedImagePaths.includes(fullPath)) {
2155
- selectedImagePaths.push(fullPath);
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 images:", error);
2166
+ console.error("Failed to get folder files:", error);
2161
2167
  }
2162
2168
  }
2163
- const imageKeys = selectedImagePaths.map((p) => "/" + p.replace(/^public\//, ""));
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 imageExtensions = ["jpg", "jpeg", "png", "gif", "webp", "svg", "ico", "bmp", "tiff", "tif"];
2251
- const selectedImagePaths = selectedPaths2.filter((p) => {
2252
- const ext = p.split(".").pop()?.toLowerCase() || "";
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 (selectedImagePaths.length === 0) {
2260
+ if (selectedFilePaths.length === 0) {
2256
2261
  setAlertMessage({
2257
- title: "No Images Found",
2258
- message: "No images found in the selected items."
2262
+ title: "No Files Found",
2263
+ message: "No files found in the selected items."
2259
2264
  });
2260
2265
  return;
2261
2266
  }
2262
- setDownloadImageCount(selectedImagePaths.length);
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 imageExtensions = ["jpg", "jpeg", "png", "gif", "webp", "svg", "ico", "bmp", "tiff", "tif"];
2269
- const selectedImagePaths = selectedPaths2.filter((p) => {
2270
- const ext = p.split(".").pop()?.toLowerCase() || "";
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 = selectedImagePaths.map((p) => "/" + p.replace(/^public\//, ""));
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-6Q7GX6IY.mjs.map
6500
+ //# sourceMappingURL=StudioUI-QZ54STXE.mjs.map