@bobfrankston/rmfmail 1.2.244 → 1.2.246
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/bin/mailx.js +59 -4
- package/bin/mailx.js.map +1 -1
- package/bin/mailx.ts +55 -5
- package/client/app.bundle.js +2 -2
- package/client/app.bundle.js.map +2 -2
- package/client/compose/compose.bundle.js +3 -3
- package/client/compose/compose.bundle.js.map +2 -2
- package/client/compose/compose.js +5 -1
- package/client/compose/compose.js.map +1 -1
- package/client/compose/compose.ts +5 -1
- package/client/lib/api-client.js +2 -2
- package/client/lib/api-client.js.map +1 -1
- package/client/lib/api-client.ts +2 -2
- package/client/lib/mailxapi.js +2 -2
- package/package.json +3 -3
- package/packages/mailx-imap/index.d.ts.map +1 -1
- package/packages/mailx-imap/index.js +15 -1
- package/packages/mailx-imap/index.js.map +1 -1
- package/packages/mailx-imap/index.ts +16 -1
- package/packages/mailx-imap/package-lock.json +2 -2
- package/packages/mailx-imap/package.json +1 -1
- package/packages/mailx-imap/test/rate-limit-backoff.test.mjs +22 -0
- package/packages/mailx-service/index.d.ts +1 -1
- package/packages/mailx-service/index.d.ts.map +1 -1
- package/packages/mailx-service/index.js +7 -4
- package/packages/mailx-service/index.js.map +1 -1
- package/packages/mailx-service/index.ts +7 -4
- package/packages/mailx-service/jsonrpc.js +1 -1
- package/packages/mailx-service/jsonrpc.js.map +1 -1
- package/packages/mailx-service/jsonrpc.ts +1 -1
- package/packages/mailx-store/store.d.ts.map +1 -1
- package/packages/mailx-store/store.js +21 -2
- package/packages/mailx-store/store.js.map +1 -1
- package/packages/mailx-store/store.ts +19 -2
- /package/packages/mailx-imap/{node_modules.npmglobalize-stash-55392 → node_modules.npmglobalize-stash-74296}/.package-lock.json +0 -0
package/bin/mailx.ts
CHANGED
|
@@ -2810,13 +2810,63 @@ RFC 5322 with CRLF line endings. Bodies are quoted-printable encoded (readable i
|
|
|
2810
2810
|
});
|
|
2811
2811
|
// Word (or the document) closed — the external edit is over. THIS is the
|
|
2812
2812
|
// moment to bring rmfmail forward, replacing the old per-save focus grab.
|
|
2813
|
-
imapManager.on("wordEditClosed", (payload: { editId: string; fromPopout?: boolean }) => {
|
|
2813
|
+
imapManager.on("wordEditClosed", (payload: { editId: string; fromPopout?: boolean; popoutId?: string }) => {
|
|
2814
2814
|
handle.send({ _event: "wordEditClosed", type: "wordEditClosed", ...payload });
|
|
2815
|
-
//
|
|
2816
|
-
//
|
|
2817
|
-
//
|
|
2818
|
-
|
|
2815
|
+
// Coming back from Word, the window you were editing has to be the one
|
|
2816
|
+
// in front — otherwise the edit lands in a window buried behind
|
|
2817
|
+
// whatever Word was covering (Bob 2026-08-10).
|
|
2818
|
+
//
|
|
2819
|
+
// In-window compose: raise the main window through the service pipe,
|
|
2820
|
+
// which msger consumes natively (msger 0.1.407).
|
|
2821
|
+
if (!payload.popoutId) { handle.send({ _msgerWindow: "focus" }); return; }
|
|
2822
|
+
// Popout compose: a separate OS window. msger's MessageBoxHandle
|
|
2823
|
+
// exposes result/pid/close and no control channel — its stdin is
|
|
2824
|
+
// closed right after the options are written — so there is nothing to
|
|
2825
|
+
// send a focus command to. Raise it by process instead. Windows-only
|
|
2826
|
+
// and deliberately so: this is the same platform-gated corner as the
|
|
2827
|
+
// Word autosave sidecar, and Edit-in-Word is a Windows/Mac feature.
|
|
2828
|
+
// A msger-side focus() would be the tidier home for this and is worth
|
|
2829
|
+
// doing when msger is next opened.
|
|
2830
|
+
const h = popoutWindows.get(`compose|${payload.popoutId}`);
|
|
2831
|
+
const pid = (h as any)?.pid;
|
|
2832
|
+
if (!pid) { console.log(` [word-edit] popout ${payload.popoutId} has no live window to raise`); return; }
|
|
2833
|
+
if (process.platform !== "win32") return;
|
|
2834
|
+
void raiseWindowByPid(pid);
|
|
2819
2835
|
});
|
|
2836
|
+
/** Bring the main window of a process to the foreground (Windows).
|
|
2837
|
+
* Uses the documented AllowSetForegroundWindow → SetForegroundWindow
|
|
2838
|
+
* dance rather than a bare SetForegroundWindow, which Windows ignores
|
|
2839
|
+
* for a process that does not own the foreground — the same reason
|
|
2840
|
+
* msger's own focusOnCreate does it that way. Best-effort: a failure
|
|
2841
|
+
* leaves the window where it is and is logged, never thrown. */
|
|
2842
|
+
async function raiseWindowByPid(pid: number): Promise<void> {
|
|
2843
|
+
const ps = [
|
|
2844
|
+
"$ErrorActionPreference='Stop'",
|
|
2845
|
+
"Add-Type @'",
|
|
2846
|
+
"using System;using System.Runtime.InteropServices;",
|
|
2847
|
+
"public class RmfFg{",
|
|
2848
|
+
"[DllImport(\"user32.dll\")] public static extern bool SetForegroundWindow(IntPtr h);",
|
|
2849
|
+
"[DllImport(\"user32.dll\")] public static extern bool ShowWindow(IntPtr h,int c);",
|
|
2850
|
+
"[DllImport(\"user32.dll\")] public static extern bool AllowSetForegroundWindow(int p);",
|
|
2851
|
+
"}",
|
|
2852
|
+
"'@",
|
|
2853
|
+
`$p = Get-Process -Id ${pid} -ErrorAction SilentlyContinue`,
|
|
2854
|
+
"if ($p -and $p.MainWindowHandle -ne 0) {",
|
|
2855
|
+
` [RmfFg]::AllowSetForegroundWindow(${pid}) | Out-Null`,
|
|
2856
|
+
" [RmfFg]::ShowWindow($p.MainWindowHandle, 9) | Out-Null", // SW_RESTORE
|
|
2857
|
+
" [RmfFg]::SetForegroundWindow($p.MainWindowHandle) | Out-Null",
|
|
2858
|
+
"}",
|
|
2859
|
+
].join("\n");
|
|
2860
|
+
try {
|
|
2861
|
+
const { spawn } = await import("node:child_process");
|
|
2862
|
+
const child = spawn("powershell", ["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", ps],
|
|
2863
|
+
{ detached: false, stdio: "ignore", windowsHide: true });
|
|
2864
|
+
child.on("error", (e: any) => console.log(` [word-edit] could not raise compose window: ${e?.message || e}`));
|
|
2865
|
+
} catch (e: any) {
|
|
2866
|
+
console.log(` [word-edit] raise failed: ${e?.message || e}`);
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2820
2870
|
// Cloud-write/read failures from mailx-settings → push to UI as a banner so
|
|
2821
2871
|
// silent fall-back-to-local can no longer swallow Drive errors.
|
|
2822
2872
|
const { onCloudError } = await import("@bobfrankston/mailx-settings");
|
package/client/app.bundle.js
CHANGED
|
@@ -614,8 +614,8 @@ function readConfigHelp(name) {
|
|
|
614
614
|
function unsubscribeOneClick(url) {
|
|
615
615
|
return ipc().unsubscribeOneClick?.(url);
|
|
616
616
|
}
|
|
617
|
-
function openInWord(editId, html,
|
|
618
|
-
return ipc().openInWord?.(editId, html,
|
|
617
|
+
function openInWord(editId, html, popoutId = "") {
|
|
618
|
+
return ipc().openInWord?.(editId, html, popoutId) ?? Promise.resolve({ ok: false, path: "", opener: "none" });
|
|
619
619
|
}
|
|
620
620
|
function closeWordEdit(editId) {
|
|
621
621
|
return ipc().closeWordEdit?.(editId) ?? Promise.resolve();
|