@magento/pagebuilder 7.2.0 → 7.3.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.
- package/lib/ContentTypes/Banner/banner.js +1 -1
- package/lib/ContentTypes/ButtonItem/buttonItem.js +1 -1
- package/lib/ContentTypes/DynamicBlock/__tests__/__snapshots__/dynamicBlock.ce.spec.js.snap +1 -1
- package/lib/ContentTypes/DynamicBlock/__tests__/__snapshots__/dynamicBlock.ee.spec.js.snap +4 -4
- package/lib/ContentTypes/DynamicBlock/__tests__/dynamicBlock.ce.spec.js +1 -1
- package/lib/ContentTypes/DynamicBlock/__tests__/dynamicBlock.ee.spec.js +1 -1
- package/lib/ContentTypes/DynamicBlock/dynamicBlock.ce.js +2 -2
- package/lib/ContentTypes/Image/image.js +1 -1
- package/lib/ContentTypes/Products/Carousel/__fixtures__/apolloMocks.js +6 -6
- package/lib/ContentTypes/Products/Carousel/__tests__/useCarousel.spec.js +10 -10
- package/lib/ContentTypes/Products/Carousel/carousel.gql.ce.js +1 -1
- package/lib/ContentTypes/Products/Carousel/carousel.gql.ee.js +1 -1
- package/lib/ContentTypes/Products/__tests__/products.spec.js +3 -1
- package/lib/ContentTypes/Products/products.js +4 -2
- package/lib/ContentTypes/Text/text.js +3 -1
- package/package.json +9 -9
|
@@ -3,7 +3,7 @@ import defaultClasses from './banner.module.css';
|
|
|
3
3
|
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
4
4
|
import { arrayOf, bool, oneOf, shape, string, func, object } from 'prop-types';
|
|
5
5
|
import Button from '@magento/venia-ui/lib/components/Button/button';
|
|
6
|
-
import resolveLinkProps from '
|
|
6
|
+
import resolveLinkProps from '@magento/peregrine/lib/util/resolveLinkProps';
|
|
7
7
|
import { Link, useHistory } from 'react-router-dom';
|
|
8
8
|
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
9
9
|
import useIntersectionObserver from '@magento/peregrine/lib/hooks/useIntersectionObserver';
|
|
@@ -4,7 +4,7 @@ import { useHistory } from 'react-router-dom';
|
|
|
4
4
|
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
5
5
|
import Button from '@magento/venia-ui/lib/components/Button/button';
|
|
6
6
|
|
|
7
|
-
import resolveLinkProps from '
|
|
7
|
+
import resolveLinkProps from '@magento/peregrine/lib/util/resolveLinkProps';
|
|
8
8
|
import defaultClasses from './buttonItem.module.css';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`#PageBuilder DynamicBlock
|
|
3
|
+
exports[`#PageBuilder DynamicBlock AC does not render a Dynamic Block component when no uids are provided 1`] = `null`;
|
|
4
4
|
|
|
5
|
-
exports[`#PageBuilder DynamicBlock
|
|
5
|
+
exports[`#PageBuilder DynamicBlock AC renders a Dynamic Block component inlined 1`] = `
|
|
6
6
|
<span
|
|
7
7
|
aria-busy="false"
|
|
8
8
|
aria-live="polite"
|
|
@@ -32,7 +32,7 @@ exports[`#PageBuilder DynamicBlock EE renders a Dynamic Block component inlined
|
|
|
32
32
|
</span>
|
|
33
33
|
`;
|
|
34
34
|
|
|
35
|
-
exports[`#PageBuilder DynamicBlock
|
|
35
|
+
exports[`#PageBuilder DynamicBlock AC renders a Dynamic Block component with custom classes 1`] = `
|
|
36
36
|
<div
|
|
37
37
|
aria-busy="false"
|
|
38
38
|
aria-live="polite"
|
|
@@ -62,7 +62,7 @@ exports[`#PageBuilder DynamicBlock EE renders a Dynamic Block component with cus
|
|
|
62
62
|
</div>
|
|
63
63
|
`;
|
|
64
64
|
|
|
65
|
-
exports[`#PageBuilder DynamicBlock
|
|
65
|
+
exports[`#PageBuilder DynamicBlock AC renders a Dynamic Block component without custom classes 1`] = `
|
|
66
66
|
<div
|
|
67
67
|
aria-busy="false"
|
|
68
68
|
aria-live="polite"
|
|
@@ -29,7 +29,7 @@ const defaultProps = {
|
|
|
29
29
|
paddingLeft: '10px'
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
describe('#PageBuilder DynamicBlock
|
|
32
|
+
describe('#PageBuilder DynamicBlock AC', () => {
|
|
33
33
|
it('renders a Dynamic Block component without custom classes', () => {
|
|
34
34
|
const component = createTestInstance(
|
|
35
35
|
<DynamicBlock {...defaultProps} />
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import defaultClasses from './image.module.css';
|
|
3
3
|
import { arrayOf, bool, oneOf, shape, string, number } from 'prop-types';
|
|
4
4
|
import { Link } from 'react-router-dom';
|
|
5
|
-
import resolveLinkProps from '
|
|
5
|
+
import resolveLinkProps from '@magento/peregrine/lib/util/resolveLinkProps';
|
|
6
6
|
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
7
|
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
8
8
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import acOperations from '../carousel.gql.ee';
|
|
2
|
+
import mosOperations from '../carousel.gql.ce';
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const mockGetStoreConfigAC = {
|
|
5
5
|
request: {
|
|
6
|
-
query:
|
|
6
|
+
query: acOperations.getStoreConfigQuery
|
|
7
7
|
},
|
|
8
8
|
result: {
|
|
9
9
|
data: {
|
|
@@ -17,9 +17,9 @@ export const mockGetStoreConfigEE = {
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
export const
|
|
20
|
+
export const mockGetStoreConfigMOS = {
|
|
21
21
|
request: {
|
|
22
|
-
query:
|
|
22
|
+
query: mosOperations.getStoreConfigQuery
|
|
23
23
|
},
|
|
24
24
|
result: {
|
|
25
25
|
data: {
|
|
@@ -5,15 +5,15 @@ import { renderHook } from '@testing-library/react-hooks';
|
|
|
5
5
|
|
|
6
6
|
import typePolicies from '@magento/peregrine/lib/Apollo/policies';
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
mockGetStoreConfigMOS,
|
|
9
|
+
mockGetStoreConfigAC
|
|
10
10
|
} from '../__fixtures__/apolloMocks';
|
|
11
11
|
|
|
12
12
|
import { useCarousel } from '../useCarousel';
|
|
13
13
|
|
|
14
14
|
import defaultOperations from '../carousel.gql';
|
|
15
|
-
import
|
|
16
|
-
import
|
|
15
|
+
import mosOperations from '../carousel.gql.ce';
|
|
16
|
+
import acOperations from '../carousel.gql.ee';
|
|
17
17
|
|
|
18
18
|
jest.mock(
|
|
19
19
|
'@magento/peregrine/lib/hooks/useCustomerWishlistSkus/useCustomerWishlistSkus',
|
|
@@ -39,11 +39,11 @@ const renderHookWithProviders = ({
|
|
|
39
39
|
return renderHook(useCarousel, { wrapper, ...renderHookOptions });
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
test('returns store config
|
|
43
|
-
defaultOperations.getStoreConfigQuery =
|
|
42
|
+
test('returns store config AC', async () => {
|
|
43
|
+
defaultOperations.getStoreConfigQuery = acOperations.getStoreConfigQuery;
|
|
44
44
|
|
|
45
45
|
const { result, waitForNextUpdate } = renderHookWithProviders({
|
|
46
|
-
mocks: [
|
|
46
|
+
mocks: [mockGetStoreConfigAC]
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
expect(result.current).toMatchInlineSnapshot(`
|
|
@@ -67,13 +67,13 @@ test('returns store config EE', async () => {
|
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
test('returns store config C', async () => {
|
|
70
|
-
defaultOperations.getStoreConfigQuery =
|
|
70
|
+
defaultOperations.getStoreConfigQuery = mosOperations.getStoreConfigQuery;
|
|
71
71
|
|
|
72
72
|
const { result, waitForNextUpdate } = renderHookWithProviders({
|
|
73
|
-
mocks: [
|
|
73
|
+
mocks: [mockGetStoreConfigMOS]
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
// I am unsure why this test renders without a loading state whereas the
|
|
76
|
+
// I am unsure why this test renders without a loading state whereas the AC
|
|
77
77
|
// test renders with a loading (null) state.
|
|
78
78
|
expect(result.current).toMatchInlineSnapshot(`
|
|
79
79
|
Object {
|
|
@@ -227,7 +227,9 @@ test('render products and ensure order is correct passed to Gallery', () => {
|
|
|
227
227
|
|
|
228
228
|
createTestInstance(<Products {...productProps} />);
|
|
229
229
|
expect(useQuery).toHaveBeenCalledWith(GET_PRODUCTS_BY_URL_KEY, {
|
|
230
|
-
variables: { url_keys: urlKeys, pageSize: urlKeys.length }
|
|
230
|
+
variables: { url_keys: urlKeys, pageSize: urlKeys.length },
|
|
231
|
+
fetchPolicy: 'cache-and-network',
|
|
232
|
+
nextFetchPolicy: 'cache-first'
|
|
231
233
|
});
|
|
232
234
|
expect(mockGallery).toHaveBeenCalledWith(
|
|
233
235
|
expect.objectContaining({
|
|
@@ -101,7 +101,9 @@ const Products = props => {
|
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
const { loading, error, data } = useQuery(GET_PRODUCTS_BY_URL_KEY, {
|
|
104
|
-
variables: { url_keys: urlKeys, pageSize: urlKeys.length }
|
|
104
|
+
variables: { url_keys: urlKeys, pageSize: urlKeys.length },
|
|
105
|
+
fetchPolicy: 'cache-and-network',
|
|
106
|
+
nextFetchPolicy: 'cache-first'
|
|
105
107
|
});
|
|
106
108
|
|
|
107
109
|
if (loading) return null;
|
|
@@ -286,7 +288,7 @@ export const GET_PRODUCTS_BY_URL_KEY = gql`
|
|
|
286
288
|
name
|
|
287
289
|
price_range {
|
|
288
290
|
maximum_price {
|
|
289
|
-
|
|
291
|
+
final_price {
|
|
290
292
|
currency
|
|
291
293
|
value
|
|
292
294
|
}
|
|
@@ -5,7 +5,9 @@ import defaultClasses from './text.module.css';
|
|
|
5
5
|
import { useHistory } from 'react-router-dom';
|
|
6
6
|
import handleHtmlContentClick from '../../handleHtmlContentClick';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import htmlStringImgUrlConverter from '@magento/peregrine/lib/util/htmlStringImgUrlConverter';
|
|
9
|
+
|
|
10
|
+
const toHTML = str => ({ __html: htmlStringImgUrlConverter(str) });
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* Page Builder Text component.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magento/pagebuilder",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0-alpha.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"storybook:build": "build-storybook -c .storybook -o storybook-dist"
|
|
27
27
|
},
|
|
28
28
|
"repository": "github:magento/pwa-studio",
|
|
29
|
-
"author": "
|
|
29
|
+
"author": "Adobe Commerce",
|
|
30
30
|
"license": "(OSL-3.0 OR AFL-3.0)",
|
|
31
31
|
"bugs": {
|
|
32
32
|
"url": "https://github.com/magento/pwa-studio/issues"
|
|
@@ -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": "12.4.0-alpha.1",
|
|
38
|
+
"@magento/pwa-buildpack": "11.3.0-alpha.1",
|
|
39
|
+
"@magento/venia-ui": "9.4.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",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@apollo/client": "~3.4.0",
|
|
52
|
-
"@magento/babel-preset-peregrine": "
|
|
53
|
-
"@magento/peregrine": "
|
|
54
|
-
"@magento/pwa-buildpack": "
|
|
55
|
-
"@magento/venia-ui": "
|
|
52
|
+
"@magento/babel-preset-peregrine": "1.2.1-alpha.1",
|
|
53
|
+
"@magento/peregrine": "12.4.0-alpha.1",
|
|
54
|
+
"@magento/pwa-buildpack": "11.3.0-alpha.1",
|
|
55
|
+
"@magento/venia-ui": "9.4.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",
|