@shopify/ui-extensions 2025.10.0-rc.37 → 2025.10.0-rc.39
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/ts/shared.d.ts +24 -4
- package/build/ts/shared.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/AdminAction.d.ts +1 -1
- package/build/ts/surfaces/admin/components/AdminBlock.d.ts +1 -1
- package/build/ts/surfaces/admin/components/AdminPrintAction.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Avatar.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Badge.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Banner.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Box.d.ts +8 -1
- package/build/ts/surfaces/admin/components/Button.d.ts +1 -1
- package/build/ts/surfaces/admin/components/ButtonGroup/ButtonGroup.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/ButtonGroup.d.ts +14 -2
- package/build/ts/surfaces/admin/components/Checkbox.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Chip.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Choice.d.ts +1 -1
- package/build/ts/surfaces/admin/components/ChoiceList.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Clickable.d.ts +8 -1
- package/build/ts/surfaces/admin/components/ClickableChip.d.ts +1 -1
- package/build/ts/surfaces/admin/components/ColorField.d.ts +3 -1
- package/build/ts/surfaces/admin/components/ColorPicker.d.ts +1 -1
- package/build/ts/surfaces/admin/components/DateField/DateField.doc.d.ts +2 -2
- package/build/ts/surfaces/admin/components/DateField/DateField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/DateField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/DatePicker.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Divider.d.ts +1 -1
- package/build/ts/surfaces/admin/components/DropZone.d.ts +1 -1
- package/build/ts/surfaces/admin/components/EmailField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Form.d.ts +1 -1
- package/build/ts/surfaces/admin/components/FunctionSettings.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Grid.d.ts +20 -1
- package/build/ts/surfaces/admin/components/GridItem.d.ts +8 -1
- package/build/ts/surfaces/admin/components/Heading.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Icon.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Image.d.ts +8 -1
- package/build/ts/surfaces/admin/components/Link.d.ts +1 -1
- package/build/ts/surfaces/admin/components/ListItem.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Menu.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Modal/Modal.ab.doc.d.ts +4 -0
- package/build/ts/surfaces/admin/components/Modal/Modal.ab.doc.d.ts.map +1 -0
- package/build/ts/surfaces/admin/components/Modal.d.ts +1 -1
- package/build/ts/surfaces/admin/components/MoneyField.d.ts +1 -3
- package/build/ts/surfaces/admin/components/NumberField.d.ts +1 -3
- package/build/ts/surfaces/admin/components/Option.d.ts +1 -1
- package/build/ts/surfaces/admin/components/OptionGroup.d.ts +1 -1
- package/build/ts/surfaces/admin/components/OrderedList.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Page.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Paragraph.d.ts +1 -1
- package/build/ts/surfaces/admin/components/PasswordField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/QueryContainer.d.ts +1 -1
- package/build/ts/surfaces/admin/components/SearchField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Section.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Select.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Spinner.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Stack.d.ts +14 -1
- package/build/ts/surfaces/admin/components/Switch.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Table.d.ts +3 -2
- package/build/ts/surfaces/admin/components/TableBody.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TableCell.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TableHeader.d.ts +3 -2
- package/build/ts/surfaces/admin/components/TableHeaderRow.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TableRow.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Text.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TextArea.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TextField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Thumbnail.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Tooltip.d.ts +1 -1
- package/build/ts/surfaces/admin/components/URLField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/UnorderedList.d.ts +1 -1
- package/build/ts/surfaces/admin/components/patterns/indexTable.ab.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/shared.d.ts +245 -222
- package/build/ts/surfaces/admin/docs-types.d.ts +4 -0
- package/build/ts/surfaces/admin/docs-types.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/api/cart-line/cart-line-item.d.ts +2 -2
- package/build/ts/surfaces/customer-account/api/cart-line/cart-line-item.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/api/order-status/order-status.d.ts +29 -29
- package/build/ts/surfaces/customer-account/api/order-status/order-status.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/api/shared.d.ts +6 -6
- package/build/ts/surfaces/customer-account/api/shared.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/api/standard-api/standard-api.d.ts +6 -6
- package/build/ts/surfaces/customer-account/api/standard-api/standard-api.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/ts/surfaces/customer-account/preact/subscription.d.ts +2 -2
- package/build/ts/surfaces/customer-account/preact/subscription.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/Badge.d.ts +1 -1
- package/build/ts/surfaces/point-of-sale/components/Box.d.ts +82 -8
- package/build/ts/surfaces/point-of-sale/components/Icon.d.ts +111 -30
- package/build/ts/surfaces/point-of-sale/components/PosBlock/PosBlock.doc.d.ts +4 -0
- package/build/ts/surfaces/point-of-sale/components/PosBlock/PosBlock.doc.d.ts.map +1 -0
- package/build/ts/surfaces/point-of-sale/components/PosBlock.d.ts +64 -0
- package/build/ts/surfaces/point-of-sale/components/SearchField.d.ts +1 -4
- package/build/ts/surfaces/point-of-sale/components/Stack.d.ts +82 -8
- package/build/ts/surfaces/point-of-sale/components/Tile.d.ts +1 -38
- package/build/ts/surfaces/point-of-sale/components/TimeField/TimeField.doc.d.ts +4 -0
- package/build/ts/surfaces/point-of-sale/components/TimeField/TimeField.doc.d.ts.map +1 -0
- package/build/ts/surfaces/point-of-sale/components/TimeField.d.ts +65 -0
- package/build/ts/surfaces/point-of-sale/components/components-shared.d.ts +321 -150
- package/build/ts/surfaces/point-of-sale/targets/pos.cart.line-item-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.customer-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.customer-details.block.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.draft-order-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.draft-order-details.block.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.exchange.post.action.render.d.ts +2 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.exchange.post.block.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.home.modal.render.d.ts +2 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.order-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.order-details.block.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.product-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.product-details.block.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.purchase.post.action.render.d.ts +2 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.purchase.post.block.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.return.post.action.render.d.ts +2 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.return.post.block.render.d.ts +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/docs/shared/components/Modal.ts +1 -1
- package/src/shared.ts +25 -4
- package/src/surfaces/admin/components/AdminAction.d.ts +1 -1
- package/src/surfaces/admin/components/AdminBlock.d.ts +1 -1
- package/src/surfaces/admin/components/AdminPrintAction.d.ts +1 -1
- package/src/surfaces/admin/components/Avatar.d.ts +1 -1
- package/src/surfaces/admin/components/Badge.d.ts +1 -1
- package/src/surfaces/admin/components/Banner.d.ts +1 -1
- package/src/surfaces/admin/components/Box.d.ts +8 -1
- package/src/surfaces/admin/components/Button.d.ts +1 -1
- package/src/surfaces/admin/components/ButtonGroup/examples/default.html +2 -2
- package/src/surfaces/admin/components/ButtonGroup.d.ts +14 -2
- package/src/surfaces/admin/components/Checkbox.d.ts +1 -1
- package/src/surfaces/admin/components/Chip.d.ts +1 -1
- package/src/surfaces/admin/components/Choice.d.ts +1 -1
- package/src/surfaces/admin/components/ChoiceList.d.ts +1 -1
- package/src/surfaces/admin/components/Clickable.d.ts +8 -1
- package/src/surfaces/admin/components/ClickableChip.d.ts +1 -1
- package/src/surfaces/admin/components/ColorField.d.ts +3 -1
- package/src/surfaces/admin/components/ColorPicker.d.ts +1 -1
- package/src/surfaces/admin/components/DateField.d.ts +1 -1
- package/src/surfaces/admin/components/DatePicker.d.ts +1 -1
- package/src/surfaces/admin/components/Divider.d.ts +1 -1
- package/src/surfaces/admin/components/DropZone.d.ts +1 -1
- package/src/surfaces/admin/components/EmailField.d.ts +1 -1
- package/src/surfaces/admin/components/Form.d.ts +1 -1
- package/src/surfaces/admin/components/FunctionSettings.d.ts +1 -1
- package/src/surfaces/admin/components/Grid.d.ts +20 -1
- package/src/surfaces/admin/components/GridItem.d.ts +8 -1
- package/src/surfaces/admin/components/Heading.d.ts +1 -1
- package/src/surfaces/admin/components/Icon.d.ts +1 -1
- package/src/surfaces/admin/components/Image.d.ts +8 -1
- package/src/surfaces/admin/components/Link.d.ts +1 -1
- package/src/surfaces/admin/components/ListItem.d.ts +1 -1
- package/src/surfaces/admin/components/Menu.d.ts +1 -1
- package/src/surfaces/admin/components/Modal/examples/default.html +23 -0
- package/src/surfaces/admin/components/Modal.d.ts +1 -1
- package/src/surfaces/admin/components/MoneyField.d.ts +1 -3
- package/src/surfaces/admin/components/NumberField.d.ts +1 -3
- package/src/surfaces/admin/components/Option.d.ts +1 -1
- package/src/surfaces/admin/components/OptionGroup.d.ts +1 -1
- package/src/surfaces/admin/components/OrderedList.d.ts +1 -1
- package/src/surfaces/admin/components/Page.d.ts +1 -1
- package/src/surfaces/admin/components/Paragraph.d.ts +1 -1
- package/src/surfaces/admin/components/PasswordField.d.ts +1 -1
- package/src/surfaces/admin/components/QueryContainer.d.ts +1 -1
- package/src/surfaces/admin/components/SearchField.d.ts +1 -1
- package/src/surfaces/admin/components/Section.d.ts +1 -1
- package/src/surfaces/admin/components/Select.d.ts +1 -1
- package/src/surfaces/admin/components/Spinner.d.ts +1 -1
- package/src/surfaces/admin/components/Stack.d.ts +14 -1
- package/src/surfaces/admin/components/Switch.d.ts +1 -1
- package/src/surfaces/admin/components/Table.d.ts +3 -2
- package/src/surfaces/admin/components/TableBody.d.ts +1 -1
- package/src/surfaces/admin/components/TableCell.d.ts +1 -1
- package/src/surfaces/admin/components/TableHeader.d.ts +3 -2
- package/src/surfaces/admin/components/TableHeaderRow.d.ts +1 -1
- package/src/surfaces/admin/components/TableRow.d.ts +1 -1
- package/src/surfaces/admin/components/Text.d.ts +1 -1
- package/src/surfaces/admin/components/TextArea.d.ts +1 -1
- package/src/surfaces/admin/components/TextField.d.ts +1 -1
- package/src/surfaces/admin/components/Thumbnail.d.ts +1 -1
- package/src/surfaces/admin/components/Tooltip.d.ts +1 -1
- package/src/surfaces/admin/components/URLField.d.ts +1 -1
- package/src/surfaces/admin/components/UnorderedList.d.ts +1 -1
- package/src/surfaces/admin/components/patterns/examples/calloutCard.html +2 -2
- package/src/surfaces/admin/components/patterns/examples/details.html +5 -11
- package/src/surfaces/admin/components/patterns/examples/details.jsx +4 -13
- package/src/surfaces/admin/components/patterns/examples/emptyState.html +2 -2
- package/src/surfaces/admin/components/patterns/examples/homepage.html +5 -14
- package/src/surfaces/admin/components/patterns/examples/homepage.jsx +7 -16
- package/src/surfaces/admin/components/patterns/examples/index.html +6 -12
- package/src/surfaces/admin/components/patterns/examples/index.jsx +6 -13
- package/src/surfaces/admin/components/patterns/examples/indexTable.html +4 -9
- package/src/surfaces/admin/components/patterns/examples/mediaCard.html +1 -1
- package/src/surfaces/admin/components/patterns/examples/settings.html +1 -2
- package/src/surfaces/admin/components/patterns/examples/settings.jsx +2 -6
- package/src/surfaces/admin/components/shared.d.ts +245 -222
- package/src/surfaces/admin/components.d.ts +293 -228
- package/src/surfaces/admin/docs-types.ts +8 -1
- package/src/surfaces/customer-account/api/cart-line/cart-line-item.ts +2 -2
- package/src/surfaces/customer-account/api/order-status/order-status.ts +29 -29
- package/src/surfaces/customer-account/api/shared.ts +6 -6
- package/src/surfaces/customer-account/api/standard-api/standard-api.ts +6 -6
- package/src/surfaces/customer-account/api.ts +1 -1
- package/src/surfaces/customer-account/preact/subscription.ts +3 -3
- package/src/surfaces/point-of-sale/components/Badge.d.ts +1 -1
- package/src/surfaces/point-of-sale/components/Box.d.ts +82 -8
- package/src/surfaces/point-of-sale/components/Icon.d.ts +111 -30
- package/src/surfaces/point-of-sale/components/PosBlock/examples/default.html +11 -0
- package/src/surfaces/point-of-sale/components/PosBlock.d.ts +64 -0
- package/src/surfaces/point-of-sale/components/SearchField.d.ts +1 -4
- package/src/surfaces/point-of-sale/components/Stack.d.ts +82 -8
- package/src/surfaces/point-of-sale/components/Tile.d.ts +1 -38
- package/src/surfaces/point-of-sale/components/TimeField/examples/default.html +12 -0
- package/src/surfaces/point-of-sale/components/TimeField.d.ts +65 -0
- package/src/surfaces/point-of-sale/components/components-shared.d.ts +321 -150
- package/src/surfaces/point-of-sale/components.d.ts +1041 -530
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import type {CSSProperties} from 'react';
|
|
1
2
|
import {
|
|
2
3
|
ReferenceEntityTemplateSchema,
|
|
3
4
|
CodeTabType,
|
|
4
5
|
} from '@shopify/generate-docs';
|
|
5
6
|
|
|
7
|
+
// Don't allow all CSS properties to be used in the customStyles property
|
|
8
|
+
type AllowedCSSProperties = Pick<CSSProperties, 'minHeight' | 'minBlockSize'>;
|
|
9
|
+
|
|
6
10
|
export interface AdminReferenceEntityTemplateSchema
|
|
7
11
|
extends Omit<ReferenceEntityTemplateSchema, 'defaultExample'> {
|
|
8
12
|
defaultExample?: Omit<
|
|
@@ -11,7 +15,10 @@ export interface AdminReferenceEntityTemplateSchema
|
|
|
11
15
|
> & {
|
|
12
16
|
codeblock?: {
|
|
13
17
|
title: string;
|
|
14
|
-
tabs: (CodeTabType & {
|
|
18
|
+
tabs: (CodeTabType & {
|
|
19
|
+
layout?: string;
|
|
20
|
+
customStyles?: AllowedCSSProperties;
|
|
21
|
+
})[];
|
|
15
22
|
};
|
|
16
23
|
};
|
|
17
24
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {CartLine} from '../order-status/order-status';
|
|
2
|
-
import {
|
|
2
|
+
import {SubscribableSignalLike} from '../shared';
|
|
3
3
|
|
|
4
4
|
export interface CartLineItemApi {
|
|
5
5
|
/**
|
|
6
6
|
* The cart line the extension is attached to.
|
|
7
7
|
*/
|
|
8
|
-
target:
|
|
8
|
+
target: SubscribableSignalLike<CartLine>;
|
|
9
9
|
}
|
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
Attribute,
|
|
7
7
|
MailingAddress,
|
|
8
8
|
Language,
|
|
9
|
-
|
|
9
|
+
SubscribableSignalLike,
|
|
10
10
|
} from '../shared';
|
|
11
11
|
import type {ExtensionTarget} from '../../extension-targets';
|
|
12
12
|
import {Extension} from '../shared';
|
|
@@ -137,17 +137,17 @@ export interface OrderStatusLocalization {
|
|
|
137
137
|
/**
|
|
138
138
|
* The currency that the buyer sees for money amounts in the checkout.
|
|
139
139
|
*/
|
|
140
|
-
currency:
|
|
140
|
+
currency: SubscribableSignalLike<Currency>;
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
143
|
* The buyer’s time zone.
|
|
144
144
|
*/
|
|
145
|
-
timezone:
|
|
145
|
+
timezone: SubscribableSignalLike<Timezone>;
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* The language the buyer sees in the checkout.
|
|
149
149
|
*/
|
|
150
|
-
language:
|
|
150
|
+
language: SubscribableSignalLike<Language>;
|
|
151
151
|
|
|
152
152
|
/**
|
|
153
153
|
* This is the buyer's language, as supported by the extension.
|
|
@@ -160,7 +160,7 @@ export interface OrderStatusLocalization {
|
|
|
160
160
|
* translations at all, this value is the default locale for your
|
|
161
161
|
* extension (that is, the one matching your .default.json file).
|
|
162
162
|
*/
|
|
163
|
-
extensionLanguage:
|
|
163
|
+
extensionLanguage: SubscribableSignalLike<Language>;
|
|
164
164
|
|
|
165
165
|
/**
|
|
166
166
|
* The country context of the checkout. This value carries over from the
|
|
@@ -168,7 +168,7 @@ export interface OrderStatusLocalization {
|
|
|
168
168
|
* experience. It will update if the buyer changes the country of their
|
|
169
169
|
* shipping address. The value is undefined if unknown.
|
|
170
170
|
*/
|
|
171
|
-
country:
|
|
171
|
+
country: SubscribableSignalLike<Country | undefined>;
|
|
172
172
|
|
|
173
173
|
/**
|
|
174
174
|
* The [market](https://shopify.dev/docs/apps/markets) context of the
|
|
@@ -177,7 +177,7 @@ export interface OrderStatusLocalization {
|
|
|
177
177
|
* buyer changes the country of their shipping address. The value is undefined
|
|
178
178
|
* if unknown.
|
|
179
179
|
*/
|
|
180
|
-
market:
|
|
180
|
+
market: SubscribableSignalLike<Market | undefined>;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
export type AuthenticationState = 'fully_authenticated' | 'pre_authenticated';
|
|
@@ -186,7 +186,7 @@ export interface OrderStatusApi<Target extends ExtensionTarget> {
|
|
|
186
186
|
/**
|
|
187
187
|
* Gift Cards that have been applied to the order.
|
|
188
188
|
*/
|
|
189
|
-
appliedGiftCards:
|
|
189
|
+
appliedGiftCards: SubscribableSignalLike<AppliedGiftCard[]>;
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
192
|
* The metafields requested in the
|
|
@@ -196,12 +196,12 @@ export interface OrderStatusApi<Target extends ExtensionTarget> {
|
|
|
196
196
|
*
|
|
197
197
|
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
198
198
|
*/
|
|
199
|
-
appMetafields:
|
|
199
|
+
appMetafields: SubscribableSignalLike<AppMetafieldEntry[]>;
|
|
200
200
|
|
|
201
201
|
/**
|
|
202
202
|
* Custom attributes left by the customer to the merchant, either in their cart or during checkout.
|
|
203
203
|
*/
|
|
204
|
-
attributes:
|
|
204
|
+
attributes: SubscribableSignalLike<Attribute[] | undefined>;
|
|
205
205
|
|
|
206
206
|
/**
|
|
207
207
|
* Information about the buyer that is interacting with the order.
|
|
@@ -213,7 +213,7 @@ export interface OrderStatusApi<Target extends ExtensionTarget> {
|
|
|
213
213
|
/**
|
|
214
214
|
* Settings applied to the buyer's checkout.
|
|
215
215
|
*/
|
|
216
|
-
checkoutSettings:
|
|
216
|
+
checkoutSettings: SubscribableSignalLike<CheckoutSettings>;
|
|
217
217
|
|
|
218
218
|
/**
|
|
219
219
|
* Details on the costs of the purchase for the buyer.
|
|
@@ -223,12 +223,12 @@ export interface OrderStatusApi<Target extends ExtensionTarget> {
|
|
|
223
223
|
/**
|
|
224
224
|
* A list of discount codes applied to the purchase.
|
|
225
225
|
*/
|
|
226
|
-
discountCodes:
|
|
226
|
+
discountCodes: SubscribableSignalLike<CartDiscountCode[]>;
|
|
227
227
|
|
|
228
228
|
/**
|
|
229
229
|
* Discounts that have been applied to the entire cart.
|
|
230
230
|
*/
|
|
231
|
-
discountAllocations:
|
|
231
|
+
discountAllocations: SubscribableSignalLike<CartDiscountAllocation[]>;
|
|
232
232
|
|
|
233
233
|
/**
|
|
234
234
|
* Meta information about the extension.
|
|
@@ -251,7 +251,7 @@ export interface OrderStatusApi<Target extends ExtensionTarget> {
|
|
|
251
251
|
/**
|
|
252
252
|
* A list of lines containing information about the items the customer intends to purchase.
|
|
253
253
|
*/
|
|
254
|
-
lines:
|
|
254
|
+
lines: SubscribableSignalLike<CartLine[]>;
|
|
255
255
|
|
|
256
256
|
/**
|
|
257
257
|
* Details about the location, language, and currency of the buyer. For utilities to easily
|
|
@@ -281,17 +281,17 @@ export interface OrderStatusApi<Target extends ExtensionTarget> {
|
|
|
281
281
|
* Once the order is created, you can query these metafields using the
|
|
282
282
|
* [GraphQL Admin API](https://shopify.dev/docs/admin-api/graphql/reference/orders/order#metafield-2021-01)
|
|
283
283
|
*/
|
|
284
|
-
metafields:
|
|
284
|
+
metafields: SubscribableSignalLike<Metafield[]>;
|
|
285
285
|
|
|
286
286
|
/**
|
|
287
287
|
* A note left by the customer to the merchant, either in their cart or during checkout.
|
|
288
288
|
*/
|
|
289
|
-
note:
|
|
289
|
+
note: SubscribableSignalLike<string | undefined>;
|
|
290
290
|
|
|
291
291
|
/**
|
|
292
292
|
* Information about the order that was placed.
|
|
293
293
|
*/
|
|
294
|
-
order:
|
|
294
|
+
order: SubscribableSignalLike<Order | undefined>;
|
|
295
295
|
|
|
296
296
|
/**
|
|
297
297
|
* id that represents the checkout used to create the order.
|
|
@@ -299,21 +299,21 @@ export interface OrderStatusApi<Target extends ExtensionTarget> {
|
|
|
299
299
|
* Matches the `token` field in the [WebPixel checkout payload](https://shopify.dev/docs/api/pixels/customer-events#checkout)
|
|
300
300
|
* and the `checkout_token` field in the [Admin REST API Order resource](https://shopify.dev/docs/api/admin-rest/unstable/resources/order#resource-object).
|
|
301
301
|
*/
|
|
302
|
-
checkoutToken:
|
|
302
|
+
checkoutToken: SubscribableSignalLike<CheckoutToken | undefined>;
|
|
303
303
|
|
|
304
304
|
/**
|
|
305
305
|
* The buyer shipping address used for the order.
|
|
306
306
|
*
|
|
307
307
|
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
308
308
|
*/
|
|
309
|
-
shippingAddress?:
|
|
309
|
+
shippingAddress?: SubscribableSignalLike<MailingAddress | undefined>;
|
|
310
310
|
|
|
311
311
|
/**
|
|
312
312
|
* The buyer billing address used for the order.
|
|
313
313
|
*
|
|
314
314
|
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
315
315
|
*/
|
|
316
|
-
billingAddress?:
|
|
316
|
+
billingAddress?: SubscribableSignalLike<MailingAddress | undefined>;
|
|
317
317
|
|
|
318
318
|
/** Shop where the purchase took place. */
|
|
319
319
|
shop: Shop;
|
|
@@ -333,7 +333,7 @@ export interface OrderStatusApi<Target extends ExtensionTarget> {
|
|
|
333
333
|
/**
|
|
334
334
|
* The authentication state of Order status page.
|
|
335
335
|
*/
|
|
336
|
-
authenticationState:
|
|
336
|
+
authenticationState: SubscribableSignalLike<AuthenticationState>;
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
export interface OrderStatusBuyerIdentity {
|
|
@@ -343,7 +343,7 @@ export interface OrderStatusBuyerIdentity {
|
|
|
343
343
|
*
|
|
344
344
|
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
345
345
|
*/
|
|
346
|
-
customer:
|
|
346
|
+
customer: SubscribableSignalLike<OrderStatusCustomer | undefined>;
|
|
347
347
|
|
|
348
348
|
/**
|
|
349
349
|
* The email address of the buyer that is interacting with the cart.
|
|
@@ -351,7 +351,7 @@ export interface OrderStatusBuyerIdentity {
|
|
|
351
351
|
*
|
|
352
352
|
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
353
353
|
*/
|
|
354
|
-
email:
|
|
354
|
+
email: SubscribableSignalLike<string | undefined>;
|
|
355
355
|
|
|
356
356
|
/**
|
|
357
357
|
* The phone number of the buyer that is interacting with the cart.
|
|
@@ -359,7 +359,7 @@ export interface OrderStatusBuyerIdentity {
|
|
|
359
359
|
*
|
|
360
360
|
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
361
361
|
*/
|
|
362
|
-
phone:
|
|
362
|
+
phone: SubscribableSignalLike<string | undefined>;
|
|
363
363
|
|
|
364
364
|
/**
|
|
365
365
|
* Provides details of the company and the company location that the business customer is purchasing on behalf of.
|
|
@@ -368,7 +368,7 @@ export interface OrderStatusBuyerIdentity {
|
|
|
368
368
|
*
|
|
369
369
|
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
370
370
|
*/
|
|
371
|
-
purchasingCompany:
|
|
371
|
+
purchasingCompany: SubscribableSignalLike<
|
|
372
372
|
OrderStatusPurchasingCompany | undefined
|
|
373
373
|
>;
|
|
374
374
|
}
|
|
@@ -479,28 +479,28 @@ export interface CartCost {
|
|
|
479
479
|
* A `Money` value representing the subtotal value of the items in the cart at the current
|
|
480
480
|
* step of checkout.
|
|
481
481
|
*/
|
|
482
|
-
subtotalAmount:
|
|
482
|
+
subtotalAmount: SubscribableSignalLike<Money>;
|
|
483
483
|
|
|
484
484
|
/**
|
|
485
485
|
* A `Money` value representing the total shipping a buyer can expect to pay at the current
|
|
486
486
|
* step of checkout. This value includes shipping discounts. Returns undefined if shipping
|
|
487
487
|
* has not been negotiated yet, such as on the information step.
|
|
488
488
|
*/
|
|
489
|
-
totalShippingAmount:
|
|
489
|
+
totalShippingAmount: SubscribableSignalLike<Money | undefined>;
|
|
490
490
|
|
|
491
491
|
/**
|
|
492
492
|
* A `Money` value representing the total tax a buyer can expect to pay at the current
|
|
493
493
|
* step of checkout or the total tax included in product and shipping prices. Returns
|
|
494
494
|
* undefined if taxes are unavailable.
|
|
495
495
|
*/
|
|
496
|
-
totalTaxAmount:
|
|
496
|
+
totalTaxAmount: SubscribableSignalLike<Money | undefined>;
|
|
497
497
|
|
|
498
498
|
/**
|
|
499
499
|
* A `Money` value representing the minimum a buyer can expect to pay at the current
|
|
500
500
|
* step of checkout. This value excludes amounts yet to be negotiated. For example,
|
|
501
501
|
* the information step might not have delivery costs calculated.
|
|
502
502
|
*/
|
|
503
|
-
totalAmount:
|
|
503
|
+
totalAmount: SubscribableSignalLike<Money>;
|
|
504
504
|
}
|
|
505
505
|
|
|
506
506
|
export interface CartLine {
|
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
CountryCode,
|
|
10
10
|
GraphQLError,
|
|
11
11
|
StorefrontApiVersion,
|
|
12
|
-
|
|
12
|
+
SubscribableSignalLike,
|
|
13
13
|
} from '../../../shared';
|
|
14
14
|
|
|
15
15
|
export {
|
|
@@ -21,7 +21,7 @@ export {
|
|
|
21
21
|
CountryCode,
|
|
22
22
|
GraphQLError,
|
|
23
23
|
StorefrontApiVersion,
|
|
24
|
-
|
|
24
|
+
SubscribableSignalLike,
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -163,7 +163,7 @@ export interface Extension<Target extends ExtensionTarget = ExtensionTarget> {
|
|
|
163
163
|
*
|
|
164
164
|
* * [`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.
|
|
165
165
|
*/
|
|
166
|
-
capabilities:
|
|
166
|
+
capabilities: SubscribableSignalLike<Capability[]>;
|
|
167
167
|
|
|
168
168
|
/**
|
|
169
169
|
* Information about the editor where the extension is being rendered.
|
|
@@ -183,7 +183,7 @@ export interface Extension<Target extends ExtensionTarget = ExtensionTarget> {
|
|
|
183
183
|
* from where it was rendered. The extension continues running so that
|
|
184
184
|
* your extension is immediately available to render if the buyer navigates back.
|
|
185
185
|
*/
|
|
186
|
-
rendered:
|
|
186
|
+
rendered: SubscribableSignalLike<boolean>;
|
|
187
187
|
|
|
188
188
|
/**
|
|
189
189
|
* The URL to the script that started the extension target.
|
|
@@ -346,11 +346,11 @@ export interface AuthenticatedAccount {
|
|
|
346
346
|
* Provides the company info of the authenticated business customer.
|
|
347
347
|
* If the customer is not authenticated or is not a business customer, this value is `undefined`.
|
|
348
348
|
*/
|
|
349
|
-
purchasingCompany:
|
|
349
|
+
purchasingCompany: SubscribableSignalLike<PurchasingCompany | undefined>;
|
|
350
350
|
/**
|
|
351
351
|
* Provides the customer information of the authenticated customer.
|
|
352
352
|
*/
|
|
353
|
-
customer:
|
|
353
|
+
customer: SubscribableSignalLike<Customer | undefined>;
|
|
354
354
|
}
|
|
355
355
|
|
|
356
356
|
/**
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
CustomerPrivacy,
|
|
13
13
|
ApplyTrackingConsentChangeType,
|
|
14
14
|
ToastApi,
|
|
15
|
-
|
|
15
|
+
SubscribableSignalLike,
|
|
16
16
|
} from '../shared';
|
|
17
17
|
|
|
18
18
|
import type {ExtensionTarget} from '../../extension-targets';
|
|
@@ -96,7 +96,7 @@ export interface StandardApi<Target extends ExtensionTarget = ExtensionTarget> {
|
|
|
96
96
|
* > Note: When an extension is being installed in the editor, the settings will be empty until
|
|
97
97
|
* a merchant sets a value. In that case, this object will be updated in real time as a merchant fills in the settings.
|
|
98
98
|
*/
|
|
99
|
-
settings:
|
|
99
|
+
settings: SubscribableSignalLike<ExtensionSettings>;
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* The Toast API displays a non-disruptive message that displays at the bottom
|
|
@@ -128,7 +128,7 @@ export interface StandardApi<Target extends ExtensionTarget = ExtensionTarget> {
|
|
|
128
128
|
/**
|
|
129
129
|
* Customer privacy consent settings and a flag denoting if consent has previously been collected.
|
|
130
130
|
*/
|
|
131
|
-
customerPrivacy:
|
|
131
|
+
customerPrivacy: SubscribableSignalLike<CustomerPrivacy>;
|
|
132
132
|
|
|
133
133
|
/**
|
|
134
134
|
* Allows setting and updating customer privacy consent settings and tracking consent metafields.
|
|
@@ -166,7 +166,7 @@ export interface Localization {
|
|
|
166
166
|
/**
|
|
167
167
|
* The language the buyer sees in the customer account hub.
|
|
168
168
|
*/
|
|
169
|
-
language:
|
|
169
|
+
language: SubscribableSignalLike<Language>;
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
172
|
* This is the buyer's language, as supported by the extension.
|
|
@@ -179,14 +179,14 @@ export interface Localization {
|
|
|
179
179
|
* translations at all, this value is the default locale for your
|
|
180
180
|
* extension (that is, the one matching your .default.json file).
|
|
181
181
|
*/
|
|
182
|
-
extensionLanguage:
|
|
182
|
+
extensionLanguage: SubscribableSignalLike<Language>;
|
|
183
183
|
|
|
184
184
|
/**
|
|
185
185
|
* The country context of the buyer sees in the customer account.
|
|
186
186
|
* It will update if the buyer changes the country in the customer account
|
|
187
187
|
* If the country is unknown, then the value is undefined.
|
|
188
188
|
*/
|
|
189
|
-
country:
|
|
189
|
+
country: SubscribableSignalLike<Country | undefined>;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {useEffect, useState} from 'preact/hooks';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {SubscribableSignalLike} from '../api/shared';
|
|
4
4
|
|
|
5
|
-
type Subscriber<T> = Parameters<
|
|
5
|
+
type Subscriber<T> = Parameters<SubscribableSignalLike<T>['subscribe']>[0];
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Subscribes to the special wrapper type that all “changeable” values in the
|
|
@@ -14,7 +14,7 @@ type Subscriber<T> = Parameters<ReadonlySignalLike<T>['subscribe']>[0];
|
|
|
14
14
|
* > for accessing the current value of each individual resource in the checkout.
|
|
15
15
|
*/
|
|
16
16
|
export function useSubscription<Value>(
|
|
17
|
-
subscription:
|
|
17
|
+
subscription: SubscribableSignalLike<Value>,
|
|
18
18
|
): Value {
|
|
19
19
|
const [, setValue] = useState(subscription.value);
|
|
20
20
|
|
|
@@ -31,7 +31,7 @@ declare const tagName = 's-badge';
|
|
|
31
31
|
export interface BadgeJSXProps extends Pick<BadgeProps, 'id'> {
|
|
32
32
|
tone?: Extract<
|
|
33
33
|
BadgeProps['tone'],
|
|
34
|
-
'auto' | 'neutral' | 'info' | 'success' | 'warning' | 'critical'
|
|
34
|
+
'auto' | 'neutral' | 'info' | 'success' | 'warning' | 'critical' | 'caution'
|
|
35
35
|
>;
|
|
36
36
|
children?: ComponentChildren;
|
|
37
37
|
}
|
|
@@ -8,7 +8,14 @@
|
|
|
8
8
|
/* eslint-disable import-x/namespace */
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/triple-slash-reference, spaced-comment
|
|
10
10
|
/// <reference lib="DOM" />
|
|
11
|
-
import type {
|
|
11
|
+
import type {
|
|
12
|
+
BoxProps,
|
|
13
|
+
SizeKeyword,
|
|
14
|
+
MaybeAllValuesShorthandProperty,
|
|
15
|
+
MaybeTwoValuesShorthandProperty,
|
|
16
|
+
Key,
|
|
17
|
+
Ref,
|
|
18
|
+
} from './components-shared.d.ts';
|
|
12
19
|
|
|
13
20
|
export type ComponentChildren = any;
|
|
14
21
|
/**
|
|
@@ -28,16 +35,10 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement>
|
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
declare const tagName = 's-box';
|
|
38
|
+
export type PaddingKeyword = SizeKeyword | 'none';
|
|
31
39
|
export interface BoxJSXProps
|
|
32
40
|
extends Pick<
|
|
33
41
|
BoxProps,
|
|
34
|
-
| 'padding'
|
|
35
|
-
| 'paddingBlock'
|
|
36
|
-
| 'paddingBlockStart'
|
|
37
|
-
| 'paddingBlockEnd'
|
|
38
|
-
| 'paddingInline'
|
|
39
|
-
| 'paddingInlineStart'
|
|
40
|
-
| 'paddingInlineEnd'
|
|
41
42
|
| 'blockSize'
|
|
42
43
|
| 'minBlockSize'
|
|
43
44
|
| 'maxBlockSize'
|
|
@@ -45,6 +46,79 @@ export interface BoxJSXProps
|
|
|
45
46
|
| 'minInlineSize'
|
|
46
47
|
| 'maxInlineSize'
|
|
47
48
|
> {
|
|
49
|
+
/**
|
|
50
|
+
* Adjust the padding of all edges.
|
|
51
|
+
*
|
|
52
|
+
* [1-to-4-value syntax](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties#edges_of_a_box) is
|
|
53
|
+
* supported. Note that, contrary to the CSS, it uses flow-relative values and the order is:
|
|
54
|
+
*
|
|
55
|
+
* - 4 values: `block-start inline-end block-end inline-start`
|
|
56
|
+
* - 3 values: `block-start inline block-end`
|
|
57
|
+
* - 2 values: `block inline`
|
|
58
|
+
*
|
|
59
|
+
* For example:
|
|
60
|
+
* - `large` means block-start, inline-end, block-end and inline-start paddings are `large`.
|
|
61
|
+
* - `large none` means block-start and block-end paddings are `large`, inline-start and inline-end paddings are `none`.
|
|
62
|
+
* - `large none large` means block-start padding is `large`, inline-end padding is `none`, block-end padding is `large` and inline-start padding is `none`.
|
|
63
|
+
* - `large none large small` means block-start padding is `large`, inline-end padding is `none`, block-end padding is `large` and inline-start padding is `small`.
|
|
64
|
+
*
|
|
65
|
+
* A padding value of `auto` will use the default padding for the closest container that has had its usual padding removed.
|
|
66
|
+
*
|
|
67
|
+
* @default 'none'
|
|
68
|
+
*/
|
|
69
|
+
padding?: MaybeAllValuesShorthandProperty<PaddingKeyword>;
|
|
70
|
+
/**
|
|
71
|
+
* Adjust the block-padding.
|
|
72
|
+
*
|
|
73
|
+
* - `large none` means block-start padding is `large`, block-end padding is `none`.
|
|
74
|
+
*
|
|
75
|
+
* This overrides the block value of `padding`.
|
|
76
|
+
*
|
|
77
|
+
* @default '' - meaning no override
|
|
78
|
+
*/
|
|
79
|
+
paddingBlock?: MaybeTwoValuesShorthandProperty<PaddingKeyword | ''>;
|
|
80
|
+
/**
|
|
81
|
+
* Adjust the block-start padding.
|
|
82
|
+
*
|
|
83
|
+
* This overrides the block-start value of `paddingBlock`.
|
|
84
|
+
*
|
|
85
|
+
* @default '' - meaning no override
|
|
86
|
+
*/
|
|
87
|
+
paddingBlockStart?: PaddingKeyword | '';
|
|
88
|
+
/**
|
|
89
|
+
* Adjust the block-end padding.
|
|
90
|
+
*
|
|
91
|
+
* This overrides the block-end value of `paddingBlock`.
|
|
92
|
+
*
|
|
93
|
+
* @default '' - meaning no override
|
|
94
|
+
*/
|
|
95
|
+
paddingBlockEnd?: PaddingKeyword | '';
|
|
96
|
+
/**
|
|
97
|
+
* Adjust the inline padding.
|
|
98
|
+
*
|
|
99
|
+
* - `large none` means inline-start padding is `large`, inline-end padding is `none`.
|
|
100
|
+
*
|
|
101
|
+
* This overrides the inline value of `padding`.
|
|
102
|
+
*
|
|
103
|
+
* @default '' - meaning no override
|
|
104
|
+
*/
|
|
105
|
+
paddingInline?: MaybeTwoValuesShorthandProperty<PaddingKeyword | ''>;
|
|
106
|
+
/**
|
|
107
|
+
* Adjust the inline-start padding.
|
|
108
|
+
*
|
|
109
|
+
* This overrides the inline-start value of `paddingInline`.
|
|
110
|
+
*
|
|
111
|
+
* @default '' - meaning no override
|
|
112
|
+
*/
|
|
113
|
+
paddingInlineStart?: PaddingKeyword | '';
|
|
114
|
+
/**
|
|
115
|
+
* Adjust the inline-end padding.
|
|
116
|
+
*
|
|
117
|
+
* This overrides the inline-end value of `paddingInline`.
|
|
118
|
+
*
|
|
119
|
+
* @default '' - meaning no override
|
|
120
|
+
*/
|
|
121
|
+
paddingInlineEnd?: PaddingKeyword | '';
|
|
48
122
|
children?: ComponentChildren;
|
|
49
123
|
}
|
|
50
124
|
declare global {
|