domma-cms 1.71.1 → 1.73.0
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/CHANGELOG.md +13 -0
- package/docs/DommaFeatures.md +1 -0
- package/package.json +1 -1
- package/plugins/_lib/admin/mail/body-menu.js +1 -1
- package/plugins/_lib/admin/mail/cms-host.js +1 -1
- package/plugins/_lib/admin/mail/compose-window.js +90 -3
- package/plugins/_lib/admin/mail/contacts.js +1 -1
- package/plugins/_lib/admin/mail/diagnostics-section.js +75 -41
- package/plugins/_lib/admin/mail/drag-drop.js +1 -1
- package/plugins/_lib/admin/mail/folder-tree.js +1 -1
- package/plugins/_lib/admin/mail/font-controls.js +1 -1
- package/plugins/_lib/admin/mail/fonts.js +1 -1
- package/plugins/_lib/admin/mail/host-context.js +1 -1
- package/plugins/_lib/admin/mail/identity.js +1 -1
- package/plugins/_lib/admin/mail/image-senders-section.js +156 -99
- package/plugins/_lib/admin/mail/keyboard.js +1 -1
- package/plugins/_lib/admin/mail/mail.css +1 -1
- package/plugins/_lib/admin/mail/mail.html +1 -1
- package/plugins/_lib/admin/mail/message-actions.js +1 -1
- package/plugins/_lib/admin/mail/oauth-panel.js +1 -1
- package/plugins/_lib/admin/mail/panes.js +1 -1
- package/plugins/_lib/admin/mail/reader-kit.js +12 -4
- package/plugins/_lib/admin/mail/reader-runtime.js +372 -96
- package/plugins/_lib/admin/mail/reader-view.js +1 -1
- package/plugins/_lib/admin/mail/resizable.js +1 -1
- package/plugins/_lib/admin/mail/restore-spam.js +1 -1
- package/plugins/_lib/admin/mail/rules.js +1 -1
- package/plugins/_lib/admin/mail/scheduling.js +1 -1
- package/plugins/_lib/admin/mail/section-kit.js +1 -1
- package/plugins/_lib/admin/mail/security-note.js +1 -1
- package/plugins/_lib/admin/mail/settings-section.js +156 -99
- package/plugins/_lib/admin/mail/templates.js +1 -1
- package/plugins/_lib/admin/mail/threads.js +1 -1
- package/plugins/_lib/admin/mail/vacation.js +45 -1
- package/plugins/_lib/admin/mail/when-closed.js +1 -1
- package/plugins/_lib/admin/ui/dates.js +1 -1
- package/plugins/_lib/admin/ui/resizable.js +1 -1
- package/plugins/_lib/admin/ui/rich-field.js +291 -0
- package/plugins/_lib/domma-mail.lock.json +83 -80
- package/plugins/_lib/mail/accountFileStore.js +1 -1
- package/plugins/_lib/mail/accountRepository.js +31 -3
- package/plugins/_lib/mail/accountRoutes.js +1 -1
- package/plugins/_lib/mail/accounts.js +1 -1
- package/plugins/_lib/mail/bodyTokenProvider.js +1 -1
- package/plugins/_lib/mail/bodyTokens.js +1 -1
- package/plugins/_lib/mail/compose.js +1 -1
- package/plugins/_lib/mail/defaults.js +1 -1
- package/plugins/_lib/mail/envelope.js +1 -1
- package/plugins/_lib/mail/folderActions.js +1 -1
- package/plugins/_lib/mail/folderRuntime.js +1 -1
- package/plugins/_lib/mail/folders.js +1 -1
- package/plugins/_lib/mail/imapPoolRuntime.js +1 -1
- package/plugins/_lib/mail/mbox.js +1 -1
- package/plugins/_lib/mail/message-action.js +1 -1
- package/plugins/_lib/mail/messageSecurity.js +1 -1
- package/plugins/_lib/mail/messageSecurityProvider.js +1 -1
- package/plugins/_lib/mail/networkAddresses.js +1 -1
- package/plugins/_lib/mail/networkPolicy.js +1 -1
- package/plugins/_lib/mail/oauthAccounts.js +1 -1
- package/plugins/_lib/mail/oauthRouteRuntime.js +1 -1
- package/plugins/_lib/mail/oauthRuntime.js +1 -1
- package/plugins/_lib/mail/pollSchedule.js +1 -1
- package/plugins/_lib/mail/poller.js +1 -1
- package/plugins/_lib/mail/pollerRuntime.js +1 -1
- package/plugins/_lib/mail/priority.js +1 -1
- package/plugins/_lib/mail/publicMailbox.js +1 -1
- package/plugins/_lib/mail/readRuntime.js +1 -1
- package/plugins/_lib/mail/render.js +1 -1
- package/plugins/_lib/mail/ruleRunner.js +1 -1
- package/plugins/_lib/mail/schedulerRuntime.js +1 -1
- package/plugins/_lib/mail/secretProvider.js +1 -1
- package/plugins/_lib/mail/secretbox.js +1 -1
- package/plugins/_lib/mail/senderAuth.js +1 -1
- package/plugins/_lib/mail/sieve.js +1 -1
- package/plugins/_lib/mail/smtpService.js +1 -1
- package/plugins/_lib/mail/snoozeRuntime.js +1 -1
- package/plugins/_lib/mail/store.js +1 -1
- package/plugins/_lib/mail/subscriptions.js +1 -1
- package/plugins/_lib/mail/syncPlan.js +1 -1
- package/plugins/_lib/mail/syncRuntime.js +1 -1
- package/plugins/_lib/mail/syncSelection.js +1 -1
- package/plugins/_lib/mail/unreadBadge.js +1 -1
- package/plugins/_lib/mail/unsubscribe.js +1 -1
- package/plugins/_lib/mail/vacationRuntime.js +1 -1
- package/plugins/_lib/mail/write.js +1 -1
- package/plugins/_lib/public/rich-text.mjs +104 -0
- package/plugins/_lib/rich-text.js +153 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.73.0] - 2026-11-17
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Mail settings is its own screen** (Domma Mail core 0.32.0). Email settings open on a grouped screen with a left-hand list of sections, and the compose window offers an edition's sender identities. Email Pro uses these for identity cards and branding.
|
|
8
|
+
- **Several saved away messages.** The mail account store exports the saved away messages, so an edition can keep more than one and switch between them.
|
|
9
|
+
|
|
10
|
+
## [1.72.0] - 2026-11-17
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Mail compose takes an edition's own panel** (Domma Mail core 0.31.0). The shared compose window has a slot above the message that a Tool can fill and add fields to Save and Send; Email Pro uses it for its branding picker. Nothing changes without such a Tool.
|
|
15
|
+
|
|
3
16
|
## [1.71.1] - 2026-11-17
|
|
4
17
|
|
|
5
18
|
### Changed
|
package/docs/DommaFeatures.md
CHANGED
|
@@ -2090,6 +2090,7 @@ A full email client in the admin: connect your own IMAP mailboxes, read, write,
|
|
|
2090
2090
|
- **Replies for Campaigns Pro (0.18.0)**: Campaigns Pro can summarise the replies to a campaign sent from the mailbox - Email finds them in that mailbox's inbox by the Message-IDs they answer and hands over only their words and dates, never who wrote them; out-of-office answers are left out and nothing is marked read or moved.
|
|
2091
2091
|
- Keyboard shortcuts: j/k or arrows to move, Enter open, u read/unread, s star, r reply, Shift+R or a reply all, f forward, c compose, `/` search, x select, Shift+A select all, `!` spam, `#` or Delete delete, Esc, `?` help.
|
|
2092
2092
|
- Sidebar badge (`/unread`): unread in Inbox (counted from the store).
|
|
2093
|
+
- **Branding (unreleased)**: Settings > **Branding** keeps up to 20 personal brandings - header artwork (width, position, description, strapline, header background), a backdrop (solid colour, 15 gradients - Surveys' 8 plus Midnight, Navy, Teal, Sand, Rose gold, Charcoal and Aurora - a pattern, or a picture darkened and blurred on the server), font (safe fonts and Google web fonts with named fallbacks) and weight, text/accent/message colours, and a footer (plain, an accent band, or an overlay on the backdrop) with photo, name, role, company, return email, phone, website, up to four links, address and small print. Pictures come from Media, the File Store or an upload (resized, metadata stripped, served publicly at an unguessable address). Which branding a message gets: chosen in the compose window, else the first To recipient's address, domain or Contacts company, else the sender's (per identity), else the general default. New messages get the full design (600px fluid tables, a solid colour under every gradient/picture for Outlook); replies and forwards only the contact line. Branded on Send, before Undo/Send later. The compose window's Branding row uses the core `extensions.compose` hook (domma-mail compose window); older cores brand automatically with no picker. Routes `/api/plugins/email-pro/branding*`.
|
|
2093
2094
|
- Notifications to the mailbox owner only: `email-pro:mailbox` (warning after 5 failed checks in a row; resolved when a check works) and `email-pro:sending` (a scheduled/undo-send message that failed).
|
|
2094
2095
|
- Permission `email` (read = Use: add own mailboxes, read and send) granted to `admin`.
|
|
2095
2096
|
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/admin/mail/body-menu.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The reading pane's right-click menu - the pure parts.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/admin/mail/cms-host.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** The CMS shell boundary. Standalone never imports this adapter. */
|
|
4
4
|
const version = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/admin/mail/compose-window.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
4
4
|
const {createMailHost} = await import(new URL(`./host-context.js?v=${MAIL_MODULE_VERSION}`, import.meta.url).href);
|
|
@@ -270,6 +270,7 @@ export function createComposeWindow(mailHost) {
|
|
|
270
270
|
<label class="form-label">Subject</label>
|
|
271
271
|
<input type="text" class="form-input" data-ref="subject">
|
|
272
272
|
</div>
|
|
273
|
+
<div class="mail-compose-extension" data-ref="extension" hidden></div>
|
|
273
274
|
<div class="mail-compose-body">
|
|
274
275
|
<label class="form-label">Message</label>
|
|
275
276
|
<div class="flex items-center gap-2 mail-template-row" data-bind-hidden="!hasTemplates">
|
|
@@ -336,7 +337,8 @@ export function createComposeWindow(mailHost) {
|
|
|
336
337
|
draft: opened = {}, base, accountId, api, maxAttachmentBytes = 20_000_000,
|
|
337
338
|
onSent = () => {}, onSaved = () => {}, onQueued = () => {}, contacts = [],
|
|
338
339
|
identities = [], mailboxAddress = '', templates = [], undoSeconds = 0,
|
|
339
|
-
mode = 'new', defaults = null, security = null, prefs = {}, capabilities = {}
|
|
340
|
+
mode = 'new', defaults = null, security = null, prefs = {}, capabilities = {},
|
|
341
|
+
composeExtension = null
|
|
340
342
|
}) {
|
|
341
343
|
// How this message was started, decided once. A reopened draft is never
|
|
342
344
|
// treated as new: it already carries the signature it was written with,
|
|
@@ -538,6 +540,7 @@ export function createComposeWindow(mailHost) {
|
|
|
538
540
|
|
|
539
541
|
fromSelect.addEventListener('change', () => {
|
|
540
542
|
currentIdentity = findIdentity(identities, fromSelect.value);
|
|
543
|
+
tellExtension('identityChanged', currentIdentity);
|
|
541
544
|
// The signature in the body belongs to whoever was sending a
|
|
542
545
|
// moment ago. Swapped where it can be found and left alone where
|
|
543
546
|
// it cannot - see `swapSignature`.
|
|
@@ -708,6 +711,83 @@ export function createComposeWindow(mailHost) {
|
|
|
708
711
|
: 'Discard this message? It has not been saved as a draft.';
|
|
709
712
|
}
|
|
710
713
|
|
|
714
|
+
// ---- An edition's compose extension --------------------------------
|
|
715
|
+
//
|
|
716
|
+
// `composeExtension(context)` (createReaderView's `extensions.compose`)
|
|
717
|
+
// may draw into its own slot above the message and answer extra fields
|
|
718
|
+
// for Save and Send. It is told when the sender or the recipients
|
|
719
|
+
// change, and when the window closes. Anything it throws is logged and
|
|
720
|
+
// costs the extension, never the message.
|
|
721
|
+
let extension = null;
|
|
722
|
+
const RESERVED = new Set(['to', 'cc', 'bcc', 'subject', 'body', 'html', 'attachments', 'identityId',
|
|
723
|
+
'inReplyTo', 'references', 'sourceMessage', 'sign', 'encrypt', 'priority', 'readReceipt',
|
|
724
|
+
'deliveryReceipt', 'sendAt', 'replaces']);
|
|
725
|
+
function tellExtension(name, ...args) {
|
|
726
|
+
try { extension?.[name]?.(...args); } catch (err) { console.warn(`[mail] compose extension ${name} failed:`, err); }
|
|
727
|
+
}
|
|
728
|
+
function extensionFields() {
|
|
729
|
+
try {
|
|
730
|
+
const fields = extension?.fields?.();
|
|
731
|
+
if (!fields || typeof fields !== 'object') return {};
|
|
732
|
+
return Object.fromEntries(Object.entries(fields).filter(([key]) => !RESERVED.has(key)));
|
|
733
|
+
} catch (err) {
|
|
734
|
+
console.warn('[mail] compose extension fields failed:', err);
|
|
735
|
+
return {};
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
function startExtension() {
|
|
739
|
+
if (typeof composeExtension !== 'function') return;
|
|
740
|
+
const slot = ref('extension');
|
|
741
|
+
let timer = null;
|
|
742
|
+
const recipientsChanged = () => {
|
|
743
|
+
clearTimeout(timer);
|
|
744
|
+
timer = setTimeout(() => tellExtension('recipientsChanged', recipients()), 400);
|
|
745
|
+
};
|
|
746
|
+
const recipients = () => ({
|
|
747
|
+
to: textToAddresses(toInput.value),
|
|
748
|
+
cc: textToAddresses(ccInput.value),
|
|
749
|
+
bcc: textToAddresses(bccInput.value)
|
|
750
|
+
});
|
|
751
|
+
try {
|
|
752
|
+
extension = composeExtension({
|
|
753
|
+
slot,
|
|
754
|
+
accountId,
|
|
755
|
+
api,
|
|
756
|
+
base,
|
|
757
|
+
mode: openedAs,
|
|
758
|
+
isReply: Boolean(draft.inReplyTo) || openedAs === 'forward',
|
|
759
|
+
draft: opened,
|
|
760
|
+
identity: () => currentIdentity,
|
|
761
|
+
// The senders the From picker offers (none when there is no choice), and a way
|
|
762
|
+
// to choose one - it goes through the picker, so the signature swap happens too.
|
|
763
|
+
identities: hasFrom ? identities.map(entry => ({id: entry.id, label: entry.label,
|
|
764
|
+
from: identityFrom(entry, mailboxAddress)})) : [],
|
|
765
|
+
setIdentity: (id) => {
|
|
766
|
+
if (!hasFrom || !findIdentity(identities, id) || fromSelect.value === id) return;
|
|
767
|
+
fromSelect.value = id;
|
|
768
|
+
fromSelect.dispatchEvent(new Event('change'));
|
|
769
|
+
},
|
|
770
|
+
// An extension that offers the senders itself may fold the From row away.
|
|
771
|
+
hideFrom: (on = true) => {
|
|
772
|
+
const row = fromSelect.closest('.form-group');
|
|
773
|
+
if (row) row.style.display = on ? 'none' : '';
|
|
774
|
+
},
|
|
775
|
+
recipients,
|
|
776
|
+
show: (on = true) => { slot.hidden = !on; },
|
|
777
|
+
helpPopovers: (root) => helpPopovers?.(root)
|
|
778
|
+
}) ?? null;
|
|
779
|
+
} catch (err) {
|
|
780
|
+
console.warn('[mail] compose extension failed to start:', err);
|
|
781
|
+
extension = null;
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
for (const input of [toInput, ccInput, bccInput]) {
|
|
785
|
+
input.addEventListener('input', recipientsChanged);
|
|
786
|
+
input.addEventListener('change', recipientsChanged);
|
|
787
|
+
}
|
|
788
|
+
closedListeners.push(() => clearTimeout(timer));
|
|
789
|
+
}
|
|
790
|
+
|
|
711
791
|
/**
|
|
712
792
|
* The message as it currently stands.
|
|
713
793
|
*
|
|
@@ -740,7 +820,11 @@ export function createComposeWindow(mailHost) {
|
|
|
740
820
|
references: draft.references ?? [],
|
|
741
821
|
sourceMessage: draft.sourceMessage ?? null,
|
|
742
822
|
attachments: attachments.peek().map(({filename, contentType, content}) =>
|
|
743
|
-
({filename, contentType, content}))
|
|
823
|
+
({filename, contentType, content})),
|
|
824
|
+
// An edition's own fields (Email Pro's branding). Spread last
|
|
825
|
+
// but never over the message itself: a hook that names `to` or
|
|
826
|
+
// `html` is ignored for that key.
|
|
827
|
+
...extensionFields()
|
|
744
828
|
};
|
|
745
829
|
}
|
|
746
830
|
|
|
@@ -1056,6 +1140,7 @@ export function createComposeWindow(mailHost) {
|
|
|
1056
1140
|
// Before the editor: it closes an open menu (left on <body> by a
|
|
1057
1141
|
// Ctrl+Enter send) and drops its dropdowns and window listener.
|
|
1058
1142
|
fontControls?.destroy();
|
|
1143
|
+
tellExtension('close');
|
|
1059
1144
|
editor?.destroy?.();
|
|
1060
1145
|
stopResizing();
|
|
1061
1146
|
for (const suggester of suggesters) suggester.destroy?.();
|
|
@@ -1072,6 +1157,8 @@ export function createComposeWindow(mailHost) {
|
|
|
1072
1157
|
setTimeout(() => { try { slideover.element?.remove(); } catch { /* gone */ } }, 400);
|
|
1073
1158
|
});
|
|
1074
1159
|
|
|
1160
|
+
startExtension();
|
|
1161
|
+
|
|
1075
1162
|
return {
|
|
1076
1163
|
/** Whether closing would lose something the reader wrote. */
|
|
1077
1164
|
dirty: () => !closed && unsaved(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/admin/mail/contacts.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Recipient suggestions from the host address book.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/admin/mail/diagnostics-section.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The settings section that answers "which build is this, and what went wrong".
|
|
@@ -52,60 +52,94 @@ export function createDiagnosticsSection(host) {
|
|
|
52
52
|
* @returns {Promise<void>}
|
|
53
53
|
*/
|
|
54
54
|
async function render(container, ctx) {
|
|
55
|
-
const
|
|
55
|
+
const M = ctx.host?.M ?? globalThis.M;
|
|
56
56
|
const server = await ctx.api(`${ctx.base}/diagnostics`);
|
|
57
|
+
if (!container.isConnected) return;
|
|
57
58
|
const loaded = loadedAssetVersions();
|
|
58
59
|
|
|
59
|
-
const entryVersion = loaded['mail.js'] ?? '(unknown)';
|
|
60
|
-
kit.heading(container, `${server.plugin.name} ${server.plugin.version ?? '?'} \u00b7 build ${entryVersion}`);
|
|
61
|
-
|
|
62
60
|
// The comparison that matters: the token this page was served under
|
|
63
61
|
// against the token the server would issue now. Comparing a module's
|
|
64
62
|
// own mtime would be wrong - the shared files are fetched under the
|
|
65
63
|
// entry's token, not their own.
|
|
66
64
|
const served = server.assets.expectedStamp;
|
|
67
65
|
const running = loaded['mail.js'];
|
|
68
|
-
const stale = running && running !== '(unversioned)' && String(served) !== String(running);
|
|
69
|
-
|
|
70
|
-
const verdict = kit.note(container, stale
|
|
71
|
-
? `This page is running an older build than the server has (${running} vs ${served}). Reload with a hard refresh before reporting anything else.`
|
|
72
|
-
: 'This page is running the build the server is serving.');
|
|
73
|
-
if (stale) verdict.classList.add('text-danger');
|
|
74
|
-
|
|
66
|
+
const stale = Boolean(running && running !== '(unversioned)' && String(served) !== String(running));
|
|
75
67
|
const errors = host.recentErrors();
|
|
76
|
-
kit.note(container, errors.length
|
|
77
|
-
? `${errors.length} error(s) captured since this view opened - included in the report.`
|
|
78
|
-
: 'No errors captured since this view opened.');
|
|
79
68
|
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
69
|
+
const report = () => JSON.stringify({
|
|
70
|
+
page: {url: location.href, userAgent: navigator.userAgent, loadedAssets: loaded, view: host.state()},
|
|
71
|
+
server,
|
|
72
|
+
errors
|
|
73
|
+
}, null, 2);
|
|
74
|
+
|
|
75
|
+
// Built with domma-reactive. Values reach the page through bindings, never markup.
|
|
76
|
+
const root = document.createElement('div');
|
|
77
|
+
root.className = 'mail-diagnostics';
|
|
78
|
+
root.innerHTML = `
|
|
79
|
+
<h4 class="mail-section-heading" data-bind-text="title"></h4>
|
|
80
|
+
<p class="text-sm" data-bind-class="stale ? 'text-danger' : 'text-muted'" data-bind-text="verdict"></p>
|
|
81
|
+
<p class="text-sm text-muted" data-bind-text="errorLine"></p>
|
|
82
|
+
<div class="mail-sender-list mb-2" data-bind-hidden="!errorRows.length" data-each="errorRows key=key">
|
|
83
|
+
<div class="mail-box-row"><span class="flex-1 text-sm mail-ellipsis" data-bind-text="text" data-bind-title="text"></span></div>
|
|
84
|
+
</div>
|
|
85
|
+
<details class="mb-2"><summary class="text-sm">What this page loaded <span data-help-title="Loaded files" data-help="Each shared file this page is running and the build token it was fetched with. A file older than the rest means the browser kept a cached copy."></span></summary>
|
|
86
|
+
<div class="mail-sender-list mt-1" data-each="assets key=name">
|
|
87
|
+
<div class="mail-box-row"><span class="flex-1 text-sm mail-ellipsis font-mono" data-bind-text="name"></span><span class="text-xs text-muted font-mono" data-bind-text="version"></span></div>
|
|
88
|
+
</div>
|
|
89
|
+
</details>
|
|
90
|
+
<div class="flex items-center gap-2">
|
|
91
|
+
<button type="button" class="btn btn-sm btn-primary" data-on-click="copy">Copy diagnostics</button>
|
|
92
|
+
<span data-help-title="Copy diagnostics" data-help="Puts a report on the clipboard: this page's build and loaded files, the mailbox and folder on screen, where the list came from, the server's versions and recent errors. Never a password or a message's content."></span>
|
|
93
|
+
<button type="button" class="btn btn-sm btn-ghost" data-on-click="reload" data-bind-hidden="!stale">Reload with a hard refresh</button>
|
|
94
|
+
<span class="text-sm flex-1" data-bind-class="tone.value" data-bind-text="status.value"></span>
|
|
95
|
+
</div>
|
|
96
|
+
<textarea class="form-textarea mail-diag-log" readonly data-bind-hidden="!fallback.value" data-model="fallbackText.value" aria-label="Diagnostics report"></textarea>`;
|
|
97
|
+
const m = {
|
|
98
|
+
title: `${server.plugin.name} ${server.plugin.version ?? '?'} \u00b7 build ${loaded['mail.js'] ?? '(unknown)'}`,
|
|
99
|
+
stale,
|
|
100
|
+
verdict: stale
|
|
101
|
+
? `This page is running an older build than the server has (${running} vs ${served}). Reload with a hard refresh before reporting anything else.`
|
|
102
|
+
: 'This page is running the build the server is serving.',
|
|
103
|
+
errorLine: errors.length
|
|
104
|
+
? `${errors.length} error(s) captured since this view opened - included in the report.`
|
|
105
|
+
: 'No errors captured since this view opened.',
|
|
106
|
+
errorRows: errors.slice(-10).map((e, i) => ({key: `e${i}`, text: String(e?.message ?? e?.text ?? e ?? '')})),
|
|
107
|
+
assets: Object.entries(loaded).sort(([a], [b]) => a.localeCompare(b)).map(([name, version]) => ({name, version})),
|
|
108
|
+
status: M.observable(''),
|
|
109
|
+
tone: M.observable('text-muted'),
|
|
110
|
+
fallback: M.observable(false),
|
|
111
|
+
fallbackText: M.observable(''),
|
|
112
|
+
async copy() {
|
|
113
|
+
const text = report();
|
|
114
|
+
try {
|
|
115
|
+
await navigator.clipboard.writeText(text);
|
|
116
|
+
m.status.value = 'Copied. Paste it into the report.';
|
|
117
|
+
m.tone.value = 'text-success';
|
|
118
|
+
} catch {
|
|
119
|
+
// Clipboard access can be refused; showing the text is still better than losing it.
|
|
120
|
+
m.fallbackText.value = text;
|
|
121
|
+
m.fallback.value = true;
|
|
122
|
+
m.status.value = 'Clipboard unavailable - select and copy the text below.';
|
|
123
|
+
m.tone.value = 'text-muted';
|
|
124
|
+
setTimeout(() => root.querySelector('.mail-diag-log')?.select(), 0);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
reload() { location.reload(); }
|
|
128
|
+
};
|
|
129
|
+
container.appendChild(root);
|
|
130
|
+
const bindings = M.applyBindings(m, root);
|
|
131
|
+
ctx.onClose?.(() => { try { bindings?.dispose?.(); } catch { /* gone */ } });
|
|
105
132
|
}
|
|
106
133
|
|
|
107
134
|
return {
|
|
108
135
|
id: 'diagnostics', label: 'Diagnostics', render,
|
|
109
|
-
help: 'What this screen can see about itself - whether it runs the build the server is serving, the mailbox and folder, where the list came from, and recent errors. Copy diagnostics puts it on the clipboard for a report.'
|
|
136
|
+
help: 'What this screen can see about itself - whether it runs the build the server is serving, the mailbox and folder, where the list came from, and recent errors. Copy diagnostics puts it on the clipboard for a report.',
|
|
137
|
+
guide: `<p>For when something is not right: what this screen knows about itself, ready to send to whoever is helping.</p>
|
|
138
|
+
<h4>The build</h4>
|
|
139
|
+
<p>The first line compares the build this page is running with the one the server is serving. If they differ, the browser is using an old copy: reload with a hard refresh (Ctrl+Shift+R, or Cmd+Shift+R on a Mac) before anything else.</p>
|
|
140
|
+
<h4>Errors</h4>
|
|
141
|
+
<p>Errors this screen has hit since it opened are counted and the most recent are listed.</p>
|
|
142
|
+
<h4>Copy diagnostics</h4>
|
|
143
|
+
<p>Puts a report on the clipboard - the build, the files loaded, the mailbox and folder on screen, where the message list came from, the server's versions and recent errors. It never includes a password or the content of a message. Paste it into your report.</p>`
|
|
110
144
|
};
|
|
111
145
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/admin/mail/drag-drop.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** Drag identities include the mailbox and source folder: UIDs alone are not unique. */
|
|
4
4
|
const PROTECTED_USES = new Set(['\\Inbox', '\\Sent', '\\Drafts', '\\Trash', '\\Junk', '\\Archive', '\\All', '\\Flagged']);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/admin/mail/folder-tree.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Mail folder presentation, shared by the Mail Reader and Email Pro.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/admin/mail/font-controls.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/admin/mail/fonts.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The fonts and sizes the mail editor offers - pure, so both the compose
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/admin/mail/host-context.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** Services supplied by the application that hosts the shared mail interface. */
|
|
4
4
|
export function createMailApi({getToken, fetch: request = globalThis.fetch, onUnauthorized = () => {}}) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/admin/mail/identity.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Who a mailbox sends as, and what it signs off with.
|