@mjhls/mjh-framework 1.0.115 → 1.0.117

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.115
2
+ # mjh-framework v. 1.0.117
3
3
 
4
4
 
5
5
  > Foundation Framework
package/dist/index.es.js CHANGED
@@ -20,6 +20,7 @@ import Button from 'react-bootstrap/Button';
20
20
  import Nav from 'react-bootstrap/Nav';
21
21
  import Navbar from 'react-bootstrap/Navbar';
22
22
  import NavDropdown from 'react-bootstrap/NavDropdown';
23
+ import Pagination from 'react-bootstrap/Pagination';
23
24
  import Carousel$1 from 'react-bootstrap/Carousel';
24
25
  import Breadcrumb from 'react-bootstrap/Breadcrumb';
25
26
 
@@ -11204,13 +11205,13 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
11204
11205
  React__default.createElement(
11205
11206
  Media$1,
11206
11207
  { key: article._id ? article._id : index$$1, style: { marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
11207
- React__default.createElement(
11208
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
11208
11209
  Link,
11209
11210
  { href: mapping[contentCategoryName] + '/[url]', as: mapping[contentCategoryName] + '/' + article.url.current },
11210
11211
  React__default.createElement(
11211
11212
  'a',
11212
- null,
11213
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3', src: renderCardImage(article, builder, imageHeight, imageWidth), alt: article.title }) : React__default.createElement('img', { src: defaultImage, className: 'mr-3', width: '240', height: '135' })
11213
+ { className: 'img-wrapper' },
11214
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, builder, imageHeight, imageWidth), alt: article.title }) : React__default.createElement('img', { src: defaultImage, className: 'mr-3', width: '240', height: '135' })
11214
11215
  )
11215
11216
  ),
11216
11217
  React__default.createElement(
@@ -11259,7 +11260,12 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
11259
11260
  )
11260
11261
  )
11261
11262
  );
11262
- })
11263
+ }),
11264
+ React__default.createElement(
11265
+ 'style',
11266
+ { jsx: true },
11267
+ '\n .img-wrapper img {\n max-height: 200px;\n width: 100%;\n object-fit: cover;\n }\n @media only screen and (min-width: 768px) {\n .img-wrapper {\n max-width: 44%;\n }\n .img-wrapper > img {\n padding-right: 1em;\n }\n }\n @media only screen and (max-width: 767px) {\n .img-wrapper {\n max-width: 100%;\n }\n .img-wrapper img {\n padding-bottom: 1em;\n }\n .media {\n flex-direction: column;\n }\n }\n '
11268
+ )
11263
11269
  );
11264
11270
  };
11265
11271
 
@@ -12366,7 +12372,7 @@ var NavMagazine = function NavMagazine(props) {
12366
12372
  React__default.createElement(
12367
12373
  'a',
12368
12374
  null,
12369
- mobileLogo && screenWidth < 776 ? React__default.createElement('img', { src: mobileLogo }) : React__default.createElement('img', { src: logo, style: { height: '55px' } })
12375
+ mobileLogo && screenWidth < 776 ? React__default.createElement('img', { src: mobileLogo }) : React__default.createElement('img', { src: logo, className: 'logo', style: { height: '55px' } })
12370
12376
  )
12371
12377
  )
12372
12378
  )
