@mjhls/mjh-framework 1.0.1082-c5 → 1.0.1082-poll-test-1

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 (33) hide show
  1. package/dist/cjs/ArticleProgramLandingPage.js +1 -1
  2. package/dist/cjs/ExternalResources.js +1 -1
  3. package/dist/cjs/HorizontalArticleListing.js +1 -1
  4. package/dist/cjs/IssueLanding.js +1 -1
  5. package/dist/cjs/MediaSeriesCard.js +1 -1
  6. package/dist/cjs/MediaSeriesLanding.js +1 -1
  7. package/dist/cjs/MediaSeriesLandingPaginated.js +1 -1
  8. package/dist/cjs/PartnerDetailListing.js +1 -1
  9. package/dist/cjs/PartnerDetailListingPaginated.js +1 -1
  10. package/dist/cjs/PodcastsLanding.js +1 -1
  11. package/dist/cjs/TaxonomyDescription.js +1 -1
  12. package/dist/cjs/VideoProgramLandingPage.js +1 -1
  13. package/dist/cjs/View.js +12 -31
  14. package/dist/cjs/getSerializers.js +1 -1
  15. package/dist/cjs/{index-171e9e82.js → index-8193e03a.js} +90 -50
  16. package/dist/cjs/index.js +1 -1
  17. package/dist/esm/ArticleProgramLandingPage.js +1 -1
  18. package/dist/esm/ExternalResources.js +1 -1
  19. package/dist/esm/HorizontalArticleListing.js +1 -1
  20. package/dist/esm/IssueLanding.js +1 -1
  21. package/dist/esm/MediaSeriesCard.js +1 -1
  22. package/dist/esm/MediaSeriesLanding.js +1 -1
  23. package/dist/esm/MediaSeriesLandingPaginated.js +1 -1
  24. package/dist/esm/PartnerDetailListing.js +1 -1
  25. package/dist/esm/PartnerDetailListingPaginated.js +1 -1
  26. package/dist/esm/PodcastsLanding.js +1 -1
  27. package/dist/esm/TaxonomyDescription.js +1 -1
  28. package/dist/esm/VideoProgramLandingPage.js +1 -1
  29. package/dist/esm/View.js +12 -31
  30. package/dist/esm/getSerializers.js +1 -1
  31. package/dist/esm/{index-1d1bbc8c.js → index-3069d37b.js} +90 -50
  32. package/dist/esm/index.js +1 -1
  33. package/package.json +1 -1
@@ -5,7 +5,7 @@ var slicedToArray = require('./slicedToArray-067dd3bc.js');
5
5
  var _extends = require('./extends-be0d85bc.js');
6
6
  var React = require('react');
7
7
  var BlockContent = require('./BlockContent-96b44364.js');
8
- var getSerializers = require('./index-171e9e82.js');
8
+ var getSerializers = require('./index-8193e03a.js');
9
9
  var ArticleSeriesListing = require('./ArticleSeriesListing.js');
10
10
  require('./_commonjsHelpers-06173234.js');
11
11
  require('./core.get-iterator-method-5643aa10.js');
@@ -4,7 +4,7 @@ var _extends = require('./extends-be0d85bc.js');
4
4
  var slicedToArray = require('./slicedToArray-067dd3bc.js');
5
5
  var React = require('react');
6
6
  var BlockContent = require('./BlockContent-96b44364.js');
7
- var getSerializers = require('./index-171e9e82.js');
7
+ var getSerializers = require('./index-8193e03a.js');
8
8
  var index = require('./index-3177f564.js');
9
9
  var Router = require('next/router');
10
10
  var Button = require('react-bootstrap/Button');
@@ -5,7 +5,7 @@ var React = require('react');
5
5
  var ArticleCarousel = require('./ArticleCarousel.js');
6
6
  var index_esm = require('./index.esm-d81454e7.js');
7
7
  var BlockContent = require('./BlockContent-96b44364.js');
8
- var getSerializers = require('./index-171e9e82.js');
8
+ var getSerializers = require('./index-8193e03a.js');
9
9
  require('./_commonjsHelpers-06173234.js');
10
10
  require('./core.get-iterator-method-5643aa10.js');
11
11
  require('./YoutubeGroup.js');
@@ -5,7 +5,7 @@ var React = require('react');
5
5
  var QueueDeckExpanded = require('./QueueDeckExpanded.js');
6
6
  var Breadcrumbs = require('./Breadcrumbs.js');
7
7
  var BlockContent = require('./BlockContent-96b44364.js');
8
- var getSerializers = require('./index-171e9e82.js');
8
+ var getSerializers = require('./index-8193e03a.js');
9
9
  var PixelTracking = require('./PixelTracking.js');
10
10
  require('./_commonjsHelpers-06173234.js');
11
11
  require('./core.get-iterator-method-5643aa10.js');
@@ -7,7 +7,7 @@ var urlFor = require('./urlFor.js');
7
7
  var moment = require('./moment-f730814d.js');
8
8
  var styleInject_es = require('./style-inject.es-dcee06b6.js');
9
9
  var BlockContent = require('./BlockContent-96b44364.js');
10
- var getSerializers = require('./index-171e9e82.js');
10
+ var getSerializers = require('./index-8193e03a.js');
11
11
  require('./_commonjsHelpers-06173234.js');
12
12
  require('./core.get-iterator-method-5643aa10.js');
13
13
  require('./web.dom.iterable-d98303e0.js');
@@ -12,7 +12,7 @@ var Link = require('next/link');
12
12
  var MasterDeck = require('./MasterDeck.js');
13
13
  var MediaSeriesCard = require('./MediaSeriesCard.js');
14
14
  var BlockContent = require('./BlockContent-96b44364.js');
15
- var getSerializers = require('./index-171e9e82.js');
15
+ var getSerializers = require('./index-8193e03a.js');
16
16
  require('./_commonjsHelpers-06173234.js');
17
17
  require('./core.get-iterator-method-5643aa10.js');
18
18
  require('./web.dom.iterable-d98303e0.js');
