@infekted11/stillnote 1.4.0 → 1.4.5
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/assets/{index-DjzwetQo.js → index-BoJuh0AQ.js} +225 -231
- package/dist/assets/{index-CDsStAt1.css → index-CrLtSFMC.css} +1 -1
- package/dist/assets/{whisper-worker-DcYN39bN.js → whisper-worker-CKCkC8xV.js} +1 -1
- package/dist/index.html +2 -2
- package/electron/main.cjs +9 -0
- package/electron/preload.cjs +5 -0
- package/package.json +1 -1
package/dist/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<meta name="theme-color" content="#f7f7f5" />
|
|
7
7
|
<title>Stillnote</title>
|
|
8
|
-
<script type="module" crossorigin src="./assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
8
|
+
<script type="module" crossorigin src="./assets/index-BoJuh0AQ.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="./assets/index-CrLtSFMC.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="app"></div>
|
package/electron/main.cjs
CHANGED
|
@@ -306,6 +306,7 @@ async function updateMovedFileLinks(oldPath, newPath) {
|
|
|
306
306
|
for (const [target, original] of written.reverse()) await fs.writeFile(target, original, 'utf8');
|
|
307
307
|
throw error;
|
|
308
308
|
}
|
|
309
|
+
mainWindow?.webContents.send('vault:links-updated', moves);
|
|
309
310
|
}
|
|
310
311
|
|
|
311
312
|
async function walkMarkdown(dir, base = '') {
|
|
@@ -671,6 +672,12 @@ function registerIpc() {
|
|
|
671
672
|
await fs.rename(target, backup);
|
|
672
673
|
try { await fs.rename(temporary, destination); }
|
|
673
674
|
catch (error) { await fs.rename(backup, target).catch(() => {}); throw error; }
|
|
675
|
+
try { await updateMovedFileLinks(relativePath, path.relative(vaultPath, destination).split(path.sep).join('/')); }
|
|
676
|
+
catch (error) {
|
|
677
|
+
await fs.rm(destination, { force: true });
|
|
678
|
+
await fs.rename(backup, target);
|
|
679
|
+
throw error;
|
|
680
|
+
}
|
|
674
681
|
await fs.rm(backup, { force: true }).catch(() => {});
|
|
675
682
|
} finally { await fs.rm(temporary, { force: true }).catch(() => {}); }
|
|
676
683
|
} else {
|
|
@@ -680,6 +687,8 @@ function registerIpc() {
|
|
|
680
687
|
try { await fs.rename(temporary, destination); }
|
|
681
688
|
catch (error) { await fs.rename(temporary, target).catch(() => {}); throw error; }
|
|
682
689
|
} else await fs.rename(target, destination);
|
|
690
|
+
try { await updateMovedFileLinks(relativePath, path.relative(vaultPath, destination).split(path.sep).join('/')); }
|
|
691
|
+
catch (error) { await fs.rename(destination, target); throw error; }
|
|
683
692
|
}
|
|
684
693
|
}
|
|
685
694
|
return path.relative(vaultPath, destination).split(path.sep).join('/');
|
package/electron/preload.cjs
CHANGED
|
@@ -34,6 +34,11 @@ contextBridge.exposeInMainWorld('stillnote', {
|
|
|
34
34
|
getBacklinks: (path) => ipcRenderer.invoke('vault:backlinks', path),
|
|
35
35
|
copyFileLink: (path) => ipcRenderer.invoke('vault:copy-link', path),
|
|
36
36
|
resetUnreadableCredentials: () => ipcRenderer.invoke('credentials:reset-unreadable'),
|
|
37
|
+
onFileLinksUpdated: (listener) => {
|
|
38
|
+
const handler = (_event, moves) => listener(moves);
|
|
39
|
+
ipcRenderer.on('vault:links-updated', handler);
|
|
40
|
+
return () => ipcRenderer.removeListener('vault:links-updated', handler);
|
|
41
|
+
},
|
|
37
42
|
onStorageRecovered: (listener) => {
|
|
38
43
|
const handler = (_event, kind) => listener(kind);
|
|
39
44
|
ipcRenderer.on('storage:recovered', handler);
|