@folklore/ads 0.0.17 → 0.0.18
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 +9 -15
- package/dist/es.js +9 -15
- package/package.json +2 -2
package/dist/cjs.js
CHANGED
|
@@ -999,21 +999,21 @@ function Ad(_ref) {
|
|
|
999
999
|
const wasDisabled = React.useRef(disabled);
|
|
1000
1000
|
const onAdRender = React.useCallback(event => {
|
|
1001
1001
|
const {
|
|
1002
|
-
isEmpty: newIsEmpty = true
|
|
1002
|
+
isEmpty: newIsEmpty = true,
|
|
1003
|
+
width: newWidth,
|
|
1004
|
+
height: newHeight
|
|
1003
1005
|
} = event || {};
|
|
1004
|
-
const newIsRendered = !newIsEmpty;
|
|
1005
1006
|
if (disabled) {
|
|
1006
1007
|
wasDisabled.current = true;
|
|
1007
|
-
} else if (!disabled &&
|
|
1008
|
+
} else if (!disabled && !newIsEmpty) {
|
|
1008
1009
|
wasDisabled.current = false;
|
|
1009
1010
|
}
|
|
1010
|
-
|
|
1011
|
-
|
|
1011
|
+
lastRenderedSize.current = !newIsEmpty ? {
|
|
1012
|
+
width: newWidth,
|
|
1013
|
+
height: newHeight
|
|
1014
|
+
} : null;
|
|
1012
1015
|
if (onRender !== null) {
|
|
1013
|
-
onRender(
|
|
1014
|
-
...event,
|
|
1015
|
-
keepSize
|
|
1016
|
-
});
|
|
1016
|
+
onRender(event);
|
|
1017
1017
|
}
|
|
1018
1018
|
}, [onRender, shouldKeepSize, disabled]);
|
|
1019
1019
|
React.useEffect(() => {
|
|
@@ -1053,12 +1053,6 @@ function Ad(_ref) {
|
|
|
1053
1053
|
// eslint-disable-next-line no-param-reassign
|
|
1054
1054
|
slotRef.current = slotObject;
|
|
1055
1055
|
}
|
|
1056
|
-
if (isRendered && !isEmpty) {
|
|
1057
|
-
lastRenderedSize.current = {
|
|
1058
|
-
width,
|
|
1059
|
-
height
|
|
1060
|
-
};
|
|
1061
|
-
}
|
|
1062
1056
|
if (disabled) {
|
|
1063
1057
|
wasDisabled.current = true;
|
|
1064
1058
|
} else if (!disabled && isRendered) {
|
package/dist/es.js
CHANGED
|
@@ -981,21 +981,21 @@ function Ad(_ref) {
|
|
|
981
981
|
const wasDisabled = useRef(disabled);
|
|
982
982
|
const onAdRender = useCallback(event => {
|
|
983
983
|
const {
|
|
984
|
-
isEmpty: newIsEmpty = true
|
|
984
|
+
isEmpty: newIsEmpty = true,
|
|
985
|
+
width: newWidth,
|
|
986
|
+
height: newHeight
|
|
985
987
|
} = event || {};
|
|
986
|
-
const newIsRendered = !newIsEmpty;
|
|
987
988
|
if (disabled) {
|
|
988
989
|
wasDisabled.current = true;
|
|
989
|
-
} else if (!disabled &&
|
|
990
|
+
} else if (!disabled && !newIsEmpty) {
|
|
990
991
|
wasDisabled.current = false;
|
|
991
992
|
}
|
|
992
|
-
|
|
993
|
-
|
|
993
|
+
lastRenderedSize.current = !newIsEmpty ? {
|
|
994
|
+
width: newWidth,
|
|
995
|
+
height: newHeight
|
|
996
|
+
} : null;
|
|
994
997
|
if (onRender !== null) {
|
|
995
|
-
onRender(
|
|
996
|
-
...event,
|
|
997
|
-
keepSize
|
|
998
|
-
});
|
|
998
|
+
onRender(event);
|
|
999
999
|
}
|
|
1000
1000
|
}, [onRender, shouldKeepSize, disabled]);
|
|
1001
1001
|
useEffect(() => {
|
|
@@ -1035,12 +1035,6 @@ function Ad(_ref) {
|
|
|
1035
1035
|
// eslint-disable-next-line no-param-reassign
|
|
1036
1036
|
slotRef.current = slotObject;
|
|
1037
1037
|
}
|
|
1038
|
-
if (isRendered && !isEmpty) {
|
|
1039
|
-
lastRenderedSize.current = {
|
|
1040
|
-
width,
|
|
1041
|
-
height
|
|
1042
|
-
};
|
|
1043
|
-
}
|
|
1044
1038
|
if (disabled) {
|
|
1045
1039
|
wasDisabled.current = true;
|
|
1046
1040
|
} else if (!disabled && isRendered) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@folklore/ads",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
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": "05240bdfda62d12b1765fd96087aeee931d0c203",
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@folklore/hooks": "^0.0.41",
|
|
56
56
|
"@folklore/tracking": "^0.0.16",
|