{"version":3,"sources":["webpack://uconn-today-plugin/./src/graphql/queries/get-post.js","webpack://uconn-today-plugin/./src/graphql/queries/get-posts.js","webpack://uconn-today-plugin/./src/js/utils/config.js","webpack://uconn-today-plugin/./src/js/Components/ArticleListItem.jsx","webpack://uconn-today-plugin/./src/js/Components/SocialShareItem.jsx","webpack://uconn-today-plugin/./src/js/Components/SocialCopyLink.jsx","webpack://uconn-today-plugin/./src/js/Components/SocialShareContainer.jsx","webpack://uconn-today-plugin/./src/js/Components/ArticleList.jsx","webpack://uconn-today-plugin/./src/js/Components/ArticleTitle.jsx","webpack://uconn-today-plugin/./src/img/oak-leaf-blue.png","webpack://uconn-today-plugin/./src/js/Components/FeaturedImage.jsx","webpack://uconn-today-plugin/./src/js/utils/nearbyPost.js","webpack://uconn-today-plugin/./src/js/utils/addContextToPost.js"],"names":["getPost","gql","getPostsQuery","socialShareConfig","copy","link","title","email","twitter","linkedIn","facebook","reddit","createSocialConfig","currentConfig","post","encodedTitle","encodeURIComponent","Object","assign","postData","clickHandler","client","useApolloClient","track","useAnalytics","doClickEvent","args","cursor","id","postID","readQuery","query","variables","npost","addContextToPost","trackEvent","eventName","category","label","className","role","tabIndex","onClick","onKeyDown","evt","code","preventDefault","FeaturedImage","image","featuredImage","ArticleTitle","children","config","popup","socialClick","href","target","open","useState","isCopied","setIsCopied","navigator","clipboard","writeText","then","err","console","log","library","faEnvelope","faLink","faTwitter","faLinkedinIn","faFacebookSquare","faRedditSquare","articleTitle","shareClickHandler","icon","ContentWrapper","React","props","numPosts","columns","useQuery","first","parseInt","after","categorySlug","loading","error","data","currentPost","setCurrentPost","openArticle","setOpenArticle","socialShare","setSocialShare","page","listItemClickHandler","newSocialConfig","trackPage","uri","useEffect","document","querySelector","classList","toggle","ListLoader","number","aria-live","style","position","left","posts","edges","map","node","key","keys","length","Suspense","fallback","nearbyPostClickHandler","closeArticleClickHandler","socialShareContainer","useCaption","src","sourceUrl","alt","altText","sizes","srcSet","Fallback","dangerouslySetInnerHTML","__html","caption","nearbyPost","direction","found","findIndex","nearby","nearbyIdFull","undefined","__ref","nearbyId","split","cache","nearby_prev","nearby_next","create","previousPost","nextPost"],"mappings":"mKAOO,I,IAAMA,GAAUC,E,QAAAA,IAAH,I,EAAA,wgB,kBAAA,E,mMCAPC,GAAgBD,E,QAAAA,IAAH,I,EAAA,k4B,kBAAA,E,kwBCDnB,IAAME,EAAoB,CAC/BC,KAAM,CACJC,KAAM,GACNC,MAAO,qBAETC,MAAO,CACLF,KAAM,GACNC,MAAO,iBAETE,QAAS,CACPH,KAAM,GACNC,MAAO,oBAETG,SAAU,CACRJ,KAAM,GACNC,MAAO,qBAETI,SAAU,CACRL,KAAM,GACNC,MAAO,qBAETK,OAAQ,CACNN,KAAM,GACNC,MAAO,oBAWEM,EAAqB,SAACC,EAAeC,GAEhD,IAAMC,EAAeC,mBAAmBF,EAAKR,OAE7C,OAAOW,OAAOC,OAAO,GAAIL,EAAe,CACtCT,KAAM,EAAF,KACCS,EAAcT,MADf,IAEFC,KAAMS,EAAKT,OAEbE,MAAO,EAAF,KACAM,EAAcN,OADd,IAEHF,KAAM,mBAAF,OAAqBS,EAAKR,MAA1B,sDAA6EQ,EAAKT,QAExFG,QAAS,EAAF,KACFK,EAAcL,SADZ,IAELH,KAAM,yCAAF,OAA2CU,EAA3C,YAA2DD,EAAKT,QAEtEI,SAAU,EAAF,KACHI,EAAcL,SADX,IAENH,KAAM,uDAAF,OAAyDS,EAAKT,QAEpEK,SAAU,EAAF,KACHG,EAAcH,UADX,IAENL,KAAM,oFAAF,OAAsFS,EAAKT,KAA3F,yBAAgHS,EAAKT,QAE3HM,OAAQ,EAAF,KACDE,EAAcF,QADb,IAEJN,KAAM,qCAAF,OAAuCS,EAAKT,KAA5C,kBAA0DU,Q,kDCOpE,EAvDwB,SAAC,GAA+B,IAA7BI,EAA6B,EAA7BA,SAAUC,EAAmB,EAAnBA,aAE7BC,GAASC,uBACPC,GAAUC,UAAVD,MASFE,EAAe,WACnB,I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C,yBAA2B,SAAW/H,EAASkB,UAAU6E,MACjEiC,EAAcX,EAAWvB,EAAOvF,EAAM,YACtC0H,EAAcZ,EAAWvB,EAAOvF,EAAM,QAEtCO,EAAQhB,OAAOoI,OAAOvI,GAI5B,OAHAmB,EAAMqH,aAAeH,EACrBlH,EAAMsH,SAAWH,EAEVnH","file":"uct-article-list.js","sourcesContent":["import { gql } from '@apollo/client'\n\n/**\n * \n * GraphQL query to get a single post based on its ID. NB - the ID is not the same as the database ID\n * \n */\nexport const getPost = gql`\n query POST_QUERY ($id: String! $cursor: String) {\n post (id: $id idType: ID) {\n id\n databaseId\n title\n uri\n link\n content\n excerpt\n slug\n date\n author {\n node {\n uri\n name\n }\n }\n featuredImage {\n node {\n altText\n sourceUrl\n srcSet\n sizes\n caption\n }\n }\n postFormatVideoEmbedLink {\n videoUrl\n }\n }\n }\n`","import { gql } from '@apollo/client'\n\n/**\n * \n * Get a selection of posts by category slug. This query uses relay/cursor based pagination. See - https://relay.dev/graphql/connections.htm\n * \n */\nexport const getPostsQuery = gql`\n query GET_POSTS (\n $first: Int\n $after: String\n $categorySlug: String\n ) {\n posts (\n where: {\n status: PUBLISH\n categoryName: $categorySlug\n }\n first: $first\n after: $after\n ) {\n pageInfo {\n endCursor\n }\n edges {\n cursor\n node {\n databaseId\n id\n title\n slug\n uri\n link\n date\n content\n excerpt\n author {\n node {\n uri\n name\n }\n }\n featuredImage {\n node {\n altText\n sourceUrl\n srcSet\n sizes\n caption\n }\n }\n postFormatVideoEmbedLink {\n videoUrl\n }\n }\n }\n }\n }\n`","\n/**\n * \n * A defaults for social share config links/button\n * \n */\nexport const socialShareConfig = {\n copy: {\n link: '',\n title: 'Copy article link'\n },\n email: {\n link: '',\n title: 'Email article'\n },\n twitter: {\n link: '',\n title: 'Share on Twitter'\n },\n linkedIn: {\n link: '',\n title: 'Share on LinkedIn'\n },\n facebook: {\n link: '',\n title: 'Share on Facebook'\n },\n reddit: {\n link: '',\n title: 'Share on Reddit'\n }\n}\n\n/**\n * \n * @param object currentConfig the config object before the post data is known\n * @param object post the post data \n * @returns object a merged object with the current config and link based on the post data\n * \n */\nexport const createSocialConfig = (currentConfig, post) => {\n\n const encodedTitle = encodeURIComponent(post.title)\n\n return Object.assign({}, currentConfig, {\n copy: {\n ...currentConfig.copy,\n link: post.link\n },\n email: {\n ...currentConfig.email,\n link: `mailto:?subject=${post.title}&body=Check out this UConn Today article - ${post.link}`\n },\n twitter: {\n ...currentConfig.twitter,\n link: `https://twitter.com/intent/tweet?text=${encodedTitle}+${post.link}`\n },\n linkedIn: {\n ...currentConfig.twitter,\n link: `https://www.linkedin.com/sharing/share-offsite/?url=${post.link}`\n },\n facebook: {\n ...currentConfig.facebook,\n link: `https://www.facebook.com/dialog/share?app_id=1689478697951363&display=popup&href=${post.link}&redirect_uri=${post.link}`\n },\n reddit: {\n ...currentConfig.reddit,\n link: `https://www.reddit.com/submit?url=${post.link}&title=${encodedTitle}`\n }\n })\n}","import React from 'react'\nimport { useApolloClient } from '@apollo/client'\nimport { useAnalytics } from 'use-analytics'\nimport { getPost } from '../../graphql/queries/get-post'\nimport { addContextToPost } from '../utils/addContextToPost';\n\nimport ArticleTitle from './ArticleTitle'\nimport FeaturedImage from './FeaturedImage'\n\nimport { trackEvent } from '../utils/analytics'\n\n/**\n * A single post item. Data is managed via callback _after_ a user clicks on one of the articles on the list.\n *\n * @param object props \n * - `postData` is an object with the selected post's cursor and ID so that apollo can find it in the cache.\n * - `clickHandler` is a callback function passed to the item so that state can be managed by the article list\n * \n */\nconst ArticleListItem = ({ postData, clickHandler }) => {\n \n const client = useApolloClient()\n const { track } = useAnalytics()\n\n /**\n *\n * When the post post preview is clicked (mouse or keyboard):\n * - find the post in the apollo cache with the variables passed in as props\n * - run the click handler passed as a prop with the post returned from the query.\n *\n */\n const doClickEvent = () => {\n const args = {\n cursor: postData.cursor,\n id: postData.postID\n };\n\n const { post } = client.readQuery({\n query: getPost,\n variables: args\n });\n\n const npost = addContextToPost(post, postData);\n\n clickHandler(npost)\n\n trackEvent(track, {\n eventName: 'article-opened',\n category: 'Article Opened',\n label: post.title\n })\n }\n\n return (\n
{postData.title}
\nError {error}
\n\n return (\n <>\n\n { `${numPosts} UConn Today articles loaded` }\n
\n