@bobfrankston/rmfmail 1.1.79 → 1.1.80
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 +10 -12
- package/client/android-bootstrap.bundle.js +5 -0
- package/client/android-bootstrap.bundle.js.map +2 -2
- package/client/app.bundle.js +31 -17
- package/client/app.bundle.js.map +3 -3
- package/client/components/message-viewer.js +29 -19
- package/client/components/message-viewer.js.map +1 -1
- package/client/components/message-viewer.ts +28 -19
- package/client/compose/compose.bundle.js +5 -0
- package/client/compose/compose.bundle.js.map +2 -2
- package/client/lib/api-client.js +7 -0
- package/client/lib/api-client.js.map +1 -1
- package/client/lib/api-client.ts +8 -0
- package/client/lib/mailxapi.js +3 -0
- package/npmchanges.md +17 -0
- package/package.json +3 -3
- package/packages/mailx-service/index.d.ts +9 -0
- package/packages/mailx-service/index.d.ts.map +1 -1
- package/packages/mailx-service/index.js +26 -0
- package/packages/mailx-service/index.js.map +1 -1
- package/packages/mailx-service/index.ts +25 -0
- package/packages/mailx-service/jsonrpc.js +2 -0
- package/packages/mailx-service/jsonrpc.js.map +1 -1
- package/packages/mailx-service/jsonrpc.ts +2 -0
- package/packages/mailx-store-web/package.json +1 -1
- package/packages/mailx-store-web/web-service.d.ts +4 -0
- package/packages/mailx-store-web/web-service.d.ts.map +1 -1
- package/packages/mailx-store-web/web-service.js +3 -0
- package/packages/mailx-store-web/web-service.js.map +1 -1
- package/packages/mailx-store-web/web-service.ts +3 -0
- package/packages/mailx-types/mailx-api.d.ts +4 -0
- package/packages/mailx-types/mailx-api.d.ts.map +1 -1
- package/packages/mailx-types/mailx-api.ts +1 -0
- package/packages/mailx-types/package.json +1 -1
- /package/packages/mailx-imap/{node_modules.npmglobalize-stash-81260 → node_modules.npmglobalize-stash-78668}/.package-lock.json +0 -0
package/client/app.bundle.js
CHANGED
|
@@ -71,6 +71,7 @@ __export(api_client_exports, {
|
|
|
71
71
|
moveMessages: () => moveMessages,
|
|
72
72
|
onEvent: () => onEvent,
|
|
73
73
|
onWsEvent: () => onWsEvent,
|
|
74
|
+
openAttachment: () => openAttachment,
|
|
74
75
|
openInTextEditor: () => openInTextEditor,
|
|
75
76
|
openInWord: () => openInWord,
|
|
76
77
|
openLocalPath: () => openLocalPath,
|
|
@@ -503,6 +504,10 @@ function setupAccount(name, email, password) {
|
|
|
503
504
|
async function getAttachment(accountId, uid, attachmentId, folderId) {
|
|
504
505
|
return ipc().getAttachment(accountId, uid, attachmentId, folderId);
|
|
505
506
|
}
|
|
507
|
+
async function openAttachment(accountId, uid, attachmentId, folderId) {
|
|
508
|
+
const fn = ipc().openAttachment;
|
|
509
|
+
return fn ? fn(accountId, uid, attachmentId, folderId) : void 0;
|
|
510
|
+
}
|
|
506
511
|
async function getDeviceAccounts() {
|
|
507
512
|
return ipc().getDeviceAccounts?.() ?? [];
|
|
508
513
|
}
|
|
@@ -1661,27 +1666,36 @@ async function showMessage(accountId, uid, folderId, specialUse, isRetry = false
|
|
|
1661
1666
|
chip.addEventListener("click", async (e) => {
|
|
1662
1667
|
e.preventDefault();
|
|
1663
1668
|
try {
|
|
1664
|
-
const data = await getAttachment(accountId, uid, i, msg.folderId);
|
|
1665
1669
|
const bridge = window._nativeBridge;
|
|
1666
1670
|
if (bridge?.openAttachment) {
|
|
1667
|
-
await
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
const
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
a.click();
|
|
1678
|
-
setTimeout(() => {
|
|
1679
|
-
a.remove();
|
|
1680
|
-
URL.revokeObjectURL(url);
|
|
1681
|
-
}, 5e3);
|
|
1671
|
+
const data2 = await getAttachment(accountId, uid, i, msg.folderId);
|
|
1672
|
+
await bridge.openAttachment(att.filename, data2.contentType, data2.content);
|
|
1673
|
+
return;
|
|
1674
|
+
}
|
|
1675
|
+
try {
|
|
1676
|
+
const res = await openAttachment(accountId, uid, i, msg.folderId);
|
|
1677
|
+
if (res?.ok)
|
|
1678
|
+
return;
|
|
1679
|
+
} catch (svcErr) {
|
|
1680
|
+
console.warn(`[attachment] service open failed, falling back to blob: ${svcErr?.message || svcErr}`);
|
|
1682
1681
|
}
|
|
1682
|
+
const data = await getAttachment(accountId, uid, i, msg.folderId);
|
|
1683
|
+
const bytes = Uint8Array.from(atob(data.content), (c) => c.charCodeAt(0));
|
|
1684
|
+
const blob = new Blob([bytes], { type: data.contentType });
|
|
1685
|
+
const url = URL.createObjectURL(blob);
|
|
1686
|
+
const a = document.createElement("a");
|
|
1687
|
+
a.href = url;
|
|
1688
|
+
a.download = att.filename || "attachment";
|
|
1689
|
+
a.style.display = "none";
|
|
1690
|
+
document.body.appendChild(a);
|
|
1691
|
+
a.click();
|
|
1692
|
+
setTimeout(() => {
|
|
1693
|
+
a.remove();
|
|
1694
|
+
URL.revokeObjectURL(url);
|
|
1695
|
+
}, 5e3);
|
|
1683
1696
|
} catch (err) {
|
|
1684
|
-
console.error(`Attachment
|
|
1697
|
+
console.error(`Attachment open failed: ${err?.message || err}`);
|
|
1698
|
+
alert(`Couldn't open "${att.filename}": ${err?.message || err}`);
|
|
1685
1699
|
}
|
|
1686
1700
|
});
|
|
1687
1701
|
chip.draggable = true;
|