@@ -12,7 +12,7 @@ var Link = require('next/link');
12
12
  var BlockContent = require('./BlockContent-96b44364.js');
13
13
  var MasterDeckPaginated = require('./MasterDeckPaginated.js');
14
14
  var MediaSeriesCard = require('./MediaSeriesCard.js');
15
- var getSerializers = require('./index-171e9e82.js');
15
+ var getSerializers = require('./index-8193e03a.js');
16
16
  require('./_commonjsHelpers-06173234.js');
17
17
  require('./core.get-iterator-method-5643aa10.js');
18
18
  require('./web.dom.iterable-d98303e0.js');
@@ -13,7 +13,7 @@ var QueueDeckExpanded = require('./QueueDeckExpanded.js');
13
13
  var Breadcrumbs = require('./Breadcrumbs.js');
14
14
  var Feature = require('./Feature.js');
15
15
  var urlFor = require('./urlFor.js');
16
- var getSerializers = require('./index-171e9e82.js');
16
+ var getSerializers = require('./index-8193e03a.js');
17
17
  var BlockContent = require('./BlockContent-96b44364.js');
18
18
  var checkSisterSite = require('./checkSisterSite-c3a4ac98.js');
19
19
  require('./_commonjsHelpers-06173234.js');
@@ -13,7 +13,7 @@ var QueueDeckExpandedPaginated = require('./QueueDeckExpandedPaginated.js');
13
13
  var Breadcrumbs = require('./Breadcrumbs.js');
14
14
  var Feature = require('./Feature.js');
15
15
  var urlFor = require('./urlFor.js');
16
- var getSerializers = require('./index-171e9e82.js');
16
+ var getSerializers = require('./index-8193e03a.js');
17
17
  var BlockContent = require('./BlockContent-96b44364.js');
18
18
  var checkSisterSite = require('./checkSisterSite-c3a4ac98.js');
19
19
  require('./_commonjsHelpers-06173234.js');
@@ -8,7 +8,7 @@ var Link = require('next/link');
8
8
  var MasterDeck = require('./MasterDeck.js');
9
9
  var MediaSeriesCard = require('./MediaSeriesCard.js');
10
10
  var BlockContent = require('./BlockContent-96b44364.js');
11
- var getSerializers = require('./index-171e9e82.js');
11
+ var getSerializers = require('./index-8193e03a.js');
12
12
  require('./_commonjsHelpers-06173234.js');
13
13
  require('./core.get-iterator-method-5643aa10.js');
14
14
  require('./web.dom.iterable-d98303e0.js');
@@ -7,7 +7,7 @@ var React = require('react');
7
7
  var Router = require('next/router');
8
8
  var Head = require('next/head');
9
9
  var BlockContent = require('./BlockContent-96b44364.js');
10
- var getSerializers = require('./index-171e9e82.js');
10
+ var getSerializers = require('./index-8193e03a.js');
11
11
  require('./_commonjsHelpers-06173234.js');
12
12
  require('./core.get-iterator-method-5643aa10.js');
13
13
  require('./web.dom.iterable-d98303e0.js');
@@ -7,7 +7,7 @@ var BlockContent = require('./BlockContent-96b44364.js');
7
7
  var Col = require('react-bootstrap/Col');
8
8
  var Form = require('react-bootstrap/Form');
9
9
  var Button = require('react-bootstrap/Button');
10
- var getSerializers = require('./index-171e9e82.js');
10
+ var getSerializers = require('./index-8193e03a.js');
11
11
  var VideoSeriesListing = require('./VideoSeriesListing.js');
12
12
  require('./_commonjsHelpers-06173234.js');
13
13
  require('./core.get-iterator-method-5643aa10.js');
package/dist/cjs/View.js CHANGED
@@ -17,7 +17,7 @@ var FormControl = require('react-bootstrap/FormControl');
17
17
  var Button = require('react-bootstrap/Button');
18
18
  var visibilitySensor = require('./visibility-sensor-56020df6.js');
19
19
  var SocialShare = require('./SocialShare.js');
20
- var getSerializers = require('./index-171e9e82.js');
20
+ var getSerializers = require('./index-8193e03a.js');
21
21
  var AdSlot = require('./AdSlot.js');
22
22
  var SeriesSlider = require('./SeriesSlider-086a8319.js');
23
23
  var getTargeting = require('./getTargeting-5b954783.js');
