tf-checkout-react 1.3.38-beta.3 → 1.3.39-beta.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.
- package/dist/components/confirmationContainer/index.d.ts +1 -2
- package/dist/components/confirmationContainer/social-buttons.d.ts +1 -2
- package/dist/hooks/usePixel.d.ts +1 -0
- package/dist/tf-checkout-react.cjs.development.js +87 -52
- package/dist/tf-checkout-react.cjs.development.js.map +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
- package/dist/tf-checkout-react.esm.js +88 -53
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/utils/htmlNodeFromString.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/billing-info-container/index.tsx +4 -1
- package/src/components/confirmationContainer/index.tsx +5 -37
- package/src/components/confirmationContainer/social-buttons.tsx +60 -80
- package/src/components/ticketsContainer/index.tsx +7 -1
- package/src/hooks/usePixel.ts +20 -0
- package/src/utils/htmlNodeFromString.ts +6 -0
- package/src/utils/index.ts +1 -0
|
@@ -23,6 +23,5 @@ export interface IConfirmationPage {
|
|
|
23
23
|
onLinkCopied: () => void;
|
|
24
24
|
orderHash?: string;
|
|
25
25
|
confirmationLabels: IConfirmationLabels;
|
|
26
|
-
clientLabel?: string;
|
|
27
26
|
}
|
|
28
|
-
export declare const ConfirmationContainer: ({ confirmationLabels, hasCopyIcon, isReferralEnabled, showDefaultShareButtons, messengerAppId, shareButtons, onGetConfirmationDataSuccess, onGetConfirmationDataError, orderHash, onLinkCopied,
|
|
27
|
+
export declare const ConfirmationContainer: ({ confirmationLabels, hasCopyIcon, isReferralEnabled, showDefaultShareButtons, messengerAppId, shareButtons, onGetConfirmationDataSuccess, onGetConfirmationDataError, orderHash, onLinkCopied, }: IConfirmationPage) => JSX.Element;
|
|
@@ -6,7 +6,6 @@ interface SocialButtonsTypes {
|
|
|
6
6
|
appId: string;
|
|
7
7
|
showDefaultShareButtons: boolean;
|
|
8
8
|
shareButtons: IShareButton[];
|
|
9
|
-
clientLabel?: string;
|
|
10
9
|
}
|
|
11
|
-
declare const SocialButtons: ({ showDefaultShareButtons, shareLink, name, appId, shareButtons
|
|
10
|
+
declare const SocialButtons: ({ showDefaultShareButtons, shareLink, name, appId, shareButtons }: SocialButtonsTypes) => JSX.Element;
|
|
12
11
|
export default SocialButtons;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const usePixel: (key: string, eventId: string | number) => Promise<void>;
|
|
@@ -1208,6 +1208,13 @@ var setLoggedUserData = function setLoggedUserData(data) {
|
|
|
1208
1208
|
};
|
|
1209
1209
|
};
|
|
1210
1210
|
|
|
1211
|
+
var createElementFromHTML = function createElementFromHTML(htmlString) {
|
|
1212
|
+
var div = document.createElement('div');
|
|
1213
|
+
div.innerHTML = htmlString.trim(); // Change this to div.childNodes to support multiple top-level nodes.
|
|
1214
|
+
|
|
1215
|
+
return div.firstChild || '';
|
|
1216
|
+
};
|
|
1217
|
+
|
|
1211
1218
|
var isWindowDefined = typeof window !== 'undefined';
|
|
1212
1219
|
var isDocumentDefined = typeof document !== 'undefined';
|
|
1213
1220
|
|
|
@@ -1609,6 +1616,64 @@ var getCheckoutPageConfigs = /*#__PURE__*/function () {
|
|
|
1609
1616
|
};
|
|
1610
1617
|
}();
|
|
1611
1618
|
|
|
1619
|
+
var usePixel = /*#__PURE__*/function () {
|
|
1620
|
+
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(key, eventId) {
|
|
1621
|
+
var getEventData;
|
|
1622
|
+
return runtime_1.wrap(function _callee2$(_context2) {
|
|
1623
|
+
while (1) {
|
|
1624
|
+
switch (_context2.prev = _context2.next) {
|
|
1625
|
+
case 0:
|
|
1626
|
+
getEventData = /*#__PURE__*/function () {
|
|
1627
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
1628
|
+
var _document;
|
|
1629
|
+
|
|
1630
|
+
var eventResponse, event, pixel;
|
|
1631
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
1632
|
+
while (1) {
|
|
1633
|
+
switch (_context.prev = _context.next) {
|
|
1634
|
+
case 0:
|
|
1635
|
+
_context.next = 2;
|
|
1636
|
+
return getEvent(eventId);
|
|
1637
|
+
|
|
1638
|
+
case 2:
|
|
1639
|
+
eventResponse = _context.sent;
|
|
1640
|
+
event = _get(eventResponse, 'data.data.attributes');
|
|
1641
|
+
pixel = event[key];
|
|
1642
|
+
|
|
1643
|
+
if ((_document = document) != null && _document.head && pixel) {
|
|
1644
|
+
document.head.append(createElementFromHTML(pixel));
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
case 6:
|
|
1648
|
+
case "end":
|
|
1649
|
+
return _context.stop();
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
}, _callee);
|
|
1653
|
+
}));
|
|
1654
|
+
|
|
1655
|
+
return function getEventData() {
|
|
1656
|
+
return _ref2.apply(this, arguments);
|
|
1657
|
+
};
|
|
1658
|
+
}();
|
|
1659
|
+
|
|
1660
|
+
React.useEffect(function () {
|
|
1661
|
+
getEventData();
|
|
1662
|
+
}, []);
|
|
1663
|
+
|
|
1664
|
+
case 2:
|
|
1665
|
+
case "end":
|
|
1666
|
+
return _context2.stop();
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
}, _callee2);
|
|
1670
|
+
}));
|
|
1671
|
+
|
|
1672
|
+
return function usePixel(_x, _x2) {
|
|
1673
|
+
return _ref.apply(this, arguments);
|
|
1674
|
+
};
|
|
1675
|
+
}();
|
|
1676
|
+
|
|
1612
1677
|
var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
1613
1678
|
var combineValidators = function combineValidators() {
|
|
1614
1679
|
for (var _len = arguments.length, validators = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -3271,7 +3336,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3271
3336
|
|
|
3272
3337
|
var showDOB = getQueryVariable('age_required') === 'true';
|
|
3273
3338
|
var showTicketHolders = getQueryVariable('names_required') === 'true';
|
|
3274
|
-
var eventId = getQueryVariable('event_id');
|
|
3339
|
+
var eventId = getQueryVariable('event_id') || '';
|
|
3275
3340
|
var optedInFieldValue = brandOptIn ? brandOptIn : _get(cartInfoData, 'optedIn', false);
|
|
3276
3341
|
var ttfOptIn = Boolean(_get(cartInfoData, 'ttfOptIn', false));
|
|
3277
3342
|
|
|
@@ -3574,6 +3639,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3574
3639
|
return item.code.toLowerCase() === defaultCountry;
|
|
3575
3640
|
}) || {};
|
|
3576
3641
|
var initialCountry = selectedCountry.id || _get(userData, 'country', '') || '1';
|
|
3642
|
+
usePixel('checkoutPixels', eventId);
|
|
3577
3643
|
return React__default.createElement(styles.ThemeProvider, {
|
|
3578
3644
|
theme: themeMui
|
|
3579
3645
|
}, (loading || isCountriesLoading) && React__default.createElement(Backdrop, {
|
|
@@ -4840,40 +4906,39 @@ var SocialButtons = function SocialButtons(_ref2) {
|
|
|
4840
4906
|
shareLink = _ref2.shareLink,
|
|
4841
4907
|
name = _ref2.name,
|
|
4842
4908
|
appId = _ref2.appId,
|
|
4843
|
-
shareButtons = _ref2.shareButtons
|
|
4844
|
-
clientLabel = _ref2.clientLabel;
|
|
4909
|
+
shareButtons = _ref2.shareButtons;
|
|
4845
4910
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
4846
4911
|
className: "convenient_buttons"
|
|
4847
4912
|
}, "or use one of these convenient buttons:"), React__default.createElement("div", {
|
|
4848
4913
|
className: "social-media-btns"
|
|
4849
4914
|
}, showDefaultShareButtons && React__default.createElement(React__default.Fragment, null, React__default.createElement(SocialComponent, {
|
|
4850
|
-
mainLabel:
|
|
4851
|
-
subLabel:
|
|
4852
|
-
platform:
|
|
4915
|
+
mainLabel: 'Share on',
|
|
4916
|
+
subLabel: 'Facebook',
|
|
4917
|
+
platform: 'facebook',
|
|
4853
4918
|
shareData: {
|
|
4854
4919
|
quote: name,
|
|
4855
4920
|
url: shareLink
|
|
4856
4921
|
}
|
|
4857
4922
|
}), React__default.createElement(SocialComponent, {
|
|
4858
|
-
mainLabel:
|
|
4859
|
-
subLabel:
|
|
4860
|
-
platform:
|
|
4923
|
+
mainLabel: 'Tweet to your',
|
|
4924
|
+
subLabel: 'Followers',
|
|
4925
|
+
platform: 'twitter',
|
|
4861
4926
|
shareData: {
|
|
4862
4927
|
title: name,
|
|
4863
4928
|
url: shareLink
|
|
4864
4929
|
}
|
|
4865
4930
|
}), React__default.createElement(SocialComponent, {
|
|
4866
|
-
mainLabel:
|
|
4867
|
-
subLabel:
|
|
4868
|
-
platform:
|
|
4931
|
+
mainLabel: 'Message friends on',
|
|
4932
|
+
subLabel: 'Facebook',
|
|
4933
|
+
platform: 'messenger',
|
|
4869
4934
|
shareData: {
|
|
4870
4935
|
appId: appId,
|
|
4871
4936
|
url: shareLink
|
|
4872
4937
|
}
|
|
4873
4938
|
}), React__default.createElement(SocialComponent, {
|
|
4874
|
-
mainLabel:
|
|
4875
|
-
subLabel:
|
|
4876
|
-
platform:
|
|
4939
|
+
mainLabel: 'Message friends on',
|
|
4940
|
+
subLabel: 'Whatsapp',
|
|
4941
|
+
platform: 'whatsapp',
|
|
4877
4942
|
shareData: {
|
|
4878
4943
|
title: name,
|
|
4879
4944
|
url: shareLink
|
|
@@ -4882,9 +4947,7 @@ var SocialButtons = function SocialButtons(_ref2) {
|
|
|
4882
4947
|
return React__default.createElement(SocialComponent, Object.assign({
|
|
4883
4948
|
key: index
|
|
4884
4949
|
}, shareButton));
|
|
4885
|
-
})), (showDefaultShareButtons || shareButtons.length) && React__default.createElement("p", null, "We ", React__default.createElement("strong", null, "never"), " post on Facebook without your permission!")
|
|
4886
|
-
className: "note-message"
|
|
4887
|
-
}, React__default.createElement("span", null, "*Please note, only purchases made from a different", ' ', clientLabel || 'Ticket Fairy', " account can count towards your referrals"), React__default.createElement("span", null, ' ', "so please make sure you ask your friends to buy their own tickets using their own ", clientLabel || 'Ticket Fairy', " account!")));
|
|
4950
|
+
})), (showDefaultShareButtons || shareButtons.length) && React__default.createElement("p", null, "We ", React__default.createElement("strong", null, "never"), " post on Facebook without your permission!"));
|
|
4888
4951
|
};
|
|
4889
4952
|
|
|
4890
4953
|
var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
@@ -4903,8 +4966,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4903
4966
|
onGetConfirmationDataError = _ref$onGetConfirmatio2 === void 0 ? function () {} : _ref$onGetConfirmatio2,
|
|
4904
4967
|
orderHash = _ref.orderHash,
|
|
4905
4968
|
_ref$onLinkCopied = _ref.onLinkCopied,
|
|
4906
|
-
onLinkCopied = _ref$onLinkCopied === void 0 ? function () {} : _ref$onLinkCopied
|
|
4907
|
-
clientLabel = _ref.clientLabel;
|
|
4969
|
+
onLinkCopied = _ref$onLinkCopied === void 0 ? function () {} : _ref$onLinkCopied;
|
|
4908
4970
|
var inputRef = React.useRef(null);
|
|
4909
4971
|
|
|
4910
4972
|
var _useState = React.useState(null),
|
|
@@ -4981,14 +5043,6 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4981
5043
|
}))();
|
|
4982
5044
|
}, []);
|
|
4983
5045
|
|
|
4984
|
-
var _useState2 = React.useState(false),
|
|
4985
|
-
showCopyModal = _useState2[0],
|
|
4986
|
-
setShowCopyModal = _useState2[1];
|
|
4987
|
-
|
|
4988
|
-
var onClose = function onClose() {
|
|
4989
|
-
setShowCopyModal(false);
|
|
4990
|
-
};
|
|
4991
|
-
|
|
4992
5046
|
var onChangeShareLink = function onChangeShareLink(e) {
|
|
4993
5047
|
var newData = _extends({}, data, {
|
|
4994
5048
|
personal_share_link: e.target.value
|
|
@@ -5003,30 +5057,14 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
5003
5057
|
confirmationMain = _confirmationLabels$c2 === void 0 ? 'Your tickets are available in My Tickets section' : _confirmationLabels$c2,
|
|
5004
5058
|
_confirmationLabels$c3 = confirmationLabels.confirmationHelper,
|
|
5005
5059
|
confirmationHelper = _confirmationLabels$c3 === void 0 ? 'Please bring them with you to the event' : _confirmationLabels$c3;
|
|
5060
|
+
usePixel('conversionPixels', data.product_id);
|
|
5006
5061
|
return React__default.createElement("div", {
|
|
5007
5062
|
className: "confirmation-page"
|
|
5008
|
-
}, React__default.createElement(
|
|
5009
|
-
open: showCopyModal,
|
|
5010
|
-
onClose: onClose,
|
|
5011
|
-
"aria-labelledby": "modal-modal-title",
|
|
5012
|
-
"aria-describedby": "modal-modal-description",
|
|
5013
|
-
className: "success-copy-modal"
|
|
5014
|
-
}, React__default.createElement("div", {
|
|
5015
|
-
className: "message-copy-success-box"
|
|
5016
|
-
}, React__default.createElement("div", {
|
|
5017
|
-
className: "message-copy-success"
|
|
5018
|
-
}, React__default.createElement("span", null, "Copied to your clipboard! Now paste your link in a Snapchat message,"), React__default.createElement("span", null, "your Instagram bio, Whatsapp, Facebook or a text :)")), React__default.createElement("div", {
|
|
5019
|
-
className: "footer"
|
|
5020
|
-
}, React__default.createElement("button", {
|
|
5021
|
-
className: "footer-button",
|
|
5022
|
-
type: "button",
|
|
5023
|
-
onClick: onClose
|
|
5024
|
-
}, "OK")))), data && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
5063
|
+
}, data && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
5025
5064
|
className: "header-container"
|
|
5026
5065
|
}, React__default.createElement("div", {
|
|
5027
5066
|
className: "header-product-image"
|
|
5028
5067
|
}, React__default.createElement("img", {
|
|
5029
|
-
alt: "",
|
|
5030
5068
|
className: "product-image",
|
|
5031
5069
|
src: data.product_image
|
|
5032
5070
|
})), React__default.createElement("div", {
|
|
@@ -5090,7 +5128,6 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
5090
5128
|
className: "share-by-link-copy-icon",
|
|
5091
5129
|
onClick: function onClick() {
|
|
5092
5130
|
navigator.clipboard.writeText(_get(inputRef, 'current.value'));
|
|
5093
|
-
setShowCopyModal(true);
|
|
5094
5131
|
onLinkCopied();
|
|
5095
5132
|
}
|
|
5096
5133
|
}, hasCopyIcon ? React__default.createElement("img", {
|
|
@@ -5103,8 +5140,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
5103
5140
|
name: data.product_name,
|
|
5104
5141
|
appId: messengerAppId,
|
|
5105
5142
|
shareLink: data.personal_share_link,
|
|
5106
|
-
shareButtons: shareButtons
|
|
5107
|
-
clientLabel: clientLabel
|
|
5143
|
+
shareButtons: shareButtons
|
|
5108
5144
|
})))), React__default.createElement("div", {
|
|
5109
5145
|
className: "pricing-section"
|
|
5110
5146
|
}, React__default.createElement("div", {
|
|
@@ -5120,9 +5156,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
5120
5156
|
}, pricing.subLabel)), React__default.createElement("div", {
|
|
5121
5157
|
className: "pricing-section_price"
|
|
5122
5158
|
}, ' ', pricing.price));
|
|
5123
|
-
})
|
|
5124
|
-
className: "note-pricing-section"
|
|
5125
|
-
}, "^ This is based on the most expensive ticket in your order."))))));
|
|
5159
|
+
}))))));
|
|
5126
5160
|
};
|
|
5127
5161
|
|
|
5128
5162
|
var X_TF_ECOMMERCE = 'X-TF-ECOMMERCE';
|
|
@@ -5887,6 +5921,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5887
5921
|
useCookieListener(X_TF_ECOMMERCE, function (value) {
|
|
5888
5922
|
return setIsLogged(Boolean(value));
|
|
5889
5923
|
});
|
|
5924
|
+
usePixel('pagePixels', eventId);
|
|
5890
5925
|
React.useEffect(function () {
|
|
5891
5926
|
if (typeof window !== 'undefined') {
|
|
5892
5927
|
var access_token = window.localStorage.getItem('access_token');
|