@shopgate/pwa-common 7.30.2-beta.3 → 7.30.3-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/pwa-common",
3
- "version": "7.30.2-beta.3",
3
+ "version": "7.30.3-beta.1",
4
4
  "description": "Common library for the Shopgate Connect PWA.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -17,7 +17,7 @@
17
17
  "dependencies": {
18
18
  "@redux-devtools/extension": "^3.3.0",
19
19
  "@sentry/browser": "6.0.1",
20
- "@shopgate/pwa-benchmark": "7.30.2-beta.3",
20
+ "@shopgate/pwa-benchmark": "7.30.3-beta.1",
21
21
  "@virtuous/conductor": "~2.5.0",
22
22
  "@virtuous/react-conductor": "~2.5.0",
23
23
  "@virtuous/redux-persister": "1.1.0-beta.7",
@@ -40,7 +40,7 @@
40
40
  "swiper": "12.1.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@shopgate/pwa-core": "7.30.2-beta.3",
43
+ "@shopgate/pwa-core": "7.30.3-beta.1",
44
44
  "@types/react-portal": "^3.0.9",
45
45
  "lodash": "^4.17.23",
46
46
  "prop-types": "~15.8.1",
@@ -5,6 +5,7 @@ import "core-js/modules/web.url-search-params.js";
5
5
  import queryString from 'query-string';
6
6
  import { router, ACTION_POP, ACTION_PUSH, ACTION_REPLACE, ACTION_RESET } from '@virtuous/conductor';
7
7
  import Route from '@virtuous/conductor/Route';
8
+ import { Linking } from '@shopgate/native-modules';
8
9
  import { HISTORY_RESET_TO } from '@shopgate/pwa-common/constants/ActionTypes';
9
10
  import { logger } from '@shopgate/pwa-core';
10
11
  import { IS_PAGE_PREVIEW_ACTIVE } from '@shopgate/engage/page/constants';
@@ -323,6 +324,20 @@ export default function routerSubscriptions(subscribe) {
323
324
  subscribe(appWillStart$, ({
324
325
  dispatch
325
326
  }) => {
327
+ /**
328
+ * Register a listener to the APP_EVENT_WINDOW_OPEN_REQUESTED event which is emitted when e.g.
329
+ * and iFrame tries to open a link in a new window. The handler will perform a history push,
330
+ * so that the router can decide how to handle the URL.
331
+ */
332
+ Linking.addEventListener('windowOpenRequested', event => {
333
+ const {
334
+ targetUrl
335
+ } = event.detail;
336
+ dispatch(historyPush({
337
+ pathname: targetUrl,
338
+ state: {}
339
+ }));
340
+ });
326
341
  const windowOpenOriginal = window.open;
327
342
  /**
328
343
  * Override for the window.open method which is usually used by external SDKs to open URLs.