tf-checkout-react 1.3.39-beta.3 → 1.3.40
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/hooks/usePixel.d.ts +1 -1
- package/dist/tf-checkout-react.cjs.development.js +28 -16
- 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 +28 -16
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +5 -2
- package/src/components/billing-info-container/index.tsx +1 -1
- package/src/components/confirmationContainer/index.tsx +1 -1
- package/src/components/ticketsContainer/index.tsx +1 -1
- package/src/hooks/usePixel.ts +19 -8
|
@@ -1611,16 +1611,27 @@ var getCheckoutPageConfigs = /*#__PURE__*/function () {
|
|
|
1611
1611
|
|
|
1612
1612
|
var usePixel = /*#__PURE__*/function () {
|
|
1613
1613
|
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(key, eventId, alreadyLoadedEventData) {
|
|
1614
|
-
var getEventData;
|
|
1614
|
+
var addPixel, getEventData;
|
|
1615
1615
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
1616
1616
|
while (1) {
|
|
1617
1617
|
switch (_context2.prev = _context2.next) {
|
|
1618
1618
|
case 0:
|
|
1619
|
+
addPixel = function addPixel(pixel) {
|
|
1620
|
+
var _document;
|
|
1621
|
+
|
|
1622
|
+
if ((_document = document) != null && _document.head && pixel) {
|
|
1623
|
+
var nodes = createElementFromHTML(pixel);
|
|
1624
|
+
|
|
1625
|
+
for (var _i = 0, _Array$from = Array.from(nodes); _i < _Array$from.length; _i++) {
|
|
1626
|
+
var element = _Array$from[_i];
|
|
1627
|
+
document.head.append(element);
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
};
|
|
1631
|
+
|
|
1619
1632
|
getEventData = /*#__PURE__*/function () {
|
|
1620
1633
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
1621
|
-
var
|
|
1622
|
-
|
|
1623
|
-
var isEventDataUndefined, eventResponse, event, pixel, nodes, i;
|
|
1634
|
+
var isEventDataUndefined, eventResponse, event, pixel;
|
|
1624
1635
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1625
1636
|
while (1) {
|
|
1626
1637
|
switch (_context.prev = _context.next) {
|
|
@@ -1656,17 +1667,18 @@ var usePixel = /*#__PURE__*/function () {
|
|
|
1656
1667
|
case 10:
|
|
1657
1668
|
eventResponse = _context.t0;
|
|
1658
1669
|
event = isEventDataUndefined ? _get(eventResponse, 'data.data.attributes', {}) : alreadyLoadedEventData || {};
|
|
1659
|
-
pixel = event[key];
|
|
1660
1670
|
|
|
1661
|
-
if (
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1671
|
+
if (typeof key === 'string') {
|
|
1672
|
+
pixel = event[key];
|
|
1673
|
+
addPixel(pixel);
|
|
1674
|
+
} else {
|
|
1675
|
+
_forEach(key, function (item) {
|
|
1676
|
+
var pixel = event[item];
|
|
1677
|
+
addPixel(pixel);
|
|
1678
|
+
});
|
|
1667
1679
|
}
|
|
1668
1680
|
|
|
1669
|
-
case
|
|
1681
|
+
case 13:
|
|
1670
1682
|
case "end":
|
|
1671
1683
|
return _context.stop();
|
|
1672
1684
|
}
|
|
@@ -1683,7 +1695,7 @@ var usePixel = /*#__PURE__*/function () {
|
|
|
1683
1695
|
getEventData(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1684
1696
|
}, [eventId, alreadyLoadedEventData]);
|
|
1685
1697
|
|
|
1686
|
-
case
|
|
1698
|
+
case 3:
|
|
1687
1699
|
case "end":
|
|
1688
1700
|
return _context2.stop();
|
|
1689
1701
|
}
|
|
@@ -3666,7 +3678,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
3666
3678
|
return item.code.toLowerCase() === defaultCountry;
|
|
3667
3679
|
}) || {};
|
|
3668
3680
|
var initialCountry = selectedCountry.id || _get(userData, 'country', '') || '1';
|
|
3669
|
-
usePixel('checkoutPixels', eventId);
|
|
3681
|
+
usePixel(['checkoutPixels', 'brandCheckoutPixels'], eventId);
|
|
3670
3682
|
return React.createElement(ThemeProvider, {
|
|
3671
3683
|
theme: themeMui
|
|
3672
3684
|
}, (loading || isCountriesLoading) && React.createElement(Backdrop, {
|
|
@@ -5084,7 +5096,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
5084
5096
|
confirmationMain = _confirmationLabels$c2 === void 0 ? 'Your tickets are available in My Tickets section' : _confirmationLabels$c2,
|
|
5085
5097
|
_confirmationLabels$c3 = confirmationLabels.confirmationHelper,
|
|
5086
5098
|
confirmationHelper = _confirmationLabels$c3 === void 0 ? 'Please bring them with you to the event' : _confirmationLabels$c3;
|
|
5087
|
-
usePixel('conversionPixels', data == null ? void 0 : data.product_id);
|
|
5099
|
+
usePixel(['conversionPixels', 'brandConversionPixels'], data == null ? void 0 : data.product_id);
|
|
5088
5100
|
return React.createElement("div", {
|
|
5089
5101
|
className: "confirmation-page"
|
|
5090
5102
|
}, data && React.createElement(React.Fragment, null, React.createElement("div", {
|
|
@@ -5948,7 +5960,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5948
5960
|
useCookieListener(X_TF_ECOMMERCE, function (value) {
|
|
5949
5961
|
return setIsLogged(Boolean(value));
|
|
5950
5962
|
});
|
|
5951
|
-
usePixel('pagePixels', eventId, event);
|
|
5963
|
+
usePixel(['pagePixels', 'brandPagePixels'], eventId, event);
|
|
5952
5964
|
useEffect(function () {
|
|
5953
5965
|
if (typeof window !== 'undefined') {
|
|
5954
5966
|
var access_token = window.localStorage.getItem('access_token');
|