@mjhls/mjh-framework 1.0.1070 → 1.0.1072
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 +1 -1
- package/dist/cjs/AlgoliaSearch.js +73 -105
- package/dist/cjs/ArticleProgramLandingPage.js +1 -1
- package/dist/cjs/AuthWrapper.js +19 -89
- package/dist/cjs/ExternalResources.js +1 -1
- package/dist/cjs/HorizontalArticleListing.js +1 -1
- package/dist/cjs/{ImageSlider-d65bc9c8.js → ImageSlider-984a697b.js} +116 -156
- package/dist/cjs/IssueLanding.js +1 -1
- package/dist/cjs/{MediaSeriesCard-2e65fe95.js → MediaSeriesCard-19aab049.js} +1 -1
- package/dist/cjs/MediaSeriesLanding.js +4 -4
- package/dist/cjs/MediaSeriesLandingPaginated.js +4 -4
- package/dist/cjs/PartnerDetailListing.js +3 -2
- package/dist/cjs/PartnerDetailListingPaginated.js +3 -2
- package/dist/cjs/PodcastsLanding.js +2 -2
- package/dist/cjs/TaxonomyDescription.js +1 -1
- package/dist/cjs/{Tooltip-02a841b5.js → Tooltip-96fe6ef6.js} +34 -86
- package/dist/cjs/VideoProgramLandingPage.js +1 -1
- package/dist/cjs/View.js +1 -1
- package/dist/cjs/defineProperty-e0fb52c5.js +73 -0
- package/dist/cjs/getSerializers.js +1 -1
- package/dist/cjs/{index-9ec837cc.js → index-50be6759.js} +25 -9
- package/dist/cjs/{index-4e9a219e.js → index-a075129d.js} +162 -112
- package/dist/cjs/index.js +5 -3
- package/dist/cjs/typeof-1358762e.js +33 -0
- package/dist/esm/AlgoliaSearch.js +72 -104
- package/dist/esm/ArticleProgramLandingPage.js +1 -1
- package/dist/esm/AuthWrapper.js +16 -86
- package/dist/esm/ExternalResources.js +1 -1
- package/dist/esm/HorizontalArticleListing.js +1 -1
- package/dist/esm/{ImageSlider-da225417.js → ImageSlider-497e9c88.js} +117 -157
- package/dist/esm/IssueLanding.js +1 -1
- package/dist/esm/{MediaSeriesCard-27cce8ea.js → MediaSeriesCard-6d08d387.js} +1 -1
- package/dist/esm/MediaSeriesLanding.js +4 -4
- package/dist/esm/MediaSeriesLandingPaginated.js +4 -4
- package/dist/esm/PartnerDetailListing.js +3 -2
- package/dist/esm/PartnerDetailListingPaginated.js +3 -2
- package/dist/esm/PodcastsLanding.js +2 -2
- package/dist/esm/TaxonomyDescription.js +1 -1
- package/dist/esm/{Tooltip-7a093cd4.js → Tooltip-bc98d17e.js} +192 -244
- package/dist/esm/VideoProgramLandingPage.js +1 -1
- package/dist/esm/View.js +1 -1
- package/dist/esm/defineProperty-23a8f8cd.js +68 -0
- package/dist/esm/getSerializers.js +1 -1
- package/dist/esm/{index-1fd45cc5.js → index-6be9a1c4.js} +163 -113
- package/dist/esm/{index-0ce54f8a.js → index-98ca9cec.js} +25 -10
- package/dist/esm/index.js +5 -3
- package/dist/esm/typeof-2f07d0e8.js +30 -0
- package/package.json +1 -1
|
@@ -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-
|
|
8
|
+
import { g as getSerializers } from './index-6be9a1c4.js';
|
|
9
9
|
import VideoSeriesListing from './VideoSeriesListing.js';
|
|
10
10
|
import './_commonjsHelpers-0c4b6f40.js';
|
|
11
11
|
import './core.get-iterator-method-ea258bb1.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-
|
|
18
|
+
import { r as renderAuthor, g as getSerializers } from './index-6be9a1c4.js';
|
|
19
19
|
import DFPAdSlot from './AdSlot.js';
|
|
20
20
|
import { S as SeriesSlider } from './SeriesSlider-a6b1d617.js';
|
|
21
21
|
import { a as getContentPlacementUrl, g as getTargeting } from './getTargeting-5a281334.js';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
|
|
2
|
+
|
|
3
|
+
var asyncToGenerator = createCommonjsModule(function (module) {
|
|
4
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
5
|
+
try {
|
|
6
|
+
var info = gen[key](arg);
|
|
7
|
+
var value = info.value;
|
|
8
|
+
} catch (error) {
|
|
9
|
+
reject(error);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (info.done) {
|
|
14
|
+
resolve(value);
|
|
15
|
+
} else {
|
|
16
|
+
Promise.resolve(value).then(_next, _throw);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function _asyncToGenerator(fn) {
|
|
21
|
+
return function () {
|
|
22
|
+
var self = this,
|
|
23
|
+
args = arguments;
|
|
24
|
+
return new Promise(function (resolve, reject) {
|
|
25
|
+
var gen = fn.apply(self, args);
|
|
26
|
+
|
|
27
|
+
function _next(value) {
|
|
28
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function _throw(err) {
|
|
32
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
_next(undefined);
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = _asyncToGenerator;
|
|
41
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
var _asyncToGenerator = unwrapExports(asyncToGenerator);
|
|
45
|
+
|
|
46
|
+
var defineProperty = createCommonjsModule(function (module) {
|
|
47
|
+
function _defineProperty(obj, key, value) {
|
|
48
|
+
if (key in obj) {
|
|
49
|
+
Object.defineProperty(obj, key, {
|
|
50
|
+
value: value,
|
|
51
|
+
enumerable: true,
|
|
52
|
+
configurable: true,
|
|
53
|
+
writable: true
|
|
54
|
+
});
|
|
55
|
+
} else {
|
|
56
|
+
obj[key] = value;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return obj;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
module.exports = _defineProperty;
|
|
63
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
var _defineProperty = unwrapExports(defineProperty);
|
|
67
|
+
|
|
68
|
+
export { _asyncToGenerator as _, _defineProperty as a, asyncToGenerator as b, defineProperty as d };
|
|
@@ -28,7 +28,7 @@ import ReactGA from 'react-ga';
|
|
|
28
28
|
import GroupDeck from './GroupDeck.js';
|
|
29
29
|
import { m as moment } from './moment-bc12cb97.js';
|
|
30
30
|
import SocialShare from './SocialShare.js';
|
|
31
|
-
import {
|
|
31
|
+
import { _ as _toConsumableArray, a as _Array$from } from './toConsumableArray-f7074d7c.js';
|
|
32
32
|
import Pagination from 'react-bootstrap/Pagination';
|
|
33
33
|
import { h as html_decode_1 } from './entities-6d9154b4.js';
|
|
34
34
|
import DFPAdSlot from './AdSlot.js';
|
|
@@ -8689,21 +8689,27 @@ var Poll$1 = function Poll(_ref) {
|
|
|
8689
8689
|
showAnswer = _useState4[0],
|
|
8690
8690
|
setShowAnswer = _useState4[1];
|
|
8691
8691
|
|
|
8692
|
+
var _useState5 = useState(false),
|
|
8693
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
8694
|
+
showBorders = _useState6[0],
|
|
8695
|
+
setShowBorders = _useState6[1];
|
|
8696
|
+
|
|
8692
8697
|
var choices = node.choices,
|
|
8693
8698
|
question = node.question,
|
|
8694
8699
|
response = node.response,
|
|
8695
8700
|
_node$showResults = node.showResults,
|
|
8696
|
-
showResults = _node$showResults === undefined ?
|
|
8701
|
+
showResults = _node$showResults === undefined ? '' : _node$showResults;
|
|
8697
8702
|
|
|
8703
|
+
var inputRef = useRef([]);
|
|
8698
8704
|
|
|
8699
8705
|
var onSubmitPoll = function onSubmitPoll(e, setShowAnswer) {
|
|
8700
8706
|
e.preventDefault();
|
|
8701
8707
|
onVote(node._key, selectedChoice);
|
|
8702
|
-
//setShowAnswer(true)
|
|
8703
8708
|
};
|
|
8704
8709
|
useEffect(function () {
|
|
8705
8710
|
if (showResults) {
|
|
8706
|
-
setShowAnswer(
|
|
8711
|
+
setShowAnswer(true);
|
|
8712
|
+
setSelectedChoice(showResults);
|
|
8707
8713
|
}
|
|
8708
8714
|
}, [showResults]);
|
|
8709
8715
|
|
|
@@ -8715,9 +8721,32 @@ var Poll$1 = function Poll(_ref) {
|
|
|
8715
8721
|
return acc;
|
|
8716
8722
|
}
|
|
8717
8723
|
}, 0);
|
|
8724
|
+
|
|
8725
|
+
useEffect(function () {
|
|
8726
|
+
var tempArray = choices.filter(function (choice) {
|
|
8727
|
+
if (choice.hasOwnProperty('choiceAnswer')) {
|
|
8728
|
+
return choice;
|
|
8729
|
+
}
|
|
8730
|
+
});
|
|
8731
|
+
setShowBorders(tempArray.length > 0);
|
|
8732
|
+
}, [choices]);
|
|
8733
|
+
|
|
8734
|
+
function checkChoice(key) {
|
|
8735
|
+
return key === selectedChoice;
|
|
8736
|
+
}
|
|
8737
|
+
|
|
8738
|
+
var userChoiceSelection = function userChoiceSelection(e) {
|
|
8739
|
+
if (inputRef.current[e.currentTarget.dataset['index']].checked) {
|
|
8740
|
+
inputRef.current[e.currentTarget.dataset['index']].checked = false;
|
|
8741
|
+
} else {
|
|
8742
|
+
inputRef.current[e.currentTarget.dataset['index']].checked = true;
|
|
8743
|
+
setSelectedChoice(inputRef.current[e.currentTarget.dataset['index']].value);
|
|
8744
|
+
}
|
|
8745
|
+
};
|
|
8746
|
+
|
|
8718
8747
|
return React__default.createElement(
|
|
8719
|
-
|
|
8720
|
-
|
|
8748
|
+
'div',
|
|
8749
|
+
{ className: 'pollHolder mb-3' },
|
|
8721
8750
|
question && React__default.createElement(
|
|
8722
8751
|
'p',
|
|
8723
8752
|
{ className: 'font-weight-bold' },
|
|
@@ -8725,78 +8754,74 @@ var Poll$1 = function Poll(_ref) {
|
|
|
8725
8754
|
),
|
|
8726
8755
|
!showAnswer && choices && choices.length > 0 && React__default.createElement(
|
|
8727
8756
|
'form',
|
|
8728
|
-
{ onSubmit: function onSubmit(e) {
|
|
8757
|
+
{ className: 'formPoll', onSubmit: function onSubmit(e) {
|
|
8729
8758
|
return onSubmitPoll(e);
|
|
8730
8759
|
} },
|
|
8731
|
-
choices && choices.map(function (choice) {
|
|
8760
|
+
choices && choices.map(function (choice, index) {
|
|
8732
8761
|
return React__default.createElement(
|
|
8733
8762
|
'div',
|
|
8734
|
-
{ key: choice._key
|
|
8763
|
+
{ key: choice._key, 'data-index': index, onClick: function onClick(e) {
|
|
8764
|
+
return userChoiceSelection(e);
|
|
8765
|
+
} },
|
|
8735
8766
|
React__default.createElement(
|
|
8736
8767
|
'label',
|
|
8737
8768
|
{ className: 'pl-2' },
|
|
8738
|
-
React__default.createElement('input', {
|
|
8739
|
-
return
|
|
8740
|
-
} }),
|
|
8769
|
+
React__default.createElement('input', { ref: function ref(el) {
|
|
8770
|
+
return inputRef.current[index] = el;
|
|
8771
|
+
}, type: 'radio', id: 'male', name: choice._type, value: choice._key }),
|
|
8741
8772
|
' ' + choice.choiceText
|
|
8742
8773
|
)
|
|
8743
8774
|
);
|
|
8744
8775
|
}),
|
|
8745
8776
|
React__default.createElement(
|
|
8746
8777
|
Button$1,
|
|
8747
|
-
{ disabled: !selectedChoice, type: 'submit' },
|
|
8778
|
+
{ disabled: !selectedChoice, style: { width: '100%', borderRadius: '5px', fontWeight: 'bold ' }, className: 'mt-3', type: 'submit' },
|
|
8748
8779
|
'Vote'
|
|
8749
8780
|
)
|
|
8750
8781
|
),
|
|
8751
|
-
React__default.createElement(
|
|
8782
|
+
showAnswer && React__default.createElement(
|
|
8752
8783
|
'div',
|
|
8753
|
-
{ className: 'progress-container' },
|
|
8784
|
+
{ className: 'progress-container mb-3' },
|
|
8754
8785
|
showAnswer && choices && choices.length > 0 && choices.map(function (choice) {
|
|
8755
8786
|
var percentage = choicesTotalCount && choicesTotalCount > 0 ? choice.choiceCount ? Math.floor(choice.choiceCount * 100 / choicesTotalCount) : 0 : 0;
|
|
8756
8787
|
return React__default.createElement(
|
|
8757
8788
|
'div',
|
|
8758
|
-
{
|
|
8789
|
+
{
|
|
8790
|
+
key: choice._key,
|
|
8791
|
+
style: { border: showBorders ? choice.choiceAnswer === true ? '2px solid limegreen' : checkChoice(choice._key) ? '2px solid red' : '' : '' },
|
|
8792
|
+
className: 'mb-3' },
|
|
8759
8793
|
React__default.createElement(
|
|
8760
8794
|
'div',
|
|
8761
8795
|
{ className: 'correct-answer' },
|
|
8796
|
+
React__default.createElement(ProgressBar, { now: percentage }),
|
|
8762
8797
|
React__default.createElement(
|
|
8763
8798
|
'div',
|
|
8764
8799
|
null,
|
|
8765
8800
|
choice.choiceText
|
|
8766
8801
|
),
|
|
8767
|
-
|
|
8802
|
+
React__default.createElement(
|
|
8768
8803
|
'div',
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
)
|
|
8804
|
+
{ className: 'float-right' },
|
|
8805
|
+
percentage,
|
|
8806
|
+
'% (',
|
|
8807
|
+
choice.choiceCount ? choice.choiceCount : 0,
|
|
8808
|
+
' Votes)'
|
|
8775
8809
|
)
|
|
8776
|
-
),
|
|
8777
|
-
React__default.createElement(ProgressBar, { now: percentage }),
|
|
8778
|
-
React__default.createElement(
|
|
8779
|
-
'span',
|
|
8780
|
-
{ className: 'float-right' },
|
|
8781
|
-
percentage,
|
|
8782
|
-
'% (',
|
|
8783
|
-
choice.choiceCount ? choice.choiceCount : 0,
|
|
8784
|
-
' Votes)'
|
|
8785
8810
|
)
|
|
8786
8811
|
);
|
|
8787
|
-
})
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8812
|
+
}),
|
|
8813
|
+
showAnswer && React__default.createElement(
|
|
8814
|
+
'h4',
|
|
8815
|
+
{ className: 'text-center small p-3' },
|
|
8816
|
+
'Total Votes: ',
|
|
8817
|
+
choicesTotalCount
|
|
8818
|
+
)
|
|
8794
8819
|
),
|
|
8795
8820
|
showAnswer && response && React__default.createElement(BlockContent, { blocks: response, serializers: getSerializers }),
|
|
8796
8821
|
React__default.createElement(
|
|
8797
8822
|
'style',
|
|
8798
8823
|
{ jsx: 'true' },
|
|
8799
|
-
'\n .correct-answer {\n display: flex;\n justify-content: space-between;\n }\n .
|
|
8824
|
+
'\n .formPoll > div {\n box-shadow: 0 0 5px 2px #9b9b9b6b;\n border-radius: 5px;\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0.5rem 0;\n text-align: left;\n margin: 0.5rem 0;\n cursor: pointer;\n }\n .formPoll > div:hover {\n background-color: #cbcbcb;\n }\n .formPoll > div > label {\n pointer-events: none;\n margin-bottom: 0;\n }\n .pollHolder {\n background-color: #eaeaea;\n padding: 1rem;\n border-radius: 5px;\n box-shadow: 0 0 5px 2px #9b9b9b6b;\n clear: both;\n }\n .progress-container > div {\n position: relative;\n font-weight: bold;\n border-radius: 5px;\n box-shadow: 0 0 5px 2px #9b9b9b6b;\n }\n .correct-answer {\n display: flex;\n justify-content: space-between;\n flex-direction: row;\n align-items: center;\n background-color: darkgrey;\n border-radius: 5px;\n }\n .float-right {\n z-index: 2;\n padding-right: 1rem;\n color: #fff;\n }\n .progress {\n align-self: flex-start;\n display: contents;\n border-radius: 5px;\n }\n .progress-bar {\n width: 33%;\n height: 100%;\n position: absolute;\n border-radius: 5px 0 0 5px;\n background-color: var(--primary);\n }\n .correct-answer > div:nth-child(2) {\n z-index: 1;\n color: white;\n padding-left: 0.5rem;\n max-width: 75%;\n }\n '
|
|
8800
8825
|
)
|
|
8801
8826
|
);
|
|
8802
8827
|
};
|
|
@@ -8810,62 +8835,74 @@ var Poll = function Poll(_ref) {
|
|
|
8810
8835
|
_ref.showVotes;
|
|
8811
8836
|
var getSerializers = _ref.getSerializers;
|
|
8812
8837
|
|
|
8813
|
-
var _useState = useState(
|
|
8838
|
+
var _useState = useState([]),
|
|
8814
8839
|
_useState2 = _slicedToArray(_useState, 2),
|
|
8815
8840
|
selectedChoice = _useState2[0],
|
|
8816
8841
|
setSelectedChoice = _useState2[1];
|
|
8817
8842
|
|
|
8818
|
-
var _useState3 = useState(
|
|
8843
|
+
var _useState3 = useState(true),
|
|
8819
8844
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
8820
|
-
|
|
8821
|
-
|
|
8845
|
+
disableVote = _useState4[0],
|
|
8846
|
+
setDisableVote = _useState4[1];
|
|
8847
|
+
|
|
8848
|
+
var _useState5 = useState(false),
|
|
8849
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
8850
|
+
showAnswer = _useState6[0],
|
|
8851
|
+
setShowAnswer = _useState6[1];
|
|
8852
|
+
|
|
8853
|
+
var _useState7 = useState(false),
|
|
8854
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
8855
|
+
showBorders = _useState8[0],
|
|
8856
|
+
setShowBorders = _useState8[1];
|
|
8822
8857
|
|
|
8823
8858
|
var choices = node.choices,
|
|
8824
8859
|
question = node.question,
|
|
8825
8860
|
response = node.response,
|
|
8826
8861
|
_node$showResults = node.showResults,
|
|
8827
|
-
showResults = _node$showResults === undefined ?
|
|
8862
|
+
showResults = _node$showResults === undefined ? '' : _node$showResults;
|
|
8828
8863
|
|
|
8864
|
+
var inputRef = useRef([]);
|
|
8829
8865
|
|
|
8830
|
-
var onSubmitPoll = function onSubmitPoll(e
|
|
8866
|
+
var onSubmitPoll = function onSubmitPoll(e) {
|
|
8831
8867
|
e.preventDefault();
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
var input = _step.value;
|
|
8840
|
-
|
|
8841
|
-
if (input.nodeName === 'INPUT' && input.checked) {
|
|
8842
|
-
selections.push(input.value);
|
|
8843
|
-
}
|
|
8844
|
-
}
|
|
8845
|
-
} catch (err) {
|
|
8846
|
-
_didIteratorError = true;
|
|
8847
|
-
_iteratorError = err;
|
|
8848
|
-
} finally {
|
|
8849
|
-
try {
|
|
8850
|
-
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
8851
|
-
_iterator.return();
|
|
8852
|
-
}
|
|
8853
|
-
} finally {
|
|
8854
|
-
if (_didIteratorError) {
|
|
8855
|
-
throw _iteratorError;
|
|
8856
|
-
}
|
|
8857
|
-
}
|
|
8858
|
-
}
|
|
8859
|
-
|
|
8860
|
-
onVote(node._key, selections.join(','));
|
|
8861
|
-
//setShowAnswer(true)
|
|
8868
|
+
// const selections = []
|
|
8869
|
+
// for (let input of Object.values(e.currentTarget)) {
|
|
8870
|
+
// if (input.nodeName === 'INPUT' && input.checked) {
|
|
8871
|
+
// selections.push(input.value)
|
|
8872
|
+
// }
|
|
8873
|
+
// }
|
|
8874
|
+
onVote(node._key, selectedChoice.toString());
|
|
8862
8875
|
};
|
|
8863
8876
|
useEffect(function () {
|
|
8864
8877
|
if (showResults) {
|
|
8865
|
-
setShowAnswer(
|
|
8878
|
+
setShowAnswer(true);
|
|
8879
|
+
setSelectedChoice(showResults.split(','));
|
|
8866
8880
|
}
|
|
8867
8881
|
}, [showResults]);
|
|
8868
8882
|
|
|
8883
|
+
useEffect(function () {
|
|
8884
|
+
if (selectedChoice.length > 0) {
|
|
8885
|
+
setDisableVote(false);
|
|
8886
|
+
} else {
|
|
8887
|
+
setDisableVote(true);
|
|
8888
|
+
}
|
|
8889
|
+
}, [selectedChoice]);
|
|
8890
|
+
|
|
8891
|
+
useEffect(function () {
|
|
8892
|
+
var tempArray = choices.filter(function (choice) {
|
|
8893
|
+
if (choice.hasOwnProperty('choiceAnswer')) {
|
|
8894
|
+
return choice;
|
|
8895
|
+
}
|
|
8896
|
+
});
|
|
8897
|
+
setShowBorders(tempArray.length > 0);
|
|
8898
|
+
}, [choices]);
|
|
8899
|
+
|
|
8900
|
+
function checkChoice(key) {
|
|
8901
|
+
return selectedChoice.find(function (value) {
|
|
8902
|
+
return value === key;
|
|
8903
|
+
});
|
|
8904
|
+
}
|
|
8905
|
+
|
|
8869
8906
|
var choicesTotalCount = choices && choices.reduce(function (acc, choice) {
|
|
8870
8907
|
if (choice.choiceCount) {
|
|
8871
8908
|
acc = acc + parseInt(choice.choiceCount);
|
|
@@ -8874,9 +8911,26 @@ var Poll = function Poll(_ref) {
|
|
|
8874
8911
|
return acc;
|
|
8875
8912
|
}
|
|
8876
8913
|
}, 0);
|
|
8914
|
+
|
|
8915
|
+
var userChoiceSelection = function userChoiceSelection(e) {
|
|
8916
|
+
if (inputRef.current[e.currentTarget.dataset['index']].checked) {
|
|
8917
|
+
inputRef.current[e.currentTarget.dataset['index']].checked = false;
|
|
8918
|
+
var updateChoices = selectedChoice.filter(function (choice) {
|
|
8919
|
+
if (inputRef.current[e.currentTarget.dataset['index']].value !== choice) {
|
|
8920
|
+
return choice;
|
|
8921
|
+
}
|
|
8922
|
+
});
|
|
8923
|
+
setSelectedChoice(updateChoices);
|
|
8924
|
+
} else {
|
|
8925
|
+
inputRef.current[e.currentTarget.dataset['index']].checked = true;
|
|
8926
|
+
|
|
8927
|
+
setSelectedChoice([inputRef.current[e.currentTarget.dataset['index']].value].concat(_toConsumableArray(selectedChoice)));
|
|
8928
|
+
}
|
|
8929
|
+
};
|
|
8930
|
+
|
|
8877
8931
|
return React__default.createElement(
|
|
8878
|
-
|
|
8879
|
-
|
|
8932
|
+
'div',
|
|
8933
|
+
{ className: 'pollHolder mb-3' },
|
|
8880
8934
|
question && React__default.createElement(
|
|
8881
8935
|
'p',
|
|
8882
8936
|
{ className: 'font-weight-bold' },
|
|
@@ -8884,78 +8938,74 @@ var Poll = function Poll(_ref) {
|
|
|
8884
8938
|
),
|
|
8885
8939
|
!showAnswer && choices && choices.length > 0 && React__default.createElement(
|
|
8886
8940
|
'form',
|
|
8887
|
-
{ onSubmit: function onSubmit(e) {
|
|
8941
|
+
{ className: 'multiChoicePoll', onSubmit: function onSubmit(e) {
|
|
8888
8942
|
return onSubmitPoll(e);
|
|
8889
8943
|
} },
|
|
8890
|
-
choices && choices.map(function (choice) {
|
|
8944
|
+
choices && choices.map(function (choice, index) {
|
|
8891
8945
|
return React__default.createElement(
|
|
8892
8946
|
'div',
|
|
8893
|
-
{ key: choice._key
|
|
8947
|
+
{ key: choice._key, 'data-index': index, onClick: function onClick(e) {
|
|
8948
|
+
return userChoiceSelection(e);
|
|
8949
|
+
} },
|
|
8894
8950
|
React__default.createElement(
|
|
8895
8951
|
'label',
|
|
8896
8952
|
{ className: 'pl-2' },
|
|
8897
|
-
React__default.createElement('input', {
|
|
8898
|
-
return
|
|
8899
|
-
} }),
|
|
8953
|
+
React__default.createElement('input', { ref: function ref(el) {
|
|
8954
|
+
return inputRef.current[index] = el;
|
|
8955
|
+
}, type: 'checkbox', id: 'male', name: choice._type, value: choice._key }),
|
|
8900
8956
|
' ' + choice.choiceText
|
|
8901
8957
|
)
|
|
8902
8958
|
);
|
|
8903
8959
|
}),
|
|
8904
8960
|
React__default.createElement(
|
|
8905
8961
|
Button$1,
|
|
8906
|
-
{ disabled:
|
|
8962
|
+
{ disabled: disableVote, style: { width: '100%', borderRadius: '5px', fontWeight: 'bold ' }, className: 'mt-3', type: 'submit' },
|
|
8907
8963
|
'Vote'
|
|
8908
8964
|
)
|
|
8909
8965
|
),
|
|
8910
|
-
React__default.createElement(
|
|
8966
|
+
showAnswer && React__default.createElement(
|
|
8911
8967
|
'div',
|
|
8912
|
-
{ className: 'progress-container' },
|
|
8968
|
+
{ className: 'progress-container mb-3' },
|
|
8913
8969
|
showAnswer && choices && choices.length > 0 && choices.map(function (choice) {
|
|
8914
8970
|
var percentage = choicesTotalCount && choicesTotalCount > 0 ? choice.choiceCount ? Math.floor(choice.choiceCount * 100 / choicesTotalCount) : 0 : 0;
|
|
8915
8971
|
return React__default.createElement(
|
|
8916
8972
|
'div',
|
|
8917
|
-
{
|
|
8973
|
+
{
|
|
8974
|
+
key: choice._key,
|
|
8975
|
+
style: { border: showBorders ? choice.choiceAnswer === true ? '2px solid limegreen' : checkChoice(choice._key) ? '2px solid red' : '' : '' },
|
|
8976
|
+
className: 'mb-3' },
|
|
8918
8977
|
React__default.createElement(
|
|
8919
8978
|
'div',
|
|
8920
8979
|
{ className: 'correct-answer' },
|
|
8980
|
+
React__default.createElement(ProgressBar, { now: percentage }),
|
|
8921
8981
|
React__default.createElement(
|
|
8922
8982
|
'div',
|
|
8923
8983
|
null,
|
|
8924
8984
|
choice.choiceText
|
|
8925
8985
|
),
|
|
8926
|
-
|
|
8986
|
+
React__default.createElement(
|
|
8927
8987
|
'div',
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
|
|
8933
|
-
)
|
|
8988
|
+
{ className: 'float-right' },
|
|
8989
|
+
percentage,
|
|
8990
|
+
'% (',
|
|
8991
|
+
choice.choiceCount ? choice.choiceCount : 0,
|
|
8992
|
+
' Votes)'
|
|
8934
8993
|
)
|
|
8935
|
-
),
|
|
8936
|
-
React__default.createElement(ProgressBar, { now: percentage }),
|
|
8937
|
-
React__default.createElement(
|
|
8938
|
-
'span',
|
|
8939
|
-
{ className: 'float-right' },
|
|
8940
|
-
percentage,
|
|
8941
|
-
'% (',
|
|
8942
|
-
choice.choiceCount ? choice.choiceCount : 0,
|
|
8943
|
-
' Votes)'
|
|
8944
8994
|
)
|
|
8945
8995
|
);
|
|
8946
|
-
})
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8996
|
+
}),
|
|
8997
|
+
showAnswer && React__default.createElement(
|
|
8998
|
+
'h4',
|
|
8999
|
+
{ className: 'text-center small p-3' },
|
|
9000
|
+
'Total Votes: ',
|
|
9001
|
+
choicesTotalCount
|
|
9002
|
+
)
|
|
8953
9003
|
),
|
|
8954
9004
|
showAnswer && response && React__default.createElement(BlockContent, { blocks: response, serializers: getSerializers }),
|
|
8955
9005
|
React__default.createElement(
|
|
8956
9006
|
'style',
|
|
8957
9007
|
{ jsx: 'true' },
|
|
8958
|
-
'\n .
|
|
9008
|
+
'\n .multiChoicePoll > div {\n box-shadow: 0 0 5px 2px #9b9b9b6b;\n border-radius: 5px;\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0.5rem 0;\n text-align: left;\n margin: 0.5rem 0;\n cursor: pointer;\n }\n .multiChoicePoll > div:hover {\n background-color: #cbcbcb;\n }\n .multiChoicePoll > div > label {\n pointer-events: none;\n margin-bottom: 0;\n }\n .pollHolder {\n background-color: #eaeaea;\n padding: 1rem;\n border-radius: 5px;\n box-shadow: 0 0 5px 2px #9b9b9b6b;\n clear: both;\n }\n .progress-container > div {\n position: relative;\n font-weight: bold;\n border-radius: 5px;\n box-shadow: 0 0 5px 2px #9b9b9b6b;\n }\n .correct-answer {\n display: flex;\n justify-content: space-between;\n flex-direction: row;\n align-items: center;\n background-color: darkgrey;\n border-radius: 5px;\n }\n .float-right {\n z-index: 2;\n padding-right: 1rem;\n color: #fff;\n }\n .progress {\n align-self: flex-start;\n display: contents;\n border-radius: 5px;\n }\n .progress-bar {\n width: 33%;\n height: 100%;\n position: absolute;\n border-radius: 5px 0 0 5px;\n background-color: var(--primary);\n }\n .correct-answer > div:nth-child(2) {\n z-index: 1;\n color: white;\n padding-left: 0.5rem;\n max-width: 75%;\n }\n '
|
|
8959
9009
|
)
|
|
8960
9010
|
);
|
|
8961
9011
|
};
|
|
@@ -33,9 +33,18 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
33
33
|
return target;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
function _setPrototypeOf(o, p) {
|
|
37
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
38
|
+
o.__proto__ = p;
|
|
39
|
+
return o;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return _setPrototypeOf(o, p);
|
|
43
|
+
}
|
|
44
|
+
|
|
36
45
|
var classnames = createCommonjsModule(function (module) {
|
|
37
46
|
/*!
|
|
38
|
-
Copyright (c)
|
|
47
|
+
Copyright (c) 2018 Jed Watson.
|
|
39
48
|
Licensed under the MIT License (MIT), see
|
|
40
49
|
http://jedwatson.github.io/classnames
|
|
41
50
|
*/
|
|
@@ -45,7 +54,7 @@ var classnames = createCommonjsModule(function (module) {
|
|
|
45
54
|
|
|
46
55
|
var hasOwn = {}.hasOwnProperty;
|
|
47
56
|
|
|
48
|
-
function classNames
|
|
57
|
+
function classNames() {
|
|
49
58
|
var classes = [];
|
|
50
59
|
|
|
51
60
|
for (var i = 0; i < arguments.length; i++) {
|
|
@@ -56,16 +65,22 @@ var classnames = createCommonjsModule(function (module) {
|
|
|
56
65
|
|
|
57
66
|
if (argType === 'string' || argType === 'number') {
|
|
58
67
|
classes.push(arg);
|
|
59
|
-
} else if (Array.isArray(arg)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
} else if (Array.isArray(arg)) {
|
|
69
|
+
if (arg.length) {
|
|
70
|
+
var inner = classNames.apply(null, arg);
|
|
71
|
+
if (inner) {
|
|
72
|
+
classes.push(inner);
|
|
73
|
+
}
|
|
63
74
|
}
|
|
64
75
|
} else if (argType === 'object') {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
76
|
+
if (arg.toString === Object.prototype.toString) {
|
|
77
|
+
for (var key in arg) {
|
|
78
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
79
|
+
classes.push(key);
|
|
80
|
+
}
|
|
68
81
|
}
|
|
82
|
+
} else {
|
|
83
|
+
classes.push(arg.toString());
|
|
69
84
|
}
|
|
70
85
|
}
|
|
71
86
|
}
|
|
@@ -82,4 +97,4 @@ var classnames = createCommonjsModule(function (module) {
|
|
|
82
97
|
}());
|
|
83
98
|
});
|
|
84
99
|
|
|
85
|
-
export { _objectWithoutPropertiesLoose as _,
|
|
100
|
+
export { _objectWithoutPropertiesLoose as _, _setPrototypeOf as a, _extends as b, classnames as c };
|
package/dist/esm/index.js
CHANGED
|
@@ -87,7 +87,7 @@ export { default as VerticalHero } from './VerticalHero.js';
|
|
|
87
87
|
export { default as YahooHero } from './YahooHero.js';
|
|
88
88
|
export { default as GridHero } from './GridHero.js';
|
|
89
89
|
export { default as ConferenceArticleCard } from './ConferenceArticleCard.js';
|
|
90
|
-
export { g as getSerializers } from './index-
|
|
90
|
+
export { g as getSerializers } from './index-6be9a1c4.js';
|
|
91
91
|
export { default as Beam } from './Beam.js';
|
|
92
92
|
export { default as Segment } from './Segment.js';
|
|
93
93
|
export { default as KMTracker } from './KMTracker.js';
|
|
@@ -153,7 +153,8 @@ import './_object-to-array-b61d5965.js';
|
|
|
153
153
|
import 'react-bootstrap/Spinner';
|
|
154
154
|
import 'react-bootstrap/Form';
|
|
155
155
|
import './js.cookie-6874175c.js';
|
|
156
|
-
import './
|
|
156
|
+
import './typeof-2f07d0e8.js';
|
|
157
|
+
import './index-98ca9cec.js';
|
|
157
158
|
import './ConferenceBanner-8792ebd2.js';
|
|
158
159
|
import 'next/head';
|
|
159
160
|
import '@mjhls/mjh-framework/dist/cjs/urlFor';
|
|
@@ -189,7 +190,8 @@ import './SeriesSlider-a6b1d617.js';
|
|
|
189
190
|
import './style-inject.es-1f59c1d0.js';
|
|
190
191
|
import 'disqus-react';
|
|
191
192
|
import 'react-twitter-embed';
|
|
192
|
-
import './ImageSlider-
|
|
193
|
+
import './ImageSlider-497e9c88.js';
|
|
194
|
+
import './defineProperty-23a8f8cd.js';
|
|
193
195
|
import './VideoSeriesCard.js';
|
|
194
196
|
|
|
195
197
|
//Feature query to be used
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
|
|
2
|
+
|
|
3
|
+
var _typeof_1 = createCommonjsModule(function (module) {
|
|
4
|
+
function _typeof(obj) {
|
|
5
|
+
"@babel/helpers - typeof";
|
|
6
|
+
|
|
7
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
8
|
+
module.exports = _typeof = function _typeof(obj) {
|
|
9
|
+
return typeof obj;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
13
|
+
} else {
|
|
14
|
+
module.exports = _typeof = function _typeof(obj) {
|
|
15
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return _typeof(obj);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = _typeof;
|
|
25
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
var _typeof = unwrapExports(_typeof_1);
|
|
29
|
+
|
|
30
|
+
export { _typeof as _, _typeof_1 as a };
|