@wtfalch/mailer 0.2.0 → 0.3.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/dist/layout.d.ts CHANGED
@@ -1,9 +1,4 @@
1
1
  import type { Brand, MailMessage } from './types.js';
2
- /**
3
- * The one rule. Ampersand first, or it double-escapes everything after it.
4
- * Same rule and reason as app-template's `src/lib/marketing/render.ts`.
5
- */
6
- export declare function escapeHtml(value: string): string;
7
2
  export interface LayoutOptions {
8
3
  readonly subject: string;
9
4
  /** Already-escaped HTML for the message body. */
package/dist/layout.js CHANGED
@@ -1,15 +1,5 @@
1
+ import { escapeHtml } from '@wtfalch/utils/html';
1
2
  import { assertHeaderSafe } from './header-safe.js';
2
- /**
3
- * The one rule. Ampersand first, or it double-escapes everything after it.
4
- * Same rule and reason as app-template's `src/lib/marketing/render.ts`.
5
- */
6
- export function escapeHtml(value) {
7
- return value
8
- .replace(/&/g, '&')
9
- .replace(/</g, '&lt;')
10
- .replace(/>/g, '&gt;')
11
- .replace(/"/g, '&quot;');
12
- }
13
3
  const BODY_STYLE = 'margin:0;padding:24px;background:#f4f6f8;font-family:-apple-system,Segoe UI,Helvetica,Arial,sans-serif;color:#15181d;line-height:1.6';
14
4
  const CARD_STYLE = 'max-width:600px;margin:0 auto;background:#ffffff;padding:28px;border-radius:4px';
15
5
  const BRAND_STYLE = 'margin:0 0 20px;font-size:13px;color:#545b66;text-transform:uppercase;letter-spacing:0.04em';
@@ -1,4 +1,5 @@
1
- import { escapeHtml, layout } from '../layout.js';
1
+ import { escapeHtml } from '@wtfalch/utils/html';
2
+ import { layout } from '../layout.js';
2
3
  import { DEFAULT_LOCALE } from '../types.js';
3
4
  const ACCOUNT_WORDS = {
4
5
  en: {
@@ -1,4 +1,5 @@
1
- import { escapeHtml, layout } from '../layout.js';
1
+ import { escapeHtml } from '@wtfalch/utils/html';
2
+ import { layout } from '../layout.js';
2
3
  import { DEFAULT_LOCALE } from '../types.js';
3
4
  const WORDS = {
4
5
  en: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wtfalch/mailer",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "One send(template, to, data) call for the estate's transactional email, over Resend, with a dev transport that writes to disk instead of sending.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,6 +30,9 @@
30
30
  "test": "vitest run",
31
31
  "prepack": "pnpm build"
32
32
  },
33
+ "dependencies": {
34
+ "@wtfalch/utils": "0.1.0"
35
+ },
33
36
  "peerDependencies": {
34
37
  "resend": "^4.1.0"
35
38
  },