vitepress-plugin-filelist 0.5.0 → 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.
@@ -18,6 +18,8 @@ interface FileListLabels {
18
18
  loading: string;
19
19
  loadFailed: string;
20
20
  guestHint: string;
21
+ /** Shown (and appended to toasts) for browser network errors, usually CORS. */
22
+ /** Shown (and appended to toasts) for browser network errors, usually CORS. */
21
23
  corsHint: string;
22
24
  retry: string;
23
25
  empty: string;
@@ -75,7 +77,7 @@ interface FileListLabels {
75
77
  /** Refresh failed; the old rows stay. `{message}` */
76
78
  refreshFailed: string;
77
79
  cancel: string;
78
- /** Placeholder / accessible name of a folder's password input. `{name}` */
80
+ /** Accessible name of a folder's password input. `{name}` */
79
81
  passwordFor: string;
80
82
  /** OpenList cannot tell a wrong password from missing permission. */
81
83
  passwordWrong: string;
@@ -88,8 +90,31 @@ interface FileListLabels {
88
90
  forgetPassword: string;
89
91
  /** Lock button on a folder that needs a password. `{name}` */
90
92
  unlockFolder: string;
91
- /** Appended to failure toasts for browser network errors (usually CORS). */
93
+ /** @deprecated Network failures now append `corsHint`. */
92
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;
93
118
  }
94
119
  interface FileListSource {
95
120
  /** OpenList path, directory or single file. */
@@ -121,6 +146,21 @@ interface FileListProps {
121
146
  * cleared when the tab closes). Defaults to `true`; `false` hides the option.
122
147
  */
123
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;
124
164
  /** Built-in locale. Defaults to `zh-CN`. */
125
165
  locale?: FileListLocale;
126
166
  /** Per-key label overrides on top of the locale preset. */
@@ -146,6 +186,7 @@ declare const _default: import("vue").DefineComponent<FileListProps, {}, {}, {},
146
186
  password: string;
147
187
  title: string;
148
188
  rememberPassword: boolean;
189
+ pageSize: number;
149
190
  locale: FileListLocale;
150
191
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
151
192
  declare global {
@@ -225,13 +266,13 @@ declare global {
225
266
  export declare const fileListLocales: Record<FileListLocale, FileListLabels>;
226
267
  export declare function formatLabel(template: string, values?: Record<string, string | number>): string;
227
268
  export declare function resolveLabels(locale?: FileListLocale, overrides?: Partial<FileListLabels>): FileListLabels;
228
- export interface SortableNode {
269
+ interface SortableNode {
229
270
  name: string;
230
271
  size: number;
231
272
  is_dir: boolean;
232
273
  modified: string;
233
274
  }
234
- export type SortKey = 'name' | 'size' | 'modified';
275
+ type SortKey = 'name' | 'size' | 'modified';
235
276
  export declare function joinPath(parent: string, name: string): string;
236
277
  export declare function encodePath(path: string): string;
237
278
  /**
@@ -246,24 +287,26 @@ export declare function zipEntryName(segments: string[]): string;
246
287
  * The suffix goes before the extension of the last segment. Adds the result to `used`.
247
288
  */
248
289
  export declare function uniqueEntryName(name: string, used: Set<string>): string;
290
+ /** Human-readable size. `0` reads `0 B`; missing, negative or invalid sizes read `-`. */
249
291
  export declare function formatSize(size: number): string;
250
292
  export declare function formatDate(iso: string): string;
293
+ /** Upper-case extension for the type badge, e.g. `PDF`. */
251
294
  export declare function extOf(name: string): string;
252
- export type FileKind = 'doc' | 'sheet' | 'slide' | 'pdf' | 'image' | 'media' | 'archive' | 'code' | 'other';
295
+ type FileKind = 'doc' | 'sheet' | 'slide' | 'pdf' | 'image' | 'media' | 'archive' | 'code' | 'other';
296
+ type PreviewKind = 'image' | 'video' | 'audio' | 'text' | 'pdf' | 'none';
253
297
  /** Rough file family, used to colour the type badge. */
254
298
  export declare function fileKind(name: string): FileKind;
255
- /** Sum of the `size` of the given entries, ignoring missing or invalid sizes. */
256
- export declare function totalSize(items: Array<{
257
- size?: number;
258
- }>): number;
259
- export declare function compareNodes(a: SortableNode, b: SortableNode, key: SortKey, ascending?: boolean): number;
260
- export type PreviewKind = 'image' | 'video' | 'audio' | 'text' | 'pdf' | 'none';
261
299
  /**
262
300
  * How a file is shown in the preview dialog. Office documents and anything
263
301
  * else the browser cannot render are `none` (info + download).
264
302
  */
265
303
  export declare function previewKind(name: string): PreviewKind;
266
- export interface IframePreview {
304
+ /** Sum of the `size` of the given entries, ignoring missing or invalid sizes. */
305
+ export declare function totalSize(items: Array<{
306
+ size?: number;
307
+ }>): number;
308
+ export declare function compareNodes(a: SortableNode, b: SortableNode, key: SortKey, ascending?: boolean): number;
309
+ interface IframePreview {
267
310
  label: string;
268
311
  scheme: string;
269
312
  }
@@ -300,4 +343,4 @@ export declare function fillPreviewUrl(scheme: string, args: {
300
343
  * ```
301
344
  */
302
345
  export declare function enhanceAppWithFileList({ app }: EnhanceAppContext): void;
303
- export { _default as FileList, _default as VPFileList, type FileListLabels, type FileListLocale, type FileListProps, type FileListSource, type OpenListEntry };
346
+ export { type FileKind, _default as FileList, _default as VPFileList, type FileListLabels, type FileListLocale, type FileListProps, type FileListSource, type IframePreview, type OpenListEntry, type PreviewKind, type SortKey, type SortableNode };