@folklore/ads 0.0.14 → 0.0.15
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 +15 -0
- package/dist/es.js +15 -0
- package/package.json +2 -2
package/dist/cjs.js
CHANGED
|
@@ -864,6 +864,9 @@ function useAd(path, size) {
|
|
|
864
864
|
// Listen to render event
|
|
865
865
|
React.useEffect(() => {
|
|
866
866
|
if (slot === null) {
|
|
867
|
+
if (renderEvent !== null) {
|
|
868
|
+
setRenderEvent(null);
|
|
869
|
+
}
|
|
867
870
|
return () => {};
|
|
868
871
|
}
|
|
869
872
|
const onSlotRender = event => {
|
|
@@ -1013,6 +1016,18 @@ function Ad(_ref) {
|
|
|
1013
1016
|
});
|
|
1014
1017
|
}
|
|
1015
1018
|
}, [onRender, shouldKeepSize, disabled]);
|
|
1019
|
+
React.useEffect(() => {
|
|
1020
|
+
if (!disabled) {
|
|
1021
|
+
return;
|
|
1022
|
+
}
|
|
1023
|
+
const keepSize = shouldKeepSize && lastRenderedSize.current !== null;
|
|
1024
|
+
if (onRender !== null) {
|
|
1025
|
+
onRender({
|
|
1026
|
+
isEmpty: true,
|
|
1027
|
+
keepSize
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
}, [disabled]);
|
|
1016
1031
|
|
|
1017
1032
|
// Create ad
|
|
1018
1033
|
const {
|
package/dist/es.js
CHANGED
|
@@ -846,6 +846,9 @@ function useAd(path, size) {
|
|
|
846
846
|
// Listen to render event
|
|
847
847
|
useEffect(() => {
|
|
848
848
|
if (slot === null) {
|
|
849
|
+
if (renderEvent !== null) {
|
|
850
|
+
setRenderEvent(null);
|
|
851
|
+
}
|
|
849
852
|
return () => {};
|
|
850
853
|
}
|
|
851
854
|
const onSlotRender = event => {
|
|
@@ -995,6 +998,18 @@ function Ad(_ref) {
|
|
|
995
998
|
});
|
|
996
999
|
}
|
|
997
1000
|
}, [onRender, shouldKeepSize, disabled]);
|
|
1001
|
+
useEffect(() => {
|
|
1002
|
+
if (!disabled) {
|
|
1003
|
+
return;
|
|
1004
|
+
}
|
|
1005
|
+
const keepSize = shouldKeepSize && lastRenderedSize.current !== null;
|
|
1006
|
+
if (onRender !== null) {
|
|
1007
|
+
onRender({
|
|
1008
|
+
isEmpty: true,
|
|
1009
|
+
keepSize
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1012
|
+
}, [disabled]);
|
|
998
1013
|
|
|
999
1014
|
// Create ad
|
|
1000
1015
|
const {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@folklore/ads",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
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": "02f9a585bd24267dc0032cab26ce37b0a0a7d316",
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@folklore/hooks": "^0.0.41",
|
|
56
56
|
"@folklore/tracking": "^0.0.16",
|