@mjhls/mjh-framework 1.0.1050-pdfGating → 1.0.1050-pdfGating-v3
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/dist/cjs/PublicationLanding.js +13 -27
- package/dist/esm/PublicationLanding.js +13 -27
- package/package.json +1 -1
|
@@ -656,16 +656,9 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
656
656
|
case 'email':
|
|
657
657
|
setEmail(e.currentTarget.value);
|
|
658
658
|
break;
|
|
659
|
-
default:
|
|
660
|
-
closeOverlay(e.currentTarget.dataset['key']);
|
|
661
|
-
break;
|
|
662
659
|
}
|
|
663
660
|
};
|
|
664
661
|
|
|
665
|
-
var closeOverlay = function closeOverlay(key) {
|
|
666
|
-
overLayRef.current[key].handleHide();
|
|
667
|
-
};
|
|
668
|
-
|
|
669
662
|
var isGatedFormHandler = function () {
|
|
670
663
|
var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(e) {
|
|
671
664
|
var form, body, res;
|
|
@@ -686,6 +679,7 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
686
679
|
return _context.abrupt('return');
|
|
687
680
|
|
|
688
681
|
case 6:
|
|
682
|
+
console.dir(overLayRef);
|
|
689
683
|
body = {};
|
|
690
684
|
|
|
691
685
|
body['firstName'] = firstName;
|
|
@@ -696,15 +690,15 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
696
690
|
body['site'] = window.location.hostname;
|
|
697
691
|
SetIsValidated(true);
|
|
698
692
|
|
|
699
|
-
_context.prev =
|
|
700
|
-
_context.next =
|
|
693
|
+
_context.prev = 15;
|
|
694
|
+
_context.next = 18;
|
|
701
695
|
return fetch('/api/pdfGating/check', {
|
|
702
696
|
method: 'POST',
|
|
703
697
|
headers: { 'Content-Type': 'application/json' },
|
|
704
698
|
body: stringify._JSON$stringify(body)
|
|
705
699
|
});
|
|
706
700
|
|
|
707
|
-
case
|
|
701
|
+
case 18:
|
|
708
702
|
res = _context.sent;
|
|
709
703
|
|
|
710
704
|
if (!(res.status === 202)) {
|
|
@@ -713,7 +707,6 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
713
707
|
}
|
|
714
708
|
|
|
715
709
|
window.open(DL_PDF.current.dataset.pdf, '_blank');
|
|
716
|
-
closeOverlay(DL_PDF.current.dataset.key);
|
|
717
710
|
_context.next = 28;
|
|
718
711
|
break;
|
|
719
712
|
|
|
@@ -732,7 +725,7 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
732
725
|
|
|
733
726
|
case 30:
|
|
734
727
|
_context.prev = 30;
|
|
735
|
-
_context.t2 = _context['catch'](
|
|
728
|
+
_context.t2 = _context['catch'](15);
|
|
736
729
|
|
|
737
730
|
setErrorMsg(_context.t2.message);
|
|
738
731
|
|
|
@@ -745,7 +738,7 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
745
738
|
return _context.stop();
|
|
746
739
|
}
|
|
747
740
|
}
|
|
748
|
-
}, _callee, _this, [[
|
|
741
|
+
}, _callee, _this, [[15, 30]]);
|
|
749
742
|
}));
|
|
750
743
|
|
|
751
744
|
return function isGatedFormHandler(_x) {
|
|
@@ -760,17 +753,6 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
760
753
|
React__default["default"].createElement(
|
|
761
754
|
Popover__default["default"].Content,
|
|
762
755
|
null,
|
|
763
|
-
React__default["default"].createElement(
|
|
764
|
-
'div',
|
|
765
|
-
{ className: 'popoverClose' },
|
|
766
|
-
React__default["default"].createElement(
|
|
767
|
-
'button',
|
|
768
|
-
{ 'data-key': key, onClick: function onClick(e) {
|
|
769
|
-
return handleFormInput(e);
|
|
770
|
-
} },
|
|
771
|
-
'X'
|
|
772
|
-
)
|
|
773
|
-
),
|
|
774
756
|
React__default["default"].createElement(
|
|
775
757
|
Form__default["default"],
|
|
776
758
|
{ ref: pdfFormRef, validated: isValidated, onSubmit: isGatedFormHandler },
|
|
@@ -989,6 +971,8 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
989
971
|
issue.isGatedPDF ? issue.pdf && issue.pdf.asset && issue.pdf.asset.url ? React__default["default"].createElement(
|
|
990
972
|
OverlayTrigger__default["default"],
|
|
991
973
|
{
|
|
974
|
+
rootClose: true,
|
|
975
|
+
rootCloseEvent: 'click',
|
|
992
976
|
key: key,
|
|
993
977
|
ref: function ref(el) {
|
|
994
978
|
return overLayRef.current[key] = el;
|
|
@@ -996,7 +980,7 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
996
980
|
trigger: triggerAction,
|
|
997
981
|
placement: placementLocation,
|
|
998
982
|
delay: { show: 250, hide: 400 },
|
|
999
|
-
overlay: isGatedPDFPopOver(
|
|
983
|
+
overlay: isGatedPDFPopOver() },
|
|
1000
984
|
React__default["default"].createElement(
|
|
1001
985
|
'button',
|
|
1002
986
|
{ rel: 'noopener', ref: DL_PDF, 'data-key': key, 'data-pdfName': issue.name, 'data-pdf': urlForFile.urlForFile(issue.pdf, baseUrl), className: 'btn btn-primary' },
|
|
@@ -1068,6 +1052,8 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
1068
1052
|
issue.isGatedPDF ? issue.pdf && issue.pdf.asset && issue.pdf.asset.url ? React__default["default"].createElement(
|
|
1069
1053
|
OverlayTrigger__default["default"],
|
|
1070
1054
|
{
|
|
1055
|
+
rootClose: true,
|
|
1056
|
+
rootCloseEvent: 'click',
|
|
1071
1057
|
key: key,
|
|
1072
1058
|
ref: function ref(el) {
|
|
1073
1059
|
return overLayRef.current[key] = el;
|
|
@@ -1075,7 +1061,7 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
1075
1061
|
trigger: triggerAction,
|
|
1076
1062
|
placement: placementLocation,
|
|
1077
1063
|
delay: { show: 250, hide: 400 },
|
|
1078
|
-
overlay: isGatedPDFPopOver(
|
|
1064
|
+
overlay: isGatedPDFPopOver() },
|
|
1079
1065
|
React__default["default"].createElement(
|
|
1080
1066
|
'button',
|
|
1081
1067
|
{ rel: 'noopener', ref: DL_PDF, 'data-key': key, 'data-pdfName': issue.name, 'data-pdf': urlForFile.urlForFile(issue.pdf, baseUrl), className: 'btn btn-primary' },
|
|
@@ -1098,7 +1084,7 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
1098
1084
|
React__default["default"].createElement(
|
|
1099
1085
|
'style',
|
|
1100
1086
|
{ jsx: 'true' },
|
|
1101
|
-
'\n .gatedPdfForm {\n justify-content: center;\n }\n .popoverClose {\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n }\n .popoverClose button {\n border: none;\n background: transparent;\n color: #2780e3;\n }\n .card-footer button:not(:first-child) {\n color: #fff;\n margin-left: 1rem;\n }\n .issueCard.card:hover {\n cursor: default;\n }\n .content-category-label {\n margin: 0.5rem 0;\n display: block;\n }\n .sanityDisplayLabel {\n margin: 0.5rem 0;\n border: 1px solid black;\n display: inline;\n width: 100%;\n padding: 5px;\n color: #484848;\n border-radius: 2px;\n }\n .dropdown-toggle {\n min-width: 5rem;\n }\n .dropdown-toggle:empty:after {\n margin-left: 4rem;\n }\n .card-footer {\n background-color: transparent;\n border-top: 0;\n }\n .card-footer a:not(:first-child) {\n margin-left: 1rem;\n }\n '
|
|
1087
|
+
'\n .gatedPdfForm {\n justify-content: center;\n flex-direction: column;\n padding: 0 1.5rem;\n }\n .popoverClose {\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n }\n .popoverClose button {\n border: none;\n background: transparent;\n color: #2780e3;\n }\n .card-footer button:not(:first-child) {\n color: #fff;\n margin-left: 1rem;\n }\n .issueCard.card:hover {\n cursor: default;\n }\n .content-category-label {\n margin: 0.5rem 0;\n display: block;\n }\n .sanityDisplayLabel {\n margin: 0.5rem 0;\n border: 1px solid black;\n display: inline;\n width: 100%;\n padding: 5px;\n color: #484848;\n border-radius: 2px;\n }\n .dropdown-toggle {\n min-width: 5rem;\n }\n .dropdown-toggle:empty:after {\n margin-left: 4rem;\n }\n .card-footer {\n background-color: transparent;\n border-top: 0;\n }\n .card-footer a:not(:first-child) {\n margin-left: 1rem;\n }\n '
|
|
1102
1088
|
)
|
|
1103
1089
|
);
|
|
1104
1090
|
};
|
|
@@ -642,16 +642,9 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
642
642
|
case 'email':
|
|
643
643
|
setEmail(e.currentTarget.value);
|
|
644
644
|
break;
|
|
645
|
-
default:
|
|
646
|
-
closeOverlay(e.currentTarget.dataset['key']);
|
|
647
|
-
break;
|
|
648
645
|
}
|
|
649
646
|
};
|
|
650
647
|
|
|
651
|
-
var closeOverlay = function closeOverlay(key) {
|
|
652
|
-
overLayRef.current[key].handleHide();
|
|
653
|
-
};
|
|
654
|
-
|
|
655
648
|
var isGatedFormHandler = function () {
|
|
656
649
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(e) {
|
|
657
650
|
var form, body, res;
|
|
@@ -672,6 +665,7 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
672
665
|
return _context.abrupt('return');
|
|
673
666
|
|
|
674
667
|
case 6:
|
|
668
|
+
console.dir(overLayRef);
|
|
675
669
|
body = {};
|
|
676
670
|
|
|
677
671
|
body['firstName'] = firstName;
|
|
@@ -682,15 +676,15 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
682
676
|
body['site'] = window.location.hostname;
|
|
683
677
|
SetIsValidated(true);
|
|
684
678
|
|
|
685
|
-
_context.prev =
|
|
686
|
-
_context.next =
|
|
679
|
+
_context.prev = 15;
|
|
680
|
+
_context.next = 18;
|
|
687
681
|
return fetch('/api/pdfGating/check', {
|
|
688
682
|
method: 'POST',
|
|
689
683
|
headers: { 'Content-Type': 'application/json' },
|
|
690
684
|
body: _JSON$stringify(body)
|
|
691
685
|
});
|
|
692
686
|
|
|
693
|
-
case
|
|
687
|
+
case 18:
|
|
694
688
|
res = _context.sent;
|
|
695
689
|
|
|
696
690
|
if (!(res.status === 202)) {
|
|
@@ -699,7 +693,6 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
699
693
|
}
|
|
700
694
|
|
|
701
695
|
window.open(DL_PDF.current.dataset.pdf, '_blank');
|
|
702
|
-
closeOverlay(DL_PDF.current.dataset.key);
|
|
703
696
|
_context.next = 28;
|
|
704
697
|
break;
|
|
705
698
|
|
|
@@ -718,7 +711,7 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
718
711
|
|
|
719
712
|
case 30:
|
|
720
713
|
_context.prev = 30;
|
|
721
|
-
_context.t2 = _context['catch'](
|
|
714
|
+
_context.t2 = _context['catch'](15);
|
|
722
715
|
|
|
723
716
|
setErrorMsg(_context.t2.message);
|
|
724
717
|
|
|
@@ -731,7 +724,7 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
731
724
|
return _context.stop();
|
|
732
725
|
}
|
|
733
726
|
}
|
|
734
|
-
}, _callee, _this, [[
|
|
727
|
+
}, _callee, _this, [[15, 30]]);
|
|
735
728
|
}));
|
|
736
729
|
|
|
737
730
|
return function isGatedFormHandler(_x) {
|
|
@@ -746,17 +739,6 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
746
739
|
React__default.createElement(
|
|
747
740
|
Popover.Content,
|
|
748
741
|
null,
|
|
749
|
-
React__default.createElement(
|
|
750
|
-
'div',
|
|
751
|
-
{ className: 'popoverClose' },
|
|
752
|
-
React__default.createElement(
|
|
753
|
-
'button',
|
|
754
|
-
{ 'data-key': key, onClick: function onClick(e) {
|
|
755
|
-
return handleFormInput(e);
|
|
756
|
-
} },
|
|
757
|
-
'X'
|
|
758
|
-
)
|
|
759
|
-
),
|
|
760
742
|
React__default.createElement(
|
|
761
743
|
Form,
|
|
762
744
|
{ ref: pdfFormRef, validated: isValidated, onSubmit: isGatedFormHandler },
|
|
@@ -975,6 +957,8 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
975
957
|
issue.isGatedPDF ? issue.pdf && issue.pdf.asset && issue.pdf.asset.url ? React__default.createElement(
|
|
976
958
|
OverlayTrigger,
|
|
977
959
|
{
|
|
960
|
+
rootClose: true,
|
|
961
|
+
rootCloseEvent: 'click',
|
|
978
962
|
key: key,
|
|
979
963
|
ref: function ref(el) {
|
|
980
964
|
return overLayRef.current[key] = el;
|
|
@@ -982,7 +966,7 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
982
966
|
trigger: triggerAction,
|
|
983
967
|
placement: placementLocation,
|
|
984
968
|
delay: { show: 250, hide: 400 },
|
|
985
|
-
overlay: isGatedPDFPopOver(
|
|
969
|
+
overlay: isGatedPDFPopOver() },
|
|
986
970
|
React__default.createElement(
|
|
987
971
|
'button',
|
|
988
972
|
{ rel: 'noopener', ref: DL_PDF, 'data-key': key, 'data-pdfName': issue.name, 'data-pdf': urlForFile(issue.pdf, baseUrl), className: 'btn btn-primary' },
|
|
@@ -1054,6 +1038,8 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
1054
1038
|
issue.isGatedPDF ? issue.pdf && issue.pdf.asset && issue.pdf.asset.url ? React__default.createElement(
|
|
1055
1039
|
OverlayTrigger,
|
|
1056
1040
|
{
|
|
1041
|
+
rootClose: true,
|
|
1042
|
+
rootCloseEvent: 'click',
|
|
1057
1043
|
key: key,
|
|
1058
1044
|
ref: function ref(el) {
|
|
1059
1045
|
return overLayRef.current[key] = el;
|
|
@@ -1061,7 +1047,7 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
1061
1047
|
trigger: triggerAction,
|
|
1062
1048
|
placement: placementLocation,
|
|
1063
1049
|
delay: { show: 250, hide: 400 },
|
|
1064
|
-
overlay: isGatedPDFPopOver(
|
|
1050
|
+
overlay: isGatedPDFPopOver() },
|
|
1065
1051
|
React__default.createElement(
|
|
1066
1052
|
'button',
|
|
1067
1053
|
{ rel: 'noopener', ref: DL_PDF, 'data-key': key, 'data-pdfName': issue.name, 'data-pdf': urlForFile(issue.pdf, baseUrl), className: 'btn btn-primary' },
|
|
@@ -1084,7 +1070,7 @@ var PublicationLanding = function PublicationLanding(props) {
|
|
|
1084
1070
|
React__default.createElement(
|
|
1085
1071
|
'style',
|
|
1086
1072
|
{ jsx: 'true' },
|
|
1087
|
-
'\n .gatedPdfForm {\n justify-content: center;\n }\n .popoverClose {\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n }\n .popoverClose button {\n border: none;\n background: transparent;\n color: #2780e3;\n }\n .card-footer button:not(:first-child) {\n color: #fff;\n margin-left: 1rem;\n }\n .issueCard.card:hover {\n cursor: default;\n }\n .content-category-label {\n margin: 0.5rem 0;\n display: block;\n }\n .sanityDisplayLabel {\n margin: 0.5rem 0;\n border: 1px solid black;\n display: inline;\n width: 100%;\n padding: 5px;\n color: #484848;\n border-radius: 2px;\n }\n .dropdown-toggle {\n min-width: 5rem;\n }\n .dropdown-toggle:empty:after {\n margin-left: 4rem;\n }\n .card-footer {\n background-color: transparent;\n border-top: 0;\n }\n .card-footer a:not(:first-child) {\n margin-left: 1rem;\n }\n '
|
|
1073
|
+
'\n .gatedPdfForm {\n justify-content: center;\n flex-direction: column;\n padding: 0 1.5rem;\n }\n .popoverClose {\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n }\n .popoverClose button {\n border: none;\n background: transparent;\n color: #2780e3;\n }\n .card-footer button:not(:first-child) {\n color: #fff;\n margin-left: 1rem;\n }\n .issueCard.card:hover {\n cursor: default;\n }\n .content-category-label {\n margin: 0.5rem 0;\n display: block;\n }\n .sanityDisplayLabel {\n margin: 0.5rem 0;\n border: 1px solid black;\n display: inline;\n width: 100%;\n padding: 5px;\n color: #484848;\n border-radius: 2px;\n }\n .dropdown-toggle {\n min-width: 5rem;\n }\n .dropdown-toggle:empty:after {\n margin-left: 4rem;\n }\n .card-footer {\n background-color: transparent;\n border-top: 0;\n }\n .card-footer a:not(:first-child) {\n margin-left: 1rem;\n }\n '
|
|
1088
1074
|
)
|
|
1089
1075
|
);
|
|
1090
1076
|
};
|