@bobfrankston/rmfmail 1.1.106 → 1.1.107
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/client/app.bundle.js +28 -7
- package/client/app.bundle.js.map +2 -2
- package/client/app.js +58 -14
- package/client/app.js.map +1 -1
- package/client/app.ts +52 -14
- package/client/compose/compose.bundle.js +25 -9
- package/client/compose/compose.bundle.js.map +2 -2
- package/client/lib/rmf-tiny.js +40 -11
- package/package.json +1 -1
- /package/packages/mailx-imap/{node_modules.npmglobalize-stash-77444 → node_modules.npmglobalize-stash-61168}/.package-lock.json +0 -0
package/client/lib/rmf-tiny.js
CHANGED
|
@@ -322,19 +322,48 @@ export async function createTinyMceEditor(container, opts = {}) {
|
|
|
322
322
|
// (reply / forward — user types above the quoted block);
|
|
323
323
|
// anything else → cursor at END (legacy "put cursor at end"
|
|
324
324
|
// semantics).
|
|
325
|
-
|
|
326
|
-
editor.
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
325
|
+
const place = () => {
|
|
326
|
+
const body = editor.getBody();
|
|
327
|
+
if (pos === 0) {
|
|
328
|
+
// Put the caret INSIDE the first block element. Collapsing
|
|
329
|
+
// to raw body-start lands it outside any block (before /
|
|
330
|
+
// between bare nodes) where contentEditable insertion is
|
|
331
|
+
// unpredictable — Bob 2026-05-21: "typing goes in the
|
|
332
|
+
// wrong place until you try again". rmfmail's reply body
|
|
333
|
+
// now leads with a real <p>; drop the caret into it.
|
|
334
|
+
const first = body.firstChild;
|
|
335
|
+
if (first && first.nodeType === 1 /* element */) {
|
|
336
|
+
editor.selection.setCursorLocation(first, 0);
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
editor.selection.select(body, true);
|
|
340
|
+
editor.selection.collapse(true);
|
|
341
|
+
}
|
|
342
|
+
editor.focus();
|
|
343
|
+
// Viewport to the top so the user looks at the empty
|
|
344
|
+
// reply line, not scrolled down into the quote.
|
|
335
345
|
editor.getWin()?.scrollTo(0, 0);
|
|
336
|
-
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
editor.selection.select(body, true);
|
|
349
|
+
editor.selection.collapse(false);
|
|
350
|
+
editor.focus();
|
|
337
351
|
editor.selection.scrollIntoView();
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
try {
|
|
355
|
+
place();
|
|
356
|
+
// Re-apply on the next frame. Cross-iframe focus (compose is
|
|
357
|
+
// an iframe; TinyMCE's edit area is a nested iframe) lets the
|
|
358
|
+
// first selection set get clobbered by a late layout / focus
|
|
359
|
+
// event — the "have to click in and try again" symptom. A
|
|
360
|
+
// second pass after the frame settles makes it stick.
|
|
361
|
+
editor.getWin()?.requestAnimationFrame?.(() => {
|
|
362
|
+
try {
|
|
363
|
+
place();
|
|
364
|
+
}
|
|
365
|
+
catch { /* */ }
|
|
366
|
+
});
|
|
338
367
|
}
|
|
339
368
|
catch { /* */ }
|
|
340
369
|
},
|
package/package.json
CHANGED