@apollosproject/canvas-embeds 2.1.2090 → 2.1.2091

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/widget/index.js CHANGED
@@ -447,7 +447,7 @@ React keys must be passed directly to JSX without using spread:
447
447
  ...AudioMediaFragment
448
448
  }
449
449
  }
450
- `);const D21=a=>!!a?.sources?.[0]?.uri,j21=({feature:a})=>{const[t,n]=e.useState(null),r=(a.images??[]).filter(D21);if(r.length===0)return null;const l=t!==null,i=t===null?0:Math.min(t,r.length-1),o=r[i];return C.jsxs(C.Fragment,{children:[r.length===1?C.jsxs("button",{type:"button",className:"block w-full",onClick:()=>n(0),children:[C.jsx("span",{className:"sr-only",children:"View image"}),C.jsx(C5,{image:r[0],className:"w-full rounded-xl object-cover"})]}):C.jsx("div",{className:"-mx-1 flex snap-x snap-mandatory gap-4 overflow-x-auto px-1 pb-2",children:r.map((s,c)=>C.jsxs("button",{type:"button",className:"w-4/5 shrink-0 snap-center",onClick:()=>n(c),children:[C.jsx("span",{className:"sr-only",children:`View image ${c+1} of ${r.length}`}),C.jsx(C5,{image:s,className:"aspect-[4/3] w-full rounded-xl object-cover"})]},s.sources?.[0]?.uri??c))}),C.jsxs(mG0,{open:l,onClose:()=>n(null),size:"4xl",children:[C.jsx(uG0,{className:"sr-only",children:r.length===1?"View image":`Image ${i+1} of ${r.length}`}),C.jsx(C5,{image:o,className:"max-h-[75vh] w-full rounded-lg object-contain"}),r.length>1&&C.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[C.jsxs("button",{type:"button",disabled:i===0,onClick:()=>n(i-1),className:"flex size-10 items-center justify-center rounded-full bg-black/5 text-fg-primary disabled:opacity-40 dark:bg-white/10 dark:text-fg-primary-dark",children:[C.jsx("span",{className:"sr-only",children:"Previous image"}),C.jsx(WA,{size:20})]}),C.jsxs("span",{className:"text-sm tabular-nums text-fg-secondary dark:text-fg-secondary-dark",children:[i+1," / ",r.length]}),C.jsxs("button",{type:"button",disabled:i===r.length-1,onClick:()=>n(i+1),className:"flex size-10 items-center justify-center rounded-full bg-black/5 text-fg-primary disabled:opacity-40 dark:bg-white/10 dark:text-fg-primary-dark",children:[C.jsx("span",{className:"sr-only",children:"Next image"}),C.jsx(Cn,{size:20})]})]})]})]})};xe(`
450
+ `);const D21=a=>!!a?.sources?.[0]?.uri,j21=({feature:a})=>{const[t,n]=e.useState(null),r=(a.images??[]).filter(D21);if(r.length===0)return null;const l=t!==null,i=t===null?0:Math.min(t,r.length-1),o=r[i];return C.jsxs(C.Fragment,{children:[r.length===1?C.jsxs("button",{type:"button",className:"block w-full",onClick:()=>n(0),children:[C.jsx("span",{className:"sr-only",children:"View image"}),C.jsx(C5,{image:r[0],className:"w-full rounded-xl object-cover"})]}):C.jsx("div",{"data-testid":"image-feature-carousel",className:"-mx-1 flex snap-x snap-mandatory items-start gap-4 overflow-x-auto px-1 pb-2",children:r.map((s,c)=>C.jsxs("button",{type:"button",className:"w-4/5 shrink-0 snap-center",onClick:()=>n(c),children:[C.jsx("span",{className:"sr-only",children:`View image ${c+1} of ${r.length}`}),C.jsx(C5,{image:s,className:"w-full rounded-xl"})]},s.sources?.[0]?.uri??c))}),C.jsxs(mG0,{open:l,onClose:()=>n(null),size:"4xl",children:[C.jsx(uG0,{className:"sr-only",children:r.length===1?"View image":`Image ${i+1} of ${r.length}`}),C.jsx(C5,{image:o,className:"max-h-[75vh] w-full rounded-lg object-contain"}),r.length>1&&C.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[C.jsxs("button",{type:"button",disabled:i===0,onClick:()=>n(i-1),className:"flex size-10 items-center justify-center rounded-full bg-black/5 text-fg-primary disabled:opacity-40 dark:bg-white/10 dark:text-fg-primary-dark",children:[C.jsx("span",{className:"sr-only",children:"Previous image"}),C.jsx(WA,{size:20})]}),C.jsxs("span",{className:"text-sm tabular-nums text-fg-secondary dark:text-fg-secondary-dark",children:[i+1," / ",r.length]}),C.jsxs("button",{type:"button",disabled:i===r.length-1,onClick:()=>n(i+1),className:"flex size-10 items-center justify-center rounded-full bg-black/5 text-fg-primary disabled:opacity-40 dark:bg-white/10 dark:text-fg-primary-dark",children:[C.jsx("span",{className:"sr-only",children:"Next image"}),C.jsx(Cn,{size:20})]})]})]})]})};xe(`
451
451
  fragment ImageFeatureFragment on ImageFeature {
452
452
  id
453
453
  images {