this repo has no description
0
fork

Configure Feed

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

Merge pull request #321 from cheeaun/main

Update from main

authored by

Chee Aun and committed by
GitHub
3f575142 11407d0f

+108 -58
+42 -42
package-lock.json
··· 8 8 "name": "phanpy", 9 9 "version": "0.1.0", 10 10 "dependencies": { 11 - "@formatjs/intl-localematcher": "~0.5.0", 11 + "@formatjs/intl-localematcher": "~0.5.2", 12 12 "@formkit/auto-animate": "~0.8.1", 13 - "@github/text-expander-element": "~2.5.0", 13 + "@github/text-expander-element": "~2.6.1", 14 14 "@iconify-icons/mingcute": "~1.2.9", 15 15 "@justinribeiro/lite-youtube": "~1.5.0", 16 16 "@szhsin/react-menu": "~4.1.0", ··· 23 23 "idb-keyval": "~6.2.1", 24 24 "just-debounce-it": "~3.2.0", 25 25 "lz-string": "~1.5.0", 26 - "masto": "~6.4.2", 26 + "masto": "~6.5.0", 27 27 "moize": "~6.1.6", 28 28 "p-retry": "~6.1.0", 29 29 "p-throttle": "~5.1.0", 30 - "preact": "~10.18.2", 30 + "preact": "~10.19.2", 31 31 "react-hotkeys-hook": "~4.4.1", 32 - "react-intersection-observer": "~9.5.2", 32 + "react-intersection-observer": "~9.5.3", 33 33 "react-quick-pinch-zoom": "~5.0.0", 34 34 "react-router-dom": "6.6.2", 35 35 "string-length": "5.0.1", ··· 43 43 }, 44 44 "devDependencies": { 45 45 "@preact/preset-vite": "~2.6.0", 46 - "@trivago/prettier-plugin-sort-imports": "~4.2.1", 46 + "@trivago/prettier-plugin-sort-imports": "~4.3.0", 47 47 "postcss": "~8.4.31", 48 48 "postcss-dark-theme-class": "~1.0.0", 49 49 "postcss-preset-env": "~9.3.0", ··· 3082 3082 } 3083 3083 }, 3084 3084 "node_modules/@formatjs/intl-localematcher": { 3085 - "version": "0.5.0", 3086 - "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.0.tgz", 3087 - "integrity": "sha512-K1Xpg/8oyfCMxisJQa/fILoeoeyndcM0wcN8QiNG/uM5OAe1BcO1+2yd0gIboDI2tRJEsUi/sSBEYPbgkIdq4A==", 3085 + "version": "0.5.2", 3086 + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.2.tgz", 3087 + "integrity": "sha512-txaaE2fiBMagLrR4jYhxzFO6wEdEG4TPMqrzBAcbr4HFUYzH/YC+lg6OIzKCHm8WgDdyQevxbAAV1OgcXctuGw==", 3088 3088 "dependencies": { 3089 3089 "tslib": "^2.4.0" 3090 3090 } ··· 3100 3100 "integrity": "sha512-dmG1PuppNKHnBBEcfylWDwj9SSxd/E/qd8mC1G/klQC3s7ps5q6JZ034mwkkG0LKfI+Y+UgEua/ROD776N400w==" 3101 3101 }, 3102 3102 "node_modules/@github/text-expander-element": { 3103 - "version": "2.5.0", 3104 - "resolved": "https://registry.npmjs.org/@github/text-expander-element/-/text-expander-element-2.5.0.tgz", 3105 - "integrity": "sha512-BjCxTshkUCgNXo/8iXUSK1sJ7kMJqhVsw6LAzIFtgaYrm4q2068WnPKjngfR+/QPhxN1nSvgd7CozblEIYjUZA==", 3103 + "version": "2.6.1", 3104 + "resolved": "https://registry.npmjs.org/@github/text-expander-element/-/text-expander-element-2.6.1.tgz", 3105 + "integrity": "sha512-i6krPGXJRABfKXut0WArFd365Je4PT0MljtDoXUoCOEp+lGrmdosDMxmO0EfOYc97jBn+Hd2XO1mMsuI5+fwmQ==", 3106 3106 "dependencies": { 3107 3107 "@github/combobox-nav": "^2.0.2" 3108 3108 } ··· 3349 3349 } 3350 3350 }, 3351 3351 "node_modules/@trivago/prettier-plugin-sort-imports": { 3352 - "version": "4.2.1", 3353 - "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.2.1.tgz", 3354 - "integrity": "sha512-iuy2MPVURGdxILTchHr15VAioItuYBejKfcTmQFlxIuqA7jeaT6ngr5aUIG6S6U096d6a6lJCgaOwlRrPLlOPg==", 3352 + "version": "4.3.0", 3353 + "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", 3354 + "integrity": "sha512-r3n0onD3BTOVUNPhR4lhVK4/pABGpbA7bW3eumZnYdKaHkf1qEC+Mag6DPbGNuuh0eG8AaYj+YqmVHSiGslaTQ==", 3355 3355 "dev": true, 3356 3356 "dependencies": { 3357 3357 "@babel/generator": "7.17.7", ··· 5307 5307 } 5308 5308 }, 5309 5309 "node_modules/masto": { 5310 - "version": "6.4.2", 5311 - "resolved": "https://registry.npmjs.org/masto/-/masto-6.4.2.tgz", 5312 - "integrity": "sha512-aIxhsTkl0pc755Sf9NMuglY0VM9HuU/tec60e4oLsyyzAkE7ELwufh6anErO84n8g3eWu/u0LGucTujIiDaAhg==", 5310 + "version": "6.5.0", 5311 + "resolved": "https://registry.npmjs.org/masto/-/masto-6.5.0.tgz", 5312 + "integrity": "sha512-JVg+4llNyitFaEq/xSw0BkUAp7jJQ105GV0/WpzQfw4DjWQH+T5cwYttQ+U042Q7MzHp1i50UsVhODZ+x6Tt/Q==", 5313 5313 "dependencies": { 5314 5314 "change-case": "^4.1.2", 5315 5315 "events-to-async": "^2.0.1", ··· 6293 6293 "dev": true 6294 6294 }, 6295 6295 "node_modules/preact": { 6296 - "version": "10.18.2", 6297 - "resolved": "https://registry.npmjs.org/preact/-/preact-10.18.2.tgz", 6298 - "integrity": "sha512-X/K43vocUHDg0XhWVmTTMbec4LT/iBMh+csCEqJk+pJqegaXsvjdqN80ZZ3L+93azWCnWCZ+WGwYb8SplxeNjA==", 6296 + "version": "10.19.2", 6297 + "resolved": "https://registry.npmjs.org/preact/-/preact-10.19.2.tgz", 6298 + "integrity": "sha512-UA9DX/OJwv6YwP9Vn7Ti/vF80XL+YA5H2l7BpCtUr3ya8LWHFzpiO5R+N7dN16ujpIxhekRFuOOF82bXX7K/lg==", 6299 6299 "funding": { 6300 6300 "type": "opencollective", 6301 6301 "url": "https://opencollective.com/preact" ··· 6417 6417 } 6418 6418 }, 6419 6419 "node_modules/react-intersection-observer": { 6420 - "version": "9.5.2", 6421 - "resolved": "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-9.5.2.tgz", 6422 - "integrity": "sha512-EmoV66/yvksJcGa1rdW0nDNc4I1RifDWkT50gXSFnPLYQ4xUptuDD4V7k+Rj1OgVAlww628KLGcxPXFlOkkU/Q==", 6420 + "version": "9.5.3", 6421 + "resolved": "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-9.5.3.tgz", 6422 + "integrity": "sha512-NJzagSdUPS5rPhaLsHXYeJbsvdpbJwL6yCHtMk91hc0ufQ2BnXis+0QQ9NBh6n9n+Q3OyjR6OQLShYbaNBkThQ==", 6423 6423 "peerDependencies": { 6424 6424 "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" 6425 6425 } ··· 9602 9602 "optional": true 9603 9603 }, 9604 9604 "@formatjs/intl-localematcher": { 9605 - "version": "0.5.0", 9606 - "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.0.tgz", 9607 - "integrity": "sha512-K1Xpg/8oyfCMxisJQa/fILoeoeyndcM0wcN8QiNG/uM5OAe1BcO1+2yd0gIboDI2tRJEsUi/sSBEYPbgkIdq4A==", 9605 + "version": "0.5.2", 9606 + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.2.tgz", 9607 + "integrity": "sha512-txaaE2fiBMagLrR4jYhxzFO6wEdEG4TPMqrzBAcbr4HFUYzH/YC+lg6OIzKCHm8WgDdyQevxbAAV1OgcXctuGw==", 9608 9608 "requires": { 9609 9609 "tslib": "^2.4.0" 9610 9610 } ··· 9620 9620 "integrity": "sha512-dmG1PuppNKHnBBEcfylWDwj9SSxd/E/qd8mC1G/klQC3s7ps5q6JZ034mwkkG0LKfI+Y+UgEua/ROD776N400w==" 9621 9621 }, 9622 9622 "@github/text-expander-element": { 9623 - "version": "2.5.0", 9624 - "resolved": "https://registry.npmjs.org/@github/text-expander-element/-/text-expander-element-2.5.0.tgz", 9625 - "integrity": "sha512-BjCxTshkUCgNXo/8iXUSK1sJ7kMJqhVsw6LAzIFtgaYrm4q2068WnPKjngfR+/QPhxN1nSvgd7CozblEIYjUZA==", 9623 + "version": "2.6.1", 9624 + "resolved": "https://registry.npmjs.org/@github/text-expander-element/-/text-expander-element-2.6.1.tgz", 9625 + "integrity": "sha512-i6krPGXJRABfKXut0WArFd365Je4PT0MljtDoXUoCOEp+lGrmdosDMxmO0EfOYc97jBn+Hd2XO1mMsuI5+fwmQ==", 9626 9626 "requires": { 9627 9627 "@github/combobox-nav": "^2.0.2" 9628 9628 } ··· 9827 9827 } 9828 9828 }, 9829 9829 "@trivago/prettier-plugin-sort-imports": { 9830 - "version": "4.2.1", 9831 - "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.2.1.tgz", 9832 - "integrity": "sha512-iuy2MPVURGdxILTchHr15VAioItuYBejKfcTmQFlxIuqA7jeaT6ngr5aUIG6S6U096d6a6lJCgaOwlRrPLlOPg==", 9830 + "version": "4.3.0", 9831 + "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", 9832 + "integrity": "sha512-r3n0onD3BTOVUNPhR4lhVK4/pABGpbA7bW3eumZnYdKaHkf1qEC+Mag6DPbGNuuh0eG8AaYj+YqmVHSiGslaTQ==", 9833 9833 "dev": true, 9834 9834 "requires": { 9835 9835 "@babel/generator": "7.17.7", ··· 11259 11259 } 11260 11260 }, 11261 11261 "masto": { 11262 - "version": "6.4.2", 11263 - "resolved": "https://registry.npmjs.org/masto/-/masto-6.4.2.tgz", 11264 - "integrity": "sha512-aIxhsTkl0pc755Sf9NMuglY0VM9HuU/tec60e4oLsyyzAkE7ELwufh6anErO84n8g3eWu/u0LGucTujIiDaAhg==", 11262 + "version": "6.5.0", 11263 + "resolved": "https://registry.npmjs.org/masto/-/masto-6.5.0.tgz", 11264 + "integrity": "sha512-JVg+4llNyitFaEq/xSw0BkUAp7jJQ105GV0/WpzQfw4DjWQH+T5cwYttQ+U042Q7MzHp1i50UsVhODZ+x6Tt/Q==", 11265 11265 "requires": { 11266 11266 "change-case": "^4.1.2", 11267 11267 "events-to-async": "^2.0.1", ··· 11800 11800 "dev": true 11801 11801 }, 11802 11802 "preact": { 11803 - "version": "10.18.2", 11804 - "resolved": "https://registry.npmjs.org/preact/-/preact-10.18.2.tgz", 11805 - "integrity": "sha512-X/K43vocUHDg0XhWVmTTMbec4LT/iBMh+csCEqJk+pJqegaXsvjdqN80ZZ3L+93azWCnWCZ+WGwYb8SplxeNjA==" 11803 + "version": "10.19.2", 11804 + "resolved": "https://registry.npmjs.org/preact/-/preact-10.19.2.tgz", 11805 + "integrity": "sha512-UA9DX/OJwv6YwP9Vn7Ti/vF80XL+YA5H2l7BpCtUr3ya8LWHFzpiO5R+N7dN16ujpIxhekRFuOOF82bXX7K/lg==" 11806 11806 }, 11807 11807 "prettier": { 11808 11808 "version": "2.8.0", ··· 11879 11879 "requires": {} 11880 11880 }, 11881 11881 "react-intersection-observer": { 11882 - "version": "9.5.2", 11883 - "resolved": "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-9.5.2.tgz", 11884 - "integrity": "sha512-EmoV66/yvksJcGa1rdW0nDNc4I1RifDWkT50gXSFnPLYQ4xUptuDD4V7k+Rj1OgVAlww628KLGcxPXFlOkkU/Q==", 11882 + "version": "9.5.3", 11883 + "resolved": "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-9.5.3.tgz", 11884 + "integrity": "sha512-NJzagSdUPS5rPhaLsHXYeJbsvdpbJwL6yCHtMk91hc0ufQ2BnXis+0QQ9NBh6n9n+Q3OyjR6OQLShYbaNBkThQ==", 11885 11885 "requires": {} 11886 11886 }, 11887 11887 "react-is": {
+6 -6
package.json
··· 10 10 "sourcemap": "npx source-map-explorer dist/assets/*.js" 11 11 }, 12 12 "dependencies": { 13 - "@formatjs/intl-localematcher": "~0.5.0", 13 + "@formatjs/intl-localematcher": "~0.5.2", 14 14 "@formkit/auto-animate": "~0.8.1", 15 - "@github/text-expander-element": "~2.5.0", 15 + "@github/text-expander-element": "~2.6.1", 16 16 "@iconify-icons/mingcute": "~1.2.9", 17 17 "@justinribeiro/lite-youtube": "~1.5.0", 18 18 "@szhsin/react-menu": "~4.1.0", ··· 25 25 "idb-keyval": "~6.2.1", 26 26 "just-debounce-it": "~3.2.0", 27 27 "lz-string": "~1.5.0", 28 - "masto": "~6.4.2", 28 + "masto": "~6.5.0", 29 29 "moize": "~6.1.6", 30 30 "p-retry": "~6.1.0", 31 31 "p-throttle": "~5.1.0", 32 - "preact": "~10.18.2", 32 + "preact": "~10.19.2", 33 33 "react-hotkeys-hook": "~4.4.1", 34 - "react-intersection-observer": "~9.5.2", 34 + "react-intersection-observer": "~9.5.3", 35 35 "react-quick-pinch-zoom": "~5.0.0", 36 36 "react-router-dom": "6.6.2", 37 37 "string-length": "5.0.1", ··· 45 45 }, 46 46 "devDependencies": { 47 47 "@preact/preset-vite": "~2.6.0", 48 - "@trivago/prettier-plugin-sort-imports": "~4.2.1", 48 + "@trivago/prettier-plugin-sort-imports": "~4.3.0", 49 49 "postcss": "~8.4.31", 50 50 "postcss-dark-theme-class": "~1.0.0", 51 51 "postcss-preset-env": "~9.3.0",
+1 -1
src/app.css
··· 359 359 box-shadow: inset 0 -3px var(--comment-line-color), 360 360 inset 0 3px var(--comment-line-color); 361 361 overscroll-behavior-x: contain; 362 - touch-action: pan-x; 362 + /* touch-action: pan-x; */ 363 363 } 364 364 .timeline.contextual .replies[data-comments-level='4'] { 365 365 overflow-x: auto;
+1
src/components/icon.jsx
··· 28 28 'eye-open': () => import('@iconify-icons/mingcute/eye-2-line'), 29 29 message: () => import('@iconify-icons/mingcute/mail-line'), 30 30 comment: () => import('@iconify-icons/mingcute/chat-3-line'), 31 + comment2: () => import('@iconify-icons/mingcute/comment-2-line'), 31 32 home: () => import('@iconify-icons/mingcute/home-3-line'), 32 33 notification: () => import('@iconify-icons/mingcute/notification-line'), 33 34 follow: () => import('@iconify-icons/mingcute/user-follow-line'),
+50 -8
src/components/status.jsx
··· 102 102 onMediaClick, 103 103 quoted, 104 104 onStatusLinkClick = () => {}, 105 + enableCommentHint, 105 106 }) { 106 107 if (skeleton) { 107 108 return ( ··· 293 294 size={size} 294 295 contentTextWeight={contentTextWeight} 295 296 readOnly={readOnly} 297 + enableCommentHint 296 298 /> 297 299 </div> 298 300 ); ··· 533 535 <span class="ib"> 534 536 {repliesCount > 0 && ( 535 537 <span> 536 - <Icon icon="reply" alt="Replies" size="s" />{' '} 538 + <Icon icon="comment2" alt="Replies" size="s" />{' '} 537 539 <span>{shortenNumber(repliesCount)}</span> 538 540 </span> 539 541 )}{' '} ··· 989 991 // ); 990 992 }, [showMultipleMediaCaptions, displayedMediaAttachments, language]); 991 993 994 + const isThread = useMemo(() => { 995 + return ( 996 + (!!inReplyToId && inReplyToAccountId === status.account?.id) || 997 + !!snapStates.statusThreadNumber[sKey] 998 + ); 999 + }, [ 1000 + inReplyToId, 1001 + inReplyToAccountId, 1002 + status.account?.id, 1003 + snapStates.statusThreadNumber[sKey], 1004 + ]); 1005 + 1006 + const showCommentHint = useMemo(() => { 1007 + return ( 1008 + enableCommentHint && 1009 + !isThread && 1010 + !withinContext && 1011 + !inReplyToId && 1012 + visibility === 'public' && 1013 + repliesCount > 0 1014 + ); 1015 + }, [ 1016 + enableCommentHint, 1017 + isThread, 1018 + withinContext, 1019 + inReplyToId, 1020 + repliesCount, 1021 + visibility, 1022 + ]); 1023 + 992 1024 return ( 993 1025 <article 994 1026 data-state-post-id={sKey} ··· 1151 1183 : '' 1152 1184 }`} 1153 1185 > 1154 - <Icon 1155 - icon={visibilityIconsMap[visibility]} 1156 - alt={visibilityText[visibility]} 1157 - size="s" 1158 - />{' '} 1186 + {showCommentHint ? ( 1187 + <Icon 1188 + icon="comment2" 1189 + size="s" 1190 + alt={`${repliesCount} ${ 1191 + repliesCount === 1 ? 'reply' : 'replies' 1192 + }`} 1193 + /> 1194 + ) : ( 1195 + <Icon 1196 + icon={visibilityIconsMap[visibility]} 1197 + alt={visibilityText[visibility]} 1198 + size="s" 1199 + /> 1200 + )}{' '} 1159 1201 <RelativeTime datetime={createdAtDate} format="micro" /> 1160 1202 </Link> 1161 1203 ) : ( ··· 1218 1260 )} 1219 1261 {!withinContext && ( 1220 1262 <> 1221 - {(!!inReplyToId && inReplyToAccountId === status.account?.id) || 1222 - !!snapStates.statusThreadNumber[sKey] ? ( 1263 + {isThread ? ( 1223 1264 <div class="status-thread-badge"> 1224 1265 <Icon icon="thread" size="s" /> 1225 1266 Thread ··· 2437 2478 instance={q.instance} 2438 2479 size="s" 2439 2480 quoted={level + 1} 2481 + enableCommentHint 2440 2482 /> 2441 2483 </Link> 2442 2484 );
+8 -1
src/components/timeline.jsx
··· 531 531 instance={instance} 532 532 size="s" 533 533 contentTextWeight 534 + enableCommentHint 534 535 // allowFilters={allowFilters} 535 536 /> 536 537 ) : ( ··· 539 540 instance={instance} 540 541 size="s" 541 542 contentTextWeight 543 + enableCommentHint 542 544 // allowFilters={allowFilters} 543 545 /> 544 546 )} ··· 565 567 !_differentAuthor && 566 568 !items[i - 1]._differentAuthor && 567 569 !items[i + 1]._differentAuthor))); 570 + const isEnd = i === items.length - 1; 568 571 return ( 569 572 <li 570 573 key={`timeline-${statusID}`} 571 574 class={`timeline-item-container timeline-item-container-type-${type} timeline-item-container-${ 572 - i === 0 ? 'start' : i === items.length - 1 ? 'end' : 'middle' 575 + i === 0 ? 'start' : isEnd ? 'end' : 'middle' 573 576 } ${_differentAuthor ? 'timeline-item-diff-author' : ''}`} 574 577 > 575 578 <Link class="status-link timeline-item" to={url}> ··· 579 582 <Status 580 583 statusID={statusID} 581 584 instance={instance} 585 + enableCommentHint={isEnd} 582 586 // allowFilters={allowFilters} 583 587 /> 584 588 ) : ( 585 589 <Status 586 590 status={item} 587 591 instance={instance} 592 + enableCommentHint={isEnd} 588 593 // allowFilters={allowFilters} 589 594 /> 590 595 )} ··· 625 630 <Status 626 631 statusID={statusID} 627 632 instance={instance} 633 + enableCommentHint 628 634 // allowFilters={allowFilters} 629 635 /> 630 636 ) : ( 631 637 <Status 632 638 status={status} 633 639 instance={instance} 640 + enableCommentHint 634 641 // allowFilters={allowFilters} 635 642 /> 636 643 )}