@bobfrankston/mailx 1.0.211 → 1.0.212

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.
@@ -37,6 +37,29 @@ export function initViewer() {
37
37
  // "messages" change (sync reload) — don't touch the viewer
38
38
  });
39
39
  }
40
+ /** Re-dispatch keydown events from iframe contentDocument onto the parent document
41
+ * so global shortcuts (Delete, Ctrl+D, Ctrl+R, etc.) fire while the preview has focus. */
42
+ function forwardKeysToParent(iframe) {
43
+ const attach = () => {
44
+ const doc = iframe.contentDocument;
45
+ if (!doc)
46
+ return;
47
+ doc.addEventListener("keydown", (e) => {
48
+ const target = e.target;
49
+ if (target && (target.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(target.tagName)))
50
+ return;
51
+ document.dispatchEvent(new KeyboardEvent("keydown", {
52
+ key: e.key, code: e.code,
53
+ ctrlKey: e.ctrlKey, shiftKey: e.shiftKey, altKey: e.altKey, metaKey: e.metaKey,
54
+ bubbles: true, cancelable: true,
55
+ }));
56
+ });
57
+ };
58
+ if (iframe.contentDocument?.readyState === "complete")
59
+ attach();
60
+ else
61
+ iframe.addEventListener("load", attach, { once: true });
62
+ }
40
63
  function clearViewer() {
41
64
  currentMessage = null;
42
65
  currentAccountId = "";
@@ -251,6 +274,7 @@ export async function showMessage(accountId, uid, folderId, specialUse, isRetry
251
274
  const iframe = document.createElement("iframe");
252
275
  iframe.srcdoc = wrapHtmlBody(full.bodyHtml, true);
253
276
  bodyEl.appendChild(iframe);
277
+ forwardKeysToParent(iframe);
254
278
  }
255
279
  };
256
280
  banner.querySelector("#btn-load-remote").addEventListener("click", loadRemote);
@@ -279,6 +303,7 @@ export async function showMessage(accountId, uid, folderId, specialUse, isRetry
279
303
  iframe.sandbox.add("allow-top-navigation-by-user-activation");
280
304
  iframe.srcdoc = wrapHtmlBody(msg.bodyHtml, msg.remoteAllowed);
281
305
  bodyEl.appendChild(iframe);
306
+ forwardKeysToParent(iframe);
282
307
  }
283
308
  else if (msg.bodyText) {
284
309
  const pre = document.createElement("pre");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx",
3
- "version": "1.0.211",
3
+ "version": "1.0.212",
4
4
  "description": "Local-first email client with IMAP sync and standalone native app",
5
5
  "type": "module",
6
6
  "main": "bin/mailx.js",
@@ -24,7 +24,7 @@
24
24
  "@bobfrankston/iflow-node": "^0.1.2",
25
25
  "@bobfrankston/miscinfo": "^1.0.8",
26
26
  "@bobfrankston/oauthsupport": "^1.0.22",
27
- "@bobfrankston/msger": "^0.1.273",
27
+ "@bobfrankston/msger": "^0.1.274",
28
28
  "@capacitor/android": "^8.3.0",
29
29
  "@capacitor/cli": "^8.3.0",
30
30
  "@capacitor/core": "^8.3.0",
@@ -71,5 +71,24 @@
71
71
  "quill": "^2.0.3",
72
72
  "ws": "^8.18.0",
73
73
  "sql.js": "^1.14.1"
74
+ },
75
+ ".transformedSnapshot": {
76
+ "dependencies": {
77
+ "@bobfrankston/iflow-direct": "^0.1.6",
78
+ "@bobfrankston/iflow-node": "^0.1.2",
79
+ "@bobfrankston/miscinfo": "^1.0.8",
80
+ "@bobfrankston/oauthsupport": "^1.0.22",
81
+ "@bobfrankston/msger": "^0.1.274",
82
+ "@capacitor/android": "^8.3.0",
83
+ "@capacitor/cli": "^8.3.0",
84
+ "@capacitor/core": "^8.3.0",
85
+ "express": "^4.21.0",
86
+ "jsonc-parser": "^3.3.1",
87
+ "mailparser": "^3.7.2",
88
+ "nodemailer": "^7.0.0",
89
+ "quill": "^2.0.3",
90
+ "ws": "^8.18.0",
91
+ "sql.js": "^1.14.1"
92
+ }
74
93
  }
75
94
  }