@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdSlotRender.js","names":["React","useState","AdSlot","PropTypes","BANNER_LOADING","BANNER_EMPTY","BANNER_LOADED","
|
|
1
|
+
{"version":3,"file":"AdSlotRender.js","names":["React","useState","AdSlot","PropTypes","BANNER_LOADING","BANNER_EMPTY","BANNER_LOADED","AdSlotRender","shouldShowBanner","sizeMapping","sizeId","parsedAdunit","parsedSizes","targetingArguments","loadingStatus","minHeight","setLoadingStatus","bannerClass","styles","map","sizes","styleSizes","viewport","minWidth","minimumHeight","Math","min","height","sort","className","createElement","Fragment","join","style","adUnit","onSlotRender","slotData","event","isEmpty","size","slotHeight","length","undefined","newLoadingStatus","propTypes","bool","isRequired","array","string","object","defaultProps"],"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,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,MAAM,QAAQ,WAAW;AAClC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,cAAc,EAAEC,YAAY,EAAEC,aAAa,QAAQ,iBAAiB;AAE7E,MAAMC,YAAY,GAAGA,CAAC;EACpBC,gBAAgB;EAChBC,WAAW;EACXC,MAAM;EACNC,YAAY;EACZC,WAAW;EACXC;AACF,CAAC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AAM,GAAGF,IAAI,CAAC,CAAC,CAAC,GAAGG,SAAS;MAC5D,MAAMC,gBAAgB,GAAGL,OAAO,GAAGjC,YAAY,GAAGC,aAAa;MAC/DU,gBAAgB,CAAC;QAAEF,aAAa,EAAE6B,gBAAgB;QAAE5B,SAAS,EAAEyB;MAAW,CAAC,CAAC;IAC9E;EAAE,CACH,CAEA,CACL,CAAC;AAEP,CAAC;AAEDjC,YAAY,CAACqC,SAAS,GAAG;EACvBpC,gBAAgB,EAAEL,SAAS,CAAC0C,IAAI,CAACC,UAAU;EAC3CrC,WAAW,EAAEN,SAAS,CAAC4C,KAAK,CAACD,UAAU;EACvCpC,MAAM,EAAEP,SAAS,CAAC6C,MAAM,CAACF,UAAU;EACnCnC,YAAY,EAAER,SAAS,CAAC6C,MAAM,CAACF,UAAU;EACzClC,WAAW,EAAET,SAAS,CAAC4C,KAAK;EAC5BlC,kBAAkB,EAAEV,SAAS,CAAC8C,MAAM,CAACH;AACvC,CAAC;AAEDvC,YAAY,CAAC2C,YAAY,GAAG;EAC1BtC,WAAW,EAAE;AACf,CAAC;AAED,eAAeL,YAAY"}
|
|
@@ -10,6 +10,7 @@ import { useQuery } from '@apollo/client';
|
|
|
10
10
|
import { useRouter } from 'next/router';
|
|
11
11
|
import { buildUserQuery, buildPropsData } from './helpers';
|
|
12
12
|
import { getSingleEntitySchema, getUser } from '../../application/query';
|
|
13
|
+
import Wrapper from '../Wrapper';
|
|
13
14
|
import BannerRender from './BannerRender';
|
|
14
15
|
import buildPropsQuery from '../../helpers/build-props-query';
|
|
15
16
|
import { getClassModifiers } from '../../utils';
|
|
@@ -74,15 +75,17 @@ const Banner = _ref => {
|
|
|
74
75
|
action
|
|
75
76
|
} = getEntityRenderProps(queryProps, data, isPreview);
|
|
76
77
|
const bannerKey = `${sizeId}${asPath}`;
|
|
77
|
-
return /*#__PURE__*/React.createElement(
|
|
78
|
+
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
79
|
+
className: type,
|
|
80
|
+
modifiers: modifiers
|
|
81
|
+
}, /*#__PURE__*/React.createElement(BannerRender, _extends({
|
|
78
82
|
key: bannerKey
|
|
79
83
|
}, otherProps, {
|
|
80
84
|
action: action,
|
|
81
85
|
actionKey: actionKey,
|
|
82
86
|
asPath: asPath,
|
|
83
|
-
userPropsData: userPropsData
|
|
84
|
-
|
|
85
|
-
}));
|
|
87
|
+
userPropsData: userPropsData
|
|
88
|
+
})));
|
|
86
89
|
};
|
|
87
90
|
Banner.propTypes = {
|
|
88
91
|
type: PropTypes.string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.js","names":["React","useContext","MainContext","checkIfLoggedIn","PropTypes","flatten","useQuery","useRouter","buildUserQuery","buildPropsData","getSingleEntitySchema","getUser","BannerRender","buildPropsQuery","getClassModifiers","getEntityRenderProps","Banner","_ref","type","otherProps","_objectWithoutProperties","_excluded","router","isPreview","id","userId","asPath","parent","entity","sizeId","propsToDisplay","userPropsToDisplay","userQuery","itemEntity","data","error","loading","variables","userData","userLoading","skip","length","message","modifiers","queryProps","map","propertiesToDisplay","userPropsData","actionKey","action","bannerKey","createElement","_extends","key","propTypes","string","defaultProps"],"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","useContext","MainContext","checkIfLoggedIn","PropTypes","flatten","useQuery","useRouter","buildUserQuery","buildPropsData","getSingleEntitySchema","getUser","Wrapper","BannerRender","buildPropsQuery","getClassModifiers","getEntityRenderProps","Banner","_ref","type","otherProps","_objectWithoutProperties","_excluded","router","isPreview","id","userId","asPath","parent","entity","sizeId","propsToDisplay","userPropsToDisplay","userQuery","itemEntity","data","error","loading","variables","userData","userLoading","skip","length","message","modifiers","queryProps","map","propertiesToDisplay","userPropsData","actionKey","action","bannerKey","createElement","className","_extends","key","propTypes","string","defaultProps"],"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}\n />\n </Wrapper>\n );\n};\n\nBanner.propTypes = {\n type: PropTypes.string\n};\n\nBanner.defaultProps = {\n type: 'banner'\n};\n\nexport default Banner;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,eAAe,QAAQ,yBAAyB;AACzD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,OAAO,MAAM,gBAAgB;AACpC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAAS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;AAEDxC,MAAM,CAACyC,YAAY,GAAG;EACpBvC,IAAI,EAAE;AACR,CAAC;AAED,eAAeF,MAAM"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
const _excluded = ["baseAdunit", "adunit", "sizeId", "sizes", "propsToDisplay", "entity", "targetings", "parent", "asPath", "action", "actionKey", "renderCounter", "userPropsData"
|
|
3
|
+
const _excluded = ["baseAdunit", "adunit", "sizeId", "sizes", "propsToDisplay", "entity", "targetings", "parent", "asPath", "action", "actionKey", "renderCounter", "userPropsData"];
|
|
4
4
|
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; }
|
|
5
5
|
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) { _defineProperty(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; }
|
|
6
6
|
import React from 'react';
|
|
@@ -25,8 +25,7 @@ const BannerRender = _ref => {
|
|
|
25
25
|
action,
|
|
26
26
|
actionKey,
|
|
27
27
|
renderCounter,
|
|
28
|
-
userPropsData
|
|
29
|
-
modifiers
|
|
28
|
+
userPropsData
|
|
30
29
|
} = _ref,
|
|
31
30
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
32
31
|
const {
|
|
@@ -89,7 +88,6 @@ const BannerRender = _ref => {
|
|
|
89
88
|
sizeId: sizeId,
|
|
90
89
|
parsedAdunit: parsedAdunit,
|
|
91
90
|
parsedSizes: parsedSizes,
|
|
92
|
-
modifiers: modifiers,
|
|
93
91
|
targetingArguments: targetingArguments
|
|
94
92
|
});
|
|
95
93
|
};
|
|
@@ -106,7 +104,6 @@ BannerRender.propTypes = {
|
|
|
106
104
|
targetings: PropTypes.string,
|
|
107
105
|
sizes: PropTypes.string,
|
|
108
106
|
renderCounter: PropTypes.number,
|
|
109
|
-
modifiers: PropTypes.string,
|
|
110
107
|
userPropsData: PropTypes.object
|
|
111
108
|
};
|
|
112
109
|
BannerRender.defaultProps = {
|
|
@@ -118,7 +115,6 @@ BannerRender.defaultProps = {
|
|
|
118
115
|
targetings: '',
|
|
119
116
|
sizes: '',
|
|
120
117
|
renderCounter: null,
|
|
121
|
-
modifiers: '',
|
|
122
118
|
userPropsData: {}
|
|
123
119
|
};
|
|
124
120
|
export default withTitle(BannerRender);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerRender.js","names":["React","PropTypes","useQuery","generateSingleItemQuery","getCount","buildBannerSizes","buildContextualTargeting","buildParsedAdunit","buildSizeMapping","setCustomTargetings","BANNER_QUERY_PROPS","COUNT_CONTENT_HIERARCHIES","GET_BANNER","PUBLISHED","withTitle","AdSlotRender","BannerRender","_ref","baseAdunit","adunit","sizeId","sizes","propsToDisplay","entity","targetings","parent","asPath","action","actionKey","renderCounter","userPropsData","
|
|
1
|
+
{"version":3,"file":"BannerRender.js","names":["React","PropTypes","useQuery","generateSingleItemQuery","getCount","buildBannerSizes","buildContextualTargeting","buildParsedAdunit","buildSizeMapping","setCustomTargetings","BANNER_QUERY_PROPS","COUNT_CONTENT_HIERARCHIES","GET_BANNER","PUBLISHED","withTitle","AdSlotRender","BannerRender","_ref","baseAdunit","adunit","sizeId","sizes","propsToDisplay","entity","targetings","parent","asPath","action","actionKey","renderCounter","userPropsData","otherProps","_objectWithoutProperties","_excluded","id","itemId","data","entityRecordData","variables","where","skip","bannerData","parentId","childEntity","_ilike","parsedTargetings","entityData","bannerSizes","sizeMapping","parsedSizes","countContentHierarchies","parsedAdunit","isContextualTargetingSet","length","Object","keys","isContextualTargetingReady","shouldShowBanner","customTargetings","targetingArguments","_objectSpread","createElement","propTypes","object","isRequired","string","array","number","defaultProps"],"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,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,QAAQ,QAAQ,gBAAgB;AAEzC,SAASC,uBAAuB,EAAEC,QAAQ,QAAQ,yBAAyB;AAC3E,SACEC,gBAAgB,EAChBC,wBAAwB,EACxBC,iBAAiB,EACjBC,gBAAgB,EAChBC,mBAAmB,QACd,WAAW;AAClB,SACEC,kBAAkB,EAClBC,yBAAyB,EACzBC,UAAU,EACVC,SAAS,QACJ,iBAAiB;AACxB,SAASC,SAAS,QAAQ,WAAW;AACrC,OAAOC,YAAY,MAAM,gBAAgB;AAEzC,MAAMC,YAAY,G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zB,SAAS,CAACgE,MAAM,CAACD,UAAU;EACnCrC,MAAM,EAAE1B,SAAS,CAAC8D,MAAM,CAACC,UAAU;EACnCpC,SAAS,EAAE3B,SAAS,CAACgE,MAAM,CAACD,UAAU;EACtC7C,MAAM,EAAElB,SAAS,CAACgE,MAAM;EACxB/C,UAAU,EAAEjB,SAAS,CAACgE,MAAM;EAC5B7C,MAAM,EAAEnB,SAAS,CAACgE,MAAM;EACxB3C,cAAc,EAAErB,SAAS,CAACiE,KAAK;EAC/B3C,MAAM,EAAEtB,SAAS,CAACgE,MAAM;EACxBzC,UAAU,EAAEvB,SAAS,CAACgE,MAAM;EAC5B5C,KAAK,EAAEpB,SAAS,CAACgE,MAAM;EACvBpC,aAAa,EAAE5B,SAAS,CAACkE,MAAM;EAC/BrC,aAAa,EAAE7B,SAAS,CAAC8D;AAC3B,CAAC;AAED/C,YAAY,CAACoD,YAAY,GAAG;EAC1BjD,MAAM,EAAE,EAAE;EACVD,UAAU,EAAE,EAAE;EACdE,MAAM,EAAE,EAAE;EACVE,cAAc,EAAE,EAAE;EAClBC,MAAM,EAAE,EAAE;EACVC,UAAU,EAAE,EAAE;EACdH,KAAK,EAAE,EAAE;EACTQ,aAAa,EAAE,IAAI;EACnBC,aAAa,EAAE,CAAC;AAClB,CAAC;AAED,eAAehB,SAAS,CAACE,YAAY,CAAC"}
|
|
@@ -44,11 +44,10 @@ const buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, d
|
|
|
44
44
|
} = options;
|
|
45
45
|
return propertiesToDisplay.map(key => {
|
|
46
46
|
const loopValue = loopValues[key];
|
|
47
|
-
const
|
|
48
|
-
const propValue = loopValueItem ? getLoopValue(loopValueItem) : regularValues[key];
|
|
47
|
+
const propValue = loopValue ? getLoopValue(loopValue[i]) : regularValues[key];
|
|
49
48
|
if (!propValue) return null;
|
|
50
49
|
const processedValue = processDataSummaryValue(propValue, options);
|
|
51
|
-
const linkToPublishedContent = getLinkToPublishedContent(key, data
|
|
50
|
+
const linkToPublishedContent = getLinkToPublishedContent(key, data);
|
|
52
51
|
return [upperFirst(label), processedValue, linkToPublishedContent, modifier];
|
|
53
52
|
});
|
|
54
53
|
})).filter(Boolean);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-loop-props-content.js","names":["upperFirst","flatten","getLinkToPublishedContent","getLoopPropsLimit","getPropValue","processDataSummaryValue","getLoopValue","value","keyField","separateValues","propsToDisplay","loopProps","data","regularValues","loopValues","forEach","options","propertiesToDisplay","prop","isArrayValue","Array","isArray","isLoopableProp","includes","buildLoopPropsContent","limit","loopPropsWithContent","loopLimit","i","propsArray","map","label","modifier","key","loopValue","
|
|
1
|
+
{"version":3,"file":"build-loop-props-content.js","names":["upperFirst","flatten","getLinkToPublishedContent","getLoopPropsLimit","getPropValue","processDataSummaryValue","getLoopValue","value","keyField","separateValues","propsToDisplay","loopProps","data","regularValues","loopValues","forEach","options","propertiesToDisplay","prop","isArrayValue","Array","isArray","isLoopableProp","includes","buildLoopPropsContent","limit","loopPropsWithContent","loopLimit","i","propsArray","map","label","modifier","key","loopValue","propValue","processedValue","linkToPublishedContent","filter","Boolean","push"],"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,OAAOA,UAAU,MAAM,mBAAmB;AAC1C,OAAOC,OAAO,MAAM,gBAAgB;AACpC,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,uBAAuB,QAAQ,kBAAkB;AAE1D,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAAEC;EAAS,CAAC,GAAGD,KAAK;EAC1B,OAAOA,KAAK,CAACC,QAAQ,CAAC;AACxB,CAAC;AAED,MAAMC,cAAc,GAAGA,CAACC,cAAc,EAAEC,SAAS,EAAEC,IAAI,KAAK;EAC1D,MAAMC,aAAa,GAAG,CAAC,CAAC;EACxB,MAAMC,UAAU,GAAG,CAAC,CAAC;EAErBJ,cAAc,CAACK,OAAO,CAACC,OAAO,IAAI;IAChC,MAAM;MAAEC;IAAoB,CAAC,GAAGD,OAAO;IACvCC,mBAAmB,CAACF,OAAO,CAACG,I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,GAAG5B,YAAY,CAAC4B,SAAS,CAACN,CAAC,CAAC,CAAC,GAAGf,aAAa,CAACoB,GAAG,CAAC;QAC7E,IAAI,CAACE,SAAS,EAAE,OAAO,IAAI;QAE3B,MAAMC,cAAc,GAAG/B,uBAAuB,CAAC8B,SAAS,EAAEnB,OAAO,CAAC;QAClE,MAAMqB,sBAAsB,GAAGnC,yBAAyB,CAAC+B,GAAG,EAAErB,IAAI,CAAC;QACnE,OAAO,CAACZ,UAAU,CAAC+B,KAAK,CAAC,EAAEK,cAAc,EAAEC,sBAAsB,EAAEL,QAAQ,CAAC;MAC9E,CAAC,CAAC;IACJ,CAAC,CACH,CAAC,CAACM,MAAM,CAACC,OAAO,CAAC;IACjBb,oBAAoB,CAACc,IAAI,CAACX,UAAU,CAAC;EACvC;EAEA,OAAO5B,OAAO,CAACyB,oBAAoB,CAAC;AACtC,CAAC;AAED,eAAeF,qBAAqB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
const getLinkToPublishedContent = (key = '', props = {}
|
|
1
|
+
const getLinkToPublishedContent = (key = '', props = {}) => {
|
|
2
2
|
const [baseKey] = key.split('.');
|
|
3
3
|
if (!props[baseKey]) return '';
|
|
4
|
-
if (currentValue && typeof currentValue.url !== 'undefined') return currentValue.url;
|
|
5
4
|
const content = Array.isArray(props[baseKey]) ? props[baseKey][0] : props[baseKey];
|
|
6
5
|
return content && content.url ? content.url : '';
|
|
7
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-link-to-published-content.js","names":["getLinkToPublishedContent","key","props","
|
|
1
|
+
{"version":3,"file":"get-link-to-published-content.js","names":["getLinkToPublishedContent","key","props","baseKey","split","content","Array","isArray","url"],"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,MAAMA,yBAAyB,GAAGA,CAACC,GAAG,GAAG,EAAE,EAAEC,KAAK,GAAG,CAAC,CAAC,KAAK;EAC1D,MAAM,CAACC,OAAO,CAAC,GAAGF,GAAG,CAACG,KAAK,CAAC,GAAG,CAAC;EAChC,IAAI,CAACF,KAAK,CAACC,OAAO,CAAC,EAAE,OAAO,EAAE;EAC9B,MAAME,OAAO,GAAGC,KAAK,CAACC,OAAO,CAACL,KAAK,CAACC,OAAO,CAAC,CAAC,GAAGD,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAGD,KAAK,CAACC,OAAO,CAAC;EAClF,OAAOE,OAAO,IAAIA,OAAO,CAACG,GAAG,GAAGH,OAAO,CAACG,GAAG,GAAG,EAAE;AAClD,CAAC;AAED,eAAeR,yBAAyB"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
const _excluded = ["should"];
|
|
2
4
|
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; }
|
|
3
5
|
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) { _defineProperty(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; }
|
|
4
6
|
import buildRawQueryBase from './build-raw-query-base';
|
|
@@ -17,7 +19,10 @@ const buildRawQuery = ({
|
|
|
17
19
|
azOptions
|
|
18
20
|
}) => {
|
|
19
21
|
const {
|
|
20
|
-
searchValuesText
|
|
22
|
+
searchValuesText: {
|
|
23
|
+
must: searchValuesText,
|
|
24
|
+
should: shouldValuesText = []
|
|
25
|
+
},
|
|
21
26
|
searchValuesCheckboxSelectRange,
|
|
22
27
|
searchValuesCheckboxOr
|
|
23
28
|
} = searchValues;
|
|
@@ -61,7 +66,7 @@ const buildRawQuery = ({
|
|
|
61
66
|
finalValue = {
|
|
62
67
|
must: [...searchValuesCheckboxSelectRange, {
|
|
63
68
|
bool: {
|
|
64
|
-
should: searchValuesTextCheckboxOr
|
|
69
|
+
should: [...searchValuesTextCheckboxOr, ...shouldValuesText]
|
|
65
70
|
}
|
|
66
71
|
}]
|
|
67
72
|
};
|
|
@@ -70,17 +75,24 @@ const buildRawQuery = ({
|
|
|
70
75
|
bool: finalValue
|
|
71
76
|
}];
|
|
72
77
|
buildAzFilter(azFilter, mustValues, azSortProperty);
|
|
73
|
-
const
|
|
74
|
-
bool: _objectSpread({
|
|
75
|
-
must: mustValues
|
|
76
|
-
}, buildRawQueryBase({
|
|
78
|
+
const _buildRawQueryBase = buildRawQueryBase({
|
|
77
79
|
docType,
|
|
78
80
|
id,
|
|
79
81
|
filterValues,
|
|
80
82
|
filterOperator,
|
|
81
83
|
relations,
|
|
82
84
|
stringProps
|
|
83
|
-
})
|
|
85
|
+
}),
|
|
86
|
+
{
|
|
87
|
+
should: baseShould = []
|
|
88
|
+
} = _buildRawQueryBase,
|
|
89
|
+
baseQuery = _objectWithoutProperties(_buildRawQueryBase, _excluded);
|
|
90
|
+
const shouldValue = [...baseShould, ...shouldValuesText];
|
|
91
|
+
const query = {
|
|
92
|
+
bool: _objectSpread({
|
|
93
|
+
must: mustValues,
|
|
94
|
+
should: shouldValue.length ? shouldValue : undefined
|
|
95
|
+
}, baseQuery)
|
|
84
96
|
};
|
|
85
97
|
const azQueryBits = getExtraAzBits(_objectSpread(_objectSpread({}, azOptions), {}, {
|
|
86
98
|
azSortProperty,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-raw-query.js","names":["buildRawQueryBase","getItemsToDisplayIds","getExtraAzBits","buildAzFilter","AND_OPERATOR","AZ_DEFAULT_PROP","buildRawQuery","docType","operator","searchValues","filterData","id","itemsToDisplay","shouldApplySort","azOptions","searchValuesText","searchValuesCheckboxSelectRange","searchValuesCheckboxOr","filterValues","filterOperator","relations","stringProps","azFilter","isAZ","sortProperties","sortPropertyToUse","isScore","propsToDisplay","azSortProp","azSortProperty","searchValuesTextCheckboxSelectJoined","searchValuesTextCheckboxOr","length","finalValue","finalValueWithCheckboxOrValues","
|
|
1
|
+
{"version":3,"file":"build-raw-query.js","names":["buildRawQueryBase","getItemsToDisplayIds","getExtraAzBits","buildAzFilter","AND_OPERATOR","AZ_DEFAULT_PROP","buildRawQuery","docType","operator","searchValues","filterData","id","itemsToDisplay","shouldApplySort","azOptions","searchValuesText","must","should","shouldValuesText","searchValuesCheckboxSelectRange","searchValuesCheckboxOr","filterValues","filterOperator","relations","stringProps","azFilter","isAZ","sortProperties","sortPropertyToUse","isScore","propsToDisplay","azSortProp","azSortProperty","searchValuesTextCheckboxSelectJoined","searchValuesTextCheckboxOr","length","finalValue","finalValueWithCheckboxOrValues","bool","finalValueIfNoCheckboxOrValues","mustValues","_buildRawQueryBase","baseShould","baseQuery","_objectWithoutProperties","_excluded","shouldValue","query","_objectSpread","undefined","azQueryBits","itemsToDisplayIds","push","ids","values","sort","_script","type","script","lang","source","params","sortOrder","order"],"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\nexport default buildRawQuery;\n"],"mappings":";;;;;AAAA,OAAOA,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,OAAOC,cAAc,MAAM,qBAAqB;AAChD,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,SAASC,YAAY,EAAEC,eAAe,QAAQ,cAAc;AAE5D,MAAMC,aAAa,GAAGA,CAAC;EACrBC,OAAO;EACPC,QAAQ;EACRC,YAAY;EACZC,UAAU;EACVC,EAAE;EACFC,cAAc;EACdC,eAAe;EACfC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC,gBAAgB,EAAE;MAAEC,IAAI,EAAED,gBAAgB;MAAEE,MAAM,EAAEC,gBAAgB,GAAG;IAAG,CAAC;IAC3EC,+BAA+B;IAC/BC;EACF,CAAC,GAAGX,YAAY;EAChB,MAAM;IAAEY,YAAY;IAAEC,cAAc;IAAEC,SAAS;IAAEC,WAAW;IAAEC;EAAS,CAAC,GAAGf,UAAU;EAErF,MAAM;IAAEgB,IAAI;IAAEC,cAAc,GAAG;EAAG,CAAC,GAAGb,SAAS,IAAI,CAAC,CAAC;EACrD,MAAMc,iBAAiB,GAAGF,IAAI,IAAIC,cAAc,CAAC,CAAC,CAAC,IAAIA,cAAc,CAAC,CAAC,CAAC,CAACE,OAAO,GAAG,CAAC,GAAG,CAAC;EACxF,MAAM;IAAEC,cAAc,EAAE,CAACC,UAAU,CAAC,GAAG;EAAG,CAAC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(index === 0) {
|
|
8
|
-
acc
|
|
8
|
+
acc.should.push({
|
|
9
9
|
match: {
|
|
10
10
|
pageBuilderIndexed: {
|
|
11
11
|
query: searchTerm,
|
|
12
12
|
fuzziness: 'AUTO'
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
};
|
|
15
|
+
});
|
|
16
16
|
}
|
|
17
|
-
acc
|
|
17
|
+
acc.must.push({
|
|
18
18
|
match: {
|
|
19
19
|
[field]: {
|
|
20
20
|
query: searchTerm,
|
|
21
21
|
fuzziness: 'AUTO'
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
};
|
|
24
|
+
});
|
|
25
25
|
}
|
|
26
26
|
return acc;
|
|
27
|
-
},
|
|
27
|
+
}, {
|
|
28
|
+
should: [],
|
|
29
|
+
must: []
|
|
30
|
+
});
|
|
28
31
|
export default buildSearchValuesText;
|
|
29
32
|
//# sourceMappingURL=build-search-values-text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-search-values-text.js","names":["buildSearchValuesText","propsToDisplay","search_term","searchTerm","reduce","acc","field","index","match","pageBuilderIndexed","query","fuzziness"],"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","propsToDisplay","search_term","searchTerm","reduce","acc","field","index","should","push","match","pageBuilderIndexed","query","fuzziness","must"],"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,MAAMA,qBAAqB,GAAGA,CAAC;EAAEC;AAAe,CAAC,EAAE;EAAEC,WAAW,EAAEC;AAAW,CAAC,KAC5EF,cAAc,CAACG,MAAM,CACnB,CAACC,GAAG,EAAEC,KAAK,EAAEC,KAAK,KAAK;EACrB,IAAID,KAAK,IAAIH,UAAU,EAAE;IACvB,IAAII,KAAK,KAAK,CAAC,EAAE;MACfF,GAAG,CAACG,MAAM,CAACC,IAAI,CAAC;QACdC,KAAK,EAAE;UACLC,kBAAkB,EAAE;YAClBC,KAAK,EAAET,UAAU;YACjBU,SAAS,EAAE;UACb;QACF;MACF,CAAC,CAAC;IACJ;IACAR,GAAG,CAACS,IAAI,CAACL,IAAI,CAAC;MACZC,KAAK,EAAE;QACL,CAACJ,KAAK,GAAG;UACPM,KAAK,EAAET,UAAU;UACjBU,SAAS,EAAE;QACb;MACF;IACF,CAAC,CAAC;EACJ;EACA,OAAOR,GAAG;AACZ,CAAC,EACD;EAAEG,MAAM,EAAE,EAAE;EAAEM,IAAI,EAAE;AAAG,CACzB,CAAC;AAEH,eAAed,qBAAqB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/react-page-builder",
|
|
3
|
-
"version": "0.135.0
|
|
3
|
+
"version": "0.135.0",
|
|
4
4
|
"description": "Blaze react page builder",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "GPL-3.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@blaze-cms/core-auth-ui": "0.
|
|
31
|
-
"@blaze-cms/core-errors": "0.
|
|
32
|
-
"@blaze-cms/core-errors-ui": "0.
|
|
30
|
+
"@blaze-cms/core-auth-ui": "^0.131.0",
|
|
31
|
+
"@blaze-cms/core-errors": "^0.131.0",
|
|
32
|
+
"@blaze-cms/core-errors-ui": "^0.131.0",
|
|
33
33
|
"@blaze-cms/image-cdn-react": "0.3.0-alpha.6",
|
|
34
|
-
"@blaze-cms/nextjs-components": "0.
|
|
35
|
-
"@blaze-cms/plugin-search-ui": "0.
|
|
36
|
-
"@blaze-cms/setup-ui": "0.
|
|
37
|
-
"@blaze-cms/utils": "0.
|
|
38
|
-
"@blaze-cms/utils-handlebars": "0.
|
|
34
|
+
"@blaze-cms/nextjs-components": "^0.134.0",
|
|
35
|
+
"@blaze-cms/plugin-search-ui": "^0.134.0",
|
|
36
|
+
"@blaze-cms/setup-ui": "^0.131.0",
|
|
37
|
+
"@blaze-cms/utils": "^0.131.0",
|
|
38
|
+
"@blaze-cms/utils-handlebars": "^0.134.0",
|
|
39
39
|
"@blaze-react/breadcrumb": "0.8.0-alpha.60",
|
|
40
40
|
"@blaze-react/button": "0.5.19",
|
|
41
41
|
"@blaze-react/checkboxes": "0.5.31",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"lib/*",
|
|
90
90
|
"lib-es/*"
|
|
91
91
|
],
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "37423f2681b9ec2a1b949f2f3e09094c9920a6c8"
|
|
93
93
|
}
|
|
@@ -2,7 +2,6 @@ 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
|
|
|
7
6
|
const AdSlotRender = ({
|
|
8
7
|
shouldShowBanner,
|
|
@@ -10,7 +9,6 @@ const AdSlotRender = ({
|
|
|
10
9
|
sizeId,
|
|
11
10
|
parsedAdunit,
|
|
12
11
|
parsedSizes,
|
|
13
|
-
modifiers,
|
|
14
12
|
targetingArguments
|
|
15
13
|
}) => {
|
|
16
14
|
const [{ loadingStatus = BANNER_LOADING, minHeight }, setLoadingStatus] = useState({});
|
|
@@ -26,11 +24,11 @@ const AdSlotRender = ({
|
|
|
26
24
|
})
|
|
27
25
|
.sort();
|
|
28
26
|
const className = `ad-slot ad-slot-${loadingStatus} ${bannerClass}`;
|
|
29
|
-
|
|
27
|
+
|
|
30
28
|
return (
|
|
31
|
-
|
|
29
|
+
<>
|
|
32
30
|
{styles && <style>{styles.join('\n')}</style>}
|
|
33
|
-
<div className={className} style={{ minHeight }}
|
|
31
|
+
<div className={className} style={{ minHeight }}>
|
|
34
32
|
{shouldShowBanner && (
|
|
35
33
|
<AdSlot
|
|
36
34
|
adUnit={parsedAdunit}
|
|
@@ -48,7 +46,7 @@ const AdSlotRender = ({
|
|
|
48
46
|
/>
|
|
49
47
|
)}
|
|
50
48
|
</div>
|
|
51
|
-
|
|
49
|
+
</>
|
|
52
50
|
);
|
|
53
51
|
};
|
|
54
52
|
|
|
@@ -58,13 +56,11 @@ AdSlotRender.propTypes = {
|
|
|
58
56
|
sizeId: PropTypes.string.isRequired,
|
|
59
57
|
parsedAdunit: PropTypes.string.isRequired,
|
|
60
58
|
parsedSizes: PropTypes.array,
|
|
61
|
-
modifiers: PropTypes.string,
|
|
62
59
|
targetingArguments: PropTypes.object.isRequired
|
|
63
60
|
};
|
|
64
61
|
|
|
65
62
|
AdSlotRender.defaultProps = {
|
|
66
|
-
parsedSizes: null
|
|
67
|
-
modifiers: ''
|
|
63
|
+
parsedSizes: null
|
|
68
64
|
};
|
|
69
65
|
|
|
70
66
|
export default AdSlotRender;
|
|
@@ -7,6 +7,7 @@ import { useQuery } from '@apollo/client';
|
|
|
7
7
|
import { useRouter } from 'next/router';
|
|
8
8
|
import { buildUserQuery, buildPropsData } from './helpers';
|
|
9
9
|
import { getSingleEntitySchema, getUser } from '../../application/query';
|
|
10
|
+
import Wrapper from '../Wrapper';
|
|
10
11
|
import BannerRender from './BannerRender';
|
|
11
12
|
import buildPropsQuery from '../../helpers/build-props-query';
|
|
12
13
|
import { getClassModifiers } from '../../utils';
|
|
@@ -46,15 +47,16 @@ const Banner = ({ type, ...otherProps }) => {
|
|
|
46
47
|
const bannerKey = `${sizeId}${asPath}`;
|
|
47
48
|
|
|
48
49
|
return (
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
<Wrapper className={type} modifiers={modifiers}>
|
|
51
|
+
<BannerRender
|
|
52
|
+
key={bannerKey}
|
|
53
|
+
{...otherProps}
|
|
54
|
+
action={action}
|
|
55
|
+
actionKey={actionKey}
|
|
56
|
+
asPath={asPath}
|
|
57
|
+
userPropsData={userPropsData}
|
|
58
|
+
/>
|
|
59
|
+
</Wrapper>
|
|
58
60
|
);
|
|
59
61
|
};
|
|
60
62
|
|
|
@@ -34,7 +34,6 @@ const BannerRender = ({
|
|
|
34
34
|
actionKey,
|
|
35
35
|
renderCounter,
|
|
36
36
|
userPropsData,
|
|
37
|
-
modifiers,
|
|
38
37
|
...otherProps
|
|
39
38
|
}) => {
|
|
40
39
|
const { id } = otherProps;
|
|
@@ -91,7 +90,6 @@ const BannerRender = ({
|
|
|
91
90
|
sizeId={sizeId}
|
|
92
91
|
parsedAdunit={parsedAdunit}
|
|
93
92
|
parsedSizes={parsedSizes}
|
|
94
|
-
modifiers={modifiers}
|
|
95
93
|
targetingArguments={targetingArguments}
|
|
96
94
|
/>
|
|
97
95
|
);
|
|
@@ -110,7 +108,6 @@ BannerRender.propTypes = {
|
|
|
110
108
|
targetings: PropTypes.string,
|
|
111
109
|
sizes: PropTypes.string,
|
|
112
110
|
renderCounter: PropTypes.number,
|
|
113
|
-
modifiers: PropTypes.string,
|
|
114
111
|
userPropsData: PropTypes.object
|
|
115
112
|
};
|
|
116
113
|
|
|
@@ -123,7 +120,6 @@ BannerRender.defaultProps = {
|
|
|
123
120
|
targetings: '',
|
|
124
121
|
sizes: '',
|
|
125
122
|
renderCounter: null,
|
|
126
|
-
modifiers: '',
|
|
127
123
|
userPropsData: {}
|
|
128
124
|
};
|
|
129
125
|
|
|
@@ -45,12 +45,11 @@ const buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, d
|
|
|
45
45
|
|
|
46
46
|
return propertiesToDisplay.map(key => {
|
|
47
47
|
const loopValue = loopValues[key];
|
|
48
|
-
const
|
|
49
|
-
const propValue = loopValueItem ? getLoopValue(loopValueItem) : regularValues[key];
|
|
48
|
+
const propValue = loopValue ? getLoopValue(loopValue[i]) : regularValues[key];
|
|
50
49
|
if (!propValue) return null;
|
|
51
50
|
|
|
52
51
|
const processedValue = processDataSummaryValue(propValue, options);
|
|
53
|
-
const linkToPublishedContent = getLinkToPublishedContent(key, data
|
|
52
|
+
const linkToPublishedContent = getLinkToPublishedContent(key, data);
|
|
54
53
|
return [upperFirst(label), processedValue, linkToPublishedContent, modifier];
|
|
55
54
|
});
|
|
56
55
|
})
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
const getLinkToPublishedContent = (key = '', props = {}
|
|
1
|
+
const getLinkToPublishedContent = (key = '', props = {}) => {
|
|
2
2
|
const [baseKey] = key.split('.');
|
|
3
3
|
if (!props[baseKey]) return '';
|
|
4
|
-
|
|
5
|
-
if (currentValue && typeof currentValue.url !== 'undefined') return currentValue.url;
|
|
6
|
-
|
|
7
4
|
const content = Array.isArray(props[baseKey]) ? props[baseKey][0] : props[baseKey];
|
|
8
5
|
return content && content.url ? content.url : '';
|
|
9
6
|
};
|