@bobfrankston/rmfmail 1.1.62 → 1.1.65

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 (38) hide show
  1. package/client/android-bootstrap.bundle.js +408 -194
  2. package/client/android-bootstrap.bundle.js.map +4 -4
  3. package/client/app.bundle.js +8 -0
  4. package/client/app.bundle.js.map +3 -3
  5. package/client/compose/compose.bundle.js +56 -1
  6. package/client/compose/compose.bundle.js.map +2 -2
  7. package/client/compose/compose.css +6 -0
  8. package/client/compose/spellcheck.js +74 -1
  9. package/client/compose/spellcheck.js.map +1 -1
  10. package/client/compose/spellcheck.ts +62 -1
  11. package/package.json +1 -1
  12. package/packages/mailx-service/index.d.ts.map +1 -1
  13. package/packages/mailx-service/index.js +8 -45
  14. package/packages/mailx-service/index.js.map +1 -1
  15. package/packages/mailx-service/index.ts +8 -31
  16. package/packages/mailx-store-web/db.d.ts +4 -0
  17. package/packages/mailx-store-web/db.d.ts.map +1 -1
  18. package/packages/mailx-store-web/db.js +16 -2
  19. package/packages/mailx-store-web/db.js.map +1 -1
  20. package/packages/mailx-store-web/db.ts +17 -2
  21. package/packages/mailx-store-web/package.json +1 -1
  22. package/packages/mailx-store-web/web-service.d.ts +2 -2
  23. package/packages/mailx-store-web/web-service.d.ts.map +1 -1
  24. package/packages/mailx-store-web/web-service.js +20 -3
  25. package/packages/mailx-store-web/web-service.js.map +1 -1
  26. package/packages/mailx-store-web/web-service.ts +20 -3
  27. package/packages/mailx-types/contacts-config.d.ts +27 -0
  28. package/packages/mailx-types/contacts-config.d.ts.map +1 -0
  29. package/packages/mailx-types/contacts-config.js +67 -0
  30. package/packages/mailx-types/contacts-config.js.map +1 -0
  31. package/packages/mailx-types/contacts-config.ts +71 -0
  32. package/packages/mailx-types/index.d.ts +1 -0
  33. package/packages/mailx-types/index.d.ts.map +1 -1
  34. package/packages/mailx-types/index.js +2 -0
  35. package/packages/mailx-types/index.js.map +1 -1
  36. package/packages/mailx-types/index.ts +5 -0
  37. package/packages/mailx-types/package.json +1 -1
  38. /package/packages/mailx-imap/{node_modules.npmglobalize-stash-45932 → node_modules.npmglobalize-stash-13452}/.package-lock.json +0 -0
@@ -2158,6 +2158,47 @@ function replaceMarker(editor2, marker, replacement) {
2158
2158
  range.insertNode(doc.createTextNode(replacement));
2159
2159
  }
2160
2160
  }
2161
+ function cleanupCorrected(editor2, sp) {
2162
+ const body = editor2.getBody?.();
2163
+ const doc = editor2.getDoc?.();
2164
+ if (!body || !doc)
2165
+ return;
2166
+ const markers = body.querySelectorAll(`span[${MARKER_ATTR}]`);
2167
+ if (markers.length === 0)
2168
+ return;
2169
+ let caretMarker = null;
2170
+ const sel = doc.getSelection();
2171
+ if (sel && sel.rangeCount > 0) {
2172
+ let p = sel.focusNode;
2173
+ while (p && p !== body) {
2174
+ if (p.nodeType === Node.ELEMENT_NODE && p.hasAttribute?.(MARKER_ATTR)) {
2175
+ caretMarker = p;
2176
+ break;
2177
+ }
2178
+ p = p.parentNode;
2179
+ }
2180
+ }
2181
+ const stale = [];
2182
+ for (const m of markers) {
2183
+ if (m === caretMarker)
2184
+ continue;
2185
+ const word = m.textContent || "";
2186
+ if (!word || /\s/.test(word) || sp.correct(word))
2187
+ stale.push(m);
2188
+ }
2189
+ if (stale.length === 0)
2190
+ return;
2191
+ editor2.undoManager?.ignore?.(() => {
2192
+ for (const m of stale) {
2193
+ const parent2 = m.parentNode;
2194
+ if (!parent2)
2195
+ continue;
2196
+ while (m.firstChild)
2197
+ parent2.insertBefore(m.firstChild, m);
2198
+ parent2.removeChild(m);
2199
+ }
2200
+ });
2201
+ }
2161
2202
  function wireSpellcheck(editor2) {
2162
2203
  if (editor2.__mailxSpellWired)
2163
2204
  return;
@@ -2175,6 +2216,18 @@ function wireSpellcheck(editor2) {
2175
2216
  decorate(editor2, sp);
2176
2217
  }, DECORATE_DEBOUNCE_MS);
2177
2218
  };
2219
+ let cleanupTimer = null;
2220
+ const scheduleCleanup = () => {
2221
+ if (!sp)
2222
+ return;
2223
+ if (cleanupTimer)
2224
+ clearTimeout(cleanupTimer);
2225
+ cleanupTimer = setTimeout(() => {
2226
+ cleanupTimer = null;
2227
+ if (sp)
2228
+ cleanupCorrected(editor2, sp);
2229
+ }, CLEANUP_DEBOUNCE_MS);
2230
+ };
2178
2231
  getSpell().then((loaded) => {
2179
2232
  sp = loaded;
2180
2233
  installDecorationStyle(editor2);
@@ -2184,6 +2237,7 @@ function wireSpellcheck(editor2) {
2184
2237
  console.error("[spellcheck] dict load failed:", err);
2185
2238
  });
2186
2239
  editor2.on("input nodechange setcontent paste keyup", scheduleDecorate);
2240
+ editor2.on("input nodechange setcontent paste keyup", scheduleCleanup);
2187
2241
  const iframeDoc = editor2.getDoc();
2188
2242
  iframeDoc.addEventListener("contextmenu", (ev) => {
2189
2243
  const e = ev;
@@ -2252,7 +2306,7 @@ function wireSpellcheck(editor2) {
2252
2306
  showSuggestionsMenu(document, iframeRect.left + e.clientX, iframeRect.top + e.clientY, items);
2253
2307
  }, true);
2254
2308
  }
2255
- var import_nspell, USER_DICT_KEY, MARKER_ATTR, DECORATE_DEBOUNCE_MS, MIN_WORD_LEN, SKIP_TAGS, spellPromise;
2309
+ var import_nspell, USER_DICT_KEY, MARKER_ATTR, DECORATE_DEBOUNCE_MS, CLEANUP_DEBOUNCE_MS, MIN_WORD_LEN, SKIP_TAGS, spellPromise;
2256
2310
  var init_spellcheck = __esm({
2257
2311
  "client/compose/spellcheck.js"() {
2258
2312
  "use strict";
@@ -2261,6 +2315,7 @@ var init_spellcheck = __esm({
2261
2315
  USER_DICT_KEY = "mailx-user-dict";
2262
2316
  MARKER_ATTR = "data-mailx-spellerror";
2263
2317
  DECORATE_DEBOUNCE_MS = 1200;
2318
+ CLEANUP_DEBOUNCE_MS = 300;
2264
2319
  MIN_WORD_LEN = 3;
2265
2320
  SKIP_TAGS = /* @__PURE__ */ new Set(["BLOCKQUOTE", "CODE", "PRE", "A", "SCRIPT", "STYLE", "KBD", "SAMP", "VAR"]);
2266
2321
  spellPromise = null;