@salesforce/retail-react-app 10.3.0-nightly-20261008080708 → 10.3.0-preview.1
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 +4 -5
- package/app/components/_app/index.jsx +3 -145
- package/app/components/_app/index.test.js +2 -100
- package/app/components/inline-agent-widget/index.jsx +3 -17
- package/app/components/shopper-agent/index.jsx +6 -13
- package/app/components/shopper-agent/index.test.js +0 -59
- package/app/hooks/use-inline-agent-widget.js +1 -49
- package/app/mocks/page-designer.js +0 -26
- package/app/page-designer/layouts/index.js +0 -1
- package/app/page-designer/registry.js +0 -8
- package/app/pages/product-detail/index.jsx +1 -10
- package/app/routes.jsx +0 -6
- package/app/ssr.js +0 -23
- package/app/static/inline-agent-widget.umd.js +28 -26
- package/package.json +8 -8
- package/app/page-designer/content/announcement-banner/index.jsx +0 -148
- package/app/page-designer/content/announcement-banner/index.test.js +0 -57
- package/app/page-designer/content/index.js +0 -8
- package/app/page-designer/layouts/header/index.jsx +0 -33
- package/app/page-designer/layouts/header/index.test.js +0 -38
- package/app/page-designer/preview-page.js +0 -28
- package/app/page-designer/preview-page.test.js +0 -26
- package/app/pages/component-preview/index.jsx +0 -73
- package/app/pages/component-preview/index.test.js +0 -117
- package/app/utils/inline-agent-widget-utils.js +0 -74
- package/app/utils/inline-agent-widget-utils.test.js +0 -87
|
@@ -42,7 +42,6 @@ import ProductView from '@salesforce/retail-react-app/app/components/product-vie
|
|
|
42
42
|
import InformationAccordion from '@salesforce/retail-react-app/app/pages/product-detail/partials/information-accordion'
|
|
43
43
|
import Island from '@salesforce/retail-react-app/app/components/island'
|
|
44
44
|
import InlineAgentWidget from '@salesforce/retail-react-app/app/components/inline-agent-widget'
|
|
45
|
-
import {parsePdpQuestions} from '@salesforce/retail-react-app/app/utils/inline-agent-widget-utils'
|
|
46
45
|
|
|
47
46
|
import {HTTPNotFound, HTTPError} from '@salesforce/pwa-kit-react-sdk/ssr/universal/errors'
|
|
48
47
|
import logger from '@salesforce/retail-react-app/app/utils/logger-instance'
|
|
@@ -808,15 +807,7 @@ const ProductDetail = () => {
|
|
|
808
807
|
onOpenStoreLocator={onOpenStoreLocator}
|
|
809
808
|
showDeliveryOptions={storeLocatorEnabled}
|
|
810
809
|
showDeliveryEstimate={true}
|
|
811
|
-
actionFooter={
|
|
812
|
-
<InlineAgentWidget
|
|
813
|
-
config={embeddedAgentConfig}
|
|
814
|
-
pdpQuestions={parsePdpQuestions(
|
|
815
|
-
productResponse?.c_pdpQuestions
|
|
816
|
-
)}
|
|
817
|
-
productName={productResponse?.name}
|
|
818
|
-
/>
|
|
819
|
-
}
|
|
810
|
+
actionFooter={<InlineAgentWidget config={embeddedAgentConfig} />}
|
|
820
811
|
/>
|
|
821
812
|
<InformationAccordion product={product} />
|
|
822
813
|
</Island>
|
package/app/routes.jsx
CHANGED
|
@@ -65,8 +65,6 @@ const GuestOrderLookupResults = loadable(() => import('./pages/guest-order-looku
|
|
|
65
65
|
fallback
|
|
66
66
|
})
|
|
67
67
|
|
|
68
|
-
const ComponentPreview = loadable(() => import('./pages/component-preview'), {fallback})
|
|
69
|
-
|
|
70
68
|
export const routes = [
|
|
71
69
|
{
|
|
72
70
|
path: '/',
|
|
@@ -139,10 +137,6 @@ export const routes = [
|
|
|
139
137
|
{
|
|
140
138
|
path: '/store-locator',
|
|
141
139
|
component: StoreLocator
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
path: '/preview/component',
|
|
145
|
-
component: ComponentPreview
|
|
146
140
|
}
|
|
147
141
|
]
|
|
148
142
|
|
package/app/ssr.js
CHANGED
|
@@ -31,8 +31,6 @@ import {registerTokenBridgeRoute} from './components/shopper-agent/token-bridge.
|
|
|
31
31
|
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
32
32
|
import {getCommerceClientOverridesCspSources} from './utils/commerce-client-overrides.js'
|
|
33
33
|
import {ShopperOrders} from 'commerce-sdk-isomorphic'
|
|
34
|
-
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
35
|
-
import {getSiteByReference} from './utils/site-utils.js'
|
|
36
34
|
|
|
37
35
|
const config = getConfig()
|
|
38
36
|
|
|
@@ -1124,27 +1122,6 @@ const {handler} = runtime.createHandler(options, (app) => {
|
|
|
1124
1122
|
}
|
|
1125
1123
|
})
|
|
1126
1124
|
|
|
1127
|
-
// The Content Block Editor (Page Designer) builds the component-preview iframe URL
|
|
1128
|
-
// with SFCC's `default` pseudo-locale token (the platform's convention for "the site's
|
|
1129
|
-
// default locale"). PWA Kit's route matcher only accepts real locale ids/aliases from
|
|
1130
|
-
// the site config, so `/:site/default/preview/component` misses every route and falls
|
|
1131
|
-
// through to PageNotFound. Translate `default` to the resolved site's actual default
|
|
1132
|
-
// locale and redirect once so the request matches /:site/:locale/preview/component.
|
|
1133
|
-
// Scoped to the preview route to leave the public storefront URL model untouched.
|
|
1134
|
-
app.get('/:site/default/preview/component', (req, res, next) => {
|
|
1135
|
-
const site = getSiteByReference(req.params.site)
|
|
1136
|
-
const defaultLocale = site?.l10n?.defaultLocale
|
|
1137
|
-
if (!defaultLocale) {
|
|
1138
|
-
// Can't resolve a locale — let the normal renderer handle it (PageNotFound)
|
|
1139
|
-
// rather than emitting a broken redirect.
|
|
1140
|
-
return next()
|
|
1141
|
-
}
|
|
1142
|
-
// Preserve the exact encoded query string (mode, componentId, pdToken, stamp, …).
|
|
1143
|
-
const queryIndex = req.originalUrl.indexOf('?')
|
|
1144
|
-
const search = queryIndex >= 0 ? req.originalUrl.slice(queryIndex) : ''
|
|
1145
|
-
res.redirect(302, `/${req.params.site}/${defaultLocale}/preview/component${search}`)
|
|
1146
|
-
})
|
|
1147
|
-
|
|
1148
1125
|
app.get('*', runtime.render)
|
|
1149
1126
|
})
|
|
1150
1127
|
// SSR requires that we export a single handler function called 'get', that
|