@@ -12494,7 +12500,7 @@ var NavMagazine = function NavMagazine(props) {
12494
12500
  React__default.createElement(
12495
12501
  'style',
12496
12502
  { jsx: true },
12497
- '\n .sticky-home {\n position: relative;\n top: -3px;\n left: -6px;\n cursor: pointer;\n }\n @media screen and (max-width: 991px) {\n .mobile-nav .nav-toggle {\n width: 100%;\n }\n .mobile-nav .nav-toggle .navbar-toggler {\n float: left;\n height: 45px;\n }\n .mobile-nav .nav-toggle .form-inline {\n float: right;\n margin: 4px 0px 0px 0px;\n }\n .mobile-nav .form-inline .mobile-search {\n width: auto;\n }\n .sticky-home {\n display: none;\n }\n .dropdown-menu {\n max-height: 315px;\n overflow: auto;\n }\n ::-webkit-scrollbar {\n width: 10px;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(214, 214, 214, 0.8);\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n }\n .navbar-expand-lg .show#basic-navbar-sub {\n display: block;\n }\n .navbar .mobile-nav .navbar-collapse.show {\n padding-bottom: 20px;\n border-bottom: 0.5px solid white;\n margin-bottom: 15px;\n }\n .navbar .mobile-nav .navbar-collapse .form-inline {\n display: none;\n }\n .navbar .mobile-nav .navbar-collapse {\n margin-top: 15px;\n }\n .navbar .mobile-nav .navbar-collapse:last-child {\n border-bottom: none;\n margin-bottom: 0px;\n padding-bottom: 0px;\n margin-top: 0px;\n }\n .navbar .mobile-nav .navbar-collapse .nav-footer ul {\n list-style-type: none;\n padding: inherit;\n margin-bottom: 0rem;\n }\n .navbar .mobile-nav .navbar-collapse .nav-footer .nav-link {\n text-transform: capitalize !important;\n font-weight: 300;\n }\n .navbar .mobile-nav .dropdown-item:focus {\n background-color: #696969;\n }\n .navbar .mobile-nav .dropdown-menu .dropdown-item {\n color: white;\n }\n .navbar .mobile-nav .dropdown-menu {\n background: inherit;\n border: none;\n }\n .navbar .mobile-nav .dropdown-menu.show {\n max-height: 100px;\n }\n }\n @media screen and (min-width: 992px) {\n #basic-navbar-sub {\n display: none !important;\n }\n .navbar .mobile-nav .dropdown-menu .dropdown-item {\n color: #696969;\n }\n .navbar .mobile-nav .dropdown-menu {\n background: white;\n border: 1 px solid #708090;\n }\n .mobile-nav .nav-toggle .form-inline {\n display: none;\n }\n }\n\n @media screen and (max-width: 367px) {\n .mobile-nav .nav-toggle .form-inline .mobile-search {\n width: 60%;\n }\n .mobile-nav .nav-toggle .form-inline {\n width: 70%;\n }\n }\n @media screen and (max-width: 328px) {\n .mobile-nav .nav-toggle .form-inline .mobile-search {\n margin-right: 5px\n }\n }\n '
12503
+ '\n .sticky-home {\n position: relative;\n top: -3px;\n left: -6px;\n cursor: pointer;\n }\n @media screen and (max-width: 991px) {\n .mobile-nav .nav-toggle {\n width: 100%;\n }\n .mobile-nav .nav-toggle .navbar-toggler {\n float: left;\n height: 45px;\n }\n .mobile-nav .nav-toggle .form-inline {\n float: right;\n margin: 4px 0px 0px 0px;\n }\n .mobile-nav .form-inline .mobile-search {\n width: auto;\n }\n .sticky-home {\n display: none;\n }\n .dropdown-menu {\n max-height: 315px;\n overflow: auto;\n }\n ::-webkit-scrollbar {\n width: 10px;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(214, 214, 214, 0.8);\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n }\n .navbar-expand-lg .show#basic-navbar-sub {\n display: block;\n }\n .navbar .mobile-nav .navbar-collapse.show {\n padding-bottom: 20px;\n border-bottom: 0.5px solid white;\n margin-bottom: 15px;\n }\n .navbar .mobile-nav .navbar-collapse .form-inline {\n display: none;\n }\n .navbar .mobile-nav .navbar-collapse {\n margin-top: 15px;\n }\n .navbar .mobile-nav .navbar-collapse:last-child {\n border-bottom: none;\n margin-bottom: 0px;\n padding-bottom: 0px;\n margin-top: 0px;\n }\n .navbar .mobile-nav .navbar-collapse .nav-footer ul {\n list-style-type: none;\n padding: inherit;\n margin-bottom: 0rem;\n }\n .navbar .mobile-nav .navbar-collapse .nav-footer .nav-link {\n text-transform: capitalize !important;\n font-weight: 300;\n }\n .navbar .mobile-nav .dropdown-item:focus {\n background-color: #696969;\n }\n .navbar .mobile-nav .dropdown-menu .dropdown-item {\n color: white;\n }\n .navbar .mobile-nav .dropdown-menu {\n background: inherit;\n border: none;\n }\n .navbar .mobile-nav .dropdown-menu.show {\n max-height: 100px;\n }\n }\n @media screen and (min-width: 992px) {\n #basic-navbar-sub {\n display: none !important;\n }\n .navbar .mobile-nav .dropdown-menu .dropdown-item {\n color: #696969;\n }\n .navbar .mobile-nav .dropdown-menu {\n background: white;\n border: 1 px solid #708090;\n }\n .mobile-nav .nav-toggle .form-inline {\n display: none;\n }\n }\n\n @media screen and (max-width: 367px) {\n .mobile-nav .nav-toggle .form-inline .mobile-search {\n width: 60%;\n }\n .mobile-nav .nav-toggle .form-inline {\n width: 70%;\n }\n }\n @media screen and (max-width: 328px) {\n .mobile-nav .nav-toggle .form-inline .mobile-search {\n margin-right: 5px;\n }\n }\n @media screen and (max-width: 767px) {\n .logo {\n width: 100%;\n padding-left: 10px;\n padding-right: 10px;\n }\n }\n '
12498
12504
  )
12499
12505
  );
