@magento/pagebuilder 8.1.0 → 8.2.0-alpha.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.
|
@@ -24,29 +24,6 @@ test('does nothing when the target is not a link', () => {
|
|
|
24
24
|
describe('when the target is a link', () => {
|
|
25
25
|
const preventDefault = jest.fn();
|
|
26
26
|
|
|
27
|
-
test('uses the push() function in the history object if it is internal', () => {
|
|
28
|
-
const event = {
|
|
29
|
-
code: 'Enter',
|
|
30
|
-
target: {
|
|
31
|
-
origin: 'https://my-magento.store',
|
|
32
|
-
tagName: 'A',
|
|
33
|
-
pathname: '/checkout.html',
|
|
34
|
-
href: 'https://my-magento.store/checkout.html'
|
|
35
|
-
},
|
|
36
|
-
view: {
|
|
37
|
-
location: {
|
|
38
|
-
origin: 'https://my-magento.store'
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
preventDefault: preventDefault
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
handleHtmlContentClick(mockHistory, event);
|
|
45
|
-
|
|
46
|
-
expect(preventDefault).toHaveBeenCalled();
|
|
47
|
-
expect(mockHistoryPush).toHaveBeenCalledWith(event.target.pathname);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
27
|
test('loads the new URL if it is external', () => {
|
|
51
28
|
const mockAssign = jest.fn();
|
|
52
29
|
|
|
@@ -105,6 +82,6 @@ describe('when the target is a link', () => {
|
|
|
105
82
|
|
|
106
83
|
expect(preventDefault).toHaveBeenCalled();
|
|
107
84
|
expect(mockHistoryPush).not.toHaveBeenCalled();
|
|
108
|
-
expect(mockOpen).toHaveBeenCalledWith(event.target.href
|
|
85
|
+
expect(mockOpen).toHaveBeenCalledWith(event.target.href);
|
|
109
86
|
});
|
|
110
87
|
});
|
|
@@ -16,23 +16,13 @@ const handleHtmlContentClick = (history, event) => {
|
|
|
16
16
|
// destination is internal to avoid refreshing the page
|
|
17
17
|
if (target.tagName === 'A' && shouldIntercept) {
|
|
18
18
|
event.preventDefault();
|
|
19
|
-
|
|
20
|
-
const eventOrigin = event.view.location.origin;
|
|
21
|
-
const {
|
|
22
|
-
origin: linkOrigin,
|
|
23
|
-
pathname: path,
|
|
24
|
-
search: query,
|
|
25
|
-
target: tabTarget,
|
|
26
|
-
href
|
|
27
|
-
} = target;
|
|
19
|
+
const { search: query, target: tabTarget, href } = target;
|
|
28
20
|
|
|
29
21
|
if (tabTarget && globalThis.open) {
|
|
30
|
-
globalThis.open(href, '_blank');
|
|
31
|
-
} else if (linkOrigin === eventOrigin) {
|
|
32
22
|
if (query) {
|
|
33
|
-
|
|
23
|
+
globalThis.open(href + query);
|
|
34
24
|
} else {
|
|
35
|
-
|
|
25
|
+
globalThis.open(href);
|
|
36
26
|
}
|
|
37
27
|
} else {
|
|
38
28
|
globalThis.location.assign(href);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magento/pagebuilder",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0-alpha.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"homepage": "https://github.com/magento/pwa-studio/tree/main/packages/pagebuilder#readme",
|
|
35
35
|
"dependencies": {},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@magento/peregrine": "
|
|
38
|
-
"@magento/pwa-buildpack": "
|
|
39
|
-
"@magento/venia-ui": "
|
|
37
|
+
"@magento/peregrine": "13.1.1-alpha.1",
|
|
38
|
+
"@magento/pwa-buildpack": "11.4.2-alpha.1",
|
|
39
|
+
"@magento/venia-ui": "10.2.0-alpha.1",
|
|
40
40
|
"@storybook/react": "~6.3.7",
|
|
41
41
|
"jarallax": "~1.11.1",
|
|
42
42
|
"load-google-maps-api": "~2.0.1",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@apollo/client": "~3.5.0",
|
|
52
52
|
"@magento/babel-preset-peregrine": "~1.2.2",
|
|
53
|
-
"@magento/peregrine": "
|
|
54
|
-
"@magento/pwa-buildpack": "
|
|
55
|
-
"@magento/venia-ui": "
|
|
53
|
+
"@magento/peregrine": "13.1.1-alpha.1",
|
|
54
|
+
"@magento/pwa-buildpack": "11.4.2-alpha.1",
|
|
55
|
+
"@magento/venia-ui": "10.2.0-alpha.1",
|
|
56
56
|
"jarallax": "~1.11.1",
|
|
57
57
|
"load-google-maps-api": "~2.0.1",
|
|
58
58
|
"lodash.escape": "~4.0.1",
|