@blaze-cms/react-page-builder 0.146.0-alpha.2 → 0.146.0-alpha.21
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 +132 -0
- package/lib/components/Card/Card.js +14 -9
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/CardsContainer.js +8 -4
- package/lib/components/Card/CardsContainer.js.map +1 -1
- package/lib/components/Card/CardsFactory.js +37 -7
- package/lib/components/Card/CardsFactory.js.map +1 -1
- package/lib/components/Card/CardsRender.js +8 -4
- package/lib/components/Card/CardsRender.js.map +1 -1
- package/lib/components/Card/helpers/index.js +6 -6
- package/lib/components/Card/helpers/index.js.map +1 -1
- package/lib/components/Image/Lightbox/Lightbox.js +2 -2
- package/lib/components/Image/Lightbox/Lightbox.js.map +1 -1
- package/lib/components/List/ListRender.js.map +1 -1
- package/lib/components/MenuItem/MenuEntitiesItem.js +204 -0
- package/lib/components/MenuItem/MenuEntitiesItem.js.map +1 -0
- package/lib/components/MenuItem/MenuItem.js +25 -68
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/MenuItem/MenuItemRender.js +104 -0
- package/lib/components/MenuItem/MenuItemRender.js.map +1 -0
- package/lib/components/MenuItem/helpers/index.js +15 -0
- package/lib/components/MenuItem/helpers/index.js.map +1 -0
- package/lib/components/MenuItem/helpers/inject-helper-into-template.js +17 -0
- package/lib/components/MenuItem/helpers/inject-helper-into-template.js.map +1 -0
- package/lib/components/Modal/Modal.js +2 -2
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/ModalAdapter/ModalAdapter.js +21 -0
- package/lib/components/ModalAdapter/ModalAdapter.js.map +1 -0
- package/lib/components/ModalAdapter/index.js +11 -0
- package/lib/components/ModalAdapter/index.js.map +1 -0
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js +22 -4
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilterContainer.js +22 -27
- package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib/components/SearchFilter/components/Select.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-list-name-query.js +31 -0
- package/lib/components/SearchFilter/helpers/build-list-name-query.js.map +1 -0
- package/lib/components/SearchFilter/helpers/decode-encode.js.map +1 -1
- package/lib/components/SearchFilter/helpers/index.js +7 -0
- package/lib/components/SearchFilter/helpers/index.js.map +1 -1
- package/lib/components/Video/Video.js +2 -1
- package/lib/components/Video/Video.js.map +1 -1
- package/lib/components/Video/VideoContext.js +12 -0
- package/lib/components/Video/VideoContext.js.map +1 -0
- package/lib/components/Video/VideoModal.js +2 -2
- package/lib/components/Video/VideoModal.js.map +1 -1
- package/lib/components/Video/VideoRender.js +36 -3
- package/lib/components/Video/VideoRender.js.map +1 -1
- package/lib/components/Video/constants.js +14 -0
- package/lib/components/Video/constants.js.map +1 -0
- package/lib/components/Video/helpers/emit-gtm-event.js +31 -0
- package/lib/components/Video/helpers/emit-gtm-event.js.map +1 -0
- package/lib/components/Video/providers/JWPlayer/JWPlayerController.js +28 -8
- package/lib/components/Video/providers/JWPlayer/JWPlayerController.js.map +1 -1
- package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js +16 -4
- package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js.map +1 -1
- package/lib/components/Video/providers/YouTube/YoutubeEmbeded.js +57 -0
- package/lib/components/Video/providers/YouTube/YoutubeEmbeded.js.map +1 -1
- package/lib/helpers/build-filters-query.js +1 -2
- package/lib/helpers/build-filters-query.js.map +1 -1
- package/lib/{components/Card/helpers → helpers}/filter-query-setup.js +10 -7
- package/lib/helpers/filter-query-setup.js.map +1 -0
- package/lib/{components/Card/helpers → helpers}/filters-setup.js +8 -5
- package/lib/helpers/filters-setup.js.map +1 -0
- package/lib/helpers/get-updated-items-to-display.js.map +1 -0
- package/lib/helpers/get-updated-sort-properties.js.map +1 -0
- package/lib/helpers/index.js +42 -0
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/should-return.js.map +1 -0
- package/lib/{components/Card/helpers → helpers}/should-skip-single-query.js +1 -1
- package/lib/helpers/should-skip-single-query.js.map +1 -0
- package/lib/hooks/index.js +14 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/use-filter-aggregation-values.js +54 -0
- package/lib/hooks/use-filter-aggregation-values.js.map +1 -0
- package/lib/hooks/use-portal.js +30 -0
- package/lib/hooks/use-portal.js.map +1 -0
- package/lib-es/components/Card/Card.js +14 -9
- package/lib-es/components/Card/Card.js.map +1 -1
- package/lib-es/components/Card/CardsContainer.js +9 -5
- package/lib-es/components/Card/CardsContainer.js.map +1 -1
- package/lib-es/components/Card/CardsFactory.js +40 -9
- package/lib-es/components/Card/CardsFactory.js.map +1 -1
- package/lib-es/components/Card/CardsRender.js +9 -5
- package/lib-es/components/Card/CardsRender.js.map +1 -1
- package/lib-es/components/Card/helpers/index.js +6 -6
- package/lib-es/components/Card/helpers/index.js.map +1 -1
- package/lib-es/components/Image/Lightbox/Lightbox.js +1 -1
- package/lib-es/components/Image/Lightbox/Lightbox.js.map +1 -1
- package/lib-es/components/List/ListRender.js.map +1 -1
- package/lib-es/components/MenuItem/MenuEntitiesItem.js +178 -0
- package/lib-es/components/MenuItem/MenuEntitiesItem.js.map +1 -0
- package/lib-es/components/MenuItem/MenuItem.js +28 -57
- package/lib-es/components/MenuItem/MenuItem.js.map +1 -1
- package/lib-es/components/MenuItem/MenuItemRender.js +84 -0
- package/lib-es/components/MenuItem/MenuItemRender.js.map +1 -0
- package/lib-es/components/MenuItem/helpers/index.js +3 -0
- package/lib-es/components/MenuItem/helpers/index.js.map +1 -0
- package/lib-es/components/MenuItem/helpers/inject-helper-into-template.js +8 -0
- package/lib-es/components/MenuItem/helpers/inject-helper-into-template.js.map +1 -0
- package/lib-es/components/Modal/Modal.js +1 -1
- package/lib-es/components/Modal/Modal.js.map +1 -1
- package/lib-es/components/ModalAdapter/ModalAdapter.js +13 -0
- package/lib-es/components/ModalAdapter/ModalAdapter.js.map +1 -0
- package/lib-es/components/ModalAdapter/index.js +3 -0
- package/lib-es/components/ModalAdapter/index.js.map +1 -0
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js +15 -4
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilterContainer.js +23 -20
- package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib-es/components/SearchFilter/components/Select.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/build-list-name-query.js +15 -0
- package/lib-es/components/SearchFilter/helpers/build-list-name-query.js.map +1 -0
- package/lib-es/components/SearchFilter/helpers/decode-encode.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/index.js +2 -1
- package/lib-es/components/SearchFilter/helpers/index.js.map +1 -1
- package/lib-es/components/Video/Video.js +2 -1
- package/lib-es/components/Video/Video.js.map +1 -1
- package/lib-es/components/Video/VideoContext.js +6 -0
- package/lib-es/components/Video/VideoContext.js.map +1 -0
- package/lib-es/components/Video/VideoModal.js +1 -1
- package/lib-es/components/Video/VideoModal.js.map +1 -1
- package/lib-es/components/Video/VideoRender.js +28 -3
- package/lib-es/components/Video/VideoRender.js.map +1 -1
- package/lib-es/components/Video/constants.js +7 -0
- package/lib-es/components/Video/constants.js.map +1 -0
- package/lib-es/components/Video/helpers/emit-gtm-event.js +25 -0
- package/lib-es/components/Video/helpers/emit-gtm-event.js.map +1 -0
- package/lib-es/components/Video/providers/JWPlayer/JWPlayerController.js +28 -4
- package/lib-es/components/Video/providers/JWPlayer/JWPlayerController.js.map +1 -1
- package/lib-es/components/Video/providers/JWPlayer/JWPlayerProvider.js +10 -4
- package/lib-es/components/Video/providers/JWPlayer/JWPlayerProvider.js.map +1 -1
- package/lib-es/components/Video/providers/YouTube/YoutubeEmbeded.js +60 -2
- package/lib-es/components/Video/providers/YouTube/YoutubeEmbeded.js.map +1 -1
- package/lib-es/helpers/build-filters-query.js +1 -2
- package/lib-es/helpers/build-filters-query.js.map +1 -1
- package/lib-es/{components/Card/helpers → helpers}/filter-query-setup.js +5 -3
- package/lib-es/helpers/filter-query-setup.js.map +1 -0
- package/lib-es/{components/Card/helpers → helpers}/filters-setup.js +4 -2
- package/lib-es/helpers/filters-setup.js.map +1 -0
- package/lib-es/helpers/get-updated-items-to-display.js.map +1 -0
- package/lib-es/helpers/get-updated-sort-properties.js.map +1 -0
- package/lib-es/helpers/index.js +6 -0
- package/lib-es/helpers/index.js.map +1 -1
- package/lib-es/helpers/should-return.js.map +1 -0
- package/lib-es/{components/Card/helpers → helpers}/should-skip-single-query.js +1 -1
- package/lib-es/helpers/should-skip-single-query.js.map +1 -0
- package/lib-es/hooks/index.js +2 -0
- package/lib-es/hooks/index.js.map +1 -1
- package/lib-es/hooks/use-filter-aggregation-values.js +31 -0
- package/lib-es/hooks/use-filter-aggregation-values.js.map +1 -0
- package/lib-es/hooks/use-portal.js +14 -0
- package/lib-es/hooks/use-portal.js.map +1 -0
- package/package.json +7 -7
- package/src/components/Card/Card.js +25 -16
- package/src/components/Card/CardsContainer.js +7 -3
- package/src/components/Card/CardsFactory.js +34 -6
- package/src/components/Card/CardsRender.js +6 -2
- package/src/components/Card/helpers/index.js +6 -6
- package/src/components/Image/Lightbox/Lightbox.js +1 -1
- package/src/components/List/ListRender.js +0 -1
- package/src/components/MenuItem/MenuEntitiesItem.js +204 -0
- package/src/components/MenuItem/MenuItem.js +15 -58
- package/src/components/MenuItem/MenuItemRender.js +92 -0
- package/src/components/MenuItem/helpers/index.js +3 -0
- package/src/components/MenuItem/helpers/inject-helper-into-template.js +11 -0
- package/src/components/Modal/Modal.js +1 -1
- package/src/components/ModalAdapter/ModalAdapter.js +12 -0
- package/src/components/ModalAdapter/index.js +3 -0
- package/src/components/SearchFilter/SearchFilter/SearchFilter.js +16 -5
- package/src/components/SearchFilter/SearchFilterContainer.js +21 -22
- package/src/components/SearchFilter/components/Select.js +2 -0
- package/src/components/SearchFilter/helpers/build-list-name-query.js +18 -0
- package/src/components/SearchFilter/helpers/decode-encode.js +0 -1
- package/src/components/SearchFilter/helpers/index.js +2 -0
- package/src/components/Video/Video.js +1 -1
- package/src/components/Video/VideoContext.js +7 -0
- package/src/components/Video/VideoModal.js +1 -1
- package/src/components/Video/VideoRender.js +28 -3
- package/src/components/Video/constants.js +6 -0
- package/src/components/Video/helpers/emit-gtm-event.js +25 -0
- package/src/components/Video/providers/JWPlayer/JWPlayerController.js +21 -4
- package/src/components/Video/providers/JWPlayer/JWPlayerProvider.js +7 -5
- package/src/components/Video/providers/YouTube/YoutubeEmbeded.js +65 -2
- package/src/helpers/build-filters-query.js +1 -3
- package/src/{components/Card/helpers → helpers}/filter-query-setup.js +5 -3
- package/src/{components/Card/helpers → helpers}/filters-setup.js +5 -2
- package/src/helpers/index.js +6 -0
- package/src/{components/Card/helpers → helpers}/should-skip-single-query.js +1 -1
- package/src/hooks/index.js +2 -0
- package/src/hooks/use-filter-aggregation-values.js +37 -0
- package/src/hooks/use-portal.js +18 -0
- package/tests/unit/src/components/Card/Card.test.js +16 -1
- package/tests/unit/src/components/Card/__snapshots__/Card.test.js.snap +83 -0
- package/tests/unit/src/components/Card/helpers/get-updated-items-to-display.test.js +1 -1
- package/tests/unit/src/components/Image/Lightbox/Lightbox.test.js +4 -0
- package/tests/unit/src/components/Image/Lightbox/__snapshots__/Lightbox.test.js.snap +3 -38
- package/tests/unit/src/components/MenuItem/MenuEntitiesItem.test.js +23 -0
- package/tests/unit/src/components/MenuItem/MenuItem.test.js +30 -11
- package/tests/unit/src/components/MenuItem/MenuItemRender.test.js +55 -0
- package/tests/unit/src/components/MenuItem/__snapshots__/MenuEntitiesItem.test.js.snap +3 -0
- package/tests/unit/src/components/MenuItem/__snapshots__/MenuItem.test.js.snap +5 -51
- package/tests/unit/src/components/MenuItem/helpers/inject-helper-into-template.test.js +44 -0
- package/tests/unit/src/components/MenuItem/mocks.js +71 -0
- package/tests/unit/src/components/Modal/Modal.test.js +4 -0
- package/tests/unit/src/components/Modal/__snapshots__/Modal.test.js.snap +7 -42
- package/tests/unit/src/components/SearchFilter/__snapshots__/SearchFilterContainer.test.js.snap +7 -1
- package/lib/components/Card/helpers/filter-query-setup.js.map +0 -1
- package/lib/components/Card/helpers/filters-setup.js.map +0 -1
- package/lib/components/Card/helpers/get-updated-items-to-display.js.map +0 -1
- package/lib/components/Card/helpers/get-updated-sort-properties.js.map +0 -1
- package/lib/components/Card/helpers/should-return.js.map +0 -1
- package/lib/components/Card/helpers/should-skip-single-query.js.map +0 -1
- package/lib-es/components/Card/helpers/filter-query-setup.js.map +0 -1
- package/lib-es/components/Card/helpers/filters-setup.js.map +0 -1
- package/lib-es/components/Card/helpers/get-updated-items-to-display.js.map +0 -1
- package/lib-es/components/Card/helpers/get-updated-sort-properties.js.map +0 -1
- package/lib-es/components/Card/helpers/should-return.js.map +0 -1
- package/lib-es/components/Card/helpers/should-skip-single-query.js.map +0 -1
- /package/lib/{components/Card/helpers → helpers}/get-updated-items-to-display.js +0 -0
- /package/lib/{components/Card/helpers → helpers}/get-updated-sort-properties.js +0 -0
- /package/lib/{components/Card/helpers → helpers}/should-return.js +0 -0
- /package/lib-es/{components/Card/helpers → helpers}/get-updated-items-to-display.js +0 -0
- /package/lib-es/{components/Card/helpers → helpers}/get-updated-sort-properties.js +0 -0
- /package/lib-es/{components/Card/helpers → helpers}/should-return.js +0 -0
- /package/src/{components/Card/helpers → helpers}/get-updated-items-to-display.js +0 -0
- /package/src/{components/Card/helpers → helpers}/get-updated-sort-properties.js +0 -0
- /package/src/{components/Card/helpers → helpers}/should-return.js +0 -0
|
@@ -3,28 +3,35 @@
|
|
|
3
3
|
require("core-js/modules/es.symbol.js");
|
|
4
4
|
require("core-js/modules/es.array.filter.js");
|
|
5
5
|
require("core-js/modules/es.array.for-each.js");
|
|
6
|
+
require("core-js/modules/es.array.iterator.js");
|
|
6
7
|
require("core-js/modules/es.object.define-properties.js");
|
|
7
8
|
require("core-js/modules/es.object.define-property.js");
|
|
8
9
|
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
9
10
|
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
10
11
|
require("core-js/modules/es.object.keys.js");
|
|
11
12
|
require("core-js/modules/es.object.to-string.js");
|
|
13
|
+
require("core-js/modules/es.string.iterator.js");
|
|
14
|
+
require("core-js/modules/es.weak-map.js");
|
|
12
15
|
require("core-js/modules/web.dom-collections.for-each.js");
|
|
16
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
13
17
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
18
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
14
19
|
Object.defineProperty(exports, "__esModule", {
|
|
15
20
|
value: true
|
|
16
21
|
});
|
|
17
22
|
exports["default"] = void 0;
|
|
18
23
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
24
|
require("core-js/modules/es.function.name.js");
|
|
20
|
-
var _react =
|
|
25
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
21
26
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
22
27
|
var _reactJwPlayer = _interopRequireDefault(require("react-jw-player"));
|
|
23
28
|
var _constants = require("../../../../constants");
|
|
24
29
|
var _JWPlayerController = _interopRequireDefault(require("./JWPlayerController"));
|
|
30
|
+
var _VideoContext = require("../../VideoContext");
|
|
31
|
+
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); }
|
|
32
|
+
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; }
|
|
25
33
|
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; }
|
|
26
34
|
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; }
|
|
27
|
-
var PlayerController = new _JWPlayerController["default"]();
|
|
28
35
|
var JWPlayerProvider = function JWPlayerProvider(_ref) {
|
|
29
36
|
var url = _ref.url,
|
|
30
37
|
name = _ref.name,
|
|
@@ -35,14 +42,19 @@ var JWPlayerProvider = function JWPlayerProvider(_ref) {
|
|
|
35
42
|
muted = _ref.muted,
|
|
36
43
|
imageData = _ref.imageData,
|
|
37
44
|
repeat = _ref.loop;
|
|
45
|
+
var _useContext = (0, _react.useContext)(_VideoContext.VideoContext),
|
|
46
|
+
emitEvent = _useContext.emitEvent;
|
|
47
|
+
var PlayerController = (0, _react.useRef)(new _JWPlayerController["default"]({
|
|
48
|
+
emitEvent: emitEvent
|
|
49
|
+
}));
|
|
38
50
|
var handleOnReady = function handleOnReady() {
|
|
39
51
|
var jwPlayer = window.jwplayer(name);
|
|
40
52
|
if (jwPlayer) {
|
|
41
|
-
PlayerController.setPlayer(jwPlayer);
|
|
53
|
+
PlayerController.current.setPlayer(jwPlayer);
|
|
42
54
|
}
|
|
43
55
|
};
|
|
44
56
|
var getJWPlayerProps = function getJWPlayerProps() {
|
|
45
|
-
var events = PlayerController.events;
|
|
57
|
+
var events = PlayerController.current.events;
|
|
46
58
|
var props = {
|
|
47
59
|
customProps: {
|
|
48
60
|
repeat: repeat,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JWPlayerProvider.js","names":["_react","
|
|
1
|
+
{"version":3,"file":"JWPlayerProvider.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_reactJwPlayer","_constants","_JWPlayerController","_VideoContext","_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","JWPlayerProvider","_ref","url","name","autoplay","controls","type","urlScript","muted","imageData","repeat","loop","_useContext","useContext","VideoContext","emitEvent","PlayerController","useRef","JWPlayerController","handleOnReady","jwPlayer","window","jwplayer","current","setPlayer","getJWPlayerProps","events","props","customProps","playerScript","isAutoPlay","isMuted","playerId","onReady","className","VIDEO_WRAPPER_CLASS_NAME","JW_PLAYER_TYPE_FILE","_imageData$url","imageURL","image","file","playlist","createElement","propTypes","PropTypes","string","isRequired","imageId","bool","object","defaultProps","_default","exports"],"sources":["../../../../../src/components/Video/providers/JWPlayer/JWPlayerProvider.js"],"sourcesContent":["import React, { useContext, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport ReactJWPlayer from 'react-jw-player';\nimport { JW_PLAYER_TYPE_FILE, VIDEO_WRAPPER_CLASS_NAME } from '../../../../constants';\nimport JWPlayerController from './JWPlayerController';\nimport { VideoContext } from '../../VideoContext';\n\nconst JWPlayerProvider = ({\n url,\n name,\n autoplay,\n controls,\n type,\n urlScript,\n muted,\n imageData,\n loop: repeat\n}) => {\n const { emitEvent } = useContext(VideoContext);\n const PlayerController = useRef(new JWPlayerController({ emitEvent }));\n\n const handleOnReady = () => {\n const jwPlayer = window.jwplayer(name);\n if (jwPlayer) {\n PlayerController.current.setPlayer(jwPlayer);\n }\n };\n\n const getJWPlayerProps = () => {\n const { events } = PlayerController.current;\n\n const props = {\n customProps: { repeat, controls, events },\n playerScript: urlScript,\n isAutoPlay: autoplay,\n isMuted: muted,\n playerId: name,\n onReady: handleOnReady,\n className: VIDEO_WRAPPER_CLASS_NAME\n };\n\n if (type === JW_PLAYER_TYPE_FILE) {\n const { url: imageURL = '' } = imageData;\n return { ...props, image: imageURL, file: url };\n }\n\n return { ...props, playlist: url };\n };\n\n return <ReactJWPlayer {...getJWPlayerProps()} />;\n};\n\nJWPlayerProvider.propTypes = {\n url: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n urlScript: PropTypes.string.isRequired,\n imageId: PropTypes.string,\n autoplay: PropTypes.bool,\n loop: PropTypes.bool,\n controls: PropTypes.bool,\n muted: PropTypes.bool,\n type: PropTypes.string,\n imageData: PropTypes.object\n};\n\nJWPlayerProvider.defaultProps = {\n autoplay: false,\n loop: false,\n controls: true,\n muted: false,\n type: 'playlist',\n imageId: null,\n imageData: {}\n};\n\nexport default JWPlayerProvider;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAAkD,SAAAO,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;AA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G;EAC3BzC,GAAG,EAAE0C,qBAAS,CAACC,MAAM,CAACC,UAAU;EAChC3C,IAAI,EAAEyC,qBAAS,CAACC,MAAM,CAACC,UAAU;EACjCvC,SAAS,EAAEqC,qBAAS,CAACC,MAAM,CAACC,UAAU;EACtCC,OAAO,EAAEH,qBAAS,CAACC,MAAM;EACzBzC,QAAQ,EAAEwC,qBAAS,CAACI,IAAI;EACxBrC,IAAI,EAAEiC,qBAAS,CAACI,IAAI;EACpB3C,QAAQ,EAAEuC,qBAAS,CAACI,IAAI;EACxBxC,KAAK,EAAEoC,qBAAS,CAACI,IAAI;EACrB1C,IAAI,EAAEsC,qBAAS,CAACC,MAAM;EACtBpC,SAAS,EAAEmC,qBAAS,CAACK;AACvB,CAAC;AAEDjD,gBAAgB,CAACkD,YAAY,GAAG;EAC9B9C,QAAQ,EAAE,KAAK;EACfO,IAAI,EAAE,KAAK;EACXN,QAAQ,EAAE,IAAI;EACdG,KAAK,EAAE,KAAK;EACZF,IAAI,EAAE,UAAU;EAChByC,OAAO,EAAE,IAAI;EACbtC,SAAS,EAAE,CAAC;AACd,CAAC;AAAC,IAAA0C,QAAA,GAAAC,OAAA,cAEapD,gBAAgB","ignoreList":[]}
|
|
@@ -20,8 +20,11 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
20
20
|
var _customHooks = require("@blaze-react/utils/lib/customHooks");
|
|
21
21
|
var _constants = require("../../../../constants");
|
|
22
22
|
var _helpers = require("./helpers");
|
|
23
|
+
var _VideoContext = require("../../VideoContext");
|
|
24
|
+
var _constants2 = require("../../constants");
|
|
23
25
|
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); }
|
|
24
26
|
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; }
|
|
27
|
+
var SCRIPT_ID = 'youtube-iframe-api';
|
|
25
28
|
var YoutubeEmbeded = function YoutubeEmbeded(_ref) {
|
|
26
29
|
var autoplay = _ref.autoplay,
|
|
27
30
|
videoId = _ref.videoId,
|
|
@@ -40,6 +43,10 @@ var YoutubeEmbeded = function YoutubeEmbeded(_ref) {
|
|
|
40
43
|
priority = _ref.priority,
|
|
41
44
|
placeholderOnly = _ref.placeholderOnly,
|
|
42
45
|
imageData = _ref.imageData;
|
|
46
|
+
var ref = (0, _react.useRef)(null);
|
|
47
|
+
var playerRef = (0, _react.useRef)(null);
|
|
48
|
+
var _useContext = (0, _react.useContext)(_VideoContext.VideoContext),
|
|
49
|
+
emitEvent = _useContext.emitEvent;
|
|
43
50
|
var _useInView = (0, _customHooks.useInView)(_constants.IN_VIEW_CONFIG),
|
|
44
51
|
_useInView2 = (0, _slicedToArray2["default"])(_useInView, 2),
|
|
45
52
|
isIntersecting = _useInView2[0],
|
|
@@ -74,7 +81,55 @@ var YoutubeEmbeded = function YoutubeEmbeded(_ref) {
|
|
|
74
81
|
});
|
|
75
82
|
var mutedValue = muted ? '&mute=1' : '';
|
|
76
83
|
var iframeSrc = !playlist ? "".concat(ytUrl, "/embed/").concat(encodedId, "?autoplay=1").concat(mutedValue).concat(paramsImp) : "".concat(ytUrl, "/embed/videoseries?autoplay=1").concat(mutedValue, "&list=").concat(encodedId).concat(paramsImp);
|
|
84
|
+
if (emitEvent) {
|
|
85
|
+
iframeSrc += "&enablejsapi=1";
|
|
86
|
+
}
|
|
77
87
|
var parsedWrapperClassname = "yt-facade ".concat(renderIframe ? 'yt-activated' : '');
|
|
88
|
+
var iframeId = "yt-iframe-".concat(videoId);
|
|
89
|
+
(0, _react.useEffect)(function () {
|
|
90
|
+
if (!emitEvent || !renderIframe) return;
|
|
91
|
+
if (!document.getElementById(SCRIPT_ID)) {
|
|
92
|
+
// if script not already loaded
|
|
93
|
+
var tag = document.createElement('script');
|
|
94
|
+
tag.id = SCRIPT_ID;
|
|
95
|
+
tag.src = 'https://www.youtube.com/iframe_api';
|
|
96
|
+
var firstScriptTag = document.getElementsByTagName('script')[0];
|
|
97
|
+
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
|
98
|
+
}
|
|
99
|
+
var onStateChange = function onStateChange(event) {
|
|
100
|
+
var action = '';
|
|
101
|
+
if (event.data === window.YT.PlayerState.ENDED) {
|
|
102
|
+
action = _constants2.EVENT_ACTIONS.ENDED;
|
|
103
|
+
} else if (event.data === window.YT.PlayerState.PAUSED) {
|
|
104
|
+
action = _constants2.EVENT_ACTIONS.PAUSED;
|
|
105
|
+
} else if (event.data === window.YT.PlayerState.PLAYING) {
|
|
106
|
+
action = _constants2.EVENT_ACTIONS.PLAYING;
|
|
107
|
+
}
|
|
108
|
+
emitEvent({
|
|
109
|
+
action: action,
|
|
110
|
+
videoId: videoId
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
if (window.YT) {
|
|
114
|
+
// if script already loaded then attach player
|
|
115
|
+
window.YT.ready(function () {
|
|
116
|
+
playerRef.current = new window.YT.Player(iframeId, {
|
|
117
|
+
events: {
|
|
118
|
+
onStateChange: onStateChange
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
} else {
|
|
123
|
+
// called on script load
|
|
124
|
+
window.onYouTubeIframeAPIReady = function () {
|
|
125
|
+
playerRef.current = new window.YT.Player(ref.current, {
|
|
126
|
+
events: {
|
|
127
|
+
onStateChange: onStateChange
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}, [emitEvent, iframeId, renderIframe, videoId]);
|
|
78
133
|
(0, _react.useEffect)(function () {
|
|
79
134
|
var isMounted = true;
|
|
80
135
|
if (!priority && !isIntersecting || imageSize === _helpers.YT_HQ_FORMAT) return;
|
|
@@ -135,6 +190,8 @@ var YoutubeEmbeded = function YoutubeEmbeded(_ref) {
|
|
|
135
190
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
136
191
|
className: "yt-facade-button"
|
|
137
192
|
})), renderIframe && /*#__PURE__*/_react["default"].createElement("iframe", {
|
|
193
|
+
ref: ref,
|
|
194
|
+
id: iframeId,
|
|
138
195
|
className: iframeClass,
|
|
139
196
|
title: videoTitle,
|
|
140
197
|
allow: "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YoutubeEmbeded.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_customHooks","_constants","_helpers","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","YoutubeEmbeded","_ref","autoplay","videoId","playlistCoverId","videoTitle","poster","videoParams","announce","noCookie","webp","playlist","onIframeAdded","muted","adNetwork","iframeClass","priority","placeholderOnly","imageData","_useInView","useInView","IN_VIEW_CONFIG","_useInView2","_slicedToArray2","isIntersecting","outerRef","_useState","useState","_useState2","preconnected","setPreconnected","_useState3","_useState4","renderIframe","setRenderIframe","_useState5","imageSize","displayImage","_useState6","_useState6$","setImageDetails","encodedId","encodeURIComponent","paramsImp","concat","ytUrl","posterUrl","getPosterUrl","mutedValue","iframeSrc","parsedWrapperClassname","useEffect","isMounted","YT_HQ_FORMAT","img","Image","onload","newImageSize","width","src","warmConnections","addIframe","createElement","Fragment","rel","href","YT_IMAGE_URL","ref","role","onPointerOver","onClick","className","style","backgroundImage","type","title","allow","allowFullScreen","propTypes","PropTypes","bool","func","string","object","defaultProps","_default","exports"],"sources":["../../../../../src/components/Video/providers/YouTube/YoutubeEmbeded.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { useInView } from '@blaze-react/utils/lib/customHooks';\nimport { IN_VIEW_CONFIG } from '../../../../constants';\nimport { getPosterUrl, YT_HQ_FORMAT, YT_IMAGE_URL } from './helpers';\n\nconst YoutubeEmbeded = ({\n autoplay,\n videoId,\n playlistCoverId,\n videoTitle,\n poster,\n videoParams,\n announce,\n noCookie,\n webp,\n playlist,\n onIframeAdded,\n muted,\n adNetwork,\n iframeClass,\n priority,\n placeholderOnly,\n imageData\n}) => {\n const [isIntersecting, outerRef] = useInView(IN_VIEW_CONFIG);\n const [preconnected, setPreconnected] = useState(false);\n const [renderIframe, setRenderIframe] = useState(!!autoplay);\n const [{ imageSize, displayImage }, setImageDetails] = useState({\n imageSize: poster,\n displayImage: priority\n });\n\n const encodedId = encodeURIComponent(videoId);\n const paramsImp = videoParams ? `&${videoParams}` : '';\n const ytUrl = noCookie ? 'https://www.youtube-nocookie.com' : 'https://www.youtube.com';\n const posterUrl = getPosterUrl({\n imageData,\n playlistCoverId,\n playlist,\n encodedId,\n imageSize,\n webp\n });\n const mutedValue = muted ? '&mute=1' : '';\n const iframeSrc = !playlist\n ? `${ytUrl}/embed/${encodedId}?autoplay=1${mutedValue}${paramsImp}`\n : `${ytUrl}/embed/videoseries?autoplay=1${mutedValue}&list=${encodedId}${paramsImp}`;\n const parsedWrapperClassname = `yt-facade ${renderIframe ? 'yt-activated' : ''}`;\n\n useEffect(\n () => {\n let isMounted = true;\n if ((!priority && !isIntersecting) || imageSize === YT_HQ_FORMAT) return;\n\n const img = new Image();\n // eslint-disable-next-line func-names\n img.onload = function() {\n let newImageSize = imageSize;\n if (this && this.width === 120) newImageSize = YT_HQ_FORMAT;\n if (isMounted) setImageDetails({ imageSize: newImageSize, displayImage: true });\n };\n\n img.src = posterUrl;\n return () => {\n isMounted = false;\n };\n },\n [imageSize, isIntersecting, posterUrl, priority]\n );\n\n const warmConnections = () => {\n if (preconnected) return;\n setPreconnected(true);\n };\n\n const addIframe = () => {\n if (renderIframe || placeholderOnly) return;\n onIframeAdded();\n setRenderIframe(true);\n };\n\n return (\n <>\n {preconnected && (\n <>\n <link rel=\"preconnect\" href={YT_IMAGE_URL} />\n <link rel=\"preconnect\" href={ytUrl} />\n <link rel=\"preconnect\" href=\"https://www.google.com\" />\n {adNetwork && (\n <>\n <link rel=\"preconnect\" href=\"https://static.doubleclick.net\" />\n <link rel=\"preconnect\" href=\"https://googleads.g.doubleclick.net\" />\n </>\n )}\n </>\n )}\n <div\n ref={outerRef}\n role=\"button\"\n onPointerOver={warmConnections}\n onClick={addIframe}\n className={parsedWrapperClassname}\n data-title={videoTitle}\n aria-label={`View ${videoTitle || 'video'}`}\n style={{\n backgroundImage: `url(${displayImage ? posterUrl : ''})`\n }}>\n <div\n type=\"button\"\n className=\"yt-facade-button-wrapper\"\n aria-label={`${announce} ${videoTitle}`}>\n <div className=\"yt-facade-button\" />\n </div>\n {renderIframe && (\n <iframe\n className={iframeClass}\n title={videoTitle}\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n src={iframeSrc}\n />\n )}\n </div>\n </>\n );\n};\n\nYoutubeEmbeded.propTypes = {\n priority: PropTypes.bool,\n onIframeAdded: PropTypes.func,\n adNetwork: PropTypes.bool,\n autoplay: PropTypes.bool,\n playlist: PropTypes.bool,\n muted: PropTypes.bool,\n webp: PropTypes.bool,\n noCookie: PropTypes.bool,\n videoId: PropTypes.string,\n iframeClass: PropTypes.string,\n poster: PropTypes.string,\n announce: PropTypes.string,\n playlistCoverId: PropTypes.string,\n videoParams: PropTypes.string,\n videoTitle: PropTypes.string,\n placeholderOnly: PropTypes.bool,\n imageData: PropTypes.object\n};\n\nYoutubeEmbeded.defaultProps = {\n priority: true,\n onIframeAdded: () => {},\n adNetwork: false,\n autoplay: false,\n playlist: false,\n muted: false,\n webp: false,\n noCookie: false,\n iframeClass: '',\n poster: 'sddefault',\n announce: 'Watch',\n videoId: '',\n playlistCoverId: '',\n videoParams: '',\n videoTitle: '',\n placeholderOnly: false,\n imageData: {}\n};\n\nexport default YoutubeEmbeded;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAAqE,SAAAM,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,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IA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,CAAC;AACd,CAAC;AAAC,IAAAmE,QAAA,GAAAC,OAAA,cAEatF,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"YoutubeEmbeded.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_customHooks","_constants","_helpers","_VideoContext","_constants2","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","SCRIPT_ID","YoutubeEmbeded","_ref","autoplay","videoId","playlistCoverId","videoTitle","poster","videoParams","announce","noCookie","webp","playlist","onIframeAdded","muted","adNetwork","iframeClass","priority","placeholderOnly","imageData","ref","useRef","playerRef","_useContext","useContext","VideoContext","emitEvent","_useInView","useInView","IN_VIEW_CONFIG","_useInView2","_slicedToArray2","isIntersecting","outerRef","_useState","useState","_useState2","preconnected","setPreconnected","_useState3","_useState4","renderIframe","setRenderIframe","_useState5","imageSize","displayImage","_useState6","_useState6$","setImageDetails","encodedId","encodeURIComponent","paramsImp","concat","ytUrl","posterUrl","getPosterUrl","mutedValue","iframeSrc","parsedWrapperClassname","iframeId","useEffect","document","getElementById","tag","createElement","id","src","firstScriptTag","getElementsByTagName","parentNode","insertBefore","onStateChange","event","action","data","window","YT","PlayerState","ENDED","EVENT_ACTIONS","PAUSED","PLAYING","ready","current","Player","events","onYouTubeIframeAPIReady","isMounted","YT_HQ_FORMAT","img","Image","onload","newImageSize","width","warmConnections","addIframe","Fragment","rel","href","YT_IMAGE_URL","role","onPointerOver","onClick","className","style","backgroundImage","type","title","allow","allowFullScreen","propTypes","PropTypes","bool","func","string","object","defaultProps","_default","exports"],"sources":["../../../../../src/components/Video/providers/YouTube/YoutubeEmbeded.js"],"sourcesContent":["import React, { useState, useEffect, useContext, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { useInView } from '@blaze-react/utils/lib/customHooks';\nimport { IN_VIEW_CONFIG } from '../../../../constants';\nimport { getPosterUrl, YT_HQ_FORMAT, YT_IMAGE_URL } from './helpers';\nimport { VideoContext } from '../../VideoContext';\nimport { EVENT_ACTIONS } from '../../constants';\n\nconst SCRIPT_ID = 'youtube-iframe-api';\n\nconst YoutubeEmbeded = ({\n autoplay,\n videoId,\n playlistCoverId,\n videoTitle,\n poster,\n videoParams,\n announce,\n noCookie,\n webp,\n playlist,\n onIframeAdded,\n muted,\n adNetwork,\n iframeClass,\n priority,\n placeholderOnly,\n imageData\n}) => {\n const ref = useRef(null);\n const playerRef = useRef(null);\n const { emitEvent } = useContext(VideoContext);\n const [isIntersecting, outerRef] = useInView(IN_VIEW_CONFIG);\n const [preconnected, setPreconnected] = useState(false);\n const [renderIframe, setRenderIframe] = useState(!!autoplay);\n const [{ imageSize, displayImage }, setImageDetails] = useState({\n imageSize: poster,\n displayImage: priority\n });\n\n const encodedId = encodeURIComponent(videoId);\n const paramsImp = videoParams ? `&${videoParams}` : '';\n const ytUrl = noCookie ? 'https://www.youtube-nocookie.com' : 'https://www.youtube.com';\n const posterUrl = getPosterUrl({\n imageData,\n playlistCoverId,\n playlist,\n encodedId,\n imageSize,\n webp\n });\n const mutedValue = muted ? '&mute=1' : '';\n let iframeSrc = !playlist\n ? `${ytUrl}/embed/${encodedId}?autoplay=1${mutedValue}${paramsImp}`\n : `${ytUrl}/embed/videoseries?autoplay=1${mutedValue}&list=${encodedId}${paramsImp}`;\n if (emitEvent) {\n iframeSrc += `&enablejsapi=1`;\n }\n\n const parsedWrapperClassname = `yt-facade ${renderIframe ? 'yt-activated' : ''}`;\n const iframeId = `yt-iframe-${videoId}`;\n\n useEffect(\n () => {\n if (!emitEvent || !renderIframe) return;\n\n if (!document.getElementById(SCRIPT_ID)) {\n // if script not already loaded\n const tag = document.createElement('script');\n tag.id = SCRIPT_ID;\n tag.src = 'https://www.youtube.com/iframe_api';\n const firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n }\n\n const onStateChange = event => {\n let action = '';\n if (event.data === window.YT.PlayerState.ENDED) {\n action = EVENT_ACTIONS.ENDED;\n } else if (event.data === window.YT.PlayerState.PAUSED) {\n action = EVENT_ACTIONS.PAUSED;\n } else if (event.data === window.YT.PlayerState.PLAYING) {\n action = EVENT_ACTIONS.PLAYING;\n }\n\n emitEvent({ action, videoId });\n };\n\n if (window.YT) {\n // if script already loaded then attach player\n window.YT.ready(() => {\n playerRef.current = new window.YT.Player(iframeId, {\n events: {\n onStateChange\n }\n });\n });\n } else {\n // called on script load\n window.onYouTubeIframeAPIReady = () => {\n playerRef.current = new window.YT.Player(ref.current, {\n events: {\n onStateChange\n }\n });\n };\n }\n },\n [emitEvent, iframeId, renderIframe, videoId]\n );\n\n useEffect(\n () => {\n let isMounted = true;\n if ((!priority && !isIntersecting) || imageSize === YT_HQ_FORMAT) return;\n\n const img = new Image();\n // eslint-disable-next-line func-names\n img.onload = function() {\n let newImageSize = imageSize;\n if (this && this.width === 120) newImageSize = YT_HQ_FORMAT;\n if (isMounted) setImageDetails({ imageSize: newImageSize, displayImage: true });\n };\n\n img.src = posterUrl;\n return () => {\n isMounted = false;\n };\n },\n [imageSize, isIntersecting, posterUrl, priority]\n );\n\n const warmConnections = () => {\n if (preconnected) return;\n setPreconnected(true);\n };\n\n const addIframe = () => {\n if (renderIframe || placeholderOnly) return;\n onIframeAdded();\n setRenderIframe(true);\n };\n\n return (\n <>\n {preconnected && (\n <>\n <link rel=\"preconnect\" href={YT_IMAGE_URL} />\n <link rel=\"preconnect\" href={ytUrl} />\n <link rel=\"preconnect\" href=\"https://www.google.com\" />\n {adNetwork && (\n <>\n <link rel=\"preconnect\" href=\"https://static.doubleclick.net\" />\n <link rel=\"preconnect\" href=\"https://googleads.g.doubleclick.net\" />\n </>\n )}\n </>\n )}\n <div\n ref={outerRef}\n role=\"button\"\n onPointerOver={warmConnections}\n onClick={addIframe}\n className={parsedWrapperClassname}\n data-title={videoTitle}\n aria-label={`View ${videoTitle || 'video'}`}\n style={{\n backgroundImage: `url(${displayImage ? posterUrl : ''})`\n }}>\n <div\n type=\"button\"\n className=\"yt-facade-button-wrapper\"\n aria-label={`${announce} ${videoTitle}`}>\n <div className=\"yt-facade-button\" />\n </div>\n {renderIframe && (\n <iframe\n ref={ref}\n id={iframeId}\n className={iframeClass}\n title={videoTitle}\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n src={iframeSrc}\n />\n )}\n </div>\n </>\n );\n};\n\nYoutubeEmbeded.propTypes = {\n priority: PropTypes.bool,\n onIframeAdded: PropTypes.func,\n adNetwork: PropTypes.bool,\n autoplay: PropTypes.bool,\n playlist: PropTypes.bool,\n muted: PropTypes.bool,\n webp: PropTypes.bool,\n noCookie: PropTypes.bool,\n videoId: PropTypes.string,\n iframeClass: PropTypes.string,\n poster: PropTypes.string,\n announce: PropTypes.string,\n playlistCoverId: PropTypes.string,\n videoParams: PropTypes.string,\n videoTitle: PropTypes.string,\n placeholderOnly: PropTypes.bool,\n imageData: PropTypes.object\n};\n\nYoutubeEmbeded.defaultProps = {\n priority: true,\n onIframeAdded: () => {},\n adNetwork: false,\n autoplay: false,\n playlist: false,\n muted: false,\n webp: false,\n noCookie: false,\n iframeClass: '',\n poster: 'sddefault',\n announce: 'Watch',\n videoId: '',\n playlistCoverId: '',\n videoParams: '',\n videoTitle: '',\n placeholderOnly: false,\n imageData: {}\n};\n\nexport default YoutubeEmbeded;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAAgD,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,O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AQ,EAAE,IAAI;EACdJ,aAAa,EAAE,SAAAA,cAAA,EAAM,CAAC,CAAC;EACvBE,SAAS,EAAE,KAAK;EAChBZ,QAAQ,EAAE,KAAK;EACfS,QAAQ,EAAE,KAAK;EACfE,KAAK,EAAE,KAAK;EACZH,IAAI,EAAE,KAAK;EACXD,QAAQ,EAAE,KAAK;EACfM,WAAW,EAAE,EAAE;EACfT,MAAM,EAAE,WAAW;EACnBE,QAAQ,EAAE,OAAO;EACjBL,OAAO,EAAE,EAAE;EACXC,eAAe,EAAE,EAAE;EACnBG,WAAW,EAAE,EAAE;EACfF,UAAU,EAAE,EAAE;EACdY,eAAe,EAAE,KAAK;EACtBC,SAAS,EAAE,CAAC;AACd,CAAC;AAAC,IAAAkG,QAAA,GAAAC,OAAA,cAEarH,cAAc","ignoreList":[]}
|
|
@@ -58,9 +58,8 @@ var buildFiltersQuery = function buildFiltersQuery(_ref2) {
|
|
|
58
58
|
rangeValues = _ref2.rangeValues,
|
|
59
59
|
queryKeys = _ref2.queryKeys,
|
|
60
60
|
query = _ref2.query;
|
|
61
|
-
if (!shouldAddFilters) return [];
|
|
62
61
|
var mustFilters = [];
|
|
63
|
-
if (query) {
|
|
62
|
+
if (shouldAddFilters && query) {
|
|
64
63
|
Object.keys(query).forEach(function (queryKey) {
|
|
65
64
|
if (QUERY_KEYS_TO_IGNORE.includes(queryKey)) return;
|
|
66
65
|
if (!queryKey || !query[queryKey]) return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-filters-query.js","names":["QUERY_KEYS_TO_IGNORE","builFilterObject","_ref","queryKey","value","filters","isRange","isInQuery","min","minValue","max","maxValue","push","range","_defineProperty2","gte","Number","lte","key","concat","isArray","Array","singleFilterObj","match","forEach","filterValue","buildFiltersQuery","_ref2","shouldAddFilters","filterBy","filterByProperty","rangeValues","queryKeys","query","mustFilters","Object","keys","includes","queryValue","length","filterByPropOption","_filterByPropOption$s","split","_filterByPropOption$s2","_slicedToArray2","filterByPropKey","filterByOption","indexOf","_filterByOption$split","_filterByOption$split2","filteryByValue","filterByKeyword","_default","exports"],"sources":["../../src/helpers/build-filters-query.js"],"sourcesContent":["const QUERY_KEYS_TO_IGNORE = ['dataNotSet', 'shouldSearch', 'search_term'];\n\nconst builFilterObject = ({ queryKey, value, filters, isRange, isInQuery }) => {\n if (isRange) {\n // don't add to query if value matches range values\n if (isInQuery || (value.min !== value.minValue && value.max !== value.maxValue)) {\n filters.push({\n range: {\n [queryKey]: {\n gte: Number(value.minValue),\n lte: Number(value.maxValue)\n }\n }\n });\n }\n return;\n }\n\n const key = isRange ? queryKey : `${queryKey}.keyword`;\n\n const isArray = Array.isArray(value);\n if (!isArray) {\n const singleFilterObj = { match: { [key]: value } };\n filters.push(singleFilterObj);\n return;\n }\n\n value.forEach(filterValue => {\n filters.push({ match: { [key]: filterValue } });\n });\n};\n\nconst buildFiltersQuery = ({\n shouldAddFilters,\n
|
|
1
|
+
{"version":3,"file":"build-filters-query.js","names":["QUERY_KEYS_TO_IGNORE","builFilterObject","_ref","queryKey","value","filters","isRange","isInQuery","min","minValue","max","maxValue","push","range","_defineProperty2","gte","Number","lte","key","concat","isArray","Array","singleFilterObj","match","forEach","filterValue","buildFiltersQuery","_ref2","shouldAddFilters","filterBy","filterByProperty","rangeValues","queryKeys","query","mustFilters","Object","keys","includes","queryValue","length","filterByPropOption","_filterByPropOption$s","split","_filterByPropOption$s2","_slicedToArray2","filterByPropKey","filterByOption","indexOf","_filterByOption$split","_filterByOption$split2","filteryByValue","filterByKeyword","_default","exports"],"sources":["../../src/helpers/build-filters-query.js"],"sourcesContent":["const QUERY_KEYS_TO_IGNORE = ['dataNotSet', 'shouldSearch', 'search_term'];\n\nconst builFilterObject = ({ queryKey, value, filters, isRange, isInQuery }) => {\n if (isRange) {\n // don't add to query if value matches range values\n if (isInQuery || (value.min !== value.minValue && value.max !== value.maxValue)) {\n filters.push({\n range: {\n [queryKey]: {\n gte: Number(value.minValue),\n lte: Number(value.maxValue)\n }\n }\n });\n }\n return;\n }\n\n const key = isRange ? queryKey : `${queryKey}.keyword`;\n\n const isArray = Array.isArray(value);\n if (!isArray) {\n const singleFilterObj = { match: { [key]: value } };\n filters.push(singleFilterObj);\n return;\n }\n\n value.forEach(filterValue => {\n filters.push({ match: { [key]: filterValue } });\n });\n};\n\nconst buildFiltersQuery = ({\n shouldAddFilters,\n filterBy,\n filterByProperty,\n rangeValues,\n queryKeys,\n query\n}) => {\n const mustFilters = [];\n if (shouldAddFilters && query) {\n Object.keys(query).forEach(queryKey => {\n if (QUERY_KEYS_TO_IGNORE.includes(queryKey)) return;\n if (!queryKey || !query[queryKey]) return;\n const queryValue = query[queryKey];\n\n const isRange = rangeValues.includes(queryKey);\n const isInQuery = queryKeys.includes(queryKey);\n builFilterObject({ queryKey, value: queryValue, filters: mustFilters, isRange, isInQuery });\n });\n }\n\n if (filterByProperty && filterByProperty.length) {\n filterByProperty.forEach(filterByPropOption => {\n const [filterByPropKey] = filterByPropOption.split('/');\n filterBy.forEach(filterByOption => {\n if (filterByOption.indexOf(filterByPropKey) === -1) return;\n const [, filteryByValue] = filterByOption.split('/');\n const filterByKeyword = `${filterByPropKey}.keyword`;\n if (!filteryByValue) return;\n mustFilters.push({ match: { [filterByKeyword]: filteryByValue } });\n });\n });\n }\n\n return mustFilters;\n};\n\nexport default buildFiltersQuery;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAMA,oBAAoB,GAAG,CAAC,YAAY,EAAE,cAAc,EAAE,aAAa,CAAC;AAE1E,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAAyD;EAAA,IAAnDC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IAAEC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;IAAEC,SAAS,GAAAL,IAAA,CAATK,SAAS;EACtE,IAAID,O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U;QACpD,IAAI,CAACK,cAAc,EAAE;QACrBhB,WAAW,CAACtB,IAAI,CAAC;UAAEW,KAAK,MAAAT,gBAAA,iBAAKqC,eAAe,EAAGD,cAAc;QAAG,CAAC,CAAC;MACpE,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;EAEA,OAAOhB,WAAW;AACpB,CAAC;AAAC,IAAAkB,QAAA,GAAAC,OAAA,cAEa3B,iBAAiB","ignoreList":[]}
|
|
@@ -18,8 +18,10 @@ exports["default"] = void 0;
|
|
|
18
18
|
require("core-js/modules/es.number.constructor.js");
|
|
19
19
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
20
20
|
var _helpers = require("@blaze-cms/utils/src/helpers");
|
|
21
|
-
var
|
|
22
|
-
var
|
|
21
|
+
var _getGenericRenderVariables = _interopRequireDefault(require("./get-generic-render-variables"));
|
|
22
|
+
var _buildRawQueryBase = _interopRequireDefault(require("./build-raw-query-base"));
|
|
23
|
+
var _buildSetFilters = _interopRequireDefault(require("./build-set-filters"));
|
|
24
|
+
var _constants = require("../constants");
|
|
23
25
|
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; }
|
|
24
26
|
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; }
|
|
25
27
|
var filterQuerySetup = function filterQuerySetup(_ref) {
|
|
@@ -33,13 +35,14 @@ var filterQuerySetup = function filterQuerySetup(_ref) {
|
|
|
33
35
|
itemsToDisplay = _ref.itemsToDisplay,
|
|
34
36
|
entitySameAsCurrentItemEntity = _ref.entitySameAsCurrentItemEntity,
|
|
35
37
|
entitySchema = _ref.entitySchema,
|
|
36
|
-
useRandomSort = _ref.useRandomSort
|
|
38
|
+
_ref$useRandomSort = _ref.useRandomSort,
|
|
39
|
+
useRandomSort = _ref$useRandomSort === void 0 ? false : _ref$useRandomSort;
|
|
37
40
|
var stringProps = (0, _helpers.getStringTypeProps)(entity, filterEntityRelations, getEntitySchemas);
|
|
38
|
-
var filterValues = updatedFilterBy && updatedFilterBy.length ? (0,
|
|
41
|
+
var filterValues = updatedFilterBy && updatedFilterBy.length ? (0, _buildSetFilters["default"])(_objectSpread(_objectSpread({}, variableProps), {}, {
|
|
39
42
|
filterBy: updatedFilterBy
|
|
40
|
-
})) : (0,
|
|
43
|
+
})) : (0, _buildSetFilters["default"])(variableProps);
|
|
41
44
|
var rawQuery = {
|
|
42
|
-
bool: (0,
|
|
45
|
+
bool: (0, _buildRawQueryBase["default"])({
|
|
43
46
|
docType: docType,
|
|
44
47
|
filterValues: filterValues,
|
|
45
48
|
filterOperator: filterOperator,
|
|
@@ -56,7 +59,7 @@ var filterQuerySetup = function filterQuerySetup(_ref) {
|
|
|
56
59
|
var settingsLimit = variableProps.limit;
|
|
57
60
|
var limit = settingsLimit || _constants.DEFAULT_LIMIT; // all falsey should use default
|
|
58
61
|
var requestLimit = entitySameAsCurrentItemEntity ? Number(limit) + 1 : limit;
|
|
59
|
-
var variables = (0,
|
|
62
|
+
var variables = (0, _getGenericRenderVariables["default"])({
|
|
60
63
|
relations: filterEntityRelations,
|
|
61
64
|
filterProps: _objectSpread(_objectSpread({}, variableProps), {}, {
|
|
62
65
|
limit: requestLimit
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-query-setup.js","names":["_helpers","require","_getGenericRenderVariables","_interopRequireDefault","_buildRawQueryBase","_buildSetFilters","_constants","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","filterQuerySetup","_ref","getEntitySchemas","entity","updatedFilterBy","variableProps","docType","filterOperator","filterEntityRelations","itemsToDisplay","entitySameAsCurrentItemEntity","entitySchema","_ref$useRandomSort","useRandomSort","stringProps","getStringTypeProps","filterValues","buildSetFilters","filterBy","rawQuery","bool","buildRawQueryBase","relations","addListFiltersToQuery","settingsLimit","limit","DEFAULT_LIMIT","requestLimit","Number","variables","getGenericRenderVariables","filterProps","_default","exports"],"sources":["../../src/helpers/filter-query-setup.js"],"sourcesContent":["import { getStringTypeProps } from '@blaze-cms/utils/src/helpers';\nimport getGenericRenderVariables from './get-generic-render-variables';\nimport buildRawQueryBase from './build-raw-query-base';\nimport buildSetFilters from './build-set-filters';\nimport { DEFAULT_LIMIT } from '../constants';\n\nconst filterQuerySetup = ({\n getEntitySchemas,\n entity,\n updatedFilterBy,\n variableProps,\n docType,\n filterOperator,\n filterEntityRelations,\n itemsToDisplay,\n entitySameAsCurrentItemEntity,\n entitySchema,\n useRandomSort = false\n}) => {\n const stringProps = getStringTypeProps(entity, filterEntityRelations, getEntitySchemas);\n const filterValues =\n updatedFilterBy && updatedFilterBy.length\n ? buildSetFilters({ ...variableProps, filterBy: updatedFilterBy })\n : buildSetFilters(variableProps);\n\n const rawQuery = {\n bool: buildRawQueryBase({\n docType,\n filterValues,\n filterOperator,\n relations: filterEntityRelations,\n stringProps,\n itemsToDisplay,\n addListFiltersToQuery: true,\n entity,\n entitySchema\n })\n };\n\n // increase limit to get extra item in case results contain current parent\n const { limit: settingsLimit } = variableProps;\n const limit = settingsLimit || DEFAULT_LIMIT; // all falsey should use default\n const requestLimit = entitySameAsCurrentItemEntity ? Number(limit) + 1 : limit;\n const variables = getGenericRenderVariables({\n relations: filterEntityRelations,\n filterProps: { ...variableProps, limit: requestLimit },\n stringProps,\n rawQuery,\n useRandomSort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,CAAC;;EAED;EACA,IAAea,aAAa,GAAKnB,aAAa,CAAtCoB,KAAK;EACb,IAAMA,KAAK,GAAGD,aAAa,IAAIE,wBAAa,CAAC,CAAC;EAC9C,IAAMC,YAAY,GAAGjB,6BAA6B,GAAGkB,MAAM,CAACH,KAAK,CAAC,GAAG,CAAC,GAAGA,KAAK;EAC9E,IAAMI,SAAS,GAAG,IAAAC,qCAAyB,EAAC;IAC1CR,SAAS,EAAEd,qBAAqB;IAChCuB,WAAW,EAAAvC,aAAA,CAAAA,aAAA,KAAOa,aAAa;MAAEoB,KAAK,EAAEE;IAAY,EAAE;IACtDb,WAAW,EAAXA,WAAW;IACXK,QAAQ,EAARA,QAAQ;IACRN,aAAa,EAAbA;EACF,CAAC,CAAC;EAEF,OAAO;IAAEgB,SAAS,EAATA,SAAS;IAAEJ,KAAK,EAALA;EAAM,CAAC;AAC7B,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,cAEajC,gBAAgB","ignoreList":[]}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = void 0;
|
|
8
9
|
require("core-js/modules/es.array.includes.js");
|
|
9
10
|
require("core-js/modules/es.string.includes.js");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
11
|
+
var _buildQueryFields = _interopRequireDefault(require("./build-query-fields"));
|
|
12
|
+
var _getInheritedFilters = _interopRequireDefault(require("./get-inherited-filters"));
|
|
13
|
+
var _getQueryProps = _interopRequireDefault(require("./get-query-props"));
|
|
14
|
+
var _query = require("../application/query");
|
|
12
15
|
var filtersSetup = function filtersSetup(_ref) {
|
|
13
16
|
var entityFields = _ref.entityFields,
|
|
14
17
|
entityTypes = _ref.entityTypes,
|
|
@@ -20,13 +23,13 @@ var filtersSetup = function filtersSetup(_ref) {
|
|
|
20
23
|
isPreview = _ref.isPreview,
|
|
21
24
|
itemEntityUpdated = _ref.itemEntityUpdated,
|
|
22
25
|
isFull = _ref.isFull;
|
|
23
|
-
var fields = (0,
|
|
26
|
+
var fields = (0, _buildQueryFields["default"])(entityFields, entityTypes, isFull);
|
|
24
27
|
var action = (0, _query.getSearchPublishedContent)(fields);
|
|
25
|
-
var inheritedFilters = (0,
|
|
28
|
+
var inheritedFilters = (0, _getInheritedFilters["default"])(filterBy, filterByProperty);
|
|
26
29
|
var entitySameAsCurrentItemEntity = entities.includes(itemEntityUpdated);
|
|
27
30
|
var _filterEntitySchema$r = filterEntitySchema.relations,
|
|
28
31
|
filterEntityRelations = _filterEntitySchema$r === void 0 ? [] : _filterEntitySchema$r;
|
|
29
|
-
var queryProps = (0,
|
|
32
|
+
var queryProps = (0, _getQueryProps["default"])(inheritedFilters, currentSchema, filterEntitySchema);
|
|
30
33
|
var _ref2 = currentSchema || {},
|
|
31
34
|
_ref2$actions = _ref2.actions,
|
|
32
35
|
actions = _ref2$actions === void 0 ? {} : _ref2$actions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters-setup.js","names":["_buildQueryFields","_interopRequireDefault","require","_getInheritedFilters","_getQueryProps","_query","filtersSetup","_ref","entityFields","entityTypes","filterBy","filterByProperty","entities","currentSchema","filterEntitySchema","isPreview","itemEntityUpdated","isFull","fields","buildQueryFields","action","getSearchPublishedContent","inheritedFilters","getInheritedFilters","entitySameAsCurrentItemEntity","includes","_filterEntitySchema$r","relations","filterEntityRelations","queryProps","getQueryProps","_ref2","_ref2$actions","actions","getAction","get","getPublished","_default","exports"],"sources":["../../src/helpers/filters-setup.js"],"sourcesContent":["import buildQueryFields from './build-query-fields';\nimport getInheritedFilters from './get-inherited-filters';\nimport getQueryProps from './get-query-props';\nimport { getSearchPublishedContent } from '../application/query';\n\nconst filtersSetup = ({\n entityFields,\n entityTypes,\n filterBy,\n filterByProperty,\n entities,\n currentSchema,\n filterEntitySchema,\n isPreview,\n itemEntityUpdated,\n isFull\n}) => {\n const fields = buildQueryFields(entityFields, entityTypes, isFull);\n const action = getSearchPublishedContent(fields);\n const inheritedFilters = getInheritedFilters(filterBy, filterByProperty);\n\n const entitySameAsCurrentItemEntity = entities.includes(itemEntityUpdated);\n const { relations: filterEntityRelations = [] } = filterEntitySchema;\n const queryProps = getQueryProps(inheritedFilters, currentSchema, filterEntitySchema);\n const { actions = {} } = currentSchema || {};\n const getAction = isPreview ? actions.get : actions.getPublished;\n\n return {\n getAction,\n queryProps,\n inheritedFilters,\n currentSchema,\n filterEntitySchema,\n entitySameAsCurrentItemEntity,\n action,\n filterEntityRelations\n };\n};\n\nexport default filtersSetup;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAMI,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAWZ;EAAA,IAVJC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IACZC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IACXC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,gBAAgB,GAAAJ,IAAA,CAAhBI,gBAAgB;IAChBC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IACRC,aAAa,GAAAN,IAAA,CAAbM,aAAa;IACbC,kBAAkB,GAAAP,IAAA,CAAlBO,kBAAkB;IAClBC,SAAS,GAAAR,IAAA,CAATQ,SAAS;IACTC,iBAAiB,GAAAT,IAAA,CAAjBS,iBAAiB;IACjBC,MAAM,GAAAV,IAAA,CAANU,MAAM;EAEN,IAAMC,MAAM,GAAG,IAAAC,4BAAgB,EAACX,YAAY,EAAEC,WAAW,EAAEQ,MAAM,CAAC;EAClE,IAAMG,MAAM,GAAG,IAAAC,gCAAyB,EAACH,MAAM,CAAC;EAChD,IAAMI,gBAAgB,GAAG,IAAAC,+BAAmB,EAACb,QAAQ,EAAEC,gBAAgB,CAAC;EAExE,IAAMa,6BAA6B,GAAGZ,QAAQ,CAACa,QAAQ,CAACT,iBAAiB,CAAC;EAC1E,IAAAU,qBAAA,GAAkDZ,kBAAkB,CAA5Da,SAAS;IAAEC,qBAAqB,GAAAF,qBAAA,cAAG,EAAE,GAAAA,qBAAA;EAC7C,IAAMG,UAAU,GAAG,IAAAC,yBAAa,EAACR,gBAAgB,EAAET,aAAa,EAAEC,kBAAkB,CAAC;EACrF,IAAAiB,KAAA,GAAyBlB,aAAa,IAAI,CAAC,CAAC;IAAAmB,aAAA,GAAAD,KAAA,CAApCE,OAAO;IAAPA,OAAO,GAAAD,aAAA,cAAG,CAAC,CAAC,GAAAA,aAAA;EACpB,IAAME,SAAS,GAAGnB,SAAS,GAAGkB,OAAO,CAACE,GAAG,GAAGF,OAAO,CAACG,YAAY;EAEhE,OAAO;IACLF,SAAS,EAATA,SAAS;IACTL,UAAU,EAAVA,UAAU;IACVP,gBAAgB,EAAhBA,gBAAgB;IAChBT,aAAa,EAAbA,aAAa;IACbC,kBAAkB,EAAlBA,kBAAkB;IAClBU,6BAA6B,EAA7BA,6BAA6B;IAC7BJ,MAAM,EAANA,MAAM;IACNQ,qBAAqB,EAArBA;EACF,CAAC;AACH,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,cAEahC,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-updated-items-to-display.js","names":["getUpdatedItemsToDisplay","_ref","parentSchema","parentEntityData","_ref$itemsToDisplay","itemsToDisplay","_ref$inheritedFilters","inheritedFilters","idProp","find","filter","indexOf","properties","_idProp$split","split","_idProp$split2","_slicedToArray2","entityKey","queryValue","Object","keys","propKey","relation","entityIdentifier","parentValues","updatedItemsToDisplay","_toConsumableArray2","Array","isArray","forEach","value","push","displayItems","_default","exports"],"sources":["../../src/helpers/get-updated-items-to-display.js"],"sourcesContent":["const getUpdatedItemsToDisplay = ({\n parentSchema,\n parentEntityData,\n itemsToDisplay = [],\n inheritedFilters = []\n}) => {\n const idProp = inheritedFilters.find(filter => filter.indexOf('id/') === 0);\n\n if (!idProp || !parentSchema || !parentEntityData) return itemsToDisplay;\n const { properties } = parentSchema;\n const [, entityKey] = idProp.split('/');\n if (!properties || !entityKey) return itemsToDisplay;\n const queryValue = Object.keys(properties).find(\n propKey =>\n properties[propKey] &&\n properties[propKey].relation &&\n properties[propKey].relation.entityIdentifier === entityKey\n );\n const parentValues = parentEntityData[queryValue];\n if (!parentValues) return itemsToDisplay;\n const updatedItemsToDisplay = [...itemsToDisplay];\n if (Array.isArray(parentValues)) {\n parentValues.forEach(value => {\n updatedItemsToDisplay.push({ displayItems: [value] });\n });\n } else {\n updatedItemsToDisplay.push({ displayItems: [parentValues] });\n }\n return updatedItemsToDisplay;\n};\n\nexport default getUpdatedItemsToDisplay;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAC,IAAA,EAKxB;EAAA,IAJJC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IACZC,gBAAgB,GAAAF,IAAA,CAAhBE,gBAAgB;IAAAC,mBAAA,GAAAH,IAAA,CAChBI,cAAc;IAAdA,cAAc,GAAAD,mBAAA,cAAG,EAAE,GAAAA,mBAAA;IAAAE,qBAAA,GAAAL,IAAA,CACnBM,gBAAgB;IAAhBA,gBAAgB,GAAAD,qBAAA,cAAG,EAAE,GAAAA,qBAAA;EAErB,IAAME,MAAM,GAAGD,gBAAgB,CAACE,IAAI,CAAC,UAAAC,MAAM;IAAA,OAAIA,MAAM,CAACC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;EAAA,EAAC;EAE3E,IAAI,CAACH,MAAM,IAAI,CAACN,YAAY,IAAI,CAACC,gBAAgB,EAAE,OAAOE,cAAc;EACxE,IAAQO,UAAU,GAAKV,YAAY,CAA3BU,UAAU;EAClB,IAAAC,aAAA,GAAsBL,MAAM,CAACM,KAAK,CAAC,GAAG,CAAC;IAAAC,cAAA,OAAAC,eAAA,aAAAH,aAAA;IAA9BI,SAAS,GAAAF,cAAA;EAClB,IAAI,CAACH,UAAU,IAAI,CAACK,SAAS,EAAE,OAAOZ,cAAc;EACpD,IAAMa,UAAU,GAAGC,MAAM,CAACC,IAAI,CAACR,UAAU,CAAC,CAACH,IAAI,CAC7C,UAAAY,OAAO;IAAA,OACLT,UAAU,CAACS,OAAO,CAAC,IACnBT,UAAU,CAACS,OAAO,CAAC,CAACC,QAAQ,IAC5BV,UAAU,CAACS,OAAO,CAAC,CAACC,QAAQ,CAACC,gBAAgB,KAAKN,SAAS;EAAA,CAC/D,CAAC;EACD,IAAMO,YAAY,GAAGrB,gBAAgB,CAACe,UAAU,CAAC;EACjD,IAAI,CAACM,YAAY,EAAE,OAAOnB,cAAc;EACxC,IAAMoB,qBAAqB,OAAAC,mBAAA,aAAOrB,cAAc,CAAC;EACjD,IAAIsB,KAAK,CAACC,OAAO,CAACJ,YAAY,CAAC,EAAE;IAC/BA,YAAY,CAACK,OAAO,CAAC,UAAAC,KAAK,EAAI;MAC5BL,qBAAqB,CAACM,IAAI,CAAC;QAAEC,YAAY,EAAE,CAACF,KAAK;MAAE,CAAC,CAAC;IACvD,CAAC,CAAC;EACJ,CAAC,MAAM;IACLL,qBAAqB,CAACM,IAAI,CAAC;MAAEC,YAAY,EAAE,CAACR,YAAY;IAAE,CAAC,CAAC;EAC9D;EACA,OAAOC,qBAAqB;AAC9B,CAAC;AAAC,IAAAQ,QAAA,GAAAC,OAAA,cAEalC,wBAAwB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-updated-sort-properties.js","names":["getUpdatedSortProperties","sort","sortby","sortProperties","arguments","length","undefined","updatedSortProperties","_toConsumableArray2","unshift","propsToDisplay","sortbyFilters","map","_ref","filter","Boolean","flat","_default","exports"],"sources":["../../src/helpers/get-updated-sort-properties.js"],"sourcesContent":["const getUpdatedSortProperties = (sort, sortby, sortProperties = []) => {\n const updatedSortProperties = [...sortProperties];\n if (!updatedSortProperties.length && sort) {\n updatedSortProperties.unshift({ sort, propsToDisplay: sortby });\n }\n\n const sortbyFilters = updatedSortProperties\n .map(({ propsToDisplay }) => propsToDisplay)\n .filter(Boolean)\n .flat();\n return [updatedSortProperties, sortbyFilters];\n};\n\nexport default getUpdatedSortProperties;\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAIC,IAAI,EAAEC,MAAM,EAA0B;EAAA,IAAxBC,cAAc,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EACjE,IAAMG,qBAAqB,OAAAC,mBAAA,aAAOL,cAAc,CAAC;EACjD,IAAI,CAACI,qBAAqB,CAACF,MAAM,IAAIJ,IAAI,EAAE;IACzCM,qBAAqB,CAACE,OAAO,CAAC;MAAER,IAAI,EAAJA,IAAI;MAAES,cAAc,EAAER;IAAO,CAAC,CAAC;EACjE;EAEA,IAAMS,aAAa,GAAGJ,qBAAqB,CACxCK,GAAG,CAAC,UAAAC,IAAA;IAAA,IAAGH,cAAc,GAAAG,IAAA,CAAdH,cAAc;IAAA,OAAOA,cAAc;EAAA,EAAC,CAC3CI,MAAM,CAACC,OAAO,CAAC,CACfC,IAAI,CAAC,CAAC;EACT,OAAO,CAACT,qBAAqB,EAAEI,aAAa,CAAC;AAC/C,CAAC;AAAC,IAAAM,QAAA,GAAAC,OAAA,cAEalB,wBAAwB","ignoreList":[]}
|
package/lib/helpers/index.js
CHANGED
|
@@ -101,6 +101,18 @@ Object.defineProperty(exports, "checkPropsToUse", {
|
|
|
101
101
|
return _checkPropsToUse["default"];
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
|
+
Object.defineProperty(exports, "filterQuerySetup", {
|
|
105
|
+
enumerable: true,
|
|
106
|
+
get: function get() {
|
|
107
|
+
return _filterQuerySetup["default"];
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
Object.defineProperty(exports, "filtersSetup", {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
get: function get() {
|
|
113
|
+
return _filtersSetup["default"];
|
|
114
|
+
}
|
|
115
|
+
});
|
|
104
116
|
Object.defineProperty(exports, "getClickWrapperOptions", {
|
|
105
117
|
enumerable: true,
|
|
106
118
|
get: function get() {
|
|
@@ -245,6 +257,18 @@ Object.defineProperty(exports, "getUpdatedFilterBy", {
|
|
|
245
257
|
return _getUpdatedFilterBy["default"];
|
|
246
258
|
}
|
|
247
259
|
});
|
|
260
|
+
Object.defineProperty(exports, "getUpdatedItemsToDisplay", {
|
|
261
|
+
enumerable: true,
|
|
262
|
+
get: function get() {
|
|
263
|
+
return _getUpdatedItemsToDisplay["default"];
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
Object.defineProperty(exports, "getUpdatedSortProperties", {
|
|
267
|
+
enumerable: true,
|
|
268
|
+
get: function get() {
|
|
269
|
+
return _getUpdatedSortProperties["default"];
|
|
270
|
+
}
|
|
271
|
+
});
|
|
248
272
|
Object.defineProperty(exports, "getWrappedValueWithLink", {
|
|
249
273
|
enumerable: true,
|
|
250
274
|
get: function get() {
|
|
@@ -323,12 +347,24 @@ Object.defineProperty(exports, "shouldRenderWaypoint", {
|
|
|
323
347
|
return _shouldRenderWaypoint["default"];
|
|
324
348
|
}
|
|
325
349
|
});
|
|
350
|
+
Object.defineProperty(exports, "shouldReturn", {
|
|
351
|
+
enumerable: true,
|
|
352
|
+
get: function get() {
|
|
353
|
+
return _shouldReturn["default"];
|
|
354
|
+
}
|
|
355
|
+
});
|
|
326
356
|
Object.defineProperty(exports, "shouldShowProperty", {
|
|
327
357
|
enumerable: true,
|
|
328
358
|
get: function get() {
|
|
329
359
|
return _shouldShowProperty["default"];
|
|
330
360
|
}
|
|
331
361
|
});
|
|
362
|
+
Object.defineProperty(exports, "shouldSkipSingleQuery", {
|
|
363
|
+
enumerable: true,
|
|
364
|
+
get: function get() {
|
|
365
|
+
return _shouldSkipSingleQuery["default"];
|
|
366
|
+
}
|
|
367
|
+
});
|
|
332
368
|
Object.defineProperty(exports, "sortResponseData", {
|
|
333
369
|
enumerable: true,
|
|
334
370
|
get: function get() {
|
|
@@ -402,6 +438,12 @@ var _appendImages = _interopRequireDefault(require("./append-images"));
|
|
|
402
438
|
var _parseTextBlock = _interopRequireDefault(require("./parse-TextBlock"));
|
|
403
439
|
var _processDataSummaryValue = _interopRequireDefault(require("./process-data-summary-value"));
|
|
404
440
|
var _buildQueryKey = _interopRequireDefault(require("./build-query-key"));
|
|
441
|
+
var _filterQuerySetup = _interopRequireDefault(require("./filter-query-setup"));
|
|
442
|
+
var _filtersSetup = _interopRequireDefault(require("./filters-setup"));
|
|
443
|
+
var _getUpdatedItemsToDisplay = _interopRequireDefault(require("./get-updated-items-to-display"));
|
|
444
|
+
var _getUpdatedSortProperties = _interopRequireDefault(require("./get-updated-sort-properties"));
|
|
445
|
+
var _shouldReturn = _interopRequireDefault(require("./should-return"));
|
|
446
|
+
var _shouldSkipSingleQuery = _interopRequireDefault(require("./should-skip-single-query"));
|
|
405
447
|
var _buildRawQueryStringified = _interopRequireDefault(require("./build-raw-query-stringified"));
|
|
406
448
|
var _buildFiltersQuery = _interopRequireDefault(require("./build-filters-query"));
|
|
407
449
|
//# 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","_buildRawQueryStringified","_buildFiltersQuery"],"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 buildRawQueryStringified } from './build-raw-query-stringified';\nexport { default as buildFiltersQuery } from './build-filters-query';\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"],"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';\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,O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AA,CAAAC,OAAA;AACA,IAAA4D,sBAAA,GAAA7D,sBAAA,CAAAC,OAAA;AACA,IAAA6D,yBAAA,GAAA9D,sBAAA,CAAAC,OAAA;AACA,IAAA8D,kBAAA,GAAA/D,sBAAA,CAAAC,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"should-return.js","names":["shouldReturn","_len","arguments","length","args","Array","_key","filter","Boolean","_default","exports"],"sources":["../../src/helpers/should-return.js"],"sourcesContent":["const shouldReturn = (...args) => !!args.filter(Boolean).length;\n\nexport default shouldReturn;\n"],"mappings":";;;;;;;;;AAAA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAA;EAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAOC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;IAAJF,IAAI,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;EAAA;EAAA,OAAK,CAAC,CAACF,IAAI,CAACG,MAAM,CAACC,OAAO,CAAC,CAACL,MAAM;AAAA;AAAC,IAAAM,QAAA,GAAAC,OAAA,cAEjDV,YAAY","ignoreList":[]}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = void 0;
|
|
8
|
-
var _constants = require("
|
|
8
|
+
var _constants = require("../constants");
|
|
9
9
|
var shouldSkipSingleQuery = function shouldSkipSingleQuery(loading, getAction, queryProps) {
|
|
10
10
|
return loading || !getAction || queryProps === _constants.ID;
|
|
11
11
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"should-skip-single-query.js","names":["_constants","require","shouldSkipSingleQuery","loading","getAction","queryProps","ID","_default","exports"],"sources":["../../src/helpers/should-skip-single-query.js"],"sourcesContent":["import { ID } from '../constants';\n\nconst shouldSkipSingleQuery = (loading, getAction, queryProps) =>\n loading || !getAction || queryProps === ID;\n\nexport default shouldSkipSingleQuery;\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,OAAO,EAAEC,SAAS,EAAEC,UAAU;EAAA,OAC3DF,OAAO,IAAI,CAACC,SAAS,IAAIC,UAAU,KAAKC,aAAE;AAAA;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAE9BN,qBAAqB","ignoreList":[]}
|