@masterteam/system-settings 0.0.22 → 0.0.24

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.
@@ -1,2 +1,2 @@
1
- export { j as DEFAULT_DATE_FORMAT_OPTIONS, o as DEFAULT_EMAIL_DELIVERY_OPTIONS, D as DEFAULT_GENERAL_CONFIGURATION, k as DEFAULT_TIME_FORMAT_OPTIONS, l as DOTNET_DAY_DEFINITIONS, b as EMAIL_DELIVERY_ATTEMPT_STATUSES, q as EMAIL_DELIVERY_OPTIONS, f as EMAIL_DELIVERY_PERMISSIONS, x as EMAIL_DELIVERY_ROUTES, w as EMAIL_USER_INITIATED_TEST_OPERATION_KIND, h as EXPLORE_DEFAULT_VIEW_OPTIONS, s as EmailDeliveryAccessService, v as EmailUserTestDialog, F as FIXED_CURRENCIES, G as GENERAL_CONFIGURATION_SETTING_KEY, R as RATE_SOURCE_OPTIONS, m as SCHEDULE_ITEM_TYPE_OPTIONS, S as SystemSettings, n as SystemSettingsHolidayEditor, T as TIMESHEET_FREQUENCY_OPTIONS, W as WEEKEND_DAY_DEFINITIONS, d as areEmailTestRecipientsValid, u as buildEmailTemplatePlaceholderFields, t as collectEmailTemplatePlaceholders, c as createEmailTestRequestId, i as isConnectionTestAttempt, e as isEmailTestRequestPending, p as parseEmailTestRecipients, r as provideEmailDelivery } from './masterteam-system-settings-masterteam-system-settings-7I4TfgwP.mjs';
1
+ export { s as DEFAULT_DATE_FORMAT_OPTIONS, x as DEFAULT_EMAIL_DELIVERY_OPTIONS, D as DEFAULT_GENERAL_CONFIGURATION, t as DEFAULT_TIME_FORMAT_OPTIONS, u as DOTNET_DAY_DEFINITIONS, b as EMAIL_DELIVERY_ATTEMPT_STATUSES, y as EMAIL_DELIVERY_OPTIONS, f as EMAIL_DELIVERY_PERMISSIONS, J as EMAIL_DELIVERY_ROUTES, K as EMAIL_FONT_FAMILIES, N as EMAIL_FONT_LABELS, M as EMAIL_FONT_WEIGHTS, k as EMAIL_LAYOUT_CONTENT_SLOT, l as EMAIL_LAYOUT_MAX_BYTES, P as EMAIL_STYLE_ADVANCED_SECTIONS, L as EMAIL_STYLE_RANGES, O as EMAIL_STYLE_SECTIONS, I as EMAIL_USER_INITIATED_TEST_OPERATION_KIND, q as EXPLORE_DEFAULT_VIEW_OPTIONS, n as EmailContentStylesEditor, A as EmailDeliveryAccessService, o as EmailHtmlPreview, h as EmailLayoutFacade, H as EmailUserTestDialog, m as EmailVisualEditor, F as FIXED_CURRENCIES, G as GENERAL_CONFIGURATION_SETTING_KEY, R as RATE_SOURCE_OPTIONS, v as SCHEDULE_ITEM_TYPE_OPTIONS, S as SystemSettings, w as SystemSettingsHolidayEditor, T as TIMESHEET_FREQUENCY_OPTIONS, W as WEEKEND_DAY_DEFINITIONS, d as areEmailTestRecipientsValid, Y as buildEmailPreviewDocument, C as buildEmailTemplatePlaceholderFields, B as collectEmailTemplatePlaceholders, c as createEmailTestRequestId, X as emailDesignLeaveGuard, j as emailStylesKey, i as isConnectionTestAttempt, e as isEmailTestRequestPending, V as normalizeEmailColor, p as parseEmailTestRecipients, z as provideEmailDelivery, Q as readEmailStyle, r as readLayoutErrorDiagnostics, U as writeEmailStyle } from './masterteam-system-settings-masterteam-system-settings-KfJrvCL9.mjs';
2
2
  //# sourceMappingURL=masterteam-system-settings.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masterteam/system-settings",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/system-settings",
6
6
  "linkDirectory": false,
@@ -19,8 +19,8 @@
19
19
  "rxjs": "^7.8.2",
20
20
  "tailwindcss": "^4.2.2",
21
21
  "tailwindcss-primeui": "^0.6.1",
22
- "@masterteam/components": "^0.0.301",
23
- "@masterteam/forms": "^0.0.156",
22
+ "@masterteam/components": "^0.0.328",
23
+ "@masterteam/forms": "^0.0.169",
24
24
  "@masterteam/icons": "^0.0.17"
25
25
  },
26
26
  "sideEffects": false,
@@ -1,12 +1,13 @@
1
1
  import * as _angular_forms from '@angular/forms';
2
- import { FormGroup, FormControl } from '@angular/forms';
2
+ import { FormGroup, FormControl, ControlValueAccessor } from '@angular/forms';
3
3
  import * as _angular_core from '@angular/core';
4
4
  import { OnInit, InjectionToken, EnvironmentProviders } from '@angular/core';
5
5
  import { DatePicker } from 'primeng/datepicker';
6
6
  import { ModalService } from '@masterteam/components/modal';
