@blaze-cms/react-page-builder 0.141.0-core-styles.1 → 0.141.0-core-variants.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 +11 -36
- package/lib/components/ContentGroup/ContentGroupTabs.js +10 -8
- package/lib/components/ContentGroup/ContentGroupTabs.js.map +1 -1
- package/lib/hooks/helpers/getVariant.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 +29 -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 +51 -0
- package/lib/variants/LongformGallery/LongformGallery.js.map +1 -0
- package/lib/variants/LongformGallery/LongformGalleryImage.js +68 -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 +27 -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 +31 -0
- package/lib/variants/LongformGallery/index.js.map +1 -0
- package/lib/variants/LongformGallery/useLongformGallery.js +63 -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/index.js +13 -1
- 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/hooks/helpers/getVariant.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 +37 -0
- package/lib-es/variants/LongformGallery/LongformGallery.js.map +1 -0
- package/lib-es/variants/LongformGallery/LongformGalleryImage.js +56 -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 +13 -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 +48 -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/index.js +12 -1
- package/lib-es/variants/index.js.map +1 -1
- package/package.json +10 -10
- package/src/components/ContentGroup/ContentGroupTabs.js +11 -8
- package/src/hooks/helpers/getVariant.js +1 -0
- package/src/variants/HeroImage/index.js +8 -0
- package/src/variants/Infographic/Infographic.js +14 -0
- package/src/variants/Infographic/index.js +10 -0
- package/src/variants/Infographic/useInfographic.js +18 -0
- package/src/variants/LongformGallery/LongformGallery.js +48 -0
- package/src/variants/LongformGallery/LongformGalleryImage.js +62 -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 +22 -0
- package/src/variants/LongformGallery/helpers/shouldSkip.js +3 -0
- package/src/variants/LongformGallery/index.js +11 -0
- package/src/variants/LongformGallery/useLongformGallery.js +50 -0
- package/src/variants/LongformRow/index.js +8 -0
- package/src/variants/ParallaxImageTextRight/index.js +9 -0
- package/src/variants/index.js +13 -1
- package/tests/unit/src/components/ContentGroup/__snapshots__/ContentGroupTabs.test.js.snap +2 -0
- package/tests/unit/src/components/PlaceholderIcon/__snapshots__/index.test.js.snap +1 -3
- package/tests/unit/src/variants/LongFormGallery/LongformGallery.test.js +41 -0
- package/tests/unit/src/variants/LongFormGallery/LongformGalleryImage.test.js +44 -0
- package/tests/unit/src/variants/LongFormGallery/__snapshots__/LongformGallery.test.js.snap +102 -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 +54 -0
- package/tests/unit/src/variants/LongFormGallery/helpers/shouldSkip.test.js +23 -0
- package/tests/unit/src/variants/LongFormGallery/useLongformGallery.test.js +39 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
require("core-js/modules/es.array.map.js");
|
|
10
|
+
require("core-js/modules/es.array.slice.js");
|
|
11
|
+
var _parseImageData = _interopRequireDefault(require("./parseImageData"));
|
|
12
|
+
var separateImages = function separateImages(images, priorityLimit, shouldDisplayCaption) {
|
|
13
|
+
if (!images || !images.length) return [[], []];
|
|
14
|
+
var mainImages = images.slice(0, 2).map(function (image, index) {
|
|
15
|
+
return (0, _parseImageData["default"])(image, index, priorityLimit, shouldDisplayCaption);
|
|
16
|
+
});
|
|
17
|
+
var secondaryImages = [];
|
|
18
|
+
for (var i = 2; i < images.length; i += 3) {
|
|
19
|
+
var parsedImages = images.slice(i, i + 3).map(function (image, index) {
|
|
20
|
+
return (0, _parseImageData["default"])(image, index, priorityLimit, shouldDisplayCaption);
|
|
21
|
+
});
|
|
22
|
+
secondaryImages.push(parsedImages);
|
|
23
|
+
}
|
|
24
|
+
return [mainImages, secondaryImages];
|
|
25
|
+
};
|
|
26
|
+
var _default = exports["default"] = separateImages;
|
|
27
|
+
//# sourceMappingURL=separateImages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separateImages.js","names":["_parseImageData","_interopRequireDefault","require","separateImages","images","priorityLimit","shouldDisplayCaption","length","mainImages","slice","map","image","index","parseImageData","secondaryImages","i","parsedImages","push","_default","exports"],"sources":["../../../../src/variants/LongformGallery/helpers/separateImages.js"],"sourcesContent":["import parseImageData from './parseImageData';\n\nconst separateImages = (images, priorityLimit, shouldDisplayCaption) => {\n if (!images || !images.length) return [[], []];\n\n const mainImages = images\n .slice(0, 2)\n .map((image, index) => parseImageData(image, index, priorityLimit, shouldDisplayCaption));\n\n const secondaryImages = [];\n\n for (let i = 2; i < images.length; i += 3) {\n const parsedImages = images\n .slice(i, i + 3)\n .map((image, index) => parseImageData(image, index, priorityLimit, shouldDisplayCaption));\n secondaryImages.push(parsedImages);\n }\n\n return [mainImages, secondaryImages];\n};\n\nexport default separateImages;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,MAAM,EAAEC,aAAa,EAAEC,oBAAoB,EAAK;EACtE,IAAI,CAACF,MAAM,IAAI,CAACA,MAAM,CAACG,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC;EAE9C,IAAMC,UAAU,GAAGJ,MAAM,CACtBK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CACXC,GAAG,CAAC,UAACC,KAAK,EAAEC,KAAK;IAAA,OAAK,IAAAC,0BAAc,EAACF,KAAK,EAAEC,KAAK,EAAEP,aAAa,EAAEC,oBAAoB,CAAC;EAAA,EAAC;EAE3F,IAAMQ,eAAe,GAAG,EAAE;EAE1B,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGX,MAAM,CAACG,MAAM,EAAEQ,CAAC,IAAI,CAAC,EAAE;IACzC,IAAMC,YAAY,GAAGZ,MAAM,CACxBK,KAAK,CAACM,CAAC,EAAEA,CAAC,GAAG,CAAC,CAAC,CACfL,GAAG,CAAC,UAACC,KAAK,EAAEC,KAAK;MAAA,OAAK,IAAAC,0BAAc,EAACF,KAAK,EAAEC,KAAK,EAAEP,aAAa,EAAEC,oBAAoB,CAAC;IAAA,EAAC;IAC3FQ,eAAe,CAACG,IAAI,CAACD,YAAY,CAAC;EACpC;EAEA,OAAO,CAACR,UAAU,EAAEM,eAAe,CAAC;AACtC,CAAC;AAAC,IAAAI,QAAA,GAAAC,OAAA,cAEahB,cAAc"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
require("core-js/modules/es.array.is-array.js");
|
|
9
|
+
var shouldSkip = function shouldSkip(ids) {
|
|
10
|
+
return !ids || Array.isArray(ids) && !ids.length;
|
|
11
|
+
};
|
|
12
|
+
var _default = exports["default"] = shouldSkip;
|
|
13
|
+
//# sourceMappingURL=shouldSkip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shouldSkip.js","names":["shouldSkip","ids","Array","isArray","length","_default","exports"],"sources":["../../../../src/variants/LongformGallery/helpers/shouldSkip.js"],"sourcesContent":["const shouldSkip = ids => !ids || (Array.isArray(ids) && !ids.length);\n\nexport default shouldSkip;\n"],"mappings":";;;;;;;;AAAA,IAAMA,UAAU,GAAG,SAAbA,UAAUA,CAAGC,GAAG;EAAA,OAAI,CAACA,GAAG,IAAKC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,IAAI,CAACA,GAAG,CAACG,MAAO;AAAA;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEvDN,UAAU"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.keys.js");
|
|
4
|
+
require("core-js/modules/es.symbol.js");
|
|
5
|
+
require("core-js/modules/es.array.filter.js");
|
|
6
|
+
require("core-js/modules/es.object.to-string.js");
|
|
7
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
8
|
+
require("core-js/modules/es.array.for-each.js");
|
|
9
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
10
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
11
|
+
require("core-js/modules/es.object.define-properties.js");
|
|
12
|
+
require("core-js/modules/es.object.define-property.js");
|
|
13
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
exports["default"] = void 0;
|
|
18
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
|
+
var _LongformGallery = _interopRequireDefault(require("./LongformGallery"));
|
|
20
|
+
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; }
|
|
21
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22
|
+
var LongformGallery = {
|
|
23
|
+
VariantComponent: _LongformGallery["default"],
|
|
24
|
+
getSettings: function getSettings(componentSettings) {
|
|
25
|
+
return _objectSpread(_objectSpread({}, componentSettings), {}, {
|
|
26
|
+
modifier: 'longformGallery'
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var _default = exports["default"] = LongformGallery;
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_LongformGallery","_interopRequireDefault","require","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","LongformGallery","VariantComponent","LongformGalleryComponent","getSettings","componentSettings","modifier","_default","exports"],"sources":["../../../src/variants/LongformGallery/index.js"],"sourcesContent":["import LongformGalleryComponent from './LongformGallery';\n\nconst LongformGallery = {\n VariantComponent: LongformGalleryComponent,\n getSettings: componentSettings => ({\n ...componentSettings,\n modifier: 'longformGallery'\n })\n};\n\nexport default LongformGallery;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAyD,SAAAC,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,QAAAe,gBAAA,aAAAhB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,CAAAc,yBAAA,GAAAd,MAAA,CAAAe,gBAAA,CAAAlB,CAAA,EAAAG,MAAA,CAAAc,yBAAA,CAAAf,CAAA,KAAAH,OAAA,CAAAI,MAAA,CAAAD,CAAA,GAAAa,OAAA,WAAAd,CAAA,IAAAE,MAAA,CAAAgB,cAAA,CAAAnB,CAAA,EAAAC,CAAA,EAAAE,MAAA,CAAAK,wBAAA,CAAAN,CAAA,EAAAD,CAAA,iBAAAD,CAAA;AAEzD,IAAMoB,eAAe,GAAG;EACtBC,gBAAgB,EAAEC,2BAAwB;EAC1CC,WAAW,EAAE,SAAAA,YAAAC,iBAAiB;IAAA,OAAAZ,aAAA,CAAAA,aAAA,KACzBY,iBAAiB;MACpBC,QAAQ,EAAE;IAAiB;EAAA;AAE/B,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEaP,eAAe"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _client = require("@apollo/client");
|
|
11
|
+
var _constants = require("./constants");
|
|
12
|
+
var _helpers = require("./helpers");
|
|
13
|
+
var useLongformGallery = function useLongformGallery(_ref) {
|
|
14
|
+
var _ref$imageIds = _ref.imageIds,
|
|
15
|
+
imageIds = _ref$imageIds === void 0 ? [] : _ref$imageIds,
|
|
16
|
+
_ref$priorityLimit = _ref.priorityLimit,
|
|
17
|
+
priorityLimit = _ref$priorityLimit === void 0 ? 0 : _ref$priorityLimit,
|
|
18
|
+
_ref$shouldDisplayCap = _ref.shouldDisplayCaption,
|
|
19
|
+
shouldDisplayCaption = _ref$shouldDisplayCap === void 0 ? false : _ref$shouldDisplayCap,
|
|
20
|
+
_ref$enableLightbox = _ref.enableLightbox,
|
|
21
|
+
enableLightbox = _ref$enableLightbox === void 0 ? false : _ref$enableLightbox,
|
|
22
|
+
_ref$toggleModal = _ref.toggleModal,
|
|
23
|
+
toggleModal = _ref$toggleModal === void 0 ? function () {} : _ref$toggleModal,
|
|
24
|
+
_ref$handleSelectedIm = _ref.handleSelectedImage,
|
|
25
|
+
handleSelectedImage = _ref$handleSelectedIm === void 0 ? function () {} : _ref$handleSelectedIm;
|
|
26
|
+
var skip = (0, _helpers.shouldSkip)(imageIds);
|
|
27
|
+
var _useQuery = (0, _client.useQuery)(_constants.GET_IMAGES_QUERY, {
|
|
28
|
+
variables: {
|
|
29
|
+
where: {
|
|
30
|
+
id: {
|
|
31
|
+
_in: imageIds
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
skip: skip
|
|
36
|
+
}),
|
|
37
|
+
data = _useQuery.data,
|
|
38
|
+
loading = _useQuery.loading,
|
|
39
|
+
error = _useQuery.error;
|
|
40
|
+
var _ref2 = data || {},
|
|
41
|
+
getImages = _ref2.getImages;
|
|
42
|
+
var _separateImages = (0, _helpers.separateImages)(getImages, priorityLimit, shouldDisplayCaption),
|
|
43
|
+
_separateImages2 = (0, _slicedToArray2["default"])(_separateImages, 2),
|
|
44
|
+
mainImages = _separateImages2[0],
|
|
45
|
+
secondaryImages = _separateImages2[1];
|
|
46
|
+
var handleImageOnClick = function handleImageOnClick(clickedImageId) {
|
|
47
|
+
if (!enableLightbox) return;
|
|
48
|
+
toggleModal();
|
|
49
|
+
handleSelectedImage(clickedImageId);
|
|
50
|
+
};
|
|
51
|
+
var secondaryImageClassname = imageIds.length === 4 ? 'longform-gallery__images__image secondary-image two-group' : 'longform-gallery__images__image secondary-image';
|
|
52
|
+
return {
|
|
53
|
+
data: data,
|
|
54
|
+
loading: loading,
|
|
55
|
+
error: error,
|
|
56
|
+
mainImages: mainImages,
|
|
57
|
+
secondaryImages: secondaryImages,
|
|
58
|
+
secondaryImageClassname: secondaryImageClassname,
|
|
59
|
+
handleImageOnClick: handleImageOnClick
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
var _default = exports["default"] = useLongformGallery;
|
|
63
|
+
//# sourceMappingURL=useLongformGallery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLongformGallery.js","names":["_client","require","_constants","_helpers","useLongformGallery","_ref","_ref$imageIds","imageIds","_ref$priorityLimit","priorityLimit","_ref$shouldDisplayCap","shouldDisplayCaption","_ref$enableLightbox","enableLightbox","_ref$toggleModal","toggleModal","_ref$handleSelectedIm","handleSelectedImage","skip","shouldSkip","_useQuery","useQuery","GET_IMAGES_QUERY","variables","where","id","_in","data","loading","error","_ref2","getImages","_separateImages","separateImages","_separateImages2","_slicedToArray2","mainImages","secondaryImages","handleImageOnClick","clickedImageId","secondaryImageClassname","length","_default","exports"],"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 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 [mainImages, secondaryImages] = separateImages(\n getImages,\n priorityLimit,\n shouldDisplayCaption\n );\n\n const handleImageOnClick = clickedImageId => {\n if (!enableLightbox) return;\n toggleModal();\n handleSelectedImage(clickedImageId);\n };\n\n const secondaryImageClassname =\n imageIds.length === 4\n ? 'longform-gallery__images__image secondary-image two-group'\n : 'longform-gallery__images__image secondary-image';\n\n return {\n data,\n loading,\n error,\n mainImages,\n secondaryImages,\n secondaryImageClassname,\n handleImageOnClick\n };\n};\n\nexport default useLongformGallery;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAMG,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAOlB;EAAA,IAAAC,aAAA,GAAAD,IAAA,CANJE,QAAQ;IAARA,QAAQ,GAAAD,aAAA,cAAG,EAAE,GAAAA,aAAA;IAAAE,kBAAA,GAAAH,IAAA,CACbI,aAAa;IAAbA,aAAa,GAAAD,kBAAA,cAAG,CAAC,GAAAA,kBAAA;IAAAE,qBAAA,GAAAL,IAAA,CACjBM,oBAAoB;IAApBA,oBAAoB,GAAAD,qBAAA,cAAG,KAAK,GAAAA,qBAAA;IAAAE,mBAAA,GAAAP,IAAA,CAC5BQ,cAAc;IAAdA,cAAc,GAAAD,mBAAA,cAAG,KAAK,GAAAA,mBAAA;IAAAE,gBAAA,GAAAT,IAAA,CACtBU,WAAW;IAAXA,WAAW,GAAAD,gBAAA,cAAG,YAAM,CAAC,CAAC,GAAAA,gBAAA;IAAAE,qBAAA,GAAAX,IAAA,CACtBY,mBAAmB;IAAnBA,mBAAmB,GAAAD,qBAAA,cAAG,YAAM,CAAC,CAAC,GAAAA,qBAAA;EAE9B,IAAME,IAAI,GAAG,IAAAC,mBAAU,EAACZ,QAAQ,CAAC;EAEjC,IAAAa,SAAA,GAAiC,IAAAC,gBAAQ,EAACC,2BAAgB,EAAE;MAC1DC,SAAS,EAAE;QAAEC,KAAK,EAAE;UAAEC,EAAE,EAAE;YAAEC,GAAG,EAAEnB;UAAS;QAAE;MAAE,CAAC;MAC/CW,IAAI,EAAJA;IACF,CAAC,CAAC;IAHMS,IAAI,GAAAP,SAAA,CAAJO,IAAI;IAAEC,OAAO,GAAAR,SAAA,CAAPQ,OAAO;IAAEC,KAAK,GAAAT,SAAA,CAALS,KAAK;EAK5B,IAAAC,KAAA,GAAsBH,IAAI,IAAI,CAAC,CAAC;IAAxBI,SAAS,GAAAD,KAAA,CAATC,SAAS;EAEjB,IAAAC,eAAA,GAAsC,IAAAC,uBAAc,EAClDF,SAAS,EACTtB,aAAa,EACbE,oBACF,CAAC;IAAAuB,gBAAA,OAAAC,eAAA,aAAAH,eAAA;IAJMI,UAAU,GAAAF,gBAAA;IAAEG,eAAe,GAAAH,gBAAA;EAMlC,IAAMI,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAGC,cAAc,EAAI;IAC3C,IAAI,CAAC1B,cAAc,EAAE;IACrBE,WAAW,CAAC,CAAC;IACbE,mBAAmB,CAACsB,cAAc,CAAC;EACrC,CAAC;EAED,IAAMC,uBAAuB,GAC3BjC,QAAQ,CAACkC,MAAM,KAAK,CAAC,GACjB,2DAA2D,GAC3D,iDAAiD;EAEvD,OAAO;IACLd,IAAI,EAAJA,IAAI;IACJC,OAAO,EAAPA,OAAO;IACPC,KAAK,EAALA,KAAK;IACLO,UAAU,EAAVA,UAAU;IACVC,eAAe,EAAfA,eAAe;IACfG,uBAAuB,EAAvBA,uBAAuB;IACvBF,kBAAkB,EAAlBA;EACF,CAAC;AACH,CAAC;AAAC,IAAAI,QAAA,GAAAC,OAAA,cAEavC,kBAAkB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.keys.js");
|
|
4
|
+
require("core-js/modules/es.symbol.js");
|
|
5
|
+
require("core-js/modules/es.array.filter.js");
|
|
6
|
+
require("core-js/modules/es.object.to-string.js");
|
|
7
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
8
|
+
require("core-js/modules/es.array.for-each.js");
|
|
9
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
10
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
11
|
+
require("core-js/modules/es.object.define-properties.js");
|
|
12
|
+
require("core-js/modules/es.object.define-property.js");
|
|
13
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
exports["default"] = void 0;
|
|
18
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
|
+
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; }
|
|
20
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
|
+
var LongformRow = {
|
|
22
|
+
getSettings: function getSettings(componentSettings) {
|
|
23
|
+
return _objectSpread(_objectSpread({}, componentSettings), {}, {
|
|
24
|
+
modifier: 'longform-row'
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var _default = exports["default"] = LongformRow;
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["LongformRow","getSettings","componentSettings","_objectSpread","modifier","_default","exports"],"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,IAAMA,WAAW,GAAG;EAClBC,WAAW,EAAE,SAAAA,YAAAC,iBAAiB;IAAA,OAAAC,aAAA,CAAAA,aAAA,KACzBD,iBAAiB;MACpBE,QAAQ,EAAE;IAAc;EAAA;AAE5B,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEaN,WAAW"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.keys.js");
|
|
4
|
+
require("core-js/modules/es.symbol.js");
|
|
5
|
+
require("core-js/modules/es.array.filter.js");
|
|
6
|
+
require("core-js/modules/es.object.to-string.js");
|
|
7
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
8
|
+
require("core-js/modules/es.array.for-each.js");
|
|
9
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
10
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
11
|
+
require("core-js/modules/es.object.define-properties.js");
|
|
12
|
+
require("core-js/modules/es.object.define-property.js");
|
|
13
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
exports["default"] = void 0;
|
|
18
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
|
+
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; }
|
|
20
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
|
+
var ParallaxImageTextRight = {
|
|
22
|
+
getSettings: function getSettings(componentSettings) {
|
|
23
|
+
return _objectSpread(_objectSpread({}, componentSettings), {}, {
|
|
24
|
+
parallax: true,
|
|
25
|
+
modifier: 'image-children-right'
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var _default = exports["default"] = ParallaxImageTextRight;
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ParallaxImageTextRight","getSettings","componentSettings","_objectSpread","parallax","modifier","_default","exports"],"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,IAAMA,sBAAsB,GAAG;EAC7BC,WAAW,EAAE,SAAAA,YAAAC,iBAAiB;IAAA,OAAAC,aAAA,CAAAA,aAAA,KACzBD,iBAAiB;MACpBE,QAAQ,EAAE,IAAI;MACdC,QAAQ,EAAE;IAAsB;EAAA;AAEpC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEaP,sBAAsB"}
|
package/lib/variants/index.js
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = void 0;
|
|
8
|
-
var
|
|
9
|
+
var _HeroImage = _interopRequireDefault(require("./HeroImage"));
|
|
10
|
+
var _Infographic = _interopRequireDefault(require("./Infographic"));
|
|
11
|
+
var _LongformGallery = _interopRequireDefault(require("./LongformGallery"));
|
|
12
|
+
var _LongformRow = _interopRequireDefault(require("./LongformRow"));
|
|
13
|
+
var _ParallaxImageTextRight = _interopRequireDefault(require("./ParallaxImageTextRight"));
|
|
14
|
+
var _default = exports["default"] = {
|
|
15
|
+
heroImage: _HeroImage["default"],
|
|
16
|
+
infographic: _Infographic["default"],
|
|
17
|
+
longformGallery: _LongformGallery["default"],
|
|
18
|
+
longformRow: _LongformRow["default"],
|
|
19
|
+
parallaxImageTextRight: _ParallaxImageTextRight["default"]
|
|
20
|
+
};
|
|
9
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/variants/index.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_HeroImage","_interopRequireDefault","require","_Infographic","_LongformGallery","_LongformRow","_ParallaxImageTextRight","_default","exports","heroImage","infographic","longformGallery","longformRow","parallaxImageTextRight"],"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';\n\nexport default {\n heroImage,\n infographic,\n longformGallery,\n longformRow,\n parallaxImageTextRight\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,gBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,uBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAA8D,IAAAK,QAAA,GAAAC,OAAA,cAE/C;EACbC,SAAS,EAATA,qBAAS;EACTC,WAAW,EAAXA,uBAAW;EACXC,eAAe,EAAfA,2BAAe;EACfC,WAAW,EAAXA,uBAAW;EACXC,sBAAsB,EAAtBA;AACF,CAAC"}
|
|
@@ -6,9 +6,9 @@ import { TAB, TABS, SIDEPANEL, CONTENT_GROUP, PANEL } from './constants';
|
|
|
6
6
|
const ContentGroupTabs = ({
|
|
7
7
|
name,
|
|
8
8
|
contentType,
|
|
9
|
-
modifier,
|
|
10
9
|
groupSections,
|
|
11
|
-
sectionsData
|
|
10
|
+
sectionsData,
|
|
11
|
+
VariantComponent
|
|
12
12
|
}) => {
|
|
13
13
|
const router = useRouter();
|
|
14
14
|
const [selectedTab, setSelectedTab] = useState(getActiveTab(sectionsData, ''));
|
|
@@ -23,13 +23,14 @@ const ContentGroupTabs = ({
|
|
|
23
23
|
const activeTab = getActiveTab(sectionsData, asPath);
|
|
24
24
|
if (activeTab !== selectedTab) setSelectedTab(activeTab);
|
|
25
25
|
}, [asPath, sectionsData, selectedTab]);
|
|
26
|
+
const WrapperComponent = VariantComponent || 'div';
|
|
26
27
|
return /*#__PURE__*/React.createElement("div", {
|
|
27
28
|
className: mainDivClass
|
|
28
29
|
}, /*#__PURE__*/React.createElement("ul", {
|
|
29
30
|
className: contentGroupClass,
|
|
30
31
|
role: "tablist",
|
|
31
32
|
"aria-label": name
|
|
32
|
-
}, groupSections.map((
|
|
33
|
+
}, groupSections.map((_, index) => {
|
|
33
34
|
const [sectionName, sectioLabel] = sectionsData[index];
|
|
34
35
|
const tabId = `${TAB}-${sectionName}`;
|
|
35
36
|
const panelId = `${PANEL}-${sectionName}`;
|
|
@@ -58,11 +59,12 @@ const ContentGroupTabs = ({
|
|
|
58
59
|
const tabId = `${TAB}-${sectionName}`;
|
|
59
60
|
const panelId = `${PANEL}-${sectionName}`;
|
|
60
61
|
if (selectedTab !== tabId) return null;
|
|
61
|
-
return /*#__PURE__*/React.createElement(
|
|
62
|
-
id: sectionName,
|
|
62
|
+
return /*#__PURE__*/React.createElement(WrapperComponent, {
|
|
63
63
|
key: panelId,
|
|
64
|
+
id: sectionName,
|
|
64
65
|
className: sectionClass,
|
|
65
66
|
role: "tabpanel",
|
|
67
|
+
tabId: tabId,
|
|
66
68
|
"aria-labelledby": tabId
|
|
67
69
|
}, groupSection);
|
|
68
70
|
}));
|
|
@@ -70,12 +72,12 @@ const ContentGroupTabs = ({
|
|
|
70
72
|
ContentGroupTabs.propTypes = {
|
|
71
73
|
name: PropTypes.string.isRequired,
|
|
72
74
|
contentType: PropTypes.string.isRequired,
|
|
73
|
-
modifier: PropTypes.string,
|
|
74
75
|
groupSections: PropTypes.array.isRequired,
|
|
75
|
-
sectionsData: PropTypes.array.isRequired
|
|
76
|
+
sectionsData: PropTypes.array.isRequired,
|
|
77
|
+
VariantComponent: PropTypes.func
|
|
76
78
|
};
|
|
77
79
|
ContentGroupTabs.defaultProps = {
|
|
78
|
-
|
|
80
|
+
VariantComponent: null
|
|
79
81
|
};
|
|
80
82
|
export default ContentGroupTabs;
|
|
81
83
|
//# sourceMappingURL=ContentGroupTabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentGroupTabs.js","names":["React","useState","useEffect","PropTypes","useRouter","getActiveTab","TAB","TABS","SIDEPANEL","CONTENT_GROUP","PANEL","ContentGroupTabs","name","contentType","
|
|
1
|
+
{"version":3,"file":"ContentGroupTabs.js","names":["React","useState","useEffect","PropTypes","useRouter","getActiveTab","TAB","TABS","SIDEPANEL","CONTENT_GROUP","PANEL","ContentGroupTabs","name","contentType","groupSections","sectionsData","VariantComponent","router","selectedTab","setSelectedTab","asPath","contentClassame","mainDivClass","contentGroupClass","sectionClass","activeTab","WrapperComponent","createElement","className","role","map","_","index","sectionName","sectioLabel","tabId","panelId","isSelected","buttonClassName","id","key","type","onClick","baseUrl","split","newUrl","push","shallow","groupSection","propTypes","string","isRequired","array","func","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, groupSections, sectionsData, VariantComponent }) => {\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 const WrapperComponent = VariantComponent || 'div';\n\n return (\n <div className={mainDivClass}>\n <ul className={contentGroupClass} role=\"tablist\" aria-label={name}>\n {groupSections.map((_, 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 <WrapperComponent\n key={panelId}\n id={sectionName}\n className={sectionClass}\n role=\"tabpanel\"\n tabId={tabId}\n aria-labelledby={tabId}>\n {groupSection}\n </WrapperComponent>\n );\n })}\n </div>\n );\n};\n\nContentGroupTabs.propTypes = {\n name: PropTypes.string.isRequired,\n contentType: PropTypes.string.isRequired,\n groupSections: PropTypes.array.isRequired,\n sectionsData: PropTypes.array.isRequired,\n VariantComponent: PropTypes.func\n};\n\nContentGroupTabs.defaultProps = {\n VariantComponent: null\n};\n\nexport default ContentGroupTabs;\n"],"mappings":"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"}
|
|
@@ -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"}
|
|
@@ -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 InfographicComponent from './Infographic';
|
|
5
|
+
const Infographic = {
|
|
6
|
+
getSettings: componentSettings => _objectSpread({}, componentSettings),
|
|
7
|
+
VariantComponent: InfographicComponent
|
|
8
|
+
};
|
|
9
|
+
export default Infographic;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["InfographicComponent","Infographic","getSettings","componentSettings","_objectSpread","VariantComponent"],"sources":["../../../src/variants/Infographic/index.js"],"sourcesContent":["import InfographicComponent from './Infographic';\n\nconst Infographic = {\n getSettings: componentSettings => ({\n ...componentSettings\n }),\n VariantComponent: InfographicComponent\n};\n\nexport default Infographic;\n"],"mappings":";;;AAAA,OAAOA,oBAAoB,MAAM,eAAe;AAEhD,MAAMC,WAAW,GAAG;EAClBC,WAAW,EAAEC,iBAAiB,IAAAC,aAAA,KACzBD,iBAAiB,CACpB;EACFE,gBAAgB,EAAEL;AACpB,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,37 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import useLongformGallery from './useLongformGallery';
|
|
4
|
+
import LongformGalleryImage from './LongformGalleryImage';
|
|
5
|
+
const LongformGallery = props => {
|
|
6
|
+
const {
|
|
7
|
+
error,
|
|
8
|
+
mainImages,
|
|
9
|
+
secondaryImages,
|
|
10
|
+
secondaryImageClassname,
|
|
11
|
+
handleImageOnClick
|
|
12
|
+
} = useLongformGallery(props);
|
|
13
|
+
if (error) return null;
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: "longform-gallery",
|
|
16
|
+
"data-testid": "longform-gallery"
|
|
17
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
className: "longform-gallery__images main-images"
|
|
19
|
+
}, mainImages.map(mainImageData => /*#__PURE__*/React.createElement(LongformGalleryImage, _extends({
|
|
20
|
+
key: mainImageData.id
|
|
21
|
+
}, mainImageData, {
|
|
22
|
+
className: "longform-gallery__images__image main-image",
|
|
23
|
+
handleImageOnClick: handleImageOnClick
|
|
24
|
+
})))), secondaryImages.map((secondaryImagesGroup, i) => /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
26
|
+
key: i,
|
|
27
|
+
"data-testid": "secondary-images",
|
|
28
|
+
className: "longform-gallery__images secondary-images"
|
|
29
|
+
}, secondaryImagesGroup.map(secondaryImage => /*#__PURE__*/React.createElement(LongformGalleryImage, _extends({
|
|
30
|
+
key: secondaryImage.id
|
|
31
|
+
}, secondaryImage, {
|
|
32
|
+
className: secondaryImageClassname,
|
|
33
|
+
handleImageOnClick: handleImageOnClick
|
|
34
|
+
}))))));
|
|
35
|
+
};
|
|
36
|
+
export default LongformGallery;
|
|
37
|
+
//# sourceMappingURL=LongformGallery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LongformGallery.js","names":["React","useLongformGallery","LongformGalleryImage","LongformGallery","props","error","mainImages","secondaryImages","secondaryImageClassname","handleImageOnClick","createElement","className","map","mainImageData","_extends","key","id","secondaryImagesGroup","i","secondaryImage"],"sources":["../../../src/variants/LongformGallery/LongformGallery.js"],"sourcesContent":["import React from 'react';\nimport useLongformGallery from './useLongformGallery';\nimport LongformGalleryImage from './LongformGalleryImage';\n\nconst LongformGallery = props => {\n const {\n error,\n mainImages,\n secondaryImages,\n secondaryImageClassname,\n handleImageOnClick\n } = useLongformGallery(props);\n\n if (error) return null;\n\n return (\n <div className=\"longform-gallery\" data-testid=\"longform-gallery\">\n <div className=\"longform-gallery__images main-images\">\n {mainImages.map(mainImageData => (\n <LongformGalleryImage\n key={mainImageData.id}\n {...mainImageData}\n className=\"longform-gallery__images__image main-image\"\n handleImageOnClick={handleImageOnClick}\n />\n ))}\n </div>\n {secondaryImages.map((secondaryImagesGroup, i) => (\n <div\n // eslint-disable-next-line react/no-array-index-key\n key={i}\n data-testid=\"secondary-images\"\n className=\"longform-gallery__images secondary-images\">\n {secondaryImagesGroup.map(secondaryImage => (\n <LongformGalleryImage\n key={secondaryImage.id}\n {...secondaryImage}\n className={secondaryImageClassname}\n handleImageOnClick={handleImageOnClick}\n />\n ))}\n </div>\n ))}\n </div>\n );\n};\n\nexport default LongformGallery;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,OAAOC,oBAAoB,MAAM,wBAAwB;AAEzD,MAAMC,eAAe,GAAGC,KAAK,IAAI;EAC/B,MAAM;IACJC,KAAK;IACLC,UAAU;IACVC,eAAe;IACfC,uBAAuB;IACvBC;EACF,CAAC,GAAGR,kBAAkB,CAACG,KAAK,CAAC;EAE7B,IAAIC,KAAK,EAAE,OAAO,IAAI;EAEtB,oBACEL,KAAA,CAAAU,aAAA;IAAKC,SAAS,EAAC,kBAAkB;IAAC,eAAY;EAAkB,gBAC9DX,KAAA,CAAAU,aAAA;IAAKC,SAAS,EAAC;EAAsC,GAClDL,UAAU,CAACM,GAAG,CAACC,aAAa,iBAC3Bb,KAAA,CAAAU,aAAA,CAACR,oBAAoB,EAAAY,QAAA;IACnBC,GAAG,EAAEF,aAAa,CAACG;EAAG,GAClBH,aAAa;IACjBF,SAAS,EAAC,4CAA4C;IACtDF,kBAAkB,EAAEA;EAAmB,EACxC,CACF,CACE,CAAC,EACLF,eAAe,CAACK,GAAG,CAAC,CAACK,oBAAoB,EAAEC,CAAC,kBAC3ClB,KAAA,CAAAU,aAAA;IACE;IACAK,GAAG,EAAEG,CAAE;IACP,eAAY,kBAAkB;IAC9BP,SAAS,EAAC;EAA2C,GACpDM,oBAAoB,CAACL,GAAG,CAACO,cAAc,iBACtCnB,KAAA,CAAAU,aAAA,CAACR,oBAAoB,EAAAY,QAAA;IACnBC,GAAG,EAAEI,cAAc,CAACH;EAAG,GACnBG,cAAc;IAClBR,SAAS,EAAEH,uBAAwB;IACnCC,kBAAkB,EAAEA;EAAmB,EACxC,CACF,CACE,CACN,CACE,CAAC;AAEV,CAAC;AAED,eAAeN,eAAe"}
|
|
@@ -0,0 +1,56 @@
|
|
|
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", "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
|
+
handleImageOnClick
|
|
19
|
+
} = _ref,
|
|
20
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
const [isIntersecting, outerRef] = useInView(IN_VIEW_CONFIG);
|
|
22
|
+
const shouldRender = priority || isIntersecting;
|
|
23
|
+
const HeadComponent = priority ? Head : null;
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
ref: outerRef,
|
|
26
|
+
className: className
|
|
27
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
role: "button",
|
|
29
|
+
className: "longform-gallery__images__image__container",
|
|
30
|
+
"data-testid": "longform-gallery__images__image__container",
|
|
31
|
+
onClick: () => handleImageOnClick(id)
|
|
32
|
+
}, shouldRender && /*#__PURE__*/React.createElement(ResponsiveImage, _extends({
|
|
33
|
+
sizeKey: "carousel",
|
|
34
|
+
role: "button",
|
|
35
|
+
src: url,
|
|
36
|
+
alt: altText,
|
|
37
|
+
priority: priority,
|
|
38
|
+
HeadComponent: HeadComponent
|
|
39
|
+
}, props))), !!caption && /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: "longform-gallery__images__image__details",
|
|
41
|
+
"data-testid": "longform-gallery__images__image__details"
|
|
42
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: "longform-gallery__images__image__details__caption"
|
|
44
|
+
}, caption)));
|
|
45
|
+
};
|
|
46
|
+
LongformGalleryImage.propTypes = {
|
|
47
|
+
id: PropTypes.string.isRequired,
|
|
48
|
+
url: PropTypes.string.isRequired,
|
|
49
|
+
caption: PropTypes.string.isRequired,
|
|
50
|
+
altText: PropTypes.string.isRequired,
|
|
51
|
+
priority: PropTypes.bool.isRequired,
|
|
52
|
+
className: PropTypes.string.isRequired,
|
|
53
|
+
handleImageOnClick: PropTypes.func.isRequired
|
|
54
|
+
};
|
|
55
|
+
export default LongformGalleryImage;
|
|
56
|
+
//# 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","handleImageOnClick","props","_objectWithoutProperties","_excluded","isIntersecting","outerRef","shouldRender","HeadComponent","createElement","ref","role","onClick","_extends","sizeKey","src","alt","propTypes","string","isRequired","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 handleImageOnClick,\n ...props\n}) => {\n const [isIntersecting, outerRef] = useInView(IN_VIEW_CONFIG);\n const shouldRender = priority || isIntersecting;\n const HeadComponent = priority ? Head : null;\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=\"carousel\"\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 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,IASvB;EAAA,IATwB;MAC5BC,EAAE;MACFC,GAAG;MACHC,OAAO;MACPC,OAAO;MACPC,QAAQ;MACRC,SAAS;MACTC;IAEF,CAAC,GAAAP,IAAA;IADIQ,KAAK,GAAAC,wBAAA,CAAAT,IAAA,EAAAU,SAAA;EAER,MAAM,CAACC,cAAc,EAAEC,QAAQ,CAAC,GAAGhB,SAAS,CAACE,cAAc,CAAC;EAC5D,MAAMe,YAAY,GAAGR,QAAQ,IAAIM,cAAc;EAC/C,MAAMG,aAAa,GAAGT,QAAQ,GAAGV,IAAI,GAAG,IAAI;EAE5C,oBACEF,KAAA,CAAAsB,aAAA;IAAKC,GAAG,EAAEJ,QAAS;IAACN,SAAS,EAAEA;EAAU,gBACvCb,KAAA,CAAAsB,aAAA;IACEE,IAAI,EAAC,QAAQ;IACbX,SAAS,EAAC,4CAA4C;IACtD,eAAY,4CAA4C;IACxDY,OAAO,EAAEA,CAAA,KAAMX,kBAAkB,CAACN,EAAE;EAAE,GACrCY,YAAY,iBACXpB,KAAA,CAAAsB,aAAA,CAAClB,eAAe,EAAAsB,QAAA;IACdC,OAAO,EAAC,UAAU;IAClBH,IAAI,EAAC,QAAQ;IACbI,GAAG,EAAEnB,GAAI;IACToB,GAAG,EAAElB,OAAQ;IACbC,QAAQ,EAAEA,QAAS;IACnBS,aAAa,EAAEA;EAAc,GACzBN,KAAK,CACV,CAEA,CAAC,EACL,CAAC,CAACL,OAAO,iBACRV,KAAA,CAAAsB,aAAA;IACET,SAAS,EAAC,0CAA0C;IACpD,eAAY;EAA0C,gBACtDb,KAAA,CAAAsB,aAAA;IAAKT,SAAS,EAAC;EAAmD,GAAEH,OAAa,CAC9E,CAEJ,CAAC;AAEV,CAAC;AAEDJ,oBAAoB,CAACwB,SAAS,GAAG;EAC/BtB,EAAE,EAAEP,SAAS,CAAC8B,MAAM,CAACC,UAAU;EAC/BvB,GAAG,EAAER,SAAS,CAAC8B,MAAM,CAACC,UAAU;EAChCtB,OAAO,EAAET,SAAS,CAAC8B,MAAM,CAACC,UAAU;EACpCrB,OAAO,EAAEV,SAAS,CAAC8B,MAAM,CAACC,UAAU;EACpCpB,QAAQ,EAAEX,SAAS,CAACgC,IAAI,CAACD,UAAU;EACnCnB,SAAS,EAAEZ,SAAS,CAAC8B,MAAM,CAACC,UAAU;EACtClB,kBAAkB,EAAEb,SAAS,CAACiC,IAAI,CAACF;AACrC,CAAC;AAED,eAAe1B,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"}
|