Skip to content

Commit 280778e

Browse files
authored
Syncing private package for 2026-01 release (#3730)
* syncing private package for 2026-01 release * add buyer journey updates
1 parent cca70fe commit 280778e

File tree

105 files changed

+868
-2196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+868
-2196
lines changed

.changeset/hot-olives-act.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/ui-extensions': patch
3+
---
4+
5+
recommend merchant friendly warning for enabling checkout extension to block progress

packages/ui-extensions/docs/surfaces/checkout/reference/apis/buyer-journey.doc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const data: ReferenceEntityTemplateSchema = {
3939
To block checkout progress, you must set the [block_progress](/docs/api/checkout-ui-extensions/configuration#block-progress) capability in your extension's configuration.
4040
If you do, then you're expected to inform the buyer why navigation was blocked, either by passing validation errors to the checkout UI or rendering the errors in your extension.
4141
\`useBuyerJourneyIntercept()\` should be called at the top level of the extension, not within an embedded or child component, to avoid errors should the child component get destroyed.
42+
It is good practice to show a warning in the checkout editor when the merchant has not given permission for your extension to block checkout progress.
4243
`,
4344
type: 'UseBuyerJourneyInterceptGeneratedType',
4445
},

packages/ui-extensions/docs/surfaces/checkout/reference/examples/buyer-journey-intercept/extension-banner.example.tsx

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import '@shopify/ui-extensions/preact';
22
import {render} from 'preact';
33
import {useState} from 'preact/hooks';
44

5-
import {useBuyerJourneyIntercept} from '@shopify/ui-extensions/checkout/preact';
5+
import {
6+
useBuyerJourneyIntercept,
7+
useExtensionEditor,
8+
useExtensionCapability,
9+
} from '@shopify/ui-extensions/checkout/preact';
610

711
export default function extension() {
812
render(<Extension />, document.body);
@@ -11,6 +15,9 @@ export default function extension() {
1115
function Extension() {
1216
const [showError, setShowError] =
1317
useState(false);
18+
const editorType = useExtensionEditor()?.type;
19+
const blockProgressGranted =
20+
useExtensionCapability('block_progress');
1421

1522
useBuyerJourneyIntercept(
1623
({canBlockProgress}) => {
@@ -34,9 +41,25 @@ function Extension() {
3441
},
3542
);
3643

37-
return showError ? (
38-
<s-banner tone="critical">
39-
This item has a limit of one per customer.
40-
</s-banner>
41-
) : null;
44+
return (
45+
<>
46+
{editorType === 'checkout' &&
47+
!blockProgressGranted ? (
48+
<s-banner
49+
tone="warning"
50+
heading="This app may be misconfigured"
51+
>
52+
To allow this app to block checkout,
53+
enable this behavior in "Checkout
54+
behavior" settings.
55+
</s-banner>
56+
) : null}
57+
{showError ? (
58+
<s-banner tone="critical">
59+
This item has a limit of one per
60+
customer.
61+
</s-banner>
62+
) : null}
63+
</>
64+
);
4265
}

packages/ui-extensions/docs/surfaces/checkout/reference/examples/buyer-journey-intercept/page-level-error.example.tsx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
import '@shopify/ui-extensions/preact';
22
import {render} from 'preact';
33

4-
import {useBuyerJourneyIntercept} from '@shopify/ui-extensions/checkout/preact';
4+
import {
5+
useBuyerJourneyIntercept,
6+
useExtensionEditor,
7+
useExtensionCapability,
8+
} from '@shopify/ui-extensions/checkout/preact';
59

610
export default function extension() {
711
render(<Extension />, document.body);
812
}
913

1014
function Extension() {
15+
const editorType = useExtensionEditor()?.type;
16+
const blockProgressGranted =
17+
useExtensionCapability('block_progress');
18+
1119
useBuyerJourneyIntercept(
1220
({canBlockProgress}) => {
1321
return canBlockProgress &&
@@ -32,5 +40,19 @@ function Extension() {
3240
},
3341
);
3442

35-
return null;
43+
return (
44+
<>
45+
{editorType === 'checkout' &&
46+
!blockProgressGranted ? (
47+
<s-banner
48+
tone="warning"
49+
heading="This app may be misconfigured"
50+
>
51+
To allow this app to block checkout,
52+
enable this behavior in "Checkout
53+
behavior" settings.
54+
</s-banner>
55+
) : null}
56+
</>
57+
);
3658
}

packages/ui-extensions/docs/surfaces/checkout/reference/examples/buyer-journey-intercept/target-native-field.example.tsx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
import '@shopify/ui-extensions/preact';
22
import {render} from 'preact';
33

4-
import {useBuyerJourneyIntercept} from '@shopify/ui-extensions/checkout/preact';
4+
import {
5+
useBuyerJourneyIntercept,
6+
useExtensionEditor,
7+
useExtensionCapability,
8+
} from '@shopify/ui-extensions/checkout/preact';
59

610
export default function extension() {
711
render(<Extension />, document.body);
812
}
913

1014
function Extension() {
15+
const editorType = useExtensionEditor()?.type;
16+
const blockProgressGranted =
17+
useExtensionCapability('block_progress');
18+
1119
useBuyerJourneyIntercept(
1220
({canBlockProgress}) => {
1321
return canBlockProgress &&
@@ -39,5 +47,19 @@ function Extension() {
3947
},
4048
);
4149

42-
return null;
50+
return (
51+
<>
52+
{editorType === 'checkout' &&
53+
!blockProgressGranted ? (
54+
<s-banner
55+
tone="warning"
56+
heading="This app may be misconfigured"
57+
>
58+
To allow this app to block checkout,
59+
enable this behavior in "Checkout
60+
behavior" settings.
61+
</s-banner>
62+
) : null}
63+
</>
64+
);
4365
}

packages/ui-extensions/docs/surfaces/checkout/reference/examples/extension-targets.example.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
api_version = "2025-10"
1+
api_version = "2026-01"
22

33
[[extensions]]
44
name = "My checkout extension"
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
api_version = "2025-10"
1+
api_version = "2026-01"
22

33
[[extensions]]
44
name = "My checkout extension"
55
handle = "checkout-ui"
66
uid = "fddfc370-27c7-c30f-4ee0-a927194e2accadefd40c"
77
type = "ui_extension"
88

9-
[[extensions.targeting]]
10-
target = "purchase.checkout.block.render"
11-
module = "./Checkout.jsx"
9+
[[extensions.targeting]]
10+
target = "purchase.checkout.block.render"
11+
module = "./Checkout.jsx"
1212

13-
[extensions.settings]
14-
[[extensions.settings.fields]]
15-
key = "banner_title"
16-
type = "single_line_text_field"
17-
name = "Banner title"
18-
description = "Enter a title for the banner."
19-
[[extensions.settings.fields.validations]]
20-
name = "min"
21-
value = "5"
22-
[[extensions.settings.fields.validations]]
23-
name = "max"
24-
value = "20"
13+
[extensions.settings]
14+
[[extensions.settings.fields]]
15+
key = "banner_title"
16+
type = "single_line_text_field"
17+
name = "Banner title"
18+
description = "Enter a title for the banner."
19+
[[extensions.settings.fields.validations]]
20+
name = "min"
21+
value = "5"
22+
[[extensions.settings.fields.validations]]
23+
name = "max"
24+
value = "20"
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
api_version = "2025-10"
1+
api_version = "2026-01"
22

33
[[extensions]]
44
type = "ui_extension"
55
name = "Your checkout extension"
66
handle = "checkout-ui"
77
uid = "fddfc370-27c7-c30f-4ee0-a927194e2accadefd40c"
88

9-
[[extensions.targeting]]
10-
target = "purchase.checkout.block.render"
11-
module = "./Extension.jsx"
12-
9+
[[extensions.targeting]]
10+
target = "purchase.checkout.block.render"
11+
module = "./Extension.jsx"

packages/ui-extensions/docs/surfaces/checkout/staticPages/examples/configuration/extended.example.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
api_version = "2025-10"
1+
api_version ="2026-01"
22

33
[[extensions]]
44
type = "ui_extension"

packages/ui-extensions/docs/surfaces/checkout/staticPages/examples/configuration/settings.example.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
api_version = "2025-10"
1+
api_version = "2026-01"
22

33
[[extensions]]
44
type = "ui_extension"

0 commit comments

Comments
 (0)