this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Include Prettier & format everything properly

My bad for not including prettier

+145 -138
+6 -7
package-lock.json
··· 58 58 "postcss": "~8.4.49", 59 59 "postcss-dark-theme-class": "~1.3.0", 60 60 "postcss-preset-env": "~10.1.1", 61 + "prettier": "3.4.1", 61 62 "sonda": "~0.6.1", 62 63 "twitter-text": "~3.1.0", 63 64 "vite": "~5.4.11", ··· 8406 8407 } 8407 8408 }, 8408 8409 "node_modules/prettier": { 8409 - "version": "2.8.0", 8410 - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", 8411 - "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", 8410 + "version": "3.4.1", 8411 + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.1.tgz", 8412 + "integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==", 8412 8413 "dev": true, 8413 - "license": "MIT", 8414 - "peer": true, 8415 8414 "bin": { 8416 - "prettier": "bin-prettier.js" 8415 + "prettier": "bin/prettier.cjs" 8417 8416 }, 8418 8417 "engines": { 8419 - "node": ">=10.13.0" 8418 + "node": ">=14" 8420 8419 }, 8421 8420 "funding": { 8422 8421 "url": "https://github.com/prettier/prettier?sponsor=1"
+1
package.json
··· 66 66 "postcss": "~8.4.49", 67 67 "postcss-dark-theme-class": "~1.3.0", 68 68 "postcss-preset-env": "~10.1.1", 69 + "prettier": "3.4.1", 69 70 "sonda": "~0.6.1", 70 71 "twitter-text": "~3.1.0", 71 72 "vite": "~5.4.11",
+35 -32
src/app.jsx
··· 27 27 import Shortcuts from './components/shortcuts'; 28 28 import NotFound from './pages/404'; 29 29 import AccountStatuses from './pages/account-statuses'; 30 + import AnnualReport from './pages/annual-report'; 30 31 import Bookmarks from './pages/bookmarks'; 31 32 import Catchup from './pages/catchup'; 32 33 import Favourites from './pages/favourites'; ··· 46 47 import StatusRoute from './pages/status-route'; 47 48 import Trending from './pages/trending'; 48 49 import Welcome from './pages/welcome'; 49 - import AnnualReport from './pages/annual-report'; 50 50 import { 51 51 api, 52 52 hasInstance, ··· 99 99 // Experimental "garbage collection" for states 100 100 // Every 15 minutes 101 101 // Only posts for now 102 - setInterval(() => { 103 - if (!window.__IDLE__) return; 104 - const { statuses, unfurledLinks, notifications } = states; 105 - let keysCount = 0; 106 - const { instance } = api(); 107 - for (const key in statuses) { 108 - if (!window.__IDLE__) break; 109 - try { 110 - const $post = document.querySelector( 111 - `[data-state-post-id~="${key}"], [data-state-post-ids~="${key}"]`, 112 - ); 113 - const postInNotifications = notifications.some( 114 - (n) => key === statusKey(n.status?.id, instance), 115 - ); 116 - if (!$post && !postInNotifications) { 117 - delete states.statuses[key]; 118 - delete states.statusQuotes[key]; 119 - for (const link in unfurledLinks) { 120 - const unfurled = unfurledLinks[link]; 121 - const sKey = statusKey(unfurled.id, unfurled.instance); 122 - if (sKey === key) { 123 - delete states.unfurledLinks[link]; 124 - break; 102 + setInterval( 103 + () => { 104 + if (!window.__IDLE__) return; 105 + const { statuses, unfurledLinks, notifications } = states; 106 + let keysCount = 0; 107 + const { instance } = api(); 108 + for (const key in statuses) { 109 + if (!window.__IDLE__) break; 110 + try { 111 + const $post = document.querySelector( 112 + `[data-state-post-id~="${key}"], [data-state-post-ids~="${key}"]`, 113 + ); 114 + const postInNotifications = notifications.some( 115 + (n) => key === statusKey(n.status?.id, instance), 116 + ); 117 + if (!$post && !postInNotifications) { 118 + delete states.statuses[key]; 119 + delete states.statusQuotes[key]; 120 + for (const link in unfurledLinks) { 121 + const unfurled = unfurledLinks[link]; 122 + const sKey = statusKey(unfurled.id, unfurled.instance); 123 + if (sKey === key) { 124 + delete states.unfurledLinks[link]; 125 + break; 126 + } 125 127 } 128 + keysCount++; 126 129 } 127 - keysCount++; 128 - } 129 - } catch (e) {} 130 - } 131 - if (keysCount) { 132 - console.info(`GC: Removed ${keysCount} keys`); 133 - } 134 - }, 15 * 60 * 1000); 130 + } catch (e) {} 131 + } 132 + if (keysCount) { 133 + console.info(`GC: Removed ${keysCount} keys`); 134 + } 135 + }, 136 + 15 * 60 * 1000, 137 + ); 135 138 136 139 // Preload icons 137 140 // There's probably a better way to do this
+23 -23
src/components/compose.jsx
··· 1255 1255 replyToStatus 1256 1256 ? t`Post your reply` 1257 1257 : editStatus 1258 - ? t`Edit your post` 1259 - : t`What are you doing?` 1258 + ? t`Edit your post` 1259 + : t`What are you doing?` 1260 1260 } 1261 1261 required={mediaAttachments?.length === 0} 1262 1262 disabled={uiState === 'loading'} ··· 1554 1554 {replyToStatus 1555 1555 ? t`Reply` 1556 1556 : editStatus 1557 - ? t`Update` 1558 - : t({ 1559 - message: 'Post', 1560 - context: 'Submit button in composer', 1561 - })} 1557 + ? t`Update` 1558 + : t({ 1559 + message: 'Post', 1560 + context: 'Submit button in composer', 1561 + })} 1562 1562 </button> 1563 1563 </div> 1564 1564 </form> ··· 2214 2214 leftChars <= -10 2215 2215 ? 'explode' 2216 2216 : leftChars <= 0 2217 - ? 'danger' 2218 - : leftChars <= 20 2219 - ? 'warning' 2220 - : '' 2217 + ? 'danger' 2218 + : leftChars <= 20 2219 + ? 'warning' 2220 + : '' 2221 2221 }`} 2222 2222 value={charCount} 2223 2223 max={maxCharacters} ··· 2846 2846 return bothStartWith 2847 2847 ? a.length - b.length 2848 2848 : aStartsWith 2849 - ? -1 2850 - : bStartsWith 2851 - ? 1 2852 - : bothContain 2853 - ? a.length - b.length 2854 - : aContains 2855 - ? -1 2856 - : bContains 2857 - ? 1 2858 - : 0; 2849 + ? -1 2850 + : bStartsWith 2851 + ? 1 2852 + : bothContain 2853 + ? a.length - b.length 2854 + : aContains 2855 + ? -1 2856 + : bContains 2857 + ? 1 2858 + : 0; 2859 2859 }) 2860 2860 .slice(0, 5); 2861 2861 } ··· 3516 3516 const theImage = fixed_height_small?.url 3517 3517 ? fixed_height_small 3518 3518 : fixed_height_downsampled?.url 3519 - ? fixed_height_downsampled 3520 - : fixed_height; 3519 + ? fixed_height_downsampled 3520 + : fixed_height; 3521 3521 let { url, webp, width, height } = theImage; 3522 3522 if (+height > 100) { 3523 3523 width = (width / height) * 100;
+2 -2
src/components/menu2.jsx
··· 17 17 ? align === 'end' 18 18 ? 'start' 19 19 : align === 'start' 20 - ? 'end' 21 - : align 20 + ? 'end' 21 + : align 22 22 : align; 23 23 24 24 return (
+8 -8
src/components/notification.jsx
··· 261 261 ), 262 262 emoji_reaction: emojiText, 263 263 'pleroma:emoji_reaction': emojiText, 264 - annual_report: ({ year }) => ( 265 - <Trans>Your {year} #Wrapstodon is here!</Trans> 266 - ), 264 + annual_report: ({ year }) => <Trans>Your {year} #Wrapstodon is here!</Trans>, 267 265 }; 268 266 269 267 // account_suspension, domain_block, user_domain_block ··· 537 535 )} 538 536 {type === 'annual_report' && ( 539 537 <div> 540 - <Link to={`/annual_report/${annualReport?.year}`}><Trans>View #Wrapstodon</Trans></Link> 538 + <Link to={`/annual_report/${annualReport?.year}`}> 539 + <Trans>View #Wrapstodon</Trans> 540 + </Link> 541 541 </div> 542 542 )} 543 543 </> ··· 562 562 _accounts.length <= 10 563 563 ? 'xxl' 564 564 : _accounts.length < 20 565 - ? 'xl' 566 - : 'l' 565 + ? 'xl' 566 + : 'l' 567 567 } 568 568 key={account.id} 569 569 alt={`${account.displayName} @${account.acct}`} ··· 606 606 const type = /^favourite/.test(key) 607 607 ? 'favourite' 608 608 : /^reblog/.test(key) 609 - ? 'reblog' 610 - : null; 609 + ? 'reblog' 610 + : null; 611 611 if (!type) continue; 612 612 for (const account of _accounts) { 613 613 const theAccount = accounts.find(
+12 -12
src/components/status.jsx
··· 996 996 {reblogsCount > 0 997 997 ? shortenNumber(reblogsCount) 998 998 : reblogged 999 - ? t`Unboost` 1000 - : t`Boost…`} 999 + ? t`Unboost` 1000 + : t`Boost…`} 1001 1001 </span> 1002 1002 </MenuConfirm> 1003 1003 <MenuItem ··· 1009 1009 {favouritesCount > 0 1010 1010 ? shortenNumber(favouritesCount) 1011 1011 : favourited 1012 - ? t`Unlike` 1013 - : t`Like`} 1012 + ? t`Unlike` 1013 + : t`Like`} 1014 1014 </span> 1015 1015 </MenuItem> 1016 1016 {supports('@mastodon/post-bookmark') && ( ··· 3167 3167 } else { 3168 3168 mediaHTML = ` 3169 3169 <a href="${sourceMediaURL}">📄 ${ 3170 - description || sourceMediaURL 3171 - }</a> 3170 + description || sourceMediaURL 3171 + }</a> 3172 3172 `; 3173 3173 } 3174 3174 ··· 3625 3625 quoted 3626 3626 ? '' 3627 3627 : isReblog 3628 - ? group 3629 - ? 'status-group' 3630 - : 'status-reblog' 3631 - : isFollowedTags 3632 - ? 'status-followed-tags' 3633 - : '' 3628 + ? group 3629 + ? 'status-group' 3630 + : 'status-reblog' 3631 + : isFollowedTags 3632 + ? 'status-followed-tags' 3633 + : '' 3634 3634 } 3635 3635 {...containerProps} 3636 3636 // title={statusPeekText}
+6 -6
src/components/translation-block.jsx
··· 189 189 {uiState === 'loading' 190 190 ? t`Translating…` 191 191 : sourceLanguage && sourceLangText && !detectedLang 192 - ? autoDetected 193 - ? t`Translate from ${sourceLangText} (auto-detected)` 194 - : t`Translate from ${sourceLangText}` 195 - : t`Translate`} 192 + ? autoDetected 193 + ? t`Translate from ${sourceLangText} (auto-detected)` 194 + : t`Translate from ${sourceLangText}` 195 + : t`Translate`} 196 196 </span> 197 197 </button> 198 198 </summary> ··· 221 221 {l.code === 'auto' 222 222 ? t`Auto (${detectedLang ?? '…'})` 223 223 : showCommon 224 - ? `${native} - ${common}` 225 - : native} 224 + ? `${native} - ${common}` 225 + : native} 226 226 </option> 227 227 ); 228 228 })}
+4 -4
src/compose.jsx
··· 31 31 editStatus 32 32 ? t`Editing source status` 33 33 : replyToStatus 34 - ? t`Replying to @${ 35 - replyToStatus.account?.acct || replyToStatus.account?.username 36 - }` 37 - : t`Compose`, 34 + ? t`Replying to @${ 35 + replyToStatus.account?.acct || replyToStatus.account?.username 36 + }` 37 + : t`Compose`, 38 38 ); 39 39 40 40 useEffect(() => {
+21 -21
src/locales/en.po
··· 963 963 msgstr "" 964 964 965 965 #: src/components/generic-accounts.jsx:145 966 - #: src/components/notification.jsx:446 966 + #: src/components/notification.jsx:444 967 967 #: src/pages/accounts.jsx:41 968 968 #: src/pages/search.jsx:317 969 969 #: src/pages/search.jsx:350 ··· 1472 1472 msgid "Moderation warning" 1473 1473 msgstr "" 1474 1474 1475 - #: src/components/notification.jsx:265 1475 + #: src/components/notification.jsx:264 1476 1476 msgid "Your {year} #Wrapstodon is here!" 1477 1477 msgstr "Your {year} #Wrapstodon is here!" 1478 1478 1479 - #: src/components/notification.jsx:272 1479 + #: src/components/notification.jsx:270 1480 1480 msgid "An admin from <0>{from}</0> has suspended <1>{targetName}</1>, which means you can no longer receive updates from them or interact with them." 1481 1481 msgstr "" 1482 1482 1483 - #: src/components/notification.jsx:278 1483 + #: src/components/notification.jsx:276 1484 1484 msgid "An admin from <0>{from}</0> has blocked <1>{targetName}</1>. Affected followers: {followersCount}, followings: {followingCount}." 1485 1485 msgstr "" 1486 1486 1487 - #: src/components/notification.jsx:284 1487 + #: src/components/notification.jsx:282 1488 1488 msgid "You have blocked <0>{targetName}</0>. Removed followers: {followersCount}, followings: {followingCount}." 1489 1489 msgstr "" 1490 1490 1491 - #: src/components/notification.jsx:292 1491 + #: src/components/notification.jsx:290 1492 1492 msgid "Your account has received a moderation warning." 1493 1493 msgstr "" 1494 1494 1495 - #: src/components/notification.jsx:293 1495 + #: src/components/notification.jsx:291 1496 1496 msgid "Your account has been disabled." 1497 1497 msgstr "" 1498 1498 1499 - #: src/components/notification.jsx:294 1499 + #: src/components/notification.jsx:292 1500 1500 msgid "Some of your posts have been marked as sensitive." 1501 1501 msgstr "" 1502 1502 1503 - #: src/components/notification.jsx:295 1503 + #: src/components/notification.jsx:293 1504 1504 msgid "Some of your posts have been deleted." 1505 1505 msgstr "" 1506 1506 1507 - #: src/components/notification.jsx:296 1507 + #: src/components/notification.jsx:294 1508 1508 msgid "Your posts will be marked as sensitive from now on." 1509 1509 msgstr "" 1510 1510 1511 - #: src/components/notification.jsx:297 1511 + #: src/components/notification.jsx:295 1512 1512 msgid "Your account has been limited." 1513 1513 msgstr "" 1514 1514 1515 - #: src/components/notification.jsx:298 1515 + #: src/components/notification.jsx:296 1516 1516 msgid "Your account has been suspended." 1517 1517 msgstr "" 1518 1518 1519 - #: src/components/notification.jsx:373 1519 + #: src/components/notification.jsx:371 1520 1520 msgid "[Unknown notification type: {type}]" 1521 1521 msgstr "" 1522 1522 1523 - #: src/components/notification.jsx:442 1523 + #: src/components/notification.jsx:440 1524 1524 #: src/components/status.jsx:1036 1525 1525 #: src/components/status.jsx:1046 1526 1526 msgid "Boosted/Liked by…" 1527 1527 msgstr "" 1528 1528 1529 - #: src/components/notification.jsx:443 1529 + #: src/components/notification.jsx:441 1530 1530 msgid "Liked by…" 1531 1531 msgstr "" 1532 1532 1533 - #: src/components/notification.jsx:444 1533 + #: src/components/notification.jsx:442 1534 1534 msgid "Boosted by…" 1535 1535 msgstr "" 1536 1536 1537 - #: src/components/notification.jsx:445 1537 + #: src/components/notification.jsx:443 1538 1538 msgid "Followed by…" 1539 1539 msgstr "" 1540 1540 1541 - #: src/components/notification.jsx:516 1542 - #: src/components/notification.jsx:532 1541 + #: src/components/notification.jsx:514 1542 + #: src/components/notification.jsx:530 1543 1543 msgid "Learn more <0/>" 1544 1544 msgstr "" 1545 1545 1546 - #: src/components/notification.jsx:540 1546 + #: src/components/notification.jsx:539 1547 1547 msgid "View #Wrapstodon" 1548 1548 msgstr "View #Wrapstodon" 1549 1549 ··· 2410 2410 msgstr "Login required." 2411 2411 2412 2412 #: src/compose.jsx:90 2413 - #: src/pages/annual-report.jsx:132 2413 + #: src/pages/annual-report.jsx:136 2414 2414 #: src/pages/http-route.jsx:91 2415 2415 #: src/pages/login.jsx:270 2416 2416 msgid "Go home"
+13 -9
src/pages/annual-report.jsx
··· 64 64 <tr> 65 65 {Object.entries(item).map(([k, value]) => ( 66 66 <td> 67 - {value && /(accountId)/i.test(k) && 67 + {value && 68 + /(accountId)/i.test(k) && 68 69 /^(mostRebloggedAccounts|commonlyInteractedWithAccounts)$/i.test( 69 70 key, 70 71 ) ? ( ··· 90 91 <> 91 92 <dt>{k}</dt> 92 93 <dd> 93 - {value && 94 - <Link to={`/${instance}/s/${value}`}> 95 - <Status 96 - status={statuses?.find((s) => s.id === value)} 97 - size="s" 98 - readOnly 99 - /> 100 - </Link>} 94 + {value && ( 95 + <Link to={`/${instance}/s/${value}`}> 96 + <Status 97 + status={statuses?.find( 98 + (s) => s.id === value, 99 + )} 100 + size="s" 101 + readOnly 102 + /> 103 + </Link> 104 + )} 101 105 </dd> 102 106 </> 103 107 ))}
+6 -6
src/pages/catchup.jsx
··· 1730 1730 group 1731 1731 ? 'group' 1732 1732 : reblog 1733 - ? 'reblog' 1734 - : isFollowedTags?.length 1735 - ? 'followed-tags' 1736 - : '' 1733 + ? 'reblog' 1734 + : isFollowedTags?.length 1735 + ? 'followed-tags' 1736 + : '' 1737 1737 } ${isReplyTo ? 'reply-to' : ''} ${ 1738 1738 isFiltered ? 'filtered' : '' 1739 1739 } visibility-${visibility}`} ··· 1826 1826 (mediaAttachments?.length 1827 1827 ? MEDIA_DENSITY * mediaAttachments.length 1828 1828 : card?.image 1829 - ? CARD_DENSITY 1830 - : 0); 1829 + ? CARD_DENSITY 1830 + : 0); 1831 1831 return density; 1832 1832 } 1833 1833
+2 -2
src/pages/hashtag.jsx
··· 55 55 ? t`${hashtagTitle} (Media only) on ${instance}` 56 56 : t`${hashtagTitle} on ${instance}` 57 57 : media 58 - ? t`${hashtagTitle} (Media only)` 59 - : t`${hashtagTitle}`; 58 + ? t`${hashtagTitle} (Media only)` 59 + : t`${hashtagTitle}`; 60 60 useTitle(title, `/:instance?/t/:hashtag`); 61 61 const latestItem = useRef(); 62 62
+4 -4
src/pages/login.jsx
··· 152 152 const selectedInstanceText = instanceTextLooksLikeDomain 153 153 ? cleanInstanceText 154 154 : instancesSuggestions?.length 155 - ? instancesSuggestions[0] 156 - : instanceText 157 - ? instancesList.find((instance) => instance.includes(instanceText)) 158 - : null; 155 + ? instancesSuggestions[0] 156 + : instanceText 157 + ? instancesList.find((instance) => instance.includes(instanceText)) 158 + : null; 159 159 160 160 const onSubmit = (e) => { 161 161 e.preventDefault();
+1 -1
src/utils/enhance-content.js
··· 13 13 '&': '&amp;', 14 14 '<': '&lt;', 15 15 '>': '&gt;', 16 - }[c]), 16 + })[c], 17 17 ); 18 18 } 19 19
+1 -1
src/utils/status-peek.js
··· 26 26 video: '📹', 27 27 audio: '🎵', 28 28 unknown: '', 29 - }[m.type] || ''), 29 + })[m.type] || '', 30 30 ) 31 31 .join(''); 32 32 }