@blaze-cms/react-page-builder 0.141.0-core-styles.22 → 0.141.0-core-styles.23
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 +11 -0
- package/lib/components/ContentGroup/ContentGroupTabs.js +10 -8
- package/lib/components/ContentGroup/ContentGroupTabs.js.map +1 -1
- package/lib/components/Video/providers/Default.js +13 -7
- package/lib/components/Video/providers/Default.js.map +1 -1
- package/lib/components/Video/providers/get-provider.js +5 -0
- package/lib/components/Video/providers/get-provider.js.map +1 -1
- package/lib/hooks/helpers/getVariant.js.map +1 -1
- package/lib/utils/variant-handler.js +2 -1
- package/lib/utils/variant-handler.js.map +1 -1
- package/lib/variants/HeroImage/index.js +29 -0
- package/lib/variants/HeroImage/index.js.map +1 -0
- package/lib/variants/Infographic/Infographic.js +27 -0
- package/lib/variants/Infographic/Infographic.js.map +1 -0
- package/lib/variants/Infographic/index.js +41 -0
- package/lib/variants/Infographic/index.js.map +1 -0
- package/lib/variants/Infographic/useInfographic.js +43 -0
- package/lib/variants/Infographic/useInfographic.js.map +1 -0
- package/lib/variants/LongformGallery/LongformGallery.js +53 -0
- package/lib/variants/LongformGallery/LongformGallery.js.map +1 -0
- package/lib/variants/LongformGallery/LongformGalleryImage.js +71 -0
- package/lib/variants/LongformGallery/LongformGalleryImage.js.map +1 -0
- package/lib/variants/LongformGallery/constants.js +19 -0
- package/lib/variants/LongformGallery/constants.js.map +1 -0
- package/lib/variants/LongformGallery/helpers/index.js +29 -0
- package/lib/variants/LongformGallery/helpers/index.js.map +1 -0
- package/lib/variants/LongformGallery/helpers/parseImageData.js +42 -0
- package/lib/variants/LongformGallery/helpers/parseImageData.js.map +1 -0
- package/lib/variants/LongformGallery/helpers/separateImages.js +36 -0
- package/lib/variants/LongformGallery/helpers/separateImages.js.map +1 -0
- package/lib/variants/LongformGallery/helpers/shouldSkip.js +13 -0
- package/lib/variants/LongformGallery/helpers/shouldSkip.js.map +1 -0
- package/lib/variants/LongformGallery/index.js +43 -0
- package/lib/variants/LongformGallery/index.js.map +1 -0
- package/lib/variants/LongformGallery/useLongformGallery.js +58 -0
- package/lib/variants/LongformGallery/useLongformGallery.js.map +1 -0
- package/lib/variants/LongformRow/index.js +29 -0
- package/lib/variants/LongformRow/index.js.map +1 -0
- package/lib/variants/ParallaxImageTextRight/index.js +30 -0
- package/lib/variants/ParallaxImageTextRight/index.js.map +1 -0
- package/lib/variants/ThumbnailCarousel/index.js +15 -3
- package/lib/variants/ThumbnailCarousel/index.js.map +1 -1
- package/lib/variants/index.js +10 -0
- package/lib/variants/index.js.map +1 -1
- package/lib-es/components/ContentGroup/ContentGroupTabs.js +10 -8
- package/lib-es/components/ContentGroup/ContentGroupTabs.js.map +1 -1
- package/lib-es/components/Video/providers/Default.js +14 -7
- package/lib-es/components/Video/providers/Default.js.map +1 -1
- package/lib-es/components/Video/providers/get-provider.js +2 -1
- package/lib-es/components/Video/providers/get-provider.js.map +1 -1
- package/lib-es/hooks/helpers/getVariant.js.map +1 -1
- package/lib-es/utils/variant-handler.js +2 -1
- package/lib-es/utils/variant-handler.js.map +1 -1
- package/lib-es/variants/HeroImage/index.js +10 -0
- package/lib-es/variants/HeroImage/index.js.map +1 -0
- package/lib-es/variants/Infographic/Infographic.js +20 -0
- package/lib-es/variants/Infographic/Infographic.js.map +1 -0
- package/lib-es/variants/Infographic/index.js +10 -0
- package/lib-es/variants/Infographic/index.js.map +1 -0
- package/lib-es/variants/Infographic/useInfographic.js +23 -0
- package/lib-es/variants/Infographic/useInfographic.js.map +1 -0
- package/lib-es/variants/LongformGallery/LongformGallery.js +40 -0
- package/lib-es/variants/LongformGallery/LongformGallery.js.map +1 -0
- package/lib-es/variants/LongformGallery/LongformGalleryImage.js +59 -0
- package/lib-es/variants/LongformGallery/LongformGalleryImage.js.map +1 -0
- package/lib-es/variants/LongformGallery/constants.js +18 -0
- package/lib-es/variants/LongformGallery/constants.js.map +1 -0
- package/lib-es/variants/LongformGallery/helpers/index.js +5 -0
- package/lib-es/variants/LongformGallery/helpers/index.js.map +1 -0
- package/lib-es/variants/LongformGallery/helpers/parseImageData.js +26 -0
- package/lib-es/variants/LongformGallery/helpers/parseImageData.js.map +1 -0
- package/lib-es/variants/LongformGallery/helpers/separateImages.js +25 -0
- package/lib-es/variants/LongformGallery/helpers/separateImages.js.map +1 -0
- package/lib-es/variants/LongformGallery/helpers/shouldSkip.js +3 -0
- package/lib-es/variants/LongformGallery/helpers/shouldSkip.js.map +1 -0
- package/lib-es/variants/LongformGallery/index.js +12 -0
- package/lib-es/variants/LongformGallery/index.js.map +1 -0
- package/lib-es/variants/LongformGallery/useLongformGallery.js +47 -0
- package/lib-es/variants/LongformGallery/useLongformGallery.js.map +1 -0
- package/lib-es/variants/LongformRow/index.js +10 -0
- package/lib-es/variants/LongformRow/index.js.map +1 -0
- package/lib-es/variants/ParallaxImageTextRight/index.js +11 -0
- package/lib-es/variants/ParallaxImageTextRight/index.js.map +1 -0
- package/lib-es/variants/ThumbnailCarousel/index.js +2 -2
- package/lib-es/variants/ThumbnailCarousel/index.js.map +1 -1
- package/lib-es/variants/index.js +10 -0
- package/lib-es/variants/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/ContentGroup/ContentGroupTabs.js +11 -8
- package/src/components/Video/providers/Default.js +12 -6
- package/src/components/Video/providers/get-provider.js +2 -1
- package/src/hooks/helpers/getVariant.js +1 -0
- package/src/utils/variant-handler.js +2 -1
- package/src/variants/HeroImage/index.js +8 -0
- package/src/variants/Infographic/Infographic.js +14 -0
- package/src/variants/Infographic/index.js +12 -0
- package/src/variants/Infographic/useInfographic.js +18 -0
- package/src/variants/LongformGallery/LongformGallery.js +47 -0
- package/src/variants/LongformGallery/LongformGalleryImage.js +65 -0
- package/src/variants/LongformGallery/constants.js +21 -0
- package/src/variants/LongformGallery/helpers/index.js +5 -0
- package/src/variants/LongformGallery/helpers/parseImageData.js +25 -0
- package/src/variants/LongformGallery/helpers/separateImages.js +38 -0
- package/src/variants/LongformGallery/helpers/shouldSkip.js +3 -0
- package/src/variants/LongformGallery/index.js +13 -0
- package/src/variants/LongformGallery/useLongformGallery.js +41 -0
- package/src/variants/LongformRow/index.js +8 -0
- package/src/variants/ParallaxImageTextRight/index.js +9 -0
- package/src/variants/ThumbnailCarousel/index.js +4 -2
- package/src/variants/index.js +10 -0
- package/tests/unit/src/components/ContentGroup/__snapshots__/ContentGroupTabs.test.js.snap +2 -0
- package/tests/unit/src/components/Video/providers/__snapshots__/Default.test.js.snap +111 -108
- package/tests/unit/src/utils/variant-handler.test.js +9 -4
- package/tests/unit/src/variants/LongFormGallery/LongformGallery.test.js +42 -0
- package/tests/unit/src/variants/LongFormGallery/LongformGalleryImage.test.js +44 -0
- package/tests/unit/src/variants/LongFormGallery/__snapshots__/LongformGallery.test.js.snap +99 -0
- package/tests/unit/src/variants/LongFormGallery/__snapshots__/LongformGalleryImage.test.js.snap +51 -0
- package/tests/unit/src/variants/LongFormGallery/constants.js +37 -0
- package/tests/unit/src/variants/LongFormGallery/helpers/parseImageData.test.js +53 -0
- package/tests/unit/src/variants/LongFormGallery/helpers/separateImages.test.js +52 -0
- package/tests/unit/src/variants/LongFormGallery/helpers/shouldSkip.test.js +23 -0
- package/tests/unit/src/variants/LongFormGallery/useLongformGallery.test.js +36 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-provider.js","names":["dynamic","SUPPORTED_PROVIDERS","youtube","JWPlayer","vimeo","default","getProvider","provider"],"sources":["../../../../src/components/Video/providers/get-provider.js"],"sourcesContent":["import dynamic from 'next/dynamic';\n\nconst SUPPORTED_PROVIDERS = {\n youtube: dynamic(() =>\n import(/* webpackChunkName: \"blazePbVideoYouTube\" */ './YouTube/YouTubeProvider')\n ),\n JWPlayer: dynamic(() =>\n import(/* webpackChunkName: \"blazePbVideoJWPlayer\" */ './JWPlayer/JWPlayerProvider')\n ),\n vimeo: dynamic(() => import(/* webpackChunkName: \"blazePbVideoVimeo\" */ './Vimeo/VimeoProvider')),\n default: dynamic(() => import(/* webpackChunkName: \"blazePbVideoDefault\" */ './Default'))\n};\n\nfunction getProvider(provider) {\n return SUPPORTED_PROVIDERS[provider] || SUPPORTED_PROVIDERS.default;\n}\n\nexport default getProvider;\n"],"mappings":"AAAA,OAAOA,OAAO,MAAM,cAAc;AAElC,MAAMC,mBAAmB,GAAG;EAC1BC,OAAO,EAAEF,OAAO,CAAC,MACf,MAAM,EAAC,6CAA8C,2BAA2B,CAClF,CAAC;EACDG,QAAQ,EAAEH,OAAO,CAAC,MAChB,MAAM,EAAC,8CAA+C,6BAA6B,CACrF,CAAC;EACDI,KAAK,EAAEJ,OAAO,CAAC,MAAM,MAAM,EAAC,2CAA4C,uBAAuB,CAAC,CAAC;EACjGK,OAAO,EAAEL,OAAO,CAAC,MAAM,MAAM,EAAC,6CAA8C,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"get-provider.js","names":["dynamic","SUPPORTED_PROVIDERS","youtube","JWPlayer","vimeo","default","html","getProvider","provider"],"sources":["../../../../src/components/Video/providers/get-provider.js"],"sourcesContent":["import dynamic from 'next/dynamic';\n\nconst SUPPORTED_PROVIDERS = {\n youtube: dynamic(() =>\n import(/* webpackChunkName: \"blazePbVideoYouTube\" */ './YouTube/YouTubeProvider')\n ),\n JWPlayer: dynamic(() =>\n import(/* webpackChunkName: \"blazePbVideoJWPlayer\" */ './JWPlayer/JWPlayerProvider')\n ),\n vimeo: dynamic(() => import(/* webpackChunkName: \"blazePbVideoVimeo\" */ './Vimeo/VimeoProvider')),\n default: dynamic(() => import(/* webpackChunkName: \"blazePbVideoDefault\" */ './Default')),\n html: dynamic(() => import(/* webpackChunkName: \"blazePbVideoDefault\" */ './Default'))\n};\n\nfunction getProvider(provider) {\n return SUPPORTED_PROVIDERS[provider] || SUPPORTED_PROVIDERS.default;\n}\n\nexport default getProvider;\n"],"mappings":"AAAA,OAAOA,OAAO,MAAM,cAAc;AAElC,MAAMC,mBAAmB,GAAG;EAC1BC,OAAO,EAAEF,OAAO,CAAC,MACf,MAAM,EAAC,6CAA8C,2BAA2B,CAClF,CAAC;EACDG,QAAQ,EAAEH,OAAO,CAAC,MAChB,MAAM,EAAC,8CAA+C,6BAA6B,CACrF,CAAC;EACDI,KAAK,EAAEJ,OAAO,CAAC,MAAM,MAAM,EAAC,2CAA4C,uBAAuB,CAAC,CAAC;EACjGK,OAAO,EAAEL,OAAO,CAAC,MAAM,MAAM,EAAC,6CAA8C,WAAW,CAAC,CAAC;EACzFM,IAAI,EAAEN,OAAO,CAAC,MAAM,MAAM,EAAC,6CAA8C,WAAW,CAAC;AACvF,CAAC;AAED,SAASO,WAAWA,CAACC,QAAQ,EAAE;EAC7B,OAAOP,mBAAmB,CAACO,QAAQ,CAAC,IAAIP,mBAAmB,CAACI,OAAO;AACrE;AAEA,eAAeE,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVariant.js","names":["variantHandler","getVariant","settings","variant","VariantComponent","getSettings","get","variantSettings"],"sources":["../../../src/hooks/helpers/getVariant.js"],"sourcesContent":["import { variantHandler } from '../../utils';\n\nexport default function getVariant(settings) {\n const { variant } = settings;\n if (!variant) return [null, {}];\n const { VariantComponent, getSettings } = variantHandler.get(variant) || {};\n const variantSettings =\n !!getSettings && typeof getSettings === 'function' ? getSettings(settings) : settings;\n\n return [VariantComponent, variantSettings];\n}\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,aAAa;AAE5C,eAAe,SAASC,UAAUA,CAACC,QAAQ,EAAE;EAC3C,MAAM;IAAEC;EAAQ,CAAC,GAAGD,QAAQ;EAC5B,IAAI,CAACC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"getVariant.js","names":["variantHandler","getVariant","settings","variant","VariantComponent","getSettings","get","variantSettings"],"sources":["../../../src/hooks/helpers/getVariant.js"],"sourcesContent":["import { variantHandler } from '../../utils';\n\nexport default function getVariant(settings) {\n const { variant } = settings;\n if (!variant) return [null, {}];\n\n const { VariantComponent, getSettings } = variantHandler.get(variant) || {};\n const variantSettings =\n !!getSettings && typeof getSettings === 'function' ? getSettings(settings) : settings;\n\n return [VariantComponent, variantSettings];\n}\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,aAAa;AAE5C,eAAe,SAASC,UAAUA,CAACC,QAAQ,EAAE;EAC3C,MAAM;IAAEC;EAAQ,CAAC,GAAGD,QAAQ;EAC5B,IAAI,CAACC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;EAE/B,MAAM;IAAEC,gBAAgB;IAAEC;EAAY,CAAC,GAAGL,cAAc,CAACM,GAAG,CAACH,OAAO,CAAC,IAAI,CAAC,CAAC;EAC3E,MAAMI,eAAe,GACnB,CAAC,CAACF,WAAW,IAAI,OAAOA,WAAW,KAAK,UAAU,GAAGA,WAAW,CAACH,QAAQ,CAAC,GAAGA,QAAQ;EAEvF,OAAO,CAACE,gBAAgB,EAAEG,eAAe,CAAC;AAC5C"}
|
|
@@ -13,7 +13,8 @@ function variantMapHandler() {
|
|
|
13
13
|
}
|
|
14
14
|
function validate(key, variant) {
|
|
15
15
|
if (!key || !variant) throw new BlazeError('Variant requires key and component');
|
|
16
|
-
|
|
16
|
+
// eslint-disable-next-line no-console
|
|
17
|
+
if (variants.has(key) && key !== 'array') console.warn(`Variant already exists: ${key}`); // todo: restore error // throw new BlazeError(`Variant already exists: ${key}`);
|
|
17
18
|
}
|
|
18
19
|
return {
|
|
19
20
|
add,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variant-handler.js","names":["BlazeError","variantMapHandler","variants","Map","get","key","getAll","Array","from","entries","add","variant","validate","set","has","variantHandler"],"sources":["../../src/utils/variant-handler.js"],"sourcesContent":["import { BlazeError } from '@blaze-cms/core-errors';\n\nfunction variantMapHandler() {\n const variants = new Map();\n\n function get(key) {\n return variants.get(key);\n }\n\n function getAll() {\n return Array.from(variants.entries());\n }\n\n function add(key, variant) {\n validate(key, variant);\n variants.set(key, variant);\n }\n\n function validate(key, variant) {\n if (!key || !variant) throw new BlazeError('Variant requires key and component');\n if (variants.has(key) && key !== 'array') throw new BlazeError(`Variant already exists`);\n }\n\n return {\n add,\n get,\n getAll\n };\n}\n\nconst variantHandler = variantMapHandler();\n\nexport default variantHandler;\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,iBAAiBA,CAAA,EAAG;EAC3B,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAAC,CAAC;EAE1B,SAASC,GAAGA,CAACC,GAAG,EAAE;IAChB,OAAOH,QAAQ,CAACE,GAAG,CAACC,GAAG,CAAC;EAC1B;EAEA,SAASC,MAAMA,CAAA,EAAG;IAChB,OAAOC,KAAK,CAACC,IAAI,CAACN,QAAQ,CAACO,OAAO,CAAC,CAAC,CAAC;EACvC;EAEA,SAASC,GAAGA,CAACL,GAAG,EAAEM,OAAO,EAAE;IACzBC,QAAQ,CAACP,GAAG,EAAEM,OAAO,CAAC;IACtBT,QAAQ,CAACW,GAAG,CAACR,GAAG,EAAEM,OAAO,CAAC;EAC5B;EAEA,SAASC,QAAQA,CAACP,GAAG,EAAEM,OAAO,EAAE;IAC9B,IAAI,CAACN,GAAG,IAAI,CAACM,OAAO,EAAE,MAAM,IAAIX,UAAU,CAAC,oCAAoC,CAAC;IAChF,IAAIE,QAAQ,CAACY,GAAG,CAACT,GAAG,CAAC,IAAIA,GAAG,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"variant-handler.js","names":["BlazeError","variantMapHandler","variants","Map","get","key","getAll","Array","from","entries","add","variant","validate","set","has","console","warn","variantHandler"],"sources":["../../src/utils/variant-handler.js"],"sourcesContent":["import { BlazeError } from '@blaze-cms/core-errors';\n\nfunction variantMapHandler() {\n const variants = new Map();\n\n function get(key) {\n return variants.get(key);\n }\n\n function getAll() {\n return Array.from(variants.entries());\n }\n\n function add(key, variant) {\n validate(key, variant);\n variants.set(key, variant);\n }\n\n function validate(key, variant) {\n if (!key || !variant) throw new BlazeError('Variant requires key and component');\n // eslint-disable-next-line no-console\n if (variants.has(key) && key !== 'array') console.warn(`Variant already exists: ${key}`); // todo: restore error // throw new BlazeError(`Variant already exists: ${key}`);\n }\n\n return {\n add,\n get,\n getAll\n };\n}\n\nconst variantHandler = variantMapHandler();\n\nexport default variantHandler;\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,iBAAiBA,CAAA,EAAG;EAC3B,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAAC,CAAC;EAE1B,SAASC,GAAGA,CAACC,GAAG,EAAE;IAChB,OAAOH,QAAQ,CAACE,GAAG,CAACC,GAAG,CAAC;EAC1B;EAEA,SAASC,MAAMA,CAAA,EAAG;IAChB,OAAOC,KAAK,CAACC,IAAI,CAACN,QAAQ,CAACO,OAAO,CAAC,CAAC,CAAC;EACvC;EAEA,SAASC,GAAGA,CAACL,GAAG,EAAEM,OAAO,EAAE;IACzBC,QAAQ,CAACP,GAAG,EAAEM,OAAO,CAAC;IACtBT,QAAQ,CAACW,GAAG,CAACR,GAAG,EAAEM,OAAO,CAAC;EAC5B;EAEA,SAASC,QAAQA,CAACP,GAAG,EAAEM,OAAO,EAAE;IAC9B,IAAI,CAACN,GAAG,IAAI,CAACM,OAAO,EAAE,MAAM,IAAIX,UAAU,CAAC,oCAAoC,CAAC;IAChF;IACA,IAAIE,QAAQ,CAACY,GAAG,CAACT,GAAG,CAAC,IAAIA,GAAG,KAAK,OAAO,EAAEU,OAAO,CAACC,IAAI,CAAE,2BAA0BX,GAAI,EAAC,CAAC,CAAC,CAAC;EAC5F;EAEA,OAAO;IACLK,GAAG;IACHN,GAAG;IACHE;EACF,CAAC;AACH;AAEA,MAAMW,cAAc,GAAGhB,iBAAiB,CAAC,CAAC;AAE1C,eAAegB,cAAc"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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
|
+
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
|
+
const HeroImage = {
|
|
5
|
+
getSettings: componentSettings => _objectSpread(_objectSpread({}, componentSettings), {}, {
|
|
6
|
+
modifier: 'hero-image'
|
|
7
|
+
})
|
|
8
|
+
};
|
|
9
|
+
export default HeroImage;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["HeroImage","getSettings","componentSettings","_objectSpread","modifier"],"sources":["../../../src/variants/HeroImage/index.js"],"sourcesContent":["const HeroImage = {\n getSettings: componentSettings => ({\n ...componentSettings,\n modifier: 'hero-image'\n })\n};\n\nexport default HeroImage;\n"],"mappings":";;;AAAA,MAAMA,SAAS,GAAG;EAChBC,WAAW,EAAEC,iBAAiB,IAAAC,aAAA,CAAAA,aAAA,KACzBD,iBAAiB;IACpBE,QAAQ,EAAE;EAAY;AAE1B,CAAC;AAED,eAAeJ,SAAS"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import useInfographic from './useInfographic';
|
|
3
|
+
const Infographic = props => {
|
|
4
|
+
const {
|
|
5
|
+
contentRef,
|
|
6
|
+
id,
|
|
7
|
+
className,
|
|
8
|
+
tabId,
|
|
9
|
+
children
|
|
10
|
+
} = useInfographic(props);
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
ref: contentRef,
|
|
13
|
+
id: id,
|
|
14
|
+
className: className,
|
|
15
|
+
role: "tabpanel",
|
|
16
|
+
"aria-labelledby": tabId
|
|
17
|
+
}, children);
|
|
18
|
+
};
|
|
19
|
+
export default Infographic;
|
|
20
|
+
//# sourceMappingURL=Infographic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Infographic.js","names":["React","useInfographic","Infographic","props","contentRef","id","className","tabId","children","createElement","ref","role"],"sources":["../../../src/variants/Infographic/Infographic.js"],"sourcesContent":["import React from 'react';\nimport useInfographic from './useInfographic';\n\nconst Infographic = props => {\n const { contentRef, id, className, tabId, children } = useInfographic(props);\n\n return (\n <div ref={contentRef} id={id} className={className} role=\"tabpanel\" aria-labelledby={tabId}>\n {children}\n </div>\n );\n};\n\nexport default Infographic;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,cAAc,MAAM,kBAAkB;AAE7C,MAAMC,WAAW,GAAGC,KAAK,IAAI;EAC3B,MAAM;IAAEC,UAAU;IAAEC,EAAE;IAAEC,SAAS;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGP,cAAc,CAACE,KAAK,CAAC;EAE5E,oBACEH,KAAA,CAAAS,aAAA;IAAKC,GAAG,EAAEN,UAAW;IAACC,EAAE,EAAEA,EAAG;IAACC,SAAS,EAAEA,SAAU;IAACK,IAAI,EAAC,UAAU;IAAC,mBAAiBJ;EAAM,GACxFC,QACE,CAAC;AAEV,CAAC;AAED,eAAeN,WAAW"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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
|
+
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
|
+
import dynamic from 'next/dynamic';
|
|
5
|
+
const Infographic = {
|
|
6
|
+
getSettings: componentSettings => _objectSpread({}, componentSettings),
|
|
7
|
+
VariantComponent: dynamic(() => import( /* webpackChunkName: "blazePbVariantInfographic" */'./Infographic'))
|
|
8
|
+
};
|
|
9
|
+
export default Infographic;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["dynamic","Infographic","getSettings","componentSettings","_objectSpread","VariantComponent"],"sources":["../../../src/variants/Infographic/index.js"],"sourcesContent":["import dynamic from 'next/dynamic';\n\nconst Infographic = {\n getSettings: componentSettings => ({\n ...componentSettings\n }),\n VariantComponent: dynamic(() =>\n import(/* webpackChunkName: \"blazePbVariantInfographic\" */ './Infographic')\n )\n};\n\nexport default Infographic;\n"],"mappings":";;;AAAA,OAAOA,OAAO,MAAM,cAAc;AAElC,MAAMC,WAAW,GAAG;EAClBC,WAAW,EAAEC,iBAAiB,IAAAC,aAAA,KACzBD,iBAAiB,CACpB;EACFE,gBAAgB,EAAEL,OAAO,CAAC,MACxB,MAAM,EAAC,mDAAoD,eAAe,CAC5E;AACF,CAAC;AAED,eAAeC,WAAW"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
const _excluded = ["className"];
|
|
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
|
+
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
|
+
import { useInView } from '@blaze-react/utils/lib/customHooks';
|
|
7
|
+
const useInfographic = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
className: _className
|
|
10
|
+
} = _ref,
|
|
11
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
+
const [isIntersecting, contentRef] = useInView({
|
|
13
|
+
once: true,
|
|
14
|
+
offset: '200px'
|
|
15
|
+
});
|
|
16
|
+
const className = `${_className} infographic${isIntersecting ? ' infographic__active' : ''}`;
|
|
17
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
|
18
|
+
className,
|
|
19
|
+
contentRef
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
export default useInfographic;
|
|
23
|
+
//# sourceMappingURL=useInfographic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInfographic.js","names":["useInView","useInfographic","_ref","className","_className","props","_objectWithoutProperties","_excluded","isIntersecting","contentRef","once","offset","_objectSpread"],"sources":["../../../src/variants/Infographic/useInfographic.js"],"sourcesContent":["import { useInView } from '@blaze-react/utils/lib/customHooks';\n\nconst useInfographic = ({ className: _className, ...props }) => {\n const [isIntersecting, contentRef] = useInView({\n once: true,\n offset: '200px'\n });\n\n const className = `${_className} infographic${isIntersecting ? ' infographic__active' : ''}`;\n\n return {\n ...props,\n className,\n contentRef\n };\n};\n\nexport default useInfographic;\n"],"mappings":";;;;;AAAA,SAASA,SAAS,QAAQ,oCAAoC;AAE9D,MAAMC,cAAc,GAAGC,IAAA,IAAyC;EAAA,IAAxC;MAAEC,SAAS,EAAEC;IAAqB,CAAC,GAAAF,IAAA;IAAPG,KAAK,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA;EACvD,MAAM,CAACC,cAAc,EAAEC,UAAU,CAAC,GAAGT,SAAS,CAAC;IAC7CU,IAAI,EAAE,IAAI;IACVC,MAAM,EAAE;EACV,CAAC,CAAC;EAEF,MAAMR,SAAS,GAAI,GAAEC,UAAW,eAAcI,cAAc,GAAG,sBAAsB,GAAG,EAAG,EAAC;EAE5F,OAAAI,aAAA,CAAAA,aAAA,KACKP,KAAK;IACRF,SAAS;IACTM;EAAU;AAEd,CAAC;AAED,eAAeR,cAAc"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { withTitle } from '../../HOC';
|
|
4
|
+
import useLongformGallery from './useLongformGallery';
|
|
5
|
+
import LongformGalleryImage from './LongformGalleryImage';
|
|
6
|
+
const LongformGallery = props => {
|
|
7
|
+
const {
|
|
8
|
+
loading,
|
|
9
|
+
error,
|
|
10
|
+
groupedImages,
|
|
11
|
+
shouldDisplayCaption,
|
|
12
|
+
caption,
|
|
13
|
+
handleImageOnClick
|
|
14
|
+
} = useLongformGallery(props);
|
|
15
|
+
if (loading || error || !groupedImages.length) return null;
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: "longform-gallery",
|
|
18
|
+
"data-testid": "longform-gallery"
|
|
19
|
+
}, groupedImages.map((imageGroup, i) =>
|
|
20
|
+
/*#__PURE__*/
|
|
21
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
22
|
+
React.createElement("div", {
|
|
23
|
+
key: i,
|
|
24
|
+
"data-testid": "grouped-images",
|
|
25
|
+
className: "longform-gallery__images"
|
|
26
|
+
}, imageGroup.map(secondaryImage => /*#__PURE__*/React.createElement(LongformGalleryImage, _extends({
|
|
27
|
+
key: secondaryImage.id
|
|
28
|
+
}, secondaryImage, {
|
|
29
|
+
numberOfImages: imageGroup.length,
|
|
30
|
+
className: imageGroup.length > 2 ? 'longform-gallery__images__image secondary-image' : 'longform-gallery__images__image main-image',
|
|
31
|
+
handleImageOnClick: handleImageOnClick
|
|
32
|
+
}))))), shouldDisplayCaption && /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: "carousel__details",
|
|
34
|
+
"data-testid": "carousel-details"
|
|
35
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: "caption"
|
|
37
|
+
}, caption)));
|
|
38
|
+
};
|
|
39
|
+
export default withTitle(LongformGallery);
|
|
40
|
+
//# sourceMappingURL=LongformGallery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LongformGallery.js","names":["React","withTitle","useLongformGallery","LongformGalleryImage","LongformGallery","props","loading","error","groupedImages","shouldDisplayCaption","caption","handleImageOnClick","length","createElement","className","map","imageGroup","i","key","secondaryImage","_extends","id","numberOfImages"],"sources":["../../../src/variants/LongformGallery/LongformGallery.js"],"sourcesContent":["import React from 'react';\nimport { withTitle } from '../../HOC';\nimport useLongformGallery from './useLongformGallery';\nimport LongformGalleryImage from './LongformGalleryImage';\n\nconst LongformGallery = props => {\n const {\n loading,\n error,\n groupedImages,\n shouldDisplayCaption,\n caption,\n handleImageOnClick\n } = useLongformGallery(props);\n\n if (loading || error || !groupedImages.length) return null;\n\n return (\n <div className=\"longform-gallery\" data-testid=\"longform-gallery\">\n {groupedImages.map((imageGroup, i) => (\n // eslint-disable-next-line react/no-array-index-key\n <div key={i} data-testid=\"grouped-images\" className=\"longform-gallery__images\">\n {imageGroup.map(secondaryImage => (\n <LongformGalleryImage\n key={secondaryImage.id}\n {...secondaryImage}\n numberOfImages={imageGroup.length}\n className={\n imageGroup.length > 2\n ? 'longform-gallery__images__image secondary-image'\n : 'longform-gallery__images__image main-image'\n }\n handleImageOnClick={handleImageOnClick}\n />\n ))}\n </div>\n ))}\n {shouldDisplayCaption && (\n <div className=\"carousel__details\" data-testid=\"carousel-details\">\n <div className=\"caption\">{caption}</div>\n </div>\n )}\n </div>\n );\n};\n\nexport default withTitle(LongformGallery);\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,QAAQ,WAAW;AACrC,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,OAAOC,oBAAoB,MAAM,wBAAwB;AAEzD,MAAMC,eAAe,GAAGC,KAAK,IAAI;EAC/B,MAAM;IACJC,OAAO;IACPC,KAAK;IACLC,aAAa;IACbC,oBAAoB;IACpBC,OAAO;IACPC;EACF,CAAC,GAAGT,kBAAkB,CAACG,KAAK,CAAC;EAE7B,IAAIC,OAAO,IAAIC,KAAK,IAAI,CAACC,aAAa,CAACI,MAAM,EAAE,OAAO,IAAI;EAE1D,oBACEZ,KAAA,CAAAa,aAAA;IAAKC,SAAS,EAAC,kBAAkB;IAAC,eAAY;EAAkB,GAC7DN,aAAa,CAACO,GAAG,CAAC,CAACC,UAAU,EAAEC,CAAC;EAAA;EAC/B;EACAjB,KAAA,CAAAa,aAAA;IAAKK,GAAG,EAAED,CAAE;IAAC,eAAY,gBAAgB;IAACH,SAAS,EAAC;EAA0B,GAC3EE,UAAU,CAACD,GAAG,CAACI,cAAc,iBAC5BnB,KAAA,CAAAa,aAAA,CAACV,oBAAoB,EAAAiB,QAAA;IACnBF,GAAG,EAAEC,cAAc,CAACE;EAAG,GACnBF,cAAc;IAClBG,cAAc,EAAEN,UAAU,CAACJ,MAAO;IAClCE,SAAS,EACPE,UAAU,CAACJ,MAAM,GAAG,CAAC,GACjB,iDAAiD,GACjD,4CACL;IACDD,kBAAkB,EAAEA;EAAmB,EACxC,CACF,CACE,CACN,CAAC,EACDF,oBAAoB,iBACnBT,KAAA,CAAAa,aAAA;IAAKC,SAAS,EAAC,mBAAmB;IAAC,eAAY;EAAkB,gBAC/Dd,KAAA,CAAAa,aAAA;IAAKC,SAAS,EAAC;EAAS,GAAEJ,OAAa,CACpC,CAEJ,CAAC;AAEV,CAAC;AAED,eAAeT,SAAS,CAACG,eAAe,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
const _excluded = ["id", "url", "caption", "altText", "priority", "className", "numberOfImages", "handleImageOnClick"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import Head from 'next/head';
|
|
7
|
+
import { useInView } from '@blaze-react/utils/lib/customHooks';
|
|
8
|
+
import { ResponsiveImage } from '@blaze-cms/image-cdn-react';
|
|
9
|
+
import { IN_VIEW_CONFIG } from './constants';
|
|
10
|
+
const LongformGalleryImage = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
id,
|
|
13
|
+
url,
|
|
14
|
+
caption,
|
|
15
|
+
altText,
|
|
16
|
+
priority,
|
|
17
|
+
className,
|
|
18
|
+
numberOfImages,
|
|
19
|
+
handleImageOnClick
|
|
20
|
+
} = _ref,
|
|
21
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
const [isIntersecting, outerRef] = useInView(IN_VIEW_CONFIG);
|
|
23
|
+
const shouldRender = priority || isIntersecting;
|
|
24
|
+
const HeadComponent = priority ? Head : null;
|
|
25
|
+
const sizeKey = `carousel:longform:${numberOfImages}`;
|
|
26
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
ref: outerRef,
|
|
28
|
+
className: `${className}`
|
|
29
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
role: "button",
|
|
31
|
+
className: "longform-gallery__images__image__container",
|
|
32
|
+
"data-testid": "longform-gallery__images__image__container",
|
|
33
|
+
onClick: () => handleImageOnClick(id)
|
|
34
|
+
}, shouldRender && /*#__PURE__*/React.createElement(ResponsiveImage, _extends({
|
|
35
|
+
sizeKey: sizeKey,
|
|
36
|
+
role: "button",
|
|
37
|
+
src: url,
|
|
38
|
+
alt: altText,
|
|
39
|
+
priority: priority,
|
|
40
|
+
HeadComponent: HeadComponent
|
|
41
|
+
}, props))), !!caption && /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: "longform-gallery__images__image__details",
|
|
43
|
+
"data-testid": "longform-gallery__images__image__details"
|
|
44
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: "longform-gallery__images__image__details__caption"
|
|
46
|
+
}, caption)));
|
|
47
|
+
};
|
|
48
|
+
LongformGalleryImage.propTypes = {
|
|
49
|
+
id: PropTypes.string.isRequired,
|
|
50
|
+
url: PropTypes.string.isRequired,
|
|
51
|
+
caption: PropTypes.string.isRequired,
|
|
52
|
+
numberOfImages: PropTypes.number.isRequired,
|
|
53
|
+
altText: PropTypes.string.isRequired,
|
|
54
|
+
priority: PropTypes.bool.isRequired,
|
|
55
|
+
className: PropTypes.string.isRequired,
|
|
56
|
+
handleImageOnClick: PropTypes.func.isRequired
|
|
57
|
+
};
|
|
58
|
+
export default LongformGalleryImage;
|
|
59
|
+
//# sourceMappingURL=LongformGalleryImage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LongformGalleryImage.js","names":["React","PropTypes","Head","useInView","ResponsiveImage","IN_VIEW_CONFIG","LongformGalleryImage","_ref","id","url","caption","altText","priority","className","numberOfImages","handleImageOnClick","props","_objectWithoutProperties","_excluded","isIntersecting","outerRef","shouldRender","HeadComponent","sizeKey","createElement","ref","role","onClick","_extends","src","alt","propTypes","string","isRequired","number","bool","func"],"sources":["../../../src/variants/LongformGallery/LongformGalleryImage.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Head from 'next/head';\nimport { useInView } from '@blaze-react/utils/lib/customHooks';\nimport { ResponsiveImage } from '@blaze-cms/image-cdn-react';\nimport { IN_VIEW_CONFIG } from './constants';\n\nconst LongformGalleryImage = ({\n id,\n url,\n caption,\n altText,\n priority,\n className,\n numberOfImages,\n handleImageOnClick,\n ...props\n}) => {\n const [isIntersecting, outerRef] = useInView(IN_VIEW_CONFIG);\n const shouldRender = priority || isIntersecting;\n const HeadComponent = priority ? Head : null;\n const sizeKey = `carousel:longform:${numberOfImages}`;\n\n return (\n <div ref={outerRef} className={`${className}`}>\n <div\n role=\"button\"\n className=\"longform-gallery__images__image__container\"\n data-testid=\"longform-gallery__images__image__container\"\n onClick={() => handleImageOnClick(id)}>\n {shouldRender && (\n <ResponsiveImage\n sizeKey={sizeKey}\n role=\"button\"\n src={url}\n alt={altText}\n priority={priority}\n HeadComponent={HeadComponent}\n {...props}\n />\n )}\n </div>\n {!!caption && (\n <div\n className=\"longform-gallery__images__image__details\"\n data-testid=\"longform-gallery__images__image__details\">\n <div className=\"longform-gallery__images__image__details__caption\">{caption}</div>\n </div>\n )}\n </div>\n );\n};\n\nLongformGalleryImage.propTypes = {\n id: PropTypes.string.isRequired,\n url: PropTypes.string.isRequired,\n caption: PropTypes.string.isRequired,\n numberOfImages: PropTypes.number.isRequired,\n altText: PropTypes.string.isRequired,\n priority: PropTypes.bool.isRequired,\n className: PropTypes.string.isRequired,\n handleImageOnClick: PropTypes.func.isRequired\n};\n\nexport default LongformGalleryImage;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,WAAW;AAC5B,SAASC,SAAS,QAAQ,oCAAoC;AAC9D,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,cAAc,QAAQ,aAAa;AAE5C,MAAMC,oBAAoB,GAAGC,IAAA,IAUvB;EAAA,IAVwB;MAC5BC,EAAE;MACFC,GAAG;MACHC,OAAO;MACPC,OAAO;MACPC,QAAQ;MACRC,SAAS;MACTC,cAAc;MACdC;IAEF,CAAC,GAAAR,IAAA;IADIS,KAAK,GAAAC,wBAAA,CAAAV,IAAA,EAAAW,SAAA;EAER,MAAM,CAACC,cAAc,EAAEC,QAAQ,CAAC,GAAGjB,SAAS,CAACE,cAAc,CAAC;EAC5D,MAAMgB,YAAY,GAAGT,QAAQ,IAAIO,cAAc;EAC/C,MAAMG,aAAa,GAAGV,QAAQ,GAAGV,IAAI,GAAG,IAAI;EAC5C,MAAMqB,OAAO,GAAI,qBAAoBT,cAAe,EAAC;EAErD,oBACEd,KAAA,CAAAwB,aAAA;IAAKC,GAAG,EAAEL,QAAS;IAACP,SAAS,EAAG,GAAEA,SAAU;EAAE,gBAC5Cb,KAAA,CAAAwB,aAAA;IACEE,IAAI,EAAC,QAAQ;IACbb,SAAS,EAAC,4CAA4C;IACtD,eAAY,4CAA4C;IACxDc,OAAO,EAAEA,CAAA,KAAMZ,kBAAkB,CAACP,EAAE;EAAE,GACrCa,YAAY,iBACXrB,KAAA,CAAAwB,aAAA,CAACpB,eAAe,EAAAwB,QAAA;IACdL,OAAO,EAAEA,OAAQ;IACjBG,IAAI,EAAC,QAAQ;IACbG,GAAG,EAAEpB,GAAI;IACTqB,GAAG,EAAEnB,OAAQ;IACbC,QAAQ,EAAEA,QAAS;IACnBU,aAAa,EAAEA;EAAc,GACzBN,KAAK,CACV,CAEA,CAAC,EACL,CAAC,CAACN,OAAO,iBACRV,KAAA,CAAAwB,aAAA;IACEX,SAAS,EAAC,0CAA0C;IACpD,eAAY;EAA0C,gBACtDb,KAAA,CAAAwB,aAAA;IAAKX,SAAS,EAAC;EAAmD,GAAEH,OAAa,CAC9E,CAEJ,CAAC;AAEV,CAAC;AAEDJ,oBAAoB,CAACyB,SAAS,GAAG;EAC/BvB,EAAE,EAAEP,SAAS,CAAC+B,MAAM,CAACC,UAAU;EAC/BxB,GAAG,EAAER,SAAS,CAAC+B,MAAM,CAACC,UAAU;EAChCvB,OAAO,EAAET,SAAS,CAAC+B,MAAM,CAACC,UAAU;EACpCnB,cAAc,EAAEb,SAAS,CAACiC,MAAM,CAACD,UAAU;EAC3CtB,OAAO,EAAEV,SAAS,CAAC+B,MAAM,CAACC,UAAU;EACpCrB,QAAQ,EAAEX,SAAS,CAACkC,IAAI,CAACF,UAAU;EACnCpB,SAAS,EAAEZ,SAAS,CAAC+B,MAAM,CAACC,UAAU;EACtClB,kBAAkB,EAAEd,SAAS,CAACmC,IAAI,CAACH;AACrC,CAAC;AAED,eAAe3B,oBAAoB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
const GET_IMAGES_QUERY = gql`
|
|
3
|
+
query getImages($where: JSON!) {
|
|
4
|
+
getImages: getFiles(where: $where) {
|
|
5
|
+
id
|
|
6
|
+
url
|
|
7
|
+
data
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
11
|
+
const PROPS_TO_CHECK = ['altText', 'caption', 'hrefUrl', 'credits'];
|
|
12
|
+
const IN_VIEW_CONFIG = {
|
|
13
|
+
once: true,
|
|
14
|
+
offset: '200px',
|
|
15
|
+
bottomOffset: '-200px'
|
|
16
|
+
};
|
|
17
|
+
export { GET_IMAGES_QUERY, IN_VIEW_CONFIG, PROPS_TO_CHECK };
|
|
18
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","names":["gql","GET_IMAGES_QUERY","PROPS_TO_CHECK","IN_VIEW_CONFIG","once","offset","bottomOffset"],"sources":["../../../src/variants/LongformGallery/constants.js"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst GET_IMAGES_QUERY = gql`\n query getImages($where: JSON!) {\n getImages: getFiles(where: $where) {\n id\n url\n data\n }\n }\n`;\n\nconst PROPS_TO_CHECK = ['altText', 'caption', 'hrefUrl', 'credits'];\n\nconst IN_VIEW_CONFIG = {\n once: true,\n offset: '200px',\n bottomOffset: '-200px'\n};\n\nexport { GET_IMAGES_QUERY, IN_VIEW_CONFIG, PROPS_TO_CHECK };\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,gBAAgB;AAEpC,MAAMC,gBAAgB,GAAGD,GAAI;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,MAAME,cAAc,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;AAEnE,MAAMC,cAAc,GAAG;EACrBC,IAAI,EAAE,IAAI;EACVC,MAAM,EAAE,OAAO;EACfC,YAAY,EAAE;AAChB,CAAC;AAED,SAASL,gBAAgB,EAAEE,cAAc,EAAED,cAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["parseImageData","separateImages","shouldSkip"],"sources":["../../../../src/variants/LongformGallery/helpers/index.js"],"sourcesContent":["import parseImageData from './parseImageData';\nimport separateImages from './separateImages';\nimport shouldSkip from './shouldSkip';\n\nexport { parseImageData, separateImages, shouldSkip };\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,UAAU,MAAM,cAAc;AAErC,SAASF,cAAc,EAAEC,cAAc,EAAEC,UAAU"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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
|
+
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
|
+
import parseHTML from 'html-react-parser';
|
|
5
|
+
import { PROPS_TO_CHECK } from '../constants';
|
|
6
|
+
const parseImageData = (image, index, priorityLimit, shouldDisplayCaption) => {
|
|
7
|
+
const {
|
|
8
|
+
data = {}
|
|
9
|
+
} = image;
|
|
10
|
+
const parsedData = {};
|
|
11
|
+
PROPS_TO_CHECK.forEach(dataKey => {
|
|
12
|
+
const value = data && data[dataKey];
|
|
13
|
+
if (dataKey === 'caption') {
|
|
14
|
+
parsedData[dataKey] = shouldDisplayCaption && !!value ? parseHTML(value) : '';
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
parsedData[dataKey] = value || '';
|
|
18
|
+
});
|
|
19
|
+
return _objectSpread(_objectSpread({}, parsedData), {}, {
|
|
20
|
+
id: image.id,
|
|
21
|
+
url: image.url,
|
|
22
|
+
priority: index < priorityLimit
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
export default parseImageData;
|
|
26
|
+
//# sourceMappingURL=parseImageData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseImageData.js","names":["parseHTML","PROPS_TO_CHECK","parseImageData","image","index","priorityLimit","shouldDisplayCaption","data","parsedData","forEach","dataKey","value","_objectSpread","id","url","priority"],"sources":["../../../../src/variants/LongformGallery/helpers/parseImageData.js"],"sourcesContent":["import parseHTML from 'html-react-parser';\nimport { PROPS_TO_CHECK } from '../constants';\n\nconst parseImageData = (image, index, priorityLimit, shouldDisplayCaption) => {\n const { data = {} } = image;\n const parsedData = {};\n\n PROPS_TO_CHECK.forEach(dataKey => {\n const value = data && data[dataKey];\n if (dataKey === 'caption') {\n parsedData[dataKey] = shouldDisplayCaption && !!value ? parseHTML(value) : '';\n return;\n }\n parsedData[dataKey] = value || '';\n });\n\n return {\n ...parsedData,\n id: image.id,\n url: image.url,\n priority: index < priorityLimit\n };\n};\n\nexport default parseImageData;\n"],"mappings":";;;AAAA,OAAOA,SAAS,MAAM,mBAAmB;AACzC,SAASC,cAAc,QAAQ,cAAc;AAE7C,MAAMC,cAAc,GAAGA,CAACC,KAAK,EAAEC,KAAK,EAAEC,aAAa,EAAEC,oBAAoB,KAAK;EAC5E,MAAM;IAAEC,IAAI,GAAG,CAAC;EAAE,CAAC,GAAGJ,KAAK;EAC3B,MAAMK,UAAU,GAAG,CAAC,CAAC;EAErBP,cAAc,CAACQ,OAAO,CAACC,OAAO,IAAI;IAChC,MAAMC,KAAK,GAAGJ,IAAI,IAAIA,IAAI,CAACG,OAAO,CAAC;IACnC,IAAIA,OAAO,KAAK,SAAS,EAAE;MACzBF,UAAU,CAACE,OAAO,CAAC,GAAGJ,oBAAoB,IAAI,CAAC,CAACK,KAAK,GAAGX,SAAS,CAACW,KAAK,CAAC,GAAG,EAAE;MAC7E;IACF;IACAH,UAAU,CAACE,OAAO,CAAC,GAAGC,KAAK,IAAI,EAAE;EACnC,CAAC,CAAC;EAEF,OAAAC,aAAA,CAAAA,aAAA,KACKJ,UAAU;IACbK,EAAE,EAAEV,KAAK,CAACU,EAAE;IACZC,GAAG,EAAEX,KAAK,CAACW,GAAG;IACdC,QAAQ,EAAEX,KAAK,GAAGC;EAAa;AAEnC,CAAC;AAED,eAAeH,cAAc"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import parseImageData from './parseImageData';
|
|
2
|
+
const buildImageGroups = (images, priorityLimit, shouldDisplayCaption) => {
|
|
3
|
+
const imageGroups = [];
|
|
4
|
+
let imageGroupIndex = 0;
|
|
5
|
+
const isDivisible = images.length % 3 === 0;
|
|
6
|
+
images.forEach((image, index) => {
|
|
7
|
+
if (!imageGroups[imageGroupIndex]) imageGroups[imageGroupIndex] = [parseImageData(image, index, priorityLimit, shouldDisplayCaption)];else imageGroups[imageGroupIndex].push(parseImageData(image, index, priorityLimit, shouldDisplayCaption));
|
|
8
|
+
if (isDivisible) {
|
|
9
|
+
if (imageGroups[imageGroupIndex].length >= 3) imageGroupIndex += 1;
|
|
10
|
+
} else {
|
|
11
|
+
if (imageGroupIndex === 0 && imageGroups[imageGroupIndex].length >= 2) {
|
|
12
|
+
imageGroupIndex += 1;
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (imageGroups[imageGroupIndex].length >= 3) imageGroupIndex += 1;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return imageGroups;
|
|
19
|
+
};
|
|
20
|
+
const separateImages = (images, priorityLimit, shouldDisplayCaption) => {
|
|
21
|
+
if (!images || !images.length) return [];
|
|
22
|
+
return buildImageGroups(images, priorityLimit, shouldDisplayCaption);
|
|
23
|
+
};
|
|
24
|
+
export default separateImages;
|
|
25
|
+
//# sourceMappingURL=separateImages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separateImages.js","names":["parseImageData","buildImageGroups","images","priorityLimit","shouldDisplayCaption","imageGroups","imageGroupIndex","isDivisible","length","forEach","image","index","push","separateImages"],"sources":["../../../../src/variants/LongformGallery/helpers/separateImages.js"],"sourcesContent":["import parseImageData from './parseImageData';\n\nconst buildImageGroups = (images, priorityLimit, shouldDisplayCaption) => {\n const imageGroups = [];\n let imageGroupIndex = 0;\n const isDivisible = images.length % 3 === 0;\n\n images.forEach((image, index) => {\n if (!imageGroups[imageGroupIndex])\n imageGroups[imageGroupIndex] = [\n parseImageData(image, index, priorityLimit, shouldDisplayCaption)\n ];\n else\n imageGroups[imageGroupIndex].push(\n parseImageData(image, index, priorityLimit, shouldDisplayCaption)\n );\n\n if (isDivisible) {\n if (imageGroups[imageGroupIndex].length >= 3) imageGroupIndex += 1;\n } else {\n if (imageGroupIndex === 0 && imageGroups[imageGroupIndex].length >= 2) {\n imageGroupIndex += 1;\n return;\n }\n if (imageGroups[imageGroupIndex].length >= 3) imageGroupIndex += 1;\n }\n });\n\n return imageGroups;\n};\n\nconst separateImages = (images, priorityLimit, shouldDisplayCaption) => {\n if (!images || !images.length) return [];\n\n return buildImageGroups(images, priorityLimit, shouldDisplayCaption);\n};\n\nexport default separateImages;\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,kBAAkB;AAE7C,MAAMC,gBAAgB,GAAGA,CAACC,MAAM,EAAEC,aAAa,EAAEC,oBAAoB,KAAK;EACxE,MAAMC,WAAW,GAAG,EAAE;EACtB,IAAIC,eAAe,GAAG,CAAC;EACvB,MAAMC,WAAW,GAAGL,MAAM,CAACM,MAAM,GAAG,CAAC,KAAK,CAAC;EAE3CN,MAAM,CAACO,OAAO,CAAC,CAACC,KAAK,EAAEC,KAAK,KAAK;IAC/B,IAAI,CAACN,WAAW,CAACC,eAAe,CAAC,EAC/BD,WAAW,CAACC,eAAe,CAAC,GAAG,CAC7BN,cAAc,CAACU,KAAK,EAAEC,KAAK,EAAER,aAAa,EAAEC,oBAAoB,CAAC,CAClE,CAAC,KAEFC,WAAW,CAACC,eAAe,CAAC,CAACM,IAAI,CAC/BZ,cAAc,CAACU,KAAK,EAAEC,KAAK,EAAER,aAAa,EAAEC,oBAAoB,CAClE,CAAC;IAEH,IAAIG,WAAW,EAAE;MACf,IAAIF,WAAW,CAACC,eAAe,CAAC,CAACE,MAAM,IAAI,CAAC,EAAEF,eAAe,IAAI,CAAC;IACpE,CAAC,MAAM;MACL,IAAIA,eAAe,KAAK,CAAC,IAAID,WAAW,CAACC,eAAe,CAAC,CAACE,MAAM,IAAI,CAAC,EAAE;QACrEF,eAAe,IAAI,CAAC;QACpB;MACF;MACA,IAAID,WAAW,CAACC,eAAe,CAAC,CAACE,MAAM,IAAI,CAAC,EAAEF,eAAe,IAAI,CAAC;IACpE;EACF,CAAC,CAAC;EAEF,OAAOD,WAAW;AACpB,CAAC;AAED,MAAMQ,cAAc,GAAGA,CAACX,MAAM,EAAEC,aAAa,EAAEC,oBAAoB,KAAK;EACtE,IAAI,CAACF,MAAM,IAAI,CAACA,MAAM,CAACM,MAAM,EAAE,OAAO,EAAE;EAExC,OAAOP,gBAAgB,CAACC,MAAM,EAAEC,aAAa,EAAEC,oBAAoB,CAAC;AACtE,CAAC;AAED,eAAeS,cAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shouldSkip.js","names":["shouldSkip","ids","Array","isArray","length"],"sources":["../../../../src/variants/LongformGallery/helpers/shouldSkip.js"],"sourcesContent":["const shouldSkip = ids => !ids || (Array.isArray(ids) && !ids.length);\n\nexport default shouldSkip;\n"],"mappings":"AAAA,MAAMA,UAAU,GAAGC,GAAG,IAAI,CAACA,GAAG,IAAKC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,IAAI,CAACA,GAAG,CAACG,MAAO;AAErE,eAAeJ,UAAU"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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
|
+
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
|
+
import dynamic from 'next/dynamic';
|
|
5
|
+
const LongformGallery = {
|
|
6
|
+
VariantComponent: dynamic(() => import( /* webpackChunkName: "blazePbVariantLongformGallery" */'./LongformGallery')),
|
|
7
|
+
getSettings: componentSettings => _objectSpread(_objectSpread({}, componentSettings), {}, {
|
|
8
|
+
modifier: 'longformGallery'
|
|
9
|
+
})
|
|
10
|
+
};
|
|
11
|
+
export default LongformGallery;
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["dynamic","LongformGallery","VariantComponent","getSettings","componentSettings","_objectSpread","modifier"],"sources":["../../../src/variants/LongformGallery/index.js"],"sourcesContent":["import dynamic from 'next/dynamic';\n\nconst LongformGallery = {\n VariantComponent: dynamic(() =>\n import(/* webpackChunkName: \"blazePbVariantLongformGallery\" */ './LongformGallery')\n ),\n getSettings: componentSettings => ({\n ...componentSettings,\n modifier: 'longformGallery'\n })\n};\n\nexport default LongformGallery;\n"],"mappings":";;;AAAA,OAAOA,OAAO,MAAM,cAAc;AAElC,MAAMC,eAAe,GAAG;EACtBC,gBAAgB,EAAEF,OAAO,CAAC,MACxB,MAAM,EAAC,uDAAwD,mBAAmB,CACpF,CAAC;EACDG,WAAW,EAAEC,iBAAiB,IAAAC,aAAA,CAAAA,aAAA,KACzBD,iBAAiB;IACpBE,QAAQ,EAAE;EAAiB;AAE/B,CAAC;AAED,eAAeL,eAAe"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useQuery } from '@apollo/client';
|
|
2
|
+
import { GET_IMAGES_QUERY } from './constants';
|
|
3
|
+
import { separateImages, shouldSkip } from './helpers';
|
|
4
|
+
const useLongformGallery = ({
|
|
5
|
+
imageIds = [],
|
|
6
|
+
priorityLimit = 0,
|
|
7
|
+
caption = '',
|
|
8
|
+
shouldDisplayCaption = false,
|
|
9
|
+
enableLightbox = false,
|
|
10
|
+
toggleModal = () => {},
|
|
11
|
+
handleSelectedImage = () => {}
|
|
12
|
+
}) => {
|
|
13
|
+
const skip = shouldSkip(imageIds);
|
|
14
|
+
const {
|
|
15
|
+
data,
|
|
16
|
+
loading,
|
|
17
|
+
error
|
|
18
|
+
} = useQuery(GET_IMAGES_QUERY, {
|
|
19
|
+
variables: {
|
|
20
|
+
where: {
|
|
21
|
+
id: {
|
|
22
|
+
_in: imageIds
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
skip
|
|
27
|
+
});
|
|
28
|
+
const {
|
|
29
|
+
getImages
|
|
30
|
+
} = data || {};
|
|
31
|
+
const groupedImages = separateImages(getImages, priorityLimit, shouldDisplayCaption);
|
|
32
|
+
const handleImageOnClick = clickedImageId => {
|
|
33
|
+
if (!enableLightbox) return;
|
|
34
|
+
toggleModal();
|
|
35
|
+
handleSelectedImage(clickedImageId);
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
loading,
|
|
39
|
+
error,
|
|
40
|
+
shouldDisplayCaption,
|
|
41
|
+
caption,
|
|
42
|
+
groupedImages,
|
|
43
|
+
handleImageOnClick
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export default useLongformGallery;
|
|
47
|
+
//# sourceMappingURL=useLongformGallery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLongformGallery.js","names":["useQuery","GET_IMAGES_QUERY","separateImages","shouldSkip","useLongformGallery","imageIds","priorityLimit","caption","shouldDisplayCaption","enableLightbox","toggleModal","handleSelectedImage","skip","data","loading","error","variables","where","id","_in","getImages","groupedImages","handleImageOnClick","clickedImageId"],"sources":["../../../src/variants/LongformGallery/useLongformGallery.js"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport { GET_IMAGES_QUERY } from './constants';\nimport { separateImages, shouldSkip } from './helpers';\n\nconst useLongformGallery = ({\n imageIds = [],\n priorityLimit = 0,\n caption = '',\n shouldDisplayCaption = false,\n enableLightbox = false,\n toggleModal = () => {},\n handleSelectedImage = () => {}\n}) => {\n const skip = shouldSkip(imageIds);\n\n const { data, loading, error } = useQuery(GET_IMAGES_QUERY, {\n variables: { where: { id: { _in: imageIds } } },\n skip\n });\n\n const { getImages } = data || {};\n\n const groupedImages = separateImages(getImages, priorityLimit, shouldDisplayCaption);\n\n const handleImageOnClick = clickedImageId => {\n if (!enableLightbox) return;\n toggleModal();\n handleSelectedImage(clickedImageId);\n };\n\n return {\n loading,\n error,\n shouldDisplayCaption,\n caption,\n groupedImages,\n handleImageOnClick\n };\n};\n\nexport default useLongformGallery;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,gBAAgB,QAAQ,aAAa;AAC9C,SAASC,cAAc,EAAEC,UAAU,QAAQ,WAAW;AAEtD,MAAMC,kBAAkB,GAAGA,CAAC;EAC1BC,QAAQ,GAAG,EAAE;EACbC,aAAa,GAAG,CAAC;EACjBC,OAAO,GAAG,EAAE;EACZC,oBAAoB,GAAG,KAAK;EAC5BC,cAAc,GAAG,KAAK;EACtBC,WAAW,GAAGA,CAAA,KAAM,CAAC,CAAC;EACtBC,mBAAmB,GAAGA,CAAA,KAAM,CAAC;AAC/B,CAAC,KAAK;EACJ,MAAMC,IAAI,GAAGT,UAAU,CAACE,QAAQ,CAAC;EAEjC,MAAM;IAAEQ,IAAI;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGf,QAAQ,CAACC,gBAAgB,EAAE;IAC1De,SAAS,EAAE;MAAEC,KAAK,EAAE;QAAEC,EAAE,EAAE;UAAEC,GAAG,EAAEd;QAAS;MAAE;IAAE,CAAC;IAC/CO;EACF,CAAC,CAAC;EAEF,MAAM;IAAEQ;EAAU,CAAC,GAAGP,IAAI,IAAI,CAAC,CAAC;EAEhC,MAAMQ,aAAa,GAAGnB,cAAc,CAACkB,SAAS,EAAEd,aAAa,EAAEE,oBAAoB,CAAC;EAEpF,MAAMc,kBAAkB,GAAGC,cAAc,IAAI;IAC3C,IAAI,CAACd,cAAc,EAAE;IACrBC,WAAW,CAAC,CAAC;IACbC,mBAAmB,CAACY,cAAc,CAAC;EACrC,CAAC;EAED,OAAO;IACLT,OAAO;IACPC,KAAK;IACLP,oBAAoB;IACpBD,OAAO;IACPc,aAAa;IACbC;EACF,CAAC;AACH,CAAC;AAED,eAAelB,kBAAkB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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
|
+
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
|
+
const LongformRow = {
|
|
5
|
+
getSettings: componentSettings => _objectSpread(_objectSpread({}, componentSettings), {}, {
|
|
6
|
+
modifier: 'longform-row'
|
|
7
|
+
})
|
|
8
|
+
};
|
|
9
|
+
export default LongformRow;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["LongformRow","getSettings","componentSettings","_objectSpread","modifier"],"sources":["../../../src/variants/LongformRow/index.js"],"sourcesContent":["const LongformRow = {\n getSettings: componentSettings => ({\n ...componentSettings,\n modifier: 'longform-row'\n })\n};\n\nexport default LongformRow;\n"],"mappings":";;;AAAA,MAAMA,WAAW,GAAG;EAClBC,WAAW,EAAEC,iBAAiB,IAAAC,aAAA,CAAAA,aAAA,KACzBD,iBAAiB;IACpBE,QAAQ,EAAE;EAAc;AAE5B,CAAC;AAED,eAAeJ,WAAW"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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
|
+
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
|
+
const ParallaxImageTextRight = {
|
|
5
|
+
getSettings: componentSettings => _objectSpread(_objectSpread({}, componentSettings), {}, {
|
|
6
|
+
parallax: true,
|
|
7
|
+
modifier: 'image-children-right'
|
|
8
|
+
})
|
|
9
|
+
};
|
|
10
|
+
export default ParallaxImageTextRight;
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ParallaxImageTextRight","getSettings","componentSettings","_objectSpread","parallax","modifier"],"sources":["../../../src/variants/ParallaxImageTextRight/index.js"],"sourcesContent":["const ParallaxImageTextRight = {\n getSettings: componentSettings => ({\n ...componentSettings,\n parallax: true,\n modifier: 'image-children-right'\n })\n};\n\nexport default ParallaxImageTextRight;\n"],"mappings":";;;AAAA,MAAMA,sBAAsB,GAAG;EAC7BC,WAAW,EAAEC,iBAAiB,IAAAC,aAAA,CAAAA,aAAA,KACzBD,iBAAiB;IACpBE,QAAQ,EAAE,IAAI;IACdC,QAAQ,EAAE;EAAsB;AAEpC,CAAC;AAED,eAAeL,sBAAsB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
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
3
|
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
|
-
import
|
|
4
|
+
import dynamic from 'next/dynamic';
|
|
5
5
|
const ThumbnailCarousel = {
|
|
6
6
|
getSettings: componentSettings => _objectSpread({}, componentSettings),
|
|
7
|
-
VariantComponent:
|
|
7
|
+
VariantComponent: dynamic(() => import( /* webpackChunkName: "blazePbVariantThumbnailCarousel" */'./ThumbnailCarousel'))
|
|
8
8
|
};
|
|
9
9
|
export default ThumbnailCarousel;
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["dynamic","ThumbnailCarousel","getSettings","componentSettings","_objectSpread","VariantComponent"],"sources":["../../../src/variants/ThumbnailCarousel/index.js"],"sourcesContent":["import dynamic from 'next/dynamic';\n\nconst ThumbnailCarousel = {\n getSettings: componentSettings => ({\n ...componentSettings\n }),\n VariantComponent: dynamic(() =>\n import(/* webpackChunkName: \"blazePbVariantThumbnailCarousel\" */ './ThumbnailCarousel')\n )\n};\n\nexport default ThumbnailCarousel;\n"],"mappings":";;;AAAA,OAAOA,OAAO,MAAM,cAAc;AAElC,MAAMC,iBAAiB,GAAG;EACxBC,WAAW,EAAEC,iBAAiB,IAAAC,aAAA,KACzBD,iBAAiB,CACpB;EACFE,gBAAgB,EAAEL,OAAO,CAAC,MACxB,MAAM,EAAC,yDAA0D,qBAAqB,CACxF;AACF,CAAC;AAED,eAAeC,iBAAiB"}
|
package/lib-es/variants/index.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import heroImage from './HeroImage';
|
|
2
|
+
import infographic from './Infographic';
|
|
3
|
+
import longformGallery from './LongformGallery';
|
|
4
|
+
import longformRow from './LongformRow';
|
|
5
|
+
import parallaxImageTextRight from './ParallaxImageTextRight';
|
|
1
6
|
import thumbnailCarousel from './ThumbnailCarousel';
|
|
2
7
|
export default {
|
|
8
|
+
heroImage,
|
|
9
|
+
infographic,
|
|
10
|
+
longformGallery,
|
|
11
|
+
longformRow,
|
|
12
|
+
parallaxImageTextRight,
|
|
3
13
|
thumbnailCarousel
|
|
4
14
|
};
|
|
5
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["thumbnailCarousel"],"sources":["../../src/variants/index.js"],"sourcesContent":["import thumbnailCarousel from './ThumbnailCarousel';\n\nexport default {\n thumbnailCarousel\n};\n"],"mappings":"AAAA,OAAOA,iBAAiB,MAAM,qBAAqB;AAEnD,eAAe;
|
|
1
|
+
{"version":3,"file":"index.js","names":["heroImage","infographic","longformGallery","longformRow","parallaxImageTextRight","thumbnailCarousel"],"sources":["../../src/variants/index.js"],"sourcesContent":["import heroImage from './HeroImage';\nimport infographic from './Infographic';\nimport longformGallery from './LongformGallery';\nimport longformRow from './LongformRow';\nimport parallaxImageTextRight from './ParallaxImageTextRight';\nimport thumbnailCarousel from './ThumbnailCarousel';\n\nexport default {\n heroImage,\n infographic,\n longformGallery,\n longformRow,\n parallaxImageTextRight,\n thumbnailCarousel\n};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,aAAa;AACnC,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,OAAOC,iBAAiB,MAAM,qBAAqB;AAEnD,eAAe;EACbL,SAAS;EACTC,WAAW;EACXC,eAAe;EACfC,WAAW;EACXC,sBAAsB;EACtBC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/react-page-builder",
|
|
3
|
-
"version": "0.141.0-core-styles.
|
|
3
|
+
"version": "0.141.0-core-styles.23",
|
|
4
4
|
"description": "Blaze react page builder",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"lib/*",
|
|
90
90
|
"lib-es/*"
|
|
91
91
|
],
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "d9d2e56511f87e137bad4f0010ad520a00dfba7c"
|
|
93
93
|
}
|
|
@@ -4,7 +4,7 @@ import { useRouter } from 'next/router';
|
|
|
4
4
|
import { getActiveTab } from './helpers';
|
|
5
5
|
import { TAB, TABS, SIDEPANEL, CONTENT_GROUP, PANEL } from './constants';
|
|
6
6
|
|
|
7
|
-
const ContentGroupTabs = ({ name, contentType,
|
|
7
|
+
const ContentGroupTabs = ({ name, contentType, groupSections, sectionsData, VariantComponent }) => {
|
|
8
8
|
const router = useRouter();
|
|
9
9
|
const [selectedTab, setSelectedTab] = useState(getActiveTab(sectionsData, ''));
|
|
10
10
|
const { asPath } = router;
|
|
@@ -21,10 +21,12 @@ const ContentGroupTabs = ({ name, contentType, modifier, groupSections, sections
|
|
|
21
21
|
[asPath, sectionsData, selectedTab]
|
|
22
22
|
);
|
|
23
23
|
|
|
24
|
+
const WrapperComponent = VariantComponent || 'div';
|
|
25
|
+
|
|
24
26
|
return (
|
|
25
27
|
<div className={mainDivClass}>
|
|
26
28
|
<ul className={contentGroupClass} role="tablist" aria-label={name}>
|
|
27
|
-
{groupSections.map((
|
|
29
|
+
{groupSections.map((_, index) => {
|
|
28
30
|
const [sectionName, sectioLabel] = sectionsData[index];
|
|
29
31
|
const tabId = `${TAB}-${sectionName}`;
|
|
30
32
|
const panelId = `${PANEL}-${sectionName}`;
|
|
@@ -61,14 +63,15 @@ const ContentGroupTabs = ({ name, contentType, modifier, groupSections, sections
|
|
|
61
63
|
if (selectedTab !== tabId) return null;
|
|
62
64
|
|
|
63
65
|
return (
|
|
64
|
-
<
|
|
65
|
-
id={sectionName}
|
|
66
|
+
<WrapperComponent
|
|
66
67
|
key={panelId}
|
|
68
|
+
id={sectionName}
|
|
67
69
|
className={sectionClass}
|
|
68
70
|
role="tabpanel"
|
|
71
|
+
tabId={tabId}
|
|
69
72
|
aria-labelledby={tabId}>
|
|
70
73
|
{groupSection}
|
|
71
|
-
</
|
|
74
|
+
</WrapperComponent>
|
|
72
75
|
);
|
|
73
76
|
})}
|
|
74
77
|
</div>
|
|
@@ -78,13 +81,13 @@ const ContentGroupTabs = ({ name, contentType, modifier, groupSections, sections
|
|
|
78
81
|
ContentGroupTabs.propTypes = {
|
|
79
82
|
name: PropTypes.string.isRequired,
|
|
80
83
|
contentType: PropTypes.string.isRequired,
|
|
81
|
-
modifier: PropTypes.string,
|
|
82
84
|
groupSections: PropTypes.array.isRequired,
|
|
83
|
-
sectionsData: PropTypes.array.isRequired
|
|
85
|
+
sectionsData: PropTypes.array.isRequired,
|
|
86
|
+
VariantComponent: PropTypes.func
|
|
84
87
|
};
|
|
85
88
|
|
|
86
89
|
ContentGroupTabs.defaultProps = {
|
|
87
|
-
|
|
90
|
+
VariantComponent: null
|
|
88
91
|
};
|
|
89
92
|
|
|
90
93
|
export default ContentGroupTabs;
|