vitepress-plugin-filelist 0.5.1 → 0.6.0

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
@@ -6,7 +6,8 @@
6
6
 
7
7
  - 📁 树形目录,文件夹按需加载
8
8
  - ✅ 勾选文件;选中文件夹会自动加载并选中其下所有层级的文件
9
- - 📦 批量打包 ZIP(基于 `fflate`),带进度;保留目录结构,不同目录的同名文件不会互相覆盖
9
+ - 📦 批量打包 ZIP(基于 `client-zip`),带进度、可取消;Chrome / Edge 边下载边写入磁盘,不受大小限制;保留目录结构,不同目录的同名文件不会互相覆盖
10
+ - 📄 大目录每个文件夹先显示 200 条,可“显示更多 / 全部显示”
10
11
  - ⬇️ 单文件下载(`fs/get` 的 `raw_url`,回退 `/d/`)
11
12
  - 👁️ 弹窗预览(不跳转):图片、音视频、文本、PDF;Office 等其它类型显示文件信息与下载
12
13
  - 🔐 目录密码输入,可选只读 token
@@ -81,6 +82,9 @@ export default {
81
82
  | `token` | `string` | `''` | 可选只读 token;不传则以游客身份请求 |
82
83
  | `password` | `string` | `''` | 目录密码,也可以在运行时输入 |
83
84
  | `rememberPassword` | `boolean` | `true` | 输入密码时是否提供“在此标签页中记住”开关;`false` 时不写入 sessionStorage |
85
+ | `pageSize` | `number` | `200` | 每个文件夹先显示的条数,之后显示“显示更多 / 全部显示”;`0` 全部显示 |
86
+ | `zipWarnSize` | `number` | `500`(触屏 `200`) | 需在内存中打包的浏览器(Firefox、Safari)超过该大小(MB)先确认;`0` 不提示 |
87
+ | `zipMaxSize` | `number` | `2048`(触屏 `1024`) | 同上,超过该大小(MB)不打包;`0` 不限制 |
84
88
  | `title` | `string` | `''` | 工具栏标题;为空时回退到 OpenList 的 `site_title` |
85
89
  | `locale` | `'zh-CN' \| 'en-US'` | `'zh-CN'` | 内置文案预设 |
86
90
  | `labels` | `Partial<FileListLabels>` | `undefined` | 按 key 覆盖单条文案 |
@@ -126,6 +130,19 @@ interface FileListSource {
126
130
  - 勾选后操作条吸附在组件顶部,位于 VitePress 导航栏 / “On this page” 栏下方,只在本组件范围内吸附
127
131
  - 颜色全部取自 VitePress 主题变量,暗色模式自动适配
128
132
 
133
+ ## 批量下载
134
+
135
+ - Chrome / Edge(含较新的 Android Chrome):点“下载 ZIP”先弹出系统“另存为”窗口,之后边下载边写入,内存占用很小,不受大小限制
136
+ - Firefox、Safari、iPhone:浏览器只能先把文件放进内存再打包。按已选总大小判断:超过 `zipWarnSize` 先确认,超过 `zipMaxSize` 不打包并建议分批
137
+ - 打包期间操作条显示进度(大小与文件数),可随时取消;勾选暂时锁定。任一文件失败会整体取消并提示文件名
138
+ - ZIP 只存储不压缩(网盘文件多为已压缩格式),支持超过 4 GB(Zip64)
139
+
140
+ ## 大目录
141
+
142
+ - 每个文件夹(以及单路径模式的顶层列表)先显示 `pageSize` 条,末尾一行“还有 X 项 · 显示更多 · 全部显示”;剩余不足一页时只显示“显示剩余 X 项”
143
+ - 数据一次全部取回,只减少渲染:排序后再截取,勾选文件夹 / 全选包含未显示的文件,输入筛选词时显示全部匹配
144
+ - 刷新后保留已展开的条数
145
+
129
146
  ## 刷新与目录密码
130
147
 
131
148
  - **刷新**:保留当前列表并调暗,表头下方显示进度条;完成后整体替换,已展开的目录和仍存在的勾选会保留。刷新失败时保留旧数据并提示。刷新只重新读取 OpenList 的目录缓存(游客没有写权限,无法强制刷新存储)
@@ -92,6 +92,29 @@ interface FileListLabels {
92
92
  unlockFolder: string;
93
93
  /** @deprecated Network failures now append `corsHint`. */
94
94
  networkHint: string;
95
+ /** Batch progress detail. `{done}` `{total}` sizes, `{files}` `{count}` file counts */
96
+ batchProgress: string;
97
+ /** Batch finished. `{name}` `{count}` `{size}` */
98
+ batchDone: string;
99
+ batchCanceled: string;
100
+ /** In-memory ZIP over `zipWarnSize`. `{size}` */
101
+ zipWarnTitle: string;
102
+ /** `{limit}` */
103
+ zipWarnText: string;
104
+ /** Desktop browsers that cannot stream: point to one that can. */
105
+ zipStreamTip: string;
106
+ zipContinue: string;
107
+ /** In-memory ZIP over `zipMaxSize`. `{size}` */
108
+ zipBlockTitle: string;
109
+ /** `{limit}` */
110
+ zipBlockText: string;
111
+ gotIt: string;
112
+ /** Last row of a long folder. `{count}` */
113
+ moreRemaining: string;
114
+ showMore: string;
115
+ showAll: string;
116
+ /** Fewer than a page left. `{count}` */
117
+ showRest: string;
95
118
  }
96
119
  interface FileListSource {
97
120
  /** OpenList path, directory or single file. */
@@ -123,6 +146,21 @@ interface FileListProps {
123
146
  * cleared when the tab closes). Defaults to `true`; `false` hides the option.
124
147
  */
125
148
  rememberPassword?: boolean;
149
+ /**
150
+ * Rows shown per folder before “Show more”. Defaults to `200`; `0` shows
151
+ * everything. Data is still loaded in full; only rendering is limited.
152
+ */
153
+ pageSize?: number;
154
+ /**
155
+ * Browsers that must build the ZIP in memory (Firefox, Safari) ask first above
156
+ * this many MB. Defaults to 500 (200 on touch devices); `0` never asks.
157
+ */
158
+ zipWarnSize?: number;
159
+ /**
160
+ * …and refuse above this many MB. Defaults to 2048 (1024 on touch devices);
161
+ * `0` means no limit. Chrome and Edge stream to disk and skip both checks.
162
+ */
163
+ zipMaxSize?: number;
126
164
  /** Built-in locale. Defaults to `zh-CN`. */
127
165
  locale?: FileListLocale;
128
166
  /** Per-key label overrides on top of the locale preset. */
@@ -148,6 +186,7 @@ declare const _default: import("vue").DefineComponent<FileListProps, {}, {}, {},
148
186
  password: string;
149
187
  title: string;
150
188
  rememberPassword: boolean;
189
+ pageSize: number;
151
190
  locale: FileListLocale;
152
191
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
153
192
  declare global {