@shopify/ui-extensions 2025.7.1 → 2025.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ts/surfaces/checkout/api/announcement/announcement.d.ts +20 -6
- package/build/ts/surfaces/checkout/api/announcement/announcement.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/api/checkout/checkout.d.ts +2 -2
- package/build/ts/surfaces/checkout/targets.d.ts +2 -2
- package/build/ts/surfaces/checkout/targets.d.ts.map +1 -1
- package/build/ts/surfaces/checkout.d.ts +1 -1
- package/build/ts/surfaces/checkout.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/api/announcement/announcement.d.ts +20 -6
- package/build/ts/surfaces/customer-account/api/announcement/announcement.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/api/docs.d.ts +2 -0
- package/build/ts/surfaces/customer-account/api/docs.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/api/standard-api/standard-api.d.ts +2 -0
- 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 -0
- package/build/ts/surfaces/customer-account/api.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/targets.d.ts +4 -4
- package/build/ts/surfaces/customer-account/targets.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/event/data/ExchangeTransactionData.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/event/data/ExchangeTransactionData.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/event/data/ReturnTransactionData.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/event/data/ReturnTransactionData.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/targets.d.ts +3 -0
- package/build/ts/surfaces/point-of-sale/targets.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/types/cart.d.ts +28 -0
- package/build/ts/surfaces/point-of-sale/types/cart.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/types/discount-allocation.d.ts +5 -0
- package/build/ts/surfaces/point-of-sale/types/discount-allocation.d.ts.map +1 -0
- package/build/ts/surfaces/point-of-sale/types/money.d.ts +4 -0
- package/build/ts/surfaces/point-of-sale/types/money.d.ts.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/surfaces/checkout/api/announcement/announcement.ts +20 -6
- package/src/surfaces/checkout/api/checkout/checkout.ts +2 -2
- package/src/surfaces/checkout/targets.ts +2 -2
- package/src/surfaces/checkout.ts +1 -1
- package/src/surfaces/customer-account/api/announcement/announcement.ts +20 -6
- package/src/surfaces/customer-account/api/docs.ts +3 -0
- package/src/surfaces/customer-account/api/standard-api/standard-api.ts +2 -0
- package/src/surfaces/customer-account/api.ts +2 -0
- package/src/surfaces/customer-account/targets.ts +5 -4
- package/src/surfaces/point-of-sale/event/data/ExchangeTransactionData.ts +1 -0
- package/src/surfaces/point-of-sale/event/data/ReturnTransactionData.ts +1 -0
- package/src/surfaces/point-of-sale/targets.ts +4 -0
- package/src/surfaces/point-of-sale/types/cart.ts +29 -0
- package/src/surfaces/point-of-sale/types/discount-allocation.ts +5 -0
- package/src/surfaces/point-of-sale/types/money.ts +5 -0
package/package.json
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The API for interacting with the announcement bar.
|
|
3
|
+
*/
|
|
4
|
+
export interface AnnouncementApi {
|
|
5
|
+
announcement: Announcement;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface Announcement {
|
|
9
|
+
/**
|
|
10
|
+
* Close the Announcement bar.
|
|
11
|
+
*/
|
|
12
|
+
close(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Listen for events from the announcement bar.
|
|
15
|
+
*/
|
|
16
|
+
addEventListener(type: 'close', cb: () => void): void;
|
|
17
|
+
/**
|
|
18
|
+
* Remove a listener for events from the announcement bar.
|
|
19
|
+
*/
|
|
20
|
+
removeEventListener(type: 'close', cb: () => void): void;
|
|
7
21
|
}
|
|
@@ -253,7 +253,7 @@ export interface DiscountCodeAddChange {
|
|
|
253
253
|
type: 'addDiscountCode';
|
|
254
254
|
|
|
255
255
|
/**
|
|
256
|
-
* The code for the discount (case-
|
|
256
|
+
* The code for the discount (case-insensitive)
|
|
257
257
|
*/
|
|
258
258
|
code: string;
|
|
259
259
|
}
|
|
@@ -265,7 +265,7 @@ export interface DiscountCodeRemoveChange {
|
|
|
265
265
|
type: 'removeDiscountCode';
|
|
266
266
|
|
|
267
267
|
/**
|
|
268
|
-
* The code for the discount (case-
|
|
268
|
+
* The code for the discount (case-insensitive)
|
|
269
269
|
*/
|
|
270
270
|
code: string;
|
|
271
271
|
}
|
|
@@ -18,13 +18,13 @@ import type {RedeemableApi} from './api/redeemable/redeemable';
|
|
|
18
18
|
import type {StandardApi} from './api/standard/standard';
|
|
19
19
|
import type {ShippingOptionItemApi} from './api/shipping/shipping-option-item';
|
|
20
20
|
import type {ShippingOptionListApi} from './api/shipping/shipping-option-list';
|
|
21
|
+
import {AnnouncementApi} from './api/announcement/announcement';
|
|
21
22
|
import type {RenderExtension, RunnableExtension} from './extension';
|
|
22
23
|
import type {
|
|
23
24
|
AnyComponent,
|
|
24
25
|
AllowedComponents,
|
|
25
26
|
AnyComponentExcept,
|
|
26
27
|
} from './shared';
|
|
27
|
-
import type {Announcement} from './api/announcement/announcement';
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* A UI extension will register for one or more extension targets using `shopify.extend()`.
|
|
@@ -654,7 +654,7 @@ export interface RenderExtensionTargets {
|
|
|
654
654
|
'purchase.thank-you.announcement.render': RenderExtension<
|
|
655
655
|
OrderConfirmationApi &
|
|
656
656
|
StandardApi<'purchase.thank-you.announcement.render'> &
|
|
657
|
-
|
|
657
|
+
AnnouncementApi,
|
|
658
658
|
AnyComponent
|
|
659
659
|
>;
|
|
660
660
|
}
|
package/src/surfaces/checkout.ts
CHANGED
|
@@ -143,7 +143,7 @@ export type {
|
|
|
143
143
|
OrderStatusApi,
|
|
144
144
|
} from './checkout/api/order-status/order-status';
|
|
145
145
|
export type {OrderConfirmationApi} from './checkout/api/order-confirmation/order-confirmation';
|
|
146
|
-
export type {
|
|
146
|
+
export type {AnnouncementApi} from './checkout/api/announcement/announcement';
|
|
147
147
|
|
|
148
148
|
export type {CartLineItemApi} from './checkout/api/cart-line/cart-line-item';
|
|
149
149
|
export type {PickupLocationListApi} from './checkout/api/pickup/pickup-location-list';
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The API for interacting with the announcement bar.
|
|
3
|
+
*/
|
|
4
|
+
export interface AnnouncementApi {
|
|
5
|
+
announcement: Announcement;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface Announcement {
|
|
9
|
+
/**
|
|
10
|
+
* Close the Announcement bar.
|
|
11
|
+
*/
|
|
12
|
+
close(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Listen for events from the announcement bar.
|
|
15
|
+
*/
|
|
16
|
+
addEventListener(type: 'close', cb: () => void): void;
|
|
17
|
+
/**
|
|
18
|
+
* Remove a listener for events from the announcement bar.
|
|
19
|
+
*/
|
|
20
|
+
removeEventListener(type: 'close', cb: () => void): void;
|
|
7
21
|
}
|
|
@@ -67,6 +67,9 @@ export interface Docs_Standard_LocalizationApi
|
|
|
67
67
|
export interface Docs_Standard_SessionTokenApi
|
|
68
68
|
extends Pick<StandardApi<any>, 'sessionToken'> {}
|
|
69
69
|
|
|
70
|
+
export interface Docs_Standard_AnalyticsApi
|
|
71
|
+
extends Pick<StandardApi<any>, 'analytics'> {}
|
|
72
|
+
|
|
70
73
|
export interface Docs_Standard_SettingsApi
|
|
71
74
|
extends Pick<StandardApi, 'settings'> {}
|
|
72
75
|
|
|
@@ -82,6 +82,8 @@ export interface StandardApi<Target extends ExtensionTarget = ExtensionTarget> {
|
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* Methods for interacting with [Web Pixels](https://shopify.dev/docs/apps/marketing), such as emitting an event.
|
|
85
|
+
*
|
|
86
|
+
* > Note: Requires to [connect a third-party domain](https://help.shopify.com/en/manual/domains/add-a-domain/connecting-domains/connect-domain-customer-account) to Shopify for your customer account pages.
|
|
85
87
|
*/
|
|
86
88
|
analytics: Analytics;
|
|
87
89
|
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
FulfillmentApi,
|
|
12
12
|
ReturnApi,
|
|
13
13
|
} from './api/standard-api/standard-api';
|
|
14
|
-
import {
|
|
14
|
+
import {AnnouncementApi} from './api/announcement/announcement';
|
|
15
15
|
|
|
16
16
|
type Components = typeof import('./components');
|
|
17
17
|
|
|
@@ -97,7 +97,7 @@ export interface OrderStatusExtensionTargets {
|
|
|
97
97
|
'customer-account.order-status.announcement.render': RenderExtension<
|
|
98
98
|
OrderStatusApi<'customer-account.order-status.announcement.render'> &
|
|
99
99
|
StandardApi<'customer-account.order-status.announcement.render'> &
|
|
100
|
-
|
|
100
|
+
AnnouncementApi,
|
|
101
101
|
AnyComponent
|
|
102
102
|
>;
|
|
103
103
|
'customer-account.order.page.render': RenderExtension<
|
|
@@ -129,7 +129,7 @@ export interface CustomerAccountExtensionTargets {
|
|
|
129
129
|
>;
|
|
130
130
|
'customer-account.order-index.announcement.render': RenderExtension<
|
|
131
131
|
StandardApi<'customer-account.order-index.announcement.render'> &
|
|
132
|
-
|
|
132
|
+
AnnouncementApi,
|
|
133
133
|
AllComponents
|
|
134
134
|
>;
|
|
135
135
|
'customer-account.profile.block.render': RenderExtension<
|
|
@@ -137,7 +137,8 @@ export interface CustomerAccountExtensionTargets {
|
|
|
137
137
|
AllComponents
|
|
138
138
|
>;
|
|
139
139
|
'customer-account.profile.announcement.render': RenderExtension<
|
|
140
|
-
StandardApi<'customer-account.profile.announcement.render'> &
|
|
140
|
+
StandardApi<'customer-account.profile.announcement.render'> &
|
|
141
|
+
AnnouncementApi,
|
|
141
142
|
AllComponents
|
|
142
143
|
>;
|
|
143
144
|
'customer-account.profile.addresses.render-after': RenderExtension<
|
|
@@ -185,6 +185,10 @@ export interface ExtensionTargets {
|
|
|
185
185
|
{[key: string]: any} & StorageApi & TransactionCompleteWithReprintData,
|
|
186
186
|
ReceiptComponents
|
|
187
187
|
>;
|
|
188
|
+
'pos.receipt-header.block.render': RenderExtension<
|
|
189
|
+
{[key: string]: any} & StorageApi & TransactionCompleteWithReprintData,
|
|
190
|
+
ReceiptComponents
|
|
191
|
+
>;
|
|
188
192
|
}
|
|
189
193
|
|
|
190
194
|
export type ExtensionTarget = keyof ExtensionTargets;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {CountryCode} from './country-code';
|
|
2
2
|
import {TaxLine} from './tax-line';
|
|
3
|
+
import {DiscountAllocation} from './discount-allocation';
|
|
3
4
|
|
|
4
5
|
export interface Cart {
|
|
5
6
|
/**
|
|
@@ -40,6 +41,7 @@ export interface LineItem {
|
|
|
40
41
|
variantId?: number;
|
|
41
42
|
productId?: number;
|
|
42
43
|
discounts: Discount[];
|
|
44
|
+
discountAllocations?: DiscountAllocation[];
|
|
43
45
|
taxable: boolean;
|
|
44
46
|
taxLines: TaxLine[];
|
|
45
47
|
sku?: string;
|
|
@@ -47,6 +49,33 @@ export interface LineItem {
|
|
|
47
49
|
properties: {[key: string]: string};
|
|
48
50
|
isGiftCard: boolean;
|
|
49
51
|
attributedUserId?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Bundle components for this line item. Only present for product bundles.
|
|
54
|
+
* Each component represents an individual item within the bundle with its own tax information.
|
|
55
|
+
*/
|
|
56
|
+
components?: LineItemComponent[];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Represents a component of a product bundle line item.
|
|
61
|
+
* Bundle components contain the individual items that make up a bundle,
|
|
62
|
+
* each with their own pricing and tax information.
|
|
63
|
+
*/
|
|
64
|
+
export interface LineItemComponent {
|
|
65
|
+
/** The title/name of the component product */
|
|
66
|
+
title?: string;
|
|
67
|
+
/** The quantity of this component in the bundle */
|
|
68
|
+
quantity: number;
|
|
69
|
+
/** The price of this component */
|
|
70
|
+
price?: number;
|
|
71
|
+
/** Whether this component is taxable */
|
|
72
|
+
taxable: boolean;
|
|
73
|
+
/** Tax lines applied to this component */
|
|
74
|
+
taxLines: TaxLine[];
|
|
75
|
+
/** The variant ID of this component, if applicable */
|
|
76
|
+
variantId?: number;
|
|
77
|
+
/** The product ID of this component, if applicable */
|
|
78
|
+
productId?: number;
|
|
50
79
|
}
|
|
51
80
|
|
|
52
81
|
export interface Discount {
|