@frak-labs/components 0.0.26 → 1.0.0-beta.10dada3f
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/cdn/Banner.UBeCtoRQ.js +162 -0
- package/cdn/ButtonShare.COa5uY94.js +1 -0
- package/cdn/ButtonWallet.BUzysl1S.js +40 -0
- package/cdn/OpenInAppButton.Bmzm2fL9.js +1 -0
- package/cdn/PostPurchase._st1hB42.js +52 -0
- package/cdn/components.js +1 -1
- package/cdn/formatReward.B0iBskOJ.js +1 -0
- package/cdn/loader.css +0 -14
- package/cdn/loader.js +14 -1
- package/cdn/sprinkles.css.ts.vanilla.Ct795MMK.js +1175 -0
- package/cdn/useGlobalComponents.CLH7id-Y.js +1 -0
- package/cdn/useLightDomStyles.DqYouFn3.js +1 -0
- package/cdn/usePlacement.Di6eZ4ty.js +58 -0
- package/cdn/useReward.DJwgphI1.js +1 -0
- package/cdn/useShareModal.UYsKX7L2.js +1 -0
- package/dist/GiftIcon-4sr9xXyq.js +1501 -0
- package/dist/banner.d.ts +116 -0
- package/dist/banner.js +464 -0
- package/dist/buttonShare.d.ts +16 -6
- package/dist/buttonShare.js +78 -103
- package/dist/buttonWallet.d.ts +10 -2
- package/dist/buttonWallet.js +79 -40
- package/dist/formatReward-Bub6Z6eY.js +33 -0
- package/dist/openInApp.d.ts +4 -2
- package/dist/openInApp.js +33 -33
- package/dist/postPurchase.d.ts +136 -0
- package/dist/postPurchase.js +1618 -0
- package/dist/useGlobalComponents-Cmfszr7v.js +21 -0
- package/dist/useLightDomStyles-C3lcOwY2.js +41 -0
- package/dist/usePlacement-V7NrKoub.js +253 -0
- package/dist/useReward-DU3_yP8Q.js +65 -0
- package/dist/useShareModal-BEVkLrBP.js +54 -0
- package/package.json +29 -20
- package/cdn/ButtonShare.CqRLxX5u.js +0 -1
- package/cdn/ButtonWallet.ToH_g8FC.js +0 -1
- package/cdn/OpenInAppButton.BMZnXQLT.js +0 -1
- package/cdn/Spinner.DRiAlyyq.js +0 -1
- package/cdn/initFrakSdk.CA6zXtGT.js +0 -14
- package/cdn/useClientReady.DskSqlAg.js +0 -1
- package/dist/Spinner-1CZC_zy6.js +0 -36
- package/dist/Spinner-CHZD3tMn.css +0 -1
- package/dist/buttonShare.css +0 -1
- package/dist/buttonWallet.css +0 -1
- package/dist/openInApp.css +0 -1
- package/dist/useClientReady-iCtUeDsc.js +0 -197
- package/dist/useReward-DAkT-7wT.js +0 -48
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import * as _$preact from "preact";
|
|
2
|
+
|
|
3
|
+
//#region src/components/PostPurchase/types.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Props for the {@link PostPurchase} component.
|
|
6
|
+
* @inline
|
|
7
|
+
*/
|
|
8
|
+
type PostPurchaseProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Merchant customer ID for purchase tracking fallback.
|
|
11
|
+
* All three tracking props (`customerId`, `orderId`, `token`) must be
|
|
12
|
+
* present for tracking to fire.
|
|
13
|
+
*/
|
|
14
|
+
customerId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Merchant order ID for purchase tracking fallback.
|
|
17
|
+
*/
|
|
18
|
+
orderId?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Checkout token for purchase tracking fallback.
|
|
21
|
+
*/
|
|
22
|
+
token?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Base URL to share. Falls back to the merchant domain returned by
|
|
25
|
+
* the backend when omitted.
|
|
26
|
+
*/
|
|
27
|
+
sharingUrl?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Override the merchant ID resolved from the SDK config.
|
|
30
|
+
*/
|
|
31
|
+
merchantId?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Placement ID for backend-driven CSS customization.
|
|
34
|
+
*/
|
|
35
|
+
placement?: string;
|
|
36
|
+
/**
|
|
37
|
+
* CSS class names passed through to the root element (Light DOM).
|
|
38
|
+
*/
|
|
39
|
+
classname?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Force a display variant instead of relying on the backend evaluation.
|
|
42
|
+
*/
|
|
43
|
+
variant?: "referrer" | "referee";
|
|
44
|
+
/**
|
|
45
|
+
* Label for the pill badge displayed above the message.
|
|
46
|
+
* When omitted (and no placement config provides one), the badge is hidden.
|
|
47
|
+
*/
|
|
48
|
+
badgeText?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Override the message shown to referrers.
|
|
51
|
+
* Use `{REWARD}` as placeholder for the reward amount.
|
|
52
|
+
*/
|
|
53
|
+
referrerText?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Override the message shown to referees.
|
|
56
|
+
* Use `{REWARD}` as placeholder for the reward amount.
|
|
57
|
+
*/
|
|
58
|
+
refereeText?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Override the CTA button text.
|
|
61
|
+
* Use `{REWARD}` as placeholder for the reward amount.
|
|
62
|
+
*/
|
|
63
|
+
ctaText?: string;
|
|
64
|
+
/**
|
|
65
|
+
* When set, renders the card in preview mode (e.g. Shopify/WP editor).
|
|
66
|
+
* Bypasses the client-ready / RPC gates that normally hide the card
|
|
67
|
+
* until the backend resolves, and no-ops the click handler so merchants
|
|
68
|
+
* can see the final layout with their configured copy.
|
|
69
|
+
*/
|
|
70
|
+
preview?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Which variant to show when {@link preview} is set.
|
|
73
|
+
* Defaults to `"referrer"`.
|
|
74
|
+
*/
|
|
75
|
+
previewVariant?: "referrer" | "referee";
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/components/PostPurchase/PostPurchase.d.ts
|
|
79
|
+
/**
|
|
80
|
+
* Post-purchase card component.
|
|
81
|
+
*
|
|
82
|
+
* Renders an inline card on the merchant's thank-you / order-status page
|
|
83
|
+
* that either congratulates a referee or invites a referrer to share.
|
|
84
|
+
*
|
|
85
|
+
* Fetches referral status and merchant information via two independent
|
|
86
|
+
* RPC calls, then computes the display variant locally.
|
|
87
|
+
*
|
|
88
|
+
* @group components
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* Minimal — just show the card:
|
|
92
|
+
* ```html
|
|
93
|
+
* <frak-post-purchase></frak-post-purchase>
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* With purchase tracking fallback and custom sharing URL:
|
|
98
|
+
* ```html
|
|
99
|
+
* <frak-post-purchase
|
|
100
|
+
* customer-id="cust_123"
|
|
101
|
+
* order-id="ord_456"
|
|
102
|
+
* token="checkout_abc"
|
|
103
|
+
* sharing-url="https://merchant.com/product/shoes"
|
|
104
|
+
* ></frak-post-purchase>
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
declare function PostPurchase({
|
|
108
|
+
customerId,
|
|
109
|
+
orderId,
|
|
110
|
+
token,
|
|
111
|
+
sharingUrl,
|
|
112
|
+
merchantId,
|
|
113
|
+
placement: placementId,
|
|
114
|
+
classname,
|
|
115
|
+
variant: forcedVariant,
|
|
116
|
+
badgeText: propBadgeText,
|
|
117
|
+
referrerText: propReferrerText,
|
|
118
|
+
refereeText: propRefereeText,
|
|
119
|
+
ctaText: propCtaText,
|
|
120
|
+
preview,
|
|
121
|
+
previewVariant
|
|
122
|
+
}: PostPurchaseProps): _$preact.JSX.Element | null;
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/components/PostPurchase/index.d.ts
|
|
125
|
+
/**
|
|
126
|
+
* Custom element interface for `<frak-post-purchase>`.
|
|
127
|
+
* Combines standard {@link HTMLElement} with {@link PostPurchaseProps}.
|
|
128
|
+
*/
|
|
129
|
+
interface PostPurchaseElement extends HTMLElement, PostPurchaseProps {}
|
|
130
|
+
declare global {
|
|
131
|
+
interface HTMLElementTagNameMap {
|
|
132
|
+
"frak-post-purchase": PostPurchaseElement;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
export { PostPurchase, PostPurchaseElement };
|