@blaze-cms/react-page-builder 0.135.0-core-styles.4 → 0.135.0
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 +3 -7
- package/lib/components/Banner/AdSlotRender.js +3 -12
- package/lib/components/Banner/AdSlotRender.js.map +1 -1
- package/lib/components/Banner/Banner.js +7 -4
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Banner/BannerRender.js +1 -5
- package/lib/components/Banner/BannerRender.js.map +1 -1
- package/lib/components/DataSummary/helpers/build-loop-props-content.js +2 -3
- package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-link-to-published-content.js +0 -2
- package/lib/components/DataSummary/helpers/get-link-to-published-content.js.map +1 -1
- package/lib/helpers/build-raw-query.js +20 -9
- package/lib/helpers/build-raw-query.js.map +1 -1
- package/lib/helpers/build-search-values-text.js +8 -5
- package/lib/helpers/build-search-values-text.js.map +1 -1
- package/lib-es/components/Banner/AdSlotRender.js +3 -12
- package/lib-es/components/Banner/AdSlotRender.js.map +1 -1
- package/lib-es/components/Banner/Banner.js +7 -4
- package/lib-es/components/Banner/Banner.js.map +1 -1
- package/lib-es/components/Banner/BannerRender.js +2 -6
- package/lib-es/components/Banner/BannerRender.js.map +1 -1
- package/lib-es/components/DataSummary/helpers/build-loop-props-content.js +2 -3
- package/lib-es/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
- package/lib-es/components/DataSummary/helpers/get-link-to-published-content.js +1 -2
- package/lib-es/components/DataSummary/helpers/get-link-to-published-content.js.map +1 -1
- package/lib-es/helpers/build-raw-query.js +19 -7
- package/lib-es/helpers/build-raw-query.js.map +1 -1
- package/lib-es/helpers/build-search-values-text.js +8 -5
- package/lib-es/helpers/build-search-values-text.js.map +1 -1
- package/package.json +10 -10
- package/src/components/Banner/AdSlotRender.js +5 -9
- package/src/components/Banner/Banner.js +11 -9
- package/src/components/Banner/BannerRender.js +0 -4
- package/src/components/DataSummary/helpers/build-loop-props-content.js +2 -3
- package/src/components/DataSummary/helpers/get-link-to-published-content.js +1 -4
- package/src/helpers/build-raw-query.js +16 -3
- package/src/helpers/build-search-values-text.js +20 -17
- package/tests/helpers/mocks.js +20 -5
- package/tests/unit/src/components/Banner/AdSlotRender.test.js +11 -6
- package/tests/unit/src/components/Banner/__snapshots__/AdSlotRender.test.js.snap +25 -45
- package/tests/unit/src/components/Banner/__snapshots__/BannerRender.test.js.snap +3 -8
- package/tests/unit/src/components/DataSummary/helpers/build-loop-props-content.test.js +0 -41
- package/tests/unit/src/components/DataSummary/helpers/get-link-to-published-content.test.js +0 -21
- package/tests/unit/src/helpers/build-search-values-text.test.js +22 -11
- package/tests/unit/src/components/PlaceholderIcon/__snapshots__/index.test.js.snap +0 -87
- package/tests/unit/src/components/PlaceholderIcon/index.test.js +0 -20
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [0.135.0
|
|
6
|
+
# [0.135.0](https://github.com/thebyte9/blaze/compare/v0.135.0-alpha.0...v0.135.0) (2023-11-21)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @blaze-cms/react-page-builder
|
|
9
9
|
|
|
@@ -11,16 +11,12 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
# [0.135.0-
|
|
14
|
+
# [0.135.0-alpha.0](https://github.com/thebyte9/blaze/compare/v0.134.0...v0.135.0-alpha.0) (2023-11-21)
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
### Bug Fixes
|
|
18
18
|
|
|
19
|
-
*
|
|
20
|
-
* handle data summary urls in loops correctly ([#3993](https://github.com/thebyte9/blaze/issues/3993)) ([008e1a1](https://github.com/thebyte9/blaze/commit/008e1a1f24f065b4060302c2c32d1aa32dd8a007))
|
|
21
|
-
* unwanted space when banner not served ([fb35848](https://github.com/thebyte9/blaze/commit/fb35848b7f91c9c063833d30b37e44996b2a4a56))
|
|
22
|
-
* update ad slot render test ([dc9655f](https://github.com/thebyte9/blaze/commit/dc9655f2a2f9b9b5f5e98c77382561d3c4c4088d))
|
|
23
|
-
* update ad slot render test ([2d12523](https://github.com/thebyte9/blaze/commit/2d12523f79245208e8919b7d90fa6d4294f396da))
|
|
19
|
+
* move pageBuilderIndexed search to a should filter instead of must ([#4129](https://github.com/thebyte9/blaze/issues/4129)) ([4c31598](https://github.com/thebyte9/blaze/commit/4c315981752f32a8f3f10da3e1806c4fb3ad0e21))
|
|
24
20
|
|
|
25
21
|
|
|
26
22
|
|
|
@@ -23,7 +23,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
23
23
|
var _reactDfp = require("react-dfp");
|
|
24
24
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
25
|
var _constants = require("../../constants");
|
|
26
|
-
var _Wrapper = _interopRequireDefault(require("../Wrapper"));
|
|
27
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
28
27
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
28
|
var AdSlotRender = function AdSlotRender(_ref) {
|
|
@@ -32,7 +31,6 @@ var AdSlotRender = function AdSlotRender(_ref) {
|
|
|
32
31
|
sizeId = _ref.sizeId,
|
|
33
32
|
parsedAdunit = _ref.parsedAdunit,
|
|
34
33
|
parsedSizes = _ref.parsedSizes,
|
|
35
|
-
modifiers = _ref.modifiers,
|
|
36
34
|
targetingArguments = _ref.targetingArguments;
|
|
37
35
|
var _useState = (0, _react.useState)({}),
|
|
38
36
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
@@ -54,16 +52,11 @@ var AdSlotRender = function AdSlotRender(_ref) {
|
|
|
54
52
|
return "@media(min-width:".concat(minWidth, "px){.").concat(bannerClass, "{min-height:").concat(minimumHeight, "px;}");
|
|
55
53
|
}).sort();
|
|
56
54
|
var className = "ad-slot ad-slot-".concat(loadingStatus, " ").concat(bannerClass);
|
|
57
|
-
|
|
58
|
-
return /*#__PURE__*/_react["default"].createElement(_Wrapper["default"], {
|
|
59
|
-
className: "banner",
|
|
60
|
-
modifiers: newModifers
|
|
61
|
-
}, styles && /*#__PURE__*/_react["default"].createElement("style", null, styles.join('\n')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
55
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, styles && /*#__PURE__*/_react["default"].createElement("style", null, styles.join('\n')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
62
56
|
className: className,
|
|
63
57
|
style: {
|
|
64
58
|
minHeight: minHeight
|
|
65
|
-
}
|
|
66
|
-
"data-testid": "ad-slot"
|
|
59
|
+
}
|
|
67
60
|
}, shouldShowBanner && /*#__PURE__*/_react["default"].createElement(_reactDfp.AdSlot, {
|
|
68
61
|
adUnit: parsedAdunit,
|
|
69
62
|
sizes: parsedSizes,
|
|
@@ -88,12 +81,10 @@ AdSlotRender.propTypes = {
|
|
|
88
81
|
sizeId: _propTypes["default"].string.isRequired,
|
|
89
82
|
parsedAdunit: _propTypes["default"].string.isRequired,
|
|
90
83
|
parsedSizes: _propTypes["default"].array,
|
|
91
|
-
modifiers: _propTypes["default"].string,
|
|
92
84
|
targetingArguments: _propTypes["default"].object.isRequired
|
|
93
85
|
};
|
|
94
86
|
AdSlotRender.defaultProps = {
|
|
95
|
-
parsedSizes: null
|
|
96
|
-
modifiers: ''
|
|
87
|
+
parsedSizes: null
|
|
97
88
|
};
|
|
98
89
|
var _default = AdSlotRender;
|
|
99
90
|
exports["default"] = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdSlotRender.js","names":["_react","_interopRequireWildcard","require","_reactDfp","_propTypes","_interopRequireDefault","_constants","
|
|
1
|
+
{"version":3,"file":"AdSlotRender.js","names":["_react","_interopRequireWildcard","require","_reactDfp","_propTypes","_interopRequireDefault","_constants","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","AdSlotRender","_ref","shouldShowBanner","sizeMapping","sizeId","parsedAdunit","parsedSizes","targetingArguments","_useState","useState","_useState2","_slicedToArray2","_useState2$","_useState2$$loadingSt","loadingStatus","BANNER_LOADING","minHeight","setLoadingStatus","bannerClass","concat","styles","map","_ref2","styleSizes","sizes","_ref2$viewport","viewport","minWidth","minimumHeight","Math","min","apply","_toConsumableArray2","_ref3","_ref4","height","sort","className","createElement","Fragment","join","style","AdSlot","adUnit","onSlotRender","slotData","_slotData$event","event","isEmpty","size","slotHeight","length","undefined","newLoadingStatus","BANNER_EMPTY","BANNER_LOADED","propTypes","PropTypes","bool","isRequired","array","string","object","defaultProps","_default","exports"],"sources":["../../../src/components/Banner/AdSlotRender.js"],"sourcesContent":["import React, { useState } from 'react';\nimport { AdSlot } from 'react-dfp';\nimport PropTypes from 'prop-types';\nimport { BANNER_LOADING, BANNER_EMPTY, BANNER_LOADED } from '../../constants';\n\nconst AdSlotRender = ({\n shouldShowBanner,\n sizeMapping,\n sizeId,\n parsedAdunit,\n parsedSizes,\n targetingArguments\n}) => {\n const [{ loadingStatus = BANNER_LOADING, minHeight }, setLoadingStatus] = useState({});\n\n const bannerClass = `banner-${sizeId}`;\n\n const styles =\n loadingStatus === BANNER_LOADING &&\n sizeMapping\n .map(({ sizes: styleSizes, viewport: [minWidth] }) => {\n const minimumHeight = Math.min(...styleSizes.map(([, height]) => height));\n return `@media(min-width:${minWidth}px){.${bannerClass}{min-height:${minimumHeight}px;}`;\n })\n .sort();\n const className = `ad-slot ad-slot-${loadingStatus} ${bannerClass}`;\n\n return (\n <>\n {styles && <style>{styles.join('\\n')}</style>}\n <div className={className} style={{ minHeight }}>\n {shouldShowBanner && (\n <AdSlot\n adUnit={parsedAdunit}\n sizes={parsedSizes}\n targetingArguments={targetingArguments}\n sizeMapping={sizeMapping}\n onSlotRender={slotData => {\n const {\n event: { isEmpty, size }\n } = slotData;\n const slotHeight = size && size.length ? size[1] : undefined;\n const newLoadingStatus = isEmpty ? BANNER_EMPTY : BANNER_LOADED;\n setLoadingStatus({ loadingStatus: newLoadingStatus, minHeight: slotHeight });\n }}\n />\n )}\n </div>\n </>\n );\n};\n\nAdSlotRender.propTypes = {\n shouldShowBanner: PropTypes.bool.isRequired,\n sizeMapping: PropTypes.array.isRequired,\n sizeId: PropTypes.string.isRequired,\n parsedAdunit: PropTypes.string.isRequired,\n parsedSizes: PropTypes.array,\n targetingArguments: PropTypes.object.isRequired\n};\n\nAdSlotRender.defaultProps = {\n parsedSizes: null\n};\n\nexport default AdSlotRender;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,sB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AAS,CAACG,KAAK;EAC5BrD,kBAAkB,EAAEkD,qBAAS,CAACK,MAAM,CAACH;AACvC,CAAC;AAED3D,YAAY,CAAC+D,YAAY,GAAG;EAC1BzD,WAAW,EAAE;AACf,CAAC;AAAC,IAAA0D,QAAA,GAEahE,YAAY;AAAAiE,OAAA,cAAAD,QAAA"}
|
|
@@ -26,6 +26,7 @@ var _client = require("@apollo/client");
|
|
|
26
26
|
var _router = require("next/router");
|
|
27
27
|
var _helpers = require("./helpers");
|
|
28
28
|
var _query = require("../../application/query");
|
|
29
|
+
var _Wrapper = _interopRequireDefault(require("../Wrapper"));
|
|
29
30
|
var _BannerRender = _interopRequireDefault(require("./BannerRender"));
|
|
30
31
|
var _buildPropsQuery = _interopRequireDefault(require("../../helpers/build-props-query"));
|
|
31
32
|
var _utils = require("../../utils");
|
|
@@ -83,15 +84,17 @@ var Banner = function Banner(_ref) {
|
|
|
83
84
|
actionKey = _getEntityRenderProps.actionKey,
|
|
84
85
|
action = _getEntityRenderProps.action;
|
|
85
86
|
var bannerKey = "".concat(sizeId).concat(asPath);
|
|
86
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
87
|
+
return /*#__PURE__*/_react["default"].createElement(_Wrapper["default"], {
|
|
88
|
+
className: type,
|
|
89
|
+
modifiers: modifiers
|
|
90
|
+
}, /*#__PURE__*/_react["default"].createElement(_BannerRender["default"], (0, _extends2["default"])({
|
|
87
91
|
key: bannerKey
|
|
88
92
|
}, otherProps, {
|
|
89
93
|
action: action,
|
|
90
94
|
actionKey: actionKey,
|
|
91
95
|
asPath: asPath,
|
|
92
|
-
userPropsData: userPropsData
|
|
93
|
-
|
|
94
|
-
}));
|
|
96
|
+
userPropsData: userPropsData
|
|
97
|
+
})));
|
|
95
98
|
};
|
|
96
99
|
Banner.propTypes = {
|
|
97
100
|
type: _propTypes["default"].string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.js","names":["_react","_interopRequireWildcard","require","_nextjsComponents","_coreAuthUi","_propTypes","_interopRequireDefault","_lodash","_client","_router","_helpers","_query","_BannerRender","_buildPropsQuery","_utils","_getEntityRenderProps2","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Banner","_ref","type","otherProps","_objectWithoutProperties2","router","useRouter","_useContext","useContext","MainContext","isPreview","_checkIfLoggedIn","checkIfLoggedIn","userId","id","asPath","parent","entity","sizeId","_otherProps$propsToDi","propsToDisplay","_otherProps$userProps","userPropsToDisplay","userQuery","buildUserQuery","itemEntity","_useQuery","useQuery","getSingleEntitySchema","variables","data","error","loading","_useQuery2","getUser","skip","length","_useQuery2$data","_useQuery2$data2","userData","userLoading","message","modifiers","getClassModifiers","queryProps","buildPropsQuery","flatten","map","_ref2","propertiesToDisplay","userPropsData","buildPropsData","_getEntityRenderProps","getEntityRenderProps","actionKey","action","bannerKey","concat","createElement","_extends2","propTypes","PropTypes","string","defaultProps","_default","exports"],"sources":["../../../src/components/Banner/Banner.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport { checkIfLoggedIn } from '@blaze-cms/core-auth-ui';\nimport PropTypes from 'prop-types';\nimport flatten from 'lodash.flatten';\nimport { useQuery } from '@apollo/client';\nimport { useRouter } from 'next/router';\nimport { buildUserQuery, buildPropsData } from './helpers';\nimport { getSingleEntitySchema, getUser } from '../../application/query';\nimport BannerRender from './BannerRender';\nimport buildPropsQuery from '../../helpers/build-props-query';\nimport { getClassModifiers } from '../../utils';\nimport getEntityRenderProps from '../../helpers/get-entity-render-props';\n\nconst Banner = ({ type, ...otherProps }) => {\n const router = useRouter();\n const { isPreview } = useContext(MainContext);\n const { id: userId } = checkIfLoggedIn();\n const { asPath } = router;\n const { parent, entity, sizeId, propsToDisplay = [], userPropsToDisplay = [] } = otherProps;\n const userQuery = buildUserQuery(userPropsToDisplay);\n const { itemEntity } = parent;\n const { data, error, loading } = useQuery(getSingleEntitySchema, {\n variables: { id: entity || itemEntity }\n });\n const { data: { getUser: userData } = {}, loading: userLoading } = useQuery(getUser(userQuery), {\n variables: { id: userId },\n skip: !userPropsToDisplay.length || !userId\n });\n\n if (loading || userLoading) return '';\n if (error) return error.message;\n if (!data) return null;\n if (!sizeId) return null;\n\n const modifiers = getClassModifiers('banner', otherProps);\n const queryProps = buildPropsQuery(\n data,\n propsToDisplay.length\n ? flatten(propsToDisplay.map(({ propertiesToDisplay }) => propertiesToDisplay))\n : []\n );\n\n const userPropsData = buildPropsData(userData, userPropsToDisplay);\n const { actionKey, action } = getEntityRenderProps(queryProps, data, isPreview);\n const bannerKey = `${sizeId}${asPath}`;\n\n return (\n <BannerRender\n
|
|
1
|
+
{"version":3,"file":"Banner.js","names":["_react","_interopRequireWildcard","require","_nextjsComponents","_coreAuthUi","_propTypes","_interopRequireDefault","_lodash","_client","_router","_helpers","_query","_Wrapper","_BannerRender","_buildPropsQuery","_utils","_getEntityRenderProps2","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Banner","_ref","type","otherProps","_objectWithoutProperties2","router","useRouter","_useContext","useContext","MainContext","isPreview","_checkIfLoggedIn","checkIfLoggedIn","userId","id","asPath","parent","entity","sizeId","_otherProps$propsToDi","propsToDisplay","_otherProps$userProps","userPropsToDisplay","userQuery","buildUserQuery","itemEntity","_useQuery","useQuery","getSingleEntitySchema","variables","data","error","loading","_useQuery2","getUser","skip","length","_useQuery2$data","_useQuery2$data2","userData","userLoading","message","modifiers","getClassModifiers","queryProps","buildPropsQuery","flatten","map","_ref2","propertiesToDisplay","userPropsData","buildPropsData","_getEntityRenderProps","getEntityRenderProps","actionKey","action","bannerKey","concat","createElement","className","_extends2","propTypes","PropTypes","string","defaultProps","_default","exports"],"sources":["../../../src/components/Banner/Banner.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport { checkIfLoggedIn } from '@blaze-cms/core-auth-ui';\nimport PropTypes from 'prop-types';\nimport flatten from 'lodash.flatten';\nimport { useQuery } from '@apollo/client';\nimport { useRouter } from 'next/router';\nimport { buildUserQuery, buildPropsData } from './helpers';\nimport { getSingleEntitySchema, getUser } from '../../application/query';\nimport Wrapper from '../Wrapper';\nimport BannerRender from './BannerRender';\nimport buildPropsQuery from '../../helpers/build-props-query';\nimport { getClassModifiers } from '../../utils';\nimport getEntityRenderProps from '../../helpers/get-entity-render-props';\n\nconst Banner = ({ type, ...otherProps }) => {\n const router = useRouter();\n const { isPreview } = useContext(MainContext);\n const { id: userId } = checkIfLoggedIn();\n const { asPath } = router;\n const { parent, entity, sizeId, propsToDisplay = [], userPropsToDisplay = [] } = otherProps;\n const userQuery = buildUserQuery(userPropsToDisplay);\n const { itemEntity } = parent;\n const { data, error, loading } = useQuery(getSingleEntitySchema, {\n variables: { id: entity || itemEntity }\n });\n const { data: { getUser: userData } = {}, loading: userLoading } = useQuery(getUser(userQuery), {\n variables: { id: userId },\n skip: !userPropsToDisplay.length || !userId\n });\n\n if (loading || userLoading) return '';\n if (error) return error.message;\n if (!data) return null;\n if (!sizeId) return null;\n\n const modifiers = getClassModifiers('banner', otherProps);\n const queryProps = buildPropsQuery(\n data,\n propsToDisplay.length\n ? flatten(propsToDisplay.map(({ propertiesToDisplay }) => propertiesToDisplay))\n : []\n );\n\n const userPropsData = buildPropsData(userData, userPropsToDisplay);\n const { actionKey, action } = getEntityRenderProps(queryProps, data, isPreview);\n const bannerKey = `${sizeId}${asPath}`;\n\n return (\n <Wrapper className={type} modifiers={modifiers}>\n <BannerRender\n key={bannerKey}\n {...otherProps}\n action={action}\n actionKey={actionKey}\n asPath={asPath}\n userPropsData={userPropsData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AAM,GACjB,IAAAU,kBAAO,EAAC1B,cAAc,CAAC2B,GAAG,CAAC,UAAAC,KAAA;IAAA,IAAGC,mBAAmB,GAAAD,KAAA,CAAnBC,mBAAmB;IAAA,OAAOA,mBAAmB;EAAA,EAAC,CAAC,GAC7E,EACN,CAAC;EAED,IAAMC,aAAa,GAAG,IAAAC,uBAAc,EAACZ,QAAQ,EAAEjB,kBAAkB,CAAC;EAClE,IAAA8B,qBAAA,GAA8B,IAAAC,iCAAoB,EAACT,UAAU,EAAEd,IAAI,EAAEpB,SAAS,CAAC;IAAvE4C,SAAS,GAAAF,qBAAA,CAATE,SAAS;IAAEC,MAAM,GAAAH,qBAAA,CAANG,MAAM;EACzB,IAAMC,SAAS,MAAAC,MAAA,CAAMvC,MAAM,EAAAuC,MAAA,CAAG1C,MAAM,CAAE;EAEtC,oBACEvD,MAAA,YAAAkG,aAAA,CAACtF,QAAA,WAAO;IAACuF,SAAS,EAAEzD,IAAK;IAACwC,SAAS,EAAEA;EAAU,gBAC7ClF,MAAA,YAAAkG,aAAA,CAACrF,aAAA,WAAY,MAAAuF,SAAA;IACXlE,GAAG,EAAE8D;EAAU,GACXrD,UAAU;IACdoD,MAAM,EAAEA,MAAO;IACfD,SAAS,EAAEA,SAAU;IACrBvC,MAAM,EAAEA,MAAO;IACfmC,aAAa,EAAEA;EAAc,EAC9B,CACM,CAAC;AAEd,CAAC;AAEDlD,MAAM,CAAC6D,SAAS,GAAG;EACjB3D,IAAI,EAAE4D,qBAAS,CAACC;AAClB,CAAC;AAED/D,MAAM,CAACgE,YAAY,GAAG;EACpB9D,IAAI,EAAE;AACR,CAAC;AAAC,IAAA+D,QAAA,GAEajE,MAAM;AAAAkE,OAAA,cAAAD,QAAA"}
|
|
@@ -25,7 +25,7 @@ var _helpers = require("./helpers");
|
|
|
25
25
|
var _constants = require("../../constants");
|
|
26
26
|
var _HOC = require("../../HOC");
|
|
27
27
|
var _AdSlotRender = _interopRequireDefault(require("./AdSlotRender"));
|
|
28
|
-
var _excluded = ["baseAdunit", "adunit", "sizeId", "sizes", "propsToDisplay", "entity", "targetings", "parent", "asPath", "action", "actionKey", "renderCounter", "userPropsData"
|
|
28
|
+
var _excluded = ["baseAdunit", "adunit", "sizeId", "sizes", "propsToDisplay", "entity", "targetings", "parent", "asPath", "action", "actionKey", "renderCounter", "userPropsData"];
|
|
29
29
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
30
30
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31
31
|
var BannerRender = function BannerRender(_ref) {
|
|
@@ -42,7 +42,6 @@ var BannerRender = function BannerRender(_ref) {
|
|
|
42
42
|
actionKey = _ref.actionKey,
|
|
43
43
|
renderCounter = _ref.renderCounter,
|
|
44
44
|
userPropsData = _ref.userPropsData,
|
|
45
|
-
modifiers = _ref.modifiers,
|
|
46
45
|
otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
47
46
|
var id = otherProps.id;
|
|
48
47
|
var itemId = parent.itemId;
|
|
@@ -95,7 +94,6 @@ var BannerRender = function BannerRender(_ref) {
|
|
|
95
94
|
sizeId: sizeId,
|
|
96
95
|
parsedAdunit: parsedAdunit,
|
|
97
96
|
parsedSizes: parsedSizes,
|
|
98
|
-
modifiers: modifiers,
|
|
99
97
|
targetingArguments: targetingArguments
|
|
100
98
|
});
|
|
101
99
|
};
|
|
@@ -112,7 +110,6 @@ BannerRender.propTypes = {
|
|
|
112
110
|
targetings: _propTypes["default"].string,
|
|
113
111
|
sizes: _propTypes["default"].string,
|
|
114
112
|
renderCounter: _propTypes["default"].number,
|
|
115
|
-
modifiers: _propTypes["default"].string,
|
|
116
113
|
userPropsData: _propTypes["default"].object
|
|
117
114
|
};
|
|
118
115
|
BannerRender.defaultProps = {
|
|
@@ -124,7 +121,6 @@ BannerRender.defaultProps = {
|
|
|
124
121
|
targetings: '',
|
|
125
122
|
sizes: '',
|
|
126
123
|
renderCounter: null,
|
|
127
|
-
modifiers: '',
|
|
128
124
|
userPropsData: {}
|
|
129
125
|
};
|
|
130
126
|
var _default = (0, _HOC.withTitle)(BannerRender);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerRender.js","names":["_react","_interopRequireDefault","require","_propTypes","_client","_query","_helpers","_constants","_HOC","_AdSlotRender","_excluded","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","BannerRender","_ref","baseAdunit","adunit","sizeId","sizes","propsToDisplay","entity","targetings","parent","asPath","action","actionKey","renderCounter","userPropsData","
|
|
1
|
+
{"version":3,"file":"BannerRender.js","names":["_react","_interopRequireDefault","require","_propTypes","_client","_query","_helpers","_constants","_HOC","_AdSlotRender","_excluded","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","BannerRender","_ref","baseAdunit","adunit","sizeId","sizes","propsToDisplay","entity","targetings","parent","asPath","action","actionKey","renderCounter","userPropsData","otherProps","_objectWithoutProperties2","id","itemId","_useQuery","useQuery","variables","where","skip","_useQuery$data","data","entityRecordData","_useQuery2","generateSingleItemQuery","GET_BANNER","BANNER_QUERY_PROPS","_useQuery2$data","bannerData","_useQuery3","getCount","COUNT_CONTENT_HIERARCHIES","parentId","childEntity","_ilike","concat","PUBLISHED","_useQuery3$data","parsedTargetings","buildContextualTargeting","entityData","_ref2","bannerSizes","sizeMapping","buildSizeMapping","parsedSizes","buildBannerSizes","countContentHierarchies","parsedAdunit","buildParsedAdunit","isContextualTargetingSet","isContextualTargetingReady","shouldShowBanner","customTargetings","setCustomTargetings","targetingArguments","createElement","propTypes","PropTypes","object","isRequired","string","array","number","defaultProps","_default","withTitle","exports"],"sources":["../../../src/components/Banner/BannerRender.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { useQuery } from '@apollo/client';\n\nimport { generateSingleItemQuery, getCount } from '../../application/query';\nimport {\n buildBannerSizes,\n buildContextualTargeting,\n buildParsedAdunit,\n buildSizeMapping,\n setCustomTargetings\n} from './helpers';\nimport {\n BANNER_QUERY_PROPS,\n COUNT_CONTENT_HIERARCHIES,\n GET_BANNER,\n PUBLISHED\n} from '../../constants';\nimport { withTitle } from '../../HOC';\nimport AdSlotRender from './AdSlotRender';\n\nconst BannerRender = ({\n baseAdunit,\n adunit,\n sizeId,\n sizes,\n propsToDisplay,\n entity,\n targetings,\n parent,\n asPath,\n action,\n actionKey,\n renderCounter,\n userPropsData,\n ...otherProps\n}) => {\n const { id } = otherProps;\n const { itemId } = parent;\n\n const { data: entityRecordData = {} } = useQuery(action, {\n variables: { where: { id: id || itemId } },\n skip: id && id !== itemId\n });\n\n const { data: bannerData = {} } = useQuery(\n generateSingleItemQuery(GET_BANNER, BANNER_QUERY_PROPS),\n {\n variables: { id: sizeId },\n skip: !sizeId\n }\n );\n\n const { data = {} } = useQuery(getCount(COUNT_CONTENT_HIERARCHIES), {\n variables: {\n where: {\n parentId: id || itemId,\n childEntity: {\n _ilike: `${PUBLISHED}_%`\n }\n }\n }\n });\n\n const parsedTargetings = buildContextualTargeting(actionKey, entityRecordData, propsToDisplay);\n const { entityData } = bannerData;\n const { sizes: bannerSizes } = entityData || {};\n\n const sizeMapping = buildSizeMapping(sizeId, bannerSizes);\n const parsedSizes = buildBannerSizes(sizeId, bannerSizes, sizes);\n\n const { countContentHierarchies } = data;\n\n const parsedAdunit = buildParsedAdunit(asPath, countContentHierarchies, baseAdunit, adunit);\n const isContextualTargetingSet =\n propsToDisplay.length && parsedTargetings && Object.keys(parsedTargetings).length;\n const isContextualTargetingReady = isContextualTargetingSet || !propsToDisplay.length;\n const shouldShowBanner =\n parsedAdunit && parsedSizes && !!parsedSizes.length && isContextualTargetingReady;\n\n const customTargetings = setCustomTargetings(targetings, renderCounter);\n\n const targetingArguments = { ...parsedTargetings, ...customTargetings, ...userPropsData };\n\n return (\n <AdSlotRender\n shouldShowBanner={!!shouldShowBanner}\n sizeMapping={sizeMapping}\n sizeId={sizeId}\n parsedAdunit={parsedAdunit}\n parsedSizes={parsedSizes}\n targetingArguments={targetingArguments}\n />\n );\n};\n\nBannerRender.propTypes = {\n parent: PropTypes.object.isRequired,\n asPath: PropTypes.string.isRequired,\n action: PropTypes.object.isRequired,\n actionKey: PropTypes.string.isRequired,\n adunit: PropTypes.string,\n baseAdunit: PropTypes.string,\n sizeId: PropTypes.string,\n propsToDisplay: PropTypes.array,\n entity: PropTypes.string,\n targetings: PropTypes.string,\n sizes: PropTypes.string,\n renderCounter: PropTypes.number,\n userPropsData: PropTypes.object\n};\n\nBannerRender.defaultProps = {\n adunit: '',\n baseAdunit: '',\n sizeId: '',\n propsToDisplay: [],\n entity: '',\n targetings: '',\n sizes: '',\n renderCounter: null,\n userPropsData: {}\n};\n\nexport default withTitle(BannerRender);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAOA,IAAAK,UAAA,GAAAL,OAAA;AAMA,I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EAAE,EAAE;EACdH,KAAK,EAAE,EAAE;EACTQ,aAAa,EAAE,IAAI;EACnBC,aAAa,EAAE,CAAC;AAClB,CAAC;AAAC,IAAAuD,QAAA,GAEa,IAAAC,cAAS,EAACtE,YAAY,CAAC;AAAAuE,OAAA,cAAAF,QAAA"}
|
|
@@ -63,11 +63,10 @@ var buildLoopPropsContent = function buildLoopPropsContent() {
|
|
|
63
63
|
modifier = _options$modifier === void 0 ? '' : _options$modifier;
|
|
64
64
|
return propertiesToDisplay.map(function (key) {
|
|
65
65
|
var loopValue = loopValues[key];
|
|
66
|
-
var
|
|
67
|
-
var propValue = loopValueItem ? getLoopValue(loopValueItem) : regularValues[key];
|
|
66
|
+
var propValue = loopValue ? getLoopValue(loopValue[i]) : regularValues[key];
|
|
68
67
|
if (!propValue) return null;
|
|
69
68
|
var processedValue = (0, _helpers.processDataSummaryValue)(propValue, options);
|
|
70
|
-
var linkToPublishedContent = (0, _getLinkToPublishedContent["default"])(key, data
|
|
69
|
+
var linkToPublishedContent = (0, _getLinkToPublishedContent["default"])(key, data);
|
|
71
70
|
return [(0, _lodash["default"])(label), processedValue, linkToPublishedContent, modifier];
|
|
72
71
|
});
|
|
73
72
|
})).filter(Boolean);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-loop-props-content.js","names":["_lodash","_interopRequireDefault","require","_lodash2","_getLinkToPublishedContent","_getLoopPropsLimit","_getPropValue","_helpers","getLoopValue","value","keyField","separateValues","propsToDisplay","loopProps","data","regularValues","loopValues","forEach","options","propertiesToDisplay","prop","getPropValue","isArrayValue","Array","isArray","isLoopableProp","includes","buildLoopPropsContent","arguments","length","undefined","limit","loopPropsWithContent","_separateValues","_separateValues2","_slicedToArray2","loopLimit","getLoopPropsLimit","_loop","i","propsArray","flatten","map","label","_options$modifier","modifier","key","loopValue","
|
|
1
|
+
{"version":3,"file":"build-loop-props-content.js","names":["_lodash","_interopRequireDefault","require","_lodash2","_getLinkToPublishedContent","_getLoopPropsLimit","_getPropValue","_helpers","getLoopValue","value","keyField","separateValues","propsToDisplay","loopProps","data","regularValues","loopValues","forEach","options","propertiesToDisplay","prop","getPropValue","isArrayValue","Array","isArray","isLoopableProp","includes","buildLoopPropsContent","arguments","length","undefined","limit","loopPropsWithContent","_separateValues","_separateValues2","_slicedToArray2","loopLimit","getLoopPropsLimit","_loop","i","propsArray","flatten","map","label","_options$modifier","modifier","key","loopValue","propValue","processedValue","processDataSummaryValue","linkToPublishedContent","getLinkToPublishedContent","upperFirst","filter","Boolean","push","_default","exports"],"sources":["../../../../src/components/DataSummary/helpers/build-loop-props-content.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport flatten from 'lodash.flatten';\nimport getLinkToPublishedContent from './get-link-to-published-content';\nimport getLoopPropsLimit from './get-loop-props-limit';\nimport getPropValue from './get-prop-value';\nimport { processDataSummaryValue } from '../../../helpers';\n\nconst getLoopValue = value => {\n const { keyField } = value;\n return value[keyField];\n};\n\nconst separateValues = (propsToDisplay, loopProps, data) => {\n const regularValues = {};\n const loopValues = {};\n\n propsToDisplay.forEach(options => {\n const { propertiesToDisplay } = options;\n propertiesToDisplay.forEach(prop => {\n const value = getPropValue(prop, data, options);\n const isArrayValue = Array.isArray(value);\n if (!value) return;\n const isLoopableProp = loopProps.includes(prop) && isArrayValue;\n\n if (isLoopableProp) {\n loopValues[prop] = value;\n } else {\n regularValues[prop] = value;\n }\n });\n });\n return [regularValues, loopValues];\n};\n\nconst buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, data = {}) => {\n const loopPropsWithContent = [];\n const [regularValues, loopValues] = separateValues(propsToDisplay, loopProps, data);\n\n const loopLimit = getLoopPropsLimit(loopValues, limit);\n\n for (let i = 0; i < loopLimit; i += 1) {\n const propsArray = flatten(\n propsToDisplay.map(options => {\n const { propertiesToDisplay, label, modifier = '' } = options;\n\n return propertiesToDisplay.map(key => {\n const loopValue = loopValues[key];\n const propValue = loopValue ? getLoopValue(loopValue[i]) : regularValues[key];\n if (!propValue) return null;\n\n const processedValue = processDataSummaryValue(propValue, options);\n const linkToPublishedContent = getLinkToPublishedContent(key, data);\n return [upperFirst(label), processedValue, linkToPublishedContent, modifier];\n });\n })\n ).filter(Boolean);\n loopPropsWithContent.push(propsArray);\n }\n\n return flatten(loopPropsWithContent);\n};\n\nexport default buildLoopPropsContent;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,0BAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,kBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAEA,IAAMM,YAAY,GAAG,SAAfA,YAAYA,CAAGC,KAAK,EAAI;EAC5B,IAAQC,QAAQ,GAAKD,KAAK,CAAlBC,QAAQ;EAChB,OAAOD,KAAK,CAACC,QAAQ,CAAC;AACxB,CAAC;AAED,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,cAAc,EAAEC,SAAS,EAAEC,IAAI,EAAK;EAC1D,IAAMC,aAAa,GAAG,CAAC,CAAC;EACxB,IAAMC,UAAU,GAAG,CAAC,CAAC;EAErBJ,cAAc,CAACK,OAAO,CAAC,UAAAC,OAAO,EAAI;IAChC,IAAQC,mBAAmB,GAAKD,OAAO,CAA/BC,mBAAmB;IAC3BA,mBAAmB,CAACF,OAAO,CAAC,UAAAG,IAAI,EAAI;MAClC,IAAMX,KAAK,GAAG,IAAAY,wBAAY,EAACD,IAAI,EAAEN,IAAI,EAAEI,OAAO,CAAC;MAC/C,IAAMI,YAAY,GAAGC,KAAK,CAACC,OAAO,CAACf,KAAK,CAAC;MACzC,IAAI,CAACA,KAAK,EAAE;MACZ,IAAMgB,cAAc,GAAGZ,SAAS,CAACa,QAAQ,CAACN,IAA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B,KAAK;QAAAC,iBAAA,GAAoB1B,OAAO,CAAzB2B,QAAQ;QAARA,QAAQ,GAAAD,iBAAA,cAAG,EAAE,GAAAA,iBAAA;MAEjD,OAAOzB,mBAAmB,CAACuB,GAAG,CAAC,UAAAI,GAAG,EAAI;QACpC,IAAMC,SAAS,GAAG/B,UAAU,CAAC8B,GAAG,CAAC;QACjC,IAAME,SAAS,GAAGD,SAAS,GAAGvC,YAAY,CAACuC,SAAS,CAACR,CAAC,CAAC,CAAC,GAAGxB,aAAa,CAAC+B,GAAG,CAAC;QAC7E,IAAI,CAACE,SAAS,EAAE,OAAO,IAAI;QAE3B,IAAMC,cAAc,GAAG,IAAAC,gCAAuB,EAACF,SAAS,EAAE9B,OAAO,CAAC;QAClE,IAAMiC,sBAAsB,GAAG,IAAAC,qCAAyB,EAACN,GAAG,EAAEhC,IAAI,CAAC;QACnE,OAAO,CAAC,IAAAuC,kBAAU,EAACV,KAAK,CAAC,EAAEM,cAAc,EAAEE,sBAAsB,EAAEN,QAAQ,CAAC;MAC9E,CAAC,CAAC;IACJ,CAAC,CACH,CAAC,CAACS,MAAM,CAACC,OAAO,CAAC;IACjBvB,oBAAoB,CAACwB,IAAI,CAAChB,UAAU,CAAC;EACvC,CAAC;EAjBD,KAAK,IAAID,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,SAAS,EAAEG,CAAC,IAAI,CAAC;IAAAD,KAAA,CAAAC,CAAA;EAAA;EAmBrC,OAAO,IAAAE,mBAAO,EAACT,oBAAoB,CAAC;AACtC,CAAC;AAAC,IAAAyB,QAAA,GAEa9B,qBAAqB;AAAA+B,OAAA,cAAAD,QAAA"}
|
|
@@ -11,12 +11,10 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
11
11
|
var getLinkToPublishedContent = function getLinkToPublishedContent() {
|
|
12
12
|
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
13
13
|
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
14
|
-
var currentValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
15
14
|
var _key$split = key.split('.'),
|
|
16
15
|
_key$split2 = (0, _slicedToArray2["default"])(_key$split, 1),
|
|
17
16
|
baseKey = _key$split2[0];
|
|
18
17
|
if (!props[baseKey]) return '';
|
|
19
|
-
if (currentValue && typeof currentValue.url !== 'undefined') return currentValue.url;
|
|
20
18
|
var content = Array.isArray(props[baseKey]) ? props[baseKey][0] : props[baseKey];
|
|
21
19
|
return content && content.url ? content.url : '';
|
|
22
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-link-to-published-content.js","names":["getLinkToPublishedContent","key","arguments","length","undefined","props","
|
|
1
|
+
{"version":3,"file":"get-link-to-published-content.js","names":["getLinkToPublishedContent","key","arguments","length","undefined","props","_key$split","split","_key$split2","_slicedToArray2","baseKey","content","Array","isArray","url","_default","exports"],"sources":["../../../../src/components/DataSummary/helpers/get-link-to-published-content.js"],"sourcesContent":["const getLinkToPublishedContent = (key = '', props = {}) => {\n const [baseKey] = key.split('.');\n if (!props[baseKey]) return '';\n const content = Array.isArray(props[baseKey]) ? props[baseKey][0] : props[baseKey];\n return content && content.url ? content.url : '';\n};\n\nexport default getLinkToPublishedContent;\n"],"mappings":";;;;;;;;;;AAAA,IAAMA,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAA,EAA6B;EAAA,IAAzBC,GAAG,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAAA,IAAEG,KAAK,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACrD,IAAAI,UAAA,GAAkBL,GAAG,CAACM,KAAK,CAAC,GAAG,CAAC;IAAAC,WAAA,OAAAC,eAAA,aAAAH,UAAA;IAAzBI,OAAO,GAAAF,WAAA;EACd,IAAI,CAACH,KAAK,CAACK,OAAO,CAAC,EAAE,OAAO,EAAE;EAC9B,IAAMC,OAAO,GAAGC,KAAK,CAACC,OAAO,CAACR,KAAK,CAACK,OAAO,CAAC,CAAC,GAAGL,KAAK,CAACK,OAAO,CAAC,CAAC,CAAC,CAAC,GAAGL,KAAK,CAACK,OAAO,CAAC;EAClF,OAAOC,OAAO,IAAIA,OAAO,CAACG,GAAG,GAAGH,OAAO,CAACG,GAAG,GAAG,EAAE;AAClD,CAAC;AAAC,IAAAC,QAAA,GAEaf,yBAAyB;AAAAgB,OAAA,cAAAD,QAAA"}
|
|
@@ -15,15 +15,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
17
|
exports["default"] = void 0;
|
|
18
|
-
require("core-js/modules/es.array.concat.js");
|
|
19
18
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
20
|
+
require("core-js/modules/es.array.concat.js");
|
|
20
21
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
21
22
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
22
|
-
var
|
|
23
|
+
var _buildRawQueryBase2 = _interopRequireDefault(require("./build-raw-query-base"));
|
|
23
24
|
var _getItemsToDisplayIds = _interopRequireDefault(require("./get-items-to-display-ids"));
|
|
24
25
|
var _getExtraAzBits = _interopRequireDefault(require("./get-extra-az-bits"));
|
|
25
26
|
var _buildAzFilter = _interopRequireDefault(require("./build-az-filter"));
|
|
26
27
|
var _constants = require("../constants");
|
|
28
|
+
var _excluded = ["should"];
|
|
27
29
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28
30
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29
31
|
var buildRawQuery = function buildRawQuery(_ref) {
|
|
@@ -35,7 +37,10 @@ var buildRawQuery = function buildRawQuery(_ref) {
|
|
|
35
37
|
itemsToDisplay = _ref.itemsToDisplay,
|
|
36
38
|
shouldApplySort = _ref.shouldApplySort,
|
|
37
39
|
azOptions = _ref.azOptions;
|
|
38
|
-
var
|
|
40
|
+
var _searchValues$searchV = searchValues.searchValuesText,
|
|
41
|
+
searchValuesText = _searchValues$searchV.must,
|
|
42
|
+
_searchValues$searchV2 = _searchValues$searchV.should,
|
|
43
|
+
shouldValuesText = _searchValues$searchV2 === void 0 ? [] : _searchValues$searchV2,
|
|
39
44
|
searchValuesCheckboxSelectRange = searchValues.searchValuesCheckboxSelectRange,
|
|
40
45
|
searchValuesCheckboxOr = searchValues.searchValuesCheckboxOr;
|
|
41
46
|
var filterValues = filterData.filterValues,
|
|
@@ -78,7 +83,7 @@ var buildRawQuery = function buildRawQuery(_ref) {
|
|
|
78
83
|
finalValue = {
|
|
79
84
|
must: [].concat((0, _toConsumableArray2["default"])(searchValuesCheckboxSelectRange), [{
|
|
80
85
|
bool: {
|
|
81
|
-
should: searchValuesTextCheckboxOr
|
|
86
|
+
should: [].concat((0, _toConsumableArray2["default"])(searchValuesTextCheckboxOr), (0, _toConsumableArray2["default"])(shouldValuesText))
|
|
82
87
|
}
|
|
83
88
|
}])
|
|
84
89
|
};
|
|
@@ -87,17 +92,23 @@ var buildRawQuery = function buildRawQuery(_ref) {
|
|
|
87
92
|
bool: finalValue
|
|
88
93
|
}];
|
|
89
94
|
(0, _buildAzFilter["default"])(azFilter, mustValues, azSortProperty);
|
|
90
|
-
var
|
|
91
|
-
bool: _objectSpread({
|
|
92
|
-
must: mustValues
|
|
93
|
-
}, (0, _buildRawQueryBase["default"])({
|
|
95
|
+
var _buildRawQueryBase = (0, _buildRawQueryBase2["default"])({
|
|
94
96
|
docType: docType,
|
|
95
97
|
id: id,
|
|
96
98
|
filterValues: filterValues,
|
|
97
99
|
filterOperator: filterOperator,
|
|
98
100
|
relations: relations,
|
|
99
101
|
stringProps: stringProps
|
|
100
|
-
})
|
|
102
|
+
}),
|
|
103
|
+
_buildRawQueryBase$sh = _buildRawQueryBase.should,
|
|
104
|
+
baseShould = _buildRawQueryBase$sh === void 0 ? [] : _buildRawQueryBase$sh,
|
|
105
|
+
baseQuery = (0, _objectWithoutProperties2["default"])(_buildRawQueryBase, _excluded);
|
|
106
|
+
var shouldValue = [].concat((0, _toConsumableArray2["default"])(baseShould), (0, _toConsumableArray2["default"])(shouldValuesText));
|
|
107
|
+
var query = {
|
|
108
|
+
bool: _objectSpread({
|
|
109
|
+
must: mustValues,
|
|
110
|
+
should: shouldValue.length ? shouldValue : undefined
|
|
111
|
+
}, baseQuery)
|
|
101
112
|
};
|
|
102
113
|
var azQueryBits = (0, _getExtraAzBits["default"])(_objectSpread(_objectSpread({}, azOptions), {}, {
|
|
103
114
|
azSortProperty: azSortProperty,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-raw-query.js","names":["
|
|
1
|
+
{"version":3,"file":"build-raw-query.js","names":["_buildRawQueryBase2","_interopRequireDefault","require","_getItemsToDisplayIds","_getExtraAzBits","_buildAzFilter","_constants","_excluded","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","buildRawQuery","_ref","docType","operator","searchValues","filterData","id","itemsToDisplay","shouldApplySort","azOptions","_searchValues$searchV","searchValuesText","must","_searchValues$searchV2","should","shouldValuesText","searchValuesCheckboxSelectRange","searchValuesCheckboxOr","filterValues","filterOperator","relations","stringProps","azFilter","_ref2","isAZ","_ref2$sortProperties","sortProperties","sortPropertyToUse","isScore","_ref3","propsToDisplay","_ref3$propsToDisplay","_ref3$propsToDisplay2","_ref3$propsToDisplay3","_slicedToArray2","azSortProp","azSortProperty","AZ_DEFAULT_PROP","searchValuesTextCheckboxSelectJoined","AND_OPERATOR","concat","_toConsumableArray2","searchValuesTextCheckboxOr","finalValue","finalValueWithCheckboxOrValues","bool","finalValueIfNoCheckboxOrValues","mustValues","buildAzFilter","_buildRawQueryBase","buildRawQueryBase","_buildRawQueryBase$sh","baseShould","baseQuery","_objectWithoutProperties2","shouldValue","query","undefined","azQueryBits","getExtraAzBits","itemsToDisplayIds","getItemsToDisplayIds","ids","values","sort","_script","type","script","lang","source","params","sortOrder","order","_default","exports"],"sources":["../../src/helpers/build-raw-query.js"],"sourcesContent":["import buildRawQueryBase from './build-raw-query-base';\nimport getItemsToDisplayIds from './get-items-to-display-ids';\nimport getExtraAzBits from './get-extra-az-bits';\nimport buildAzFilter from './build-az-filter';\nimport { AND_OPERATOR, AZ_DEFAULT_PROP } from '../constants';\n\nconst buildRawQuery = ({\n docType,\n operator,\n searchValues,\n filterData,\n id,\n itemsToDisplay,\n shouldApplySort,\n azOptions\n}) => {\n const {\n searchValuesText: { must: searchValuesText, should: shouldValuesText = [] },\n searchValuesCheckboxSelectRange,\n searchValuesCheckboxOr\n } = searchValues;\n const { filterValues, filterOperator, relations, stringProps, azFilter } = filterData;\n\n const { isAZ, sortProperties = [] } = azOptions || {};\n const sortPropertyToUse = isAZ && sortProperties[0] && sortProperties[0].isScore ? 1 : 0;\n const { propsToDisplay: [azSortProp] = [] } = sortProperties[sortPropertyToUse] || {\n propsToDisplay: []\n };\n const azSortProperty = azSortProp || AZ_DEFAULT_PROP;\n\n const searchValuesTextCheckboxSelectJoined =\n operator === AND_OPERATOR ? [...searchValuesText, ...searchValuesCheckboxSelectRange] : [];\n let searchValuesTextCheckboxOr = searchValuesText;\n if (searchValuesCheckboxOr.length) {\n searchValuesTextCheckboxOr = [...searchValuesText, ...searchValuesCheckboxOr];\n }\n\n let finalValue;\n\n if (searchValuesTextCheckboxSelectJoined.length) {\n const finalValueWithCheckboxOrValues = {\n must: [...searchValuesTextCheckboxSelectJoined, { bool: { should: searchValuesCheckboxOr } }]\n };\n const finalValueIfNoCheckboxOrValues = { must: searchValuesTextCheckboxSelectJoined };\n finalValue = searchValuesCheckboxOr.length\n ? finalValueWithCheckboxOrValues\n : finalValueIfNoCheckboxOrValues;\n } else {\n finalValue = {\n must: [\n ...searchValuesCheckboxSelectRange,\n { bool: { should: [...searchValuesTextCheckboxOr, ...shouldValuesText] } }\n ]\n };\n }\n const mustValues = [\n {\n bool: finalValue\n }\n ];\n\n buildAzFilter(azFilter, mustValues, azSortProperty);\n\n const { should: baseShould = [], ...baseQuery } = buildRawQueryBase({\n docType,\n id,\n filterValues,\n filterOperator,\n relations,\n stringProps\n });\n const shouldValue = [...baseShould, ...shouldValuesText];\n const query = {\n bool: {\n must: mustValues,\n should: shouldValue.length ? shouldValue : undefined,\n ...baseQuery\n }\n };\n const azQueryBits = getExtraAzBits({ ...azOptions, azSortProperty, azFilter });\n\n if (itemsToDisplay && itemsToDisplay.length) {\n const itemsToDisplayIds = getItemsToDisplayIds(itemsToDisplay);\n\n query.bool.must.push({ ids: { values: itemsToDisplayIds } });\n if (shouldApplySort) {\n return {\n query,\n sort: {\n _script: {\n type: 'number',\n script: {\n lang: 'painless',\n source:\n \"!doc['id.keyword'].empty ? params.sortOrder.indexOf(doc['id.keyword'].value) : 0\",\n params: {\n sortOrder: itemsToDisplayIds\n }\n },\n order: 'asc'\n }\n },\n ...azQueryBits\n };\n }\n }\n\n return isAZ\n ? {\n query,\n ...azQueryBits\n }\n : query;\n};\n\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CAAC;IAC5D,IAAIpD,eAAe,EAAE;MACnB,OAAAhB,aAAA;QACEgE,KAAK,EAALA,KAAK;QACLQ,IAAI,EAAE;UACJC,OAAO,EAAE;YACPC,IAAI,EAAE,QAAQ;YACdC,MAAM,EAAE;cACNC,IAAI,EAAE,UAAU;cAChBC,MAAM,EACJ,kFAAkF;cACpFC,MAAM,EAAE;gBACNC,SAAS,EAAEX;cACb;YACF,CAAC;YACDY,KAAK,EAAE;UACT;QACF;MAAC,GACEd,WAAW;IAElB;EACF;EAEA,OAAOlC,IAAI,GAAAhC,aAAA;IAELgE,KAAK,EAALA;EAAK,GACFE,WAAW,IAEhBF,KAAK;AACX,CAAC;AAAC,IAAAiB,QAAA,GAEazE,aAAa;AAAA0E,OAAA,cAAAD,QAAA"}
|
|
@@ -15,24 +15,27 @@ var buildSearchValuesText = function buildSearchValuesText(_ref, _ref2) {
|
|
|
15
15
|
return propsToDisplay.reduce(function (acc, field, index) {
|
|
16
16
|
if (field && searchTerm) {
|
|
17
17
|
if (index === 0) {
|
|
18
|
-
acc
|
|
18
|
+
acc.should.push({
|
|
19
19
|
match: {
|
|
20
20
|
pageBuilderIndexed: {
|
|
21
21
|
query: searchTerm,
|
|
22
22
|
fuzziness: 'AUTO'
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
};
|
|
25
|
+
});
|
|
26
26
|
}
|
|
27
|
-
acc
|
|
27
|
+
acc.must.push({
|
|
28
28
|
match: (0, _defineProperty2["default"])({}, field, {
|
|
29
29
|
query: searchTerm,
|
|
30
30
|
fuzziness: 'AUTO'
|
|
31
31
|
})
|
|
32
|
-
};
|
|
32
|
+
});
|
|
33
33
|
}
|
|
34
34
|
return acc;
|
|
35
|
-
},
|
|
35
|
+
}, {
|
|
36
|
+
should: [],
|
|
37
|
+
must: []
|
|
38
|
+
});
|
|
36
39
|
};
|
|
37
40
|
var _default = buildSearchValuesText;
|
|
38
41
|
exports["default"] = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-search-values-text.js","names":["buildSearchValuesText","_ref","_ref2","propsToDisplay","searchTerm","search_term","reduce","acc","field","index","match","pageBuilderIndexed","query","fuzziness","_defineProperty2","_default","exports"],"sources":["../../src/helpers/build-search-values-text.js"],"sourcesContent":["const buildSearchValuesText = ({ propsToDisplay }, { search_term: searchTerm }) =>\n propsToDisplay.reduce((acc, field, index) => {\n
|
|
1
|
+
{"version":3,"file":"build-search-values-text.js","names":["buildSearchValuesText","_ref","_ref2","propsToDisplay","searchTerm","search_term","reduce","acc","field","index","should","push","match","pageBuilderIndexed","query","fuzziness","must","_defineProperty2","_default","exports"],"sources":["../../src/helpers/build-search-values-text.js"],"sourcesContent":["const buildSearchValuesText = ({ propsToDisplay }, { search_term: searchTerm }) =>\n propsToDisplay.reduce(\n (acc, field, index) => {\n if (field && searchTerm) {\n if (index === 0) {\n acc.should.push({\n match: {\n pageBuilderIndexed: {\n query: searchTerm,\n fuzziness: 'AUTO'\n }\n }\n });\n }\n acc.must.push({\n match: {\n [field]: {\n query: searchTerm,\n fuzziness: 'AUTO'\n }\n }\n });\n }\n return acc;\n },\n { should: [], must: [] }\n );\n\nexport default buildSearchValuesText;\n"],"mappings":";;;;;;;;;;;AAAA,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAAC,IAAA,EAAAC,KAAA;EAAA,IAAMC,cAAc,GAAAF,IAAA,CAAdE,cAAc;EAAA,IAAmBC,UAAU,GAAAF,KAAA,CAAvBG,WAAW;EAAA,OAC9DF,cAAc,CAACG,MAAM,CACnB,UAACC,GAAG,EAAEC,KAAK,EAAEC,KAAK,EAAK;IACrB,IAAID,KAAK,IAAIJ,UAAU,EAAE;MACvB,IAAIK,KAAK,KAAK,CAAC,EAAE;QACfF,GAAG,CAACG,MAAM,CAACC,IAAI,CAAC;UACdC,KAAK,EAAE;YACLC,kBAAkB,EAAE;cAClBC,KAAK,EAAEV,UAAU;cACjBW,SAAS,EAAE;YACb;UACF;QACF,CAAC,CAAC;MACJ;MACAR,GAAG,CAACS,IAAI,CAACL,IAAI,CAAC;QACZC,KAAK,MAAAK,gBAAA,iBACFT,KAAK,EAAG;UACPM,KAAK,EAAEV,UAAU;UACjBW,SAAS,EAAE;QACb,CAAC;MAEL,CAAC,CAAC;IACJ;IACA,OAAOR,GAAG;EACZ,CAAC,EACD;IAAEG,MAAM,EAAE,EAAE;IAAEM,IAAI,EAAE;EAAG,CACzB,CAAC;AAAA;AAAC,IAAAE,QAAA,GAEWlB,qBAAqB;AAAAmB,OAAA,cAAAD,QAAA"}
|
|
@@ -2,14 +2,12 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { AdSlot } from 'react-dfp';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { BANNER_LOADING, BANNER_EMPTY, BANNER_LOADED } from '../../constants';
|
|
5
|
-
import Wrapper from '../Wrapper';
|
|
6
5
|
const AdSlotRender = ({
|
|
7
6
|
shouldShowBanner,
|
|
8
7
|
sizeMapping,
|
|
9
8
|
sizeId,
|
|
10
9
|
parsedAdunit,
|
|
11
10
|
parsedSizes,
|
|
12
|
-
modifiers,
|
|
13
11
|
targetingArguments
|
|
14
12
|
}) => {
|
|
15
13
|
const [{
|
|
@@ -25,16 +23,11 @@ const AdSlotRender = ({
|
|
|
25
23
|
return `@media(min-width:${minWidth}px){.${bannerClass}{min-height:${minimumHeight}px;}`;
|
|
26
24
|
}).sort();
|
|
27
25
|
const className = `ad-slot ad-slot-${loadingStatus} ${bannerClass}`;
|
|
28
|
-
|
|
29
|
-
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
30
|
-
className: "banner",
|
|
31
|
-
modifiers: newModifers
|
|
32
|
-
}, styles && /*#__PURE__*/React.createElement("style", null, styles.join('\n')), /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, styles && /*#__PURE__*/React.createElement("style", null, styles.join('\n')), /*#__PURE__*/React.createElement("div", {
|
|
33
27
|
className: className,
|
|
34
28
|
style: {
|
|
35
29
|
minHeight
|
|
36
|
-
}
|
|
37
|
-
"data-testid": "ad-slot"
|
|
30
|
+
}
|
|
38
31
|
}, shouldShowBanner && /*#__PURE__*/React.createElement(AdSlot, {
|
|
39
32
|
adUnit: parsedAdunit,
|
|
40
33
|
sizes: parsedSizes,
|
|
@@ -62,12 +55,10 @@ AdSlotRender.propTypes = {
|
|
|
62
55
|
sizeId: PropTypes.string.isRequired,
|
|
63
56
|
parsedAdunit: PropTypes.string.isRequired,
|
|
64
57
|
parsedSizes: PropTypes.array,
|
|
65
|
-
modifiers: PropTypes.string,
|
|
66
58
|
targetingArguments: PropTypes.object.isRequired
|
|
67
59
|
};
|
|
68
60
|
AdSlotRender.defaultProps = {
|
|
69
|
-
parsedSizes: null
|
|
70
|
-
modifiers: ''
|
|
61
|
+
parsedSizes: null
|
|
71
62
|
};
|
|
72
63
|
export default AdSlotRender;
|
|
73
64
|
//# sourceMappingURL=AdSlotRender.js.map
|