@bobfrankston/rmfmail 1.2.168 → 1.2.170

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/README.md CHANGED
@@ -240,6 +240,7 @@ Under **View** in the toolbar:
240
240
 
241
241
  Under **Settings** in the toolbar:
242
242
  - **Editor** -- Choose between Quill (default), tiptap, or TinyMCE for compose
243
+ - **Grammar check (Harper)** -- Live grammar, phrasing, capitalization, and repetition squiggles (dotted blue) while composing, in all three editors. Click a squiggle for an explanation and one-click fixes. Powered by [Harper](https://writewithharper.com/), Automattic's open-source grammar checker (Apache-2.0) -- the engine runs entirely on this machine inside the rmfmail service, so draft text never leaves your computer. English only (dialect-aware). Quoted reply text is not checked; spelling stays with the native red-squiggle spellchecker. On by default. More about Harper: <https://writewithharper.com/> and <https://github.com/automattic/harper>.
243
244
  - **External editor (Edit in Word)** -- Open the compose body in Microsoft Word or LibreOffice Writer for heavy editing (Auto / Word / LibreOffice)
244
245
  - **Auto mark-as-read** -- Mark a viewed message read after a short, configurable delay (delay in seconds; 0 = immediately). Turn off to require an explicit Mark-read.
245
246
  - **Check sender reputation (DNSBLs)** -- When opening a message with remote content, look the sender's domain up in three free blocklists in parallel (off by default; each query leaks the bare domain to that DNSBL)
@@ -2816,6 +2816,22 @@ function parseJsonc(text) {
2816
2816
  stripped = stripped.replace(/,(\s*[}\]])/g, "$1");
2817
2817
  return JSON.parse(stripped);
2818
2818
  }
2819
+ function refreshSharedFile(filename, cached) {
2820
+ const now = Date.now();
2821
+ if (now - (__lastSharedRefresh.get(filename) || 0) < SHARED_REFRESH_MS)
2822
+ return;
2823
+ __lastSharedRefresh.set(filename, now);
2824
+ void (async () => {
2825
+ try {
2826
+ const fresh = await gDriveRead(filename);
2827
+ if (fresh && fresh !== cached) {
2828
+ await idbWrite(filename, fresh);
2829
+ console.log(`[settings] ${filename} refreshed from GDrive (shared copy changed)`);
2830
+ }
2831
+ } catch {
2832
+ }
2833
+ })();
2834
+ }
2819
2835
  async function loadAccounts() {
2820
2836
  const cached = await idbRead("accounts.jsonc");
2821
2837
  if (cached) {
@@ -2864,6 +2880,7 @@ async function saveAccounts(accounts) {
2864
2880
  async function loadPreferences() {
2865
2881
  const cached = await idbRead("preferences.jsonc");
2866
2882
  if (cached) {
2883
+ refreshSharedFile("preferences.jsonc", cached);
2867
2884
  try {
2868
2885
  const data = parseJsonc(cached);
2869
2886
  return {
@@ -2915,6 +2932,7 @@ async function saveSettings(settings) {
2915
2932
  async function loadAllowlist() {
2916
2933
  const cached = await idbRead("allowlist.jsonc");
2917
2934
  if (cached) {
2935
+ refreshSharedFile("allowlist.jsonc", cached);
2918
2936
  try {
2919
2937
  return parseJsonc(cached);
2920
2938
  } catch {
@@ -3002,7 +3020,7 @@ async function loadDeviceState() {
3002
3020
  }
3003
3021
  return {};
3004
3022
  }
3005
- var IDB_NAME2, IDB_VERSION, STORE_NAME2, gDriveFolderId, gDriveFolderName, gDriveFolderPath, gDriveFolderOwner, tokenProvider, PROVIDERS, DEFAULT_PREFERENCES, DEFAULT_ALLOWLIST, DEVICE_ID_KEY;
3023
+ var IDB_NAME2, IDB_VERSION, STORE_NAME2, gDriveFolderId, gDriveFolderName, gDriveFolderPath, gDriveFolderOwner, tokenProvider, PROVIDERS, DEFAULT_PREFERENCES, DEFAULT_ALLOWLIST, SHARED_REFRESH_MS, __lastSharedRefresh, DEVICE_ID_KEY;
3006
3024
  var init_web_settings = __esm({
3007
3025
  "packages/mailx-store-web/web-settings.js"() {
3008
3026
  "use strict";
@@ -3077,6 +3095,8 @@ var init_web_settings = __esm({
3077
3095
  flaggedSenders: [],
3078
3096
  flaggedDomains: []
3079
3097
  };
3098
+ SHARED_REFRESH_MS = 5 * 6e4;
3099
+ __lastSharedRefresh = /* @__PURE__ */ new Map();
3080
3100
  DEVICE_ID_KEY = "mailx-device-id";
3081
3101
  }
3082
3102
  });