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
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/admin/ui/rich-field.js.
|
|
2
|
+
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
|
+
/**
|
|
4
|
+
* A Description field as a rich text editor, and a description shown in the admin.
|
|
5
|
+
*
|
|
6
|
+
* ## One line to adopt
|
|
7
|
+
*
|
|
8
|
+
* `richDescription(textarea)` puts Domma's rich editor in the textarea's place
|
|
9
|
+
* and keeps the textarea (hidden) as the field: its `.value` is the editor's
|
|
10
|
+
* HTML, reading it or setting it works as before, and it fires `input` and
|
|
11
|
+
* `change` as the editor changes. So a view that reads `$('#x').val()`, a
|
|
12
|
+
* `data-model` binding and a draft keeper all carry on unchanged.
|
|
13
|
+
*
|
|
14
|
+
* What is stored is described in `/public/js/rich-text.mjs`: text typed before
|
|
15
|
+
* the field was rich is shown in the editor as paragraphs and is only rewritten
|
|
16
|
+
* as HTML once somebody edits it. An editor left empty gives `''`. The server
|
|
17
|
+
* cleans whatever arrives (`server/services/richText.js`); nothing here is the
|
|
18
|
+
* safety.
|
|
19
|
+
*
|
|
20
|
+
* Without Domma's editor the textarea is simply left as it is.
|
|
21
|
+
*
|
|
22
|
+
* ## In a dense screen
|
|
23
|
+
*
|
|
24
|
+
* `richDescription(textarea, {compact: true})` is the same field at the height
|
|
25
|
+
* of a line or two: its toolbar shows only while the editor has the focus and
|
|
26
|
+
* the word count is left out. For a caption inside a row of other inputs. The
|
|
27
|
+
* toolbar opens UNDER the text, so the line being clicked does not move away
|
|
28
|
+
* from the pointer between the press and the release.
|
|
29
|
+
*
|
|
30
|
+
* @module admin/js/lib/rich-field
|
|
31
|
+
*/
|
|
32
|
+
import {isRichText, plainToRichHtml, richTextToPlain, richTextSummary, richTextLine, escapeHtml} from '../../public/rich-text.mjs';
|
|
33
|
+
|
|
34
|
+
export {isRichText, richTextToPlain, richTextSummary, richTextLine};
|
|
35
|
+
|
|
36
|
+
/** The CMS field, using the editor and sanitizer supplied by its host. */
|
|
37
|
+
export function createRichFields(services = globalThis) {
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
/** Formatting a description can have. No images, embeds or code blocks. */
|
|
41
|
+
const TOOLBAR = [['bold', 'italic', 'underline'], ['ul', 'ol'], ['link'], ['undo', 'redo']];
|
|
42
|
+
|
|
43
|
+
/** What the admin will draw from a rich description (the server allows the same). */
|
|
44
|
+
const SHOWN = {
|
|
45
|
+
ALLOWED_TAGS: ['p', 'br', 'strong', 'b', 'em', 'i', 'u', 's', 'ul', 'ol', 'li', 'a', 'h2', 'h3', 'h4', 'blockquote', 'code'],
|
|
46
|
+
ALLOWED_ATTR: ['href', 'target', 'rel'],
|
|
47
|
+
ALLOW_DATA_ATTR: false
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** Tokens only, so both follow every theme. Added to the page once. */
|
|
51
|
+
const CSS_ID = 'rich-description-css';
|
|
52
|
+
const STYLES = `
|
|
53
|
+
.rich-description{display:none}
|
|
54
|
+
.rich-description-editor .dm-editor-body,.rich-description-editor .dm-editor-content{min-height:var(--rich-description-min,6rem)}
|
|
55
|
+
.rich-description-editor .dm-editor-content{padding:.6rem .75rem}
|
|
56
|
+
.rich-description-compact .dm-editor-toolbar,.rich-description-compact .dm-editor-footer{display:none}
|
|
57
|
+
.rich-description-compact:focus-within .dm-editor-toolbar{display:flex}
|
|
58
|
+
.rich-description-compact .dm-editor-content{padding:.4rem .6rem;font-size:var(--dm-font-size-sm)}
|
|
59
|
+
.rich-description-compact .dm-editor-content>:first-child{margin-top:0}
|
|
60
|
+
.rich-description-compact .dm-editor-content>:last-child{margin-bottom:0}
|
|
61
|
+
.rich-description-compact .dm-editor-toolbar{order:2;border-bottom:0;border-top:1px solid var(--dm-border);padding:.25rem .4rem;gap:.25rem}
|
|
62
|
+
.rich-description-compact .dm-editor-toolbar-btn{width:26px;height:26px}
|
|
63
|
+
.rich-text>:first-child{margin-top:0}
|
|
64
|
+
.rich-text>:last-child{margin-bottom:0}
|
|
65
|
+
.rich-text p,.rich-text ul,.rich-text ol,.rich-text blockquote{margin:0 0 .5em}
|
|
66
|
+
.rich-text ul,.rich-text ol{padding-left:1.25em}
|
|
67
|
+
`;
|
|
68
|
+
function styles() {
|
|
69
|
+
if (document.getElementById(CSS_ID)) return;
|
|
70
|
+
const style = document.createElement('style');
|
|
71
|
+
style.id = CSS_ID;
|
|
72
|
+
style.textContent = STYLES;
|
|
73
|
+
document.head.appendChild(style);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const NATIVE = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value');
|
|
77
|
+
|
|
78
|
+
/** The editor's markup for a stored value. */
|
|
79
|
+
const toEditor = value => (isRichText(value) ? value : plainToRichHtml(value));
|
|
80
|
+
|
|
81
|
+
const BLOCKS = /^(P|UL|OL|H[1-6]|BLOCKQUOTE|DIV)$/;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The editor's markup with every line inside a block element. Typed into an
|
|
85
|
+
* empty editor, the browser leaves the first line bare and makes the next ones
|
|
86
|
+
* divs ("first<div>second</div>"); stored like that, the value would not start
|
|
87
|
+
* with a block element and so would be taken for plain text and shown with its
|
|
88
|
+
* tags. Bare runs become paragraphs and divs become paragraphs.
|
|
89
|
+
*
|
|
90
|
+
* @param {string} html - as the editor gives it
|
|
91
|
+
* @returns {string}
|
|
92
|
+
*/
|
|
93
|
+
function asBlocks(html) {
|
|
94
|
+
const doc = new DOMParser().parseFromString(`<body>${html ?? ''}</body>`, 'text/html');
|
|
95
|
+
const out = doc.createElement('div');
|
|
96
|
+
let run = null;
|
|
97
|
+
for (const node of [...doc.body.childNodes]) {
|
|
98
|
+
if (node.nodeType === 1 && BLOCKS.test(node.tagName)) {
|
|
99
|
+
run = null;
|
|
100
|
+
if (node.tagName === 'DIV') {
|
|
101
|
+
const p = doc.createElement('p');
|
|
102
|
+
p.append(...node.childNodes);
|
|
103
|
+
out.append(p);
|
|
104
|
+
} else out.append(node);
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
// White space between blocks is not a line of its own.
|
|
108
|
+
if (!run && node.nodeType === 3 && !node.textContent.trim()) continue;
|
|
109
|
+
if (!run) { run = doc.createElement('p'); out.append(run); }
|
|
110
|
+
run.append(node);
|
|
111
|
+
}
|
|
112
|
+
return out.innerHTML;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Does this markup say anything? An empty list item reads as its bullet alone. */
|
|
116
|
+
const saysSomething = html => Boolean(richTextToPlain(toEditor(html)).replace(/^- ?$/gm, '').trim());
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Turn a Description textarea into a rich text editor.
|
|
120
|
+
*
|
|
121
|
+
* @param {HTMLTextAreaElement|string|object} target - the textarea, a selector, or a Domma collection
|
|
122
|
+
* @param {{minHeight?: number, placeholder?: string, compact?: boolean}} [options] - `compact`: a line or
|
|
123
|
+
* two tall (minHeight 40 unless given), the toolbar shown only while the editor has the focus
|
|
124
|
+
* @returns {{rich: boolean, get: () => string, getText: () => string, set: (value: string) => void,
|
|
125
|
+
* focus: () => void, destroy: () => void}}
|
|
126
|
+
*/
|
|
127
|
+
function richDescription(target, {compact = false, minHeight = compact ? 40 : 88, placeholder} = {}) {
|
|
128
|
+
const area = typeof target === 'string' ? document.querySelector(target) : (target?.get?.(0) ?? target);
|
|
129
|
+
const plain = {
|
|
130
|
+
rich: false,
|
|
131
|
+
get: () => area?.value ?? '',
|
|
132
|
+
getText: () => richTextToPlain(area?.value ?? ''),
|
|
133
|
+
set: value => { if (area) area.value = value ?? ''; },
|
|
134
|
+
focus: () => area?.focus(),
|
|
135
|
+
destroy: () => {}
|
|
136
|
+
};
|
|
137
|
+
if (!(area instanceof HTMLTextAreaElement) || area._richDescription || typeof services.E?.editor !== 'function') {
|
|
138
|
+
return area?._richDescription ?? plain;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const host = document.createElement('div');
|
|
142
|
+
host.className = 'rich-description';
|
|
143
|
+
area.after(host);
|
|
144
|
+
let editor;
|
|
145
|
+
/** True while the editor is being filled, so that is not taken for typing. */
|
|
146
|
+
let filling = false;
|
|
147
|
+
/** What the editor was last filled with or said: never refill it with its own words. */
|
|
148
|
+
let shown = null;
|
|
149
|
+
|
|
150
|
+
const store = (value) => {
|
|
151
|
+
if (NATIVE.get.call(area) === value) return;
|
|
152
|
+
NATIVE.set.call(area, value);
|
|
153
|
+
area.dispatchEvent(new Event('input', {bubbles: true}));
|
|
154
|
+
area.dispatchEvent(new Event('change', {bubbles: true}));
|
|
155
|
+
};
|
|
156
|
+
const fill = (value) => {
|
|
157
|
+
const html = toEditor(value);
|
|
158
|
+
if (html === shown) return;
|
|
159
|
+
filling = true;
|
|
160
|
+
try { editor.setValue(html); } finally { filling = false; }
|
|
161
|
+
shown = html;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
try {
|
|
165
|
+
editor = services.E.editor(host, {
|
|
166
|
+
mode: 'rich', minHeight, imagePaste: false, toolbar: TOOLBAR,
|
|
167
|
+
placeholder: placeholder ?? area.getAttribute('placeholder') ?? '',
|
|
168
|
+
onChange: (html) => {
|
|
169
|
+
if (filling) return;
|
|
170
|
+
const raw = typeof html === 'string' ? html : editor.getValue();
|
|
171
|
+
const value = saysSomething(raw) ? asBlocks(raw) : '';
|
|
172
|
+
// Remembered as it is stored (as blocks): a bound field hands the stored
|
|
173
|
+
// value straight back, and that must not refill the editor mid-typing.
|
|
174
|
+
shown = value || raw;
|
|
175
|
+
store(value);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
} catch {
|
|
179
|
+
host.remove();
|
|
180
|
+
return plain;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Domma builds the editor beside the element it was given, not inside it.
|
|
184
|
+
const frame = host.nextElementSibling?.querySelector('[contenteditable]') ? host.nextElementSibling : host;
|
|
185
|
+
styles();
|
|
186
|
+
frame.classList.add('rich-description-editor');
|
|
187
|
+
if (compact) frame.classList.add('rich-description-compact');
|
|
188
|
+
frame.style.minHeight = '';
|
|
189
|
+
frame.style.setProperty('--rich-description-min', `${minHeight}px`);
|
|
190
|
+
// The label names the editor now; the textarea's length limit was for
|
|
191
|
+
// plain text and would count markup (the server keeps its own).
|
|
192
|
+
const editable = frame.querySelector('[contenteditable]');
|
|
193
|
+
// Inside a <label>, a click on the text would be passed to the label's first
|
|
194
|
+
// control - a help button, usually - and take the focus out of the editor.
|
|
195
|
+
frame.addEventListener('click', (e) => {
|
|
196
|
+
if (frame.closest('label') && !e.target.closest('button, a, input, select, textarea')) e.preventDefault();
|
|
197
|
+
});
|
|
198
|
+
const label = area.id ? document.querySelector(`label[for="${CSS.escape(area.id)}"]`) : area.closest('label');
|
|
199
|
+
const named = area.getAttribute('aria-label') || label?.childNodes[0]?.textContent?.trim() || 'Description';
|
|
200
|
+
editable?.setAttribute('aria-label', named);
|
|
201
|
+
area.removeAttribute('maxlength');
|
|
202
|
+
area.hidden = true;
|
|
203
|
+
|
|
204
|
+
fill(NATIVE.get.call(area));
|
|
205
|
+
Object.defineProperty(area, 'value', {
|
|
206
|
+
configurable: true,
|
|
207
|
+
get: () => NATIVE.get.call(area),
|
|
208
|
+
set: (value) => {
|
|
209
|
+
NATIVE.set.call(area, value ?? '');
|
|
210
|
+
fill(NATIVE.get.call(area));
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
const handle = {
|
|
215
|
+
rich: true,
|
|
216
|
+
get: () => NATIVE.get.call(area),
|
|
217
|
+
getText: () => richTextToPlain(NATIVE.get.call(area)),
|
|
218
|
+
set: (value) => { area.value = value ?? ''; },
|
|
219
|
+
focus: () => editable?.focus(),
|
|
220
|
+
destroy: () => {
|
|
221
|
+
delete area.value;
|
|
222
|
+
delete area._richDescription;
|
|
223
|
+
try { editor.destroy?.(); } catch { /* gone with the view */ }
|
|
224
|
+
if (frame !== host) frame.remove();
|
|
225
|
+
host.remove();
|
|
226
|
+
area.hidden = false;
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
area._richDescription = handle;
|
|
230
|
+
return handle;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Show a stored description in an element: formatted when it is rich, as the
|
|
235
|
+
* text it is (line breaks kept) when it is plain.
|
|
236
|
+
*
|
|
237
|
+
* @param {Element|object} target - an element or a Domma collection
|
|
238
|
+
* @param {*} value - as stored
|
|
239
|
+
* @returns {void}
|
|
240
|
+
*/
|
|
241
|
+
function showRichText(target, value) {
|
|
242
|
+
const el = target?.get?.(0) ?? target;
|
|
243
|
+
if (!el) return;
|
|
244
|
+
const text = typeof value === 'string' ? value : '';
|
|
245
|
+
if (!isRichText(text) || !services.DOMPurify) {
|
|
246
|
+
el.textContent = richTextToPlain(text);
|
|
247
|
+
el.style.whiteSpace = 'pre-line';
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
el.style.whiteSpace = '';
|
|
251
|
+
styles();
|
|
252
|
+
const doc = new DOMParser().parseFromString(services.DOMPurify.sanitize(text, SHOWN), 'text/html');
|
|
253
|
+
for (const link of doc.body.querySelectorAll('a')) link.setAttribute('rel', 'noopener noreferrer');
|
|
254
|
+
el.classList.add('rich-text');
|
|
255
|
+
el.replaceChildren(...doc.body.childNodes);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* A description as HTML for the inside of a line of text (a `<p>`, a caption):
|
|
260
|
+
* inline formatting only, a paragraph or list item becoming a line break. The
|
|
261
|
+
* admin's copy of the server's `renderRichTextPhrasing`, for a preview that
|
|
262
|
+
* draws what the public page will be given. Through DOMPurify; without it,
|
|
263
|
+
* the words alone, escaped.
|
|
264
|
+
*
|
|
265
|
+
* @param {*} value - as stored
|
|
266
|
+
* @param {{links?: boolean, legacyHtml?: boolean}} [options] - as the server's
|
|
267
|
+
* @returns {string}
|
|
268
|
+
*/
|
|
269
|
+
function richTextInlineHtml(value, {links = true, legacyHtml = false} = {}) {
|
|
270
|
+
const text = typeof value === 'string' ? value.trim() : '';
|
|
271
|
+
if (!text) return '';
|
|
272
|
+
const rich = isRichText(text);
|
|
273
|
+
if (!services.DOMPurify || (!rich && !legacyHtml)) return escapeHtml(richTextLine(text));
|
|
274
|
+
const flat = text.replace(/<li(\s[^<>]*)?>/gi, '- ').replace(/<\/(p|h[1-6]|blockquote|li|ul|ol|div)>/gi, '<br>');
|
|
275
|
+
const html = services.DOMPurify.sanitize(flat, {
|
|
276
|
+
ALLOWED_TAGS: ['strong', 'b', 'em', 'i', 'u', 's', 'code', 'br', ...(links ? ['a'] : [])],
|
|
277
|
+
ALLOWED_ATTR: links ? ['href', 'target', 'rel'] : [],
|
|
278
|
+
ALLOW_DATA_ATTR: false
|
|
279
|
+
});
|
|
280
|
+
return html.replace(/(\s*<br\s*\/?>\s*){2,}/g, '<br>').replace(/^(\s|<br\s*\/?>)+|(\s|<br\s*\/?>)+$/g, '');
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return {asBlocks, richDescription, showRichText, richTextInlineHtml};
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
let defaults;
|
|
287
|
+
const fields = () => defaults ??= createRichFields(globalThis);
|
|
288
|
+
export const asBlocks = (...args) => fields().asBlocks(...args);
|
|
289
|
+
export const richDescription = (...args) => fields().richDescription(...args);
|
|
290
|
+
export const showRichText = (...args) => fields().showRichText(...args);
|
|
291
|
+
export const richTextInlineHtml = (...args) => fields().richTextInlineHtml(...args);
|
|
@@ -1,86 +1,89 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"package": "@domma-mail/core",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.32.0",
|
|
5
5
|
"files": {
|
|
6
|
-
"plugins/_lib/mail/defaults.js": "
|
|
7
|
-
"plugins/_lib/mail/priority.js": "
|
|
8
|
-
"plugins/_lib/mail/envelope.js": "
|
|
9
|
-
"plugins/_lib/mail/pollSchedule.js": "
|
|
10
|
-
"plugins/_lib/mail/syncPlan.js": "
|
|
11
|
-
"plugins/_lib/admin/mail/threads.js": "
|
|
12
|
-
"plugins/_lib/admin/mail/vacation.js": "
|
|
13
|
-
"plugins/_lib/mail/secretProvider.js": "
|
|
14
|
-
"plugins/_lib/mail/secretbox.js": "
|
|
15
|
-
"plugins/_lib/mail/bodyTokenProvider.js": "
|
|
16
|
-
"plugins/_lib/mail/bodyTokens.js": "
|
|
17
|
-
"plugins/_lib/mail/accountFileStore.js": "
|
|
18
|
-
"plugins/_lib/mail/accountRepository.js": "
|
|
19
|
-
"plugins/_lib/mail/accountRoutes.js": "
|
|
20
|
-
"plugins/_lib/mail/networkAddresses.js": "
|
|
21
|
-
"plugins/_lib/mail/networkPolicy.js": "
|
|
22
|
-
"plugins/_lib/mail/imapPoolRuntime.js": "
|
|
23
|
-
"plugins/_lib/mail/publicMailbox.js": "
|
|
24
|
-
"plugins/_lib/mail/render.js": "
|
|
25
|
-
"plugins/_lib/mail/unsubscribe.js": "
|
|
26
|
-
"plugins/_lib/mail/unreadBadge.js": "
|
|
27
|
-
"plugins/_lib/mail/message-action.js": "
|
|
28
|
-
"plugins/_lib/admin/mail/identity.js": "
|
|
29
|
-
"plugins/_lib/mail/messageSecurityProvider.js": "
|
|
30
|
-
"plugins/_lib/mail/messageSecurity.js": "
|
|
31
|
-
"plugins/_lib/mail/smtpService.js": "
|
|
32
|
-
"plugins/_lib/mail/subscriptions.js": "
|
|
33
|
-
"plugins/_lib/mail/senderAuth.js": "
|
|
34
|
-
"plugins/_lib/mail/readRuntime.js": "
|
|
35
|
-
"plugins/_lib/admin/mail/image-senders-section.js": "
|
|
36
|
-
"plugins/_lib/admin/mail/mail.html": "
|
|
37
|
-
"plugins/_lib/admin/mail/section-kit.js": "
|
|
38
|
-
"plugins/_lib/admin/mail/when-closed.js": "
|
|
39
|
-
"plugins/_lib/admin/mail/oauth-panel.js": "
|
|
40
|
-
"plugins/_lib/admin/mail/rules.js": "
|
|
41
|
-
"plugins/_lib/admin/mail/reader-kit.js": "
|
|
42
|
-
"plugins/_lib/admin/mail/panes.js": "
|
|
43
|
-
"plugins/_lib/admin/mail/contacts.js": "
|
|
44
|
-
"plugins/_lib/admin/mail/message-actions.js": "
|
|
45
|
-
"plugins/_lib/admin/mail/resizable.js": "
|
|
46
|
-
"plugins/_lib/admin/mail/settings-section.js": "
|
|
47
|
-
"plugins/_lib/admin/mail/compose-window.js": "
|
|
48
|
-
"plugins/_lib/admin/mail/folder-tree.js": "
|
|
49
|
-
"plugins/_lib/admin/mail/body-menu.js": "
|
|
50
|
-
"plugins/_lib/admin/mail/diagnostics-section.js": "
|
|
51
|
-
"plugins/_lib/admin/mail/drag-drop.js": "
|
|
52
|
-
"plugins/_lib/admin/mail/scheduling.js": "
|
|
53
|
-
"plugins/_lib/admin/mail/font-controls.js": "
|
|
54
|
-
"plugins/_lib/admin/mail/fonts.js": "
|
|
55
|
-
"plugins/_lib/admin/mail/keyboard.js": "
|
|
56
|
-
"plugins/_lib/admin/mail/mail.css": "
|
|
57
|
-
"plugins/_lib/admin/mail/reader-view.js": "
|
|
58
|
-
"plugins/_lib/admin/mail/templates.js": "
|
|
59
|
-
"plugins/_lib/admin/mail/security-note.js": "
|
|
60
|
-
"plugins/_lib/admin/ui/dates.js": "
|
|
61
|
-
"plugins/_lib/mail/compose.js": "
|
|
62
|
-
"plugins/_lib/admin/mail/reader-runtime.js": "
|
|
63
|
-
"plugins/_lib/admin/mail/host-context.js": "
|
|
64
|
-
"plugins/_lib/admin/mail/cms-host.js": "
|
|
65
|
-
"plugins/_lib/admin/ui/resizable.js": "
|
|
66
|
-
"plugins/_lib/mail/store.js": "
|
|
67
|
-
"plugins/_lib/mail/syncSelection.js": "
|
|
68
|
-
"plugins/_lib/mail/pollerRuntime.js": "
|
|
69
|
-
"plugins/_lib/mail/poller.js": "
|
|
70
|
-
"plugins/_lib/mail/syncRuntime.js": "
|
|
71
|
-
"plugins/_lib/mail/write.js": "
|
|
72
|
-
"plugins/_lib/admin/mail/restore-spam.js": "
|
|
73
|
-
"plugins/_lib/mail/folders.js": "
|
|
74
|
-
"plugins/_lib/mail/folderActions.js": "
|
|
75
|
-
"plugins/_lib/mail/folderRuntime.js": "
|
|
76
|
-
"plugins/_lib/mail/ruleRunner.js": "
|
|
77
|
-
"plugins/_lib/mail/schedulerRuntime.js": "
|
|
78
|
-
"plugins/_lib/mail/snoozeRuntime.js": "
|
|
79
|
-
"plugins/_lib/mail/vacationRuntime.js": "
|
|
80
|
-
"plugins/_lib/mail/mbox.js": "
|
|
81
|
-
"plugins/_lib/mail/sieve.js": "
|
|
82
|
-
"plugins/_lib/mail/oauthRuntime.js": "
|
|
83
|
-
"plugins/_lib/mail/oauthRouteRuntime.js": "
|
|
84
|
-
"plugins/_lib/mail/oauthAccounts.js": "
|
|
6
|
+
"plugins/_lib/mail/defaults.js": "17e405e39672c4a4e435ac1de0a8dc44de6500072b5212c68b302e3214c700c9",
|
|
7
|
+
"plugins/_lib/mail/priority.js": "fdbf22bb516e7b093eff8dbd89ff108cf6a259746cf08c9390fc9fc30751fd88",
|
|
8
|
+
"plugins/_lib/mail/envelope.js": "6eb8c058b56c81d8cd0aadeefb643d1f1f3edfae92f796ad73e4f883720335c8",
|
|
9
|
+
"plugins/_lib/mail/pollSchedule.js": "69a6e82c5b9e2ff58d0a36d086c4c57f3476d1c0febd35dce79bc6b890f28f27",
|
|
10
|
+
"plugins/_lib/mail/syncPlan.js": "1c2029aa6b665fdbf55e886a04deee01cf7e7ffb609b17710a9820efccc7a889",
|
|
11
|
+
"plugins/_lib/admin/mail/threads.js": "c0d32386afd2c70036a52cd655255a270aa54a7c6cbe221a2740f89a8baf0f4f",
|
|
12
|
+
"plugins/_lib/admin/mail/vacation.js": "64e179d6214be88b54c3bdd0727efac3837086610f73cfec30ac586a61d220f7",
|
|
13
|
+
"plugins/_lib/mail/secretProvider.js": "62b9117cbfe8870c385a47781d27f5382d29717c1b3a9b4472691d56976e8b30",
|
|
14
|
+
"plugins/_lib/mail/secretbox.js": "bf190d5fca28d841db1f040116c0530a322dd8984c38212ddbba33cb10d935b1",
|
|
15
|
+
"plugins/_lib/mail/bodyTokenProvider.js": "1c50fdddda9cb6d53672d10a9d80405bff736dd9926c59396c49e521a9a21786",
|
|
16
|
+
"plugins/_lib/mail/bodyTokens.js": "cadeeb4609cafece39b547d6baec560f560c567c303e426453f5170a73c0f839",
|
|
17
|
+
"plugins/_lib/mail/accountFileStore.js": "1da78ab0984ac19522a24fad28c3e4c2da2ff3a098f75aea56483e6c531b713c",
|
|
18
|
+
"plugins/_lib/mail/accountRepository.js": "829bf3a87a0df226139e0382577164e0a754a10372d94dc4402b9b025998837e",
|
|
19
|
+
"plugins/_lib/mail/accountRoutes.js": "b621362bfd5041abe8c06def12d22fa4a46e00ada86221351440b042530f4976",
|
|
20
|
+
"plugins/_lib/mail/networkAddresses.js": "0566123f0c0999fe1d74d7ee536a7db641b1050d58242a3abc941d4f8d0868bf",
|
|
21
|
+
"plugins/_lib/mail/networkPolicy.js": "040ff923f2f40d11a3ed2bf8d3472e6447e1108ac18e4a1a8956a7e7e2fcce53",
|
|
22
|
+
"plugins/_lib/mail/imapPoolRuntime.js": "ea2803a9c380eac260e94594caa8bcf99b40cc32d3629b9c672de5ee8a2e4850",
|
|
23
|
+
"plugins/_lib/mail/publicMailbox.js": "190d181f05142e325cd5c1cee76783bdb079f2942cec21a06b38f5a887ba1e2b",
|
|
24
|
+
"plugins/_lib/mail/render.js": "b9bb41f8741f8b2614ca4dca6b0a6cd123d490d5af9f032ae162f1097829821d",
|
|
25
|
+
"plugins/_lib/mail/unsubscribe.js": "ae393c63ad7d2c746f385f14e9ed2c7086e5c22ab615535be40f6d5f51e79592",
|
|
26
|
+
"plugins/_lib/mail/unreadBadge.js": "197a5427bd8316e3080cae210ee58328fa0ec767cd52db779bd6462403cd7e3d",
|
|
27
|
+
"plugins/_lib/mail/message-action.js": "f112fb7f41bb8ccac04b3512842195ed9d7dd8c76646e35ad1191597b4d3f334",
|
|
28
|
+
"plugins/_lib/admin/mail/identity.js": "b193af336043488c987080b71feec3115d0b70877ea27b28755751fade4fad16",
|
|
29
|
+
"plugins/_lib/mail/messageSecurityProvider.js": "d8eec2ff9a7abbf8ebab51b11036b8737954bb6914f621a0c19b20f4ddf8ccab",
|
|
30
|
+
"plugins/_lib/mail/messageSecurity.js": "9018d707088fdf036646d41b77d8a4f6573ba57df5593cb6fdda4ba7046bdb54",
|
|
31
|
+
"plugins/_lib/mail/smtpService.js": "6560c1b499ee3dcaac2faff101424e6ac1255e260aff26e47bb6f3fbb52ed6ad",
|
|
32
|
+
"plugins/_lib/mail/subscriptions.js": "c0bebeb34f70ce7f8fedc64c22e4fff0dd3b35eae43ad6a494fccfd67a0bda4b",
|
|
33
|
+
"plugins/_lib/mail/senderAuth.js": "e1aa044200ed3efb947d69e0789c512965b7264a81b2e3aafe9644e698f76a4f",
|
|
34
|
+
"plugins/_lib/mail/readRuntime.js": "e827e80e02fd7d7e90dacdb9c50a58cac636d16ac5b5c3148a2ff39113fd3b81",
|
|
35
|
+
"plugins/_lib/admin/mail/image-senders-section.js": "fde4fba0e19b5a82e032931c840613b326a504362269d126a2a8bb6b133c4884",
|
|
36
|
+
"plugins/_lib/admin/mail/mail.html": "5f3f1220daf8ef5eee29c71cde094e058c9a46777ffeba366e591c886abc4f0c",
|
|
37
|
+
"plugins/_lib/admin/mail/section-kit.js": "9be75951a496f3a31601b552d46f1a2fc98817f318270eb85841e3cca2ec6a11",
|
|
38
|
+
"plugins/_lib/admin/mail/when-closed.js": "0c053bcb2c094b8a595850549d4108fa5cec36e6d43c98bc70cdd5a26ba96fba",
|
|
39
|
+
"plugins/_lib/admin/mail/oauth-panel.js": "a3522fbd7b35590686634a9ac8bf07cdb1386d3b37ca70c93c4f094976f4b7cf",
|
|
40
|
+
"plugins/_lib/admin/mail/rules.js": "76e6e52cbbc4f569c3dbcde59a1a76e5d0bc717cbb5a5ffa4590213333787647",
|
|
41
|
+
"plugins/_lib/admin/mail/reader-kit.js": "25036a2d69ce1d39083ad47fc529c77ddb66e2e59e1d0458f9d63dce885385fd",
|
|
42
|
+
"plugins/_lib/admin/mail/panes.js": "04154509086b30802b95aa0130d38bcf5ab487fcbd8324996d82762c15ea7363",
|
|
43
|
+
"plugins/_lib/admin/mail/contacts.js": "bc0cbabfd9bdcb6910191aca457f92f32588d6c7c9584841e90da74354df98d0",
|
|
44
|
+
"plugins/_lib/admin/mail/message-actions.js": "9d5c75b29ef7bbe071e7cfa97db006ac7fd6388c72ae84ad8e3d6f2a7e33c90c",
|
|
45
|
+
"plugins/_lib/admin/mail/resizable.js": "773dd3d5f90858696872524e414ede877dfdf1431bf2d63e67980a6a47c585d4",
|
|
46
|
+
"plugins/_lib/admin/mail/settings-section.js": "193a164693a6d550580ce033b24dd483dc51acb2dacf26a269fb87237af146cb",
|
|
47
|
+
"plugins/_lib/admin/mail/compose-window.js": "6316ba198558cd59121a8da2d550f1a24676d4abede5af18b8d4ddb0e3d6f639",
|
|
48
|
+
"plugins/_lib/admin/mail/folder-tree.js": "81cc567e06f3401f6e5a45274f88e2de6230e5f9449c0a901000f8998315517a",
|
|
49
|
+
"plugins/_lib/admin/mail/body-menu.js": "039d0683edf43f3ca81f26033a84bbf06dad29b2822369948021c434b6ea1bb6",
|
|
50
|
+
"plugins/_lib/admin/mail/diagnostics-section.js": "8759d9ab634b94b8c4a2fdf47390a9454843789c14182b51193ccbeb78a5874c",
|
|
51
|
+
"plugins/_lib/admin/mail/drag-drop.js": "ddabd0eb2ec152e85eed03e4935a2985e5323a48725c377931511d835eae3687",
|
|
52
|
+
"plugins/_lib/admin/mail/scheduling.js": "8ce02b294f398b79516a70ae94e9215cca892f7856f1dee215caa4bb3c1e9845",
|
|
53
|
+
"plugins/_lib/admin/mail/font-controls.js": "5a062ff0e6dfe8964ce942e316f8de5d6d293bcfa8a5f53b6ba49e1410b8b73b",
|
|
54
|
+
"plugins/_lib/admin/mail/fonts.js": "c270c8103d8bea458edea06dd46e5a75c36c36547474f936389d34c6331e9501",
|
|
55
|
+
"plugins/_lib/admin/mail/keyboard.js": "2a134fd135133d86462916ad45692ca3fd571dba46dc9a4778760c28b74068df",
|
|
56
|
+
"plugins/_lib/admin/mail/mail.css": "52ff2f58406f4cc5805187feefc29206d2eef21a4de98da7805ee8781f2ec6a5",
|
|
57
|
+
"plugins/_lib/admin/mail/reader-view.js": "8bfe5ea2195cf8594876a07d868c97f9215b17dabf6cf4f1ba192ea7ecdfb0e3",
|
|
58
|
+
"plugins/_lib/admin/mail/templates.js": "d4aa3ca98fc4b868e85e6d6575ead44afd09dd67799285f6d0e8889f5bd2e290",
|
|
59
|
+
"plugins/_lib/admin/mail/security-note.js": "e36fb19a5b922b6fdbd0117f04da5a4dfc2aa6339844ae2e288b29cda53f026c",
|
|
60
|
+
"plugins/_lib/admin/ui/dates.js": "645909412293185cace072a4354939b41a96eaf2ff068ad936d18ffca0f4f18d",
|
|
61
|
+
"plugins/_lib/mail/compose.js": "7d69fd3592e586e91b06a24241c019018c59bd18ed13a825bdb70c663e406516",
|
|
62
|
+
"plugins/_lib/admin/mail/reader-runtime.js": "0e5b3bd54736dc62362fb42e4264dacacc48c6b529229dbec0169f589db2306d",
|
|
63
|
+
"plugins/_lib/admin/mail/host-context.js": "365187c26b1ade2a1dc023f3d24a8505f6adedfce275813ce1f725309dcf585c",
|
|
64
|
+
"plugins/_lib/admin/mail/cms-host.js": "59129d74a96f229914957e553640ee7abea6bd12c89a71608c8aa7ba263a7422",
|
|
65
|
+
"plugins/_lib/admin/ui/resizable.js": "77c869c91a6a15d9be235ef37d04cb0b9247b53d840c2e224be8bfffce6c3c2c",
|
|
66
|
+
"plugins/_lib/mail/store.js": "035ddb9201064d4114372b697a7b3f541fe0a43fdf464b4baf6aa83bc4183bf6",
|
|
67
|
+
"plugins/_lib/mail/syncSelection.js": "cf37bed4be1cc4e47fd10a6fa0c90c9d5e435549b424e4c9b61dc12a568c8ef8",
|
|
68
|
+
"plugins/_lib/mail/pollerRuntime.js": "03dadc53483371ca89ec274de1646f1476d151a30d9bc9c09df709a77f52f3bb",
|
|
69
|
+
"plugins/_lib/mail/poller.js": "0e623e5e7ad7e59c679b9caa9956ba3a7fe29e64299e7802665a91d47b66574e",
|
|
70
|
+
"plugins/_lib/mail/syncRuntime.js": "b4ca50b3191a9936c64238842569ff7f10308c19a8400e3cf8a88bffc9db14a4",
|
|
71
|
+
"plugins/_lib/mail/write.js": "4fe8e59053f0d9c6de663ba5b527481cde62254c1a37ffe817b21507af1ec562",
|
|
72
|
+
"plugins/_lib/admin/mail/restore-spam.js": "c145780f3e6dc71005f1c69983b8ae0b1a11cee2c6f6ce9134f97ecf2ca33d2b",
|
|
73
|
+
"plugins/_lib/mail/folders.js": "c732a30a6932d91b165fcf9456877053b520568ae4611d51bd2949eab7b8d037",
|
|
74
|
+
"plugins/_lib/mail/folderActions.js": "868dae933e09767984f731eccdb84f1d13baf4e54c284bbbe52c4d3a99d353b6",
|
|
75
|
+
"plugins/_lib/mail/folderRuntime.js": "9e2d27683ee9bf4848f02f6af01fe9f7abcd4cfa950f4cded8ae2fd46a2dc9d6",
|
|
76
|
+
"plugins/_lib/mail/ruleRunner.js": "a8568eac5a5ca32d957174fed37abfc92f0d0bb027c917e92238cac6625bcb4f",
|
|
77
|
+
"plugins/_lib/mail/schedulerRuntime.js": "e555c3e0a3db43b85640d6eff73cf5bc5b3b243cd2033c649951e0a58ee04367",
|
|
78
|
+
"plugins/_lib/mail/snoozeRuntime.js": "53eaaa72bf89605fafc27b372134c27f11fe61de20dd9b3876ab71e45612d110",
|
|
79
|
+
"plugins/_lib/mail/vacationRuntime.js": "c8589546f5a5aabc71b31b425026fb594a2eda8c00c06ff43b16359016c15413",
|
|
80
|
+
"plugins/_lib/mail/mbox.js": "823516fbce7a921d7ac7939211b66e4b7220f41959c33f32ebb300f521448781",
|
|
81
|
+
"plugins/_lib/mail/sieve.js": "68de9ddc2ce64a4aa54896de06c16b2816ab000c94de962eddc16609ac7f72db",
|
|
82
|
+
"plugins/_lib/mail/oauthRuntime.js": "3275b1a9d4af990eb4cf20393d5cdcaa48306f83ce36597e7aef414cdaaae189",
|
|
83
|
+
"plugins/_lib/mail/oauthRouteRuntime.js": "812bc030d2486c3062de8fb50bf839ba3c34ed811385c372042653b774159b35",
|
|
84
|
+
"plugins/_lib/mail/oauthAccounts.js": "88f422afae14dd1af941382a405ce682a8244332cf08f503aa105fc4b3c97ae0",
|
|
85
|
+
"plugins/_lib/public/rich-text.mjs": "1abcc27508dd91a5749e8e2ec115ce62744f12b56f69419b8872951725b64fa8",
|
|
86
|
+
"plugins/_lib/rich-text.js": "e0f21884ab336a23b90811f97f25d5e516651c3c52b2c20f4be638626efc9551",
|
|
87
|
+
"plugins/_lib/admin/ui/rich-field.js": "5ca3d574e02124fd512cc16d424bf2b705d662fe7b7a158c89707fe361a230dc"
|
|
85
88
|
}
|
|
86
89
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/mail/accountFileStore.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
import {randomUUID} from 'node:crypto';
|
|
4
4
|
import fs from 'node:fs/promises';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/mail/accountRepository.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
export const POLL_INTERVALS = Object.freeze([3, 5, 10, 15]);
|
|
4
4
|
import {randomUUID} from 'node:crypto';
|
|
5
5
|
import {normaliseIdentityList, findIdentity, bareAddress, signatureToText} from '../admin/mail/identity.js';
|
|
6
6
|
import {normaliseTemplates} from '../admin/mail/templates.js';
|
|
7
7
|
import {sanitiseSignature} from './render.js';
|
|
8
|
-
import {normaliseVacation} from '../admin/mail/vacation.js';
|
|
8
|
+
import {activeAwayId, normaliseAwayMessages, normaliseVacation} from '../admin/mail/vacation.js';
|
|
9
9
|
import {normaliseUndoSeconds} from '../admin/mail/scheduling.js';
|
|
10
10
|
import {normaliseRules, normaliseRuleGroups, rulesInEffect} from '../admin/mail/rules.js';
|
|
11
11
|
|
|
@@ -604,6 +604,34 @@ export function createAccountRepository({store, secrets, isOAuth = account => ac
|
|
|
604
604
|
});
|
|
605
605
|
}
|
|
606
606
|
|
|
607
|
+
const awayMessagesToPublic = account => {
|
|
608
|
+
const messages = normaliseAwayMessages(account);
|
|
609
|
+
return {messages, activeId: activeAwayId(account, messages)};
|
|
610
|
+
};
|
|
611
|
+
/**
|
|
612
|
+
* Replace the saved away messages and which one is on. The one switched on is copied
|
|
613
|
+
* into `vacation` (what the runner reads); none on switches the away message off and
|
|
614
|
+
* leaves its text where it was.
|
|
615
|
+
*/
|
|
616
|
+
async function setAwayMessages(userId, accountId, messages = [], activeId = null) {
|
|
617
|
+
const cleaned = normaliseAwayMessages({awayMessages: messages.map(m => {
|
|
618
|
+
const bodyHtml = sanitiseSignature(m?.bodyHtml ?? '');
|
|
619
|
+
return {...m, bodyHtml, bodyText: m?.bodyText ?? signatureToText(bodyHtml)};
|
|
620
|
+
})});
|
|
621
|
+
const active = cleaned.find(m => m.id === activeId) ?? null;
|
|
622
|
+
await withStoreLock(async () => {
|
|
623
|
+
const all = await readAll();
|
|
624
|
+
const index = all.findIndex(account => account.id === accountId && account.userId === userId);
|
|
625
|
+
if (index === -1) return;
|
|
626
|
+
all[index] = {...all[index], awayMessages: cleaned, awayActiveId: active?.id ?? null, updatedAt: new Date().toISOString()};
|
|
627
|
+
await writeAll(all);
|
|
628
|
+
});
|
|
629
|
+
const current = normaliseVacation(await getAccount(userId, accountId));
|
|
630
|
+
return setVacation(userId, accountId, active
|
|
631
|
+
? {...active, enabled: true}
|
|
632
|
+
: {...current, enabled: false});
|
|
633
|
+
}
|
|
634
|
+
|
|
607
635
|
const snoozeFolder = account => String(account?.snoozeFolder ?? '').trim() || 'Snoozed';
|
|
608
636
|
const undoSendSeconds = account => normaliseUndoSeconds(account?.undoSendSeconds);
|
|
609
637
|
async function setSendingOptions(userId, accountId, options = {}) {
|
|
@@ -668,5 +696,5 @@ export function createAccountRepository({store, secrets, isOAuth = account => ac
|
|
|
668
696
|
return all[index];
|
|
669
697
|
});
|
|
670
698
|
}
|
|
671
|
-
return {sieveToPublic, setSieve, vacationToPublic, sendingAddresses, setVacation, snoozeFolder, undoSendSeconds, setSendingOptions, rulesToPublic, ruleGroupsToPublic, rulesToRun, ruleFolders, setRules, rewriteFolderPaths, setIdentities, setTemplates, listAllAccounts, setPollInterval, setSyncFolders, setNotificationFolders, isOAuth, validate, listAccounts, setDefaultAccount, getAccount, saveAccount, deleteAccount, deleteAccountsForUser, pruneOrphans, toConnection, setSmtp, toSmtpConnection, smtpToPublic, trustImageSender, untrustImageSender, setRememberImageSenders, sendersImagesTrusted, setContactImages, contactImagesAllowed};
|
|
699
|
+
return {sieveToPublic, setSieve, vacationToPublic, awayMessagesToPublic, setAwayMessages, sendingAddresses, setVacation, snoozeFolder, undoSendSeconds, setSendingOptions, rulesToPublic, ruleGroupsToPublic, rulesToRun, ruleFolders, setRules, rewriteFolderPaths, setIdentities, setTemplates, listAllAccounts, setPollInterval, setSyncFolders, setNotificationFolders, isOAuth, validate, listAccounts, setDefaultAccount, getAccount, saveAccount, deleteAccount, deleteAccountsForUser, pruneOrphans, toConnection, setSmtp, toSmtpConnection, smtpToPublic, trustImageSender, untrustImageSender, setRememberImageSenders, sendersImagesTrusted, setContactImages, contactImagesAllowed};
|
|
672
700
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/mail/accountRoutes.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
import {MailKeyError} from './secretProvider.js';
|
|
4
4
|
|
|
@@ -472,7 +472,7 @@ export async function setComposeOptions(userId, accountId, options) {
|
|
|
472
472
|
|
|
473
473
|
/** Account lifecycle is authored in domma-mail/packages/core/src/mail/accountRepository.js. */
|
|
474
474
|
export const {
|
|
475
|
-
sieveToPublic, setSieve, vacationToPublic, sendingAddresses, setVacation, snoozeFolder, undoSendSeconds, setSendingOptions, rulesToPublic, ruleGroupsToPublic, rulesToRun, ruleFolders, setRules, rewriteFolderPaths, setIdentities, setTemplates, listAllAccounts, setPollInterval, setSyncFolders, setNotificationFolders, validate, listAccounts, setDefaultAccount, getAccount, saveAccount,
|
|
475
|
+
sieveToPublic, setSieve, vacationToPublic, awayMessagesToPublic, setAwayMessages, sendingAddresses, setVacation, snoozeFolder, undoSendSeconds, setSendingOptions, rulesToPublic, ruleGroupsToPublic, rulesToRun, ruleFolders, setRules, rewriteFolderPaths, setIdentities, setTemplates, listAllAccounts, setPollInterval, setSyncFolders, setNotificationFolders, validate, listAccounts, setDefaultAccount, getAccount, saveAccount,
|
|
476
476
|
deleteAccount, deleteAccountsForUser, pruneOrphans, toConnection,
|
|
477
477
|
setSmtp, toSmtpConnection, smtpToPublic, trustImageSender, untrustImageSender, setRememberImageSenders, sendersImagesTrusted, setContactImages, contactImagesAllowed
|
|
478
478
|
} = baseAccounts;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/mail/bodyTokenProvider.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
import {createHmac, timingSafeEqual} from 'node:crypto';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/mail/bodyTokens.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** CMS compatibility entry point for the existing iframe grant API. */
|
|
4
4
|
import {resolveKeySource} from './secretbox.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/mail/compose.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Turning a message into a reply, and a reply into something sendable.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/mail/defaults.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Reading defaults, shared by every edition.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/mail/envelope.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The shape the mirror holds one message in.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/mail/folderActions.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** Whole-folder operations use a snapshot of UIDs, never the visible page or a moving '*'. */
|
|
4
4
|
import {moveBulk, setFlagsBulk} from './write.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/mail/folderRuntime.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** Portable folder operations. Hosts supply ownership, serialization and metadata updates. */
|
|
4
4
|
import {validateFolderName, buildFolderPath, renameTarget, canModifyFolder, descendantsOf, moveTarget, resolveSubscriptions} from './folders.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/mail/folders.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
import {resolveSubscriptions} from './subscriptions.js';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.32.0, packages/core/src/mail/imapPoolRuntime.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* IMAP connection pool for the Mail Reader plugin.
|