diff --git a/.changeset/brave-rivers-crash.md b/.changeset/brave-rivers-crash.md deleted file mode 100644 index c7ecfaf75b..0000000000 --- a/.changeset/brave-rivers-crash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/ui-extensions': minor ---- - -Add size property to Modal diff --git a/.changeset/breezy-mangos-fry.md b/.changeset/breezy-mangos-fry.md deleted file mode 100644 index 32a945930f..0000000000 --- a/.changeset/breezy-mangos-fry.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/ui-extensions-react': minor -'@shopify/ui-extensions': minor ---- - -Adds `type` property to `selectedPaymentOption` diff --git a/.changeset/eight-peas-buy.md b/.changeset/eight-peas-buy.md deleted file mode 100644 index 4a97686363..0000000000 --- a/.changeset/eight-peas-buy.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/ui-extensions-react': minor -'@shopify/ui-extensions': minor ---- - -Add primary and secondary actions to Modal component diff --git a/.changeset/fast-crabs-act.md b/.changeset/fast-crabs-act.md deleted file mode 100644 index 1ba60aae25..0000000000 --- a/.changeset/fast-crabs-act.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/ui-extensions-react': patch -'@shopify/ui-extensions': patch ---- - -expose Switch component to customer account unstable surface diff --git a/.changeset/fast-geckos-double.md b/.changeset/fast-geckos-double.md deleted file mode 100644 index 6271ef6d57..0000000000 --- a/.changeset/fast-geckos-double.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/ui-extensions': patch ---- - -Add missing documentation for `auth.idToken()` API diff --git a/.changeset/gold-pillows-protect.md b/.changeset/gold-pillows-protect.md deleted file mode 100644 index 2659815af6..0000000000 --- a/.changeset/gold-pillows-protect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/ui-extensions': minor ---- - -Add currencyCode to admin MoneyField component diff --git a/.changeset/light-dancers-pump.md b/.changeset/light-dancers-pump.md deleted file mode 100644 index 1486a7bb5a..0000000000 --- a/.changeset/light-dancers-pump.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/ui-extensions': minor ---- - -Add suffix to NumberField and TextField diff --git a/.changeset/lucky-beds-shout.md b/.changeset/lucky-beds-shout.md deleted file mode 100644 index 7139371a20..0000000000 --- a/.changeset/lucky-beds-shout.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/ui-extensions': major ---- - -customer account ui extensions order status `shop.storefrontUrl` does not contain a trailing slash anymore diff --git a/.changeset/many-houses-build.md b/.changeset/many-houses-build.md deleted file mode 100644 index 7d441673aa..0000000000 --- a/.changeset/many-houses-build.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/ui-extensions': minor ---- - -add accessibilityLabel to admin's Button diff --git a/.changeset/mean-trains-fly.md b/.changeset/mean-trains-fly.md deleted file mode 100644 index 75f193fc7a..0000000000 --- a/.changeset/mean-trains-fly.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/ui-extensions-react': minor -'@shopify/ui-extensions': minor ---- - -update generate-doc version, add attributes to Icon diff --git a/.changeset/new-badgers-mix.md b/.changeset/new-badgers-mix.md deleted file mode 100644 index cc13ef4774..0000000000 --- a/.changeset/new-badgers-mix.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/ui-extensions': patch -'@shopify/ui-extensions-react': patch ---- - -add full page navigation api to order full page extension target diff --git a/.changeset/proud-baboons-work.md b/.changeset/proud-baboons-work.md deleted file mode 100644 index a226de5e1c..0000000000 --- a/.changeset/proud-baboons-work.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/ui-extensions': minor ---- - -New Action Extension targets: Catalog, Company, Gift Card diff --git a/.changeset/shiny-frogs-reflect.md b/.changeset/shiny-frogs-reflect.md deleted file mode 100644 index 96452e7bd8..0000000000 --- a/.changeset/shiny-frogs-reflect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/ui-extensions': minor ---- - -Add metafields to PickupPointOption diff --git a/.changeset/silly-balloons-turn.md b/.changeset/soft-clowns-turn.md similarity index 63% rename from .changeset/silly-balloons-turn.md rename to .changeset/soft-clowns-turn.md index 3bed4e2754..05c7fcd4aa 100644 --- a/.changeset/silly-balloons-turn.md +++ b/.changeset/soft-clowns-turn.md @@ -1,6 +1,6 @@ --- -'@shopify/ui-extensions': patch '@shopify/ui-extensions-react': patch +'@shopify/ui-extensions': patch --- -Add customer-account.order.page.render target +update Screen.onReceiveParams description diff --git a/.changeset/tall-bees-scream.md b/.changeset/tall-bees-scream.md deleted file mode 100644 index db1aca49ca..0000000000 --- a/.changeset/tall-bees-scream.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/ui-extensions': minor ---- - -Address autocomplete extensions now support 'company', 'latitude', and 'longitude' values diff --git a/.changeset/tasty-coats-shave.md b/.changeset/tasty-coats-shave.md deleted file mode 100644 index ba74b4dd25..0000000000 --- a/.changeset/tasty-coats-shave.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/ui-extensions-react': patch -'@shopify/ui-extensions': patch ---- - -update error message for useNavigationCurrentEntry api diff --git a/.changeset/tasty-trainers-lick.md b/.changeset/tasty-trainers-lick.md deleted file mode 100644 index 3d63c0fec2..0000000000 --- a/.changeset/tasty-trainers-lick.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/ui-extensions': minor ---- - -Add display:none to Box diff --git a/.changeset/violet-lamps-relate.md b/.changeset/violet-lamps-relate.md deleted file mode 100644 index d6a479ffa5..0000000000 --- a/.changeset/violet-lamps-relate.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/ui-extensions-react': minor -'@shopify/ui-extensions': minor ---- - -Add QRCode component diff --git a/.changeset/warm-tigers-sin.md b/.changeset/warm-tigers-sin.md deleted file mode 100644 index e7420950c6..0000000000 --- a/.changeset/warm-tigers-sin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/ui-extensions': patch ---- - -Improve TypeScript definition for the Position type used by the position property diff --git a/.changeset/young-buckets-punch.md b/.changeset/young-buckets-punch.md deleted file mode 100644 index 7bce7f5929..0000000000 --- a/.changeset/young-buckets-punch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/ui-extensions': patch ---- - -Add admin company location block diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e24f13b748..091281aff4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 }} @@ -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 }} diff --git a/packages/ui-extensions-react/CHANGELOG.md b/packages/ui-extensions-react/CHANGELOG.md index 1a8f30bd8e..f629748e87 100644 --- a/packages/ui-extensions-react/CHANGELOG.md +++ b/packages/ui-extensions-react/CHANGELOG.md @@ -1,5 +1,48 @@ # @shopify/ui-extensions-react +## 2024.10.2 + +### Patch Changes + +- [#2514](https://github.com/Shopify/ui-extensions/pull/2514) [`45f4980788fe94ba58ad9c44bbfb80294bb3ad20`](https://github.com/Shopify/ui-extensions/commit/45f4980788fe94ba58ad9c44bbfb80294bb3ad20) Thanks [@cpeddecord](https://github.com/cpeddecord)! - Releasing Chat into the wild, for real this time + +- Updated dependencies [[`45f4980788fe94ba58ad9c44bbfb80294bb3ad20`](https://github.com/Shopify/ui-extensions/commit/45f4980788fe94ba58ad9c44bbfb80294bb3ad20)]: + - @shopify/ui-extensions@2024.10.2 + +## 2024.10.1 + +### Patch Changes + +- [#2482](https://github.com/Shopify/ui-extensions/pull/2482) [`5e847761d9e0ce2d03fb2971e132810f9696c10f`](https://github.com/Shopify/ui-extensions/commit/5e847761d9e0ce2d03fb2971e132810f9696c10f) Thanks [@js-goupil](https://github.com/js-goupil)! - Added support for Host to unmount UI Extensions + +- Updated dependencies [[`5e847761d9e0ce2d03fb2971e132810f9696c10f`](https://github.com/Shopify/ui-extensions/commit/5e847761d9e0ce2d03fb2971e132810f9696c10f)]: + - @shopify/ui-extensions@2024.10.1 + +## 2024.10.0 + +### Minor Changes + +- [#2371](https://github.com/Shopify/ui-extensions/pull/2371) [`28edde440ceee584c71c5ac983252ca71a7f853a`](https://github.com/Shopify/ui-extensions/commit/28edde440ceee584c71c5ac983252ca71a7f853a) Thanks [@shopify-github-actions-access](https://github.com/apps/shopify-github-actions-access)! - Adds `type` property to `selectedPaymentOption` + +- [#2361](https://github.com/Shopify/ui-extensions/pull/2361) [`89438897001dce9058030e6ee1655747a66ec71a`](https://github.com/Shopify/ui-extensions/commit/89438897001dce9058030e6ee1655747a66ec71a) Thanks [@oliverigor](https://github.com/oliverigor)! - Add primary and secondary actions to Modal component + +- [#2297](https://github.com/Shopify/ui-extensions/pull/2297) [`7ab538090e8bcef052bfc782b31639efe89ff262`](https://github.com/Shopify/ui-extensions/commit/7ab538090e8bcef052bfc782b31639efe89ff262) Thanks [@shopify-github-actions-access](https://github.com/apps/shopify-github-actions-access)! - update generate-doc version, add attributes to Icon + +- [#2220](https://github.com/Shopify/ui-extensions/pull/2220) [`9e619fca6ea4f816148c90158b46bc1db5bfbad7`](https://github.com/Shopify/ui-extensions/commit/9e619fca6ea4f816148c90158b46bc1db5bfbad7) Thanks [@LucasLacerdaUX](https://github.com/LucasLacerdaUX)! - Add QRCode component + +### Patch Changes + +- [#2284](https://github.com/Shopify/ui-extensions/pull/2284) [`f84592931962537d345dfd68bf2a2f2396373740`](https://github.com/Shopify/ui-extensions/commit/f84592931962537d345dfd68bf2a2f2396373740) Thanks [@brianshen1990](https://github.com/brianshen1990)! - expose Switch component to customer account unstable surface + +- [#2356](https://github.com/Shopify/ui-extensions/pull/2356) [`a2d458be51a708aeac6a1879554051f98371f908`](https://github.com/Shopify/ui-extensions/commit/a2d458be51a708aeac6a1879554051f98371f908) Thanks [@brianshen1990](https://github.com/brianshen1990)! - add full page navigation api to order full page extension target + +- [#2347](https://github.com/Shopify/ui-extensions/pull/2347) [`dd8a861caba591c1087e8349e8a9bbfdc2681cb8`](https://github.com/Shopify/ui-extensions/commit/dd8a861caba591c1087e8349e8a9bbfdc2681cb8) Thanks [@brianshen1990](https://github.com/brianshen1990)! - Add customer-account.order.page.render target + +- [#2369](https://github.com/Shopify/ui-extensions/pull/2369) [`7ef1d9cdd37c42277e240eb660e08de54967461c`](https://github.com/Shopify/ui-extensions/commit/7ef1d9cdd37c42277e240eb660e08de54967461c) Thanks [@brianshen1990](https://github.com/brianshen1990)! - update error message for useNavigationCurrentEntry api + +- Updated dependencies [[`21234eea51b50dfc53d3fc4962512728b4a19446`](https://github.com/Shopify/ui-extensions/commit/21234eea51b50dfc53d3fc4962512728b4a19446), [`28edde440ceee584c71c5ac983252ca71a7f853a`](https://github.com/Shopify/ui-extensions/commit/28edde440ceee584c71c5ac983252ca71a7f853a), [`89438897001dce9058030e6ee1655747a66ec71a`](https://github.com/Shopify/ui-extensions/commit/89438897001dce9058030e6ee1655747a66ec71a), [`f84592931962537d345dfd68bf2a2f2396373740`](https://github.com/Shopify/ui-extensions/commit/f84592931962537d345dfd68bf2a2f2396373740), [`9347443b76210c2f9f3ce45bb488c38ec08efb6f`](https://github.com/Shopify/ui-extensions/commit/9347443b76210c2f9f3ce45bb488c38ec08efb6f), [`fd4ecf2aef0414e790a4a78ae6a9fa013acbafda`](https://github.com/Shopify/ui-extensions/commit/fd4ecf2aef0414e790a4a78ae6a9fa013acbafda), [`118654e61e393c2885198ab5dafddb4cf4d62669`](https://github.com/Shopify/ui-extensions/commit/118654e61e393c2885198ab5dafddb4cf4d62669), [`4dec3851bf53f6cf289ca8c265cd13f8c123ab06`](https://github.com/Shopify/ui-extensions/commit/4dec3851bf53f6cf289ca8c265cd13f8c123ab06), [`9fe9d56d190fee5ee444ed980a5ef60106dfda12`](https://github.com/Shopify/ui-extensions/commit/9fe9d56d190fee5ee444ed980a5ef60106dfda12), [`7ab538090e8bcef052bfc782b31639efe89ff262`](https://github.com/Shopify/ui-extensions/commit/7ab538090e8bcef052bfc782b31639efe89ff262), [`a2d458be51a708aeac6a1879554051f98371f908`](https://github.com/Shopify/ui-extensions/commit/a2d458be51a708aeac6a1879554051f98371f908), [`8bca1a1710431083b7e98966ec76f3fe17720d5c`](https://github.com/Shopify/ui-extensions/commit/8bca1a1710431083b7e98966ec76f3fe17720d5c), [`a8de80b0e252ebd0c529bfe88d02d2e35e2a0461`](https://github.com/Shopify/ui-extensions/commit/a8de80b0e252ebd0c529bfe88d02d2e35e2a0461), [`dd8a861caba591c1087e8349e8a9bbfdc2681cb8`](https://github.com/Shopify/ui-extensions/commit/dd8a861caba591c1087e8349e8a9bbfdc2681cb8), [`f81712b643430dd1cbdce54b3edf0c80bc0dafe5`](https://github.com/Shopify/ui-extensions/commit/f81712b643430dd1cbdce54b3edf0c80bc0dafe5), [`7ef1d9cdd37c42277e240eb660e08de54967461c`](https://github.com/Shopify/ui-extensions/commit/7ef1d9cdd37c42277e240eb660e08de54967461c), [`37620b9d47f38586c843a9c11a6de2e0461bc0dd`](https://github.com/Shopify/ui-extensions/commit/37620b9d47f38586c843a9c11a6de2e0461bc0dd), [`9e619fca6ea4f816148c90158b46bc1db5bfbad7`](https://github.com/Shopify/ui-extensions/commit/9e619fca6ea4f816148c90158b46bc1db5bfbad7), [`9f7ee640e434bb175b90248c29bb194f321e871a`](https://github.com/Shopify/ui-extensions/commit/9f7ee640e434bb175b90248c29bb194f321e871a), [`d6ac8d4e4180eef5242719bfaffe998441be1aa9`](https://github.com/Shopify/ui-extensions/commit/d6ac8d4e4180eef5242719bfaffe998441be1aa9)]: + - @shopify/ui-extensions@2024.10.0 + ## 2024.4.0 ### Minor Changes diff --git a/packages/ui-extensions-react/README.md b/packages/ui-extensions-react/README.md index f0b4a0433f..efd3a97b5e 100644 --- a/packages/ui-extensions-react/README.md +++ b/packages/ui-extensions-react/README.md @@ -6,7 +6,7 @@ This package contains the public type definitions and utilities needed to create Currently, this package only contains the extension APIs for the [`checkout` surface](./src/surfaces/checkout), but other Shopify surfaces will be added here soon. -All extensions, regardless of where they appear in Shopify, make use the same [underlying technology](../../documentation/how-extensions-work.md), and most of the same “core” components (e.g., `BlockStack`, `Button`, `TextField`, etc) and capabilities (e.g., direct API access, session tokens). Separating APIs by surface makes it easier for a developer to see what is available to them in each context, and gives us a flexible system for introducing components and APIs available in only some areas of Shopify. +All extensions, regardless of where they appear in Shopify, make use of the same [underlying technology](../../documentation/how-extensions-work.md), and most of the same “core” components (e.g., `BlockStack`, `Button`, `TextField`, etc) and capabilities (e.g., direct API access, session tokens). Separating APIs by surface makes it easier for a developer to see what is available to them in each context, and gives us a flexible system for introducing components and APIs available in only some areas of Shopify. A checkout extension using React would be written as follows: diff --git a/packages/ui-extensions-react/package.json b/packages/ui-extensions-react/package.json index d7523dc844..a264e4611d 100644 --- a/packages/ui-extensions-react/package.json +++ b/packages/ui-extensions-react/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/ui-extensions-react", - "version": "0.0.0-unstable", + "version": "2024.10.2", "description": "React bindings for @shopify/ui-extensions", "publishConfig": { "access": "public", @@ -66,7 +66,7 @@ "@types/react": ">=18.2.67" }, "peerDependencies": { - "@shopify/ui-extensions": "0.0.0-unstable", + "@shopify/ui-extensions": "2024.10.2", "react": ">=18.0.0" }, "peerDependenciesMeta": { @@ -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.10.2", "react": "^18.0.0", "react-reconciler": "0.29.0", "react-test-renderer": "^18.2.0" diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/AdminAction/examples/adminaction-form.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/AdminAction/examples/adminaction-form.example.tsx new file mode 100644 index 0000000000..94b5ca6864 --- /dev/null +++ b/packages/ui-extensions-react/src/surfaces/admin/components/AdminAction/examples/adminaction-form.example.tsx @@ -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 ( + { + await fetch('/api/products/assign-warehouse', { + method: 'POST', + headers: {'Content-Type': 'application/json'}, + body: JSON.stringify({productId}), + }); + close(); + }} + > + Assign to warehouse + + } + secondaryAction={ + + } + > + + + + + { + setShippingClass(value); + setError(undefined); + }} + /> + + + ); +} + +export default reactExtension( + 'admin.product-details.action.render', + () => , +); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Select/examples/select-placeholder.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Select/examples/select-placeholder.example.tsx new file mode 100644 index 0000000000..c4963290c4 --- /dev/null +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Select/examples/select-placeholder.example.tsx @@ -0,0 +1,27 @@ +import {reactExtension, Select, BlockStack, Text} from '@shopify/ui-extensions-react/admin'; + +function App() { + + return ( + + Product classification +