@salesforce/retail-react-app 10.2.0-preview.0 → 10.2.1-preview.0

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.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
- ## v10.2.0-preview.0 (Aug 07, 2026)
1
+ ## v10.2.1-preview.0
2
+ - [Bugfix] Keep the Page Designer preview URL bar synchronized with client-side navigation. The storefront now parses the exact `mode` query parameter, and the Page Designer initializer emits `notifyClientRouteChanged(url)` after the preview channel is connected whenever the SPA route changes. Bumps `@salesforce/storefront-next-runtime` to `1.3.1`. [#4021](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/4021)
3
+
4
+ ## v10.2.0 (Aug 12, 2026)
2
5
  - [Bugfix] Fix the Data Cloud recommender catalog event field name: `personalizationContextId` → `personalizationContentId`. The official `@salesforce/cc-datacloud-typescript` SDK type and Salesforce docs both define `personalizationContentId` (Content); the `Context` spelling did not match, so the recommender UUID (`__recoUUID`) was sent under a key Data Cloud does not recognize and is expected to be dropped on ingest.
3
6
  - [Feature] Add `cc_showFab` for the Commerce Client shopper-agent widget: when `'true'`, renders a floating action button at `cc_widgetPosition` that opens the agent panel and hides while it is open. Defaults to `'false'`.
4
7
  - [Bugfix] Honor `cc_dialogFullHeight: 'false'`, which was previously dropped from the widget options so the bundle's full-height default always won.
@@ -581,4 +584,4 @@ The versions published below were not published on npm, and the versioning match
581
584
 
582
585
  ### v1.0.0 (Sep 08, 2021)
583
586
 
584
- - PWA Kit General Availability and open source. 🎉
587
+ - PWA Kit General Availability and open source. 🎉
@@ -179,8 +179,9 @@ const App = (props) => {
179
179
  // Determine Page Designer mode from URL - use req for server-side detection
180
180
  const pageDesignerMode = useMemo(() => {
181
181
  const queryParams = location?.search || ''
182
- if (queryParams.includes('mode=EDIT')) return 'EDIT'
183
- else if (queryParams.includes('mode=PREVIEW')) return 'PREVIEW'
182
+ const mode = new URLSearchParams(queryParams).get('mode')
183
+ if (mode === 'EDIT') return 'EDIT'
184
+ if (mode === 'PREVIEW') return 'PREVIEW'
184
185
  return undefined
185
186
  }, [req?.url])
186
187
 
@@ -6,10 +6,11 @@
6
6
  */
7
7
 
8
8
  import React, {useEffect} from 'react'
9
- import {Prompt} from 'react-router-dom'
9
+ import {Prompt, useLocation} from 'react-router-dom'
10
10
  import {
11
11
  usePageDesignerMode,
12
- useGlobalAnchorBlock
12
+ useGlobalAnchorBlock,
13
+ usePreviewContext
13
14
  } from '@salesforce/commerce-sdk-react/page-designer'
14
15
  import {getAssetUrl} from '@salesforce/pwa-kit-react-sdk/ssr/universal/utils'
15
16
 
@@ -55,6 +56,8 @@ import {getAssetUrl} from '@salesforce/pwa-kit-react-sdk/ssr/universal/utils'
55
56
  */
56
57
  export function PageDesignerInit() {
57
58
  const {isDesignMode} = usePageDesignerMode()
59
+ const {pathname, search, hash} = useLocation()
60
+ const {notifyClientRouteChanged, isConnected} = usePreviewContext()
58
61
 
59
62
  // Block anchor navigation when in design mode
60
63
  // Pass isDesignMode to control when navigation blocking is active
@@ -81,6 +84,18 @@ export function PageDesignerInit() {
81
84
  return () => link.remove()
82
85
  }, [isDesignMode])
83
86
 
87
+ // Push client-side route changes back to Business Manager so the preview URL bar
88
+ // tracks navigation. Gated on isConnected so we don't emit before the messaging
89
+ // channel handshake completes.
90
+ useEffect(() => {
91
+ if (!isConnected) return
92
+ const url =
93
+ typeof window !== 'undefined'
94
+ ? `${window.location.origin}${pathname}${search || ''}${hash || ''}`
95
+ : `${pathname}${search || ''}${hash || ''}`
96
+ notifyClientRouteChanged(url)
97
+ }, [pathname, search, hash, isConnected, notifyClientRouteChanged])
98
+
84
99
  // When the message function returns false, navigation is completely blocked (no dialog shown)
85
100
  return (
86
101
  <React.Fragment>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/retail-react-app",
3
- "version": "10.2.0-preview.0",
3
+ "version": "10.2.1-preview.0",
4
4
  "license": "See license in LICENSE",
5
5
  "author": "cc-pwa-kit@salesforce.com",
6
6
  "ccExtensibility": {
@@ -46,11 +46,11 @@
46
46
  "@loadable/component": "^5.15.3",
47
47
  "@peculiar/webcrypto": "^1.4.2",
48
48
  "@salesforce/cc-datacloud-typescript": "1.1.2",
49
- "@salesforce/commerce-sdk-react": "5.4.0-preview.0",
50
- "@salesforce/pwa-kit-dev": "3.20.0-preview.0",
51
- "@salesforce/pwa-kit-react-sdk": "3.20.0-preview.0",
52
- "@salesforce/pwa-kit-runtime": "3.20.0-preview.0",
53
- "@salesforce/storefront-next-runtime": "0.4.2",
49
+ "@salesforce/commerce-sdk-react": "5.4.1-preview.0",
50
+ "@salesforce/pwa-kit-dev": "3.20.0",
51
+ "@salesforce/pwa-kit-react-sdk": "3.20.0",
52
+ "@salesforce/pwa-kit-runtime": "3.20.0",
53
+ "@salesforce/storefront-next-runtime": "1.3.1",
54
54
  "@tanstack/react-query": "^4.28.0",
55
55
  "@tanstack/react-query-devtools": "^4.29.1",
56
56
  "@testing-library/dom": "^9.0.1",
@@ -111,8 +111,8 @@
111
111
  },
112
112
  {
113
113
  "path": "build/vendor.js",
114
- "maxSize": "400 kB"
114
+ "maxSize": "402 kB"
115
115
  }
116
116
  ],
117
- "gitHead": "63b3848e2c46b8e1ca540f8c80e7f9d96a4a7cb9"
117
+ "gitHead": "8f31e6fea2071d0cf04b8ff2f5071c75f69bbf0a"
118
118
  }