12500
12506
  };
@@ -20125,23 +20131,21 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
20125
20131
  );
20126
20132
  };
20127
20133
 
20128
- var onSubmitPoll = function onSubmitPoll(e, setShowAnswer) {
20129
- e.preventDefault();
20130
- setShowAnswer(true);
20131
- };
20132
-
20133
20134
  var Poll = function Poll(_ref) {
20134
20135
  var node = _ref.node,
20135
20136
  client = _ref.client,
20136
20137
  pageview = _ref.pageview,
20137
- videoAccountIDs = _ref.videoAccountIDs;
20138
+ videoAccountIDs = _ref.videoAccountIDs,
20139
+ onVote = _ref.onVote,
20140
+ _ref$showVotes = _ref.showVotes,
20141
+ showVotes = _ref$showVotes === undefined ? false : _ref$showVotes;
20138
20142
 
20139
20143
  var _useState = useState(null),
20140
20144
  _useState2 = slicedToArray(_useState, 2),
20141
20145
  selectedChoice = _useState2[0],
20142
20146
  setSelectedChoice = _useState2[1];
20143
20147
 
20144
- var _useState3 = useState(false),
20148
+ var _useState3 = useState(showVotes),
20145
20149
  _useState4 = slicedToArray(_useState3, 2),
20146
20150
  showAnswer = _useState4[0],
20147
20151
  setShowAnswer = _useState4[1];
@@ -20151,6 +20155,12 @@ var Poll = function Poll(_ref) {
20151
20155
  response = node.response;
20152
20156
 
20153
20157
 
20158
+ var onSubmitPoll = function onSubmitPoll(e, setShowAnswer) {
20159
+ e.preventDefault();
20160
+ onVote(node._key, selectedChoice);
20161
+ setShowAnswer(true);
20162
+ };
20163
+
20154
20164
  var choicesTotalCount = choices && choices.reduce(function (acc, choice) {
20155
20165
  acc = acc + parseInt(choice.choiceCount);
20156
20166
  return acc;
@@ -20172,7 +20182,7 @@ var Poll = function Poll(_ref) {
20172
20182
  return React__default.createElement(
20173
20183
  'div',
20174
20184
  { key: choice._key },
20175
- React__default.createElement('input', { type: 'radio', id: 'male', name: choice._type, value: choice.choiceText, onChange: function onChange(e) {
20185
+ React__default.createElement('input', { type: 'radio', id: 'male', name: choice._type, value: choice._key, onChange: function onChange(e) {
20176
20186
  return setSelectedChoice(e.target.value);
20177
20187
  } }),
20178
20188
  React__default.createElement(
@@ -20228,7 +20238,94 @@ var Poll = function Poll(_ref) {
20228
20238
  );
20229
20239
  };
20230
20240
 
20231
- var getSerializers$1 = function getSerializers(client, pageview, videoAccountIDs) {
20241
+ var Quiz = function Quiz(_ref) {
20242
+ var quizzes = _ref.quizzes;
20243
+
20244
+ var pageCount = quizzes.length;
20245
+
20246
+ var _useState = useState(1),
20247
+ _useState2 = slicedToArray(_useState, 2),
20248
+ currentPage = _useState2[0],
20249
+ setCurrentPage = _useState2[1];
20250
+
20251
+ var _useState3 = useState(false),
20252
+ _useState4 = slicedToArray(_useState3, 2),
20253
+ showAnswer = _useState4[0],
20254
+ setShowAnswer = _useState4[1];
20255
+
20256
+ var changePage = function changePage(page) {
20257
+ if (page > 0 && page <= pageCount) {
20258
+ setShowAnswer(false);
20259
+ setCurrentPage(page);
20260
+ }
20261
+ };
20262
+
20263
+ var renderPagination = function renderPagination() {
20264
+ var pages = [];
20265
+
20266
+ var _loop = function _loop(i) {
20267
+ pages.push(React__default.createElement(
20268
+ Pagination.Item,
20269
+ { onClick: function onClick() {
20270
+ return changePage(i);
20271
+ }, active: i === currentPage },
20272
+ i
20273
+ ));
20274
+ };
20275
+
20276
+ for (var i = 1; i <= pageCount; i++) {
20277
+ _loop(i);
20278
+ }
20279
+ return React__default.createElement(
20280
+ Pagination,
20281
+ { className: 'p-0 m-0' },
20282
+ React__default.createElement(Pagination.First, { onClick: function onClick() {
20283
+ return changePage(1);
20284
+ } }),
20285
+ React__default.createElement(Pagination.Prev, { onClick: function onClick() {
20286
+ return changePage(currentPage - 1);
20287
+ } }),
20288
+ pages,
20289
+ React__default.createElement(Pagination.Next, { onClick: function onClick() {
20290
+ return changePage(currentPage + 1);
20291
+ } }),
20292
+ React__default.createElement(Pagination.Last, { onClick: function onClick() {
20293
+ return changePage(pageCount);
20294
+ } })
20295
+ );
20296
+ };
20297
+
20298
+ return React__default.createElement(
20299
+ React__default.Fragment,
20300
+ null,
20301
+ quizzes[currentPage - 1] && React__default.createElement(BlockContent, { blocks: quizzes[currentPage - 1].question }),
20302
+ !showAnswer && React__default.createElement(
20303
+ Button,
20304
+ { onClick: function onClick() {
20305
+ return setShowAnswer(true);
20306
+ }, variant: 'info', block: true },
20307
+ 'Please click here for answer'
20308
+ ),
20309
+ quizzes[currentPage - 1] && showAnswer && React__default.createElement(
20310
+ React__default.Fragment,
20311
+ null,
20312
+ React__default.createElement(
20313
+ 'h4',
20314
+ null,
20315
+ 'Answer:'
20316
+ ),
20317
+ React__default.createElement(BlockContent, { blocks: quizzes[currentPage - 1].answer })
20318
+ ),
20319
+ React__default.createElement('br', null),
20320
+ React__default.createElement(
20321
+ 'div',
20322
+ { className: 'd-flex justify-content-center' },
20323
+ renderPagination()
20324
+ )
20325
+ );
20326
+ };
20327
+
20328
+ var getSerializers$1 = function getSerializers(client, pageview, videoAccountIDs, onVote, showVotes) {
20232
20329
  return {
20233
20330
  types: {
20234
20331
  youtube: function youtube(_ref) {
@@ -20293,7 +20390,13 @@ var getSerializers$1 = function getSerializers(client, pageview, videoAccountIDs
20293
20390
  poll: function poll(_ref11) {
20294
20391
  var node = _ref11.node;
20295
20392
 
20296
- return React__default.createElement(Poll, { node: node, client: client, pageview: pageview, videoAccountIDs: videoAccountIDs });
20393
+ return React__default.createElement(Poll, { node: node, client: client, pageview: pageview, videoAccountIDs: videoAccountIDs, onVote: onVote, showVotes: showVotes });
20394
+ },
20395
+ quiz: function quiz(_ref12) {
20396
+ var node = _ref12.node;
20397
+ var quizzes = node.quizzes;
20398
+
20399
+ return React__default.createElement(Quiz, { quizzes: quizzes });
20297
20400
  }
20298
20401
  },
20299
20402
  marks: {