@evandu/super-pi 0.1.284 → 0.1.285
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/dist/.super-pi-check-inputs.json +2 -2
- package/dist/client/.super-pi-client-sources.json +3 -3
- package/dist/client/assets/{CodeMirrorEditor-6_hCAYhn.js → CodeMirrorEditor-zoNEpI2I.js} +1 -1
- package/dist/client/assets/{GitDiffEditor-VvD8axSx.js → GitDiffEditor-B8XFlAKh.js} +1 -1
- package/dist/client/assets/{index-IafH0r-m.js → index-l_Knh78R.js} +23 -23
- package/dist/client/index.html +1 -1
- package/dist/server/explicit-file-open.js +4 -6
- package/package.json +1 -1
package/dist/client/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="alternate icon" href="/favicon.ico" />
|
|
9
9
|
<link rel="apple-touch-icon" href="/favicon.svg" />
|
|
10
10
|
<title>Super Pi</title>
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-l_Knh78R.js"></script>
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
|
|
13
13
|
<link rel="stylesheet" crossorigin href="/assets/index-CMb8f0dS.css">
|
|
14
14
|
</head>
|
|
@@ -23,13 +23,10 @@ async function selectedFile(workspace, root, input) {
|
|
|
23
23
|
const name = posix.basename(relative);
|
|
24
24
|
if (!name || name === "." || name === "..")
|
|
25
25
|
throw new FilesError(400, "请选择一个文件。", "not_a_file");
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
if (explorerInternalPath(toRelative(workspace, file))) {
|
|
26
|
+
const file = resolve(root, relative);
|
|
27
|
+
if (contains(resolve(workspace), file) && explorerInternalPath(toRelative(workspace, file))) {
|
|
29
28
|
throw new FilesError(403, "不能直接访问应用的回收目录。", "protected_path");
|
|
30
29
|
}
|
|
31
|
-
if (!(await lstat(file)).isSymbolicLink())
|
|
32
|
-
await explorerPath(workspace, root, relative);
|
|
33
30
|
return file;
|
|
34
31
|
}
|
|
35
32
|
async function readOpenedFile(path) {
|
|
@@ -78,7 +75,8 @@ export function createExplicitFileOpen() {
|
|
|
78
75
|
if (contains(canonicalRoot, path)) {
|
|
79
76
|
const scoped = toRelative(canonicalRoot, path);
|
|
80
77
|
await explorerPath(workspace, root, scoped);
|
|
81
|
-
|
|
78
|
+
const displayPath = contains(resolve(root), selected) ? toRelative(root, selected) : scoped;
|
|
79
|
+
return { path: displayPath, name: basename(selected), ...await readOpenedFile(path) };
|
|
82
80
|
}
|
|
83
81
|
const contents = await readOpenedFile(path);
|
|
84
82
|
const ticket = randomUUID();
|