@bobfrankston/rmfmail 1.2.132 → 1.2.133
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/bin/mailx.js +11 -0
- package/bin/mailx.js.map +1 -1
- package/bin/mailx.ts +11 -0
- package/client/compose/compose.bundle.js +56 -0
- package/client/compose/compose.bundle.js.map +2 -2
- package/client/compose/compose.js +67 -0
- package/client/compose/compose.js.map +1 -1
- package/client/compose/compose.ts +41 -0
- package/client/compose/editor.js +3 -0
- package/client/compose/editor.js.map +1 -1
- package/client/compose/editor.ts +6 -0
- package/package.json +3 -3
|
@@ -3486,6 +3486,9 @@ function createQuillEditor(container2) {
|
|
|
3486
3486
|
}
|
|
3487
3487
|
});
|
|
3488
3488
|
return {
|
|
3489
|
+
// Raw engine handle — same contract as rmf-tiny's nativeEditor. Used
|
|
3490
|
+
// by compose's native-context-menu command handler to run formatting.
|
|
3491
|
+
nativeEditor: q,
|
|
3489
3492
|
setHtml(html) {
|
|
3490
3493
|
q.clipboard.dangerouslyPasteHTML(html);
|
|
3491
3494
|
},
|
|
@@ -5272,6 +5275,59 @@ async function popoutHandoff() {
|
|
|
5272
5275
|
window.addEventListener("compose-popout", () => {
|
|
5273
5276
|
void popoutHandoff();
|
|
5274
5277
|
});
|
|
5278
|
+
window.__msgerContextCommand = (id) => {
|
|
5279
|
+
const ne = editor?.nativeEditor;
|
|
5280
|
+
if (!ne) return;
|
|
5281
|
+
const isTiny = typeof ne.execCommand === "function" && ne.selection;
|
|
5282
|
+
if (isTiny) {
|
|
5283
|
+
try {
|
|
5284
|
+
if (ne.selection.isCollapsed() && typeof ne.selection.expand === "function") ne.selection.expand({ type: "word" });
|
|
5285
|
+
} catch {
|
|
5286
|
+
}
|
|
5287
|
+
const cmd = { bold: "Bold", italic: "Italic", underline: "Underline", strike: "Strikethrough", link: "mceLink", clear: "RemoveFormat" };
|
|
5288
|
+
if (cmd[id]) ne.execCommand(cmd[id]);
|
|
5289
|
+
return;
|
|
5290
|
+
}
|
|
5291
|
+
if (typeof ne.format === "function" && typeof ne.getSelection === "function") {
|
|
5292
|
+
let sel = ne.getSelection();
|
|
5293
|
+
if (sel && sel.length === 0) {
|
|
5294
|
+
const text = ne.getText();
|
|
5295
|
+
let a = sel.index, b = sel.index;
|
|
5296
|
+
while (a > 0 && /S/.test(text[a - 1])) a--;
|
|
5297
|
+
while (b < text.length && /S/.test(text[b])) b++;
|
|
5298
|
+
if (b > a) {
|
|
5299
|
+
ne.setSelection(a, b - a);
|
|
5300
|
+
sel = { index: a, length: b - a };
|
|
5301
|
+
}
|
|
5302
|
+
}
|
|
5303
|
+
if (!sel || sel.length === 0) return;
|
|
5304
|
+
const cur = ne.getFormat(sel);
|
|
5305
|
+
switch (id) {
|
|
5306
|
+
case "bold":
|
|
5307
|
+
ne.format("bold", !cur.bold);
|
|
5308
|
+
break;
|
|
5309
|
+
case "italic":
|
|
5310
|
+
ne.format("italic", !cur.italic);
|
|
5311
|
+
break;
|
|
5312
|
+
case "underline":
|
|
5313
|
+
ne.format("underline", !cur.underline);
|
|
5314
|
+
break;
|
|
5315
|
+
case "strike":
|
|
5316
|
+
ne.format("strike", !cur.strike);
|
|
5317
|
+
break;
|
|
5318
|
+
case "clear":
|
|
5319
|
+
ne.removeFormat(sel.index, sel.length);
|
|
5320
|
+
break;
|
|
5321
|
+
// link: Quill's dialog lives in its keyboard binding — Ctrl+K.
|
|
5322
|
+
case "link":
|
|
5323
|
+
try {
|
|
5324
|
+
ne.root.dispatchEvent(new KeyboardEvent("keydown", { key: "K", ctrlKey: true, bubbles: true, cancelable: true }));
|
|
5325
|
+
} catch {
|
|
5326
|
+
}
|
|
5327
|
+
break;
|
|
5328
|
+
}
|
|
5329
|
+
}
|
|
5330
|
+
};
|
|
5275
5331
|
var ccRow = document.getElementById("compose-cc-row");
|
|
5276
5332
|
var bccRow = document.getElementById("compose-bcc-row");
|
|
5277
5333
|
var toggleCcBtn = document.getElementById("btn-toggle-cc");
|