@blaze-cms/react-page-builder 0.126.0-shorthand.2 → 0.126.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 +7 -10
- package/README.md +0 -4
- package/lib/components/Banner/BannerRender.js +5 -5
- package/lib/components/Banner/BannerRender.js.map +1 -1
- package/lib/components/Banner/helpers.js +2 -2
- package/lib/components/Banner/helpers.js.map +1 -1
- package/lib/components/Card/CardContainer.js +3 -3
- package/lib/components/Card/CardContainer.js.map +1 -1
- package/lib/components/Code/Code.js +4 -7
- package/lib/components/Code/Code.js.map +1 -1
- package/lib/components/Code/helpers/wrap-script-tags.js +3 -7
- package/lib/components/Code/helpers/wrap-script-tags.js.map +1 -1
- package/lib/components/ContentGroup/ContentGroup.js +13 -4
- package/lib/components/ContentGroup/ContentGroup.js.map +1 -1
- package/lib/components/ContentGroup/ContentGroupTabs.js +43 -31
- package/lib/components/ContentGroup/ContentGroupTabs.js.map +1 -1
- package/lib/components/ContentGroup/constants.js +18 -0
- package/lib/components/ContentGroup/constants.js.map +1 -0
- package/lib/components/ContentGroup/helpers/get-active-tab.js +23 -0
- package/lib/components/ContentGroup/helpers/get-active-tab.js.map +1 -0
- package/lib/components/ContentGroup/helpers/get-sections-data.js +25 -0
- package/lib/components/ContentGroup/helpers/get-sections-data.js.map +1 -0
- package/lib/components/ContentGroup/helpers/index.js +22 -0
- package/lib/components/ContentGroup/helpers/index.js.map +1 -0
- package/lib/components/ContentGroupSection/ContentGroupSection.js +4 -1
- package/lib/components/ContentGroupSection/ContentGroupSection.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRenderItem.js +1 -1
- package/lib/components/List/components/Cards/CardsRenderItem.js.map +1 -1
- package/lib/components/List/components/Full/FullRenderItem.js +1 -1
- package/lib/components/List/components/Full/FullRenderItem.js.map +1 -1
- package/lib/components/Video/providers/YouTube/YoutubeEmbeded.js +5 -1
- package/lib/components/Video/providers/YouTube/YoutubeEmbeded.js.map +1 -1
- package/lib-es/components/Banner/BannerRender.js +5 -5
- package/lib-es/components/Banner/BannerRender.js.map +1 -1
- package/lib-es/components/Banner/helpers.js +2 -2
- package/lib-es/components/Banner/helpers.js.map +1 -1
- package/lib-es/components/Card/CardContainer.js +3 -3
- package/lib-es/components/Card/CardContainer.js.map +1 -1
- package/lib-es/components/Code/Code.js +5 -8
- package/lib-es/components/Code/Code.js.map +1 -1
- package/lib-es/components/Code/helpers/wrap-script-tags.js +3 -7
- package/lib-es/components/Code/helpers/wrap-script-tags.js.map +1 -1
- package/lib-es/components/ContentGroup/ContentGroup.js +14 -5
- package/lib-es/components/ContentGroup/ContentGroup.js.map +1 -1
- package/lib-es/components/ContentGroup/ContentGroupTabs.js +48 -39
- package/lib-es/components/ContentGroup/ContentGroupTabs.js.map +1 -1
- package/lib-es/components/ContentGroup/constants.js +7 -0
- package/lib-es/components/ContentGroup/constants.js.map +1 -0
- package/lib-es/components/ContentGroup/helpers/get-active-tab.js +10 -0
- package/lib-es/components/ContentGroup/helpers/get-active-tab.js.map +1 -0
- package/lib-es/components/ContentGroup/helpers/get-sections-data.js +15 -0
- package/lib-es/components/ContentGroup/helpers/get-sections-data.js.map +1 -0
- package/lib-es/components/ContentGroup/helpers/index.js +4 -0
- package/lib-es/components/ContentGroup/helpers/index.js.map +1 -0
- package/lib-es/components/ContentGroupSection/ContentGroupSection.js +4 -2
- package/lib-es/components/ContentGroupSection/ContentGroupSection.js.map +1 -1
- package/lib-es/components/List/components/Cards/CardsRenderItem.js +1 -1
- package/lib-es/components/List/components/Cards/CardsRenderItem.js.map +1 -1
- package/lib-es/components/List/components/Full/FullRenderItem.js +1 -1
- package/lib-es/components/List/components/Full/FullRenderItem.js.map +1 -1
- package/lib-es/components/Video/providers/YouTube/YoutubeEmbeded.js +5 -1
- package/lib-es/components/Video/providers/YouTube/YoutubeEmbeded.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Banner/BannerRender.js +4 -4
- package/src/components/Banner/helpers.js +3 -3
- package/src/components/Card/CardContainer.js +3 -3
- package/src/components/Code/Code.js +4 -6
- package/src/components/Code/helpers/wrap-script-tags.js +3 -7
- package/src/components/ContentGroup/ContentGroup.js +16 -4
- package/src/components/ContentGroup/ContentGroupTabs.js +44 -28
- package/src/components/ContentGroup/constants.js +7 -0
- package/src/components/ContentGroup/helpers/get-active-tab.js +11 -0
- package/src/components/ContentGroup/helpers/get-sections-data.js +7 -0
- package/src/components/ContentGroup/helpers/index.js +4 -0
- package/src/components/ContentGroupSection/ContentGroupSection.js +6 -2
- package/src/components/List/components/Cards/CardsRenderItem.js +1 -1
- package/src/components/List/components/Full/FullRenderItem.js +1 -1
- package/src/components/Video/providers/YouTube/YoutubeEmbeded.js +5 -1
- package/tests/unit/src/components/Banner/BannerRender.test.js +1 -1
- package/tests/unit/src/components/ContentGroup/ContentGroupTabs.test.js +14 -1
- package/tests/unit/src/components/ContentGroup/__snapshots__/ContentGroupTabs.test.js.snap +88 -2
- package/tests/unit/src/components/ContentGroup/helpers/get-active-tab.test.js +19 -0
- package/tests/unit/src/components/ContentGroup/helpers/get-sections-data.test.js +14 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardContainer.js","names":["React","useContext","PropTypes","MainContext","withTitle","Banner","Wrapper","CarouselWrapper","Card","getDynamicGridClasses","getEntitiesWithBanner","parsePropsToDisplay","getPropsToDisplayModifiers","CardContainer","cardData","gridModifier","style","displayCategory","displayThumbnail","displayTitle","modifier","entity","propsToDisplay","gtmChildren","cardChildren","name","designConfig","itemsPerRow","enableCarousel","bannerModifier","priorityLimit","enableAutoScroll","enableOverlay","autoScrollTimer","overlayModifier","titleOverlayModifier","cardProps","entities","itemId","propsToDisplayModifiers","dynamicWrapperSizes","
|
|
1
|
+
{"version":3,"file":"CardContainer.js","names":["React","useContext","PropTypes","MainContext","withTitle","Banner","Wrapper","CarouselWrapper","Card","getDynamicGridClasses","getEntitiesWithBanner","parsePropsToDisplay","getPropsToDisplayModifiers","CardContainer","cardData","gridModifier","style","displayCategory","displayThumbnail","displayTitle","modifier","entity","propsToDisplay","gtmChildren","cardChildren","name","designConfig","itemsPerRow","enableCarousel","bannerModifier","priorityLimit","enableAutoScroll","enableOverlay","autoScrollTimer","overlayModifier","titleOverlayModifier","cardProps","entities","itemId","propsToDisplayModifiers","dynamicWrapperSizes","cardBannerIndex","CardWrapper","map","index","baseAdunit","id","entityProps","extraProps","dynamicKey","join","priority","propTypes","array","isRequired","string","oneOfType","arrayOf","node","bool","object","number","defaultProps"],"sources":["../../../src/components/Card/CardContainer.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport { withTitle } from '../../HOC';\nimport Banner from '../Banner';\nimport Wrapper from '../Wrapper';\nimport CarouselWrapper from '../CarouselWrapper';\nimport Card from './Card';\nimport { getDynamicGridClasses } from './helpers';\nimport { getEntitiesWithBanner, parsePropsToDisplay } from '../../helpers';\nimport { getPropsToDisplayModifiers } from '../../utils';\n\nconst CardContainer = ({\n cardData,\n gridModifier,\n style,\n displayCategory,\n displayThumbnail,\n displayTitle,\n modifier,\n entity,\n propsToDisplay,\n gtmChildren,\n cardChildren,\n name,\n designConfig,\n itemsPerRow,\n enableCarousel,\n bannerModifier,\n priorityLimit,\n enableAutoScroll,\n enableOverlay,\n autoScrollTimer,\n overlayModifier,\n titleOverlayModifier,\n ...cardProps\n}) => {\n const entities = getEntitiesWithBanner(cardData, cardProps);\n const { itemId } = useContext(MainContext);\n const propsToDisplayModifiers = getPropsToDisplayModifiers(propsToDisplay);\n const dynamicWrapperSizes = enableCarousel\n ? ''\n : getDynamicGridClasses('grid', itemsPerRow, designConfig);\n let cardBannerIndex = 0;\n const CardWrapper = enableCarousel ? CarouselWrapper : Wrapper;\n\n return (\n <CardWrapper\n className={dynamicWrapperSizes}\n modifiers={gridModifier}\n itemsPerRow={itemsPerRow}\n bannerModifier={bannerModifier}\n enableAutoScroll={enableAutoScroll}\n autoScrollTimer={autoScrollTimer}>\n {entities.map(({ baseAdunit, id, ...entityProps }, index) => {\n const extraProps = parsePropsToDisplay(entityProps, propsToDisplay);\n const dynamicKey = [itemId, index].join('-');\n if (baseAdunit) cardBannerIndex += 1;\n\n const priority = priorityLimit > 0 && index + 1 <= priorityLimit;\n\n return baseAdunit ? (\n <Banner\n key={dynamicKey}\n entity={entity}\n baseAdunit={baseAdunit}\n {...entityProps}\n modifier={modifier}\n cardBannerIndex={cardBannerIndex}\n />\n ) : (\n <Card\n key={id}\n id={id}\n enableCarousel={enableCarousel}\n entity={entity}\n propsToDisplay={propsToDisplay}\n parsedPropsToDisplay={extraProps}\n propsToDisplayModifiers={propsToDisplayModifiers}\n modifier={modifier}\n style={style}\n cardChildren={cardChildren}\n gtmChildren={gtmChildren}\n gtmId={name}\n gridModifier={gridModifier}\n entityProps={entityProps}\n displayCategory={displayCategory}\n displayThumbnail={displayThumbnail}\n displayTitle={displayTitle}\n priority={priority}\n enableOverlay={enableOverlay}\n overlayModifier={overlayModifier}\n titleOverlayModifier={titleOverlayModifier}\n {...entityProps}\n />\n );\n })}\n </CardWrapper>\n );\n};\n\nCardContainer.propTypes = {\n cardData: PropTypes.array.isRequired,\n name: PropTypes.string,\n entity: PropTypes.string.isRequired,\n gridModifier: PropTypes.string,\n gtmChildren: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n cardChildren: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n propsToDisplay: PropTypes.array,\n displayCategory: PropTypes.bool,\n displayThumbnail: PropTypes.bool,\n displayTitle: PropTypes.bool,\n modifier: PropTypes.string,\n style: PropTypes.string,\n designConfig: PropTypes.object,\n itemsPerRow: PropTypes.number,\n enableCarousel: PropTypes.bool,\n bannerModifier: PropTypes.string,\n priorityLimit: PropTypes.number,\n enableAutoScroll: PropTypes.bool,\n enableOverlay: PropTypes.bool,\n overlayModifier: PropTypes.string,\n titleOverlayModifier: PropTypes.string,\n autoScrollTimer: PropTypes.number\n};\n\nCardContainer.defaultProps = {\n gtmChildren: [],\n cardChildren: [],\n name: '',\n gridModifier: '',\n propsToDisplay: [],\n displayCategory: true,\n displayThumbnail: true,\n displayTitle: true,\n modifier: '',\n style: 'portrait',\n designConfig: {},\n itemsPerRow: 1,\n enableCarousel: false,\n bannerModifier: '',\n priorityLimit: 0,\n enableAutoScroll: false,\n enableOverlay: false,\n autoScrollTimer: 0,\n overlayModifier: '',\n titleOverlayModifier: ''\n};\n\nexport default withTitle(CardContainer);\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,SAAS,QAAQ,WAAW;AACrC,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,eAAe,MAAM,oBAAoB;AAChD,OAAOC,IAAI,MAAM,QAAQ;AACzB,SAASC,qBAAqB,QAAQ,WAAW;AACjD,SAASC,qBAAqB,EAAEC,mBAAmB,QAAQ,eAAe;AAC1E,SAASC,0BAA0B,QAAQ,aAAa;AAExD,MAAMC,aAAa,GAAG,QAwBhB;EAAA,IAxBiB;MACrBC,QAAQ;MACRC,YAAY;MACZC,KAAK;MACLC,eAAe;MACfC,gBAAgB;MAChBC,YAAY;MACZC,QAAQ;MACRC,MAAM;MACNC,cAAc;MACdC,WAAW;MACXC,YAAY;MACZC,IAAI;MACJC,YAAY;MACZC,WAAW;MACXC,cAAc;MACdC,cAAc;MACdC,aAAa;MACbC,gBAAgB;MAChBC,aAAa;MACbC,eAAe;MACfC,eAAe;MACfC;IAEF,CAAC;IADIC,SAAS;EAEZ,MAAMC,QAAQ,GAAG3B,qBAAqB,CAACI,QAAQ,EAAEsB,SAAS,CAAC;EAC3D,MAAM;IAAEE;EAAO,CAAC,GAAGrC,UAAU,CAACE,WAAW,CAAC;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AY,EAAExB,SAAS,CAAC0D,MAAM;EAC9BjC,WAAW,EAAEzB,SAAS,CAAC2D,MAAM;EAC7BjC,cAAc,EAAE1B,SAAS,CAACyD,IAAI;EAC9B9B,cAAc,EAAE3B,SAAS,CAACqD,MAAM;EAChCzB,aAAa,EAAE5B,SAAS,CAAC2D,MAAM;EAC/B9B,gBAAgB,EAAE7B,SAAS,CAACyD,IAAI;EAChC3B,aAAa,EAAE9B,SAAS,CAACyD,IAAI;EAC7BzB,eAAe,EAAEhC,SAAS,CAACqD,MAAM;EACjCpB,oBAAoB,EAAEjC,SAAS,CAACqD,MAAM;EACtCtB,eAAe,EAAE/B,SAAS,CAAC2D;AAC7B,CAAC;AAEDhD,aAAa,CAACiD,YAAY,GAAG;EAC3BvC,WAAW,EAAE,EAAE;EACfC,YAAY,EAAE,EAAE;EAChBC,IAAI,EAAE,EAAE;EACRV,YAAY,EAAE,EAAE;EAChBO,cAAc,EAAE,EAAE;EAClBL,eAAe,EAAE,IAAI;EACrBC,gBAAgB,EAAE,IAAI;EACtBC,YAAY,EAAE,IAAI;EAClBC,QAAQ,EAAE,EAAE;EACZJ,KAAK,EAAE,UAAU;EACjBU,YAAY,EAAE,CAAC,CAAC;EAChBC,WAAW,EAAE,CAAC;EACdC,cAAc,EAAE,KAAK;EACrBC,cAAc,EAAE,EAAE;EAClBC,aAAa,EAAE,CAAC;EAChBC,gBAAgB,EAAE,KAAK;EACvBC,aAAa,EAAE,KAAK;EACpBC,eAAe,EAAE,CAAC;EAClBC,eAAe,EAAE,EAAE;EACnBC,oBAAoB,EAAE;AACxB,CAAC;AAED,eAAe/B,SAAS,CAACS,aAAa,CAAC"}
|
|
@@ -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 = ["code"
|
|
3
|
+
const _excluded = ["code"];
|
|
4
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
import React, { memo } from 'react';
|
|
@@ -13,12 +13,11 @@ import { CODE } from '../../constants';
|
|
|
13
13
|
import { wrapScriptTags } from './helpers';
|
|
14
14
|
const Code = memo(_ref => {
|
|
15
15
|
let {
|
|
16
|
-
code: embedCode
|
|
17
|
-
parserOptions
|
|
16
|
+
code: embedCode
|
|
18
17
|
} = _ref,
|
|
19
18
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
20
19
|
if (!embedCode) return null;
|
|
21
|
-
const parsedCode = parseHTML(embedCode
|
|
20
|
+
const parsedCode = parseHTML(embedCode);
|
|
22
21
|
const wrappedCode = wrapScriptTags(parsedCode);
|
|
23
22
|
const modifiers = getClassModifiers(CODE, _objectSpread({}, otherProps));
|
|
24
23
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
@@ -27,13 +26,11 @@ const Code = memo(_ref => {
|
|
|
27
26
|
});
|
|
28
27
|
Code.propTypes = {
|
|
29
28
|
code: PropTypes.string,
|
|
30
|
-
modifier: PropTypes.string
|
|
31
|
-
parserOptions: PropTypes.object
|
|
29
|
+
modifier: PropTypes.string
|
|
32
30
|
};
|
|
33
31
|
Code.defaultProps = {
|
|
34
32
|
code: '',
|
|
35
|
-
modifier: ''
|
|
36
|
-
parserOptions: {}
|
|
33
|
+
modifier: ''
|
|
37
34
|
};
|
|
38
35
|
export default withTitle(Code);
|
|
39
36
|
//# sourceMappingURL=Code.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Code.js","names":["React","memo","PropTypes","parseHTML","Wrapper","withTitle","getClassModifiers","CODE","wrapScriptTags","Code","code","embedCode","
|
|
1
|
+
{"version":3,"file":"Code.js","names":["React","memo","PropTypes","parseHTML","Wrapper","withTitle","getClassModifiers","CODE","wrapScriptTags","Code","code","embedCode","otherProps","parsedCode","wrappedCode","modifiers","propTypes","string","modifier","defaultProps"],"sources":["../../../src/components/Code/Code.js"],"sourcesContent":["import React, { memo } from 'react';\nimport PropTypes from 'prop-types';\nimport parseHTML from 'html-react-parser';\nimport Wrapper from '../Wrapper';\nimport { withTitle } from '../../HOC';\nimport { getClassModifiers } from '../../utils';\nimport { CODE } from '../../constants';\nimport { wrapScriptTags } from './helpers';\n\nconst Code = memo(({ code: embedCode, ...otherProps }) => {\n if (!embedCode) return null;\n\n const parsedCode = parseHTML(embedCode);\n const wrappedCode = wrapScriptTags(parsedCode);\n const modifiers = getClassModifiers(CODE, { ...otherProps });\n\n return <Wrapper modifiers={modifiers}>{wrappedCode}</Wrapper>;\n});\n\nCode.propTypes = {\n code: PropTypes.string,\n modifier: PropTypes.string\n};\n\nCode.defaultProps = {\n code: '',\n modifier: ''\n};\n\nexport default withTitle(Code);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,SAAS,MAAM,mBAAmB;AACzC,OAAOC,OAAO,MAAM,YAAY;AAChC,SAASC,SAAS,QAAQ,WAAW;AACrC,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,IAAI,QAAQ,iBAAiB;AACtC,SAASC,cAAc,QAAQ,WAAW;AAE1C,MAAMC,IAAI,GAAGR,IAAI,CAAC,QAAwC;EAAA,IAAvC;MAAES,IAAI,EAAEC;IAAyB,CAAC;IAAZC,UAAU;EACjD,IAAI,CAACD,SAAS,EAAE,OAAO,IAAI;EAE3B,MAAME,UAAU,GAAGV,SAAS,CAACQ,SAAS,CAAC;EACvC,MAAMG,WAAW,GAAGN,cAAc,CAACK,UAAU,CAAC;EAC9C,MAAME,SAAS,GAAGT,iBAAiB,CAACC,IAAI,oBAAOK,UAAU,EAAG;EAE5D,oBAAO,oBAAC,OAAO;IAAC,SAAS,EAAEG;EAAU,GAAED,WAAW,CAAW;AAC/D,CAAC,CAAC;AAEFL,IAAI,CAACO,SAAS,GAAG;EACfN,IAAI,EAAER,SAAS,CAACe,MAAM;EACtBC,QAAQ,EAAEhB,SAAS,CAACe;AACtB,CAAC;AAEDR,IAAI,CAACU,YAAY,GAAG;EAClBT,IAAI,EAAE,EAAE;EACRQ,QAAQ,EAAE;AACZ,CAAC;AAED,eAAeb,SAAS,CAACI,IAAI,CAAC"}
|
|
@@ -20,13 +20,9 @@ function getWrappedScriptTag(child) {
|
|
|
20
20
|
function wrapScriptTags(parsedCode) {
|
|
21
21
|
if (Array.isArray(parsedCode)) {
|
|
22
22
|
parsedCode.forEach((child, index) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
parsedCode[index] = getWrappedScriptTag(child);
|
|
27
|
-
} catch {
|
|
28
|
-
// catch read-only element errors
|
|
29
|
-
}
|
|
23
|
+
// modify children array as we just want to wrap single components
|
|
24
|
+
// eslint-disable-next-line no-param-reassign
|
|
25
|
+
parsedCode[index] = getWrappedScriptTag(child);
|
|
30
26
|
});
|
|
31
27
|
return parsedCode;
|
|
32
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrap-script-tags.js","names":["React","ScriptTag","getWrappedScriptTag","child","props","children","scriptProps","type","key","cloneElement","wrapScriptTags","parsedCode","Array","isArray","forEach","index"],"sources":["../../../../src/components/Code/helpers/wrap-script-tags.js"],"sourcesContent":["import React from 'react';\nimport ScriptTag from '../ScriptTag';\n\nfunction getWrappedScriptTag(child) {\n if (!child) return child;\n\n if (typeof child === 'string') return child;\n\n const { children, ...scriptProps } = child.props;\n if (child.type === 'script') return <ScriptTag {...scriptProps} key={child.key} />;\n\n if (!children) return child;\n\n return React.cloneElement(child, child.props, wrapScriptTags(children));\n}\n\nfunction wrapScriptTags(parsedCode) {\n if (Array.isArray(parsedCode)) {\n parsedCode.forEach((child, index) => {\n
|
|
1
|
+
{"version":3,"file":"wrap-script-tags.js","names":["React","ScriptTag","getWrappedScriptTag","child","props","children","scriptProps","type","key","cloneElement","wrapScriptTags","parsedCode","Array","isArray","forEach","index"],"sources":["../../../../src/components/Code/helpers/wrap-script-tags.js"],"sourcesContent":["import React from 'react';\nimport ScriptTag from '../ScriptTag';\n\nfunction getWrappedScriptTag(child) {\n if (!child) return child;\n\n if (typeof child === 'string') return child;\n\n const { children, ...scriptProps } = child.props;\n if (child.type === 'script') return <ScriptTag {...scriptProps} key={child.key} />;\n\n if (!children) return child;\n\n return React.cloneElement(child, child.props, wrapScriptTags(children));\n}\n\nfunction wrapScriptTags(parsedCode) {\n if (Array.isArray(parsedCode)) {\n parsedCode.forEach((child, index) => {\n // modify children array as we just want to wrap single components\n // eslint-disable-next-line no-param-reassign\n parsedCode[index] = getWrappedScriptTag(child);\n });\n\n return parsedCode;\n }\n\n return getWrappedScriptTag(parsedCode);\n}\n\nexport default wrapScriptTags;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,cAAc;AAEpC,SAASC,mBAAmB,CAACC,KAAK,EAAE;EAClC,IAAI,CAACA,KAAK,EAAE,OAAOA,KAAK;EAExB,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE,OAAOA,KAAK;EAE3C,qBAAqCA,KAAK,CAACC,KAAK;IAA1C;MAAEC;IAAyB,CAAC;IAAbC,WAAW;EAChC,IAAIH,KAAK,CAACI,IAAI,KAAK,QAAQ,EAAE,oBAAO,oBAAC,SAAS,eAAKD,WAAW;IAAE,GAAG,EAAEH,KAAK,CAACK;EAAI,GAAG;EAElF,IAAI,CAACH,QAAQ,EAAE,OAAOF,KAAK;EAE3B,OAAOH,KAAK,CAACS,YAAY,CAACN,KAAK,EAAEA,KAAK,CAACC,KAAK,EAAEM,cAAc,CAACL,QAAQ,CAAC,CAAC;AACzE;AAEA,SAASK,cAAc,CAACC,UAAU,EAAE;EAClC,IAAIC,KAAK,CAACC,OAAO,CAACF,UAAU,CAAC,EAAE;IAC7BA,UAAU,CAACG,OAAO,CAAC,CAACX,KAAK,EAAEY,KAAK,KAAK;MACnC;MACA;MACAJ,UAAU,CAACI,KAAK,CAAC,GAAGb,mBAAmB,CAACC,KAAK,CAAC;IAChD,CAAC,CAAC;IAEF,OAAOQ,UAAU;EACnB;EAEA,OAAOT,mBAAmB,CAACS,UAAU,CAAC;AACxC;AAEA,eAAeD,cAAc"}
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
const _excluded = ["contentType"];
|
|
3
|
+
const _excluded = ["contentType", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import ContentGroupTabs from './ContentGroupTabs';
|
|
7
|
+
import { getSectionsData } from './helpers';
|
|
7
8
|
const ContentGroup = _ref => {
|
|
9
|
+
var _children$props;
|
|
8
10
|
let {
|
|
9
|
-
contentType
|
|
11
|
+
contentType,
|
|
12
|
+
children
|
|
10
13
|
} = _ref,
|
|
11
14
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
const groupSections = children === null || children === void 0 ? void 0 : (_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.children[1];
|
|
16
|
+
if (!groupSections || !groupSections.length) return '';
|
|
17
|
+
if (contentType !== 'tab' && contentType !== 'sidepanel') return '';
|
|
18
|
+
const sectionsData = getSectionsData(groupSections);
|
|
19
|
+
return /*#__PURE__*/React.createElement(ContentGroupTabs, _extends({
|
|
20
|
+
contentType: contentType,
|
|
21
|
+
groupSections: groupSections,
|
|
22
|
+
sectionsData: sectionsData
|
|
14
23
|
}, props));
|
|
15
|
-
return '';
|
|
16
24
|
};
|
|
17
25
|
ContentGroup.propTypes = {
|
|
26
|
+
children: PropTypes.object.isRequired,
|
|
18
27
|
contentType: PropTypes.string.isRequired
|
|
19
28
|
};
|
|
20
29
|
ContentGroup.defaultProps = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentGroup.js","names":["React","PropTypes","ContentGroupTabs","ContentGroup","contentType","props","propTypes","
|
|
1
|
+
{"version":3,"file":"ContentGroup.js","names":["React","PropTypes","ContentGroupTabs","getSectionsData","ContentGroup","contentType","children","props","groupSections","length","sectionsData","propTypes","object","isRequired","string","defaultProps"],"sources":["../../../src/components/ContentGroup/ContentGroup.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport ContentGroupTabs from './ContentGroupTabs';\nimport { getSectionsData } from './helpers';\n\nconst ContentGroup = ({ contentType, children, ...props }) => {\n const groupSections = children?.props?.children[1];\n if (!groupSections || !groupSections.length) return '';\n if (contentType !== 'tab' && contentType !== 'sidepanel') return '';\n const sectionsData = getSectionsData(groupSections);\n\n return (\n <ContentGroupTabs\n contentType={contentType}\n groupSections={groupSections}\n sectionsData={sectionsData}\n {...props}\n />\n );\n};\n\nContentGroup.propTypes = {\n children: PropTypes.object.isRequired,\n contentType: PropTypes.string.isRequired\n};\n\nContentGroup.defaultProps = {};\n\nexport default ContentGroup;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,eAAe,QAAQ,WAAW;AAE3C,MAAMC,YAAY,GAAG,QAAyC;EAAA;EAAA,IAAxC;MAAEC,WAAW;MAAEC;IAAmB,CAAC;IAAPC,KAAK;EACrD,MAAMC,aAAa,GAAGF,QAAQ,aAARA,QAAQ,0CAARA,QAAQ,CAAEC,KAAK,oDAAf,gBAAiBD,QAAQ,CAAC,CAAC,CAAC;EAClD,IAAI,CAACE,aAAa,IAAI,CAACA,aAAa,CAACC,MAAM,EAAE,OAAO,EAAE;EACtD,IAAIJ,WAAW,KAAK,KAAK,IAAIA,WAAW,KAAK,WAAW,EAAE,OAAO,EAAE;EACnE,MAAMK,YAAY,GAAGP,eAAe,CAACK,aAAa,CAAC;EAEnD,oBACE,oBAAC,gBAAgB;IACf,WAAW,EAAEH,WAAY;IACzB,aAAa,EAAEG,aAAc;IAC7B,YAAY,EAAEE;EAAa,GACvBH,KAAK,EACT;AAEN,CAAC;AAEDH,YAAY,CAACO,SAAS,GAAG;EACvBL,QAAQ,EAAEL,SAAS,CAACW,MAAM,CAACC,UAAU;EACrCR,WAAW,EAAEJ,SAAS,CAACa,MAAM,CAACD;AAChC,CAAC;AAEDT,YAAY,CAACW,YAAY,GAAG,CAAC,CAAC;AAE9B,eAAeX,YAAY"}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
const _excluded = ["name", "contentType", "modifier", "children"];
|
|
3
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
4
2
|
import PropTypes from 'prop-types';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
3
|
+
import { useRouter } from 'next/router';
|
|
4
|
+
import { getActiveTab } from './helpers';
|
|
5
|
+
import { TAB, TABS, SIDEPANEL, CONTENT_GROUP, PANEL } from './constants';
|
|
6
|
+
const ContentGroupTabs = ({
|
|
7
|
+
name,
|
|
8
|
+
contentType,
|
|
9
|
+
modifier,
|
|
10
|
+
groupSections,
|
|
11
|
+
sectionsData
|
|
12
|
+
}) => {
|
|
13
|
+
const router = useRouter();
|
|
14
|
+
const [selectedTab, setSelectedTab] = useState(getActiveTab(sectionsData, ''));
|
|
15
|
+
const {
|
|
16
|
+
asPath
|
|
17
|
+
} = router;
|
|
18
|
+
const contentClassame = contentType === TAB ? TABS : SIDEPANEL;
|
|
19
|
+
const mainDivClass = `${CONTENT_GROUP}-${contentClassame}`;
|
|
20
|
+
const contentGroupClass = `${CONTENT_GROUP}-${contentClassame}__buttons-wrapper`;
|
|
21
|
+
const sectionClass = `${CONTENT_GROUP}-${contentClassame}__content-section`;
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
const activeTab = getActiveTab(sectionsData, asPath);
|
|
24
|
+
if (activeTab !== selectedTab) setSelectedTab(activeTab);
|
|
25
|
+
}, [asPath, sectionsData, selectedTab]);
|
|
18
26
|
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
-
className:
|
|
27
|
+
className: mainDivClass
|
|
20
28
|
}, /*#__PURE__*/React.createElement("ul", {
|
|
21
|
-
className:
|
|
29
|
+
className: contentGroupClass,
|
|
22
30
|
role: "tablist",
|
|
23
31
|
"aria-label": name
|
|
24
32
|
}, groupSections.map((groupSection, index) => {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
settings: {
|
|
29
|
-
label: sectionLabel
|
|
30
|
-
} = {}
|
|
31
|
-
} = {}
|
|
32
|
-
} = {}
|
|
33
|
-
} = groupSection;
|
|
34
|
-
const tabId = `tab-${index}`;
|
|
35
|
-
const panelId = `panel-${index}`;
|
|
33
|
+
const [sectionName, sectioLabel] = sectionsData[index];
|
|
34
|
+
const tabId = `${TAB}-${sectionName}`;
|
|
35
|
+
const panelId = `${PANEL}-${sectionName}`;
|
|
36
36
|
const isSelected = selectedTab === tabId;
|
|
37
|
-
const buttonClassName = isSelected ?
|
|
37
|
+
const buttonClassName = `${CONTENT_GROUP}-${contentClassame}__button${isSelected ? '--is-active' : ''}`;
|
|
38
38
|
return /*#__PURE__*/React.createElement("button", {
|
|
39
39
|
id: tabId,
|
|
40
40
|
key: tabId,
|
|
@@ -43,16 +43,25 @@ const ContentGroupTabs = _ref => {
|
|
|
43
43
|
role: "tab",
|
|
44
44
|
"aria-selected": isSelected,
|
|
45
45
|
"aria-controls": panelId,
|
|
46
|
-
onClick: () =>
|
|
47
|
-
|
|
46
|
+
onClick: () => {
|
|
47
|
+
const baseUrl = asPath.split('#')[0];
|
|
48
|
+
const newUrl = `${baseUrl}#${sectionName}`;
|
|
49
|
+
if (asPath === newUrl) return;
|
|
50
|
+
router.push(`/Resolver`, newUrl, {
|
|
51
|
+
shallow: true
|
|
52
|
+
});
|
|
53
|
+
setSelectedTab(tabId);
|
|
54
|
+
}
|
|
55
|
+
}, sectioLabel);
|
|
48
56
|
})), groupSections.map((groupSection, index) => {
|
|
49
|
-
const
|
|
50
|
-
const
|
|
57
|
+
const [sectionName] = sectionsData[index];
|
|
58
|
+
const tabId = `${TAB}-${sectionName}`;
|
|
59
|
+
const panelId = `${PANEL}-${sectionName}`;
|
|
51
60
|
if (selectedTab !== tabId) return null;
|
|
52
61
|
return /*#__PURE__*/React.createElement("div", {
|
|
53
|
-
id:
|
|
62
|
+
id: sectionName,
|
|
54
63
|
key: panelId,
|
|
55
|
-
className:
|
|
64
|
+
className: sectionClass,
|
|
56
65
|
role: "tabpanel",
|
|
57
66
|
"aria-labelledby": tabId
|
|
58
67
|
}, groupSection);
|
|
@@ -62,11 +71,11 @@ ContentGroupTabs.propTypes = {
|
|
|
62
71
|
name: PropTypes.string.isRequired,
|
|
63
72
|
contentType: PropTypes.string.isRequired,
|
|
64
73
|
modifier: PropTypes.string,
|
|
65
|
-
|
|
74
|
+
groupSections: PropTypes.array.isRequired,
|
|
75
|
+
sectionsData: PropTypes.array.isRequired
|
|
66
76
|
};
|
|
67
77
|
ContentGroupTabs.defaultProps = {
|
|
68
|
-
modifier: ''
|
|
69
|
-
children: {}
|
|
78
|
+
modifier: ''
|
|
70
79
|
};
|
|
71
80
|
export default ContentGroupTabs;
|
|
72
81
|
//# sourceMappingURL=ContentGroupTabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentGroupTabs.js","names":["React","useState","PropTypes","ContentGroupTabs","name","contentType","modifier","
|
|
1
|
+
{"version":3,"file":"ContentGroupTabs.js","names":["React","useState","useEffect","PropTypes","useRouter","getActiveTab","TAB","TABS","SIDEPANEL","CONTENT_GROUP","PANEL","ContentGroupTabs","name","contentType","modifier","groupSections","sectionsData","router","selectedTab","setSelectedTab","asPath","contentClassame","mainDivClass","contentGroupClass","sectionClass","activeTab","map","groupSection","index","sectionName","sectioLabel","tabId","panelId","isSelected","buttonClassName","baseUrl","split","newUrl","push","shallow","propTypes","string","isRequired","array","defaultProps"],"sources":["../../../src/components/ContentGroup/ContentGroupTabs.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { useRouter } from 'next/router';\nimport { getActiveTab } from './helpers';\nimport { TAB, TABS, SIDEPANEL, CONTENT_GROUP, PANEL } from './constants';\n\nconst ContentGroupTabs = ({ name, contentType, modifier, groupSections, sectionsData }) => {\n const router = useRouter();\n const [selectedTab, setSelectedTab] = useState(getActiveTab(sectionsData, ''));\n const { asPath } = router;\n const contentClassame = contentType === TAB ? TABS : SIDEPANEL;\n const mainDivClass = `${CONTENT_GROUP}-${contentClassame}`;\n const contentGroupClass = `${CONTENT_GROUP}-${contentClassame}__buttons-wrapper`;\n const sectionClass = `${CONTENT_GROUP}-${contentClassame}__content-section`;\n\n useEffect(\n () => {\n const activeTab = getActiveTab(sectionsData, asPath);\n if (activeTab !== selectedTab) setSelectedTab(activeTab);\n },\n [asPath, sectionsData, selectedTab]\n );\n\n return (\n <div className={mainDivClass}>\n <ul className={contentGroupClass} role=\"tablist\" aria-label={name}>\n {groupSections.map((groupSection, index) => {\n const [sectionName, sectioLabel] = sectionsData[index];\n const tabId = `${TAB}-${sectionName}`;\n const panelId = `${PANEL}-${sectionName}`;\n const isSelected = selectedTab === tabId;\n const buttonClassName = `${CONTENT_GROUP}-${contentClassame}__button${\n isSelected ? '--is-active' : ''\n }`;\n\n return (\n <button\n id={tabId}\n key={tabId}\n className={buttonClassName}\n type=\"button\"\n role=\"tab\"\n aria-selected={isSelected}\n aria-controls={panelId}\n onClick={() => {\n const baseUrl = asPath.split('#')[0];\n const newUrl = `${baseUrl}#${sectionName}`;\n if (asPath === newUrl) return;\n router.push(`/Resolver`, newUrl, { shallow: true });\n setSelectedTab(tabId);\n }}>\n {sectioLabel}\n </button>\n );\n })}\n </ul>\n {groupSections.map((groupSection, index) => {\n const [sectionName] = sectionsData[index];\n const tabId = `${TAB}-${sectionName}`;\n const panelId = `${PANEL}-${sectionName}`;\n if (selectedTab !== tabId) return null;\n\n return (\n <div\n id={sectionName}\n key={panelId}\n className={sectionClass}\n role=\"tabpanel\"\n aria-labelledby={tabId}>\n {groupSection}\n </div>\n );\n })}\n </div>\n );\n};\n\nContentGroupTabs.propTypes = {\n name: PropTypes.string.isRequired,\n contentType: PropTypes.string.isRequired,\n modifier: PropTypes.string,\n groupSections: PropTypes.array.isRequired,\n sectionsData: PropTypes.array.isRequired\n};\n\nContentGroupTabs.defaultProps = {\n modifier: ''\n};\n\nexport default ContentGroupTabs;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,YAAY,QAAQ,WAAW;AACxC,SAASC,GAAG,EAAEC,IAAI,EAAEC,SAAS,EAAEC,aAAa,EAAEC,KAAK,QAAQ,aAAa;AAExE,MAAMC,gBAAgB,GAAG,CAAC;EAAEC,IAAI;EAAEC,WAAW;EAAEC,QAAQ;EAAEC,aAAa;EAAEC;AAAa,CAAC,KAAK;EACzF,MA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UAAU;EACzC1B,YAAY,EAAEb,SAAS,CAACwC,KAAK,CAACD;AAChC,CAAC;AAED/B,gBAAgB,CAACiC,YAAY,GAAG;EAC9B9B,QAAQ,EAAE;AACZ,CAAC;AAED,eAAeH,gBAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","names":["TAB","TABS","SIDEPANEL","CONTENT_GROUP","PANEL"],"sources":["../../../src/components/ContentGroup/constants.js"],"sourcesContent":["const TAB = 'tab';\nconst TABS = 'tabs';\nconst SIDEPANEL = 'sidepanel';\nconst CONTENT_GROUP = 'content-group';\nconst PANEL = 'panel';\n\nexport { TAB, TABS, SIDEPANEL, CONTENT_GROUP, PANEL };\n"],"mappings":"AAAA,MAAMA,GAAG,GAAG,KAAK;AACjB,MAAMC,IAAI,GAAG,MAAM;AACnB,MAAMC,SAAS,GAAG,WAAW;AAC7B,MAAMC,aAAa,GAAG,eAAe;AACrC,MAAMC,KAAK,GAAG,OAAO;AAErB,SAASJ,GAAG,EAAEC,IAAI,EAAEC,SAAS,EAAEC,aAAa,EAAEC,KAAK"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TAB } from '../constants';
|
|
2
|
+
const getActiveTab = (sections, url) => {
|
|
3
|
+
const decodedUrl = decodeURI(url);
|
|
4
|
+
const activeTabName = decodedUrl.split('#')[1];
|
|
5
|
+
const isUrlTabValid = !!sections.find(section => section[0] === activeTabName);
|
|
6
|
+
const tabToUse = isUrlTabValid && activeTabName || sections[0][0];
|
|
7
|
+
return `${TAB}-${tabToUse}`;
|
|
8
|
+
};
|
|
9
|
+
export default getActiveTab;
|
|
10
|
+
//# sourceMappingURL=get-active-tab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-active-tab.js","names":["TAB","getActiveTab","sections","url","decodedUrl","decodeURI","activeTabName","split","isUrlTabValid","find","section","tabToUse"],"sources":["../../../../src/components/ContentGroup/helpers/get-active-tab.js"],"sourcesContent":["import { TAB } from '../constants';\n\nconst getActiveTab = (sections, url) => {\n const decodedUrl = decodeURI(url);\n const activeTabName = decodedUrl.split('#')[1];\n const isUrlTabValid = !!sections.find(section => section[0] === activeTabName);\n const tabToUse = (isUrlTabValid && activeTabName) || sections[0][0];\n return `${TAB}-${tabToUse}`;\n};\n\nexport default getActiveTab;\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,cAAc;AAElC,MAAMC,YAAY,GAAG,CAACC,QAAQ,EAAEC,GAAG,KAAK;EACtC,MAAMC,UAAU,GAAGC,SAAS,CAACF,GAAG,CAAC;EACjC,MAAMG,aAAa,GAAGF,UAAU,CAACG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;EAC9C,MAAMC,aAAa,GAAG,CAAC,CAACN,QAAQ,CAACO,IAAI,CAACC,OAAO,IAAIA,OAAO,CAAC,CAAC,CAAC,KAAKJ,aAAa,CAAC;EAC9E,MAAMK,QAAQ,GAAIH,aAAa,IAAIF,aAAa,IAAKJ,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EACnE,OAAQ,GAAEF,GAAI,IAAGW,QAAS,EAAC;AAC7B,CAAC;AAED,eAAeV,YAAY"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const getSectionsData = sections => sections.map(section => {
|
|
2
|
+
const {
|
|
3
|
+
props: {
|
|
4
|
+
component: {
|
|
5
|
+
settings: {
|
|
6
|
+
label,
|
|
7
|
+
name
|
|
8
|
+
} = {}
|
|
9
|
+
} = {}
|
|
10
|
+
} = {}
|
|
11
|
+
} = section;
|
|
12
|
+
return [name, label];
|
|
13
|
+
});
|
|
14
|
+
export default getSectionsData;
|
|
15
|
+
//# sourceMappingURL=get-sections-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-sections-data.js","names":["getSectionsData","sections","map","section","props","component","settings","label","name"],"sources":["../../../../src/components/ContentGroup/helpers/get-sections-data.js"],"sourcesContent":["const getSectionsData = sections =>\n sections.map(section => {\n const { props: { component: { settings: { label, name } = {} } = {} } = {} } = section;\n return [name, label];\n });\n\nexport default getSectionsData;\n"],"mappings":"AAAA,MAAMA,eAAe,GAAGC,QAAQ,IAC9BA,QAAQ,CAACC,GAAG,CAACC,OAAO,IAAI;EACtB,MAAM;IAAEC,KAAK,EAAE;MAAEC,SAAS,EAAE;QAAEC,QAAQ,EAAE;UAAEC,KAAK;UAAEC;QAAK,CAAC,GAAG,CAAC;MAAE,CAAC,GAAG,CAAC;IAAE,CAAC,GAAG,CAAC;EAAE,CAAC,GAAGL,OAAO;EACtF,OAAO,CAACK,IAAI,EAAED,KAAK,CAAC;AACtB,CAAC,CAAC;AAEJ,eAAeP,eAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["getSectionsData","getActiveTab"],"sources":["../../../../src/components/ContentGroup/helpers/index.js"],"sourcesContent":["import getSectionsData from './get-sections-data';\nimport getActiveTab from './get-active-tab';\n\nexport { getSectionsData, getActiveTab };\n"],"mappings":"AAAA,OAAOA,eAAe,MAAM,qBAAqB;AACjD,OAAOC,YAAY,MAAM,kBAAkB;AAE3C,SAASD,eAAe,EAAEC,YAAY"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
-
const _excluded = ["children"];
|
|
2
|
+
const _excluded = ["children", "name"];
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { hasChildren } from '../../helpers';
|
|
6
6
|
const ContentGroupSection = _ref => {
|
|
7
7
|
let {
|
|
8
|
-
children
|
|
8
|
+
children,
|
|
9
|
+
name
|
|
9
10
|
} = _ref,
|
|
10
11
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
11
12
|
if (!hasChildren(children)) return null;
|
|
12
13
|
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
key: name,
|
|
13
15
|
className: "content-group-section"
|
|
14
16
|
}, children);
|
|
15
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentGroupSection.js","names":["React","PropTypes","hasChildren","ContentGroupSection","children","props","propTypes","oneOfType","arrayOf","node","defaultProps"],"sources":["../../../src/components/ContentGroupSection/ContentGroupSection.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { hasChildren } from '../../helpers';\n\nconst ContentGroupSection = ({ children, ...props }) => {\n if (!hasChildren(children)) return null;\n\n return <div className=\"content-group-section\"
|
|
1
|
+
{"version":3,"file":"ContentGroupSection.js","names":["React","PropTypes","hasChildren","ContentGroupSection","children","name","props","propTypes","oneOfType","arrayOf","node","defaultProps"],"sources":["../../../src/components/ContentGroupSection/ContentGroupSection.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { hasChildren } from '../../helpers';\n\nconst ContentGroupSection = ({ children, name, ...props }) => {\n if (!hasChildren(children)) return null;\n\n return (\n <div key={name} className=\"content-group-section\">\n {children}\n </div>\n );\n};\n\nContentGroupSection.propTypes = {\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])\n};\n\nContentGroupSection.defaultProps = { children: null };\n\nexport default ContentGroupSection;\n"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,WAAW,QAAQ,eAAe;AAE3C,MAAMC,mBAAmB,GAAG,QAAkC;EAAA,IAAjC;MAAEC,QAAQ;MAAEC;IAAe,CAAC;IAAPC,KAAK;EACrD,IAAI,CAACJ,WAAW,CAACE,QAAQ,CAAC,EAAE,OAAO,IAAI;EAEvC,oBACE;IAAK,GAAG,EAAEC,IAAK;IAAC,SAAS,EAAC;EAAuB,GAC9CD,QAAQ,CACL;AAEV,CAAC;AAEDD,mBAAmB,CAACI,SAAS,GAAG;EAC9BH,QAAQ,EAAEH,SAAS,CAACO,SAAS,CAAC,CAACP,SAAS,CAACQ,OAAO,CAACR,SAAS,CAACS,IAAI,CAAC,EAAET,SAAS,CAACS,IAAI,CAAC;AACnF,CAAC;AAEDP,mBAAmB,CAACQ,YAAY,GAAG;EAAEP,QAAQ,EAAE;AAAK,CAAC;AAErD,eAAeD,mBAAmB"}
|
|
@@ -78,7 +78,7 @@ const CardsRenderItem = ({
|
|
|
78
78
|
overlayModifier: overlayModifier,
|
|
79
79
|
titleOverlayModifier: titleOverlayModifier
|
|
80
80
|
}, cardProps))), shouldRenderBanner && /*#__PURE__*/React.createElement(Banner, _extends({}, bannerProps, {
|
|
81
|
-
|
|
81
|
+
cardBannerIndex: bannerIndex
|
|
82
82
|
})));
|
|
83
83
|
};
|
|
84
84
|
CardsRenderItem.propTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardsRenderItem.js","names":["React","PropTypes","Waypoint","Card","shouldRenderWaypoint","renderChildren","parsePropsToDisplay","checkIfShouldRenderGtm","Banner","CardsRenderItem","cardProps","listProps","bannerProps","index","entity","currentListLength","cardChildren","gtmChildren","modifier","gridModifier","propsToDisplayModifiers","propsToDisplay","shouldRenderBanner","bannerIndex","priority","enableOverlay","autoScrollTimer","arrowSize","overlayModifier","titleOverlayModifier","initialOffset","isInfinite","style","name","id","triggerInfiniteScroll","displayCount","displayCategory","displayThumbnail","displayTitle","listTotal","itemsPerPage","currentItemIndex","renderWaypoint","shouldRenderGtm","parsedPropsToDisplay","propTypes","object","isRequired","number","array","bool","string","oneOfType","arrayOf","node","defaultProps"],"sources":["../../../../../src/components/List/components/Cards/CardsRenderItem.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Waypoint } from 'react-waypoint';\nimport Card from '../../../Card/Card';\nimport { shouldRenderWaypoint, renderChildren, parsePropsToDisplay } from '../../../../helpers';\nimport { checkIfShouldRenderGtm } from '../helpers';\nimport Banner from '../../../Banner';\n\nconst CardsRenderItem = ({\n cardProps,\n listProps,\n bannerProps,\n index,\n entity,\n currentListLength,\n cardChildren,\n gtmChildren,\n modifier,\n gridModifier,\n propsToDisplayModifiers,\n propsToDisplay,\n shouldRenderBanner,\n bannerIndex,\n priority,\n enableOverlay,\n autoScrollTimer,\n arrowSize,\n overlayModifier,\n titleOverlayModifier\n}) => {\n const {\n initialOffset,\n isInfinite,\n style,\n name,\n id,\n triggerInfiniteScroll,\n displayCount,\n displayCategory = true,\n displayThumbnail = true,\n displayTitle = true,\n listTotal,\n itemsPerPage\n } = listProps;\n\n const currentItemIndex = initialOffset + index;\n const renderWaypoint =\n isInfinite && shouldRenderWaypoint(index, currentListLength, currentItemIndex, listTotal);\n const shouldRenderGtm =\n gtmChildren && checkIfShouldRenderGtm(itemsPerPage, currentListLength, index);\n\n const parsedPropsToDisplay = parsePropsToDisplay(cardProps, propsToDisplay);\n\n return (\n <>\n {shouldRenderGtm && renderChildren(gtmChildren)}\n {displayCount && (\n <div className=\"heading heading--section heading--section--count\">\n <span className=\"section-number\">{currentItemIndex + 1}</span>\n <span className=\"section-total\">/{listTotal}</span>\n </div>\n )}\n <div className=\"list__item list__item--compact\">\n {renderWaypoint && <Waypoint onEnter={triggerInfiniteScroll} />}\n <Card\n id={id}\n entity={entity}\n gridModifier={gridModifier}\n propsToDisplay={propsToDisplay}\n parsedPropsToDisplay={parsedPropsToDisplay}\n propsToDisplayModifiers={propsToDisplayModifiers}\n modifier={modifier}\n style={style}\n cardChildren={cardChildren}\n displayCategory={displayCategory}\n displayThumbnail={displayThumbnail}\n displayTitle={displayTitle}\n cardProps={cardProps}\n gtmId={name}\n gtmChildren={gtmChildren}\n priority={priority}\n arrowSize={arrowSize}\n enableOverlay={enableOverlay}\n overlayModifier={overlayModifier}\n titleOverlayModifier={titleOverlayModifier}\n {...cardProps}\n />\n </div>\n {shouldRenderBanner && <Banner {...bannerProps}
|
|
1
|
+
{"version":3,"file":"CardsRenderItem.js","names":["React","PropTypes","Waypoint","Card","shouldRenderWaypoint","renderChildren","parsePropsToDisplay","checkIfShouldRenderGtm","Banner","CardsRenderItem","cardProps","listProps","bannerProps","index","entity","currentListLength","cardChildren","gtmChildren","modifier","gridModifier","propsToDisplayModifiers","propsToDisplay","shouldRenderBanner","bannerIndex","priority","enableOverlay","autoScrollTimer","arrowSize","overlayModifier","titleOverlayModifier","initialOffset","isInfinite","style","name","id","triggerInfiniteScroll","displayCount","displayCategory","displayThumbnail","displayTitle","listTotal","itemsPerPage","currentItemIndex","renderWaypoint","shouldRenderGtm","parsedPropsToDisplay","propTypes","object","isRequired","number","array","bool","string","oneOfType","arrayOf","node","defaultProps"],"sources":["../../../../../src/components/List/components/Cards/CardsRenderItem.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Waypoint } from 'react-waypoint';\nimport Card from '../../../Card/Card';\nimport { shouldRenderWaypoint, renderChildren, parsePropsToDisplay } from '../../../../helpers';\nimport { checkIfShouldRenderGtm } from '../helpers';\nimport Banner from '../../../Banner';\n\nconst CardsRenderItem = ({\n cardProps,\n listProps,\n bannerProps,\n index,\n entity,\n currentListLength,\n cardChildren,\n gtmChildren,\n modifier,\n gridModifier,\n propsToDisplayModifiers,\n propsToDisplay,\n shouldRenderBanner,\n bannerIndex,\n priority,\n enableOverlay,\n autoScrollTimer,\n arrowSize,\n overlayModifier,\n titleOverlayModifier\n}) => {\n const {\n initialOffset,\n isInfinite,\n style,\n name,\n id,\n triggerInfiniteScroll,\n displayCount,\n displayCategory = true,\n displayThumbnail = true,\n displayTitle = true,\n listTotal,\n itemsPerPage\n } = listProps;\n\n const currentItemIndex = initialOffset + index;\n const renderWaypoint =\n isInfinite && shouldRenderWaypoint(index, currentListLength, currentItemIndex, listTotal);\n const shouldRenderGtm =\n gtmChildren && checkIfShouldRenderGtm(itemsPerPage, currentListLength, index);\n\n const parsedPropsToDisplay = parsePropsToDisplay(cardProps, propsToDisplay);\n\n return (\n <>\n {shouldRenderGtm && renderChildren(gtmChildren)}\n {displayCount && (\n <div className=\"heading heading--section heading--section--count\">\n <span className=\"section-number\">{currentItemIndex + 1}</span>\n <span className=\"section-total\">/{listTotal}</span>\n </div>\n )}\n <div className=\"list__item list__item--compact\">\n {renderWaypoint && <Waypoint onEnter={triggerInfiniteScroll} />}\n <Card\n id={id}\n entity={entity}\n gridModifier={gridModifier}\n propsToDisplay={propsToDisplay}\n parsedPropsToDisplay={parsedPropsToDisplay}\n propsToDisplayModifiers={propsToDisplayModifiers}\n modifier={modifier}\n style={style}\n cardChildren={cardChildren}\n displayCategory={displayCategory}\n displayThumbnail={displayThumbnail}\n displayTitle={displayTitle}\n cardProps={cardProps}\n gtmId={name}\n gtmChildren={gtmChildren}\n priority={priority}\n arrowSize={arrowSize}\n enableOverlay={enableOverlay}\n overlayModifier={overlayModifier}\n titleOverlayModifier={titleOverlayModifier}\n {...cardProps}\n />\n </div>\n {shouldRenderBanner && <Banner {...bannerProps} cardBannerIndex={bannerIndex} />}\n </>\n );\n};\n\nCardsRenderItem.propTypes = {\n cardProps: PropTypes.object.isRequired,\n listProps: PropTypes.object.isRequired,\n index: PropTypes.number.isRequired,\n currentListLength: PropTypes.number.isRequired,\n propsToDisplayModifiers: PropTypes.array.isRequired,\n shouldRenderBanner: PropTypes.bool.isRequired,\n bannerIndex: PropTypes.number.isRequired,\n bannerProps: PropTypes.object,\n gridModifier: PropTypes.string,\n propsToDisplay: PropTypes.array,\n entity: PropTypes.string.isRequired,\n modifier: PropTypes.string,\n cardChildren: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n gtmChildren: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n priority: PropTypes.bool,\n enableOverlay: PropTypes.bool,\n overlayModifier: PropTypes.string,\n titleOverlayModifier: PropTypes.string,\n autoScrollTimer: PropTypes.number,\n arrowSize: PropTypes.string\n};\n\nCardsRenderItem.defaultProps = {\n priority: false,\n bannerProps: null,\n gridModifier: '',\n propsToDisplay: [],\n modifier: '',\n cardChildren: [],\n gtmChildren: [],\n enableOverlay: false,\n autoScrollTimer: 0,\n overlayModifier: '',\n titleOverlayModifier: '',\n arrowSize: ''\n};\n\nexport default CardsRenderItem;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,IAAI,MAAM,oBAAoB;AACrC,SAASC,oBAAoB,EAAEC,cAAc,EAAEC,mBAAmB,QAAQ,qBAAqB;AAC/F,SAASC,sBAAsB,QAAQ,YAAY;AACnD,OAAOC,MAAM,MAAM,iBAAiB;AAEpC,MAAMC,eAAe,GAAG,CAAC;EACvBC,SAAS;EACTC,SAAS;EACTC,WAAW;EACXC,KAAK;EACLC,MAAM;EACNC,iBAAiB;EACjBC,YAAY;EACZC,WAAW;EACXC,QAAQ;EACRC,YAAY;EACZC,uBAAuB;EACvBC,cAAc;EACdC,kBAAkB;EAClBC,WAAW;EACXC,QAAQ;EACRC,aAAa;EACbC,eAAe;EACfC,SAAS;EACTC,eAAe;EACfC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC,aAAa;IACbC,UAAU;IACVC,KAAK;IACLC,IAAI;IACJC,EAAE;IACFC,qBAAqB;IACrBC,YAAY;IACZC,eAAe,GAAG,IAAI;IACtBC,gBAAgB,GAAG,IAAI;IACvBC,YAAY,GAAG,IAAI;IACnBC,SAAS;IACTC;EACF,CAAC,GAAG9B,SAAS;EAEb,MAAM+B,gBAAgB,GAAGZ,aAAa,GAAGjB,KAAK;EAC9C,MAAM8B,cAAc,GAClBZ,UAAU,IAAI3B,oBAAoB,CAACS,KAAK,EAAEE,iBAAiB,EAAE2B,gBAAgB,EAAEF,SAAS,CAAC;EAC3F,MAAMI,eAAe,GACnB3B,WAAW,IAAIV,sBAAsB,CAACkC,YAAY,EAAE1B,iBAAiB,EAAEF,KAAK,CAAC;EAE/E,MAAMgC,oBAAoB,GAAGvC,mBAAmB,CAACI,SAAS,EAAEW,cAAc,CAAC;EAE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EAAE,CAAC;EAClBE,eAAe,EAAE,EAAE;EACnBC,oBAAoB,EAAE,EAAE;EACxBF,SAAS,EAAE;AACb,CAAC;AAED,eAAelB,eAAe"}
|
|
@@ -55,7 +55,7 @@ const FullRenderItem = ({
|
|
|
55
55
|
})), !!parsedPropsToDisplay.length && /*#__PURE__*/React.createElement(React.Fragment, null, parsedPropsToDisplay.map(prop => prop ? /*#__PURE__*/React.createElement("span", {
|
|
56
56
|
key: prop
|
|
57
57
|
}, prop) : null)), shouldRenderBanner && /*#__PURE__*/React.createElement(Banner, _extends({}, bannerProps, {
|
|
58
|
-
|
|
58
|
+
cardBannerIndex: bannerIndex
|
|
59
59
|
})));
|
|
60
60
|
};
|
|
61
61
|
FullRenderItem.propTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FullRenderItem.js","names":["React","useContext","PropTypes","Waypoint","MainContext","BuildPBComponents","Banner","parsePropsToDisplay","shouldRenderWaypoint","FullRenderItem","isInfinite","pageBuilderComponents","entityProps","propsToDisplay","entity","index","itemId","listTotal","initialOffset","currentListLength","triggerInfiniteScroll","parent","pageBuilderID","displayCount","shouldRenderBanner","bannerProps","bannerIndex","hasGTM","parsedPropsToDisplay","currentItemIndex","renderWaypoint","itemEntity","length","map","prop","propTypes","array","object","isRequired","number","bool","func","string","data","itemsToDisplay","defaultProps"],"sources":["../../../../../src/components/List/components/Full/FullRenderItem.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { Waypoint } from 'react-waypoint';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport BuildPBComponents from '../../../../hooks/helpers/buildPBComponents';\nimport Banner from '../../../Banner';\nimport { parsePropsToDisplay, shouldRenderWaypoint } from '../../../../helpers';\n\nconst FullRenderItem = ({\n isInfinite,\n pageBuilderComponents,\n entityProps,\n propsToDisplay,\n entity,\n index,\n itemId,\n listTotal,\n initialOffset,\n currentListLength,\n triggerInfiniteScroll,\n parent,\n pageBuilderID,\n displayCount,\n shouldRenderBanner,\n bannerProps,\n bannerIndex\n}) => {\n const { hasGTM } = useContext(MainContext);\n if (!pageBuilderComponents) return null;\n const parsedPropsToDisplay = parsePropsToDisplay(entityProps, propsToDisplay);\n const currentItemIndex = initialOffset + index;\n const renderWaypoint =\n isInfinite && shouldRenderWaypoint(index, currentListLength, currentItemIndex, listTotal);\n return (\n <>\n {renderWaypoint && <Waypoint onEnter={triggerInfiniteScroll} />}\n {displayCount && (\n <div className=\"heading heading--section heading--section--count\">\n <span className=\"section-number\">{currentItemIndex + 1}</span>\n <span className=\"section-total\">/{listTotal}</span>\n </div>\n )}\n <div className=\"list__item list__item--full\">\n {BuildPBComponents(pageBuilderComponents, {\n parent: { ...parent, itemId, itemEntity: entity },\n hasGTM,\n pageBuilderID\n })}\n </div>\n {!!parsedPropsToDisplay.length && (\n <>{parsedPropsToDisplay.map(prop => (prop ? <span key={prop}>{prop}</span> : null))}</>\n )}\n {shouldRenderBanner && <Banner {...bannerProps}
|
|
1
|
+
{"version":3,"file":"FullRenderItem.js","names":["React","useContext","PropTypes","Waypoint","MainContext","BuildPBComponents","Banner","parsePropsToDisplay","shouldRenderWaypoint","FullRenderItem","isInfinite","pageBuilderComponents","entityProps","propsToDisplay","entity","index","itemId","listTotal","initialOffset","currentListLength","triggerInfiniteScroll","parent","pageBuilderID","displayCount","shouldRenderBanner","bannerProps","bannerIndex","hasGTM","parsedPropsToDisplay","currentItemIndex","renderWaypoint","itemEntity","length","map","prop","propTypes","array","object","isRequired","number","bool","func","string","data","itemsToDisplay","defaultProps"],"sources":["../../../../../src/components/List/components/Full/FullRenderItem.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { Waypoint } from 'react-waypoint';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport BuildPBComponents from '../../../../hooks/helpers/buildPBComponents';\nimport Banner from '../../../Banner';\nimport { parsePropsToDisplay, shouldRenderWaypoint } from '../../../../helpers';\n\nconst FullRenderItem = ({\n isInfinite,\n pageBuilderComponents,\n entityProps,\n propsToDisplay,\n entity,\n index,\n itemId,\n listTotal,\n initialOffset,\n currentListLength,\n triggerInfiniteScroll,\n parent,\n pageBuilderID,\n displayCount,\n shouldRenderBanner,\n bannerProps,\n bannerIndex\n}) => {\n const { hasGTM } = useContext(MainContext);\n if (!pageBuilderComponents) return null;\n const parsedPropsToDisplay = parsePropsToDisplay(entityProps, propsToDisplay);\n const currentItemIndex = initialOffset + index;\n const renderWaypoint =\n isInfinite && shouldRenderWaypoint(index, currentListLength, currentItemIndex, listTotal);\n return (\n <>\n {renderWaypoint && <Waypoint onEnter={triggerInfiniteScroll} />}\n {displayCount && (\n <div className=\"heading heading--section heading--section--count\">\n <span className=\"section-number\">{currentItemIndex + 1}</span>\n <span className=\"section-total\">/{listTotal}</span>\n </div>\n )}\n <div className=\"list__item list__item--full\">\n {BuildPBComponents(pageBuilderComponents, {\n parent: { ...parent, itemId, itemEntity: entity },\n hasGTM,\n pageBuilderID\n })}\n </div>\n {!!parsedPropsToDisplay.length && (\n <>{parsedPropsToDisplay.map(prop => (prop ? <span key={prop}>{prop}</span> : null))}</>\n )}\n {shouldRenderBanner && <Banner {...bannerProps} cardBannerIndex={bannerIndex} />}\n </>\n );\n};\n\nFullRenderItem.propTypes = {\n pageBuilderComponents: PropTypes.array,\n entityProps: PropTypes.object.isRequired,\n parent: PropTypes.object.isRequired,\n currentListLength: PropTypes.number.isRequired,\n listTotal: PropTypes.number.isRequired,\n initialOffset: PropTypes.number.isRequired,\n displayCount: PropTypes.bool.isRequired,\n triggerInfiniteScroll: PropTypes.func,\n entity: PropTypes.string.isRequired,\n pageBuilderID: PropTypes.string.isRequired,\n itemId: PropTypes.string.isRequired,\n index: PropTypes.number.isRequired,\n isInfinite: PropTypes.bool.isRequired,\n shouldRenderBanner: PropTypes.bool.isRequired,\n bannerIndex: PropTypes.number.isRequired,\n propsToDisplay: PropTypes.array,\n data: PropTypes.array,\n itemsToDisplay: PropTypes.array,\n bannerProps: PropTypes.object\n};\n\nFullRenderItem.defaultProps = {\n pageBuilderComponents: null,\n data: [],\n propsToDisplay: [],\n itemsToDisplay: [],\n triggerInfiniteScroll: null,\n bannerProps: null\n};\n\nexport default FullRenderItem;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,OAAOC,iBAAiB,MAAM,6CAA6C;AAC3E,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,qBAAqB;AAE/E,MAAMC,cAAc,GAAG,CAAC;EACtBC,UAAU;EACVC,qBAAqB;EACrBC,WAAW;EACXC,cAAc;EACdC,MAAM;EACNC,KAAK;EACLC,MAAM;EACNC,SAAS;EACTC,aAAa;EACbC,iBAAiB;EACjBC,qBAAqB;EACrBC,MAAM;EACNC,aAAa;EACbC,YAAY;EACZC,kBAAkB;EAClBC,WAAW;EACXC;AACF,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAO,CAAC,GAAG1B,UAAU,CAACG,WAAW,CAAC;EAC1C,IAAI,CAACO,qBAAqB,EAAE,OAAO,IAAI;EACvC,MAAMiB,oBAAoB,GAAGrB,mBAAmB,CAACK,WAAW,EAAEC,cAAc,CAAC;EAC7E,MAAMgB,gBAAgB,GAAGX,aAAa,GAAGH,KAAK;EAC9C,MAAMe,cAAc,GAClBpB,UAAU,IAAIF,oBAAoB,CAACO,KAAK,EAAEI,iBAAiB,EAAEU,gBAAgB,EAAEZ,SAAS,CAAC;EAC3F,oBACE,0CACGa,cAAc,iBAAI,oBAAC,QAAQ;IAAC,OAAO,EAAEV;EAAsB,EAAG,EAC9DG,YAAY,iBACX;IAAK,SAAS,EAAC;EAAkD,gBAC/D;IAAM,SAAS,EAAC;EAAgB,GAAEM,gBAAgB,GAAG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AAI,CAACF,UAAU;EACrCd,kBAAkB,EAAEtB,SAAS,CAACsC,IAAI,CAACF,UAAU;EAC7CZ,WAAW,EAAExB,SAAS,CAACqC,MAAM,CAACD,UAAU;EACxCzB,cAAc,EAAEX,SAAS,CAACkC,KAAK;EAC/BO,IAAI,EAAEzC,SAAS,CAACkC,KAAK;EACrBQ,cAAc,EAAE1C,SAAS,CAACkC,KAAK;EAC/BX,WAAW,EAAEvB,SAAS,CAACmC;AACzB,CAAC;AAED5B,cAAc,CAACoC,YAAY,GAAG;EAC5BlC,qBAAqB,EAAE,IAAI;EAC3BgC,IAAI,EAAE,EAAE;EACR9B,cAAc,EAAE,EAAE;EAClB+B,cAAc,EAAE,EAAE;EAClBxB,qBAAqB,EAAE,IAAI;EAC3BK,WAAW,EAAE;AACf,CAAC;AAED,eAAehB,cAAc"}
|
|
@@ -47,18 +47,22 @@ const YoutubeEmbeded = ({
|
|
|
47
47
|
const iframeSrc = !playlist ? `${ytUrl}/embed/${encodedId}?autoplay=1${mutedValue}${paramsImp}` : `${ytUrl}/embed/videoseries?autoplay=1${mutedValue}&list=${encodedId}${paramsImp}`;
|
|
48
48
|
const parsedWrapperClassname = `yt-facade ${renderIframe ? 'yt-activated' : ''}`;
|
|
49
49
|
useEffect(() => {
|
|
50
|
+
let isMounted = true;
|
|
50
51
|
if (!priority && !isIntersecting || imageSize === YT_HQ_FORMAT) return;
|
|
51
52
|
const img = new Image();
|
|
52
53
|
// eslint-disable-next-line func-names
|
|
53
54
|
img.onload = function () {
|
|
54
55
|
let newImageSize = imageSize;
|
|
55
56
|
if (this && this.width === 120) newImageSize = YT_HQ_FORMAT;
|
|
56
|
-
setImageDetails({
|
|
57
|
+
if (isMounted) setImageDetails({
|
|
57
58
|
imageSize: newImageSize,
|
|
58
59
|
displayImage: true
|
|
59
60
|
});
|
|
60
61
|
};
|
|
61
62
|
img.src = posterUrl;
|
|
63
|
+
return () => {
|
|
64
|
+
isMounted = false;
|
|
65
|
+
};
|
|
62
66
|
}, [imageSize, isIntersecting, posterUrl, priority]);
|
|
63
67
|
const warmConnections = () => {
|
|
64
68
|
if (preconnected) return;
|