Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
5b513a4
Adds 2024-07 to github workflows
Jun 20, 2024
ba9b2f8
prepare customer account 2024-07 release
robin-drexler Jun 18, 2024
02d7e2c
Merge pull request #2094 from Shopify/rd/customer-accounts-prep-2024-07
robin-drexler Jun 21, 2024
321749e
[checkout] Add cart instructions API
jamesvidler Jun 21, 2024
45ba453
Merge pull request #2144 from Shopify/jkv/2024-07-cart-instructions
jamesvidler Jul 2, 2024
d023c08
manual unstable release of checkout ui extensions
jamesvidler Jul 2, 2024
b8818d7
Merge pull request #2154 from Shopify/jkv/2024-07-cart-instructions-docs
jamesvidler Jul 2, 2024
2579670
Version Packages
github-actions[bot] Jul 2, 2024
9b0ec71
Updates version to 2024.7.0
thomas-marcucci Jul 2, 2024
b557726
Merge pull request #2122 from Shopify/changeset-release/2024-07
thomas-marcucci Jul 2, 2024
5b05187
updates instructions-update page
rcaplanshopify Aug 2, 2024
41ce210
Merge pull request #2233 from Shopify/rc/instructions-update-2024-07
rcaplanshopify Aug 5, 2024
6356b66
add doc changes to option-item-render-after
jonathanhamel4 Aug 6, 2024
2dc6945
Merge pull request #2239 from Shopify/jh/doc-change-item-render-after
jonathanhamel4 Aug 6, 2024
d5776ab
Fix doc generation on localdev
jplhomer Aug 22, 2024
4856a72
Merge pull request #2296 from Shopify/jl-fix-docgen-2024-07
jplhomer Aug 30, 2024
c68ded7
update generate-doc verision
hheyhhay Sep 4, 2024
2ae7e44
run yan install
hheyhhay Sep 4, 2024
16b8855
remove packageManager added at yarn install
hheyhhay Sep 4, 2024
9ad622f
Merge pull request #2324 from Shopify/update-generate-doc-version
hheyhhay Sep 4, 2024
e73dbda
fix build-docs file to run gh action
hheyhhay Sep 4, 2024
b7e54ac
Merge pull request #2326 from Shopify/hdixon/fix-build-docs-file
hheyhhay Sep 4, 2024
1938062
Add a step to CI to ensure docs can be built in CI
jplhomer Sep 3, 2024
b9293b4
Merge pull request #2320 from Shopify/jl-fix-docs-2024-07
jplhomer Sep 4, 2024
ccb8d47
Fix docs building by using `bash` rather than `sh` because it
jplhomer Sep 9, 2024
4208219
Merge pull request #2332 from Shopify/jl-fix-docs-spin-202407
jplhomer Sep 9, 2024
60aa932
update one page checkout asset to show reductions targets
ameemee Dec 17, 2024
e3e1f15
Merge pull request #2541 from Shopify/updating-2024-07-one-page-check…
ameemee Dec 18, 2024
6b017a0
Escape double quotes in config documentation
danielqiuu Jan 21, 2025
e5be807
Merge pull request #2575 from Shopify/dq/update-config-doc-2024-07
danielqiuu Jan 24, 2025
27e4702
Fix payment options documentation
vaibhavramchandani Jan 23, 2025
9ecb495
Backfill doc changes to POS Extension 2024-07 (#2969)
henryStelle Jun 10, 2025
037af9f
Add order-api examples
NathanJolly Jun 19, 2025
70ab191
Merge pull request #2997 from Shopify/njo/2024-07-order-api-examples
NathanJolly Jun 20, 2025
df4c95a
Remove the unsupported section from the versions page
NathanJolly Jul 10, 2025
4739d23
Merge pull request #3065 from Shopify/njo/2024-07/remove-unsupported
NathanJolly Jul 10, 2025
0f689c0
docs: add extension-targets doc on admin
olavoasantos Sep 10, 2025
3e6e8d2
docs: remove extension-targets doc on admin
olavoasantos Sep 10, 2025
3e64efb
Remove versions page from 2024-07, update links
NathanJolly Sep 15, 2025
4bcb00a
update links on overview page
NathanJolly Sep 16, 2025
bfe777b
Merge pull request #3305 from Shopify/njo/2024-07/remove-versions
NathanJolly Sep 16, 2025
75beb15
Fix polaris-web-components link
NathanJolly Oct 6, 2025
11c9a34
Merge pull request #3467 from Shopify/njo/2024-07/fix-component-link
NathanJolly Oct 6, 2025
a181e3a
Update troubleshooting doc for clarity
NathanJolly Oct 10, 2025
96649fe
Merge pull request #3495 from Shopify/njo/2024-07/reword-troubleshoot…
NathanJolly Oct 14, 2025
e5b0bda
Remove pos static pages that are migrating
NathanJolly Oct 17, 2025
8061c14
Merge pull request #3514 from Shopify/njo/2024-07/remove-pos-build-docs
NathanJolly Oct 17, 2025
ef8699b
Improved API and prop descriptions for 2024-07
mcvinci Nov 13, 2025
07a0471
Improved descriptions
mcvinci Nov 17, 2025
51be395
Remove 'and detail pages' from Tile component description
mcvinci Nov 18, 2025
8db50fa
Improvements to example titles and descriptions
mcvinci Nov 23, 2025
784bc48
Fix PinPad and Stack
mcvinci Nov 23, 2025
b653fe4
Best practices and limitations
mcvinci Nov 24, 2025
8902fc1
Re-organize subcategories
mcvinci Nov 24, 2025
a1529b3
Merge pull request #3567 from Shopify/pos-ui-extensions-2024-07-api-p…
mcvinci Nov 25, 2025
465ed6e
Rename ProductSearch to Product Search (#3615)
mcvinci Dec 2, 2025
2626848
Remove redundant types + add missing descriptions (#3624)
mcvinci Dec 4, 2025
2c540b9
[Admin UI extensions 2024-07]: IA for Target APIs and components (#3701)
mcvinci Jan 9, 2026
06ff678
chore: update shopify-dev asset path
majd-shopify Feb 2, 2026
6fa59a5
[Target APIs]: Description improvements for version 2024-07 (#3764)
mcvinci Feb 3, 2026
6b6e3df
Merge pull request #3796 from Shopify/chore/update-shopify-dev-asset-…
majd-shopify Feb 3, 2026
51d804a
chore: update all paths in build-docs scripts
majd-shopify Feb 6, 2026
19d9300
Merge pull request #3857 from Shopify/chore/update-all-paths-in-build…
majd-shopify Feb 6, 2026
b0e8520
Migrating from old branch
SteveSill Feb 5, 2026
8b76a5c
Merge pull request #3827 from Shopify/2024-07-admin-ui-examples
SteveSill Feb 6, 2026
7dc4445
target docs
johndcollett Jan 23, 2026
0578f98
fix: add @private exclusion, RunnableExtension support, and Pick/Omit…
laurelthorburn Jan 30, 2026
f9c76cc
Merge pull request #3776 from Shopify/2024-07-target-docs
laurelthorburn Feb 6, 2026
375fcc7
Exclude ActionTargetApi and StandardApi from POS targets JSON
laurelthorburn Feb 6, 2026
faf52b9
update `Screen.onReceiveParams` with clarifying description. (#3849)
fatbattk Feb 9, 2026
a159bfa
[2024-07] Make API headings consistent in POS UI and Admin UI (#3838)
mcvinci Feb 9, 2026
9ab7580
Merge pull request #3872 from Shopify/2024-07-action
laurelthorburn Feb 10, 2026
cb470a8
[POS 2024-07]: Remove component name code syntax (#3913)
mcvinci Feb 17, 2026
d41900a
[Components]: Description improvements for version 2024-07 (#3881)
mcvinci Feb 19, 2026
79c6943
Add component examples and descriptions for 2024-07
SteveSill Feb 20, 2026
2131dbb
Merge pull request #3935 from Shopify/2024-07-component-examples
SteveSill Feb 21, 2026
54fe55d
Admin UI component defaultExample descriptions
SteveSill Feb 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 0 additions & 6 deletions .changeset/calm-crabs-run.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/famous-pillows-work.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/fresh-shoes-buy.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/happy-kings-shop.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/hot-flowers-glow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/hungry-beans-complain.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/long-news-prove.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/lovely-pots-scream.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/nasty-hotels-press.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/new-pugs-shop.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/orange-ants-sniff.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/serious-experts-admire.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/silver-jobs-sneeze.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
'@shopify/ui-extensions': patch
'@shopify/ui-extensions-react': patch
'@shopify/ui-extensions': patch
---

Publish display property
update Screen.onReceiveParams description
5 changes: 0 additions & 5 deletions .changeset/swift-cherries-prove.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/tall-cows-explain.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/tall-fireants-sleep.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/twelve-otters-think.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/violet-flowers-deny.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/weak-snakes-ring.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/yellow-lions-behave.md

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/changesets-reminder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- 2023-10
- 2024-01
- 2024-04
- 2024-07
- unstable
paths:
- 'packages/*/src/**'
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

- id: typescript-cache
name: Restore TypeScript cache
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: |
packages/*/build/ts
Expand All @@ -31,7 +31,7 @@ jobs:

- id: jest-cache
name: Restore jest cache
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: .loom/cache/jest/
key: ${{ runner.os }}-jest-v1-${{ github.sha }}
Expand All @@ -50,7 +50,7 @@ jobs:

- id: eslint-cache
name: Restore ESLint cache
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: .loom/cache/eslint
key: ${{ runner.os }}-eslint-v1-${{ github.sha }}
Expand All @@ -59,3 +59,14 @@ jobs:

- name: Lint
run: yarn lint

test-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/prepare

- id: test-build
name: Build docs locally to ensure they can be built in CI
run: yarn docs:admin
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- 2023-10
- 2024-01
- 2024-04
- 2024-07

concurrency: ${{ github.workflow }}-${{ github.ref }}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
"prettier": "^2.8.0",
"react": ">=18.0.0",
"typescript": "^4.9.0",
"@shopify/generate-docs": "0.16.0"
"@shopify/generate-docs": "0.16.4"
}
}
49 changes: 49 additions & 0 deletions packages/ui-extensions-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
# @shopify/ui-extensions-react

## 2024.7.0

### Minor Changes

- [#1888](https://github.com/Shopify/ui-extensions/pull/1888) [`199a90fef0f4ce90a8f6ae6a8298c9d9c437f2f4`](https://github.com/Shopify/ui-extensions/commit/199a90fef0f4ce90a8f6ae6a8298c9d9c437f2f4) Thanks [@elanalynn](https://github.com/elanalynn)! - Add new block extension targets: collection, draft-order, abandoned-checkout, and product-variant

- [#1981](https://github.com/Shopify/ui-extensions/pull/1981) [`ba2510f0f4737a56abe4171a08b8adea4488f8b4`](https://github.com/Shopify/ui-extensions/commit/ba2510f0f4737a56abe4171a08b8adea4488f8b4) Thanks [@shopify-github-actions-access](https://github.com/apps/shopify-github-actions-access)! - Updates Order Status API with `processedAt` attribute

- [#1987](https://github.com/Shopify/ui-extensions/pull/1987) [`952489d3c27a2f5c8bcdad29e516480fe71e94e8`](https://github.com/Shopify/ui-extensions/commit/952489d3c27a2f5c8bcdad29e516480fe71e94e8) Thanks [@rcaplanshopify](https://github.com/rcaplanshopify)! - - Adds `useCustomerPrivacy` hook.

- [#2144](https://github.com/Shopify/ui-extensions/pull/2144) [`321749e68edf6d64a82ffe2c4c99d0f19ac4e63c`](https://github.com/Shopify/ui-extensions/commit/321749e68edf6d64a82ffe2c4c99d0f19ac4e63c) Thanks [@jamesvidler](https://github.com/jamesvidler)! - Added `CartInstructions` (accessed using `api.instructions`) to checkout. These represent the cart instructions used to create the checkout and possibly limit extension capabilities. These instructions should be checked prior to performing any actions that may be affected by them.

For example, if you intend to add a discount code via the `applyDiscountCodeChange` method, check `api.instructions.discounts.canUpdateDiscountCodes` to ensure it's supported in this checkout.

- [#2067](https://github.com/Shopify/ui-extensions/pull/2067) [`3c3505c16c1deb6f202cbecf6747c0fdc6b79228`](https://github.com/Shopify/ui-extensions/commit/3c3505c16c1deb6f202cbecf6747c0fdc6b79228) Thanks [@shopify-github-actions-access](https://github.com/apps/shopify-github-actions-access)! - Support split shipping in Shipping option list and item targets.

- [#1924](https://github.com/Shopify/ui-extensions/pull/1924) [`a4f275abcb0c0166e0383fc5c1ed544b938def29`](https://github.com/Shopify/ui-extensions/commit/a4f275abcb0c0166e0383fc5c1ed544b938def29) Thanks [@rcaplanshopify](https://github.com/rcaplanshopify)! - - Adds the ability to read and write tracking consent metafield data to the Customer Privacy API.

- Updates the `Sheet` component and examples.

- [#1807](https://github.com/Shopify/ui-extensions/pull/1807) [`08067cbba140d72f115e38f218dd0caead13f0d5`](https://github.com/Shopify/ui-extensions/commit/08067cbba140d72f115e38f218dd0caead13f0d5) Thanks [@nataliejeong](https://github.com/nataliejeong)! - Add Extension Target for Reorder Flow

- [#2040](https://github.com/Shopify/ui-extensions/pull/2040) [`c8d876e83f3144361e09c375c3dc89af2029655b`](https://github.com/Shopify/ui-extensions/commit/c8d876e83f3144361e09c375c3dc89af2029655b) Thanks [@elanalynn](https://github.com/elanalynn)! - Add AdminPrintAction component

- [#2065](https://github.com/Shopify/ui-extensions/pull/2065) [`c2c51b82135fadf9dd4a2b1ad95dc59cabd9064c`](https://github.com/Shopify/ui-extensions/commit/c2c51b82135fadf9dd4a2b1ad95dc59cabd9064c) Thanks [@elanalynn](https://github.com/elanalynn)! - Add admin print action targets

- [#2118](https://github.com/Shopify/ui-extensions/pull/2118) [`0016e7e5031934e21b26398958d69b97a20ccebd`](https://github.com/Shopify/ui-extensions/commit/0016e7e5031934e21b26398958d69b97a20ccebd) Thanks [@shopify-github-actions-access](https://github.com/apps/shopify-github-actions-access)! - - Adds `oneTimeUse` to `ShippingAddress` to denote whether the address can be saved in checkout.

- Adds `sku` to `ProductVariant` in checkout.
- Adds `bullet` icon in checkout.

- [#1916](https://github.com/Shopify/ui-extensions/pull/1916) [`f9a593edd7bc6ea9f46f3927efd3b9fa6ebc5b5a`](https://github.com/Shopify/ui-extensions/commit/f9a593edd7bc6ea9f46f3927efd3b9fa6ebc5b5a) Thanks [@mleandres](https://github.com/mleandres)! - - Adds `purchase.address-autocomplete.suggest` extension target
- Adds the `primaryAction` and `secondaryAction` to the `Sheet` component

### Patch Changes

- [#2015](https://github.com/Shopify/ui-extensions/pull/2015) [`5ded8d2cb5d9ae502aa75183714f84dc92b820ea`](https://github.com/Shopify/ui-extensions/commit/5ded8d2cb5d9ae502aa75183714f84dc92b820ea) Thanks [@PSalmers](https://github.com/PSalmers)! - Homogenizes terminology to use the term "placement" in place of "supported location", "placement reference", and others.

- [#2037](https://github.com/Shopify/ui-extensions/pull/2037) [`0fd33b35c651b89d24c4fc560f376e91658d70a6`](https://github.com/Shopify/ui-extensions/commit/0fd33b35c651b89d24c4fc560f376e91658d70a6) Thanks [@brianshen1990](https://github.com/brianshen1990)! - add authenticationState api to customer account ui extension

- [#2053](https://github.com/Shopify/ui-extensions/pull/2053) [`9c1777d48e0d81fea811cfbcd9764e98cf65778d`](https://github.com/Shopify/ui-extensions/commit/9c1777d48e0d81fea811cfbcd9764e98cf65778d) Thanks [@ncardeli](https://github.com/ncardeli)! - Publish display property

- [#2014](https://github.com/Shopify/ui-extensions/pull/2014) [`ac077c8becee6f02fbb4fd9f04d029dbf9b838f2`](https://github.com/Shopify/ui-extensions/commit/ac077c8becee6f02fbb4fd9f04d029dbf9b838f2) Thanks [@oliverigor](https://github.com/oliverigor)! - Add Switch component

- [#1942](https://github.com/Shopify/ui-extensions/pull/1942) [`b086046068ccb984b37c92a4e17378ada1774524`](https://github.com/Shopify/ui-extensions/commit/b086046068ccb984b37c92a4e17378ada1774524) Thanks [@jamesvidler](https://github.com/jamesvidler)! - Improve error messaging when a React hook is used from a different API surface than the extension calling it.

- Updated dependencies [[`5ded8d2cb5d9ae502aa75183714f84dc92b820ea`](https://github.com/Shopify/ui-extensions/commit/5ded8d2cb5d9ae502aa75183714f84dc92b820ea), [`199a90fef0f4ce90a8f6ae6a8298c9d9c437f2f4`](https://github.com/Shopify/ui-extensions/commit/199a90fef0f4ce90a8f6ae6a8298c9d9c437f2f4), [`ba2510f0f4737a56abe4171a08b8adea4488f8b4`](https://github.com/Shopify/ui-extensions/commit/ba2510f0f4737a56abe4171a08b8adea4488f8b4), [`952489d3c27a2f5c8bcdad29e516480fe71e94e8`](https://github.com/Shopify/ui-extensions/commit/952489d3c27a2f5c8bcdad29e516480fe71e94e8), [`321749e68edf6d64a82ffe2c4c99d0f19ac4e63c`](https://github.com/Shopify/ui-extensions/commit/321749e68edf6d64a82ffe2c4c99d0f19ac4e63c), [`a87b8f3ac19ba9db78ed5933c2e0099195dc8c5b`](https://github.com/Shopify/ui-extensions/commit/a87b8f3ac19ba9db78ed5933c2e0099195dc8c5b), [`47512e33ddfb3d99a48fbcebdd20647cbc149fd7`](https://github.com/Shopify/ui-extensions/commit/47512e33ddfb3d99a48fbcebdd20647cbc149fd7), [`3c3505c16c1deb6f202cbecf6747c0fdc6b79228`](https://github.com/Shopify/ui-extensions/commit/3c3505c16c1deb6f202cbecf6747c0fdc6b79228), [`0c05f0d17d91a9cb7ad61f1806d7d0a20bd09912`](https://github.com/Shopify/ui-extensions/commit/0c05f0d17d91a9cb7ad61f1806d7d0a20bd09912), [`c30a9639a5209862f4177f26ef3bc26e299c3c7b`](https://github.com/Shopify/ui-extensions/commit/c30a9639a5209862f4177f26ef3bc26e299c3c7b), [`0fd33b35c651b89d24c4fc560f376e91658d70a6`](https://github.com/Shopify/ui-extensions/commit/0fd33b35c651b89d24c4fc560f376e91658d70a6), [`a4f275abcb0c0166e0383fc5c1ed544b938def29`](https://github.com/Shopify/ui-extensions/commit/a4f275abcb0c0166e0383fc5c1ed544b938def29), [`9c1777d48e0d81fea811cfbcd9764e98cf65778d`](https://github.com/Shopify/ui-extensions/commit/9c1777d48e0d81fea811cfbcd9764e98cf65778d), [`08067cbba140d72f115e38f218dd0caead13f0d5`](https://github.com/Shopify/ui-extensions/commit/08067cbba140d72f115e38f218dd0caead13f0d5), [`ac077c8becee6f02fbb4fd9f04d029dbf9b838f2`](https://github.com/Shopify/ui-extensions/commit/ac077c8becee6f02fbb4fd9f04d029dbf9b838f2), [`bf839358269255bb6a86fd9a64295b4ea89d6004`](https://github.com/Shopify/ui-extensions/commit/bf839358269255bb6a86fd9a64295b4ea89d6004), [`c8d876e83f3144361e09c375c3dc89af2029655b`](https://github.com/Shopify/ui-extensions/commit/c8d876e83f3144361e09c375c3dc89af2029655b), [`c2c51b82135fadf9dd4a2b1ad95dc59cabd9064c`](https://github.com/Shopify/ui-extensions/commit/c2c51b82135fadf9dd4a2b1ad95dc59cabd9064c), [`b086046068ccb984b37c92a4e17378ada1774524`](https://github.com/Shopify/ui-extensions/commit/b086046068ccb984b37c92a4e17378ada1774524), [`0016e7e5031934e21b26398958d69b97a20ccebd`](https://github.com/Shopify/ui-extensions/commit/0016e7e5031934e21b26398958d69b97a20ccebd), [`a744908ee0cedbc627a7bfac18294f34cad8746d`](https://github.com/Shopify/ui-extensions/commit/a744908ee0cedbc627a7bfac18294f34cad8746d), [`f9a593edd7bc6ea9f46f3927efd3b9fa6ebc5b5a`](https://github.com/Shopify/ui-extensions/commit/f9a593edd7bc6ea9f46f3927efd3b9fa6ebc5b5a)]:
- @shopify/ui-extensions@2024.7.0

## 2024.4.0

### Minor Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/ui-extensions-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shopify/ui-extensions-react",
"version": "0.0.0-unstable",
"version": "2024.7.0",
"description": "React bindings for @shopify/ui-extensions",
"publishConfig": {
"access": "public",
Expand Down Expand Up @@ -66,7 +66,7 @@
"@types/react": ">=18.2.67"
},
"peerDependencies": {
"@shopify/ui-extensions": "0.0.0-unstable",
"@shopify/ui-extensions": "2024.7.0",
"react": ">=18.0.0"
},
"peerDependenciesMeta": {
Expand All @@ -80,7 +80,7 @@
"devDependencies": {
"@faker-js/faker": "^8.4.1",
"@quilted/react-testing": "^0.5.31",
"@shopify/ui-extensions": "0.0.0-unstable",
"@shopify/ui-extensions": "2024.7.0",
"react": "^18.0.0",
"react-reconciler": "0.29.0",
"react-test-renderer": "^18.2.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React from 'react';
import {reactExtension, useApi, AdminAction, Button, TextField, Select, BlockStack} from '@shopify/ui-extensions-react/admin';

function App() {
const {data, close} = useApi('admin.product-details.action.render');
const productId = data.selected[0]?.id;

return (
<AdminAction
title="Assign warehouse location"
primaryAction={
<Button
onPress={async () => {
await fetch('/api/products/assign-warehouse', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({productId}),
});
close();
}}
>
Assign to warehouse
</Button>
}
secondaryAction={
<Button onPress={() => close()}>Cancel</Button>
}
>
<BlockStack gap>
<TextField label="Warehouse SKU" name="warehouseSku" required />
<Select
label="Target warehouse"
name="warehouse"
options={[
{label: 'East Coast — New York', value: 'nyc'},
{label: 'West Coast — Los Angeles', value: 'lax'},
{label: 'Central — Chicago', value: 'chi'},
]}
/>
</BlockStack>
</AdminAction>
);
}

export default reactExtension(
'admin.product-details.action.render',
() => <App />,
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React, {useState, useEffect} from 'react';
import {reactExtension, useApi, AdminAction, Button, Text, ProgressIndicator, BlockStack} from '@shopify/ui-extensions-react/admin';

function App() {
const {data, close, query} = useApi('admin.product-details.action.render');
const productId = data.selected[0]?.id;
const [product, setProduct] = useState(null);
const [loading, setLoading] = useState(true);

useEffect(() => {
query(
`query Product($id: ID!) {
product(id: $id) { title status totalInventory }
}`,
{variables: {id: productId}},
).then((result) => {
setProduct(result?.data?.product);
setLoading(false);
});
}, [productId, query]);

return (
<AdminAction
title="Product details"
primaryAction={<Button onPress={() => close()}>Done</Button>}
>
<BlockStack gap>
{loading ? (
<ProgressIndicator
size="small-200"
accessibilityLabel="Loading product details"
/>
) : product ? (
<>
<Text fontWeight="bold">{product.title}</Text>
<Text>Status: {product.status}</Text>
<Text>Inventory: {product.totalInventory} units</Text>
</>
) : null}
</BlockStack>
</AdminAction>
);
}

export default reactExtension(
'admin.product-details.action.render',
() => <App />,
);
Loading
Loading