@folklore/ads 0.0.78 → 0.0.80

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.
Files changed (3) hide show
  1. package/dist/cjs.js +15 -12
  2. package/dist/es.js +15 -12
  3. package/package.json +2 -2
package/dist/cjs.js CHANGED
@@ -635,8 +635,8 @@ const slots = {
635
635
  sizeMapping: {
636
636
  default: [[300, 100], [300, 150], [320, 50], [320, 100]],
637
637
  tablet: [[300, 100], [300, 150], [320, 50], [320, 100], [728, 90]],
638
- desktop: [[300, 100], [300, 150], [320, 50], [320, 100], [640, 350], [728, 90], [970, 90], [970, 250], [1024, 300]],
639
- laptop: [[300, 100], [300, 150], [320, 50], [320, 100], [640, 350], [728, 90], [970, 90], [970, 250], [1024, 300], [1382, 300], [1382, 600]]
638
+ desktop: [[300, 100], [300, 150], [320, 100], [640, 350], [728, 90], [970, 90], [970, 250], [1024, 300]],
639
+ laptop: [[300, 100], [300, 150], [320, 100], [640, 350], [728, 90], [970, 90], [970, 250], [1024, 300], [1382, 300], [1382, 600]]
640
640
  }
641
641
  },
642
642
  grid: {
@@ -650,21 +650,21 @@ const slots = {
650
650
  }
651
651
  },
652
652
  fullwidth: {
653
- size: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 50], [320, 100], [336, 280], [640, 350], [728, 90], [970, 90], [970, 250], [1024, 300], [1382, 300], [1382, 600]],
653
+ size: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 50], [320, 100], [336, 280], [634, 634], [640, 350], [728, 90], [970, 90], [970, 250], [970, 415], [1024, 300], [1382, 300], [1382, 600]],
654
654
  sizeMapping: {
655
655
  default: [[300, 100], [300, 150], [320, 50], [320, 100]],
656
- tablet: [[300, 100], [300, 150], [320, 50], [320, 100], [728, 90]],
657
- desktop: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 50], [320, 100], [336, 280], [640, 350], [728, 90], [970, 90], [970, 250], [1024, 300]],
658
- laptop: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 50], [320, 100], [336, 280], [640, 350], [728, 90], [970, 90], [970, 250], [1024, 300], [1382, 300], [1382, 600]]
656
+ tablet: [[300, 100], [300, 150], [320, 50], [320, 100], [634, 634], [728, 90]],
657
+ desktop: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 100], [336, 280], [634, 634], [640, 350], [728, 90], [970, 90], [970, 250], [970, 415], [1024, 300]],
658
+ laptop: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 100], [336, 280], [634, 634], [640, 350], [728, 90], [970, 90], [970, 250], [970, 415], [1024, 300], [1382, 300], [1382, 600]]
659
659
  }
660
660
  },
661
661
  content: {
662
- size: [[120, 600], [160, 600], [250, 250], [300, 100], [300, 150], [300, 250], [300, 600], [320, 50], [320, 100], [336, 280], [640, 350], [728, 90]],
662
+ size: [[120, 600], [160, 600], [250, 250], [300, 100], [300, 150], [300, 250], [300, 600], [320, 50], [320, 100], [336, 280], [634, 634], [640, 350], [728, 90], [970, 90], [970, 250], [970, 415], [1024, 300], [1382, 300], [1382, 600]],
663
663
  sizeMapping: {
664
664
  default: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 50], [320, 100], [336, 280]],
665
- tablet: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 50], [320, 100], [336, 280], [640, 350], [728, 90]],
666
- desktop: [[120, 600], [160, 600], [250, 250], [300, 100], [300, 150], [300, 250], [300, 600], [320, 50], [320, 100], [336, 280], [640, 350], [728, 90]],
667
- laptop: [[120, 600], [160, 600], [250, 250], [300, 100], [300, 150], [300, 250], [300, 600], [320, 50], [320, 100], [336, 280], [640, 350], [728, 90]]
665
+ tablet: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 50], [320, 100], [336, 280], [634, 634], [640, 350], [728, 90]],
666
+ desktop: [[120, 600], [160, 600], [250, 250], [300, 100], [300, 150], [300, 250], [300, 600], [320, 100], [336, 280], [634, 634], [640, 350], [728, 90], [970, 90], [970, 250], [970, 415], [1024, 300]],
667
+ laptop: [[120, 600], [160, 600], [250, 250], [300, 100], [300, 150], [300, 250], [300, 600], [320, 100], [336, 280], [634, 634], [640, 350], [728, 90], [970, 90], [970, 250], [970, 415], [1024, 300], [1382, 300], [1382, 600]]
668
668
  }
669
669
  }
670
670
  };
@@ -1080,13 +1080,16 @@ function useRichAd(containerRef, id, opts) {
1080
1080
  onRichAd = null
1081
1081
  } = opts || {};
