vitepress-plugin-filelist 0.2.0 → 0.2.2

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/README.md CHANGED
@@ -200,8 +200,8 @@ pnpm run pack:check
200
200
 
201
201
  ```bash
202
202
  cd demo
203
- npm install
204
- npm run build
203
+ pnpm install
204
+ pnpm run build
205
205
  ```
206
206
 
207
207
  ## License
@@ -428,17 +428,27 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
428
428
  refresh: false
429
429
  }))?.content ?? [];
430
430
  }
431
+ function absoluteUrl(raw) {
432
+ if (!raw) return "";
433
+ if (/^[a-z][a-z0-9+.-]*:\/\//i.test(raw)) return raw;
434
+ const root = baseUrl.value || (typeof window !== "undefined" ? window.location.origin : "");
435
+ try {
436
+ return new URL(raw, `${root}/`).href;
437
+ } catch {
438
+ return raw;
439
+ }
440
+ }
431
441
  async function resolveUrl(node) {
432
442
  if (demo.value) return "";
433
- if (node.raw_url) return node.raw_url;
443
+ if (node.raw_url) return absoluteUrl(node.raw_url);
434
444
  const cached = downloadCache.get(node.path);
435
445
  if (cached) return cached;
436
446
  let url = "";
437
447
  try {
438
- url = (await request("/api/fs/get", {
448
+ url = absoluteUrl((await request("/api/fs/get", {
439
449
  path: node.path,
440
450
  password: node.password || activePassword.value
441
- }))?.raw_url ?? "";
451
+ }))?.raw_url ?? "");
442
452
  } catch {
443
453
  url = "";
444
454
  }
@@ -125,10 +125,6 @@
125
125
  background: var(--vp-c-bg-soft);
126
126
  }
127
127
 
128
- .fl-row-root .fl-name {
129
- font-weight: 600;
130
- }
131
-
132
128
  .fl-row-selected {
133
129
  background: var(--vp-c-brand-soft);
134
130
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitepress-plugin-filelist",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "packageManager": "pnpm@11.25.0",
5
5
  "type": "module",
6
6
  "description": "OpenList file browser for VitePress: tree view, batch ZIP download, i18n, password and token support.",