4 lines
14 KiB
JavaScript
4 lines
14 KiB
JavaScript
import{S as P,i as U,s as E,e as D,a as h,g as S,t as u,c as L,b as f,d as y,q as A,u as I,r as V,v as W,w as T,x as K,j as w,m as $,n as v,K as ie,D as H,z,E as Y,M as le,Y as ne,W as x}from"./index-25af778d.js";import{B as ee}from"./Block-9c89ee1a.js";import{P as N}from"./PaddingReset-d848e1b7.js";import{m as F}from"./marked.esm-76161808.js";function se(s){let t;const l=s[2].default,e=A(l,s,s[1],null);return{c(){e&&e.c()},m(i,n){e&&e.m(i,n),t=!0},p(i,n){e&&e.p&&(!t||n&2)&&I(e,l,i,i[1],t?W(l,i[1],n,null):V(i[1]),null)},i(i){t||(f(e,i),t=!0)},o(i){u(e,i),t=!1},d(i){e&&e.d(i)}}}function re(s){let t,l;const e=s[2].default,i=A(e,s,s[1],null);return{c(){t=T("div"),i&&i.c(),K(t,"aria-hidden","true")},m(n,r){h(n,t,r),i&&i.m(t,null),l=!0},p(n,r){i&&i.p&&(!l||r&2)&&I(i,e,n,n[1],l?W(e,n[1],r,null):V(n[1]),null)},i(n){l||(f(i,n),l=!0)},o(n){u(i,n),l=!1},d(n){n&&y(t),i&&i.d(n)}}}function oe(s){let t,l,e,i;const n=[re,se],r=[];function _(o,a){return o[0]?0:1}return t=_(s),l=r[t]=n[t](s),{c(){l.c(),e=D()},m(o,a){r[t].m(o,a),h(o,e,a),i=!0},p(o,[a]){let m=t;t=_(o),t===m?r[t].p(o,a):(S(),u(r[m],1,1,()=>{r[m]=null}),L(),l=r[t],l?l.p(o,a):(l=r[t]=n[t](o),l.c()),f(l,1),l.m(e.parentNode,e))},i(o){i||(f(l),i=!0)},o(o){u(l),i=!1},d(o){r[t].d(o),o&&y(e)}}}function ae(s,t,l){let{$$slots:e={},$$scope:i}=t,{hidden:n=!1}=t;return s.$$set=r=>{"hidden"in r&&l(0,n=r.hidden),"$$scope"in r&&l(1,i=r.$$scope)},[n,i,e]}class te extends P{constructor(t){super(),U(this,t,ae,oe,E,{hidden:0})}}te.__docgen={version:3,name:"AriaHidden.svelte",data:[{keywords:[],visibility:"public",description:"Whether to wrap the graphic with an aria hidden tag.",name:"hidden",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"",name:"default"}],refs:[]};function fe(s){let t;const l=s[1].default,e=A(l,s,s[2],null);return{c(){e&&e.c()},m(i,n){e&&e.m(i,n),t=!0},p(i,n){e&&e.p&&(!t||n&4)&&I(e,l,i,i[2],t?W(l,i[2],n,null):V(i[2]),null)},i(i){t||(f(e,i),t=!0)},o(i){u(e,i),t=!1},d(i){e&&e.d(i)}}}function ue(s){let t,l;return t=new ee({props:{width:s[0],cls:"m-0",$$slots:{default:[ce]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&1&&(n.width=e[0]),i&4&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(f(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function ce(s){let t;const l=s[1].default,e=A(l,s,s[2],null);return{c(){e&&e.c()},m(i,n){e&&e.m(i,n),t=!0},p(i,n){e&&e.p&&(!t||n&4)&&I(e,l,i,i[2],t?W(l,i[2],n,null):V(i[2]),null)},i(i){t||(f(e,i),t=!0)},o(i){u(e,i),t=!1},d(i){e&&e.d(i)}}}function de(s){let t,l,e,i;const n=[ue,fe],r=[];function _(o,a){return o[0]?0:1}return t=_(s),l=r[t]=n[t](s),{c(){l.c(),e=D()},m(o,a){r[t].m(o,a),h(o,e,a),i=!0},p(o,[a]){let m=t;t=_(o),t===m?r[t].p(o,a):(S(),u(r[m],1,1,()=>{r[m]=null}),L(),l=r[t],l?l.p(o,a):(l=r[t]=n[t](o),l.c()),f(l,1),l.m(e.parentNode,e))},i(o){i||(f(l),i=!0)},o(o){u(l),i=!1},d(o){r[t].d(o),o&&y(e)}}}function _e(s,t,l){let{$$slots:e={},$$scope:i}=t,{width:n=null}=t;return s.$$set=r=>{"width"in r&&l(0,n=r.width),"$$scope"in r&&l(2,i=r.$$scope)},[n,e,i]}class G extends P{constructor(t){super(),U(this,t,_e,de,E,{width:0})}}G.__docgen={version:3,name:"TextBlock.svelte",data:[{keywords:[],visibility:"public",description:"Width of the component within the text well.",name:"width",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:"",name:"default"}],refs:[]};const pe=s=>({}),J=s=>({}),me=s=>({}),O=s=>({}),be=s=>({}),Q=s=>({});function ke(s){let t,l;return t=new N({props:{containerIsFluid:s[0]==="fluid",$$slots:{default:[ye]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&1&&(n.containerIsFluid=e[0]==="fluid"),i&8640&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(f(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function ge(s){let t,l;return t=new N({props:{containerIsFluid:s[0]==="fluid",$$slots:{default:[$e]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&1&&(n.containerIsFluid=e[0]==="fluid"),i&8256&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(f(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function X(s){let t,l=F(s[8])+"",e;return{c(){t=new x(!1),e=D(),t.a=e},m(i,n){t.m(l,i,n),h(i,e,n)},p(i,n){n&256&&l!==(l=F(i[8])+"")&&t.p(l)},d(i){i&&y(e),i&&t.d()}}}function he(s){let t,l,e,i,n=s[8]&&X(s);return{c(){t=T("h3"),l=le(s[7]),e=H(),n&&n.c(),i=D()},m(r,_){h(r,t,_),z(t,l),h(r,e,_),n&&n.m(r,_),h(r,i,_)},p(r,_){_&128&&ne(l,r[7]),r[8]?n?n.p(r,_):(n=X(r),n.c(),n.m(i.parentNode,i)):n&&(n.d(1),n=null)},d(r){r&&y(t),r&&y(e),n&&n.d(r),r&&y(i)}}}function ye(s){let t,l;return t=new G({props:{width:s[6],$$slots:{default:[he]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&64&&(n.width=e[6]),i&8576&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(f(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function we(s){let t;const l=s[12].title,e=A(l,s,s[13],Q);return{c(){e&&e.c()},m(i,n){e&&e.m(i,n),t=!0},p(i,n){e&&e.p&&(!t||n&8192)&&I(e,l,i,i[13],t?W(l,i[13],n,be):V(i[13]),Q)},i(i){t||(f(e,i),t=!0)},o(i){u(e,i),t=!1},d(i){e&&e.d(i)}}}function $e(s){let t,l;return t=new G({props:{width:s[6],$$slots:{default:[we]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&64&&(n.width=e[6]),i&8192&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(f(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function ve(s){let t;const l=s[12].default,e=A(l,s,s[13],null);return{c(){e&&e.c()},m(i,n){e&&e.m(i,n),t=!0},p(i,n){e&&e.p&&(!t||n&8192)&&I(e,l,i,i[13],t?W(l,i[13],n,null):V(i[13]),null)},i(i){t||(f(e,i),t=!0)},o(i){u(e,i),t=!1},d(i){e&&e.d(i)}}}function Z(s){let t,l,e,i;const n=[Ie,Ae],r=[];function _(o,a){return o[11].aria?0:1}return l=_(s),e=r[l]=n[l](s),{c(){t=T("div"),e.c(),K(t,"class","visually-hidden svelte-ayeg3m")},m(o,a){h(o,t,a),r[l].m(t,null),i=!0},p(o,a){let m=l;l=_(o),l===m?r[l].p(o,a):(S(),u(r[m],1,1,()=>{r[m]=null}),L(),e=r[l],e?e.p(o,a):(e=r[l]=n[l](o),e.c()),f(e,1),e.m(t,null))},i(o){i||(f(e),i=!0)},o(o){u(e),i=!1},d(o){o&&y(t),r[l].d()}}}function Ae(s){let t,l=F(s[10])+"",e;return{c(){t=new x(!1),e=D(),t.a=e},m(i,n){t.m(l,i,n),h(i,e,n)},p(i,n){n&1024&&l!==(l=F(i[10])+"")&&t.p(l)},i:Y,o:Y,d(i){i&&y(e),i&&t.d()}}}function Ie(s){let t;const l=s[12].aria,e=A(l,s,s[13],O);return{c(){e&&e.c()},m(i,n){e&&e.m(i,n),t=!0},p(i,n){e&&e.p&&(!t||n&8192)&&I(e,l,i,i[13],t?W(l,i[13],n,me):V(i[13]),O)},i(i){t||(f(e,i),t=!0)},o(i){u(e,i),t=!1},d(i){e&&e.d(i)}}}function Ve(s){let t,l;return t=new N({props:{containerIsFluid:s[0]==="fluid",$$slots:{default:[Le]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&1&&(n.containerIsFluid=e[0]==="fluid"),i&8288&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(f(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function We(s){let t,l;return t=new N({props:{containerIsFluid:s[0]==="fluid",$$slots:{default:[Re]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&1&&(n.containerIsFluid=e[0]==="fluid"),i&8256&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(f(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function Se(s){let t,l=F(s[5])+"";return{c(){t=T("aside")},m(e,i){h(e,t,i),t.innerHTML=l},p(e,i){i&32&&l!==(l=F(e[5])+"")&&(t.innerHTML=l)},d(e){e&&y(t)}}}function Le(s){let t,l;return t=new G({props:{width:s[6],$$slots:{default:[Se]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&64&&(n.width=e[6]),i&8224&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(f(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function Fe(s){let t;const l=s[12].notes,e=A(l,s,s[13],J);return{c(){e&&e.c()},m(i,n){e&&e.m(i,n),t=!0},p(i,n){e&&e.p&&(!t||n&8192)&&I(e,l,i,i[13],t?W(l,i[13],n,pe):V(i[13]),J)},i(i){t||(f(e,i),t=!0)},o(i){u(e,i),t=!1},d(i){e&&e.d(i)}}}function Re(s){let t,l;return t=new G({props:{width:s[6],$$slots:{default:[Fe]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&64&&(n.width=e[6]),i&8192&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(f(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function Be(s){let t,l,e,i,n,r,_,o,a,m;const R=[ge,ke],k=[];function B(c,b){return c[11].title?0:c[7]?1:-1}~(l=B(s))&&(e=k[l]=R[l](s)),n=new te({props:{hidden:!!s[11].aria||!!s[10],$$slots:{default:[ve]},$$scope:{ctx:s}}});let p=(s[11].aria||s[10])&&Z(s);const C=[We,Ve],g=[];function d(c,b){return c[11].notes?0:c[5]?1:-1}return~(o=d(s))&&(a=g[o]=C[o](s)),{c(){t=T("div"),e&&e.c(),i=H(),w(n.$$.fragment),r=H(),p&&p.c(),_=H(),a&&a.c(),K(t,"class","svelte-ayeg3m")},m(c,b){h(c,t,b),~l&&k[l].m(t,null),z(t,i),$(n,t,null),z(t,r),p&&p.m(t,null),z(t,_),~o&&g[o].m(t,null),m=!0},p(c,b){let j=l;l=B(c),l===j?~l&&k[l].p(c,b):(e&&(S(),u(k[j],1,1,()=>{k[j]=null}),L()),~l?(e=k[l],e?e.p(c,b):(e=k[l]=R[l](c),e.c()),f(e,1),e.m(t,i)):e=null);const M={};b&3072&&(M.hidden=!!c[11].aria||!!c[10]),b&8192&&(M.$$scope={dirty:b,ctx:c}),n.$set(M),c[11].aria||c[10]?p?(p.p(c,b),b&3072&&f(p,1)):(p=Z(c),p.c(),f(p,1),p.m(t,_)):p&&(S(),u(p,1,1,()=>{p=null}),L());let q=o;o=d(c),o===q?~o&&g[o].p(c,b):(a&&(S(),u(g[q],1,1,()=>{g[q]=null}),L()),~o?(a=g[o],a?a.p(c,b):(a=g[o]=C[o](c),a.c()),f(a,1),a.m(t,null)):a=null)},i(c){m||(f(e),f(n.$$.fragment,c),f(p),f(a),m=!0)},o(c){u(e),u(n.$$.fragment,c),u(p),u(a),m=!1},d(c){c&&y(t),~l&&k[l].d(),v(n),p&&p.d(),~o&&g[o].d()}}}function Ce(s){let t,l;return t=new ee({props:{id:s[1],snap:s[3],role:s[4],width:s[0],ariaLabel:s[9],cls:"graphic "+s[2],$$slots:{default:[Be]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,[i]){const n={};i&2&&(n.id=e[1]),i&8&&(n.snap=e[3]),i&16&&(n.role=e[4]),i&1&&(n.width=e[0]),i&512&&(n.ariaLabel=e[9]),i&4&&(n.cls="graphic "+e[2]),i&11745&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(f(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function De(s,t,l){let{$$slots:e={},$$scope:i}=t;const n=ie(e);let{width:r="normal"}=t,{id:_=""}=t,{cls:o=""}=t,{snap:a=!1}=t,{role:m=null}=t,{notes:R=null}=t,{textWidth:k=null}=t,{title:B=null}=t,{description:p=null}=t,{ariaLabel:C="chart"}=t,{ariaDescription:g=null}=t;return s.$$set=d=>{"width"in d&&l(0,r=d.width),"id"in d&&l(1,_=d.id),"cls"in d&&l(2,o=d.cls),"snap"in d&&l(3,a=d.snap),"role"in d&&l(4,m=d.role),"notes"in d&&l(5,R=d.notes),"textWidth"in d&&l(6,k=d.textWidth),"title"in d&&l(7,B=d.title),"description"in d&&l(8,p=d.description),"ariaLabel"in d&&l(9,C=d.ariaLabel),"ariaDescription"in d&&l(10,g=d.ariaDescription),"$$scope"in d&&l(13,i=d.$$scope)},[r,_,o,a,m,R,k,B,p,C,g,n,e,i]}class Te extends P{constructor(t){super(),U(this,t,De,Ce,E,{width:0,id:1,cls:2,snap:3,role:4,notes:5,textWidth:6,title:7,description:8,ariaLabel:9,ariaDescription:10})}}Te.__docgen={version:3,name:"GraphicBlock.svelte",data:[{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Width of the component within the text well.",name:"width",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"normal"},{keywords:[{name:"type",description:"{string}"}],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:""},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Add extra classes to the block tag to target it with custom CSS.",name:"cls",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},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:[{name:"type",description:"{string}"}],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:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Notes to the graphic, passed in as a markdown string.",name:"notes",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:`Set a different width for the text within the text well, for example,
|
|
"normal" to keep the title, description and notes inline with the rest
|
|
of the text well. Can't ever be wider than \`width\`.`,name:"textWidth",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Title of the graphic",name:"title",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Description of the graphic, passed in as a markdown string.",name:"description",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],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:"string",type:"string"},defaultValue:"chart"},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"ARIA description, passed in as a markdown string.",name:"ariaDescription",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"Custom title content",name:"title"},{keywords:[],visibility:"public",description:"Graphic content",name:"default"},{keywords:[],visibility:"public",description:"Custom ARIA markup",name:"aria"},{keywords:[],visibility:"public",description:"Custom notes content",name:"notes"}],refs:[]};export{Te as G};
|
|
//# sourceMappingURL=GraphicBlock-f4f94c1a.js.map
|