@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.
Files changed (46) hide show
  1. package/build/ts/surfaces/checkout/api/announcement/announcement.d.ts +20 -6
  2. package/build/ts/surfaces/checkout/api/announcement/announcement.d.ts.map +1 -1
  3. package/build/ts/surfaces/checkout/api/checkout/checkout.d.ts +2 -2
  4. package/build/ts/surfaces/checkout/targets.d.ts +2 -2
  5. package/build/ts/surfaces/checkout/targets.d.ts.map +1 -1
  6. package/build/ts/surfaces/checkout.d.ts +1 -1
  7. package/build/ts/surfaces/checkout.d.ts.map +1 -1
  8. package/build/ts/surfaces/customer-account/api/announcement/announcement.d.ts +20 -6
  9. package/build/ts/surfaces/customer-account/api/announcement/announcement.d.ts.map +1 -1
  10. package/build/ts/surfaces/customer-account/api/docs.d.ts +2 -0
  11. package/build/ts/surfaces/customer-account/api/docs.d.ts.map +1 -1
  12. package/build/ts/surfaces/customer-account/api/standard-api/standard-api.d.ts +2 -0
  13. package/build/ts/surfaces/customer-account/api/standard-api/standard-api.d.ts.map +1 -1
  14. package/build/ts/surfaces/customer-account/api.d.ts +1 -0
  15. package/build/ts/surfaces/customer-account/api.d.ts.map +1 -1
  16. package/build/ts/surfaces/customer-account/targets.d.ts +4 -4
  17. package/build/ts/surfaces/customer-account/targets.d.ts.map +1 -1
  18. package/build/ts/surfaces/point-of-sale/event/data/ExchangeTransactionData.d.ts +1 -0
  19. package/build/ts/surfaces/point-of-sale/event/data/ExchangeTransactionData.d.ts.map +1 -1
  20. package/build/ts/surfaces/point-of-sale/event/data/ReturnTransactionData.d.ts +1 -0
  21. package/build/ts/surfaces/point-of-sale/event/data/ReturnTransactionData.d.ts.map +1 -1
  22. package/build/ts/surfaces/point-of-sale/targets.d.ts +3 -0
  23. package/build/ts/surfaces/point-of-sale/targets.d.ts.map +1 -1
  24. package/build/ts/surfaces/point-of-sale/types/cart.d.ts +28 -0
  25. package/build/ts/surfaces/point-of-sale/types/cart.d.ts.map +1 -1
  26. package/build/ts/surfaces/point-of-sale/types/discount-allocation.d.ts +5 -0
  27. package/build/ts/surfaces/point-of-sale/types/discount-allocation.d.ts.map +1 -0
  28. package/build/ts/surfaces/point-of-sale/types/money.d.ts +4 -0
  29. package/build/ts/surfaces/point-of-sale/types/money.d.ts.map +1 -1
  30. package/build/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +1 -1
  32. package/src/surfaces/checkout/api/announcement/announcement.ts +20 -6
  33. package/src/surfaces/checkout/api/checkout/checkout.ts +2 -2
  34. package/src/surfaces/checkout/targets.ts +2 -2
  35. package/src/surfaces/checkout.ts +1 -1
  36. package/src/surfaces/customer-account/api/announcement/announcement.ts +20 -6
  37. package/src/surfaces/customer-account/api/docs.ts +3 -0
  38. package/src/surfaces/customer-account/api/standard-api/standard-api.ts +2 -0
  39. package/src/surfaces/customer-account/api.ts +2 -0
  40. package/src/surfaces/customer-account/targets.ts +5 -4
  41. package/src/surfaces/point-of-sale/event/data/ExchangeTransactionData.ts +1 -0
  42. package/src/surfaces/point-of-sale/event/data/ReturnTransactionData.ts +1 -0
  43. package/src/surfaces/point-of-sale/targets.ts +4 -0
  44. package/src/surfaces/point-of-sale/types/cart.ts +29 -0
  45. package/src/surfaces/point-of-sale/types/discount-allocation.ts +5 -0
  46. package/src/surfaces/point-of-sale/types/money.ts +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopify/ui-extensions",
3
- "version": "2025.7.1",
3
+ "version": "2025.7.2",
4
4
  "scripts": {
5
5
  "docs:admin": "bash ./docs/surfaces/admin/build-docs.sh",
6
6
  "docs:admin:dev": "nodemon --watch src/surfaces/admin -e ts,tsx,json --exec 'yarn docs:admin'",
@@ -1,7 +1,21 @@
1
- export interface Announcement {
2
- announcement: {
3
- close(): void;
4
- addEventListener(type: 'close', cb: () => void): void;
5
- removeEventListener(type: 'close', cb: () => void): void;
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-sensitive)
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-sensitive)
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
- Announcement,
657
+ AnnouncementApi,
658
658
  AnyComponent
659
659
  >;
660
660
  }
@@ -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 {Announcement} from './checkout/api/announcement/announcement';
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
- export interface Announcement {
2
- announcement: {
3
- close(): void;
4
- addEventListener(type: 'close', cb: () => void): void;
5
- removeEventListener(type: 'close', cb: () => void): void;
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
 
@@ -97,3 +97,5 @@ export type {
97
97
  OrderApi,
98
98
  ExtensionSettings,
99
99
  } from './api/standard-api/standard-api';
100
+
101
+ export type {AnnouncementApi} from './api/announcement/announcement';
@@ -11,7 +11,7 @@ import {
11
11
  FulfillmentApi,
12
12
  ReturnApi,
13
13
  } from './api/standard-api/standard-api';
14
- import {Announcement} from './api/announcement/announcement';
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
- Announcement,
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
- Announcement,
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'> & Announcement,
140
+ StandardApi<'customer-account.profile.announcement.render'> &
141
+ AnnouncementApi,
141
142
  AllComponents
142
143
  >;
143
144
  'customer-account.profile.addresses.render-after': RenderExtension<
@@ -3,6 +3,7 @@ import {LineItem} from '../../types/cart';
3
3
 
4
4
  export interface ExchangeTransactionData extends BaseTransactionComplete {
5
5
  transactionType: 'Exchange';
6
+ returnId?: number;
6
7
  exchangeId?: number;
7
8
  lineItemsAdded: LineItem[];
8
9
  lineItemsRemoved: LineItem[];
@@ -3,6 +3,7 @@ import {LineItem} from '../../types/cart';
3
3
 
4
4
  export interface ReturnTransactionData extends BaseTransactionComplete {
5
5
  transactionType: 'Return';
6
+ refundId?: number;
6
7
  returnId?: number;
7
8
  exchangeId?: number;
8
9
  lineItems: LineItem[];
@@ -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 {
@@ -0,0 +1,5 @@
1
+ import type {MoneyV2} from './money';
2
+
3
+ export interface DiscountAllocation {
4
+ allocatedAmount: MoneyV2;
5
+ }
@@ -2,3 +2,8 @@ export interface Money {
2
2
  amount: number;
3
3
  currency: string;
4
4
  }
5
+
6
+ export interface MoneyV2 {
7
+ amount: string;
8
+ currencyCode: string;
9
+ }