@bobfrankston/rmfmail 1.2.25 → 1.2.27

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.
@@ -1989,6 +1989,30 @@ async function createTinyMceEditor(container2, opts = {}) {
1989
1989
  // custom backend via spellchecker_rpc_url, but requires a
1990
1990
  // Tiny Cloud subscription.
1991
1991
  browser_spellcheck: true,
1992
+ // Insert/Edit Image dialog: add a BROWSE button to the Source field
1993
+ // so a local file can be picked instead of only pasting a URL (Bob
1994
+ // 2026-06-17 "insert image should use the browse API"). Uses the same
1995
+ // OS file-picker the compose Attach button uses (<input type=file>,
1996
+ // which works in the msger WebView), then inlines the chosen image as
1997
+ // a base64 data URL — matching the drag-drop-an-image behavior.
1998
+ file_picker_types: "image",
1999
+ file_picker_callback: (cb, _value, meta) => {
2000
+ if (meta && meta.filetype && meta.filetype !== "image")
2001
+ return;
2002
+ const input = document.createElement("input");
2003
+ input.type = "file";
2004
+ input.accept = "image/*";
2005
+ input.onchange = () => {
2006
+ const file = input.files && input.files[0];
2007
+ if (!file)
2008
+ return;
2009
+ const reader = new FileReader();
2010
+ reader.onload = () => cb(reader.result, { alt: file.name, title: file.name });
2011
+ reader.onerror = () => cb("");
2012
+ reader.readAsDataURL(file);
2013
+ };
2014
+ input.click();
2015
+ },
1992
2016
  // Right-click context menu DISABLED so WebView2's native menu
1993
2017
  // fires instead. We need the native menu because that's where
1994
2018
  // the browser shows spelling suggestions (TinyMCE's contextmenu