domma-cms 1.77.0 → 1.79.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 +20 -0
- package/admin/js/lib/site-settings-arrange.js +3 -3
- package/admin/js/templates/docs/usage-site-settings.html +29 -1
- package/admin/js/templates/settings.html +19 -0
- package/admin/js/views/settings.js +3 -3
- package/docs/DommaFeatures.md +62 -54
- package/docs/plans/2026-11-19-brand-kit-design.md +58 -0
- package/docs/screenshots/email-branding-gallery.png +0 -0
- package/docs/screenshots/email-branding-waypoint.png +0 -0
- package/package.json +1 -1
- package/plugins/_lib/admin/mail/attach-arrange.js +176 -0
- package/plugins/_lib/admin/mail/body-menu.js +1 -1
- package/plugins/_lib/admin/mail/cms-attach.js +268 -0
- package/plugins/_lib/admin/mail/cms-host.js +10 -3
- package/plugins/_lib/admin/mail/compose-window.js +37 -1
- package/plugins/_lib/admin/mail/contacts.js +1 -1
- package/plugins/_lib/admin/mail/diagnostics-section.js +1 -1
- 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 +1 -1
- package/plugins/_lib/admin/mail/keyboard.js +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 +1 -1
- package/plugins/_lib/admin/mail/reader-runtime.js +1 -1
- 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 +1 -1
- 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 +1 -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 +1 -1
- package/plugins/_lib/domma-mail.lock.json +85 -83
- package/plugins/_lib/mail/accountFileStore.js +1 -1
- package/plugins/_lib/mail/accountRepository.js +1 -1
- package/plugins/_lib/mail/accountRoutes.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/vacationRunner.js +14 -2
- package/plugins/_lib/mail/vacationRuntime.js +23 -5
- package/plugins/_lib/mail/write.js +1 -1
- package/plugins/_lib/outreach/sending.js +3 -1
- package/plugins/_lib/public/rich-text.mjs +1 -1
- package/plugins/_lib/rich-text.js +1 -1
- package/plugins/docs/CHANGELOG.md +5 -0
- package/plugins/docs/plugin.js +2 -2
- package/plugins/free-tier.lock.json +7 -7
- package/plugins/shopping-cart/CHANGELOG.md +5 -0
- package/plugins/shopping-cart/lib/accounts.js +1 -1
- package/plugins/support/CHANGELOG.md +5 -0
- package/plugins/support/lib/mail.js +2 -2
- package/server/routes/api/settings.js +28 -7
- package/server/services/actions.js +2 -1
- package/server/services/callInvites.js +1 -1
- package/server/services/email.js +10 -4
- package/server/services/emailBrand.js +126 -0
- package/server/services/emailExamples.js +37 -0
- package/server/services/instantCalls.js +1 -1
- package/server/services/passwordReset.js +4 -4
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// Source: @domma-mail/core 0.36.0, packages/core/src/admin/mail/attach-arrange.js.
|
|
2
|
+
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
|
+
/**
|
|
4
|
+
* Attachments from somewhere other than this computer: the pure part.
|
|
5
|
+
*
|
|
6
|
+
* The compose window can be given "attachment sources" by its host (the CMS offers Media and the File Store).
|
|
7
|
+
* A source is trusted to open its own chooser, but what comes back is checked here before it is attached, and
|
|
8
|
+
* the lists a chooser shows are shaped here so the screen only ever draws plain records.
|
|
9
|
+
*
|
|
10
|
+
* @module _lib/admin/mail/attach-arrange
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/** The most files one visit to a chooser may add. */
|
|
14
|
+
export const MAX_PICK = 25;
|
|
15
|
+
const BASE64 = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
16
|
+
|
|
17
|
+
/** Bytes a base64 string decodes to. */
|
|
18
|
+
export function base64Bytes(content) {
|
|
19
|
+
const text = String(content ?? '');
|
|
20
|
+
if (!text) return 0;
|
|
21
|
+
const pad = text.endsWith('==') ? 2 : text.endsWith('=') ? 1 : 0;
|
|
22
|
+
return Math.max(0, Math.floor(text.length * 3 / 4) - pad);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** A file name fit to put on an attachment: no folders, no control characters, never empty. */
|
|
26
|
+
export function safeName(name) {
|
|
27
|
+
// Controls go, and so do the direction overrides that can make "exe.png" read as "gnp.exe".
|
|
28
|
+
const base = String(name ?? '').split(/[\\/]/).pop().replace(/[\x00-\x1f\x7f-\x9f\u2028\u2029]/g, ' ')
|
|
29
|
+
.replace(/[\u200e\u200f\u202a-\u202e\u2066-\u2069]/g, '').replace(/\s+/g, ' ').trim();
|
|
30
|
+
return (base === '.' || base === '..' ? '' : base).slice(0, 200) || 'attachment';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** A content type as a header value, or the catch-all. */
|
|
34
|
+
export function safeType(type) {
|
|
35
|
+
const text = String(type ?? '').split(';')[0].trim().toLowerCase();
|
|
36
|
+
return /^[a-z0-9][a-z0-9!#$&^_.+-]{0,60}\/[a-z0-9][a-z0-9!#$&^_.+-]{0,90}$/.test(text) ? text : 'application/octet-stream';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* What a source handed back, as attachments: only well-formed ones, with the size worked out from the content
|
|
41
|
+
* itself rather than taken on trust.
|
|
42
|
+
*
|
|
43
|
+
* @param {unknown} items
|
|
44
|
+
* @returns {Array<{filename: string, contentType: string, content: string, bytes: number}>}
|
|
45
|
+
*/
|
|
46
|
+
export function cleanPicked(items, {max = MAX_PICK} = {}) {
|
|
47
|
+
const out = [];
|
|
48
|
+
for (const item of Array.isArray(items) ? items : []) {
|
|
49
|
+
if (!item || typeof item !== 'object' || typeof item.content !== 'string') continue;
|
|
50
|
+
// An empty file is a file: '' is its content.
|
|
51
|
+
if (item.content.length % 4 !== 0 || !BASE64.test(item.content)) continue;
|
|
52
|
+
out.push({filename: safeName(item.filename), contentType: safeType(item.contentType), content: item.content, bytes: base64Bytes(item.content)});
|
|
53
|
+
if (out.length === max) break;
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** The sources a host offers, checked: an id, a short label and a function. */
|
|
59
|
+
export function cleanSources(list) {
|
|
60
|
+
const seen = new Set();
|
|
61
|
+
const out = [];
|
|
62
|
+
for (const s of Array.isArray(list) ? list : []) {
|
|
63
|
+
const id = String(s?.id ?? '');
|
|
64
|
+
if (!/^[a-z][a-z0-9-]{0,30}$/.test(id) || seen.has(id) || typeof s.pick !== 'function') continue;
|
|
65
|
+
const label = String(s.label ?? '').replace(/\s+/g, ' ').trim().slice(0, 40);
|
|
66
|
+
if (!label) continue;
|
|
67
|
+
seen.add(id);
|
|
68
|
+
out.push({id, label, title: String(s.title ?? label).replace(/\s+/g, ' ').trim().slice(0, 120), pick: s.pick});
|
|
69
|
+
if (out.length === 6) break;
|
|
70
|
+
}
|
|
71
|
+
return out;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** 1536 -> "1.5 KB". */
|
|
75
|
+
export function formatSize(bytes) {
|
|
76
|
+
const n = Number(bytes) || 0;
|
|
77
|
+
if (n < 1024) return `${n} B`;
|
|
78
|
+
if (n < 1024 * 1024) return `${(n / 1024).toFixed(n < 10 * 1024 ? 1 : 0)} KB`;
|
|
79
|
+
return `${(n / 1024 / 1024).toFixed(1)} MB`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* A Media address as a path on this site (`/media/...`), or '' for anything else. The chooser fetches only
|
|
84
|
+
* these: an address from a list is data, and must not be able to send the browser somewhere else.
|
|
85
|
+
*/
|
|
86
|
+
export function mediaPath(url, origin = 'https://site.invalid') {
|
|
87
|
+
let u;
|
|
88
|
+
try { u = new URL(String(url ?? ''), origin); } catch { return ''; }
|
|
89
|
+
if (u.origin !== new URL(origin).origin || !u.pathname.startsWith('/media/') || u.pathname.includes('//')) return '';
|
|
90
|
+
// An encoded slash, backslash or null has no business in a file's address.
|
|
91
|
+
if (/%2f|%5c|%00/i.test(u.pathname)) return '';
|
|
92
|
+
return u.pathname;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** A size from a list: never negative, never not a number. */
|
|
96
|
+
const sizeOf = (v) => Math.max(0, Number(v) || 0);
|
|
97
|
+
const dirOf = (path) => (path.includes('/') ? path.slice(0, path.lastIndexOf('/')) : '');
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Media, as the chooser's records. Takes the built-in list (an array of top-level files) or Media Pro's library
|
|
101
|
+
* (`{files, folders}`, where a file has a `path` inside its folders).
|
|
102
|
+
*
|
|
103
|
+
* @returns {{files: Array<{id, name, folder, size, url}>, folders: string[]}}
|
|
104
|
+
*/
|
|
105
|
+
export function mediaEntries(payload, origin) {
|
|
106
|
+
const raw = Array.isArray(payload) ? payload : Array.isArray(payload?.files) ? payload.files : [];
|
|
107
|
+
const files = [];
|
|
108
|
+
const folders = new Set();
|
|
109
|
+
for (const f of raw.slice(0, 20000)) {
|
|
110
|
+
if (!f || typeof f !== 'object') continue;
|
|
111
|
+
const path = String(f.path ?? f.name ?? '').replace(/^\/+/, '');
|
|
112
|
+
// The address is made here from the path, each part encoded: a list's own `url` is not, and a name with
|
|
113
|
+
// a `#`, `?` or `%` in it would otherwise be fetched as some other file.
|
|
114
|
+
const url = mediaPath(`/media/${path.split('/').map(encodeURIComponent).join('/')}`, origin);
|
|
115
|
+
if (!path || !url) continue;
|
|
116
|
+
const folder = dirOf(path);
|
|
117
|
+
files.push({id: `m:${path}`, name: path.split('/').pop(), folder, size: sizeOf(f.size), url});
|
|
118
|
+
}
|
|
119
|
+
const add = (path) => { for (let p = String(path || ''); p; p = dirOf(p)) folders.add(p); };
|
|
120
|
+
for (const f of files) add(f.folder);
|
|
121
|
+
for (const d of Array.isArray(payload?.folders) ? payload.folders.slice(0, 5000) : []) add(typeof d === 'string' ? d : d?.path);
|
|
122
|
+
return {files: files.sort((a, b) => a.name.localeCompare(b.name)), folders: [...folders].sort((a, b) => a.localeCompare(b))};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* One screen of Media: the folders directly inside `folder` and its files - or, when searching, every file whose
|
|
127
|
+
* name matches, wherever it is.
|
|
128
|
+
*/
|
|
129
|
+
export function mediaView({files, folders}, {folder = '', query = ''} = {}) {
|
|
130
|
+
const q = String(query).trim().toLowerCase();
|
|
131
|
+
if (q) return {folders: [], files: files.filter(f => f.name.toLowerCase().includes(q)).map(f => ({...f, where: f.folder || 'Top level'}))};
|
|
132
|
+
return {
|
|
133
|
+
folders: folders.filter(p => dirOf(p) === folder).map(p => ({id: p, name: p.split('/').pop()})),
|
|
134
|
+
files: files.filter(f => f.folder === folder).map(f => ({...f, where: ''}))
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** The way back up from a Media folder: [{id: '', name: 'Media'}, {id: 'a', name: 'a'}, ...]. */
|
|
139
|
+
export function mediaCrumbs(folder) {
|
|
140
|
+
const out = [{id: '', name: 'Media'}];
|
|
141
|
+
let at = '';
|
|
142
|
+
for (const part of String(folder || '').split('/').filter(Boolean)) { at = at ? `${at}/${part}` : part; out.push({id: at, name: part}); }
|
|
143
|
+
return out;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** The File Store's answer to "what is here", as the chooser's records. */
|
|
147
|
+
export function storeView(payload, {place = 'mine'} = {}) {
|
|
148
|
+
const p = payload && typeof payload === 'object' ? payload : {};
|
|
149
|
+
const text = (v, max) => String(v ?? '').slice(0, max);
|
|
150
|
+
const id = (v) => (/^[0-9a-f]{24}$/.test(String(v)) ? String(v) : '');
|
|
151
|
+
return {
|
|
152
|
+
folders: (Array.isArray(p.folders) ? p.folders : []).filter(f => id(f?.id)).map(f => ({id: f.id, name: text(f.name, 200)})),
|
|
153
|
+
files: (Array.isArray(p.files) ? p.files : []).filter(f => id(f?.id)).map(f => ({id: `f:${f.id}`, fileId: f.id, name: text(f.name, 200), size: sizeOf(f.size),
|
|
154
|
+
where: text(f.path, 300) || (place === 'shared' ? text(f.owner?.name ?? f.owner, 80) : '')})),
|
|
155
|
+
crumbs: [{id: '', name: place === 'shared' ? 'Shared with me' : 'My files'}, ...(Array.isArray(p.crumbs) ? p.crumbs : []).filter(c => id(c?.id)).map(c => ({id: c.id, name: text(c.name, 200)}))]
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The line under a chooser's list, and whether Attach may be pressed.
|
|
161
|
+
*
|
|
162
|
+
* @param {Array<{size: number}>} chosen
|
|
163
|
+
* @param {number} room - bytes left in the message before its limit (Infinity when unknown)
|
|
164
|
+
*/
|
|
165
|
+
export function choiceSummary(chosen, room = Infinity) {
|
|
166
|
+
const n = chosen.length;
|
|
167
|
+
const total = chosen.reduce((sum, f) => sum + sizeOf(f.size), 0);
|
|
168
|
+
if (!n) return {text: 'Tick the files to attach.', ok: false, over: false};
|
|
169
|
+
const many = n > MAX_PICK;
|
|
170
|
+
const over = Number.isFinite(room) && total > room;
|
|
171
|
+
const base = `${n} file${n === 1 ? '' : 's'}, ${formatSize(total)}`;
|
|
172
|
+
return {
|
|
173
|
+
text: many ? `${base}. No more than ${MAX_PICK} at a time.` : over ? `${base} - more than the ${formatSize(Math.max(0, room))} this message has room for.` : base,
|
|
174
|
+
ok: !many && !over, over: over || many
|
|
175
|
+
};
|
|
176
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.36.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.
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
// Source: @domma-mail/core 0.36.0, packages/core/src/admin/mail/cms-attach.js.
|
|
2
|
+
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
|
+
/**
|
|
4
|
+
* Attachments from the CMS: Media and the File Store. CMS shell boundary - only cms-host.js imports this, and
|
|
5
|
+
* standalone Domma Mail never does.
|
|
6
|
+
*
|
|
7
|
+
* One chooser, two places to look. Each "provider" only knows how to list a place and how to fetch a file's bytes,
|
|
8
|
+
* through the admin APIs those Tools already have, as the signed-in person: a file they may not open is not
|
|
9
|
+
* listed, and the server checks again when its bytes are asked for. Nothing here is told to the compose window but
|
|
10
|
+
* the files chosen. Names come from other people's uploads, so they reach the screen as text, never as markup.
|
|
11
|
+
*
|
|
12
|
+
* @module _lib/admin/mail/cms-attach
|
|
13
|
+
*/
|
|
14
|
+
const version = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
15
|
+
const {choiceSummary, formatSize, mediaCrumbs, mediaEntries, mediaPath, mediaView, storeView} =
|
|
16
|
+
await import(new URL(`./attach-arrange.js?v=${version}`, import.meta.url).href);
|
|
17
|
+
|
|
18
|
+
const STORE = '/api/plugins/file-store';
|
|
19
|
+
|
|
20
|
+
function el(tag, attrs = {}, ...kids) {
|
|
21
|
+
const node = document.createElement(tag);
|
|
22
|
+
for (const [k, v] of Object.entries(attrs)) {
|
|
23
|
+
if (v == null || v === false) continue;
|
|
24
|
+
if (k === 'class') node.className = v;
|
|
25
|
+
else if (k === 'text') node.textContent = v;
|
|
26
|
+
else if (k.startsWith('on')) node.addEventListener(k.slice(2), v);
|
|
27
|
+
else if (k in node) node[k] = v;
|
|
28
|
+
else node.setAttribute(k, v === true ? '' : v);
|
|
29
|
+
}
|
|
30
|
+
node.append(...kids.flat().filter(x => x != null && x !== false));
|
|
31
|
+
return node;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function asBase64(blob) {
|
|
35
|
+
return new Promise((resolve, reject) => {
|
|
36
|
+
const reader = new FileReader();
|
|
37
|
+
reader.onload = () => resolve(String(reader.result).split(',')[1] ?? '');
|
|
38
|
+
reader.onerror = () => reject(new Error('A file could not be read.'));
|
|
39
|
+
reader.readAsDataURL(blob);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Can this person use a source? true, false (the Tool is off or not theirs: 403, 404), or null when the question
|
|
45
|
+
* could not be answered (the network), so that it is asked again next time rather than remembered as a no.
|
|
46
|
+
*/
|
|
47
|
+
async function probe(host, url) {
|
|
48
|
+
try { await host.api(url); return true; }
|
|
49
|
+
catch (err) { return err?.status === 403 || err?.status === 404 ? false : null; }
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Media: Media Pro's library when it is there (folders), the built-in list when it is not. */
|
|
53
|
+
function mediaProvider(host) {
|
|
54
|
+
let library = null;
|
|
55
|
+
return {
|
|
56
|
+
id: 'media', label: 'From Media', title: 'Attach from Media', places: [{id: 'media', name: 'Media'}],
|
|
57
|
+
available: () => probe(host, '/api/media/_count'),
|
|
58
|
+
/** Media is read afresh each time the chooser opens: files come and go between visits. */
|
|
59
|
+
reset() { library = null; },
|
|
60
|
+
async browse({folder, query}) {
|
|
61
|
+
if (!library) {
|
|
62
|
+
let payload;
|
|
63
|
+
try { payload = await host.api('/api/plugins/media-pro/library'); } catch { payload = await host.api('/api/media'); }
|
|
64
|
+
library = mediaEntries(payload, location.origin);
|
|
65
|
+
}
|
|
66
|
+
return {...mediaView(library, {folder, query}), crumbs: query ? [{id: '', name: 'Media'}] : mediaCrumbs(folder)};
|
|
67
|
+
},
|
|
68
|
+
async bytes(file, signal) {
|
|
69
|
+
const path = mediaPath(file.url, location.origin);
|
|
70
|
+
if (!path) throw new Error(`${file.name} is not in Media.`);
|
|
71
|
+
const res = await host.fetch(path, {credentials: 'same-origin', redirect: 'error', signal});
|
|
72
|
+
if (!res.ok) throw new Error(`${file.name} could not be fetched (${res.status}).`);
|
|
73
|
+
return res.blob();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** The File Store: the person's own files and folders, and what has been shared with them. */
|
|
79
|
+
function storeProvider(host) {
|
|
80
|
+
return {
|
|
81
|
+
id: 'file-store', label: 'From File Store', title: 'Attach from the File Store',
|
|
82
|
+
places: [{id: 'mine', name: 'My files'}, {id: 'shared', name: 'Shared with me'}],
|
|
83
|
+
available: () => probe(host, `${STORE}/status`),
|
|
84
|
+
async browse({place, folder, query}) {
|
|
85
|
+
const params = new URLSearchParams({place});
|
|
86
|
+
if (folder && place === 'mine') params.set('folder', folder);
|
|
87
|
+
if (query) params.set('q', query);
|
|
88
|
+
return storeView(await host.api(`${STORE}/files?${params}`), {place});
|
|
89
|
+
},
|
|
90
|
+
async bytes(file, signal) {
|
|
91
|
+
const res = await host.fetch(`${STORE}/files/${encodeURIComponent(file.fileId)}/download`, {headers: host.authHeaders(), redirect: 'error', signal});
|
|
92
|
+
if (!res.ok) throw new Error(`${file.name} could not be fetched (${res.status}).`);
|
|
93
|
+
return res.blob();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const STYLE = `
|
|
99
|
+
.mail-pick { display: flex; flex-direction: column; gap: .6rem; padding: 1rem; height: 100%; min-height: 0; }
|
|
100
|
+
.mail-pick-bar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
|
|
101
|
+
.mail-pick-bar .form-input { flex: 1 1 12rem; }
|
|
102
|
+
.mail-pick-places { display: inline-flex; gap: .25rem; }
|
|
103
|
+
.mail-pick-crumbs { display: flex; flex-wrap: wrap; gap: .15rem; align-items: center; font-size: var(--dm-text-sm, .875rem); }
|
|
104
|
+
.mail-pick-crumb { background: none; border: 0; padding: .1rem .3rem; color: var(--dm-primary); cursor: pointer; font: inherit; border-radius: var(--dm-radius-sm, .25rem); }
|
|
105
|
+
.mail-pick-crumb[aria-current="true"] { color: inherit; font-weight: 600; cursor: default; }
|
|
106
|
+
.mail-pick-list { flex: 1; min-height: 8rem; overflow-y: auto; border: 1px solid var(--dm-border); border-radius: var(--dm-radius-md, .5rem); }
|
|
107
|
+
.mail-pick-row { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .45rem .7rem; border: 0; border-bottom: 1px solid var(--dm-border); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
|
|
108
|
+
.mail-pick-row:last-child { border-bottom: 0; }
|
|
109
|
+
.mail-pick-row:hover { background: var(--dm-surface-raised, rgba(127,127,127,.1)); }
|
|
110
|
+
.mail-pick-row:focus-visible, .mail-pick-crumb:focus-visible { outline: 2px solid var(--dm-primary); outline-offset: -2px; }
|
|
111
|
+
.mail-pick-tick { flex: none; width: 1.1rem; height: 1.1rem; border: 1.5px solid var(--dm-border); border-radius: var(--dm-radius-sm, .25rem); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; line-height: 1; }
|
|
112
|
+
.mail-pick-row[aria-checked="true"] .mail-pick-tick { background: var(--dm-primary); border-color: var(--dm-primary); color: var(--dm-primary-text, #fff); }
|
|
113
|
+
.mail-pick-list:focus-visible { outline: 2px solid var(--dm-primary); outline-offset: -2px; }
|
|
114
|
+
.mail-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
115
|
+
.mail-pick-meta { flex: none; font-size: var(--dm-text-xs, .75rem); color: var(--dm-text-muted); white-space: nowrap; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
|
|
116
|
+
.mail-pick-note { padding: 1rem; margin: 0; color: var(--dm-text-muted); font-size: var(--dm-text-sm, .875rem); }
|
|
117
|
+
.mail-pick-foot { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
|
|
118
|
+
.mail-pick-sum { flex: 1; font-size: var(--dm-text-sm, .875rem); color: var(--dm-text-muted); }
|
|
119
|
+
.mail-pick-sum[data-over="true"] { color: var(--dm-danger); }
|
|
120
|
+
`;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The chooser: a slideover over the compose window. Resolves with the attachments chosen (possibly none).
|
|
124
|
+
*
|
|
125
|
+
* @param {object} host - the mail host
|
|
126
|
+
* @param {object} provider
|
|
127
|
+
* @param {{remainingBytes?: number}} opts
|
|
128
|
+
* @returns {Promise<Array<{filename, contentType, content}>>}
|
|
129
|
+
*/
|
|
130
|
+
function choose(host, provider, {remainingBytes = Infinity} = {}) {
|
|
131
|
+
const {E} = host;
|
|
132
|
+
return new Promise((resolve) => {
|
|
133
|
+
let settled = false;
|
|
134
|
+
const done = (list) => { if (!settled) { settled = true; resolve(list); } };
|
|
135
|
+
const so = E.slideover({title: provider.title, size: 'md', position: 'right'});
|
|
136
|
+
const chosen = new Map(); // id -> record, kept as the person moves between folders
|
|
137
|
+
let place = provider.places[0].id;
|
|
138
|
+
let folder = '';
|
|
139
|
+
let query = '';
|
|
140
|
+
let visit = 0; // a slow answer for a place already left is dropped
|
|
141
|
+
let fetching = false;
|
|
142
|
+
let closedByUs = false;
|
|
143
|
+
const stop = new AbortController(); // closing the chooser stops a download in hand
|
|
144
|
+
provider.reset?.();
|
|
145
|
+
|
|
146
|
+
const search = el('input', {type: 'search', class: 'form-input', placeholder: 'Search by name', 'aria-label': 'Search by name'});
|
|
147
|
+
const places = el('div', {class: 'mail-pick-places', role: 'group', 'aria-label': 'Where to look'});
|
|
148
|
+
const crumbs = el('nav', {class: 'mail-pick-crumbs', 'aria-label': 'Folder'});
|
|
149
|
+
const list = el('div', {class: 'mail-pick-list', tabIndex: -1});
|
|
150
|
+
const sum = el('span', {class: 'mail-pick-sum', 'aria-live': 'polite'});
|
|
151
|
+
const attach = el('button', {type: 'button', class: 'btn btn-primary btn-sm', text: 'Attach', disabled: true});
|
|
152
|
+
const cancel = el('button', {type: 'button', class: 'btn btn-ghost btn-sm', text: 'Cancel', onclick: () => so.close()});
|
|
153
|
+
const panel = el('div', {class: 'mail-pick'},
|
|
154
|
+
el('div', {class: 'mail-pick-bar'}, provider.places.length > 1 ? places : null, search), crumbs, list,
|
|
155
|
+
el('div', {class: 'mail-pick-foot'}, sum, cancel, attach));
|
|
156
|
+
|
|
157
|
+
const drawSum = () => {
|
|
158
|
+
const s = choiceSummary([...chosen.values()], remainingBytes);
|
|
159
|
+
sum.textContent = fetching ? sum.textContent : s.text;
|
|
160
|
+
sum.dataset.over = String(s.over);
|
|
161
|
+
attach.disabled = fetching || !s.ok;
|
|
162
|
+
attach.textContent = chosen.size > 1 ? `Attach ${chosen.size} files` : 'Attach';
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// Made once and only re-marked, so the button just pressed keeps the focus.
|
|
166
|
+
const placeButtons = provider.places.map(p => el('button', {type: 'button', class: 'btn btn-sm btn-ghost', text: p.name, 'data-place': p.id,
|
|
167
|
+
onclick: () => { if (p.id !== place && !fetching) { place = p.id; folder = ''; load(); } }}));
|
|
168
|
+
places.replaceChildren(...placeButtons);
|
|
169
|
+
const drawPlaces = () => {
|
|
170
|
+
for (const b of placeButtons) {
|
|
171
|
+
const on = b.dataset.place === place;
|
|
172
|
+
b.classList.toggle('btn-primary', on); b.classList.toggle('btn-ghost', !on);
|
|
173
|
+
b.setAttribute('aria-pressed', String(on));
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
async function load({focus = false} = {}) {
|
|
178
|
+
const mine = ++visit;
|
|
179
|
+
drawPlaces();
|
|
180
|
+
list.replaceChildren(el('p', {class: 'mail-pick-note', text: 'Loading…'}));
|
|
181
|
+
let view;
|
|
182
|
+
try { view = await provider.browse({place, folder, query}); }
|
|
183
|
+
catch (err) { if (mine === visit) list.replaceChildren(el('p', {class: 'mail-pick-note', text: `That could not be listed: ${err?.message || 'the request failed'}.`})); return; }
|
|
184
|
+
if (mine !== visit || settled) return;
|
|
185
|
+
crumbs.replaceChildren(...view.crumbs.flatMap((c, i) => [i ? el('span', {text: '›', 'aria-hidden': 'true'}) : null,
|
|
186
|
+
el('button', {type: 'button', class: 'mail-pick-crumb', text: c.name, 'aria-current': String(i === view.crumbs.length - 1 && !query),
|
|
187
|
+
onclick: () => { if ((folder !== c.id || query) && !fetching) { folder = c.id; query = ''; search.value = ''; load({focus: true}); } }})]));
|
|
188
|
+
const rows = [
|
|
189
|
+
...view.folders.map(f => el('button', {type: 'button', class: 'mail-pick-row', onclick: () => { if (fetching) return; folder = f.id; query = ''; search.value = ''; load({focus: true}); }},
|
|
190
|
+
el('span', {'aria-hidden': 'true', text: '📁'}), el('span', {class: 'mail-pick-name', text: f.name}), el('span', {class: 'mail-pick-meta', text: 'Folder'}))),
|
|
191
|
+
...view.files.map(f => {
|
|
192
|
+
const box = el('span', {class: 'mail-pick-tick', 'aria-hidden': 'true', text: chosen.has(f.id) ? '✓' : ''});
|
|
193
|
+
const row = el('button', {type: 'button', class: 'mail-pick-row', role: 'checkbox', 'aria-checked': String(chosen.has(f.id)), onclick: () => {
|
|
194
|
+
// What is being fetched is what was ticked when Attach was pressed.
|
|
195
|
+
if (fetching) return;
|
|
196
|
+
if (chosen.has(f.id)) chosen.delete(f.id); else chosen.set(f.id, f);
|
|
197
|
+
box.textContent = chosen.has(f.id) ? '✓' : ''; row.setAttribute('aria-checked', String(chosen.has(f.id)));
|
|
198
|
+
drawSum();
|
|
199
|
+
}}, box, el('span', {class: 'mail-pick-name', text: f.name, title: f.name}), el('span', {class: 'mail-pick-meta', text: [f.where, formatSize(f.size)].filter(Boolean).join(' · ')}));
|
|
200
|
+
return row;
|
|
201
|
+
})
|
|
202
|
+
];
|
|
203
|
+
list.replaceChildren(...(rows.length ? rows : [el('p', {class: 'mail-pick-note', text: query ? 'Nothing here has that in its name.' : 'There is nothing here.'})]));
|
|
204
|
+
// After going into a folder or back up, the keyboard is at the top of what is now showing.
|
|
205
|
+
if (focus) (rows[0] || list).focus();
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
let typing = 0;
|
|
209
|
+
search.addEventListener('input', () => { clearTimeout(typing); typing = setTimeout(() => { query = search.value.trim(); load(); }, 250); });
|
|
210
|
+
|
|
211
|
+
attach.addEventListener('click', async () => {
|
|
212
|
+
if (fetching) return;
|
|
213
|
+
fetching = true; drawSum();
|
|
214
|
+
const out = [];
|
|
215
|
+
const files = [...chosen.values()];
|
|
216
|
+
try {
|
|
217
|
+
let total = 0;
|
|
218
|
+
for (const [i, f] of files.entries()) {
|
|
219
|
+
sum.textContent = `Fetching ${i + 1} of ${files.length}: ${f.name}`;
|
|
220
|
+
const blob = await provider.bytes(f, stop.signal);
|
|
221
|
+
if (settled) return;
|
|
222
|
+
// The list's sizes were a promise; this is the file. Checked before it is turned into text, which doubles it.
|
|
223
|
+
total += blob.size;
|
|
224
|
+
if (total > remainingBytes) throw new Error(`${f.name} is ${formatSize(blob.size)}: with it, these are more than this message has room for.`);
|
|
225
|
+
out.push({filename: f.name, contentType: blob.type || 'application/octet-stream', content: await asBase64(blob)});
|
|
226
|
+
}
|
|
227
|
+
if (settled) return;
|
|
228
|
+
done(out);
|
|
229
|
+
closedByUs = true;
|
|
230
|
+
so.close();
|
|
231
|
+
} catch (err) {
|
|
232
|
+
if (settled) return; // closed part way: nothing to say
|
|
233
|
+
fetching = false; drawSum();
|
|
234
|
+
E.toast(err?.message || 'A file could not be fetched.', {type: 'error'});
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
const style = el('style', {text: STYLE});
|
|
239
|
+
so.element.append(panel, style);
|
|
240
|
+
const closed = () => { clearTimeout(typing); visit++; done([]); if (!closedByUs) stop.abort(); };
|
|
241
|
+
// The CMS's onceClosed takes the panel away itself; without it, this does.
|
|
242
|
+
if (typeof host.helpers?.onceClosed === 'function') host.helpers.onceClosed(so, closed);
|
|
243
|
+
else so.element.addEventListener('dm:slideover:close', () => { closed(); setTimeout(() => { try { so.destroy?.(); so.element?.remove(); } catch { /* gone */ } }, 400); }, {once: true});
|
|
244
|
+
so.open();
|
|
245
|
+
drawSum();
|
|
246
|
+
load();
|
|
247
|
+
setTimeout(() => search.focus(), 60);
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* The attachment sources the CMS offers the compose window: those the signed-in person can use, found out once.
|
|
253
|
+
*
|
|
254
|
+
* @param {object} host - the mail host (api, fetch, authHeaders, E, helpers)
|
|
255
|
+
* @returns {() => Promise<Array<{id, label, title, pick}>>}
|
|
256
|
+
*/
|
|
257
|
+
export function createCmsAttachmentSources(host) {
|
|
258
|
+
const providers = [mediaProvider(host), storeProvider(host)];
|
|
259
|
+
let found = null;
|
|
260
|
+
return async () => {
|
|
261
|
+
if (found) return found;
|
|
262
|
+
const answers = await Promise.all(providers.map(p => p.available()));
|
|
263
|
+
const list = providers.filter((p, i) => answers[i] === true).map(p => ({id: p.id, label: p.label, title: p.title, pick: (opts) => choose(host, p, opts)}));
|
|
264
|
+
// Remembered only when every source gave a real answer: a network blip must not hide one for the session.
|
|
265
|
+
if (!answers.includes(null)) found = list;
|
|
266
|
+
return list;
|
|
267
|
+
};
|
|
268
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.36.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';
|
|
@@ -14,9 +14,16 @@ const [toolKit, help, loading, chrome, mailCompose, notifications, smoothCaret]
|
|
|
14
14
|
import('/admin/js/lib/smooth-caret.js').catch(() => ({}))
|
|
15
15
|
]);
|
|
16
16
|
|
|
17
|
+
const {createCmsAttachmentSources} = await import(new URL(`./cms-attach.js?v=${version}`, import.meta.url).href);
|
|
18
|
+
|
|
17
19
|
export function createCmsMailHost({pluginName}) {
|
|
18
|
-
|
|
20
|
+
// The compose window asks for these when it opens; they need the finished host to make their requests.
|
|
21
|
+
let sources = async () => [];
|
|
22
|
+
const host = createMailHost({
|
|
19
23
|
pluginName, framework: globalThis.Domma, storage: globalThis.S,
|
|
20
|
-
helpers: {...toolKit, ...help, loading, chrome, mailCompose, notifications, ...smoothCaret}
|
|
24
|
+
helpers: {...toolKit, ...help, loading, chrome, mailCompose, notifications, ...smoothCaret},
|
|
25
|
+
attachmentSources: () => sources()
|
|
21
26
|
});
|
|
27
|
+
sources = createCmsAttachmentSources(host);
|
|
28
|
+
return host;
|
|
22
29
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.36.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);
|
|
@@ -11,6 +11,7 @@ const {makeResizable} = await import(new URL(`./resizable.js?v=${MAIL_MODULE_VER
|
|
|
11
11
|
const {whenClosed} = await import(new URL(`./when-closed.js?v=${MAIL_MODULE_VERSION}`, import.meta.url).href);
|
|
12
12
|
const {esc} = await import(new URL(`./reader-kit.js?v=${MAIL_MODULE_VERSION}`, import.meta.url).href);
|
|
13
13
|
const {installFontControls} = await import(new URL(`./font-controls.js?v=${MAIL_MODULE_VERSION}`, import.meta.url).href);
|
|
14
|
+
const {cleanPicked, cleanSources} = await import(new URL(`./attach-arrange.js?v=${MAIL_MODULE_VERSION}`, import.meta.url).href);
|
|
14
15
|
const {
|
|
15
16
|
collectGroups,
|
|
16
17
|
currentFragment,
|
|
@@ -310,6 +311,7 @@ export function createComposeWindow(mailHost) {
|
|
|
310
311
|
</div>
|
|
311
312
|
<div class="flex items-center gap-2 flex-wrap">
|
|
312
313
|
<button type="button" class="btn btn-sm btn-ghost" data-on-click="pickFiles">Attach files</button>
|
|
314
|
+
<span class="mail-attach-sources flex items-center gap-2 flex-wrap" data-ref="sources"></span>
|
|
313
315
|
<span data-bind-class="attachTone.value" data-bind-text="attachSummary.value"></span>
|
|
314
316
|
<span data-help-title="Attachments" data-help="The running total is shown as you add files, and turns red over this mailbox's limit - a message that large cannot be sent. Right-click a file (or use its ⋮, or Shift+F10) to remove it."></span>
|
|
315
317
|
</div>
|
|
@@ -384,6 +386,7 @@ export function createComposeWindow(mailHost) {
|
|
|
384
386
|
const picker = ref('template');
|
|
385
387
|
const editorHost = ref('editor');
|
|
386
388
|
const fileInput = ref('files');
|
|
389
|
+
const sourcesBox = ref('sources');
|
|
387
390
|
|
|
388
391
|
// ---- View state ------------------------------------------------------
|
|
389
392
|
|
|
@@ -660,6 +663,39 @@ export function createComposeWindow(mailHost) {
|
|
|
660
663
|
if (added.length) attachments.value = [...attachments.peek(), ...added];
|
|
661
664
|
});
|
|
662
665
|
|
|
666
|
+
// Other places to attach from, when the host offers any (in the CMS: Media and the File Store). Each
|
|
667
|
+
// source opens its own chooser; what it hands back is checked (attach-arrange.js) before it is attached.
|
|
668
|
+
Promise.resolve().then(() => (typeof mailHost.attachmentSources === 'function' ? mailHost.attachmentSources() : mailHost.attachmentSources))
|
|
669
|
+
.then((list) => {
|
|
670
|
+
for (const source of cleanSources(list)) {
|
|
671
|
+
const button = document.createElement('button');
|
|
672
|
+
button.type = 'button';
|
|
673
|
+
button.className = 'btn btn-sm btn-ghost';
|
|
674
|
+
button.textContent = source.label;
|
|
675
|
+
button.title = source.title;
|
|
676
|
+
button.dataset.attachSource = source.id;
|
|
677
|
+
button.addEventListener('click', async () => {
|
|
678
|
+
if (button.disabled) return;
|
|
679
|
+
button.disabled = true;
|
|
680
|
+
try {
|
|
681
|
+
const used = attachments.peek().reduce((n, a) => n + a.bytes, 0);
|
|
682
|
+
const handed = await source.pick({remainingBytes: Math.max(0, maxAttachmentBytes - used)});
|
|
683
|
+
const picked = cleanPicked(handed);
|
|
684
|
+
if (picked.length) attachments.value = [...attachments.peek(), ...picked.map(file => ({key: `a${nextKey++}`, ...file}))];
|
|
685
|
+
// Never dropped without a word: what could not be attached is said.
|
|
686
|
+
const lost = (Array.isArray(handed) ? handed.length : 0) - picked.length;
|
|
687
|
+
if (lost > 0) E.toast(`${lost} file${lost === 1 ? '' : 's'} could not be attached.`, {type: 'warning'});
|
|
688
|
+
} catch (err) {
|
|
689
|
+
E.toast(err?.message || 'Those files could not be attached.', {type: 'error'});
|
|
690
|
+
} finally {
|
|
691
|
+
button.disabled = false;
|
|
692
|
+
}
|
|
693
|
+
});
|
|
694
|
+
sourcesBox?.appendChild(button);
|
|
695
|
+
}
|
|
696
|
+
})
|
|
697
|
+
.catch(() => { /* a host whose sources fail still has "Attach files" */ });
|
|
698
|
+
|
|
663
699
|
/** @param {string} key */
|
|
664
700
|
function removeAttachment(key) {
|
|
665
701
|
attachments.value = attachments.peek().filter(a => a.key !== key);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.36.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.36.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".
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.36.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.36.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.36.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.36.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.36.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.36.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.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.36.0, packages/core/src/admin/mail/image-senders-section.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The settings section for senders whose images always load.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.36.0, packages/core/src/admin/mail/keyboard.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Keyboard navigation for the reader.
|