@whop/elements 1.5.0 → 1.7.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/package.json +2 -2
- package/payments.d.cts +19 -5
- package/payments.d.ts +19 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whop/elements",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Whop Elements — vanilla-js loader + types. Loads the hosted SDK and exposes the typed WhopElements factory.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"checkout",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
-
"whopElementsApiHash": "
|
|
100
|
+
"whopElementsApiHash": "f11e64fefcafa5eff8df4bbd6a2afbf830f2e718599e49ab8b4a16b111de7565"
|
|
101
101
|
}
|
package/payments.d.cts
CHANGED
|
@@ -350,10 +350,10 @@ export interface AddressElementProps {
|
|
|
350
350
|
*/
|
|
351
351
|
defaultValues?: { name?: string | undefined; address?: { name?: string | undefined; first_name?: string | undefined; last_name?: string | undefined; organization?: string | undefined; organization_type?: "business" | "individual" | undefined; line1?: string | undefined; line2?: string | undefined; city?: string | undefined; state?: string | undefined; postal_code?: string | undefined; country?: string | undefined; } | undefined; };
|
|
352
352
|
/**
|
|
353
|
-
* `full` (default) stacks labeled fields. `compact` groups placeholder-labeled fields within one border.
|
|
353
|
+
* `full` (default) stacks labeled fields. `compact` groups placeholder-labeled fields within one border. `wrap` keeps `full`'s separate fields and also puts city, state and postal code side by side. Those and the pairs `full` already sets side by side (first and last name, organization) fit as many to a row as the width allows and wrap as it narrows.
|
|
354
354
|
* @default "full"
|
|
355
355
|
*/
|
|
356
|
-
layout?: "full" | "compact";
|
|
356
|
+
layout?: "full" | "compact" | "wrap";
|
|
357
357
|
/**
|
|
358
358
|
* `above` (default) keeps each label outside its field: above it in the `full` layout, as its placeholder in `compact`. `floating` uses each label as the placeholder of its field, in either layout, then shows a small label above the typed text once the field has a value.
|
|
359
359
|
* @default "above"
|
|
@@ -383,6 +383,11 @@ export interface AddressElementProps {
|
|
|
383
383
|
* @default true
|
|
384
384
|
*/
|
|
385
385
|
autocomplete?: boolean;
|
|
386
|
+
/**
|
|
387
|
+
* Shows every address field from the start. By default (`false`) the form opens with the street address and reveals the rest once the buyer picks a suggestion, types an address, or chooses to enter it manually.
|
|
388
|
+
* @default false
|
|
389
|
+
*/
|
|
390
|
+
expanded?: boolean;
|
|
386
391
|
/**
|
|
387
392
|
* Additional fields rendered with the address form. Values are validated and emitted in the separate `custom` map.
|
|
388
393
|
*/
|
|
@@ -451,10 +456,10 @@ export interface AddressElementCreateOptions {
|
|
|
451
456
|
*/
|
|
452
457
|
defaultValues?: { name?: string | undefined; address?: { name?: string | undefined; first_name?: string | undefined; last_name?: string | undefined; organization?: string | undefined; organization_type?: "business" | "individual" | undefined; line1?: string | undefined; line2?: string | undefined; city?: string | undefined; state?: string | undefined; postal_code?: string | undefined; country?: string | undefined; } | undefined; };
|
|
453
458
|
/**
|
|
454
|
-
* `full` (default) stacks labeled fields. `compact` groups placeholder-labeled fields within one border.
|
|
459
|
+
* `full` (default) stacks labeled fields. `compact` groups placeholder-labeled fields within one border. `wrap` keeps `full`'s separate fields and also puts city, state and postal code side by side. Those and the pairs `full` already sets side by side (first and last name, organization) fit as many to a row as the width allows and wrap as it narrows.
|
|
455
460
|
* @default "full"
|
|
456
461
|
*/
|
|
457
|
-
layout?: "full" | "compact";
|
|
462
|
+
layout?: "full" | "compact" | "wrap";
|
|
458
463
|
/**
|
|
459
464
|
* `above` (default) keeps each label outside its field: above it in the `full` layout, as its placeholder in `compact`. `floating` uses each label as the placeholder of its field, in either layout, then shows a small label above the typed text once the field has a value.
|
|
460
465
|
* @default "above"
|
|
@@ -484,6 +489,11 @@ export interface AddressElementCreateOptions {
|
|
|
484
489
|
* @default true
|
|
485
490
|
*/
|
|
486
491
|
autocomplete?: boolean;
|
|
492
|
+
/**
|
|
493
|
+
* Shows every address field from the start. By default (`false`) the form opens with the street address and reveals the rest once the buyer picks a suggestion, types an address, or chooses to enter it manually.
|
|
494
|
+
* @default false
|
|
495
|
+
*/
|
|
496
|
+
expanded?: boolean;
|
|
487
497
|
/**
|
|
488
498
|
* Additional fields rendered with the address form. Values are validated and emitted in the separate `custom` map.
|
|
489
499
|
*/
|
|
@@ -1361,6 +1371,10 @@ export interface PromoCodeUpdate {
|
|
|
1361
1371
|
* The total under the code, in minor units.
|
|
1362
1372
|
*/
|
|
1363
1373
|
amount?: number | undefined;
|
|
1374
|
+
/**
|
|
1375
|
+
* The sheet's line items under the code, such as the discount and the tax it changes.
|
|
1376
|
+
*/
|
|
1377
|
+
lineItems?: PaymentRequestLineItem[] | undefined;
|
|
1364
1378
|
/**
|
|
1365
1379
|
* A caption for the applied code, where the sheet captions codes (Google Pay).
|
|
1366
1380
|
*/
|
|
@@ -1380,7 +1394,7 @@ export interface PromoCodeChangeEvent {
|
|
|
1380
1394
|
*/
|
|
1381
1395
|
code: string | null;
|
|
1382
1396
|
/**
|
|
1383
|
-
* Answer exactly once: `error` refuses the code and keeps the totals, and any other answer applies it. `amount`
|
|
1397
|
+
* Answer exactly once: `error` refuses the code and keeps the totals, and any other answer applies it. `amount` and `lineItems` reprice the sheet under the code, and `appliedDescription` captions the applied code where the sheet shows one (Google Pay). `updateWith({})` applies the code at the current total.
|
|
1384
1398
|
*/
|
|
1385
1399
|
updateWith: (update: PromoCodeUpdate) => void;
|
|
1386
1400
|
}
|
package/payments.d.ts
CHANGED
|
@@ -350,10 +350,10 @@ export interface AddressElementProps {
|
|
|
350
350
|
*/
|
|
351
351
|
defaultValues?: { name?: string | undefined; address?: { name?: string | undefined; first_name?: string | undefined; last_name?: string | undefined; organization?: string | undefined; organization_type?: "business" | "individual" | undefined; line1?: string | undefined; line2?: string | undefined; city?: string | undefined; state?: string | undefined; postal_code?: string | undefined; country?: string | undefined; } | undefined; };
|
|
352
352
|
/**
|
|
353
|
-
* `full` (default) stacks labeled fields. `compact` groups placeholder-labeled fields within one border.
|
|
353
|
+
* `full` (default) stacks labeled fields. `compact` groups placeholder-labeled fields within one border. `wrap` keeps `full`'s separate fields and also puts city, state and postal code side by side. Those and the pairs `full` already sets side by side (first and last name, organization) fit as many to a row as the width allows and wrap as it narrows.
|
|
354
354
|
* @default "full"
|
|
355
355
|
*/
|
|
356
|
-
layout?: "full" | "compact";
|
|
356
|
+
layout?: "full" | "compact" | "wrap";
|
|
357
357
|
/**
|
|
358
358
|
* `above` (default) keeps each label outside its field: above it in the `full` layout, as its placeholder in `compact`. `floating` uses each label as the placeholder of its field, in either layout, then shows a small label above the typed text once the field has a value.
|
|
359
359
|
* @default "above"
|
|
@@ -383,6 +383,11 @@ export interface AddressElementProps {
|
|
|
383
383
|
* @default true
|
|
384
384
|
*/
|
|
385
385
|
autocomplete?: boolean;
|
|
386
|
+
/**
|
|
387
|
+
* Shows every address field from the start. By default (`false`) the form opens with the street address and reveals the rest once the buyer picks a suggestion, types an address, or chooses to enter it manually.
|
|
388
|
+
* @default false
|
|
389
|
+
*/
|
|
390
|
+
expanded?: boolean;
|
|
386
391
|
/**
|
|
387
392
|
* Additional fields rendered with the address form. Values are validated and emitted in the separate `custom` map.
|
|
388
393
|
*/
|
|
@@ -451,10 +456,10 @@ export interface AddressElementCreateOptions {
|
|
|
451
456
|
*/
|
|
452
457
|
defaultValues?: { name?: string | undefined; address?: { name?: string | undefined; first_name?: string | undefined; last_name?: string | undefined; organization?: string | undefined; organization_type?: "business" | "individual" | undefined; line1?: string | undefined; line2?: string | undefined; city?: string | undefined; state?: string | undefined; postal_code?: string | undefined; country?: string | undefined; } | undefined; };
|
|
453
458
|
/**
|
|
454
|
-
* `full` (default) stacks labeled fields. `compact` groups placeholder-labeled fields within one border.
|
|
459
|
+
* `full` (default) stacks labeled fields. `compact` groups placeholder-labeled fields within one border. `wrap` keeps `full`'s separate fields and also puts city, state and postal code side by side. Those and the pairs `full` already sets side by side (first and last name, organization) fit as many to a row as the width allows and wrap as it narrows.
|
|
455
460
|
* @default "full"
|
|
456
461
|
*/
|
|
457
|
-
layout?: "full" | "compact";
|
|
462
|
+
layout?: "full" | "compact" | "wrap";
|
|
458
463
|
/**
|
|
459
464
|
* `above` (default) keeps each label outside its field: above it in the `full` layout, as its placeholder in `compact`. `floating` uses each label as the placeholder of its field, in either layout, then shows a small label above the typed text once the field has a value.
|
|
460
465
|
* @default "above"
|
|
@@ -484,6 +489,11 @@ export interface AddressElementCreateOptions {
|
|
|
484
489
|
* @default true
|
|
485
490
|
*/
|
|
486
491
|
autocomplete?: boolean;
|
|
492
|
+
/**
|
|
493
|
+
* Shows every address field from the start. By default (`false`) the form opens with the street address and reveals the rest once the buyer picks a suggestion, types an address, or chooses to enter it manually.
|
|
494
|
+
* @default false
|
|
495
|
+
*/
|
|
496
|
+
expanded?: boolean;
|
|
487
497
|
/**
|
|
488
498
|
* Additional fields rendered with the address form. Values are validated and emitted in the separate `custom` map.
|
|
489
499
|
*/
|
|
@@ -1361,6 +1371,10 @@ export interface PromoCodeUpdate {
|
|
|
1361
1371
|
* The total under the code, in minor units.
|
|
1362
1372
|
*/
|
|
1363
1373
|
amount?: number | undefined;
|
|
1374
|
+
/**
|
|
1375
|
+
* The sheet's line items under the code, such as the discount and the tax it changes.
|
|
1376
|
+
*/
|
|
1377
|
+
lineItems?: PaymentRequestLineItem[] | undefined;
|
|
1364
1378
|
/**
|
|
1365
1379
|
* A caption for the applied code, where the sheet captions codes (Google Pay).
|
|
1366
1380
|
*/
|
|
@@ -1380,7 +1394,7 @@ export interface PromoCodeChangeEvent {
|
|
|
1380
1394
|
*/
|
|
1381
1395
|
code: string | null;
|
|
1382
1396
|
/**
|
|
1383
|
-
* Answer exactly once: `error` refuses the code and keeps the totals, and any other answer applies it. `amount`
|
|
1397
|
+
* Answer exactly once: `error` refuses the code and keeps the totals, and any other answer applies it. `amount` and `lineItems` reprice the sheet under the code, and `appliedDescription` captions the applied code where the sheet shows one (Google Pay). `updateWith({})` applies the code at the current total.
|
|
1384
1398
|
*/
|
|
1385
1399
|
updateWith: (update: PromoCodeUpdate) => void;
|
|
1386
1400
|
}
|