@shopify/ui-extensions 2025.10.0-rc.39 → 2025.10.0-rc.40

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 (53) hide show
  1. package/build/ts/surfaces/customer-account/globals.d.ts.map +1 -1
  2. package/build/ts/surfaces/point-of-sale/api/action-target-api/action-target-api.d.ts +1 -2
  3. package/build/ts/surfaces/point-of-sale/api/action-target-api/action-target-api.d.ts.map +1 -1
  4. package/build/ts/surfaces/point-of-sale/api/navigation-api/navigation-api.d.ts +49 -36
  5. package/build/ts/surfaces/point-of-sale/api/navigation-api/navigation-api.d.ts.map +1 -1
  6. package/build/ts/surfaces/point-of-sale/api.d.ts +0 -1
  7. package/build/ts/surfaces/point-of-sale/api.d.ts.map +1 -1
  8. package/build/ts/surfaces/point-of-sale/components/Section/Section.doc.d.ts.map +1 -1
  9. package/build/ts/surfaces/point-of-sale/globals.d.ts +5 -0
  10. package/build/ts/surfaces/point-of-sale/globals.d.ts.map +1 -0
  11. package/build/ts/surfaces/point-of-sale/targets/pos.cart-update.event.observe.d.ts +2 -1
  12. package/build/ts/surfaces/point-of-sale/targets/pos.cart.line-item-details.action.menu-item.render.d.ts +1 -0
  13. package/build/ts/surfaces/point-of-sale/targets/pos.cart.line-item-details.action.render.d.ts +1 -0
  14. package/build/ts/surfaces/point-of-sale/targets/pos.cash-tracking-session-complete.event.observe.d.ts +2 -1
  15. package/build/ts/surfaces/point-of-sale/targets/pos.cash-tracking-session-start.event.observe.d.ts +2 -1
  16. package/build/ts/surfaces/point-of-sale/targets/pos.customer-details.action.menu-item.render.d.ts +1 -0
  17. package/build/ts/surfaces/point-of-sale/targets/pos.customer-details.action.render.d.ts +1 -0
  18. package/build/ts/surfaces/point-of-sale/targets/pos.customer-details.block.render.d.ts +1 -0
  19. package/build/ts/surfaces/point-of-sale/targets/pos.draft-order-details.action.menu-item.render.d.ts +1 -0
  20. package/build/ts/surfaces/point-of-sale/targets/pos.draft-order-details.action.render.d.ts +1 -0
  21. package/build/ts/surfaces/point-of-sale/targets/pos.draft-order-details.block.render.d.ts +1 -0
  22. package/build/ts/surfaces/point-of-sale/targets/pos.exchange.post.action.menu-item.render.d.ts +1 -0
  23. package/build/ts/surfaces/point-of-sale/targets/pos.exchange.post.action.render.d.ts +1 -0
  24. package/build/ts/surfaces/point-of-sale/targets/pos.exchange.post.block.render.d.ts +1 -0
  25. package/build/ts/surfaces/point-of-sale/targets/pos.home.modal.render.d.ts +1 -0
  26. package/build/ts/surfaces/point-of-sale/targets/pos.home.tile.render.d.ts +1 -0
  27. package/build/ts/surfaces/point-of-sale/targets/pos.order-details.action.menu-item.render.d.ts +1 -0
  28. package/build/ts/surfaces/point-of-sale/targets/pos.order-details.action.render.d.ts +1 -0
  29. package/build/ts/surfaces/point-of-sale/targets/pos.order-details.block.render.d.ts +1 -0
  30. package/build/ts/surfaces/point-of-sale/targets/pos.product-details.action.menu-item.render.d.ts +1 -0
  31. package/build/ts/surfaces/point-of-sale/targets/pos.product-details.action.render.d.ts +1 -0
  32. package/build/ts/surfaces/point-of-sale/targets/pos.product-details.block.render.d.ts +1 -0
  33. package/build/ts/surfaces/point-of-sale/targets/pos.purchase.post.action.menu-item.render.d.ts +1 -0
  34. package/build/ts/surfaces/point-of-sale/targets/pos.purchase.post.action.render.d.ts +1 -0
  35. package/build/ts/surfaces/point-of-sale/targets/pos.purchase.post.block.render.d.ts +1 -0
  36. package/build/ts/surfaces/point-of-sale/targets/pos.receipt-footer.block.render.d.ts +1 -0
  37. package/build/ts/surfaces/point-of-sale/targets/pos.receipt-header.block.render.d.ts +1 -0
  38. package/build/ts/surfaces/point-of-sale/targets/pos.return.post.action.menu-item.render.d.ts +1 -0
  39. package/build/ts/surfaces/point-of-sale/targets/pos.return.post.action.render.d.ts +1 -0
  40. package/build/ts/surfaces/point-of-sale/targets/pos.return.post.block.render.d.ts +1 -0
  41. package/build/ts/surfaces/point-of-sale/targets/pos.transaction-complete.event.observe.d.ts +2 -1
  42. package/build/tsconfig.tsbuildinfo +1 -1
  43. package/package.json +1 -1
  44. package/src/surfaces/admin/components/Image/examples/default.html +1 -1
  45. package/src/surfaces/admin/components/Thumbnail/examples/default.html +2 -2
  46. package/src/surfaces/customer-account/globals.ts +2 -0
  47. package/src/surfaces/point-of-sale/api/action-target-api/action-target-api.ts +1 -3
  48. package/src/surfaces/point-of-sale/api/navigation-api/navigation-api.ts +53 -35
  49. package/src/surfaces/point-of-sale/api.ts +0 -5
  50. package/src/surfaces/point-of-sale/components/Badge/examples/default.html +5 -7
  51. package/src/surfaces/point-of-sale/components/DateField/examples/default.html +0 -2
  52. package/src/surfaces/point-of-sale/components/Tile/examples/default.html +1 -1
  53. package/src/surfaces/point-of-sale/globals.ts +6 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopify/ui-extensions",