@@ -124,8 +124,7 @@ var getDocumentGroupUrl = function getDocumentGroupUrl(docGroup) {
124
124
  if (typeof url !== 'undefined') {
125
125
  url = url + '/' + docGroup.path;
126
126
  } else {
127
- // url = '/' + docGroup.path
128
- return null;
127
+ url = '/' + docGroup.path;
129
128
  }
130
129
 
131
130
  return url;
@@ -148,8 +147,7 @@ var getDocumentGroupName = function getDocumentGroupName(docGroup) {
148
147
  if (typeof name !== 'undefined') {
149
148
  name = name + ' | <b>' + docGroup.name + '</b>';
150
149
  } else {
151
- // name = '<b>' + docGroup.name + '</b>'
152
- return null;
150
+ name = '<b>' + docGroup.name + '</b>';
153
151
  }
154
152
 
155
153
  return name && typeof name != 'undefined' ? name : null;
@@ -199,7 +197,7 @@ var DocumentGroup = function DocumentGroup(_ref) {
199
197
  { style: { textAlign: 'center', fontWeight: 600 } },
200
198
  article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText ? article.documentGroupMapping[0].parent.parent.contextText : article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? article.documentGroup.parent.parent.contextText : null
201
199
  ),
202
- url && name && React__default["default"].createElement(
200
+ React__default["default"].createElement(
203
201
  'a',
204
202
  {
205
203
  href: url,
@@ -1266,7 +1264,6 @@ var Article = React__default["default"].memo(React.forwardRef(function (props, r
1266
1264
  };
1267
1265
 
1268
1266
  var RelevantTopics = function RelevantTopics() {
1269
-
1270
1267
  if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
1271
1268
  var relatedLinks = [];
1272
1269
  if (documentGroupMapping && documentGroupMapping.length > 0) {
@@ -1274,23 +1271,12 @@ var Article = React__default["default"].memo(React.forwardRef(function (props, r
1274
1271
  if (documentGroup.isShow === false || documentGroup.excludeRelatedContents) {
1275
1272
  return null;
1276
1273
  }
1277
-
1278
- var doc_url = cpModificationRequired ? getDocumentGroupUrl(documentGroup) : documentGroup.ancestor ? documentGroup.parent && !documentGroup.path.includes('/') ? '/' + documentGroup.ancestor + '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.ancestor + '/' + documentGroup.path : documentGroup.parent ? !documentGroup.path.includes('/') ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path : '/' + documentGroup.path;
1279
- var href = '' + doc_url;
1280
- relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: documentGroup.name, href: href }]);
1281
- // if (documentGroup.parent) {
1282
- // relatedLinks = [
1283
- // ...relatedLinks,
1284
- // {
1285
- // label: documentGroup.name,
1286
- // href: cpModificationRequired
1287
- // ? getDocumentGroupUrl(documentGroup)
1288
- // : documentGroup.parent.identifier && documentGroup.parent.identifier.current && !documentGroup.path.includes('/')
1289
- // ? `/${documentGroup.parent.identifier.current}/${documentGroup.path}`
1290
- // : `/${documentGroup.path}`
1291
- // }
1292
- // ]
1293
- // }
1274
+ if (documentGroup.parent) {
1275
+ relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{
1276
+ label: documentGroup.name,
1277
+ href: cpModificationRequired ? getDocumentGroupUrl(documentGroup) : documentGroup.parent.identifier && documentGroup.parent.identifier.current && !documentGroup.path.includes('/') ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path
1278
+ }]);
1279
+ }
1294
1280
  });
1295
1281
  }
1296
1282
  if (content_placement && content_placement.length > 0) {
@@ -1300,11 +1286,8 @@ var Article = React__default["default"].memo(React.forwardRef(function (props, r
1300
1286
  if (cp.excludeRelatedContents) {
1301
1287
  return null;
1302
1288
  }
1303
-
1304
- cpModificationRequired ? getTargeting.getContentPlacementUrl(cp) : cp.ancestor ? cp.parent && !cp.path.includes('/') ? cp.ancestor + '/' + cp.parent + '/' + cp.path : cp.ancestor + '/' + cp.path : cp.parent ? !cp.path.includes('/') ? cp.parent + '/' + cp.path : '' + cp.path : '' + cp.path;
1305
- var cp_url1 = cpModificationRequired ? getTargeting.getContentPlacementUrl(cp) : cp.ancestor ? cp.parent && !cp.path.includes('/') ? cp.ancestor + '/' + cp.parent + '/' + cp.path : !cp.path.includes(cp.ancestor) ? cp.ancestor + '/' + cp.path : '' + cp.path : cp.parent ? !cp.path.includes('/') ? cp.parent + '/' + cp.path : '' + cp.path : '' + cp.path;
1306
- console.log("++++++++++++++++++++++cp url+++++++++++", cp_url1);
1307
- var href = '/' + cp_url1;
1289
+ var cp_url = cpModificationRequired ? getTargeting.getContentPlacementUrl(cp) : cp.path;
1290
+ var href = '/' + cp_url;
1308
1291
  relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: cp.name, href: href }]);
1309
1292
  });
1310
1293
  }
@@ -2400,8 +2383,6 @@ var View = function View(props) {
2400
2383
  var title = _props$article2.title,
2401
2384
  seriesShareOptions = _props$article2.seriesShareOptions;
2402
2385
 
2403
- console.log(props);
2404
-
2405
2386
  var _useState = React.useState(0),
2406
2387
  _useState2 = slicedToArray._slicedToArray(_useState, 2),
2407
2388
  currentPage = _useState2[0],
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  require('react');
4
- var getSerializers = require('./index-171e9e82.js');
4
+ var getSerializers = require('./index-8193e03a.js');
5
5
  require('./BlockContent-96b44364.js');
6
6
  require('./entities-df1aed86.js');
7
7
  require('./slicedToArray-067dd3bc.js');
@@ -8933,11 +8933,17 @@ var Poll$1 = function Poll(_ref) {
8933
8933
  showBorders = _useState6[0],
8934
8934
  setShowBorders = _useState6[1];
8935
8935
 
8936
+ var _useState7 = React.useState(false),
8937
+ _useState8 = slicedToArray._slicedToArray(_useState7, 2),
8938
+ dateChecked = _useState8[0],
8939
+ setDateChecked = _useState8[1];
8940
+
8936
8941
  var choices = node.choices,
8937
8942
  question = node.question,
8938
8943
  response = node.response,
8939
8944
  _node$showResults = node.showResults,
8940
- showResults = _node$showResults === undefined ? '' : _node$showResults;
8945
+ showResults = _node$showResults === undefined ? '' : _node$showResults,
8946
+ resultsDate = node.resultsDate;
8941
8947
 
8942
8948
  var inputRef = React.useRef([]);
8943
8949
 
@@ -8945,6 +8951,15 @@ var Poll$1 = function Poll(_ref) {
8945
8951
  e.preventDefault();
8946
8952
  onVote(node._key, selectedChoice);
8947
8953
  };
8954
+ React.useEffect(function () {
8955
+ var dateForResults = new Date(resultsDate);
8956
+ var today = new Date();
8957
+ if (today.getTime() >= dateForResults.getTime()) {
8958
+ setShowAnswer(true);
8959
+ setDateChecked(true);
8960
+ }
8961
+ }, [resultsDate]);
8962
+
8948
8963
  React.useEffect(function () {
8949
8964
  if (showResults) {
8950
8965
  setShowAnswer(true);
@@ -8983,44 +8998,10 @@ var Poll$1 = function Poll(_ref) {
8983
8998
  }
8984
8999
  };
8985
9000
 
8986
- return React__default["default"].createElement(
8987
- 'div',
8988
- { className: 'pollHolder mb-3' },
8989
- question && React__default["default"].createElement(
8990
- 'p',
8991
- { className: 'font-weight-bold' },
8992
- question
8993
- ),
8994
- !showAnswer && choices && choices.length > 0 && React__default["default"].createElement(
8995
- 'form',
8996
- { className: 'formPoll', onSubmit: function onSubmit(e) {
8997
- return onSubmitPoll(e);
8998
- } },
8999
- choices && choices.map(function (choice, index) {
9000
- return React__default["default"].createElement(
9001
- 'div',
9002
- { key: choice._key, 'data-index': index, onClick: function onClick(e) {
9003
- return userChoiceSelection(e);
9004
- } },
9005
- React__default["default"].createElement(
9006
- 'label',
9007
- { className: 'pl-2' },
9008
- React__default["default"].createElement('input', { ref: function ref(el) {
9009
- return inputRef.current[index] = el;
9010
- }, type: 'radio', id: 'male', name: choice._type, value: choice._key }),
9011
- ' ' + choice.choiceText
9012
- )
9013
- );
9014
- }),
9015
- React__default["default"].createElement(
9016
- reactBootstrap.Button,
9017
- { disabled: !selectedChoice, style: { width: '100%', borderRadius: '5px', fontWeight: 'bold ' }, className: 'mt-3', type: 'submit' },
9018
- 'Vote'
9019
- )
9020
- ),
9021
- showAnswer && React__default["default"].createElement(
9001
+ var Results = function Results() {
9002
+ return React__default["default"].createElement(
9022
9003
  'div',
9023
- { className: 'progress-container mb-3' },
9004
+ null,
9024
9005
  showAnswer && choices && choices.length > 0 && choices.map(function (choice) {
9025
9006
  var percentage = choicesTotalCount && choicesTotalCount > 0 ? choice.choiceCount ? Math.floor(choice.choiceCount * 100 / choicesTotalCount) : 0 : 0;
9026
9007
  return React__default["default"].createElement(
@@ -9028,23 +9009,32 @@ var Poll$1 = function Poll(_ref) {
9028
9009
  {
9029
9010
  key: choice._key,
9030
9011
  style: { border: showBorders ? choice.choiceAnswer === true ? '2px solid limegreen' : checkChoice(choice._key) ? '2px solid red' : '' : '' },
9031
- className: 'mb-3' },
9012
+ className: 'mb-3'
9013
+ },
9032
9014
  React__default["default"].createElement(
9033
9015
  'div',
9034
9016
  { className: 'correct-answer' },
9035
- React__default["default"].createElement(reactBootstrap.ProgressBar, { now: percentage }),
9036
9017
  React__default["default"].createElement(
9037
9018
  'div',
9038
- null,
9039
- choice.choiceText
9040
- ),
9041
- React__default["default"].createElement(
9042
- 'div',
9043
- { className: 'float-right' },
9044
- percentage,
9045
- '% (',
9046
- choice.choiceCount ? choice.choiceCount : 0,
9047
- ' Votes)'
9019
+ { className: 'relative w-full h-6 bg-gray-600/50 mx-auto rounded-lg overflow-hidden border border-gray-300' },
9020
+ React__default["default"].createElement('div', { style: { width: percentage + '%' }, className: 'top-0 absolute h-full bg-primary relative' }),
9021
+ React__default["default"].createElement(
9022
+ 'div',
9023
+ { className: 'bottom-0 absolute h-full m-auto font-bold text-sm align-center flex justify-between w-full' },
9024
+ React__default["default"].createElement(
9025
+ 'div',
9026
+ { className: 'text-white pl-2 max-w-[75%]' },
9027
+ choice.choiceText
9028
+ ),
9029
+ React__default["default"].createElement(
9030
+ 'div',
9031
+ { className: 'pr-4 text-white' },
9032
+ percentage,
9033
+ '% (',
9034
+ choice.choiceCount ? choice.choiceCount : 0,
9035
+ ' Votes)'
9036
+ )
9037
+ )
9048
9038
  )
9049
9039
  )
9050
9040
  );
@@ -9055,6 +9045,56 @@ var Poll$1 = function Poll(_ref) {
9055
9045
  'Total Votes: ',
9056
9046
  choicesTotalCount
9057
9047
  )
9048
+ );
9049
+ };
9050
+
9051
+ return React__default["default"].createElement(
9052
+ 'div',
9053
+ { className: 'pollHolder mb-3' },
9054
+ !dateChecked && React__default["default"].createElement(
9055
+ 'div',
9056
+ null,
9057
+ question && React__default["default"].createElement(
9058
+ 'p',
9059
+ { className: 'font-weight-bold' },
9060
+ question
9061
+ ),
9062
+ !showAnswer && choices && choices.length > 0 && React__default["default"].createElement(
9063
+ 'form',
9064
+ { className: 'formPoll', onSubmit: function onSubmit(e) {
9065
+ return onSubmitPoll(e);
9066
+ } },
9067
+ choices && choices.map(function (choice, index) {
9068
+ return React__default["default"].createElement(
9069
+ 'div',
9070
+ { key: choice._key, 'data-index': index, onClick: function onClick(e) {
9071
+ return userChoiceSelection(e);
9072
+ } },
9073
+ React__default["default"].createElement(
9074
+ 'label',
9075
+ { className: 'pl-2' },
9076
+ React__default["default"].createElement('input', { ref: function ref(el) {
9077
+ return inputRef.current[index] = el;
9078
+ }, type: 'radio', id: 'male', name: choice._type, value: choice._key }),
9079
+ ' ' + choice.choiceText
9080
+ )
9081
+ );
9082
+ }),
9083
+ React__default["default"].createElement(
9084
+ reactBootstrap.Button,
9085
+ { disabled: !selectedChoice, style: { width: '100%', borderRadius: '5px', fontWeight: 'bold ' }, className: 'mt-3', type: 'submit' },
9086
+ 'Vote'
9087
+ )
9088
+ )
9089
+ ),
9090
+ showAnswer && dateChecked ? React__default["default"].createElement(
9091
+ 'div',
9092
+ { className: 'progress-container mb-3' },
9093
+ React__default["default"].createElement(Results, null)
9094
+ ) : React__default["default"].createElement(
9095
+ 'div',
9096
+ null,
9097
+ !resultsDate && React__default["default"].createElement(Results, null)
9058
9098
  ),
9059
9099
  showAnswer && response && React__default["default"].createElement(BlockContent.BlockContent, { blocks: response, serializers: getSerializers }),
9060
9100
  React__default["default"].createElement(
package/dist/cjs/index.js CHANGED
@@ -91,7 +91,7 @@ var VerticalHero = require('./VerticalHero.js');
91
91
  var YahooHero = require('./YahooHero.js');
92
92
  var GridHero = require('./GridHero.js');
93
93
  var ConferenceArticleCard = require('./ConferenceArticleCard.js');
94
- var getSerializers = require('./index-171e9e82.js');
94
+ var getSerializers = require('./index-8193e03a.js');
95
95
  var Beam = require('./Beam.js');
96
96
  var Segment = require('./Segment.js');
97
97
  var KMTracker = require('./KMTracker.js');
@@ -3,7 +3,7 @@ import { _ as _slicedToArray } from './slicedToArray-72ed566b.js';
3
3
  import { _ as _extends } from './extends-2f4448b8.js';
4
4
  import React__default from 'react';
5
5
  import { B as BlockContent } from './BlockContent-1e73bd2c.js';
6
- import { g as getSerializers } from './index-1d1bbc8c.js';
6
+ import { g as getSerializers } from './index-3069d37b.js';
7
7
  import ArticleSeriesListing from './ArticleSeriesListing.js';
8
8
  import './_commonjsHelpers-0c4b6f40.js';
9
9
  import './core.get-iterator-method-95db387d.js';
@@ -2,7 +2,7 @@ import { _ as _extends } from './extends-2f4448b8.js';
2
2
  import { _ as _slicedToArray } from './slicedToArray-72ed566b.js';
3
3
  import React__default, { useState, useEffect } from 'react';
4
4
  import { B as BlockContent } from './BlockContent-1e73bd2c.js';
5
- import { g as getSerializers } from './index-1d1bbc8c.js';
5
+ import { g as getSerializers } from './index-3069d37b.js';
6
6
  import { m as momentTimezone } from './index-4550ef23.js';
7
7
  import { useRouter } from 'next/router';
8
8
  import Button from 'react-bootstrap/Button';
@@ -3,7 +3,7 @@ import React__default from 'react';
3
3
  import ArticleCarousel from './ArticleCarousel.js';
4
4
  import { I as IoIosArrowForward } from './index.esm-eb1e8e80.js';
5
5
  import { B as BlockContent } from './BlockContent-1e73bd2c.js';
6
- import { g as getSerializers } from './index-1d1bbc8c.js';
6
+ import { g as getSerializers } from './index-3069d37b.js';
7
7
  import './_commonjsHelpers-0c4b6f40.js';
8
8
  import './core.get-iterator-method-95db387d.js';
9
9
  import './YoutubeGroup.js';
@@ -3,7 +3,7 @@ import React__default from 'react';
3
3
  import QueueDeckExpanded from './QueueDeckExpanded.js';
4
4
  import Breadcrumbs from './Breadcrumbs.js';
5
5
  import { B as BlockContent } from './BlockContent-1e73bd2c.js';
6
- import { g as getSerializers } from './index-1d1bbc8c.js';
6
+ import { g as getSerializers } from './index-3069d37b.js';
7
7
  import { PixelTrackingLandingPages } from './PixelTracking.js';
8
8
  import './_commonjsHelpers-0c4b6f40.js';
9
9
  import './core.get-iterator-method-95db387d.js';
@@ -5,7 +5,7 @@ import urlFor from './urlFor.js';
5
5
  import { m as moment } from './moment-48faeb9c.js';
6
6
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
7
7
  import { B as BlockContent } from './BlockContent-1e73bd2c.js';
8
- import { g as getSerializers } from './index-1d1bbc8c.js';
8
+ import { g as getSerializers } from './index-3069d37b.js';
9
9
  import './_commonjsHelpers-0c4b6f40.js';
10
10
  import './core.get-iterator-method-95db387d.js';
11
11
  import './web.dom.iterable-3fffc027.js';
@@ -10,7 +10,7 @@ import Link from 'next/link';
10
10
  import MasterDeck from './MasterDeck.js';
11
11
  import MediaSeriesCard from './MediaSeriesCard.js';
12
12
  import { B as BlockContent } from './BlockContent-1e73bd2c.js';
13
- import { g as getSerializers } from './index-1d1bbc8c.js';
13
+ import { g as getSerializers } from './index-3069d37b.js';
14
14
  import './_commonjsHelpers-0c4b6f40.js';
15
15
  import './core.get-iterator-method-95db387d.js';
16
16
  import './web.dom.iterable-3fffc027.js';
@@ -10,7 +10,7 @@ import Link from 'next/link';
10
10
  import { B as BlockContent } from './BlockContent-1e73bd2c.js';
11
11
  import MasterDeck from './MasterDeckPaginated.js';
12
12
  import MediaSeriesCard from './MediaSeriesCard.js';
13
- import { g as getSerializers } from './index-1d1bbc8c.js';
13
+ import { g as getSerializers } from './index-3069d37b.js';
14
14
  import './_commonjsHelpers-0c4b6f40.js';
15
15
  import './core.get-iterator-method-95db387d.js';
16
16
  import './web.dom.iterable-3fffc027.js';
@@ -11,7 +11,7 @@ import QueueDeckExpanded from './QueueDeckExpanded.js';
11
11
  import Breadcrumbs from './Breadcrumbs.js';
12
12
  import Feature from './Feature.js';
13
13
  import urlFor from './urlFor.js';
14
- import { g as getSerializers } from './index-1d1bbc8c.js';
14
+ import { g as getSerializers } from './index-3069d37b.js';
15
15
  import { B as BlockContent } from './BlockContent-1e73bd2c.js';
16
16
  import { c as checkSisterSite } from './checkSisterSite-a7218fda.js';
17
17
  import './_commonjsHelpers-0c4b6f40.js';
@@ -11,7 +11,7 @@ import QueueDeckExpanded from './QueueDeckExpandedPaginated.js';
11
11
  import Breadcrumbs from './Breadcrumbs.js';
12
12
  import Feature from './Feature.js';
13
13
  import urlFor from './urlFor.js';
14
- import { g as getSerializers } from './index-1d1bbc8c.js';
14
+ import { g as getSerializers } from './index-3069d37b.js';
15
15
  import { B as BlockContent } from './BlockContent-1e73bd2c.js';
16
16
  import { c as checkSisterSite } from './checkSisterSite-a7218fda.js';
17
17
  import './_commonjsHelpers-0c4b6f40.js';
@@ -6,7 +6,7 @@ import Link from 'next/link';
6
6
  import MasterDeck from './MasterDeck.js';
7
7
  import MediaSeriesCard from './MediaSeriesCard.js';
8
8
  import { B as BlockContent } from './BlockContent-1e73bd2c.js';
9
- import { g as getSerializers } from './index-1d1bbc8c.js';
9
+ import { g as getSerializers } from './index-3069d37b.js';
10
10
  import './_commonjsHelpers-0c4b6f40.js';
11
11
  import './core.get-iterator-method-95db387d.js';
12
12
  import './web.dom.iterable-3fffc027.js';
@@ -5,7 +5,7 @@ import React__default, { useState, useEffect } from 'react';
5
5
  import { useRouter } from 'next/router';
6
6
  import Head from 'next/head';
7
7
  import { B as BlockContent } from './BlockContent-1e73bd2c.js';
8
- import { g as getSerializers } from './index-1d1bbc8c.js';
8
+ import { g as getSerializers } from './index-3069d37b.js';
9
9
  import './_commonjsHelpers-0c4b6f40.js';
10
10
  import './core.get-iterator-method-95db387d.js';
11
11
  import './web.dom.iterable-3fffc027.js';
@@ -5,7 +5,7 @@ import { B as BlockContent } from './BlockContent-1e73bd2c.js';
5
5
  import Col from 'react-bootstrap/Col';
6
6
  import Form from 'react-bootstrap/Form';
7
7
  import Button from 'react-bootstrap/Button';
8
- import { g as getSerializers } from './index-1d1bbc8c.js';
8
+ import { g as getSerializers } from './index-3069d37b.js';
9
9
  import VideoSeriesListing from './VideoSeriesListing.js';
10
10
  import './_commonjsHelpers-0c4b6f40.js';
11
11
  import './core.get-iterator-method-95db387d.js';
package/dist/esm/View.js CHANGED
@@ -15,7 +15,7 @@ import FormControl from 'react-bootstrap/FormControl';
15
15
  import Button from 'react-bootstrap/Button';
16
16
  import { V as VisibilitySensor } from './visibility-sensor-72fd8f8b.js';
17
17
  import SocialShare from './SocialShare.js';
18
- import { r as renderAuthor, g as getSerializers } from './index-1d1bbc8c.js';
18
+ import { r as renderAuthor, g as getSerializers } from './index-3069d37b.js';
19
19
  import DFPAdSlot from './AdSlot.js';
20
20
  import { S as SeriesSlider } from './SeriesSlider-acbdf4c9.js';
21
21
  import { a as getContentPlacementUrl, g as getTargeting } from './getTargeting-b62a177c.js';
@@ -114,8 +114,7 @@ var getDocumentGroupUrl = function getDocumentGroupUrl(docGroup) {
114
114
  if (typeof url !== 'undefined') {
115
115
  url = url + '/' + docGroup.path;
116
116
  } else {
117
- // url = '/' + docGroup.path
118
- return null;
117
+ url = '/' + docGroup.path;
119
118
  }
120
119
 
121
120
  return url;
@@ -138,8 +137,7 @@ var getDocumentGroupName = function getDocumentGroupName(docGroup) {
138
137
  if (typeof name !== 'undefined') {
139
138
  name = name + ' | <b>' + docGroup.name + '</b>';
140
139
  } else {
141
- // name = '<b>' + docGroup.name + '</b>'
142
- return null;
140
+ name = '<b>' + docGroup.name + '</b>';
143
141
  }
144
142
 
145
143
  return name && typeof name != 'undefined' ? name : null;
@@ -189,7 +187,7 @@ var DocumentGroup = function DocumentGroup(_ref) {
189
187
  { style: { textAlign: 'center', fontWeight: 600 } },
190
188
  article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText ? article.documentGroupMapping[0].parent.parent.contextText : article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? article.documentGroup.parent.parent.contextText : null
191
189
  ),
192
- url && name && React__default.createElement(
190
+ React__default.createElement(
193
191
  'a',
194
192
  {
195
193
  href: url,
@@ -1256,7 +1254,6 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
1256
1254
  };
1257
1255
 
1258
1256
  var RelevantTopics = function RelevantTopics() {
1259
-
1260
1257
  if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
1261
1258
  var relatedLinks = [];
1262
1259
  if (documentGroupMapping && documentGroupMapping.length > 0) {
@@ -1264,23 +1261,12 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
1264
1261
  if (documentGroup.isShow === false || documentGroup.excludeRelatedContents) {
1265
1262
  return null;
1266
1263
  }
1267
-
1268
- var doc_url = cpModificationRequired ? getDocumentGroupUrl(documentGroup) : documentGroup.ancestor ? documentGroup.parent && !documentGroup.path.includes('/') ? '/' + documentGroup.ancestor + '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.ancestor + '/' + documentGroup.path : documentGroup.parent ? !documentGroup.path.includes('/') ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path : '/' + documentGroup.path;
1269
- var href = '' + doc_url;
1270
- relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{ label: documentGroup.name, href: href }]);
1271
- // if (documentGroup.parent) {
1272
- // relatedLinks = [
1273
- // ...relatedLinks,
1274
- // {
1275
- // label: documentGroup.name,
1276
- // href: cpModificationRequired
1277
- // ? getDocumentGroupUrl(documentGroup)
1278
- // : documentGroup.parent.identifier && documentGroup.parent.identifier.current && !documentGroup.path.includes('/')
1279
- // ? `/${documentGroup.parent.identifier.current}/${documentGroup.path}`
1280
- // : `/${documentGroup.path}`
1281
- // }
1282
- // ]
1283
- // }
1264
+ if (documentGroup.parent) {
1265
+ relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{
1266
+ label: documentGroup.name,
1267
+ href: cpModificationRequired ? getDocumentGroupUrl(documentGroup) : documentGroup.parent.identifier && documentGroup.parent.identifier.current && !documentGroup.path.includes('/') ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path
1268
+ }]);
1269
+ }
1284
1270
  });
1285
1271
  }
1286
1272
  if (content_placement && content_placement.length > 0) {
@@ -1290,11 +1276,8 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
1290
1276
  if (cp.excludeRelatedContents) {
1291
1277
  return null;
1292
1278
  }
1293
-
1294
- cpModificationRequired ? getContentPlacementUrl(cp) : cp.ancestor ? cp.parent && !cp.path.includes('/') ? cp.ancestor + '/' + cp.parent + '/' + cp.path : cp.ancestor + '/' + cp.path : cp.parent ? !cp.path.includes('/') ? cp.parent + '/' + cp.path : '' + cp.path : '' + cp.path;
1295
- var cp_url1 = cpModificationRequired ? getContentPlacementUrl(cp) : cp.ancestor ? cp.parent && !cp.path.includes('/') ? cp.ancestor + '/' + cp.parent + '/' + cp.path : !cp.path.includes(cp.ancestor) ? cp.ancestor + '/' + cp.path : '' + cp.path : cp.parent ? !cp.path.includes('/') ? cp.parent + '/' + cp.path : '' + cp.path : '' + cp.path;
1296
- console.log("++++++++++++++++++++++cp url+++++++++++", cp_url1);
1297
- var href = '/' + cp_url1;
1279
+ var cp_url = cpModificationRequired ? getContentPlacementUrl(cp) : cp.path;
1280
+ var href = '/' + cp_url;
1298
1281
  relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{ label: cp.name, href: href }]);
1299
1282
  });
1300
1283
  }
@@ -2390,8 +2373,6 @@ var View = function View(props) {
2390
2373
  var title = _props$article2.title,
2391
2374
  seriesShareOptions = _props$article2.seriesShareOptions;
2392
2375
 
2393
- console.log(props);
2394
-
2395
2376
  var _useState = useState(0),
2396
2377
  _useState2 = _slicedToArray(_useState, 2),
2397
2378
  currentPage = _useState2[0],
@@ -1,5 +1,5 @@
1
1
  import 'react';
2
- export { g as default } from './index-1d1bbc8c.js';
2
+ export { g as default } from './index-3069d37b.js';
3
3
  import './BlockContent-1e73bd2c.js';
4
4
  import './entities-6d9154b4.js';
5
5
  import './slicedToArray-72ed566b.js';
@@ -8913,11 +8913,17 @@ var Poll$1 = function Poll(_ref) {
8913
8913
  showBorders = _useState6[0],
8914
8914
  setShowBorders = _useState6[1];
8915
8915
 
8916
+ var _useState7 = useState(false),
8917
+ _useState8 = _slicedToArray(_useState7, 2),
8918
+ dateChecked = _useState8[0],
8919
+ setDateChecked = _useState8[1];
8920
+
8916
8921
  var choices = node.choices,
8917
8922
  question = node.question,
8918
8923
  response = node.response,
8919
8924
  _node$showResults = node.showResults,
8920
- showResults = _node$showResults === undefined ? '' : _node$showResults;
8925
+ showResults = _node$showResults === undefined ? '' : _node$showResults,
8926
+ resultsDate = node.resultsDate;
8921
8927
 
8922
8928
  var inputRef = useRef([]);
8923
8929
 
@@ -8925,6 +8931,15 @@ var Poll$1 = function Poll(_ref) {
8925
8931
  e.preventDefault();
8926
8932
  onVote(node._key, selectedChoice);
8927
8933
  };
8934
+ useEffect(function () {
8935
+ var dateForResults = new Date(resultsDate);
8936
+ var today = new Date();
8937
+ if (today.getTime() >= dateForResults.getTime()) {
8938
+ setShowAnswer(true);
8939
+ setDateChecked(true);
8940
+ }
8941
+ }, [resultsDate]);
8942
+
8928
8943
  useEffect(function () {
8929
8944
  if (showResults) {
8930
8945
  setShowAnswer(true);
@@ -8963,44 +8978,10 @@ var Poll$1 = function Poll(_ref) {
8963
8978
  }
8964
8979
  };
8965
8980
 
8966
- return React__default.createElement(
8967
- 'div',
8968
- { className: 'pollHolder mb-3' },
8969
- question && React__default.createElement(
8970
- 'p',
8971
- { className: 'font-weight-bold' },
8972
- question
8973
- ),
8974
- !showAnswer && choices && choices.length > 0 && React__default.createElement(
8975
- 'form',
8976
- { className: 'formPoll', onSubmit: function onSubmit(e) {
8977
- return onSubmitPoll(e);
8978
- } },
8979
- choices && choices.map(function (choice, index) {
8980
- return React__default.createElement(
8981
- 'div',
8982
- { key: choice._key, 'data-index': index, onClick: function onClick(e) {
8983
- return userChoiceSelection(e);
8984
- } },
8985
- React__default.createElement(
8986
- 'label',
8987
- { className: 'pl-2' },
8988
- React__default.createElement('input', { ref: function ref(el) {
8989
- return inputRef.current[index] = el;
8990
- }, type: 'radio', id: 'male', name: choice._type, value: choice._key }),
8991
- ' ' + choice.choiceText
8992
- )
8993
- );
8994
- }),
8995
- React__default.createElement(
8996
- Button$1,
8997
- { disabled: !selectedChoice, style: { width: '100%', borderRadius: '5px', fontWeight: 'bold ' }, className: 'mt-3', type: 'submit' },
8998
- 'Vote'
8999
- )
9000
- ),
9001
- showAnswer && React__default.createElement(
8981
+ var Results = function Results() {
8982
+ return React__default.createElement(
9002
8983
  'div',
9003
- { className: 'progress-container mb-3' },
8984
+ null,
9004
8985
  showAnswer && choices && choices.length > 0 && choices.map(function (choice) {
9005
8986
  var percentage = choicesTotalCount && choicesTotalCount > 0 ? choice.choiceCount ? Math.floor(choice.choiceCount * 100 / choicesTotalCount) : 0 : 0;
9006
8987
  return React__default.createElement(
@@ -9008,23 +8989,32 @@ var Poll$1 = function Poll(_ref) {
9008
8989
  {
9009
8990
  key: choice._key,
9010
8991
  style: { border: showBorders ? choice.choiceAnswer === true ? '2px solid limegreen' : checkChoice(choice._key) ? '2px solid red' : '' : '' },
9011
- className: 'mb-3' },
8992
+ className: 'mb-3'
8993
+ },
9012
8994
  React__default.createElement(
9013
8995
  'div',
9014
8996
  { className: 'correct-answer' },
9015
- React__default.createElement(ProgressBar, { now: percentage }),
9016
8997
  React__default.createElement(
9017
8998
  'div',
9018
- null,
9019
- choice.choiceText
9020
- ),
9021
- React__default.createElement(
9022
- 'div',
9023
- { className: 'float-right' },
9024
- percentage,
9025
- '% (',
9026
- choice.choiceCount ? choice.choiceCount : 0,
9027
- ' Votes)'
8999
+ { className: 'relative w-full h-6 bg-gray-600/50 mx-auto rounded-lg overflow-hidden border border-gray-300' },
9000
+ React__default.createElement('div', { style: { width: percentage + '%' }, className: 'top-0 absolute h-full bg-primary relative' }),
9001
+ React__default.createElement(
9002
+ 'div',
9003
+ { className: 'bottom-0 absolute h-full m-auto font-bold text-sm align-center flex justify-between w-full' },
9004
+ React__default.createElement(
9005
+ 'div',
9006
+ { className: 'text-white pl-2 max-w-[75%]' },
9007
+ choice.choiceText
9008
+ ),
9009
+ React__default.createElement(
9010
+ 'div',
9011
+ { className: 'pr-4 text-white' },
9012
+ percentage,
9013
+ '% (',
9014
+ choice.choiceCount ? choice.choiceCount : 0,
9015
+ ' Votes)'
9016
+ )
9017
+ )
9028
9018
  )
9029
9019
  )
9030
9020
  );
@@ -9035,6 +9025,56 @@ var Poll$1 = function Poll(_ref) {
9035
9025
  'Total Votes: ',
9036
9026
  choicesTotalCount
9037
9027
  )
9028
+ );
9029
+ };
9030
+
9031
+ return React__default.createElement(
9032
+ 'div',
9033
+ { className: 'pollHolder mb-3' },
9034
+ !dateChecked && React__default.createElement(
9035
+ 'div',
9036
+ null,
9037
+ question && React__default.createElement(
9038
+ 'p',
9039
+ { className: 'font-weight-bold' },
9040
+ question
9041
+ ),
9042
+ !showAnswer && choices && choices.length > 0 && React__default.createElement(
9043
+ 'form',
9044
+ { className: 'formPoll', onSubmit: function onSubmit(e) {
9045
+ return onSubmitPoll(e);
9046
+ } },
9047
+ choices && choices.map(function (choice, index) {
9048
+ return React__default.createElement(
9049
+ 'div',
9050
+ { key: choice._key, 'data-index': index, onClick: function onClick(e) {
9051
+ return userChoiceSelection(e);
9052
+ } },
9053
+ React__default.createElement(
9054
+ 'label',
9055
+ { className: 'pl-2' },
9056
+ React__default.createElement('input', { ref: function ref(el) {
9057
+ return inputRef.current[index] = el;
9058
+ }, type: 'radio', id: 'male', name: choice._type, value: choice._key }),
9059
+ ' ' + choice.choiceText
9060
+ )
9061
+ );
9062
+ }),
9063
+ React__default.createElement(
9064
+ Button$1,
9065
+ { disabled: !selectedChoice, style: { width: '100%', borderRadius: '5px', fontWeight: 'bold ' }, className: 'mt-3', type: 'submit' },
9066
+ 'Vote'
9067
+ )
9068
+ )
9069
+ ),
9070
+ showAnswer && dateChecked ? React__default.createElement(
9071
+ 'div',
9072
+ { className: 'progress-container mb-3' },
9073
+ React__default.createElement(Results, null)
9074
+ ) : React__default.createElement(
9075
+ 'div',
9076
+ null,
9077
+ !resultsDate && React__default.createElement(Results, null)
9038
9078
  ),
9039
9079
  showAnswer && response && React__default.createElement(BlockContent, { blocks: response, serializers: getSerializers }),
9040
9080
  React__default.createElement(
package/dist/esm/index.js CHANGED
@@ -88,7 +88,7 @@ export { default as VerticalHero } from './VerticalHero.js';
88
88
  export { default as YahooHero } from './YahooHero.js';
89
89
  export { default as GridHero } from './GridHero.js';
90
90
  export { default as ConferenceArticleCard } from './ConferenceArticleCard.js';
91
- export { g as getSerializers } from './index-1d1bbc8c.js';
91
+ export { g as getSerializers } from './index-3069d37b.js';
92
92
  export { default as Beam } from './Beam.js';
93
93
  export { default as Segment } from './Segment.js';
94
94
  export { default as KMTracker } from './KMTracker.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.1082-c5",
3
+ "version": "1.0.1082-poll-test-1",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",