Skip to content

Commit f30911f

Browse files
committed
Use prod url for example apps in a nice way, clean up alt text building, fix tests
1 parent 84e9e68 commit f30911f

20 files changed

+647
-641
lines changed

dist/chunk-LJOP7BRQ.mjs

Lines changed: 0 additions & 296 deletions
This file was deleted.

dist/chunk-Q7N6K3TO.js

Lines changed: 296 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/chunk-WDEDAZPV.js

Lines changed: 0 additions & 296 deletions
This file was deleted.

dist/chunk-YF7KTK47.mjs

Lines changed: 296 additions & 0 deletions
Large diffs are not rendered by default.

dist/core.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ declare class DefaultLogReporter implements LogReporter {
337337
}
338338
declare const defaultLogReporter: DefaultLogReporter;
339339

340-
type MozAdsLocalizedStringKey = "ad_image_default_alt" | "loading_spinner_tooltip" | "report_ad_button_tooltip" | "report_form_close_button_tooltip" | "report_form_select_reason_option_none" | "report_form_select_reason_option_inappropriate" | "report_form_select_reason_option_seen_too_many_times" | "report_form_select_reason_option_not_interested" | "report_form_submit_button" | "report_form_title_default" | "report_form_title_success";
340+
type MozAdsLocalizedStringKey = "ad_image_default_alt" | "alt_prefix_billboard_ad_image" | "alt_prefix_rectangle_ad_image" | "alt_prefix_skyscraper_ad_image" | "loading_spinner_tooltip" | "report_ad_button_tooltip" | "report_form_close_button_tooltip" | "report_form_select_reason_option_none" | "report_form_select_reason_option_inappropriate" | "report_form_select_reason_option_seen_too_many_times" | "report_form_select_reason_option_not_interested" | "report_form_submit_button" | "report_form_title_default" | "report_form_title_success";
341341
declare function l(key: MozAdsLocalizedStringKey): string;
342342

