@bobfrankston/rmfmail 1.2.319 → 1.2.320

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,18 +1,14 @@
1
- Compose: typing after a pasted link no longer extends the link
1
+ Compose (Quill): typing after a pasted or edited link is plain text
2
2
 
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."
3
+ Bob 2026-09-10: "you can risk the change for Quill since it is a known
4
+ bug and I can test it" the Quill counterpart of v1.2.319's TinyMCE fix.
5
5
 
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.
15
-
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.
6
+ Quill carries the format of the character before the caret into what is
7
+ typed next, so every place that inserted a linked run and then set the
8
+ caret at its end (the five paste paths single-anchor clipboard, URL in
9
+ an HTML clipboard, plain URL with and without a selection and both
10
+ branches of the Edit-link dialog) left the next keystrokes extending the
11
+ link. One hoisted placeCaretAfterLink(index) in createQuillEditor now
12
+ does setSelection + format("link", false) for all seven sites; format()
13
+ on a collapsed selection sets the cursor format, which is how the
14
+ toolbar's own toggle-then-type works. Untested on Quill Bob tests.
@@ -64,3 +64,4 @@ tests/trust.test.ts, .commitmsg, TODO.md C165, root version 1.2.311. Then rebuil
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
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.
67
+ - v1.2.320: Quill counterpart — placeCaretAfterLink(index) = setSelection + format("link", false) at 5 paste sites + 2 Edit-link dialog sites. Untested; Bob will switch editor to test.
@@ -4671,10 +4671,10 @@ function createQuillEditor(container2) {
4671
4671
  if (linkRange.length) {
4672
4672
  quill.deleteText(linkRange.index, linkRange.length);
4673
4673
  quill.insertText(linkRange.index, newText, { link: result.url });
4674
- quill.setSelection(linkRange.index + newText.length, 0);
4674
+ placeCaretAfterLink(linkRange.index + newText.length);
4675
4675
  } else {
4676
4676
  quill.insertText(linkRange.index, newText, { link: result.url });
4677
- quill.setSelection(linkRange.index + newText.length, 0);
4677
+ placeCaretAfterLink(linkRange.index + newText.length);
4678
4678
  }
4679
4679
  };
4680
4680
  const extraBindings = {
@@ -4978,7 +4978,7 @@ function createQuillEditor(container2) {
4978
4978
  q.deleteText(range.index, range.length);
4979
4979
  }
4980
4980
  q.insertText(range.index, text, { link: href });
4981
- q.setSelection(range.index + text.length, 0);
4981
+ placeCaretAfterLink(range.index + text.length);
4982
4982
  return;
4983
4983
  }
4984
4984
  }
@@ -4991,10 +4991,10 @@ function createQuillEditor(container2) {
4991
4991
  const url = normalizeUrl(textOnly);
4992
4992
  if (range.length > 0) {
4993
4993
  q.formatText(range.index, range.length, "link", url);
4994
- q.setSelection(range.index + range.length, 0);
4994
+ placeCaretAfterLink(range.index + range.length);
4995
4995
  } else {
4996
4996
  q.insertText(range.index, textOnly, { link: url });
4997
- q.setSelection(range.index + textOnly.length, 0);
4997
+ placeCaretAfterLink(range.index + textOnly.length);
4998
4998
  }
4999
4999
  return;
5000
5000
  }
@@ -5010,10 +5010,10 @@ function createQuillEditor(container2) {
5010
5010
  const url = normalizeUrl(plain);
5011
5011
  if (range.length > 0) {
5012
5012
  q.formatText(range.index, range.length, "link", url);
5013
- q.setSelection(range.index + range.length, 0);
5013
+ placeCaretAfterLink(range.index + range.length);
5014
5014
  } else {
5015
5015
  q.insertText(range.index, plain.trim(), { link: url });
5016
- q.setSelection(range.index + plain.trim().length, 0);
5016
+ placeCaretAfterLink(range.index + plain.trim().length);
5017
5017
  }
5018
5018
  return;
5019
5019
  }
@@ -5033,6 +5033,10 @@ function createQuillEditor(container2) {
5033
5033
  q.clipboard.dangerouslyPasteHTML(range.index, markdownToEmailHtml(plain));
5034
5034
  }
5035
5035
  }, true);
5036
+ function placeCaretAfterLink(index) {
5037
+ q.setSelection(index, 0);
5038
+ q.format("link", false);
5039
+ }
5036
5040
  q.on("text-change", (delta, _old, source) => {
5037
5041
  if (source !== "user")
5038
5042
  return;