vitepress-plugin-filelist 0.3.0 → 0.3.1

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
@@ -201,7 +201,7 @@ Deno 可以安装 npm 依赖,但目前用 Deno 构建 VitePress 会在 rolldow
201
201
  ## 说明
202
202
 
203
203
  - 批量 ZIP 通过 `raw_url`(OpenList `/p/` 代理)下载,CORS 保持在 OpenList 源上
204
- - 表头全选只统计已加载的文件,页脚会显示还有多少文件夹未展开;勾选单个文件夹则会递归加载其全部子目录(目录很深或很多时会逐个请求,可能较慢)
204
+ - 表头全选只统计已加载的文件;勾选单个文件夹则会递归加载其全部子目录(目录很深或很多时会逐个请求,可能较慢)
205
205
  - 目录以 `per_page: 0` 请求全部条目;超大目录可能较慢,暂未实现分页
206
206
 
207
207
  ## 开发
@@ -25,6 +25,7 @@ interface FileListLabels {
25
25
  download: string;
26
26
  loaded: string;
27
27
  selected: string;
28
+ /** @deprecated No longer shown; the footer only shows loaded files and size. */
28
29
  unloaded: string;
29
30
  folderFailed: string;
30
31
  demoDownload: string;
@@ -408,10 +408,6 @@ const _hoisted_54 = [
408
408
  ];
409
409
  const _hoisted_55 = { class: "fl-foot" };
410
410
  const _hoisted_56 = {
411
- key: 0,
412
- class: "fl-foot-hint"
413
- };
414
- const _hoisted_57 = {
415
411
  key: 4,
416
412
  class: "fl-toast",
417
413
  role: "status"
@@ -901,17 +897,6 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
901
897
  function toggleCheckAll() {
902
898
  selected.value = allChecked.value ? /* @__PURE__ */ new Set() : new Set(allFiles.value.map((file) => file.path));
903
899
  }
904
- const unloadedFolders = computed(() => {
905
- let count = 0;
906
- const walk = (nodes) => {
907
- for (const node of nodes) {
908
- if (node.is_dir && !node.loaded) count += 1;
909
- if (node.children.length) walk(node.children);
910
- }
911
- };
912
- walk(roots.value);
913
- return count;
914
- });
915
900
  function triggerUrl(url) {
916
901
  const anchor = document.createElement("a");
917
902
  anchor.href = url;
@@ -1288,8 +1273,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1288
1273
  ], -1)])], 8, _hoisted_54)], 64))])
1289
1274
  ], 6);
1290
1275
  }), 128)),
1291
- createElementVNode("div", _hoisted_55, [createElementVNode("span", null, toDisplayString(t("loaded", { count: allFiles.value.length })) + " · " + toDisplayString(t("totalSize", { size: unref(formatSize)(loadedBytes.value) })), 1), unloadedFolders.value ? (openBlock(), createElementBlock("span", _hoisted_56, toDisplayString(t("unloaded", { count: unloadedFolders.value })), 1)) : createCommentVNode("v-if", true)]),
1292
- toast.value ? (openBlock(), createElementBlock("div", _hoisted_57, toDisplayString(toast.value), 1)) : createCommentVNode("v-if", true)
1276
+ createElementVNode("div", _hoisted_55, [createElementVNode("span", null, toDisplayString(t("loaded", { count: allFiles.value.length })) + " · " + toDisplayString(t("totalSize", { size: unref(formatSize)(loadedBytes.value) })), 1)]),
1277
+ toast.value ? (openBlock(), createElementBlock("div", _hoisted_56, toDisplayString(toast.value), 1)) : createCommentVNode("v-if", true)
1293
1278
  ], 6);
1294
1279
  };
1295
1280
  }
@@ -25,6 +25,7 @@ interface FileListLabels {
25
25
  download: string;
26
26
  loaded: string;
27
27
  selected: string;
28
+ /** @deprecated No longer shown; the footer only shows loaded files and size. */
28
29
  unloaded: string;
29
30
  folderFailed: string;
30
31
  demoDownload: string;
@@ -675,17 +675,6 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
675
675
  resortAll();
676
676
  }
677
677
  });
678
- const unloadedFolders = computed(() => {
679
- let count = 0;
680
- const walk = (nodes) => {
681
- for (const node of nodes) {
682
- if (node.is_dir && !node.loaded) count += 1;
683
- if (node.children.length) walk(node.children);
684
- }
685
- };
686
- walk(roots.value);
687
- return count;
688
- });
689
678
  const previewable = /\.(?:pdf|png|jpe?g|gif|webp|svg|txt|md|json|mp3|wav|mp4|webm|mov)$/i;
690
679
  function canPreview(node) {
691
680
  return !node.is_dir && previewable.test(node.name);
@@ -780,10 +769,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
780
769
  }
781
770
  _push(`</span></div>`);
782
771
  });
783
- _push(`<!--]--><div class="fl-foot"><span>${ssrInterpolate(t("loaded", { count: allFiles.value.length }))} · ${ssrInterpolate(t("totalSize", { size: unref(formatSize)(loadedBytes.value) }))}</span>`);
784
- if (unloadedFolders.value) _push(`<span class="fl-foot-hint">${ssrInterpolate(t("unloaded", { count: unloadedFolders.value }))}</span>`);
785
- else _push(`<!---->`);
786
- _push(`</div>`);
772
+ _push(`<!--]--><div class="fl-foot"><span>${ssrInterpolate(t("loaded", { count: allFiles.value.length }))} · ${ssrInterpolate(t("totalSize", { size: unref(formatSize)(loadedBytes.value) }))}</span></div>`);
787
773
  if (toast.value) _push(`<div class="fl-toast" role="status">${ssrInterpolate(toast.value)}</div>`);
788
774
  else _push(`<!---->`);
789
775
  _push(`</div>`);
@@ -488,10 +488,6 @@
488
488
  color: var(--vp-c-brand-1);
489
489
  }
490
490
 
491
- .fl-name-dir {
492
- font-weight: 600;
493
- }
494
-
495
491
  .fl-meta {
496
492
  display: none;
497
493
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitepress-plugin-filelist",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
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.",