@shopify/ui-extensions 2023.7.3 → 2023.10.1
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/build/cjs/surfaces/admin/components/CustomerSegmentTemplate/CustomerSegmentTemplate.js +17 -0
- package/build/cjs/surfaces/admin/components/InternalCustomerSegmentTemplate/InternalCustomerSegmentTemplate.js +12 -0
- package/build/cjs/surfaces/admin.js +4 -2
- package/build/cjs/surfaces/checkout/components/ConsentCheckbox/ConsentCheckbox.js +9 -0
- package/build/cjs/surfaces/checkout/components/ConsentPhoneField/ConsentPhoneField.js +9 -0
- package/build/cjs/surfaces/checkout/components/LoginWithShop/LoginWithShop.js +9 -0
- package/build/cjs/surfaces/checkout/components/PaymentIcon/PaymentIcon.js +11 -0
- package/build/cjs/surfaces/checkout/components/ProductThumbnail/ProductThumbnail.js +9 -0
- package/build/cjs/surfaces/checkout.js +10 -0
- package/build/cjs/surfaces/customer-account.js +10 -0
- package/build/esm/surfaces/admin/components/CustomerSegmentTemplate/CustomerSegmentTemplate.mjs +13 -0
- package/build/esm/surfaces/admin/components/InternalCustomerSegmentTemplate/InternalCustomerSegmentTemplate.mjs +8 -0
- package/build/esm/surfaces/admin.mjs +2 -1
- package/build/esm/surfaces/checkout/components/ConsentCheckbox/ConsentCheckbox.mjs +5 -0
- package/build/esm/surfaces/checkout/components/ConsentPhoneField/ConsentPhoneField.mjs +5 -0
- package/build/esm/surfaces/checkout/components/LoginWithShop/LoginWithShop.mjs +5 -0
- package/build/esm/surfaces/checkout/components/PaymentIcon/PaymentIcon.mjs +7 -0
- package/build/esm/surfaces/checkout/components/ProductThumbnail/ProductThumbnail.mjs +5 -0
- package/build/esm/surfaces/checkout.mjs +5 -0
- package/build/esm/surfaces/customer-account.mjs +5 -0
- package/build/esnext/surfaces/admin/components/CustomerSegmentTemplate/CustomerSegmentTemplate.esnext +13 -0
- package/build/esnext/surfaces/admin/components/InternalCustomerSegmentTemplate/InternalCustomerSegmentTemplate.esnext +8 -0
- package/build/esnext/surfaces/admin.esnext +2 -1
- package/build/esnext/surfaces/checkout/components/ConsentCheckbox/ConsentCheckbox.esnext +5 -0
- package/build/esnext/surfaces/checkout/components/ConsentPhoneField/ConsentPhoneField.esnext +5 -0
- package/build/esnext/surfaces/checkout/components/LoginWithShop/LoginWithShop.esnext +5 -0
- package/build/esnext/surfaces/checkout/components/PaymentIcon/PaymentIcon.esnext +7 -0
- package/build/esnext/surfaces/checkout/components/ProductThumbnail/ProductThumbnail.esnext +5 -0
- package/build/esnext/surfaces/checkout.esnext +5 -0
- package/build/esnext/surfaces/customer-account.esnext +5 -0
- package/build/ts/shared.d.ts +1 -1
- package/build/ts/shared.d.ts.map +1 -1
- package/build/ts/surfaces/admin/api/action/action.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/api/block/block.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/api/{customer-segmentation-template/customer-segmentation-template.d.ts → customer-segment-template/customer-segment-template.d.ts} +3 -3
- package/build/ts/surfaces/admin/api/customer-segment-template/customer-segment-template.d.ts.map +1 -0
- package/build/ts/surfaces/admin/api/customer-segment-template/customer-segment-template.doc.d.ts +4 -0
- package/build/ts/surfaces/admin/api/customer-segment-template/customer-segment-template.doc.d.ts.map +1 -0
- package/build/ts/surfaces/admin/api/extension-targets/extension-targets.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/api/standard/standard.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/api.d.ts +1 -1
- package/build/ts/surfaces/admin/api.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/AdminAction/AdminAction.d.ts +7 -1
- package/build/ts/surfaces/admin/components/AdminAction/AdminAction.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/AdminAction/AdminAction.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/AdminBlock/AdminBlock.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/BlockStack/BlockStack.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Box/Box.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Button/Button.d.ts +10 -0
- package/build/ts/surfaces/admin/components/Button/Button.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Button/Button.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Checkbox/Checkbox.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/CustomerSegmentTemplate/CustomerSegmentTemplate.d.ts +44 -0
- package/build/ts/surfaces/admin/components/CustomerSegmentTemplate/CustomerSegmentTemplate.d.ts.map +1 -0
- package/build/ts/surfaces/admin/components/CustomerSegmentTemplate/CustomerSegmentTemplate.doc.d.ts +4 -0
- package/build/ts/surfaces/admin/components/CustomerSegmentTemplate/CustomerSegmentTemplate.doc.d.ts.map +1 -0
- package/build/ts/surfaces/admin/components/Divider/Divider.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/EmailField/EmailField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Form/Form.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Heading/Heading.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/HeadingGroup/HeadingGroup.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Icon/Icon.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Image/Image.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/InlineStack/InlineStack.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/InternalCustomerSegmentTemplate/InternalCustomerSegmentTemplate.d.ts +30 -0
- package/build/ts/surfaces/admin/components/InternalCustomerSegmentTemplate/InternalCustomerSegmentTemplate.d.ts.map +1 -0
- package/build/ts/surfaces/admin/components/Link/Link.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/NumberField/NumberField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/PasswordField/PasswordField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Pressable/Pressable.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/ResourceItem/ResourceItem.d.ts +5 -0
- package/build/ts/surfaces/admin/components/ResourceItem/ResourceItem.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Select/Select.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Text/Text.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/TextArea/TextArea.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/TextField/TextField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/URLField/URLField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components.d.ts +4 -2
- package/build/ts/surfaces/admin/components.d.ts.map +1 -1
- package/build/ts/surfaces/admin/extension-targets.d.ts +52 -18
- package/build/ts/surfaces/admin/extension-targets.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/api/checkout/checkout.d.ts +6 -6
- package/build/ts/surfaces/checkout/api/docs.d.ts +70 -0
- package/build/ts/surfaces/checkout/api/docs.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/api/payment/payment-option-item.d.ts +2 -0
- package/build/ts/surfaces/checkout/api/payment/payment-option-item.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/api/redeemable/redeemable.d.ts +5 -1
- package/build/ts/surfaces/checkout/api/redeemable/redeemable.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/api/standard/standard.d.ts +120 -20
- package/build/ts/surfaces/checkout/api/standard/standard.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/api.d.ts +1 -1
- package/build/ts/surfaces/checkout/api.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/components/BlockSpacer/BlockSpacer.d.ts +5 -0
- package/build/ts/surfaces/checkout/components/BlockSpacer/BlockSpacer.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/components/ConsentCheckbox/ConsentCheckbox.d.ts +15 -0
- package/build/ts/surfaces/checkout/components/ConsentCheckbox/ConsentCheckbox.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/ConsentCheckbox/ConsentCheckbox.doc.d.ts +4 -0
- package/build/ts/surfaces/checkout/components/ConsentCheckbox/ConsentCheckbox.doc.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/ConsentPhoneField/ConsentPhoneField.d.ts +16 -0
- package/build/ts/surfaces/checkout/components/ConsentPhoneField/ConsentPhoneField.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/ConsentPhoneField/ConsentPhoneField.doc.d.ts +4 -0
- package/build/ts/surfaces/checkout/components/ConsentPhoneField/ConsentPhoneField.doc.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Icon/Icon.d.ts +2 -4
- package/build/ts/surfaces/checkout/components/Icon/Icon.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/components/LoginWithShop/LoginWithShop.d.ts +15 -0
- package/build/ts/surfaces/checkout/components/LoginWithShop/LoginWithShop.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/PaymentIcon/PaymentIcon.d.ts +32 -0
- package/build/ts/surfaces/checkout/components/PaymentIcon/PaymentIcon.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/PaymentIcon/PaymentIcon.doc.d.ts +4 -0
- package/build/ts/surfaces/checkout/components/PaymentIcon/PaymentIcon.doc.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/ProductThumbnail/ProductThumbnail.d.ts +79 -0
- package/build/ts/surfaces/checkout/components/ProductThumbnail/ProductThumbnail.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/ProductThumbnail/ProductThumbnail.doc.d.ts +4 -0
- package/build/ts/surfaces/checkout/components/ProductThumbnail/ProductThumbnail.doc.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/SkeletonText/SkeletonText.d.ts +3 -1
- package/build/ts/surfaces/checkout/components/SkeletonText/SkeletonText.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/components/SkeletonTextBlock/SkeletonTextBlock.d.ts +5 -1
- package/build/ts/surfaces/checkout/components/SkeletonTextBlock/SkeletonTextBlock.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/components/Tag/Tag.d.ts +1 -3
- package/build/ts/surfaces/checkout/components/Tag/Tag.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/components/Text/Text.d.ts +1 -1
- package/build/ts/surfaces/checkout/components/Text/Text.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/components/TextBlock/TextBlock.d.ts +4 -2
- package/build/ts/surfaces/checkout/components/TextBlock/TextBlock.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/components/shared.d.ts +11 -13
- package/build/ts/surfaces/checkout/components/shared.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/components.d.ts +10 -0
- package/build/ts/surfaces/checkout/components.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/targets.d.ts +70 -33
- package/build/ts/surfaces/checkout/targets.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/api/order-status/order-status.d.ts +15 -4
- package/build/ts/surfaces/customer-account/api/order-status/order-status.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/api.d.ts +1 -1
- package/build/ts/surfaces/customer-account/api.d.ts.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/shared.ts +1 -1
- package/src/surfaces/admin/api/action/action.doc.ts +0 -1
- package/src/surfaces/admin/api/block/block.doc.ts +0 -1
- package/src/surfaces/admin/api/customer-segment-template/customer-segment-template.doc.ts +20 -0
- package/src/surfaces/admin/api/{customer-segmentation-template/customer-segmentation-template.ts → customer-segment-template/customer-segment-template.ts} +3 -5
- package/src/surfaces/admin/api/extension-targets/extension-targets.doc.ts +0 -1
- package/src/surfaces/admin/api/standard/standard.doc.ts +0 -1
- package/src/surfaces/admin/api.ts +1 -1
- package/src/surfaces/admin/components/AdminAction/AdminAction.doc.ts +0 -1
- package/src/surfaces/admin/components/AdminAction/AdminAction.ts +5 -0
- package/src/surfaces/admin/components/AdminBlock/AdminBlock.doc.ts +0 -1
- package/src/surfaces/admin/components/BlockStack/BlockStack.doc.ts +0 -1
- package/src/surfaces/admin/components/Box/Box.doc.ts +0 -1
- package/src/surfaces/admin/components/Button/Button.doc.ts +0 -1
- package/src/surfaces/admin/components/Button/Button.ts +12 -0
- package/src/surfaces/admin/components/Checkbox/Checkbox.doc.ts +0 -1
- package/src/surfaces/admin/components/CustomerSegmentTemplate/CustomerSegmentTemplate.doc.ts +42 -0
- package/src/surfaces/admin/components/CustomerSegmentTemplate/CustomerSegmentTemplate.ts +45 -0
- package/src/surfaces/admin/components/CustomerSegmentTemplate/examples/CustomerSegmentTemplate.example.ts +17 -0
- package/src/surfaces/admin/components/CustomerSegmentTemplate/examples/CustomerSegmentTemplate.example.tsx +15 -0
- package/src/surfaces/admin/components/Divider/Divider.doc.ts +0 -1
- package/src/surfaces/admin/components/EmailField/EmailField.doc.ts +0 -1
- package/src/surfaces/admin/components/Form/Form.doc.ts +1 -2
- package/src/surfaces/admin/components/Heading/Heading.doc.ts +0 -1
- package/src/surfaces/admin/components/HeadingGroup/HeadingGroup.doc.ts +0 -1
- package/src/surfaces/admin/components/Icon/Icon.doc.ts +0 -1
- package/src/surfaces/admin/components/Image/Image.doc.ts +0 -1
- package/src/surfaces/admin/components/InlineStack/InlineStack.doc.ts +0 -1
- package/src/surfaces/admin/components/InternalCustomerSegmentTemplate/InternalCustomerSegmentTemplate.ts +68 -0
- package/src/surfaces/admin/components/InternalCustomerSegmentTemplate/examples/InternalCustomerSegmentTemplate.example.ts +45 -0
- package/src/surfaces/admin/components/Link/Link.doc.ts +0 -1
- package/src/surfaces/admin/components/NumberField/NumberField.doc.ts +0 -1
- package/src/surfaces/admin/components/PasswordField/PasswordField.doc.ts +0 -1
- package/src/surfaces/admin/components/Pressable/Pressable.doc.ts +0 -1
- package/src/surfaces/admin/components/Select/Select.doc.ts +0 -1
- package/src/surfaces/admin/components/Text/Text.doc.ts +0 -1
- package/src/surfaces/admin/components/TextArea/TextArea.doc.ts +0 -1
- package/src/surfaces/admin/components/TextField/TextField.doc.ts +0 -1
- package/src/surfaces/admin/components/URLField/URLField.doc.ts +0 -1
- package/src/surfaces/admin/components.ts +8 -2
- package/src/surfaces/admin/extension-targets.ts +67 -20
- package/src/surfaces/checkout/api/checkout/checkout.ts +6 -6
- package/src/surfaces/checkout/api/docs.ts +99 -0
- package/src/surfaces/checkout/api/payment/payment-option-item.ts +5 -0
- package/src/surfaces/checkout/api/redeemable/redeemable.ts +6 -1
- package/src/surfaces/checkout/api/standard/standard.ts +136 -19
- package/src/surfaces/checkout/api.ts +1 -0
- package/src/surfaces/checkout/components/ChoiceList/ChoiceList.doc.ts +1 -1
- package/src/surfaces/checkout/components/ConsentCheckbox/ConsentCheckbox.doc.ts +48 -0
- package/src/surfaces/checkout/components/ConsentCheckbox/ConsentCheckbox.ts +17 -0
- package/src/surfaces/checkout/components/ConsentCheckbox/examples/basic-consent-checkbox.example.ts +11 -0
- package/src/surfaces/checkout/components/ConsentPhoneField/ConsentPhoneField.doc.ts +48 -0
- package/src/surfaces/checkout/components/ConsentPhoneField/ConsentPhoneField.ts +19 -0
- package/src/surfaces/checkout/components/ConsentPhoneField/examples/basic-consent-phone-field.example.ts +10 -0
- package/src/surfaces/checkout/components/Icon/Icon.ts +2 -3
- package/src/surfaces/checkout/components/LoginWithShop/LoginWithShop.ts +16 -0
- package/src/surfaces/checkout/components/PaymentIcon/PaymentIcon.doc.ts +55 -0
- package/src/surfaces/checkout/components/PaymentIcon/PaymentIcon.ts +481 -0
- package/src/surfaces/checkout/components/PaymentIcon/examples/basic-paymenticon.example.ts +7 -0
- package/src/surfaces/checkout/components/ProductThumbnail/ProductThumbnail.doc.ts +50 -0
- package/src/surfaces/checkout/components/ProductThumbnail/ProductThumbnail.ts +86 -0
- package/src/surfaces/checkout/components/ProductThumbnail/examples/basic-productthumbnail.example.ts +11 -0
- package/src/surfaces/checkout/components/Text/Text.ts +7 -1
- package/src/surfaces/checkout/components/TextBlock/TextBlock.ts +7 -1
- package/src/surfaces/checkout/components/shared.ts +13 -23
- package/src/surfaces/checkout/components.ts +21 -0
- package/src/surfaces/checkout/targets.ts +96 -35
- package/src/surfaces/customer-account/api/order-status/order-status.ts +18 -4
- package/src/surfaces/customer-account/api.ts +1 -0
- package/build/cjs/surfaces/admin/components/CustomerSegmentationTemplate/CustomerSegmentationTemplate.js +0 -12
- package/build/esm/surfaces/admin/components/CustomerSegmentationTemplate/CustomerSegmentationTemplate.mjs +0 -8
- package/build/esnext/surfaces/admin/components/CustomerSegmentationTemplate/CustomerSegmentationTemplate.esnext +0 -8
- package/build/ts/surfaces/admin/api/customer-segmentation-template/customer-segmentation-template.d.ts.map +0 -1
- package/build/ts/surfaces/admin/components/CustomerSegmentationTemplate/CustomerSegmentationTemplate.d.ts +0 -27
- package/build/ts/surfaces/admin/components/CustomerSegmentationTemplate/CustomerSegmentationTemplate.d.ts.map +0 -1
- package/src/surfaces/admin/components/CustomerSegmentationTemplate/CustomerSegmentationTemplate.ts +0 -68
- package/src/surfaces/admin/components/CustomerSegmentationTemplate/examples/CustomerSegmentationTemplate.example.ts +0 -37
|
@@ -15,10 +15,10 @@ import type {ExtensionTarget} from '../../targets';
|
|
|
15
15
|
import {ApiVersion} from '../../../../shared';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* A key-value storage object for extension
|
|
18
|
+
* A key-value storage object for the extension.
|
|
19
19
|
*
|
|
20
|
-
* Stored data is only available to this specific
|
|
21
|
-
*
|
|
20
|
+
* Stored data is only available to this specific extension
|
|
21
|
+
* and any of its instances.
|
|
22
22
|
*
|
|
23
23
|
* The storage backend is implemented with `localStorage` and
|
|
24
24
|
* should persist across the buyer's checkout session.
|
|
@@ -56,8 +56,15 @@ export interface Storage {
|
|
|
56
56
|
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
|
|
57
57
|
*
|
|
58
58
|
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior.
|
|
59
|
+
*
|
|
60
|
+
* * [`collect_buyer_consent.sms_marketing`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect buyer consent for SMS marketing.
|
|
59
61
|
*/
|
|
60
|
-
|
|
62
|
+
|
|
63
|
+
export type Capability =
|
|
64
|
+
| 'api_access'
|
|
65
|
+
| 'network_access'
|
|
66
|
+
| 'block_progress'
|
|
67
|
+
| 'collect_buyer_consent.sms_marketing';
|
|
61
68
|
|
|
62
69
|
/**
|
|
63
70
|
* Meta information about an extension target.
|
|
@@ -79,6 +86,8 @@ export interface Extension<Target extends ExtensionTarget = ExtensionTarget> {
|
|
|
79
86
|
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
|
|
80
87
|
*
|
|
81
88
|
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior.
|
|
89
|
+
*
|
|
90
|
+
* * [`collect_buyer_consent.sms_marketing`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect buyer consent for SMS marketing.
|
|
82
91
|
*/
|
|
83
92
|
capabilities: StatefulRemoteSubscribable<Capability[]>;
|
|
84
93
|
|
|
@@ -211,6 +220,7 @@ export interface AppMetafieldEntryTarget {
|
|
|
211
220
|
| 'customer'
|
|
212
221
|
| 'product'
|
|
213
222
|
| 'shop'
|
|
223
|
+
| 'shopUser'
|
|
214
224
|
| 'variant'
|
|
215
225
|
| 'company'
|
|
216
226
|
| 'companyLocation'
|
|
@@ -238,6 +248,7 @@ export interface AppMetafieldEntry {
|
|
|
238
248
|
export type {ApiVersion} from '../../../../shared';
|
|
239
249
|
|
|
240
250
|
export type Version = string;
|
|
251
|
+
export type CheckoutToken = string;
|
|
241
252
|
|
|
242
253
|
/**
|
|
243
254
|
* This returns a translated string matching a key in a locale file.
|
|
@@ -462,7 +473,7 @@ export interface StandardApi<Target extends ExtensionTarget = ExtensionTarget> {
|
|
|
462
473
|
/**
|
|
463
474
|
* Provides details on the buyer's progression through the checkout.
|
|
464
475
|
*
|
|
465
|
-
* See [buyer journey](https://shopify.dev/docs/api/checkout-ui-extensions/apis/
|
|
476
|
+
* See [buyer journey](https://shopify.dev/docs/api/checkout-ui-extensions/apis/buyer-journey#examples)
|
|
466
477
|
* examples for more information.
|
|
467
478
|
*/
|
|
468
479
|
buyerJourney: BuyerJourney;
|
|
@@ -472,6 +483,14 @@ export interface StandardApi<Target extends ExtensionTarget = ExtensionTarget> {
|
|
|
472
483
|
*/
|
|
473
484
|
checkoutSettings: StatefulRemoteSubscribable<CheckoutSettings>;
|
|
474
485
|
|
|
486
|
+
/**
|
|
487
|
+
* A stable id that represents the current checkout.
|
|
488
|
+
*
|
|
489
|
+
* Matches the `token` field in the [WebPixel checkout payload](https://shopify.dev/docs/api/pixels/customer-events#checkout)
|
|
490
|
+
* and the `checkout_token` field in the [Admin REST API Order resource](https://shopify.dev/docs/api/admin-rest/unstable/resources/order#resource-object).
|
|
491
|
+
*/
|
|
492
|
+
checkoutToken: StatefulRemoteSubscribable<CheckoutToken | undefined>;
|
|
493
|
+
|
|
475
494
|
/**
|
|
476
495
|
* Details on the costs the buyer will pay for this checkout.
|
|
477
496
|
*/
|
|
@@ -512,10 +531,10 @@ export interface StandardApi<Target extends ExtensionTarget = ExtensionTarget> {
|
|
|
512
531
|
|
|
513
532
|
/**
|
|
514
533
|
* Utilities for translating content and formatting values according to the current
|
|
515
|
-
* [`localization`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/
|
|
534
|
+
* [`localization`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization)
|
|
516
535
|
* of the checkout.
|
|
517
536
|
*
|
|
518
|
-
* See [localization examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/
|
|
537
|
+
* See [localization examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#examples)
|
|
519
538
|
* for more information.
|
|
520
539
|
*/
|
|
521
540
|
i18n: I18n;
|
|
@@ -528,7 +547,7 @@ export interface StandardApi<Target extends ExtensionTarget = ExtensionTarget> {
|
|
|
528
547
|
/**
|
|
529
548
|
* Details about the location, language, and currency of the buyer. For utilities to easily
|
|
530
549
|
* format and translate content based on these details, you can use the
|
|
531
|
-
* [`i18n`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi
|
|
550
|
+
* [`i18n`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#standardapi-propertydetail-i18n)
|
|
532
551
|
* object instead.
|
|
533
552
|
*/
|
|
534
553
|
localization: Localization;
|
|
@@ -554,7 +573,7 @@ export interface StandardApi<Target extends ExtensionTarget = ExtensionTarget> {
|
|
|
554
573
|
/**
|
|
555
574
|
* Used to query the Storefront GraphQL API with a prefetched token.
|
|
556
575
|
*
|
|
557
|
-
* See [storefront api access examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/
|
|
576
|
+
* See [storefront api access examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/storefront-api) for more information.
|
|
558
577
|
*/
|
|
559
578
|
query: <Data = unknown, Variables = {[key: string]: unknown}>(
|
|
560
579
|
query: string,
|
|
@@ -569,7 +588,7 @@ export interface StandardApi<Target extends ExtensionTarget = ExtensionTarget> {
|
|
|
569
588
|
/**
|
|
570
589
|
* Provides access to session tokens, which can be used to verify token claims on your app's server.
|
|
571
590
|
*
|
|
572
|
-
* See [session token examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/
|
|
591
|
+
* See [session token examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/session-token) for more information.
|
|
573
592
|
*/
|
|
574
593
|
sessionToken: SessionToken;
|
|
575
594
|
|
|
@@ -577,7 +596,7 @@ export interface StandardApi<Target extends ExtensionTarget = ExtensionTarget> {
|
|
|
577
596
|
* The settings matching the settings definition written in the
|
|
578
597
|
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
|
|
579
598
|
*
|
|
580
|
-
* See [settings examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/
|
|
599
|
+
* See [settings examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/settings) for more information.
|
|
581
600
|
*
|
|
582
601
|
* > Note: When an extension is being installed in the editor, the settings will be empty until
|
|
583
602
|
* a merchant sets a value. In that case, this object will be updated in real time as a merchant fills in the settings.
|
|
@@ -594,11 +613,24 @@ export interface StandardApi<Target extends ExtensionTarget = ExtensionTarget> {
|
|
|
594
613
|
*/
|
|
595
614
|
shippingAddress?: StatefulRemoteSubscribable<MailingAddress | undefined>;
|
|
596
615
|
|
|
616
|
+
/**
|
|
617
|
+
* The proposed buyer billing address. The address updates when the field is
|
|
618
|
+
* committed (on change) rather than every keystroke.
|
|
619
|
+
*
|
|
620
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
621
|
+
*/
|
|
622
|
+
billingAddress?: StatefulRemoteSubscribable<MailingAddress | undefined>;
|
|
623
|
+
|
|
597
624
|
/** Shop where the checkout is taking place. */
|
|
598
625
|
shop: Shop;
|
|
599
626
|
|
|
600
627
|
/**
|
|
601
|
-
* Key-value storage for the extension
|
|
628
|
+
* Key-value storage for the extension.
|
|
629
|
+
* Uses `localStorage` and should persist across the buyer's current checkout session.
|
|
630
|
+
* However, data persistence isn't guaranteed and storage is reset when the buyer starts a new checkout.
|
|
631
|
+
*
|
|
632
|
+
* Data is shared across all activated extension targets of this extension. In versions `<=2023-07`,
|
|
633
|
+
* each activated extension target had its own storage.
|
|
602
634
|
*/
|
|
603
635
|
storage: Storage;
|
|
604
636
|
|
|
@@ -764,6 +796,26 @@ export interface Shop {
|
|
|
764
796
|
}
|
|
765
797
|
|
|
766
798
|
export interface CartCost {
|
|
799
|
+
/**
|
|
800
|
+
* A `Money` value representing the subtotal value of the items in the cart at the current
|
|
801
|
+
* step of checkout.
|
|
802
|
+
*/
|
|
803
|
+
subtotalAmount: StatefulRemoteSubscribable<Money>;
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* A `Money` value representing the total shipping a buyer can expect to pay at the current
|
|
807
|
+
* step of checkout. This value includes shipping discounts. Returns undefined if shipping
|
|
808
|
+
* has not been negotiated yet, such as on the information step.
|
|
809
|
+
*/
|
|
810
|
+
totalShippingAmount: StatefulRemoteSubscribable<Money | undefined>;
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* A `Money` value representing the total tax a buyer can expect to pay at the current
|
|
814
|
+
* step of checkout or the total tax included in product and shipping prices. Returns
|
|
815
|
+
* undefined if taxes are unavailable.
|
|
816
|
+
*/
|
|
817
|
+
totalTaxAmount: StatefulRemoteSubscribable<Money | undefined>;
|
|
818
|
+
|
|
767
819
|
/**
|
|
768
820
|
* A `Money` value representing the minimum a buyer can expect to pay at the current
|
|
769
821
|
* step of checkout. This value excludes amounts yet to be negotiated. For example,
|
|
@@ -1015,7 +1067,7 @@ export interface SelectedPaymentOption {
|
|
|
1015
1067
|
/**
|
|
1016
1068
|
* The unique handle referencing `PaymentOption.handle`.
|
|
1017
1069
|
*
|
|
1018
|
-
* See [availablePaymentOptions](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi
|
|
1070
|
+
* See [availablePaymentOptions](https://shopify.dev/docs/api/checkout-ui-extensions/apis/payment-options#standardapi-propertydetail-availablepaymentoptions).
|
|
1019
1071
|
*/
|
|
1020
1072
|
handle: string;
|
|
1021
1073
|
}
|
|
@@ -1210,9 +1262,27 @@ export interface Customer {
|
|
|
1210
1262
|
*/
|
|
1211
1263
|
image: ImageDetails;
|
|
1212
1264
|
/**
|
|
1213
|
-
* Defines if the customer accepts marketing activities.
|
|
1265
|
+
* Defines if the customer email accepts marketing activities.
|
|
1266
|
+
*
|
|
1267
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
1268
|
+
*
|
|
1269
|
+
* > Caution: This field is deprecated and will be removed in a future version. Use `acceptsEmailMarketing` or `acceptsSmsMarketing` instead.
|
|
1270
|
+
*
|
|
1271
|
+
* @deprecated Use `acceptsEmailMarketing` or `acceptsSmsMarketing` instead.
|
|
1214
1272
|
*/
|
|
1215
1273
|
acceptsMarketing: boolean;
|
|
1274
|
+
/**
|
|
1275
|
+
* Defines if the customer accepts email marketing activities.
|
|
1276
|
+
*
|
|
1277
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
1278
|
+
*/
|
|
1279
|
+
acceptsEmailMarketing: boolean;
|
|
1280
|
+
/**
|
|
1281
|
+
* Defines if the customer accepts SMS marketing activities.
|
|
1282
|
+
*
|
|
1283
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
1284
|
+
*/
|
|
1285
|
+
acceptsSmsMarketing: boolean;
|
|
1216
1286
|
/**
|
|
1217
1287
|
* The Store Credit Accounts owned by the customer and usable during the checkout process.
|
|
1218
1288
|
*
|
|
@@ -1261,7 +1331,7 @@ export interface PaymentTermsTemplate {
|
|
|
1261
1331
|
*/
|
|
1262
1332
|
id: string;
|
|
1263
1333
|
/**
|
|
1264
|
-
* The name of the payment terms translated to the buyer's current language. See [localization.language](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi
|
|
1334
|
+
* The name of the payment terms translated to the buyer's current language. See [localization.language](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#standardapi-propertydetail-localization).
|
|
1265
1335
|
*/
|
|
1266
1336
|
name: string;
|
|
1267
1337
|
/**
|
|
@@ -1301,6 +1371,43 @@ export interface Analytics {
|
|
|
1301
1371
|
* Publish method to emit analytics events to [Web Pixels](https://shopify.dev/docs/apps/marketing).
|
|
1302
1372
|
*/
|
|
1303
1373
|
publish(name: string, data: {[key: string]: unknown}): Promise<boolean>;
|
|
1374
|
+
|
|
1375
|
+
/**
|
|
1376
|
+
* A method for capturing details about a visitor on the online store.
|
|
1377
|
+
*/
|
|
1378
|
+
visitor(data: {email?: string; phone?: string}): Promise<VisitorResult>;
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* Represents a visitor result.
|
|
1382
|
+
*/
|
|
1383
|
+
export type VisitorResult = VisitorSuccess | VisitorError;
|
|
1384
|
+
|
|
1385
|
+
/**
|
|
1386
|
+
* Represents a successful visitor result.
|
|
1387
|
+
*/
|
|
1388
|
+
export interface VisitorSuccess {
|
|
1389
|
+
/**
|
|
1390
|
+
* Indicates that the visitor information was validated and submitted.
|
|
1391
|
+
*/
|
|
1392
|
+
type: 'success';
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* Represents an unsuccessful visitor result.
|
|
1397
|
+
*/
|
|
1398
|
+
export interface VisitorError {
|
|
1399
|
+
/**
|
|
1400
|
+
* Indicates that the visitor information is invalid and wasn't submitted.
|
|
1401
|
+
* Examples are using the wrong data type or missing a required property.
|
|
1402
|
+
*/
|
|
1403
|
+
type: 'error';
|
|
1404
|
+
|
|
1405
|
+
/**
|
|
1406
|
+
* A message that explains the error. This message is useful for debugging.
|
|
1407
|
+
* It's **not** localized, and therefore should not be presented directly
|
|
1408
|
+
* to the buyer.
|
|
1409
|
+
*/
|
|
1410
|
+
message: string;
|
|
1304
1411
|
}
|
|
1305
1412
|
|
|
1306
1413
|
/**
|
|
@@ -1359,10 +1466,15 @@ export interface DeliveryOptionReference {
|
|
|
1359
1466
|
handle: string;
|
|
1360
1467
|
}
|
|
1361
1468
|
|
|
1469
|
+
export type DeliveryOption =
|
|
1470
|
+
| ShippingOption
|
|
1471
|
+
| PickupPointOption
|
|
1472
|
+
| PickupLocationOption;
|
|
1473
|
+
|
|
1362
1474
|
/**
|
|
1363
1475
|
* Represents a base interface for a single delivery option.
|
|
1364
1476
|
*/
|
|
1365
|
-
export interface
|
|
1477
|
+
export interface DeliveryOptionBase {
|
|
1366
1478
|
/**
|
|
1367
1479
|
* The unique identifier of the delivery option.
|
|
1368
1480
|
*/
|
|
@@ -1377,12 +1489,17 @@ export interface DeliveryOption {
|
|
|
1377
1489
|
* The description of the delivery option.
|
|
1378
1490
|
*/
|
|
1379
1491
|
description?: string;
|
|
1492
|
+
|
|
1493
|
+
/**
|
|
1494
|
+
* The code of the delivery option.
|
|
1495
|
+
*/
|
|
1496
|
+
code: string;
|
|
1380
1497
|
}
|
|
1381
1498
|
|
|
1382
1499
|
/**
|
|
1383
1500
|
* Represents a delivery option that is a shipping option.
|
|
1384
1501
|
*/
|
|
1385
|
-
export interface ShippingOption extends
|
|
1502
|
+
export interface ShippingOption extends DeliveryOptionBase {
|
|
1386
1503
|
/**
|
|
1387
1504
|
* The type of this delivery option.
|
|
1388
1505
|
*/
|
|
@@ -1423,7 +1540,7 @@ export interface ShippingOptionCarrier {
|
|
|
1423
1540
|
name?: string;
|
|
1424
1541
|
}
|
|
1425
1542
|
|
|
1426
|
-
export interface PickupPointOption extends
|
|
1543
|
+
export interface PickupPointOption extends DeliveryOptionBase {
|
|
1427
1544
|
/**
|
|
1428
1545
|
* The type of this delivery option.
|
|
1429
1546
|
*/
|
|
@@ -1450,7 +1567,7 @@ export interface PickupPointOption extends DeliveryOption {
|
|
|
1450
1567
|
location: PickupPointLocation;
|
|
1451
1568
|
}
|
|
1452
1569
|
|
|
1453
|
-
export interface PickupLocationOption extends
|
|
1570
|
+
export interface PickupLocationOption extends DeliveryOptionBase {
|
|
1454
1571
|
/**
|
|
1455
1572
|
* The type of this delivery option.
|
|
1456
1573
|
*/
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
2
|
+
|
|
3
|
+
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
+
name: 'ConsentCheckbox',
|
|
5
|
+
description:
|
|
6
|
+
"Use buyer consent checkboxes for collecting the buyer's approval for a given policy.",
|
|
7
|
+
thumbnail: 'consent-checkbox-thumbnail.png',
|
|
8
|
+
requires: '',
|
|
9
|
+
isVisualComponent: true,
|
|
10
|
+
type: '',
|
|
11
|
+
definitions: [
|
|
12
|
+
{
|
|
13
|
+
title: 'ConsentCheckboxProps',
|
|
14
|
+
description: '',
|
|
15
|
+
type: 'ConsentCheckboxProps',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
category: 'Components',
|
|
19
|
+
subCategory: 'Forms',
|
|
20
|
+
defaultExample: {
|
|
21
|
+
image: 'consent-checkbox-default.png',
|
|
22
|
+
codeblock: {
|
|
23
|
+
title: 'Basic ConsentCheckbox',
|
|
24
|
+
tabs: [
|
|
25
|
+
{
|
|
26
|
+
title: 'React',
|
|
27
|
+
code: '../../../../../../ui-extensions-react/src/surfaces/checkout/components/ConsentCheckbox/examples/basic-consent-checkbox.example.tsx',
|
|
28
|
+
language: 'tsx',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: 'JS',
|
|
32
|
+
code: './examples/basic-consent-checkbox.example.ts',
|
|
33
|
+
language: 'js',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
related: [
|
|
39
|
+
{
|
|
40
|
+
name: 'ConsentCheckbox',
|
|
41
|
+
subtitle: 'Component',
|
|
42
|
+
url: 'consent-checkbox',
|
|
43
|
+
type: 'Component',
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default data;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {createRemoteComponent} from '@remote-ui/core';
|
|
2
|
+
|
|
3
|
+
import {CheckboxProps} from '../Checkbox/Checkbox';
|
|
4
|
+
|
|
5
|
+
export interface ConsentCheckboxProps extends Omit<CheckboxProps, 'value'> {
|
|
6
|
+
/**
|
|
7
|
+
* The policy for which buyer consent is being collected for.
|
|
8
|
+
*
|
|
9
|
+
* `sms-marketing`: Represents the policy for SMS marketing consent.
|
|
10
|
+
*/
|
|
11
|
+
policy: 'sms-marketing';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const ConsentCheckbox = createRemoteComponent<
|
|
15
|
+
'ConsentCheckbox',
|
|
16
|
+
ConsentCheckboxProps
|
|
17
|
+
>('ConsentCheckbox');
|
package/src/surfaces/checkout/components/ConsentCheckbox/examples/basic-consent-checkbox.example.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {extension, ConsentCheckbox} from '@shopify/ui-extensions/checkout';
|
|
2
|
+
|
|
3
|
+
export default extension('purchase.checkout.block.render', (root) => {
|
|
4
|
+
const consentCheckbox = root.createComponent(
|
|
5
|
+
ConsentCheckbox,
|
|
6
|
+
{policy: 'sms-marketing'},
|
|
7
|
+
'Text me with news and promotions',
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
root.appendChild(consentCheckbox);
|
|
11
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
2
|
+
|
|
3
|
+
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
+
name: 'ConsentPhoneField',
|
|
5
|
+
description:
|
|
6
|
+
'Display a phone field for customers to sign up for text message marketing, noting that the phone field value will be automatically saved during checkout.',
|
|
7
|
+
thumbnail: 'consent-phonefield-thumbnail.png',
|
|
8
|
+
requires: '',
|
|
9
|
+
isVisualComponent: true,
|
|
10
|
+
type: '',
|
|
11
|
+
definitions: [
|
|
12
|
+
{
|
|
13
|
+
title: 'ConsentPhoneFieldProps',
|
|
14
|
+
description: '',
|
|
15
|
+
type: 'ConsentPhoneFieldProps',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
category: 'Components',
|
|
19
|
+
subCategory: 'Forms',
|
|
20
|
+
defaultExample: {
|
|
21
|
+
image: 'consent-phonefield-default.png',
|
|
22
|
+
codeblock: {
|
|
23
|
+
title: 'Basic ConsentPhoneField',
|
|
24
|
+
tabs: [
|
|
25
|
+
{
|
|
26
|
+
title: 'React',
|
|
27
|
+
code: '../../../../../../ui-extensions-react/src/surfaces/checkout/components/ConsentPhoneField/examples/basic-consent-phone-field.example.tsx',
|
|
28
|
+
language: 'tsx',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: 'JS',
|
|
32
|
+
code: './examples/basic-consent-phone-field.example.ts',
|
|
33
|
+
language: 'js',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
related: [
|
|
39
|
+
{
|
|
40
|
+
name: 'ConsentCheckbox',
|
|
41
|
+
subtitle: 'Component',
|
|
42
|
+
url: 'consent-checkbox',
|
|
43
|
+
type: 'Component',
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default data;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {createRemoteComponent} from '@remote-ui/core';
|
|
2
|
+
|
|
3
|
+
import {PhoneFieldProps} from '../PhoneField/PhoneField';
|
|
4
|
+
|
|
5
|
+
export type ConsentPolicy = 'sms-marketing';
|
|
6
|
+
|
|
7
|
+
export interface ConsentPhoneFieldProps extends Omit<PhoneFieldProps, 'value'> {
|
|
8
|
+
/**
|
|
9
|
+
* The policy for which buyer consent is being collected for.
|
|
10
|
+
*
|
|
11
|
+
* `sms-marketing`: Represents the policy for SMS marketing consent.
|
|
12
|
+
*/
|
|
13
|
+
policy: ConsentPolicy;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const ConsentPhoneField = createRemoteComponent<
|
|
17
|
+
'ConsentPhoneField',
|
|
18
|
+
ConsentPhoneFieldProps
|
|
19
|
+
>('ConsentPhoneField');
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {extension, ConsentPhoneField} from '@shopify/ui-extensions/checkout';
|
|
2
|
+
|
|
3
|
+
export default extension('purchase.checkout.block.render', (root) => {
|
|
4
|
+
const consentPhoneField = root.createComponent(ConsentPhoneField, {
|
|
5
|
+
label: 'Phone',
|
|
6
|
+
policy: 'sms-marketing',
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
root.appendChild(consentPhoneField);
|
|
10
|
+
});
|
|
@@ -39,6 +39,7 @@ export type IconSource =
|
|
|
39
39
|
| 'hamburger'
|
|
40
40
|
| 'hollowCircle'
|
|
41
41
|
| 'horizontalDots'
|
|
42
|
+
| 'image'
|
|
42
43
|
| 'info'
|
|
43
44
|
| 'infoFill'
|
|
44
45
|
| 'list'
|
|
@@ -75,9 +76,7 @@ export interface IconProps extends IdProps {
|
|
|
75
76
|
/**
|
|
76
77
|
* Sets the appearance (color) of the icon.
|
|
77
78
|
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* @defaultValue 'monochrome'
|
|
79
|
+
* @defaultValue 'base'
|
|
81
80
|
*/
|
|
82
81
|
appearance?: Appearance;
|
|
83
82
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {createRemoteComponent} from '@remote-ui/core';
|
|
2
|
+
|
|
3
|
+
export interface LoginWithShopProps {
|
|
4
|
+
checked: boolean;
|
|
5
|
+
modalTitle?: string;
|
|
6
|
+
modalDescription?: string;
|
|
7
|
+
modalLogoSrc?: string;
|
|
8
|
+
apiKey?: string;
|
|
9
|
+
onComplete?(): void | Promise<void>;
|
|
10
|
+
onClosed?(): void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const LoginWithShop = createRemoteComponent<
|
|
14
|
+
'LoginWithShop',
|
|
15
|
+
LoginWithShopProps
|
|
16
|
+
>('LoginWithShop');
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
2
|
+
|
|
3
|
+
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
+
name: 'PaymentIcon',
|
|
5
|
+
description:
|
|
6
|
+
'Payment icons can be used for displaying payment-related information or features such as a user’s saved or available payment methods.',
|
|
7
|
+
thumbnail: 'paymenticon-thumbnail.png',
|
|
8
|
+
requires: '',
|
|
9
|
+
isVisualComponent: true,
|
|
10
|
+
type: '',
|
|
11
|
+
definitions: [
|
|
12
|
+
{
|
|
13
|
+
title: 'PaymentIconProps',
|
|
14
|
+
description: '',
|
|
15
|
+
type: 'PaymentIconProps',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: 'PaymentMethod',
|
|
19
|
+
description: '',
|
|
20
|
+
type: 'PaymentMethod',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
category: 'Components',
|
|
24
|
+
subCategory: 'Media',
|
|
25
|
+
defaultExample: {
|
|
26
|
+
image: 'paymenticon-default.png',
|
|
27
|
+
codeblock: {
|
|
28
|
+
title: 'Basic PaymentIcon',
|
|
29
|
+
tabs: [
|
|
30
|
+
{
|
|
31
|
+
title: 'React',
|
|
32
|
+
code: '../../../../../../ui-extensions-react/src/surfaces/checkout/components/PaymentIcon/examples/basic-paymenticon.example.tsx',
|
|
33
|
+
language: 'tsx',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
title: 'JS',
|
|
37
|
+
code: './examples/basic-paymenticon.example.ts',
|
|
38
|
+
language: 'js',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
subSections: [
|
|
44
|
+
{
|
|
45
|
+
type: 'Generic',
|
|
46
|
+
anchorLink: 'best-practices',
|
|
47
|
+
title: 'Best Practices',
|
|
48
|
+
sectionContent:
|
|
49
|
+
'- Maintain the interior appearance of the SVG. The branded portion of the payment icon as provided meets the brand guidelines of the payment provider.\n\n- Maintain the border property of the payment icon. It is designed to adapt to merchant branding in Checkout and ensures a consistent appearance across the customer experience.\n\n- The icon size is designed to be displayed consistently across checkout.',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
related: [],
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default data;
|