-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
511 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 7 additions & 10 deletions
17
packages/ui-extensions-react/src/surfaces/checkout/hooks/extension.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
import type { | ||
Extension, | ||
RenderExtensionTarget, | ||
} from '@shopify/ui-extensions/checkout'; | ||
import type {Extension} from '@shopify/ui-extensions/checkout'; | ||
|
||
import {useApi} from './api'; | ||
|
||
/** | ||
* Returns the metadata about the extension. | ||
*/ | ||
export function useExtension< | ||
Target extends RenderExtensionTarget = RenderExtensionTarget, | ||
>(): Extension<Target> { | ||
return useApi<Target>().extension as Extension<Target>; | ||
export function useExtension(): Extension { | ||
return useApi().extension as Extension; | ||
} | ||
|
||
/** | ||
* Returns the metadata about the extension. | ||
* | ||
* > Caution: This is deprecated, use `useExtension()` instead. | ||
* @deprecated Use `useExtension()` instead. | ||
*/ | ||
export const useExtensionData = useExtension; | ||
export function useExtensionData(): Extension { | ||
return useExtension(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/ui-extensions-react/src/surfaces/customer-account/hooks/extension.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type {Extension} from '@shopify/ui-extensions/customer-account'; | ||
|
||
import {useApi} from './api'; | ||
|
||
/** | ||
* Returns the metadata about the extension. | ||
*/ | ||
export function useExtension(): Extension { | ||
return useApi().extension; | ||
} | ||
|
||
/** | ||
* Returns the metadata about the extension. | ||
* > Caution: This is deprecated, use `useExtension()` instead. | ||
* @deprecated Use `useExtension()` instead. | ||
*/ | ||
export function useExtensionData(): Extension { | ||
return useExtension(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/ui-extensions/docs/surfaces/checkout/reference/hooks/extension.doc.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'; | ||
|
||
import {getLinksByTag} from '../helper.docs'; | ||
|
||
const data: ReferenceEntityTemplateSchema = { | ||
name: 'useExtension', | ||
description: '', | ||
descriptionType: 'UseExtensionGeneratedType', | ||
isVisualComponent: false, | ||
type: 'hook', | ||
category: 'React Hooks', | ||
subCategory: 'Metadata', | ||
definitions: [ | ||
{ | ||
title: '', | ||
description: '', | ||
type: 'UseExtensionGeneratedType', | ||
}, | ||
], | ||
related: getLinksByTag('apis'), | ||
}; | ||
|
||
export default data; |
Binary file modified
BIN
+9.6 KB
(160%)
.../ui-extensions/docs/surfaces/checkout/screenshots/dynamic-extension-targets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+11 KB
(150%)
...s/ui-extensions/docs/surfaces/checkout/screenshots/static-extension-targets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.56 KB
(99%)
...tensions/docs/surfaces/checkout/screenshots/supported-locations-information.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.76 KB
(97%)
...ensions/docs/surfaces/checkout/screenshots/supported-locations-local-pickup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+152 Bytes
(100%)
...ns/docs/surfaces/checkout/screenshots/supported-locations-one-page-checkout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.81 KB
(100%)
...ensions/docs/surfaces/checkout/screenshots/supported-locations-order-status.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.6 KB
(97%)
...urfaces/checkout/screenshots/supported-locations-order-summary-order-status.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.48 KB
(97%)
...s/surfaces/checkout/screenshots/supported-locations-order-summary-thank-you.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+11.4 KB
(110%)
...nsions/docs/surfaces/checkout/screenshots/supported-locations-order-summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.13 KB
(100%)
...i-extensions/docs/surfaces/checkout/screenshots/supported-locations-payment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.34 KB
(100%)
...nsions/docs/surfaces/checkout/screenshots/supported-locations-pickup-points.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+561 Bytes
(100%)
...-extensions/docs/surfaces/checkout/screenshots/supported-locations-shipping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.29 KB
(100%)
...-extensions/docs/surfaces/checkout/screenshots/supported-locations-shop-pay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+8.14 KB
(100%)
...extensions/docs/surfaces/checkout/screenshots/supported-locations-thank-you.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions
18
.../ui-extensions/docs/surfaces/checkout/staticPages/examples/migration/migration-output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
❯ yarn deploy | ||
yarn run v1.22.19 | ||
$ shopify app deploy | ||
|
||
╭─ info ───────────────────────────────────────────────────────────────────────────────────────────────╮ | ||
│ │ | ||
│ Extension migrations can't be undone. │ | ||
│ │ | ||
│ Your "my-extension" configuration has been updated. Migrating gives you access to new │ | ||
│ features and won't impact the end user experience. All previous extension versions will reflect │ | ||
│ this change. │ | ||
│ │ | ||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ | ||
|
||
? Migrate "my-extension"? | ||
|
||
> (y) Yes, confirm migration from "checkout_ui_extension" | ||
(n) No, cancel |
Oops, something went wrong.