@shopgate/engage 7.31.8-beta.1 → 7.31.8
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/engage",
|
|
3
|
-
"version": "7.31.8
|
|
3
|
+
"version": "7.31.8",
|
|
4
4
|
"description": "Shopgate's ENGAGE library.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Shopgate <support@shopgate.com>",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@emotion/react": "^11.14.0",
|
|
20
20
|
"@shopgate/native-modules": "1.0.0-beta.34",
|
|
21
|
-
"@shopgate/pwa-common": "7.31.8
|
|
22
|
-
"@shopgate/pwa-common-commerce": "7.31.8
|
|
23
|
-
"@shopgate/pwa-core": "7.31.8
|
|
24
|
-
"@shopgate/pwa-ui-ios": "7.31.8
|
|
25
|
-
"@shopgate/pwa-ui-material": "7.31.8
|
|
26
|
-
"@shopgate/pwa-ui-shared": "7.31.8
|
|
21
|
+
"@shopgate/pwa-common": "7.31.8",
|
|
22
|
+
"@shopgate/pwa-common-commerce": "7.31.8",
|
|
23
|
+
"@shopgate/pwa-core": "7.31.8",
|
|
24
|
+
"@shopgate/pwa-ui-ios": "7.31.8",
|
|
25
|
+
"@shopgate/pwa-ui-material": "7.31.8",
|
|
26
|
+
"@shopgate/pwa-ui-shared": "7.31.8",
|
|
27
27
|
"@stripe/react-stripe-js": "^1.16.5",
|
|
28
28
|
"@stripe/stripe-js": "^1.44.1",
|
|
29
29
|
"@virtuous/conductor": "~2.5.0",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* List of allowed origin patterns for cms page preview iFrame communication.
|
|
3
|
-
* only processed when their origin matches
|
|
4
|
-
* posted to
|
|
2
|
+
* List of allowed origin patterns for cms page preview iFrame communication. Both directions are
|
|
3
|
+
* validated against these patterns: incoming messages are only processed when their origin matches,
|
|
4
|
+
* and outgoing messages are only posted to a matching origin - either the origin of the last
|
|
5
|
+
* accepted incoming message, or the origin of the embedding document.
|
|
5
6
|
*
|
|
6
7
|
* A "*" acts as a wildcard for one or more domain labels, so "https://*.shopgate.com" matches
|
|
7
8
|
* "https://app.shopgate.com" as well as "https://next.us.admin.shopgate.com", but neither
|
|
@@ -99,7 +99,7 @@ function useIframeMessenger(onMessage, parentOrigins, enabled = true) {
|
|
|
99
99
|
return () => {
|
|
100
100
|
window.removeEventListener('message', handler);
|
|
101
101
|
};
|
|
102
|
-
}, [enabled, parentOrigins
|
|
102
|
+
}, [enabled, parentOrigins]);
|
|
103
103
|
return {
|
|
104
104
|
sendToParent
|
|
105
105
|
};
|
|
@@ -127,6 +127,10 @@ export const usePreviewIframeCommunication = (isActive = false) => {
|
|
|
127
127
|
const {
|
|
128
128
|
sendToParent
|
|
129
129
|
} = useIframeMessenger(data => {
|
|
130
|
+
// Allowed parents can also emit unrelated messages with arbitrary payloads.
|
|
131
|
+
if (typeof data !== 'object' || data === null) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
130
134
|
if (data.type === 'receivePageConfig') {
|
|
131
135
|
// Page preview config received from the parent window.
|
|
132
136
|
dispatch(receivePageConfigV2({
|