1082
1082
  React.useEffect(() => {
1083
+ if (id === null) {
1084
+ return () => {};
1085
+ }
1083
1086
  setRichAd(null);
1084
1087
  function onMessage(event) {
1085
1088
  if (event.origin.match(/safeframe\.googlesyndication\.com/) === null) {
1086
1089
  return;
1087
1090
  }
1088
- const container = containerRef.current || document;
1089
- const iframe = container.querySelector('iframe') || null;
1091
+ const container = containerRef.current || null;
1092
+ const iframe = container !== null ? container.querySelector('iframe') || null : null;
1090
1093
  if (iframe === null || iframe.contentWindow !== event.source) {
1091
1094
  return;
1092
1095
  }
package/dist/es.js CHANGED
@@ -617,8 +617,8 @@ const slots = {
617
617
  sizeMapping: {
618
618
  default: [[300, 100], [300, 150], [320, 50], [320, 100]],
619
619
  tablet: [[300, 100], [300, 150], [320, 50], [320, 100], [728, 90]],
620
- desktop: [[300, 100], [300, 150], [320, 50], [320, 100], [640, 350], [728, 90], [970, 90], [970, 250], [1024, 300]],
621
- laptop: [[300, 100], [300, 150], [320, 50], [320, 100], [640, 350], [728, 90], [970, 90], [970, 250], [1024, 300], [1382, 300], [1382, 600]]
620
+ desktop: [[300, 100], [300, 150], [320, 100], [640, 350], [728, 90], [970, 90], [970, 250], [1024, 300]],
621
+ laptop: [[300, 100], [300, 150], [320, 100], [640, 350], [728, 90], [970, 90], [970, 250], [1024, 300], [1382, 300], [1382, 600]]
622
622
  }
623
623
  },
624
624
  grid: {
@@ -632,21 +632,21 @@ const slots = {
632
632
  }
633
633
  },
634
634
  fullwidth: {
635
- size: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 50], [320, 100], [336, 280], [640, 350], [728, 90], [970, 90], [970, 250], [1024, 300], [1382, 300], [1382, 600]],
635
+ size: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 50], [320, 100], [336, 280], [634, 634], [640, 350], [728, 90], [970, 90], [970, 250], [970, 415], [1024, 300], [1382, 300], [1382, 600]],
636
636
  sizeMapping: {
637
637
  default: [[300, 100], [300, 150], [320, 50], [320, 100]],
638
- tablet: [[300, 100], [300, 150], [320, 50], [320, 100], [728, 90]],
639
- desktop: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 50], [320, 100], [336, 280], [640, 350], [728, 90], [970, 90], [970, 250], [1024, 300]],
640
- laptop: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 50], [320, 100], [336, 280], [640, 350], [728, 90], [970, 90], [970, 250], [1024, 300], [1382, 300], [1382, 600]]
638
+ tablet: [[300, 100], [300, 150], [320, 50], [320, 100], [634, 634], [728, 90]],
639
+ desktop: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 100], [336, 280], [634, 634], [640, 350], [728, 90], [970, 90], [970, 250], [970, 415], [1024, 300]],
640
+ laptop: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 100], [336, 280], [634, 634], [640, 350], [728, 90], [970, 90], [970, 250], [970, 415], [1024, 300], [1382, 300], [1382, 600]]
641
641
  }
642
642
  },
643
643
  content: {
644
- size: [[120, 600], [160, 600], [250, 250], [300, 100], [300, 150], [300, 250], [300, 600], [320, 50], [320, 100], [336, 280], [640, 350], [728, 90]],
644
+ size: [[120, 600], [160, 600], [250, 250], [300, 100], [300, 150], [300, 250], [300, 600], [320, 50], [320, 100], [336, 280], [634, 634], [640, 350], [728, 90], [970, 90], [970, 250], [970, 415], [1024, 300], [1382, 300], [1382, 600]],
645
645
  sizeMapping: {
646
646
  default: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 50], [320, 100], [336, 280]],
647
- tablet: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 50], [320, 100], [336, 280], [640, 350], [728, 90]],
648
- desktop: [[120, 600], [160, 600], [250, 250], [300, 100], [300, 150], [300, 250], [300, 600], [320, 50], [320, 100], [336, 280], [640, 350], [728, 90]],
649
- laptop: [[120, 600], [160, 600], [250, 250], [300, 100], [300, 150], [300, 250], [300, 600], [320, 50], [320, 100], [336, 280], [640, 350], [728, 90]]
647
+ tablet: [[250, 250], [300, 100], [300, 150], [300, 250], [320, 50], [320, 100], [336, 280], [634, 634], [640, 350], [728, 90]],
648
+ desktop: [[120, 600], [160, 600], [250, 250], [300, 100], [300, 150], [300, 250], [300, 600], [320, 100], [336, 280], [634, 634], [640, 350], [728, 90], [970, 90], [970, 250], [970, 415], [1024, 300]],
649
+ laptop: [[120, 600], [160, 600], [250, 250], [300, 100], [300, 150], [300, 250], [300, 600], [320, 100], [336, 280], [634, 634], [640, 350], [728, 90], [970, 90], [970, 250], [970, 415], [1024, 300], [1382, 300], [1382, 600]]
650
650
  }
651
651
  }
652
652
  };
@@ -1062,13 +1062,16 @@ function useRichAd(containerRef, id, opts) {
1062
1062
  onRichAd = null
1063
1063
  } = opts || {};
1064
1064
  useEffect(() => {
1065
+ if (id === null) {
1066
+ return () => {};
1067
+ }
1065
1068
  setRichAd(null);
1066
1069
  function onMessage(event) {
1067
1070
  if (event.origin.match(/safeframe\.googlesyndication\.com/) === null) {
1068
1071
  return;
1069
1072
  }
1070
- const container = containerRef.current || document;
1071
- const iframe = container.querySelector('iframe') || null;
1073
+ const container = containerRef.current || null;
1074
+ const iframe = container !== null ? container.querySelector('iframe') || null : null;
1072
1075
  if (iframe === null || iframe.contentWindow !== event.source) {
1073
1076
  return;
1074
1077
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@folklore/ads",
3
- "version": "0.0.78",
3
+ "version": "0.0.80",
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": "305e55290b425a9b60853ce4b1a9688956f77f68",
53
+ "gitHead": "336b221bfe2d1bc6a39c79e0d9cedc3621a7c9d6",
54
54
  "dependencies": {
55
55
  "@folklore/hooks": "^0.0.65",
56
56
  "@folklore/tracking": "^0.0.25",