@quintype/components 3.8.8-only-react-v19.1 → 3.8.8

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.
Files changed (61) hide show
  1. package/dist/cjs/index.js +2041 -1091
  2. package/dist/es/components/access-type.js +822 -574
  3. package/dist/es/components/adbutler-ad.js +14 -10
  4. package/dist/es/components/api-client.js +6 -4
  5. package/dist/es/components/breaking-news-item.js +3 -2
  6. package/dist/es/components/breaking-news.js +23 -7
  7. package/dist/es/components/client-side-only.js +19 -6
  8. package/dist/es/components/collection.js +5 -5
  9. package/dist/es/components/dfp-ad.js +30 -23
  10. package/dist/es/components/eager-load-images.js +17 -7
  11. package/dist/es/components/hamburger-button.js +5 -2
  12. package/dist/es/components/image-gallery.js +13 -10
  13. package/dist/es/components/impl/collection-impl.js +10 -3
  14. package/dist/es/components/impl/gumlet-image.js +19 -10
  15. package/dist/es/components/impl/image-utils.js +4 -3
  16. package/dist/es/components/impl/load-more-stories-manager.js +19 -6
  17. package/dist/es/components/impl/thumbor-image.js +32 -10
  18. package/dist/es/components/infinite-scroll.js +85 -29
  19. package/dist/es/components/infinite-story-base.js +24 -7
  20. package/dist/es/components/lazy-collection.js +8 -8
  21. package/dist/es/components/lazy-load-images.js +43 -10
  22. package/dist/es/components/link-base.js +19 -11
  23. package/dist/es/components/link.js +4 -1
  24. package/dist/es/components/load-more-collection-stories.js +18 -7
  25. package/dist/es/components/load-more-stories-base.js +20 -6
  26. package/dist/es/components/loading-indicator.js +5 -1
  27. package/dist/es/components/menu-item.js +10 -6
  28. package/dist/es/components/menu.js +9 -6
  29. package/dist/es/components/responsive-hero-image.js +3 -1
  30. package/dist/es/components/responsive-image.js +5 -0
  31. package/dist/es/components/responsive-source.js +1 -1
  32. package/dist/es/components/review-rating/review-rating.js +27 -21
  33. package/dist/es/components/review-rating/star-icon.js +5 -3
  34. package/dist/es/components/search-box.js +23 -7
  35. package/dist/es/components/search-page-base.js +18 -7
  36. package/dist/es/components/social-logins/with-facebook-login.js +20 -10
  37. package/dist/es/components/social-logins/with-google-login.js +18 -8
  38. package/dist/es/components/social-logins/with-linkedin-login.js +12 -7
  39. package/dist/es/components/social-logins/with-social-login.js +21 -7
  40. package/dist/es/components/social-logins/with-twitter-login.js +7 -7
  41. package/dist/es/components/social-share.js +24 -8
  42. package/dist/es/components/story-element.js +88 -43
  43. package/dist/es/components/story-elements/brightcove.js +94 -54
  44. package/dist/es/components/story-elements/dailymotion-embed-script.js +39 -13
  45. package/dist/es/components/story-elements/dailymotion.js +61 -19
  46. package/dist/es/components/story-elements/jsembed.js +30 -10
  47. package/dist/es/components/story-elements/jwPlayer.js +24 -9
  48. package/dist/es/components/story-elements/polltype.js +20 -6
  49. package/dist/es/components/story-elements/table.js +34 -16
  50. package/dist/es/components/story-elements/youtube.js +73 -24
  51. package/dist/es/components/update-on-interval.js +52 -31
  52. package/dist/es/components/with-client-side-only.js +4 -3
  53. package/dist/es/components/with-error.js +20 -7
  54. package/dist/es/components/with-host-url.js +9 -4
  55. package/dist/es/components/with-lazy.js +21 -7
  56. package/dist/es/components/with-member.js +33 -14
  57. package/dist/es/components/with-preview.js +20 -7
  58. package/dist/es/components/wrap-collection-layout.js +16 -4
  59. package/dist/es/store/reducers.js +45 -1
  60. package/dist/es/utils.js +12 -7
  61. package/package.json +6 -9
