hypnagaga/packages/graphics-components/docs/assets/InlineAd-C9En6aKX.js

43 lines
2.6 KiB
JavaScript

import{j as n}from"./index-bIIEL2MP.js";import{useMDXComponents as t}from"./index-CO-0pc0F.js";import{M as i,C as s}from"./index-Z-6k0Xrj.js";import{I as p,D as d}from"./InlineAd.stories-Cl0PEmJ1.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./iframe-CzjIX-qr.js";import"./index-aQYXhgXp.js";import"./index-DrFu-skq.js";import"./props-b4vEeO_8.js";import"./runtime-C3rQLW--.js";import"./lifecycle-F2p_Qkk3.js";import"./ResponsiveAd-CbJNHDhi.js";import"./index-client-BAw8T8-V.js";import"./svelte-head-xbEMkVns.js";import"./throttle-CHB1Npaq.js";import"./svelte-component-C8Ginrj8.js";import"./key-BFGg-sHz.js";import"./window-DXjFTZv5.js";import"./attributes-Cg6aLqN3.js";import"./style-DvJ3IcV1.js";import"./Block-D3Ui8rd-.js";import"./snippet-C5kbqVpq.js";import"./create-runtime-stories-7AWWVphH.js";import"./get-C3XmtPLd.js";function o(r){const e={blockquote:"blockquote",code:"code",h1:"h1",p:"p",pre:"pre",strong:"strong",...t(),...r.components};return n.jsxs(n.Fragment,{children:[n.jsx(i,{of:p}),`
`,n.jsx(e.h1,{id:"inlinead",children:"InlineAd"}),`
`,n.jsx(e.p,{children:"Add programmatic ads inline on your page."}),`
`,n.jsxs(e.blockquote,{children:[`
`,n.jsxs(e.p,{children:[n.jsx(e.strong,{children:"IMPORTANT!"})," Make sure ads are only used on dotcom pages, never on embeds."]}),`
`]}),`
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-svelte",children:`<!-- +page.svelte -->
<script>
import { AdScripts } from '@reuters-graphics/graphics-components';
<\/script>
<!-- Include AdScripts only ONCE per page for any type of ad -->
<AdScripts />
`})}),`
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-svelte",children:`<!-- App.svelte -->
<script>
import { InlineAd } from '@reuters-graphics/graphics-components';
let { embedded = false } = $props();
<\/script>
{#each content.blocks as block}
<!-- ... -->
{#if block.Type === 'inline-ad'}
<!-- Check if in an embed context! -->
{#if !embedded}
<InlineAd />
{/if}
{/if}
<!-- ... -->
{/each}
`})}),`
`,n.jsxs(e.p,{children:["You may add ",n.jsx(e.strong,{children:"up to three"})," inline ads per page, but must set the ",n.jsx(e.code,{children:"n"})," prop on multiple ads in sequential order, 1 - 3."]}),`
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-svelte",children:`<!-- First inline ad on the page -->
<InlineAd n={1} />
<!-- ... second ... -->
<InlineAd n={2} />
<!-- ... third and final. -->
<InlineAd n={3} />
`})}),`
`,n.jsx(s,{of:d})]})}function E(r={}){const{wrapper:e}={...t(),...r.components};return e?n.jsx(e,{...r,children:n.jsx(o,{...r})}):o(r)}export{E as default};