@apollosproject/canvas-embeds 2.1.2249 → 2.1.2250
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/package.json +1 -1
- package/widget/index.js +1 -1
package/package.json
CHANGED
package/widget/index.js
CHANGED
|
@@ -746,7 +746,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
746
746
|
title
|
|
747
747
|
url
|
|
748
748
|
}
|
|
749
|
-
`),e2n();var wPr=`https://cdn.iframe.ly/api/iframely`,TPr=`64420707babbbe919d6fabff62b8371a`,EPr=async e=>{try{return await(await fetch(`${wPr}?url=${encodeURIComponent(e)}&key=${TPr}&theme=light`)).json()}catch(e){return console.error(`Failed to fetch embed data from Iframely:`,e),null}},DPr=e=>{let t=e.links?.thumbnail?.[0],n=t&&t.media.width>t.media.height&&Math.abs(t.media.width-t.media.height)/t.media.width<.5;return{site:e.meta
|
|
749
|
+
`),e2n();var wPr=`https://cdn.iframe.ly/api/iframely`,TPr=`64420707babbbe919d6fabff62b8371a`,EPr=async e=>{try{return await(await fetch(`${wPr}?url=${encodeURIComponent(e)}&key=${TPr}&theme=light`)).json()}catch(e){return console.error(`Failed to fetch embed data from Iframely:`,e),null}},DPr=e=>{let t=e.links?.thumbnail?.[0],n=t&&t.media.width>t.media.height&&Math.abs(t.media.width-t.media.height)/t.media.width<.5;return{site:e.meta?.site||void 0,title:e.meta?.title||void 0,description:e.meta?.description||void 0,canonical:e.meta?.canonical||void 0,thumbnail:n&&(t?.href||e.links?.logo?.[0]?.href)||void 0,favicon:n?e.links?.icon?.[0]?.href||e.links?.image?.[0]?.href||t?.href||void 0:e.links?.icon?.[0]?.href||e.links?.image?.[0]?.href||void 0}},OPr=({src:e,title:t})=>(0,q.jsx)(iSe,{src:e,alt:t||`Link Preview`,className:`my-0`}),kPr=({src:e})=>(0,q.jsx)(`img`,{className:`h-8 w-8 rounded-md m-0`,src:e,alt:`Link Icon`,loading:`lazy`}),APr=({site:e})=>e?(0,q.jsx)(OC,{as:`p`,className:`text-sm text-gray-500 m-0`,children:e}):null,jPr=({site:e,title:t,canonical:n,description:r,thumbnail:i,favicon:a})=>(0,q.jsxs)(EC,{children:[i?(0,q.jsx)(OPr,{src:i,title:t}):null,(0,q.jsxs)(DC,{children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-start flex-row gap-2`,children:[a?(0,q.jsx)(kPr,{src:a}):null,(0,q.jsx)(APr,{site:e})]}),t?(0,q.jsx)(OC,{as:`h3`,className:`mt-4 mb-0`,children:t}):null,n?(0,q.jsx)(OC,{as:`p`,className:`line-clamp-1 text-sm text-gray-400 my-0`,children:n}):null,r?(0,q.jsx)(OC,{as:`p`,className:`mt-4 mb-0 line-clamp-4`,children:r}):null]})]}),MPr=({embedHtml:e})=>(0,q.jsx)(EC,{className:`relative cursor-pointer overflow-hidden rounded-xl`,children:(0,q.jsx)(`div`,{dangerouslySetInnerHTML:{__html:e}})}),NPr=({url:e=``})=>{let[t,n]=(0,I.useState)(null),[r,i]=(0,I.useState)(!0),[a,o]=(0,I.useState)(null);return(0,I.useEffect)(()=>{e&&(async()=>{i(!0);let t=await EPr(e);if(!t){n(null),o(null),i(!1);return}n(DPr(t)),Array.isArray(t.rel)&&[`player`,`app`,`reader`,`survey`].some(e=>t.rel?.includes(e))&&o(t.html||null),i(!1)})()},[e]),(0,q.jsx)(`div`,{className:`w-full min-w-96`,children:r?(0,q.jsx)(PPr,{}):a?(0,q.jsx)(MPr,{embedHtml:a}):(0,q.jsx)(jPr,{...t})})},PPr=()=>(0,q.jsx)(`div`,{className:`text-primary-700 transition-all duration-500 flex flex-row justify-center items-center h-28`,children:(0,q.jsx)($0n,{className:`h-5 w-5 animate-spin`})}),FPr=({feature:e})=>{let{church:t,accessToken:n}=eAe();if(!e.url)return null;let r=tAe({originalUrl:e.url,church:t,accessToken:n});return(0,q.jsx)(`div`,{className:`mb-10`,children:(0,q.jsx)(NPr,{url:r})})};nw(`
|
|
750
750
|
fragment WebviewFeatureFragment on WebviewFeature {
|
|
751
751
|
id
|
|
752
752
|
title
|