@@ -1,29 +1,41 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
+ import _inherits from "@babel/runtime/helpers/inherits";
3
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
7
+
8
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
+
10
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
11
+
8
12
  import { bool, func } from "prop-types";
9
13
  import React from "react";
10
14
  import { connect } from "react-redux";
11
15
  import { MEMBER_BEING_LOADED, MEMBER_UPDATED } from '../store/actions';
12
16
  import { getRequest } from './api-client';
13
17
  var loadedMember = false;
18
+
14
19
  var WithMemberBase = /*#__PURE__*/function (_React$Component) {
20
+ _inherits(WithMemberBase, _React$Component);
21
+
22
+ var _super = /*#__PURE__*/_createSuper(WithMemberBase);
23
+
15
24
  function WithMemberBase(props) {
16
25
  var _this;
26
+
17
27
  _classCallCheck(this, WithMemberBase);
18
- _this = _callSuper(this, WithMemberBase, [props]);
19
- _this.checkForMemberUpdated = _this.checkForMemberUpdated.bind(_this);
28
+
29
+ _this = _super.call(this, props);
30
+ _this.checkForMemberUpdated = _this.checkForMemberUpdated.bind(_assertThisInitialized(_this));
20
31
  return _this;
21
32
  }
22
- _inherits(WithMemberBase, _React$Component);
23
- return _createClass(WithMemberBase, [{
33
+
34
+ _createClass(WithMemberBase, [{
24
35
  key: "checkForMemberUpdated",
25
36
  value: function checkForMemberUpdated() {
26
37
  var _this2 = this;
38
+
27
39
  this.props.memberBeingLoaded();
28
40
  var requestUrl = this.props.isBridgekeeperEnabled ? "/api/auth/v1/users/me" : "/api/v1/members/me";
29
41
  return getRequest(requestUrl).forbidden(function () {
@@ -32,8 +44,9 @@ var WithMemberBase = /*#__PURE__*/function (_React$Component) {
32
44
  return _this2.props.memberUpdated(null);
33
45
  }).json(function (_ref) {
34
46
  var member = _ref.member,
35
- user = _ref.user;
47
+ user = _ref.user;
36
48
  var memberObj = _this2.props.isBridgekeeperEnabled ? user : member;
49
+
37
50
  _this2.props.memberUpdated(memberObj);
38
51
  });
39
52
  }
@@ -49,10 +62,10 @@ var WithMemberBase = /*#__PURE__*/function (_React$Component) {
49
62
  key: "render",
50
63
  value: function render() {
51
64
  var _this$props = this.props,
52
- member = _this$props.member,
53
- logout = _this$props.logout,
54
- children = _this$props.children,
55
- isLoading = _this$props.isLoading;
65
+ member = _this$props.member,
66
+ logout = _this$props.logout,
67
+ children = _this$props.children,
68
+ isLoading = _this$props.isLoading;
56
69
  return children({
57
70
  member: member,
58
71
  logout: logout,
@@ -61,19 +74,24 @@ var WithMemberBase = /*#__PURE__*/function (_React$Component) {
61
74
  });
62
75
  }
63
76
  }]);
77
+
78
+ return WithMemberBase;
64
79
  }(React.Component);
80
+
65
81
  WithMemberBase.defaultProps = {
66
82
  isBridgekeeperEnabled: false
67
83
  };
84
+
68
85
  function mapStateToProps(_ref2) {
69
86
  var member = _ref2.member,
70
- memberLoading = _ref2.memberLoading;
87
+ memberLoading = _ref2.memberLoading;
71
88
  return {
72
89
  member: member || null,
73
90
  // undefined on server side
74
91
  isLoading: memberLoading === true || memberLoading === undefined
75
92
  };
76
93
  }
94
+
77
95
  function mapDispatchToProps(dispatch, ownProps) {
78
96
  var logoutRequestUrl = ownProps.isBridgekeeperEnabled ? "/api/auth/v1/logout" : "/api/logout";
79
97
  return {
@@ -98,7 +116,6 @@ function mapDispatchToProps(dispatch, ownProps) {
98
116
  }
99
117
  };
100
118
  }
101
-
102
119
  /**
103
120
  * This is a render props component which will call your callback with the current logged in member. It will automatically call `/api/v1/members/me` to figure out if you are logged in, and replace the contents in the store and callback. In future, this may use LocalStorage to cache the member for some time.
104
121
  *
@@ -127,4 +144,6 @@ function mapDispatchToProps(dispatch, ownProps) {
127
144
  * @component
128
145
  * @category Login
129
146
  */
147
+
148
+
130
149
  export var WithMember = /*#__PURE__*/connect(mapStateToProps, mapDispatchToProps)(WithMemberBase);
@@ -1,12 +1,14 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _inherits from "@babel/runtime/helpers/inherits";
3
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
8
- import React from "react";
9
6
 
7
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
+
9
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
+
11
+ import React from "react";
10
12
  /**
11
13
  * This higher order function can be used for the home or story page preview. It takes a component, and a function to map the story into props suitable for the component
12
14
  *
@@ -35,22 +37,30 @@ import React from "react";
35
37
  * @category Other
36
38
  * @returns {Component} Component which can be used for preview
37
39
  */
40
+
38
41
  export function WithPreview(klazz, updateData) {
39
42
  return /*#__PURE__*/function (_React$Component) {
43
+ _inherits(WithPreviewWrapper, _React$Component);
44
+
45
+ var _super = _createSuper(WithPreviewWrapper);
46
+
40
47
  function WithPreviewWrapper(props) {
41
48
  var _this;
49
+
42
50
  _classCallCheck(this, WithPreviewWrapper);
43
- _this = _callSuper(this, WithPreviewWrapper, [props]);
51
+
52
+ _this = _super.call(this, props);
44
53
  _this.state = {
45
54
  story: null
46
55
  };
47
56
  return _this;
48
57
  }
49
- _inherits(WithPreviewWrapper, _React$Component);
50
- return _createClass(WithPreviewWrapper, [{
58
+
59
+ _createClass(WithPreviewWrapper, [{
51
60
  key: "componentDidMount",
52
61
  value: function componentDidMount() {
53
62
  var _this2 = this;
63
+
54
64
  global.addEventListener("message", function (event) {
55
65
  if (event.data && event.data.action == 'reloadStory' && event.data.story) {
56
66
  _this2.setState({
@@ -69,10 +79,13 @@ export function WithPreview(klazz, updateData) {
69
79
  }
70
80
  });
71
81
  }
82
+
72
83
  return /*#__PURE__*/React.createElement(klazz, Object.assign({}, this.props, {
73
84
  data: updateData(this.props.data, this.state.story)
74
85
  }));
75
86
  }
76
87
  }]);
88
+
89
+ return WithPreviewWrapper;
77
90
  }(React.Component);
78
91
  }
@@ -4,6 +4,7 @@ import get from "lodash/get";
4
4
  import { LoadMoreCollectionStories } from "./load-more-collection-stories";
5
5
  import { LazyLoadImages } from "./lazy-load-images";
6
6
  import { ClientSideOnly } from "./client-side-only";
7
+
7
8
  function loadMoreWrapper(Component, data, enableLoadMoreButton, slug, numStoriesToLoad) {
8
9
  return !enableLoadMoreButton ? /*#__PURE__*/React.createElement(Component, data) : /*#__PURE__*/React.createElement(LoadMoreCollectionStories, {
9
10
  template: Component,
@@ -15,26 +16,32 @@ function loadMoreWrapper(Component, data, enableLoadMoreButton, slug, numStories
15
16
  numStoriesToLoad: numStoriesToLoad
16
17
  });
17
18
  }
19
+
18
20
  function lazyLoadWrapper(component, _ref) {
19
21
  var _ref$lazy_load_images = _ref.lazy_load_images,
20
- lazyLoadImages = _ref$lazy_load_images === void 0 ? false : _ref$lazy_load_images;
22
+ lazyLoadImages = _ref$lazy_load_images === void 0 ? false : _ref$lazy_load_images;
21
23
  return !lazyLoadImages ? component : /*#__PURE__*/React.createElement(LazyLoadImages, {}, component);
22
24
  }
25
+
23
26
  function clientSideLoadWrapper(component, _ref2) {
24
27
  var _ref2$client_side_onl = _ref2.client_side_only,
25
- clientSideOnly = _ref2$client_side_onl === void 0 ? false : _ref2$client_side_onl;
28
+ clientSideOnly = _ref2$client_side_onl === void 0 ? false : _ref2$client_side_onl;
26
29
  return !clientSideOnly ? component : /*#__PURE__*/React.createElement(ClientSideOnly, {}, component);
27
30
  }
31
+
28
32
  function WrapCollectionComponent(Component) {
29
33
  return function (props) {
30
34
  if (!props.collection) {
31
35
  return /*#__PURE__*/React.createElement("div", null);
32
36
  }
37
+
33
38
  var associatedMetadata = props.collection["associated-metadata"] || {};
34
39
  var stories = collectionToStories(props.collection);
40
+
35
41
  if (associatedMetadata.initial_stories_load_count) {
36
42
  stories = stories.slice(0, associatedMetadata.initial_stories_load_count);
37
43
  }
44
+
38
45
  var data = Object.assign({}, props, {
39
46
  stories: stories,
40
47
  associatedMetadata: associatedMetadata
@@ -45,7 +52,6 @@ function WrapCollectionComponent(Component) {
45
52
  }, component);
46
53
  };
47
54
  }
48
-
49
55
  /**
50
56
  * Use this function to wrap a UI for collections, which returns a component handling common behavior, such as only rendering client side, or lazy loading images.
51
57
  * This component adds two props: `stories` and `associatedMetadata`
@@ -63,21 +69,25 @@ function WrapCollectionComponent(Component) {
63
69
  * @category Collection Page
64
70
  * @returns {Component} A component which can be passed collection
65
71
  */
72
+
73
+
66
74
  export function wrapCollectionLayout(component) {
67
75
  var wrappedComponent = connect(function (state) {
68
76
  return {
69
77
  config: state.qt.config
70
78
  };
71
79
  })(WrapCollectionComponent(component));
80
+
72
81
  if (component.storyLimit) {
73
82
  wrappedComponent.storyLimit = component.storyLimit;
74
83
  }
84
+
75
85
  if (component.nestedCollectionLimit) {
76
86
  wrappedComponent.nestedCollectionLimit = component.nestedCollectionLimit;
77
87
  }
88
+
78
89
  return wrappedComponent;
79
90
  }
80
-
81
91
  /**
82
92
  * Use this function to get the stories from a collection object
83
93
  * returns [] if collection doesn't have items key
@@ -86,6 +96,7 @@ export function wrapCollectionLayout(component) {
86
96
  * @category Collection Page
87
97
  * @returns {Array} An array of stories
88
98
  */
99
+
89
100
  export function collectionToStories(collection) {
90
101
  if (!collection.items) return [];
91
102
  return collection.items.filter(function (item) {
@@ -94,6 +105,7 @@ export function collectionToStories(collection) {
94
105
  return replaceWithAlternates(item.story);
95
106
  });
96
107
  }
108
+
97
109
  function replaceWithAlternates(story) {
98
110
  var alternates = get(story, ["alternative", "home", "default"]);
99
111
  if (!alternates) return story;
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import { BREAKING_NEWS_UPDATED, CLIENT_SIDE_RENDERED, PAGE_LOADING, NAVIGATE_TO_PAGE, PAGE_FINISHED_LOADING, HAMBURGER_CLICKED, HAMBURGER_CLOSED, MEMBER_UPDATED, MEMBER_BEING_LOADED, SUBSCRIPTION_GROUP_UPDATED, PAYMENT_OPTIONS_UPDATED, ACCESS_BEING_LOADED, ACCESS_UPDATED, METER_UPDATED, ASSET_PLANS, CAMPAIGN_SUBSCRIPTION_GROUP_UPDATED } from "./actions";
5
5
  import { computeAccess } from "../utils";
6
+
6
7
  function setToTrueOnEvent() {
7
8
  var events = Array.from(arguments);
8
9
  return function () {
@@ -11,142 +12,185 @@ function setToTrueOnEvent() {
11
12
  return state || events.includes(action.type);
12
13
  };
13
14
  }
15
+
14
16
  function breakingNewsReducer() {
15
17
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
16
18
  var action = arguments.length > 1 ? arguments[1] : undefined;
19
+
17
20
  switch (action.type) {
18
21
  case BREAKING_NEWS_UPDATED:
19
22
  return action.stories;
23
+
20
24
  default:
21
25
  return state;
22
26
  }
23
27
  }
28
+
24
29
  var breakingNewsLoadedReducer = /*#__PURE__*/setToTrueOnEvent(BREAKING_NEWS_UPDATED);
25
30
  var clientSideRenderedReducer = /*#__PURE__*/setToTrueOnEvent(CLIENT_SIDE_RENDERED);
31
+
26
32
  function pageLoadingReducer() {
27
33
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
28
34
  var action = arguments.length > 1 ? arguments[1] : undefined;
35
+
29
36
  switch (action.type) {
30
37
  case PAGE_LOADING:
31
38
  return true;
39
+
32
40
  case NAVIGATE_TO_PAGE:
33
41
  return false;
42
+
34
43
  case PAGE_FINISHED_LOADING:
35
44
  return false;
45
+
36
46
  default:
37
47
  return state;
38
48
  }
39
49
  }
50
+
40
51
  function hamburgerOpenedReducer() {
41
52
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
42
53
  var action = arguments.length > 1 ? arguments[1] : undefined;
54
+
43
55
  switch (action.type) {
44
56
  case HAMBURGER_CLICKED:
45
57
  return true;
58
+
46
59
  case HAMBURGER_CLOSED:
47
60
  return false;
61
+
48
62
  case NAVIGATE_TO_PAGE:
49
63
  return false;
64
+
50
65
  default:
51
66
  return state;
52
67
  }
53
68
  }
69
+
54
70
  function memberReducer() {
55
71
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
56
72
  var action = arguments.length > 1 ? arguments[1] : undefined;
73
+
57
74
  switch (action.type) {
58
75
  case MEMBER_UPDATED:
59
76
  return action.member;
77
+
60
78
  default:
61
79
  return state;
62
80
  }
63
81
  }
82
+
64
83
  function memberLoadingReducer() {
65
84
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
66
85
  var action = arguments.length > 1 ? arguments[1] : undefined;
86
+
67
87
  switch (action.type) {
68
88
  case MEMBER_BEING_LOADED:
69
89
  return true;
90
+
70
91
  case MEMBER_UPDATED:
71
92
  return false;
93
+
72
94
  default:
73
95
  return state;
74
96
  }
75
97
  }
98
+
76
99
  function subscriptionReducer() {
77
100
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
78
101
  var action = arguments.length > 1 ? arguments[1] : undefined;
102
+
79
103
  switch (action.type) {
80
104
  case SUBSCRIPTION_GROUP_UPDATED:
81
105
  return action.subscriptions;
106
+
82
107
  default:
83
108
  return state;
84
109
  }
85
110
  }
111
+
86
112
  function paymentOptionsReducer() {
87
113
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
88
114
  var action = arguments.length > 1 ? arguments[1] : undefined;
115
+
89
116
  switch (action.type) {
90
117
  case PAYMENT_OPTIONS_UPDATED:
91
118
  return action.paymentOptions;
119
+
92
120
  default:
93
121
  return state;
94
122
  }
95
123
  }
124
+
96
125
  function accessLoadingReducer() {
97
126
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
98
127
  var action = arguments.length > 1 ? arguments[1] : undefined;
128
+
99
129
  switch (action.type) {
100
130
  case ACCESS_BEING_LOADED:
101
131
  return action.loading;
132
+
102
133
  default:
103
134
  return state;
104
135
  }
105
136
  }
137
+
106
138
  function accessReducer() {
107
139
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
108
140
  var action = arguments.length > 1 ? arguments[1] : undefined;
141
+
109
142
  switch (action.type) {
110
143
  case ACCESS_UPDATED:
111
144
  return computeAccess(state, action);
145
+
112
146
  default:
113
147
  return state;
114
148
  }
115
149
  }
150
+
116
151
  function meteringReducer() {
117
152
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
118
153
  var action = arguments.length > 1 ? arguments[1] : undefined;
154
+
119
155
  switch (action.type) {
120
156
  case METER_UPDATED:
121
157
  return action.meterCount;
158
+
122
159
  default:
123
160
  return state;
124
161
  }
125
162
  }
163
+
126
164
  function assetPlansReducer() {
127
165
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
128
166
  var action = arguments.length > 1 ? arguments[1] : undefined;
167
+
129
168
  switch (action.type) {
130
169
  case ASSET_PLANS:
131
170
  return action.assetPlans;
171
+
132
172
  default:
133
173
  return state;
134
174
  }
135
175
  }
176
+
136
177
  function campaignSubscriptionReducer() {
137
178
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
138
179
  var action = arguments.length > 1 ? arguments[1] : undefined;
180
+
139
181
  switch (action.type) {
140
182
  case CAMPAIGN_SUBSCRIPTION_GROUP_UPDATED:
141
183
  return action.campaignSubscriptions;
184
+
142
185
  default:
143
186
  return state;
144
187
  }
145
188
  }
146
-
147
189
  /**
148
190
  * ComponentReducers is a list of reducers that are needed by the various components included
149
191
  */
192
+
193
+
150
194
  export var ComponentReducers = {
151
195
  breakingNews: breakingNewsReducer,
152
196
  breakingNewsLoaded: breakingNewsLoadedReducer,
package/dist/es/utils.js CHANGED
@@ -1,6 +1,9 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2
+
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
4
+
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6
+
4
7
  // FIXME: TEST THIS
5
8
  import get from "lodash/get";
6
9
  export function removeDuplicateStories(existingStories, newStories) {
@@ -15,9 +18,8 @@ export function removeDuplicateStories(existingStories, newStories) {
15
18
  export function getAssociatedTemplate(_ref) {
16
19
  var associatedMetadata = _ref["associated-metadata"];
17
20
  return associatedMetadata ? associatedMetadata.layout : "default";
18
- }
21
+ } // FIXME: TEST THIS
19
22
 
20
- // FIXME: TEST THIS
21
23
  export function replaceAllStoriesInCollection(collection, story) {
22
24
  var items = (collection.items || []).map(function (item) {
23
25
  if (item.type === "story") {
@@ -29,14 +31,13 @@ export function replaceAllStoriesInCollection(collection, story) {
29
31
  } else if (item.type === "collection") {
30
32
  return replaceAllStoriesInCollection(item, story);
31
33
  }
34
+
32
35
  return item;
33
36
  });
34
37
  return Object.assign({}, collection, {
35
38
  items: items
36
39
  });
37
- }
38
-
39
- //Helps handle errors with async await pattern
40
+ } //Helps handle errors with async await pattern
40
41
 
41
42
  export var awaitHelper = function awaitHelper(promise) {
42
43
  return promise.then(function (data) {
@@ -71,13 +72,17 @@ export var getQliticsSchema = function getQliticsSchema() {
71
72
  export var computeAccess = function computeAccess(previousState, currentState) {
72
73
  var currentAccess = get(currentState, ["access"], {});
73
74
  var currentStoryId = get(Object.keys(currentAccess), [0], "");
75
+
74
76
  if (currentStoryId in previousState) {
75
77
  var storyAccess = previousState[currentStoryId];
78
+
76
79
  if (storyAccess.granted !== currentAccess[currentStoryId].granted || storyAccess.grantReason !== currentAccess[currentStoryId].grantReason) {
77
80
  return _objectSpread(_objectSpread({}, previousState), currentAccess);
78
81
  }
82
+
79
83
  return previousState;
80
84
  }
85
+
81
86
  return _objectSpread(_objectSpread({}, previousState), currentAccess);
82
87
  };
83
88
  export function initiateNewObserver(targetElement, intersectionCallBack) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/components",
3
- "version": "3.8.8-only-react-v19.1",
3
+ "version": "3.8.8",
4
4
  "description": "Components to help build Quintype Node.js apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",
@@ -31,11 +31,11 @@
31
31
  "papaparse": "^5.3.1",
32
32
  "prop-types": "^15.7.2",
33
33
  "quintype-js": "^1.2.1",
34
- "react": "^19.1.0",
34
+ "react": "^16.14.0",
35
35
  "react-dailymotion": "^0.4.1",
36
36
  "react-dfp": "quintype/react-dfp",
37
37
  "react-helmet": "^6.1.0",
38
- "react-redux": "^9.1.2",
38
+ "react-redux": "^7.2.6",
39
39
  "react-youtube": "^7.13.1",
40
40
  "redux": "^4.1.2",
41
41
  "wretch": "^1.7.6"
@@ -50,15 +50,12 @@
50
50
  "@babel/plugin-transform-runtime": "^7.16.0",
51
51
  "@babel/preset-env": "^7.16.0",
52
52
  "@babel/preset-react": "^7.16.0",
53
- "@testing-library/dom": "^10.4.1",
54
- "@testing-library/jest-dom": "^6.8.0",
55
- "@testing-library/react": "^16.3.0",
56
53
  "babel-eslint": "^10.0.3",
57
54
  "babel-jest": "^27.3.1",
58
55
  "babel-plugin-annotate-pure-calls": "^0.4.0",
59
56
  "babel-plugin-quintype-assets": "^1.1.1",
60
57
  "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
61
- "better-docs": "^2.7.3",
58
+ "better-docs": "^2.3.2",
62
59
  "eslint": "^8.2.0",
63
60
  "eslint-config-prettier": "^8.3.0",
64
61
  "eslint-config-standard": "^16.0.3",
@@ -73,12 +70,12 @@
73
70
  "husky": "^7.0.4",
74
71
  "jest": "^27.3.1",
75
72
  "jest-dom": "^3.2.2",
76
- "jsdoc": "^4.0.4",
73
+ "jsdoc": "^3.6.7",
77
74
  "lint-staged": "^11.2.6",
78
75
  "onchange": "^7.1.0",
79
76
  "parcel-bundler": "^1.12.4",
80
77
  "prettier": "2.4.1",
81
- "react-dom": "^19.1.0",
78
+ "react-dom": "^16.14.0",
82
79
  "react-testing-library": "^7.0.0",
83
80
  "rimraf": "^3.0.2",
84
81
  "rollup": "^2.59.0",