@bobfrankston/rmfmail 1.2.229 → 1.2.231
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/TODO.md +27 -0
- package/client/app.bundle.js +349 -66
- package/client/app.bundle.js.map +4 -4
- package/client/app.js +16 -2
- package/client/app.js.map +1 -1
- package/client/app.ts +14 -1
- package/client/components/calendar-sidebar.js +1 -1
- package/client/components/calendar-sidebar.js.map +1 -1
- package/client/components/calendar-sidebar.ts +1 -1
- package/client/components/context-menu.js +12 -1
- package/client/components/context-menu.js.map +1 -1
- package/client/components/context-menu.ts +36 -1
- package/client/components/edit-menu.js +339 -0
- package/client/components/edit-menu.js.map +1 -0
- package/client/components/edit-menu.ts +343 -0
- package/client/components/folder-tree.js +2 -2
- package/client/components/folder-tree.js.map +1 -1
- package/client/components/folder-tree.ts +2 -2
- package/client/components/message-list.js +3 -1
- package/client/components/message-list.js.map +1 -1
- package/client/components/message-list.ts +3 -1
- package/client/compose/compose.bundle.js +254 -83
- package/client/compose/compose.bundle.js.map +4 -4
- package/client/compose/compose.js +5 -28
- package/client/compose/compose.js.map +1 -1
- package/client/compose/compose.ts +4 -13
- package/client/compose/edit-commands.js +10 -89
- package/client/compose/edit-commands.js.map +1 -1
- package/client/compose/edit-commands.ts +11 -77
- package/package.json +1 -1
- /package/packages/mailx-imap/{node_modules.npmglobalize-stash-146480 → node_modules.npmglobalize-stash-7472}/.package-lock.json +0 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Cut / Copy / Paste / Select-all block, for every menu in the app.
|
|
3
|
+
*
|
|
4
|
+
* Why this exists: mailx replaces the WebView's native context menu almost
|
|
5
|
+
* everywhere (app.ts kills the default one, and each surface builds its own),
|
|
6
|
+
* and a menu that takes over from the native one inherits the native one's
|
|
7
|
+
* JOB — including the clipboard. Surfaces that forgot produced a right-click
|
|
8
|
+
* with no Cut/Copy/Paste at all, which is what a user hits first and what
|
|
9
|
+
* Bob's wife reported (2026-08-09, "some menus don't show copy/cut/paste").
|
|
10
|
+
*
|
|
11
|
+
* Before this file there were three separate clipboard implementations —
|
|
12
|
+
* a rich-editor one in compose/edit-commands.ts, a hand-rolled one for the
|
|
13
|
+
* recipient <input> in compose.ts, and nothing anywhere else. They differed
|
|
14
|
+
* in what they put on the clipboard and in whether a refusal was reported or
|
|
15
|
+
* swallowed. Now every menu builds its clipboard block from `editMenuItems()`
|
|
16
|
+
* and every clipboard action runs through `runClipboard()`.
|
|
17
|
+
*
|
|
18
|
+
* Two execution paths, ONE entry point:
|
|
19
|
+
* - `engine` set (TinyMCE Editor or Quill) → the rich path, which preserves
|
|
20
|
+
* text/html so formatting survives a copy between messages.
|
|
21
|
+
* - otherwise → the DOM path, which handles <input>/<textarea> through
|
|
22
|
+
* value + selectionStart/End, and contenteditable/plain page text through
|
|
23
|
+
* the Selection API.
|
|
24
|
+
*
|
|
25
|
+
* NOT document.execCommand("copy"/"paste"): those need transient user
|
|
26
|
+
* activation, which a context-menu callback (and especially a native-menu
|
|
27
|
+
* callback dispatched from Rust via ExecuteScript) does not carry. The async
|
|
28
|
+
* Clipboard API works from a focused document; clipboard READ is
|
|
29
|
+
* permission-gated and can legitimately be refused — so these functions
|
|
30
|
+
* REJECT with a real message instead of returning quietly, and every caller
|
|
31
|
+
* surfaces it. A menu item that silently does nothing is worse than no menu
|
|
32
|
+
* item.
|
|
33
|
+
*/
|
|
34
|
+
/** Input types whose value is text the user can sensibly cut/copy/paste.
|
|
35
|
+
* Deliberately excludes the pickers (date, color, file, checkbox…), where a
|
|
36
|
+
* clipboard item would do nothing. */
|
|
37
|
+
const TEXTUAL_INPUT_TYPES = new Set([
|
|
38
|
+
"text", "search", "email", "url", "tel", "number", "password", "",
|
|
39
|
+
]);
|
|
40
|
+
function isTinyEngine(ne) {
|
|
41
|
+
return !!ne && typeof ne.execCommand === "function" && !!ne.selection;
|
|
42
|
+
}
|
|
43
|
+
/** Classify `target` for the purposes of a clipboard menu. Never throws —
|
|
44
|
+
* a menu must open even if it can't offer anything. */
|
|
45
|
+
export function describeEditTarget(target) {
|
|
46
|
+
const none = { el: null, editable: false, selection: "", canRead: true, isField: false };
|
|
47
|
+
const node = target;
|
|
48
|
+
if (!node)
|
|
49
|
+
return { ...none, selection: pageSelection() };
|
|
50
|
+
const start = (node.nodeType === Node.ELEMENT_NODE ? node : node.parentElement);
|
|
51
|
+
if (!start)
|
|
52
|
+
return { ...none, selection: pageSelection() };
|
|
53
|
+
const field = start.closest("input, textarea");
|
|
54
|
+
if (field) {
|
|
55
|
+
const type = (field instanceof HTMLInputElement ? field.type : "text").toLowerCase();
|
|
56
|
+
if (!TEXTUAL_INPUT_TYPES.has(type))
|
|
57
|
+
return { ...none, selection: pageSelection() };
|
|
58
|
+
const s = field.selectionStart ?? 0, e = field.selectionEnd ?? 0;
|
|
59
|
+
return {
|
|
60
|
+
el: field,
|
|
61
|
+
editable: !field.readOnly && !field.disabled,
|
|
62
|
+
selection: e > s ? field.value.slice(s, e) : "",
|
|
63
|
+
canRead: type !== "password",
|
|
64
|
+
isField: true,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const ce = start.closest("[contenteditable]");
|
|
68
|
+
const editable = !!ce && ce.isContentEditable;
|
|
69
|
+
return { el: ce || start, editable, selection: pageSelection(), canRead: true, isField: false };
|
|
70
|
+
}
|
|
71
|
+
function pageSelection() {
|
|
72
|
+
try {
|
|
73
|
+
return window.getSelection()?.toString() || "";
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return "";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function escapeHtml(s) {
|
|
80
|
+
return s.replace(/[&<>]/g, c => ({ "&": "&", "<": "<", ">": ">" }[c]));
|
|
81
|
+
}
|
|
82
|
+
/** Read the clipboard, preferring text/html so formatting survives a paste
|
|
83
|
+
* exactly as Ctrl+V would. Returns both shapes; callers pick. */
|
|
84
|
+
async function readClipboard() {
|
|
85
|
+
let html = "", text = "";
|
|
86
|
+
if (navigator.clipboard?.read) {
|
|
87
|
+
for (const item of await navigator.clipboard.read()) {
|
|
88
|
+
if (item.types.includes("text/html"))
|
|
89
|
+
html = await (await item.getType("text/html")).text();
|
|
90
|
+
if (item.types.includes("text/plain"))
|
|
91
|
+
text = await (await item.getType("text/plain")).text();
|
|
92
|
+
}
|
|
93
|
+
// Chromium resolves read() with an empty list rather than rejecting
|
|
94
|
+
// when the page isn't allowed to read — don't let that look like an
|
|
95
|
+
// empty clipboard.
|
|
96
|
+
if (!html && !text)
|
|
97
|
+
text = await navigator.clipboard.readText();
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
text = await navigator.clipboard.readText();
|
|
101
|
+
}
|
|
102
|
+
return { html, text };
|
|
103
|
+
}
|
|
104
|
+
/** Write `text` (and optionally `html`) to the clipboard in one item, so a
|
|
105
|
+
* paste into a rich target keeps formatting and a paste into a plain one
|
|
106
|
+
* still gets sensible text. */
|
|
107
|
+
async function writeClipboard(text, html) {
|
|
108
|
+
if (html && typeof ClipboardItem === "function" && navigator.clipboard?.write) {
|
|
109
|
+
await navigator.clipboard.write([new ClipboardItem({
|
|
110
|
+
"text/html": new Blob([html], { type: "text/html" }),
|
|
111
|
+
"text/plain": new Blob([text], { type: "text/plain" }),
|
|
112
|
+
})]);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
await navigator.clipboard.writeText(text);
|
|
116
|
+
}
|
|
117
|
+
/** Expand a collapsed caret to the word under it, so "right-click a word →
|
|
118
|
+
* Copy" acts on that word rather than on nothing. Rich-editor path only:
|
|
119
|
+
* in a plain field an empty selection means empty, and silently grabbing a
|
|
120
|
+
* word would be a surprise. */
|
|
121
|
+
function expandToWord(ne) {
|
|
122
|
+
if (isTinyEngine(ne)) {
|
|
123
|
+
try {
|
|
124
|
+
if (ne.selection.isCollapsed() && typeof ne.selection.expand === "function") {
|
|
125
|
+
ne.selection.expand({ type: "word" });
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch { /* older TinyMCE — the command still applies at the caret */ }
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (ne && typeof ne.getSelection === "function" && typeof ne.setSelection === "function") {
|
|
132
|
+
const sel = ne.getSelection();
|
|
133
|
+
if (!sel || sel.length > 0)
|
|
134
|
+
return;
|
|
135
|
+
const text = ne.getText();
|
|
136
|
+
let a = sel.index, b = sel.index;
|
|
137
|
+
while (a > 0 && /\S/.test(text[a - 1]))
|
|
138
|
+
a--;
|
|
139
|
+
while (b < text.length && /\S/.test(text[b]))
|
|
140
|
+
b++;
|
|
141
|
+
if (b > a)
|
|
142
|
+
ne.setSelection(a, b - a);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/** Replace the selected range of an <input>/<textarea> with `text`, leaving
|
|
146
|
+
* the caret after it, and fire `input` so listeners (autocomplete, autosave,
|
|
147
|
+
* auto-grow) see the change — assigning .value alone fires nothing. */
|
|
148
|
+
function replaceFieldSelection(field, text) {
|
|
149
|
+
const s = field.selectionStart ?? field.value.length;
|
|
150
|
+
const e = field.selectionEnd ?? field.value.length;
|
|
151
|
+
field.value = field.value.slice(0, s) + text + field.value.slice(e);
|
|
152
|
+
field.selectionStart = field.selectionEnd = s + text.length;
|
|
153
|
+
field.dispatchEvent(new Event("input", { bubbles: true }));
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Run a clipboard command for `ctx`. Rejects (never swallows) when the
|
|
157
|
+
* clipboard refuses — callers report it.
|
|
158
|
+
*/
|
|
159
|
+
export async function runClipboard(ctx, id) {
|
|
160
|
+
if (ctx.engine)
|
|
161
|
+
return runEngineClipboard(ctx.engine, id);
|
|
162
|
+
const info = describeEditTarget(ctx.target);
|
|
163
|
+
if (id === "paste") {
|
|
164
|
+
if (!info.editable || !info.el)
|
|
165
|
+
throw new Error("nothing here accepts a paste");
|
|
166
|
+
const { html, text } = await readClipboard();
|
|
167
|
+
if (info.isField) {
|
|
168
|
+
// A field holds text, so HTML on the clipboard is pasted as its
|
|
169
|
+
// text — which is what every other app does here.
|
|
170
|
+
if (!text && !html)
|
|
171
|
+
return;
|
|
172
|
+
replaceFieldSelection(info.el, text || stripHtml(html));
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const content = html || (text ? escapeHtml(text).replace(/\r?\n/g, "<br>") : "");
|
|
176
|
+
if (!content)
|
|
177
|
+
return;
|
|
178
|
+
insertHtmlAtSelection(info.el, content);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (!info.canRead)
|
|
182
|
+
throw new Error("this field's contents can't be copied");
|
|
183
|
+
if (!info.selection)
|
|
184
|
+
return; // nothing selected — no-op, not an error
|
|
185
|
+
if (info.isField) {
|
|
186
|
+
await writeClipboard(info.selection);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
await writeClipboard(info.selection, selectionHtml());
|
|
190
|
+
}
|
|
191
|
+
if (id !== "cut")
|
|
192
|
+
return;
|
|
193
|
+
if (!info.editable)
|
|
194
|
+
throw new Error("this text is read-only — copied instead of cut");
|
|
195
|
+
if (info.isField) {
|
|
196
|
+
replaceFieldSelection(info.el, "");
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
try {
|
|
200
|
+
window.getSelection()?.deleteFromDocument();
|
|
201
|
+
}
|
|
202
|
+
catch { /* selection vanished */ }
|
|
203
|
+
}
|
|
204
|
+
/** Rich-editor clipboard (TinyMCE / Quill). Keeps text/html on copy so a
|
|
205
|
+
* formatted quote survives the round trip. */
|
|
206
|
+
async function runEngineClipboard(ne, id) {
|
|
207
|
+
const isTiny = isTinyEngine(ne);
|
|
208
|
+
if (id === "paste") {
|
|
209
|
+
const { html, text } = await readClipboard();
|
|
210
|
+
const content = html || (text ? escapeHtml(text).replace(/\r?\n/g, "<br>") : "");
|
|
211
|
+
if (!content)
|
|
212
|
+
return;
|
|
213
|
+
if (isTiny) {
|
|
214
|
+
ne.execCommand("mceInsertContent", false, content);
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
if (ne?.clipboard?.dangerouslyPasteHTML) {
|
|
218
|
+
const sel = ne.getSelection(true);
|
|
219
|
+
ne.clipboard.dangerouslyPasteHTML(sel?.index ?? 0, content);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
throw new Error("editor doesn't support paste");
|
|
223
|
+
}
|
|
224
|
+
expandToWord(ne);
|
|
225
|
+
let html = "", text = "";
|
|
226
|
+
if (isTiny) {
|
|
227
|
+
html = ne.selection.getContent({ format: "html" });
|
|
228
|
+
text = ne.selection.getContent({ format: "text" });
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
text = pageSelection();
|
|
232
|
+
html = selectionHtml();
|
|
233
|
+
}
|
|
234
|
+
if (!text && !html)
|
|
235
|
+
return;
|
|
236
|
+
await writeClipboard(text, html || undefined);
|
|
237
|
+
if (id !== "cut")
|
|
238
|
+
return;
|
|
239
|
+
if (isTiny) {
|
|
240
|
+
ne.execCommand("Delete");
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
if (typeof ne?.deleteText === "function") {
|
|
244
|
+
const sel = ne.getSelection();
|
|
245
|
+
if (sel?.length)
|
|
246
|
+
ne.deleteText(sel.index, sel.length);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
/** Serialize the current DOM selection as HTML, for a formatting-preserving copy. */
|
|
250
|
+
function selectionHtml() {
|
|
251
|
+
try {
|
|
252
|
+
const sel = window.getSelection();
|
|
253
|
+
if (!sel || sel.rangeCount === 0 || sel.isCollapsed)
|
|
254
|
+
return "";
|
|
255
|
+
const div = document.createElement("div");
|
|
256
|
+
div.appendChild(sel.getRangeAt(0).cloneContents());
|
|
257
|
+
return div.innerHTML;
|
|
258
|
+
}
|
|
259
|
+
catch {
|
|
260
|
+
return "";
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function stripHtml(html) {
|
|
264
|
+
const div = document.createElement("div");
|
|
265
|
+
div.innerHTML = html;
|
|
266
|
+
return div.textContent || "";
|
|
267
|
+
}
|
|
268
|
+
/** Insert `html` at the caret inside a contenteditable host. */
|
|
269
|
+
function insertHtmlAtSelection(host, html) {
|
|
270
|
+
const sel = window.getSelection();
|
|
271
|
+
const frag = document.createRange().createContextualFragment(html);
|
|
272
|
+
if (!sel || sel.rangeCount === 0) {
|
|
273
|
+
host?.appendChild(frag);
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
const range = sel.getRangeAt(0);
|
|
277
|
+
range.deleteContents();
|
|
278
|
+
const last = frag.lastChild;
|
|
279
|
+
range.insertNode(frag);
|
|
280
|
+
if (last) {
|
|
281
|
+
range.setStartAfter(last);
|
|
282
|
+
range.collapse(true);
|
|
283
|
+
sel.removeAllRanges();
|
|
284
|
+
sel.addRange(range);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
/** Select everything in the target — the field's value, or the page selection
|
|
288
|
+
* scoped to the element the menu was opened over. */
|
|
289
|
+
function selectAll(info) {
|
|
290
|
+
if (info.isField && info.el) {
|
|
291
|
+
info.el.select();
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
const host = info.el;
|
|
295
|
+
if (!host)
|
|
296
|
+
return;
|
|
297
|
+
const range = document.createRange();
|
|
298
|
+
range.selectNodeContents(host);
|
|
299
|
+
const sel = window.getSelection();
|
|
300
|
+
sel?.removeAllRanges();
|
|
301
|
+
sel?.addRange(range);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* The clipboard block for a menu, ready to spread into an items array.
|
|
305
|
+
*
|
|
306
|
+
* Returns [] when the right-click landed somewhere none of it applies (a
|
|
307
|
+
* message row with no selection, a folder name, an icon) — so callers can
|
|
308
|
+
* spread it unconditionally without ending up with a menu full of dead
|
|
309
|
+
* entries. Items that apply but aren't currently available (Copy with nothing
|
|
310
|
+
* selected) are shown DISABLED rather than hidden, so the menu doesn't change
|
|
311
|
+
* shape under the pointer.
|
|
312
|
+
*/
|
|
313
|
+
export function editMenuItems(ctx, opts = {}) {
|
|
314
|
+
const report = opts.onError || ((m) => console.warn(`[edit-menu] ${m}`));
|
|
315
|
+
const info = ctx.engine
|
|
316
|
+
? { el: null, editable: true, selection: pageSelection(), canRead: true, isField: false }
|
|
317
|
+
: describeEditTarget(ctx.target);
|
|
318
|
+
// Nothing to offer: not editable, and no text selected to copy.
|
|
319
|
+
if (!ctx.engine && !info.editable && !info.selection)
|
|
320
|
+
return [];
|
|
321
|
+
const run = (id) => () => {
|
|
322
|
+
void runClipboard(ctx, id).catch((e) => {
|
|
323
|
+
const key = id === "cut" ? "Ctrl+X" : id === "copy" ? "Ctrl+C" : "Ctrl+V";
|
|
324
|
+
const what = id[0].toUpperCase() + id.slice(1);
|
|
325
|
+
report(`${what} failed: ${e?.message || e}. ${key} still works.`);
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
const hasSel = !!ctx.engine || !!info.selection;
|
|
329
|
+
const items = [
|
|
330
|
+
{ label: "Cut", action: run("cut"), disabled: !info.editable || !hasSel || !info.canRead },
|
|
331
|
+
{ label: "Copy", action: run("copy"), disabled: !hasSel || !info.canRead },
|
|
332
|
+
{ label: "Paste", action: run("paste"), disabled: !info.editable },
|
|
333
|
+
];
|
|
334
|
+
if (opts.selectAll !== false && !ctx.engine) {
|
|
335
|
+
items.push({ label: "Select all", action: () => selectAll(info) });
|
|
336
|
+
}
|
|
337
|
+
return items;
|
|
338
|
+
}
|
|
339
|
+
//# sourceMappingURL=edit-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-menu.js","sourceRoot":"","sources":["edit-menu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AA4BH;;uCAEuC;AACvC,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAChC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE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