@bobfrankston/rmfmail 1.1.65 → 1.1.68
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/client/app.bundle.js +17 -1
- package/client/app.bundle.js.map +2 -2
- package/client/app.js +23 -2
- package/client/app.js.map +1 -1
- package/client/app.ts +19 -2
- package/client/compose/compose.bundle.js +4 -0
- package/client/compose/compose.bundle.js.map +2 -2
- package/client/compose/compose.js +11 -0
- package/client/compose/compose.js.map +1 -1
- package/client/compose/compose.ts +11 -0
- package/package.json +3 -3
- /package/packages/mailx-imap/{node_modules.npmglobalize-stash-13452 → node_modules.npmglobalize-stash-57412}/.package-lock.json +0 -0
package/client/app.ts
CHANGED
|
@@ -3512,7 +3512,7 @@ document.getElementById("btn-open-log")?.addEventListener("click", async () => {
|
|
|
3512
3512
|
});
|
|
3513
3513
|
|
|
3514
3514
|
async function openJsoncEditor(initialFile: string): Promise<void> {
|
|
3515
|
-
const { readJsoncFile, writeJsoncFile, readConfigHelp, formatJsonc } = await import("./lib/api-client.js");
|
|
3515
|
+
const { readJsoncFile, writeJsoncFile, readConfigHelp, formatJsonc, openLocalPath } = await import("./lib/api-client.js");
|
|
3516
3516
|
|
|
3517
3517
|
const backdrop = document.createElement("div");
|
|
3518
3518
|
backdrop.className = "mailx-modal-backdrop";
|
|
@@ -3549,6 +3549,7 @@ async function openJsoncEditor(initialFile: string): Promise<void> {
|
|
|
3549
3549
|
<div class="mailx-modal-error" id="jsonc-error" hidden></div>
|
|
3550
3550
|
<div class="mailx-modal-buttons">
|
|
3551
3551
|
<button type="button" class="mailx-modal-btn" data-action="format" title="Reformat indentation while preserving comments and trailing commas">Format</button>
|
|
3552
|
+
<button type="button" class="mailx-modal-btn" data-action="opensource" id="jsonc-opensource" title="Open the folder containing config.jsonc so you can edit it in a full editor" hidden>Open source folder</button>
|
|
3552
3553
|
<span class="mailx-modal-spacer"></span>
|
|
3553
3554
|
<button type="button" class="mailx-modal-btn" data-action="cancel">Cancel</button>
|
|
3554
3555
|
<button type="button" class="mailx-modal-btn mailx-modal-btn-primary" data-action="save">Save</button>
|
|
@@ -3664,8 +3665,17 @@ async function openJsoncEditor(initialFile: string): Promise<void> {
|
|
|
3664
3665
|
errorEl.hidden = false;
|
|
3665
3666
|
}
|
|
3666
3667
|
};
|
|
3668
|
+
// "Open source folder" — only meaningful for config.jsonc, the one
|
|
3669
|
+
// file that lives on the local disk (~/.rmfmail/config.jsonc). The
|
|
3670
|
+
// others are Google Drive objects with no local path, so the button
|
|
3671
|
+
// is hidden for them. Lets the user edit config.jsonc in a real editor
|
|
3672
|
+
// instead of the modal textarea.
|
|
3673
|
+
const openSourceBtn = panel.querySelector<HTMLButtonElement>("#jsonc-opensource")!;
|
|
3674
|
+
const updateOpenSource = () => { openSourceBtn.hidden = fileSelect.value !== "config.jsonc"; };
|
|
3675
|
+
updateOpenSource();
|
|
3676
|
+
|
|
3667
3677
|
await Promise.all([loadFile(), loadHelp()]);
|
|
3668
|
-
fileSelect.addEventListener("change", () => { loadFile(); loadHelp(); });
|
|
3678
|
+
fileSelect.addEventListener("change", () => { loadFile(); loadHelp(); updateOpenSource(); });
|
|
3669
3679
|
|
|
3670
3680
|
const close = () => {
|
|
3671
3681
|
if (validateTimer) window.clearTimeout(validateTimer);
|
|
@@ -3682,6 +3692,13 @@ async function openJsoncEditor(initialFile: string): Promise<void> {
|
|
|
3682
3692
|
btn.addEventListener("click", async () => {
|
|
3683
3693
|
const action = btn.dataset.action;
|
|
3684
3694
|
if (action === "cancel") { close(); return; }
|
|
3695
|
+
if (action === "opensource") {
|
|
3696
|
+
// Reveal ~/.rmfmail/ in the OS file manager — config.jsonc
|
|
3697
|
+
// sits there; the user can then open it in a full editor.
|
|
3698
|
+
try { await openLocalPath("config"); }
|
|
3699
|
+
catch (e: any) { errorEl.textContent = `Couldn't open folder: ${e?.message || e}`; errorEl.hidden = false; }
|
|
3700
|
+
return;
|
|
3701
|
+
}
|
|
3685
3702
|
if (action === "format") {
|
|
3686
3703
|
// Reformat via the service-side jsonc-parser format() — the
|
|
3687
3704
|
// edits are whitespace-only, so `//` and `/* */` comments
|
|
@@ -4618,6 +4618,10 @@ document.addEventListener("keydown", (e) => {
|
|
|
4618
4618
|
}
|
|
4619
4619
|
if (e.key === "Escape") {
|
|
4620
4620
|
if (Date.now() - attachJustClicked < 1500) return;
|
|
4621
|
+
const t = e.target;
|
|
4622
|
+
if (t && typeof t.closest === "function" && t.closest('.mailx-modal-backdrop, .tox-dialog, [role="dialog"]')) {
|
|
4623
|
+
return;
|
|
4624
|
+
}
|
|
4621
4625
|
e.preventDefault();
|
|
4622
4626
|
handleCloseRequest();
|
|
4623
4627
|
}
|