@folklore/ads 0.0.29 → 0.0.30

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 +16 -10
  2. package/dist/es.js +16 -10
  3. package/package.json +2 -2
package/dist/cjs.js CHANGED
@@ -1001,18 +1001,24 @@ function Ad(_ref) {
1001
1001
  const minimumSize = React.useMemo(() => getMinimumAdSize(finalSizeMapping !== null ? finalSizeMapping.reduce((allSizes, sizeMap) => [...allSizes, sizeMap[1]], [finalSize]) : finalSize), [finalSizeMapping, finalSize]);
1002
1002
 
1003
1003
  // Targeting
1004
+ const contextTargeting = useAdsTargeting();
1004
1005
  const {
1005
- disabled: targetingDisabled = false,
1006
- ...contextTargeting
1007
- } = useAdsTargeting();
1006
+ disabled: targetingDisabled = false
1007
+ } = contextTargeting || {};
1008
1008
  const finalDisabled = disabled || targetingDisabled;
1009
- const allTargeting = React.useMemo(() => ({
1010
- ...(slotName !== null ? {
1011
- slot: slotName
1012
- } : null),
1013
- ...contextTargeting,
1014
- ...targeting
1015
- }), [contextTargeting, targeting, slotName]);
1009
+ const allTargeting = React.useMemo(() => {
1010
+ const {
1011
+ disabled: removedDisabled,
1012
+ ...otherTargeting
1013
+ } = contextTargeting || {};
1014
+ return {
1015
+ ...(slotName !== null ? {
1016
+ slot: slotName
1017
+ } : null),
1018
+ ...otherTargeting,
1019
+ ...targeting
1020
+ };
1021
+ }, [contextTargeting, targeting, slotName]);
1016
1022
  const finalAdTargeting = React.useMemo(() => {
1017
1023
  const {
1018
1024
  refreshAds = null,
package/dist/es.js CHANGED
@@ -983,18 +983,24 @@ function Ad(_ref) {
983
983
  const minimumSize = useMemo(() => getMinimumAdSize(finalSizeMapping !== null ? finalSizeMapping.reduce((allSizes, sizeMap) => [...allSizes, sizeMap[1]], [finalSize]) : finalSize), [finalSizeMapping, finalSize]);
984
984
 
985
985
  // Targeting
986
+ const contextTargeting = useAdsTargeting();
986
987
  const {
987
- disabled: targetingDisabled = false,
988
- ...contextTargeting
989
- } = useAdsTargeting();
988
+ disabled: targetingDisabled = false
989
+ } = contextTargeting || {};
990
990
  const finalDisabled = disabled || targetingDisabled;
991
- const allTargeting = useMemo(() => ({
992
- ...(slotName !== null ? {
993
- slot: slotName
994
- } : null),
995
- ...contextTargeting,
996
- ...targeting
997
- }), [contextTargeting, targeting, slotName]);
991
+ const allTargeting = useMemo(() => {
992
+ const {
993
+ disabled: removedDisabled,
994
+ ...otherTargeting
995
+ } = contextTargeting || {};
996
+ return {
997
+ ...(slotName !== null ? {
998
+ slot: slotName
999
+ } : null),
1000
+ ...otherTargeting,
1001
+ ...targeting
1002
+ };
1003
+ }, [contextTargeting, targeting, slotName]);
998
1004
  const finalAdTargeting = useMemo(() => {
999
1005
  const {
1000
1006
  refreshAds = null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@folklore/ads",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
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": "3d6a994986575b5e4705182dbeecfd3b8c760513",
53
+ "gitHead": "af57f5d2a4d695deb8f676557d66e0cc24540e49",
54
54
  "dependencies": {
55
55
  "@folklore/hooks": "^0.0.43",
56
56
  "@folklore/tracking": "^0.0.21",