343343
declare enum LoggerLevel {

dist/core.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
import{A as z,B as A,C as B,D as C,E as D,F as E,G as F,H as G,I as H,J as I,K as J,L as K,M as L,N as M,O as N,a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i,p as j,q as k,r as l,s as n,t as q,v as s,w as u,x as v,y as w,z as y}from"./chunk-LJOP7BRQ.mjs";import"./chunk-57T3EAOB.mjs";export{d as AdUnitFormatImpressionThreshold,b as AdUnitFormatTypeLookup,h as CLOSE_ICON_SVG,e as DEFAULT_SERVICE_ENDPOINT,g as DefaultImpressionThreshold,u as DefaultLogReporter,y as DefaultLogger,z as DefaultMozAdsImpressionObserver,l as FALLBACK_BILLBOARD_SVG,j as FALLBACK_DINO_SVG_FRAGMENT,k as FALLBACK_DONATE_SVG_FRAGMENT,q as FALLBACK_MRECTANGLE_SVG,n as FALLBACK_SKYSCRAPER_SVG,c as FallbackAdURL,K as FetchAdsError,a as FixedSize,t as IABFixedSize,f as INSTRUMENT_ENDPOINT,o as IS_BROWSER,r as IS_PRODUCTION,p as LOG_EMIT_FLAG_DEFAULT,m as LOG_TO_CONSOLE_FLAG_DEFAULT,w as LoggerLevel,x as NonIABFixedSize,i as REPORT_ICON_SVG,s as SeverityLevel,F as StoreType,M as buildPlacementsRequest,A as defaultImpressionObserver,v as defaultLogReporter,L as fetchAds,G as getItemFromStore,J as getOrGenerateContextId,C as l,N as mapResponseToPlacementsWithContent,D as preloadImage,B as recordClick,I as removeItemFromStore,E as renderPlacement,H as setItemInStore};
1+
import{A as z,B as A,C as B,D as C,E as D,F as E,G as F,H as G,I as H,J as I,K as J,L as K,M as L,N as M,O as N,a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i,p as j,q as k,r as l,s as n,t as q,v as s,w as u,x as v,y as w,z as y}from"./chunk-YF7KTK47.mjs";import"./chunk-57T3EAOB.mjs";export{d as AdUnitFormatImpressionThreshold,b as AdUnitFormatTypeLookup,h as CLOSE_ICON_SVG,e as DEFAULT_SERVICE_ENDPOINT,g as DefaultImpressionThreshold,u as DefaultLogReporter,y as DefaultLogger,z as DefaultMozAdsImpressionObserver,l as FALLBACK_BILLBOARD_SVG,j as FALLBACK_DINO_SVG_FRAGMENT,k as FALLBACK_DONATE_SVG_FRAGMENT,q as FALLBACK_MRECTANGLE_SVG,n as FALLBACK_SKYSCRAPER_SVG,c as FallbackAdURL,K as FetchAdsError,a as FixedSize,t as IABFixedSize,f as INSTRUMENT_ENDPOINT,o as IS_BROWSER,r as IS_PRODUCTION,p as LOG_EMIT_FLAG_DEFAULT,m as LOG_TO_CONSOLE_FLAG_DEFAULT,w as LoggerLevel,x as NonIABFixedSize,i as REPORT_ICON_SVG,s as SeverityLevel,F as StoreType,M as buildPlacementsRequest,A as defaultImpressionObserver,v as defaultLogReporter,L as fetchAds,G as getItemFromStore,J as getOrGenerateContextId,C as l,N as mapResponseToPlacementsWithContent,D as preloadImage,B as recordClick,I as removeItemFromStore,E as renderPlacement,H as setItemInStore};

dist/iife.global.js

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"use client";import{B as A,C as M,F as f,M as z,u as h,z as l}from"./chunk-LJOP7BRQ.mjs";import"./chunk-57T3EAOB.mjs";import{useLayoutEffect as x,useRef as D}from"react";import{createContext as w,useContext as L,useEffect as R,useState as b}from"react";var C;try{C=new l({name:"react.hooks.useMozAdsPlacement"})}catch(e){console.debug(`DefaultLogger for react.hooks.useMozAdsPlacement could not be instantiated: ${e}`)}var u=class{placements={};async getPlacementWithContent(t){let a=this.placements[t.placementId];if(a)return a;try{let o=await z({placements:{[t.placementId]:t}});this.placements={...this.placements,...o}}catch(o){return C?.error(`Unable to fetch ads; ${o.message}`,{type:"placementComponent.adLoad.failure",eventLabel:"ad_load_error",errorId:o?.name}),t.onError?.({error:o}),t}return this.placements[t.placementId]}},k=w(new u),E=({placementId:e,iabContent:t,fixedSize:a,onError:o})=>{let[d,c]=b({placementId:e,iabContent:t,fixedSize:a}),i=L(k),m=async()=>{c(await i.getPlacementWithContent({placementId:e,iabContent:t,fixedSize:a,onError:o}))};return R(()=>{m()},[e]),d};import{jsx as v}from"react/jsx-runtime";var y;try{y=new l({name:"react.components.MozAdsPlacement"})}catch(e){console.debug(`DefaultLogger for react.components.MozAdsPlacement could not be instantiated: ${e}`)}function G({placementId:e,iabContent:t,fixedSize:a,onClick:o,onReport:d,onError:c,onLoad:i}){let{width:m,height:p}=a||{},g={width:m&&`${m}px`,height:p&&`${p}px`};try{let r=E({placementId:e,iabContent:t,fixedSize:a,onError:c}),s=D(null),P={onClick:n=>{M(r),o?.(n)},onReport:n=>{d?.(n)},onError:n=>{c?.(n)},onLoad:n=>{A.observe(r),i?.(n)}};return x(()=>{s.current&&f(s.current,{placement:r,...P,onError:()=>{let n=h(r);s.current&&f(s.current,{placement:{...r,content:n},...P})}})},[r]),v("div",{ref:s,style:g})}catch(r){try{y?.error(`An unexpected error has occured when rendering ${e}: ${r?.message}`,{type:"placementComponent.render.error",eventLabel:"render_error",placementId:e,errorId:r?.name}),c?.({error:r})}catch{}return v("div",{style:g})}}export{G as MozAdsPlacement,u as MozAdsPlacementContextState,k as mozAdsPlacementContext,E as useMozAdsPlacement};
1+
"use client";import{B as A,C as M,F as f,M as z,u as h,z as l}from"./chunk-YF7KTK47.mjs";import"./chunk-57T3EAOB.mjs";import{useLayoutEffect as x,useRef as D}from"react";import{createContext as w,useContext as L,useEffect as R,useState as b}from"react";var C;try{C=new l({name:"react.hooks.useMozAdsPlacement"})}catch(e){console.debug(`DefaultLogger for react.hooks.useMozAdsPlacement could not be instantiated: ${e}`)}var u=class{placements={};async getPlacementWithContent(t){let a=this.placements[t.placementId];if(a)return a;try{let o=await z({placements:{[t.placementId]:t}});this.placements={...this.placements,...o}}catch(o){return C?.error(`Unable to fetch ads; ${o.message}`,{type:"placementComponent.adLoad.failure",eventLabel:"ad_load_error",errorId:o?.name}),t.onError?.({error:o}),t}return this.placements[t.placementId]}},k=w(new u),E=({placementId:e,iabContent:t,fixedSize:a,onError:o})=>{let[d,c]=b({placementId:e,iabContent:t,fixedSize:a}),i=L(k),m=async()=>{c(await i.getPlacementWithContent({placementId:e,iabContent:t,fixedSize:a,onError:o}))};return R(()=>{m()},[e]),d};import{jsx as v}from"react/jsx-runtime";var y;try{y=new l({name:"react.components.MozAdsPlacement"})}catch(e){console.debug(`DefaultLogger for react.components.MozAdsPlacement could not be instantiated: ${e}`)}function G({placementId:e,iabContent:t,fixedSize:a,onClick:o,onReport:d,onError:c,onLoad:i}){let{width:m,height:p}=a||{},g={width:m&&`${m}px`,height:p&&`${p}px`};try{let r=E({placementId:e,iabContent:t,fixedSize:a,onError:c}),s=D(null),P={onClick:n=>{M(r),o?.(n)},onReport:n=>{d?.(n)},onError:n=>{c?.(n)},onLoad:n=>{A.observe(r),i?.(n)}};return x(()=>{s.current&&f(s.current,{placement:r,...P,onError:()=>{let n=h(r);s.current&&f(s.current,{placement:{...r,content:n},...P})}})},[r]),v("div",{ref:s,style:g})}catch(r){try{y?.error(`An unexpected error has occured when rendering ${e}: ${r?.message}`,{type:"placementComponent.render.error",eventLabel:"render_error",placementId:e,errorId:r?.name}),c?.({error:r})}catch{}return v("div",{style:g})}}export{G as MozAdsPlacement,u as MozAdsPlacementContextState,k as mozAdsPlacementContext,E as useMozAdsPlacement};

0 commit comments

Comments
 (0)