vitepress-plugin-filelist 0.3.1 → 0.5.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.
@@ -32,6 +32,7 @@ interface FileListLabels {
32
32
  demoPreview: string;
33
33
  demoBatch: string;
34
34
  downloadFailed: string;
35
+ /** @deprecated Preview errors are shown in the dialog (`previewUnavailable`). */
35
36
  previewFailed: string;
36
37
  batchFailed: string;
37
38
  defaultZip: string;
@@ -52,6 +53,43 @@ interface FileListLabels {
52
53
  expand: string;
53
54
  /** Accessible name of the collapse button, `{name}`. */
54
55
  collapse: string;
56
+ /** Preview dialog: close button. */
57
+ close: string;
58
+ /** Preview dialog: previous / next previewable file. */
59
+ previous: string;
60
+ next: string;
61
+ /** Preview dialog: rotate image by 90°. */
62
+ rotate: string;
63
+ /** Preview dialog: toggle the image between fit-to-window and actual size. */
64
+ actualSize: string;
65
+ /** Preview dialog: file type that is not previewed (Office and others). */
66
+ previewUnsupported: string;
67
+ /** Preview dialog: preview failed (network, CORS, unsupported codec). */
68
+ previewUnavailable: string;
69
+ /** Preview dialog: PDF larger than the in-page limit, `{size}`. */
70
+ previewTooLarge: string;
71
+ /** Preview dialog: only the first `{size}` of a text file is shown. */
72
+ textTruncated: string;
73
+ /** Refresh button while refreshing. */
74
+ refreshing: string;
75
+ /** Refresh failed; the old rows stay. `{message}` */
76
+ refreshFailed: string;
77
+ cancel: string;
78
+ /** Placeholder / accessible name of a folder's password input. `{name}` */
79
+ passwordFor: string;
80
+ /** OpenList cannot tell a wrong password from missing permission. */
81
+ passwordWrong: string;
82
+ /** A password remembered in this tab no longer works. */
83
+ passwordStale: string;
84
+ /** The key toggle next to a password input. */
85
+ rememberPassword: string;
86
+ /** Tag on a folder whose password is remembered. */
87
+ remembered: string;
88
+ forgetPassword: string;
89
+ /** Lock button on a folder that needs a password. `{name}` */
90
+ unlockFolder: string;
91
+ /** Appended to failure toasts for browser network errors (usually CORS). */
92
+ networkHint: string;
55
93
  }
56
94
  interface FileListSource {
57
95
  /** OpenList path, directory or single file. */
@@ -78,6 +116,11 @@ interface FileListProps {
78
116
  password?: string;
79
117
  /** Toolbar title. Falls back to `site_title` from `/api/public/settings`. */
80
118
  title?: string;
119
+ /**
120
+ * Offer to remember folder passwords in this browser tab (sessionStorage,
121
+ * cleared when the tab closes). Defaults to `true`; `false` hides the option.
122
+ */
123
+ rememberPassword?: boolean;
81
124
  /** Built-in locale. Defaults to `zh-CN`. */
82
125
  locale?: FileListLocale;
83
126
  /** Per-key label overrides on top of the locale preset. */
@@ -102,6 +145,7 @@ declare const _default: import("vue").DefineComponent<FileListProps, {}, {}, {},
102
145
  token: string;
103
146
  password: string;
104
147
  title: string;
148
+ rememberPassword: boolean;
105
149
  locale: FileListLocale;
106
150
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
107
151
  declare global {
@@ -213,6 +257,32 @@ export declare function totalSize(items: Array<{
213
257
  size?: number;
214
258
  }>): number;
215
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
+ /**
262
+ * How a file is shown in the preview dialog. Office documents and anything
263
+ * else the browser cannot render are `none` (info + download).
264
+ */
265
+ export declare function previewKind(name: string): PreviewKind;
266
+ export interface IframePreview {
267
+ label: string;
268
+ scheme: string;
269
+ }
270
+ /**
271
+ * Viewers from OpenList's public `iframe_previews` setting that match a file,
272
+ * in the order OpenList lists them. Keys are comma-separated extensions or a
273
+ * `/regex/flags` tested against the extension, as in OpenList's frontend.
274
+ */
275
+ export declare function iframePreviewsFor(name: string, setting: string | undefined): IframePreview[];
276
+ /**
277
+ * Fill an OpenList preview scheme: `$name`, `$url` (raw URL) and `$durl`
278
+ * (signed download URL), each optionally prefixed with `e` (URI-encode) or
279
+ * `b` (base64), e.g. `$e_url`, `$b_url`, `$e_durl`.
280
+ */
281
+ export declare function fillPreviewUrl(scheme: string, args: {
282
+ name: string;
283
+ rawUrl: string;
284
+ downloadUrl: string;
285
+ }): string;
216
286
  /**
217
287
  * Register `<FileList>` and `<VPFileList>` globally.
218
288
  *