@rovela-ai/sdk 0.14.0 → 0.15.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/admin/api/emails.d.ts +2 -1
- package/dist/admin/api/emails.d.ts.map +1 -1
- package/dist/admin/api/emails.js +203 -34
- package/dist/admin/api/emails.js.map +1 -1
- package/dist/admin/components/AdminNav.d.ts.map +1 -1
- package/dist/admin/components/AdminNav.js +2 -1
- package/dist/admin/components/AdminNav.js.map +1 -1
- package/dist/admin/components/EmailsManager.d.ts.map +1 -1
- package/dist/admin/components/EmailsManager.js +168 -51
- package/dist/admin/components/EmailsManager.js.map +1 -1
- package/dist/admin/components/emails/BlocksEditor.d.ts +17 -0
- package/dist/admin/components/emails/BlocksEditor.d.ts.map +1 -0
- package/dist/admin/components/emails/BlocksEditor.js +110 -0
- package/dist/admin/components/emails/BlocksEditor.js.map +1 -0
- package/dist/admin/components/emails/EmailPreviewPane.d.ts +18 -0
- package/dist/admin/components/emails/EmailPreviewPane.d.ts.map +1 -0
- package/dist/admin/components/emails/EmailPreviewPane.js +52 -0
- package/dist/admin/components/emails/EmailPreviewPane.js.map +1 -0
- package/dist/admin/components/emails/EmailThemePanel.d.ts +27 -0
- package/dist/admin/components/emails/EmailThemePanel.d.ts.map +1 -0
- package/dist/admin/components/emails/EmailThemePanel.js +25 -0
- package/dist/admin/components/emails/EmailThemePanel.js.map +1 -0
- package/dist/admin/components/emails/FontPicker.d.ts +11 -0
- package/dist/admin/components/emails/FontPicker.d.ts.map +1 -0
- package/dist/admin/components/emails/FontPicker.js +55 -0
- package/dist/admin/components/emails/FontPicker.js.map +1 -0
- package/dist/admin/components/emails/TextBlockEditor.d.ts +7 -0
- package/dist/admin/components/emails/TextBlockEditor.d.ts.map +1 -0
- package/dist/admin/components/emails/TextBlockEditor.js +70 -0
- package/dist/admin/components/emails/TextBlockEditor.js.map +1 -0
- package/dist/core/db/queries.d.ts +38 -29
- package/dist/core/db/queries.d.ts.map +1 -1
- package/dist/core/db/queries.js +20 -0
- package/dist/core/db/queries.js.map +1 -1
- package/dist/core/db/schema.d.ts +35 -1
- package/dist/core/db/schema.d.ts.map +1 -1
- package/dist/core/db/schema.js +4 -0
- package/dist/core/db/schema.js.map +1 -1
- package/dist/emails/blocks.d.ts +95 -0
- package/dist/emails/blocks.d.ts.map +1 -0
- package/dist/emails/blocks.js +239 -0
- package/dist/emails/blocks.js.map +1 -0
- package/dist/emails/google-fonts.d.ts +13 -0
- package/dist/emails/google-fonts.d.ts.map +1 -0
- package/dist/emails/google-fonts.js +1943 -0
- package/dist/emails/google-fonts.js.map +1 -0
- package/dist/emails/overrides.d.ts +6 -0
- package/dist/emails/overrides.d.ts.map +1 -1
- package/dist/emails/overrides.js +10 -2
- package/dist/emails/overrides.js.map +1 -1
- package/dist/emails/registry.d.ts +49 -5
- package/dist/emails/registry.d.ts.map +1 -1
- package/dist/emails/registry.js +584 -122
- package/dist/emails/registry.js.map +1 -1
- package/dist/emails/send/auth.d.ts.map +1 -1
- package/dist/emails/send/auth.js +40 -25
- package/dist/emails/send/auth.js.map +1 -1
- package/dist/emails/send/orders.d.ts.map +1 -1
- package/dist/emails/send/orders.js +85 -55
- package/dist/emails/send/orders.js.map +1 -1
- package/dist/emails/templates/base.d.ts +7 -0
- package/dist/emails/templates/base.d.ts.map +1 -1
- package/dist/emails/templates/base.js +34 -12
- package/dist/emails/templates/base.js.map +1 -1
- package/dist/emails/templates/email-verification.d.ts +4 -0
- package/dist/emails/templates/email-verification.d.ts.map +1 -1
- package/dist/emails/templates/email-verification.js +10 -2
- package/dist/emails/templates/email-verification.js.map +1 -1
- package/dist/emails/templates/order-cancelled.d.ts +4 -0
- package/dist/emails/templates/order-cancelled.d.ts.map +1 -1
- package/dist/emails/templates/order-cancelled.js +18 -10
- package/dist/emails/templates/order-cancelled.js.map +1 -1
- package/dist/emails/templates/order-confirmation.d.ts +18 -0
- package/dist/emails/templates/order-confirmation.d.ts.map +1 -1
- package/dist/emails/templates/order-confirmation.js +43 -21
- package/dist/emails/templates/order-confirmation.js.map +1 -1
- package/dist/emails/templates/order-delivered.d.ts +6 -0
- package/dist/emails/templates/order-delivered.d.ts.map +1 -1
- package/dist/emails/templates/order-delivered.js +22 -16
- package/dist/emails/templates/order-delivered.js.map +1 -1
- package/dist/emails/templates/order-ready-for-pickup.d.ts +10 -0
- package/dist/emails/templates/order-ready-for-pickup.d.ts.map +1 -1
- package/dist/emails/templates/order-ready-for-pickup.js +38 -22
- package/dist/emails/templates/order-ready-for-pickup.js.map +1 -1
- package/dist/emails/templates/order-shipped.d.ts +6 -0
- package/dist/emails/templates/order-shipped.d.ts.map +1 -1
- package/dist/emails/templates/order-shipped.js +17 -9
- package/dist/emails/templates/order-shipped.js.map +1 -1
- package/dist/emails/templates/password-reset.d.ts +4 -0
- package/dist/emails/templates/password-reset.d.ts.map +1 -1
- package/dist/emails/templates/password-reset.js +10 -2
- package/dist/emails/templates/password-reset.js.map +1 -1
- package/dist/emails/templates/refund-processed.d.ts +6 -0
- package/dist/emails/templates/refund-processed.d.ts.map +1 -1
- package/dist/emails/templates/refund-processed.js +17 -7
- package/dist/emails/templates/refund-processed.js.map +1 -1
- package/dist/emails/templates/welcome.d.ts +2 -0
- package/dist/emails/templates/welcome.d.ts.map +1 -1
- package/dist/emails/templates/welcome.js +8 -4
- package/dist/emails/templates/welcome.js.map +1 -1
- package/dist/emails/theme.d.ts +35 -12
- package/dist/emails/theme.d.ts.map +1 -1
- package/dist/emails/theme.js +178 -53
- package/dist/emails/theme.js.map +1 -1
- package/package.json +7 -1
|
@@ -13,9 +13,9 @@ import { baseLayout, statusBadge, heading, primaryButton, labeledValue, addressS
|
|
|
13
13
|
/**
|
|
14
14
|
* Render the ready-for-pickup email template.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
/** Slot fragment: order number + pickup location box. */
|
|
17
|
+
export function renderPickupOrderInfo(data) {
|
|
18
|
+
return `
|
|
19
19
|
<div style="padding: 24px; background-color: ${STYLES.footerBackground}; border-radius: 16px; border: 1px solid ${STYLES.cardBorder}; margin-bottom: 32px;">
|
|
20
20
|
<table width="100%" cellpadding="0" cellspacing="0">
|
|
21
21
|
${labeledValue('Order Number', `#${data.orderNumber}`, { borderBottom: true })}
|
|
@@ -27,29 +27,45 @@ export function renderOrderReadyForPickup(data) {
|
|
|
27
27
|
</table>
|
|
28
28
|
</div>
|
|
29
29
|
`;
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
}
|
|
31
|
+
/** Slot fragment: 'Pick Up At' address section. */
|
|
32
|
+
export function renderPickupLocation(data) {
|
|
33
|
+
return addressSection('Pick Up At', formatAddressHtml(data.pickupAddress));
|
|
34
|
+
}
|
|
35
|
+
/** Slot fragment: opening-hours highlight; '' when the location has none. */
|
|
36
|
+
export function renderOpeningHours(data) {
|
|
37
|
+
if (!data.openingHoursLines || data.openingHoursLines.length === 0)
|
|
38
|
+
return '';
|
|
39
|
+
return highlightBox(`
|
|
32
40
|
<p style="margin: 0 0 8px 0; font-family: ${STYLES.fontFamily}; font-size: 14px; font-weight: 400; color: ${STYLES.textSecondary}; text-transform: uppercase; letter-spacing: 0.05em; text-align: center;">Opening Hours</p>
|
|
33
41
|
${data.openingHoursLines
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
.map((line) => `<p style="margin: 0; font-family: ${STYLES.fontFamily}; font-size: 14px; font-weight: 500; color: ${STYLES.textPrimary}; text-align: center;">${escapeHtml(line)}</p>`)
|
|
43
|
+
.join('')}
|
|
44
|
+
`);
|
|
45
|
+
}
|
|
46
|
+
/** Slot fragment: merchant pickup instructions; '' when absent. */
|
|
47
|
+
export function renderPickupInstructions(data) {
|
|
48
|
+
if (!data.pickupInstructions)
|
|
49
|
+
return '';
|
|
50
|
+
return `
|
|
40
51
|
<div style="padding: 20px; background-color: ${STYLES.footerBackground}; border-radius: 12px; border: 1px solid ${STYLES.cardBorder}; margin-bottom: 32px;">
|
|
41
52
|
<p style="margin: 0 0 6px 0; font-family: ${STYLES.fontFamily}; font-size: 13px; font-weight: 600; color: ${STYLES.textSecondary}; text-transform: uppercase; letter-spacing: 0.05em;">Pickup Instructions</p>
|
|
42
53
|
<p style="margin: 0; font-family: ${STYLES.fontFamily}; font-size: 14px; line-height: 1.6; color: ${STYLES.textPrimary};">${escapeHtml(data.pickupInstructions)}</p>
|
|
43
54
|
</div>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
`;
|
|
56
|
+
}
|
|
57
|
+
/** Slot fragment: store phone line; '' when absent. */
|
|
58
|
+
export function renderPickupPhoneLine(data) {
|
|
59
|
+
if (!data.locationPhone)
|
|
60
|
+
return '';
|
|
61
|
+
return `
|
|
48
62
|
<p style="margin: 24px 0 0 0; font-family: ${STYLES.fontFamily}; font-size: 14px; color: ${STYLES.textSecondary}; text-align: center;">
|
|
49
63
|
Questions? Call the store at ${escapeHtml(data.locationPhone)}.
|
|
50
64
|
</p>
|
|
51
|
-
|
|
52
|
-
|
|
65
|
+
`;
|
|
66
|
+
}
|
|
67
|
+
export function renderOrderReadyForPickup(data) {
|
|
68
|
+
const badge = statusBadge('Ready for Pickup', '🛍️');
|
|
53
69
|
const content = `
|
|
54
70
|
${badge}
|
|
55
71
|
${heading('Your Order is Ready for Pickup!')}
|
|
@@ -58,17 +74,17 @@ export function renderOrderReadyForPickup(data) {
|
|
|
58
74
|
Hi ${escapeHtml(data.customerName)}, your order is packed and waiting for you at ${escapeHtml(data.locationName)}. Bring your order number when you come by.
|
|
59
75
|
</p>
|
|
60
76
|
|
|
61
|
-
${
|
|
77
|
+
${renderPickupOrderInfo(data)}
|
|
62
78
|
|
|
63
|
-
${
|
|
79
|
+
${renderPickupLocation(data)}
|
|
64
80
|
|
|
65
|
-
${
|
|
81
|
+
${renderOpeningHours(data)}
|
|
66
82
|
|
|
67
|
-
${
|
|
83
|
+
${renderPickupInstructions(data)}
|
|
68
84
|
|
|
69
85
|
${primaryButton('View Your Order', data.orderUrl)}
|
|
70
86
|
|
|
71
|
-
${
|
|
87
|
+
${renderPickupPhoneLine(data)}
|
|
72
88
|
`;
|
|
73
89
|
return baseLayout({
|
|
74
90
|
config: data.config,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-ready-for-pickup.js","sourceRoot":"","sources":["../../../src/emails/templates/order-ready-for-pickup.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACxD,OAAO,EACL,UAAU,EACV,WAAW,EACX,OAAO,EACP,aAAa,EACb,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,MAAM,GACP,MAAM,QAAQ,CAAA;AAEf,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"order-ready-for-pickup.js","sourceRoot":"","sources":["../../../src/emails/templates/order-ready-for-pickup.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACxD,OAAO,EACL,UAAU,EACV,WAAW,EACX,OAAO,EACP,aAAa,EACb,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,MAAM,GACP,MAAM,QAAQ,CAAA;AAEf,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF;;GAEG;AACH,yDAAyD;AACzD,MAAM,UAAU,qBAAqB,CACnC,IAAmE;IAEnE,OAAO;mDAC0C,MAAM,CAAC,gBAAgB,4CAA4C,MAAM,CAAC,UAAU;;UAE7H,YAAY,CAAC,cAAc,EAAE,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;UAC5E,YAAY,CAAC,iBAAiB,EAAE,IAAI,CAAC,YAAY,E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OAAO;iDACwC,MAAM,CAAC,UAAU,6BAA6B,MAAM,CAAC,aAAa;qCAC9E,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC;;GAEhE,CAAA;AACH,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,IAA6B;IACrE,MAAM,KAAK,GAAG,WAAW,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAA;IAEpD,MAAM,OAAO,GAAG;MACZ,KAAK;MACL,OAAO,CAAC,iCAAiC,CAAC;;iDAEC,MAAM,CAAC,UAAU,mEAAmE,MAAM,CAAC,aAAa;WAC9I,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,iDAAiD,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC;;;MAGhH,qBAAqB,CAAC,IAAI,CAAC;;MAE3B,oBAAoB,CAAC,IAAI,CAAC;;MAE1B,kBAAkB,CAAC,IAAI,CAAC;;MAExB,wBAAwB,CAAC,IAAI,CAAC;;MAE9B,aAAa,CAAC,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CAAC;;MAE/C,qBAAqB,CAAC,IAAI,CAAC;GAC9B,CAAA;IAED,OAAO,UAAU,CAAC;QAChB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,KAAK,EAAE,qCAAqC,IAAI,CAAC,WAAW,EAAE;QAC9D,OAAO;KACR,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAC3C,SAAiB,EACjB,WAAmB;IAEnB,OAAO,qCAAqC,WAAW,MAAM,SAAS,EAAE,CAAA;AAC1E,CAAC"}
|
|
@@ -24,6 +24,12 @@ import type { OrderShippedData } from '../types';
|
|
|
24
24
|
* })
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
+
/** Slot fragment: order number / tracking number / carrier box. */
|
|
28
|
+
export declare function renderTrackingDetails(data: Pick<OrderShippedData, 'orderNumber' | 'trackingNumber' | 'carrierName'>): string;
|
|
29
|
+
/** Slot fragment: highlighted estimated-delivery date. */
|
|
30
|
+
export declare function renderDeliveryEstimate(data: Pick<OrderShippedData, 'estimatedDeliveryDate'>): string;
|
|
31
|
+
/** Slot fragment: 'Shipping To' address section. */
|
|
32
|
+
export declare function renderShippingTo(data: Pick<OrderShippedData, 'shippingAddress'>): string;
|
|
27
33
|
export declare function renderOrderShipped(data: OrderShippedData): string;
|
|
28
34
|
/**
|
|
29
35
|
* Get the subject line for order shipped emails.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-shipped.d.ts","sourceRoot":"","sources":["../../../src/emails/templates/order-shipped.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAiBhD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"order-shipped.d.ts","sourceRoot":"","sources":["../../../src/emails/templates/order-shipped.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAiBhD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mEAAmE;AACnE,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,aAAa,GAAG,gBAAgB,GAAG,aAAa,CAAC,GAC7E,MAAM,CAiBR;AAED,0DAA0D;AAC1D,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,uBAAuB,CAAC,GAAG,MAAM,CAKpG;AAED,oDAAoD;AACpD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,GAAG,MAAM,CAExF;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAyBjE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAClB,MAAM,CAER"}
|
|
@@ -28,10 +28,9 @@ import { baseLayout, statusBadge, heading, primaryButton, labeledValue, addressS
|
|
|
28
28
|
* })
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const trackingInfoBox = `
|
|
31
|
+
/** Slot fragment: order number / tracking number / carrier box. */
|
|
32
|
+
export function renderTrackingDetails(data) {
|
|
33
|
+
return `
|
|
35
34
|
<div style="padding: 24px; background-color: ${STYLES.footerBackground}; border-radius: 16px; border: 1px solid ${STYLES.cardBorder}; margin-bottom: 32px;">
|
|
36
35
|
<table width="100%" cellpadding="0" cellspacing="0">
|
|
37
36
|
${labeledValue('Order Number', `#${data.orderNumber}`, { borderBottom: true })}
|
|
@@ -47,11 +46,20 @@ export function renderOrderShipped(data) {
|
|
|
47
46
|
</table>
|
|
48
47
|
</div>
|
|
49
48
|
`;
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
}
|
|
50
|
+
/** Slot fragment: highlighted estimated-delivery date. */
|
|
51
|
+
export function renderDeliveryEstimate(data) {
|
|
52
|
+
return highlightBox(`
|
|
52
53
|
<p style="margin: 0 0 8px 0; font-family: ${STYLES.fontFamily}; font-size: 14px; font-weight: 400; color: ${STYLES.textSecondary}; text-transform: uppercase; letter-spacing: 0.05em; text-align: center;">Estimated Delivery</p>
|
|
53
54
|
<p style="margin: 0; font-family: ${STYLES.fontFamily}; font-size: 24px; font-weight: 700; color: ${STYLES.primaryColor}; text-align: center;">${escapeHtml(data.estimatedDeliveryDate)}</p>
|
|
54
55
|
`);
|
|
56
|
+
}
|
|
57
|
+
/** Slot fragment: 'Shipping To' address section. */
|
|
58
|
+
export function renderShippingTo(data) {
|
|
59
|
+
return addressSection('Shipping To', formatAddressHtml(data.shippingAddress));
|
|
60
|
+
}
|
|
61
|
+
export function renderOrderShipped(data) {
|
|
62
|
+
const badge = statusBadge('Order Shipped', '📦');
|
|
55
63
|
const content = `
|
|
56
64
|
${badge}
|
|
57
65
|
${heading('Your Order is On Its Way!')}
|
|
@@ -60,11 +68,11 @@ export function renderOrderShipped(data) {
|
|
|
60
68
|
Hi ${escapeHtml(data.customerName)}, great news! Your order has been shipped and is heading your way.
|
|
61
69
|
</p>
|
|
62
70
|
|
|
63
|
-
${
|
|
71
|
+
${renderTrackingDetails(data)}
|
|
64
72
|
|
|
65
|
-
${
|
|
73
|
+
${renderDeliveryEstimate(data)}
|
|
66
74
|
|
|
67
|
-
${
|
|
75
|
+
${renderShippingTo(data)}
|
|
68
76
|
|
|
69
77
|
${primaryButton('Track Your Package', data.trackingUrl)}
|
|
70
78
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-shipped.js","sourceRoot":"","sources":["../../../src/emails/templates/order-shipped.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACxD,OAAO,EACL,UAAU,EACV,WAAW,EACX,OAAO,EACP,aAAa,EACb,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,MAAM,GACP,MAAM,QAAQ,CAAA;AAEf,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,
|
|
1
|
+
{"version":3,"file":"order-shipped.js","sourceRoot":"","sources":["../../../src/emails/templates/order-shipped.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACxD,OAAO,EACL,UAAU,EACV,WAAW,EACX,OAAO,EACP,aAAa,EACb,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,MAAM,GACP,MAAM,QAAQ,CAAA;AAEf,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mEAAmE;AACnE,MAAM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B,CAAC,IAAI,CAAC;;MAE5B,gBAAgB,CAAC,IAAI,CAAC;;MAEtB,aAAa,CAAC,oBAAoB,EAAE,IAAI,CAAC,WAAW,CAAC;GACxD,CAAA;IAED,OAAO,UAAU,CAAC;QAChB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,KAAK,EAAE,6BAA6B,IAAI,CAAC,WAAW,EAAE;QACtD,OAAO;KACR,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,SAAiB,EACjB,WAAmB;IAEnB,OAAO,6BAA6B,WAAW,MAAM,SAAS,EAAE,CAAA;AAClE,CAAC"}
|
|
@@ -19,6 +19,10 @@ import type { PasswordResetEmailData } from '../types';
|
|
|
19
19
|
* })
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
+
/** Slot fragment: the reset-password button (secure tokenized link). */
|
|
23
|
+
export declare function renderResetButton(data: Pick<PasswordResetEmailData, 'resetLink'>): string;
|
|
24
|
+
/** Slot fragment: copy-paste fallback for the reset link. */
|
|
25
|
+
export declare function renderResetLinkFallback(data: Pick<PasswordResetEmailData, 'resetLink'>): string;
|
|
22
26
|
export declare function renderPasswordResetEmail(data: PasswordResetEmailData): string;
|
|
23
27
|
/**
|
|
24
28
|
* Get the subject line for password reset emails.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-reset.d.ts","sourceRoot":"","sources":["../../../src/emails/templates/password-reset.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAUtD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,sBAAsB,GAAG,MAAM,CA8B7E;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEjE"}
|
|
1
|
+
{"version":3,"file":"password-reset.d.ts","sourceRoot":"","sources":["../../../src/emails/templates/password-reset.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAUtD;;;;;;;;;;;;;;GAcG;AACH,wEAAwE;AACxE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,sBAAsB,EAAE,WAAW,CAAC,GAAG,MAAM,CAEzF;AAED,6DAA6D;AAC7D,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,CAAC,sBAAsB,EAAE,WAAW,CAAC,GAAG,MAAM,CAE/F;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,sBAAsB,GAAG,MAAM,CA8B7E;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEjE"}
|
|
@@ -20,6 +20,14 @@ import { baseLayout, heading, paragraph, primaryButton, linkFallback, } from './
|
|
|
20
20
|
* })
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
+
/** Slot fragment: the reset-password button (secure tokenized link). */
|
|
24
|
+
export function renderResetButton(data) {
|
|
25
|
+
return primaryButton('Reset Password', data.resetLink);
|
|
26
|
+
}
|
|
27
|
+
/** Slot fragment: copy-paste fallback for the reset link. */
|
|
28
|
+
export function renderResetLinkFallback(data) {
|
|
29
|
+
return linkFallback(data.resetLink);
|
|
30
|
+
}
|
|
23
31
|
export function renderPasswordResetEmail(data) {
|
|
24
32
|
const content = `
|
|
25
33
|
${heading('Reset Your Password')}
|
|
@@ -28,13 +36,13 @@ export function renderPasswordResetEmail(data) {
|
|
|
28
36
|
|
|
29
37
|
${paragraph('We received a request to reset your password. Click the button below to create a new password:', '32px')}
|
|
30
38
|
|
|
31
|
-
${
|
|
39
|
+
${renderResetButton(data)}
|
|
32
40
|
|
|
33
41
|
${paragraph(`This link will expire in ${escapeHtml(data.expiryTime)} ${data.expiryTime === '1' ? 'hour' : 'hours'} for security reasons.`)}
|
|
34
42
|
|
|
35
43
|
${paragraph("If you didn't request a password reset, you can safely ignore this email. Your password will remain unchanged.", '24px')}
|
|
36
44
|
|
|
37
|
-
${
|
|
45
|
+
${renderResetLinkFallback(data)}
|
|
38
46
|
`;
|
|
39
47
|
return baseLayout({
|
|
40
48
|
config: data.config,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-reset.js","sourceRoot":"","sources":["../../../src/emails/templates/password-reset.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EACL,UAAU,EACV,OAAO,EACP,SAAS,EACT,aAAa,EACb,YAAY,GACb,MAAM,QAAQ,CAAA;AAEf;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAA4B;IACnE,MAAM,OAAO,GAAG;MACZ,OAAO,CAAC,qBAAqB,CAAC;;MAE9B,SAAS,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC;;MAEjD,SAAS,CACT,gGAAgG,EAChG,MAAM,CACP;;MAEC,
|
|
1
|
+
{"version":3,"file":"password-reset.js","sourceRoot":"","sources":["../../../src/emails/templates/password-reset.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EACL,UAAU,EACV,OAAO,EACP,SAAS,EACT,aAAa,EACb,YAAY,GACb,MAAM,QAAQ,CAAA;AAEf;;;;;;;;;;;;;;GAcG;AACH,wEAAwE;AACxE,MAAM,UAAU,iBAAiB,CAAC,IAA+C;IAC/E,OAAO,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;AACxD,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,uBAAuB,CAAC,IAA+C;IACrF,OAAO,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AACrC,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,IAA4B;IACnE,MAAM,OAAO,GAAG;MACZ,OAAO,CAAC,qBAAqB,CAAC;;MAE9B,SAAS,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC;;MAEjD,SAAS,CACT,gGAAgG,EAChG,MAAM,CACP;;MAEC,iBAAiB,CAAC,IAAI,CAAC;;MAEvB,SAAS,CACT,4BAA4B,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,UAAU,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,wBAAwB,CAC9H;;MAEC,SAAS,CACT,gHAAgH,EAChH,MAAM,CACP;;MAEC,uBAAuB,CAAC,IAAI,CAAC;GAChC,CAAA;IAED,OAAO,UAAU,CAAC;QAChB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,KAAK,EAAE,qBAAqB;QAC5B,OAAO;KACR,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,SAAiB;IACvD,OAAO,yBAAyB,SAAS,EAAE,CAAA;AAC7C,CAAC"}
|
|
@@ -24,6 +24,12 @@ import type { RefundProcessedData } from '../types';
|
|
|
24
24
|
* })
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
+
/** Slot fragment: refund amount / order number / date box. */
|
|
28
|
+
export declare function renderRefundAmountBox(data: Pick<RefundProcessedData, 'refundAmount' | 'orderNumber' | 'refundDate'>): string;
|
|
29
|
+
/** Slot fragment: payment method + estimated arrival detail box. */
|
|
30
|
+
export declare function renderRefundMethodBox(data: Pick<RefundProcessedData, 'paymentMethod' | 'estimatedArrival'>): string;
|
|
31
|
+
/** Slot fragment: 'allow N business days' timing paragraph. */
|
|
32
|
+
export declare function renderRefundTiming(data: Pick<RefundProcessedData, 'businessDays'>): string;
|
|
27
33
|
export declare function renderRefundProcessed(data: RefundProcessedData): string;
|
|
28
34
|
/**
|
|
29
35
|
* Get the subject line for refund processed emails.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refund-processed.d.ts","sourceRoot":"","sources":["../../../src/emails/templates/refund-processed.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAiBnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"refund-processed.d.ts","sourceRoot":"","sources":["../../../src/emails/templates/refund-processed.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAiBnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8DAA8D;AAC9D,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,IAAI,CAAC,mBAAmB,EAAE,cAAc,GAAG,aAAa,GAAG,YAAY,CAAC,GAC7E,MAAM,CAsBR;AAED,oEAAoE;AACpE,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,IAAI,CAAC,mBAAmB,EAAE,eAAe,GAAG,kBAAkB,CAAC,GACpE,MAAM,CAKR;AAED,+DAA+D;AAC/D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,mBAAmB,EAAE,cAAc,CAAC,GAAG,MAAM,CAK1F;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAoCvE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAClB,MAAM,CAER"}
|
|
@@ -28,10 +28,9 @@ import { baseLayout, statusBadge, heading, paragraph, primaryButton, labeledValu
|
|
|
28
28
|
* })
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const refundDetailsBox = `
|
|
31
|
+
/** Slot fragment: refund amount / order number / date box. */
|
|
32
|
+
export function renderRefundAmountBox(data) {
|
|
33
|
+
return `
|
|
35
34
|
<div style="padding: 24px; background-color: rgba(12, 175, 125, 0.05); border-radius: 16px; border: 1px solid rgba(12, 175, 125, 0.2); margin-bottom: 32px;">
|
|
36
35
|
<table width="100%" cellpadding="0" cellspacing="0">
|
|
37
36
|
<tr>
|
|
@@ -52,11 +51,22 @@ export function renderRefundProcessed(data) {
|
|
|
52
51
|
</table>
|
|
53
52
|
</div>
|
|
54
53
|
`;
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
}
|
|
55
|
+
/** Slot fragment: payment method + estimated arrival detail box. */
|
|
56
|
+
export function renderRefundMethodBox(data) {
|
|
57
|
+
return detailBox('Refund Details', [
|
|
57
58
|
{ label: 'Payment Method', value: data.paymentMethod },
|
|
58
59
|
{ label: 'Estimated Arrival', value: data.estimatedArrival },
|
|
59
60
|
]);
|
|
61
|
+
}
|
|
62
|
+
/** Slot fragment: 'allow N business days' timing paragraph. */
|
|
63
|
+
export function renderRefundTiming(data) {
|
|
64
|
+
return paragraph(`Please allow ${escapeHtml(data.businessDays)} business days for the refund to appear in your account. The exact timing depends on your bank or card issuer.`, '32px');
|
|
65
|
+
}
|
|
66
|
+
export function renderRefundProcessed(data) {
|
|
67
|
+
const badge = statusBadge('Refund Processed');
|
|
68
|
+
const refundDetailsBox = renderRefundAmountBox(data);
|
|
69
|
+
const paymentMethodBox = renderRefundMethodBox(data);
|
|
60
70
|
const content = `
|
|
61
71
|
${badge}
|
|
62
72
|
${heading('Your Refund Has Been Processed')}
|
|
@@ -69,7 +79,7 @@ export function renderRefundProcessed(data) {
|
|
|
69
79
|
|
|
70
80
|
${paymentMethodBox}
|
|
71
81
|
|
|
72
|
-
${
|
|
82
|
+
${renderRefundTiming(data)}
|
|
73
83
|
|
|
74
84
|
<p style="margin: 0 0 32px 0; font-family: ${STYLES.fontFamily}; font-size: 14px; font-weight: 400; line-height: 1.625; color: ${STYLES.textSecondary}; text-align: center;">
|
|
75
85
|
If you have any questions about this refund, please don't hesitate to contact us.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refund-processed.js","sourceRoot":"","sources":["../../../src/emails/templates/refund-processed.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EACL,UAAU,EACV,WAAW,EACX,OAAO,EACP,SAAS,EACT,aAAa,EACb,YAAY,EACZ,SAAS,EACT,MAAM,GACP,MAAM,QAAQ,CAAA;AAEf,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,qBAAqB,
|
|
1
|
+
{"version":3,"file":"refund-processed.js","sourceRoot":"","sources":["../../../src/emails/templates/refund-processed.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EACL,UAAU,EACV,WAAW,EACX,OAAO,EACP,SAAS,EACT,aAAa,EACb,YAAY,EACZ,SAAS,EACT,MAAM,GACP,MAAM,QAAQ,CAAA;AAEf,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8DAA8D;AAC9D,MAAM,UAAU,qBAAqB,CACnC,IAA8E;IAE9E,OAAO;;;;;wDAK+C,MAAM,CAAC,UAAU,+CAA+C,MAAM,CAAC,aAAa;gDAC5F,MAAM,CAAC,UAAU,+CAA+C,MAAM,CAAC,YAAY,MAAM,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC;;;UAG5J,YAAY,CAAC,cAAc,EAAE,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;QACrD,SAAS,EAAE,MAAM;QACjB,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,IAAI;KACnB,CAAC;UACA,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC,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AE,IAAI,CAAC,MAAM;QACnB,KAAK,EAAE,uBAAuB,IAAI,CAAC,WAAW,EAAE;QAChD,OAAO;KACR,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CACvC,SAAiB,EACjB,WAAmB;IAEnB,OAAO,uBAAuB,WAAW,MAAM,SAAS,EAAE,CAAA;AAC5D,CAAC"}
|
|
@@ -19,6 +19,8 @@ import type { WelcomeEmailData } from '../types';
|
|
|
19
19
|
* })
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
+
/** Slot fragment: account email + created-on detail box. */
|
|
23
|
+
export declare function renderAccountDetails(data: Pick<WelcomeEmailData, 'customerEmail' | 'createdDate'>): string;
|
|
22
24
|
export declare function renderWelcomeEmail(data: WelcomeEmailData): string;
|
|
23
25
|
/**
|
|
24
26
|
* Get the subject line for welcome emails.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"welcome.d.ts","sourceRoot":"","sources":["../../../src/emails/templates/welcome.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAUhD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"welcome.d.ts","sourceRoot":"","sources":["../../../src/emails/templates/welcome.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAUhD;;;;;;;;;;;;;;GAcG;AACH,4DAA4D;AAC5D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,eAAe,GAAG,aAAa,CAAC,GAAG,MAAM,CAK1G;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CA0BjE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEhE"}
|
|
@@ -20,6 +20,13 @@ import { baseLayout, heading, paragraph, primaryButton, detailBox, } from './bas
|
|
|
20
20
|
* })
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
+
/** Slot fragment: account email + created-on detail box. */
|
|
24
|
+
export function renderAccountDetails(data) {
|
|
25
|
+
return detailBox('Your Account Details', [
|
|
26
|
+
{ label: 'Email', value: data.customerEmail },
|
|
27
|
+
{ label: 'Account Created', value: data.createdDate },
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
23
30
|
export function renderWelcomeEmail(data) {
|
|
24
31
|
const content = `
|
|
25
32
|
${heading(`Welcome to ${escapeHtml(data.config.storeName)}!`)}
|
|
@@ -32,10 +39,7 @@ export function renderWelcomeEmail(data) {
|
|
|
32
39
|
|
|
33
40
|
${primaryButton('Start Shopping', data.config.shopUrl)}
|
|
34
41
|
|
|
35
|
-
${
|
|
36
|
-
{ label: 'Email', value: data.customerEmail },
|
|
37
|
-
{ label: 'Account Created', value: data.createdDate },
|
|
38
|
-
])}
|
|
42
|
+
${renderAccountDetails(data)}
|
|
39
43
|
`;
|
|
40
44
|
return baseLayout({
|
|
41
45
|
config: data.config,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"welcome.js","sourceRoot":"","sources":["../../../src/emails/templates/welcome.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EACL,UAAU,EACV,OAAO,EACP,SAAS,EACT,aAAa,EACb,SAAS,GACV,MAAM,QAAQ,CAAA;AAEf;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAsB;IACvD,MAAM,OAAO,GAAG;MACZ,OAAO,CAAC,cAAc,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC;;MAE3D,SAAS,CAAC,MAAM,UAAU,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AM;QACnB,KAAK,EAAE,cAAc,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;QAC5C,OAAO;KACR,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAAiB;IACtD,OAAO,cAAc,SAAS,GAAG,CAAA;AACnC,CAAC"}
|
package/dist/emails/theme.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Resolution order (highest wins), cached briefly per process:
|
|
9
9
|
* 1. store_settings.email_theme (admin "Emails → Theme" panel)
|
|
10
|
-
* 2. brand-derived defaults (blueprint
|
|
10
|
+
* 2. brand-derived defaults (blueprint colors + heading/body fonts)
|
|
11
11
|
* 3. the shipped defaults (DEFAULT_EMAIL_STYLES)
|
|
12
12
|
*
|
|
13
13
|
* Branch-per-store means one store per process, so applying the theme via
|
|
@@ -18,36 +18,59 @@
|
|
|
18
18
|
* an email is never blocked or broken by theming.
|
|
19
19
|
*/
|
|
20
20
|
export type EmailButtonRadius = 'sm' | 'md' | 'full';
|
|
21
|
+
export type EmailCardRadius = 'sm' | 'md' | 'lg';
|
|
22
|
+
export type EmailLogoSize = 'sm' | 'md' | 'lg';
|
|
23
|
+
export type EmailLogoAlign = 'left' | 'center';
|
|
21
24
|
export interface EmailTheme {
|
|
22
25
|
/** Buttons, links, badges, highlights. Hex like '#1C5BA8'. */
|
|
23
26
|
primaryColor?: string;
|
|
24
|
-
/**
|
|
27
|
+
/** Outer background behind the card. Hex. */
|
|
28
|
+
backgroundColor?: string;
|
|
29
|
+
/** The card surface itself. Hex. */
|
|
30
|
+
cardColor?: string;
|
|
31
|
+
/** Headline / strong text color. Hex. */
|
|
32
|
+
textColor?: string;
|
|
33
|
+
/** Headline font — any Google Font. */
|
|
34
|
+
headingFont?: string;
|
|
35
|
+
/** Body font — any Google Font. */
|
|
36
|
+
bodyFont?: string;
|
|
37
|
+
/** Legacy single-font field (0.14.x) — read as bodyFont when bodyFont absent. */
|
|
25
38
|
fontName?: string;
|
|
26
39
|
/** Button corner shape. */
|
|
27
40
|
buttonRadius?: EmailButtonRadius;
|
|
28
|
-
/**
|
|
29
|
-
|
|
41
|
+
/** Card corner shape. */
|
|
42
|
+
cardRadius?: EmailCardRadius;
|
|
43
|
+
/** Header logo size. */
|
|
44
|
+
logoSize?: EmailLogoSize;
|
|
45
|
+
/** Header logo alignment. */
|
|
46
|
+
logoAlign?: EmailLogoAlign;
|
|
30
47
|
/** Extra footer line (legal notice, tagline). */
|
|
31
48
|
footerNote?: string;
|
|
32
49
|
}
|
|
33
50
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* else — the same progressive strategy the templates always used.
|
|
51
|
+
* Suggested fonts, shown first in the picker. The full catalog
|
|
52
|
+
* (GOOGLE_FONT_NAMES, ~1900 fonts) is valid everywhere a font is accepted.
|
|
37
53
|
*/
|
|
38
54
|
export declare const EMAIL_FONTS: Array<{
|
|
39
55
|
name: string;
|
|
40
56
|
stack: string;
|
|
41
57
|
}>;
|
|
42
|
-
export declare function
|
|
43
|
-
/**
|
|
58
|
+
export declare function isEmailFont(name: unknown): name is string;
|
|
59
|
+
/** CSS font-family stack for a catalog font, with the right fallback family. */
|
|
60
|
+
export declare function fontStack(name: string): string;
|
|
61
|
+
/** Sanitize an incoming theme (admin writes + reads) — keeps only valid fields. */
|
|
44
62
|
export declare function sanitizeEmailTheme(raw: unknown): EmailTheme;
|
|
45
63
|
/**
|
|
46
|
-
* Derive the theme from the store's brand: blueprint primary color +
|
|
47
|
-
*
|
|
48
|
-
* store's emails brand-matched with no merchant action.
|
|
64
|
+
* Derive the theme from the store's brand: blueprint primary color +
|
|
65
|
+
* heading/body fonts (when they exist in the Google catalog). This is what
|
|
66
|
+
* makes every store's emails brand-matched with no merchant action.
|
|
49
67
|
*/
|
|
50
68
|
export declare function deriveBrandEmailTheme(): EmailTheme;
|
|
69
|
+
/**
|
|
70
|
+
* Brand color swatches for the admin theme panel — one click puts the store
|
|
71
|
+
* on-brand. Unique, ordered by prominence.
|
|
72
|
+
*/
|
|
73
|
+
export declare function deriveBrandPalette(): string[];
|
|
51
74
|
/**
|
|
52
75
|
* The effective theme: brand-derived defaults with the merchant's saved
|
|
53
76
|
* theme layered on top. Cached briefly; call invalidateEmailTheme() after
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/emails/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/emails/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAiFH,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAA;AACpD,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAChD,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAC9C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,CAAA;AAE9C,MAAM,WAAW,UAAU;IACzB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,6CAA6C;IAC7C,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,iBAAiB,CAAA;IAChC,yBAAyB;IACzB,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,wBAAwB;IACxB,QAAQ,CAAC,EAAE,aAAa,C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