vitepress-plugin-filelist 0.7.2 → 0.8.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 +18 -300
- package/dist/client/browser/index.d.ts +15 -2
- package/dist/client/browser/index.js +379 -128
- package/dist/client/ssr/index.d.ts +15 -2
- package/dist/client/ssr/index.js +208 -19
- package/dist/client/style.css +153 -29
- package/package.json +2 -2
|
@@ -353,6 +353,56 @@ function createOpenListApi(base, token) {
|
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
355
|
}
|
|
356
|
+
// src/client/demoSamples.ts
|
|
357
|
+
const SAMPLE_FOLDER = "/示例文件";
|
|
358
|
+
const SAMPLES = {
|
|
359
|
+
"使用说明.md": {
|
|
360
|
+
type: "text/markdown",
|
|
361
|
+
body: "# 使用说明\n\n这是 **vitepress-plugin-filelist** 演示数据自带的 Markdown 文件。\n\n## 试一试\n\n- 点右上角“渲染”,按 VitePress 正文样式显示\n- 用 ← / → 切换到同一目录里的其它文件\n- 勾选“示例文件”文件夹,点“下载 ZIP”打包\n\n| 文件 | 类型 |\n| --- | --- |\n| 讲义.pdf | PDF |\n| 课程海报.svg | 图片 |\n| 网页示例.html | 网页 |\n\n> 接入 OpenList 后,这里显示的就是网盘里的真实文件。\n\n更多说明见 [文档站](https://nrjycyd.github.io/vitepress-plugin-filelist/)。\n"
|
|
362
|
+
},
|
|
363
|
+
"网页示例.html": {
|
|
364
|
+
type: "text/html",
|
|
365
|
+
body: "<!doctype html>\n<html lang=\"zh-CN\">\n<head>\n<meta charset=\"utf-8\">\n<title>网页示例</title>\n<style>\n body { font-family: system-ui, sans-serif; margin: 24px; line-height: 1.6; color: #1f2937; }\n h1 { color: #3451b2; }\n .card { padding: 12px 16px; border: 1px solid #d1d5db; border-radius: 8px; }\n</style>\n</head>\n<body>\n<h1>网页示例</h1>\n<p>切换到“渲染”后,这个网页在沙盒中显示:带样式,但脚本不会运行。</p>\n<div class=\"card\">下面的按钮由脚本控制,在沙盒里点了没有反应。</div>\n<p><button onclick=\"alert('脚本运行了')\">点我</button></p>\n<script>document.body.dataset.ran = 'yes'<\/script>\n</body>\n</html>\n"
|
|
366
|
+
},
|
|
367
|
+
"课程海报.svg": {
|
|
368
|
+
type: "image/svg+xml",
|
|
369
|
+
body: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"800\" height=\"450\" viewBox=\"0 0 800 450\">\n<defs><linearGradient id=\"g\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"><stop offset=\"0\" stop-color=\"#3451b2\"/><stop offset=\"1\" stop-color=\"#5672cd\"/></linearGradient></defs>\n<rect width=\"800\" height=\"450\" fill=\"url(#g)\"/>\n<circle cx=\"660\" cy=\"90\" r=\"120\" fill=\"#ffffff\" opacity=\"0.08\"/>\n<circle cx=\"120\" cy=\"420\" r=\"160\" fill=\"#ffffff\" opacity=\"0.06\"/>\n<text x=\"64\" y=\"190\" font-family=\"system-ui, sans-serif\" font-size=\"56\" font-weight=\"700\" fill=\"#ffffff\">课程海报</text>\n<text x=\"64\" y=\"250\" font-family=\"system-ui, sans-serif\" font-size=\"26\" fill=\"#dfe5ff\">线性代数 · 2026 秋季学期</text>\n<text x=\"64\" y=\"380\" font-family=\"system-ui, sans-serif\" font-size=\"18\" fill=\"#dfe5ff\">vitepress-plugin-filelist 演示图片</text>\n</svg>\n"
|
|
370
|
+
},
|
|
371
|
+
"讲义.pdf": {
|
|
372
|
+
type: "application/pdf",
|
|
373
|
+
body: "%PDF-1.4\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Resources << /Font << /F1 4 0 R >> >> /Contents 5 0 R >>\nendobj\n4 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>\nendobj\n5 0 obj\n<< /Length 257 >>\nstream\nBT\n/F1 20 Tf\n72 760 Td\n(FileList sample PDF) Tj\n/F1 12 Tf\n0 -22 Td\n() Tj\n0 -22 Td\n(This small PDF ships with the demo data of) Tj\n0 -22 Td\n(vitepress-plugin-filelist, so preview, download) Tj\n0 -22 Td\n(and ZIP can be tried without an OpenList server.) Tj\nET\nendstream\nendobj\nxref\n0 6\n0000000000 65535 f \n0000000009 00000 n \n0000000058 00000 n \n0000000115 00000 n \n0000000241 00000 n \n0000000311 00000 n \ntrailer\n<< /Size 6 /Root 1 0 R >>\nstartxref\n619\n%%EOF\n"
|
|
374
|
+
},
|
|
375
|
+
"课程表.txt": {
|
|
376
|
+
type: "text/plain",
|
|
377
|
+
body: "课程表(演示文本)\n\n周一 08:00 线性代数 教 301\n周三 10:00 线性代数习题课 教 205\n周五 14:00 答疑 图书馆 2 楼\n\n纯文本文件只读取前 1 MB,按原样显示。\n"
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
const SAMPLE_NAMES = Object.keys(SAMPLES);
|
|
381
|
+
/** Size in bytes of a sample, as UTF-8. */
|
|
382
|
+
function sampleSize(name) {
|
|
383
|
+
return new TextEncoder().encode(SAMPLES[name].body).byteLength;
|
|
384
|
+
}
|
|
385
|
+
function nameOf(path) {
|
|
386
|
+
const name = path.slice(6);
|
|
387
|
+
return path.startsWith(`/示例文件/`) && name in SAMPLES ? name : void 0;
|
|
388
|
+
}
|
|
389
|
+
/** Whether a demo path is one of the sample files (which have a real URL). */
|
|
390
|
+
function isSample(path) {
|
|
391
|
+
return nameOf(path) !== void 0;
|
|
392
|
+
}
|
|
393
|
+
const urls = /* @__PURE__ */ new Map();
|
|
394
|
+
/** A blob: URL for a sample file, `''` for any other path or outside a browser. */
|
|
395
|
+
function sampleUrl(path) {
|
|
396
|
+
const name = nameOf(path);
|
|
397
|
+
if (!name || typeof URL.createObjectURL !== "function") return "";
|
|
398
|
+
let url = urls.get(name);
|
|
399
|
+
if (!url) {
|
|
400
|
+
const { type, body } = SAMPLES[name];
|
|
401
|
+
url = URL.createObjectURL(new Blob([body], { type: `${type};charset=utf-8` }));
|
|
402
|
+
urls.set(name, url);
|
|
403
|
+
}
|
|
404
|
+
return url;
|
|
405
|
+
}
|
|
356
406
|
// src/client/demo.ts
|
|
357
407
|
/** Built-in sample data, used when no `base` is given. */
|
|
358
408
|
const TREE = {
|
|
@@ -392,8 +442,32 @@ const TREE = {
|
|
|
392
442
|
size: 0,
|
|
393
443
|
is_dir: true,
|
|
394
444
|
modified: "2026-10-20T18:00:00+08:00"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
name: "示例文件",
|
|
448
|
+
size: 0,
|
|
449
|
+
is_dir: true,
|
|
450
|
+
modified: "2026-11-11T09:00:00+08:00"
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
name: "照片(260 张)",
|
|
454
|
+
size: 0,
|
|
455
|
+
is_dir: true,
|
|
456
|
+
modified: "2026-10-01T12:00:00+08:00"
|
|
395
457
|
}
|
|
396
458
|
],
|
|
459
|
+
[SAMPLE_FOLDER]: SAMPLE_NAMES.map((name) => ({
|
|
460
|
+
name,
|
|
461
|
+
size: sampleSize(name),
|
|
462
|
+
is_dir: false,
|
|
463
|
+
modified: "2026-11-11T09:00:00+08:00"
|
|
464
|
+
})),
|
|
465
|
+
"/照片(260 张)": Array.from({ length: 260 }, (_, index) => ({
|
|
466
|
+
name: `IMG_${String(index + 1).padStart(4, "0")}.jpg`,
|
|
467
|
+
size: 2e6 + index * 7919 % 15e5,
|
|
468
|
+
is_dir: false,
|
|
469
|
+
modified: "2026-10-01T12:00:00+08:00"
|
|
470
|
+
})),
|
|
397
471
|
"/assignments": [{
|
|
398
472
|
name: "线代作业参考答案",
|
|
399
473
|
size: 0,
|
|
@@ -514,7 +588,7 @@ function guard(path, password) {
|
|
|
514
588
|
function parentOf(path) {
|
|
515
589
|
return path.slice(0, path.lastIndexOf("/")) || "/";
|
|
516
590
|
}
|
|
517
|
-
/** Demo OpenList: same API, no network; files have
|
|
591
|
+
/** Demo OpenList: same API, no network; only the sample files have a URL. */
|
|
518
592
|
function createDemoApi(delay = 220) {
|
|
519
593
|
return {
|
|
520
594
|
async list(path, password) {
|
|
@@ -533,12 +607,14 @@ function createDemoApi(delay = 220) {
|
|
|
533
607
|
title: "",
|
|
534
608
|
iframePreviews: ""
|
|
535
609
|
}),
|
|
536
|
-
fileUrl: async () =>
|
|
610
|
+
fileUrl: async (file) => sampleUrl(file.path),
|
|
537
611
|
directUrl: () => "",
|
|
538
|
-
isAttachmentUrl: () =>
|
|
612
|
+
isAttachmentUrl: (url) => url.startsWith("blob:"),
|
|
539
613
|
clearCache: () => {}
|
|
540
614
|
};
|
|
541
615
|
}
|
|
616
|
+
/** Whether a demo file can really be previewed, downloaded and zipped. */
|
|
617
|
+
const isDemoFile = isSample;
|
|
542
618
|
// src/client/ConfirmDialog.vue
|
|
543
619
|
const _hoisted_1$3 = ["aria-label"];
|
|
544
620
|
const _hoisted_2$3 = {
|
|
@@ -801,6 +877,14 @@ const ICONS = {
|
|
|
801
877
|
stroke: 2.2,
|
|
802
878
|
paths: ["m15 6-6 6 6 6"]
|
|
803
879
|
},
|
|
880
|
+
down: {
|
|
881
|
+
stroke: 2.4,
|
|
882
|
+
paths: ["m6 9 6 6 6-6"]
|
|
883
|
+
},
|
|
884
|
+
up: {
|
|
885
|
+
stroke: 2.4,
|
|
886
|
+
paths: ["m18 15-6-6-6 6"]
|
|
887
|
+
},
|
|
804
888
|
zoomIn: {
|
|
805
889
|
stroke: 2,
|
|
806
890
|
paths: [
|
|
@@ -948,7 +1032,13 @@ const fileListLocales = {
|
|
|
948
1032
|
moreRemaining: "还有 {count} 项",
|
|
949
1033
|
showMore: "显示更多",
|
|
950
1034
|
showAll: "全部显示",
|
|
951
|
-
showRest: "显示剩余 {count} 项"
|
|
1035
|
+
showRest: "显示剩余 {count} 项",
|
|
1036
|
+
showLess: "收起",
|
|
1037
|
+
allShown: "已显示全部 {count} 项",
|
|
1038
|
+
moreShown: "已显示 {shown} / {total} 项",
|
|
1039
|
+
showAllShort: "全部",
|
|
1040
|
+
showNext: "再显示 {count} 项",
|
|
1041
|
+
showNextShort: "+{count}"
|
|
952
1042
|
},
|
|
953
1043
|
"en-US": {
|
|
954
1044
|
allFiles: "All files",
|
|
@@ -1044,7 +1134,13 @@ const fileListLocales = {
|
|
|
1044
1134
|
moreRemaining: "{count} more",
|
|
1045
1135
|
showMore: "Show more",
|
|
1046
1136
|
showAll: "Show all",
|
|
1047
|
-
showRest: "Show the remaining {count}"
|
|
1137
|
+
showRest: "Show the remaining {count}",
|
|
1138
|
+
showLess: "Show less",
|
|
1139
|
+
allShown: "All {count} shown",
|
|
1140
|
+
moreShown: "Showing {shown} of {total}",
|
|
1141
|
+
showAllShort: "All",
|
|
1142
|
+
showNext: "Show {count} more",
|
|
1143
|
+
showNextShort: "+{count}"
|
|
1048
1144
|
}
|
|
1049
1145
|
};
|
|
1050
1146
|
function formatLabel(template, values = {}) {
|
|
@@ -1813,73 +1909,97 @@ const _hoisted_27 = {
|
|
|
1813
1909
|
};
|
|
1814
1910
|
const _hoisted_28 = ["aria-label"];
|
|
1815
1911
|
const _hoisted_29 = ["value"];
|
|
1816
|
-
const _hoisted_30 = {
|
|
1912
|
+
const _hoisted_30 = { class: "fl-cell fl-cell-name" };
|
|
1913
|
+
const _hoisted_31 = {
|
|
1914
|
+
key: 0,
|
|
1915
|
+
class: "fl-indent",
|
|
1916
|
+
"aria-hidden": "true"
|
|
1917
|
+
};
|
|
1918
|
+
const _hoisted_32 = {
|
|
1919
|
+
key: 1,
|
|
1920
|
+
class: "fl-pin-arrow",
|
|
1921
|
+
"aria-hidden": "true"
|
|
1922
|
+
};
|
|
1923
|
+
const _hoisted_33 = { class: "fl-pin-name" };
|
|
1924
|
+
const _hoisted_34 = { class: "fl-pin-count" };
|
|
1925
|
+
const _hoisted_35 = {
|
|
1817
1926
|
key: 0,
|
|
1818
1927
|
class: "fl-status"
|
|
1819
1928
|
};
|
|
1820
|
-
const
|
|
1821
|
-
const
|
|
1822
|
-
const
|
|
1823
|
-
const
|
|
1929
|
+
const _hoisted_36 = ["for"];
|
|
1930
|
+
const _hoisted_37 = ["id"];
|
|
1931
|
+
const _hoisted_38 = { class: "fl-unlock" };
|
|
1932
|
+
const _hoisted_39 = [
|
|
1824
1933
|
"id",
|
|
1825
1934
|
"data-unlock",
|
|
1826
1935
|
"placeholder",
|
|
1827
1936
|
"aria-invalid",
|
|
1828
1937
|
"aria-describedby"
|
|
1829
1938
|
];
|
|
1830
|
-
const
|
|
1939
|
+
const _hoisted_40 = [
|
|
1831
1940
|
"aria-pressed",
|
|
1832
1941
|
"aria-label",
|
|
1833
1942
|
"title"
|
|
1834
1943
|
];
|
|
1835
|
-
const
|
|
1836
|
-
const
|
|
1944
|
+
const _hoisted_41 = ["disabled"];
|
|
1945
|
+
const _hoisted_42 = {
|
|
1837
1946
|
key: 2,
|
|
1838
1947
|
class: "fl-status fl-error"
|
|
1839
1948
|
};
|
|
1840
|
-
const
|
|
1949
|
+
const _hoisted_43 = {
|
|
1841
1950
|
key: 0,
|
|
1842
1951
|
class: "fl-hint"
|
|
1843
1952
|
};
|
|
1844
|
-
const
|
|
1953
|
+
const _hoisted_44 = {
|
|
1845
1954
|
key: 1,
|
|
1846
1955
|
class: "fl-hint"
|
|
1847
1956
|
};
|
|
1848
|
-
const
|
|
1957
|
+
const _hoisted_45 = {
|
|
1849
1958
|
key: 3,
|
|
1850
1959
|
class: "fl-status"
|
|
1851
1960
|
};
|
|
1852
|
-
const
|
|
1853
|
-
const
|
|
1854
|
-
const
|
|
1855
|
-
const
|
|
1856
|
-
const
|
|
1857
|
-
const
|
|
1858
|
-
|
|
1859
|
-
|
|
1961
|
+
const _hoisted_46 = { class: "fl-cell fl-more-cell" };
|
|
1962
|
+
const _hoisted_47 = { class: "fl-more-count" };
|
|
1963
|
+
const _hoisted_48 = { class: "fl-more-actions" };
|
|
1964
|
+
const _hoisted_49 = ["aria-label", "onClick"];
|
|
1965
|
+
const _hoisted_50 = { class: "fl-more-long" };
|
|
1966
|
+
const _hoisted_51 = {
|
|
1967
|
+
class: "fl-more-short",
|
|
1968
|
+
"aria-hidden": "true"
|
|
1969
|
+
};
|
|
1970
|
+
const _hoisted_52 = ["aria-label", "onClick"];
|
|
1971
|
+
const _hoisted_53 = { class: "fl-more-long" };
|
|
1972
|
+
const _hoisted_54 = {
|
|
1973
|
+
class: "fl-more-short",
|
|
1974
|
+
"aria-hidden": "true"
|
|
1975
|
+
};
|
|
1976
|
+
const _hoisted_55 = ["onClick"];
|
|
1977
|
+
const _hoisted_56 = ["data-path"];
|
|
1978
|
+
const _hoisted_57 = { class: "fl-cell fl-cell-check" };
|
|
1979
|
+
const _hoisted_58 = [
|
|
1860
1980
|
"disabled",
|
|
1861
1981
|
"aria-label",
|
|
1862
1982
|
"checked",
|
|
1863
1983
|
".indeterminate",
|
|
1864
1984
|
"onChange"
|
|
1865
1985
|
];
|
|
1866
|
-
const
|
|
1867
|
-
const
|
|
1986
|
+
const _hoisted_59 = ["title"];
|
|
1987
|
+
const _hoisted_60 = [
|
|
1868
1988
|
"aria-label",
|
|
1869
1989
|
"title",
|
|
1870
1990
|
"onClick"
|
|
1871
1991
|
];
|
|
1872
|
-
const
|
|
1992
|
+
const _hoisted_61 = [
|
|
1873
1993
|
"aria-label",
|
|
1874
1994
|
"aria-expanded",
|
|
1875
1995
|
"onClick"
|
|
1876
1996
|
];
|
|
1877
|
-
const
|
|
1997
|
+
const _hoisted_62 = {
|
|
1878
1998
|
key: 2,
|
|
1879
1999
|
class: "fl-arrow-placeholder",
|
|
1880
2000
|
"aria-hidden": "true"
|
|
1881
2001
|
};
|
|
1882
|
-
const
|
|
2002
|
+
const _hoisted_63 = {
|
|
1883
2003
|
key: 3,
|
|
1884
2004
|
class: "fl-folder-icon",
|
|
1885
2005
|
viewBox: "0 0 24 24",
|
|
@@ -1887,39 +2007,39 @@ const _hoisted_53 = {
|
|
|
1887
2007
|
height: "18",
|
|
1888
2008
|
"aria-hidden": "true"
|
|
1889
2009
|
};
|
|
1890
|
-
const
|
|
1891
|
-
const
|
|
1892
|
-
const
|
|
1893
|
-
const
|
|
2010
|
+
const _hoisted_64 = ["data-kind"];
|
|
2011
|
+
const _hoisted_65 = { class: "fl-label" };
|
|
2012
|
+
const _hoisted_66 = ["onClick"];
|
|
2013
|
+
const _hoisted_67 = {
|
|
1894
2014
|
key: 0,
|
|
1895
2015
|
class: "fl-hit"
|
|
1896
2016
|
};
|
|
1897
|
-
const
|
|
1898
|
-
const
|
|
2017
|
+
const _hoisted_68 = { class: "fl-meta" };
|
|
2018
|
+
const _hoisted_69 = {
|
|
1899
2019
|
key: 2,
|
|
1900
2020
|
class: "fl-locked-note"
|
|
1901
2021
|
};
|
|
1902
|
-
const
|
|
2022
|
+
const _hoisted_70 = {
|
|
1903
2023
|
key: 5,
|
|
1904
2024
|
class: "fl-locked-note fl-locked-hint"
|
|
1905
2025
|
};
|
|
1906
|
-
const
|
|
2026
|
+
const _hoisted_71 = {
|
|
1907
2027
|
key: 6,
|
|
1908
2028
|
class: "fl-count"
|
|
1909
2029
|
};
|
|
1910
|
-
const
|
|
1911
|
-
const
|
|
2030
|
+
const _hoisted_72 = ["id"];
|
|
2031
|
+
const _hoisted_73 = [
|
|
1912
2032
|
"aria-label",
|
|
1913
2033
|
"title",
|
|
1914
2034
|
"onClick"
|
|
1915
2035
|
];
|
|
1916
|
-
const
|
|
2036
|
+
const _hoisted_74 = {
|
|
1917
2037
|
key: 9,
|
|
1918
2038
|
class: "fl-loading",
|
|
1919
2039
|
"aria-hidden": "true"
|
|
1920
2040
|
};
|
|
1921
|
-
const
|
|
1922
|
-
const
|
|
2041
|
+
const _hoisted_75 = ["onSubmit", "onKeydown"];
|
|
2042
|
+
const _hoisted_76 = [
|
|
1923
2043
|
"onUpdate:modelValue",
|
|
1924
2044
|
"data-unlock",
|
|
1925
2045
|
"placeholder",
|
|
@@ -1927,50 +2047,50 @@ const _hoisted_66 = [
|
|
|
1927
2047
|
"aria-invalid",
|
|
1928
2048
|
"aria-describedby"
|
|
1929
2049
|
];
|
|
1930
|
-
const
|
|
2050
|
+
const _hoisted_77 = [
|
|
1931
2051
|
"aria-pressed",
|
|
1932
2052
|
"aria-label",
|
|
1933
2053
|
"title",
|
|
1934
2054
|
"onClick"
|
|
1935
2055
|
];
|
|
1936
|
-
const
|
|
1937
|
-
const
|
|
2056
|
+
const _hoisted_78 = ["disabled"];
|
|
2057
|
+
const _hoisted_79 = [
|
|
1938
2058
|
"aria-label",
|
|
1939
2059
|
"title",
|
|
1940
2060
|
"onClick"
|
|
1941
2061
|
];
|
|
1942
|
-
const
|
|
1943
|
-
const
|
|
1944
|
-
const
|
|
1945
|
-
const
|
|
1946
|
-
const
|
|
2062
|
+
const _hoisted_80 = { class: "fl-cell fl-cell-size" };
|
|
2063
|
+
const _hoisted_81 = { class: "fl-cell fl-cell-date" };
|
|
2064
|
+
const _hoisted_82 = { class: "fl-cell fl-cell-op" };
|
|
2065
|
+
const _hoisted_83 = ["aria-label", "onClick"];
|
|
2066
|
+
const _hoisted_84 = [
|
|
1947
2067
|
"aria-label",
|
|
1948
2068
|
"aria-expanded",
|
|
1949
2069
|
"onClick"
|
|
1950
2070
|
];
|
|
1951
|
-
const
|
|
2071
|
+
const _hoisted_85 = [
|
|
1952
2072
|
"aria-label",
|
|
1953
2073
|
"title",
|
|
1954
2074
|
"onClick"
|
|
1955
2075
|
];
|
|
1956
|
-
const
|
|
2076
|
+
const _hoisted_86 = [
|
|
1957
2077
|
"aria-label",
|
|
1958
2078
|
"title",
|
|
1959
2079
|
"onClick"
|
|
1960
2080
|
];
|
|
1961
|
-
const
|
|
2081
|
+
const _hoisted_87 = {
|
|
1962
2082
|
key: 4,
|
|
1963
2083
|
class: "fl-deep",
|
|
1964
2084
|
role: "status"
|
|
1965
2085
|
};
|
|
1966
|
-
const
|
|
1967
|
-
const
|
|
2086
|
+
const _hoisted_88 = { class: "fl-deep-text" };
|
|
2087
|
+
const _hoisted_89 = {
|
|
1968
2088
|
key: 0,
|
|
1969
2089
|
class: "fl-deep-bar",
|
|
1970
2090
|
"aria-hidden": "true"
|
|
1971
2091
|
};
|
|
1972
|
-
const
|
|
1973
|
-
const
|
|
2092
|
+
const _hoisted_90 = { class: "fl-foot" };
|
|
2093
|
+
const _hoisted_91 = {
|
|
1974
2094
|
key: 5,
|
|
1975
2095
|
class: "fl-toast",
|
|
1976
2096
|
role: "status"
|
|
@@ -1994,7 +2114,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
1994
2114
|
type: Boolean,
|
|
1995
2115
|
default: true
|
|
1996
2116
|
},
|
|
1997
|
-
pageSize: { default:
|
|
2117
|
+
pageSize: { default: 15 },
|
|
1998
2118
|
deepSearchLimit: { default: 500 },
|
|
1999
2119
|
deepSearch: { default: "manual" },
|
|
2000
2120
|
zipWarnSize: {},
|
|
@@ -2341,6 +2461,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
2341
2461
|
if (!node.is_dir) return;
|
|
2342
2462
|
if (node.expanded) {
|
|
2343
2463
|
node.expanded = false;
|
|
2464
|
+
for (const key of [...shown.keys()]) if (isWithin(key, node.path)) shown.delete(key);
|
|
2344
2465
|
return;
|
|
2345
2466
|
}
|
|
2346
2467
|
node.expanded = await loadChildren(node, "focus");
|
|
@@ -2376,22 +2497,37 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
2376
2497
|
applySort(key, direction !== "desc");
|
|
2377
2498
|
}
|
|
2378
2499
|
});
|
|
2379
|
-
/**
|
|
2500
|
+
/** The row closing a long folder while its children are cut at `pageSize`. */
|
|
2380
2501
|
const shown = reactive(/* @__PURE__ */ new Map());
|
|
2502
|
+
function pageSizeOf() {
|
|
2503
|
+
return Math.max(0, Math.floor(props.pageSize ?? 15));
|
|
2504
|
+
}
|
|
2381
2505
|
function limitOf(key) {
|
|
2382
|
-
const size =
|
|
2506
|
+
const size = pageSizeOf();
|
|
2383
2507
|
return size ? shown.get(key) ?? size : Number.POSITIVE_INFINITY;
|
|
2384
2508
|
}
|
|
2385
2509
|
function showMore(row, all) {
|
|
2386
|
-
const size = Math.max(1,
|
|
2510
|
+
const size = Math.max(1, pageSizeOf());
|
|
2387
2511
|
shown.set(row.key, all ? Number.POSITIVE_INFINITY : limitOf(row.key) + size);
|
|
2388
2512
|
}
|
|
2513
|
+
/** Back to the first page; the folder's row (or the list's top) comes back into view. */
|
|
2514
|
+
async function showLess(key) {
|
|
2515
|
+
shown.delete(key);
|
|
2516
|
+
pinned.value = null;
|
|
2517
|
+
await nextTick();
|
|
2518
|
+
const root = rootEl.value;
|
|
2519
|
+
if (!root) return;
|
|
2520
|
+
const target = rowElement(key) ?? root;
|
|
2521
|
+
if (target.getBoundingClientRect().top < stickyTop.value) target.scrollIntoView({ block: "start" });
|
|
2522
|
+
}
|
|
2389
2523
|
function isMore(row) {
|
|
2390
2524
|
return "more" in row;
|
|
2391
2525
|
}
|
|
2392
|
-
const
|
|
2526
|
+
const layout = computed(() => {
|
|
2393
2527
|
const out = [];
|
|
2528
|
+
const long = [];
|
|
2394
2529
|
const query = keyword.value.trim().toLowerCase();
|
|
2530
|
+
const size = pageSizeOf();
|
|
2395
2531
|
const matches = (node) => !query || node.name.toLowerCase().includes(query) || node.is_dir && (node.children.some(matches) || deepMode.value && !!node.lock);
|
|
2396
2532
|
const walk = (nodes, key, depth) => {
|
|
2397
2533
|
const list = nodes.filter(matches);
|
|
@@ -2406,10 +2542,70 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
2406
2542
|
depth,
|
|
2407
2543
|
remaining: list.length - limit
|
|
2408
2544
|
});
|
|
2545
|
+
let end = out.length - 1;
|
|
2546
|
+
while (end >= 0 && isMore(out[end])) end -= 1;
|
|
2547
|
+
const last = out[end];
|
|
2548
|
+
if (!query && size > 0 && limit > size && last && !isMore(last)) long.push({
|
|
2549
|
+
key,
|
|
2550
|
+
depth: depth - 1,
|
|
2551
|
+
shown: limit,
|
|
2552
|
+
total: list.length,
|
|
2553
|
+
last: last.path
|
|
2554
|
+
});
|
|
2409
2555
|
};
|
|
2410
2556
|
walk(roots.value, props.sources.length ? "" : props.path, 0);
|
|
2411
|
-
return
|
|
2557
|
+
return {
|
|
2558
|
+
rows: out,
|
|
2559
|
+
long
|
|
2560
|
+
};
|
|
2412
2561
|
});
|
|
2562
|
+
const rows = computed(() => layout.value.rows);
|
|
2563
|
+
const pinned = ref(null);
|
|
2564
|
+
/** Height of the sticky selection bar above the pinned row (narrow lists only). */
|
|
2565
|
+
const pinOffset = ref(0);
|
|
2566
|
+
function rowElement(path) {
|
|
2567
|
+
return [...rootEl.value?.querySelectorAll("[data-path]") ?? []].find((el) => el.dataset.path === path);
|
|
2568
|
+
}
|
|
2569
|
+
/** The pinned folder's name: its own, or for a single path's top level, the list's title. */
|
|
2570
|
+
const pinnedName = computed(() => {
|
|
2571
|
+
const folder = pinned.value;
|
|
2572
|
+
if (!folder) return "";
|
|
2573
|
+
if (folder.depth < 0) return props.title || folder.key.split("/").filter(Boolean).pop() || "/";
|
|
2574
|
+
const find = (nodes) => {
|
|
2575
|
+
for (const node of nodes) {
|
|
2576
|
+
if (node.path === folder.key) return node;
|
|
2577
|
+
const inner = isWithin(folder.key, node.path) ? find(node.children) : void 0;
|
|
2578
|
+
if (inner) return inner;
|
|
2579
|
+
}
|
|
2580
|
+
};
|
|
2581
|
+
return find(roots.value)?.name ?? "";
|
|
2582
|
+
});
|
|
2583
|
+
/** Pin the innermost long folder whose own row has scrolled away while its files are still on screen. */
|
|
2584
|
+
function updatePin() {
|
|
2585
|
+
const root = rootEl.value;
|
|
2586
|
+
if (!root) return;
|
|
2587
|
+
const bar = root.querySelector(".fl-bar");
|
|
2588
|
+
pinOffset.value = bar && getComputedStyle(bar).position === "sticky" ? bar.offsetHeight : 0;
|
|
2589
|
+
const top = stickyTop.value + pinOffset.value;
|
|
2590
|
+
const rowHeight = root.querySelector(".fl-head")?.offsetHeight ?? 40;
|
|
2591
|
+
let found = null;
|
|
2592
|
+
for (const folder of layout.value.long) {
|
|
2593
|
+
const head = folder.depth < 0 ? root.querySelector(".fl-head") : rowElement(folder.key);
|
|
2594
|
+
const last = rowElement(folder.last);
|
|
2595
|
+
if (!head || !last) continue;
|
|
2596
|
+
if (head.getBoundingClientRect().bottom <= top && last.getBoundingClientRect().bottom > top + rowHeight && (!found || folder.depth > found.depth)) found = folder;
|
|
2597
|
+
}
|
|
2598
|
+
pinned.value = found;
|
|
2599
|
+
}
|
|
2600
|
+
let pinFrame = 0;
|
|
2601
|
+
function schedulePin() {
|
|
2602
|
+
if (pinFrame) return;
|
|
2603
|
+
pinFrame = requestAnimationFrame(() => {
|
|
2604
|
+
pinFrame = 0;
|
|
2605
|
+
updatePin();
|
|
2606
|
+
});
|
|
2607
|
+
}
|
|
2608
|
+
watch(layout, () => void nextTick(schedulePin));
|
|
2413
2609
|
const visible = computed(() => rows.value.filter((row) => !isMore(row)));
|
|
2414
2610
|
/** A name split around the filter keyword, for highlighting. */
|
|
2415
2611
|
function nameParts(name) {
|
|
@@ -2653,7 +2849,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
2653
2849
|
}
|
|
2654
2850
|
async function download(node) {
|
|
2655
2851
|
if (node.is_dir) return;
|
|
2656
|
-
if (demo.value) {
|
|
2852
|
+
if (demo.value && !isDemoFile(node.path)) {
|
|
2657
2853
|
showToast(t("demoDownload", { name: node.name }));
|
|
2658
2854
|
return;
|
|
2659
2855
|
}
|
|
@@ -2711,7 +2907,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
2711
2907
|
async function batchDownload() {
|
|
2712
2908
|
const files = selectedFiles.value;
|
|
2713
2909
|
if (!files.length || batchBusy.value) return;
|
|
2714
|
-
if (demo.value) {
|
|
2910
|
+
if (demo.value && !files.every((file) => isDemoFile(file.path))) {
|
|
2715
2911
|
showToast(t("demoBatch", { count: files.length }));
|
|
2716
2912
|
return;
|
|
2717
2913
|
}
|
|
@@ -2809,7 +3005,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
2809
3005
|
previewViewer.value = "";
|
|
2810
3006
|
previewError.value = "";
|
|
2811
3007
|
previewResolving.value = false;
|
|
2812
|
-
if (demo.value || !canPreview(node)) return;
|
|
3008
|
+
if (demo.value && !isDemoFile(node.path) || !canPreview(node)) return;
|
|
2813
3009
|
previewResolving.value = true;
|
|
2814
3010
|
try {
|
|
2815
3011
|
const url = await fileUrlOf(node);
|
|
@@ -2858,10 +3054,15 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
2858
3054
|
loadSettings();
|
|
2859
3055
|
measureStickyTop();
|
|
2860
3056
|
window.addEventListener("resize", measureStickyTop, { passive: true });
|
|
3057
|
+
window.addEventListener("scroll", schedulePin, { passive: true });
|
|
3058
|
+
window.addEventListener("resize", schedulePin, { passive: true });
|
|
2861
3059
|
});
|
|
2862
3060
|
onBeforeUnmount(() => {
|
|
2863
3061
|
zipAbort?.abort();
|
|
2864
3062
|
window.removeEventListener("resize", measureStickyTop);
|
|
3063
|
+
window.removeEventListener("scroll", schedulePin);
|
|
3064
|
+
window.removeEventListener("resize", schedulePin);
|
|
3065
|
+
cancelAnimationFrame(pinFrame);
|
|
2865
3066
|
clearTimeout(toastTimer);
|
|
2866
3067
|
});
|
|
2867
3068
|
return (_ctx, _cache) => {
|
|
@@ -2990,7 +3191,45 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
2990
3191
|
}), 128))], 8, _hoisted_28), [[vModelSelect, sortValue.value]])
|
|
2991
3192
|
])])
|
|
2992
3193
|
]),
|
|
2993
|
-
|
|
3194
|
+
createCommentVNode(" While scrolling through a long folder, its row stays at the top with “show less”. "),
|
|
3195
|
+
createElementVNode("div", {
|
|
3196
|
+
class: "fl-pin-anchor",
|
|
3197
|
+
style: normalizeStyle({ "--fl-pin-offset": `${pinOffset.value}px` })
|
|
3198
|
+
}, [pinned.value ? (openBlock(), createElementBlock("div", {
|
|
3199
|
+
key: 0,
|
|
3200
|
+
class: "fl-pin",
|
|
3201
|
+
style: normalizeStyle({ "--fl-depth": Math.max(pinned.value.depth, 0) })
|
|
3202
|
+
}, [
|
|
3203
|
+
_cache[11] || (_cache[11] = createElementVNode("span", { class: "fl-cell fl-cell-check" }, null, -1)),
|
|
3204
|
+
createElementVNode("span", _hoisted_30, [
|
|
3205
|
+
pinned.value.depth >= 0 ? (openBlock(), createElementBlock("span", _hoisted_31)) : createCommentVNode("v-if", true),
|
|
3206
|
+
pinned.value.depth >= 0 ? (openBlock(), createElementBlock("span", _hoisted_32, [createVNode(_sfc_main$2, {
|
|
3207
|
+
name: "next",
|
|
3208
|
+
size: 14
|
|
3209
|
+
})])) : createCommentVNode("v-if", true),
|
|
3210
|
+
_cache[10] || (_cache[10] = createElementVNode("svg", {
|
|
3211
|
+
class: "fl-folder-icon",
|
|
3212
|
+
viewBox: "0 0 24 24",
|
|
3213
|
+
width: "18",
|
|
3214
|
+
height: "18",
|
|
3215
|
+
"aria-hidden": "true"
|
|
3216
|
+
}, [createElementVNode("path", { d: "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" })], -1)),
|
|
3217
|
+
createElementVNode("span", _hoisted_33, toDisplayString(pinnedName.value), 1),
|
|
3218
|
+
createElementVNode("span", _hoisted_34, toDisplayString(pinned.value.shown < pinned.value.total ? t("moreShown", {
|
|
3219
|
+
shown: pinned.value.shown,
|
|
3220
|
+
total: pinned.value.total
|
|
3221
|
+
}) : t("allShown", { count: pinned.value.total })), 1)
|
|
3222
|
+
]),
|
|
3223
|
+
createElementVNode("button", {
|
|
3224
|
+
class: "fl-pin-less",
|
|
3225
|
+
type: "button",
|
|
3226
|
+
onClick: _cache[3] || (_cache[3] = ($event) => showLess(pinned.value.key))
|
|
3227
|
+
}, [createTextVNode(toDisplayString(t("showLess")), 1), createVNode(_sfc_main$2, {
|
|
3228
|
+
name: "up",
|
|
3229
|
+
size: 12
|
|
3230
|
+
})])
|
|
3231
|
+
], 4)) : createCommentVNode("v-if", true)], 4),
|
|
3232
|
+
loadingRoot.value ? (openBlock(), createElementBlock("div", _hoisted_35, toDisplayString(t("loading")), 1)) : rootLock.value ? (openBlock(), createElementBlock("form", {
|
|
2994
3233
|
key: 1,
|
|
2995
3234
|
class: normalizeClass(["fl-unlock-root", { "fl-unlock-error": rootLock.value.error }]),
|
|
2996
3235
|
onSubmit: withModifiers(submitRootUnlock, ["prevent"])
|
|
@@ -3002,24 +3241,24 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
3002
3241
|
createElementVNode("label", {
|
|
3003
3242
|
class: "fl-unlock-label",
|
|
3004
3243
|
for: `${unref(uid)}-root`
|
|
3005
|
-
}, toDisplayString(t("passwordPrompt")), 9,
|
|
3244
|
+
}, toDisplayString(t("passwordPrompt")), 9, _hoisted_36),
|
|
3006
3245
|
rootLock.value.error ? (openBlock(), createElementBlock("span", {
|
|
3007
3246
|
key: 0,
|
|
3008
3247
|
id: `${unref(uid)}-root-error`,
|
|
3009
3248
|
class: "fl-unlock-message",
|
|
3010
3249
|
role: "alert"
|
|
3011
|
-
}, toDisplayString(unlockErrorText(rootLock.value.error)), 9,
|
|
3012
|
-
createElementVNode("span",
|
|
3250
|
+
}, toDisplayString(unlockErrorText(rootLock.value.error)), 9, _hoisted_37)) : createCommentVNode("v-if", true),
|
|
3251
|
+
createElementVNode("span", _hoisted_38, [
|
|
3013
3252
|
withDirectives(createElementVNode("input", {
|
|
3014
3253
|
id: `${unref(uid)}-root`,
|
|
3015
|
-
"onUpdate:modelValue": _cache[
|
|
3254
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => rootLock.value.input = $event),
|
|
3016
3255
|
type: "password",
|
|
3017
3256
|
autocomplete: "off",
|
|
3018
3257
|
"data-unlock": __props.path,
|
|
3019
3258
|
placeholder: t("passwordPlaceholder"),
|
|
3020
3259
|
"aria-invalid": !!rootLock.value.error,
|
|
3021
3260
|
"aria-describedby": rootLock.value.error ? `${unref(uid)}-root-error` : void 0
|
|
3022
|
-
}, null, 8,
|
|
3261
|
+
}, null, 8, _hoisted_39), [[vModelText, rootLock.value.input]]),
|
|
3023
3262
|
canRemember.value ? (openBlock(), createElementBlock("button", {
|
|
3024
3263
|
key: 0,
|
|
3025
3264
|
class: "fl-unlock-remember",
|
|
@@ -3027,49 +3266,60 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
3027
3266
|
"aria-pressed": rootLock.value.remember,
|
|
3028
3267
|
"aria-label": t("rememberPassword"),
|
|
3029
3268
|
title: t("rememberPassword"),
|
|
3030
|
-
onClick: _cache[
|
|
3031
|
-
}, [createVNode(_sfc_main$2, { name: "key" })], 8,
|
|
3269
|
+
onClick: _cache[5] || (_cache[5] = ($event) => rootLock.value.remember = !rootLock.value.remember)
|
|
3270
|
+
}, [createVNode(_sfc_main$2, { name: "key" })], 8, _hoisted_40)) : createCommentVNode("v-if", true),
|
|
3032
3271
|
createElementVNode("button", {
|
|
3033
3272
|
class: "fl-unlock-submit",
|
|
3034
3273
|
type: "submit",
|
|
3035
3274
|
disabled: rootLock.value.busy || !rootLock.value.input
|
|
3036
|
-
}, toDisplayString(t("open")), 9,
|
|
3275
|
+
}, toDisplayString(t("open")), 9, _hoisted_41)
|
|
3037
3276
|
])
|
|
3038
|
-
], 34)) : errorMsg.value ? (openBlock(), createElementBlock("div",
|
|
3277
|
+
], 34)) : errorMsg.value ? (openBlock(), createElementBlock("div", _hoisted_42, [
|
|
3039
3278
|
createTextVNode(toDisplayString(t("loadFailed", { message: errorMsg.value })) + " ", 1),
|
|
3040
|
-
/guest/i.test(errorMsg.value) ? (openBlock(), createElementBlock("div",
|
|
3041
|
-
unref(isNetworkError)(errorMsg.value) ? (openBlock(), createElementBlock("div",
|
|
3279
|
+
/guest/i.test(errorMsg.value) ? (openBlock(), createElementBlock("div", _hoisted_43, toDisplayString(t("guestHint")), 1)) : createCommentVNode("v-if", true),
|
|
3280
|
+
unref(isNetworkError)(errorMsg.value) ? (openBlock(), createElementBlock("div", _hoisted_44, toDisplayString(t("corsHint")), 1)) : createCommentVNode("v-if", true),
|
|
3042
3281
|
createElementVNode("button", {
|
|
3043
3282
|
class: "fl-btn",
|
|
3044
3283
|
type: "button",
|
|
3045
3284
|
onClick: loadRoot
|
|
3046
3285
|
}, toDisplayString(t("retry")), 1)
|
|
3047
|
-
])) : visible.value.length === 0 ? (openBlock(), createElementBlock("div",
|
|
3286
|
+
])) : visible.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_45, toDisplayString(t("empty")), 1)) : createCommentVNode("v-if", true),
|
|
3048
3287
|
(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (node, index) => {
|
|
3049
3288
|
return openBlock(), createElementBlock(Fragment, { key: isMore(node) ? `more:${node.key}` : node.path }, [isMore(node) ? (openBlock(), createElementBlock("div", {
|
|
3050
3289
|
key: 0,
|
|
3051
3290
|
class: "fl-row fl-more",
|
|
3052
3291
|
style: normalizeStyle({ "--fl-depth": node.depth })
|
|
3053
|
-
}, [_cache[
|
|
3054
|
-
|
|
3292
|
+
}, [_cache[15] || (_cache[15] = createElementVNode("span", { class: "fl-cell fl-cell-check" }, null, -1)), createElementVNode("span", _hoisted_46, [
|
|
3293
|
+
createCommentVNode(" Reads as one more row of the folder: “⋯” in the type column, the count where names start. "),
|
|
3294
|
+
_cache[12] || (_cache[12] = createElementVNode("span", {
|
|
3055
3295
|
class: "fl-indent",
|
|
3056
3296
|
"aria-hidden": "true"
|
|
3057
3297
|
}, null, -1)),
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3298
|
+
_cache[13] || (_cache[13] = createElementVNode("span", {
|
|
3299
|
+
class: "fl-arrow-placeholder",
|
|
3300
|
+
"aria-hidden": "true"
|
|
3301
|
+
}, null, -1)),
|
|
3302
|
+
_cache[14] || (_cache[14] = createElementVNode("span", {
|
|
3303
|
+
class: "fl-more-tag",
|
|
3304
|
+
"aria-hidden": "true"
|
|
3305
|
+
}, "⋯", -1)),
|
|
3306
|
+
createElementVNode("span", _hoisted_47, toDisplayString(t("moreRemaining", { count: node.remaining })), 1),
|
|
3307
|
+
createElementVNode("span", _hoisted_48, [node.remaining > (__props.pageSize || 0) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("button", {
|
|
3308
|
+
class: "fl-more-link",
|
|
3061
3309
|
type: "button",
|
|
3310
|
+
"aria-label": t("showNext", { count: __props.pageSize }),
|
|
3062
3311
|
onClick: ($event) => showMore(node, false)
|
|
3063
|
-
}, [
|
|
3064
|
-
class: "fl-more-
|
|
3312
|
+
}, [createElementVNode("span", _hoisted_50, toDisplayString(t("showNext", { count: __props.pageSize })), 1), createElementVNode("span", _hoisted_51, toDisplayString(t("showNextShort", { count: __props.pageSize })), 1)], 8, _hoisted_49), createElementVNode("button", {
|
|
3313
|
+
class: "fl-more-link fl-more-all",
|
|
3065
3314
|
type: "button",
|
|
3315
|
+
"aria-label": t("showAll"),
|
|
3066
3316
|
onClick: ($event) => showMore(node, true)
|
|
3067
|
-
}, toDisplayString(t("showAll")),
|
|
3317
|
+
}, [createElementVNode("span", _hoisted_53, toDisplayString(t("showAll")), 1), createElementVNode("span", _hoisted_54, toDisplayString(t("showAllShort")), 1)], 8, _hoisted_52)], 64)) : (openBlock(), createElementBlock("button", {
|
|
3068
3318
|
key: 1,
|
|
3069
|
-
class: "fl-more-
|
|
3319
|
+
class: "fl-more-link fl-more-all",
|
|
3070
3320
|
type: "button",
|
|
3071
3321
|
onClick: ($event) => showMore(node, true)
|
|
3072
|
-
}, toDisplayString(t("showRest", { count: node.remaining })), 9,
|
|
3322
|
+
}, toDisplayString(t("showRest", { count: node.remaining })), 9, _hoisted_55))])
|
|
3073
3323
|
])], 4)) : (openBlock(), createElementBlock("div", {
|
|
3074
3324
|
key: 1,
|
|
3075
3325
|
class: normalizeClass(["fl-row", {
|
|
@@ -3080,21 +3330,22 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
3080
3330
|
"fl-row-prompting": node.lock?.prompting,
|
|
3081
3331
|
"fl-row-error": node.lock?.prompting && !!node.lock.error
|
|
3082
3332
|
}]),
|
|
3083
|
-
style: normalizeStyle({ "--fl-depth": node.depth })
|
|
3333
|
+
style: normalizeStyle({ "--fl-depth": node.depth }),
|
|
3334
|
+
"data-path": node.path
|
|
3084
3335
|
}, [
|
|
3085
|
-
createElementVNode("label",
|
|
3336
|
+
createElementVNode("label", _hoisted_57, [createElementVNode("input", {
|
|
3086
3337
|
type: "checkbox",
|
|
3087
3338
|
disabled: !!node.lock || batchBusy.value,
|
|
3088
3339
|
"aria-label": t("selectItem", { name: node.name }),
|
|
3089
3340
|
checked: isChecked(node),
|
|
3090
3341
|
".indeterminate": isIndeterminate(node),
|
|
3091
3342
|
onChange: ($event) => toggleCheck(node, $event)
|
|
3092
|
-
}, null, 40,
|
|
3343
|
+
}, null, 40, _hoisted_58)]),
|
|
3093
3344
|
createElementVNode("span", {
|
|
3094
3345
|
class: "fl-cell fl-cell-name",
|
|
3095
3346
|
title: node.isRoot ? node.path : void 0
|
|
3096
3347
|
}, [
|
|
3097
|
-
_cache[
|
|
3348
|
+
_cache[17] || (_cache[17] = createElementVNode("span", {
|
|
3098
3349
|
class: "fl-indent",
|
|
3099
3350
|
"aria-hidden": "true"
|
|
3100
3351
|
}, null, -1)),
|
|
@@ -3108,7 +3359,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
3108
3359
|
}, [createVNode(_sfc_main$2, {
|
|
3109
3360
|
name: "lock",
|
|
3110
3361
|
size: 14
|
|
3111
|
-
})], 8,
|
|
3362
|
+
})], 8, _hoisted_60)) : node.is_dir ? (openBlock(), createElementBlock("button", {
|
|
3112
3363
|
key: 1,
|
|
3113
3364
|
class: normalizeClass(["fl-arrow", { "fl-arrow-open": node.expanded }]),
|
|
3114
3365
|
type: "button",
|
|
@@ -3118,27 +3369,27 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
3118
3369
|
}, [createVNode(_sfc_main$2, {
|
|
3119
3370
|
name: "next",
|
|
3120
3371
|
size: 14
|
|
3121
|
-
})], 10,
|
|
3122
|
-
node.is_dir ? (openBlock(), createElementBlock("svg",
|
|
3372
|
+
})], 10, _hoisted_61)) : (openBlock(), createElementBlock("span", _hoisted_62)),
|
|
3373
|
+
node.is_dir ? (openBlock(), createElementBlock("svg", _hoisted_63, [..._cache[16] || (_cache[16] = [createElementVNode("path", { d: "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }, null, -1)])])) : (openBlock(), createElementBlock("span", {
|
|
3123
3374
|
key: 4,
|
|
3124
3375
|
class: "fl-type",
|
|
3125
3376
|
"data-kind": unref(fileKind)(node.name),
|
|
3126
3377
|
"aria-hidden": "true"
|
|
3127
|
-
}, toDisplayString(unref(extOf)(node.name) || "FILE"), 9,
|
|
3128
|
-
createElementVNode("span",
|
|
3378
|
+
}, toDisplayString(unref(extOf)(node.name) || "FILE"), 9, _hoisted_64)),
|
|
3379
|
+
createElementVNode("span", _hoisted_65, [createElementVNode("span", {
|
|
3129
3380
|
class: normalizeClass(["fl-name", { "fl-name-dir": node.is_dir }]),
|
|
3130
3381
|
onClick: ($event) => node.lock || node.is_dir ? toggleExpand(node) : download(node)
|
|
3131
3382
|
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(nameParts(node.name), (part, at) => {
|
|
3132
|
-
return openBlock(), createElementBlock(Fragment, { key: at }, [part.hit ? (openBlock(), createElementBlock("mark",
|
|
3133
|
-
}), 128))], 10,
|
|
3134
|
-
lockedInSearch(node) && !node.lock?.prompting ? (openBlock(), createElementBlock("span",
|
|
3135
|
-
node.is_dir && node.loaded ? (openBlock(), createElementBlock("span",
|
|
3383
|
+
return openBlock(), createElementBlock(Fragment, { key: at }, [part.hit ? (openBlock(), createElementBlock("mark", _hoisted_67, toDisplayString(part.text), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
|
|
3384
|
+
}), 128))], 10, _hoisted_66), createElementVNode("span", _hoisted_68, [!node.is_dir ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(unref(formatSize)(node.size)) + " · " + toDisplayString(unref(formatDate)(node.modified)), 1)], 64)) : node.loaded ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(t("folderItems", { count: statsOf(node).files })) + " · " + toDisplayString(unref(formatSize)(statsOf(node).bytes)), 1)], 64)) : lockedInSearch(node) ? (openBlock(), createElementBlock("span", _hoisted_69, toDisplayString(t("deepLocked")), 1)) : createCommentVNode("v-if", true)])]),
|
|
3385
|
+
lockedInSearch(node) && !node.lock?.prompting ? (openBlock(), createElementBlock("span", _hoisted_70, toDisplayString(t("deepLocked")), 1)) : createCommentVNode("v-if", true),
|
|
3386
|
+
node.is_dir && node.loaded ? (openBlock(), createElementBlock("span", _hoisted_71, toDisplayString(t("folderItems", { count: statsOf(node).files })), 1)) : createCommentVNode("v-if", true),
|
|
3136
3387
|
node.lock?.prompting && node.lock.error ? (openBlock(), createElementBlock("span", {
|
|
3137
3388
|
key: 7,
|
|
3138
3389
|
id: `${unref(uid)}-error-${index}`,
|
|
3139
3390
|
class: "fl-unlock-message",
|
|
3140
3391
|
role: "alert"
|
|
3141
|
-
}, toDisplayString(unlockErrorText(node.lock.error)), 9,
|
|
3392
|
+
}, toDisplayString(unlockErrorText(node.lock.error)), 9, _hoisted_72)) : createCommentVNode("v-if", true),
|
|
3142
3393
|
!node.lock && unref(remembered).has(node.path) ? (openBlock(), createElementBlock("button", {
|
|
3143
3394
|
key: 8,
|
|
3144
3395
|
class: "fl-remembered",
|
|
@@ -3149,9 +3400,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
3149
3400
|
}, [createVNode(_sfc_main$2, {
|
|
3150
3401
|
name: "key",
|
|
3151
3402
|
size: 11
|
|
3152
|
-
}), createTextVNode(" " + toDisplayString(t("remembered")) + " · " + toDisplayString(t("forgetPassword")), 1)], 8,
|
|
3153
|
-
node.loading ? (openBlock(), createElementBlock("span",
|
|
3154
|
-
], 8,
|
|
3403
|
+
}), createTextVNode(" " + toDisplayString(t("remembered")) + " · " + toDisplayString(t("forgetPassword")), 1)], 8, _hoisted_73)) : createCommentVNode("v-if", true),
|
|
3404
|
+
node.loading ? (openBlock(), createElementBlock("span", _hoisted_74, "…")) : createCommentVNode("v-if", true)
|
|
3405
|
+
], 8, _hoisted_59),
|
|
3155
3406
|
node.lock?.prompting ? (openBlock(), createElementBlock("form", {
|
|
3156
3407
|
key: 0,
|
|
3157
3408
|
class: "fl-unlock fl-unlock-row",
|
|
@@ -3172,7 +3423,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
3172
3423
|
"aria-label": t("passwordFor", { name: node.name }),
|
|
3173
3424
|
"aria-invalid": !!node.lock.error,
|
|
3174
3425
|
"aria-describedby": node.lock.error ? `${unref(uid)}-error-${index}` : void 0
|
|
3175
|
-
}, null, 8,
|
|
3426
|
+
}, null, 8, _hoisted_76), [[vModelText, node.lock.input]]),
|
|
3176
3427
|
canRemember.value ? (openBlock(), createElementBlock("button", {
|
|
3177
3428
|
key: 0,
|
|
3178
3429
|
class: "fl-unlock-remember",
|
|
@@ -3181,12 +3432,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
3181
3432
|
"aria-label": t("rememberPassword"),
|
|
3182
3433
|
title: t("rememberPassword"),
|
|
3183
3434
|
onClick: ($event) => node.lock.remember = !node.lock.remember
|
|
3184
|
-
}, [createVNode(_sfc_main$2, { name: "key" })], 8,
|
|
3435
|
+
}, [createVNode(_sfc_main$2, { name: "key" })], 8, _hoisted_77)) : createCommentVNode("v-if", true),
|
|
3185
3436
|
createElementVNode("button", {
|
|
3186
3437
|
class: "fl-unlock-submit",
|
|
3187
3438
|
type: "submit",
|
|
3188
3439
|
disabled: node.lock.busy || !node.lock.input
|
|
3189
|
-
}, toDisplayString(t("open")), 9,
|
|
3440
|
+
}, toDisplayString(t("open")), 9, _hoisted_78),
|
|
3190
3441
|
createElementVNode("button", {
|
|
3191
3442
|
class: "fl-unlock-cancel",
|
|
3192
3443
|
type: "button",
|
|
@@ -3196,11 +3447,11 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
3196
3447
|
}, [createVNode(_sfc_main$2, {
|
|
3197
3448
|
name: "close",
|
|
3198
3449
|
size: 14
|
|
3199
|
-
})], 8,
|
|
3200
|
-
], 40,
|
|
3201
|
-
createElementVNode("span",
|
|
3202
|
-
createElementVNode("span",
|
|
3203
|
-
createElementVNode("span",
|
|
3450
|
+
})], 8, _hoisted_79)
|
|
3451
|
+
], 40, _hoisted_75)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3452
|
+
createElementVNode("span", _hoisted_80, toDisplayString(node.is_dir ? "—" : unref(formatSize)(node.size)), 1),
|
|
3453
|
+
createElementVNode("span", _hoisted_81, toDisplayString(unref(formatDate)(node.modified)), 1),
|
|
3454
|
+
createElementVNode("span", _hoisted_82, [node.lock ? (openBlock(), createElementBlock("button", {
|
|
3204
3455
|
key: 0,
|
|
3205
3456
|
class: "fl-action fl-arrow-end fl-lock",
|
|
3206
3457
|
type: "button",
|
|
@@ -3209,7 +3460,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
3209
3460
|
}, [createVNode(_sfc_main$2, {
|
|
3210
3461
|
name: "lock",
|
|
3211
3462
|
size: 18
|
|
3212
|
-
})], 8,
|
|
3463
|
+
})], 8, _hoisted_83)) : node.is_dir ? (openBlock(), createElementBlock("button", {
|
|
3213
3464
|
key: 1,
|
|
3214
3465
|
class: normalizeClass(["fl-action fl-arrow-end", { "fl-arrow-open": node.expanded }]),
|
|
3215
3466
|
type: "button",
|
|
@@ -3219,24 +3470,24 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
3219
3470
|
}, [createVNode(_sfc_main$2, {
|
|
3220
3471
|
name: "next",
|
|
3221
3472
|
size: 18
|
|
3222
|
-
})], 10,
|
|
3473
|
+
})], 10, _hoisted_84)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [canPreview(node) ? (openBlock(), createElementBlock("button", {
|
|
3223
3474
|
key: 0,
|
|
3224
3475
|
class: "fl-action fl-preview-btn",
|
|
3225
3476
|
type: "button",
|
|
3226
3477
|
"aria-label": `${t("preview")} ${node.name}`,
|
|
3227
3478
|
title: t("preview"),
|
|
3228
3479
|
onClick: ($event) => preview(node)
|
|
3229
|
-
}, [createVNode(_sfc_main$2, { name: "eye" })], 8,
|
|
3480
|
+
}, [createVNode(_sfc_main$2, { name: "eye" })], 8, _hoisted_85)) : createCommentVNode("v-if", true), createElementVNode("button", {
|
|
3230
3481
|
class: "fl-action fl-download",
|
|
3231
3482
|
type: "button",
|
|
3232
3483
|
"aria-label": `${t("download")} ${node.name}`,
|
|
3233
3484
|
title: t("download"),
|
|
3234
3485
|
onClick: ($event) => download(node)
|
|
3235
|
-
}, [createVNode(_sfc_main$2, { name: "download" })], 8,
|
|
3486
|
+
}, [createVNode(_sfc_main$2, { name: "download" })], 8, _hoisted_86)], 64))])
|
|
3236
3487
|
], 64))
|
|
3237
|
-
],
|
|
3488
|
+
], 14, _hoisted_56))], 64);
|
|
3238
3489
|
}), 128)),
|
|
3239
|
-
deepRow.value ? (openBlock(), createElementBlock("div",
|
|
3490
|
+
deepRow.value ? (openBlock(), createElementBlock("div", _hoisted_87, [createElementVNode("div", _hoisted_88, [deepRow.value === "running" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(t("deepRunning", { count: folderCounts.value.checked })) + " · ", 1), createElementVNode("button", {
|
|
3240
3491
|
class: "fl-deep-link",
|
|
3241
3492
|
type: "button",
|
|
3242
3493
|
onClick: pauseDeepSearch
|
|
@@ -3248,9 +3499,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
3248
3499
|
class: "fl-deep-link",
|
|
3249
3500
|
type: "button",
|
|
3250
3501
|
onClick: deepSearch
|
|
3251
|
-
}, toDisplayString(t("deepContinue")), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [createTextVNode(toDisplayString(deepSummary.value), 1)], 64))]), deepRow.value === "running" ? (openBlock(), createElementBlock("span",
|
|
3252
|
-
createElementVNode("div",
|
|
3253
|
-
toast.value ? (openBlock(), createElementBlock("div",
|
|
3502
|
+
}, toDisplayString(t("deepContinue")), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [createTextVNode(toDisplayString(deepSummary.value), 1)], 64))]), deepRow.value === "running" ? (openBlock(), createElementBlock("span", _hoisted_89)) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true),
|
|
3503
|
+
createElementVNode("div", _hoisted_90, [createElementVNode("span", null, toDisplayString(t("loaded", { count: allFiles.value.length })) + " · " + toDisplayString(t("totalSize", { size: unref(formatSize)(unref(totalSize)(allFiles.value)) })), 1)]),
|
|
3504
|
+
toast.value ? (openBlock(), createElementBlock("div", _hoisted_91, toDisplayString(toast.value), 1)) : createCommentVNode("v-if", true),
|
|
3254
3505
|
createVNode(_sfc_main$3, {
|
|
3255
3506
|
open: !!zipDialog.value,
|
|
3256
3507
|
title: zipDialog.value?.title ?? "",
|
|
@@ -3259,7 +3510,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
3259
3510
|
"confirm-label": zipDialog.value?.confirm,
|
|
3260
3511
|
"cancel-label": zipDialog.value?.cancel ?? "",
|
|
3261
3512
|
onConfirm: confirmZip,
|
|
3262
|
-
onClose: _cache[
|
|
3513
|
+
onClose: _cache[6] || (_cache[6] = ($event) => zipNotice.value = null)
|
|
3263
3514
|
}, null, 8, [
|
|
3264
3515
|
"open",
|
|
3265
3516
|
"title",
|
|
@@ -3276,13 +3527,13 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
3276
3527
|
viewer: previewViewer.value,
|
|
3277
3528
|
resolving: previewResolving.value,
|
|
3278
3529
|
error: previewError.value,
|
|
3279
|
-
demo: demo.value,
|
|
3530
|
+
demo: demo.value && !!previewNode.value && !unref(isDemoFile)(previewNode.value.path),
|
|
3280
3531
|
position: previewPosition.value,
|
|
3281
3532
|
total: previewPosition.value ? previewList.value.length : 0,
|
|
3282
3533
|
onClose: closePreview,
|
|
3283
|
-
onPrev: _cache[
|
|
3284
|
-
onNext: _cache[
|
|
3285
|
-
onDownload: _cache[
|
|
3534
|
+
onPrev: _cache[7] || (_cache[7] = ($event) => stepPreview(-1)),
|
|
3535
|
+
onNext: _cache[8] || (_cache[8] = ($event) => stepPreview(1)),
|
|
3536
|
+
onDownload: _cache[9] || (_cache[9] = ($event) => previewNode.value && download(previewNode.value))
|
|
3286
3537
|
}, null, 8, [
|
|
3287
3538
|
"open",
|
|
3288
3539
|
"file",
|