@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
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
Object.defineProperty(exports, "parseImageData", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _parseImageData["default"];
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "separateImages", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _separateImages["default"];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "shouldSkip", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function get() {
|
|
23
|
+
return _shouldSkip["default"];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
var _parseImageData = _interopRequireDefault(require("./parseImageData"));
|
|
27
|
+
var _separateImages = _interopRequireDefault(require("./separateImages"));
|
|
28
|
+
var _shouldSkip = _interopRequireDefault(require("./shouldSkip"));
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_parseImageData","_interopRequireDefault","require","_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,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.get-own-property-descriptor.js");
|
|
7
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
8
|
+
require("core-js/modules/es.object.define-properties.js");
|
|
9
|
+
require("core-js/modules/es.object.define-property.js");
|
|
10
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
11
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12
|
+
value: true
|
|
13
|
+
});
|
|
14
|
+
exports["default"] = void 0;
|
|
15
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
+
require("core-js/modules/es.array.for-each.js");
|
|
17
|
+
require("core-js/modules/es.object.to-string.js");
|
|
18
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
19
|
+
var _htmlReactParser = _interopRequireDefault(require("html-react-parser"));
|
|
20
|
+
var _constants = require("../constants");
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
23
|
+
var parseImageData = function parseImageData(image, index, priorityLimit, shouldDisplayCaption) {
|
|
24
|
+
var _image$data = image.data,
|
|
25
|
+
data = _image$data === void 0 ? {} : _image$data;
|
|
26
|
+
var parsedData = {};
|
|
27
|
+
_constants.PROPS_TO_CHECK.forEach(function (dataKey) {
|
|
28
|
+
var value = data && data[dataKey];
|
|
29
|
+
if (dataKey === 'caption') {
|
|
30
|
+
parsedData[dataKey] = shouldDisplayCaption && !!value ? (0, _htmlReactParser["default"])(value) : '';
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
parsedData[dataKey] = value || '';
|
|
34
|
+
});
|
|
35
|
+
return _objectSpread(_objectSpread({}, parsedData), {}, {
|
|
36
|
+
id: image.id,
|
|
37
|
+
url: image.url,
|
|
38
|
+
priority: index < priorityLimit
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
var _default = exports["default"] = parseImageData;
|
|
42
|
+
//# sourceMappingURL=parseImageData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseImageData.js","names":["_htmlReactParser","_interopRequireDefault","require","_constants","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","parseImageData","image","index","priorityLimit","shouldDisplayCaption","_image$data","data","parsedData","PROPS_TO_CHECK","dataKey","value","parseHTML","id","url","priority","_default","exports"],"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,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAA8C,SAAAE,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,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ACF;IACAH,UAAU,CAACE,OAAO,CAAC,GAAGC,KAAK,IAAI,EAAE;EACnC,CAAC,CAAC;EAEF,OAAAlB,aAAA,CAAAA,aAAA,KACKe,UAAU;IACbK,EAAE,EAAEX,KAAK,CAACW,EAAE;IACZC,GAAG,EAAEZ,KAAK,CAACY,GAAG;IACdC,QAAQ,EAAEZ,KAAK,GAAGC;EAAa;AAEnC,CAAC;AAAC,IAAAY,QAAA,GAAAC,OAAA,cAEahB,cAAc"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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.for-each.js");
|
|
10
|
+
require("core-js/modules/es.object.to-string.js");
|
|
11
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
12
|
+
var _parseImageData = _interopRequireDefault(require("./parseImageData"));
|
|
13
|
+
var buildImageGroups = function buildImageGroups(images, priorityLimit, shouldDisplayCaption) {
|
|
14
|
+
var imageGroups = [];
|
|
15
|
+
var imageGroupIndex = 0;
|
|
16
|
+
var isDivisible = images.length % 3 === 0;
|
|
17
|
+
images.forEach(function (image, index) {
|
|
18
|
+
if (!imageGroups[imageGroupIndex]) imageGroups[imageGroupIndex] = [(0, _parseImageData["default"])(image, index, priorityLimit, shouldDisplayCaption)];else imageGroups[imageGroupIndex].push((0, _parseImageData["default"])(image, index, priorityLimit, shouldDisplayCaption));
|
|
19
|
+
if (isDivisible) {
|
|
20
|
+
if (imageGroups[imageGroupIndex].length >= 3) imageGroupIndex += 1;
|
|
21
|
+
} else {
|
|
22
|
+
if (imageGroupIndex === 0 && imageGroups[imageGroupIndex].length >= 2) {
|
|
23
|
+
imageGroupIndex += 1;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (imageGroups[imageGroupIndex].length >= 3) imageGroupIndex += 1;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return imageGroups;
|
|
30
|
+
};
|
|
31
|
+
var separateImages = function separateImages(images, priorityLimit, shouldDisplayCaption) {
|
|
32
|
+
if (!images || !images.length) return [];
|
|
33
|
+
return buildImageGroups(images, priorityLimit, shouldDisplayCaption);
|
|
34
|
+
};
|
|
35
|
+
var _default = exports["default"] = separateImages;
|
|
36
|
+
//# sourceMappingURL=separateImages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separateImages.js","names":["_parseImageData","_interopRequireDefault","require","buildImageGroups","images","priorityLimit","shouldDisplayCaption","imageGroups","imageGroupIndex","isDivisible","length","forEach","image","index","parseImageData","push","separateImages","_default","exports"],"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,IA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,EAAEC,oBAAoB,CAAC;AACtE,CAAC;AAAC,IAAAW,QAAA,GAAAC,OAAA,cAEaF,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,43 @@
|
|
|
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.array.for-each.js");
|
|
7
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
8
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
9
|
+
require("core-js/modules/es.object.define-properties.js");
|
|
10
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
11
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12
|
+
value: true
|
|
13
|
+
});
|
|
14
|
+
exports["default"] = void 0;
|
|
15
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
16
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
+
require("core-js/modules/es.object.to-string.js");
|
|
18
|
+
require("core-js/modules/es.promise.js");
|
|
19
|
+
require("core-js/modules/es.array.iterator.js");
|
|
20
|
+
require("core-js/modules/es.string.iterator.js");
|
|
21
|
+
require("core-js/modules/es.weak-map.js");
|
|
22
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
23
|
+
require("core-js/modules/es.object.define-property.js");
|
|
24
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
25
|
+
var _dynamic = _interopRequireDefault(require("next/dynamic"));
|
|
26
|
+
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; }
|
|
27
|
+
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; }
|
|
28
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
29
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2["default"])(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
30
|
+
var LongformGallery = {
|
|
31
|
+
VariantComponent: (0, _dynamic["default"])(function () {
|
|
32
|
+
return Promise.resolve().then(function () {
|
|
33
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "blazePbVariantLongformGallery" */'./LongformGallery'));
|
|
34
|
+
});
|
|
35
|
+
}),
|
|
36
|
+
getSettings: function getSettings(componentSettings) {
|
|
37
|
+
return _objectSpread(_objectSpread({}, componentSettings), {}, {
|
|
38
|
+
modifier: 'longformGallery'
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var _default = exports["default"] = LongformGallery;
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_dynamic","_interopRequireDefault","require","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","_getRequireWildcardCache","WeakMap","_interopRequireWildcard","__esModule","_typeof2","has","get","n","__proto__","a","u","prototype","hasOwnProperty","call","i","set","LongformGallery","VariantComponent","dynamic","Promise","resolve","then","getSettings","componentSettings","modifier","_default","exports"],"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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EAAA,CACpF,CAAC;EACD4C,WAAW,EAAE,SAAAA,YAAAC,iBAAiB;IAAA,OAAA/B,aAAA,CAAAA,aAAA,KACzB+B,iBAAiB;MACpBC,QAAQ,EAAE;IAAiB;EAAA;AAE/B,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEaV,eAAe"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
var _client = require("@apollo/client");
|
|
9
|
+
var _constants = require("./constants");
|
|
10
|
+
var _helpers = require("./helpers");
|
|
11
|
+
var useLongformGallery = function useLongformGallery(_ref) {
|
|
12
|
+
var _ref$imageIds = _ref.imageIds,
|
|
13
|
+
imageIds = _ref$imageIds === void 0 ? [] : _ref$imageIds,
|
|
14
|
+
_ref$priorityLimit = _ref.priorityLimit,
|
|
15
|
+
priorityLimit = _ref$priorityLimit === void 0 ? 0 : _ref$priorityLimit,
|
|
16
|
+
_ref$caption = _ref.caption,
|
|
17
|
+
caption = _ref$caption === void 0 ? '' : _ref$caption,
|
|
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 groupedImages = (0, _helpers.separateImages)(getImages, priorityLimit, shouldDisplayCaption);
|
|
43
|
+
var handleImageOnClick = function handleImageOnClick(clickedImageId) {
|
|
44
|
+
if (!enableLightbox) return;
|
|
45
|
+
toggleModal();
|
|
46
|
+
handleSelectedImage(clickedImageId);
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
loading: loading,
|
|
50
|
+
error: error,
|
|
51
|
+
shouldDisplayCaption: shouldDisplayCaption,
|
|
52
|
+
caption: caption,
|
|
53
|
+
groupedImages: groupedImages,
|
|
54
|
+
handleImageOnClick: handleImageOnClick
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
var _default = exports["default"] = useLongformGallery;
|
|
58
|
+
//# 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$caption","caption","_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","groupedImages","separateImages","handleImageOnClick","clickedImageId","_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 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,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAMG,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAQlB;EAAA,IAAAC,aAAA,GAAAD,IAAA,CAPJE,QAAQ;IAARA,QAAQ,GAAAD,aAAA,cAAG,EAAE,GAAAA,aAAA;IAAAE,kBAAA,GAAAH,IAAA,CACbI,aAAa;IAAbA,aAAa,GAAAD,kBAAA,cAAG,CAAC,GAAAA,kBAAA;IAAAE,YAAA,GAAAL,IAAA,CACjBM,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,EAAE,GAAAA,YAAA;IAAAE,qBAAA,GAAAP,IAAA,CACZQ,oBAAoB;IAApBA,oBAAoB,GAAAD,qBAAA,cAAG,KAAK,GAAAA,qBAAA;IAAAE,mBAAA,GAAAT,IAAA,CAC5BU,cAAc;IAAdA,cAAc,GAAAD,mBAAA,cAAG,KAAK,GAAAA,mBAAA;IAAAE,gBAAA,GAAAX,IAAA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
|
+
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"}
|
|
@@ -3,27 +3,39 @@
|
|
|
3
3
|
require("core-js/modules/es.object.keys.js");
|
|
4
4
|
require("core-js/modules/es.symbol.js");
|
|
5
5
|
require("core-js/modules/es.array.filter.js");
|
|
6
|
-
require("core-js/modules/es.object.to-string.js");
|
|
7
6
|
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
8
7
|
require("core-js/modules/es.array.for-each.js");
|
|
9
8
|
require("core-js/modules/web.dom-collections.for-each.js");
|
|
10
9
|
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
11
10
|
require("core-js/modules/es.object.define-properties.js");
|
|
12
11
|
require("core-js/modules/es.object.define-property.js");
|
|
12
|
+
require("core-js/modules/es.array.iterator.js");
|
|
13
|
+
require("core-js/modules/es.string.iterator.js");
|
|
14
|
+
require("core-js/modules/es.weak-map.js");
|
|
15
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
13
16
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
17
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
14
18
|
Object.defineProperty(exports, "__esModule", {
|
|
15
19
|
value: true
|
|
16
20
|
});
|
|
17
21
|
exports["default"] = void 0;
|
|
22
|
+
require("core-js/modules/es.object.to-string.js");
|
|
23
|
+
require("core-js/modules/es.promise.js");
|
|
18
24
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
|
-
var
|
|
25
|
+
var _dynamic = _interopRequireDefault(require("next/dynamic"));
|
|
26
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
27
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
20
28
|
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
29
|
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
30
|
var ThumbnailCarousel = {
|
|
23
31
|
getSettings: function getSettings(componentSettings) {
|
|
24
32
|
return _objectSpread({}, componentSettings);
|
|
25
33
|
},
|
|
26
|
-
VariantComponent:
|
|
34
|
+
VariantComponent: (0, _dynamic["default"])(function () {
|
|
35
|
+
return Promise.resolve().then(function () {
|
|
36
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "blazePbVariantThumbnailCarousel" */'./ThumbnailCarousel'));
|
|
37
|
+
});
|
|
38
|
+
})
|
|
27
39
|
};
|
|
28
40
|
var _default = exports["default"] = ThumbnailCarousel;
|
|
29
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_dynamic","_interopRequireDefault","require","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","ThumbnailCarousel","getSettings","componentSettings","VariantComponent","dynamic","Promise","resolve","then","_default","exports"],"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,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAmC,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,eAAAA,CAAA,gBAAAM,OAAA,CAAAN,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAlB,CAAA,EAAAe,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAd,CAAA,EAAAe,CAAA,UAAAI,CAAA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AE,CAAA,EAAAU,MAAA,CAAAE,wBAAA,CAAAX,CAAA,EAAAD,CAAA,iBAAAF,CAAA;AAEnC,IAAMoC,iBAAiB,GAAG;EACxBC,WAAW,EAAE,SAAAA,YAAAC,iBAAiB;IAAA,OAAAT,aAAA,KACzBS,iBAAiB;EAAA,CACpB;EACFC,gBAAgB,EAAE,IAAAC,mBAAO,EAAC;IAAA,OAAAC,OAAA,CAAAC,OAAA,GAAAC,IAAA;MAAA,OAAAvC,uBAAA,CAAAN,OAAA,EACjB,yDAA0D,qBAAqB;IAAA;EAAA,CACxF;AACF,CAAC;AAAC,IAAA8C,QAAA,GAAAC,OAAA,cAEaT,iBAAiB"}
|
package/lib/variants/index.js
CHANGED
|
@@ -6,8 +6,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
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"));
|
|
9
14
|
var _ThumbnailCarousel = _interopRequireDefault(require("./ThumbnailCarousel"));
|
|
10
15
|
var _default = exports["default"] = {
|
|
16
|
+
heroImage: _HeroImage["default"],
|
|
17
|
+
infographic: _Infographic["default"],
|
|
18
|
+
longformGallery: _LongformGallery["default"],
|
|
19
|
+
longformRow: _LongformRow["default"],
|
|
20
|
+
parallaxImageTextRight: _ParallaxImageTextRight["default"],
|
|
11
21
|
thumbnailCarousel: _ThumbnailCarousel["default"]
|
|
12
22
|
};
|
|
13
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_HeroImage","_interopRequireDefault","require","_Infographic","_LongformGallery","_LongformRow","_ParallaxImageTextRight","_ThumbnailCarousel","_default","exports","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,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;AACA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAAoD,IAAAM,QAAA,GAAAC,OAAA,cAErC;EACbC,SAAS,EAATA,qBAAS;EACTC,WAAW,EAAXA,uBAAW;EACXC,eAAe,EAAfA,2BAAe;EACfC,WAAW,EAAXA,uBAAW;EACXC,sBAAsB,EAAtBA,kCAAsB;EACtBC,iBAAiB,EAAjBA;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":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,SAAS,QAAQ,aAA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KAAA,CAAA2B,aAAA,CAACD,gBAAgB;MACfc,GAAG,EAAEJ,OAAQ;MACbG,EAAE,EAAEN,WAAY;MAChBL,SAAS,EAAEJ,YAAa;MACxBK,IAAI,EAAC,UAAU;MACfM,KAAK,EAAEA,KAAM;MACb,mBAAiBA;IAAM,GACtBa,YACe,CAAC;EAEvB,CAAC,CACE,CAAC;AAEV,CAAC;AAEDrC,gBAAgB,CAACsC,SAAS,GAAG;EAC3BrC,IAAI,EAAET,SAAS,CAAC+C,MAAM,CAACC,UAAU;EACjCtC,WAAW,EAAEV,SAAS,CAAC+C,MAAM,CAACC,UAAU;EACxCrC,aAAa,EAAEX,SAAS,CAACiD,KAAK,CAACD,UAAU;EACzCpC,YAAY,EAAEZ,SAAS,CAACiD,KAAK,CAACD,UAAU;EACxCnC,gBAAgB,EAAEb,SAAS,CAACkD;AAC9B,CAAC;AAED1C,gBAAgB,CAAC2C,YAAY,GAAG;EAC9BtC,gBAAgB,EAAE;AACpB,CAAC;AAED,eAAeL,gBAAgB"}
|
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Player } from 'video-react';
|
|
4
|
+
import { VIDEO_WRAPPER_CLASS_NAME } from '../../../constants';
|
|
5
|
+
|
|
4
6
|
// import 'video-react/styles/scss/video-react.scss';
|
|
5
7
|
|
|
6
8
|
const Default = ({
|
|
7
9
|
modifier,
|
|
8
10
|
url,
|
|
9
|
-
autoplay
|
|
10
|
-
|
|
11
|
+
autoplay,
|
|
12
|
+
loop
|
|
13
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: VIDEO_WRAPPER_CLASS_NAME
|
|
15
|
+
}, /*#__PURE__*/React.createElement(Player, {
|
|
11
16
|
className: modifier,
|
|
12
17
|
preload: "none",
|
|
13
18
|
autoPlay: autoplay,
|
|
19
|
+
loop: loop,
|
|
14
20
|
muted: autoplay
|
|
15
21
|
}, /*#__PURE__*/React.createElement("source", {
|
|
16
|
-
src: url
|
|
17
|
-
|
|
18
|
-
}));
|
|
22
|
+
src: url
|
|
23
|
+
})));
|
|
19
24
|
Default.propTypes = {
|
|
20
25
|
url: PropTypes.string.isRequired,
|
|
21
26
|
modifier: PropTypes.string,
|
|
22
|
-
autoplay: PropTypes.bool
|
|
27
|
+
autoplay: PropTypes.bool,
|
|
28
|
+
loop: PropTypes.bool
|
|
23
29
|
};
|
|
24
30
|
Default.defaultProps = {
|
|
25
31
|
modifier: null,
|
|
26
|
-
autoplay: false
|
|
32
|
+
autoplay: false,
|
|
33
|
+
loop: false
|
|
27
34
|
};
|
|
28
35
|
export default Default;
|
|
29
36
|
//# sourceMappingURL=Default.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Default.js","names":["React","PropTypes","Player","Default","modifier","url","autoplay","createElement","className","preload","autoPlay","muted","src","
|
|
1
|
+
{"version":3,"file":"Default.js","names":["React","PropTypes","Player","VIDEO_WRAPPER_CLASS_NAME","Default","modifier","url","autoplay","loop","createElement","className","preload","autoPlay","muted","src","propTypes","string","isRequired","bool","defaultProps"],"sources":["../../../../src/components/Video/providers/Default.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Player } from 'video-react';\nimport { VIDEO_WRAPPER_CLASS_NAME } from '../../../constants';\n\n// import 'video-react/styles/scss/video-react.scss';\n\nconst Default = ({ modifier, url, autoplay, loop }) => (\n <div className={VIDEO_WRAPPER_CLASS_NAME}>\n <Player className={modifier} preload=\"none\" autoPlay={autoplay} loop={loop} muted={autoplay}>\n <source src={url} />\n </Player>\n </div>\n);\n\nDefault.propTypes = {\n url: PropTypes.string.isRequired,\n modifier: PropTypes.string,\n autoplay: PropTypes.bool,\n loop: PropTypes.bool\n};\n\nDefault.defaultProps = {\n modifier: null,\n autoplay: false,\n loop: false\n};\n\nexport default Default;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,MAAM,QAAQ,aAAa;AACpC,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;;AAEA,MAAMC,OAAO,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,GAAG;EAAEC,QAAQ;EAAEC;AAAK,CAAC,kBAChDR,KAAA,CAAAS,aAAA;EAAKC,SAAS,EAAEP;AAAyB,gBACvCH,KAAA,CAAAS,aAAA,CAACP,MAAM;EAACQ,SAAS,EAAEL,QAAS;EAACM,OAAO,EAAC,MAAM;EAACC,QAAQ,EAAEL,QAAS;EAACC,IAAI,EAAEA,IAAK;EAACK,KAAK,EAAEN;AAAS,gBAC1FP,KAAA,CAAAS,aAAA;EAAQK,GAAG,EAAER;AAAI,CAAE,CACb,CACL,CACN;AAEDF,OAAO,CAACW,SAAS,GAAG;EAClBT,GAAG,EAAEL,SAAS,CAACe,MAAM,CAACC,UAAU;EAChCZ,QAAQ,EAAEJ,SAAS,CAACe,MAAM;EAC1BT,QAAQ,EAAEN,SAAS,CAACiB,IAAI;EACxBV,IAAI,EAAEP,SAAS,CAACiB;AAClB,CAAC;AAEDd,OAAO,CAACe,YAAY,GAAG;EACrBd,QAAQ,EAAE,IAAI;EACdE,QAAQ,EAAE,KAAK;EACfC,IAAI,EAAE;AACR,CAAC;AAED,eAAeJ,OAAO"}
|
|
@@ -3,7 +3,8 @@ const SUPPORTED_PROVIDERS = {
|
|
|
3
3
|
youtube: dynamic(() => import( /* webpackChunkName: "blazePbVideoYouTube" */'./YouTube/YouTubeProvider')),
|
|
4
4
|
JWPlayer: dynamic(() => import( /* webpackChunkName: "blazePbVideoJWPlayer" */'./JWPlayer/JWPlayerProvider')),
|
|
5
5
|
vimeo: dynamic(() => import( /* webpackChunkName: "blazePbVideoVimeo" */'./Vimeo/VimeoProvider')),
|
|
6
|
-
default: dynamic(() => import( /* webpackChunkName: "blazePbVideoDefault" */'./Default'))
|
|
6
|
+
default: dynamic(() => import( /* webpackChunkName: "blazePbVideoDefault" */'./Default')),
|
|
7
|
+
html: dynamic(() => import( /* webpackChunkName: "blazePbVideoDefault" */'./Default'))
|
|
7
8
|
};
|
|
8
9
|
function getProvider(provider) {
|
|
9
10
|
return SUPPORTED_PROVIDERS[provider] || SUPPORTED_PROVIDERS.default;
|