@folklore/ads 0.0.36 → 0.0.37
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.js +12 -12
- package/dist/es.js +12 -12
- package/package.json +2 -2
package/dist/cjs.js
CHANGED
|
@@ -657,7 +657,7 @@ const propTypes$2 = {
|
|
|
657
657
|
slots: adSlots,
|
|
658
658
|
viewports: adViewports,
|
|
659
659
|
disabled: PropTypes__default["default"].bool,
|
|
660
|
-
|
|
660
|
+
disableTracking: PropTypes__default["default"].bool
|
|
661
661
|
};
|
|
662
662
|
const defaultProps$2 = {
|
|
663
663
|
defaultSlotPath: null,
|
|
@@ -674,7 +674,7 @@ const defaultProps$2 = {
|
|
|
674
674
|
slots: slots,
|
|
675
675
|
viewports: viewports,
|
|
676
676
|
disabled: false,
|
|
677
|
-
|
|
677
|
+
disableTracking: false
|
|
678
678
|
};
|
|
679
679
|
function AdsProvider(_ref) {
|
|
680
680
|
let {
|
|
@@ -693,7 +693,7 @@ function AdsProvider(_ref) {
|
|
|
693
693
|
viewports,
|
|
694
694
|
slots,
|
|
695
695
|
disabled,
|
|
696
|
-
|
|
696
|
+
disableTracking
|
|
697
697
|
} = _ref;
|
|
698
698
|
const [ready, setReady] = React.useState(false);
|
|
699
699
|
const adsRef = React.useRef(null);
|
|
@@ -762,8 +762,8 @@ function AdsProvider(_ref) {
|
|
|
762
762
|
} : {
|
|
763
763
|
...slotsPath
|
|
764
764
|
},
|
|
765
|
-
trackingDisabled
|
|
766
|
-
}), [ready, ads, viewports, slots, slotsPath, defaultSlotPath,
|
|
765
|
+
trackingDisabled: disableTracking
|
|
766
|
+
}), [ready, ads, viewports, slots, slotsPath, defaultSlotPath, disableTracking, disabled]);
|
|
767
767
|
return /*#__PURE__*/jsxRuntime.jsx(AdsContext.Provider, {
|
|
768
768
|
value: value,
|
|
769
769
|
children: children
|
|
@@ -824,7 +824,7 @@ function useAd(path, size) {
|
|
|
824
824
|
alwaysRender = false,
|
|
825
825
|
onRender = null,
|
|
826
826
|
disabled = false,
|
|
827
|
-
|
|
827
|
+
disableTracking = false,
|
|
828
828
|
rootMargin = '300px'
|
|
829
829
|
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
830
830
|
const {
|
|
@@ -834,10 +834,10 @@ function useAd(path, size) {
|
|
|
834
834
|
} = useAdsContext();
|
|
835
835
|
const trackAd = useAdsTracking();
|
|
836
836
|
const track = React.useCallback(function () {
|
|
837
|
-
if (!
|
|
837
|
+
if (!disableTracking && !globalTrackingDisabled) {
|
|
838
838
|
trackAd(...arguments);
|
|
839
839
|
}
|
|
840
|
-
}, [
|
|
840
|
+
}, [disableTracking, globalTrackingDisabled, trackAd]);
|
|
841
841
|
|
|
842
842
|
// Check for visibility
|
|
843
843
|
const {
|
|
@@ -976,7 +976,7 @@ const propTypes = {
|
|
|
976
976
|
refreshInterval: PropTypes__default["default"].number,
|
|
977
977
|
alwaysRender: PropTypes__default["default"].bool,
|
|
978
978
|
disabled: PropTypes__default["default"].bool,
|
|
979
|
-
|
|
979
|
+
disableTracking: PropTypes__default["default"].bool,
|
|
980
980
|
shouldKeepSize: PropTypes__default["default"].bool,
|
|
981
981
|
withoutStyle: PropTypes__default["default"].bool,
|
|
982
982
|
withoutMinimumSize: PropTypes__default["default"].bool,
|
|
@@ -994,7 +994,7 @@ const defaultProps = {
|
|
|
994
994
|
refreshInterval: null,
|
|
995
995
|
alwaysRender: true,
|
|
996
996
|
disabled: false,
|
|
997
|
-
|
|
997
|
+
disableTracking: false,
|
|
998
998
|
shouldKeepSize: false,
|
|
999
999
|
withoutStyle: false,
|
|
1000
1000
|
withoutMinimumSize: false,
|
|
@@ -1014,7 +1014,7 @@ function Ad(_ref) {
|
|
|
1014
1014
|
refreshInterval,
|
|
1015
1015
|
alwaysRender,
|
|
1016
1016
|
disabled,
|
|
1017
|
-
|
|
1017
|
+
disableTracking,
|
|
1018
1018
|
shouldKeepSize,
|
|
1019
1019
|
withoutStyle,
|
|
1020
1020
|
withoutMinimumSize,
|
|
@@ -1116,7 +1116,7 @@ function Ad(_ref) {
|
|
|
1116
1116
|
alwaysRender,
|
|
1117
1117
|
onRender: onAdRender,
|
|
1118
1118
|
disabled: finalDisabled,
|
|
1119
|
-
|
|
1119
|
+
disableTracking
|
|
1120
1120
|
});
|
|
1121
1121
|
if (slotRef !== null && isFunction__default["default"](slotRef)) {
|
|
1122
1122
|
slotRef(slotObject);
|
package/dist/es.js
CHANGED
|
@@ -639,7 +639,7 @@ const propTypes$2 = {
|
|
|
639
639
|
slots: adSlots,
|
|
640
640
|
viewports: adViewports,
|
|
641
641
|
disabled: PropTypes.bool,
|
|
642
|
-
|
|
642
|
+
disableTracking: PropTypes.bool
|
|
643
643
|
};
|
|
644
644
|
const defaultProps$2 = {
|
|
645
645
|
defaultSlotPath: null,
|
|
@@ -656,7 +656,7 @@ const defaultProps$2 = {
|
|
|
656
656
|
slots: slots,
|
|
657
657
|
viewports: viewports,
|
|
658
658
|
disabled: false,
|
|
659
|
-
|
|
659
|
+
disableTracking: false
|
|
660
660
|
};
|
|
661
661
|
function AdsProvider(_ref) {
|
|
662
662
|
let {
|
|
@@ -675,7 +675,7 @@ function AdsProvider(_ref) {
|
|
|
675
675
|
viewports,
|
|
676
676
|
slots,
|
|
677
677
|
disabled,
|
|
678
|
-
|
|
678
|
+
disableTracking
|
|
679
679
|
} = _ref;
|
|
680
680
|
const [ready, setReady] = useState(false);
|
|
681
681
|
const adsRef = useRef(null);
|
|
@@ -744,8 +744,8 @@ function AdsProvider(_ref) {
|
|
|
744
744
|
} : {
|
|
745
745
|
...slotsPath
|
|
746
746
|
},
|
|
747
|
-
trackingDisabled
|
|
748
|
-
}), [ready, ads, viewports, slots, slotsPath, defaultSlotPath,
|
|
747
|
+
trackingDisabled: disableTracking
|
|
748
|
+
}), [ready, ads, viewports, slots, slotsPath, defaultSlotPath, disableTracking, disabled]);
|
|
749
749
|
return /*#__PURE__*/jsx(AdsContext.Provider, {
|
|
750
750
|
value: value,
|
|
751
751
|
children: children
|
|
@@ -806,7 +806,7 @@ function useAd(path, size) {
|
|
|
806
806
|
alwaysRender = false,
|
|
807
807
|
onRender = null,
|
|
808
808
|
disabled = false,
|
|
809
|
-
|
|
809
|
+
disableTracking = false,
|
|
810
810
|
rootMargin = '300px'
|
|
811
811
|
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
812
812
|
const {
|
|
@@ -816,10 +816,10 @@ function useAd(path, size) {
|
|
|
816
816
|
} = useAdsContext();
|
|
817
817
|
const trackAd = useAdsTracking();
|
|
818
818
|
const track = useCallback(function () {
|
|
819
|
-
if (!
|
|
819
|
+
if (!disableTracking && !globalTrackingDisabled) {
|
|
820
820
|
trackAd(...arguments);
|
|
821
821
|
}
|
|
822
|
-
}, [
|
|
822
|
+
}, [disableTracking, globalTrackingDisabled, trackAd]);
|
|
823
823
|
|
|
824
824
|
// Check for visibility
|
|
825
825
|
const {
|
|
@@ -958,7 +958,7 @@ const propTypes = {
|
|
|
958
958
|
refreshInterval: PropTypes.number,
|
|
959
959
|
alwaysRender: PropTypes.bool,
|
|
960
960
|
disabled: PropTypes.bool,
|
|
961
|
-
|
|
961
|
+
disableTracking: PropTypes.bool,
|
|
962
962
|
shouldKeepSize: PropTypes.bool,
|
|
963
963
|
withoutStyle: PropTypes.bool,
|
|
964
964
|
withoutMinimumSize: PropTypes.bool,
|
|
@@ -976,7 +976,7 @@ const defaultProps = {
|
|
|
976
976
|
refreshInterval: null,
|
|
977
977
|
alwaysRender: true,
|
|
978
978
|
disabled: false,
|
|
979
|
-
|
|
979
|
+
disableTracking: false,
|
|
980
980
|
shouldKeepSize: false,
|
|
981
981
|
withoutStyle: false,
|
|
982
982
|
withoutMinimumSize: false,
|
|
@@ -996,7 +996,7 @@ function Ad(_ref) {
|
|
|
996
996
|
refreshInterval,
|
|
997
997
|
alwaysRender,
|
|
998
998
|
disabled,
|
|
999
|
-
|
|
999
|
+
disableTracking,
|
|
1000
1000
|
shouldKeepSize,
|
|
1001
1001
|
withoutStyle,
|
|
1002
1002
|
withoutMinimumSize,
|
|
@@ -1098,7 +1098,7 @@ function Ad(_ref) {
|
|
|
1098
1098
|
alwaysRender,
|
|
1099
1099
|
onRender: onAdRender,
|
|
1100
1100
|
disabled: finalDisabled,
|
|
1101
|
-
|
|
1101
|
+
disableTracking
|
|
1102
1102
|
});
|
|
1103
1103
|
if (slotRef !== null && isFunction(slotRef)) {
|
|
1104
1104
|
slotRef(slotObject);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@folklore/ads",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.37",
|
|
4
4
|
"description": "Ads library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "eb4be4e6692164f0fb4a7fc881cdac855698a2e7",
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@folklore/hooks": "^0.0.44",
|
|
56
56
|
"@folklore/tracking": "^0.0.23",
|