@bobfrankston/rmfmail 1.2.318 → 1.2.319

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/.commitmsg CHANGED
@@ -1,19 +1,18 @@
1
- New event: choose the calendar; pushes go to the event's own calendar
1
+ Compose: typing after a pasted link no longer extends the link
2
2
 
3
- Bob 2026-09-10: "when creating an event I should be able to specify
4
- which calendar. I want to start making more use of shared calendars."
3
+ Bob 2026-09-10: "there is still a problem in typing after pasting a link.
4
+ It extends the link text rather than acting as regular text."
5
5
 
6
- The New event dialog gains a Calendar picker listing the calendars
7
- Google says the reader can write to (accessRole owner or writer, now
8
- carried by listCalendars getCalendars), personal first, shown only
9
- when there is more than one; the last choice is remembered per machine.
10
- The status line names the calendar the event went to.
6
+ TinyMCE (his editor) turns a pasted URL into an anchor through its smart
7
+ paste and leaves the caret INSIDE the anchor at the end of its text, so
8
+ every character typed next became more link text while the target stayed
9
+ the pasted URL a link that no longer says what it does. Same when the
10
+ clipboard carries an anchor copied from a page. New
11
+ stepCaretOutOfPastedLink in client/compose/editor.ts: one tick after a
12
+ paste, if the caret is collapsed at the very end of an anchor, it is set
13
+ to just after the anchor; a caret mid-link or outside any link is left
14
+ alone. Contained in mailx's TinyMCE wiring; rmf-tiny untouched.
11
15
 
12
- Underneath, a real bug: the store-sync drain dropped calendarId and sent
13
- every create, update and delete to "primary". A create could not land
14
- anywhere else, and an update or delete of an event on a shared calendar
15
- was a 404 retried on every poll. createCalendarEventLocal takes
16
- calendarId, the row and the queue payload carry it, update/delete
17
- payloads carry the row's, and the drain passes it to all three Google
18
- calls. Rows pulled before today already hold the id the pull recorded.
19
- mailx-types 0.1.95, mailx-service 0.1.37.
16
+ The Quill branch has the same shape (insertText with a link format, then
17
+ setSelection at its end) and is not changed here untested, and not the
18
+ editor in use.
@@ -63,3 +63,4 @@ tests/trust.test.ts, .commitmsg, TODO.md C165, root version 1.2.311. Then rebuil
63
63
  Refresh button + window focus call refreshCalendarNow. Tooltips on all sidebar controls; event rows:
64
64
  click = edit in Google, right-click = Delete "<title>" (deleteCalendarEvent). Publishing as v1.2.317.
65
65
  - v1.2.318: New event Calendar picker (writable calendars via accessRole from listCalendars). Store-sync drain now passes calendarId to create/update/delete (was always "primary" — shared-calendar edits 404'd forever). Google: create/subscribe/share calendars on calendar.google.com; rmfmail lists the ones selected there.
66
+ - v1.2.319: TinyMCE smart-paste left the caret INSIDE the pasted <a>; stepCaretOutOfPastedLink in client/compose/editor.ts moves it after the anchor one tick after paste. Quill path has the same shape (insertText link + setSelection) — untouched, Bob uses TinyMCE.
@@ -5320,11 +5320,34 @@ async function createTinyMceEditor2(container2, opts = {}) {
5320
5320
  const body = native?.getBody?.();
5321
5321
  if (native && body) {
5322
5322
  wireMarkdownPaste(body, (html) => native.insertContent(html));
5323
+ stepCaretOutOfPastedLink(native);
5323
5324
  }
5324
5325
  } catch {
5325
5326
  }
5326
5327
  return ed;
5327
5328
  }
5329
+ function stepCaretOutOfPastedLink(native) {
5330
+ native.on("paste", () => {
5331
+ setTimeout(() => {
5332
+ try {
5333
+ const rng = native.selection.getRng();
5334
+ if (!rng || !rng.collapsed)
5335
+ return;
5336
+ const node = native.selection.getNode();
5337
+ const a = node?.closest?.("a[href]");
5338
+ if (!a)
5339
+ return;
5340
+ const rest = rng.cloneRange();
5341
+ rest.setEnd(a, a.childNodes.length);
5342
+ if (rest.toString().trim())
5343
+ return;
5344
+ native.selection.setCursorLocation(a.parentNode, native.dom.nodeIndex(a) + 1);
5345
+ } catch (e) {
5346
+ console.warn("[editor] could not move the caret past the pasted link:", e?.message || e);
5347
+ }
5348
+ }, 0);
5349
+ });
5350
+ }
5328
5351
 
5329
5352
  // client/compose/compose.ts
5330
5353
  init_api_client();