7
7
  import { Observable } from 'rxjs';
8
8
  import * as _masterteam_system_settings from '@masterteam/system-settings';
9
- import { Routes } from '@angular/router';
9
+ import { Routes, CanDeactivateFn } from '@angular/router';
10
+ import { MTIcon } from '@masterteam/icons';
10
11
 
11
12
  type SystemSettingPrimitive = string | number | boolean | null;
12
13
  type SystemSettingObject = Record<string, unknown>;
@@ -1082,6 +1083,12 @@ declare class EmailUserTestDialog {
1082
1083
  readonly sourceLabel: _angular_core.InputSignal<string>;
1083
1084
  readonly placeholderKeys: _angular_core.InputSignal<readonly string[]>;
1084
1085
  readonly placeholderFields: _angular_core.InputSignal<readonly EmailTemplatePlaceholderField[]>;
1086
+ /**
1087
+ * When given, these values fill the placeholders and the per-placeholder
1088
+ * fields are not shown (the notification editor sends the same readable
1089
+ * samples as its preview).
1090
+ */
1091
+ readonly sampleValues: _angular_core.InputSignal<Readonly<Record<string, string>> | null>;
1085
1092
  protected readonly modal: ModalService;
1086
1093
  private readonly ref;
1087
1094
  private readonly destroyRef;
@@ -1114,10 +1121,468 @@ declare class EmailUserTestDialog {
1114
1121
  private retrieveStoredResult;
1115
1122
  protected t(key: string): string;
1116
1123
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EmailUserTestDialog, never>;
1117
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<EmailUserTestDialog, "mt-email-user-test-dialog", never, { "kind": { "alias": "kind"; "required": true; "isSignal": true; }; "eventId": { "alias": "eventId"; "required": false; "isSignal": true; }; "templateId": { "alias": "templateId"; "required": false; "isSignal": true; }; "alertId": { "alias": "alertId"; "required": false; "isSignal": true; }; "sourceLabel": { "alias": "sourceLabel"; "required": false; "isSignal": true; }; "placeholderKeys": { "alias": "placeholderKeys"; "required": false; "isSignal": true; }; "placeholderFields": { "alias": "placeholderFields"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1124
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EmailUserTestDialog, "mt-email-user-test-dialog", never, { "kind": { "alias": "kind"; "required": true; "isSignal": true; }; "eventId": { "alias": "eventId"; "required": false; "isSignal": true; }; "templateId": { "alias": "templateId"; "required": false; "isSignal": true; }; "alertId": { "alias": "alertId"; "required": false; "isSignal": true; }; "sourceLabel": { "alias": "sourceLabel"; "required": false; "isSignal": true; }; "placeholderKeys": { "alias": "placeholderKeys"; "required": false; "isSignal": true; }; "placeholderFields": { "alias": "placeholderFields"; "required": false; "isSignal": true; }; "sampleValues": { "alias": "sampleValues"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1118
1125
  }
1119
1126
 
1120
1127
  declare const EMAIL_DELIVERY_ROUTES: Routes;
1121
1128
 
1122
- export { DEFAULT_DATE_FORMAT_OPTIONS, DEFAULT_EMAIL_DELIVERY_OPTIONS, DEFAULT_GENERAL_CONFIGURATION, DEFAULT_TIME_FORMAT_OPTIONS, DOTNET_DAY_DEFINITIONS, EMAIL_DELIVERY_ATTEMPT_STATUSES, EMAIL_DELIVERY_OPTIONS, EMAIL_DELIVERY_PERMISSIONS, EMAIL_DELIVERY_ROUTES, EMAIL_USER_INITIATED_TEST_OPERATION_KIND, EXPLORE_DEFAULT_VIEW_OPTIONS, EmailDeliveryAccessService, EmailUserTestDialog, FIXED_CURRENCIES, GENERAL_CONFIGURATION_SETTING_KEY, RATE_SOURCE_OPTIONS, SCHEDULE_ITEM_TYPE_OPTIONS, SystemSettings, SystemSettingsHolidayEditor, TIMESHEET_FREQUENCY_OPTIONS, WEEKEND_DAY_DEFINITIONS, areEmailTestRecipientsValid, buildEmailTemplatePlaceholderFields, collectEmailTemplatePlaceholders, createEmailTestRequestId, isConnectionTestAttempt, isEmailTestRequestPending, parseEmailTestRecipients, provideEmailDelivery };
1123
- export type { ApiResponse, AppResponse, CurrencyCatalogItem, CurrencySettingValue, CurrencyUnitLabel, EmailAttemptPage, EmailAttemptReplayRequest, EmailAttemptReplayResult, EmailAuthorizationStartResult, EmailConnectionCreateRequest, EmailConnectionDetails, EmailConnectionRecord, EmailConnectionSummary, EmailConnectionTestRequest, EmailConnectionTestResult, EmailConnectionUpdateRequest, EmailConnectionValidationResult, EmailCredentialMutation, EmailCredentialOperation, EmailCredentialStatus, EmailCredentialStorageKind, EmailDeliveryAccessibility, EmailDeliveryAttempt, EmailDeliveryOptions, EmailDeliveryPermission, EmailDeliveryProblem, EmailDeliveryStatus, EmailErrorCatalogEntry, EmailEvidenceDecisionRequest, EmailEvidenceDownload, EmailEvidenceRebuildResult, EmailFinalizationQuarantineItem, EmailFinalizationQuarantinePage, EmailHostEvidenceItem, EmailHostEvidencePage, EmailProviderActionDescriptor, EmailProviderAuthenticationModeDescriptor, EmailProviderDescriptor, EmailProviderFieldDescriptor, EmailSafeDiagnostic, EmailSendResult, EmailTemplatePlaceholderField, EmailTemplatePlaceholderProperty, EmailUserTestDispatchResult, EmailUserTestKind, ExploreDefaultView, FormatSchemaOption, GeneralConfigurationSettingValue, GlobalWorkingHoursSettingValue, HolidayItem, HolidayTableRow, HolidaysSettingValue, IconSelectOption, ScheduleItemTypeOption, SelectOption, SystemSetting, SystemSettingObject, SystemSettingPrimitive, SystemSettingValue, SystemSettingsForm, SystemSettingsFormatSchema, SystemSettingsSnapshot, TimeSheetFrequency, TimeSheetPolicySettingValue, TimezoneRegionOption, TimezoneSettingValue, UpdateSystemSettingItem, WeekendDayOption, WeekendSettingValue };
1129
+ /**
1130
+ * Shared notification email design (Pplus5.BE `NotificationEmailLayoutController`,
1131
+ * `api/notifications/email-layout`). One published base wraps every newly
1132
+ * prepared notification email; event templates hold business content only.
1133
+ */
1134
+ type EmailLayoutSource = 'published' | 'configured' | 'recommended';
1135
+ interface EmailLayoutDiagnostic {
1136
+ code: string;
1137
+ severity: string;
1138
+ path: string;
1139
+ }
1140
+ /** Fonts the server accepts for shared content styles (approved fallback stacks). */
1141
+ declare const EMAIL_FONT_FAMILIES: readonly ["tahoma", "arial", "verdana", "georgia", "times-new-roman", "courier-new"];
1142
+ type EmailFontFamily = (typeof EMAIL_FONT_FAMILIES)[number];
1143
+ /** `text`, `english`, `arabic`: typography only. Null / omitted inherits. */
1144
+ interface EmailTypographyStyle {
1145
+ fontFamily?: EmailFontFamily | null;
1146
+ fontSize?: number | null;
1147
+ lineHeight?: number | null;
1148
+ color?: string | null;
1149
+ }
1150
+ /** Role groups (headings, paragraph, link, button, table, list, quote, code). */
1151
+ interface EmailBlockStyle extends EmailTypographyStyle {
1152
+ backgroundColor?: string | null;
1153
+ borderColor?: string | null;
1154
+ fontWeight?: number | null;
1155
+ spaceBefore?: number | null;
1156
+ spaceAfter?: number | null;
1157
+ padding?: number | null;
1158
+ borderWidth?: number | null;
1159
+ underline?: boolean | null;
1160
+ }
1161
+ /**
1162
+ * Shared content styles published with the base (Pplus5.BE
1163
+ * `Notification-Email-Content-Styles.md`). Applied to event content only, never
1164
+ * to the base header/footer. Publishing replaces the whole object, so every
1165
+ * group read from the server is sent back — including ones without a control.
1166
+ */
1167
+ interface EmailContentStyles {
1168
+ text?: EmailTypographyStyle | null;
1169
+ english?: EmailTypographyStyle | null;
1170
+ arabic?: EmailTypographyStyle | null;
1171
+ heading1?: EmailBlockStyle | null;
1172
+ heading2?: EmailBlockStyle | null;
1173
+ heading3?: EmailBlockStyle | null;
1174
+ heading4?: EmailBlockStyle | null;
1175
+ paragraph?: EmailBlockStyle | null;
1176
+ link?: EmailBlockStyle | null;
1177
+ button?: EmailBlockStyle | null;
1178
+ table?: EmailBlockStyle | null;
1179
+ tableHeader?: EmailBlockStyle | null;
1180
+ tableCell?: EmailBlockStyle | null;
1181
+ list?: EmailBlockStyle | null;
1182
+ quote?: EmailBlockStyle | null;
1183
+ code?: EmailBlockStyle | null;
1184
+ /** 0–96 px before later top-level language sections; default 32. */
1185
+ languageSectionGap?: number | null;
1186
+ }
1187
+ interface EmailLayoutSnapshot {
1188
+ body: string;
1189
+ /** Always an object; empty groups / null fields inherit. */
1190
+ contentStyles: EmailContentStyles;
1191
+ source: EmailLayoutSource;
1192
+ /** `0` before the first publication — submit exactly that for the first publish. */
1193
+ revision: number;
1194
+ hash: string;
1195
+ clientBaseUrl: string;
1196
+ canRestore: boolean;
1197
+ diagnostics: EmailLayoutDiagnostic[];
1198
+ approvedImageOrigins: string[];
1199
+ }
1200
+ interface EmailLayoutPreview {
1201
+ html: string;
1202
+ text: string;
1203
+ sanitizedBody: string;
1204
+ /** The styles as the server normalized them for this render. */
1205
+ contentStyles: EmailContentStyles;
1206
+ layoutHash: string;
1207
+ contentHash: string;
1208
+ /** The live revision when the preview ran; differs from the baseline after someone else publishes. */
1209
+ effectiveRevision: number;
1210
+ fidelity: 'browser';
1211
+ approvedImageOrigins: string[];
1212
+ diagnostics: EmailLayoutDiagnostic[];
1213
+ }
1214
+ /** The one literal slot every base must contain exactly once. */
1215
+ declare const EMAIL_LAYOUT_CONTENT_SLOT = "{content}";
1216
+ /** UTF-8 byte limit for the base HTML. */
1217
+ declare const EMAIL_LAYOUT_MAX_BYTES: number;
1218
+
1219
+ /**
1220
+ * State for the Email design tab. The working draft lives here rather than in
1221
+ * the tab so switching between Connections / Activity / Email design keeps
1222
+ * unsaved edits; leaving the page asks first (`emailDesignLeaveGuard`).
1223
+ *
1224
+ * There is no server-side draft: the design (base HTML + shared content
1225
+ * styles) is only ever previewed (render-only) or published with the revision
1226
+ * it was read at. Both parts always travel together.
1227
+ */
1228
+ declare class EmailLayoutFacade {
1229
+ private readonly http;
1230
+ private readonly options;
1231
+ private readonly transloco;
1232
+ private readonly headers;
1233
+ readonly snapshot: _angular_core.WritableSignal<EmailLayoutSnapshot | null>;
1234
+ readonly draft: _angular_core.WritableSignal<string>;
1235
+ /** Working copy of the shared content styles; starts as the server's object. */
1236
+ readonly stylesDraft: _angular_core.WritableSignal<EmailContentStyles>;
1237
+ readonly loading: _angular_core.WritableSignal<boolean>;
1238
+ readonly loadErrorCode: _angular_core.WritableSignal<string | null>;
1239
+ readonly loadFailed: _angular_core.WritableSignal<boolean>;
1240
+ readonly saving: _angular_core.WritableSignal<"publish" | "restore" | null>;
1241
+ /** Someone else published since this draft's baseline was read. */
1242
+ readonly conflict: _angular_core.WritableSignal<boolean>;
1243
+ readonly stylesDirty: _angular_core.Signal<boolean>;
1244
+ readonly dirty: _angular_core.Signal<boolean>;
1245
+ load(): Observable<EmailLayoutSnapshot>;
1246
+ /** Render-only: the server supplies a fixed bilingual sample; nothing is saved or sent. */
1247
+ preview(body: string, contentStyles: EmailContentStyles): Observable<EmailLayoutPreview>;
1248
+ publish(): Observable<EmailLayoutSnapshot>;
1249
+ restorePrevious(): Observable<EmailLayoutSnapshot>;
1250
+ /**
1251
+ * Re-reads the live design after a conflict. `keepDraft` keeps the user's
1252
+ * edits on top of the newer baseline, so the next publish applies them
1253
+ * deliberately; otherwise the draft is replaced by what is live.
1254
+ */
1255
+ reloadLatest(keepDraft: boolean): Observable<EmailLayoutSnapshot>;
1256
+ discard(): void;
1257
+ describeCode(code: string | null): string;
1258
+ describeDiagnostic(diagnostic: EmailLayoutDiagnostic): string;
1259
+ readErrorCode(error: unknown): string | null;
1260
+ private adopt;
1261
+ private onWriteError;
1262
+ private url;
1263
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EmailLayoutFacade, never>;
1264
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<EmailLayoutFacade>;
1265
+ }
1266
+ /**
1267
+ * The diagnostics of a failed write. Domain errors send `{code, severity,
1268
+ * path}` items; standard model validation (`VAL_001`) sends a field map such
1269
+ * as `{ "ContentStyles": ["..."] }`, shown as one invalid-field line each.
1270
+ */
1271
+ declare function readLayoutErrorDiagnostics(error: unknown): EmailLayoutDiagnostic[];
1272
+
1273
+ /**
1274
+ * Shared email content styles: the controls the Email design tab offers and
1275
+ * the pure read / write / compare helpers behind them. Value ranges follow
1276
+ * Pplus5.BE `Notification-Email-Content-Styles.md`; the server re-validates.
1277
+ */
1278
+
1279
+ type EmailStyleFieldKind = 'font' | 'size' | 'lineHeight' | 'color' | 'weight' | 'space' | 'padding' | 'borderWidth' | 'underline' | 'gap';
1280
+ type EmailStyleField = 'fontFamily' | 'fontSize' | 'lineHeight' | 'color' | 'backgroundColor' | 'borderColor' | 'fontWeight' | 'spaceBefore' | 'spaceAfter' | 'padding' | 'borderWidth' | 'underline';
1281
+ /** A style group, or the one top-level number (`languageSectionGap`). */
1282
+ type EmailStyleGroup = Exclude<keyof EmailContentStyles, 'languageSectionGap'>;
1283
+ interface EmailStyleControl {
1284
+ /** Unique control id: `group.field`, or `languageSectionGap`. */
1285
+ id: string;
1286
+ group: EmailStyleGroup | 'languageSectionGap';
1287
+ field: EmailStyleField | null;
1288
+ kind: EmailStyleFieldKind;
1289
+ }
1290
+ interface EmailStyleSection {
1291
+ key: string;
1292
+ controls: EmailStyleControl[];
1293
+ }
1294
+ declare const EMAIL_STYLE_RANGES: Record<Exclude<EmailStyleFieldKind, 'font' | 'color' | 'weight' | 'underline'>, {
1295
+ min: number;
1296
+ max: number;
1297
+ fractionDigits: number;
1298
+ }>;
1299
+ declare const EMAIL_FONT_WEIGHTS: readonly [100, 200, 300, 400, 500, 600, 700, 800, 900];
1300
+ declare const EMAIL_FONT_LABELS: Record<EmailFontFamily, string>;
1301
+ /** Everyday controls, shown first. */
1302
+ declare const EMAIL_STYLE_SECTIONS: EmailStyleSection[];
1303
+ /** Less common roles, under "Advanced". Their values are kept when hidden. */
1304
+ declare const EMAIL_STYLE_ADVANCED_SECTIONS: EmailStyleSection[];
1305
+ type StyleValue = string | number | boolean | null;
1306
+ declare function readEmailStyle(styles: EmailContentStyles, control: EmailStyleControl): StyleValue;
1307
+ /**
1308
+ * Returns new styles with one control changed. Everything else — other groups,
1309
+ * other fields, fields without a control — is kept exactly, because a publish
1310
+ * replaces the whole object. `null` removes the field (inherit); `0` and
1311
+ * `false` are kept as intentional values.
1312
+ */
1313
+ declare function writeEmailStyle(styles: EmailContentStyles, control: EmailStyleControl, value: StyleValue): EmailContentStyles;
1314
+ /** `#abc` / `#AABBCC` → `#aabbcc`; anything else is not a usable colour. */
1315
+ declare function normalizeEmailColor(value: string | null): string | null;
1316
+ /**
1317
+ * A stable comparison key: key order, null fields and empty groups do not
1318
+ * count, so the server's normalized copy of the same styles compares equal.
1319
+ */
1320
+ declare function emailStylesKey(styles: EmailContentStyles | null): string;
1321
+
1322
+ type ControlValue = string | number | boolean | null;
1323
+ /**
1324
+ * The shared content style controls of the Email design tab. Every field is
1325
+ * optional: empty means "inherit". Only the edited field changes; groups and
1326
+ * fields without a control are passed through untouched, because publishing
1327
+ * replaces the whole styles object.
1328
+ */
1329
+ declare class EmailContentStylesEditor {
1330
+ private readonly transloco;
1331
+ private readonly destroyRef;
1332
+ readonly styles: _angular_core.InputSignal<EmailContentStyles>;
1333
+ readonly disabled: _angular_core.InputSignal<boolean>;
1334
+ readonly stylesChange: _angular_core.OutputEmitterRef<EmailContentStyles>;
1335
+ protected readonly sections: EmailStyleSection[];
1336
+ protected readonly advancedSections: EmailStyleSection[];
1337
+ protected readonly showAdvanced: _angular_core.WritableSignal<boolean>;
1338
+ private readonly lang;
1339
+ protected readonly fontOptions: {
1340
+ value: "tahoma" | "arial" | "verdana" | "georgia" | "times-new-roman" | "courier-new";
1341
+ label: string;
1342
+ }[];
1343
+ protected readonly weightOptions: {
1344
+ value: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
1345
+ label: string;
1346
+ }[];
1347
+ protected readonly underlineOptions: _angular_core.Signal<{
1348
+ value: boolean;
1349
+ label: string;
1350
+ }[]>;
1351
+ /** The styles as last emitted, or as last received from the host. */
1352
+ private latest;
1353
+ /** One control per style field, built once. */
1354
+ protected readonly controls: Map<string, FormControl<ControlValue>>;
1355
+ private readonly definitions;
1356
+ constructor();
1357
+ protected control(id: string): FormControl<ControlValue>;
1358
+ protected label(control: EmailStyleControl): string;
1359
+ protected groupLabel(control: EmailStyleControl): string;
1360
+ /** Controls of one section, bunched by the role they style. */
1361
+ protected rows(section: EmailStyleSection): EmailStyleControl[][];
1362
+ /** Bounds of a number control (the select / colour kinds never ask). */
1363
+ protected range(control: EmailStyleControl): {
1364
+ min: number;
1365
+ max: number;
1366
+ fractionDigits: number;
1367
+ };
1368
+ protected sectionLabel(section: EmailStyleSection): string;
1369
+ private onEdit;
1370
+ private t;
1371
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EmailContentStylesEditor, never>;
1372
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EmailContentStylesEditor, "mt-email-content-styles", never, { "styles": { "alias": "styles"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "stylesChange": "stylesChange"; }, never, never, true, never>;
1373
+ }
1374
+
1375
+ /**
1376
+ * Leaving the Email page with an unpublished design draft asks once. Switching
1377
+ * tabs inside the page is not a navigation away — the draft lives in
1378
+ * `EmailLayoutFacade` and is still there when the tab is reopened.
1379
+ */
1380
+ declare const emailDesignLeaveGuard: CanDeactivateFn<unknown>;
1381
+
1382
+ interface EmailPreviewDocumentOptions {
1383
+ showImages: boolean;
1384
+ approvedImageOrigins: readonly string[];
1385
+ /** Wrap a content fragment (an App message) in a minimal document. */
1386
+ fragment: boolean;
1387
+ direction: 'ltr' | 'rtl' | null;
1388
+ }
1389
+ /**
1390
+ * Renders server-composed notification HTML without letting it touch the app.
1391
+ *
1392
+ * The frame is an opaque origin (`sandbox=""`: no scripts, forms, popups,
1393
+ * same-origin or top navigation), sends no referrer, and the document carries
1394
+ * its own CSP: nothing loads except inline styles, and images only from the
1395
+ * approved origins once the viewer opts in. Links are stripped from this
1396
+ * preview-only copy so a click cannot navigate the frame; scrolling and
1397
+ * keyboard focus still work. The source is never injected into the app DOM.
1398
+ */
1399
+ declare class EmailHtmlPreview {
1400
+ readonly html: _angular_core.InputSignal<string>;
1401
+ readonly showImages: _angular_core.InputSignal<boolean>;
1402
+ readonly approvedImageOrigins: _angular_core.InputSignal<readonly string[]>;
1403
+ readonly fragment: _angular_core.InputSignal<boolean>;
1404
+ readonly direction: _angular_core.InputSignal<"rtl" | "ltr" | null>;
1405
+ readonly title: _angular_core.InputSignal<string>;
1406
+ readonly height: _angular_core.InputSignal<string>;
1407
+ private readonly frame;
1408
+ constructor();
1409
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EmailHtmlPreview, never>;
1410
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EmailHtmlPreview, "mt-email-html-preview", never, { "html": { "alias": "html"; "required": false; "isSignal": true; }; "showImages": { "alias": "showImages"; "required": false; "isSignal": true; }; "approvedImageOrigins": { "alias": "approvedImageOrigins"; "required": false; "isSignal": true; }; "fragment": { "alias": "fragment"; "required": false; "isSignal": true; }; "direction": { "alias": "direction"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1411
+ }
1412
+ declare function buildEmailPreviewDocument(html: string, options: EmailPreviewDocumentOptions): string;
1413
+
1414
+ /**
1415
+ * Pure helpers for `mt-email-visual-editor`: building the editing document and
1416
+ * turning it back into the exact source format the backend expects.
1417
+ *
1418
+ * In the canvas, `{{token}}` placeholders and the layout's `{content}` slot are
1419
+ * shown as non-editable chips; serialization turns every chip back into its
1420
+ * literal text, so the stored HTML never contains editor markup.
1421
+ */
1422
+ interface EmailEditorPlaceholder {
1423
+ key: string;
1424
+ label: string;
1425
+ }
1426
+ type EmailImageError = 'no-origins' | 'url' | 'origin' | 'alt' | 'size';
1427
+ /**
1428
+ * Formatting the email policy keeps: inline `color`, `background-color` and
1429
+ * `font-size` on spans, and `text-align` on blocks. Classes (how Quill applies
1430
+ * alignment, size and font) are stripped, so everything here is an inline style.
1431
+ */
1432
+ interface EditorSwatch {
1433
+ key: string;
1434
+ value: string;
1435
+ }
1436
+ type EditorTextSize = 'small' | 'normal' | 'large' | 'huge';
1437
+
1438
+ type EditorMode = 'design' | 'html';
1439
+ type StylePanel = 'color' | 'highlight' | 'size';
1440
+ interface ToolbarAction {
1441
+ key: string;
1442
+ icon?: MTIcon;
1443
+ text?: string;
1444
+ run: () => void;
1445
+ }
1446
+ /**
1447
+ * Visual editor for notification email HTML (event content and the shared
1448
+ * base layout), with an HTML tab for the exact source.
1449
+ *
1450
+ * The canvas is a sandboxed, script-free iframe (`sandbox="allow-same-origin"`
1451
+ * so the host can edit it; nothing inside it can run) with its own CSP —
1452
+ * images and network stay blocked, as the contract asks. The browser's editing
1453
+ * DOM keeps tables, inline styles and `lang` / `dir`; `{{tokens}}` and the
1454
+ * layout's `{content}` slot are shown as chips and written back as literal
1455
+ * text. Opening content, or switching between Visual and HTML, never emits a
1456
+ * value: only a real edit does, so nothing is rewritten or marked unsaved just
1457
+ * by looking at it.
1458
+ */
1459
+ declare class EmailVisualEditor implements ControlValueAccessor {
1460
+ private readonly transloco;
1461
+ private readonly destroyRef;
1462
+ readonly label: _angular_core.InputSignal<string | undefined>;
1463
+ readonly hint: _angular_core.InputSignal<string | undefined>;
1464
+ /** Placeholders the content may use; their labels name the chips. */
1465
+ readonly placeholders: _angular_core.InputSignal<readonly EmailEditorPlaceholder[]>;
1466
+ /** Editing the shared base layout: `{content}` is shown as a protected slot. */
1467
+ readonly layout: _angular_core.InputSignal<boolean>;
1468
+ readonly height: _angular_core.InputSignal<string>;
1469
+ /** Reading direction of the whole canvas (a single-language field). */
1470
+ readonly direction: _angular_core.InputSignal<"rtl" | "ltr" | null>;
1471
+ /** Offer the English + Arabic starter on an empty email. */
1472
+ readonly starter: _angular_core.InputSignal<boolean>;
1473
+ /** The canvas or the HTML source received focus. */
1474
+ readonly focused: _angular_core.OutputEmitterRef<void>;
1475
+ /**
1476
+ * HTTPS origins the server accepts images from (`approvedImageOrigins` on the
1477
+ * layout read / preview). Empty means images are not allowed at all.
1478
+ */
1479
+ readonly approvedImageOrigins: _angular_core.InputSignal<readonly string[]>;
1480
+ protected readonly imageOpen: _angular_core.WritableSignal<boolean>;
1481
+ protected readonly imageError: _angular_core.WritableSignal<EmailImageError | null>;
1482
+ protected readonly editingImage: _angular_core.WritableSignal<HTMLImageElement | null>;
1483
+ protected readonly imageForm: {
1484
+ src: FormControl<string>;
1485
+ alt: FormControl<string>;
1486
+ width: FormControl<number | null>;
1487
+ height: FormControl<number | null>;
1488
+ };
1489
+ protected readonly imageMin = 16;
1490
+ protected readonly imageMax = 1200;
1491
+ protected readonly imageOriginsLabel: _angular_core.Signal<string>;
1492
+ protected readonly imageErrorText: _angular_core.Signal<string>;
1493
+ protected readonly mode: _angular_core.WritableSignal<EditorMode>;
1494
+ protected readonly value: _angular_core.WritableSignal<string>;
1495
+ protected readonly disabled: _angular_core.WritableSignal<boolean>;
1496
+ protected readonly linkOpen: _angular_core.WritableSignal<boolean>;
1497
+ /** The colour / size row under the toolbar. */
1498
+ protected readonly stylePanel: _angular_core.WritableSignal<StylePanel | null>;
1499
+ protected readonly textColors: readonly EditorSwatch[];
1500
+ protected readonly highlightColors: readonly EditorSwatch[];
1501
+ protected readonly textSizes: readonly {
1502
+ key: EditorTextSize;
1503
+ px: number | null;
1504
+ }[];
1505
+ protected readonly linkError: _angular_core.WritableSignal<boolean>;
1506
+ protected readonly linkControl: FormControl<string>;
1507
+ protected readonly sourceControl: FormControl<string>;
1508
+ protected readonly designBlocked: _angular_core.Signal<boolean>;
1509
+ protected readonly effectiveMode: _angular_core.Signal<EditorMode>;
1510
+ protected readonly isEmpty: _angular_core.Signal<boolean>;
1511
+ protected readonly modeOptions: _angular_core.Signal<{
1512
+ label: string;
1513
+ value: EditorMode;
1514
+ icon: MTIcon;
1515
+ }[]>;
1516
+ protected readonly blockActions: ToolbarAction[];
1517
+ protected readonly inlineActions: ToolbarAction[];
1518
+ protected readonly styleActions: ToolbarAction[];
1519
+ protected readonly alignActions: ToolbarAction[];
1520
+ protected readonly listActions: ToolbarAction[];
1521
+ protected readonly directionActions: ToolbarAction[];
1522
+ protected readonly historyActions: ToolbarAction[];
1523
+ private readonly frame;
1524
+ private readonly sourceHost;
1525
+ private readonly lang;
1526
+ /** The last value this editor emitted — writes of it are not re-rendered. */
1527
+ private lastEmitted;
1528
+ private renderedFrame;
1529
+ private renderedKey;
1530
+ private savedRange;
1531
+ /** Set while a multi-step command runs, so it emits once at the end. */
1532
+ private batching;
1533
+ private onChange;
1534
+ private onTouched;
1535
+ private detachCanvas;
1536
+ constructor();
1537
+ writeValue(value: string | null): void;
1538
+ registerOnChange(fn: (value: string) => void): void;
1539
+ registerOnTouched(fn: () => void): void;
1540
+ setDisabledState(disabled: boolean): void;
1541
+ /** Inserts `{{key}}` where the cursor is (as a chip in Visual, as text in HTML). */
1542
+ insertToken(key: string, label?: string): void;
1543
+ protected onModeChange(mode: string | number): void;
1544
+ protected startBilingual(): void;
1545
+ protected toggleStylePanel(panel: StylePanel): void;
1546
+ protected applyColor(swatch: EditorSwatch): void;
1547
+ protected removeColor(): void;
1548
+ protected applySize(size: EditorTextSize): void;
1549
+ protected swatchLabel(swatch: EditorSwatch): string;
1550
+ protected toggleLink(): void;
1551
+ protected useRecordLink(): void;
1552
+ protected applyLink(): void;
1553
+ protected removeLink(): void;
1554
+ /**
1555
+ * Opens the image row: for the image selected in the canvas (to change it),
1556
+ * otherwise for a new image at the cursor.
1557
+ */
1558
+ protected toggleImage(): void;
1559
+ protected applyImage(): void;
1560
+ protected removeImage(): void;
1561
+ protected closeImage(): void;
1562
+ protected actionLabel(key: string): string;
1563
+ private renderCanvas;
1564
+ private attachCanvas;
1565
+ private emitFromCanvas;
1566
+ private emit;
1567
+ private exec;
1568
+ /** Commands whose CSS form survives the email policy (spans with styles). */
1569
+ private execWithCss;
1570
+ /** Written as `<s>`: the policy strips `<strike>` and `text-decoration-line`. */
1571
+ private strike;
1572
+ private clearStyle;
1573
+ private formatBlock;
1574
+ /** Sets the reading direction (and language) of the block under the cursor. */
1575
+ private setDirection;
1576
+ /** Highlights (canvas-only class, never serialized) and selects one image. */
1577
+ private selectImage;
1578
+ private saveSelection;
1579
+ private restoreSelection;
1580
+ private placeCaret;
1581
+ private canvasDocument;
1582
+ private t;
1583
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EmailVisualEditor, never>;
1584
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EmailVisualEditor, "mt-email-visual-editor", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "placeholders": { "alias": "placeholders"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "direction": { "alias": "direction"; "required": false; "isSignal": true; }; "starter": { "alias": "starter"; "required": false; "isSignal": true; }; "approvedImageOrigins": { "alias": "approvedImageOrigins"; "required": false; "isSignal": true; }; }, { "focused": "focused"; }, never, never, true, never>;
1585
+ }
1586
+
1587
+ export { DEFAULT_DATE_FORMAT_OPTIONS, DEFAULT_EMAIL_DELIVERY_OPTIONS, DEFAULT_GENERAL_CONFIGURATION, DEFAULT_TIME_FORMAT_OPTIONS, DOTNET_DAY_DEFINITIONS, EMAIL_DELIVERY_ATTEMPT_STATUSES, EMAIL_DELIVERY_OPTIONS, EMAIL_DELIVERY_PERMISSIONS, EMAIL_DELIVERY_ROUTES, EMAIL_FONT_FAMILIES, EMAIL_FONT_LABELS, EMAIL_FONT_WEIGHTS, EMAIL_LAYOUT_CONTENT_SLOT, EMAIL_LAYOUT_MAX_BYTES, EMAIL_STYLE_ADVANCED_SECTIONS, EMAIL_STYLE_RANGES, EMAIL_STYLE_SECTIONS, EMAIL_USER_INITIATED_TEST_OPERATION_KIND, EXPLORE_DEFAULT_VIEW_OPTIONS, EmailContentStylesEditor, EmailDeliveryAccessService, EmailHtmlPreview, EmailLayoutFacade, EmailUserTestDialog, EmailVisualEditor, FIXED_CURRENCIES, GENERAL_CONFIGURATION_SETTING_KEY, RATE_SOURCE_OPTIONS, SCHEDULE_ITEM_TYPE_OPTIONS, SystemSettings, SystemSettingsHolidayEditor, TIMESHEET_FREQUENCY_OPTIONS, WEEKEND_DAY_DEFINITIONS, areEmailTestRecipientsValid, buildEmailPreviewDocument, buildEmailTemplatePlaceholderFields, collectEmailTemplatePlaceholders, createEmailTestRequestId, emailDesignLeaveGuard, emailStylesKey, isConnectionTestAttempt, isEmailTestRequestPending, normalizeEmailColor, parseEmailTestRecipients, provideEmailDelivery, readEmailStyle, readLayoutErrorDiagnostics, writeEmailStyle };
1588
+ export type { ApiResponse, AppResponse, CurrencyCatalogItem, CurrencySettingValue, CurrencyUnitLabel, EmailAttemptPage, EmailAttemptReplayRequest, EmailAttemptReplayResult, EmailAuthorizationStartResult, EmailBlockStyle, EmailConnectionCreateRequest, EmailConnectionDetails, EmailConnectionRecord, EmailConnectionSummary, EmailConnectionTestRequest, EmailConnectionTestResult, EmailConnectionUpdateRequest, EmailConnectionValidationResult, EmailContentStyles, EmailCredentialMutation, EmailCredentialOperation, EmailCredentialStatus, EmailCredentialStorageKind, EmailDeliveryAccessibility, EmailDeliveryAttempt, EmailDeliveryOptions, EmailDeliveryPermission, EmailDeliveryProblem, EmailDeliveryStatus, EmailEditorPlaceholder, EmailErrorCatalogEntry, EmailEvidenceDecisionRequest, EmailEvidenceDownload, EmailEvidenceRebuildResult, EmailFinalizationQuarantineItem, EmailFinalizationQuarantinePage, EmailFontFamily, EmailHostEvidenceItem, EmailHostEvidencePage, EmailLayoutDiagnostic, EmailLayoutPreview, EmailLayoutSnapshot, EmailLayoutSource, EmailPreviewDocumentOptions, EmailProviderActionDescriptor, EmailProviderAuthenticationModeDescriptor, EmailProviderDescriptor, EmailProviderFieldDescriptor, EmailSafeDiagnostic, EmailSendResult, EmailStyleControl, EmailStyleField, EmailStyleFieldKind, EmailStyleGroup, EmailStyleSection, EmailTemplatePlaceholderField, EmailTemplatePlaceholderProperty, EmailTypographyStyle, EmailUserTestDispatchResult, EmailUserTestKind, ExploreDefaultView, FormatSchemaOption, GeneralConfigurationSettingValue, GlobalWorkingHoursSettingValue, HolidayItem, HolidayTableRow, HolidaysSettingValue, IconSelectOption, ScheduleItemTypeOption, SelectOption, SystemSetting, SystemSettingObject, SystemSettingPrimitive, SystemSettingValue, SystemSettingsForm, SystemSettingsFormatSchema, SystemSettingsSnapshot, TimeSheetFrequency, TimeSheetPolicySettingValue, TimezoneRegionOption, TimezoneSettingValue, UpdateSystemSettingItem, WeekendDayOption, WeekendSettingValue };