This commit is contained in:
Jon McClure 2023-09-18 08:02:26 +01:00
parent 638a6f1037
commit 925a9477f3
439 changed files with 2191 additions and 2415 deletions

View file

@ -1,4 +1,4 @@
import{S as J,i as P,s as U,D as F,C as A,c as g,p as w,m as d,b as p,t as y,a as $,f as m,d as v,l as E,n as q}from"./index-2c1648fc.js";import{g as K,a as W}from"./spread-8a54911c.js";import{p as Q,M as X,T as z,S as N}from"./collect-stories-640c7888.js";import{w as H,b as T}from"./withParams-47e2ab71.js";const V=`Add Google and Chartbeat analytics to your page.
import{S as J,i as P,s as U,D as F,C as A,g as f,y as h,m as d,d as p,t as $,h as y,f as u,j as v,o as E,n as q}from"./index-4f5e5369.js";import{g as K,a as W}from"./spread-8a54911c.js";import{p as Q,M as X,T as z,S as b}from"./collect-stories-6e37d46b.js";import{w as H,b as L}from"./withParams-47e2ab71.js";const V=`Add Google and Chartbeat analytics to your page.
\`\`\`svelte
<script>
@ -58,8 +58,8 @@ For example, here's how you can use SvelteKit's [\`afterNavigate\`](https://kit.
<Analytics />
\`\`\`
`,O="G-W3Q2X6NTNM",L=`https://www.googletagmanager.com/gtag/js?id=${O}`,ee=()=>{if(document.querySelector(`script[src="${L}"]`))return;const a=document.createElement("script"),t=document.getElementsByTagName("script")[0];a.type="text/javascript",a.async=!0,a.src=L,t.parentNode.insertBefore(a,t)},te=()=>{try{window.dataLayer=window.dataLayer||[],window.gtag||(ee(),window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",O,{send_page_view:!1}),ne())}catch(a){console.warn(`Error initialising Google Analytics: ${a}`)}},ne=()=>{typeof window>"u"||!window.gtag||window.gtag("event","page_view",{page_location:window.location.origin+window.location.pathname,page_title:document==null?void 0:document.title})},se=52639,B="//static.chartbeat.com/js/chartbeat.js",ae=()=>{if(document.querySelector(`script[src="${B}"]`))return;const a=document.createElement("script"),t=document.getElementsByTagName("script")[0];a.type="text/javascript",a.async=!0,a.src=B,t.parentNode.insertBefore(a,t)},oe=a=>{window._sf_async_config={uid:se,domain:"reuters.com",flickerControl:!1,useCanonical:!0,useCanonicalDomain:!0,sections:"Graphics",authors:a.map(t=>(t==null?void 0:t.name)||"").join(","),...window._sf_async_config||{}};try{ae()}catch(t){console.warn(`Error initialising Chartbeat Analytics: ${t}`)}};function re(a,t,i){let{authors:s=[]}=t;return F(()=>{te(),oe(s)}),a.$$set=r=>{"authors"in r&&i(0,s=r.authors)},[s]}class h extends J{constructor(t){super(),P(this,t,re,null,U,{authors:0})}}h.__docgen={version:3,name:"Analytics.svelte",data:[{keywords:[],visibility:"public",description:"Used to associate a page with its author(s) in Chartbeat.",name:"authors",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"array",type:"array"}}],computed:[],methods:[{keywords:[],visibility:"public",description:"Register virtual pageviews when using client-side routing in multipage applications.",name:"registerPageview",static:!0}],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};function ie(a){let t,i,s,r;const n=[a[0]];let l={};for(let o=0;o<n.length;o+=1)l=A(l,n[o]);return t=new h({props:l}),{c(){g(t.$$.fragment),i=w(),s=E("div"),s.textContent="Nothing to see here"},m(o,u){d(t,o,u),p(o,i,u),p(o,s,u),r=!0},p(o,u){const f=u&1?K(n,[W(o[0])]):{};t.$set(f)},i(o){r||(y(t.$$.fragment,o),r=!0)},o(o){$(t.$$.fragment,o),r=!1},d(o){o&&(m(i),m(s)),v(t,o)}}}function ce(a){let t,i,s,r;return t=new h({}),{c(){g(t.$$.fragment),i=w(),s=E("div"),s.textContent="Nothing to see here"},m(n,l){d(t,n,l),p(n,i,l),p(n,s,l),r=!0},p:q,i(n){r||(y(t.$$.fragment,n),r=!0)},o(n){$(t.$$.fragment,n),r=!1},d(n){n&&(m(i),m(s)),v(t,n)}}}function le(a){let t,i,s,r;return t=new h({}),{c(){g(t.$$.fragment),i=w(),s=E("div"),s.textContent="Nothing to see here"},m(n,l){d(t,n,l),p(n,i,l),p(n,s,l),r=!0},p:q,i(n){r||(y(t.$$.fragment,n),r=!0)},o(n){$(t.$$.fragment,n),r=!1},d(n){n&&(m(i),m(s)),v(t,n)}}}function pe(a){let t,i,s,r,n,l,o,u,f,_;const x=[{title:"Components/Analytics"},{component:h},H(V)];let M={};for(let e=0;e<x.length;e+=1)M=A(M,x[e]);t=new X({props:M}),s=new z({props:{$$slots:{default:[ie,({args:e})=>({0:e}),({args:e})=>e?1:0]},$$scope:{ctx:a}}}),n=new N({props:{name:"Default",args:{authors:[{name:"Jane Doe"},{name:"John Doe"}]}}});const S=[{name:"Environments"},T(Y)];let b={$$slots:{default:[ce]},$$scope:{ctx:a}};for(let e=0;e<S.length;e+=1)b=A(b,S[e]);o=new N({props:b});const I=[{name:"Multipage apps"},T(Z)];let C={$$slots:{default:[le]},$$scope:{ctx:a}};for(let e=0;e<I.length;e+=1)C=A(C,I[e]);return f=new N({props:C}),{c(){g(t.$$.fragment),i=w(),g(s.$$.fragment),r=w(),g(n.$$.fragment),l=w(),g(o.$$.fragment),u=w(),g(f.$$.fragment)},m(e,c){d(t,e,c),p(e,i,c),d(s,e,c),p(e,r,c),d(n,e,c),p(e,l,c),d(o,e,c),p(e,u,c),d(f,e,c),_=!0},p(e,[c]){const R={};t.$set(R);const j={};c&3&&(j.$$scope={dirty:c,ctx:e}),s.$set(j);const k={};c&2&&(k.$$scope={dirty:c,ctx:e}),o.$set(k);const G={};c&2&&(G.$$scope={dirty:c,ctx:e}),f.$set(G)},i(e){_||(y(t.$$.fragment,e),y(s.$$.fragment,e),y(n.$$.fragment,e),y(o.$$.fragment,e),y(f.$$.fragment,e),_=!0)},o(e){$(t.$$.fragment,e),$(s.$$.fragment,e),$(n.$$.fragment,e),$(o.$$.fragment,e),$(f.$$.fragment,e),_=!1},d(e){e&&(m(i),m(r),m(l),m(u)),v(t,e),v(s,e),v(n,e),v(o,e),v(f,e)}}}class me extends J{constructor(t){super(),P(this,t,null,pe,U,{})}}const D=Q(me,{meta:{title:"Components/Analytics"},stories:{"tpl:default":{storyId:"components-analytics--default",name:"default",template:!0,source:`<Analytics {...args} />
<div>Nothing to see here</div>`,hasArgs:!0},Default:{storyId:"components-analytics--default",name:"Default",template:!1,source:"",hasArgs:!1},Environments:{storyId:"components-analytics--environments",name:"Environments",template:!1,source:`<Analytics />
<div>Nothing to see here</div>`,hasArgs:!1},MultipageApps:{storyId:"components-analytics--multipage-apps",name:"Multipage apps",template:!1,source:`<Analytics />
<div>Nothing to see here</div>`,hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","environmentsDocs","multipageDocs","Analytics","withComponentDocs","withStoryDocs"]}),ye=D.meta,$e=["Default","Environments","MultipageApps"],ve=D.stories.Default,we=D.stories.Environments,he=D.stories.MultipageApps;export{ve as Default,we as Environments,he as MultipageApps,$e as __namedExportsOrder,ye as default};
//# sourceMappingURL=Analytics.stories-930233b0.js.map
`,O="G-W3Q2X6NTNM",I=`https://www.googletagmanager.com/gtag/js?id=${O}`,ee=()=>{if(document.querySelector(`script[src="${I}"]`))return;const a=document.createElement("script"),t=document.getElementsByTagName("script")[0];a.type="text/javascript",a.async=!0,a.src=I,t.parentNode.insertBefore(a,t)},te=()=>{try{window.dataLayer=window.dataLayer||[],window.gtag||(ee(),window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",O,{send_page_view:!1}),ne())}catch(a){console.warn(`Error initialising Google Analytics: ${a}`)}},ne=()=>{typeof window>"u"||!window.gtag||window.gtag("event","page_view",{page_location:window.location.origin+window.location.pathname,page_title:document==null?void 0:document.title})},se=52639,B="//static.chartbeat.com/js/chartbeat.js",ae=()=>{if(document.querySelector(`script[src="${B}"]`))return;const a=document.createElement("script"),t=document.getElementsByTagName("script")[0];a.type="text/javascript",a.async=!0,a.src=B,t.parentNode.insertBefore(a,t)},oe=a=>{window._sf_async_config={uid:se,domain:"reuters.com",flickerControl:!1,useCanonical:!0,useCanonicalDomain:!0,sections:"Graphics",authors:a.map(t=>(t==null?void 0:t.name)||"").join(","),...window._sf_async_config||{}};try{ae()}catch(t){console.warn(`Error initialising Chartbeat Analytics: ${t}`)}};function re(a,t,i){let{authors:s=[]}=t;return F(()=>{te(),oe(s)}),a.$$set=r=>{"authors"in r&&i(0,s=r.authors)},[s]}class w extends J{constructor(t){super(),P(this,t,re,null,U,{authors:0})}}w.__docgen={version:3,name:"Analytics.svelte",data:[{keywords:[],visibility:"public",description:"Used to associate a page with its author(s) in Chartbeat.",name:"authors",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"array",type:"array"}}],computed:[],methods:[{keywords:[],visibility:"public",description:"Register virtual pageviews when using client-side routing in multipage applications.",name:"registerPageview",static:!0}],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};function ie(a){let t,i,s,r;const n=[a[0]];let l={};for(let o=0;o<n.length;o+=1)l=A(l,n[o]);return t=new w({props:l}),{c(){f(t.$$.fragment),i=h(),s=E("div"),s.textContent="Nothing to see here"},m(o,m){d(t,o,m),p(o,i,m),p(o,s,m),r=!0},p(o,m){const g=m&1?K(n,[W(o[0])]):{};t.$set(g)},i(o){r||($(t.$$.fragment,o),r=!0)},o(o){y(t.$$.fragment,o),r=!1},d(o){o&&(u(i),u(s)),v(t,o)}}}function ce(a){let t,i,s,r;return t=new w({}),{c(){f(t.$$.fragment),i=h(),s=E("div"),s.textContent="Nothing to see here"},m(n,l){d(t,n,l),p(n,i,l),p(n,s,l),r=!0},p:q,i(n){r||($(t.$$.fragment,n),r=!0)},o(n){y(t.$$.fragment,n),r=!1},d(n){n&&(u(i),u(s)),v(t,n)}}}function le(a){let t,i,s,r;return t=new w({}),{c(){f(t.$$.fragment),i=h(),s=E("div"),s.textContent="Nothing to see here"},m(n,l){d(t,n,l),p(n,i,l),p(n,s,l),r=!0},p:q,i(n){r||($(t.$$.fragment,n),r=!0)},o(n){y(t.$$.fragment,n),r=!1},d(n){n&&(u(i),u(s)),v(t,n)}}}function pe(a){let t,i,s,r,n,l,o,m,g,_;const x=[{title:"Components/Analytics"},{component:w},H(V)];let M={};for(let e=0;e<x.length;e+=1)M=A(M,x[e]);t=new X({props:M}),s=new z({props:{$$slots:{default:[ie,({args:e})=>({0:e}),({args:e})=>e?1:0]},$$scope:{ctx:a}}}),n=new b({props:{name:"Default",args:{authors:[{name:"Jane Doe"},{name:"John Doe"}]}}});const S=[{name:"Environments"},L(Y)];let C={$$slots:{default:[ce]},$$scope:{ctx:a}};for(let e=0;e<S.length;e+=1)C=A(C,S[e]);o=new b({props:C});const j=[{name:"Multipage apps"},L(Z)];let N={$$slots:{default:[le]},$$scope:{ctx:a}};for(let e=0;e<j.length;e+=1)N=A(N,j[e]);return g=new b({props:N}),{c(){f(t.$$.fragment),i=h(),f(s.$$.fragment),r=h(),f(n.$$.fragment),l=h(),f(o.$$.fragment),m=h(),f(g.$$.fragment)},m(e,c){d(t,e,c),p(e,i,c),d(s,e,c),p(e,r,c),d(n,e,c),p(e,l,c),d(o,e,c),p(e,m,c),d(g,e,c),_=!0},p(e,[c]){const R={};t.$set(R);const k={};c&3&&(k.$$scope={dirty:c,ctx:e}),s.$set(k);const G={};c&2&&(G.$$scope={dirty:c,ctx:e}),o.$set(G);const T={};c&2&&(T.$$scope={dirty:c,ctx:e}),g.$set(T)},i(e){_||($(t.$$.fragment,e),$(s.$$.fragment,e),$(n.$$.fragment,e),$(o.$$.fragment,e),$(g.$$.fragment,e),_=!0)},o(e){y(t.$$.fragment,e),y(s.$$.fragment,e),y(n.$$.fragment,e),y(o.$$.fragment,e),y(g.$$.fragment,e),_=!1},d(e){e&&(u(i),u(r),u(l),u(m)),v(t,e),v(s,e),v(n,e),v(o,e),v(g,e)}}}class ue extends J{constructor(t){super(),P(this,t,null,pe,U,{})}}const D=Q(ue,{meta:{title:"Components/Analytics"},stories:{"tpl:default":{name:"default",template:!0,source:`<Analytics {...args} />
<div>Nothing to see here</div>`,hasArgs:!0},Default:{name:"Default",template:!1,source:"",hasArgs:!1},Environments:{name:"Environments",template:!1,source:`<Analytics />
<div>Nothing to see here</div>`,hasArgs:!1},MultipageApps:{name:"Multipage apps",template:!1,source:`<Analytics />
<div>Nothing to see here</div>`,hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","environmentsDocs","multipageDocs","Analytics","withComponentDocs","withStoryDocs"]}),$e=D.meta,ye=["Default","Environments","MultipageApps"],ve=D.stories.Default,he=D.stories.Environments,we=D.stories.MultipageApps;export{ve as Default,he as Environments,we as MultipageApps,ye as __namedExportsOrder,$e as default};
//# sourceMappingURL=Analytics.stories-29b3816b.js.map

View file

@ -1,2 +1,2 @@
import{S as b,i as y,s as _,u as w,l as f,h as u,B as m,b as h,k as p,G as k,v as j,w as g,x as v,I as A,t as S,a as V,f as W}from"./index-2c1648fc.js";const E=(s,i)=>(Object.entries(i).forEach(([t,n])=>{s.style.setProperty(`--${t}`,n)}),{update(t){Object.entries(t).forEach(([n,o])=>{s.style.setProperty(`--${n}`,o),delete i[n]}),Object.keys(i).forEach(n=>{s.style.removeProperty(`--${n}`)}),i=t}});function O(s){let i,t,n,o,d,c;const r=s[6].default,a=w(r,s,s[5],null);return{c(){i=f("main"),t=f("article"),a&&a.c(),u(t,"id",s[1]),u(t,"role",s[2]),u(t,"class","svelte-jd0c2r"),m(t,"embedded",s[0])},m(e,l){h(e,i,l),p(i,t),a&&a.m(t,null),o=!0,d||(c=k(n=E.call(null,t,s[3])),d=!0)},p(e,[l]){a&&a.p&&(!o||l&32)&&j(a,r,e,e[5],o?v(r,e[5],l,null):g(e[5]),null),(!o||l&2)&&u(t,"id",e[1]),(!o||l&4)&&u(t,"role",e[2]),n&&A(n.update)&&l&8&&n.update.call(null,e[3]),(!o||l&1)&&m(t,"embedded",e[0])},i(e){o||(S(a,e),o=!0)},o(e){V(a,e),o=!1},d(e){e&&W(i),a&&a.d(e),d=!1,c()}}}function C(s,i,t){let n,{$$slots:o={},$$scope:d}=i,{embedded:c=!1}=i,{id:r=null}=i,{role:a=null}=i,{columnWidths:e={narrower:330,narrow:510,normal:660,wide:930,wider:1200}}=i;return s.$$set=l=>{"embedded"in l&&t(0,c=l.embedded),"id"in l&&t(1,r=l.id),"role"in l&&t(2,a=l.role),"columnWidths"in l&&t(4,e=l.columnWidths),"$$scope"in l&&t(5,d=l.$$scope)},s.$$.update=()=>{s.$$.dirty&16&&t(3,n={"narrower-column-width":e.narrower+"px","narrow-column-width":e.narrow+"px","normal-column-width":e.normal+"px","wide-column-width":e.wide+"px","wider-column-width":e.wider+"px"})},[c,r,a,n,e,d,o]}class I extends b{constructor(i){super(),y(this,i,C,O,_,{embedded:0,id:1,role:2,columnWidths:4})}}I.__docgen={version:3,name:"Article.svelte",data:[{keywords:[],visibility:"public",description:"Set to true for embeddables.",name:"embedded",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[],visibility:"public",description:"Add an id to the article tag to target it with custom CSS.",name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"},defaultValue:null},{keywords:[],visibility:"public",description:"ARIA role of the article",name:"role",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"},defaultValue:null},{keywords:[],visibility:"public",description:"Set custom widths for the normal, wide and wider column dimensions",name:"columnWidths",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"}}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"Article content",name:"default"}],refs:[]};export{I as A};
//# sourceMappingURL=Article-446669e0.js.map
import{S as b,i as y,s as _,l as w,o as f,b as u,p as m,d as h,e as p,G as k,u as j,q as g,r as v,I as A,t as S,h as V,f as W}from"./index-4f5e5369.js";const E=(s,i)=>(Object.entries(i).forEach(([t,n])=>{s.style.setProperty(`--${t}`,n)}),{update(t){Object.entries(t).forEach(([n,o])=>{s.style.setProperty(`--${n}`,o),delete i[n]}),Object.keys(i).forEach(n=>{s.style.removeProperty(`--${n}`)}),i=t}});function O(s){let i,t,n,o,d,c;const r=s[6].default,a=w(r,s,s[5],null);return{c(){i=f("main"),t=f("article"),a&&a.c(),u(t,"id",s[1]),u(t,"role",s[2]),u(t,"class","svelte-jd0c2r"),m(t,"embedded",s[0])},m(e,l){h(e,i,l),p(i,t),a&&a.m(t,null),o=!0,d||(c=k(n=E.call(null,t,s[3])),d=!0)},p(e,[l]){a&&a.p&&(!o||l&32)&&j(a,r,e,e[5],o?v(r,e[5],l,null):g(e[5]),null),(!o||l&2)&&u(t,"id",e[1]),(!o||l&4)&&u(t,"role",e[2]),n&&A(n.update)&&l&8&&n.update.call(null,e[3]),(!o||l&1)&&m(t,"embedded",e[0])},i(e){o||(S(a,e),o=!0)},o(e){V(a,e),o=!1},d(e){e&&W(i),a&&a.d(e),d=!1,c()}}}function q(s,i,t){let n,{$$slots:o={},$$scope:d}=i,{embedded:c=!1}=i,{id:r=null}=i,{role:a=null}=i,{columnWidths:e={narrower:330,narrow:510,normal:660,wide:930,wider:1200}}=i;return s.$$set=l=>{"embedded"in l&&t(0,c=l.embedded),"id"in l&&t(1,r=l.id),"role"in l&&t(2,a=l.role),"columnWidths"in l&&t(4,e=l.columnWidths),"$$scope"in l&&t(5,d=l.$$scope)},s.$$.update=()=>{s.$$.dirty&16&&t(3,n={"narrower-column-width":e.narrower+"px","narrow-column-width":e.narrow+"px","normal-column-width":e.normal+"px","wide-column-width":e.wide+"px","wider-column-width":e.wider+"px"})},[c,r,a,n,e,d,o]}class C extends b{constructor(i){super(),y(this,i,q,O,_,{embedded:0,id:1,role:2,columnWidths:4})}}C.__docgen={version:3,name:"Article.svelte",data:[{keywords:[],visibility:"public",description:"Set to true for embeddables.",name:"embedded",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[],visibility:"public",description:"Add an id to the article tag to target it with custom CSS.",name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"},defaultValue:null},{keywords:[],visibility:"public",description:"ARIA role of the article",name:"role",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"},defaultValue:null},{keywords:[],visibility:"public",description:"Set custom widths for the normal, wide and wider column dimensions",name:"columnWidths",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"}}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"Article content",name:"default"}],refs:[]};export{C as A};
//# sourceMappingURL=Article-d7d48bf1.js.map

View file

@ -1 +1 @@
{"version":3,"file":"Article-446669e0.js","sources":["../../src/actions/cssVariables/index.js","../../src/components/Article/Article.svelte"],"sourcesContent":["// Shamelessly stolen from: https://github.com/kaisermann/svelte-css-vars\nexport default (node, props) => {\n Object.entries(props).forEach(([key, value]) => {\n node.style.setProperty(`--${key}`, value);\n });\n\n return {\n update(newProps) {\n Object.entries(newProps).forEach(([key, value]) => {\n node.style.setProperty(`--${key}`, value);\n delete props[key];\n });\n\n Object.keys(props).forEach((name) => {\n node.style.removeProperty(`--${name}`);\n });\n props = newProps;\n },\n };\n};\n","<!-- @component `Article` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/layout-article--default) -->\n<script lang=\"ts\">\n /** Set to true for embeddables. */\n export let embedded: boolean = false;\n\n /** Add an id to the article tag to target it with custom CSS. */\n export let id: string | null = null;\n\n /** ARIA role of the article */\n export let role: string | null = null;\n\n interface ColumnWidths {\n /** Narrower column width */\n narrower: number;\n /** Narrow column width */\n narrow: number;\n /** Normal column width */\n normal: number;\n /** Wide column width */\n wide: number;\n /** Wider column width */\n wider: number;\n }\n\n /** Set custom widths for the normal, wide and wider column dimensions */\n export let columnWidths: ColumnWidths = {\n narrower: 330,\n narrow: 510,\n normal: 660,\n wide: 930,\n wider: 1200,\n };\n\n import cssVariables from '../../actions/cssVariables/index.js';\n\n $: columnWidthVars = {\n 'narrower-column-width': columnWidths.narrower + 'px',\n 'narrow-column-width': columnWidths.narrow + 'px',\n 'normal-column-width': columnWidths.normal + 'px',\n 'wide-column-width': columnWidths.wide + 'px',\n 'wider-column-width': columnWidths.wider + 'px',\n };\n</script>\n\n<main>\n <article\n id=\"{id}\"\n class:embedded=\"{embedded}\"\n role=\"{role}\"\n use:cssVariables=\"{columnWidthVars}\"\n >\n <!-- Article content -->\n <slot />\n </article>\n</main>\n\n<style lang=\"scss\">\n article {\n width: 100%;\n display: block;\n margin: 0;\n padding: 0 15px;\n background-color: var(--theme-colour-background, transparent);\n &.embedded {\n overflow: auto;\n }\n }\n</style>\n"],"names":["cssVariables","node","props","key","value","newProps","name","ctx","insert","target","main","anchor","append","article","embedded","$$props","id","role","columnWidths","columnWidthVars"],"mappings":"wJACA,MAAAA,EAAe,CAACC,EAAMC,KACpB,OAAO,QAAQA,CAAK,EAAE,QAAQ,CAAC,CAACC,EAAKC,CAAK,IAAM,CAC9CH,EAAK,MAAM,YAAY,KAAKE,CAAG,GAAIC,CAAK,CAC5C,CAAG,EAEM,CACL,OAAOC,EAAU,CACf,OAAO,QAAQA,CAAQ,EAAE,QAAQ,CAAC,CAACF,EAAKC,CAAK,IAAM,CACjDH,EAAK,MAAM,YAAY,KAAKE,CAAG,GAAIC,CAAK,EACxC,OAAOF,EAAMC,CAAG,CACxB,CAAO,EAED,OAAO,KAAKD,CAAK,EAAE,QAASI,GAAS,CACnCL,EAAK,MAAM,eAAe,KAAKK,CAAI,EAAE,CAC7C,CAAO,EACDJ,EAAQG,CACT,CACL,iIC4BSE,EAAE,CAAA,CAAA,aAEAA,EAAI,CAAA,CAAA,8CADMA,EAAQ,CAAA,CAAA,UAH7BC,EAUMC,EAAAC,EAAAC,CAAA,EATJC,EAQSF,EAAAG,CAAA,8CAJYN,EAAe,CAAA,CAAA,CAAA,wGAH7BA,EAAE,CAAA,CAAA,wBAEAA,EAAI,CAAA,CAAA,0CACQA,EAAe,CAAA,CAAA,4BAFjBA,EAAQ,CAAA,CAAA,iIA5ChB,CAAA,SAAAO,EAAoB,EAAK,EAAAC,EAGzB,CAAA,GAAAC,EAAoB,IAAI,EAAAD,EAGxB,CAAA,KAAAE,EAAsB,IAAI,EAAAF,GAgB1B,aAAAG,EAAY,CACrB,SAAU,IACV,OAAQ,IACR,OAAQ,IACR,KAAM,IACN,MAAO,6NAKNC,EAAe,CAChB,wBAAyBD,EAAa,SAAW,KACjD,sBAAuBA,EAAa,OAAS,KAC7C,sBAAuBA,EAAa,OAAS,KAC7C,oBAAqBA,EAAa,KAAO,KACzC,qBAAsBA,EAAa,MAAQ"}
{"version":3,"file":"Article-d7d48bf1.js","sources":["../../src/actions/cssVariables/index.js","../../src/components/Article/Article.svelte"],"sourcesContent":["// Shamelessly stolen from: https://github.com/kaisermann/svelte-css-vars\nexport default (node, props) => {\n Object.entries(props).forEach(([key, value]) => {\n node.style.setProperty(`--${key}`, value);\n });\n\n return {\n update(newProps) {\n Object.entries(newProps).forEach(([key, value]) => {\n node.style.setProperty(`--${key}`, value);\n delete props[key];\n });\n\n Object.keys(props).forEach((name) => {\n node.style.removeProperty(`--${name}`);\n });\n props = newProps;\n },\n };\n};\n","<!-- @component `Article` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/layout-article--default) -->\n<script lang=\"ts\">\n /** Set to true for embeddables. */\n export let embedded: boolean = false;\n\n /** Add an id to the article tag to target it with custom CSS. */\n export let id: string | null = null;\n\n /** ARIA role of the article */\n export let role: string | null = null;\n\n interface ColumnWidths {\n /** Narrower column width */\n narrower: number;\n /** Narrow column width */\n narrow: number;\n /** Normal column width */\n normal: number;\n /** Wide column width */\n wide: number;\n /** Wider column width */\n wider: number;\n }\n\n /** Set custom widths for the normal, wide and wider column dimensions */\n export let columnWidths: ColumnWidths = {\n narrower: 330,\n narrow: 510,\n normal: 660,\n wide: 930,\n wider: 1200,\n };\n\n import cssVariables from '../../actions/cssVariables/index.js';\n\n $: columnWidthVars = {\n 'narrower-column-width': columnWidths.narrower + 'px',\n 'narrow-column-width': columnWidths.narrow + 'px',\n 'normal-column-width': columnWidths.normal + 'px',\n 'wide-column-width': columnWidths.wide + 'px',\n 'wider-column-width': columnWidths.wider + 'px',\n };\n</script>\n\n<main>\n <article\n id=\"{id}\"\n class:embedded=\"{embedded}\"\n role=\"{role}\"\n use:cssVariables=\"{columnWidthVars}\"\n >\n <!-- Article content -->\n <slot />\n </article>\n</main>\n\n<style lang=\"scss\">\n article {\n width: 100%;\n display: block;\n margin: 0;\n padding: 0 15px;\n background-color: var(--theme-colour-background, transparent);\n &.embedded {\n overflow: auto;\n }\n }\n</style>\n"],"names":["cssVariables","node","props","key","value","newProps","name","ctx","insert","target","main","anchor","append","article","embedded","$$props","id","role","columnWidths","columnWidthVars"],"mappings":"wJACA,MAAAA,EAAe,CAACC,EAAMC,KACpB,OAAO,QAAQA,CAAK,EAAE,QAAQ,CAAC,CAACC,EAAKC,CAAK,IAAM,CAC9CH,EAAK,MAAM,YAAY,KAAKE,CAAG,GAAIC,CAAK,CAC5C,CAAG,EAEM,CACL,OAAOC,EAAU,CACf,OAAO,QAAQA,CAAQ,EAAE,QAAQ,CAAC,CAACF,EAAKC,CAAK,IAAM,CACjDH,EAAK,MAAM,YAAY,KAAKE,CAAG,GAAIC,CAAK,EACxC,OAAOF,EAAMC,CAAG,CACxB,CAAO,EAED,OAAO,KAAKD,CAAK,EAAE,QAASI,GAAS,CACnCL,EAAK,MAAM,eAAe,KAAKK,CAAI,EAAE,CAC7C,CAAO,EACDJ,EAAQG,CACT,CACL,iIC4BSE,EAAE,CAAA,CAAA,aAEAA,EAAI,CAAA,CAAA,8CADMA,EAAQ,CAAA,CAAA,UAH7BC,EAUMC,EAAAC,EAAAC,CAAA,EATJC,EAQSF,EAAAG,CAAA,8CAJYN,EAAe,CAAA,CAAA,CAAA,wGAH7BA,EAAE,CAAA,CAAA,wBAEAA,EAAI,CAAA,CAAA,0CACQA,EAAe,CAAA,CAAA,4BAFjBA,EAAQ,CAAA,CAAA,iIA5ChB,CAAA,SAAAO,EAAoB,EAAK,EAAAC,EAGzB,CAAA,GAAAC,EAAoB,IAAI,EAAAD,EAGxB,CAAA,KAAAE,EAAsB,IAAI,EAAAF,GAgB1B,aAAAG,EAAY,CACrB,SAAU,IACV,OAAQ,IACR,OAAQ,IACR,KAAM,IACN,MAAO,6NAKNC,EAAe,CAChB,wBAAyBD,EAAa,SAAW,KACjD,sBAAuBA,EAAa,OAAS,KAC7C,sBAAuBA,EAAa,OAAS,KAC7C,oBAAqBA,EAAa,KAAO,KACzC,qBAAsBA,EAAa,MAAQ"}

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
import{S as y,i as k,s as m,u as _,l as h,h as d,B as b,b as p,v as w,w as g,x as v,t as A,a as S,f as V}from"./index-2c1648fc.js";function B(l){let e,n,a;const c=l[7].default,i=_(c,l,l[6],null);return{c(){e=h("div"),i&&i.c(),d(e,"id",l[1]),d(e,"class",n="article-block fmx-auto "+l[0]+" "+l[2]+" svelte-lsty9"),d(e,"role",l[4]),d(e,"aria-label",l[5]),b(e,"snap",l[3]&&l[0]!=="fluid"&&l[0]!=="widest")},m(t,o){p(t,e,o),i&&i.m(e,null),a=!0},p(t,[o]){i&&i.p&&(!a||o&64)&&w(i,c,t,t[6],a?v(c,t[6],o,null):g(t[6]),null),(!a||o&2)&&d(e,"id",t[1]),(!a||o&5&&n!==(n="article-block fmx-auto "+t[0]+" "+t[2]+" svelte-lsty9"))&&d(e,"class",n),(!a||o&16)&&d(e,"role",t[4]),(!a||o&32)&&d(e,"aria-label",t[5]),(!a||o&13)&&b(e,"snap",t[3]&&t[0]!=="fluid"&&t[0]!=="widest")},i(t){a||(A(i,t),a=!0)},o(t){S(i,t),a=!1},d(t){t&&V(e),i&&i.d(t)}}}function L(l,e,n){let{$$slots:a={},$$scope:c}=e,{width:i="normal"}=e,{id:t=""}=e,{class:o=""}=e,{snap:r=!1}=e,{role:f=null}=e,{ariaLabel:u=null}=e;return l.$$set=s=>{"width"in s&&n(0,i=s.width),"id"in s&&n(1,t=s.id),"class"in s&&n(2,o=s.class),"snap"in s&&n(3,r=s.snap),"role"in s&&n(4,f=s.role),"ariaLabel"in s&&n(5,u=s.ariaLabel),"$$scope"in s&&n(6,c=s.$$scope)},[i,t,o,r,f,u,c,a]}class R extends y{constructor(e){super(),k(this,e,L,B,m,{width:0,id:1,class:2,snap:3,role:4,ariaLabel:5})}}R.__docgen={version:3,name:"Block.svelte",data:[{keywords:[],visibility:"public",description:"Width of the block within the article well.",name:"width",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"normal"},{keywords:[],visibility:"public",description:"Add an id to the block tag to target it with custom CSS.",name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""},{visibility:"public",description:"Add extra classes to the block tag to target it with custom CSS.",keywords:[],name:"class",kind:"const",static:!1,readonly:!0,type:{kind:"type",text:"string",type:"string"},localName:"cls",defaultValue:""},{keywords:[],visibility:"public",description:"Snap block to column widths, rather than fluidly resizing them.",name:"snap",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[],visibility:"public",description:"ARIA [role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) for the block",name:"role",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"},defaultValue:null},{keywords:[],visibility:"public",description:"ARIA [label](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) for the block",name:"ariaLabel",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"},defaultValue:null}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"block content",name:"default"}],refs:[]};export{R as B};
//# sourceMappingURL=Block-d69850f9.js.map
import{S as y,i as k,s as m,l as _,o as h,b as d,p as b,d as p,u as g,q as w,r as v,t as A,h as S,f as V}from"./index-4f5e5369.js";function L(l){let e,n,a;const r=l[7].default,i=_(r,l,l[6],null);return{c(){e=h("div"),i&&i.c(),d(e,"id",l[1]),d(e,"class",n="article-block fmx-auto "+l[0]+" "+l[2]+" svelte-lsty9"),d(e,"role",l[4]),d(e,"aria-label",l[5]),b(e,"snap",l[3]&&l[0]!=="fluid"&&l[0]!=="widest")},m(t,o){p(t,e,o),i&&i.m(e,null),a=!0},p(t,[o]){i&&i.p&&(!a||o&64)&&g(i,r,t,t[6],a?v(r,t[6],o,null):w(t[6]),null),(!a||o&2)&&d(e,"id",t[1]),(!a||o&5&&n!==(n="article-block fmx-auto "+t[0]+" "+t[2]+" svelte-lsty9"))&&d(e,"class",n),(!a||o&16)&&d(e,"role",t[4]),(!a||o&32)&&d(e,"aria-label",t[5]),(!a||o&13)&&b(e,"snap",t[3]&&t[0]!=="fluid"&&t[0]!=="widest")},i(t){a||(A(i,t),a=!0)},o(t){S(i,t),a=!1},d(t){t&&V(e),i&&i.d(t)}}}function R(l,e,n){let{$$slots:a={},$$scope:r}=e,{width:i="normal"}=e,{id:t=""}=e,{class:o=""}=e,{snap:c=!1}=e,{role:f=null}=e,{ariaLabel:u=null}=e;return l.$$set=s=>{"width"in s&&n(0,i=s.width),"id"in s&&n(1,t=s.id),"class"in s&&n(2,o=s.class),"snap"in s&&n(3,c=s.snap),"role"in s&&n(4,f=s.role),"ariaLabel"in s&&n(5,u=s.ariaLabel),"$$scope"in s&&n(6,r=s.$$scope)},[i,t,o,c,f,u,r,a]}class j extends y{constructor(e){super(),k(this,e,R,L,m,{width:0,id:1,class:2,snap:3,role:4,ariaLabel:5})}}j.__docgen={version:3,name:"Block.svelte",data:[{keywords:[],visibility:"public",description:"Width of the block within the article well.",name:"width",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"normal"},{keywords:[],visibility:"public",description:"Add an id to the block tag to target it with custom CSS.",name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""},{visibility:"public",description:"Add extra classes to the block tag to target it with custom CSS.",keywords:[],name:"class",kind:"const",static:!1,readonly:!0,type:{kind:"type",text:"string",type:"string"},localName:"cls",defaultValue:""},{keywords:[],visibility:"public",description:"Snap block to column widths, rather than fluidly resizing them.",name:"snap",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[],visibility:"public",description:"ARIA [role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) for the block",name:"role",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"},defaultValue:null},{keywords:[],visibility:"public",description:"ARIA [label](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) for the block",name:"ariaLabel",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"},defaultValue:null}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"block content",name:"default"}],refs:[]};export{j as B};
//# sourceMappingURL=Block-67c7bec3.js.map

View file

@ -1 +1 @@
{"version":3,"file":"Block-d69850f9.js","sources":["../../src/components/Block/Block.svelte"],"sourcesContent":["<!-- @component `Block` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/layout-block--default) -->\n<script lang=\"ts\">\n import type { ContainerWidth } from '../@types/global';\n\n /** Width of the block within the article well. */\n export let width: ContainerWidth = 'normal';\n\n /** Add an id to the block tag to target it with custom CSS. */\n export let id: string = '';\n\n /** Add extra classes to the block tag to target it with custom CSS. */\n let cls: string = '';\n export { cls as class };\n\n /** Snap block to column widths, rather than fluidly resizing them. */\n export let snap: boolean = false;\n\n /** ARIA [role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) for the block */\n export let role: string | null = null;\n\n /** ARIA [label](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) for the block */\n export let ariaLabel: string | null = null;\n</script>\n\n<div\n id=\"{id}\"\n class=\"article-block fmx-auto {width} {cls}\"\n class:snap=\"{snap && width !== 'fluid' && width !== 'widest'}\"\n role=\"{role}\"\n aria-label=\"{ariaLabel}\"\n>\n <!-- block content -->\n <slot />\n</div>\n\n<style lang=\"scss\">\n @import '../../scss/mixins';\n\n .article-block {\n max-width: var(--normal-column-width, 660px);\n\n &.narrower {\n max-width: var(--narrower-column-width, 330px);\n }\n\n &.narrow {\n max-width: var(--narrow-column-width, 510px);\n }\n\n &.wide {\n max-width: var(--wide-column-width, 930px);\n }\n\n &.wider {\n max-width: var(--wider-column-width, 1200px);\n }\n\n &.widest {\n max-width: 100%;\n }\n\n &.fluid {\n width: calc(100% + 30px);\n margin-left: -15px;\n max-width: none;\n }\n\n // Only setup for the default column widths, b/c can't use\n // CSS vars in media queries.\n &.snap {\n @include block-snap-widths;\n }\n }\n</style>\n"],"names":["ctx","attr","div","div_class_value","toggle_class","insert","target","anchor","current","dirty","width","$$props","id","cls","snap","role","ariaLabel"],"mappings":"2OAyBOA,EAAE,CAAA,CAAA,EACwBC,EAAAC,EAAA,QAAAC,EAAA,0BAAAH,SAAQA,EAAG,CAAA,EAAA,eAAA,aAEnCA,EAAI,CAAA,CAAA,mBACEA,EAAS,CAAA,CAAA,EAFTI,EAAAF,EAAA,OAAAF,MAAQA,EAAK,CAAA,IAAK,SAAWA,OAAU,QAAQ,UAH9DK,EASKC,EAAAJ,EAAAK,CAAA,sHAREP,EAAE,CAAA,CAAA,GACwB,CAAAQ,GAAAC,EAAA,GAAAN,KAAAA,EAAA,0BAAAH,SAAQA,EAAG,CAAA,EAAA,yDAEnCA,EAAI,CAAA,CAAA,+BACEA,EAAS,CAAA,CAAA,cAFTI,EAAAF,EAAA,OAAAF,MAAQA,EAAK,CAAA,IAAK,SAAWA,OAAU,QAAQ,qHAtBjD,CAAA,MAAAU,EAAwB,QAAQ,EAAAC,EAGhC,CAAA,GAAAC,EAAa,EAAE,EAAAD,EAGtB,CAAA,MAAAE,EAAc,EAAE,EAAAF,EAIT,CAAA,KAAAG,EAAgB,EAAK,EAAAH,EAGrB,CAAA,KAAAI,EAAsB,IAAI,EAAAJ,EAG1B,CAAA,UAAAK,EAA2B,IAAI,EAAAL"}
{"version":3,"file":"Block-67c7bec3.js","sources":["../../src/components/Block/Block.svelte"],"sourcesContent":["<!-- @component `Block` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/layout-block--default) -->\n<script lang=\"ts\">\n import type { ContainerWidth } from '../@types/global';\n\n /** Width of the block within the article well. */\n export let width: ContainerWidth = 'normal';\n\n /** Add an id to the block tag to target it with custom CSS. */\n export let id: string = '';\n\n /** Add extra classes to the block tag to target it with custom CSS. */\n let cls: string = '';\n export { cls as class };\n\n /** Snap block to column widths, rather than fluidly resizing them. */\n export let snap: boolean = false;\n\n /** ARIA [role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) for the block */\n export let role: string | null = null;\n\n /** ARIA [label](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) for the block */\n export let ariaLabel: string | null = null;\n</script>\n\n<div\n id=\"{id}\"\n class=\"article-block fmx-auto {width} {cls}\"\n class:snap=\"{snap && width !== 'fluid' && width !== 'widest'}\"\n role=\"{role}\"\n aria-label=\"{ariaLabel}\"\n>\n <!-- block content -->\n <slot />\n</div>\n\n<style lang=\"scss\">\n @import '../../scss/mixins';\n\n .article-block {\n max-width: var(--normal-column-width, 660px);\n\n &.narrower {\n max-width: var(--narrower-column-width, 330px);\n }\n\n &.narrow {\n max-width: var(--narrow-column-width, 510px);\n }\n\n &.wide {\n max-width: var(--wide-column-width, 930px);\n }\n\n &.wider {\n max-width: var(--wider-column-width, 1200px);\n }\n\n &.widest {\n max-width: 100%;\n }\n\n &.fluid {\n width: calc(100% + 30px);\n margin-left: -15px;\n max-width: none;\n }\n\n // Only setup for the default column widths, b/c can't use\n // CSS vars in media queries.\n &.snap {\n @include block-snap-widths;\n }\n }\n</style>\n"],"names":["ctx","attr","div","div_class_value","toggle_class","insert","target","anchor","current","dirty","width","$$props","id","cls","snap","role","ariaLabel"],"mappings":"2OAyBOA,EAAE,CAAA,CAAA,EACwBC,EAAAC,EAAA,QAAAC,EAAA,0BAAAH,SAAQA,EAAG,CAAA,EAAA,eAAA,aAEnCA,EAAI,CAAA,CAAA,mBACEA,EAAS,CAAA,CAAA,EAFTI,EAAAF,EAAA,OAAAF,MAAQA,EAAK,CAAA,IAAK,SAAWA,OAAU,QAAQ,UAH9DK,EASKC,EAAAJ,EAAAK,CAAA,sHAREP,EAAE,CAAA,CAAA,GACwB,CAAAQ,GAAAC,EAAA,GAAAN,KAAAA,EAAA,0BAAAH,SAAQA,EAAG,CAAA,EAAA,yDAEnCA,EAAI,CAAA,CAAA,+BACEA,EAAS,CAAA,CAAA,cAFTI,EAAAF,EAAA,OAAAF,MAAQA,EAAK,CAAA,IAAK,SAAWA,OAAU,QAAQ,qHAtBjD,CAAA,MAAAU,EAAwB,QAAQ,EAAAC,EAGhC,CAAA,GAAAC,EAAa,EAAE,EAAAD,EAGtB,CAAA,MAAAE,EAAc,EAAE,EAAAF,EAIT,CAAA,KAAAG,EAAgB,EAAK,EAAAH,EAGrB,CAAA,KAAAI,EAAsB,IAAI,EAAAJ,EAG1B,CAAA,UAAAK,EAA2B,IAAI,EAAAL"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,2 @@
import{S as m,i as u,s as p,g as y,m as _,t as k,h as g,j as b,k as c,d,f,H as w}from"./index-4f5e5369.js";import{m as o}from"./marked.esm-76161808.js";import{B as h}from"./Block-67c7bec3.js";function r(a){let s,t=o.parse(a[0])+"",e;return{c(){s=new w(!1),e=c(),s.a=e},m(i,n){s.m(t,i,n),d(i,e,n)},p(i,n){n&1&&t!==(t=o.parse(i[0])+"")&&s.p(t)},d(i){i&&(f(e),s.d())}}}function S(a){let s,t=a[0]&&r(a);return{c(){t&&t.c(),s=c()},m(e,i){t&&t.m(e,i),d(e,s,i)},p(e,i){e[0]?t?t.p(e,i):(t=r(e),t.c(),t.m(s.parentNode,s)):t&&(t.d(1),t=null)},d(e){e&&f(s),t&&t.d(e)}}}function v(a){let s,t;return s=new h({props:{id:a[2],class:"fmy-6 "+a[1],$$slots:{default:[S]},$$scope:{ctx:a}}}),{c(){y(s.$$.fragment)},m(e,i){_(s,e,i),t=!0},p(e,[i]){const n={};i&4&&(n.id=e[2]),i&2&&(n.class="fmy-6 "+e[1]),i&9&&(n.$$scope={dirty:i,ctx:e}),s.$set(n)},i(e){t||(k(s.$$.fragment,e),t=!0)},o(e){g(s.$$.fragment,e),t=!1},d(e){b(s,e)}}}function x(a,s,t){let{text:e}=s,{class:i=""}=s,{id:n=""}=s;return a.$$set=l=>{"text"in l&&t(0,e=l.text),"class"in l&&t(1,i=l.class),"id"in l&&t(2,n=l.id)},[e,i,n]}class B extends m{constructor(s){super(),u(this,s,x,v,p,{text:0,class:1,id:2})}}B.__docgen={version:3,name:"BodyText.svelte",data:[{keywords:[{name:"type",description:"{string}"},{name:"required",description:""}],visibility:"public",description:"A markdown text string.",name:"text",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"}},{visibility:"public",description:"Add a class to target with SCSS.",keywords:[],name:"class",kind:"const",static:!1,readonly:!0,type:{kind:"type",text:"string",type:"string"},localName:"cls",defaultValue:""},{keywords:[],visibility:"public",description:"Add an id to the block tag to target it with custom CSS.",name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};export{B};
//# sourceMappingURL=BodyText-780d8761.js.map

View file

@ -1 +1 @@
{"version":3,"file":"BodyText-80591e5d.js","sources":["../../src/components/BodyText/BodyText.svelte"],"sourcesContent":["<!-- @component `BodyText` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-bodytext--default) -->\n<script lang=\"ts\">\n /**\n * A markdown text string.\n * @type {string}\n * @required\n */\n export let text: string;\n\n /** Add a class to target with SCSS. */\n let cls: string = '';\n export { cls as class };\n\n /** Add an id to the block tag to target it with custom CSS. */\n export let id: string = '';\n\n import { marked } from 'marked';\n import Block from '../Block/Block.svelte';\n</script>\n\n<Block id=\"{id}\" class=\"fmy-6 {cls}\">\n {#if text}\n {@html marked.parse(text)}\n {/if}\n</Block>\n"],"names":["marked","ctx","html_tag","raw_value","create_if_block","text","$$props","cls","id"],"mappings":"2NAsBWA,EAAO,MAAMC,EAAI,CAAA,CAAA,EAAA,wFAAjBD,EAAO,MAAMC,EAAI,CAAA,CAAA,EAAA,KAAAC,EAAA,EAAAC,CAAA,gDADrBF,EAAI,CAAA,GAAAG,EAAAH,CAAA,iEAAJA,EAAI,CAAA,6IADCA,EAAE,CAAA,iBAAiBA,EAAG,CAAA,uHAAtBA,EAAE,CAAA,0BAAiBA,EAAG,CAAA,oJAbrB,KAAAI,CAAY,EAAAC,EAGnB,CAAA,MAAAC,EAAc,EAAE,EAAAD,EAIT,CAAA,GAAAE,EAAa,EAAE,EAAAF"}
{"version":3,"file":"BodyText-780d8761.js","sources":["../../src/components/BodyText/BodyText.svelte"],"sourcesContent":["<!-- @component `BodyText` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-bodytext--default) -->\n<script lang=\"ts\">\n /**\n * A markdown text string.\n * @type {string}\n * @required\n */\n export let text: string;\n\n /** Add a class to target with SCSS. */\n let cls: string = '';\n export { cls as class };\n\n /** Add an id to the block tag to target it with custom CSS. */\n export let id: string = '';\n\n import { marked } from 'marked';\n import Block from '../Block/Block.svelte';\n</script>\n\n<Block id=\"{id}\" class=\"fmy-6 {cls}\">\n {#if text}\n {@html marked.parse(text)}\n {/if}\n</Block>\n"],"names":["marked","ctx","html_tag","raw_value","create_if_block","text","$$props","cls","id"],"mappings":"sNAsBWA,EAAO,MAAMC,EAAI,CAAA,CAAA,EAAA,wFAAjBD,EAAO,MAAMC,EAAI,CAAA,CAAA,EAAA,KAAAC,EAAA,EAAAC,CAAA,gDADrBF,EAAI,CAAA,GAAAG,EAAAH,CAAA,iEAAJA,EAAI,CAAA,6IADCA,EAAE,CAAA,iBAAiBA,EAAG,CAAA,uHAAtBA,EAAE,CAAA,0BAAiBA,EAAG,CAAA,oJAbrB,KAAAI,CAAY,EAAAC,EAGnB,CAAA,MAAAC,EAAc,EAAE,EAAAD,EAIT,CAAA,GAAAE,EAAa,EAAE,EAAAF"}

View file

@ -1,2 +0,0 @@
import{S as m,i as u,s as p,c as y,m as _,t as k,a as g,d as b,e as c,b as d,f,H as w}from"./index-2c1648fc.js";import{m as o}from"./marked.esm-76161808.js";import{B as h}from"./Block-d69850f9.js";function r(a){let s,t=o.parse(a[0])+"",e;return{c(){s=new w(!1),e=c(),s.a=e},m(i,n){s.m(t,i,n),d(i,e,n)},p(i,n){n&1&&t!==(t=o.parse(i[0])+"")&&s.p(t)},d(i){i&&(f(e),s.d())}}}function S(a){let s,t=a[0]&&r(a);return{c(){t&&t.c(),s=c()},m(e,i){t&&t.m(e,i),d(e,s,i)},p(e,i){e[0]?t?t.p(e,i):(t=r(e),t.c(),t.m(s.parentNode,s)):t&&(t.d(1),t=null)},d(e){e&&f(s),t&&t.d(e)}}}function v(a){let s,t;return s=new h({props:{id:a[2],class:"fmy-6 "+a[1],$$slots:{default:[S]},$$scope:{ctx:a}}}),{c(){y(s.$$.fragment)},m(e,i){_(s,e,i),t=!0},p(e,[i]){const n={};i&4&&(n.id=e[2]),i&2&&(n.class="fmy-6 "+e[1]),i&9&&(n.$$scope={dirty:i,ctx:e}),s.$set(n)},i(e){t||(k(s.$$.fragment,e),t=!0)},o(e){g(s.$$.fragment,e),t=!1},d(e){b(s,e)}}}function x(a,s,t){let{text:e}=s,{class:i=""}=s,{id:n=""}=s;return a.$$set=l=>{"text"in l&&t(0,e=l.text),"class"in l&&t(1,i=l.class),"id"in l&&t(2,n=l.id)},[e,i,n]}class B extends m{constructor(s){super(),u(this,s,x,v,p,{text:0,class:1,id:2})}}B.__docgen={version:3,name:"BodyText.svelte",data:[{keywords:[{name:"type",description:"{string}"},{name:"required",description:""}],visibility:"public",description:"A markdown text string.",name:"text",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"}},{visibility:"public",description:"Add a class to target with SCSS.",keywords:[],name:"class",kind:"const",static:!1,readonly:!0,type:{kind:"type",text:"string",type:"string"},localName:"cls",defaultValue:""},{keywords:[],visibility:"public",description:"Add an id to the block tag to target it with custom CSS.",name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};export{B};
//# sourceMappingURL=BodyText-80591e5d.js.map

View file

@ -1,4 +1,4 @@
import{S as C,i as D,s as j,C as T,c,p as k,m as p,b as g,t as m,a as u,f as y,d}from"./index-2c1648fc.js";import{g as q,a as A}from"./spread-8a54911c.js";import{p as M,M as F,T as V,S as w}from"./collect-stories-640c7888.js";import{B}from"./BodyText-80591e5d.js";import{w as I}from"./withParams-47e2ab71.js";import"./marked.esm-76161808.js";import"./Block-d69850f9.js";const P=`The \`BodyText\` creates the main text of your page. You can pass the \`text\` prop a [markdown-formatted](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) string, which will be parsed into paragraphs, headers, lists, blockquotes or whatever else you need.
import{S as C,i as D,s as j,C as T,g as c,y as b,m,d as g,t as p,h as u,f as y,j as d}from"./index-4f5e5369.js";import{g as q,a as A}from"./spread-8a54911c.js";import{p as M,M as F,T as V,S as w}from"./collect-stories-6e37d46b.js";import{B}from"./BodyText-780d8761.js";import{w as P}from"./withParams-47e2ab71.js";import"./marked.esm-76161808.js";import"./Block-67c7bec3.js";const E=`The \`BodyText\` creates the main text of your page. You can pass the \`text\` prop a [markdown-formatted](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) string, which will be parsed into paragraphs, headers, lists, blockquotes or whatever else you need.
Use it like this:
@ -31,7 +31,7 @@ Use it like this:
{/if}
{/each}
\`\`\`
`;function E(h){let o,n;const a=[h[0]];let l={};for(let t=0;t<a.length;t+=1)l=T(l,a[t]);return o=new B({props:l}),{c(){c(o.$$.fragment)},m(t,i){p(o,t,i),n=!0},p(t,i){const s=i&1?q(a,[A(t[0])]):{};o.$set(s)},i(t){n||(m(o.$$.fragment,t),n=!0)},o(t){u(o.$$.fragment,t),n=!1},d(t){d(o,t)}}}function G(h){let o,n,a,l,t,i,s,f;const x=[{title:"Components/BodyText"},{component:B},I(P)];let b={};for(let e=0;e<x.length;e+=1)b=T(b,x[e]);return o=new F({props:b}),a=new V({props:{$$slots:{default:[E,({args:e})=>({0:e}),({args:e})=>e?1:0]},$$scope:{ctx:h}}}),t=new w({props:{name:"Default",args:{text:`Bacon ipsum **dolor amet** cow tongue tri-tip.
`;function G(h){let o,n;const a=[h[0]];let i={};for(let t=0;t<a.length;t+=1)i=T(i,a[t]);return o=new B({props:i}),{c(){c(o.$$.fragment)},m(t,l){m(o,t,l),n=!0},p(t,l){const s=l&1?q(a,[A(t[0])]):{};o.$set(s)},i(t){n||(p(o.$$.fragment,t),n=!0)},o(t){u(o.$$.fragment,t),n=!1},d(t){d(o,t)}}}function J(h){let o,n,a,i,t,l,s,f;const _=[{title:"Components/BodyText"},{component:B},P(E)];let k={};for(let e=0;e<_.length;e+=1)k=T(k,_[e]);return o=new F({props:k}),a=new V({props:{$$slots:{default:[G,({args:e})=>({0:e}),({args:e})=>e?1:0]},$$scope:{ctx:h}}}),t=new w({props:{name:"Default",args:{text:`Bacon ipsum **dolor amet** cow tongue tri-tip.
Biltong turducken ground round kevin [hamburger turkey](https://reuters.com) pig.
@ -90,5 +90,5 @@ Tempor tail doner chicken incididunt beef ribs. Ad ullamco in cupim venison. Leb
Ham hock id porchetta elit. Sint spare ribs aute buffalo.
<p class='body-correction'>Correction: Lorem ispsum dolor sit amet ameno dorime.</p>
`}}}),{c(){c(o.$$.fragment),n=k(),c(a.$$.fragment),l=k(),c(t.$$.fragment),i=k(),c(s.$$.fragment)},m(e,r){p(o,e,r),g(e,n,r),p(a,e,r),g(e,l,r),p(t,e,r),g(e,i,r),p(s,e,r),f=!0},p(e,[r]){const S={};o.$set(S);const _={};r&3&&(_.$$scope={dirty:r,ctx:e}),a.$set(_)},i(e){f||(m(o.$$.fragment,e),m(a.$$.fragment,e),m(t.$$.fragment,e),m(s.$$.fragment,e),f=!0)},o(e){u(o.$$.fragment,e),u(a.$$.fragment,e),u(t.$$.fragment,e),u(s.$$.fragment,e),f=!1},d(e){e&&(y(n),y(l),y(i)),d(o,e),d(a,e),d(t,e),d(s,e)}}}class v extends C{constructor(o){super(),D(this,o,null,G,j,{})}}v.__docgen={version:3,name:"BodyText.stories.svelte",data:[],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const $=M(v,{meta:{title:"Components/BodyText"},stories:{"tpl:default":{storyId:"components-bodytext--default",name:"default",template:!0,source:"<BodyText {...args} />",hasArgs:!0},Default:{storyId:"components-bodytext--default",name:"Default",template:!1,source:"",hasArgs:!1},TypographySample:{storyId:"components-bodytext--typography-sample",name:"Typography sample",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","BodyText","withComponentDocs"]}),U=$.meta,Y=["Default","TypographySample"],z=$.stories.Default,N=$.stories.TypographySample;export{z as Default,N as TypographySample,Y as __namedExportsOrder,U as default};
//# sourceMappingURL=BodyText.stories-1c39ca41.js.map
`}}}),{c(){c(o.$$.fragment),n=b(),c(a.$$.fragment),i=b(),c(t.$$.fragment),l=b(),c(s.$$.fragment)},m(e,r){m(o,e,r),g(e,n,r),m(a,e,r),g(e,i,r),m(t,e,r),g(e,l,r),m(s,e,r),f=!0},p(e,[r]){const S={};o.$set(S);const x={};r&3&&(x.$$scope={dirty:r,ctx:e}),a.$set(x)},i(e){f||(p(o.$$.fragment,e),p(a.$$.fragment,e),p(t.$$.fragment,e),p(s.$$.fragment,e),f=!0)},o(e){u(o.$$.fragment,e),u(a.$$.fragment,e),u(t.$$.fragment,e),u(s.$$.fragment,e),f=!1},d(e){e&&(y(n),y(i),y(l)),d(o,e),d(a,e),d(t,e),d(s,e)}}}class v extends C{constructor(o){super(),D(this,o,null,J,j,{})}}v.__docgen={version:3,name:"BodyText.stories.svelte",data:[],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const $=M(v,{meta:{title:"Components/BodyText"},stories:{"tpl:default":{name:"default",template:!0,source:"<BodyText {...args} />",hasArgs:!0},Default:{name:"Default",template:!1,source:"",hasArgs:!1},TypographySample:{name:"Typography sample",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","BodyText","withComponentDocs"]}),U=$.meta,Y=["Default","TypographySample"],z=$.stories.Default,N=$.stories.TypographySample;export{z as Default,N as TypographySample,Y as __namedExportsOrder,U as default};
//# sourceMappingURL=BodyText.stories-8baed122.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,21 +0,0 @@
import{S as v,i as A,s as C,C as B,c as p,p as g,m as f,b as y,t as u,a as c,f as D,d as $}from"./index-2c1648fc.js";import{g as h,a as T}from"./spread-8a54911c.js";import{p as M,M as I,T as P,S as Z}from"./collect-stories-640c7888.js";import{B as b}from"./Byline-b58b294f.js";import{w as O}from"./withParams-47e2ab71.js";import"./each-e59479a4.js";import"./Block-d69850f9.js";import"./_commonjsHelpers-de833af9.js";import"./journalize-07958dc6.js";const k=`Byline and dateline.
\`\`\`svelte
<script>
import { Byline } from '@reuters-graphics/graphics-components';
<\/script>
<Byline
authors="{[
'Dea Bankova',
'Aditi Bhandari',
'Prasanta Kumar Dutta',
'Anurag Rao',
'Mariano Zafra',
]}"
publishTime="2021-09-12T00:00:00.000Z"
updateTime="2021-09-12T12:57:00.000Z"
/>
\`\`\`
`;function K(m){let n,r;const a=[m[1]];let i={};for(let t=0;t<a.length;t+=1)i=B(i,a[t]);return n=new b({props:i}),{c(){p(n.$$.fragment)},m(t,o){f(n,t,o),r=!0},p(t,o){const l=o&2?h(a,[T(t[1])]):{};n.$set(l)},i(t){r||(u(n.$$.fragment,t),r=!0)},o(t){c(n.$$.fragment,t),r=!1},d(t){$(n,t)}}}function R(m){let n,r,a,i,t,o;const l=[{title:"Components/Byline"},{component:b},m[0]];let _={};for(let e=0;e<l.length;e+=1)_=B(_,l[e]);return n=new I({props:_}),a=new P({props:{$$slots:{default:[K,({args:e})=>({1:e}),({args:e})=>e?2:0]},$$scope:{ctx:m}}}),t=new Z({props:{name:"Default",args:{align:"left",authors:["Dea Bankova","Aditi Bhandari","Prasanta Kumar Dutta","Anurag Rao","Mariano Zafra"],publishTime:new Date("2021-09-12").toISOString(),updateTime:new Date("2021-09-12T13:57:00").toISOString()}}}),{c(){p(n.$$.fragment),r=g(),p(a.$$.fragment),i=g(),p(t.$$.fragment)},m(e,s){f(n,e,s),y(e,r,s),f(a,e,s),y(e,i,s),f(t,e,s),o=!0},p(e,[s]){const S=s&1?h(l,[l[0],l[1],T(e[0])]):{};n.$set(S);const d={};s&6&&(d.$$scope={dirty:s,ctx:e}),a.$set(d)},i(e){o||(u(n.$$.fragment,e),u(a.$$.fragment,e),u(t.$$.fragment,e),o=!0)},o(e){c(n.$$.fragment,e),c(a.$$.fragment,e),c(t.$$.fragment,e),o=!1},d(e){e&&(D(r),D(i)),$(n,e),$(a,e),$(t,e)}}}function j(m){return[{...O(k),argTypes:{align:{control:"select",options:["left","center"]}}}]}class q extends v{constructor(n){super(),A(this,n,j,R,C,{})}}const w=M(q,{meta:{title:"Components/Byline"},stories:{"tpl:default":{storyId:"components-byline--default",name:"default",template:!0,source:"<Byline {...args} />",hasArgs:!0},Default:{storyId:"components-byline--default",name:"Default",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","Byline","withComponentDocs"]}),Q=w.meta,U=["Default"],V=w.stories.Default;export{V as Default,U as __namedExportsOrder,Q as default};
//# sourceMappingURL=Byline.stories-b7682f25.js.map

View file

@ -0,0 +1,21 @@
import{S as v,i as A,s as C,C as B,g as l,y as d,m as f,d as y,t as u,h as c,f as D,j as $}from"./index-4f5e5369.js";import{g as h,a as T}from"./spread-8a54911c.js";import{p as M,M as P,T as Z,S as I}from"./collect-stories-6e37d46b.js";import{B as w}from"./Byline-45dd4719.js";import{w as O}from"./withParams-47e2ab71.js";import"./each-e59479a4.js";import"./Block-67c7bec3.js";import"./_commonjsHelpers-de833af9.js";import"./journalize-07958dc6.js";const j=`Byline and dateline.
\`\`\`svelte
<script>
import { Byline } from '@reuters-graphics/graphics-components';
<\/script>
<Byline
authors="{[
'Dea Bankova',
'Aditi Bhandari',
'Prasanta Kumar Dutta',
'Anurag Rao',
'Mariano Zafra',
]}"
publishTime="2021-09-12T00:00:00.000Z"
updateTime="2021-09-12T12:57:00.000Z"
/>
\`\`\`
`;function k(p){let n,r;const a=[p[1]];let i={};for(let t=0;t<a.length;t+=1)i=B(i,a[t]);return n=new w({props:i}),{c(){l(n.$$.fragment)},m(t,o){f(n,t,o),r=!0},p(t,o){const m=o&2?h(a,[T(t[1])]):{};n.$set(m)},i(t){r||(u(n.$$.fragment,t),r=!0)},o(t){c(n.$$.fragment,t),r=!1},d(t){$(n,t)}}}function K(p){let n,r,a,i,t,o;const m=[{title:"Components/Byline"},{component:w},p[0]];let g={};for(let e=0;e<m.length;e+=1)g=B(g,m[e]);return n=new P({props:g}),a=new Z({props:{$$slots:{default:[k,({args:e})=>({1:e}),({args:e})=>e?2:0]},$$scope:{ctx:p}}}),t=new I({props:{name:"Default",args:{align:"left",authors:["Dea Bankova","Aditi Bhandari","Prasanta Kumar Dutta","Anurag Rao","Mariano Zafra"],publishTime:new Date("2021-09-12").toISOString(),updateTime:new Date("2021-09-12T13:57:00").toISOString()}}}),{c(){l(n.$$.fragment),r=d(),l(a.$$.fragment),i=d(),l(t.$$.fragment)},m(e,s){f(n,e,s),y(e,r,s),f(a,e,s),y(e,i,s),f(t,e,s),o=!0},p(e,[s]){const b=s&1?h(m,[m[0],m[1],T(e[0])]):{};n.$set(b);const _={};s&6&&(_.$$scope={dirty:s,ctx:e}),a.$set(_)},i(e){o||(u(n.$$.fragment,e),u(a.$$.fragment,e),u(t.$$.fragment,e),o=!0)},o(e){c(n.$$.fragment,e),c(a.$$.fragment,e),c(t.$$.fragment,e),o=!1},d(e){e&&(D(r),D(i)),$(n,e),$(a,e),$(t,e)}}}function R(p){return[{...O(j),argTypes:{align:{control:"select",options:["left","center"]}}}]}class q extends v{constructor(n){super(),A(this,n,R,K,C,{})}}const S=M(q,{meta:{title:"Components/Byline"},stories:{"tpl:default":{name:"default",template:!0,source:"<Byline {...args} />",hasArgs:!0},Default:{name:"Default",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","Byline","withComponentDocs"]}),Q=S.meta,U=["Default"],V=S.stories.Default;export{V as Default,U as __namedExportsOrder,Q as default};
//# sourceMappingURL=Byline.stories-baac1079.js.map

View file

@ -1 +1 @@
{"version":3,"file":"Byline.stories-b7682f25.js","sources":["../../src/components/Byline/stories/docs/component.md?raw","../../src/components/Byline/Byline.stories.svelte"],"sourcesContent":["export default \"Byline and dateline.\\n\\n```svelte\\n<script>\\n import { Byline } from '@reuters-graphics/graphics-components';\\n</script>\\n\\n<Byline\\n authors=\\\"{[\\n 'Dea Bankova',\\n 'Aditi Bhandari',\\n 'Prasanta Kumar Dutta',\\n 'Anurag Rao',\\n 'Mariano Zafra',\\n ]}\\\"\\n publishTime=\\\"2021-09-12T00:00:00.000Z\\\"\\n updateTime=\\\"2021-09-12T12:57:00.000Z\\\"\\n/>\\n```\\n\"","<script>\n import { Meta, Template, Story } from '@storybook/addon-svelte-csf';\n\n // @ts-ignore\n import componentDocs from './stories/docs/component.md?raw';\n\n import Byline from './Byline.svelte';\n\n import { withComponentDocs } from '$lib/docs/utils/withParams.js';\n\n const metaProps = {\n ...withComponentDocs(componentDocs),\n // https://storybook.js.org/docs/svelte/essentials/controls\n argTypes: {\n align: {\n control: 'select',\n options: ['left', 'center'],\n },\n },\n };\n</script>\n\n<Meta title=\"Components/Byline\" component=\"{Byline}\" {...metaProps} />\n\n<Template let:args>\n <Byline {...args} />\n</Template>\n\n<Story\n name=\"Default\"\n args=\"{{\n align: 'left',\n authors: [\n 'Dea Bankova',\n 'Aditi Bhandari',\n 'Prasanta Kumar Dutta',\n 'Anurag Rao',\n 'Mariano Zafra',\n ],\n publishTime: new Date('2021-09-12').toISOString(),\n updateTime: new Date('2021-09-12T13:57:00').toISOString(),\n }}\"\n/>\n"],"names":["componentDocs","ctx","meta_spread_levels","Byline","withComponentDocs"],"mappings":"icAAA,MAAeA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCCyBDC,EAAI,CAAA,CAAA,oJAAJA,EAAI,CAAA,CAAA,CAAA,CAAA,6HAH0B,MAAAC,EAAA,CAAA,CAAA,MAAA,mBAAA,EAAA,CAAA,UAAAC,GAAaF,EAAS,CAAA,CAAA,iNAS9D,MAAO,OACP,QAAO,CACL,cACA,iBACA,uBACA,aACA,iBAEF,YAAiB,IAAA,KAAK,YAAY,EAAE,YAAW,EAC/C,WAAgB,IAAA,KAAK,qBAAqB,EAAE,YAAW,2KAlBFA,EAAS,CAAA,CAAA,qRAZjD,CACV,GAAAG,EAAkBJ,CAAa,EAElC,SAAQ,CACN,MAAK,CACH,QAAS,SACT,QAAO,CAAG,OAAQ,QAAQ"}
{"version":3,"file":"Byline.stories-baac1079.js","sources":["../../src/components/Byline/stories/docs/component.md?raw","../../src/components/Byline/Byline.stories.svelte"],"sourcesContent":["export default \"Byline and dateline.\\n\\n```svelte\\n<script>\\n import { Byline } from '@reuters-graphics/graphics-components';\\n</script>\\n\\n<Byline\\n authors=\\\"{[\\n 'Dea Bankova',\\n 'Aditi Bhandari',\\n 'Prasanta Kumar Dutta',\\n 'Anurag Rao',\\n 'Mariano Zafra',\\n ]}\\\"\\n publishTime=\\\"2021-09-12T00:00:00.000Z\\\"\\n updateTime=\\\"2021-09-12T12:57:00.000Z\\\"\\n/>\\n```\\n\"","<script>\n import { Meta, Template, Story } from '@storybook/addon-svelte-csf';\n\n // @ts-ignore\n import componentDocs from './stories/docs/component.md?raw';\n\n import Byline from './Byline.svelte';\n\n import { withComponentDocs } from '$lib/docs/utils/withParams.js';\n\n const metaProps = {\n ...withComponentDocs(componentDocs),\n // https://storybook.js.org/docs/svelte/essentials/controls\n argTypes: {\n align: {\n control: 'select',\n options: ['left', 'center'],\n },\n },\n };\n</script>\n\n<Meta title=\"Components/Byline\" component=\"{Byline}\" {...metaProps} />\n\n<Template let:args>\n <Byline {...args} />\n</Template>\n\n<Story\n name=\"Default\"\n args=\"{{\n align: 'left',\n authors: [\n 'Dea Bankova',\n 'Aditi Bhandari',\n 'Prasanta Kumar Dutta',\n 'Anurag Rao',\n 'Mariano Zafra',\n ],\n publishTime: new Date('2021-09-12').toISOString(),\n updateTime: new Date('2021-09-12T13:57:00').toISOString(),\n }}\"\n/>\n"],"names":["componentDocs","ctx","meta_spread_levels","Byline","withComponentDocs"],"mappings":"icAAA,MAAeA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCCyBDC,EAAI,CAAA,CAAA,oJAAJA,EAAI,CAAA,CAAA,CAAA,CAAA,6HAH0B,MAAAC,EAAA,CAAA,CAAA,MAAA,mBAAA,EAAA,CAAA,UAAAC,GAAaF,EAAS,CAAA,CAAA,iNAS9D,MAAO,OACP,QAAO,CACL,cACA,iBACA,uBACA,aACA,iBAEF,YAAiB,IAAA,KAAK,YAAY,EAAE,YAAW,EAC/C,WAAgB,IAAA,KAAK,qBAAqB,EAAE,YAAW,2KAlBFA,EAAS,CAAA,CAAA,qRAZjD,CACV,GAAAG,EAAkBJ,CAAa,EAElC,SAAQ,CACN,MAAK,CACH,QAAS,SACT,QAAO,CAAG,OAAQ,QAAQ"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,2 @@
import{D as d,d as n}from"./chunk-S4VUQJ4A-7a1b1a0f.js";import"./iframe-7924401a.js";import"../sb-preview/runtime.js";import"./index-7dae1d9b.js";import"./_commonjsHelpers-de833af9.js";import"./index-d37d4223.js";import"./index-e04ae519.js";import"./index-356e4a49.js";export{d as DocsRenderer,n as defaultComponents};
//# sourceMappingURL=DocsRenderer-3PUGWF3O-5a8bbb08.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"DocsRenderer-3PUGWF3O-5a8bbb08.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}

View file

@ -1,2 +0,0 @@
import{D as n,d as f}from"./chunk-S4VUQJ4A-c8f04c9f.js";import"./iframe-06bd3a1b.js";import"../sb-preview/runtime.js";import"./index-e106f771.js";import"./_commonjsHelpers-de833af9.js";import"./index-d475d2ea.js";import"./index-d37d4223.js";import"./index-e04ae519.js";import"./index-356e4a49.js";export{n as DocsRenderer,f as defaultComponents};
//# sourceMappingURL=DocsRenderer-3PUGWF3O-c1cd37ed.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"DocsRenderer-3PUGWF3O-c1cd37ed.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}

View file

@ -1,4 +1,4 @@
import{S as $,i as k,s as C,c as m,m as f,t as p,a as g,d as h,l as q,h as d,F as b,b as w,f as _,C as v,p as D}from"./index-2c1648fc.js";import{g as A,a as S}from"./spread-8a54911c.js";import{p as R,M,T as V,S as B}from"./collect-stories-640c7888.js";import{B as E}from"./Block-d69850f9.js";import{w as F}from"./withParams-47e2ab71.js";const H=`Embed a document hosted by [DocumentCloud](https://documentcloud.org)
import{S as $,i as k,s as C,g as d,m as f,t as p,h as g,j as h,o as q,b as m,F as b,d as w,f as _,C as v,y as D}from"./index-4f5e5369.js";import{g as A,a as S}from"./spread-8a54911c.js";import{p as R,M,T as V,S as j}from"./collect-stories-6e37d46b.js";import{B}from"./Block-67c7bec3.js";import{w as E}from"./withParams-47e2ab71.js";const F=`Embed a document hosted by [DocumentCloud](https://documentcloud.org)
---
@ -15,5 +15,5 @@ The document must have its access level set to public before it can be embedded.
width="normal"
/>
\`\`\`
`;function P(a){let e,o;return{c(){e=q("iframe"),d(e,"class","h-screen"),b(e.src,o="https://embed.documentcloud.org/documents/"+a[1]+"/?embed=1&responsive=1&title=1")||d(e,"src",o),d(e,"title",a[2]),d(e,"width","700"),d(e,"height","540"),d(e,"sandbox","allow-scripts allow-same-origin allow-popups allow-forms allow-popups-to-escape-sandbox")},m(t,l){w(t,e,l)},p(t,l){l&2&&!b(e.src,o="https://embed.documentcloud.org/documents/"+t[1]+"/?embed=1&responsive=1&title=1")&&d(e,"src",o),l&4&&d(e,"title",t[2])},d(t){t&&_(e)}}}function j(a){let e,o;return e=new E({props:{width:a[0],id:a[3],class:"photo fmy-6 "+a[4],$$slots:{default:[P]},$$scope:{ctx:a}}}),{c(){m(e.$$.fragment)},m(t,l){f(e,t,l),o=!0},p(t,[l]){const s={};l&1&&(s.width=t[0]),l&8&&(s.id=t[3]),l&16&&(s.class="photo fmy-6 "+t[4]),l&38&&(s.$$scope={dirty:l,ctx:t}),e.$set(s)},i(t){o||(p(e.$$.fragment,t),o=!0)},o(t){g(e.$$.fragment,t),o=!1},d(t){h(e,t)}}}function L(a,e,o){let{width:t="normal"}=e,{slug:l}=e,{altText:s}=e,{id:r=""}=e,{class:u=""}=e;return a.$$set=i=>{"width"in i&&o(0,t=i.width),"slug"in i&&o(1,l=i.slug),"altText"in i&&o(2,s=i.altText),"id"in i&&o(3,r=i.id),"class"in i&&o(4,u=i.class)},[t,l,s,r,u]}class y extends ${constructor(e){super(),k(this,e,L,j,C,{width:0,slug:1,altText:2,id:3,class:4})}}y.__docgen={version:3,name:"DocumentCloud.svelte",data:[{keywords:[],visibility:"public",description:"Width of the container, one of: normal, wide, wider, widest or fluid",name:"width",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"normal"},{keywords:[{name:"required",description:""}],visibility:"public",description:"The unique identifier for the document.",name:"slug",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{keywords:[{name:"required",description:""}],visibility:"public",description:"Alt text for the document.",name:"altText",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{keywords:[],visibility:"public",description:"Add an ID to target with SCSS.",name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""},{visibility:"public",description:"Add a class to target with SCSS.",keywords:[],name:"class",kind:"const",static:!1,readonly:!0,type:{kind:"type",text:"string",type:"string"},localName:"cls",defaultValue:""}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};function N(a){let e,o;const t=[a[1]];let l={};for(let s=0;s<t.length;s+=1)l=v(l,t[s]);return e=new y({props:l}),{c(){m(e.$$.fragment)},m(s,r){f(e,s,r),o=!0},p(s,r){const u=r&2?A(t,[S(s[1])]):{};e.$set(u)},i(s){o||(p(e.$$.fragment,s),o=!0)},o(s){g(e.$$.fragment,s),o=!1},d(s){h(e,s)}}}function O(a){let e,o,t,l,s,r;const u=[{title:"Components/DocumentCloud"},{component:y},a[0]];let i={};for(let n=0;n<u.length;n+=1)i=v(i,u[n]);return e=new M({props:i}),t=new V({props:{$$slots:{default:[N,({args:n})=>({1:n}),({args:n})=>n?2:0]},$$scope:{ctx:a}}}),s=new B({props:{name:"Default",args:{width:"normal",slug:"3259984-Trump-Intelligence-Allegations",altText:"These Reports Allege Trump Has Deep Ties To Russia"}}}),{c(){m(e.$$.fragment),o=D(),m(t.$$.fragment),l=D(),m(s.$$.fragment)},m(n,c){f(e,n,c),w(n,o,c),f(t,n,c),w(n,l,c),f(s,n,c),r=!0},p(n,[c]){const I=c&1?A(u,[u[0],u[1],S(n[0])]):{};e.$set(I);const T={};c&6&&(T.$$scope={dirty:c,ctx:n}),t.$set(T)},i(n){r||(p(e.$$.fragment,n),p(t.$$.fragment,n),p(s.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),g(t.$$.fragment,n),g(s.$$.fragment,n),r=!1},d(n){n&&(_(o),_(l)),h(e,n),h(t,n),h(s,n)}}}function U(a){return[{...F(H),argTypes:{width:{control:"select",options:["normal","wide","wider","widest","fluid"]}}}]}class W extends ${constructor(e){super(),k(this,e,U,O,C,{})}}const x=R(W,{meta:{title:"Components/DocumentCloud"},stories:{"tpl:default":{storyId:"components-documentcloud--default",name:"default",template:!0,source:"<DocumentCloud {...args} />",hasArgs:!0},Default:{storyId:"components-documentcloud--default",name:"Default",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","DocumentCloud","withComponentDocs"]}),X=x.meta,Y=["Default"],Z=x.stories.Default;export{Z as Default,Y as __namedExportsOrder,X as default};
//# sourceMappingURL=DocumentCloud.stories-479629dd.js.map
`;function H(a){let e,o;return{c(){e=q("iframe"),m(e,"class","h-screen"),b(e.src,o="https://embed.documentcloud.org/documents/"+a[1]+"/?embed=1&responsive=1&title=1")||m(e,"src",o),m(e,"title",a[2]),m(e,"width","700"),m(e,"height","540"),m(e,"sandbox","allow-scripts allow-same-origin allow-popups allow-forms allow-popups-to-escape-sandbox")},m(t,l){w(t,e,l)},p(t,l){l&2&&!b(e.src,o="https://embed.documentcloud.org/documents/"+t[1]+"/?embed=1&responsive=1&title=1")&&m(e,"src",o),l&4&&m(e,"title",t[2])},d(t){t&&_(e)}}}function P(a){let e,o;return e=new B({props:{width:a[0],id:a[3],class:"photo fmy-6 "+a[4],$$slots:{default:[H]},$$scope:{ctx:a}}}),{c(){d(e.$$.fragment)},m(t,l){f(e,t,l),o=!0},p(t,[l]){const s={};l&1&&(s.width=t[0]),l&8&&(s.id=t[3]),l&16&&(s.class="photo fmy-6 "+t[4]),l&38&&(s.$$scope={dirty:l,ctx:t}),e.$set(s)},i(t){o||(p(e.$$.fragment,t),o=!0)},o(t){g(e.$$.fragment,t),o=!1},d(t){h(e,t)}}}function L(a,e,o){let{width:t="normal"}=e,{slug:l}=e,{altText:s}=e,{id:r=""}=e,{class:u=""}=e;return a.$$set=i=>{"width"in i&&o(0,t=i.width),"slug"in i&&o(1,l=i.slug),"altText"in i&&o(2,s=i.altText),"id"in i&&o(3,r=i.id),"class"in i&&o(4,u=i.class)},[t,l,s,r,u]}class y extends ${constructor(e){super(),k(this,e,L,P,C,{width:0,slug:1,altText:2,id:3,class:4})}}y.__docgen={version:3,name:"DocumentCloud.svelte",data:[{keywords:[],visibility:"public",description:"Width of the container, one of: normal, wide, wider, widest or fluid",name:"width",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"normal"},{keywords:[{name:"required",description:""}],visibility:"public",description:"The unique identifier for the document.",name:"slug",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{keywords:[{name:"required",description:""}],visibility:"public",description:"Alt text for the document.",name:"altText",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{keywords:[],visibility:"public",description:"Add an ID to target with SCSS.",name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""},{visibility:"public",description:"Add a class to target with SCSS.",keywords:[],name:"class",kind:"const",static:!1,readonly:!0,type:{kind:"type",text:"string",type:"string"},localName:"cls",defaultValue:""}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};function N(a){let e,o;const t=[a[1]];let l={};for(let s=0;s<t.length;s+=1)l=v(l,t[s]);return e=new y({props:l}),{c(){d(e.$$.fragment)},m(s,r){f(e,s,r),o=!0},p(s,r){const u=r&2?A(t,[S(s[1])]):{};e.$set(u)},i(s){o||(p(e.$$.fragment,s),o=!0)},o(s){g(e.$$.fragment,s),o=!1},d(s){h(e,s)}}}function O(a){let e,o,t,l,s,r;const u=[{title:"Components/DocumentCloud"},{component:y},a[0]];let i={};for(let n=0;n<u.length;n+=1)i=v(i,u[n]);return e=new M({props:i}),t=new V({props:{$$slots:{default:[N,({args:n})=>({1:n}),({args:n})=>n?2:0]},$$scope:{ctx:a}}}),s=new j({props:{name:"Default",args:{width:"normal",slug:"3259984-Trump-Intelligence-Allegations",altText:"These Reports Allege Trump Has Deep Ties To Russia"}}}),{c(){d(e.$$.fragment),o=D(),d(t.$$.fragment),l=D(),d(s.$$.fragment)},m(n,c){f(e,n,c),w(n,o,c),f(t,n,c),w(n,l,c),f(s,n,c),r=!0},p(n,[c]){const I=c&1?A(u,[u[0],u[1],S(n[0])]):{};e.$set(I);const T={};c&6&&(T.$$scope={dirty:c,ctx:n}),t.$set(T)},i(n){r||(p(e.$$.fragment,n),p(t.$$.fragment,n),p(s.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),g(t.$$.fragment,n),g(s.$$.fragment,n),r=!1},d(n){n&&(_(o),_(l)),h(e,n),h(t,n),h(s,n)}}}function U(a){return[{...E(F),argTypes:{width:{control:"select",options:["normal","wide","wider","widest","fluid"]}}}]}class W extends ${constructor(e){super(),k(this,e,U,O,C,{})}}const x=R(W,{meta:{title:"Components/DocumentCloud"},stories:{"tpl:default":{name:"default",template:!0,source:"<DocumentCloud {...args} />",hasArgs:!0},Default:{name:"Default",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","DocumentCloud","withComponentDocs"]}),X=x.meta,Y=["Default"],Z=x.stories.Default;export{Z as Default,Y as __namedExportsOrder,X as default};
//# sourceMappingURL=DocumentCloud.stories-212a867c.js.map

View file

@ -1 +1 @@
{"version":3,"file":"DocumentCloud.stories-479629dd.js","sources":["../../src/components/DocumentCloud/stories/docs/component.md?raw","../../src/components/DocumentCloud/DocumentCloud.svelte","../../src/components/DocumentCloud/DocumentCloud.stories.svelte"],"sourcesContent":["export default \"Embed a document hosted by [DocumentCloud](https://documentcloud.org)\\n\\n---\\n\\nThe document must have its access level set to public before it can be embedded. The `slug` argument can be found after the final slash in the document's URL. For instance, the document included in the example is found at [documentcloud.org/documents/3259984-Trump-Intelligence-Allegations](https://www.documentcloud.org/documents/3259984-Trump-Intelligence-Allegations). The slug is \\\"3259984-Trump-Intelligence-Allegations\\\".\\n\\n```svelte\\n<script>\\n import { DocumentCloud } from '@reuters-graphics/graphics-components';\\n</script>\\n\\n<DocumentCloud\\n slug=\\\"3259984-Trump-Intelligence-Allegations\\\"\\n altText=\\\"These Reports Allege Trump Has Deep Ties To Russia\\\"\\n width=\\\"normal\\\"\\n/>\\n```\\n\"","<!-- @component `DocumentCloud` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-DocumentCloud--default) -->\n<script lang=\"ts\">\n import type { ContainerWidth } from '../@types/global';\n /** ✏️ DOCUMENT your chart's props using TypeScript and JSDoc comments like below! */\n\n /**\n * Width of the container, one of: normal, wide, wider, widest or fluid\n */\n export let width: ContainerWidth = 'normal';\n\n /**\n * The unique identifier for the document.\n * @required\n */\n export let slug: string;\n\n /**\n * Alt text for the document.\n * @required\n */\n export let altText: string;\n\n /** Add an ID to target with SCSS. */\n export let id: string = '';\n\n /** Add a class to target with SCSS. */\n let cls: string = '';\n export { cls as class };\n\n import Block from '../Block/Block.svelte';\n</script>\n\n<Block width=\"{width}\" id=\"{id}\" class=\"photo fmy-6 {cls}\">\n <iframe\n class=\"h-screen\"\n src=\"https://embed.documentcloud.org/documents/{slug}/?embed=1&amp;responsive=1&amp;title=1\"\n title=\"{altText}\"\n width=\"700\"\n height=\"540\"\n sandbox=\"allow-scripts allow-same-origin allow-popups allow-forms allow-popups-to-escape-sandbox\"\n ></iframe>\n</Block>\n","<script>\n import { Meta, Template, Story } from '@storybook/addon-svelte-csf';\n\n // Don't lose the \"?raw\" in markdown imports!\n // @ts-ignore\n import componentDocs from './stories/docs/component.md?raw';\n\n import DocumentCloud from './DocumentCloud.svelte';\n\n import { withComponentDocs } from '$docs/utils/withParams.js';\n\n const metaProps = {\n ...withComponentDocs(componentDocs),\n argTypes: {\n width: {\n control: 'select',\n options: ['normal', 'wide', 'wider', 'widest', 'fluid'],\n },\n },\n };\n</script>\n\n<Meta\n title=\"Components/DocumentCloud\"\n component=\"{DocumentCloud}\"\n {...metaProps}\n/>\n\n<Template let:args>\n <DocumentCloud {...args} />\n</Template>\n\n<Story\n name=\"Default\"\n args=\"{{\n width: 'normal',\n slug: '3259984-Trump-Intelligence-Allegations',\n altText: 'These Reports Allege Trump Has Deep Ties To Russia',\n }}\"\n/>\n"],"names":["componentDocs","ctx","attr","iframe","iframe_src_value","insert","target","anchor","width","$$props","slug","altText","id","cls","DocumentCloud","withComponentDocs"],"mappings":"iVAAA,MAAeA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gICmCqCC,EAAI,CAAA,EAAA,gCAAA,GAAAC,EAAAC,EAAA,MAAAC,CAAA,cAC5CH,EAAO,CAAA,CAAA,0JAHjBI,EAOSC,EAAAH,EAAAI,CAAA,uEALyCN,EAAI,CAAA,EAAA,gCAAA,iCAC5CA,EAAO,CAAA,CAAA,qEAJJA,EAAK,CAAA,KAAQA,EAAE,CAAA,uBAAuBA,EAAG,CAAA,0HAAzCA,EAAK,CAAA,cAAQA,EAAE,CAAA,iCAAuBA,EAAG,CAAA,iJAxB3C,GAAA,CAAA,MAAAO,EAAwB,QAAQ,EAAAC,GAMhC,KAAAC,CAAY,EAAAD,GAMZ,QAAAE,CAAe,EAAAF,EAGf,CAAA,GAAAG,EAAa,EAAE,EAAAH,EAGtB,CAAA,MAAAI,EAAc,EAAE,EAAAJ,q8CCGDR,EAAI,CAAA,CAAA,oJAAJA,EAAI,CAAA,CAAA,CAAA,CAAA,oLALXa,CAAa,EACrBb,EAAS,CAAA,kNAUX,MAAO,SACP,KAAM,yCACN,QAAS,8NAZPA,EAAS,CAAA,CAAA,qRAdE,CACV,GAAAc,EAAkBf,CAAa,EAClC,SAAQ,CACN,MAAK,CACH,QAAS,SACT,QAAO,CAAG,SAAU,OAAQ,QAAS,SAAU,OAAO"}
{"version":3,"file":"DocumentCloud.stories-212a867c.js","sources":["../../src/components/DocumentCloud/stories/docs/component.md?raw","../../src/components/DocumentCloud/DocumentCloud.svelte","../../src/components/DocumentCloud/DocumentCloud.stories.svelte"],"sourcesContent":["export default \"Embed a document hosted by [DocumentCloud](https://documentcloud.org)\\n\\n---\\n\\nThe document must have its access level set to public before it can be embedded. The `slug` argument can be found after the final slash in the document's URL. For instance, the document included in the example is found at [documentcloud.org/documents/3259984-Trump-Intelligence-Allegations](https://www.documentcloud.org/documents/3259984-Trump-Intelligence-Allegations). The slug is \\\"3259984-Trump-Intelligence-Allegations\\\".\\n\\n```svelte\\n<script>\\n import { DocumentCloud } from '@reuters-graphics/graphics-components';\\n</script>\\n\\n<DocumentCloud\\n slug=\\\"3259984-Trump-Intelligence-Allegations\\\"\\n altText=\\\"These Reports Allege Trump Has Deep Ties To Russia\\\"\\n width=\\\"normal\\\"\\n/>\\n```\\n\"","<!-- @component `DocumentCloud` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-DocumentCloud--default) -->\n<script lang=\"ts\">\n import type { ContainerWidth } from '../@types/global';\n /** ✏️ DOCUMENT your chart's props using TypeScript and JSDoc comments like below! */\n\n /**\n * Width of the container, one of: normal, wide, wider, widest or fluid\n */\n export let width: ContainerWidth = 'normal';\n\n /**\n * The unique identifier for the document.\n * @required\n */\n export let slug: string;\n\n /**\n * Alt text for the document.\n * @required\n */\n export let altText: string;\n\n /** Add an ID to target with SCSS. */\n export let id: string = '';\n\n /** Add a class to target with SCSS. */\n let cls: string = '';\n export { cls as class };\n\n import Block from '../Block/Block.svelte';\n</script>\n\n<Block width=\"{width}\" id=\"{id}\" class=\"photo fmy-6 {cls}\">\n <iframe\n class=\"h-screen\"\n src=\"https://embed.documentcloud.org/documents/{slug}/?embed=1&amp;responsive=1&amp;title=1\"\n title=\"{altText}\"\n width=\"700\"\n height=\"540\"\n sandbox=\"allow-scripts allow-same-origin allow-popups allow-forms allow-popups-to-escape-sandbox\"\n ></iframe>\n</Block>\n","<script>\n import { Meta, Template, Story } from '@storybook/addon-svelte-csf';\n\n // Don't lose the \"?raw\" in markdown imports!\n // @ts-ignore\n import componentDocs from './stories/docs/component.md?raw';\n\n import DocumentCloud from './DocumentCloud.svelte';\n\n import { withComponentDocs } from '$docs/utils/withParams.js';\n\n const metaProps = {\n ...withComponentDocs(componentDocs),\n argTypes: {\n width: {\n control: 'select',\n options: ['normal', 'wide', 'wider', 'widest', 'fluid'],\n },\n },\n };\n</script>\n\n<Meta\n title=\"Components/DocumentCloud\"\n component=\"{DocumentCloud}\"\n {...metaProps}\n/>\n\n<Template let:args>\n <DocumentCloud {...args} />\n</Template>\n\n<Story\n name=\"Default\"\n args=\"{{\n width: 'normal',\n slug: '3259984-Trump-Intelligence-Allegations',\n altText: 'These Reports Allege Trump Has Deep Ties To Russia',\n }}\"\n/>\n"],"names":["componentDocs","ctx","attr","iframe","iframe_src_value","insert","target","anchor","width","$$props","slug","altText","id","cls","DocumentCloud","withComponentDocs"],"mappings":"4UAAA,MAAeA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gICmCqCC,EAAI,CAAA,EAAA,gCAAA,GAAAC,EAAAC,EAAA,MAAAC,CAAA,cAC5CH,EAAO,CAAA,CAAA,0JAHjBI,EAOSC,EAAAH,EAAAI,CAAA,uEALyCN,EAAI,CAAA,EAAA,gCAAA,iCAC5CA,EAAO,CAAA,CAAA,qEAJJA,EAAK,CAAA,KAAQA,EAAE,CAAA,uBAAuBA,EAAG,CAAA,0HAAzCA,EAAK,CAAA,cAAQA,EAAE,CAAA,iCAAuBA,EAAG,CAAA,iJAxB3C,GAAA,CAAA,MAAAO,EAAwB,QAAQ,EAAAC,GAMhC,KAAAC,CAAY,EAAAD,GAMZ,QAAAE,CAAe,EAAAF,EAGf,CAAA,GAAAG,EAAa,EAAE,EAAAH,EAGtB,CAAA,MAAAI,EAAc,EAAE,EAAAJ,q8CCGDR,EAAI,CAAA,CAAA,oJAAJA,EAAI,CAAA,CAAA,CAAA,CAAA,oLALXa,CAAa,EACrBb,EAAS,CAAA,kNAUX,MAAO,SACP,KAAM,yCACN,QAAS,8NAZPA,EAAS,CAAA,CAAA,qRAdE,CACV,GAAAc,EAAkBf,CAAa,EAClC,SAAQ,CACN,MAAK,CACH,QAAS,SACT,QAAO,CAAG,SAAU,OAAQ,QAAS,SAAU,OAAO"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,2 +0,0 @@
import{I as a}from"./chunk-MSDTXLE7-17536f09.js";import{r as e}from"./index-e106f771.js";import"./iframe-06bd3a1b.js";import"../sb-preview/runtime.js";import"./_commonjsHelpers-de833af9.js";import"./index-d475d2ea.js";import"./index-d37d4223.js";var c=r=>{const{svgProps:t,...l}=r;return e.createElement(a,{icon:e.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{d:"M8.982 1.632a.5.5 0 00-.964-.263l-3 11a.5.5 0 10.964.263l3-11zM3.32 3.616a.5.5 0 01.064.704L1.151 7l2.233 2.68a.5.5 0 11-.768.64l-2.5-3a.5.5 0 010-.64l2.5-3a.5.5 0 01.704-.064zM10.68 3.616a.5.5 0 00-.064.704L12.849 7l-2.233 2.68a.5.5 0 00.768.64l2.5-3a.5.5 0 000-.64l-2.5-3a.5.5 0 00-.704-.064z",fill:"currentColor"})),...l})},w=r=>{const{svgProps:t,...l}=r;return e.createElement(a,{icon:e.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 2v1.5h1v7H3V12h5a3 3 0 001.791-5.407A2.75 2.75 0 008 2.011V2H3zm5 5.5H5.5v3H8a1.5 1.5 0 100-3zm-.25-4H5.5V6h2.25a1.25 1.25 0 100-2.5z",fill:"currentColor"})),...l})},m=r=>{const{svgProps:t,...l}=r;return e.createElement(a,{icon:e.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{d:"M5 2h6v1H8.5l-2 8H9v1H3v-1h2.5l2-8H5V2z",fill:"currentColor"})),...l})},g=r=>{const{svgProps:t,...l}=r;return e.createElement(a,{icon:e.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{d:"M10.553 2.268a1.5 1.5 0 00-2.12 0L2.774 7.925a2.5 2.5 0 003.536 3.535l3.535-3.535a.5.5 0 11.707.707l-3.535 3.536-.002.002a3.5 3.5 0 01-4.959-4.941l.011-.011L7.725 1.56l.007-.008a2.5 2.5 0 013.53 3.541l-.002.002-5.656 5.657-.003.003a1.5 1.5 0 01-2.119-2.124l3.536-3.536a.5.5 0 11.707.707L4.189 9.34a.5.5 0 00.707.707l5.657-5.657a1.5 1.5 0 000-2.121z",fill:"currentColor"})),...l})},d=r=>{const{svgProps:t,...l}=r;return e.createElement(a,{icon:e.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{d:"M5 2.5a.5.5 0 01.5-.5h7a.5.5 0 010 1h-7a.5.5 0 01-.5-.5zM5 7a.5.5 0 01.5-.5h7a.5.5 0 010 1h-7A.5.5 0 015 7zM5.5 11a.5.5 0 000 1h7a.5.5 0 000-1h-7zM2.5 2H1v1h1v3h1V2.5a.5.5 0 00-.5-.5zM3 8.5v1a.5.5 0 01-1 0V9h-.5a.5.5 0 010-1h1a.5.5 0 01.5.5zM2 10.5a.5.5 0 00-1 0V12h2v-1H2v-.5z",fill:"currentColor"})),...l})},E=r=>{const{svgProps:t,...l}=r;return e.createElement(a,{icon:e.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{d:"M2.75 2.5a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM5.5 2a.5.5 0 000 1h7a.5.5 0 000-1h-7zM5.5 11a.5.5 0 000 1h7a.5.5 0 000-1h-7zM2 12.25a.75.75 0 100-1.5.75.75 0 000 1.5zM5 7a.5.5 0 01.5-.5h7a.5.5 0 010 1h-7A.5.5 0 015 7zM2 7.75a.75.75 0 100-1.5.75.75 0 000 1.5z",fill:"currentColor"})),...l})},z=r=>{const{svgProps:t,...l}=r;return e.createElement(a,{icon:e.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{d:"M6 7a3 3 0 110-6h5.5a.5.5 0 010 1H10v10.5a.5.5 0 01-1 0V2H7v10.5a.5.5 0 01-1 0V7z",fill:"currentColor"})),...l})},M=r=>{const{svgProps:t,...l}=r;return e.createElement(a,{icon:e.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{d:"M2 4.5h1.5L5 6.375 6.5 4.5H8v5H6.5V7L5 8.875 3.5 7v2.5H2v-5zM9.75 4.5h1.5V7h1.25l-2 2.5-2-2.5h1.25V4.5z",fill:"currentColor"}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M.5 2a.5.5 0 00-.5.5v9a.5.5 0 00.5.5h13a.5.5 0 00.5-.5v-9a.5.5 0 00-.5-.5H.5zM1 3v8h12V3H1z",fill:"currentColor"})),...l})};export{w as Bold,m as Italic,d as ListOrdered,E as ListUnordered,M as Markdown,c as Markup,g as PaperClip,z as Paragraph};
//# sourceMappingURL=Editing-7QFB6ZMG-07bad899.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,16 +0,0 @@
import{S as E,i as D,s as L,e as M,b as _,t as m,q as S,a as p,r as V,f as $,l as k,c as f,h as v,k as H,m as c,d,C as P,p as h}from"./index-2c1648fc.js";import{g as z,a as A}from"./spread-8a54911c.js";import{p as I,M as T,T as q,S as F}from"./collect-stories-640c7888.js";import{F as N}from"./fa-0168d71b.js";import{w as j}from"./withParams-47e2ab71.js";const O=`An embed tool for development in graphics kit.
\`\`\`svelte
<script>
import { EmbedPreviewerLink } from '@reuters-graphics/graphics-components';
import { dev } from '$app/env';
<\/script>
<EmbedPreviewerLink dev="{dev}" />
\`\`\`
`;/*!
* Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/var R={prefix:"far",iconName:"window-restore",icon:[512,512,[],"f2d2","M464 0H144c-26.5 0-48 21.5-48 48v48H48c-26.5 0-48 21.5-48 48v320c0 26.5 21.5 48 48 48h320c26.5 0 48-21.5 48-48v-48h48c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zm-96 464H48V256h320v208zm96-96h-48V144c0-26.5-21.5-48-48-48H144V48h320v320z"]};function y(o){let t,a,e,s;return e=new N({props:{icon:R}}),{c(){t=k("div"),a=k("a"),f(e.$$.fragment),v(a,"rel","external"),v(a,"href","/embed-previewer"),v(a,"class","svelte-715e2e"),v(t,"class","svelte-715e2e")},m(r,i){_(r,t,i),H(t,a),c(e,a,null),s=!0},i(r){s||(m(e.$$.fragment,r),s=!0)},o(r){p(e.$$.fragment,r),s=!1},d(r){r&&$(t),d(e)}}}function W(o){let t,a,e=o[0]&&y();return{c(){e&&e.c(),t=M()},m(s,r){e&&e.m(s,r),_(s,t,r),a=!0},p(s,[r]){s[0]?e?r&1&&m(e,1):(e=y(),e.c(),m(e,1),e.m(t.parentNode,t)):e&&(S(),p(e,1,1,()=>{e=null}),V())},i(s){a||(m(e),a=!0)},o(s){p(e),a=!1},d(s){s&&$(t),e&&e.d(s)}}}function B(o,t,a){let{dev:e=!1}=t;return o.$$set=s=>{"dev"in s&&a(0,e=s.dev)},[e]}class b extends E{constructor(t){super(),D(this,t,B,W,L,{dev:0})}}b.__docgen={version:3,name:"EmbedPreviewerLink.svelte",data:[{visibility:"public",description:null,keywords:[],name:"dev",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};function G(o){let t,a;const e=[o[0]];let s={};for(let r=0;r<e.length;r+=1)s=P(s,e[r]);return t=new b({props:s}),{c(){f(t.$$.fragment)},m(r,i){c(t,r,i),a=!0},p(r,i){const u=i&1?z(e,[A(r[0])]):{};t.$set(u)},i(r){a||(m(t.$$.fragment,r),a=!0)},o(r){p(t.$$.fragment,r),a=!1},d(r){d(t,r)}}}function J(o){let t,a,e,s,r,i;const u=[{title:"Components/EmbedPreviewerLink"},{component:b},j(O)];let w={};for(let n=0;n<u.length;n+=1)w=P(w,u[n]);return t=new T({props:w}),e=new q({props:{$$slots:{default:[G,({args:n})=>({0:n}),({args:n})=>n?1:0]},$$scope:{ctx:o}}}),r=new F({props:{name:"Default",args:{dev:!0}}}),{c(){f(t.$$.fragment),a=h(),f(e.$$.fragment),s=h(),f(r.$$.fragment)},m(n,l){c(t,n,l),_(n,a,l),c(e,n,l),_(n,s,l),c(r,n,l),i=!0},p(n,[l]){const C={};t.$set(C);const g={};l&3&&(g.$$scope={dirty:l,ctx:n}),e.$set(g)},i(n){i||(m(t.$$.fragment,n),m(e.$$.fragment,n),m(r.$$.fragment,n),i=!0)},o(n){p(t.$$.fragment,n),p(e.$$.fragment,n),p(r.$$.fragment,n),i=!1},d(n){n&&($(a),$(s)),d(t,n),d(e,n),d(r,n)}}}class K extends E{constructor(t){super(),D(this,t,null,J,L,{})}}const x=I(K,{meta:{title:"Components/EmbedPreviewerLink"},stories:{"tpl:default":{storyId:"components-embedpreviewerlink--default",name:"default",template:!0,source:"<EmbedPreviewerLink {...args} />",hasArgs:!0},Default:{storyId:"components-embedpreviewerlink--default",name:"Default",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","EmbedPreviewerLink","withComponentDocs"]}),ee=x.meta,te=["Default"],re=x.stories.Default;export{re as Default,te as __namedExportsOrder,ee as default};
//# sourceMappingURL=EmbedPreviewerLink.stories-48f8f4ce.js.map

View file

@ -0,0 +1,16 @@
import{S as E,i as D,s as L,k as M,d as _,t as m,v as S,h as f,w as V,f as $,o as k,g as p,b as v,e as H,m as c,j as d,C as P,y as h}from"./index-4f5e5369.js";import{g as z,a as A}from"./spread-8a54911c.js";import{p as T,M as j,T as F,S as N}from"./collect-stories-6e37d46b.js";import{F as q}from"./fa-870bc0bd.js";import{w as I}from"./withParams-47e2ab71.js";const O=`An embed tool for development in graphics kit.
\`\`\`svelte
<script>
import { EmbedPreviewerLink } from '@reuters-graphics/graphics-components';
import { dev } from '$app/env';
<\/script>
<EmbedPreviewerLink dev="{dev}" />
\`\`\`
`;/*!
* Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/var R={prefix:"far",iconName:"window-restore",icon:[512,512,[],"f2d2","M464 0H144c-26.5 0-48 21.5-48 48v48H48c-26.5 0-48 21.5-48 48v320c0 26.5 21.5 48 48 48h320c26.5 0 48-21.5 48-48v-48h48c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zm-96 464H48V256h320v208zm96-96h-48V144c0-26.5-21.5-48-48-48H144V48h320v320z"]};function y(o){let t,a,e,n;return e=new q({props:{icon:R}}),{c(){t=k("div"),a=k("a"),p(e.$$.fragment),v(a,"rel","external"),v(a,"href","/embed-previewer"),v(a,"class","svelte-715e2e"),v(t,"class","svelte-715e2e")},m(r,i){_(r,t,i),H(t,a),c(e,a,null),n=!0},i(r){n||(m(e.$$.fragment,r),n=!0)},o(r){f(e.$$.fragment,r),n=!1},d(r){r&&$(t),d(e)}}}function W(o){let t,a,e=o[0]&&y();return{c(){e&&e.c(),t=M()},m(n,r){e&&e.m(n,r),_(n,t,r),a=!0},p(n,[r]){n[0]?e?r&1&&m(e,1):(e=y(),e.c(),m(e,1),e.m(t.parentNode,t)):e&&(S(),f(e,1,1,()=>{e=null}),V())},i(n){a||(m(e),a=!0)},o(n){f(e),a=!1},d(n){n&&$(t),e&&e.d(n)}}}function B(o,t,a){let{dev:e=!1}=t;return o.$$set=n=>{"dev"in n&&a(0,e=n.dev)},[e]}class g extends E{constructor(t){super(),D(this,t,B,W,L,{dev:0})}}g.__docgen={version:3,name:"EmbedPreviewerLink.svelte",data:[{visibility:"public",description:null,keywords:[],name:"dev",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};function G(o){let t,a;const e=[o[0]];let n={};for(let r=0;r<e.length;r+=1)n=P(n,e[r]);return t=new g({props:n}),{c(){p(t.$$.fragment)},m(r,i){c(t,r,i),a=!0},p(r,i){const u=i&1?z(e,[A(r[0])]):{};t.$set(u)},i(r){a||(m(t.$$.fragment,r),a=!0)},o(r){f(t.$$.fragment,r),a=!1},d(r){d(t,r)}}}function J(o){let t,a,e,n,r,i;const u=[{title:"Components/EmbedPreviewerLink"},{component:g},I(O)];let w={};for(let s=0;s<u.length;s+=1)w=P(w,u[s]);return t=new j({props:w}),e=new F({props:{$$slots:{default:[G,({args:s})=>({0:s}),({args:s})=>s?1:0]},$$scope:{ctx:o}}}),r=new N({props:{name:"Default",args:{dev:!0}}}),{c(){p(t.$$.fragment),a=h(),p(e.$$.fragment),n=h(),p(r.$$.fragment)},m(s,l){c(t,s,l),_(s,a,l),c(e,s,l),_(s,n,l),c(r,s,l),i=!0},p(s,[l]){const C={};t.$set(C);const b={};l&3&&(b.$$scope={dirty:l,ctx:s}),e.$set(b)},i(s){i||(m(t.$$.fragment,s),m(e.$$.fragment,s),m(r.$$.fragment,s),i=!0)},o(s){f(t.$$.fragment,s),f(e.$$.fragment,s),f(r.$$.fragment,s),i=!1},d(s){s&&($(a),$(n)),d(t,s),d(e,s),d(r,s)}}}class K extends E{constructor(t){super(),D(this,t,null,J,L,{})}}const x=T(K,{meta:{title:"Components/EmbedPreviewerLink"},stories:{"tpl:default":{name:"default",template:!0,source:"<EmbedPreviewerLink {...args} />",hasArgs:!0},Default:{name:"Default",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","EmbedPreviewerLink","withComponentDocs"]}),ee=x.meta,te=["Default"],re=x.stories.Default;export{re as Default,te as __namedExportsOrder,ee as default};
//# sourceMappingURL=EmbedPreviewerLink.stories-7ea2c556.js.map

View file

@ -1,4 +1,4 @@
import{S as E,i as C,s as M,c as p,m as d,t as u,a as _,d as $,e as S,b as f,f as m,K as A,l as N,p as y,h as D,C as I}from"./index-2c1648fc.js";import{g as F,a as q}from"./spread-8a54911c.js";import{p as B,M as P,T as j,S as z}from"./collect-stories-640c7888.js";import{e as T}from"./each-e59479a4.js";import{m as g}from"./marked.esm-76161808.js";import{B as K}from"./Block-d69850f9.js";import{w as O}from"./withParams-47e2ab71.js";const G=`Note text includes notes to the main article — usually things like sources, clarifiying notes and minor corrections at the end of a story.
import{S as E,i as C,s as M,g as p,m as d,t as u,h as _,j as $,k as S,d as f,f as m,V as F,o as N,y,b as k,C as H}from"./index-4f5e5369.js";import{g as I,a as j}from"./spread-8a54911c.js";import{p as q,M as B,T as P,S as z}from"./collect-stories-6e37d46b.js";import{e as D}from"./each-e59479a4.js";import{m as g}from"./marked.esm-76161808.js";import{B as O}from"./Block-67c7bec3.js";import{w as V}from"./withParams-47e2ab71.js";const G=`Note text includes notes to the main article — usually things like sources, clarifiying notes and minor corrections at the end of a story.
Note text can be fed a markdown string, but text styling is intentionally restricted in this component. For example, all heading tags are forced to a single font size and weight.
@ -24,5 +24,5 @@ Note text can be fed a markdown string, but text styling is intentionally restri
<NoteText notes="{notes}" />
\`\`\`
`;function b(i,t,s){const e=i.slice();return e[1]=t[s],e}function k(i){let t,s=T(i[0]),e=[];for(let n=0;n<s.length;n+=1)e[n]=x(b(i,s,n));return{c(){for(let n=0;n<e.length;n+=1)e[n].c();t=S()},m(n,r){for(let o=0;o<e.length;o+=1)e[o]&&e[o].m(n,r);f(n,t,r)},p(n,r){if(r&1){s=T(n[0]);let o;for(o=0;o<s.length;o+=1){const l=b(n,s,o);e[o]?e[o].p(l,r):(e[o]=x(l),e[o].c(),e[o].m(t.parentNode,t))}for(;o<e.length;o+=1)e[o].d(1);e.length=s.length}},d(n){n&&m(t),A(e,n)}}}function x(i){let t,s=g.parse(i[1].title)+"",e,n,r=g.parse(i[1].text)+"";return{c(){t=N("div"),e=y(),n=N("div"),D(t,"class","note-title svelte-as9r96"),D(n,"class","note-content svelte-as9r96")},m(o,l){f(o,t,l),t.innerHTML=s,f(o,e,l),f(o,n,l),n.innerHTML=r},p(o,l){l&1&&s!==(s=g.parse(o[1].title)+"")&&(t.innerHTML=s),l&1&&r!==(r=g.parse(o[1].text)+"")&&(n.innerHTML=r)},d(o){o&&(m(t),m(e),m(n))}}}function J(i){let t,s=i[0]&&k(i);return{c(){s&&s.c(),t=S()},m(e,n){s&&s.m(e,n),f(e,t,n)},p(e,n){e[0]?s?s.p(e,n):(s=k(e),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null)},d(e){e&&m(t),s&&s.d(e)}}}function Q(i){let t,s;return t=new K({props:{class:"notes fmt-6 fmb-8",$$slots:{default:[J]},$$scope:{ctx:i}}}),{c(){p(t.$$.fragment)},m(e,n){d(t,e,n),s=!0},p(e,[n]){const r={};n&17&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){s||(u(t.$$.fragment,e),s=!0)},o(e){_(t.$$.fragment,e),s=!1},d(e){$(t,e)}}}function R(i,t,s){let{notes:e=[]}=t;return i.$$set=n=>{"notes"in n&&s(0,e=n.notes)},[e]}class w extends E{constructor(t){super(),C(this,t,R,Q,M,{notes:0})}}w.__docgen={version:3,name:"EndNotes.svelte",data:[{keywords:[{name:"required",description:""}],visibility:"public",description:"An array of endnote items.",name:"notes",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"array",type:"array"}}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const U=i=>i.map(t=>({title:t.Title,text:t.Text}));function V(i){let t,s;const e=[i[1]];let n={};for(let r=0;r<e.length;r+=1)n=I(n,e[r]);return t=new w({props:n}),{c(){p(t.$$.fragment)},m(r,o){d(t,r,o),s=!0},p(r,o){const l=o&2?F(e,[q(r[1])]):{};t.$set(l)},i(r){s||(u(t.$$.fragment,r),s=!0)},o(r){_(t.$$.fragment,r),s=!1},d(r){$(t,r)}}}function W(i){let t,s,e,n,r,o;const l=[{title:"Components/EndNotes"},{component:w},O(G)];let h={};for(let a=0;a<l.length;a+=1)h=I(h,l[a]);return t=new P({props:h}),e=new j({props:{$$slots:{default:[V,({args:a})=>({1:a}),({args:a})=>a?2:0]},$$scope:{ctx:i}}}),r=new z({props:{name:"Default",args:{notes:U(i[0])}}}),{c(){p(t.$$.fragment),s=y(),p(e.$$.fragment),n=y(),p(r.$$.fragment)},m(a,c){d(t,a,c),f(a,s,c),d(e,a,c),f(a,n,c),d(r,a,c),o=!0},p(a,[c]){const L={};t.$set(L);const v={};c&6&&(v.$$scope={dirty:c,ctx:a}),e.$set(v)},i(a){o||(u(t.$$.fragment,a),u(e.$$.fragment,a),u(r.$$.fragment,a),o=!0)},o(a){_(t.$$.fragment,a),_(e.$$.fragment,a),_(r.$$.fragment,a),o=!1},d(a){a&&(m(s),m(n)),$(t,a),$(e,a),$(r,a)}}}function X(i){return[[{Title:"Note",Text:"Data is current as of today."},{Title:"Sources",Text:"Data, Inc."},{Title:"Edited by",Text:'<a href="https://www.reuters.com/graphics/">Editor</a>, Copyeditor'}]]}class Y extends E{constructor(t){super(),C(this,t,X,W,M,{})}}const H=B(Y,{meta:{title:"Components/EndNotes"},stories:{"tpl:default":{storyId:"components-endnotes--default",name:"default",template:!0,source:"<EndNotes {...args} />",hasArgs:!0},Default:{storyId:"components-endnotes--default",name:"Default",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","EndNotes","getEndNotesPropsFromDoc","withComponentDocs"]}),ae=H.meta,ie=["Default"],le=H.stories.Default;export{le as Default,ie as __namedExportsOrder,ae as default};
//# sourceMappingURL=EndNotes.stories-f048dc3f.js.map
`;function T(i,t,s){const e=i.slice();return e[1]=t[s],e}function b(i){let t,s=D(i[0]),e=[];for(let n=0;n<s.length;n+=1)e[n]=x(T(i,s,n));return{c(){for(let n=0;n<e.length;n+=1)e[n].c();t=S()},m(n,r){for(let o=0;o<e.length;o+=1)e[o]&&e[o].m(n,r);f(n,t,r)},p(n,r){if(r&1){s=D(n[0]);let o;for(o=0;o<s.length;o+=1){const l=T(n,s,o);e[o]?e[o].p(l,r):(e[o]=x(l),e[o].c(),e[o].m(t.parentNode,t))}for(;o<e.length;o+=1)e[o].d(1);e.length=s.length}},d(n){n&&m(t),F(e,n)}}}function x(i){let t,s=g.parse(i[1].title)+"",e,n,r=g.parse(i[1].text)+"";return{c(){t=N("div"),e=y(),n=N("div"),k(t,"class","note-title svelte-as9r96"),k(n,"class","note-content svelte-as9r96")},m(o,l){f(o,t,l),t.innerHTML=s,f(o,e,l),f(o,n,l),n.innerHTML=r},p(o,l){l&1&&s!==(s=g.parse(o[1].title)+"")&&(t.innerHTML=s),l&1&&r!==(r=g.parse(o[1].text)+"")&&(n.innerHTML=r)},d(o){o&&(m(t),m(e),m(n))}}}function J(i){let t,s=i[0]&&b(i);return{c(){s&&s.c(),t=S()},m(e,n){s&&s.m(e,n),f(e,t,n)},p(e,n){e[0]?s?s.p(e,n):(s=b(e),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null)},d(e){e&&m(t),s&&s.d(e)}}}function K(i){let t,s;return t=new O({props:{class:"notes fmt-6 fmb-8",$$slots:{default:[J]},$$scope:{ctx:i}}}),{c(){p(t.$$.fragment)},m(e,n){d(t,e,n),s=!0},p(e,[n]){const r={};n&17&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){s||(u(t.$$.fragment,e),s=!0)},o(e){_(t.$$.fragment,e),s=!1},d(e){$(t,e)}}}function Q(i,t,s){let{notes:e=[]}=t;return i.$$set=n=>{"notes"in n&&s(0,e=n.notes)},[e]}class w extends E{constructor(t){super(),C(this,t,Q,K,M,{notes:0})}}w.__docgen={version:3,name:"EndNotes.svelte",data:[{keywords:[{name:"required",description:""}],visibility:"public",description:"An array of endnote items.",name:"notes",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"array",type:"array"}}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const R=i=>i.map(t=>({title:t.Title,text:t.Text}));function U(i){let t,s;const e=[i[1]];let n={};for(let r=0;r<e.length;r+=1)n=H(n,e[r]);return t=new w({props:n}),{c(){p(t.$$.fragment)},m(r,o){d(t,r,o),s=!0},p(r,o){const l=o&2?I(e,[j(r[1])]):{};t.$set(l)},i(r){s||(u(t.$$.fragment,r),s=!0)},o(r){_(t.$$.fragment,r),s=!1},d(r){$(t,r)}}}function W(i){let t,s,e,n,r,o;const l=[{title:"Components/EndNotes"},{component:w},V(G)];let h={};for(let a=0;a<l.length;a+=1)h=H(h,l[a]);return t=new B({props:h}),e=new P({props:{$$slots:{default:[U,({args:a})=>({1:a}),({args:a})=>a?2:0]},$$scope:{ctx:i}}}),r=new z({props:{name:"Default",args:{notes:R(i[0])}}}),{c(){p(t.$$.fragment),s=y(),p(e.$$.fragment),n=y(),p(r.$$.fragment)},m(a,c){d(t,a,c),f(a,s,c),d(e,a,c),f(a,n,c),d(r,a,c),o=!0},p(a,[c]){const A={};t.$set(A);const v={};c&6&&(v.$$scope={dirty:c,ctx:a}),e.$set(v)},i(a){o||(u(t.$$.fragment,a),u(e.$$.fragment,a),u(r.$$.fragment,a),o=!0)},o(a){_(t.$$.fragment,a),_(e.$$.fragment,a),_(r.$$.fragment,a),o=!1},d(a){a&&(m(s),m(n)),$(t,a),$(e,a),$(r,a)}}}function X(i){return[[{Title:"Note",Text:"Data is current as of today."},{Title:"Sources",Text:"Data, Inc."},{Title:"Edited by",Text:'<a href="https://www.reuters.com/graphics/">Editor</a>, Copyeditor'}]]}class Y extends E{constructor(t){super(),C(this,t,X,W,M,{})}}const L=q(Y,{meta:{title:"Components/EndNotes"},stories:{"tpl:default":{name:"default",template:!0,source:"<EndNotes {...args} />",hasArgs:!0},Default:{name:"Default",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","EndNotes","getEndNotesPropsFromDoc","withComponentDocs"]}),ae=L.meta,ie=["Default"],le=L.stories.Default;export{le as Default,ie as __namedExportsOrder,ae as default};
//# sourceMappingURL=EndNotes.stories-a1367203.js.map

View file

@ -1 +1 @@
{"version":3,"file":"EndNotes.stories-f048dc3f.js","sources":["../../src/components/EndNotes/stories/docs/component.md?raw","../../src/components/EndNotes/EndNotes.svelte","../../src/components/EndNotes/docProps.ts","../../src/components/EndNotes/EndNotes.stories.svelte"],"sourcesContent":["export default \"Note text includes notes to the main article — usually things like sources, clarifiying notes and minor corrections at the end of a story.\\n\\nNote text can be fed a markdown string, but text styling is intentionally restricted in this component. For example, all heading tags are forced to a single font size and weight.\\n\\n```svelte\\n<script>\\n import { NoteText } from '@reuters-graphics/graphics-components';\\n\\n const notes = [\\n {\\n title: 'Note',\\n text: 'Data is current as of today.',\\n },\\n {\\n title: 'Sources',\\n text: 'Data, Inc.',\\n },\\n {\\n title: 'Edited by',\\n text: '<a href=\\\"https://www.reuters.com/graphics/\\\">Editor</a>, Copyeditor',\\n },\\n ];\\n</script>\\n\\n<NoteText notes=\\\"{notes}\\\" />\\n```\\n\"","<!-- @component `EndNotes` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-EndNotes--default) -->\n<script lang=\"ts\">\n interface EndNote {\n /**\n * Title of the note item\n */\n title: String;\n /**\n * Contents of the note as a markdown string\n * @required\n */\n text: String;\n }\n\n /**\n * An array of endnote items.\n * @required\n */\n export let notes: EndNote[] = [];\n\n import { marked } from 'marked';\n import Block from '../Block/Block.svelte';\n</script>\n\n<Block class=\"notes fmt-6 fmb-8\">\n {#if notes}\n {#each notes as note}\n <div class=\"note-title\">{@html marked.parse(note.title)}</div>\n <div class=\"note-content\">{@html marked.parse(note.text)}</div>\n {/each}\n {/if}\n</Block>\n\n<!-- svelte-ignore css-unused-selector -->\n<style lang=\"scss\">\n @import '../../scss/mixins';\n\n .note-title {\n :global(p) {\n @include body-caption;\n @include text-primary;\n @include font-medium;\n @include tracking-normal;\n @include fmt-3;\n margin-bottom: 0.125rem;\n text-transform: none;\n }\n }\n\n .note-content {\n :global(p) {\n @include body-caption;\n @include fmt-0;\n }\n }\n</style>\n","interface EndNote {\n Title: String;\n Text: String;\n}\n\ntype Block = EndNote[];\n\nexport const getEndNotesPropsFromDoc = (docBlock: Block) => {\n return docBlock.map((d) => {\n return {\n title: d.Title,\n text: d.Text,\n };\n });\n};\n","<script>\n import { Meta, Template, Story } from '@storybook/addon-svelte-csf';\n\n // @ts-ignore\n import componentDocs from './stories/docs/component.md?raw';\n\n import EndNotes from './EndNotes.svelte';\n import { getEndNotesPropsFromDoc } from './docProps';\n import { withComponentDocs } from '$lib/docs/utils/withParams.js';\n\n const notes = [\n {\n Title: 'Note',\n Text: 'Data is current as of today.',\n },\n {\n Title: 'Sources',\n Text: 'Data, Inc.',\n },\n {\n Title: 'Edited by',\n Text: '<a href=\"https://www.reuters.com/graphics/\">Editor</a>, Copyeditor',\n },\n ];\n</script>\n\n<Meta\n title=\"Components/EndNotes\"\n component=\"{EndNotes}\"\n {...withComponentDocs(componentDocs)}\n/>\n\n<Template let:args>\n <EndNotes {...args} />\n</Template>\n\n<Story name=\"Default\" args=\"{{ notes: getEndNotesPropsFromDoc(notes) }}\" />\n"],"names":["componentDocs","ctx","i","raw0_value","marked","raw1_value","insert","target","div0","anchor","div1","dirty","create_if_block","notes","$$props","getEndNotesPropsFromDoc","docBlock","d","EndNotes","withComponentDocs"],"mappings":"ibAAA,MAAeA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;iFC0BJC,EAAK,CAAA,CAAA,uBAAV,OAAIC,GAAA,4JAACD,EAAK,CAAA,CAAA,oBAAV,OAAIC,GAAA,EAAA,yHAAJ,mDAC+BC,EAAAC,EAAO,MAAMH,KAAK,KAAK,EAAA,OACrBI,EAAAD,EAAO,MAAMH,KAAK,IAAI,EAAA,oIADvDK,EAA6DC,EAAAC,EAAAC,CAAA,yBAC7DH,EAA8DC,EAAAG,EAAAD,CAAA,wBAD/BE,EAAA,GAAAR,KAAAA,EAAAC,EAAO,MAAMH,KAAK,KAAK,EAAA,MAAAO,EAAA,UAAAL,GACrBQ,EAAA,GAAAN,KAAAA,EAAAD,EAAO,MAAMH,KAAK,IAAI,EAAA,MAAAS,EAAA,UAAAL,qDAHtDJ,EAAK,CAAA,GAAAW,EAAAX,CAAA,iEAALA,EAAK,CAAA,gaAPC,MAAAY,EAAK,EAAA,EAAAC,kdCXL,MAAAC,EAA2BC,GAC/BA,EAAS,IAAKC,IACZ,CACL,MAAOA,EAAE,MACT,KAAMA,EAAE,IAAA,EAEX,iCCoBahB,EAAI,CAAA,CAAA,oJAAJA,EAAI,CAAA,CAAA,CAAA,CAAA,+KALNiB,CAAQ,EAChBC,EAAkBnB,CAAa,kNAON,MAAOe,EAAwBd,EAAK,CAAA,CAAA,uaA1BtD,EAEP,MAAO,OACP,KAAM,gCAGN,CAAA,MAAO,UACP,KAAM,YAAY,GAGlB,MAAO,YACP,KAAM"}
{"version":3,"file":"EndNotes.stories-a1367203.js","sources":["../../src/components/EndNotes/stories/docs/component.md?raw","../../src/components/EndNotes/EndNotes.svelte","../../src/components/EndNotes/docProps.ts","../../src/components/EndNotes/EndNotes.stories.svelte"],"sourcesContent":["export default \"Note text includes notes to the main article — usually things like sources, clarifiying notes and minor corrections at the end of a story.\\n\\nNote text can be fed a markdown string, but text styling is intentionally restricted in this component. For example, all heading tags are forced to a single font size and weight.\\n\\n```svelte\\n<script>\\n import { NoteText } from '@reuters-graphics/graphics-components';\\n\\n const notes = [\\n {\\n title: 'Note',\\n text: 'Data is current as of today.',\\n },\\n {\\n title: 'Sources',\\n text: 'Data, Inc.',\\n },\\n {\\n title: 'Edited by',\\n text: '<a href=\\\"https://www.reuters.com/graphics/\\\">Editor</a>, Copyeditor',\\n },\\n ];\\n</script>\\n\\n<NoteText notes=\\\"{notes}\\\" />\\n```\\n\"","<!-- @component `EndNotes` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-EndNotes--default) -->\n<script lang=\"ts\">\n interface EndNote {\n /**\n * Title of the note item\n */\n title: String;\n /**\n * Contents of the note as a markdown string\n * @required\n */\n text: String;\n }\n\n /**\n * An array of endnote items.\n * @required\n */\n export let notes: EndNote[] = [];\n\n import { marked } from 'marked';\n import Block from '../Block/Block.svelte';\n</script>\n\n<Block class=\"notes fmt-6 fmb-8\">\n {#if notes}\n {#each notes as note}\n <div class=\"note-title\">{@html marked.parse(note.title)}</div>\n <div class=\"note-content\">{@html marked.parse(note.text)}</div>\n {/each}\n {/if}\n</Block>\n\n<!-- svelte-ignore css-unused-selector -->\n<style lang=\"scss\">\n @import '../../scss/mixins';\n\n .note-title {\n :global(p) {\n @include body-caption;\n @include text-primary;\n @include font-medium;\n @include tracking-normal;\n @include fmt-3;\n margin-bottom: 0.125rem;\n text-transform: none;\n }\n }\n\n .note-content {\n :global(p) {\n @include body-caption;\n @include fmt-0;\n }\n }\n</style>\n","interface EndNote {\n Title: String;\n Text: String;\n}\n\ntype Block = EndNote[];\n\nexport const getEndNotesPropsFromDoc = (docBlock: Block) => {\n return docBlock.map((d) => {\n return {\n title: d.Title,\n text: d.Text,\n };\n });\n};\n","<script>\n import { Meta, Template, Story } from '@storybook/addon-svelte-csf';\n\n // @ts-ignore\n import componentDocs from './stories/docs/component.md?raw';\n\n import EndNotes from './EndNotes.svelte';\n import { getEndNotesPropsFromDoc } from './docProps';\n import { withComponentDocs } from '$lib/docs/utils/withParams.js';\n\n const notes = [\n {\n Title: 'Note',\n Text: 'Data is current as of today.',\n },\n {\n Title: 'Sources',\n Text: 'Data, Inc.',\n },\n {\n Title: 'Edited by',\n Text: '<a href=\"https://www.reuters.com/graphics/\">Editor</a>, Copyeditor',\n },\n ];\n</script>\n\n<Meta\n title=\"Components/EndNotes\"\n component=\"{EndNotes}\"\n {...withComponentDocs(componentDocs)}\n/>\n\n<Template let:args>\n <EndNotes {...args} />\n</Template>\n\n<Story name=\"Default\" args=\"{{ notes: getEndNotesPropsFromDoc(notes) }}\" />\n"],"names":["componentDocs","ctx","i","raw0_value","marked","raw1_value","insert","target","div0","anchor","div1","dirty","create_if_block","notes","$$props","getEndNotesPropsFromDoc","docBlock","d","EndNotes","withComponentDocs"],"mappings":"4aAAA,MAAeA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;iFC0BJC,EAAK,CAAA,CAAA,uBAAV,OAAIC,GAAA,4JAACD,EAAK,CAAA,CAAA,oBAAV,OAAIC,GAAA,EAAA,yHAAJ,mDAC+BC,EAAAC,EAAO,MAAMH,KAAK,KAAK,EAAA,OACrBI,EAAAD,EAAO,MAAMH,KAAK,IAAI,EAAA,oIADvDK,EAA6DC,EAAAC,EAAAC,CAAA,yBAC7DH,EAA8DC,EAAAG,EAAAD,CAAA,wBAD/BE,EAAA,GAAAR,KAAAA,EAAAC,EAAO,MAAMH,KAAK,KAAK,EAAA,MAAAO,EAAA,UAAAL,GACrBQ,EAAA,GAAAN,KAAAA,EAAAD,EAAO,MAAMH,KAAK,IAAI,EAAA,MAAAS,EAAA,UAAAL,qDAHtDJ,EAAK,CAAA,GAAAW,EAAAX,CAAA,iEAALA,EAAK,CAAA,gaAPC,MAAAY,EAAK,EAAA,EAAAC,kdCXL,MAAAC,EAA2BC,GAC/BA,EAAS,IAAKC,IACZ,CACL,MAAOA,EAAE,MACT,KAAMA,EAAE,IAAA,EAEX,iCCoBahB,EAAI,CAAA,CAAA,oJAAJA,EAAI,CAAA,CAAA,CAAA,CAAA,+KALNiB,CAAQ,EAChBC,EAAkBnB,CAAa,kNAON,MAAOe,EAAwBd,EAAK,CAAA,CAAA,uaA1BtD,EAEP,MAAO,OACP,KAAM,gCAGN,CAAA,MAAO,UACP,KAAM,YAAY,GAGlB,MAAO,YACP,KAAM"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,56 @@
import{S as Q,i as G,s as q,C as y,g as m,y as _,m as f,d as T,t as h,h as u,f as w,j as g}from"./index-4f5e5369.js";import{g as E,a as M}from"./spread-8a54911c.js";import{p as W,M as z,T as L,S as I}from"./collect-stories-6e37d46b.js";import{F as v}from"./FeaturePhoto-d0380275.js";import{b as U,w as N}from"./withParams-47e2ab71.js";import"./Block-67c7bec3.js";import"./PaddingReset-bdb61f35.js";const O=`A full-width photo inside the text well.
\`\`\`svelte
<script>
import { FeaturePhoto } from '@reuters-graphics/graphics-components';
import { assets } from '$app/paths'; // 👈 If using in the Graphics Kit...
<\/script>
<FeaturePhoto
src="{\`\${assets}/images/myImage.jpg\`}"
altText="Some alt text"
caption="A caption"
lazy="{false}"
width="normal"
/>
\`\`\`
`,B=`An example of using \`FeaturePhoto\` in the Graphics Kit with a Google Doc.
\`\`\`yaml
# Google doc block
Type: photo
Width: normal
Src: images/shark.jpg
AltText: The king of the sea
Caption: Carcharodon carcharias - REUTERS
\`\`\`
\`\`\`svelte
<!-- App.svelte -->
<script>
// Add FeaturePhoto to imports from graphics-components
import { FeaturePhoto } from '@reuters-graphics/graphics-components';
// These should be already imported for you.
import content from '$locales/en/content.json';
import { assets } from '$app/paths';
<\/script>
{#each content.blocks as block}
{#if block.Type === 'text'}
<!-- ... other blocks -->
<!-- Copy/paste into your blocks loop! -->
{:else if block.Type === 'photo'}
<FeaturePhoto
width="{block.Width}"
src="{\`\${assets}/\${block.Src}\`}"
altText="{block.AltText}"
caption="{block.Caption}"
/>
<!-- END copy/paste -->
{/if}
{/each}
\`\`\`
`,H="If your photo is missing `altText` a small warning will overlay the image.\n",S=""+new URL("shark-f4201fc0.jpg",import.meta.url).href;function J(c){let s,r;const n=[c[1]];let i={};for(let e=0;e<n.length;e+=1)i=y(i,n[e]);return s=new v({props:i}),{c(){m(s.$$.fragment)},m(e,p){f(s,e,p),r=!0},p(e,p){const a=p&2?E(n,[M(e[1])]):{};s.$set(a)},i(e){r||(h(s.$$.fragment,e),r=!0)},o(e){u(s.$$.fragment,e),r=!1},d(e){g(s,e)}}}function V(c){let s,r,n,i,e,p,a,k,l,d;const $=[{title:"Components/FeaturePhoto"},{component:v},c[0]];let A={};for(let t=0;t<$.length;t+=1)A=y(A,$[t]);s=new z({props:A}),n=new L({props:{$$slots:{default:[J,({args:t})=>({1:t}),({args:t})=>t?2:0]},$$scope:{ctx:c}}}),e=new I({props:{name:"Default",args:{src:S,altText:"A shark!",width:"normal",caption:"Carcharodon carcharias - REUTERS"}}});const P=[{name:"🚀 QUICKIT"},{args:{src:S,altText:"A shark!",width:"normal",caption:"Carcharodon carcharias - REUTERS"}},U(B)];let C={};for(let t=0;t<P.length;t+=1)C=y(C,P[t]);a=new I({props:C});const b=[{name:"Missing altText"},{args:{src:S,width:"normal",caption:"Carcharodon carcharias - REUTERS"}},U(H)];let D={};for(let t=0;t<b.length;t+=1)D=y(D,b[t]);return l=new I({props:D}),{c(){m(s.$$.fragment),r=_(),m(n.$$.fragment),i=_(),m(e.$$.fragment),p=_(),m(a.$$.fragment),k=_(),m(l.$$.fragment)},m(t,o){f(s,t,o),T(t,r,o),f(n,t,o),T(t,i,o),f(e,t,o),T(t,p,o),f(a,t,o),T(t,k,o),f(l,t,o),d=!0},p(t,[o]){const R=o&1?E($,[$[0],$[1],M(t[0])]):{};s.$set(R);const F={};o&6&&(F.$$scope={dirty:o,ctx:t}),n.$set(F);const K={};a.$set(K);const j={};l.$set(j)},i(t){d||(h(s.$$.fragment,t),h(n.$$.fragment,t),h(e.$$.fragment,t),h(a.$$.fragment,t),h(l.$$.fragment,t),d=!0)},o(t){u(s.$$.fragment,t),u(n.$$.fragment,t),u(e.$$.fragment,t),u(a.$$.fragment,t),u(l.$$.fragment,t),d=!1},d(t){t&&(w(r),w(i),w(p),w(k)),g(s,t),g(n,t),g(e,t),g(a,t),g(l,t)}}}function X(c){return[{...N(O),argTypes:{width:{control:"select",options:["normal","wide","wider","widest","fluid"]},textWidth:{control:"select",options:["normal","wide","wider","widest","fluid"]}}}]}class Y extends Q{constructor(s){super(),G(this,s,X,V,q,{})}}const x=W(Y,{meta:{title:"Components/FeaturePhoto"},stories:{"tpl:default":{name:"default",template:!0,source:"<FeaturePhoto {...args} />",hasArgs:!0},Default:{name:"Default",template:!1,source:"",hasArgs:!1},QUICKIT:{name:"🚀 QUICKIT",template:!1,source:"",hasArgs:!1},MissingAltText:{name:"Missing altText",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","quickitDocs","missingAltTextDocs","FeaturePhoto","sharkSrc","withComponentDocs","withStoryDocs"]}),rt=x.meta,it=["Default","QUICKIT","MissingAltText"],pt=x.stories.Default,lt=x.stories.QUICKIT,ct=x.stories.MissingAltText;export{pt as Default,ct as MissingAltText,lt as QUICKIT,it as __namedExportsOrder,rt as default};
//# sourceMappingURL=FeaturePhoto.stories-965cb754.js.map

View file

@ -1 +1 @@
{"version":3,"file":"FeaturePhoto.stories-e02c685f.js","sources":["../../src/components/FeaturePhoto/stories/docs/component.md?raw","../../src/components/FeaturePhoto/stories/docs/quickit.md?raw","../../src/components/FeaturePhoto/stories/docs/missingAltText.md?raw","../../src/components/FeaturePhoto/stories/shark.jpg","../../src/components/FeaturePhoto/FeaturePhoto.stories.svelte"],"sourcesContent":["export default \"A full-width photo inside the text well.\\n\\n```svelte\\n<script>\\n import { FeaturePhoto } from '@reuters-graphics/graphics-components';\\n import { assets } from '$app/paths'; // 👈 If using in the Graphics Kit...\\n</script>\\n\\n<FeaturePhoto\\n src=\\\"{`${assets}/images/myImage.jpg`}\\\"\\n altText=\\\"Some alt text\\\"\\n caption=\\\"A caption\\\"\\n lazy=\\\"{false}\\\"\\n width=\\\"normal\\\"\\n/>\\n```\\n\"","export default \"An example of using `FeaturePhoto` in the Graphics Kit with a Google Doc.\\n\\n```yaml\\n# Google doc block\\nType: photo\\nWidth: normal\\nSrc: images/shark.jpg\\nAltText: The king of the sea\\nCaption: Carcharodon carcharias - REUTERS\\n```\\n\\n```svelte\\n<!-- App.svelte -->\\n<script>\\n // Add FeaturePhoto to imports from graphics-components\\n import { FeaturePhoto } from '@reuters-graphics/graphics-components';\\n\\n // These should be already imported for you.\\n import content from '$locales/en/content.json';\\n import { assets } from '$app/paths';\\n</script>\\n\\n{#each content.blocks as block}\\n {#if block.Type === 'text'}\\n <!-- ... other blocks -->\\n\\n <!-- Copy/paste into your blocks loop! -->\\n {:else if block.Type === 'photo'}\\n <FeaturePhoto\\n width=\\\"{block.Width}\\\"\\n src=\\\"{`${assets}/${block.Src}`}\\\"\\n altText=\\\"{block.AltText}\\\"\\n caption=\\\"{block.Caption}\\\"\\n />\\n <!-- END copy/paste -->\\n {/if}\\n{/each}\\n```\\n\"","export default \"If your photo is missing `altText` a small warning will overlay the image.\\n\"","export default \"__VITE_ASSET__d597932c__\"","<script>\n import { Meta, Template, Story } from '@storybook/addon-svelte-csf';\n\n // @ts-ignore\n import componentDocs from './stories/docs/component.md?raw';\n // @ts-ignore\n import quickitDocs from './stories/docs/quickit.md?raw';\n // @ts-ignore\n import missingAltTextDocs from './stories/docs/missingAltText.md?raw';\n\n import FeaturePhoto from './FeaturePhoto.svelte';\n\n // @ts-ignore\n import sharkSrc from './stories/shark.jpg';\n\n import {\n withComponentDocs,\n withStoryDocs,\n } from '$lib/docs/utils/withParams.js';\n\n const metaProps = {\n ...withComponentDocs(componentDocs),\n argTypes: {\n width: {\n control: 'select',\n options: ['normal', 'wide', 'wider', 'widest', 'fluid'],\n },\n textWidth: {\n control: 'select',\n options: ['normal', 'wide', 'wider', 'widest', 'fluid'],\n },\n },\n };\n</script>\n\n<Meta\n title=\"Components/FeaturePhoto\"\n component=\"{FeaturePhoto}\"\n {...metaProps}\n/>\n\n<Template let:args>\n <FeaturePhoto {...args} />\n</Template>\n\n<Story\n name=\"Default\"\n args=\"{{\n src: sharkSrc,\n altText: 'A shark!',\n width: 'normal',\n caption: 'Carcharodon carcharias - REUTERS',\n }}\"\n/>\n\n<Story\n name=\"🚀 QUICKIT\"\n args=\"{{\n src: sharkSrc,\n altText: 'A shark!',\n width: 'normal',\n caption: 'Carcharodon carcharias - REUTERS',\n }}\"\n {...withStoryDocs(quickitDocs)}\n/>\n\n<Story\n name=\"Missing altText\"\n args=\"{{\n src: sharkSrc,\n width: 'normal',\n caption: 'Carcharodon carcharias - REUTERS',\n }}\"\n {...withStoryDocs(missingAltTextDocs)}\n/>\n"],"names":["componentDocs","quickitDocs","missingAltTextDocs","sharkSrc","ctx","FeaturePhoto","withStoryDocs","withComponentDocs"],"mappings":"8YAAA,MAAeA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECAAC,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECAAC,EAAA,+ECAAC,EAAA,GAAA,IAAA,IAAA,qBAAA,YAAA,GAAA,EAAA,oCC0CKC,EAAI,CAAA,CAAA,oJAAJA,EAAI,CAAA,CAAA,CAAA,CAAA,2LALVC,CAAY,EACpBD,EAAS,CAAA,2MAUX,IAAKD,EACL,QAAS,WACT,MAAO,SACP,QAAS,2EAOT,IAAKA,EACL,QAAS,WACT,MAAO,SACP,QAAS,qCAEPG,EAAcL,CAAW,gHAM3B,IAAKE,EACL,MAAO,SACP,QAAS,qCAEPG,EAAcJ,CAAkB,qUAnChCE,EAAS,CAAA,CAAA,maAlBE,CACV,GAAAG,EAAkBP,CAAa,EAClC,SAAQ,CACN,MAAK,CACH,QAAS,SACT,QAAO,CAAG,SAAU,OAAQ,QAAS,SAAU,OAAO,GAExD,UAAS,CACP,QAAS,SACT,QAAO,CAAG,SAAU,OAAQ,QAAS,SAAU,OAAO"}
{"version":3,"file":"FeaturePhoto.stories-965cb754.js","sources":["../../src/components/FeaturePhoto/stories/docs/component.md?raw","../../src/components/FeaturePhoto/stories/docs/quickit.md?raw","../../src/components/FeaturePhoto/stories/docs/missingAltText.md?raw","../../src/components/FeaturePhoto/stories/shark.jpg","../../src/components/FeaturePhoto/FeaturePhoto.stories.svelte"],"sourcesContent":["export default \"A full-width photo inside the text well.\\n\\n```svelte\\n<script>\\n import { FeaturePhoto } from '@reuters-graphics/graphics-components';\\n import { assets } from '$app/paths'; // 👈 If using in the Graphics Kit...\\n</script>\\n\\n<FeaturePhoto\\n src=\\\"{`${assets}/images/myImage.jpg`}\\\"\\n altText=\\\"Some alt text\\\"\\n caption=\\\"A caption\\\"\\n lazy=\\\"{false}\\\"\\n width=\\\"normal\\\"\\n/>\\n```\\n\"","export default \"An example of using `FeaturePhoto` in the Graphics Kit with a Google Doc.\\n\\n```yaml\\n# Google doc block\\nType: photo\\nWidth: normal\\nSrc: images/shark.jpg\\nAltText: The king of the sea\\nCaption: Carcharodon carcharias - REUTERS\\n```\\n\\n```svelte\\n<!-- App.svelte -->\\n<script>\\n // Add FeaturePhoto to imports from graphics-components\\n import { FeaturePhoto } from '@reuters-graphics/graphics-components';\\n\\n // These should be already imported for you.\\n import content from '$locales/en/content.json';\\n import { assets } from '$app/paths';\\n</script>\\n\\n{#each content.blocks as block}\\n {#if block.Type === 'text'}\\n <!-- ... other blocks -->\\n\\n <!-- Copy/paste into your blocks loop! -->\\n {:else if block.Type === 'photo'}\\n <FeaturePhoto\\n width=\\\"{block.Width}\\\"\\n src=\\\"{`${assets}/${block.Src}`}\\\"\\n altText=\\\"{block.AltText}\\\"\\n caption=\\\"{block.Caption}\\\"\\n />\\n <!-- END copy/paste -->\\n {/if}\\n{/each}\\n```\\n\"","export default \"If your photo is missing `altText` a small warning will overlay the image.\\n\"","export default \"__VITE_ASSET__d597932c__\"","<script>\n import { Meta, Template, Story } from '@storybook/addon-svelte-csf';\n\n // @ts-ignore\n import componentDocs from './stories/docs/component.md?raw';\n // @ts-ignore\n import quickitDocs from './stories/docs/quickit.md?raw';\n // @ts-ignore\n import missingAltTextDocs from './stories/docs/missingAltText.md?raw';\n\n import FeaturePhoto from './FeaturePhoto.svelte';\n\n // @ts-ignore\n import sharkSrc from './stories/shark.jpg';\n\n import {\n withComponentDocs,\n withStoryDocs,\n } from '$lib/docs/utils/withParams.js';\n\n const metaProps = {\n ...withComponentDocs(componentDocs),\n argTypes: {\n width: {\n control: 'select',\n options: ['normal', 'wide', 'wider', 'widest', 'fluid'],\n },\n textWidth: {\n control: 'select',\n options: ['normal', 'wide', 'wider', 'widest', 'fluid'],\n },\n },\n };\n</script>\n\n<Meta\n title=\"Components/FeaturePhoto\"\n component=\"{FeaturePhoto}\"\n {...metaProps}\n/>\n\n<Template let:args>\n <FeaturePhoto {...args} />\n</Template>\n\n<Story\n name=\"Default\"\n args=\"{{\n src: sharkSrc,\n altText: 'A shark!',\n width: 'normal',\n caption: 'Carcharodon carcharias - REUTERS',\n }}\"\n/>\n\n<Story\n name=\"🚀 QUICKIT\"\n args=\"{{\n src: sharkSrc,\n altText: 'A shark!',\n width: 'normal',\n caption: 'Carcharodon carcharias - REUTERS',\n }}\"\n {...withStoryDocs(quickitDocs)}\n/>\n\n<Story\n name=\"Missing altText\"\n args=\"{{\n src: sharkSrc,\n width: 'normal',\n caption: 'Carcharodon carcharias - REUTERS',\n }}\"\n {...withStoryDocs(missingAltTextDocs)}\n/>\n"],"names":["componentDocs","quickitDocs","missingAltTextDocs","sharkSrc","ctx","FeaturePhoto","withStoryDocs","withComponentDocs"],"mappings":"8YAAA,MAAeA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECAAC,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECAAC,EAAA,+ECAAC,EAAA,GAAA,IAAA,IAAA,qBAAA,YAAA,GAAA,EAAA,oCC0CKC,EAAI,CAAA,CAAA,oJAAJA,EAAI,CAAA,CAAA,CAAA,CAAA,2LALVC,CAAY,EACpBD,EAAS,CAAA,2MAUX,IAAKD,EACL,QAAS,WACT,MAAO,SACP,QAAS,2EAOT,IAAKA,EACL,QAAS,WACT,MAAO,SACP,QAAS,qCAEPG,EAAcL,CAAW,gHAM3B,IAAKE,EACL,MAAO,SACP,QAAS,qCAEPG,EAAcJ,CAAkB,qUAnChCE,EAAS,CAAA,CAAA,maAlBE,CACV,GAAAG,EAAkBP,CAAa,EAClC,SAAQ,CACN,MAAK,CACH,QAAS,SACT,QAAO,CAAG,SAAU,OAAQ,QAAS,SAAU,OAAO,GAExD,UAAS,CACP,QAAS,SACT,QAAO,CAAG,SAAU,OAAQ,QAAS,SAAU,OAAO"}

View file

@ -1,56 +0,0 @@
import{S as j,i as q,s as G,C as w,c as m,p as _,m as f,b as T,t as h,a as u,f as y,d as g}from"./index-2c1648fc.js";import{g as E,a as M}from"./spread-8a54911c.js";import{p as W,M as z,T as L,S as D}from"./collect-stories-640c7888.js";import{F as v}from"./FeaturePhoto-c9977e5f.js";import{b as U,w as N}from"./withParams-47e2ab71.js";import"./Block-d69850f9.js";import"./PaddingReset-05774ed0.js";const O=`A full-width photo inside the text well.
\`\`\`svelte
<script>
import { FeaturePhoto } from '@reuters-graphics/graphics-components';
import { assets } from '$app/paths'; // 👈 If using in the Graphics Kit...
<\/script>
<FeaturePhoto
src="{\`\${assets}/images/myImage.jpg\`}"
altText="Some alt text"
caption="A caption"
lazy="{false}"
width="normal"
/>
\`\`\`
`,B=`An example of using \`FeaturePhoto\` in the Graphics Kit with a Google Doc.
\`\`\`yaml
# Google doc block
Type: photo
Width: normal
Src: images/shark.jpg
AltText: The king of the sea
Caption: Carcharodon carcharias - REUTERS
\`\`\`
\`\`\`svelte
<!-- App.svelte -->
<script>
// Add FeaturePhoto to imports from graphics-components
import { FeaturePhoto } from '@reuters-graphics/graphics-components';
// These should be already imported for you.
import content from '$locales/en/content.json';
import { assets } from '$app/paths';
<\/script>
{#each content.blocks as block}
{#if block.Type === 'text'}
<!-- ... other blocks -->
<!-- Copy/paste into your blocks loop! -->
{:else if block.Type === 'photo'}
<FeaturePhoto
width="{block.Width}"
src="{\`\${assets}/\${block.Src}\`}"
altText="{block.AltText}"
caption="{block.Caption}"
/>
<!-- END copy/paste -->
{/if}
{/each}
\`\`\`
`,H="If your photo is missing `altText` a small warning will overlay the image.\n",S=""+new URL("shark-f4201fc0.jpg",import.meta.url).href;function J(c){let s,r;const n=[c[1]];let p={};for(let e=0;e<n.length;e+=1)p=w(p,n[e]);return s=new v({props:p}),{c(){m(s.$$.fragment)},m(e,i){f(s,e,i),r=!0},p(e,i){const a=i&2?E(n,[M(e[1])]):{};s.$set(a)},i(e){r||(h(s.$$.fragment,e),r=!0)},o(e){u(s.$$.fragment,e),r=!1},d(e){g(s,e)}}}function V(c){let s,r,n,p,e,i,a,k,l,d;const $=[{title:"Components/FeaturePhoto"},{component:v},c[0]];let I={};for(let t=0;t<$.length;t+=1)I=w(I,$[t]);s=new z({props:I}),n=new L({props:{$$slots:{default:[J,({args:t})=>({1:t}),({args:t})=>t?2:0]},$$scope:{ctx:c}}}),e=new D({props:{name:"Default",args:{src:S,altText:"A shark!",width:"normal",caption:"Carcharodon carcharias - REUTERS"}}});const b=[{name:"🚀 QUICKIT"},{args:{src:S,altText:"A shark!",width:"normal",caption:"Carcharodon carcharias - REUTERS"}},U(B)];let A={};for(let t=0;t<b.length;t+=1)A=w(A,b[t]);a=new D({props:A});const P=[{name:"Missing altText"},{args:{src:S,width:"normal",caption:"Carcharodon carcharias - REUTERS"}},U(H)];let C={};for(let t=0;t<P.length;t+=1)C=w(C,P[t]);return l=new D({props:C}),{c(){m(s.$$.fragment),r=_(),m(n.$$.fragment),p=_(),m(e.$$.fragment),i=_(),m(a.$$.fragment),k=_(),m(l.$$.fragment)},m(t,o){f(s,t,o),T(t,r,o),f(n,t,o),T(t,p,o),f(e,t,o),T(t,i,o),f(a,t,o),T(t,k,o),f(l,t,o),d=!0},p(t,[o]){const R=o&1?E($,[$[0],$[1],M(t[0])]):{};s.$set(R);const F={};o&6&&(F.$$scope={dirty:o,ctx:t}),n.$set(F);const K={};a.$set(K);const Q={};l.$set(Q)},i(t){d||(h(s.$$.fragment,t),h(n.$$.fragment,t),h(e.$$.fragment,t),h(a.$$.fragment,t),h(l.$$.fragment,t),d=!0)},o(t){u(s.$$.fragment,t),u(n.$$.fragment,t),u(e.$$.fragment,t),u(a.$$.fragment,t),u(l.$$.fragment,t),d=!1},d(t){t&&(y(r),y(p),y(i),y(k)),g(s,t),g(n,t),g(e,t),g(a,t),g(l,t)}}}function X(c){return[{...N(O),argTypes:{width:{control:"select",options:["normal","wide","wider","widest","fluid"]},textWidth:{control:"select",options:["normal","wide","wider","widest","fluid"]}}}]}class Y extends j{constructor(s){super(),q(this,s,X,V,G,{})}}const x=W(Y,{meta:{title:"Components/FeaturePhoto"},stories:{"tpl:default":{storyId:"components-featurephoto--default",name:"default",template:!0,source:"<FeaturePhoto {...args} />",hasArgs:!0},Default:{storyId:"components-featurephoto--default",name:"Default",template:!1,source:"",hasArgs:!1},QUICKIT:{storyId:"components-featurephoto--quickit",name:"🚀 QUICKIT",template:!1,source:"",hasArgs:!1},MissingAltText:{storyId:"components-featurephoto--missing-alt-text",name:"Missing altText",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","quickitDocs","missingAltTextDocs","FeaturePhoto","sharkSrc","withComponentDocs","withStoryDocs"]}),rt=x.meta,pt=["Default","QUICKIT","MissingAltText"],it=x.stories.Default,lt=x.stories.QUICKIT,ct=x.stories.MissingAltText;export{it as Default,ct as MissingAltText,lt as QUICKIT,pt as __namedExportsOrder,rt as default};
//# sourceMappingURL=FeaturePhoto.stories-e02c685f.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,2 +0,0 @@
import{I as o}from"./chunk-MSDTXLE7-17536f09.js";import{r as e}from"./index-e106f771.js";import"./iframe-06bd3a1b.js";import"../sb-preview/runtime.js";import"./_commonjsHelpers-de833af9.js";import"./index-d475d2ea.js";import"./index-d37d4223.js";var m=r=>{const{svgProps:t,...l}=r;return e.createElement(o,{icon:e.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{d:"M5 2.5a.5.5 0 11-1 0 .5.5 0 011 0zM4.5 5a.5.5 0 100-1 .5.5 0 000 1zM5 6.5a.5.5 0 11-1 0 .5.5 0 011 0z",fill:"currentColor"}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 0a2 2 0 012 2v10a2 2 0 01-2 2H1.5a.5.5 0 01-.5-.5V.5a.5.5 0 01.5-.5H11zm0 1H3v12h8a1 1 0 001-1V2a1 1 0 00-1-1z",fill:"currentColor"})),...l})},d=r=>{const{svgProps:t,...l}=r;return e.createElement(o,{icon:e.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.031 7.5a4 4 0 007.938 0H13.5a.5.5 0 000-1h-2.53a4 4 0 00-7.94 0H.501a.5.5 0 000 1h2.531zM7 10a3 3 0 100-6 3 3 0 000 6z",fill:"currentColor"})),...l})},h=r=>{const{svgProps:t,...l}=r;return e.createElement(o,{icon:e.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 2.5a1.5 1.5 0 01-1 1.415v4.053C5.554 7.4 6.367 7 7.5 7c.89 0 1.453-.252 1.812-.557.218-.184.374-.4.482-.62a1.5 1.5 0 111.026.143c-.155.423-.425.87-.86 1.24C9.394 7.685 8.59 8 7.5 8c-1.037 0-1.637.42-1.994.917a2.81 2.81 0 00-.472 1.18A1.5 1.5 0 114 10.086v-6.17A1.5 1.5 0 116 2.5zm-2 9a.5.5 0 111 0 .5.5 0 01-1 0zm1-9a.5.5 0 11-1 0 .5.5 0 011 0zm6 2a.5.5 0 11-1 0 .5.5 0 011 0z",fill:"currentColor"})),...l})},w=r=>{const{svgProps:t,...l}=r;return e.createElement(o,{icon:e.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.354 1.354L7.707 2H8.5A2.5 2.5 0 0111 4.5v5.585a1.5 1.5 0 11-1 0V4.5A1.5 1.5 0 008.5 3h-.793l.647.646a.5.5 0 11-.708.708l-1.5-1.5a.5.5 0 010-.708l1.5-1.5a.5.5 0 11.708.708zM11 11.5a.5.5 0 11-1 0 .5.5 0 011 0zM4 3.915a1.5 1.5 0 10-1 0v6.17a1.5 1.5 0 101 0v-6.17zM3.5 11a.5.5 0 100 1 .5.5 0 000-1zm0-8a.5.5 0 100-1 .5.5 0 000 1z",fill:"currentColor"})),...l})},g=r=>{const{svgProps:t,...l}=r;return e.createElement(o,{icon:e.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.108 3.872A1.5 1.5 0 103 3.915v6.17a1.5 1.5 0 101 0V6.41c.263.41.573.77.926 1.083 1.108.98 2.579 1.433 4.156 1.5A1.5 1.5 0 109.09 7.99c-1.405-.065-2.62-.468-3.5-1.248-.723-.64-1.262-1.569-1.481-2.871zM3.5 11a.5.5 0 100 1 .5.5 0 000-1zM4 2.5a.5.5 0 11-1 0 .5.5 0 011 0zm7 6a.5.5 0 11-1 0 .5.5 0 011 0z",fill:"currentColor"})),...l})};export{h as Branch,d as Commit,g as Merge,w as PullRequest,m as Repo};
//# sourceMappingURL=Git-DZ2D5ZUL-dbee32d2.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,3 +1,3 @@
import{R as t,r as o}from"./index-e106f771.js";import{S as i,p as m}from"./prism-6fbd7538.js";import{s as u}from"./scss-efc2351e.js";const d="_title_daft4_1",g="_table_daft4_20",f="_importsnippet_daft4_125",r={title:d,table:g,importsnippet:f};i.registerLanguage("scss",u);const _=s=>{const[e,c]=o.useState(!1);let a;o.useEffect(()=>{a&&clearTimeout(a),a=setTimeout(()=>{c(!1)},1500)},[e]);const n=async({partial:p})=>{const l=`@import "@reuters-graphics/graphics-components/dist/scss/colours/${p}";`;await navigator.clipboard.writeText(l),c(!0)};return t.createElement("button",{className:"copy-btn",onClick:()=>n(s)},t.createElement("span",{className:"material-symbols-outlined"},"content_copy"),e&&t.createElement("span",{className:"copy-tag"},"Copied"))},h=({included:s=!1,partial:e="thematic/_tr.scss"})=>s?t.createElement("div",{className:r.importsnippet},t.createElement("p",null,"Included")):t.createElement("div",{className:r.importsnippet},t.createElement(i,{language:"scss",style:m},`// global.scss
import{R as t,r as o}from"./index-7dae1d9b.js";import{S as i,p as m}from"./prism-a8cfe7d8.js";import{s as u}from"./scss-efc2351e.js";const d="_title_daft4_1",g="_table_daft4_20",f="_importsnippet_daft4_125",r={title:d,table:g,importsnippet:f};i.registerLanguage("scss",u);const _=s=>{const[e,c]=o.useState(!1);let a;o.useEffect(()=>{a&&clearTimeout(a),a=setTimeout(()=>{c(!1)},1500)},[e]);const n=async({partial:p})=>{const l=`@import "@reuters-graphics/graphics-components/dist/scss/colours/${p}";`;await navigator.clipboard.writeText(l),c(!0)};return t.createElement("button",{className:"copy-btn",onClick:()=>n(s)},t.createElement("span",{className:"material-symbols-outlined"},"content_copy"),e&&t.createElement("span",{className:"copy-tag"},"Copied"))},h=({included:s=!1,partial:e="thematic/_tr.scss"})=>s?t.createElement("div",{className:r.importsnippet},t.createElement("p",null,"Included")):t.createElement("div",{className:r.importsnippet},t.createElement(i,{language:"scss",style:m},`// global.scss
@import "@reuters-graphics/graphics-components/dist/scss/colours/${e}";`),t.createElement(_,{partial:e}));export{h as I,r as c};
//# sourceMappingURL=ImportSnippet-890e1ccf.js.map
//# sourceMappingURL=ImportSnippet-a649c2f8.js.map

View file

@ -1 +1 @@
{"version":3,"file":"ImportSnippet-890e1ccf.js","sources":["../../src/docs/docs-components/CopyColourTable/ImportSnippet.jsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light';\n// @ts-ignore\nimport classes from './styles.module.scss';\nimport prism from 'react-syntax-highlighter/dist/esm/styles/prism/prism';\nimport scss from 'react-syntax-highlighter/dist/esm/languages/prism/scss';\n\nSyntaxHighlighter.registerLanguage('scss', scss);\n\nconst Copyable = (props) => {\n const [copied, setCopied] = useState(false);\n\n let timeout;\n\n useEffect(() => {\n if(timeout) clearTimeout(timeout);\n timeout = setTimeout(() => { setCopied(false); }, 1500);\n }, [copied]);\n\n const handleClick = async({ partial }) => {\n const copyText = `@import \"@reuters-graphics/graphics-components/dist/scss/colours/${partial}\";`\n await navigator.clipboard.writeText(copyText);\n setCopied(true);\n }\n\n return (\n <button className=\"copy-btn\" onClick={() => handleClick(props)}>\n <span className=\"material-symbols-outlined\">content_copy</span>\n {copied && <span className=\"copy-tag\">Copied</span>}\n </button>\n );\n}\n\nconst ImportSnippet = ({ included = false, partial = 'thematic/_tr.scss' }) => {\n return included ? (\n <div className={classes.importsnippet}>\n <p>Included</p>\n </div>\n ) : (\n <div className={classes.importsnippet}>\n <SyntaxHighlighter language=\"scss\" style={prism}>\n {`// global.scss \\n@import \"@reuters-graphics/graphics-components/dist/scss/colours/${partial}\";`}\n </SyntaxHighlighter>\n <Copyable partial={partial} />\n </div>\n )\n};\n\nexport default ImportSnippet;"],"names":["SyntaxHighlighter","scss","Copyable","props","copied","setCopied","useState","timeout","useEffect","handleClick","partial","copyText","React","ImportSnippet","included","classes","prism"],"mappings":"mPAQAA,EAAkB,iBAAiB,OAAQC,CAAI,EAE/C,MAAMC,EAAYC,GAAU,CAC1B,KAAM,CAACC,EAAQC,CAAS,EAAIC,WAAS,EAAK,EAEtC,IAAAC,EAEJC,EAAAA,UAAU,IAAM,CACXD,GAAS,aAAaA,CAAO,EAChCA,EAAU,WAAW,IAAM,CAAEF,EAAU,EAAK,GAAM,IAAI,CAAA,EACrD,CAACD,CAAM,CAAC,EAEX,MAAMK,EAAc,MAAM,CAAE,QAAAC,KAAc,CAClC,MAAAC,EAAW,oEAAoED,CAAO,KACtF,MAAA,UAAU,UAAU,UAAUC,CAAQ,EAC5CN,EAAU,EAAI,CAAA,EAId,OAAAO,EAAA,cAAC,UAAO,UAAU,WAAW,QAAS,IAAMH,EAAYN,CAAK,GAC3DS,EAAA,cAAC,QAAK,UAAU,2BAAA,EAA4B,cAAY,EACvDR,mBAAW,OAAK,CAAA,UAAU,UAAW,EAAA,QAAM,CAC9C,CAEJ,EAEMS,EAAgB,CAAC,CAAE,SAAAC,EAAW,GAAO,QAAAJ,EAAU,uBAC5CI,kBACJ,MAAI,CAAA,UAAWC,EAAQ,aACtB,EAAAH,EAAA,cAAC,SAAE,UAAQ,CACb,EAECA,EAAA,cAAA,MAAA,CAAI,UAAWG,EAAQ,aAAA,kBACrBf,EAAkB,CAAA,SAAS,OAAO,MAAOgB,CACvC,EAAA;AAAA,mEAAqFN,CAAO,IAC/F,EACCE,EAAA,cAAAV,EAAA,CAAS,QAAAQ,CAAkB,CAAA,CAC9B"}
{"version":3,"file":"ImportSnippet-a649c2f8.js","sources":["../../src/docs/docs-components/CopyColourTable/ImportSnippet.jsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light';\n// @ts-ignore\nimport classes from './styles.module.scss';\nimport prism from 'react-syntax-highlighter/dist/esm/styles/prism/prism';\nimport scss from 'react-syntax-highlighter/dist/esm/languages/prism/scss';\n\nSyntaxHighlighter.registerLanguage('scss', scss);\n\nconst Copyable = (props) => {\n const [copied, setCopied] = useState(false);\n\n let timeout;\n\n useEffect(() => {\n if(timeout) clearTimeout(timeout);\n timeout = setTimeout(() => { setCopied(false); }, 1500);\n }, [copied]);\n\n const handleClick = async({ partial }) => {\n const copyText = `@import \"@reuters-graphics/graphics-components/dist/scss/colours/${partial}\";`\n await navigator.clipboard.writeText(copyText);\n setCopied(true);\n }\n\n return (\n <button className=\"copy-btn\" onClick={() => handleClick(props)}>\n <span className=\"material-symbols-outlined\">content_copy</span>\n {copied && <span className=\"copy-tag\">Copied</span>}\n </button>\n );\n}\n\nconst ImportSnippet = ({ included = false, partial = 'thematic/_tr.scss' }) => {\n return included ? (\n <div className={classes.importsnippet}>\n <p>Included</p>\n </div>\n ) : (\n <div className={classes.importsnippet}>\n <SyntaxHighlighter language=\"scss\" style={prism}>\n {`// global.scss \\n@import \"@reuters-graphics/graphics-components/dist/scss/colours/${partial}\";`}\n </SyntaxHighlighter>\n <Copyable partial={partial} />\n </div>\n )\n};\n\nexport default ImportSnippet;"],"names":["SyntaxHighlighter","scss","Copyable","props","copied","setCopied","useState","timeout","useEffect","handleClick","partial","copyText","React","ImportSnippet","included","classes","prism"],"mappings":"mPAQAA,EAAkB,iBAAiB,OAAQC,CAAI,EAE/C,MAAMC,EAAYC,GAAU,CAC1B,KAAM,CAACC,EAAQC,CAAS,EAAIC,WAAS,EAAK,EAEtC,IAAAC,EAEJC,EAAAA,UAAU,IAAM,CACXD,GAAS,aAAaA,CAAO,EAChCA,EAAU,WAAW,IAAM,CAAEF,EAAU,EAAK,GAAM,IAAI,CAAA,EACrD,CAACD,CAAM,CAAC,EAEX,MAAMK,EAAc,MAAM,CAAE,QAAAC,KAAc,CAClC,MAAAC,EAAW,oEAAoED,CAAO,KACtF,MAAA,UAAU,UAAU,UAAUC,CAAQ,EAC5CN,EAAU,EAAI,CAAA,EAId,OAAAO,EAAA,cAAC,UAAO,UAAU,WAAW,QAAS,IAAMH,EAAYN,CAAK,GAC3DS,EAAA,cAAC,QAAK,UAAU,2BAAA,EAA4B,cAAY,EACvDR,mBAAW,OAAK,CAAA,UAAU,UAAW,EAAA,QAAM,CAC9C,CAEJ,EAEMS,EAAgB,CAAC,CAAE,SAAAC,EAAW,GAAO,QAAAJ,EAAU,uBAC5CI,kBACJ,MAAI,CAAA,UAAWC,EAAQ,aACtB,EAAAH,EAAA,cAAC,SAAE,UAAQ,CACb,EAECA,EAAA,cAAA,MAAA,CAAI,UAAWG,EAAQ,aAAA,kBACrBf,EAAkB,CAAA,SAAS,OAAO,MAAOgB,CACvC,EAAA;AAAA,mEAAqFN,CAAO,IAC/F,EACCE,EAAA,cAAAV,EAAA,CAAS,QAAAQ,CAAkB,CAAA,CAC9B"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
import{S as v,i as g,s as h,e as w,b as _,q as I,a as u,r as F,t as c,f as p,u as m,v as b,w as k,x as y,l as P,h as R}from"./index-2c1648fc.js";function q(a){let t;const l=a[2].default,n=m(l,a,a[1],null);return{c(){n&&n.c()},m(e,s){n&&n.m(e,s),t=!0},p(e,s){n&&n.p&&(!t||s&2)&&b(n,l,e,e[1],t?y(l,e[1],s,null):k(e[1]),null)},i(e){t||(c(n,e),t=!0)},o(e){u(n,e),t=!1},d(e){n&&n.d(e)}}}function S(a){let t,l;const n=a[2].default,e=m(n,a,a[1],null);return{c(){t=P("div"),e&&e.c(),R(t,"class","svelte-vjyw8p")},m(s,i){_(s,t,i),e&&e.m(t,null),l=!0},p(s,i){e&&e.p&&(!l||i&2)&&b(e,n,s,s[1],l?y(n,s[1],i,null):k(s[1]),null)},i(s){l||(c(e,s),l=!0)},o(s){u(e,s),l=!1},d(s){s&&p(t),e&&e.d(s)}}}function j(a){let t,l,n,e;const s=[S,q],i=[];function d(o,r){return o[0]?0:1}return t=d(a),l=i[t]=s[t](a),{c(){l.c(),n=w()},m(o,r){i[t].m(o,r),_(o,n,r),e=!0},p(o,[r]){let f=t;t=d(o),t===f?i[t].p(o,r):(I(),u(i[f],1,1,()=>{i[f]=null}),F(),l=i[t],l?l.p(o,r):(l=i[t]=s[t](o),l.c()),c(l,1),l.m(n.parentNode,n))},i(o){e||(c(l),e=!0)},o(o){u(l),e=!1},d(o){o&&p(n),i[t].d(o)}}}function C(a,t,l){let{$$slots:n={},$$scope:e}=t,{containerIsFluid:s=!0}=t;return a.$$set=i=>{"containerIsFluid"in i&&l(0,s=i.containerIsFluid),"$$scope"in i&&l(1,e=i.$$scope)},[s,e,n]}class N extends v{constructor(t){super(),g(this,t,C,j,h,{containerIsFluid:0})}}N.__docgen={version:3,name:"PaddingReset.svelte",data:[{keywords:[],visibility:"public",description:"If parent container is fluid, which resets the padding around contained elements.",name:"containerIsFluid",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!0}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"Padded content",name:"default"}],refs:[]};export{N as P};
//# sourceMappingURL=PaddingReset-05774ed0.js.map
import{S as v,i as g,s as h,k as w,d as _,v as I,h as u,w as F,t as c,f as p,l as m,u as b,q as k,r as y,o as P,b as R}from"./index-4f5e5369.js";function q(a){let t;const l=a[2].default,n=m(l,a,a[1],null);return{c(){n&&n.c()},m(e,s){n&&n.m(e,s),t=!0},p(e,s){n&&n.p&&(!t||s&2)&&b(n,l,e,e[1],t?y(l,e[1],s,null):k(e[1]),null)},i(e){t||(c(n,e),t=!0)},o(e){u(n,e),t=!1},d(e){n&&n.d(e)}}}function S(a){let t,l;const n=a[2].default,e=m(n,a,a[1],null);return{c(){t=P("div"),e&&e.c(),R(t,"class","svelte-vjyw8p")},m(s,i){_(s,t,i),e&&e.m(t,null),l=!0},p(s,i){e&&e.p&&(!l||i&2)&&b(e,n,s,s[1],l?y(n,s[1],i,null):k(s[1]),null)},i(s){l||(c(e,s),l=!0)},o(s){u(e,s),l=!1},d(s){s&&p(t),e&&e.d(s)}}}function j(a){let t,l,n,e;const s=[S,q],i=[];function f(o,r){return o[0]?0:1}return t=f(a),l=i[t]=s[t](a),{c(){l.c(),n=w()},m(o,r){i[t].m(o,r),_(o,n,r),e=!0},p(o,[r]){let d=t;t=f(o),t===d?i[t].p(o,r):(I(),u(i[d],1,1,()=>{i[d]=null}),F(),l=i[t],l?l.p(o,r):(l=i[t]=s[t](o),l.c()),c(l,1),l.m(n.parentNode,n))},i(o){e||(c(l),e=!0)},o(o){u(l),e=!1},d(o){o&&p(n),i[t].d(o)}}}function C(a,t,l){let{$$slots:n={},$$scope:e}=t,{containerIsFluid:s=!0}=t;return a.$$set=i=>{"containerIsFluid"in i&&l(0,s=i.containerIsFluid),"$$scope"in i&&l(1,e=i.$$scope)},[s,e,n]}class N extends v{constructor(t){super(),g(this,t,C,j,h,{containerIsFluid:0})}}N.__docgen={version:3,name:"PaddingReset.svelte",data:[{keywords:[],visibility:"public",description:"If parent container is fluid, which resets the padding around contained elements.",name:"containerIsFluid",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!0}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"Padded content",name:"default"}],refs:[]};export{N as P};
//# sourceMappingURL=PaddingReset-bdb61f35.js.map

View file

@ -1 +1 @@
{"version":3,"file":"PaddingReset-05774ed0.js","sources":["../../src/components/PaddingReset/PaddingReset.svelte"],"sourcesContent":["<script>\n /**\n * If parent container is fluid, which resets the padding around contained elements.\n */\n export let containerIsFluid = true;\n</script>\n\n{#if containerIsFluid}\n <div>\n <!-- Padded content -->\n <slot />\n </div>\n{:else}\n <!-- Padded content -->\n <slot />\n{/if}\n\n<style>\n div {\n width: 100%;\n padding: 0 15px;\n }\n</style>\n"],"names":["insert","target","div","anchor","ctx","containerIsFluid","$$props"],"mappings":"ggBAQEA,EAGKC,EAAAC,EAAAC,CAAA,sOAJFC,EAAgB,CAAA,EAAA,wVAHR,CAAA,iBAAAC,EAAmB,EAAI,EAAAC"}
{"version":3,"file":"PaddingReset-bdb61f35.js","sources":["../../src/components/PaddingReset/PaddingReset.svelte"],"sourcesContent":["<script>\n /**\n * If parent container is fluid, which resets the padding around contained elements.\n */\n export let containerIsFluid = true;\n</script>\n\n{#if containerIsFluid}\n <div>\n <!-- Padded content -->\n <slot />\n </div>\n{:else}\n <!-- Padded content -->\n <slot />\n{/if}\n\n<style>\n div {\n width: 100%;\n padding: 0 15px;\n }\n</style>\n"],"names":["insert","target","div","anchor","ctx","containerIsFluid","$$props"],"mappings":"ggBAQEA,EAGKC,EAAAC,EAAAC,CAAA,sOAJFC,EAAgB,CAAA,EAAA,wVAHR,CAAA,iBAAAC,EAAmB,EAAI,EAAAC"}

View file

@ -1,4 +1,4 @@
import{S as D,i as A,s as C,C as v,c,p as h,m,b as $,t as f,a as u,f as _,d as g,l as P,h as R,n as I}from"./index-2c1648fc.js";import{g as S,a as x}from"./spread-8a54911c.js";import{p as M,M as T,T as F,S as j}from"./collect-stories-640c7888.js";import{P as k}from"./PaddingReset-05774ed0.js";import{B as q}from"./Block-d69850f9.js";import{w as E}from"./withParams-47e2ab71.js";const O=`Sometimes you want a visual element to be fluid, i.e., edge-to-edge, but keep padding on text that's adajcent to it.
import{S as y,i as A,s as C,C as v,g as c,y as h,m,d as $,t as f,h as u,f as _,j as g,o as P,b as R,n as S}from"./index-4f5e5369.js";import{g as x,a as I}from"./spread-8a54911c.js";import{p as M,M as T,T as j,S as F}from"./collect-stories-6e37d46b.js";import{P as k}from"./PaddingReset-bdb61f35.js";import{B as q}from"./Block-67c7bec3.js";import{w as E}from"./withParams-47e2ab71.js";const O=`Sometimes you want a visual element to be fluid, i.e., edge-to-edge, but keep padding on text that's adajcent to it.
The \`PaddingReset\` component resets padding on the \`Article\` well that's been cancelled by a \`Block\` with a \`fluid\` width.
@ -33,10 +33,10 @@ You can also add the padding conditionally by using the \`containerIsFluid\` pro
</PaddingReset>
</Block>
\`\`\`
`;function Y(l){let t;return{c(){t=P("div"),R(t,"class","inner svelte-2p4lln")},m(a,s){$(a,t,s)},p:I,d(a){a&&_(t)}}}function z(l){let t,a,s,o;const r=[l[0]];let d={$$slots:{default:[Y]},$$scope:{ctx:l}};for(let n=0;n<r.length;n+=1)d=v(d,r[n]);return s=new k({props:d}),{c(){t=P("div"),a=h(),c(s.$$.fragment),R(t,"class","outer svelte-2p4lln")},m(n,i){$(n,t,i),$(n,a,i),m(s,n,i),o=!0},p(n,i){const e=i&1?S(r,[x(n[0])]):{};i&2&&(e.$$scope={dirty:i,ctx:n}),s.$set(e)},i(n){o||(f(s.$$.fragment,n),o=!0)},o(n){u(s.$$.fragment,n),o=!1},d(n){n&&(_(t),_(a)),g(s,n)}}}function G(l){let t,a;return t=new q({props:{width:"fluid",$$slots:{default:[z]},$$scope:{ctx:l}}}),{c(){c(t.$$.fragment)},m(s,o){m(t,s,o),a=!0},p(s,o){const r={};o&3&&(r.$$scope={dirty:o,ctx:s}),t.$set(r)},i(s){a||(f(t.$$.fragment,s),a=!0)},o(s){u(t.$$.fragment,s),a=!1},d(s){g(t,s)}}}function H(l){let t,a,s,o,r,d;const n=[{title:"Components/PaddingReset"},{component:k},E(O)];let i={};for(let e=0;e<n.length;e+=1)i=v(i,n[e]);return t=new T({props:i}),s=new F({props:{$$slots:{default:[G,({args:e})=>({0:e}),({args:e})=>e?1:0]},$$scope:{ctx:l}}}),r=new j({props:{name:"Default",args:{containerIsFluid:!0}}}),{c(){c(t.$$.fragment),a=h(),c(s.$$.fragment),o=h(),c(r.$$.fragment)},m(e,p){m(t,e,p),$(e,a,p),m(s,e,p),$(e,o,p),m(r,e,p),d=!0},p(e,[p]){const y={};t.$set(y);const w={};p&3&&(w.$$scope={dirty:p,ctx:e}),s.$set(w)},i(e){d||(f(t.$$.fragment,e),f(s.$$.fragment,e),f(r.$$.fragment,e),d=!0)},o(e){u(t.$$.fragment,e),u(s.$$.fragment,e),u(r.$$.fragment,e),d=!1},d(e){e&&(_(a),_(o)),g(t,e),g(s,e),g(r,e)}}}class B extends D{constructor(t){super(),A(this,t,null,H,C,{})}}B.__docgen={version:3,name:"PaddingReset.stories.svelte",data:[],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const b=M(B,{meta:{title:"Components/PaddingReset"},stories:{"tpl:default":{storyId:"components-paddingreset--default",name:"default",template:!0,source:`<Block width="fluid">
`;function Y(l){let t;return{c(){t=P("div"),R(t,"class","inner svelte-2p4lln")},m(a,s){$(a,t,s)},p:S,d(a){a&&_(t)}}}function z(l){let t,a,s,o;const r=[l[0]];let d={$$slots:{default:[Y]},$$scope:{ctx:l}};for(let n=0;n<r.length;n+=1)d=v(d,r[n]);return s=new k({props:d}),{c(){t=P("div"),a=h(),c(s.$$.fragment),R(t,"class","outer svelte-2p4lln")},m(n,i){$(n,t,i),$(n,a,i),m(s,n,i),o=!0},p(n,i){const e=i&1?x(r,[I(n[0])]):{};i&2&&(e.$$scope={dirty:i,ctx:n}),s.$set(e)},i(n){o||(f(s.$$.fragment,n),o=!0)},o(n){u(s.$$.fragment,n),o=!1},d(n){n&&(_(t),_(a)),g(s,n)}}}function G(l){let t,a;return t=new q({props:{width:"fluid",$$slots:{default:[z]},$$scope:{ctx:l}}}),{c(){c(t.$$.fragment)},m(s,o){m(t,s,o),a=!0},p(s,o){const r={};o&3&&(r.$$scope={dirty:o,ctx:s}),t.$set(r)},i(s){a||(f(t.$$.fragment,s),a=!0)},o(s){u(t.$$.fragment,s),a=!1},d(s){g(t,s)}}}function H(l){let t,a,s,o,r,d;const n=[{title:"Components/PaddingReset"},{component:k},E(O)];let i={};for(let e=0;e<n.length;e+=1)i=v(i,n[e]);return t=new T({props:i}),s=new j({props:{$$slots:{default:[G,({args:e})=>({0:e}),({args:e})=>e?1:0]},$$scope:{ctx:l}}}),r=new F({props:{name:"Default",args:{containerIsFluid:!0}}}),{c(){c(t.$$.fragment),a=h(),c(s.$$.fragment),o=h(),c(r.$$.fragment)},m(e,p){m(t,e,p),$(e,a,p),m(s,e,p),$(e,o,p),m(r,e,p),d=!0},p(e,[p]){const D={};t.$set(D);const w={};p&3&&(w.$$scope={dirty:p,ctx:e}),s.$set(w)},i(e){d||(f(t.$$.fragment,e),f(s.$$.fragment,e),f(r.$$.fragment,e),d=!0)},o(e){u(t.$$.fragment,e),u(s.$$.fragment,e),u(r.$$.fragment,e),d=!1},d(e){e&&(_(a),_(o)),g(t,e),g(s,e),g(r,e)}}}class B extends y{constructor(t){super(),A(this,t,null,H,C,{})}}B.__docgen={version:3,name:"PaddingReset.stories.svelte",data:[],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const b=M(B,{meta:{title:"Components/PaddingReset"},stories:{"tpl:default":{name:"default",template:!0,source:`<Block width="fluid">
<div class="outer"></div>
<PaddingReset {...args}>
<div class="inner"></div>
</PaddingReset>
</Block>`,hasArgs:!0},Default:{storyId:"components-paddingreset--default",name:"Default",template:!1,source:"",hasArgs:!0}},allocatedIds:["default","Meta","Template","Story","componentDocs","PaddingReset","Block","withComponentDocs"]}),V=b.meta,W=["Default"],X=b.stories.Default;export{X as Default,W as __namedExportsOrder,V as default};
//# sourceMappingURL=PaddingReset.stories-13f188a1.js.map
</Block>`,hasArgs:!0},Default:{name:"Default",template:!1,source:"",hasArgs:!0}},allocatedIds:["default","Meta","Template","Story","componentDocs","PaddingReset","Block","withComponentDocs"]}),V=b.meta,W=["Default"],X=b.stories.Default;export{X as Default,W as __namedExportsOrder,V as default};
//# sourceMappingURL=PaddingReset.stories-72291f3e.js.map

View file

@ -1 +1 @@
{"version":3,"file":"PaddingReset.stories-13f188a1.js","sources":["../../src/components/PaddingReset/stories/docs/component.md?raw","../../src/components/PaddingReset/PaddingReset.stories.svelte"],"sourcesContent":["export default \"Sometimes you want a visual element to be fluid, i.e., edge-to-edge, but keep padding on text that's adajcent to it.\\n\\nThe `PaddingReset` component resets padding on the `Article` well that's been cancelled by a `Block` with a `fluid` width.\\n\\n```svelte\\n<script>\\n import { Block, PaddingReset } from '@reuters-graphics/graphics-components';\\n</script>\\n\\n<Block width=\\\"fluid\\\">\\n <!-- An edge-to-edge image -->\\n <img src=\\\"https//...\\\" alt=\\\"...\\\" width=\\\"100%\\\" />\\n <PaddingReset>\\n <p>A caption for the image that will still be padded.</p>\\n </PaddingReset>\\n</Block>\\n```\\n\\nYou can also add the padding conditionally by using the `containerIsFluid` prop, which is what many other components in this library do.\\n\\n```svelte\\n<script>\\n import { Block, PaddingReset } from '@reuters-graphics/graphics-components';\\n\\n export let src = 'https://...';\\n export let width = 'fluid';\\n</script>\\n\\n<Block width=\\\"{width}\\\">\\n <img src=\\\"{src}\\\" alt=\\\"...\\\" width=\\\"100%\\\" />\\n <PaddingReset containerIsFluid=\\\"{width === 'fluid'}\\\">\\n <p>A caption for the image that will be padded when Block is fluid.</p>\\n </PaddingReset>\\n</Block>\\n```\\n\"","<script>\n import { Meta, Template, Story } from '@storybook/addon-svelte-csf';\n\n // @ts-ignore\n import componentDocs from './stories/docs/component.md?raw';\n\n import PaddingReset from './PaddingReset.svelte';\n import Block from '../Block/Block.svelte';\n\n import { withComponentDocs } from '$lib/docs/utils/withParams.js';\n</script>\n\n<Meta\n title=\"Components/PaddingReset\"\n component=\"{PaddingReset}\"\n {...withComponentDocs(componentDocs)}\n/>\n\n<Template let:args>\n <Block width=\"fluid\">\n <div class=\"outer\"></div>\n <PaddingReset {...args}>\n <div class=\"inner\"></div>\n </PaddingReset>\n </Block>\n</Template>\n\n<Story\n name=\"Default\"\n args=\"{{\n containerIsFluid: true,\n }}\"\n let:args\n/>\n\n<style lang=\"scss\">\n div {\n height: 30px;\n width: 100%;\n margin-bottom: 2px;\n &.outer {\n background: grey;\n }\n &.inner {\n background: salmon;\n }\n }\n</style>\n"],"names":["componentDocs","insert","target","div","anchor","ctx","PaddingReset","withComponentDocs"],"mappings":"2XAAA,MAAeA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;uFCsBTC,EAAwBC,EAAAC,EAAAC,CAAA,yDADRC,EAAI,CAAA,CAAA,oMADtBJ,EAAwBC,EAAAC,EAAAC,CAAA,oDACNC,EAAI,CAAA,CAAA,CAAA,CAAA,igBAPZC,CAAY,EACpBC,EAAkBP,CAAa,4MAejC,KAAA,CAAA,iBAAkB,EAAI;;;;;"}
{"version":3,"file":"PaddingReset.stories-72291f3e.js","sources":["../../src/components/PaddingReset/stories/docs/component.md?raw","../../src/components/PaddingReset/PaddingReset.stories.svelte"],"sourcesContent":["export default \"Sometimes you want a visual element to be fluid, i.e., edge-to-edge, but keep padding on text that's adajcent to it.\\n\\nThe `PaddingReset` component resets padding on the `Article` well that's been cancelled by a `Block` with a `fluid` width.\\n\\n```svelte\\n<script>\\n import { Block, PaddingReset } from '@reuters-graphics/graphics-components';\\n</script>\\n\\n<Block width=\\\"fluid\\\">\\n <!-- An edge-to-edge image -->\\n <img src=\\\"https//...\\\" alt=\\\"...\\\" width=\\\"100%\\\" />\\n <PaddingReset>\\n <p>A caption for the image that will still be padded.</p>\\n </PaddingReset>\\n</Block>\\n```\\n\\nYou can also add the padding conditionally by using the `containerIsFluid` prop, which is what many other components in this library do.\\n\\n```svelte\\n<script>\\n import { Block, PaddingReset } from '@reuters-graphics/graphics-components';\\n\\n export let src = 'https://...';\\n export let width = 'fluid';\\n</script>\\n\\n<Block width=\\\"{width}\\\">\\n <img src=\\\"{src}\\\" alt=\\\"...\\\" width=\\\"100%\\\" />\\n <PaddingReset containerIsFluid=\\\"{width === 'fluid'}\\\">\\n <p>A caption for the image that will be padded when Block is fluid.</p>\\n </PaddingReset>\\n</Block>\\n```\\n\"","<script>\n import { Meta, Template, Story } from '@storybook/addon-svelte-csf';\n\n // @ts-ignore\n import componentDocs from './stories/docs/component.md?raw';\n\n import PaddingReset from './PaddingReset.svelte';\n import Block from '../Block/Block.svelte';\n\n import { withComponentDocs } from '$lib/docs/utils/withParams.js';\n</script>\n\n<Meta\n title=\"Components/PaddingReset\"\n component=\"{PaddingReset}\"\n {...withComponentDocs(componentDocs)}\n/>\n\n<Template let:args>\n <Block width=\"fluid\">\n <div class=\"outer\"></div>\n <PaddingReset {...args}>\n <div class=\"inner\"></div>\n </PaddingReset>\n </Block>\n</Template>\n\n<Story\n name=\"Default\"\n args=\"{{\n containerIsFluid: true,\n }}\"\n let:args\n/>\n\n<style lang=\"scss\">\n div {\n height: 30px;\n width: 100%;\n margin-bottom: 2px;\n &.outer {\n background: grey;\n }\n &.inner {\n background: salmon;\n }\n }\n</style>\n"],"names":["componentDocs","insert","target","div","anchor","ctx","PaddingReset","withComponentDocs"],"mappings":"gYAAA,MAAeA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;uFCsBTC,EAAwBC,EAAAC,EAAAC,CAAA,yDADRC,EAAI,CAAA,CAAA,oMADtBJ,EAAwBC,EAAAC,EAAAC,CAAA,oDACNC,EAAI,CAAA,CAAA,CAAA,CAAA,igBAPZC,CAAY,EACpBC,EAAkBP,CAAa,4MAejC,KAAA,CAAA,iBAAkB,EAAI;;;;;"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,31 +0,0 @@
import{S as P,i as v,s as w,D as x,C as D,c,p as g,m as d,b as y,t as u,a as f,f as $,d as h,l as k}from"./index-2c1648fc.js";import{g as M,a as j}from"./spread-8a54911c.js";import{w as A,p as H,M as I,T,S as N}from"./collect-stories-640c7888.js";import{p as q}from"./pym.v1-7344f633.js";import{w as E}from"./withParams-47e2ab71.js";import"./_commonjsHelpers-de833af9.js";const O=`A Pym.js child instance for embeddables.
\`\`\`svelte
<script>
import { PymChild } from '@reuters-graphics/graphics-components';
<\/script>
<PymChild polling="{500}" />
\`\`\`
You can access the Pym.js child through its store in other components to send custom height updates to parent frames:
\`\`\`svelte
<script>
import {
PymChild,
pymChildStore,
} from '@reuters-graphics/graphics-components';
const updateHeight = () => {
if ($pymChildStore) $pymChildStore.sendHeight();
};
<\/script>
<PymChild />
<button on:click="{updateHeight}">Update height</button>
\`\`\`
`,U=A(null);function V(p,t,r){let{polling:n=500}=t,l;return x(()=>{l=new q.Child({polling:n}),U.set(l)}),p.$$set=o=>{"polling"in o&&r(0,n=o.polling)},[n]}class _ extends P{constructor(t){super(),v(this,t,V,null,w,{polling:0})}}_.__docgen={version:3,name:"PymChild.svelte",data:[{keywords:[],visibility:"public",description:"Pym.js polling interval",name:"polling",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:500}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};function Y(p){let t,r,n,l;const o=[p[0]];let i={};for(let s=0;s<o.length;s+=1)i=D(i,o[s]);return t=new _({props:i}),{c(){c(t.$$.fragment),r=g(),n=k("div"),n.textContent="Nothing to see here. 😎"},m(s,a){d(t,s,a),y(s,r,a),y(s,n,a),l=!0},p(s,a){const e=a&1?M(o,[j(s[0])]):{};t.$set(e)},i(s){l||(u(t.$$.fragment,s),l=!0)},o(s){f(t.$$.fragment,s),l=!1},d(s){s&&($(r),$(n)),h(t,s)}}}function z(p){let t,r,n,l,o,i;const s=[{title:"Components/PymChild"},{component:_},E(O)];let a={};for(let e=0;e<s.length;e+=1)a=D(a,s[e]);return t=new I({props:a}),n=new T({props:{$$slots:{default:[Y,({args:e})=>({0:e}),({args:e})=>e?1:0]},$$scope:{ctx:p}}}),o=new N({props:{name:"Default"}}),{c(){c(t.$$.fragment),r=g(),c(n.$$.fragment),l=g(),c(o.$$.fragment)},m(e,m){d(t,e,m),y(e,r,m),d(n,e,m),y(e,l,m),d(o,e,m),i=!0},p(e,[m]){const S={};t.$set(S);const C={};m&3&&(C.$$scope={dirty:m,ctx:e}),n.$set(C)},i(e){i||(u(t.$$.fragment,e),u(n.$$.fragment,e),u(o.$$.fragment,e),i=!0)},o(e){f(t.$$.fragment,e),f(n.$$.fragment,e),f(o.$$.fragment,e),i=!1},d(e){e&&($(r),$(l)),h(t,e),h(n,e),h(o,e)}}}class B extends P{constructor(t){super(),v(this,t,null,z,w,{})}}const b=H(B,{meta:{title:"Components/PymChild"},stories:{"tpl:default":{storyId:"components-pymchild--default",name:"default",template:!0,source:`<PymChild {...args} />
<div>Nothing to see here. 😎</div>`,hasArgs:!0},Default:{storyId:"components-pymchild--default",name:"Default",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","PymChild","withComponentDocs"]}),R=b.meta,W=["Default"],X=b.stories.Default;export{X as Default,W as __namedExportsOrder,R as default};
//# sourceMappingURL=PymChild.stories-d316c13b.js.map

View file

@ -0,0 +1,31 @@
import{S as P,i as v,s as w,D as x,C as D,g as c,y as $,m as d,d as g,t as u,h as f,f as y,j as h,o as j}from"./index-4f5e5369.js";import{g as k,a as M}from"./spread-8a54911c.js";import{w as A,p as H,M as T,T as N,S as q}from"./collect-stories-6e37d46b.js";import{p as E}from"./pym.v1-7344f633.js";import{w as I}from"./withParams-47e2ab71.js";import"./_commonjsHelpers-de833af9.js";const O=`A Pym.js child instance for embeddables.
\`\`\`svelte
<script>
import { PymChild } from '@reuters-graphics/graphics-components';
<\/script>
<PymChild polling="{500}" />
\`\`\`
You can access the Pym.js child through its store in other components to send custom height updates to parent frames:
\`\`\`svelte
<script>
import {
PymChild,
pymChildStore,
} from '@reuters-graphics/graphics-components';
const updateHeight = () => {
if ($pymChildStore) $pymChildStore.sendHeight();
};
<\/script>
<PymChild />
<button on:click="{updateHeight}">Update height</button>
\`\`\`
`,U=A(null);function V(p,t,l){let{polling:n=500}=t,r;return x(()=>{r=new E.Child({polling:n}),U.set(r)}),p.$$set=o=>{"polling"in o&&l(0,n=o.polling)},[n]}class _ extends P{constructor(t){super(),v(this,t,V,null,w,{polling:0})}}_.__docgen={version:3,name:"PymChild.svelte",data:[{keywords:[],visibility:"public",description:"Pym.js polling interval",name:"polling",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:500}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};function Y(p){let t,l,n,r;const o=[p[0]];let a={};for(let s=0;s<o.length;s+=1)a=D(a,o[s]);return t=new _({props:a}),{c(){c(t.$$.fragment),l=$(),n=j("div"),n.textContent="Nothing to see here. 😎"},m(s,i){d(t,s,i),g(s,l,i),g(s,n,i),r=!0},p(s,i){const e=i&1?k(o,[M(s[0])]):{};t.$set(e)},i(s){r||(u(t.$$.fragment,s),r=!0)},o(s){f(t.$$.fragment,s),r=!1},d(s){s&&(y(l),y(n)),h(t,s)}}}function z(p){let t,l,n,r,o,a;const s=[{title:"Components/PymChild"},{component:_},I(O)];let i={};for(let e=0;e<s.length;e+=1)i=D(i,s[e]);return t=new T({props:i}),n=new N({props:{$$slots:{default:[Y,({args:e})=>({0:e}),({args:e})=>e?1:0]},$$scope:{ctx:p}}}),o=new q({props:{name:"Default"}}),{c(){c(t.$$.fragment),l=$(),c(n.$$.fragment),r=$(),c(o.$$.fragment)},m(e,m){d(t,e,m),g(e,l,m),d(n,e,m),g(e,r,m),d(o,e,m),a=!0},p(e,[m]){const S={};t.$set(S);const C={};m&3&&(C.$$scope={dirty:m,ctx:e}),n.$set(C)},i(e){a||(u(t.$$.fragment,e),u(n.$$.fragment,e),u(o.$$.fragment,e),a=!0)},o(e){f(t.$$.fragment,e),f(n.$$.fragment,e),f(o.$$.fragment,e),a=!1},d(e){e&&(y(l),y(r)),h(t,e),h(n,e),h(o,e)}}}class B extends P{constructor(t){super(),v(this,t,null,z,w,{})}}const b=H(B,{meta:{title:"Components/PymChild"},stories:{"tpl:default":{name:"default",template:!0,source:`<PymChild {...args} />
<div>Nothing to see here. 😎</div>`,hasArgs:!0},Default:{name:"Default",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","PymChild","withComponentDocs"]}),R=b.meta,W=["Default"],X=b.stories.Default;export{X as Default,W as __namedExportsOrder,R as default};
//# sourceMappingURL=PymChild.stories-f22332f4.js.map

View file

@ -1 +1 @@
{"version":3,"file":"PymChild.stories-d316c13b.js","sources":["../../src/components/PymChild/stories/docs/component.md?raw","../../src/components/PymChild/stores.js","../../src/components/PymChild/PymChild.svelte","../../src/components/PymChild/PymChild.stories.svelte"],"sourcesContent":["export default \"A Pym.js child instance for embeddables.\\n\\n```svelte\\n<script>\\n import { PymChild } from '@reuters-graphics/graphics-components';\\n</script>\\n\\n<PymChild polling=\\\"{500}\\\" />\\n```\\n\\nYou can access the Pym.js child through its store in other components to send custom height updates to parent frames:\\n\\n```svelte\\n<script>\\n import {\\n PymChild,\\n pymChildStore,\\n } from '@reuters-graphics/graphics-components';\\n\\n const updateHeight = () => {\\n if ($pymChildStore) $pymChildStore.sendHeight();\\n };\\n</script>\\n\\n<PymChild />\\n\\n<button on:click=\\\"{updateHeight}\\\">Update height</button>\\n```\\n\"","import { writable } from 'svelte/store';\n\nexport const pymChildStore = writable(null);\n","<!-- @component `PymChild` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/utilities-PymChild--default) -->\n<script lang=\"ts\">\n /** Pym.js polling interval */\n export let polling: number = 500;\n\n import { onMount } from 'svelte';\n import pym from 'pym.js';\n import { pymChildStore } from './stores.js';\n\n let pymChild;\n\n onMount(() => {\n pymChild = new pym.Child({ polling });\n pymChildStore.set(pymChild);\n });\n</script>\n","<script>\n import { Meta, Template, Story } from '@storybook/addon-svelte-csf';\n\n // @ts-ignore\n import componentDocs from './stories/docs/component.md?raw';\n\n import PymChild from './PymChild.svelte';\n\n import { withComponentDocs } from '$lib/docs/utils/withParams.js';\n</script>\n\n<Meta\n title=\"Components/PymChild\"\n component=\"{PymChild}\"\n {...withComponentDocs(componentDocs)}\n/>\n\n<Template let:args>\n <PymChild {...args} />\n <div>Nothing to see here. 😎</div>\n</Template>\n\n<Story name=\"Default\" />\n"],"names":["componentDocs","pymChildStore","writable","polling","$$props","pymChild","onMount","pym","ctx","insert","target","div","anchor","PymChild","withComponentDocs"],"mappings":"oXAAA,MAAeA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECEFC,EAAgBC,EAAS,IAAI,oBCC7B,GAAA,CAAA,QAAAC,EAAkB,GAAG,EAAAC,EAM5BC,EAEJ,OAAAC,EAAO,IAAA,CACLD,EAAe,IAAAE,EAAI,OAAQ,QAAAJ,CAAO,CAAA,EAClCF,EAAc,IAAII,CAAQ,2eCKdG,EAAI,CAAA,CAAA,sLAClBC,EAAiCC,EAAAC,EAAAC,CAAA,kCADnBJ,EAAI,CAAA,CAAA,CAAA,CAAA,8LALNK,CAAQ,EAChBC,EAAkBd,CAAa;"}
{"version":3,"file":"PymChild.stories-f22332f4.js","sources":["../../src/components/PymChild/stories/docs/component.md?raw","../../src/components/PymChild/stores.js","../../src/components/PymChild/PymChild.svelte","../../src/components/PymChild/PymChild.stories.svelte"],"sourcesContent":["export default \"A Pym.js child instance for embeddables.\\n\\n```svelte\\n<script>\\n import { PymChild } from '@reuters-graphics/graphics-components';\\n</script>\\n\\n<PymChild polling=\\\"{500}\\\" />\\n```\\n\\nYou can access the Pym.js child through its store in other components to send custom height updates to parent frames:\\n\\n```svelte\\n<script>\\n import {\\n PymChild,\\n pymChildStore,\\n } from '@reuters-graphics/graphics-components';\\n\\n const updateHeight = () => {\\n if ($pymChildStore) $pymChildStore.sendHeight();\\n };\\n</script>\\n\\n<PymChild />\\n\\n<button on:click=\\\"{updateHeight}\\\">Update height</button>\\n```\\n\"","import { writable } from 'svelte/store';\n\nexport const pymChildStore = writable(null);\n","<!-- @component `PymChild` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/utilities-PymChild--default) -->\n<script lang=\"ts\">\n /** Pym.js polling interval */\n export let polling: number = 500;\n\n import { onMount } from 'svelte';\n import pym from 'pym.js';\n import { pymChildStore } from './stores.js';\n\n let pymChild;\n\n onMount(() => {\n pymChild = new pym.Child({ polling });\n pymChildStore.set(pymChild);\n });\n</script>\n","<script>\n import { Meta, Template, Story } from '@storybook/addon-svelte-csf';\n\n // @ts-ignore\n import componentDocs from './stories/docs/component.md?raw';\n\n import PymChild from './PymChild.svelte';\n\n import { withComponentDocs } from '$lib/docs/utils/withParams.js';\n</script>\n\n<Meta\n title=\"Components/PymChild\"\n component=\"{PymChild}\"\n {...withComponentDocs(componentDocs)}\n/>\n\n<Template let:args>\n <PymChild {...args} />\n <div>Nothing to see here. 😎</div>\n</Template>\n\n<Story name=\"Default\" />\n"],"names":["componentDocs","pymChildStore","writable","polling","$$props","pymChild","onMount","pym","ctx","insert","target","div","anchor","PymChild","withComponentDocs"],"mappings":"8XAAA,MAAeA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECEFC,EAAgBC,EAAS,IAAI,oBCC7B,GAAA,CAAA,QAAAC,EAAkB,GAAG,EAAAC,EAM5BC,EAEJ,OAAAC,EAAO,IAAA,CACLD,EAAe,IAAAE,EAAI,OAAQ,QAAAJ,CAAO,CAAA,EAClCF,EAAc,IAAII,CAAQ,2eCKdG,EAAI,CAAA,CAAA,sLAClBC,EAAiCC,EAAAC,EAAAC,CAAA,kCADnBJ,EAAI,CAAA,CAAA,CAAA,CAAA,8LALNK,CAAQ,EAChBC,EAAkBd,CAAa;"}

Some files were not shown because too many files have changed in this diff Show more