3
- "version": "2025.10.0-rc.39",
3
+ "version": "2025.10.0-rc.40",
4
4
  "scripts": {
5
5
  "docs:admin": "node ./docs/surfaces/admin/build-docs.mjs",
6
6
  "docs:checkout": "bash ./docs/surfaces/checkout/build-docs.sh",
@@ -1,5 +1,5 @@
1
1
  <s-image
2
- src="/assets/home/icons/icon-community-small-02dccda350b673dbd5d87a40cdd900de45ddef6f69b8dd9498c4ca9ab652cc0b.png"
2
+ src="https://cdn.shopify.com/static/images/polaris/image-wc_src.png"
3
3
  alt="Four pixelated characters ready to build amazing Shopify apps"
4
4
  aspectRatio="59/161"
5
5
  inlineSize="auto"
@@ -1,4 +1,4 @@
1
1
  <s-thumbnail
2
2
  alt="White sneakers"
3
- src="/assets/products/sneakers.jpg">
4
- </s-thumbnail>
3
+ src="https://cdn.shopify.com/static/images/polaris/thumbnail-wc_src.jpg"
4
+ ></s-thumbnail>
@@ -10,5 +10,7 @@ export interface ShopifyGlobal {
10
10
  }
11
11
 
12
12
  declare global {
13
+ // @ts-expect-error - Intentionally overriding navigation type for POS context
14
+ // This is safe as point-of-sale and customer-account are never used together
13
15
  const navigation: Navigation;
14
16
  }
@@ -1,9 +1,7 @@
1
1
  import {ScannerApi} from '../scanner-api/scanner-api';
2
- import {NavigationApi} from '../navigation-api/navigation-api';
3
2
  import {StandardApi} from '../standard/standard-api';
4
3
 
5
4
  export type ActionTargetApi<T> = {[key: string]: any} & {
6
5
  extensionPoint: T;
7
6
  } & StandardApi<T> &
8
- ScannerApi &
9
- NavigationApi;
7
+ ScannerApi;
@@ -1,45 +1,63 @@
1
- export interface NavigationApiContent {
1
+ export interface NavigationNavigateOptions {
2
2
  /**
3
- * Using `(screenName: string, params?: any)` navigates to a route in current navigation tree.
4
- * Pushes the specified screen if it isn't present in the navigation tree, goes back to a created screen otherwise.
5
- * @param screenName the name of the screen you want to navigate to.
6
- * @param params the parameters you want to pass to that screen.
3
+ * Developer-defined information to be stored in the associated NavigationHistoryEntry once the navigation is complete, retrievable via getState().
7
4
  */
8
- navigate(screenName: string, params?: any): Promise<void>;
5
+ state?: unknown;
6
+ }
9
7
 
8
+ /**
9
+ * The NavigationHistoryEntry interface of the Navigation API represents a single navigation history entry.
10
+ */
11
+ export interface NavigationHistoryEntry {
12
+ /** Returns the key of the history entry. This is a unique, UA-generated value that represents the history entry's slot in the entries list rather than the entry itself. */
13
+ key: string;
10
14
  /**
11
- * Using `(uri: string | URL)` opens a POS Native screen modally.
12
- * If the uri starts with `shopify:point-of-sale/` it will be treated as a POS Native screen. Otherwise it will try to navigate to an extension screen.
13
- * Available POS Native screens:
14
- * - `shopify:point-of-sale/products/{product_id}` to present product details.
15
- * - `shopify:point-of-sale/products/{product_id}/variants/{variant_id}` to present product variant details.
16
- * - `shopify:point-of-sale/customers/{customer_id}` to present customer details.
17
- * - `shopify:point-of-sale/orders/{order_id}` to present order details.
18
- * - `shopify:point-of-sale/draft_orders/{draft_order_id}` to present draft order details.
19
- * - `shopify:point-of-sale/staff/{staff_id}` to present staff details.
20
- * @param uri the uri of the POS Native screen to present modally.
21
- * @returns A promise that resolves when the POS screen is presented, rejects when an error occurs.
22
- * @example Open product variant details screen for product id 123 and variant id 456
23
- * navigate('shopify:point-of-sale/products/123/variants/456');
24
- */
25
- navigate(uri: string | URL): Promise<void>;
26
-
27
- /** Pops the currently shown screen */
28
- pop(): void;
29
-
30
- /** Dismisses the extension. */
31
- dismiss(): void;
32
-
33
- /** Checks if the user has permission to navigate to the specified screen.
34
- * @param uri the uri to check if the user has permission to navigate to.
35
- * @returns false if the uri is a valid uri to navigate to a POS screen and the user does not have permission to navigate to the specified screen, true otherwise. The promise rejects if the user is not on the correct API version of POS extensions.
15
+ * Returns the URL of this history entry.
36
16
  */
37
- canNavigate(uri: string | URL): Promise<boolean>;
17
+ url: string | null;
18
+ /**
19
+ * Returns a clone of the available state associated with this history entry.
20
+ */
21
+ getState(): unknown;
38
22
  }
39
23
 
40
24
  /**
41
- * Access the navigation API for navigation functionality from a full screen modal.
25
+ * The NavigationCurrentEntryChangeEvent interface of the Navigation API is the event object for the currententrychange event, which fires when the Navigation.currentEntry has changed.
42
26
  */
43
- export interface NavigationApi {
44
- navigation: NavigationApiContent;
27
+ export interface NavigationCurrentEntryChangeEvent {
28
+ /**
29
+ * Returns the NavigationHistoryEntry that was navigated from.
30
+ */
31
+ from: NavigationHistoryEntry;
32
+ }
33
+
34
+ export interface Navigation {
35
+ /**
36
+ * The navigate() method navigates to a specific URL, updating any provided state in the history entries list.
37
+ */
38
+ navigate: NavigateFunction;
39
+ /**
40
+ * The currentEntry read-only property of the Navigation interface returns a NavigationHistoryEntry object representing the location the user is currently navigated to right now.
41
+ */
42
+ currentEntry: NavigationHistoryEntry;
43
+ /**
44
+ * The back() method of the Navigation interface navigates to the previous entry in the history list.
45
+ */
46
+ back(): void;
47
+ addEventListener(
48
+ type: 'currententrychange',
49
+ cb: (event: NavigationCurrentEntryChangeEvent) => void,
50
+ ): void;
51
+ removeEventListener(
52
+ type: 'currententrychange',
53
+ cb: (event: NavigationCurrentEntryChangeEvent) => void,
54
+ ): void;
55
+ }
56
+
57
+ export interface NavigateFunction {
58
+ /**
59
+ * Navigates to a specific URL, updating any provided state in the history entries list.
60
+ * @param url The destination URL to navigate to.
61
+ */
62
+ (url: string, options?: NavigationNavigateOptions): void;
45
63
  }
@@ -28,11 +28,6 @@ export type {DeviceApi, DeviceApiContent} from './api/device-api/device-api';
28
28
 
29
29
  export type {LocaleApi, LocaleApiContent} from './api/locale-api/locale-api';
30
30
 
31
- export type {
32
- NavigationApiContent,
33
- NavigationApi,
34
- } from './api/navigation-api/navigation-api';
35
-
36
31
  export type {OrderApiContent, OrderApi} from './api/order-api/order-api';
37
32
 
38
33
  export type {
@@ -1,7 +1,5 @@
1
- <s-badge text="New" />
2
- <s-badge text="Success" variant="success" />
3
- <s-badge text="Warning" variant="warning" />
4
- <s-badge text="Critical" variant="critical" />
5
- <s-badge text="Active" status="active" />
6
- <s-badge text="Complete" status="complete" />
7
- <s-badge text="In Progress" variant="info" status="active" />
1
+ <s-badge tone="neutral">Neutral</s-badge>
2
+ <s-badge tone="success">Success</s-badge>
3
+ <s-badge tone="info">Highlight</s-badge>
4
+ <s-badge tone="warning">Warning</s-badge>
5
+ <s-badge tone="critical">Critical</s-badge>
@@ -1,13 +1,11 @@
1
1
  <s-date-field
2
2
  label="Date"
3
- required
4
3
  value="2024-10-26"
5
4
  details="Select a date">
6
5
  </s-date-field>
7
6
 
8
7
  <s-date-field
9
8
  label="Date"
10
- required
11
9
  value="1890-10-26"
12
10
  error="Date out of range"
13
11
  details="Select a date">
@@ -1,4 +1,4 @@
1
- <s-tile heading="Title" subheading="Subtitle" itemCount="2" tone="accent"></s-tile>
1
+ <s-tile heading="Title" subheading="Subtitle" itemCount={2} tone="accent"></s-tile>
2
2
 
3
3
  <s-tile heading="Title" subheading="Subtitle" tone="accent"></s-tile>
4
4
 
@@ -0,0 +1,6 @@
1
+ import {Navigation} from './api/navigation-api/navigation-api';
2
+
3
+ declare global {
4
+ // @ts-expect-error - Intentionally overriding navigation type for POS context
5
+ const navigation: Navigation;
6
+ }