@whop/embedded-components-vanilla-js 0.0.5-beta.0 → 0.0.5-beta.2
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/lib/index.d.ts +50 -4
- package/dist/url.js +1 -1
- package/dist/url.mjs +1 -1
- package/package.json +1 -1
package/dist/lib/index.d.ts
CHANGED
|
@@ -121,6 +121,25 @@ interface ChangeAccountCountryElementSnapshot {
|
|
|
121
121
|
}
|
|
122
122
|
type ChangeAccountCountryElement = WhopElement<ChangeAccountCountryElementOptions, ChangeAccountCountryElementEvents, ChangeAccountCountryElementSnapshot>;
|
|
123
123
|
|
|
124
|
+
interface GenerateWithdrawalReceiptElementEvents {
|
|
125
|
+
error: (error: unknown) => void;
|
|
126
|
+
ready: (element: GenerateWithdrawalReceiptElement) => void;
|
|
127
|
+
optionsUpdated: (options: GenerateWithdrawalReceiptElementOptions) => void;
|
|
128
|
+
snapshot: (snapshot: GenerateWithdrawalReceiptElementSnapshot) => void;
|
|
129
|
+
close: (ev: CustomEvent) => void;
|
|
130
|
+
receiptRequested: (ev: CustomEvent) => void;
|
|
131
|
+
}
|
|
132
|
+
interface GenerateWithdrawalReceiptElementOptions {
|
|
133
|
+
withdrawalId: string;
|
|
134
|
+
onReady?: (element: GenerateWithdrawalReceiptElement) => void;
|
|
135
|
+
onClose?: (ev: CustomEvent) => void;
|
|
136
|
+
onReceiptRequested?: (ev: CustomEvent) => void;
|
|
137
|
+
}
|
|
138
|
+
interface GenerateWithdrawalReceiptElementSnapshot {
|
|
139
|
+
state: "loading" | "ready";
|
|
140
|
+
}
|
|
141
|
+
type GenerateWithdrawalReceiptElement = WhopElement<GenerateWithdrawalReceiptElementOptions, GenerateWithdrawalReceiptElementEvents, GenerateWithdrawalReceiptElementSnapshot>;
|
|
142
|
+
|
|
124
143
|
interface PendingBalanceBreakdownElementEvents {
|
|
125
144
|
error: (error: unknown) => void;
|
|
126
145
|
ready: (element: PendingBalanceBreakdownElement) => void;
|
|
@@ -171,6 +190,26 @@ interface ResetAccountElementSnapshot {
|
|
|
171
190
|
}
|
|
172
191
|
type ResetAccountElement = WhopElement<ResetAccountElementOptions, ResetAccountElementEvents, ResetAccountElementSnapshot>;
|
|
173
192
|
|
|
193
|
+
type StatusBannerType = "compliance-required" | "compliance-pending" | "kyc-success" | "kyc-error" | "kyc-pending" | "kyc-warning" | "information-required" | "awaiting-review" | "request-approved" | null;
|
|
194
|
+
interface StatusBannerElementEvents {
|
|
195
|
+
error: (error: unknown) => void;
|
|
196
|
+
ready: (element: StatusBannerElement) => void;
|
|
197
|
+
optionsUpdated: (options: StatusBannerElementOptions) => void;
|
|
198
|
+
snapshot: (snapshot: StatusBannerElementSnapshot) => void;
|
|
199
|
+
verifyClick: (ev: CustomEvent<StatusBannerElement>) => void;
|
|
200
|
+
bannerChange: (ev: CustomEvent<StatusBannerElement>, bannerType: StatusBannerType) => void;
|
|
201
|
+
}
|
|
202
|
+
interface StatusBannerElementOptions {
|
|
203
|
+
onReady?: (element: StatusBannerElement) => void;
|
|
204
|
+
onVerifyClick?: (ev: CustomEvent<StatusBannerElement>) => void;
|
|
205
|
+
onBannerChange?: (ev: CustomEvent<StatusBannerElement>, bannerType: StatusBannerType) => void;
|
|
206
|
+
}
|
|
207
|
+
interface StatusBannerElementSnapshot {
|
|
208
|
+
state: "loading" | "ready";
|
|
209
|
+
bannerType: StatusBannerType;
|
|
210
|
+
}
|
|
211
|
+
type StatusBannerElement = WhopElement<StatusBannerElementOptions, StatusBannerElementEvents, StatusBannerElementSnapshot>;
|
|
212
|
+
|
|
174
213
|
interface TotalBalanceBreakdownElementEvents {
|
|
175
214
|
error: (error: unknown) => void;
|
|
176
215
|
ready: (element: TotalBalanceBreakdownElement) => void;
|
|
@@ -274,6 +313,9 @@ interface WithdrawalsElementEvents {
|
|
|
274
313
|
showWithdrawalBreakdown: (ev: CustomEvent<{
|
|
275
314
|
withdrawalId: string;
|
|
276
315
|
}>) => void;
|
|
316
|
+
showGenerateWithdrawalReceipt: (ev: CustomEvent<{
|
|
317
|
+
withdrawalId: string;
|
|
318
|
+
}>) => void;
|
|
277
319
|
}
|
|
278
320
|
interface WithdrawalsElementOptions {
|
|
279
321
|
onReady?: (element: WithdrawalsElement) => void;
|
|
@@ -284,9 +326,7 @@ interface WithdrawalsElementSnapshot {
|
|
|
284
326
|
type WithdrawalsElement = WhopElement<WithdrawalsElementOptions, WithdrawalsElementEvents, WithdrawalsElementSnapshot>;
|
|
285
327
|
|
|
286
328
|
interface ModalContainer {
|
|
287
|
-
|
|
288
|
-
modal: HTMLElement;
|
|
289
|
-
content: HTMLElement;
|
|
329
|
+
modalContainer: HTMLElement;
|
|
290
330
|
mount: () => void;
|
|
291
331
|
close: () => void;
|
|
292
332
|
}
|
|
@@ -387,6 +427,11 @@ type PayoutsSessionElements = {
|
|
|
387
427
|
PendingBalanceBreakdownElementOptions,
|
|
388
428
|
PendingBalanceBreakdownElement
|
|
389
429
|
];
|
|
430
|
+
"generate-withdrawal-receipt-element": [
|
|
431
|
+
GenerateWithdrawalReceiptElementOptions,
|
|
432
|
+
GenerateWithdrawalReceiptElement
|
|
433
|
+
];
|
|
434
|
+
"status-banner-element": [StatusBannerElementOptions, StatusBannerElement];
|
|
390
435
|
};
|
|
391
436
|
interface PayoutsSession extends TypedEmitter<PayoutsSessionEvents> {
|
|
392
437
|
token: Promise<string | null>;
|
|
@@ -404,6 +449,7 @@ interface PayoutsSession extends TypedEmitter<PayoutsSessionEvents> {
|
|
|
404
449
|
showPendingBalanceBreakdownModal: <Force extends boolean = false>(options: PendingBalanceBreakdownElementOptions | ((modal: ModalContainer) => PendingBalanceBreakdownElementOptions), force?: Force) => Force extends true ? ModalContainer : ModalContainer | undefined;
|
|
405
450
|
showRegularReserveBalanceBreakdownModal: <Force extends boolean = false>(options: RegularReserveBalanceBreakdownElementOptions | ((modal: ModalContainer) => RegularReserveBalanceBreakdownElementOptions), force?: Force) => Force extends true ? ModalContainer : ModalContainer | undefined;
|
|
406
451
|
showBnplReserveBalanceBreakdownModal: <Force extends boolean = false>(options: BnplReserveBalanceBreakdownElementOptions | ((modal: ModalContainer) => BnplReserveBalanceBreakdownElementOptions), force?: Force) => Force extends true ? ModalContainer : ModalContainer | undefined;
|
|
452
|
+
showGenerateWithdrawalReceiptModal: <Force extends boolean = false>(options: GenerateWithdrawalReceiptElementOptions | ((modal: ModalContainer) => GenerateWithdrawalReceiptElementOptions), force?: Force) => Force extends true ? ModalContainer : ModalContainer | undefined;
|
|
407
453
|
}
|
|
408
454
|
|
|
409
455
|
declare global {
|
|
@@ -435,4 +481,4 @@ interface WhopElementsEvents {
|
|
|
435
481
|
optionsUpdated: (options: WhopElementsOptions) => void;
|
|
436
482
|
}
|
|
437
483
|
|
|
438
|
-
export type { Appearance, BalanceElement, BalanceElementOptions, BalanceElementSnapshot, BnplReserveBalanceBreakdownElement, BnplReserveBalanceBreakdownElementOptions, BnplReserveBalanceBreakdownElementSnapshot, ChangeAccountCountryElement, ChangeAccountCountryElementOptions, ChangeAccountCountryElementSnapshot, ExpandedPayoutsSessionOptions, GetToken, I18nSupportedLocale, PayoutsSession, PayoutsSessionEvents, PayoutsSessionOptions, PendingBalanceBreakdownElement, PendingBalanceBreakdownElementOptions, PendingBalanceBreakdownElementSnapshot, RegularReserveBalanceBreakdownElement, RegularReserveBalanceBreakdownElementOptions, RegularReserveBalanceBreakdownElementSnapshot, ResetAccountElement, ResetAccountElementOptions, ResetAccountElementSnapshot, TotalBalanceBreakdownElement, TotalBalanceBreakdownElementOptions, TotalBalanceBreakdownElementSnapshot, VerifyElement, VerifyElementOptions, VerifyElementSnapshot, WhopElement, WhopElements, WhopElementsConstructor, WhopElementsEvents, WhopElementsOptions, WithdrawButtonElement, WithdrawButtonElementOptions, WithdrawElement, WithdrawElementOptions, WithdrawElementSnapshot, WithdrawalBreakdownElement, WithdrawalBreakdownElementOptions, WithdrawalBreakdownElementSnapshot, WithdrawalsElement, WithdrawalsElementOptions, WithdrawalsElementSnapshot };
|
|
484
|
+
export type { Appearance, BalanceElement, BalanceElementOptions, BalanceElementSnapshot, BnplReserveBalanceBreakdownElement, BnplReserveBalanceBreakdownElementOptions, BnplReserveBalanceBreakdownElementSnapshot, ChangeAccountCountryElement, ChangeAccountCountryElementOptions, ChangeAccountCountryElementSnapshot, ExpandedPayoutsSessionOptions, GenerateWithdrawalReceiptElement, GenerateWithdrawalReceiptElementOptions, GenerateWithdrawalReceiptElementSnapshot, GetToken, I18nSupportedLocale, PayoutsSession, PayoutsSessionEvents, PayoutsSessionOptions, PendingBalanceBreakdownElement, PendingBalanceBreakdownElementOptions, PendingBalanceBreakdownElementSnapshot, RegularReserveBalanceBreakdownElement, RegularReserveBalanceBreakdownElementOptions, RegularReserveBalanceBreakdownElementSnapshot, ResetAccountElement, ResetAccountElementOptions, ResetAccountElementSnapshot, StatusBannerElement, StatusBannerElementOptions, StatusBannerElementSnapshot, StatusBannerType, TotalBalanceBreakdownElement, TotalBalanceBreakdownElementOptions, TotalBalanceBreakdownElementSnapshot, VerifyElement, VerifyElementOptions, VerifyElementSnapshot, WhopElement, WhopElements, WhopElementsConstructor, WhopElementsEvents, WhopElementsOptions, WithdrawButtonElement, WithdrawButtonElementOptions, WithdrawElement, WithdrawElementOptions, WithdrawElementSnapshot, WithdrawalBreakdownElement, WithdrawalBreakdownElementOptions, WithdrawalBreakdownElementSnapshot, WithdrawalsElement, WithdrawalsElementOptions, WithdrawalsElementSnapshot };
|
package/dist/url.js
CHANGED
|
@@ -22,6 +22,6 @@ __export(url_exports, {
|
|
|
22
22
|
SCRIPT_URL: () => SCRIPT_URL
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(url_exports);
|
|
25
|
-
const ORIGIN = "https://0-0-5-beta-
|
|
25
|
+
const ORIGIN = "https://0-0-5-beta-2.elements.whop.com/";
|
|
26
26
|
const SCRIPT_URL = new URL(`/release/elements.js`, ORIGIN).toString();
|
|
27
27
|
//# sourceMappingURL=url.js.map
|
package/dist/url.mjs
CHANGED