@bobfrankston/rmfmail 1.2.24 → 1.2.26

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.
@@ -159,6 +159,30 @@ export async function createTinyMceEditor(container, opts = {}) {
159
159
  // custom backend via spellchecker_rpc_url, but requires a
160
160
  // Tiny Cloud subscription.
161
161
  browser_spellcheck: true,
162
+ // Insert/Edit Image dialog: add a BROWSE button to the Source field
163
+ // so a local file can be picked instead of only pasting a URL (Bob
164
+ // 2026-06-17 "insert image should use the browse API"). Uses the same
165
+ // OS file-picker the compose Attach button uses (<input type=file>,
166
+ // which works in the msger WebView), then inlines the chosen image as
167
+ // a base64 data URL — matching the drag-drop-an-image behavior.
168
+ file_picker_types: "image",
169
+ file_picker_callback: (cb, _value, meta) => {
170
+ if (meta && meta.filetype && meta.filetype !== "image")
171
+ return;
172
+ const input = document.createElement("input");
173
+ input.type = "file";
174
+ input.accept = "image/*";
175
+ input.onchange = () => {
176
+ const file = input.files && input.files[0];
177
+ if (!file)
178
+ return;
179
+ const reader = new FileReader();
180
+ reader.onload = () => cb(reader.result, { alt: file.name, title: file.name });
181
+ reader.onerror = () => cb("");
182
+ reader.readAsDataURL(file);
183
+ };
184
+ input.click();
185
+ },
162
186
  // Right-click context menu DISABLED so WebView2's native menu
163
187
  // fires instead. We need the native menu because that's where
164
188
  // the browser shows spelling suggestions (TinyMCE's contextmenu
@@ -265,8 +289,25 @@ export async function createTinyMceEditor(container, opts = {}) {
265
289
  const applyZoom = () => {
266
290
  try {
267
291
  const body = ed.getBody();
268
- if (body)
269
- body.style.fontSize = `${zoomPx}px`;
292
+ if (!body)
293
+ return;
294
+ body.style.fontSize = `${zoomPx}px`;
295
+ // WebView2's native spell-check markers are laid out ONCE
296
+ // (at the initial 14px) and do NOT reposition when the
297
+ // font-size changes via inline style — they stay stranded
298
+ // at the old, smaller baseline, so the red squiggle draws
299
+ // ABOVE the now-larger words instead of under them (Bob
300
+ // 2026-06-17 "red squiggle on the row above the text").
301
+ // Toggling the spellcheck attribute off→on forces the
302
+ // engine to re-run + re-place the markers at the current
303
+ // font metrics. rAF lets the font-size reflow land first.
304
+ const win = (ed.getWin && ed.getWin()) || window;
305
+ const raf = win.requestAnimationFrame || ((f) => setTimeout(f, 16));
306
+ body.setAttribute("spellcheck", "false");
307
+ raf(() => { try {
308
+ body.setAttribute("spellcheck", "true");
309
+ }
310
+ catch { /* */ } });
270
311
  }
271
312
  catch { /* */ }
272
313
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/rmfmail",
3
- "version": "1.2.24",
3
+ "version": "1.2.26",
4
4
  "description": "Local-first email client with IMAP sync and standalone native app",
5
5
  "type": "module",
6
6
  "main": "bin/mailx.js",
@@ -45,7 +45,7 @@
45
45
  "@bobfrankston/msger": "^0.1.387",
46
46
  "@bobfrankston/node-tcp-transport": "^0.1.10",
47
47
  "@bobfrankston/oauthsupport": "^1.0.32",
48
- "@bobfrankston/rmf-tiny": "^0.1.31",
48
+ "@bobfrankston/rmf-tiny": "^0.1.32",
49
49
  "@bobfrankston/smtp-direct": "^0.1.9",
50
50
  "@bobfrankston/tcp-transport": "^0.1.7",
51
51
  "@capacitor/android": "^8.3.0",
@@ -125,7 +125,7 @@
125
125
  "@bobfrankston/msger": "^0.1.387",
126
126
  "@bobfrankston/node-tcp-transport": "^0.1.10",
127
127
  "@bobfrankston/oauthsupport": "^1.0.32",
128
- "@bobfrankston/rmf-tiny": "^0.1.31",
128
+ "@bobfrankston/rmf-tiny": "^0.1.32",
129
129
  "@bobfrankston/smtp-direct": "^0.1.9",
130
130
  "@bobfrankston/tcp-transport": "^0.1.7",
131
131
  "@capacitor/android": "^8.3.0",