@withpotter/lib 0.13.0-next.79 → 0.13.0-next.81
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/timeline-copy.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare function productUpdated(itemTitle: string, contentType: string):
|
|
|
17
17
|
description: string;
|
|
18
18
|
emoji: string;
|
|
19
19
|
};
|
|
20
|
-
export declare function orderPlaced(customerName: string, orderNumber: string, formattedTotal: string, industryKey?: string | null): {
|
|
20
|
+
export declare function orderPlaced(customerName: string, orderNumber: string, formattedTotal: string, industryKey?: string | null, isPaid?: boolean): {
|
|
21
21
|
title: string;
|
|
22
22
|
description: string;
|
|
23
23
|
emoji: string;
|
package/dist/timeline-copy.js
CHANGED
|
@@ -17,8 +17,12 @@ const ORDER_VERB = {
|
|
|
17
17
|
hospitality: "booked",
|
|
18
18
|
events: "purchased tickets for"
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const UNPAID_ORDER_VERB = {
|
|
21
|
+
events: "started a ticket order for"
|
|
22
|
+
};
|
|
23
|
+
function orderPlaced(customerName, orderNumber, formattedTotal, industryKey, isPaid = true) {
|
|
24
|
+
const verbs = isPaid ? ORDER_VERB : { ...ORDER_VERB, ...UNPAID_ORDER_VERB };
|
|
25
|
+
const verb = industryKey && verbs[industryKey] || "placed an order";
|
|
22
26
|
return {
|
|
23
27
|
title: `${customerName} ${verb}`,
|
|
24
28
|
description: `${orderNumber} \u2022 ${formattedTotal}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/timeline-copy.ts"],"sourcesContent":["/**\n * Timeline copy/messaging for the dashboard activity feed.\n *\n * All user-facing strings for the \"What's happening\" timeline live here\n * so we can iterate on tone, A/B test, or add i18n without touching\n * component logic.\n *\n * Each generator receives contextual data and returns { title, description }.\n */\n\n// ─── Product / Content ──────────────────────────────────────────────\n\nexport function productAdded(itemTitle: string, contentType: string) {\n return {\n title: `${itemTitle} is now live`,\n description: `New ${contentType.toLowerCase()} added to your store`,\n emoji: '📦',\n };\n}\n\nexport function productUpdated(itemTitle: string, contentType: string) {\n return {\n title: `${itemTitle} was updated`,\n description: `You updated your ${contentType.toLowerCase()}`,\n emoji: '🔄',\n };\n}\n\n// ─── Orders ─────────────────────────────────────────────────────────\n\nconst ORDER_VERB: Record<string, string> = {\n food: 'ordered',\n hospitality: 'booked',\n events: 'purchased tickets for',\n};\n\nexport function orderPlaced(\n customerName: string,\n orderNumber: string,\n formattedTotal: string,\n industryKey?: string | null,\n) {\n const verb = (industryKey &&
|
|
1
|
+
{"version":3,"sources":["../src/timeline-copy.ts"],"sourcesContent":["/**\n * Timeline copy/messaging for the dashboard activity feed.\n *\n * All user-facing strings for the \"What's happening\" timeline live here\n * so we can iterate on tone, A/B test, or add i18n without touching\n * component logic.\n *\n * Each generator receives contextual data and returns { title, description }.\n */\n\n// ─── Product / Content ──────────────────────────────────────────────\n\nexport function productAdded(itemTitle: string, contentType: string) {\n return {\n title: `${itemTitle} is now live`,\n description: `New ${contentType.toLowerCase()} added to your store`,\n emoji: '📦',\n };\n}\n\nexport function productUpdated(itemTitle: string, contentType: string) {\n return {\n title: `${itemTitle} was updated`,\n description: `You updated your ${contentType.toLowerCase()}`,\n emoji: '🔄',\n };\n}\n\n// ─── Orders ─────────────────────────────────────────────────────────\n\nconst ORDER_VERB: Record<string, string> = {\n food: 'ordered',\n hospitality: 'booked',\n events: 'purchased tickets for',\n};\n\n// A ticket is only bought once it is paid. An unpaid ticket order is a checkout\n// that was started, and calling it a purchase puts money on the feed that is\n// not in the wallet.\nconst UNPAID_ORDER_VERB: Record<string, string> = {\n events: 'started a ticket order for',\n};\n\nexport function orderPlaced(\n customerName: string,\n orderNumber: string,\n formattedTotal: string,\n industryKey?: string | null,\n isPaid = true,\n) {\n const verbs = isPaid ? ORDER_VERB : { ...ORDER_VERB, ...UNPAID_ORDER_VERB };\n const verb = (industryKey && verbs[industryKey]) || 'placed an order';\n return {\n title: `${customerName} ${verb}`,\n description: `${orderNumber} • ${formattedTotal}`,\n emoji: '🛍️',\n };\n}\n\nexport function orderCompleted(customerName: string, orderNumber: string) {\n return {\n title: `${orderNumber} is fulfilled`,\n description: `${customerName}'s order is complete`,\n emoji: '✅',\n };\n}\n\n// ─── Customers / Members ────────────────────────────────────────────\n\nconst BOOKABLE_INDUSTRIES = new Set([\n 'beauty',\n 'wellness',\n 'professional',\n 'fitness',\n]);\n\nexport function memberSignup(\n name: string,\n email: string,\n industryKey?: string | null,\n) {\n const verb =\n industryKey && BOOKABLE_INDUSTRIES.has(industryKey)\n ? 'became a client'\n : 'joined your store';\n return {\n title: `${name} ${verb}`,\n description: email,\n emoji: '👤',\n };\n}\n\nexport function memberConverted(name: string, email: string) {\n return {\n title: `${name} just became a customer`,\n description: `Converted from guest · ${email}`,\n emoji: '🎉',\n };\n}\n\n// ─── Subscriptions ──────────────────────────────────────────────────\n\nexport function subscriptionCreated(\n name: string,\n planName: string,\n formattedAmount: string,\n) {\n return {\n title: `${name} subscribed to ${planName}`,\n description: `Recurring revenue: ${formattedAmount}/month`,\n emoji: '💳',\n };\n}\n\n// ─── Invoices ───────────────────────────────────────────────────────\n\nexport function invoicePaid(\n customerName: string,\n invoiceNumber: string,\n formattedAmount: string,\n) {\n return {\n title: `${customerName} paid invoice ${invoiceNumber}`,\n description: `Payment received: ${formattedAmount}`,\n emoji: '💰',\n };\n}\n\nexport function invoiceSent(\n customerName: string,\n invoiceNumber: string,\n formattedAmount: string,\n) {\n return {\n title: `Invoice ${invoiceNumber} sent to ${customerName}`,\n description: `Amount due: ${formattedAmount}`,\n emoji: '📨',\n };\n}\n\n// ─── Empty state ────────────────────────────────────────────────────\n\nconst INDUSTRY_EMPTY_TIMELINE: Record<\n string,\n { heading: string; subtext: string }\n> = {\n retail: {\n heading: 'Nothing here yet',\n subtext: 'Orders, signups, and updates will show up here as they happen.',\n },\n beauty: {\n heading: 'Nothing here yet',\n subtext: 'Appointments, bookings, and client activity will show up here.',\n },\n wellness: {\n heading: 'Nothing here yet',\n subtext: 'Appointments, bookings, and client activity will show up here.',\n },\n hospitality: {\n heading: 'Nothing here yet',\n subtext: 'Reservations, guest check-ins, and updates will show up here.',\n },\n food: {\n heading: 'Nothing here yet',\n subtext: 'Orders and customer activity will show up here as they happen.',\n },\n fitness: {\n heading: 'Nothing here yet',\n subtext: 'Class sign-ups, member activity, and updates will show up here.',\n },\n professional: {\n heading: 'Nothing here yet',\n subtext: 'Appointments, bookings, and client activity will show up here.',\n },\n creative: {\n heading: 'Nothing here yet',\n subtext: 'Bookings, orders, and client activity will show up here.',\n },\n events: {\n heading: 'Nothing here yet',\n subtext:\n 'Ticket sales, attendee activity, and event updates will show up here.',\n },\n};\n\nexport const emptyTimeline = {\n heading: 'Nothing here yet',\n subtext: 'Orders, signups, and updates will show up here as they happen.',\n};\n\nexport function getEmptyTimeline(industryKey: string | null) {\n if (industryKey && INDUSTRY_EMPTY_TIMELINE[industryKey]) {\n return INDUSTRY_EMPTY_TIMELINE[industryKey];\n }\n return emptyTimeline;\n}\n\n// ─── Feed chrome ────────────────────────────────────────────────────\n\n// Curly apostrophe, matching every other apostrophe in the product's copy.\nexport const feedHeader = 'What’s happening';\n\nexport function showMoreLabel(remaining: number) {\n return `Show ${remaining} more`;\n}\n\nexport const showLessLabel = 'Show less';\n"],"mappings":"AAYO,SAAS,aAAa,WAAmB,aAAqB;AACnE,SAAO;AAAA,IACL,OAAO,GAAG,SAAS;AAAA,IACnB,aAAa,OAAO,YAAY,YAAY,CAAC;AAAA,IAC7C,OAAO;AAAA,EACT;AACF;AAEO,SAAS,eAAe,WAAmB,aAAqB;AACrE,SAAO;AAAA,IACL,OAAO,GAAG,SAAS;AAAA,IACnB,aAAa,oBAAoB,YAAY,YAAY,CAAC;AAAA,IAC1D,OAAO;AAAA,EACT;AACF;AAIA,MAAM,aAAqC;AAAA,EACzC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,QAAQ;A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