vitepress-plugin-filelist 0.4.0 → 0.5.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.
@@ -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;
@@ -70,6 +72,26 @@ interface FileListLabels {
70
72
  previewTooLarge: string;
71
73
  /** Preview dialog: only the first `{size}` of a text file is shown. */
72
74
  textTruncated: string;
75
+ /** Refresh button while refreshing. */
76
+ refreshing: string;
77
+ /** Refresh failed; the old rows stay. `{message}` */
78
+ refreshFailed: string;
79
+ cancel: string;
80
+ /** Accessible name of a folder's password input. `{name}` */
81
+ passwordFor: string;
82
+ /** OpenList cannot tell a wrong password from missing permission. */
83
+ passwordWrong: string;
84
+ /** A password remembered in this tab no longer works. */
85
+ passwordStale: string;
86
+ /** The key toggle next to a password input. */
87
+ rememberPassword: string;
88
+ /** Tag on a folder whose password is remembered. */
89
+ remembered: string;
90
+ forgetPassword: string;
91
+ /** Lock button on a folder that needs a password. `{name}` */
92
+ unlockFolder: string;
93
+ /** @deprecated Network failures now append `corsHint`. */
94
+ networkHint: string;
73
95
  }
74
96
  interface FileListSource {
75
97
  /** OpenList path, directory or single file. */
@@ -96,6 +118,11 @@ interface FileListProps {
96
118
  password?: string;
97
119
  /** Toolbar title. Falls back to `site_title` from `/api/public/settings`. */
98
120
  title?: string;
121
+ /**
122
+ * Offer to remember folder passwords in this browser tab (sessionStorage,
123
+ * cleared when the tab closes). Defaults to `true`; `false` hides the option.
124
+ */
125
+ rememberPassword?: boolean;
99
126
  /** Built-in locale. Defaults to `zh-CN`. */
100
127
  locale?: FileListLocale;
101
128
  /** Per-key label overrides on top of the locale preset. */
@@ -120,6 +147,7 @@ declare const _default: import("vue").DefineComponent<FileListProps, {}, {}, {},
120
147
  token: string;
121
148
  password: string;
122
149
  title: string;
150
+ rememberPassword: boolean;
123
151
  locale: FileListLocale;
124
152
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
125
153
  declare global {
@@ -199,13 +227,13 @@ declare global {
199
227
  export declare const fileListLocales: Record<FileListLocale, FileListLabels>;
200
228
  export declare function formatLabel(template: string, values?: Record<string, string | number>): string;
201
229
  export declare function resolveLabels(locale?: FileListLocale, overrides?: Partial<FileListLabels>): FileListLabels;
202
- export interface SortableNode {
230
+ interface SortableNode {
203
231
  name: string;
204
232
  size: number;
205
233
  is_dir: boolean;
206
234
  modified: string;
207
235
  }
208
- export type SortKey = 'name' | 'size' | 'modified';
236
+ type SortKey = 'name' | 'size' | 'modified';
209
237
  export declare function joinPath(parent: string, name: string): string;
210
238
  export declare function encodePath(path: string): string;
211
239
  /**
@@ -220,24 +248,26 @@ export declare function zipEntryName(segments: string[]): string;
220
248
  * The suffix goes before the extension of the last segment. Adds the result to `used`.
221
249
  */
222
250
  export declare function uniqueEntryName(name: string, used: Set<string>): string;
251
+ /** Human-readable size. `0` reads `0 B`; missing, negative or invalid sizes read `-`. */
223
252
  export declare function formatSize(size: number): string;
224
253
  export declare function formatDate(iso: string): string;
254
+ /** Upper-case extension for the type badge, e.g. `PDF`. */
225
255
  export declare function extOf(name: string): string;
226
- export type FileKind = 'doc' | 'sheet' | 'slide' | 'pdf' | 'image' | 'media' | 'archive' | 'code' | 'other';
256
+ type FileKind = 'doc' | 'sheet' | 'slide' | 'pdf' | 'image' | 'media' | 'archive' | 'code' | 'other';
257
+ type PreviewKind = 'image' | 'video' | 'audio' | 'text' | 'pdf' | 'none';
227
258
  /** Rough file family, used to colour the type badge. */
228
259
  export declare function fileKind(name: string): FileKind;
229
- /** Sum of the `size` of the given entries, ignoring missing or invalid sizes. */
230
- export declare function totalSize(items: Array<{
231
- size?: number;
232
- }>): number;
233
- export declare function compareNodes(a: SortableNode, b: SortableNode, key: SortKey, ascending?: boolean): number;
234
- export type PreviewKind = 'image' | 'video' | 'audio' | 'text' | 'pdf' | 'none';
235
260
  /**
236
261
  * How a file is shown in the preview dialog. Office documents and anything
237
262
  * else the browser cannot render are `none` (info + download).
238
263
  */
239
264
  export declare function previewKind(name: string): PreviewKind;
240
- export interface IframePreview {
265
+ /** Sum of the `size` of the given entries, ignoring missing or invalid sizes. */
266
+ export declare function totalSize(items: Array<{
267
+ size?: number;
268
+ }>): number;
269
+ export declare function compareNodes(a: SortableNode, b: SortableNode, key: SortKey, ascending?: boolean): number;
270
+ interface IframePreview {
241
271
  label: string;
242
272
  scheme: string;
243
273
  }
@@ -274,4 +304,4 @@ export declare function fillPreviewUrl(scheme: string, args: {
274
304
  * ```
275
305
  */
276
306
  export declare function enhanceAppWithFileList({ app }: EnhanceAppContext): void;
277
- export { _default as FileList, _default as VPFileList, type FileListLabels, type FileListLocale, type FileListProps, type FileListSource, type OpenListEntry };
307
+ 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 };