@forgeroute/ui 0.5.34 → 0.5.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeroute/ui",
3
- "version": "0.5.34",
3
+ "version": "0.5.35",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=22.0.0",
6
6
  "@angular/core": ">=22.0.0",
@@ -364,6 +364,15 @@ export declare const UI_DEFAULT_LABELS: {
364
364
  readonly 'emailTemplateEditor.fontSize': "Font size";
365
365
  readonly 'emailTemplateEditor.headingLevel': "Heading level";
366
366
  readonly 'emailTemplateEditor.hideReactions': "Hide Reactions";
367
+ readonly 'emailTemplateEditor.checksTitle': "Check before saving";
368
+ readonly 'emailTemplateEditor.checkUnknownVariable': "The variable {{ name }} is not available: it is sent as empty text.";
369
+ readonly 'emailTemplateEditor.checkImageAlt_one': "{{ count }} image has no alt text.";
370
+ readonly 'emailTemplateEditor.checkImageAlt_other': "{{ count }} images have no alt text.";
371
+ readonly 'emailTemplateEditor.checkEmptyLink_one': "{{ count }} link has no address.";
372
+ readonly 'emailTemplateEditor.checkEmptyLink_other': "{{ count }} links have no address.";
373
+ readonly 'emailTemplateEditor.uploadImage': "Upload image";
374
+ readonly 'emailTemplateEditor.uploadingImage': "Uploading image…";
375
+ readonly 'emailTemplateEditor.imageUploadFailed': "The image could not be uploaded. Try again or paste an image address.";
367
376
  readonly 'emailTemplateEditor.imageAddress': "Image address";
368
377
  readonly 'emailTemplateEditor.imageAltText': "Image alt text";
369
378
  readonly 'emailTemplateEditor.insertImage': "Insert image";
@@ -2749,7 +2758,7 @@ export declare class ButtonComponent {
2749
2758
  * `ghost-start`: a ghost button for list / section toggles - a full-width row with its content aligned to the start, transparent
2750
2759
  * background, hover tint and the normal focus ring. Pair it with `ariaExpanded` / `ariaPressed`; the label may contain a heading element.
2751
2760
  */
2752
- readonly variant: import("@angular/core").InputSignal<"warning" | "primary" | "secondary" | "danger" | "link" | "ghost" | "ghost-start" | "tab" | "icon" | "icon-danger">;
2761
+ readonly variant: import("@angular/core").InputSignal<"primary" | "danger" | "warning" | "link" | "secondary" | "ghost" | "ghost-start" | "tab" | "icon" | "icon-danger">;
2753
2762
  /** Renders an anchor to this route instead of a button (use with `variant="link"` for an inline text link). `['/settings']` or `'/settings'`. While `disabled` or `loading` it renders a non-clickable `<span role="link" aria-disabled>` with no href (like `href`). */
2754
2763
  readonly routerLink: import("@angular/core").InputSignal<string | readonly unknown[] | null>;
2755
2764
  /** Query params of the `routerLink` (e.g. `{ section: 'deal-defaults' }`). */
@@ -2795,7 +2804,7 @@ export declare class ButtonComponent {
2795
2804
  readonly color: import("@angular/core").InputSignal<string | undefined>;
2796
2805
  readonly active: import("@angular/core").InputSignal<boolean>;
2797
2806
  readonly size: import("@angular/core").InputSignal<"sm" | "md" | "lg" | "xs">;
2798
- readonly type: import("@angular/core").InputSignal<"button" | "submit" | "reset">;
2807
+ readonly type: import("@angular/core").InputSignal<"reset" | "submit" | "button">;
2799
2808
  readonly disabled: import("@angular/core").InputSignal<boolean>;
2800
2809
  readonly loading: import("@angular/core").InputSignal<boolean>;
2801
2810
  readonly fullWidth: import("@angular/core").InputSignal<boolean>;
@@ -2944,7 +2953,7 @@ export declare class ModalComponent implements OnInit, OnDestroy {
2944
2953
  */
2945
2954
  readonly describedBy: import("@angular/core").InputSignal<string | null>;
2946
2955
  readonly maxWidth: import("@angular/core").InputSignal<string>;
2947
- readonly bodyOverflow: import("@angular/core").InputSignal<"auto" | "hidden" | "visible">;
2956
+ readonly bodyOverflow: import("@angular/core").InputSignal<"auto" | "visible" | "hidden">;
2948
2957
  /** `data-testid` of the dialog element itself (the host `<ui-modal>` is always in the page, the dialog only while open). None when empty. */
2949
2958
  readonly dialogTestId: import("@angular/core").InputSignal<string>;
2950
2959
  /** Hides the header X button (e.g. while a request is running). Escape and a backdrop click still close unless `closable` is false. */
@@ -3097,7 +3106,7 @@ export declare class SidePanelComponent implements OnDestroy {
3097
3106
  readonly cancelLabel: import("@angular/core").Signal<string>;
3098
3107
  /** Right-aligned primary action button label. Empty string = hidden. */
3099
3108
  readonly primaryLabel: import("@angular/core").InputSignal<string>;
3100
- readonly primaryVariant: import("@angular/core").InputSignal<"warning" | "primary" | "danger">;
3109
+ readonly primaryVariant: import("@angular/core").InputSignal<"primary" | "danger" | "warning">;
3101
3110
  readonly primaryLoading: import("@angular/core").InputSignal<boolean>;
3102
3111
  readonly primaryDisabled: import("@angular/core").InputSignal<boolean>;
3103
3112
  /** `data-testid` of the Cancel button; none when empty (default). */
@@ -330,6 +330,13 @@ export declare class EmailTemplateEditorComponent {
330
330
  readonly showActiveRange: import("@angular/core").InputSignal<boolean>;
331
331
  /** Styles the Preview and Mobile tabs like the app's real emails (font, colours, logo, company name, footer); see `EmailTemplatePreviewBrand`. `null` = the default look. */
332
332
  readonly previewBrand: import("@angular/core").InputSignal<EmailTemplatePreviewBrand | null>;
333
+ /** The Preview and Mobile tabs fill every variable with its `example` (default off: they show the `{{key}}` tokens as written). The saved message is never changed. */
334
+ readonly previewSampleData: import("@angular/core").InputSignal<boolean>;
335
+ /**
336
+ * Lets the user pick an image file in the Insert Image dialog. The host uploads it and resolves the public http(s) address of the stored image; a rejection (or a value that is not
337
+ * an http(s) address) shows the "could not be uploaded" message and the user can still paste an address. `null` (default) = no upload button, addresses only.
338
+ */
339
+ readonly imageUpload: import("@angular/core").InputSignal<((file: File) => Promise<string>) | null>;
333
340
  readonly categoryPlaceholderInput: import("@angular/core").InputSignal<string | null>;
334
341
  readonly categoryPlaceholder: import("@angular/core").Signal<string>;
335
342
  readonly assignmentOptions: import("@angular/core").InputSignal<EmailTemplateAssignmentOption[]>;
@@ -435,6 +442,8 @@ export declare class EmailTemplateEditorComponent {
435
442
  readonly showImageDialog: import("@angular/core").WritableSignal<boolean>;
436
443
  readonly imageUrl: import("@angular/core").WritableSignal<string>;
437
444
  readonly imageAlt: import("@angular/core").WritableSignal<string>;
445
+ readonly imageUploading: import("@angular/core").WritableSignal<boolean>;
446
+ readonly imageUploadError: import("@angular/core").WritableSignal<string>;
438
447
  readonly showTestSendDialog: import("@angular/core").WritableSignal<boolean>;
439
448
  readonly testSendEmail: import("@angular/core").WritableSignal<string>;
440
449
  readonly activeEditorTab: import("@angular/core").WritableSignal<EditorTab>;
@@ -499,6 +508,9 @@ export declare class EmailTemplateEditorComponent {
499
508
  readonly canInsertLink: import("@angular/core").Signal<boolean>;
500
509
  readonly imageUrlError: import("@angular/core").Signal<string>;
501
510
  readonly canInsertImage: import("@angular/core").Signal<boolean>;
511
+ /** Mistakes in the subject / message that turn into a broken email (see `findEmailChecks`); the sentences below list them. */
512
+ private readonly emailChecks;
513
+ readonly checkMessages: import("@angular/core").Signal<string[]>;
502
514
  readonly testEmailError: import("@angular/core").Signal<string>;
503
515
  readonly canSendTest: import("@angular/core").Signal<boolean>;
504
516
  /** The test email is the SAVED template: true when the editor holds changes that were not saved yet. */
@@ -580,6 +592,8 @@ export declare class EmailTemplateEditorComponent {
580
592
  insertLink(): void;
581
593
  openImageDialog(): void;
582
594
  insertImageFromUrl(): void;
595
+ /** The user picked a file in the Insert Image dialog: the host uploads it and the address it returns fills the address field (the user still adds alt text and presses Insert). */
596
+ onImageFile(event: Event): Promise<void>;
583
597
  openTestSendDialog(): void;
584
598
  onTestSend(): void;
585
599
  openVideoTab(): void;
@@ -620,6 +634,16 @@ export declare class EmailTemplateEditorComponent {
620
634
  "required": false;
621
635
  "isSignal": true;
622
636
  };
637
+ "previewSampleData": {
638
+ "alias": "previewSampleData";
639
+ "required": false;
640
+ "isSignal": true;
641
+ };
642
+ "imageUpload": {
643
+ "alias": "imageUpload";
644
+ "required": false;
645
+ "isSignal": true;
646
+ };
623
647
  "categoryPlaceholderInput": {
624
648
  "alias": "categoryPlaceholder";
625
649
  "required": false;
@@ -813,6 +837,20 @@ export declare const DEFAULT_EMAIL_TEMPLATE_VARIABLE_GROUPS: {
813
837
  export declare function buildPreviewDocument(bodyHtml: string, brand?: EmailTemplatePreviewBrand | null): string;
814
838
  /** Keeps only the brand values that are safe to write into the preview document (see `EmailTemplatePreviewBrand`); anything else is dropped. */
815
839
  export declare function safePreviewBrand(brand?: EmailTemplatePreviewBrand | null): EmailTemplatePreviewBrand;
840
+ /** The `{{key}}` merge variables written in the texts, each once, in the order they first appear. */
841
+ export declare function usedVariableKeys(...texts: string[]): string[];
842
+ /** The message as the Preview shows it with sample data: every known `{{key}}` becomes the variable's (escaped) `example`; a key the host does not offer stays as written. */
843
+ export declare function fillSampleVariables(html: string, groups: readonly EmailTemplateVariableGroup[]): string;
844
+ /** What the editor warns about before a template is saved: mistakes that turn into a broken email. */
845
+ export interface EmailChecks {
846
+ /** Variables used in the subject or message that the host does not offer: they are sent as empty text. */
847
+ unknownVariables: string[];
848
+ /** Images with no alt text (what a screen reader and a blocked-image inbox show). */
849
+ imagesWithoutAlt: number;
850
+ /** Links with no address (empty or `#`): clicking them goes nowhere. */
851
+ emptyLinks: number;
852
+ }
853
+ export declare function findEmailChecks(subject: string, bodyHtml: string, knownKeys: readonly string[]): EmailChecks;
816
854
  /** The default merge variables with names in the app's active language (the `key` and the example value stay as they are). */
817
855
  export declare function localizedEmailVariableGroups(): {
818
856
  name: string;