@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
|
@@ -16,6 +16,11 @@ export interface AdminActionProps {
|
|
|
16
16
|
* Sets the Secondary action button of the container. This component must a button component.
|
|
17
17
|
*/
|
|
18
18
|
secondaryAction?: RemoteFragment;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Sets the loading state of the action modal
|
|
22
|
+
*/
|
|
23
|
+
loading?: boolean;
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
21
26
|
* AdminAction is a component used by Admin Action extensions to configure a primary and secondary action and title.
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'AdminBlock',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
'This component is similar to the AdminBlock, providing a deeper integration with the container your UI is rendered into. However, this only applies to Block Extensions which render inline on a resource page.',
|
|
8
7
|
requires: '',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'BlockStack',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
"This structures layout elements along the vertical axis of the page. It's useful for vertical alignment.",
|
|
8
7
|
requires: '',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'Box',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
'This is your foundational structural element for composing UI. It can be styled using predefined tokens. Use it to build your layout.',
|
|
8
7
|
requires: '',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'Button',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
'Use this component when you want to provide users the ability to perform specific actions, like saving data.',
|
|
8
7
|
requires: '',
|
|
@@ -82,6 +82,18 @@ interface ButtonAnchorProps extends CommonProps {
|
|
|
82
82
|
*/
|
|
83
83
|
to?: AnchorProps['href'];
|
|
84
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Tells browsers to download the linked resource instead of navigating to it.
|
|
87
|
+
* Optionally accepts filename value to rename file.
|
|
88
|
+
*/
|
|
89
|
+
download?: boolean | string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Specifies where to display the linked URL
|
|
93
|
+
* @default '_self'
|
|
94
|
+
*/
|
|
95
|
+
target?: '_blank' | '_self';
|
|
96
|
+
|
|
85
97
|
/**
|
|
86
98
|
* Callback when a link is pressed. If `href` is set,
|
|
87
99
|
* it will execute the callback and then navigate to the location specified by `href`.
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'Checkbox',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
'Use this component when you want to provide users with a clear selection option, such as for agreeing to terms and conditions or selecting multiple options from a list.',
|
|
8
7
|
requires: '',
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
2
|
+
|
|
3
|
+
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
+
name: 'CustomerSegmentTemplate',
|
|
5
|
+
description:
|
|
6
|
+
'CustomerSegmentTemplate is used to configure a template rendered in the **Customers** section of the Shopify admin. Templates can be applied in the [customer segment editor](https://help.shopify.com/en/manual/customers/customer-segmentation/customer-segments) and used to create segments.',
|
|
7
|
+
requires:
|
|
8
|
+
'use of the [admin.customers.segmentation-templates.render](/docs/api/admin-extensions/api/extension-targets#extensiontargets-propertydetail-admincustomerssegmentationtemplatesrender) target.',
|
|
9
|
+
isVisualComponent: true,
|
|
10
|
+
thumbnail: 'customersegmenttemplate-thumbnail.png',
|
|
11
|
+
type: '',
|
|
12
|
+
definitions: [
|
|
13
|
+
{
|
|
14
|
+
title: 'CustomerSegmentTemplateProps',
|
|
15
|
+
description: '',
|
|
16
|
+
type: 'CustomerSegmentTemplateProps',
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
category: 'Components',
|
|
20
|
+
subCategory: 'Other',
|
|
21
|
+
defaultExample: {
|
|
22
|
+
image: 'customersegmenttemplate-default',
|
|
23
|
+
codeblock: {
|
|
24
|
+
title: 'Simple CustomerSegmentTemplate implementation',
|
|
25
|
+
tabs: [
|
|
26
|
+
{
|
|
27
|
+
title: 'React',
|
|
28
|
+
code: './examples/CustomerSegmentTemplate.example.tsx',
|
|
29
|
+
language: 'tsx',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
title: 'JS',
|
|
33
|
+
code: './examples/CustomerSegmentTemplate.example.ts',
|
|
34
|
+
language: 'js',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
related: [],
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default data;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {createRemoteComponent} from '@remote-ui/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Reserved namespace and key for the customer standard metafield used in the template's query.
|
|
5
|
+
* More info - https://shopify.dev/docs/apps/custom-data/metafields/definitions/standard
|
|
6
|
+
*/
|
|
7
|
+
type CustomerStandardMetafieldDependency = 'facts.birth_date';
|
|
8
|
+
|
|
9
|
+
export interface CustomerSegmentTemplateProps {
|
|
10
|
+
/**
|
|
11
|
+
* The localized title of the template.
|
|
12
|
+
*/
|
|
13
|
+
title: string;
|
|
14
|
+
/**
|
|
15
|
+
* The localized description of the template. An array can be used for multiple paragraphs.
|
|
16
|
+
*/
|
|
17
|
+
description: string | string[];
|
|
18
|
+
/**
|
|
19
|
+
* The code snippet to render in the template with syntax highlighting. The `query` is not validated in the template.
|
|
20
|
+
*/
|
|
21
|
+
query: string;
|
|
22
|
+
/**
|
|
23
|
+
* The code snippet to insert in the segment editor. If missing, `query` will be used. The `queryToInsert` is not validated in the template.
|
|
24
|
+
*/
|
|
25
|
+
queryToInsert?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The list of customer standard metafields or custom metafields used in the template's query.
|
|
28
|
+
*/
|
|
29
|
+
dependencies?: {
|
|
30
|
+
standardMetafields?: CustomerStandardMetafieldDependency[];
|
|
31
|
+
customMetafields?: string[];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* ISO 8601-encoded date and time string. A "New" badge will be rendered for templates introduced in the last month.
|
|
35
|
+
*/
|
|
36
|
+
createdOn?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Customer segmentation templates are used to give merchants a starting point to create segments.
|
|
41
|
+
*/
|
|
42
|
+
export const CustomerSegmentTemplate = createRemoteComponent<
|
|
43
|
+
'CustomerSegmentTemplate',
|
|
44
|
+
CustomerSegmentTemplateProps
|
|
45
|
+
>('CustomerSegmentTemplate');
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {extension, CustomerSegmentTemplate} from '@shopify/ui-extensions/admin';
|
|
2
|
+
|
|
3
|
+
export default extension(
|
|
4
|
+
'admin.customers.segmentation-templates.render',
|
|
5
|
+
(root, {i18n}) => {
|
|
6
|
+
const template = root.createComponent(CustomerSegmentTemplate, {
|
|
7
|
+
title: i18n.translate('template.title'),
|
|
8
|
+
description: i18n.translate('template.description'),
|
|
9
|
+
query: "number_of_orders > 0'",
|
|
10
|
+
createdOn: new Date('2023-01-15').toISOString(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
root.appendChild(template);
|
|
14
|
+
|
|
15
|
+
root.mount();
|
|
16
|
+
},
|
|
17
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {reactExtension, CustomerSegmentTemplate} from '@shopify/ui-extensions/admin';
|
|
3
|
+
|
|
4
|
+
function App() {
|
|
5
|
+
return (
|
|
6
|
+
<CustomerSegmentTemplate
|
|
7
|
+
title="My Customer Segment Template"
|
|
8
|
+
description="Description of the segment"
|
|
9
|
+
query="number_of_orders > 0"
|
|
10
|
+
createdOn={new Date('2023-01-15').toISOString()}
|
|
11
|
+
/>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default reactExtension('Playground', () => <App />);
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'Divider',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
'Use this to create a clear visual separation between different elements in your user interface.',
|
|
8
7
|
requires: '',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'EmailField',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description: 'Use this when you need users to provide their email addresses.',
|
|
7
6
|
requires: '',
|
|
8
7
|
thumbnail: 'emailfield-thumbnail.png',
|
|
@@ -2,9 +2,8 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'Form',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
|
-
'Use this component when you want to collect input from users. It provides a structure for various input fields and controls, such as text fields, checkboxes, and buttons. It also
|
|
6
|
+
'Use this component when you want to collect input from users. It provides a structure for various input fields and controls, such as text fields, checkboxes, and buttons. It also integrates with the native Contextual Save Bar to handle form submission and reset actions.',
|
|
8
7
|
requires: '',
|
|
9
8
|
thumbnail: 'form-thumbnail.png',
|
|
10
9
|
isVisualComponent: true,
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'Heading',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
"Use this to display a title. It's similar to the h1-h6 tags in HTML",
|
|
8
7
|
requires: '',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'HeadingGroup',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
'This groups headings together, much like the hgroup element in HTML.',
|
|
8
7
|
requires: '',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'Icon',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
'This component renders an icon from a predefined list. Choose the one that suits your needs.',
|
|
8
7
|
requires: '',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'Image',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description: 'Use this when you want to display an image.',
|
|
7
6
|
requires: '',
|
|
8
7
|
thumbnail: 'image-thumbnail.png',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'InlineStack',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
"Use this to organize layout elements along the horizontal axis of the page. It's great for horizontal alignment.",
|
|
8
7
|
requires: '',
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {createRemoteComponent} from '@remote-ui/core';
|
|
2
|
+
|
|
3
|
+
export type CustomerSegmentTemplateIcon =
|
|
4
|
+
| 'categoriesMajor'
|
|
5
|
+
| 'firstVisitMajor'
|
|
6
|
+
| 'heartMajor'
|
|
7
|
+
| 'marketingMajor'
|
|
8
|
+
| 'checkoutMajor'
|
|
9
|
+
| 'ordersMajor'
|
|
10
|
+
| 'locationMajor'
|
|
11
|
+
| 'emailNewsletterMajor'
|
|
12
|
+
| 'firstOrderMajor'
|
|
13
|
+
| 'billingStatementDollarMajor'
|
|
14
|
+
| 'diamondAlertMajor'
|
|
15
|
+
| 'abandonedCartMajor'
|
|
16
|
+
| 'calendarMajor'
|
|
17
|
+
| 'productsMajor'
|
|
18
|
+
| 'globeMajor'
|
|
19
|
+
| 'flagMajor'
|
|
20
|
+
| 'uploadMajor'
|
|
21
|
+
| 'buyButtonMajor'
|
|
22
|
+
| 'followUpEmailMajor'
|
|
23
|
+
| 'confettiMajor'
|
|
24
|
+
| 'viewMajor';
|
|
25
|
+
|
|
26
|
+
export type CustomerSegmentTemplateCategory =
|
|
27
|
+
| 'firstTimeBuyers'
|
|
28
|
+
| 'highValueCustomers'
|
|
29
|
+
| 'reEngageCustomers'
|
|
30
|
+
| 'abandonedCheckout'
|
|
31
|
+
| 'purchaseBehaviour'
|
|
32
|
+
| 'location';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Reserved namespace and key for the customer standard metafield used in the template's query.
|
|
36
|
+
* More info - https://shopify.dev/docs/apps/custom-data/metafields/definitions/standard
|
|
37
|
+
*/
|
|
38
|
+
type CustomerStandardMetafieldDependency = 'facts.birth_date';
|
|
39
|
+
|
|
40
|
+
export interface InternalCustomerSegmentTemplateProps {
|
|
41
|
+
/* Localized title of the template. */
|
|
42
|
+
title: string;
|
|
43
|
+
/* Localized description(s) of the template. */
|
|
44
|
+
description: string | string[];
|
|
45
|
+
/* Icon identifier for the template. */
|
|
46
|
+
icon: CustomerSegmentTemplateIcon;
|
|
47
|
+
/* Code snippet to render in the template with syntax highlighting. */
|
|
48
|
+
query: string;
|
|
49
|
+
/* Code snippet to insert in the segment editor. If missing, `query` will be used. */
|
|
50
|
+
queryToInsert?: string;
|
|
51
|
+
/* List of customer standard metafields or custom metafields used in the template's query. */
|
|
52
|
+
dependencies?: {
|
|
53
|
+
standardMetafields?: CustomerStandardMetafieldDependency[];
|
|
54
|
+
customMetafields?: string[];
|
|
55
|
+
};
|
|
56
|
+
/* ISO 8601-encoded date and time string. A "New" badge will be rendered for recently introduced templates. */
|
|
57
|
+
createdOn?: string;
|
|
58
|
+
/* The category in which the template will be visible. The template will show in its respective category and aggregate sections. */
|
|
59
|
+
category: CustomerSegmentTemplateCategory;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Customer segment templates are used to give merchants a starting point to create segments.
|
|
64
|
+
*/
|
|
65
|
+
export const InternalCustomerSegmentTemplate = createRemoteComponent<
|
|
66
|
+
'InternalCustomerSegmentTemplate',
|
|
67
|
+
InternalCustomerSegmentTemplateProps
|
|
68
|
+
>('InternalCustomerSegmentTemplate');
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
extension,
|
|
3
|
+
InternalCustomerSegmentTemplate,
|
|
4
|
+
} from '@shopify/ui-extensions/admin';
|
|
5
|
+
|
|
6
|
+
export default extension(
|
|
7
|
+
'admin.customers.segmentation-templates.render',
|
|
8
|
+
(root, {i18n, __enabledFeatures}) => {
|
|
9
|
+
const b2bEnabled =
|
|
10
|
+
__enabledFeatures.includes('b2bEnabled');
|
|
11
|
+
const companiesTemplate = root.createComponent(
|
|
12
|
+
InternalCustomerSegmentTemplate,
|
|
13
|
+
{
|
|
14
|
+
title: i18n.translate('companies.title'),
|
|
15
|
+
description: i18n.translate('companies.description'),
|
|
16
|
+
icon: 'buyButtonMajor',
|
|
17
|
+
query: 'companies IS NOT NULL',
|
|
18
|
+
dateAdded: new Date('2023-01-15').toISOString(),
|
|
19
|
+
category: 'reEngageCustomers',
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const locationTemplate = root.createComponent(
|
|
24
|
+
InternalCustomerSegmentTemplate,
|
|
25
|
+
{
|
|
26
|
+
title: i18n.translate('location.title'),
|
|
27
|
+
description: [
|
|
28
|
+
i18n.translate('location.firstParagraph'),
|
|
29
|
+
i18n.translate('location.secondParagraph'),
|
|
30
|
+
],
|
|
31
|
+
icon: 'locationMajor',
|
|
32
|
+
query: "customer_cities CONTAINS 'US-NY-NewYorkCity'",
|
|
33
|
+
category: 'location',
|
|
34
|
+
},
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
if (b2bEnabled) {
|
|
38
|
+
root.appendChild(companiesTemplate);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
root.appendChild(locationTemplate);
|
|
42
|
+
|
|
43
|
+
root.mount();
|
|
44
|
+
},
|
|
45
|
+
);
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'Link',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
'This is an interactive component that directs users to a specified URL. It even supports custom protocols.',
|
|
8
7
|
requires: '',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'NumberField',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
'This component is specifically designed for numeric data entry.',
|
|
8
7
|
requires: '',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'PasswordField',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
'This component is for secure input, it obfuscates any text that users enter.',
|
|
8
7
|
requires: '',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'Pressable',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
'Use this component when you need to capture click or press events on its child elements without adding any additional visual styling. It subtly enhances user interaction by changing the cursor when hovering over the child elements, providing a clear indication of interactivity.',
|
|
8
7
|
requires: '',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'Select',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
'Use this when you want to give users a predefined list of options to choose from.',
|
|
8
7
|
requires: '',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'Text',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
'This component renders text. Remember, you can also add your own styling.',
|
|
8
7
|
requires: '',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'TextArea',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
'This component is perfect when you need to allow users to input larger amounts of text, such as for comments, feedback, or any other multi-line input.',
|
|
8
7
|
requires: '',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'TextField',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description:
|
|
7
6
|
'This is your go-to component when you need to let users input textual information.',
|
|
8
7
|
requires: '',
|
|
@@ -2,7 +2,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
|
|
|
2
2
|
|
|
3
3
|
const data: ReferenceEntityTemplateSchema = {
|
|
4
4
|
name: 'URLField',
|
|
5
|
-
featureFlag: 'admin_extensibility',
|
|
6
5
|
description: 'This is the right component for letting users enter a URL.',
|
|
7
6
|
requires: '',
|
|
8
7
|
thumbnail: 'urlfield-thumbnail.png',
|
|
@@ -10,8 +10,8 @@ export {Button} from './components/Button/Button';
|
|
|
10
10
|
export type {ButtonProps} from './components/Button/Button';
|
|
11
11
|
export {Checkbox} from './components/Checkbox/Checkbox';
|
|
12
12
|
export type {CheckboxProps} from './components/Checkbox/Checkbox';
|
|
13
|
-
export {
|
|
14
|
-
export type {
|
|
13
|
+
export {CustomerSegmentTemplate} from './components/CustomerSegmentTemplate/CustomerSegmentTemplate';
|
|
14
|
+
export type {CustomerSegmentTemplateProps} from './components/CustomerSegmentTemplate/CustomerSegmentTemplate';
|
|
15
15
|
export {Divider} from './components/Divider/Divider';
|
|
16
16
|
export type {DividerProps} from './components/Divider/Divider';
|
|
17
17
|
export {EmailField} from './components/EmailField/EmailField';
|
|
@@ -26,6 +26,12 @@ export {Icon} from './components/Icon/Icon';
|
|
|
26
26
|
export type {IconProps} from './components/Icon/Icon';
|
|
27
27
|
export {InlineStack} from './components/InlineStack/InlineStack';
|
|
28
28
|
export type {InlineStackProps} from './components/InlineStack/InlineStack';
|
|
29
|
+
export {InternalCustomerSegmentTemplate} from './components/InternalCustomerSegmentTemplate/InternalCustomerSegmentTemplate';
|
|
30
|
+
export type {
|
|
31
|
+
InternalCustomerSegmentTemplateProps,
|
|
32
|
+
CustomerSegmentTemplateIcon,
|
|
33
|
+
CustomerSegmentTemplateCategory,
|
|
34
|
+
} from './components/InternalCustomerSegmentTemplate/InternalCustomerSegmentTemplate';
|
|
29
35
|
export {Image} from './components/Image/Image';
|
|
30
36
|
export type {ImageProps} from './components/Image/Image';
|
|
31
37
|
export {Link} from './components/Link/Link';
|