@bobfrankston/rmfmail 1.2.251 → 1.2.253

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.
Files changed (60) hide show
  1. package/bin/mailx.js +20 -0
  2. package/bin/mailx.js.map +1 -1
  3. package/bin/mailx.ts +21 -0
  4. package/client/android-bootstrap.bundle.js +27 -30
  5. package/client/android-bootstrap.bundle.js.map +2 -2
  6. package/client/app.bundle.js +33 -1
  7. package/client/app.bundle.js.map +3 -3
  8. package/client/app.js +42 -0
  9. package/client/app.js.map +1 -1
  10. package/client/app.ts +40 -0
  11. package/client/components/message-viewer.js +13 -2
  12. package/client/components/message-viewer.js.map +1 -1
  13. package/client/components/message-viewer.ts +13 -2
  14. package/client/compose/compose.bundle.js +37 -3
  15. package/client/compose/compose.bundle.js.map +3 -3
  16. package/client/compose/compose.css +13 -0
  17. package/client/compose/compose.js +41 -1
  18. package/client/compose/compose.js.map +1 -1
  19. package/client/compose/compose.ts +38 -1
  20. package/client/lib/api-client.js +7 -0
  21. package/client/lib/api-client.js.map +1 -1
  22. package/client/lib/api-client.ts +8 -0
  23. package/client/lib/mailxapi.js +10 -2
  24. package/package.json +3 -3
  25. package/packages/mailx-imap/package-lock.json +2 -2
  26. package/packages/mailx-imap/package.json +1 -1
  27. package/packages/mailx-service/ai-usage.d.ts +32 -0
  28. package/packages/mailx-service/ai-usage.d.ts.map +1 -0
  29. package/packages/mailx-service/ai-usage.js +98 -0
  30. package/packages/mailx-service/ai-usage.js.map +1 -0
  31. package/packages/mailx-service/ai-usage.ts +110 -0
  32. package/packages/mailx-service/index.d.ts +25 -1
  33. package/packages/mailx-service/index.d.ts.map +1 -1
  34. package/packages/mailx-service/index.js +91 -4
  35. package/packages/mailx-service/index.js.map +1 -1
  36. package/packages/mailx-service/index.ts +94 -4
  37. package/packages/mailx-service/jsonrpc.js +3 -1
  38. package/packages/mailx-service/jsonrpc.js.map +1 -1
  39. package/packages/mailx-service/jsonrpc.ts +3 -1
  40. package/packages/mailx-service/package.json +1 -1
  41. package/packages/mailx-settings/package.json +1 -1
  42. package/packages/mailx-store/package.json +1 -1
  43. package/packages/mailx-store-web/android-bootstrap.js +1 -1
  44. package/packages/mailx-store-web/android-bootstrap.js.map +1 -1
  45. package/packages/mailx-store-web/android-bootstrap.ts +1 -1
  46. package/packages/mailx-store-web/package.json +1 -1
  47. package/packages/mailx-store-web/web-service.d.ts +5 -1
  48. package/packages/mailx-store-web/web-service.d.ts.map +1 -1
  49. package/packages/mailx-store-web/web-service.js +5 -1
  50. package/packages/mailx-store-web/web-service.js.map +1 -1
  51. package/packages/mailx-store-web/web-service.ts +5 -1
  52. package/packages/mailx-types/mailx-api.d.ts +17 -1
  53. package/packages/mailx-types/mailx-api.d.ts.map +1 -1
  54. package/packages/mailx-types/mailx-api.ts +10 -1
  55. package/packages/mailx-types/mime-build.d.ts.map +1 -1
  56. package/packages/mailx-types/mime-build.js +35 -30
  57. package/packages/mailx-types/mime-build.js.map +1 -1
  58. package/packages/mailx-types/mime-build.ts +44 -32
  59. package/packages/mailx-types/package.json +1 -1
  60. /package/packages/mailx-imap/{node_modules.npmglobalize-stash-83100 → node_modules.npmglobalize-stash-54924}/.package-lock.json +0 -0
package/client/app.js CHANGED
@@ -4620,6 +4620,22 @@ function closeToolbarDropdowns() {
4620
4620
  hideDropdownHard(dd);
4621
4621
  }
4622
4622
  }
4623
+ // Clicking in the MESSAGE PREVIEW left the menu open. The preview body is an
4624
+ // iframe, so its pointerdown never reaches this document's capture-phase
4625
+ // listener above — and the transparent shield that solves this is only built
4626
+ // when a compose/popout overlay exists, which the plain three-pane view has
4627
+ // none of. Half the window is that iframe, so "click outside the settings
4628
+ // menu but it does not go away" was the common case (Bob 2026-08-11).
4629
+ // The iframe already posts `iframePointerDown` for the context menu's benefit;
4630
+ // listen to the same signal instead of shielding the whole viewport (a shield
4631
+ // would eat the click that should also select a row).
4632
+ window.addEventListener("message", (e) => {
4633
+ if (e.data?.type !== "iframePointerDown")
4634
+ return;
4635
+ closeToolbarDropdowns();
4636
+ document.getElementById("rail-menu-backdrop")?.remove();
4637
+ refreshToolbarOverlayShield();
4638
+ });
4623
4639
  function refreshToolbarOverlayShield() {
4624
4640
  const dropdownOpen = ["settings-dropdown", "view-dropdown", "restart-dropdown"]
4625
4641
  .some(id => {
@@ -6494,6 +6510,32 @@ document.addEventListener("mailx-popout-message", (async (e) => {
6494
6510
  draftFolderId: msg.folderId,
6495
6511
  draftId: msg.mailxDraftId || "",
6496
6512
  };
6513
+ // Reopening a draft must bring its attachments back into compose,
6514
+ // exactly as forward / edit-as-new do. Drafts had none to bring until
6515
+ // saveDraft started including them (2026-08-11); without this, editing
6516
+ // a draft and re-saving would strip the files a second time.
6517
+ if (Array.isArray(msg.attachments) && msg.attachments.length) {
6518
+ const loaded = [];
6519
+ for (const att of msg.attachments) {
6520
+ try {
6521
+ const data = await getAttachment(accountId, msg.uid, att.id, msg.folderId);
6522
+ if (data?.content) {
6523
+ loaded.push({
6524
+ filename: data.filename || att.filename || "attachment",
6525
+ mimeType: data.contentType || att.contentType || "application/octet-stream",
6526
+ dataBase64: data.content,
6527
+ });
6528
+ }
6529
+ }
6530
+ catch (e) {
6531
+ // Loud: a dropped attachment here means the next autosave
6532
+ // writes a draft without it.
6533
+ console.error(`[compose] edit draft: failed to load attachment ${att.id} ("${att.filename}"): ${e?.message || e}`);
6534
+ }
6535
+ }
6536
+ if (loaded.length)
6537
+ init.attachments = loaded;
6538
+ }
6497
6539
  sessionStorage.setItem("composeInit", JSON.stringify(init));
6498
6540
  showComposeOverlay(msg.subject ? `Edit: ${msg.subject}` : "Edit draft");
6499
6541
  return;