@gallop.software/studio 2.3.66 → 2.3.68

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.
@@ -11,7 +11,7 @@
11
11
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
12
12
  }
13
13
  </style>
14
- <script type="module" crossorigin src="/assets/index-B-L7Nl0F.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-BvENFNqZ.js"></script>
15
15
  </head>
16
16
  <body>
17
17
  <div id="root"></div>
@@ -845,9 +845,12 @@ async function handleList(request) {
845
845
  async function handleSearch(request) {
846
846
  const searchParams = new URL(request.url).searchParams;
847
847
  const query = searchParams.get("q")?.toLowerCase() || "";
848
+ const requestedPath = searchParams.get("path") || "public";
848
849
  if (query.length < 2) {
849
850
  return jsonResponse({ items: [] });
850
851
  }
852
+ const pathPrefix = requestedPath === "public" ? "/" : "/" + requestedPath.replace(/^public\/?/, "");
853
+ const normalizedPrefix = pathPrefix.endsWith("/") ? pathPrefix : pathPrefix + "/";
851
854
  try {
852
855
  const meta = await loadMeta();
853
856
  const fileEntries = getFileEntries(meta);
@@ -855,6 +858,7 @@ async function handleSearch(request) {
855
858
  const r2PublicUrl = process.env.CLOUDFLARE_R2_PUBLIC_URL?.replace(/\/$/, "") || "";
856
859
  const items = [];
857
860
  for (const [key, entry] of fileEntries) {
861
+ if (!key.startsWith(normalizedPrefix)) continue;
858
862
  if (!key.toLowerCase().includes(query)) continue;
859
863
  const fileName = path4.basename(key);
860
864
  const relativePath = key.slice(1);