@blaze-cms/react-page-builder 0.146.0-node18-tooltips.41 → 0.146.0-node18-tooltips.42
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/ContentGroup.js +27 -5
- package/lib/components/ContentGroup/ContentGroup.js.map +1 -1
- package/lib/components/Layout/Layout.js +13 -3
- package/lib/components/Layout/Layout.js.map +1 -1
- package/lib/helpers/get-custom-html-properties.js +24 -0
- package/lib/helpers/get-custom-html-properties.js.map +1 -0
- package/lib/helpers/index.js +7 -0
- package/lib/helpers/index.js.map +1 -1
- package/lib-es/components/ContentGroup/ContentGroup.js +22 -5
- package/lib-es/components/ContentGroup/ContentGroup.js.map +1 -1
- package/lib-es/components/Layout/Layout.js +14 -5
- package/lib-es/components/Layout/Layout.js.map +1 -1
- package/lib-es/helpers/get-custom-html-properties.js +13 -0
- package/lib-es/helpers/get-custom-html-properties.js.map +1 -0
- package/lib-es/helpers/index.js +1 -0
- package/lib-es/helpers/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/ContentGroup/ContentGroup.js +22 -5
- package/src/components/Layout/Layout.js +14 -3
- package/src/helpers/get-custom-html-properties.js +11 -0
- package/src/helpers/index.js +1 -0
- package/tests/unit/src/Layout/Layout.test.js +47 -0
- package/tests/unit/src/components/ContentGroup/ContentGroup.test.js +43 -0
- package/tests/unit/src/helpers/get-custom-html-properties.test.js +48 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.146.0-node18-tooltips.42](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.41...v0.146.0-node18-tooltips.42) (2026-03-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add customHtmlProps to row, column, contentGroup to allow setting custom html properties ([#5123](https://github.com/thebyte9/blaze/issues/5123)) ([e9ce076](https://github.com/thebyte9/blaze/commit/e9ce076fa7a15cd2ca1343323754bf952f35b841))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [0.146.0-node18-tooltips.41](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.40...v0.146.0-node18-tooltips.41) (2026-03-03)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.symbol.js");
|
|
4
|
+
require("core-js/modules/es.array.filter.js");
|
|
5
|
+
require("core-js/modules/es.array.for-each.js");
|
|
3
6
|
require("core-js/modules/es.array.iterator.js");
|
|
7
|
+
require("core-js/modules/es.object.define-properties.js");
|
|
4
8
|
require("core-js/modules/es.object.define-property.js");
|
|
5
9
|
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
10
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
11
|
+
require("core-js/modules/es.object.keys.js");
|
|
6
12
|
require("core-js/modules/es.object.to-string.js");
|
|
7
13
|
require("core-js/modules/es.string.iterator.js");
|
|
8
14
|
require("core-js/modules/es.weak-map.js");
|
|
15
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
9
16
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
10
17
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
11
18
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
@@ -14,6 +21,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
14
21
|
});
|
|
15
22
|
exports["default"] = void 0;
|
|
16
23
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
24
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
25
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
18
26
|
require("core-js/modules/es.array.includes.js");
|
|
19
27
|
require("core-js/modules/es.object.values.js");
|
|
@@ -25,16 +33,20 @@ var _ContentGroupTabs = _interopRequireDefault(require("./ContentGroupTabs"));
|
|
|
25
33
|
var _ContentGroupAccordion = _interopRequireDefault(require("./ContentGroupAccordion"));
|
|
26
34
|
var _helpers = require("./helpers");
|
|
27
35
|
var _getStructuredDataProperties = _interopRequireDefault(require("./helpers/get-structured-data-properties"));
|
|
28
|
-
var
|
|
36
|
+
var _helpers2 = require("../../helpers");
|
|
37
|
+
var _excluded = ["contentType", "isFaqContent", "children", "customHtmlProps"],
|
|
29
38
|
_excluded2 = ["topWrapperProps"];
|
|
30
39
|
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); }
|
|
31
40
|
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; }
|
|
41
|
+
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; }
|
|
42
|
+
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; }
|
|
32
43
|
var VALID_TYPES = Object.values(_constants.CONTENT_GROUP_TYPES);
|
|
33
44
|
var ContentGroup = function ContentGroup(_ref) {
|
|
34
45
|
var _children$props, _children$props$child;
|
|
35
46
|
var contentType = _ref.contentType,
|
|
36
47
|
isFaqContent = _ref.isFaqContent,
|
|
37
48
|
children = _ref.children,
|
|
49
|
+
customHtmlProps = _ref.customHtmlProps,
|
|
38
50
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
39
51
|
var groupSections = children === null || children === void 0 ? void 0 : (_children$props = children.props) === null || _children$props === void 0 ? void 0 : (_children$props$child = _children$props.children) === null || _children$props$child === void 0 ? void 0 : _children$props$child[1];
|
|
40
52
|
var GroupComponent = (0, _react.useMemo)(function () {
|
|
@@ -44,8 +56,13 @@ var ContentGroup = function ContentGroup(_ref) {
|
|
|
44
56
|
return !isFaqContent ? _react.Fragment : 'div';
|
|
45
57
|
}, [isFaqContent]);
|
|
46
58
|
var _useMemo = (0, _react.useMemo)(function () {
|
|
47
|
-
|
|
48
|
-
|
|
59
|
+
var structuredDataProperties = (0, _getStructuredDataProperties["default"])(isFaqContent);
|
|
60
|
+
return _objectSpread(_objectSpread({}, structuredDataProperties), {}, {
|
|
61
|
+
topWrapperProps: _objectSpread(_objectSpread({}, structuredDataProperties.topWrapperProps), (0, _helpers2.getCustomHtmlProperties)({
|
|
62
|
+
customHtmlProps: customHtmlProps
|
|
63
|
+
}))
|
|
64
|
+
});
|
|
65
|
+
}, [isFaqContent, customHtmlProps]),
|
|
49
66
|
topWrapperProps = _useMemo.topWrapperProps,
|
|
50
67
|
schemaProperties = (0, _objectWithoutProperties2["default"])(_useMemo, _excluded2);
|
|
51
68
|
if (!groupSections || !groupSections.length || !VALID_TYPES.includes(contentType)) return '';
|
|
@@ -59,10 +76,15 @@ var ContentGroup = function ContentGroup(_ref) {
|
|
|
59
76
|
ContentGroup.propTypes = {
|
|
60
77
|
children: _propTypes["default"].object.isRequired,
|
|
61
78
|
contentType: _propTypes["default"].oneOf(VALID_TYPES).isRequired,
|
|
62
|
-
isFaqContent: _propTypes["default"].bool
|
|
79
|
+
isFaqContent: _propTypes["default"].bool,
|
|
80
|
+
customHtmlProps: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
81
|
+
name: _propTypes["default"].string,
|
|
82
|
+
value: _propTypes["default"].string
|
|
83
|
+
}))
|
|
63
84
|
};
|
|
64
85
|
ContentGroup.defaultProps = {
|
|
65
|
-
isFaqContent: false
|
|
86
|
+
isFaqContent: false,
|
|
87
|
+
customHtmlProps: []
|
|
66
88
|
};
|
|
67
89
|
var _default = exports["default"] = ContentGroup;
|
|
68
90
|
//# sourceMappingURL=ContentGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentGroup.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_constants","_ContentGroupTabs","_ContentGroupAccordion","_helpers","_getStructuredDataProperties","_excluded","_excluded2","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","VALID_TYPES","values","CONTENT_GROUP_TYPES","ContentGroup","_ref","_children$props","_children$props$child","contentType","isFaqContent","children","props","_objectWithoutProperties2","groupSections","GroupComponent","useMemo","ACCORDION","ContentGroupAccordion","ContentGroupTabs","WrapperComponent","Fragment","_useMemo","getStructuredDataProperties","topWrapperProps","
|
|
1
|
+
{"version":3,"file":"ContentGroup.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_constants","_ContentGroupTabs","_ContentGroupAccordion","_helpers","_getStructuredDataProperties","_helpers2","_excluded","_excluded2","_getRequireWildcardCache","e","WeakMap","r","t","__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","VALID_TYPES","values","CONTENT_GROUP_TYPES","ContentGroup","_ref","_children$props","_children$props$child","contentType","isFaqContent","children","customHtmlProps","props","_objectWithoutProperties2","groupSections","GroupComponent","useMemo","ACCORDION","ContentGroupAccordion","ContentGroupTabs","WrapperComponent","Fragment","_useMemo","structuredDataProperties","getStructuredDataProperties","topWrapperProps","getCustomHtmlProperties","schemaProperties","includes","sectionsData","getSectionsData","createElement","_extends2","propTypes","PropTypes","object","isRequired","oneOf","bool","arrayOf","shape","name","string","value","defaultProps","_default","exports"],"sources":["../../../src/components/ContentGroup/ContentGroup.js"],"sourcesContent":["import React, { Fragment, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { CONTENT_GROUP_TYPES } from './constants';\nimport ContentGroupTabs from './ContentGroupTabs';\nimport ContentGroupAccordion from './ContentGroupAccordion';\nimport { getSectionsData } from './helpers';\nimport getStructuredDataProperties from './helpers/get-structured-data-properties';\nimport { getCustomHtmlProperties } from '../../helpers';\n\nconst VALID_TYPES = Object.values(CONTENT_GROUP_TYPES);\n\nconst ContentGroup = ({ contentType, isFaqContent, children, customHtmlProps, ...props }) => {\n const groupSections = children?.props?.children?.[1];\n\n const GroupComponent = useMemo(\n () =>\n contentType === CONTENT_GROUP_TYPES.ACCORDION ? ContentGroupAccordion : ContentGroupTabs,\n [contentType]\n );\n const WrapperComponent = useMemo(() => (!isFaqContent ? Fragment : 'div'), [isFaqContent]);\n\n const { topWrapperProps, ...schemaProperties } = useMemo(\n () => {\n const structuredDataProperties = getStructuredDataProperties(isFaqContent);\n return {\n ...structuredDataProperties,\n topWrapperProps: {\n ...structuredDataProperties.topWrapperProps,\n ...getCustomHtmlProperties({ customHtmlProps })\n }\n };\n },\n [isFaqContent, customHtmlProps]\n );\n\n if (!groupSections || !groupSections.length || !VALID_TYPES.includes(contentType)) return '';\n\n const sectionsData = getSectionsData(groupSections);\n\n return (\n <WrapperComponent {...topWrapperProps}>\n <GroupComponent\n contentType={contentType}\n groupSections={groupSections}\n sectionsData={sectionsData}\n {...props}\n {...schemaProperties}\n />\n </WrapperComponent>\n );\n};\n\nContentGroup.propTypes = {\n children: PropTypes.object.isRequired,\n contentType: PropTypes.oneOf(VALID_TYPES).isRequired,\n isFaqContent: PropTypes.bool,\n customHtmlProps: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n value: PropTypes.string\n })\n )\n};\n\nContentGroup.defaultProps = {\n isFaqContent: false,\n customHtmlProps: []\n};\n\nexport default ContentGroup;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,sBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,4BAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AAAwD,IAAAS,SAAA;EAAAC,UAAA;AAAA,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,SAAAb,wBAAAa,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAA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EAAE0B,qBAAS,CAACG,KAAK,CAACpC,WAAW,CAAC,CAACmC,UAAU;EACpD3B,YAAY,EAAEyB,qBAAS,CAACI,IAAI;EAC5B3B,eAAe,EAAEuB,qBAAS,CAACK,OAAO,CAChCL,qBAAS,CAACM,KAAK,CAAC;IACdC,IAAI,EAAEP,qBAAS,CAACQ,MAAM;IACtBC,KAAK,EAAET,qBAAS,CAACQ;EACnB,CAAC,CACH;AACF,CAAC;AAEDtC,YAAY,CAACwC,YAAY,GAAG;EAC1BnC,YAAY,EAAE,KAAK;EACnBE,eAAe,EAAE;AACnB,CAAC;AAAC,IAAAkC,QAAA,GAAAC,OAAA,cAEa1C,YAAY","ignoreList":[]}
|
|
@@ -27,7 +27,7 @@ var _hooks = require("../../hooks");
|
|
|
27
27
|
var _helpers = require("./helpers");
|
|
28
28
|
var _helpers2 = require("../../helpers");
|
|
29
29
|
var _constants = require("../../constants");
|
|
30
|
-
var _excluded = ["type", "children", "settings", "modifier", "backgroundImage", "tagType", "dataNoSnippet", "sticky", "VariantComponent"];
|
|
30
|
+
var _excluded = ["type", "children", "settings", "modifier", "backgroundImage", "tagType", "dataNoSnippet", "sticky", "VariantComponent", "customHtmlProps"];
|
|
31
31
|
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; }
|
|
32
32
|
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; }
|
|
33
33
|
var Layout = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
@@ -40,6 +40,8 @@ var Layout = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
40
40
|
dataNoSnippet = _ref.dataNoSnippet,
|
|
41
41
|
sticky = _ref.sticky,
|
|
42
42
|
VariantComponent = _ref.VariantComponent,
|
|
43
|
+
_ref$customHtmlProps = _ref.customHtmlProps,
|
|
44
|
+
customHtmlProps = _ref$customHtmlProps === void 0 ? [] : _ref$customHtmlProps,
|
|
43
45
|
otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
44
46
|
var _useGetImages = (0, _hooks.useGetImages)(backgroundImage),
|
|
45
47
|
_useGetImages$data$ge = _useGetImages.data.getFile,
|
|
@@ -58,6 +60,9 @@ var Layout = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
58
60
|
if (type === _constants.COLUMN && !(0, _helpers2.hasChildren)(children)) return null;
|
|
59
61
|
var otherWrapperProps = {};
|
|
60
62
|
if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;
|
|
63
|
+
var customHtmlProperties = (0, _helpers2.getCustomHtmlProperties)({
|
|
64
|
+
customHtmlProps: customHtmlProps
|
|
65
|
+
});
|
|
61
66
|
var WrapperComponent = VariantComponent || _Wrapper["default"];
|
|
62
67
|
return /*#__PURE__*/_react["default"].createElement(WrapperComponent, (0, _extends2["default"])({
|
|
63
68
|
ref: ref,
|
|
@@ -65,7 +70,7 @@ var Layout = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
65
70
|
className: type,
|
|
66
71
|
modifiers: "".concat(classModifiers).concat(additionalRowModifier),
|
|
67
72
|
style: style
|
|
68
|
-
}, otherWrapperProps), title && /*#__PURE__*/_react["default"].createElement("h2", {
|
|
73
|
+
}, otherWrapperProps, customHtmlProperties), title && /*#__PURE__*/_react["default"].createElement("h2", {
|
|
69
74
|
className: "heading heading--section"
|
|
70
75
|
}, title), (0, _helpers2.renderChildren)(children, otherProps));
|
|
71
76
|
});
|
|
@@ -80,6 +85,10 @@ Layout.propTypes = {
|
|
|
80
85
|
tagType: _propTypes["default"].string,
|
|
81
86
|
dataNoSnippet: _propTypes["default"].bool,
|
|
82
87
|
VariantComponent: _propTypes["default"].func,
|
|
88
|
+
customHtmlProps: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
89
|
+
name: _propTypes["default"].string,
|
|
90
|
+
value: _propTypes["default"].string
|
|
91
|
+
})),
|
|
83
92
|
children: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node]).isRequired
|
|
84
93
|
};
|
|
85
94
|
Layout.defaultProps = {
|
|
@@ -91,7 +100,8 @@ Layout.defaultProps = {
|
|
|
91
100
|
tagType: '',
|
|
92
101
|
dataNoSnippet: false,
|
|
93
102
|
sticky: false,
|
|
94
|
-
VariantComponent: null
|
|
103
|
+
VariantComponent: null,
|
|
104
|
+
customHtmlProps: []
|
|
95
105
|
};
|
|
96
106
|
var _default = exports["default"] = Layout;
|
|
97
107
|
//# sourceMappingURL=Layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","names":["_react","_interopRequireDefault","require","_propTypes","_Wrapper","_utils","_hooks","_helpers","_helpers2","_constants","_excluded","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","Layout","React","forwardRef","_ref","ref","type","children","settings","modifier","backgroundImage","tagType","dataNoSnippet","sticky","VariantComponent","otherProps","_objectWithoutProperties2","_useGetImages","useGetImages","_useGetImages$data$ge","data","getFile","_useGetImages$data$ge2","_useGetImages$data$ge3","url","style","getStylesToUpdate","title","classModifiers","getClassModifiers","additionalRowModifier","checkIfRowHasColumns","COLUMN","hasChildren","otherWrapperProps","WrapperComponent","Wrapper","createElement","_extends2","className","modifiers","concat","renderChildren","propTypes","PropTypes","string","isRequired","bool","shape","func","
|
|
1
|
+
{"version":3,"file":"Layout.js","names":["_react","_interopRequireDefault","require","_propTypes","_Wrapper","_utils","_hooks","_helpers","_helpers2","_constants","_excluded","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","Layout","React","forwardRef","_ref","ref","type","children","settings","modifier","backgroundImage","tagType","dataNoSnippet","sticky","VariantComponent","_ref$customHtmlProps","customHtmlProps","otherProps","_objectWithoutProperties2","_useGetImages","useGetImages","_useGetImages$data$ge","data","getFile","_useGetImages$data$ge2","_useGetImages$data$ge3","url","style","getStylesToUpdate","title","classModifiers","getClassModifiers","additionalRowModifier","checkIfRowHasColumns","COLUMN","hasChildren","otherWrapperProps","customHtmlProperties","getCustomHtmlProperties","WrapperComponent","Wrapper","createElement","_extends2","className","modifiers","concat","renderChildren","propTypes","PropTypes","string","isRequired","bool","shape","func","arrayOf","name","value","oneOfType","node","defaultProps","_default","exports"],"sources":["../../../src/components/Layout/Layout.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Wrapper from '../Wrapper';\nimport { getClassModifiers } from '../../utils';\nimport { useGetImages } from '../../hooks';\nimport { getStylesToUpdate, checkIfRowHasColumns } from './helpers';\nimport { renderChildren, hasChildren, getCustomHtmlProperties } from '../../helpers';\nimport { COLUMN } from '../../constants';\n\nconst Layout = React.forwardRef(\n (\n {\n type,\n children,\n settings,\n modifier,\n backgroundImage,\n tagType,\n dataNoSnippet,\n sticky,\n VariantComponent,\n customHtmlProps = [],\n ...otherProps\n },\n ref\n ) => {\n const {\n data: { getFile: { url = null } = {} }\n } = useGetImages(backgroundImage);\n const style = getStylesToUpdate({ backgroundImage: url });\n const { title } = settings;\n const classModifiers = getClassModifiers(type, { modifier, sticky, ...otherProps });\n const additionalRowModifier = checkIfRowHasColumns(type, children) ? ' display-row' : '';\n\n if (type === COLUMN && !hasChildren(children)) return null;\n\n const otherWrapperProps = {};\n if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;\n\n const customHtmlProperties = getCustomHtmlProperties({ customHtmlProps });\n\n const WrapperComponent = VariantComponent || Wrapper;\n\n return (\n <WrapperComponent\n ref={ref}\n tagType={tagType}\n className={type}\n modifiers={`${classModifiers}${additionalRowModifier}`}\n style={style}\n {...otherWrapperProps}\n {...customHtmlProperties}>\n {title && <h2 className=\"heading heading--section\">{title}</h2>}\n {renderChildren(children, otherProps)}\n </WrapperComponent>\n );\n }\n);\n\nLayout.propTypes = {\n type: PropTypes.string.isRequired,\n sticky: PropTypes.bool,\n settings: PropTypes.shape({\n title: PropTypes.string\n }),\n modifier: PropTypes.string,\n backgroundImage: PropTypes.string,\n tagType: PropTypes.string,\n dataNoSnippet: PropTypes.bool,\n VariantComponent: PropTypes.func,\n customHtmlProps: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n value: PropTypes.string\n })\n ),\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired\n};\n\nLayout.defaultProps = {\n settings: {\n title: ''\n },\n backgroundImage: '',\n modifier: '',\n tagType: '',\n dataNoSnippet: false,\n sticky: false,\n VariantComponent: null,\n customHtmlProps: []\n};\n\nexport default Layout;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAAyC,IAAAQ,SAAA;AAAA,SAAAC,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,G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S,CAACM,OAAO,CAACN,qBAAS,CAACU,IAAI,CAAC,EAAEV,qBAAS,CAACU,IAAI,CAAC,CAAC,CAACR;AACrF,CAAC;AAEDjD,MAAM,CAAC0D,YAAY,GAAG;EACpBnD,QAAQ,EAAE;IACRqB,KAAK,EAAE;EACT,CAAC;EACDnB,eAAe,EAAE,EAAE;EACnBD,QAAQ,EAAE,EAAE;EACZE,OAAO,EAAE,EAAE;EACXC,aAAa,EAAE,KAAK;EACpBC,MAAM,EAAE,KAAK;EACbC,gBAAgB,EAAE,IAAI;EACtBE,eAAe,EAAE;AACnB,CAAC;AAAC,IAAA4C,QAAA,GAAAC,OAAA,cAEa5D,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
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.reduce.js");
|
|
9
|
+
require("core-js/modules/es.function.name.js");
|
|
10
|
+
require("core-js/modules/es.object.to-string.js");
|
|
11
|
+
var getCustomHtmlProperties = function getCustomHtmlProperties(_ref) {
|
|
12
|
+
var _ref$customHtmlProps = _ref.customHtmlProps,
|
|
13
|
+
customHtmlProps = _ref$customHtmlProps === void 0 ? [] : _ref$customHtmlProps;
|
|
14
|
+
return customHtmlProps ? customHtmlProps.reduce(function (acc, _ref2) {
|
|
15
|
+
var name = _ref2.name,
|
|
16
|
+
value = _ref2.value;
|
|
17
|
+
if (name) {
|
|
18
|
+
acc[name] = value !== 'null' ? value : undefined;
|
|
19
|
+
}
|
|
20
|
+
return acc;
|
|
21
|
+
}, {}) : {};
|
|
22
|
+
};
|
|
23
|
+
var _default = exports["default"] = getCustomHtmlProperties;
|
|
24
|
+
//# sourceMappingURL=get-custom-html-properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-custom-html-properties.js","names":["getCustomHtmlProperties","_ref","_ref$customHtmlProps","customHtmlProps","reduce","acc","_ref2","name","value","undefined","_default","exports"],"sources":["../../src/helpers/get-custom-html-properties.js"],"sourcesContent":["const getCustomHtmlProperties = ({ customHtmlProps = [] }) =>\n customHtmlProps\n ? customHtmlProps.reduce((acc, { name, value }) => {\n if (name) {\n acc[name] = value !== 'null' ? value : undefined;\n }\n return acc;\n }, {})\n : {};\n\nexport default getCustomHtmlProperties;\n"],"mappings":";;;;;;;;;;AAAA,IAAMA,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAAC,IAAA;EAAA,IAAAC,oBAAA,GAAAD,IAAA,CAAME,eAAe;IAAfA,eAAe,GAAAD,oBAAA,cAAG,EAAE,GAAAA,oBAAA;EAAA,OACrDC,eAAe,GACXA,eAAe,CAACC,MAAM,CAAC,UAACC,GAAG,EAAAC,KAAA,EAAsB;IAAA,IAAlBC,IAAI,GAAAD,KAAA,CAAJC,IAAI;MAAEC,KAAK,GAAAF,KAAA,CAALE,KAAK;IACxC,IAAID,IAAI,EAAE;MACRF,GAAG,CAACE,IAAI,CAAC,GAAGC,KAAK,KAAK,MAAM,GAAGA,KAAK,GAAGC,SAAS;IAClD;IACA,OAAOJ,GAAG;EACZ,CAAC,EAAE,CAAC,CAAC,CAAC,GACN,CAAC,CAAC;AAAA;AAAC,IAAAK,QAAA,GAAAC,OAAA,cAEMX,uBAAuB","ignoreList":[]}
|
package/lib/helpers/index.js
CHANGED
|
@@ -131,6 +131,12 @@ Object.defineProperty(exports, "getCurrentOffset", {
|
|
|
131
131
|
return _getCurrentOffset["default"];
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
|
+
Object.defineProperty(exports, "getCustomHtmlProperties", {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get: function get() {
|
|
137
|
+
return _getCustomHtmlProperties["default"];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
134
140
|
Object.defineProperty(exports, "getDisplayCountData", {
|
|
135
141
|
enumerable: true,
|
|
136
142
|
get: function get() {
|
|
@@ -453,4 +459,5 @@ var _shouldSkipSingleQuery = _interopRequireDefault(require("./should-skip-singl
|
|
|
453
459
|
var _buildRawQueryStringified = _interopRequireDefault(require("./build-raw-query-stringified"));
|
|
454
460
|
var _buildFiltersQuery = _interopRequireDefault(require("./build-filters-query"));
|
|
455
461
|
var _getComponentId = _interopRequireDefault(require("./get-component-id"));
|
|
462
|
+
var _getCustomHtmlProperties = _interopRequireDefault(require("./get-custom-html-properties"));
|
|
456
463
|
//# sourceMappingURL=index.js.map
|
package/lib/helpers/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_buildInheritedFilters","_interopRequireDefault","require","_buildLinkExtraProps","_buildPropsQuery","_buildQueryFields","_buildRawQuery","_buildRawQueryBase","_buildSearchValuesCheckboxSelect","_buildSearchValuesText","_buildSetFilters","_checkPropsToUse","_getElasticsearchOperator","_getClickWrapperOptions","_getEntitiesWithBanner","_getEntityData","_getEntityRenderProps","_getGenericProps","_getGenericRenderVariables","_getImageIds","_getInheritedFilters","_getModifiers","_getNotEqualQuery","_getPaginationIndex","_getParsedSummaryValue","_getQueryFilters","_getQueryProps","_getRequiredSchemas","_getSearchFilterType","_getUnpublishedEntityName","_getWrappedValueWithLink","_getItemsToDisplayIds","_isBrowser","_isFilterEntitysId","_isObject","_isUsingRelationImage","_parsePropsToDisplay","_renderChildren","_shouldRenderWaypoint","_shouldShowProperty","_sortResponseData","_splitChildren","_getCurrentOffset","_updateChildrensParent","_getDisplayCountData","_buildImageProperties","_getUpdatedFilterBy","_checkForError","_removeUnwantedCharacters","_hasChildren","_removeExtraItems","_getParsedPropValues","_getSanitizedPropValues","_appendImages","_parseTextBlock","_processDataSummaryValue","_buildQueryKey","_filterQuerySetup","_filtersSetup","_getUpdatedItemsToDisplay","_getUpdatedSortProperties","_shouldReturn","_shouldSkipSingleQuery","_buildRawQueryStringified","_buildFiltersQuery","_getComponentId"],"sources":["../../src/helpers/index.js"],"sourcesContent":["export { default as buildInheritedFilters } from './build-inherited-filters';\nexport { default as buildLinkExtraProps } from './build-link-extra-props';\nexport { default as buildPropsQuery } from './build-props-query';\nexport { default as buildQueryFields } from './build-query-fields';\nexport { default as buildRawQuery } from './build-raw-query';\nexport { default as buildRawQueryBase } from './build-raw-query-base';\nexport { default as buildSearchValuesCheckboxSelect } from './build-search-values-checkbox-select';\nexport { default as buildSearchValuesText } from './build-search-values-text';\nexport { default as buildSetFilters } from './build-set-filters';\nexport { default as checkPropsToUse } from './check-props-to-use';\nexport { default as getElasticsearchOperator } from './get-elasticsearch-operator';\nexport { default as getClickWrapperOptions } from './get-click-wrapper-options';\nexport { default as getEntitiesWithBanner } from './get-entities-with-banner';\nexport { default as getEntityData } from './get-entity-data';\nexport { default as getEntityRenderProps } from './get-entity-render-props';\nexport { default as getGenericProps } from './get-generic-props';\nexport { default as getGenericRenderVariables } from './get-generic-render-variables';\nexport { default as getImageIds } from './get-image-ids';\nexport { default as getInheritedFilters } from './get-inherited-filters';\nexport { default as getModifiers } from './get-modifiers';\nexport { default as getNotEqualQuery } from './get-not-equal-query';\nexport { default as getPaginationIndex } from './get-pagination-index';\nexport { default as getParsedSummaryValue } from './get-parsed-summary-value';\nexport { default as getQueryFilters } from './get-query-filters';\nexport { default as getQueryProps } from './get-query-props';\nexport { default as getRequiredSchemas } from './get-required-schemas';\nexport { default as getSearchFilterType } from './get-search-filter-type';\nexport { default as getUnpublishedEntityName } from './get-unpublished-entity-name';\nexport { default as getWrappedValueWithLink } from './get-wrapped-value-with-link';\nexport { default as getItemsToDisplayIds } from './get-items-to-display-ids';\nexport { default as isBrowser } from './is-browser';\nexport { default as isFilterEntitysId } from './is-filter-entitys-id';\nexport { default as isObject } from './is-object';\nexport { default as isUsingRelationImage } from './is-using-relation-image';\nexport { default as parsePropsToDisplay } from './parse-props-to-display';\nexport { default as renderChildren } from './render-children';\nexport { default as shouldRenderWaypoint } from './should-render-waypoint';\nexport { default as shouldShowProperty } from './should-show-property';\nexport { default as sortResponseData } from './sort-response-data';\nexport { default as splitChildren } from './split-children';\nexport { default as getCurrentOffset } from './get-current-offset';\nexport { default as updateChildrensParent } from './update-childrens-parent';\nexport { default as getDisplayCountData } from './get-display-count-data';\nexport { default as buildImageProperties } from './build-image-properties';\nexport { default as getUpdatedFilterBy } from './get-updated-filter-by';\nexport { default as checkForError } from './check-for-error';\nexport { default as removeUnwantedCharacters } from './remove-unwanted-characters';\nexport { default as hasChildren } from './has-children';\nexport { default as removeExtraItems } from './remove-extra-items';\nexport { default as getParsedPropValues } from './get-parsed-prop-values';\nexport { default as getSanitizedPropValues } from './get-sanitized-prop-values';\nexport { default as appendImages } from './append-images';\nexport { default as parseTextBlock } from './parse-TextBlock';\nexport { default as processDataSummaryValue } from './process-data-summary-value';\nexport { default as buildQueryKey } from './build-query-key';\nexport { default as filterQuerySetup } from './filter-query-setup';\nexport { default as filtersSetup } from './filters-setup';\nexport { default as getUpdatedItemsToDisplay } from './get-updated-items-to-display';\nexport { default as getUpdatedSortProperties } from './get-updated-sort-properties';\nexport { default as shouldReturn } from './should-return';\nexport { default as shouldSkipSingleQuery } from './should-skip-single-query';\nexport { default as buildRawQueryStringified } from './build-raw-query-stringified';\nexport { default as buildFiltersQuery } from './build-filters-query';\nexport { default as getComponentId } from './get-component-id';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_buildInheritedFilters","_interopRequireDefault","require","_buildLinkExtraProps","_buildPropsQuery","_buildQueryFields","_buildRawQuery","_buildRawQueryBase","_buildSearchValuesCheckboxSelect","_buildSearchValuesText","_buildSetFilters","_checkPropsToUse","_getElasticsearchOperator","_getClickWrapperOptions","_getEntitiesWithBanner","_getEntityData","_getEntityRenderProps","_getGenericProps","_getGenericRenderVariables","_getImageIds","_getInheritedFilters","_getModifiers","_getNotEqualQuery","_getPaginationIndex","_getParsedSummaryValue","_getQueryFilters","_getQueryProps","_getRequiredSchemas","_getSearchFilterType","_getUnpublishedEntityName","_getWrappedValueWithLink","_getItemsToDisplayIds","_isBrowser","_isFilterEntitysId","_isObject","_isUsingRelationImage","_parsePropsToDisplay","_renderChildren","_shouldRenderWaypoint","_shouldShowProperty","_sortResponseData","_splitChildren","_getCurrentOffset","_updateChildrensParent","_getDisplayCountData","_buildImageProperties","_getUpdatedFilterBy","_checkForError","_removeUnwantedCharacters","_hasChildren","_removeExtraItems","_getParsedPropValues","_getSanitizedPropValues","_appendImages","_parseTextBlock","_processDataSummaryValue","_buildQueryKey","_filterQuerySetup","_filtersSetup","_getUpdatedItemsToDisplay","_getUpdatedSortProperties","_shouldReturn","_shouldSkipSingleQuery","_buildRawQueryStringified","_buildFiltersQuery","_getComponentId","_getCustomHtmlProperties"],"sources":["../../src/helpers/index.js"],"sourcesContent":["export { default as buildInheritedFilters } from './build-inherited-filters';\nexport { default as buildLinkExtraProps } from './build-link-extra-props';\nexport { default as buildPropsQuery } from './build-props-query';\nexport { default as buildQueryFields } from './build-query-fields';\nexport { default as buildRawQuery } from './build-raw-query';\nexport { default as buildRawQueryBase } from './build-raw-query-base';\nexport { default as buildSearchValuesCheckboxSelect } from './build-search-values-checkbox-select';\nexport { default as buildSearchValuesText } from './build-search-values-text';\nexport { default as buildSetFilters } from './build-set-filters';\nexport { default as checkPropsToUse } from './check-props-to-use';\nexport { default as getElasticsearchOperator } from './get-elasticsearch-operator';\nexport { default as getClickWrapperOptions } from './get-click-wrapper-options';\nexport { default as getEntitiesWithBanner } from './get-entities-with-banner';\nexport { default as getEntityData } from './get-entity-data';\nexport { default as getEntityRenderProps } from './get-entity-render-props';\nexport { default as getGenericProps } from './get-generic-props';\nexport { default as getGenericRenderVariables } from './get-generic-render-variables';\nexport { default as getImageIds } from './get-image-ids';\nexport { default as getInheritedFilters } from './get-inherited-filters';\nexport { default as getModifiers } from './get-modifiers';\nexport { default as getNotEqualQuery } from './get-not-equal-query';\nexport { default as getPaginationIndex } from './get-pagination-index';\nexport { default as getParsedSummaryValue } from './get-parsed-summary-value';\nexport { default as getQueryFilters } from './get-query-filters';\nexport { default as getQueryProps } from './get-query-props';\nexport { default as getRequiredSchemas } from './get-required-schemas';\nexport { default as getSearchFilterType } from './get-search-filter-type';\nexport { default as getUnpublishedEntityName } from './get-unpublished-entity-name';\nexport { default as getWrappedValueWithLink } from './get-wrapped-value-with-link';\nexport { default as getItemsToDisplayIds } from './get-items-to-display-ids';\nexport { default as isBrowser } from './is-browser';\nexport { default as isFilterEntitysId } from './is-filter-entitys-id';\nexport { default as isObject } from './is-object';\nexport { default as isUsingRelationImage } from './is-using-relation-image';\nexport { default as parsePropsToDisplay } from './parse-props-to-display';\nexport { default as renderChildren } from './render-children';\nexport { default as shouldRenderWaypoint } from './should-render-waypoint';\nexport { default as shouldShowProperty } from './should-show-property';\nexport { default as sortResponseData } from './sort-response-data';\nexport { default as splitChildren } from './split-children';\nexport { default as getCurrentOffset } from './get-current-offset';\nexport { default as updateChildrensParent } from './update-childrens-parent';\nexport { default as getDisplayCountData } from './get-display-count-data';\nexport { default as buildImageProperties } from './build-image-properties';\nexport { default as getUpdatedFilterBy } from './get-updated-filter-by';\nexport { default as checkForError } from './check-for-error';\nexport { default as removeUnwantedCharacters } from './remove-unwanted-characters';\nexport { default as hasChildren } from './has-children';\nexport { default as removeExtraItems } from './remove-extra-items';\nexport { default as getParsedPropValues } from './get-parsed-prop-values';\nexport { default as getSanitizedPropValues } from './get-sanitized-prop-values';\nexport { default as appendImages } from './append-images';\nexport { default as parseTextBlock } from './parse-TextBlock';\nexport { default as processDataSummaryValue } from './process-data-summary-value';\nexport { default as buildQueryKey } from './build-query-key';\nexport { default as filterQuerySetup } from './filter-query-setup';\nexport { default as filtersSetup } from './filters-setup';\nexport { default as getUpdatedItemsToDisplay } from './get-updated-items-to-display';\nexport { default as getUpdatedSortProperties } from './get-updated-sort-properties';\nexport { default as shouldReturn } from './should-return';\nexport { default as shouldSkipSingleQuery } from './should-skip-single-query';\nexport { default as buildRawQueryStringified } from './build-raw-query-stringified';\nexport { default as buildFiltersQuery } from './build-filters-query';\nexport { default as getComponentId } from './get-component-id';\nexport { default as getCustomHtmlProperties } from './get-custom-html-properties';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,sBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,gBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,cAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,gCAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,sBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,gBAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,gBAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,yBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,uBAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,sBAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,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,OAAA;AACA,IAAAgE,wBAAA,GAAAjE,sBAAA,CAAAC,OAAA","ignoreList":[]}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
const _excluded = ["contentType", "isFaqContent", "children"],
|
|
4
|
+
const _excluded = ["contentType", "isFaqContent", "children", "customHtmlProps"],
|
|
4
5
|
_excluded2 = ["topWrapperProps"];
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
5
8
|
import React, { Fragment, useMemo } from 'react';
|
|
6
9
|
import PropTypes from 'prop-types';
|
|
7
10
|
import { CONTENT_GROUP_TYPES } from './constants';
|
|
@@ -9,19 +12,28 @@ import ContentGroupTabs from './ContentGroupTabs';
|
|
|
9
12
|
import ContentGroupAccordion from './ContentGroupAccordion';
|
|
10
13
|
import { getSectionsData } from './helpers';
|
|
11
14
|
import getStructuredDataProperties from './helpers/get-structured-data-properties';
|
|
15
|
+
import { getCustomHtmlProperties } from '../../helpers';
|
|
12
16
|
const VALID_TYPES = Object.values(CONTENT_GROUP_TYPES);
|
|
13
17
|
const ContentGroup = _ref => {
|
|
14
18
|
var _children$props, _children$props$child;
|
|
15
19
|
let {
|
|
16
20
|
contentType,
|
|
17
21
|
isFaqContent,
|
|
18
|
-
children
|
|
22
|
+
children,
|
|
23
|
+
customHtmlProps
|
|
19
24
|
} = _ref,
|
|
20
25
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
26
|
const groupSections = children === null || children === void 0 ? void 0 : (_children$props = children.props) === null || _children$props === void 0 ? void 0 : (_children$props$child = _children$props.children) === null || _children$props$child === void 0 ? void 0 : _children$props$child[1];
|
|
22
27
|
const GroupComponent = useMemo(() => contentType === CONTENT_GROUP_TYPES.ACCORDION ? ContentGroupAccordion : ContentGroupTabs, [contentType]);
|
|
23
28
|
const WrapperComponent = useMemo(() => !isFaqContent ? Fragment : 'div', [isFaqContent]);
|
|
24
|
-
const _useMemo = useMemo(() =>
|
|
29
|
+
const _useMemo = useMemo(() => {
|
|
30
|
+
const structuredDataProperties = getStructuredDataProperties(isFaqContent);
|
|
31
|
+
return _objectSpread(_objectSpread({}, structuredDataProperties), {}, {
|
|
32
|
+
topWrapperProps: _objectSpread(_objectSpread({}, structuredDataProperties.topWrapperProps), getCustomHtmlProperties({
|
|
33
|
+
customHtmlProps
|
|
34
|
+
}))
|
|
35
|
+
});
|
|
36
|
+
}, [isFaqContent, customHtmlProps]),
|
|
25
37
|
{
|
|
26
38
|
topWrapperProps
|
|
27
39
|
} = _useMemo,
|
|
@@ -37,10 +49,15 @@ const ContentGroup = _ref => {
|
|
|
37
49
|
ContentGroup.propTypes = {
|
|
38
50
|
children: PropTypes.object.isRequired,
|
|
39
51
|
contentType: PropTypes.oneOf(VALID_TYPES).isRequired,
|
|
40
|
-
isFaqContent: PropTypes.bool
|
|
52
|
+
isFaqContent: PropTypes.bool,
|
|
53
|
+
customHtmlProps: PropTypes.arrayOf(PropTypes.shape({
|
|
54
|
+
name: PropTypes.string,
|
|
55
|
+
value: PropTypes.string
|
|
56
|
+
}))
|
|
41
57
|
};
|
|
42
58
|
ContentGroup.defaultProps = {
|
|
43
|
-
isFaqContent: false
|
|
59
|
+
isFaqContent: false,
|
|
60
|
+
customHtmlProps: []
|
|
44
61
|
};
|
|
45
62
|
export default ContentGroup;
|
|
46
63
|
//# sourceMappingURL=ContentGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentGroup.js","names":["React","Fragment","useMemo","PropTypes","CONTENT_GROUP_TYPES","ContentGroupTabs","ContentGroupAccordion","getSectionsData","getStructuredDataProperties","VALID_TYPES","Object","values","ContentGroup","_ref","_children$props","_children$props$child","contentType","isFaqContent","children","props","_objectWithoutProperties","_excluded","groupSections","GroupComponent","ACCORDION","WrapperComponent","_useMemo","topWrapperProps","schemaProperties","_excluded2","length","includes","sectionsData","createElement","_extends","propTypes","object","isRequired","oneOf","bool","defaultProps"],"sources":["../../../src/components/ContentGroup/ContentGroup.js"],"sourcesContent":["import React, { Fragment, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { CONTENT_GROUP_TYPES } from './constants';\nimport ContentGroupTabs from './ContentGroupTabs';\nimport ContentGroupAccordion from './ContentGroupAccordion';\nimport { getSectionsData } from './helpers';\nimport getStructuredDataProperties from './helpers/get-structured-data-properties';\n\nconst VALID_TYPES = Object.values(CONTENT_GROUP_TYPES);\n\nconst ContentGroup = ({ contentType, isFaqContent, children, ...props }) => {\n const groupSections = children?.props?.children?.[1];\n\n const GroupComponent = useMemo(\n () =>\n contentType === CONTENT_GROUP_TYPES.ACCORDION ? ContentGroupAccordion : ContentGroupTabs,\n [contentType]\n );\n const WrapperComponent = useMemo(() => (!isFaqContent ? Fragment : 'div'), [isFaqContent]);\n\n const { topWrapperProps, ...schemaProperties } = useMemo(\n () => getStructuredDataProperties(isFaqContent),\n [isFaqContent]\n );\n\n if (!groupSections || !groupSections.length || !VALID_TYPES.includes(contentType)) return '';\n\n const sectionsData = getSectionsData(groupSections);\n\n return (\n <WrapperComponent {...topWrapperProps}>\n <GroupComponent\n contentType={contentType}\n groupSections={groupSections}\n sectionsData={sectionsData}\n {...props}\n {...schemaProperties}\n />\n </WrapperComponent>\n );\n};\n\nContentGroup.propTypes = {\n children: PropTypes.object.isRequired,\n contentType: PropTypes.oneOf(VALID_TYPES).isRequired,\n isFaqContent: PropTypes.bool\n};\n\nContentGroup.defaultProps = {\n isFaqContent: false\n};\n\nexport default ContentGroup;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContentGroup.js","names":["React","Fragment","useMemo","PropTypes","CONTENT_GROUP_TYPES","ContentGroupTabs","ContentGroupAccordion","getSectionsData","getStructuredDataProperties","getCustomHtmlProperties","VALID_TYPES","Object","values","ContentGroup","_ref","_children$props","_children$props$child","contentType","isFaqContent","children","customHtmlProps","props","_objectWithoutProperties","_excluded","groupSections","GroupComponent","ACCORDION","WrapperComponent","_useMemo","structuredDataProperties","_objectSpread","topWrapperProps","schemaProperties","_excluded2","length","includes","sectionsData","createElement","_extends","propTypes","object","isRequired","oneOf","bool","arrayOf","shape","name","string","value","defaultProps"],"sources":["../../../src/components/ContentGroup/ContentGroup.js"],"sourcesContent":["import React, { Fragment, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { CONTENT_GROUP_TYPES } from './constants';\nimport ContentGroupTabs from './ContentGroupTabs';\nimport ContentGroupAccordion from './ContentGroupAccordion';\nimport { getSectionsData } from './helpers';\nimport getStructuredDataProperties from './helpers/get-structured-data-properties';\nimport { getCustomHtmlProperties } from '../../helpers';\n\nconst VALID_TYPES = Object.values(CONTENT_GROUP_TYPES);\n\nconst ContentGroup = ({ contentType, isFaqContent, children, customHtmlProps, ...props }) => {\n const groupSections = children?.props?.children?.[1];\n\n const GroupComponent = useMemo(\n () =>\n contentType === CONTENT_GROUP_TYPES.ACCORDION ? ContentGroupAccordion : ContentGroupTabs,\n [contentType]\n );\n const WrapperComponent = useMemo(() => (!isFaqContent ? Fragment : 'div'), [isFaqContent]);\n\n const { topWrapperProps, ...schemaProperties } = useMemo(\n () => {\n const structuredDataProperties = getStructuredDataProperties(isFaqContent);\n return {\n ...structuredDataProperties,\n topWrapperProps: {\n ...structuredDataProperties.topWrapperProps,\n ...getCustomHtmlProperties({ customHtmlProps })\n }\n };\n },\n [isFaqContent, customHtmlProps]\n );\n\n if (!groupSections || !groupSections.length || !VALID_TYPES.includes(contentType)) return '';\n\n const sectionsData = getSectionsData(groupSections);\n\n return (\n <WrapperComponent {...topWrapperProps}>\n <GroupComponent\n contentType={contentType}\n groupSections={groupSections}\n sectionsData={sectionsData}\n {...props}\n {...schemaProperties}\n />\n </WrapperComponent>\n );\n};\n\nContentGroup.propTypes = {\n children: PropTypes.object.isRequired,\n contentType: PropTypes.oneOf(VALID_TYPES).isRequired,\n isFaqContent: PropTypes.bool,\n customHtmlProps: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n value: PropTypes.string\n })\n )\n};\n\nContentGroup.defaultProps = {\n isFaqContent: false,\n customHtmlProps: []\n};\n\nexport default ContentGroup;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,OAAO,QAAQ,OAAO;AAChD,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,mBAAmB,QAAQ,aAAa;AACjD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,qBAAqB,MAAM,yBAAyB;AAC3D,SAASC,eAAe,QAAQ,WAAW;AAC3C,OAAOC,2BAA2B,MAAM,0CAA0C;AAClF,SAASC,uBAAuB,QAAQ,eAAe;AAEvD,MAAMC,WAAW,GAAGC,MAAM,CAACC,MAAM,CAACR,mBAAmB,CAAC;AAEtD,MAAMS,YAAY,GAAGC,IAAA,IAAwE;EAAA,IAAAC,eAAA,EAAAC,qBAAA;EAAA,IAAvE;MAAEC,WAAW;MAAEC,YAAY;MAAEC,QAAQ;MAAEC;IAA0B,CAAC,GAAAN,IAAA;IAAPO,KAAK,GAAAC,wBAAA,CAAAR,IAAA,EAAAS,SAAA;EACpF,MAAMC,aAAa,GAAGL,QAAQ,aAARA,QAAQ,wBAAAJ,eAAA,GAARI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ACrB,CACe,CAAC;AAEvB,CAAC;AAEDnB,YAAY,CAAC0B,SAAS,GAAG;EACvBpB,QAAQ,EAAEhB,SAAS,CAACqC,MAAM,CAACC,UAAU;EACrCxB,WAAW,EAAEd,SAAS,CAACuC,KAAK,CAAChC,WAAW,CAAC,CAAC+B,UAAU;EACpDvB,YAAY,EAAEf,SAAS,CAACwC,IAAI;EAC5BvB,eAAe,EAAEjB,SAAS,CAACyC,OAAO,CAChCzC,SAAS,CAAC0C,KAAK,CAAC;IACdC,IAAI,EAAE3C,SAAS,CAAC4C,MAAM;IACtBC,KAAK,EAAE7C,SAAS,CAAC4C;EACnB,CAAC,CACH;AACF,CAAC;AAEDlC,YAAY,CAACoC,YAAY,GAAG;EAC1B/B,YAAY,EAAE,KAAK;EACnBE,eAAe,EAAE;AACnB,CAAC;AAED,eAAeP,YAAY","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
const _excluded = ["type", "children", "settings", "modifier", "backgroundImage", "tagType", "dataNoSnippet", "sticky", "VariantComponent"];
|
|
4
|
+
const _excluded = ["type", "children", "settings", "modifier", "backgroundImage", "tagType", "dataNoSnippet", "sticky", "VariantComponent", "customHtmlProps"];
|
|
5
5
|
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; }
|
|
6
6
|
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; }
|
|
7
7
|
import React from 'react';
|
|
@@ -10,7 +10,7 @@ import Wrapper from '../Wrapper';
|
|
|
10
10
|
import { getClassModifiers } from '../../utils';
|
|
11
11
|
import { useGetImages } from '../../hooks';
|
|
12
12
|
import { getStylesToUpdate, checkIfRowHasColumns } from './helpers';
|
|
13
|
-
import { renderChildren, hasChildren } from '../../helpers';
|
|
13
|
+
import { renderChildren, hasChildren, getCustomHtmlProperties } from '../../helpers';
|
|
14
14
|
import { COLUMN } from '../../constants';
|
|
15
15
|
const Layout = React.forwardRef((_ref, ref) => {
|
|
16
16
|
let {
|
|
@@ -22,7 +22,8 @@ const Layout = React.forwardRef((_ref, ref) => {
|
|
|
22
22
|
tagType,
|
|
23
23
|
dataNoSnippet,
|
|
24
24
|
sticky,
|
|
25
|
-
VariantComponent
|
|
25
|
+
VariantComponent,
|
|
26
|
+
customHtmlProps = []
|
|
26
27
|
} = _ref,
|
|
27
28
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
28
29
|
const {
|
|
@@ -46,6 +47,9 @@ const Layout = React.forwardRef((_ref, ref) => {
|
|
|
46
47
|
if (type === COLUMN && !hasChildren(children)) return null;
|
|
47
48
|
const otherWrapperProps = {};
|
|
48
49
|
if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;
|
|
50
|
+
const customHtmlProperties = getCustomHtmlProperties({
|
|
51
|
+
customHtmlProps
|
|
52
|
+
});
|
|
49
53
|
const WrapperComponent = VariantComponent || Wrapper;
|
|
50
54
|
return /*#__PURE__*/React.createElement(WrapperComponent, _extends({
|
|
51
55
|
ref: ref,
|
|
@@ -53,7 +57,7 @@ const Layout = React.forwardRef((_ref, ref) => {
|
|
|
53
57
|
className: type,
|
|
54
58
|
modifiers: `${classModifiers}${additionalRowModifier}`,
|
|
55
59
|
style: style
|
|
56
|
-
}, otherWrapperProps), title && /*#__PURE__*/React.createElement("h2", {
|
|
60
|
+
}, otherWrapperProps, customHtmlProperties), title && /*#__PURE__*/React.createElement("h2", {
|
|
57
61
|
className: "heading heading--section"
|
|
58
62
|
}, title), renderChildren(children, otherProps));
|
|
59
63
|
});
|
|
@@ -68,6 +72,10 @@ Layout.propTypes = {
|
|
|
68
72
|
tagType: PropTypes.string,
|
|
69
73
|
dataNoSnippet: PropTypes.bool,
|
|
70
74
|
VariantComponent: PropTypes.func,
|
|
75
|
+
customHtmlProps: PropTypes.arrayOf(PropTypes.shape({
|
|
76
|
+
name: PropTypes.string,
|
|
77
|
+
value: PropTypes.string
|
|
78
|
+
})),
|
|
71
79
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired
|
|
72
80
|
};
|
|
73
81
|
Layout.defaultProps = {
|
|
@@ -79,7 +87,8 @@ Layout.defaultProps = {
|
|
|
79
87
|
tagType: '',
|
|
80
88
|
dataNoSnippet: false,
|
|
81
89
|
sticky: false,
|
|
82
|
-
VariantComponent: null
|
|
90
|
+
VariantComponent: null,
|
|
91
|
+
customHtmlProps: []
|
|
83
92
|
};
|
|
84
93
|
export default Layout;
|
|
85
94
|
//# sourceMappingURL=Layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","names":["React","PropTypes","Wrapper","getClassModifiers","useGetImages","getStylesToUpdate","checkIfRowHasColumns","renderChildren","hasChildren","COLUMN","Layout","forwardRef","_ref","ref","type","children","settings","modifier","backgroundImage","tagType","dataNoSnippet","sticky","VariantComponent","otherProps","_objectWithoutProperties","_excluded","data","getFile","url","style","title","classModifiers","_objectSpread","additionalRowModifier","otherWrapperProps","WrapperComponent","createElement","_extends","className","modifiers","propTypes","string","isRequired","bool","shape","func","
|
|
1
|
+
{"version":3,"file":"Layout.js","names":["React","PropTypes","Wrapper","getClassModifiers","useGetImages","getStylesToUpdate","checkIfRowHasColumns","renderChildren","hasChildren","getCustomHtmlProperties","COLUMN","Layout","forwardRef","_ref","ref","type","children","settings","modifier","backgroundImage","tagType","dataNoSnippet","sticky","VariantComponent","customHtmlProps","otherProps","_objectWithoutProperties","_excluded","data","getFile","url","style","title","classModifiers","_objectSpread","additionalRowModifier","otherWrapperProps","customHtmlProperties","WrapperComponent","createElement","_extends","className","modifiers","propTypes","string","isRequired","bool","shape","func","arrayOf","name","value","oneOfType","node","defaultProps"],"sources":["../../../src/components/Layout/Layout.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Wrapper from '../Wrapper';\nimport { getClassModifiers } from '../../utils';\nimport { useGetImages } from '../../hooks';\nimport { getStylesToUpdate, checkIfRowHasColumns } from './helpers';\nimport { renderChildren, hasChildren, getCustomHtmlProperties } from '../../helpers';\nimport { COLUMN } from '../../constants';\n\nconst Layout = React.forwardRef(\n (\n {\n type,\n children,\n settings,\n modifier,\n backgroundImage,\n tagType,\n dataNoSnippet,\n sticky,\n VariantComponent,\n customHtmlProps = [],\n ...otherProps\n },\n ref\n ) => {\n const {\n data: { getFile: { url = null } = {} }\n } = useGetImages(backgroundImage);\n const style = getStylesToUpdate({ backgroundImage: url });\n const { title } = settings;\n const classModifiers = getClassModifiers(type, { modifier, sticky, ...otherProps });\n const additionalRowModifier = checkIfRowHasColumns(type, children) ? ' display-row' : '';\n\n if (type === COLUMN && !hasChildren(children)) return null;\n\n const otherWrapperProps = {};\n if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;\n\n const customHtmlProperties = getCustomHtmlProperties({ customHtmlProps });\n\n const WrapperComponent = VariantComponent || Wrapper;\n\n return (\n <WrapperComponent\n ref={ref}\n tagType={tagType}\n className={type}\n modifiers={`${classModifiers}${additionalRowModifier}`}\n style={style}\n {...otherWrapperProps}\n {...customHtmlProperties}>\n {title && <h2 className=\"heading heading--section\">{title}</h2>}\n {renderChildren(children, otherProps)}\n </WrapperComponent>\n );\n }\n);\n\nLayout.propTypes = {\n type: PropTypes.string.isRequired,\n sticky: PropTypes.bool,\n settings: PropTypes.shape({\n title: PropTypes.string\n }),\n modifier: PropTypes.string,\n backgroundImage: PropTypes.string,\n tagType: PropTypes.string,\n dataNoSnippet: PropTypes.bool,\n VariantComponent: PropTypes.func,\n customHtmlProps: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n value: PropTypes.string\n })\n ),\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired\n};\n\nLayout.defaultProps = {\n settings: {\n title: ''\n },\n backgroundImage: '',\n modifier: '',\n tagType: '',\n dataNoSnippet: false,\n sticky: false,\n VariantComponent: null,\n customHtmlProps: []\n};\n\nexport default Layout;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,OAAO,MAAM,YAAY;AAChC,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,iBAAiB,EAAEC,oBAAoB,QAAQ,WAAW;AACnE,SAASC,cAAc,EAAEC,WAAW,EAAEC,uBAAuB,QAAQ,eAAe;AACpF,SAASC,MAAM,QAAQ,iBAAiB;AAExC,MAAMC,MAAM,GAAGX,KAAK,CAACY,UAAU,CAC7B,CAAAC,IAAA,EAcEC,GAAG,KACA;EAAA,IAdH;MACEC,IAAI;MACJC,QAAQ;MACRC,QAAQ;MACRC,QAAQ;MACRC,eAAe;MACfC,OAAO;MACPC,aAAa;MACbC,MAAM;MACNC,gBAAgB;MAChBC,eAAe,GAAG;IAEpB,CAAC,GAAAX,IAAA;IADIY,UAAU,GAAAC,wBAAA,CAAAb,IAAA,EAAAc,SAAA;EAIf,MAAM;IACJC,IAAI,EAAE;MAAEC,OAAO,EAAE;QAAEC,GAAG,GAAG;MAAK,CAAC,GAAG,CAAC;IAAE;EACvC,CAAC,GAAG1B,YAAY,CAACe,eAAe,CAAC;EACjC,MAAMY,KAAK,GAAG1B,iBAAiB,CAAC;IAAE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,SAAS,CAAC2C;EACnB,CAAC,CAAC;EACF1B,QAAQ,EAAEjB,SAAS,CAAC2C,MAAM;EAC1BzB,eAAe,EAAElB,SAAS,CAAC2C,MAAM;EACjCxB,OAAO,EAAEnB,SAAS,CAAC2C,MAAM;EACzBvB,aAAa,EAAEpB,SAAS,CAAC6C,IAAI;EAC7BvB,gBAAgB,EAAEtB,SAAS,CAAC+C,IAAI;EAChCxB,eAAe,EAAEvB,SAAS,CAACgD,OAAO,CAChChD,SAAS,CAAC8C,KAAK,CAAC;IACdG,IAAI,EAAEjD,SAAS,CAAC2C,MAAM;IACtBO,KAAK,EAAElD,SAAS,CAAC2C;EACnB,CAAC,CACH,CAAC;EACD5B,QAAQ,EAAEf,SAAS,CAACmD,SAAS,CAAC,CAACnD,SAAS,CAACgD,OAAO,CAAChD,SAAS,CAACoD,IAAI,CAAC,EAAEpD,SAAS,CAACoD,IAAI,CAAC,CAAC,CAACR;AACrF,CAAC;AAEDlC,MAAM,CAAC2C,YAAY,GAAG;EACpBrC,QAAQ,EAAE;IACRe,KAAK,EAAE;EACT,CAAC;EACDb,eAAe,EAAE,EAAE;EACnBD,QAAQ,EAAE,EAAE;EACZE,OAAO,EAAE,EAAE;EACXC,aAAa,EAAE,KAAK;EACpBC,MAAM,EAAE,KAAK;EACbC,gBAAgB,EAAE,IAAI;EACtBC,eAAe,EAAE;AACnB,CAAC;AAED,eAAeb,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const getCustomHtmlProperties = ({
|
|
2
|
+
customHtmlProps = []
|
|
3
|
+
}) => customHtmlProps ? customHtmlProps.reduce((acc, {
|
|
4
|
+
name,
|
|
5
|
+
value
|
|
6
|
+
}) => {
|
|
7
|
+
if (name) {
|
|
8
|
+
acc[name] = value !== 'null' ? value : undefined;
|
|
9
|
+
}
|
|
10
|
+
return acc;
|
|
11
|
+
}, {}) : {};
|
|
12
|
+
export default getCustomHtmlProperties;
|
|
13
|
+
//# sourceMappingURL=get-custom-html-properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-custom-html-properties.js","names":["getCustomHtmlProperties","customHtmlProps","reduce","acc","name","value","undefined"],"sources":["../../src/helpers/get-custom-html-properties.js"],"sourcesContent":["const getCustomHtmlProperties = ({ customHtmlProps = [] }) =>\n customHtmlProps\n ? customHtmlProps.reduce((acc, { name, value }) => {\n if (name) {\n acc[name] = value !== 'null' ? value : undefined;\n }\n return acc;\n }, {})\n : {};\n\nexport default getCustomHtmlProperties;\n"],"mappings":"AAAA,MAAMA,uBAAuB,GAAGA,CAAC;EAAEC,eAAe,GAAG;AAAG,CAAC,KACvDA,eAAe,GACXA,eAAe,CAACC,MAAM,CAAC,CAACC,GAAG,EAAE;EAAEC,IAAI;EAAEC;AAAM,CAAC,KAAK;EAC/C,IAAID,IAAI,EAAE;IACRD,GAAG,CAACC,IAAI,CAAC,GAAGC,KAAK,KAAK,MAAM,GAAGA,KAAK,GAAGC,SAAS;EAClD;EACA,OAAOH,GAAG;AACZ,CAAC,EAAE,CAAC,CAAC,CAAC,GACN,CAAC,CAAC;AAER,eAAeH,uBAAuB","ignoreList":[]}
|
package/lib-es/helpers/index.js
CHANGED
|
@@ -62,4 +62,5 @@ export { default as shouldSkipSingleQuery } from './should-skip-single-query';
|
|
|
62
62
|
export { default as buildRawQueryStringified } from './build-raw-query-stringified';
|
|
63
63
|
export { default as buildFiltersQuery } from './build-filters-query';
|
|
64
64
|
export { default as getComponentId } from './get-component-id';
|
|
65
|
+
export { default as getCustomHtmlProperties } from './get-custom-html-properties';
|
|
65
66
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","buildInheritedFilters","buildLinkExtraProps","buildPropsQuery","buildQueryFields","buildRawQuery","buildRawQueryBase","buildSearchValuesCheckboxSelect","buildSearchValuesText","buildSetFilters","checkPropsToUse","getElasticsearchOperator","getClickWrapperOptions","getEntitiesWithBanner","getEntityData","getEntityRenderProps","getGenericProps","getGenericRenderVariables","getImageIds","getInheritedFilters","getModifiers","getNotEqualQuery","getPaginationIndex","getParsedSummaryValue","getQueryFilters","getQueryProps","getRequiredSchemas","getSearchFilterType","getUnpublishedEntityName","getWrappedValueWithLink","getItemsToDisplayIds","isBrowser","isFilterEntitysId","isObject","isUsingRelationImage","parsePropsToDisplay","renderChildren","shouldRenderWaypoint","shouldShowProperty","sortResponseData","splitChildren","getCurrentOffset","updateChildrensParent","getDisplayCountData","buildImageProperties","getUpdatedFilterBy","checkForError","removeUnwantedCharacters","hasChildren","removeExtraItems","getParsedPropValues","getSanitizedPropValues","appendImages","parseTextBlock","processDataSummaryValue","buildQueryKey","filterQuerySetup","filtersSetup","getUpdatedItemsToDisplay","getUpdatedSortProperties","shouldReturn","shouldSkipSingleQuery","buildRawQueryStringified","buildFiltersQuery","getComponentId"],"sources":["../../src/helpers/index.js"],"sourcesContent":["export { default as buildInheritedFilters } from './build-inherited-filters';\nexport { default as buildLinkExtraProps } from './build-link-extra-props';\nexport { default as buildPropsQuery } from './build-props-query';\nexport { default as buildQueryFields } from './build-query-fields';\nexport { default as buildRawQuery } from './build-raw-query';\nexport { default as buildRawQueryBase } from './build-raw-query-base';\nexport { default as buildSearchValuesCheckboxSelect } from './build-search-values-checkbox-select';\nexport { default as buildSearchValuesText } from './build-search-values-text';\nexport { default as buildSetFilters } from './build-set-filters';\nexport { default as checkPropsToUse } from './check-props-to-use';\nexport { default as getElasticsearchOperator } from './get-elasticsearch-operator';\nexport { default as getClickWrapperOptions } from './get-click-wrapper-options';\nexport { default as getEntitiesWithBanner } from './get-entities-with-banner';\nexport { default as getEntityData } from './get-entity-data';\nexport { default as getEntityRenderProps } from './get-entity-render-props';\nexport { default as getGenericProps } from './get-generic-props';\nexport { default as getGenericRenderVariables } from './get-generic-render-variables';\nexport { default as getImageIds } from './get-image-ids';\nexport { default as getInheritedFilters } from './get-inherited-filters';\nexport { default as getModifiers } from './get-modifiers';\nexport { default as getNotEqualQuery } from './get-not-equal-query';\nexport { default as getPaginationIndex } from './get-pagination-index';\nexport { default as getParsedSummaryValue } from './get-parsed-summary-value';\nexport { default as getQueryFilters } from './get-query-filters';\nexport { default as getQueryProps } from './get-query-props';\nexport { default as getRequiredSchemas } from './get-required-schemas';\nexport { default as getSearchFilterType } from './get-search-filter-type';\nexport { default as getUnpublishedEntityName } from './get-unpublished-entity-name';\nexport { default as getWrappedValueWithLink } from './get-wrapped-value-with-link';\nexport { default as getItemsToDisplayIds } from './get-items-to-display-ids';\nexport { default as isBrowser } from './is-browser';\nexport { default as isFilterEntitysId } from './is-filter-entitys-id';\nexport { default as isObject } from './is-object';\nexport { default as isUsingRelationImage } from './is-using-relation-image';\nexport { default as parsePropsToDisplay } from './parse-props-to-display';\nexport { default as renderChildren } from './render-children';\nexport { default as shouldRenderWaypoint } from './should-render-waypoint';\nexport { default as shouldShowProperty } from './should-show-property';\nexport { default as sortResponseData } from './sort-response-data';\nexport { default as splitChildren } from './split-children';\nexport { default as getCurrentOffset } from './get-current-offset';\nexport { default as updateChildrensParent } from './update-childrens-parent';\nexport { default as getDisplayCountData } from './get-display-count-data';\nexport { default as buildImageProperties } from './build-image-properties';\nexport { default as getUpdatedFilterBy } from './get-updated-filter-by';\nexport { default as checkForError } from './check-for-error';\nexport { default as removeUnwantedCharacters } from './remove-unwanted-characters';\nexport { default as hasChildren } from './has-children';\nexport { default as removeExtraItems } from './remove-extra-items';\nexport { default as getParsedPropValues } from './get-parsed-prop-values';\nexport { default as getSanitizedPropValues } from './get-sanitized-prop-values';\nexport { default as appendImages } from './append-images';\nexport { default as parseTextBlock } from './parse-TextBlock';\nexport { default as processDataSummaryValue } from './process-data-summary-value';\nexport { default as buildQueryKey } from './build-query-key';\nexport { default as filterQuerySetup } from './filter-query-setup';\nexport { default as filtersSetup } from './filters-setup';\nexport { default as getUpdatedItemsToDisplay } from './get-updated-items-to-display';\nexport { default as getUpdatedSortProperties } from './get-updated-sort-properties';\nexport { default as shouldReturn } from './should-return';\nexport { default as shouldSkipSingleQuery } from './should-skip-single-query';\nexport { default as buildRawQueryStringified } from './build-raw-query-stringified';\nexport { default as buildFiltersQuery } from './build-filters-query';\nexport { default as getComponentId } from './get-component-id';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,qBAAqB,QAAQ,2BAA2B;AAC5E,SAASD,OAAO,IAAIE,mBAAmB,QAAQ,0BAA0B;AACzE,SAASF,OAAO,IAAIG,eAAe,QAAQ,qBAAqB;AAChE,SAASH,OAAO,IAAII,gBAAgB,QAAQ,sBAAsB;AAClE,SAASJ,OAAO,IAAIK,aAAa,QAAQ,mBAAmB;AAC5D,SAASL,OAAO,IAAIM,iBAAiB,QAAQ,wBAAwB;AACrE,SAASN,OAAO,IAAIO,+BAA+B,QAAQ,uCAAuC;AAClG,SAASP,OAAO,IAAIQ,qBAAqB,QAAQ,4BAA4B;AAC7E,SAASR,OAAO,IAAIS,eAAe,QAAQ,qBAAqB;AAChE,SAAST,OAAO,IAAIU,eAAe,QAAQ,sBAAsB;AACjE,SAASV,OAAO,IAAIW,wBAAwB,QAAQ,8BAA8B;AAClF,SAASX,OAAO,IAAIY,sBAAsB,QAAQ,6BAA6B;AAC/E,SAASZ,OAAO,IAAIa,qBAAqB,QAAQ,4BAA4B;AAC7E,SAASb,OAAO,IAAIc,aAAa,QAAQ,mBAAmB;AAC5D,SAASd,OAAO,IAAIe,oBAAoB,QAAQ,2BAA2B;AAC3E,SAASf,OAAO,IAAIgB,eAAe,QAAQ,qBAAqB;AAChE,SAAShB,OAAO,IAAIiB,yBAAyB,QAAQ,gCAAgC;AACrF,SAASjB,OAAO,IAAIkB,WAAW,QAAQ,iBAAiB;AACxD,SAASlB,OAAO,IAAImB,mBAAmB,QAAQ,yBAAyB;AACxE,SAASnB,OAAO,IAAIoB,YAAY,QAAQ,iBAAiB;AACzD,SAASpB,OAAO,IAAIqB,gBAAgB,QAAQ,uBAAuB;AACnE,SAASrB,OAAO,IAAIsB,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AAO,IAAI8C,aAAa,QAAQ,mBAAmB;AAC5D,SAAS9C,OAAO,IAAI+C,wBAAwB,QAAQ,8BAA8B;AAClF,SAAS/C,OAAO,IAAIgD,WAAW,QAAQ,gBAAgB;AACvD,SAAShD,OAAO,IAAIiD,gBAAgB,QAAQ,sBAAsB;AAClE,SAASjD,OAAO,IAAIkD,mBAAmB,QAAQ,0BAA0B;AACzE,SAASlD,OAAO,IAAImD,sBAAsB,QAAQ,6BAA6B;AAC/E,SAASnD,OAAO,IAAIoD,YAAY,QAAQ,iBAAiB;AACzD,SAASpD,OAAO,IAAIqD,cAAc,QAAQ,mBAAmB;AAC7D,SAASrD,OAAO,IAAIsD,uBAAuB,QAAQ,8BAA8B;AACjF,SAAStD,OAAO,IAAIuD,aAAa,QAAQ,mBAAmB;AAC5D,SAASvD,OAAO,IAAIwD,gBAAgB,QAAQ,sBAAsB;AAClE,SAASxD,OAAO,IAAIyD,YAAY,QAAQ,iBAAiB;AACzD,SAASzD,OAAO,IAAI0D,wBAAwB,QAAQ,gCAAgC;AACpF,SAAS1D,OAAO,IAAI2D,wBAAwB,QAAQ,+BAA+B;AACnF,SAAS3D,OAAO,IAAI4D,YAAY,QAAQ,iBAAiB;AACzD,SAAS5D,OAAO,IAAI6D,qBAAqB,QAAQ,4BAA4B;AAC7E,SAAS7D,OAAO,IAAI8D,wBAAwB,QAAQ,+BAA+B;AACnF,SAAS9D,OAAO,IAAI+D,iBAAiB,QAAQ,uBAAuB;AACpE,SAAS/D,OAAO,IAAIgE,cAAc,QAAQ,oBAAoB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","buildInheritedFilters","buildLinkExtraProps","buildPropsQuery","buildQueryFields","buildRawQuery","buildRawQueryBase","buildSearchValuesCheckboxSelect","buildSearchValuesText","buildSetFilters","checkPropsToUse","getElasticsearchOperator","getClickWrapperOptions","getEntitiesWithBanner","getEntityData","getEntityRenderProps","getGenericProps","getGenericRenderVariables","getImageIds","getInheritedFilters","getModifiers","getNotEqualQuery","getPaginationIndex","getParsedSummaryValue","getQueryFilters","getQueryProps","getRequiredSchemas","getSearchFilterType","getUnpublishedEntityName","getWrappedValueWithLink","getItemsToDisplayIds","isBrowser","isFilterEntitysId","isObject","isUsingRelationImage","parsePropsToDisplay","renderChildren","shouldRenderWaypoint","shouldShowProperty","sortResponseData","splitChildren","getCurrentOffset","updateChildrensParent","getDisplayCountData","buildImageProperties","getUpdatedFilterBy","checkForError","removeUnwantedCharacters","hasChildren","removeExtraItems","getParsedPropValues","getSanitizedPropValues","appendImages","parseTextBlock","processDataSummaryValue","buildQueryKey","filterQuerySetup","filtersSetup","getUpdatedItemsToDisplay","getUpdatedSortProperties","shouldReturn","shouldSkipSingleQuery","buildRawQueryStringified","buildFiltersQuery","getComponentId","getCustomHtmlProperties"],"sources":["../../src/helpers/index.js"],"sourcesContent":["export { default as buildInheritedFilters } from './build-inherited-filters';\nexport { default as buildLinkExtraProps } from './build-link-extra-props';\nexport { default as buildPropsQuery } from './build-props-query';\nexport { default as buildQueryFields } from './build-query-fields';\nexport { default as buildRawQuery } from './build-raw-query';\nexport { default as buildRawQueryBase } from './build-raw-query-base';\nexport { default as buildSearchValuesCheckboxSelect } from './build-search-values-checkbox-select';\nexport { default as buildSearchValuesText } from './build-search-values-text';\nexport { default as buildSetFilters } from './build-set-filters';\nexport { default as checkPropsToUse } from './check-props-to-use';\nexport { default as getElasticsearchOperator } from './get-elasticsearch-operator';\nexport { default as getClickWrapperOptions } from './get-click-wrapper-options';\nexport { default as getEntitiesWithBanner } from './get-entities-with-banner';\nexport { default as getEntityData } from './get-entity-data';\nexport { default as getEntityRenderProps } from './get-entity-render-props';\nexport { default as getGenericProps } from './get-generic-props';\nexport { default as getGenericRenderVariables } from './get-generic-render-variables';\nexport { default as getImageIds } from './get-image-ids';\nexport { default as getInheritedFilters } from './get-inherited-filters';\nexport { default as getModifiers } from './get-modifiers';\nexport { default as getNotEqualQuery } from './get-not-equal-query';\nexport { default as getPaginationIndex } from './get-pagination-index';\nexport { default as getParsedSummaryValue } from './get-parsed-summary-value';\nexport { default as getQueryFilters } from './get-query-filters';\nexport { default as getQueryProps } from './get-query-props';\nexport { default as getRequiredSchemas } from './get-required-schemas';\nexport { default as getSearchFilterType } from './get-search-filter-type';\nexport { default as getUnpublishedEntityName } from './get-unpublished-entity-name';\nexport { default as getWrappedValueWithLink } from './get-wrapped-value-with-link';\nexport { default as getItemsToDisplayIds } from './get-items-to-display-ids';\nexport { default as isBrowser } from './is-browser';\nexport { default as isFilterEntitysId } from './is-filter-entitys-id';\nexport { default as isObject } from './is-object';\nexport { default as isUsingRelationImage } from './is-using-relation-image';\nexport { default as parsePropsToDisplay } from './parse-props-to-display';\nexport { default as renderChildren } from './render-children';\nexport { default as shouldRenderWaypoint } from './should-render-waypoint';\nexport { default as shouldShowProperty } from './should-show-property';\nexport { default as sortResponseData } from './sort-response-data';\nexport { default as splitChildren } from './split-children';\nexport { default as getCurrentOffset } from './get-current-offset';\nexport { default as updateChildrensParent } from './update-childrens-parent';\nexport { default as getDisplayCountData } from './get-display-count-data';\nexport { default as buildImageProperties } from './build-image-properties';\nexport { default as getUpdatedFilterBy } from './get-updated-filter-by';\nexport { default as checkForError } from './check-for-error';\nexport { default as removeUnwantedCharacters } from './remove-unwanted-characters';\nexport { default as hasChildren } from './has-children';\nexport { default as removeExtraItems } from './remove-extra-items';\nexport { default as getParsedPropValues } from './get-parsed-prop-values';\nexport { default as getSanitizedPropValues } from './get-sanitized-prop-values';\nexport { default as appendImages } from './append-images';\nexport { default as parseTextBlock } from './parse-TextBlock';\nexport { default as processDataSummaryValue } from './process-data-summary-value';\nexport { default as buildQueryKey } from './build-query-key';\nexport { default as filterQuerySetup } from './filter-query-setup';\nexport { default as filtersSetup } from './filters-setup';\nexport { default as getUpdatedItemsToDisplay } from './get-updated-items-to-display';\nexport { default as getUpdatedSortProperties } from './get-updated-sort-properties';\nexport { default as shouldReturn } from './should-return';\nexport { default as shouldSkipSingleQuery } from './should-skip-single-query';\nexport { default as buildRawQueryStringified } from './build-raw-query-stringified';\nexport { default as buildFiltersQuery } from './build-filters-query';\nexport { default as getComponentId } from './get-component-id';\nexport { default as getCustomHtmlProperties } from './get-custom-html-properties';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,qBAAqB,QAAQ,2BAA2B;AAC5E,SAASD,OAAO,IAAIE,mBAAmB,QAAQ,0BAA0B;AACzE,SAASF,OAAO,IAAIG,eAAe,QAAQ,qBAAqB;AAChE,SAASH,OAAO,IAAII,gBAAgB,QAAQ,sBAAsB;AAClE,SAASJ,OAAO,IAAIK,aAAa,QAAQ,mBAAmB;AAC5D,SAASL,OAAO,IAAIM,iBAAiB,QAAQ,wBAAwB;AACrE,SAASN,OAAO,IAAIO,+BAA+B,QAAQ,uCAAuC;AAClG,SAASP,OAAO,IAAIQ,qBAAqB,QAAQ,4BAA4B;AAC7E,SAASR,OAAO,IAAIS,eAAe,QAAQ,qBAAqB;AAChE,SAAST,OAAO,IAAIU,eAAe,QAAQ,sBAAsB;AACjE,SAASV,OAAO,IAAIW,wBAAwB,QAAQ,8BAA8B;AAClF,SAASX,OAAO,IAAIY,sBAAsB,QAAQ,6BAA6B;AAC/E,SAASZ,OAAO,IAAIa,qBAAqB,QAAQ,4BAA4B;AAC7E,SAASb,OAAO,IAAIc,aAAa,QAAQ,mBAAmB;AAC5D,SAASd,OAAO,IAAIe,oBAAoB,QAAQ,2BAA2B;AAC3E,SAASf,OAAO,IAAIgB,eAAe,QAAQ,qBAAqB;AAChE,SAAShB,OAAO,IAAIiB,yBAAyB,QAAQ,gCAAgC;AACrF,SAASjB,OAAO,IAAIkB,WAAW,QAAQ,iBAAiB;AACxD,SAASlB,OAAO,IAAImB,mBAAmB,QAAQ,yBAAyB;AACxE,SAASnB,OAAO,IAAIoB,YAAY,QAAQ,iBAAiB;AACzD,SAASpB,OAAO,IAAIqB,gBAAgB,QAAQ,uBAAuB;AACnE,SAASrB,OAAO,IAAIsB,kBAAkB,QA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C,aAAa,QAAQ,mBAAmB;AAC5D,SAAS9C,OAAO,IAAI+C,wBAAwB,QAAQ,8BAA8B;AAClF,SAAS/C,OAAO,IAAIgD,WAAW,QAAQ,gBAAgB;AACvD,SAAShD,OAAO,IAAIiD,gBAAgB,QAAQ,sBAAsB;AAClE,SAASjD,OAAO,IAAIkD,mBAAmB,QAAQ,0BAA0B;AACzE,SAASlD,OAAO,IAAImD,sBAAsB,QAAQ,6BAA6B;AAC/E,SAASnD,OAAO,IAAIoD,YAAY,QAAQ,iBAAiB;AACzD,SAASpD,OAAO,IAAIqD,cAAc,QAAQ,mBAAmB;AAC7D,SAASrD,OAAO,IAAIsD,uBAAuB,QAAQ,8BAA8B;AACjF,SAAStD,OAAO,IAAIuD,aAAa,QAAQ,mBAAmB;AAC5D,SAASvD,OAAO,IAAIwD,gBAAgB,QAAQ,sBAAsB;AAClE,SAASxD,OAAO,IAAIyD,YAAY,QAAQ,iBAAiB;AACzD,SAASzD,OAAO,IAAI0D,wBAAwB,QAAQ,gCAAgC;AACpF,SAAS1D,OAAO,IAAI2D,wBAAwB,QAAQ,+BAA+B;AACnF,SAAS3D,OAAO,IAAI4D,YAAY,QAAQ,iBAAiB;AACzD,SAAS5D,OAAO,IAAI6D,qBAAqB,QAAQ,4BAA4B;AAC7E,SAAS7D,OAAO,IAAI8D,wBAAwB,QAAQ,+BAA+B;AACnF,SAAS9D,OAAO,IAAI+D,iBAAiB,QAAQ,uBAAuB;AACpE,SAAS/D,OAAO,IAAIgE,cAAc,QAAQ,oBAAoB;AAC9D,SAAShE,OAAO,IAAIiE,uBAAuB,QAAQ,8BAA8B","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/react-page-builder",
|
|
3
|
-
"version": "0.146.0-node18-tooltips.
|
|
3
|
+
"version": "0.146.0-node18-tooltips.42",
|
|
4
4
|
"description": "Blaze react page builder",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"lib/*",
|
|
93
93
|
"lib-es/*"
|
|
94
94
|
],
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "f90ca068ebbcd3736d2f944e087d7e91082917da"
|
|
96
96
|
}
|
|
@@ -5,10 +5,11 @@ import ContentGroupTabs from './ContentGroupTabs';
|
|
|
5
5
|
import ContentGroupAccordion from './ContentGroupAccordion';
|
|
6
6
|
import { getSectionsData } from './helpers';
|
|
7
7
|
import getStructuredDataProperties from './helpers/get-structured-data-properties';
|
|
8
|
+
import { getCustomHtmlProperties } from '../../helpers';
|
|
8
9
|
|
|
9
10
|
const VALID_TYPES = Object.values(CONTENT_GROUP_TYPES);
|
|
10
11
|
|
|
11
|
-
const ContentGroup = ({ contentType, isFaqContent, children, ...props }) => {
|
|
12
|
+
const ContentGroup = ({ contentType, isFaqContent, children, customHtmlProps, ...props }) => {
|
|
12
13
|
const groupSections = children?.props?.children?.[1];
|
|
13
14
|
|
|
14
15
|
const GroupComponent = useMemo(
|
|
@@ -19,8 +20,17 @@ const ContentGroup = ({ contentType, isFaqContent, children, ...props }) => {
|
|
|
19
20
|
const WrapperComponent = useMemo(() => (!isFaqContent ? Fragment : 'div'), [isFaqContent]);
|
|
20
21
|
|
|
21
22
|
const { topWrapperProps, ...schemaProperties } = useMemo(
|
|
22
|
-
() =>
|
|
23
|
-
|
|
23
|
+
() => {
|
|
24
|
+
const structuredDataProperties = getStructuredDataProperties(isFaqContent);
|
|
25
|
+
return {
|
|
26
|
+
...structuredDataProperties,
|
|
27
|
+
topWrapperProps: {
|
|
28
|
+
...structuredDataProperties.topWrapperProps,
|
|
29
|
+
...getCustomHtmlProperties({ customHtmlProps })
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
[isFaqContent, customHtmlProps]
|
|
24
34
|
);
|
|
25
35
|
|
|
26
36
|
if (!groupSections || !groupSections.length || !VALID_TYPES.includes(contentType)) return '';
|
|
@@ -43,11 +53,18 @@ const ContentGroup = ({ contentType, isFaqContent, children, ...props }) => {
|
|
|
43
53
|
ContentGroup.propTypes = {
|
|
44
54
|
children: PropTypes.object.isRequired,
|
|
45
55
|
contentType: PropTypes.oneOf(VALID_TYPES).isRequired,
|
|
46
|
-
isFaqContent: PropTypes.bool
|
|
56
|
+
isFaqContent: PropTypes.bool,
|
|
57
|
+
customHtmlProps: PropTypes.arrayOf(
|
|
58
|
+
PropTypes.shape({
|
|
59
|
+
name: PropTypes.string,
|
|
60
|
+
value: PropTypes.string
|
|
61
|
+
})
|
|
62
|
+
)
|
|
47
63
|
};
|
|
48
64
|
|
|
49
65
|
ContentGroup.defaultProps = {
|
|
50
|
-
isFaqContent: false
|
|
66
|
+
isFaqContent: false,
|
|
67
|
+
customHtmlProps: []
|
|
51
68
|
};
|
|
52
69
|
|
|
53
70
|
export default ContentGroup;
|
|
@@ -4,7 +4,7 @@ import Wrapper from '../Wrapper';
|
|
|
4
4
|
import { getClassModifiers } from '../../utils';
|
|
5
5
|
import { useGetImages } from '../../hooks';
|
|
6
6
|
import { getStylesToUpdate, checkIfRowHasColumns } from './helpers';
|
|
7
|
-
import { renderChildren, hasChildren } from '../../helpers';
|
|
7
|
+
import { renderChildren, hasChildren, getCustomHtmlProperties } from '../../helpers';
|
|
8
8
|
import { COLUMN } from '../../constants';
|
|
9
9
|
|
|
10
10
|
const Layout = React.forwardRef(
|
|
@@ -19,6 +19,7 @@ const Layout = React.forwardRef(
|
|
|
19
19
|
dataNoSnippet,
|
|
20
20
|
sticky,
|
|
21
21
|
VariantComponent,
|
|
22
|
+
customHtmlProps = [],
|
|
22
23
|
...otherProps
|
|
23
24
|
},
|
|
24
25
|
ref
|
|
@@ -36,6 +37,8 @@ const Layout = React.forwardRef(
|
|
|
36
37
|
const otherWrapperProps = {};
|
|
37
38
|
if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;
|
|
38
39
|
|
|
40
|
+
const customHtmlProperties = getCustomHtmlProperties({ customHtmlProps });
|
|
41
|
+
|
|
39
42
|
const WrapperComponent = VariantComponent || Wrapper;
|
|
40
43
|
|
|
41
44
|
return (
|
|
@@ -45,7 +48,8 @@ const Layout = React.forwardRef(
|
|
|
45
48
|
className={type}
|
|
46
49
|
modifiers={`${classModifiers}${additionalRowModifier}`}
|
|
47
50
|
style={style}
|
|
48
|
-
{...otherWrapperProps}
|
|
51
|
+
{...otherWrapperProps}
|
|
52
|
+
{...customHtmlProperties}>
|
|
49
53
|
{title && <h2 className="heading heading--section">{title}</h2>}
|
|
50
54
|
{renderChildren(children, otherProps)}
|
|
51
55
|
</WrapperComponent>
|
|
@@ -64,6 +68,12 @@ Layout.propTypes = {
|
|
|
64
68
|
tagType: PropTypes.string,
|
|
65
69
|
dataNoSnippet: PropTypes.bool,
|
|
66
70
|
VariantComponent: PropTypes.func,
|
|
71
|
+
customHtmlProps: PropTypes.arrayOf(
|
|
72
|
+
PropTypes.shape({
|
|
73
|
+
name: PropTypes.string,
|
|
74
|
+
value: PropTypes.string
|
|
75
|
+
})
|
|
76
|
+
),
|
|
67
77
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired
|
|
68
78
|
};
|
|
69
79
|
|
|
@@ -76,7 +86,8 @@ Layout.defaultProps = {
|
|
|
76
86
|
tagType: '',
|
|
77
87
|
dataNoSnippet: false,
|
|
78
88
|
sticky: false,
|
|
79
|
-
VariantComponent: null
|
|
89
|
+
VariantComponent: null,
|
|
90
|
+
customHtmlProps: []
|
|
80
91
|
};
|
|
81
92
|
|
|
82
93
|
export default Layout;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const getCustomHtmlProperties = ({ customHtmlProps = [] }) =>
|
|
2
|
+
customHtmlProps
|
|
3
|
+
? customHtmlProps.reduce((acc, { name, value }) => {
|
|
4
|
+
if (name) {
|
|
5
|
+
acc[name] = value !== 'null' ? value : undefined;
|
|
6
|
+
}
|
|
7
|
+
return acc;
|
|
8
|
+
}, {})
|
|
9
|
+
: {};
|
|
10
|
+
|
|
11
|
+
export default getCustomHtmlProperties;
|
package/src/helpers/index.js
CHANGED
|
@@ -62,3 +62,4 @@ export { default as shouldSkipSingleQuery } from './should-skip-single-query';
|
|
|
62
62
|
export { default as buildRawQueryStringified } from './build-raw-query-stringified';
|
|
63
63
|
export { default as buildFiltersQuery } from './build-filters-query';
|
|
64
64
|
export { default as getComponentId } from './get-component-id';
|
|
65
|
+
export { default as getCustomHtmlProperties } from './get-custom-html-properties';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @jest-environment jsdom
|
|
3
3
|
*/
|
|
4
|
+
import React from 'react';
|
|
4
5
|
import '@testing-library/jest-dom/extend-expect';
|
|
5
6
|
import {
|
|
6
7
|
getMockedProvider,
|
|
@@ -117,4 +118,50 @@ describe('Layout component', () => {
|
|
|
117
118
|
});
|
|
118
119
|
expect(columnNoChildren.toJSON()).toEqual(null);
|
|
119
120
|
});
|
|
121
|
+
|
|
122
|
+
it('should add data-nosnippet attribute when dataNoSnippet prop is true', async () => {
|
|
123
|
+
const componentWithSnippet = await getMockedProvider(Layout, {
|
|
124
|
+
props: getMockedProps({ dataNoSnippet: true })
|
|
125
|
+
});
|
|
126
|
+
const element = componentWithSnippet.root.findByProps({ className: 'row' });
|
|
127
|
+
expect(element.props['data-nosnippet']).toBe(true);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it('should not add data-nosnippet attribute when dataNoSnippet prop is false', () => {
|
|
131
|
+
const element = testInstance.findByProps({ className: 'row' });
|
|
132
|
+
expect(element.props['data-nosnippet']).toBeUndefined();
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('should render VariantComponent instead of Wrapper when provided', async () => {
|
|
136
|
+
const MockVariant = React.forwardRef((props, ref) => <div ref={ref} {...props} />);
|
|
137
|
+
const componentWithVariant = await getMockedProvider(Layout, {
|
|
138
|
+
props: getMockedProps({ VariantComponent: MockVariant })
|
|
139
|
+
});
|
|
140
|
+
const element = componentWithVariant.root.findByType(MockVariant);
|
|
141
|
+
expect(element).toBeDefined();
|
|
142
|
+
const wrapperElements = shouldThrowError(componentWithVariant, 'findByType', Wrapper);
|
|
143
|
+
expect(wrapperElements).toBeTruthy();
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('should spread customHtmlProps onto the wrapper element', async () => {
|
|
147
|
+
const customHtmlProps = [
|
|
148
|
+
{ name: 'data-testid', value: 'custom-layout' },
|
|
149
|
+
{ name: 'aria-label', value: 'My layout' }
|
|
150
|
+
];
|
|
151
|
+
const componentWithCustomProps = await getMockedProvider(Layout, {
|
|
152
|
+
props: getMockedProps({ customHtmlProps })
|
|
153
|
+
});
|
|
154
|
+
const element = componentWithCustomProps.root.findByProps({ className: 'row' });
|
|
155
|
+
expect(element.props['data-testid']).toBe('custom-layout');
|
|
156
|
+
expect(element.props['aria-label']).toBe('My layout');
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it('should not spread customHtmlProps entries with value "null"', async () => {
|
|
160
|
+
const customHtmlProps = [{ name: 'data-skip', value: 'null' }];
|
|
161
|
+
const componentWithNullProp = await getMockedProvider(Layout, {
|
|
162
|
+
props: getMockedProps({ customHtmlProps })
|
|
163
|
+
});
|
|
164
|
+
const element = componentWithNullProp.root.findByProps({ className: 'row' });
|
|
165
|
+
expect(element.props['data-skip']).toBeUndefined();
|
|
166
|
+
});
|
|
120
167
|
});
|
|
@@ -43,4 +43,47 @@ describe('ContentGroup component', () => {
|
|
|
43
43
|
const faqWrapper = container.querySelector('div[itemtype="https://schema.org/FAQPage"]');
|
|
44
44
|
expect(faqWrapper).toBeTruthy();
|
|
45
45
|
});
|
|
46
|
+
|
|
47
|
+
it('spreads customHtmlProps onto the wrapper element', () => {
|
|
48
|
+
const customHtmlProps = [
|
|
49
|
+
{ name: 'data-testid', value: 'content-group-wrapper' },
|
|
50
|
+
{ name: 'aria-label', value: 'My group' }
|
|
51
|
+
];
|
|
52
|
+
const { container } = render(ContentGroup, {
|
|
53
|
+
contentType: 'tab',
|
|
54
|
+
isFaqContent: true,
|
|
55
|
+
customHtmlProps,
|
|
56
|
+
children: buildChildren()
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const wrapper = container.querySelector('div[data-testid="content-group-wrapper"]');
|
|
60
|
+
expect(wrapper).toBeTruthy();
|
|
61
|
+
expect(wrapper.getAttribute('aria-label')).toBe('My group');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('excludes customHtmlProps entries with value "null" from the wrapper', () => {
|
|
65
|
+
const customHtmlProps = [{ name: 'data-skip', value: 'null' }];
|
|
66
|
+
const { container } = render(ContentGroup, {
|
|
67
|
+
contentType: 'tab',
|
|
68
|
+
isFaqContent: true,
|
|
69
|
+
customHtmlProps,
|
|
70
|
+
children: buildChildren()
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const wrapper = container.querySelector('div[itemtype="https://schema.org/FAQPage"]');
|
|
74
|
+
expect(wrapper).toBeTruthy();
|
|
75
|
+
expect(wrapper.getAttribute('data-skip')).toBeNull();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('renders correctly with an empty customHtmlProps array', () => {
|
|
79
|
+
const { container } = render(ContentGroup, {
|
|
80
|
+
contentType: 'tab',
|
|
81
|
+
isFaqContent: true,
|
|
82
|
+
customHtmlProps: [],
|
|
83
|
+
children: buildChildren()
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const faqWrapper = container.querySelector('div[itemtype="https://schema.org/FAQPage"]');
|
|
87
|
+
expect(faqWrapper).toBeTruthy();
|
|
88
|
+
});
|
|
46
89
|
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import getCustomHtmlProperties from '../../../../src/helpers/get-custom-html-properties';
|
|
2
|
+
|
|
3
|
+
describe('getCustomHtmlProperties function', () => {
|
|
4
|
+
it('should return an empty object when customHtmlProps is an empty array', () => {
|
|
5
|
+
expect(getCustomHtmlProperties({ customHtmlProps: [] })).toEqual({});
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
it('should return an empty object when customHtmlProps is not provided', () => {
|
|
9
|
+
expect(getCustomHtmlProperties({})).toEqual({});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('should return an empty object when customHtmlProps is null', () => {
|
|
13
|
+
expect(getCustomHtmlProperties({ customHtmlProps: null })).toEqual({});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('should convert an array of name/value pairs into an object', () => {
|
|
17
|
+
const customHtmlProps = [
|
|
18
|
+
{ name: 'data-id', value: '123' },
|
|
19
|
+
{ name: 'aria-label', value: 'My label' }
|
|
20
|
+
];
|
|
21
|
+
expect(getCustomHtmlProperties({ customHtmlProps })).toEqual({
|
|
22
|
+
'data-id': '123',
|
|
23
|
+
'aria-label': 'My label'
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should exclude entries where value is the string "null"', () => {
|
|
28
|
+
const customHtmlProps = [
|
|
29
|
+
{ name: 'data-id', value: '123' },
|
|
30
|
+
{ name: 'data-skip', value: 'null' }
|
|
31
|
+
];
|
|
32
|
+
expect(getCustomHtmlProperties({ customHtmlProps })).toEqual({ 'data-id': '123' });
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('should exclude entries where name is falsy', () => {
|
|
36
|
+
const customHtmlProps = [
|
|
37
|
+
{ name: 'data-id', value: '123' },
|
|
38
|
+
{ name: '', value: 'ignored' },
|
|
39
|
+
{ name: null, value: 'also-ignored' }
|
|
40
|
+
];
|
|
41
|
+
expect(getCustomHtmlProperties({ customHtmlProps })).toEqual({ 'data-id': '123' });
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('should return an empty object when all entries are invalid', () => {
|
|
45
|
+
const customHtmlProps = [{ name: '', value: 'foo' }, { name: 'bar', value: 'null' }];
|
|
46
|
+
expect(getCustomHtmlProperties({ customHtmlProps })).toEqual({});
|
|
47
|
+
});
|
|
48
|
+
});
|