From 84e064ff304dd444033b1cff6e077dd73cbbd2de Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 17 Mar 2023 08:51:40 +0800 Subject: [PATCH 01/94] Prevent Mobile Safari from shrinking the input fields --- src/components/status.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/status.css b/src/components/status.css index e78a6c69..79a0feec 100644 --- a/src/components/status.css +++ b/src/components/status.css @@ -747,6 +747,9 @@ a.card:is(:hover, :focus) { gap: 8px; cursor: pointer; } +.poll-label input:is([type='radio'], [type='checkbox']) { + flex-shrink: 0; +} .poll-option-votes { flex-shrink: 0; font-size: 90%; From 89c03945a3c21ec31b9dac562f265b7e4aae071f Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 17 Mar 2023 17:14:54 +0800 Subject: [PATCH 02/94] "Delete" status feature --- src/components/icon.jsx | 1 + src/components/status.css | 15 +++++++ src/components/status.jsx | 82 ++++++++++++++++++++++++++++----------- 3 files changed, 76 insertions(+), 22 deletions(-) diff --git a/src/components/icon.jsx b/src/components/icon.jsx index 221d95ac..f3f423ec 100644 --- a/src/components/icon.jsx +++ b/src/components/icon.jsx @@ -65,6 +65,7 @@ const ICONS = { exit: 'mingcute:exit-line', translate: 'mingcute:translate-line', play: 'mingcute:play-fill', + trash: 'mingcute:delete-2-line', }; const modules = import.meta.glob('/node_modules/@iconify-icons/mingcute/*.js'); diff --git a/src/components/status.css b/src/components/status.css index 79a0feec..442269cf 100644 --- a/src/components/status.css +++ b/src/components/status.css @@ -810,6 +810,10 @@ a.card:is(:hover, :focus) { border-top: var(--hairline-width) solid var(--outline-color); margin-top: 8px; } +.status.large .actions.disabled { + pointer-events: none; + opacity: 0.5; +} .status .action.has-count { flex: 1; } @@ -984,3 +988,14 @@ a.card:is(:hover, :focus) { border: 1px solid var(--outline-color); border-radius: 8px; } + +/* DELETED */ + +.status-deleted { + opacity: 0.75; +} +.status-deleted-tag { + color: var(--text-insignificant-color); + text-transform: uppercase; + font-size: 80%; +} diff --git a/src/components/status.jsx b/src/components/status.jsx index 92d83af3..1eb9217c 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -27,7 +27,7 @@ import htmlContentLength from '../utils/html-content-length'; import niceDateTime from '../utils/nice-date-time'; import shortenNumber from '../utils/shorten-number'; import showToast from '../utils/show-toast'; -import states, { saveStatus, statusKey } from '../utils/states'; +import states, { getStatus, saveStatus, statusKey } from '../utils/states'; import store from '../utils/store'; import visibilityIconsMap from '../utils/visibility-icons-map'; @@ -543,6 +543,29 @@ function Status({ Edit + {isSizeLarge && ( + { + const yes = confirm('Delete this post?'); + if (yes) { + (async () => { + try { + await masto.v1.statuses.remove(id); + const cachedStatus = getStatus(id, instance); + cachedStatus._deleted = true; + showToast('Deleted'); + } catch (e) { + console.error(e); + showToast('Unable to delete'); + } + })(); + } + }} + > + + Delete… + + )} )} @@ -582,12 +605,13 @@ function Status({ m: 'medium', l: 'large', }[size] - }`} + } ${_deleted ? 'status-deleted' : ''}`} onMouseEnter={debugHover} onContextMenu={(e) => { if (size === 'l') return; if (e.metaKey) return; if (previewMode) return; + if (_deleted) return; // console.log('context menu', e); const link = e.target.closest('a'); if (link && /^https?:\/\//.test(link.getAttribute('href'))) return; @@ -672,7 +696,9 @@ function Status({ )} */} {/* */}{' '} {size !== 'l' && - (url && !previewMode ? ( + (_deleted ? ( + Deleted + ) : url && !previewMode ? (
- {' '} - - - - {editedAt && ( + {_deleted ? ( + Deleted + ) : ( <> - {' '} - • {' '} - + {' '} + + + + {editedAt && ( + <> + {' '} + • {' '} + + + )} )}
-
+
Date: Fri, 17 Mar 2023 17:15:24 +0800 Subject: [PATCH 03/94] Possibly fix the dangling thread line --- src/app.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app.css b/src/app.css index 6ce8ec28..8b575c63 100644 --- a/src/app.css +++ b/src/app.css @@ -204,6 +204,9 @@ a[href^='http'][rel*='nofollow']:visited:not(:has(div)) { .timeline.contextual > li:last-child { background-size: 100% 20px; } +.timeline.contextual > li:only-child { + background-image: none; +} .timeline.contextual > li.descendant { position: relative; } From 51bc920adaed71150853ce4420002a6939f4ce06 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 17 Mar 2023 18:58:10 +0800 Subject: [PATCH 04/94] Show last status timestamp if not being followed --- src/components/account-info.css | 1 + src/components/account-info.jsx | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/account-info.css b/src/components/account-info.css index 71c946ca..8184aac5 100644 --- a/src/components/account-info.css +++ b/src/components/account-info.css @@ -153,6 +153,7 @@ gap: 8px; justify-content: space-between; min-height: 2.5em; + align-items: center; } .account-container .actions button { align-self: flex-end; diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index a084db00..2f020918 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -2,6 +2,7 @@ import './account-info.css'; import { useEffect, useRef, useState } from 'preact/hooks'; +import RelativeTime from '../components/relative-time'; import { api } from '../utils/api'; import emojifyText from '../utils/emojify-text'; import enhanceContent from '../utils/enhance-content'; @@ -359,7 +360,7 @@ function RelatedActions({ info, instance, authenticated }) { const [relationship, setRelationship] = useState(null); const [familiarFollowers, setFamiliarFollowers] = useState([]); - const { id, locked } = info; + const { id, locked, lastStatusAt } = info; const accountID = useRef(id); const { @@ -473,7 +474,13 @@ function RelatedActions({ info, instance, authenticated }) {

)}

- {followedBy ? Following you : }{' '} + {followedBy ? ( + Following you + ) : ( + + Last status: + + )}{' '} {relationshipUIState !== 'loading' && relationship && ( + } + > + {currentAuthenticated && ( + <> + { + states.showCompose = { + draftStatus: { + status: `@${acct} `, + }, + }; + }} + > + + Mention @{username} + + + + )} + + + {niceAccountURL(url)} + +

+ {!!relationship && ( + <> + + {muting ? ( + { + setRelationshipUIState('loading'); + (async () => { + try { + const newRelationship = + await currentMasto.v1.accounts.unmute(id); + console.log('unmuting', newRelationship); + setRelationship(newRelationship); + setRelationshipUIState('default'); + showToast(`Unmuted @${username}`); + } catch (e) { + console.error(e); + setRelationshipUIState('error'); + } + })(); + }} + > + + Unmute @{username} + + ) : ( + + + Mute @{username}… + + + + + + } + > + + + )} + { + if (!blocking && !confirm(`Block @${username}?`)) { + return; + } + setRelationshipUIState('loading'); + (async () => { + try { + if (blocking) { + const newRelationship = + await currentMasto.v1.accounts.unblock(id); + console.log('unblocking', newRelationship); + setRelationship(newRelationship); + setRelationshipUIState('default'); + showToast(`Unblocked @${username}`); + } else { + const newRelationship = + await currentMasto.v1.accounts.block(id); + console.log('blocking', newRelationship); + setRelationship(newRelationship); + setRelationshipUIState('default'); + showToast(`Blocked @${username}`); + } + } catch (e) { + console.error(e); + setRelationshipUIState('error'); + if (blocking) { + showToast(`Unable to unblock @${username}`); + } else { + showToast(`Unable to block @${username}`); + } + } + })(); + }} + > + {blocking ? ( + <> + + Unblock @{username} + + ) : ( + <> + + Block @{username}… + + )} + + {/* + + Report @{username}… + */} + + )} +
+ {!!relationship && ( + - )} + if (newRelationship) setRelationship(newRelationship); + setRelationshipUIState('default'); + } catch (e) { + alert(e); + setRelationshipUIState('error'); + } + })(); + }} + > + {following ? ( + <> + Following + Unfollow… + + ) : requested ? ( + <> + Requested + Withdraw… + + ) : locked ? ( + <> + Follow + + ) : ( + 'Follow' + )} + + )} +

); @@ -561,4 +804,18 @@ function lightenRGB([r, g, b]) { return [r, g, b, alpha]; } +function niceAccountURL(url) { + if (!url) return; + const urlObj = new URL(url); + const { host, pathname } = urlObj; + const path = pathname.replace(/\/$/, '').replace(/^\//, ''); + return ( + <> + {host}/ + + {path} + + ); +} + export default AccountInfo; diff --git a/src/components/compose.jsx b/src/components/compose.jsx index 981516b2..c6076604 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -244,12 +244,12 @@ function Compose({ textareaRef.current.value = status; oninputTextarea(); focusTextarea(); - spoilerTextRef.current.value = spoilerText; - setVisibility(visibility); + if (spoilerText) spoilerTextRef.current.value = spoilerText; + if (visibility) setVisibility(visibility); setLanguage(language || prefs.postingDefaultLanguage || DEFAULT_LANG); - setSensitive(sensitive); - setPoll(composablePoll); - setMediaAttachments(mediaAttachments); + if (sensitive !== null) setSensitive(sensitive); + if (composablePoll) setPoll(composablePoll); + if (mediaAttachments) setMediaAttachments(mediaAttachments); } }, [draftStatus, editStatus, replyToStatus]); @@ -442,10 +442,6 @@ function Compose({ useEffect(() => { const handleItems = (e) => { - if (mediaAttachments.length >= maxMediaAttachments) { - alert(`You can only attach up to ${maxMediaAttachments} files.`); - return; - } const { items } = e.clipboardData || e.dataTransfer; const files = []; for (let i = 0; i < items.length; i++) { @@ -457,6 +453,10 @@ function Compose({ } } } + if (files.length > 0 && mediaAttachments.length >= maxMediaAttachments) { + alert(`You can only attach up to ${maxMediaAttachments} files.`); + return; + } console.log({ files }); if (files.length > 0) { e.preventDefault(); @@ -895,7 +895,7 @@ function Compose({ ? 'Edit your status' : 'What are you doing?' } - required={mediaAttachments.length === 0} + required={mediaAttachments?.length === 0} disabled={uiState === 'loading'} lang={language} onInput={() => { @@ -906,7 +906,7 @@ function Compose({ return masto.v2.search(params); }} /> - {mediaAttachments.length > 0 && ( + {mediaAttachments?.length > 0 && (
{mediaAttachments.map((attachment, i) => { const { id, file } = attachment; diff --git a/src/components/icon.jsx b/src/components/icon.jsx index f3f423ec..0529cd0d 100644 --- a/src/components/icon.jsx +++ b/src/components/icon.jsx @@ -66,6 +66,12 @@ const ICONS = { translate: 'mingcute:translate-line', play: 'mingcute:play-fill', trash: 'mingcute:delete-2-line', + mute: 'mingcute:volume-mute-line', + unmute: 'mingcute:volume-line', + block: 'mingcute:forbid-circle-line', + unblock: ['mingcute:forbid-circle-line', '180deg'], + flag: 'mingcute:flag-4-line', + time: 'mingcute:time-line', }; const modules = import.meta.glob('/node_modules/@iconify-icons/mingcute/*.js'); From 94b96bd53493789bf96d3f99f6f796d5ad0b56aa Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 18 Mar 2023 17:04:47 +0800 Subject: [PATCH 06/94] Fix wrong "info", when viewing remote accounts --- src/components/account-info.jsx | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index b4b92c43..f53f6f41 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -406,6 +406,8 @@ function RelatedActions({ info, instance, authenticated }) { endorsed, } = relationship || {}; + const [currentInfo, setCurrentInfo] = useState(null); + useEffect(() => { if (info) { const currentAccount = store.session.get('currentAccount'); @@ -424,7 +426,10 @@ function RelatedActions({ info, instance, authenticated }) { resolve: true, }); console.log('🥏 Fetched account from logged-in instance', results); - currentID = results.accounts[0].id; + if (results.accounts.length) { + currentID = results.accounts[0].id; + setCurrentInfo(results.accounts[0]); + } } catch (e) { console.error(e); } @@ -544,7 +549,7 @@ function RelatedActions({ info, instance, authenticated }) { onClick={() => { states.showCompose = { draftStatus: { - status: `@${acct} `, + status: `@${currentInfo?.acct || acct} `, }, }; }} @@ -606,7 +611,9 @@ function RelatedActions({ info, instance, authenticated }) { (async () => { try { const newRelationship = - await currentMasto.v1.accounts.unmute(id); + await currentMasto.v1.accounts.unmute( + currentInfo?.id || id, + ); console.log('unmuting', newRelationship); setRelationship(newRelationship); setRelationshipUIState('default'); @@ -646,9 +653,12 @@ function RelatedActions({ info, instance, authenticated }) { (async () => { try { const newRelationship = - await currentMasto.v1.accounts.mute(id, { - duration, - }); + await currentMasto.v1.accounts.mute( + currentInfo?.id || id, + { + duration, + }, + ); console.log('muting', newRelationship); setRelationship(newRelationship); setRelationshipUIState('default'); @@ -679,14 +689,18 @@ function RelatedActions({ info, instance, authenticated }) { try { if (blocking) { const newRelationship = - await currentMasto.v1.accounts.unblock(id); + await currentMasto.v1.accounts.unblock( + currentInfo?.id || id, + ); console.log('unblocking', newRelationship); setRelationship(newRelationship); setRelationshipUIState('default'); showToast(`Unblocked @${username}`); } else { const newRelationship = - await currentMasto.v1.accounts.block(id); + await currentMasto.v1.accounts.block( + currentInfo?.id || id, + ); console.log('blocking', newRelationship); setRelationship(newRelationship); setRelationshipUIState('default'); From ed3d86c67a16f898eb6b23d38c81f205020c25c2 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 18 Mar 2023 20:05:12 +0800 Subject: [PATCH 07/94] Make youtube embeds lighter And possibly more privacy-enhanced --- package-lock.json | 11 +++++++++++ package.json | 1 + src/components/status.jsx | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/package-lock.json b/package-lock.json index d658f20d..3fbd0041 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "@formatjs/intl-localematcher": "~0.2.32", "@github/text-expander-element": "~2.3.0", "@iconify-icons/mingcute": "~1.2.4", + "@justinribeiro/lite-youtube": "~1.5.0", "@szhsin/react-menu": "~3.5.2", "dayjs": "~1.11.7", "dayjs-twitter": "~0.5.0", @@ -2620,6 +2621,11 @@ "resolved": "https://registry.npmjs.org/@juggle/resize-observer/-/resize-observer-3.4.0.tgz", "integrity": "sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==" }, + "node_modules/@justinribeiro/lite-youtube": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@justinribeiro/lite-youtube/-/lite-youtube-1.5.0.tgz", + "integrity": "sha512-TU92RKtz9BI9PRYrVwDIUsnFadLZtqRKWl1ZOdbxb7roJDb8Dd/xURllAsLEmCg6oJNyhXlVa5RsnUc0EKd8Cw==" + }, "node_modules/@lukeed/csprng": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.0.1.tgz", @@ -8816,6 +8822,11 @@ "resolved": "https://registry.npmjs.org/@juggle/resize-observer/-/resize-observer-3.4.0.tgz", "integrity": "sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==" }, + "@justinribeiro/lite-youtube": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@justinribeiro/lite-youtube/-/lite-youtube-1.5.0.tgz", + "integrity": "sha512-TU92RKtz9BI9PRYrVwDIUsnFadLZtqRKWl1ZOdbxb7roJDb8Dd/xURllAsLEmCg6oJNyhXlVa5RsnUc0EKd8Cw==" + }, "@lukeed/csprng": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.0.1.tgz", diff --git a/package.json b/package.json index 24370bc5..261eb25c 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@formatjs/intl-localematcher": "~0.2.32", "@github/text-expander-element": "~2.3.0", "@iconify-icons/mingcute": "~1.2.4", + "@justinribeiro/lite-youtube": "~1.5.0", "@szhsin/react-menu": "~3.5.2", "dayjs": "~1.11.7", "dayjs-twitter": "~0.5.0", diff --git a/src/components/status.jsx b/src/components/status.jsx index 1eb9217c..e6d8ba1b 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -1,5 +1,6 @@ import './status.css'; +import '@justinribeiro/lite-youtube'; import { ControlledMenu, Menu, @@ -1195,6 +1196,13 @@ function Card({ card, instance }) { ); } else if (type === 'video') { + if (/youtube/i.test(providerName)) { + // Get ID from e.g. https://www.youtube.com/watch?v=[VIDEO_ID] + const videoID = url.match(/watch\?v=([^&]+)/)?.[1]; + if (videoID) { + return ; + } + } return (
Date: Sat, 18 Mar 2023 20:20:18 +0800 Subject: [PATCH 08/94] Finally fix this weird alignment and underline --- src/components/status.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/status.css b/src/components/status.css index 442269cf..87fcbdf7 100644 --- a/src/components/status.css +++ b/src/components/status.css @@ -783,6 +783,9 @@ a.card:is(:hover, :focus) { .status .extra-meta a { color: inherit; text-decoration: none; + vertical-align: baseline; + text-decoration-thickness: 1px; + text-underline-offset: 3px; } .status .extra-meta a:is(:hover, :focus) { text-decoration: underline; From a0d4d9e08c22ed8cf8a2e8cef8831f18a025b463 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 18 Mar 2023 20:20:48 +0800 Subject: [PATCH 09/94] Time to save all to states Memory usage might go up but need this for reactivity --- src/pages/account-statuses.jsx | 6 ++++++ src/pages/hashtag.jsx | 6 ++++++ src/pages/list.jsx | 6 ++++++ src/pages/public.jsx | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/src/pages/account-statuses.jsx b/src/pages/account-statuses.jsx index def1a03e..95c57d81 100644 --- a/src/pages/account-statuses.jsx +++ b/src/pages/account-statuses.jsx @@ -7,6 +7,7 @@ import Timeline from '../components/timeline'; import { api } from '../utils/api'; import emojifyText from '../utils/emojify-text'; import states from '../utils/states'; +import { saveStatus } from '../utils/states'; import useTitle from '../utils/useTitle'; const LIMIT = 20; @@ -48,6 +49,10 @@ function AccountStatuses() { const { value, done } = await accountStatusesIterator.current.next(); if (value?.length) { results.push(...value); + + value.forEach((item) => { + saveStatus(item, instance); + }); } return { value: results, @@ -118,6 +123,7 @@ function AccountStatuses() { emptyText="Nothing to see here yet." errorText="Unable to load statuses" fetchItems={fetchAccountStatuses} + useItemID boostsCarousel={snapStates.settings.boostsCarousel} timelineStart={TimelineStart} /> diff --git a/src/pages/hashtag.jsx b/src/pages/hashtag.jsx index cb8bce12..fd0e6f8e 100644 --- a/src/pages/hashtag.jsx +++ b/src/pages/hashtag.jsx @@ -13,6 +13,7 @@ import Timeline from '../components/timeline'; import { api } from '../utils/api'; import showToast from '../utils/show-toast'; import states from '../utils/states'; +import { saveStatus } from '../utils/states'; import useTitle from '../utils/useTitle'; const LIMIT = 20; @@ -52,6 +53,10 @@ function Hashtags(props) { if (firstLoad) { latestItem.current = value[0].id; } + + value.forEach((item) => { + saveStatus(item, instance); + }); } return results; } @@ -110,6 +115,7 @@ function Hashtags(props) { errorText="Unable to load posts with this tag" fetchItems={fetchHashtags} checkForUpdates={checkForUpdates} + useItemID headerEnd={ { + saveStatus(item, instance); + }); } return results; } @@ -69,6 +74,7 @@ function List(props) { instance={instance} fetchItems={fetchList} checkForUpdates={checkForUpdates} + useItemID boostsCarousel headerStart={ diff --git a/src/pages/public.jsx b/src/pages/public.jsx index 4fc710fd..747da069 100644 --- a/src/pages/public.jsx +++ b/src/pages/public.jsx @@ -7,6 +7,7 @@ import Icon from '../components/icon'; import Timeline from '../components/timeline'; import { api } from '../utils/api'; import states from '../utils/states'; +import { saveStatus } from '../utils/states'; import useTitle from '../utils/useTitle'; const LIMIT = 20; @@ -37,6 +38,10 @@ function Public({ local, ...props }) { if (firstLoad) { latestItem.current = value[0].id; } + + value.forEach((item) => { + saveStatus(item, instance); + }); } return results; } @@ -76,6 +81,7 @@ function Public({ local, ...props }) { errorText="Unable to load posts" fetchItems={fetchPublic} checkForUpdates={checkForUpdates} + useItemID headerStart={<>} boostsCarousel={snapStates.settings.boostsCarousel} headerEnd={ From 4f3d503a356601e05e640d449de85cfb4614d0df Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 18 Mar 2023 20:40:16 +0800 Subject: [PATCH 10/94] Don't allow self to mention self lolol --- src/components/account-info.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index f53f6f41..0b26aa0f 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -407,6 +407,7 @@ function RelatedActions({ info, instance, authenticated }) { } = relationship || {}; const [currentInfo, setCurrentInfo] = useState(null); + const [isSelf, setIsSelf] = useState(false); useEffect(() => { if (info) { @@ -439,6 +440,7 @@ function RelatedActions({ info, instance, authenticated }) { if (currentAccount === currentID) { // It's myself! + setIsSelf(true); return; } @@ -543,7 +545,7 @@ function RelatedActions({ info, instance, authenticated }) { } > - {currentAuthenticated && ( + {currentAuthenticated && !isSelf && ( <> { From aea06e0d26d9fce2065ef5823f5895ffa7fe5844 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 18 Mar 2023 21:39:55 +0800 Subject: [PATCH 11/94] Upgrade react-hotkeys-hook --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3fbd0041..c02bc476 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "p-retry": "~5.1.2", "p-throttle": "~5.0.0", "preact": "~10.13.1", - "react-hotkeys-hook": "~4.3.7", + "react-hotkeys-hook": "~4.3.8", "react-intersection-observer": "~9.4.3", "react-router-dom": "6.6.2", "string-length": "~5.0.1", @@ -5794,9 +5794,9 @@ } }, "node_modules/react-hotkeys-hook": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/react-hotkeys-hook/-/react-hotkeys-hook-4.3.7.tgz", - "integrity": "sha512-qUcA5vl/liGWr9wLYI5/8oppHLa6nExFqOAMC6CyZhpj7C56PIzYZ76xAtJ+5lgxObgl4A4pQz8upy+nq7orSQ==", + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/react-hotkeys-hook/-/react-hotkeys-hook-4.3.8.tgz", + "integrity": "sha512-RmrIQ3M259c84MnYVEAQsmHkD6s7XUgLG0rW6S7qjt1Lh7q+SPIz5b6obVU8OJw1Utsj1mUCj6twtBPaK/ytww==", "peerDependencies": { "react": ">=16.8.1", "react-dom": ">=16.8.1" @@ -11069,9 +11069,9 @@ } }, "react-hotkeys-hook": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/react-hotkeys-hook/-/react-hotkeys-hook-4.3.7.tgz", - "integrity": "sha512-qUcA5vl/liGWr9wLYI5/8oppHLa6nExFqOAMC6CyZhpj7C56PIzYZ76xAtJ+5lgxObgl4A4pQz8upy+nq7orSQ==", + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/react-hotkeys-hook/-/react-hotkeys-hook-4.3.8.tgz", + "integrity": "sha512-RmrIQ3M259c84MnYVEAQsmHkD6s7XUgLG0rW6S7qjt1Lh7q+SPIz5b6obVU8OJw1Utsj1mUCj6twtBPaK/ytww==", "requires": {} }, "react-intersection-observer": { diff --git a/package.json b/package.json index 261eb25c..9ecb0ef5 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "p-retry": "~5.1.2", "p-throttle": "~5.0.0", "preact": "~10.13.1", - "react-hotkeys-hook": "~4.3.7", + "react-hotkeys-hook": "~4.3.8", "react-intersection-observer": "~9.4.3", "react-router-dom": "6.6.2", "string-length": "~5.0.1", From 94f8c35f8d6f580fb11a6e774f9aaa93f74bb232 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 18 Mar 2023 21:40:27 +0800 Subject: [PATCH 12/94] Upgrade vite --- package-lock.json | 398 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 200 insertions(+), 200 deletions(-) diff --git a/package-lock.json b/package-lock.json index c02bc476..a5798425 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "postcss-dark-theme-class": "~0.7.3", "postcss-preset-env": "~8.0.1", "twitter-text": "~3.1.0", - "vite": "~4.1.4", + "vite": "~4.2.0", "vite-plugin-generate-file": "~0.0.4", "vite-plugin-html-config": "~1.0.11", "vite-plugin-html-env": "~1.2.7", @@ -2160,9 +2160,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.17.tgz", - "integrity": "sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.12.tgz", + "integrity": "sha512-E/sgkvwoIfj4aMAPL2e35VnUJspzVYl7+M1B2cqeubdBhADV4uPon0KCc8p2G+LqSJ6i8ocYPCqY3A4GGq0zkQ==", "cpu": [ "arm" ], @@ -2176,9 +2176,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.17.tgz", - "integrity": "sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.12.tgz", + "integrity": "sha512-WQ9p5oiXXYJ33F2EkE3r0FRDFVpEdcDiwNX3u7Xaibxfx6vQE0Sb8ytrfQsA5WO6kDn6mDfKLh6KrPBjvkk7xA==", "cpu": [ "arm64" ], @@ -2192,9 +2192,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.17.tgz", - "integrity": "sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.12.tgz", + "integrity": "sha512-m4OsaCr5gT+se25rFPHKQXARMyAehHTQAz4XX1Vk3d27VtqiX0ALMBPoXZsGaB6JYryCLfgGwUslMqTfqeLU0w==", "cpu": [ "x64" ], @@ -2208,9 +2208,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.17.tgz", - "integrity": "sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.12.tgz", + "integrity": "sha512-O3GCZghRIx+RAN0NDPhyyhRgwa19MoKlzGonIb5hgTj78krqp9XZbYCvFr9N1eUxg0ZQEpiiZ4QvsOQwBpP+lg==", "cpu": [ "arm64" ], @@ -2224,9 +2224,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.17.tgz", - "integrity": "sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.12.tgz", + "integrity": "sha512-5D48jM3tW27h1qjaD9UNRuN+4v0zvksqZSPZqeSWggfMlsVdAhH3pwSfQIFJwcs9QJ9BRibPS4ViZgs3d2wsCA==", "cpu": [ "x64" ], @@ -2240,9 +2240,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.17.tgz", - "integrity": "sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.12.tgz", + "integrity": "sha512-OWvHzmLNTdF1erSvrfoEBGlN94IE6vCEaGEkEH29uo/VoONqPnoDFfShi41Ew+yKimx4vrmmAJEGNoyyP+OgOQ==", "cpu": [ "arm64" ], @@ -2256,9 +2256,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.17.tgz", - "integrity": "sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.12.tgz", + "integrity": "sha512-A0Xg5CZv8MU9xh4a+7NUpi5VHBKh1RaGJKqjxe4KG87X+mTjDE6ZvlJqpWoeJxgfXHT7IMP9tDFu7IZ03OtJAw==", "cpu": [ "x64" ], @@ -2272,9 +2272,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.17.tgz", - "integrity": "sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.12.tgz", + "integrity": "sha512-WsHyJ7b7vzHdJ1fv67Yf++2dz3D726oO3QCu8iNYik4fb5YuuReOI9OtA+n7Mk0xyQivNTPbl181s+5oZ38gyA==", "cpu": [ "arm" ], @@ -2288,9 +2288,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.17.tgz", - "integrity": "sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.12.tgz", + "integrity": "sha512-cK3AjkEc+8v8YG02hYLQIQlOznW+v9N+OI9BAFuyqkfQFR+DnDLhEM5N8QRxAUz99cJTo1rLNXqRrvY15gbQUg==", "cpu": [ "arm64" ], @@ -2304,9 +2304,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.17.tgz", - "integrity": "sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.12.tgz", + "integrity": "sha512-jdOBXJqcgHlah/nYHnj3Hrnl9l63RjtQ4vn9+bohjQPI2QafASB5MtHAoEv0JQHVb/xYQTFOeuHnNYE1zF7tYw==", "cpu": [ "ia32" ], @@ -2320,9 +2320,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.17.tgz", - "integrity": "sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.12.tgz", + "integrity": "sha512-GTOEtj8h9qPKXCyiBBnHconSCV9LwFyx/gv3Phw0pa25qPYjVuuGZ4Dk14bGCfGX3qKF0+ceeQvwmtI+aYBbVA==", "cpu": [ "loong64" ], @@ -2336,9 +2336,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.17.tgz", - "integrity": "sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.12.tgz", + "integrity": "sha512-o8CIhfBwKcxmEENOH9RwmUejs5jFiNoDw7YgS0EJTF6kgPgcqLFjgoc5kDey5cMHRVCIWc6kK2ShUePOcc7RbA==", "cpu": [ "mips64el" ], @@ -2352,9 +2352,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.17.tgz", - "integrity": "sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.12.tgz", + "integrity": "sha512-biMLH6NR/GR4z+ap0oJYb877LdBpGac8KfZoEnDiBKd7MD/xt8eaw1SFfYRUeMVx519kVkAOL2GExdFmYnZx3A==", "cpu": [ "ppc64" ], @@ -2368,9 +2368,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.17.tgz", - "integrity": "sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.12.tgz", + "integrity": "sha512-jkphYUiO38wZGeWlfIBMB72auOllNA2sLfiZPGDtOBb1ELN8lmqBrlMiucgL8awBw1zBXN69PmZM6g4yTX84TA==", "cpu": [ "riscv64" ], @@ -2384,9 +2384,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.17.tgz", - "integrity": "sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.12.tgz", + "integrity": "sha512-j3ucLdeY9HBcvODhCY4b+Ds3hWGO8t+SAidtmWu/ukfLLG/oYDMaA+dnugTVAg5fnUOGNbIYL9TOjhWgQB8W5g==", "cpu": [ "s390x" ], @@ -2400,9 +2400,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.17.tgz", - "integrity": "sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.12.tgz", + "integrity": "sha512-uo5JL3cgaEGotaqSaJdRfFNSCUJOIliKLnDGWaVCgIKkHxwhYMm95pfMbWZ9l7GeW9kDg0tSxcy9NYdEtjwwmA==", "cpu": [ "x64" ], @@ -2416,9 +2416,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.17.tgz", - "integrity": "sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.12.tgz", + "integrity": "sha512-DNdoRg8JX+gGsbqt2gPgkgb00mqOgOO27KnrWZtdABl6yWTST30aibGJ6geBq3WM2TIeW6COs5AScnC7GwtGPg==", "cpu": [ "x64" ], @@ -2432,9 +2432,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.17.tgz", - "integrity": "sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.12.tgz", + "integrity": "sha512-aVsENlr7B64w8I1lhHShND5o8cW6sB9n9MUtLumFlPhG3elhNWtE7M1TFpj3m7lT3sKQUMkGFjTQBrvDDO1YWA==", "cpu": [ "x64" ], @@ -2448,9 +2448,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.17.tgz", - "integrity": "sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.12.tgz", + "integrity": "sha512-qbHGVQdKSwi0JQJuZznS4SyY27tYXYF0mrgthbxXrZI3AHKuRvU+Eqbg/F0rmLDpW/jkIZBlCO1XfHUBMNJ1pg==", "cpu": [ "x64" ], @@ -2464,9 +2464,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.17.tgz", - "integrity": "sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.12.tgz", + "integrity": "sha512-zsCp8Ql+96xXTVTmm6ffvoTSZSV2B/LzzkUXAY33F/76EajNw1m+jZ9zPfNJlJ3Rh4EzOszNDHsmG/fZOhtqDg==", "cpu": [ "arm64" ], @@ -2480,9 +2480,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.17.tgz", - "integrity": "sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.12.tgz", + "integrity": "sha512-FfrFjR4id7wcFYOdqbDfDET3tjxCozUgbqdkOABsSFzoZGFC92UK7mg4JKRc/B3NNEf1s2WHxJ7VfTdVDPN3ng==", "cpu": [ "ia32" ], @@ -2496,9 +2496,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.17.tgz", - "integrity": "sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.12.tgz", + "integrity": "sha512-JOOxw49BVZx2/5tW3FqkdjSD/5gXYeVGPDcB0lvap0gLQshkh1Nyel1QazC+wNxus3xPlsYAgqU1BUmrmCvWtw==", "cpu": [ "x64" ], @@ -3711,9 +3711,9 @@ } }, "node_modules/esbuild": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.17.tgz", - "integrity": "sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.12.tgz", + "integrity": "sha512-bX/zHl7Gn2CpQwcMtRogTTBf9l1nl+H6R8nUbjk+RuKqAE3+8FDulLA+pHvX7aA7Xe07Iwa+CWvy9I8Y2qqPKQ==", "dev": true, "hasInstallScript": true, "bin": { @@ -3723,28 +3723,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.16.17", - "@esbuild/android-arm64": "0.16.17", - "@esbuild/android-x64": "0.16.17", - "@esbuild/darwin-arm64": "0.16.17", - "@esbuild/darwin-x64": "0.16.17", - "@esbuild/freebsd-arm64": "0.16.17", - "@esbuild/freebsd-x64": "0.16.17", - "@esbuild/linux-arm": "0.16.17", - "@esbuild/linux-arm64": "0.16.17", - "@esbuild/linux-ia32": "0.16.17", - "@esbuild/linux-loong64": "0.16.17", - "@esbuild/linux-mips64el": "0.16.17", - "@esbuild/linux-ppc64": "0.16.17", - "@esbuild/linux-riscv64": "0.16.17", - "@esbuild/linux-s390x": "0.16.17", - "@esbuild/linux-x64": "0.16.17", - "@esbuild/netbsd-x64": "0.16.17", - "@esbuild/openbsd-x64": "0.16.17", - "@esbuild/sunos-x64": "0.16.17", - "@esbuild/win32-arm64": "0.16.17", - "@esbuild/win32-ia32": "0.16.17", - "@esbuild/win32-x64": "0.16.17" + "@esbuild/android-arm": "0.17.12", + "@esbuild/android-arm64": "0.17.12", + "@esbuild/android-x64": "0.17.12", + "@esbuild/darwin-arm64": "0.17.12", + "@esbuild/darwin-x64": "0.17.12", + "@esbuild/freebsd-arm64": "0.17.12", + "@esbuild/freebsd-x64": "0.17.12", + "@esbuild/linux-arm": "0.17.12", + "@esbuild/linux-arm64": "0.17.12", + "@esbuild/linux-ia32": "0.17.12", + "@esbuild/linux-loong64": "0.17.12", + "@esbuild/linux-mips64el": "0.17.12", + "@esbuild/linux-ppc64": "0.17.12", + "@esbuild/linux-riscv64": "0.17.12", + "@esbuild/linux-s390x": "0.17.12", + "@esbuild/linux-x64": "0.17.12", + "@esbuild/netbsd-x64": "0.17.12", + "@esbuild/openbsd-x64": "0.17.12", + "@esbuild/sunos-x64": "0.17.12", + "@esbuild/win32-arm64": "0.17.12", + "@esbuild/win32-ia32": "0.17.12", + "@esbuild/win32-x64": "0.17.12" } }, "node_modules/escalade": { @@ -5993,9 +5993,9 @@ } }, "node_modules/rollup": { - "version": "3.12.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.12.1.tgz", - "integrity": "sha512-t9elERrz2i4UU9z7AwISj3CQcXP39cWxgRWLdf4Tm6aKm1eYrqHIgjzXBgb67GNY1sZckTFFi0oMozh3/S++Ig==", + "version": "3.19.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.19.1.tgz", + "integrity": "sha512-lAbrdN7neYCg/8WaoWn/ckzCtz+jr70GFfYdlf50OF7387HTg+wiuiqJRFYawwSPpqfqDNYqK7smY/ks2iAudg==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -6630,15 +6630,15 @@ } }, "node_modules/vite": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.1.4.tgz", - "integrity": "sha512-3knk/HsbSTKEin43zHu7jTwYWv81f8kgAL99G5NWBcA1LKvtvcVAC4JjBH1arBunO9kQka+1oGbrMKOjk4ZrBg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.2.0.tgz", + "integrity": "sha512-AbDTyzzwuKoRtMIRLGNxhLRuv1FpRgdIw+1y6AQG73Q5+vtecmvzKo/yk8X/vrHDpETRTx01ABijqUHIzBXi0g==", "dev": true, "dependencies": { - "esbuild": "^0.16.14", + "esbuild": "^0.17.5", "postcss": "^8.4.21", "resolve": "^1.22.1", - "rollup": "^3.10.0" + "rollup": "^3.18.0" }, "bin": { "vite": "bin/vite.js" @@ -8569,156 +8569,156 @@ "requires": {} }, "@esbuild/android-arm": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.17.tgz", - "integrity": "sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.12.tgz", + "integrity": "sha512-E/sgkvwoIfj4aMAPL2e35VnUJspzVYl7+M1B2cqeubdBhADV4uPon0KCc8p2G+LqSJ6i8ocYPCqY3A4GGq0zkQ==", "dev": true, "optional": true }, "@esbuild/android-arm64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.17.tgz", - "integrity": "sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.12.tgz", + "integrity": "sha512-WQ9p5oiXXYJ33F2EkE3r0FRDFVpEdcDiwNX3u7Xaibxfx6vQE0Sb8ytrfQsA5WO6kDn6mDfKLh6KrPBjvkk7xA==", "dev": true, "optional": true }, "@esbuild/android-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.17.tgz", - "integrity": "sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.12.tgz", + "integrity": "sha512-m4OsaCr5gT+se25rFPHKQXARMyAehHTQAz4XX1Vk3d27VtqiX0ALMBPoXZsGaB6JYryCLfgGwUslMqTfqeLU0w==", "dev": true, "optional": true }, "@esbuild/darwin-arm64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.17.tgz", - "integrity": "sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.12.tgz", + "integrity": "sha512-O3GCZghRIx+RAN0NDPhyyhRgwa19MoKlzGonIb5hgTj78krqp9XZbYCvFr9N1eUxg0ZQEpiiZ4QvsOQwBpP+lg==", "dev": true, "optional": true }, "@esbuild/darwin-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.17.tgz", - "integrity": "sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.12.tgz", + "integrity": "sha512-5D48jM3tW27h1qjaD9UNRuN+4v0zvksqZSPZqeSWggfMlsVdAhH3pwSfQIFJwcs9QJ9BRibPS4ViZgs3d2wsCA==", "dev": true, "optional": true }, "@esbuild/freebsd-arm64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.17.tgz", - "integrity": "sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.12.tgz", + "integrity": "sha512-OWvHzmLNTdF1erSvrfoEBGlN94IE6vCEaGEkEH29uo/VoONqPnoDFfShi41Ew+yKimx4vrmmAJEGNoyyP+OgOQ==", "dev": true, "optional": true }, "@esbuild/freebsd-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.17.tgz", - "integrity": "sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.12.tgz", + "integrity": "sha512-A0Xg5CZv8MU9xh4a+7NUpi5VHBKh1RaGJKqjxe4KG87X+mTjDE6ZvlJqpWoeJxgfXHT7IMP9tDFu7IZ03OtJAw==", "dev": true, "optional": true }, "@esbuild/linux-arm": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.17.tgz", - "integrity": "sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.12.tgz", + "integrity": "sha512-WsHyJ7b7vzHdJ1fv67Yf++2dz3D726oO3QCu8iNYik4fb5YuuReOI9OtA+n7Mk0xyQivNTPbl181s+5oZ38gyA==", "dev": true, "optional": true }, "@esbuild/linux-arm64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.17.tgz", - "integrity": "sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.12.tgz", + "integrity": "sha512-cK3AjkEc+8v8YG02hYLQIQlOznW+v9N+OI9BAFuyqkfQFR+DnDLhEM5N8QRxAUz99cJTo1rLNXqRrvY15gbQUg==", "dev": true, "optional": true }, "@esbuild/linux-ia32": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.17.tgz", - "integrity": "sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.12.tgz", + "integrity": "sha512-jdOBXJqcgHlah/nYHnj3Hrnl9l63RjtQ4vn9+bohjQPI2QafASB5MtHAoEv0JQHVb/xYQTFOeuHnNYE1zF7tYw==", "dev": true, "optional": true }, "@esbuild/linux-loong64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.17.tgz", - "integrity": "sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.12.tgz", + "integrity": "sha512-GTOEtj8h9qPKXCyiBBnHconSCV9LwFyx/gv3Phw0pa25qPYjVuuGZ4Dk14bGCfGX3qKF0+ceeQvwmtI+aYBbVA==", "dev": true, "optional": true }, "@esbuild/linux-mips64el": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.17.tgz", - "integrity": "sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.12.tgz", + "integrity": "sha512-o8CIhfBwKcxmEENOH9RwmUejs5jFiNoDw7YgS0EJTF6kgPgcqLFjgoc5kDey5cMHRVCIWc6kK2ShUePOcc7RbA==", "dev": true, "optional": true }, "@esbuild/linux-ppc64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.17.tgz", - "integrity": "sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.12.tgz", + "integrity": "sha512-biMLH6NR/GR4z+ap0oJYb877LdBpGac8KfZoEnDiBKd7MD/xt8eaw1SFfYRUeMVx519kVkAOL2GExdFmYnZx3A==", "dev": true, "optional": true }, "@esbuild/linux-riscv64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.17.tgz", - "integrity": "sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.12.tgz", + "integrity": "sha512-jkphYUiO38wZGeWlfIBMB72auOllNA2sLfiZPGDtOBb1ELN8lmqBrlMiucgL8awBw1zBXN69PmZM6g4yTX84TA==", "dev": true, "optional": true }, "@esbuild/linux-s390x": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.17.tgz", - "integrity": "sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.12.tgz", + "integrity": "sha512-j3ucLdeY9HBcvODhCY4b+Ds3hWGO8t+SAidtmWu/ukfLLG/oYDMaA+dnugTVAg5fnUOGNbIYL9TOjhWgQB8W5g==", "dev": true, "optional": true }, "@esbuild/linux-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.17.tgz", - "integrity": "sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.12.tgz", + "integrity": "sha512-uo5JL3cgaEGotaqSaJdRfFNSCUJOIliKLnDGWaVCgIKkHxwhYMm95pfMbWZ9l7GeW9kDg0tSxcy9NYdEtjwwmA==", "dev": true, "optional": true }, "@esbuild/netbsd-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.17.tgz", - "integrity": "sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.12.tgz", + "integrity": "sha512-DNdoRg8JX+gGsbqt2gPgkgb00mqOgOO27KnrWZtdABl6yWTST30aibGJ6geBq3WM2TIeW6COs5AScnC7GwtGPg==", "dev": true, "optional": true }, "@esbuild/openbsd-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.17.tgz", - "integrity": "sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.12.tgz", + "integrity": "sha512-aVsENlr7B64w8I1lhHShND5o8cW6sB9n9MUtLumFlPhG3elhNWtE7M1TFpj3m7lT3sKQUMkGFjTQBrvDDO1YWA==", "dev": true, "optional": true }, "@esbuild/sunos-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.17.tgz", - "integrity": "sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.12.tgz", + "integrity": "sha512-qbHGVQdKSwi0JQJuZznS4SyY27tYXYF0mrgthbxXrZI3AHKuRvU+Eqbg/F0rmLDpW/jkIZBlCO1XfHUBMNJ1pg==", "dev": true, "optional": true }, "@esbuild/win32-arm64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.17.tgz", - "integrity": "sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.12.tgz", + "integrity": "sha512-zsCp8Ql+96xXTVTmm6ffvoTSZSV2B/LzzkUXAY33F/76EajNw1m+jZ9zPfNJlJ3Rh4EzOszNDHsmG/fZOhtqDg==", "dev": true, "optional": true }, "@esbuild/win32-ia32": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.17.tgz", - "integrity": "sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.12.tgz", + "integrity": "sha512-FfrFjR4id7wcFYOdqbDfDET3tjxCozUgbqdkOABsSFzoZGFC92UK7mg4JKRc/B3NNEf1s2WHxJ7VfTdVDPN3ng==", "dev": true, "optional": true }, "@esbuild/win32-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.17.tgz", - "integrity": "sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.12.tgz", + "integrity": "sha512-JOOxw49BVZx2/5tW3FqkdjSD/5gXYeVGPDcB0lvap0gLQshkh1Nyel1QazC+wNxus3xPlsYAgqU1BUmrmCvWtw==", "dev": true, "optional": true }, @@ -9646,33 +9646,33 @@ } }, "esbuild": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.17.tgz", - "integrity": "sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.12.tgz", + "integrity": "sha512-bX/zHl7Gn2CpQwcMtRogTTBf9l1nl+H6R8nUbjk+RuKqAE3+8FDulLA+pHvX7aA7Xe07Iwa+CWvy9I8Y2qqPKQ==", "dev": true, "requires": { - "@esbuild/android-arm": "0.16.17", - "@esbuild/android-arm64": "0.16.17", - "@esbuild/android-x64": "0.16.17", - "@esbuild/darwin-arm64": "0.16.17", - "@esbuild/darwin-x64": "0.16.17", - "@esbuild/freebsd-arm64": "0.16.17", - "@esbuild/freebsd-x64": "0.16.17", - "@esbuild/linux-arm": "0.16.17", - "@esbuild/linux-arm64": "0.16.17", - "@esbuild/linux-ia32": "0.16.17", - "@esbuild/linux-loong64": "0.16.17", - "@esbuild/linux-mips64el": "0.16.17", - "@esbuild/linux-ppc64": "0.16.17", - "@esbuild/linux-riscv64": "0.16.17", - "@esbuild/linux-s390x": "0.16.17", - "@esbuild/linux-x64": "0.16.17", - "@esbuild/netbsd-x64": "0.16.17", - "@esbuild/openbsd-x64": "0.16.17", - "@esbuild/sunos-x64": "0.16.17", - "@esbuild/win32-arm64": "0.16.17", - "@esbuild/win32-ia32": "0.16.17", - "@esbuild/win32-x64": "0.16.17" + "@esbuild/android-arm": "0.17.12", + "@esbuild/android-arm64": "0.17.12", + "@esbuild/android-x64": "0.17.12", + "@esbuild/darwin-arm64": "0.17.12", + "@esbuild/darwin-x64": "0.17.12", + "@esbuild/freebsd-arm64": "0.17.12", + "@esbuild/freebsd-x64": "0.17.12", + "@esbuild/linux-arm": "0.17.12", + "@esbuild/linux-arm64": "0.17.12", + "@esbuild/linux-ia32": "0.17.12", + "@esbuild/linux-loong64": "0.17.12", + "@esbuild/linux-mips64el": "0.17.12", + "@esbuild/linux-ppc64": "0.17.12", + "@esbuild/linux-riscv64": "0.17.12", + "@esbuild/linux-s390x": "0.17.12", + "@esbuild/linux-x64": "0.17.12", + "@esbuild/netbsd-x64": "0.17.12", + "@esbuild/openbsd-x64": "0.17.12", + "@esbuild/sunos-x64": "0.17.12", + "@esbuild/win32-arm64": "0.17.12", + "@esbuild/win32-ia32": "0.17.12", + "@esbuild/win32-x64": "0.17.12" } }, "escalade": { @@ -11215,9 +11215,9 @@ "dev": true }, "rollup": { - "version": "3.12.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.12.1.tgz", - "integrity": "sha512-t9elERrz2i4UU9z7AwISj3CQcXP39cWxgRWLdf4Tm6aKm1eYrqHIgjzXBgb67GNY1sZckTFFi0oMozh3/S++Ig==", + "version": "3.19.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.19.1.tgz", + "integrity": "sha512-lAbrdN7neYCg/8WaoWn/ckzCtz+jr70GFfYdlf50OF7387HTg+wiuiqJRFYawwSPpqfqDNYqK7smY/ks2iAudg==", "dev": true, "requires": { "fsevents": "~2.3.2" @@ -11669,16 +11669,16 @@ } }, "vite": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.1.4.tgz", - "integrity": "sha512-3knk/HsbSTKEin43zHu7jTwYWv81f8kgAL99G5NWBcA1LKvtvcVAC4JjBH1arBunO9kQka+1oGbrMKOjk4ZrBg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.2.0.tgz", + "integrity": "sha512-AbDTyzzwuKoRtMIRLGNxhLRuv1FpRgdIw+1y6AQG73Q5+vtecmvzKo/yk8X/vrHDpETRTx01ABijqUHIzBXi0g==", "dev": true, "requires": { - "esbuild": "^0.16.14", + "esbuild": "^0.17.5", "fsevents": "~2.3.2", "postcss": "^8.4.21", "resolve": "^1.22.1", - "rollup": "^3.10.0" + "rollup": "^3.18.0" } }, "vite-plugin-generate-file": { diff --git a/package.json b/package.json index 9ecb0ef5..8bde3f80 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "postcss-dark-theme-class": "~0.7.3", "postcss-preset-env": "~8.0.1", "twitter-text": "~3.1.0", - "vite": "~4.1.4", + "vite": "~4.2.0", "vite-plugin-generate-file": "~0.0.4", "vite-plugin-html-config": "~1.0.11", "vite-plugin-html-env": "~1.2.7", From 86ec30852c89437e2327ae0fdd22a5a5c11c1d41 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 18 Mar 2023 21:51:27 +0800 Subject: [PATCH 13/94] Don't need vite-plugin-html-env anymore --- compose/index.html | 2 +- index.html | 12 ++++++------ package-lock.json | 20 -------------------- package.json | 1 - vite.config.js | 2 -- 5 files changed, 7 insertions(+), 30 deletions(-) diff --git a/compose/index.html b/compose/index.html index 604e06b0..c4b3d5a1 100644 --- a/compose/index.html +++ b/compose/index.html @@ -4,7 +4,7 @@ - Compose / Phanpy + Compose / %VITE_CLIENT_NAME% diff --git a/index.html b/index.html index a18f8685..c0103ab8 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" /> - <{ VITE_CLIENT_NAME }> + %VITE_CLIENT_NAME% - + - + - - + + - +
diff --git a/package-lock.json b/package-lock.json index a5798425..c7b9f4f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,6 @@ "vite": "~4.2.0", "vite-plugin-generate-file": "~0.0.4", "vite-plugin-html-config": "~1.0.11", - "vite-plugin-html-env": "~1.2.7", "vite-plugin-pwa": "~0.14.4", "vite-plugin-remove-console": "~2.1.0", "workbox-cacheable-response": "~6.5.4", @@ -6772,18 +6771,6 @@ "vite": ">=2.0.0" } }, - "node_modules/vite-plugin-html-env": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/vite-plugin-html-env/-/vite-plugin-html-env-1.2.7.tgz", - "integrity": "sha512-vdTnKtuBeB8Zp93DCbN0Qjf4odW2msVRq45r7lGKA6nwQGJFj6YemU54u3xPPkvDeZhG8DEEU64xbLwzVEBilQ==", - "dev": true, - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "vite": "*" - } - }, "node_modules/vite-plugin-pwa": { "version": "0.14.4", "resolved": "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-0.14.4.tgz", @@ -11751,13 +11738,6 @@ "dev": true, "requires": {} }, - "vite-plugin-html-env": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/vite-plugin-html-env/-/vite-plugin-html-env-1.2.7.tgz", - "integrity": "sha512-vdTnKtuBeB8Zp93DCbN0Qjf4odW2msVRq45r7lGKA6nwQGJFj6YemU54u3xPPkvDeZhG8DEEU64xbLwzVEBilQ==", - "dev": true, - "requires": {} - }, "vite-plugin-pwa": { "version": "0.14.4", "resolved": "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-0.14.4.tgz", diff --git a/package.json b/package.json index 8bde3f80..2f914599 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,6 @@ "vite": "~4.2.0", "vite-plugin-generate-file": "~0.0.4", "vite-plugin-html-config": "~1.0.11", - "vite-plugin-html-env": "~1.2.7", "vite-plugin-pwa": "~0.14.4", "vite-plugin-remove-console": "~2.1.0", "workbox-cacheable-response": "~6.5.4", diff --git a/vite.config.js b/vite.config.js index 1998c922..9e86bf24 100644 --- a/vite.config.js +++ b/vite.config.js @@ -5,7 +5,6 @@ import { resolve } from 'path'; import { defineConfig, loadEnv, splitVendorChunkPlugin } from 'vite'; import generateFile from 'vite-plugin-generate-file'; import htmlPlugin from 'vite-plugin-html-config'; -import VitePluginHtmlEnv from 'vite-plugin-html-env'; import { VitePWA } from 'vite-plugin-pwa'; import removeConsole from 'vite-plugin-remove-console'; @@ -31,7 +30,6 @@ export default defineConfig({ plugins: [ preact(), splitVendorChunkPlugin(), - VitePluginHtmlEnv(), removeConsole({ includes: ['log', 'debug', 'info', 'warn', 'error'], }), From d9b9c04ec0bdd465ea3c7978933b48d83e84bf9d Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 18 Mar 2023 22:25:02 +0800 Subject: [PATCH 14/94] Fix pinned statuses gone missing --- src/pages/account-statuses.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/account-statuses.jsx b/src/pages/account-statuses.jsx index 95c57d81..19b9cacb 100644 --- a/src/pages/account-statuses.jsx +++ b/src/pages/account-statuses.jsx @@ -28,6 +28,7 @@ function AccountStatuses() { if (pinnedStatuses?.length) { pinnedStatuses.forEach((status) => { status._pinned = true; + saveStatus(status, instance); }); if (pinnedStatuses.length >= 3) { const pinnedStatusesIds = pinnedStatuses.map((status) => status.id); From 9d2cc6942cda3be22eb6293c9bf9127b2173f4a0 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 18 Mar 2023 22:59:19 +0800 Subject: [PATCH 15/94] Possibly fix menu not close-able --- src/components/account-info.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index 0b26aa0f..3938b1c0 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -482,6 +482,7 @@ function RelatedActions({ info, instance, authenticated }) { }, [info, authenticated]); const loading = relationshipUIState === 'loading'; + const menuInstanceRef = useRef(null); return ( <> @@ -521,6 +522,7 @@ function RelatedActions({ info, instance, authenticated }) { )}{' '} { + menuInstanceRef.current?.closeMenu?.(); + }, }} align="center" position="anchor" From ef874dd347ffc57c42f519f6788c30f2543c5e1f Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sun, 19 Mar 2023 13:38:40 +0800 Subject: [PATCH 16/94] More caching for alpha-detecting avatars --- src/components/avatar.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/avatar.jsx b/src/components/avatar.jsx index a9c2d9c4..c2aed8ab 100644 --- a/src/components/avatar.jsx +++ b/src/components/avatar.jsx @@ -43,6 +43,7 @@ function Avatar({ url, size, alt = '', ...props }) { }} onLoad={(e) => { if (avatarRef.current) avatarRef.current.dataset.loaded = true; + if (alphaCache[url] !== undefined) return; try { // Check if image has alpha channel const canvas = document.createElement('canvas'); @@ -65,8 +66,8 @@ function Avatar({ url, size, alt = '', ...props }) { if (hasAlpha) { // console.log('hasAlpha', hasAlpha, allPixels.data); avatarRef.current.classList.add('has-alpha'); - alphaCache[url] = true; } + alphaCache[url] = hasAlpha; } catch (e) { // Ignore } From 15551ec3c97b57fe8e1d36221604b1b6785074cd Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sun, 19 Mar 2023 15:04:42 +0800 Subject: [PATCH 17/94] Highlight language change in composer --- src/components/compose.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/compose.jsx b/src/components/compose.jsx index c6076604..194e3312 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -141,6 +141,7 @@ function Compose({ const [language, setLanguage] = useState( store.session.get('currentLanguage') || DEFAULT_LANG, ); + const prevLanguage = useRef(language); const [mediaAttachments, setMediaAttachments] = useState([]); const [poll, setPoll] = useState(null); @@ -1032,7 +1033,11 @@ function Compose({ {uiState !== 'loading' && ( )} -
From 458fb7bbbefb920723c4d87915d44629b9e27228 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sun, 19 Mar 2023 15:24:15 +0800 Subject: [PATCH 19/94] Turns out lastStatusAt is a date, no time --- src/components/account-info.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index 3938b1c0..9f7c3695 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -515,10 +515,15 @@ function RelatedActions({ info, instance, authenticated }) {

{followedBy ? ( Following you - ) : ( + ) : !!lastStatusAt ? ( - Last status: + Last status:{' '} + {niceDateTime(lastStatusAt, { + hideTime: true, + })} + ) : ( + )}{' '}

Date: Sun, 19 Mar 2023 20:12:45 +0800 Subject: [PATCH 20/94] Add Refresh menu item to Status page --- src/components/icon.jsx | 1 + src/pages/status.jsx | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/icon.jsx b/src/components/icon.jsx index 0529cd0d..9dc81fb7 100644 --- a/src/components/icon.jsx +++ b/src/components/icon.jsx @@ -72,6 +72,7 @@ const ICONS = { unblock: ['mingcute:forbid-circle-line', '180deg'], flag: 'mingcute:flag-4-line', time: 'mingcute:time-line', + refresh: 'mingcute:refresh-2-line', }; const modules = import.meta.glob('/node_modules/@iconify-icons/mingcute/*.js'); diff --git a/src/pages/status.jsx b/src/pages/status.jsx index 9135a10a..2692de26 100644 --- a/src/pages/status.jsx +++ b/src/pages/status.jsx @@ -1,6 +1,6 @@ import './status.css'; -import { Menu, MenuItem } from '@szhsin/react-menu'; +import { Menu, MenuDivider, MenuItem } from '@szhsin/react-menu'; import debounce from 'just-debounce-it'; import pRetry from 'p-retry'; import { useEffect, useMemo, useRef, useState } from 'preact/hooks'; @@ -562,6 +562,16 @@ function StatusPage() { } > + { + states.reloadStatusPage++; + }} + > + + Refresh + + { // Click all buttons with class .spoiler but not .spoiling From a792f494bf26b41be65ae894df8318296dae8fb0 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sun, 19 Mar 2023 21:08:09 +0800 Subject: [PATCH 21/94] Forgot to put the Play icon for audio media --- src/components/media.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/media.jsx b/src/components/media.jsx index 9d3fdcfc..6a447c16 100644 --- a/src/components/media.jsx +++ b/src/components/media.jsx @@ -204,6 +204,11 @@ function Media({ media, showOriginal, autoAnimate, onClick = () => {} }) { loading="lazy" /> ) : null} + {!showOriginal && ( +
+ +
+ )}
); } From ed1d475a1270e660265876df4559499470ca2ff9 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Mon, 20 Mar 2023 23:07:21 +0800 Subject: [PATCH 22/94] Fix .status conflicting with .notification.status Naming is hard --- src/pages/notifications.css | 2 +- src/pages/notifications.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/notifications.css b/src/pages/notifications.css index 2a33c215..0782e7b6 100644 --- a/src/pages/notifications.css +++ b/src/pages/notifications.css @@ -4,7 +4,7 @@ gap: 12px; animation: appear 0.2s ease-out; } -.notification.mention { +.notification.notification-mention { margin-top: 16px; } .only-mentions .notification:not(.mention), diff --git a/src/pages/notifications.jsx b/src/pages/notifications.jsx index 739ea1f9..ad82177a 100644 --- a/src/pages/notifications.jsx +++ b/src/pages/notifications.jsx @@ -318,7 +318,7 @@ function Notification({ notification, instance }) { : contentText[type]; return ( -
+
Date: Tue, 21 Mar 2023 15:52:26 +0800 Subject: [PATCH 23/94] Don't do anything to "missing" avatars --- src/components/avatar.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/avatar.jsx b/src/components/avatar.jsx index c2aed8ab..c8b7a962 100644 --- a/src/components/avatar.jsx +++ b/src/components/avatar.jsx @@ -16,6 +16,7 @@ const alphaCache = {}; function Avatar({ url, size, alt = '', ...props }) { size = SIZES[size] || size || SIZES.m; const avatarRef = useRef(); + const isMissing = /missing\.png$/.test(url); return ( { if (e.target.crossOrigin) { e.target.crossOrigin = null; @@ -44,6 +49,7 @@ function Avatar({ url, size, alt = '', ...props }) { onLoad={(e) => { if (avatarRef.current) avatarRef.current.dataset.loaded = true; if (alphaCache[url] !== undefined) return; + if (isMissing) return; try { // Check if image has alpha channel const canvas = document.createElement('canvas'); From a79d26ae907a4bc554c9a13a53988cf3f83d6660 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Tue, 21 Mar 2023 20:47:55 +0800 Subject: [PATCH 24/94] Fix invisible loader wrap to next line --- src/components/translation-block.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/translation-block.css b/src/components/translation-block.css index 4e3b0d3d..c36a50ec 100644 --- a/src/components/translation-block.css +++ b/src/components/translation-block.css @@ -58,8 +58,14 @@ 0 1px 5px -2px var(--drop-shadow-color); text-shadow: 0 1px var(--bg-color); } +.status-translation-block .translated-block .translation-info { + display: flex; + align-items: center; + gap: 8px; +} .status-translation-block .translated-block .translation-info * { vertical-align: middle; + flex-shrink: 0; } .status-translation-block .translated-source-select { appearance: none; @@ -71,6 +77,8 @@ background-color: var(--bg-faded-color); color: inherit; width: min-content; + min-width: 2em; + flex-shrink: 1 !important; } .status-translation-block .translated-block output { display: block; From b4177f0f760a5591947283931d9cd2344324fcac Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Tue, 21 Mar 2023 20:48:26 +0800 Subject: [PATCH 25/94] Fix translation block not clickable when inside a status link --- src/components/translation-block.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/translation-block.jsx b/src/components/translation-block.jsx index aa7b4479..161b778e 100644 --- a/src/components/translation-block.jsx +++ b/src/components/translation-block.jsx @@ -87,7 +87,12 @@ function TranslationBlock({ }, [forceTranslate]); return ( -
+
{ + e.preventDefault(); + }} + >
+ + +
+ + )} +
+ ); +} + export default memo(Status); diff --git a/src/components/timeline.jsx b/src/components/timeline.jsx index 47826cfa..0feb4d8f 100644 --- a/src/components/timeline.jsx +++ b/src/components/timeline.jsx @@ -28,6 +28,7 @@ function Timeline({ headerStart, headerEnd, timelineStart, + allowFilters, }) { const [items, setItems] = useState([]); const [uiState, setUIState] = useState('default'); @@ -310,6 +311,16 @@ function Timeline({ title = 'Pinned posts'; } if (items) { + // Here, we don't hide filtered posts, but we sort them last + items.sort((a, b) => { + if (a._filtered && !b._filtered) { + return 1; + } + if (!a._filtered && b._filtered) { + return -1; + } + return 0; + }); return (
  • @@ -352,9 +363,17 @@ function Timeline({
  • {useItemID ? ( - + ) : ( - + )}
  • diff --git a/src/pages/following.jsx b/src/pages/following.jsx index 4f3d03de..4032ed9e 100644 --- a/src/pages/following.jsx +++ b/src/pages/following.jsx @@ -3,6 +3,7 @@ import { useSnapshot } from 'valtio'; import Timeline from '../components/timeline'; import { api } from '../utils/api'; +import { filteredItems } from '../utils/filters'; import states from '../utils/states'; import { getStatus, saveStatus } from '../utils/states'; import useTitle from '../utils/useTitle'; @@ -21,12 +22,14 @@ function Following({ title, path, id, ...props }) { homeIterator.current = masto.v1.timelines.listHome({ limit: LIMIT }); } const results = await homeIterator.current.next(); - const { value } = results; + let { value } = results; if (value?.length) { if (firstLoad) { latestItem.current = value[0].id; + console.log('First load', latestItem.current); } + value = filteredItems(value, 'home'); value.forEach((item) => { saveStatus(item, instance); }); @@ -49,8 +52,9 @@ function Following({ title, path, id, ...props }) { since_id: latestItem.current, }) .next(); - const { value } = results; + let { value } = results; console.log('checkForUpdates', latestItem.current, value); + value = filteredItems(value, 'home'); if (value?.length && value.some((item) => !item.reblog)) { return true; } @@ -119,6 +123,7 @@ function Following({ title, path, id, ...props }) { useItemID boostsCarousel={snapStates.settings.boostsCarousel} {...props} + allowFilters /> ); } diff --git a/src/pages/list.jsx b/src/pages/list.jsx index 22f4a120..54c53c58 100644 --- a/src/pages/list.jsx +++ b/src/pages/list.jsx @@ -5,6 +5,7 @@ import Icon from '../components/icon'; import Link from '../components/link'; import Timeline from '../components/timeline'; import { api } from '../utils/api'; +import { filteredItems } from '../utils/filters'; import { saveStatus } from '../utils/states'; import useTitle from '../utils/useTitle'; @@ -23,12 +24,13 @@ function List(props) { }); } const results = await listIterator.current.next(); - const { value } = results; + let { value } = results; if (value?.length) { if (firstLoad) { latestItem.current = value[0].id; } + value = filteredItems(value, 'home'); value.forEach((item) => { saveStatus(item, instance); }); @@ -42,7 +44,8 @@ function List(props) { limit: 1, since_id: latestItem.current, }); - const { value } = results; + let { value } = results; + value = filteredItems(value, 'home'); if (value?.length) { return true; } @@ -76,6 +79,7 @@ function List(props) { checkForUpdates={checkForUpdates} useItemID boostsCarousel + allowFilters headerStart={ diff --git a/src/pages/public.jsx b/src/pages/public.jsx index 747da069..218eaf1a 100644 --- a/src/pages/public.jsx +++ b/src/pages/public.jsx @@ -6,6 +6,7 @@ import { useSnapshot } from 'valtio'; import Icon from '../components/icon'; import Timeline from '../components/timeline'; import { api } from '../utils/api'; +import { filteredItems } from '../utils/filters'; import states from '../utils/states'; import { saveStatus } from '../utils/states'; import useTitle from '../utils/useTitle'; @@ -33,12 +34,13 @@ function Public({ local, ...props }) { }); } const results = await publicIterator.current.next(); - const { value } = results; + let { value } = results; if (value?.length) { if (firstLoad) { latestItem.current = value[0].id; } + value = filteredItems(value, 'public'); value.forEach((item) => { saveStatus(item, instance); }); @@ -55,7 +57,8 @@ function Public({ local, ...props }) { since_id: latestItem.current, }) .next(); - const { value } = results; + let { value } = results; + value = filteredItems(value, 'public'); if (value?.length) { return true; } @@ -84,6 +87,7 @@ function Public({ local, ...props }) { useItemID headerStart={<>} boostsCarousel={snapStates.settings.boostsCarousel} + allowFilters headerEnd={ { if (!heroStatus) return ''; - const { spoilerText, content } = heroStatus; - let text; - if (spoilerText) { - text = spoilerText; - } else { - const div = document.createElement('div'); - div.innerHTML = content; - text = div.innerText.trim(); - } + let text = statusPeek(heroStatus); if (text.length > 64) { // "The title should ideally be less than 64 characters in length" // https://www.w3.org/Provider/Style/TITLE.html diff --git a/src/utils/filters.jsx b/src/utils/filters.jsx new file mode 100644 index 00000000..eda2d3fb --- /dev/null +++ b/src/utils/filters.jsx @@ -0,0 +1,34 @@ +import store from './store'; + +export function filteredItem(item, filterContext, currentAccountID) { + const { filtered } = item; + if (!filtered?.length) return true; + const isSelf = currentAccountID && item.account?.id === currentAccountID; + if (isSelf) return true; + const appliedFilters = filtered.filter((f) => { + const { filter } = f; + const hasContext = filter.context.includes(filterContext); + if (!hasContext) return false; + if (!filter.expiresAt) return hasContext; + return new Date(filter.expiresAt) > new Date(); + }); + const isHidden = appliedFilters.some((f) => f.filter.filterAction === 'hide'); + console.log({ isHidden, filtered, appliedFilters }); + if (!isHidden) { + const filterTitles = appliedFilters.map((f) => f.filter.title); + item._filtered = { + titles: filterTitles, + titlesStr: filterTitles.join(' • '), + }; + item._test = { test: 'test' }; + } + return !isHidden; +} +export function filteredItems(items, filterContext) { + if (!items?.length) return []; + if (!filterContext) return items; + const currentAccountID = store.session.get('currentAccount'); + return items.filter((item) => + filteredItem(item, filterContext, currentAccountID), + ); +} diff --git a/src/utils/states.js b/src/utils/states.js index a6cfead2..fbe3aff4 100644 --- a/src/utils/states.js +++ b/src/utils/states.js @@ -114,8 +114,11 @@ export function saveStatus(status, instance, opts) { opts, ); if (!status) return; - if (!override && getStatus(status.id)) return; + const oldStatus = getStatus(status.id, instance); + if (!override && oldStatus) return; const key = statusKey(status.id, instance); + if (oldStatus?._pinned) status._pinned = oldStatus._pinned; + if (oldStatus?._filtered) status._filtered = oldStatus._filtered; states.statuses[key] = status; if (status.reblog) { const key = statusKey(status.reblog.id, instance); diff --git a/src/utils/status-peek.jsx b/src/utils/status-peek.jsx new file mode 100644 index 00000000..2e3b084e --- /dev/null +++ b/src/utils/status-peek.jsx @@ -0,0 +1,34 @@ +import { getHTMLText } from '../components/status'; + +function statusPeek(status) { + const { spoilerText, content, poll, mediaAttachments } = status; + let text = ''; + if (spoilerText?.trim()) { + text += spoilerText; + } else { + text += getHTMLText(content); + } + text = text.trim(); + if (poll) { + text += ' 📊'; + } + if (mediaAttachments?.length) { + text += + ' ' + + mediaAttachments + .map( + (m) => + ({ + image: '🖼️', + gifv: '🎞️', + video: '📹', + audio: '🎵', + unknown: '', + }[m.type] || ''), + ) + .join(''); + } + return text; +} + +export default statusPeek; From b8ec7d3c51db3087147a520b0640fc154d6ba501 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 22 Mar 2023 12:26:28 +0800 Subject: [PATCH 28/94] Show small hints of filter titles --- src/components/status.css | 27 ++++++++++++++++++++++++++- src/components/status.jsx | 5 +++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/components/status.css b/src/components/status.css index feaae368..f7bff63f 100644 --- a/src/components/status.css +++ b/src/components/status.css @@ -245,7 +245,6 @@ } .status-filtered-badge { flex-shrink: 0; - display: inline-block; color: var(--text-insignificant-color); /* background: var(--bg-faded-color); */ /* border: var(--hairline-width) solid var(--bg-color); */ @@ -257,6 +256,15 @@ text-transform: uppercase; font-weight: bold; vertical-align: middle; + display: inline-block; +} +.status-filtered-badge.badge-meta { + display: inline-flex; + flex-direction: column; + position: relative; + top: calc((9px + 2px) / 2 * -1); + min-width: 50px; + text-align: center; } .status-filtered-badge.clickable:hover { cursor: pointer; @@ -264,6 +272,23 @@ border-color: var(--text-color); background: var(--bg-color); } +.status-filtered-badge.badge-meta > span:first-child { + white-space: nowrap; +} +.status-filtered-badge.badge-meta > span + span { + display: block; + font-size: 9px; + font-weight: normal; + text-transform: none; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + position: absolute; + width: 100%; + top: calc(100% + 2px); + left: 0; + text-align: center; +} .status.large .content-container { margin-left: calc(-50px - 16px); diff --git a/src/components/status.jsx b/src/components/status.jsx index c7c9b736..4a0e9542 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -1735,14 +1735,15 @@ function FilteredStatus({ status, filterInfo, instance }) { >
    { e.preventDefault(); setShowPeek(true); }} > - Filtered + Filtered + {filterTitleStr} {' '} From d86023facd3befa2383364c625af20e4851cd510 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 22 Mar 2023 14:11:38 +0800 Subject: [PATCH 29/94] Fix submenu not opening --- src/components/account-info.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index 9f7c3695..87d45191 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -536,8 +536,10 @@ function RelatedActions({ info, instance, authenticated }) { // Higher than the backdrop zIndex: 1001, }, - onClick: () => { - menuInstanceRef.current?.closeMenu?.(); + onClick: (e) => { + if (e.target === e.currentTarget) { + menuInstanceRef.current?.closeMenu?.(); + } }, }} align="center" From 0f5a98e42fb6cd230dfbe1c4c8612eccab785e48 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 22 Mar 2023 14:16:41 +0800 Subject: [PATCH 30/94] Remove context menu from statuses inside Edit History sheet --- src/components/status.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/status.jsx b/src/components/status.jsx index 4a0e9542..95a4b79d 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -1479,6 +1479,7 @@ function EditedAtModal({ size="s" withinContext readOnly + previewMode /> ); From bd3ca460a92d021b27525275155d5b7514d155fc Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 22 Mar 2023 20:59:58 +0800 Subject: [PATCH 31/94] Upgrade vite --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index c7b9f4f3..859704f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "postcss-dark-theme-class": "~0.7.3", "postcss-preset-env": "~8.0.1", "twitter-text": "~3.1.0", - "vite": "~4.2.0", + "vite": "~4.2.1", "vite-plugin-generate-file": "~0.0.4", "vite-plugin-html-config": "~1.0.11", "vite-plugin-pwa": "~0.14.4", @@ -6629,9 +6629,9 @@ } }, "node_modules/vite": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.2.0.tgz", - "integrity": "sha512-AbDTyzzwuKoRtMIRLGNxhLRuv1FpRgdIw+1y6AQG73Q5+vtecmvzKo/yk8X/vrHDpETRTx01ABijqUHIzBXi0g==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.2.1.tgz", + "integrity": "sha512-7MKhqdy0ISo4wnvwtqZkjke6XN4taqQ2TBaTccLIpOKv7Vp2h4Y+NpmWCnGDeSvvn45KxvWgGyb0MkHvY1vgbg==", "dev": true, "dependencies": { "esbuild": "^0.17.5", @@ -11656,9 +11656,9 @@ } }, "vite": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.2.0.tgz", - "integrity": "sha512-AbDTyzzwuKoRtMIRLGNxhLRuv1FpRgdIw+1y6AQG73Q5+vtecmvzKo/yk8X/vrHDpETRTx01ABijqUHIzBXi0g==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.2.1.tgz", + "integrity": "sha512-7MKhqdy0ISo4wnvwtqZkjke6XN4taqQ2TBaTccLIpOKv7Vp2h4Y+NpmWCnGDeSvvn45KxvWgGyb0MkHvY1vgbg==", "dev": true, "requires": { "esbuild": "^0.17.5", diff --git a/package.json b/package.json index 2f914599..618d56dd 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "postcss-dark-theme-class": "~0.7.3", "postcss-preset-env": "~8.0.1", "twitter-text": "~3.1.0", - "vite": "~4.2.0", + "vite": "~4.2.1", "vite-plugin-generate-file": "~0.0.4", "vite-plugin-html-config": "~1.0.11", "vite-plugin-pwa": "~0.14.4", From 668acdcf0b23a9aaecb358e57b8023108093c4d6 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 22 Mar 2023 21:01:03 +0800 Subject: [PATCH 32/94] Disable rollup's treeshake It eliminated all code under this line https://github.com/github/text-expander-element/blob/5b5f7ad1056327f1d297be8474fb689089115cb9/src/text-expander-element.ts#L124 --- vite.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/vite.config.js b/vite.config.js index 9e86bf24..2c74ec55 100644 --- a/vite.config.js +++ b/vite.config.js @@ -86,6 +86,7 @@ export default defineConfig({ build: { sourcemap: true, rollupOptions: { + treeshake: false, input: { main: resolve(__dirname, 'index.html'), compose: resolve(__dirname, 'compose/index.html'), From 5f15c5e659305a2bee2074bcccb94e0bee3d8254 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 22 Mar 2023 21:32:06 +0800 Subject: [PATCH 33/94] Huh this actually works --- src/components/status.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/status.css b/src/components/status.css index f7bff63f..1b9e34c8 100644 --- a/src/components/status.css +++ b/src/components/status.css @@ -534,6 +534,7 @@ body:has(#modal-container .carousel) .status .media img:hover { width: 100%; height: 100%; object-fit: contain; + border-radius: inherit; } .status :is(.media-video, .media-audio, .media-gif) { position: relative; From 5be648119611ce54a573db389b9c407664b4e8d8 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 23 Mar 2023 09:50:42 +0800 Subject: [PATCH 34/94] Forgot to pass allowFilters from timeline --- src/components/timeline.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/timeline.jsx b/src/components/timeline.jsx index 0feb4d8f..4d37e6c7 100644 --- a/src/components/timeline.jsx +++ b/src/components/timeline.jsx @@ -366,13 +366,13 @@ function Timeline({ ) : ( )} From e6da22a1e090f50f2c5782e3cc9ff877117a9962 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 23 Mar 2023 09:51:52 +0800 Subject: [PATCH 35/94] Nav Menu show avatar if multiple accounts Accounts sheet default to 'switch' when click on account --- src/app.css | 25 +++++++++++++++++++++ src/components/menu.jsx | 48 +++++++++++++++++++++++++++++++++++------ src/pages/accounts.jsx | 42 +++++++++++++++++++----------------- 3 files changed, 89 insertions(+), 26 deletions(-) diff --git a/src/app.css b/src/app.css index 954fa9e3..36341f8a 100644 --- a/src/app.css +++ b/src/app.css @@ -1433,6 +1433,31 @@ ul.link-list li a .icon { } } +/* NAV MENU BUTTON */ + +.nav-menu-button.with-avatar { + position: relative; +} +.nav-menu-button:is(:hover, :focus):not(:active) { + filter: none !important; +} +.nav-menu-button .avatar { + transition: box-shadow 0.3s ease-out; +} +.nav-menu-button:is(:hover, :focus, .active) .avatar { + box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 4px var(--link-light-color); +} +.nav-menu-button.with-avatar .icon { + position: absolute; + bottom: 4px; + right: 8px; + background-color: var(--bg-color); + border-radius: 2px; +} +.nav-menu-button.with-avatar:hover:not(:active, .active) .icon { + transform: translateY(-1px); +} + /* COLUMNS */ #columns { diff --git a/src/components/menu.jsx b/src/components/menu.jsx index bca5dcb5..c3420417 100644 --- a/src/components/menu.jsx +++ b/src/components/menu.jsx @@ -1,17 +1,23 @@ import { Menu, MenuDivider, MenuItem } from '@szhsin/react-menu'; +import { useLongPress } from 'use-long-press'; import { useSnapshot } from 'valtio'; import { api } from '../utils/api'; import states from '../utils/states'; -import { getCurrentAccount } from '../utils/store-utils'; +import store from '../utils/store'; +import Avatar from './avatar'; import Icon from './icon'; import MenuLink from './MenuLink'; function NavMenu(props) { const snapStates = useSnapshot(states); const { instance, authenticated } = api(); - const currentAccount = getCurrentAccount(); + const accounts = store.local.getJSON('accounts'); + const currentAccount = accounts.find( + (account) => account.info.id === store.session.get('currentAccount'), + ); + const moreThanOneAccount = accounts.length > 1; // Home = Following // But when in multi-column mode, Home becomes columns of anything @@ -21,6 +27,16 @@ function NavMenu(props) { snapStates.settings.shortcutsColumnsMode && !snapStates.shortcuts.find((pin) => pin.type === 'following'); + const bindLongPress = useLongPress( + () => { + states.showAccounts = true; + }, + { + detect: 'touch', + cancelOnMovement: true, + }, + ); + return ( - + menuButton={({ open }) => ( + - } + )} > {!!snapStates.appVersion?.commitHash && __COMMIT_HASH__ !== snapStates.appVersion.commitHash && ( diff --git a/src/pages/accounts.jsx b/src/pages/accounts.jsx index 0e617d9a..b7afc4fc 100644 --- a/src/pages/accounts.jsx +++ b/src/pages/accounts.jsx @@ -1,6 +1,6 @@ import './settings.css'; -import { Menu, MenuItem } from '@szhsin/react-menu'; +import { Menu, MenuDivider, MenuItem } from '@szhsin/react-menu'; import { useReducer, useState } from 'preact/hooks'; import Avatar from '../components/avatar'; @@ -25,11 +25,6 @@ function Accounts({ onClose }) {

    Accounts

    -
    - - Account - -
    @@ -66,7 +61,12 @@ function Accounts({ onClose }) { account={account.info} showAcct onClick={() => { - states.showAccount = `${account.info.username}@${account.instanceURL}`; + if (isCurrent) { + states.showAccount = `${account.info.username}@${account.instanceURL}`; + } else { + store.session.set('currentAccount', account.info.id); + location.reload(); + } }} />
    @@ -76,18 +76,6 @@ function Accounts({ onClose }) { Default{' '} )} - {!isCurrent && ( - - )} } > + { + states.showAccount = `${account.info.username}@${account.instanceURL}`; + }} + > + + View profile… + + {moreThanOneAccount && ( - Log out + Log out…
    @@ -135,6 +132,11 @@ function Accounts({ onClose }) { ); })} +

    + + Add an existing account + +

    {moreThanOneAccount && (

    From 982258304881a8da6fbcaac16a5378a59f076fad Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 23 Mar 2023 10:40:31 +0800 Subject: [PATCH 36/94] Fix text selection pops up when long-press filtered status --- src/components/status.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/status.css b/src/components/status.css index 1b9e34c8..a6121382 100644 --- a/src/components/status.css +++ b/src/components/status.css @@ -1100,6 +1100,12 @@ a.card:is(:hover, :focus) { /* FILTERED */ +#filtered-status-peek { + user-select: none; + -webkit-touch-callout: none; + -webkit-user-drag: none; +} + #filtered-status-peek main > p:first-child { margin-top: 0; } From 0f1b08b3ea31c0da111179b86f0a80d76671da34 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 23 Mar 2023 15:54:17 +0800 Subject: [PATCH 37/94] Very experimental handle "back" to close media modal Don't try this at home, kids --- src/components/media-modal.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/media-modal.jsx b/src/components/media-modal.jsx index 6c85b3dd..9fdb5b0f 100644 --- a/src/components/media-modal.jsx +++ b/src/components/media-modal.jsx @@ -22,6 +22,17 @@ function MediaModal({ const carouselFocusItem = useRef(null); useLayoutEffect(() => { carouselFocusItem.current?.scrollIntoView(); + + history.pushState({ mediaModal: true }, ''); + const handlePopState = (e) => { + if (e.state?.mediaModal) { + onClose(); + } + }; + window.addEventListener('popstate', handlePopState); + return () => { + window.removeEventListener('popstate', handlePopState); + }; }, []); const prevStatusID = useRef(statusID); useEffect(() => { From 9071439c12b45807b8b8d1067e9de93cb6b33070 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 23 Mar 2023 16:13:22 +0800 Subject: [PATCH 38/94] Adjust some layout stuff in composer --- src/components/compose.css | 17 +- src/components/compose.jsx | 1020 ++++++++++++++++++------------------ 2 files changed, 527 insertions(+), 510 deletions(-) diff --git a/src/components/compose.css b/src/components/compose.css index 62469c83..be7e038d 100644 --- a/src/components/compose.css +++ b/src/components/compose.css @@ -1,14 +1,18 @@ +#compose-container-outer { + width: 100%; + height: 100vh; + height: 100dvh; + overflow: auto; + align-self: flex-start; + padding: env(safe-area-inset-top) env(safe-area-inset-right) + env(safe-area-inset-bottom) env(safe-area-inset-left); +} #compose-container { + margin: auto; width: var(--main-width); max-width: 100vw; align-self: stretch; animation: fade-in 0.2s ease-out; - max-height: 100vh; - overflow: auto; -} -#compose-container.standalone { - max-height: none; - margin: auto; } #compose-container .compose-top { @@ -41,6 +45,7 @@ #compose-container textarea { font-size: 150%; font-size: calc(100% + 50% / var(--text-weight)); + max-height: 65vh; } } diff --git a/src/components/compose.jsx b/src/components/compose.jsx index 194e3312..8b45360b 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -498,182 +498,183 @@ function Compose({ }, [mediaAttachments]); return ( -

    -
    - {currentAccountInfo?.avatarStatic && ( - - )} - {!standalone ? ( - - {' '} - - - ) : ( - hasOpener && ( - {' '} + + + ) : ( + hasOpener && ( + - ) - )} -
    - {!!replyToStatus && ( -
    - -
    - Replying to @ - {replyToStatus.account.acct || replyToStatus.account.username} - ’s status + onClose({ + fn: () => { + const passData = { + editStatus, + replyToStatus, + draftStatus: { + uid: UID.current, + status: textareaRef.current.value, + spoilerText: spoilerTextRef.current.value, + visibility, + language, + sensitive, + poll, + mediaAttachments, + }, + }; + window.opener.__COMPOSE__ = passData; // Pass it here instead of `showCompose` due to some weird proxy issue again + window.opener.__STATES__.showCompose = true; + }, + }); + }} + > + + + ) + )} +
    + {!!replyToStatus && ( +
    + +
    + Replying to @ + {replyToStatus.account.acct || replyToStatus.account.username} + ’s status +
    -
    - )} - {!!editStatus && ( -
    - -
    Editing source status
    -
    - )} -
    { - if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) { - formRef.current.dispatchEvent( - new Event('submit', { cancelable: true }), - ); - } - }} - onSubmit={(e) => { - e.preventDefault(); + )} + {!!editStatus && ( +
    + +
    Editing source status
    +
    + )} + { + if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) { + formRef.current.dispatchEvent( + new Event('submit', { cancelable: true }), + ); + } + }} + onSubmit={(e) => { + e.preventDefault(); - const formData = new FormData(e.target); - const entries = Object.fromEntries(formData.entries()); - console.log('ENTRIES', entries); - let { status, visibility, sensitive, spoilerText } = entries; + const formData = new FormData(e.target); + const entries = Object.fromEntries(formData.entries()); + console.log('ENTRIES', entries); + let { status, visibility, sensitive, spoilerText } = entries; - // Pre-cleanup - sensitive = sensitive === 'on'; // checkboxes return "on" if checked + // Pre-cleanup + sensitive = sensitive === 'on'; // checkboxes return "on" if checked - // Validation - /* Let the backend validate this + // Validation + /* Let the backend validate this if (stringLength(status) > maxCharacters) { alert(`Status is too long! Max characters: ${maxCharacters}`); return; @@ -688,252 +689,170 @@ function Compose({ return; } */ - if (poll) { - if (poll.options.length < 2) { - alert('Poll must have at least 2 options'); - return; + if (poll) { + if (poll.options.length < 2) { + alert('Poll must have at least 2 options'); + return; + } + if (poll.options.some((option) => option === '')) { + alert('Some poll choices are empty'); + return; + } } - if (poll.options.some((option) => option === '')) { - alert('Some poll choices are empty'); - return; + // TODO: check for URLs and use `charactersReservedPerUrl` to calculate max characters + + if (mediaAttachments.length > 0) { + // If there are media attachments, check if they have no descriptions + const hasNoDescriptions = mediaAttachments.some( + (media) => !media.description?.trim?.(), + ); + if (hasNoDescriptions) { + const yes = confirm( + 'Some media have no descriptions. Continue?', + ); + if (!yes) return; + } } - } - // TODO: check for URLs and use `charactersReservedPerUrl` to calculate max characters - if (mediaAttachments.length > 0) { - // If there are media attachments, check if they have no descriptions - const hasNoDescriptions = mediaAttachments.some( - (media) => !media.description?.trim?.(), - ); - if (hasNoDescriptions) { - const yes = confirm('Some media have no descriptions. Continue?'); - if (!yes) return; - } - } + // Post-cleanup + spoilerText = (sensitive && spoilerText) || undefined; + status = status === '' ? undefined : status; - // Post-cleanup - spoilerText = (sensitive && spoilerText) || undefined; - status = status === '' ? undefined : status; - - setUIState('loading'); - (async () => { - try { - console.log('MEDIA ATTACHMENTS', mediaAttachments); - if (mediaAttachments.length > 0) { - // Upload media attachments first - const mediaPromises = mediaAttachments.map((attachment) => { - const { file, description, id } = attachment; - console.log('UPLOADING', attachment); - if (id) { - // If already uploaded - return attachment; - } else { - const params = removeNullUndefined({ - file, - description, - }); - return masto.v2.mediaAttachments - .create(params) - .then((res) => { - if (res.id) { - attachment.id = res.id; - } - return res; + setUIState('loading'); + (async () => { + try { + console.log('MEDIA ATTACHMENTS', mediaAttachments); + if (mediaAttachments.length > 0) { + // Upload media attachments first + const mediaPromises = mediaAttachments.map((attachment) => { + const { file, description, id } = attachment; + console.log('UPLOADING', attachment); + if (id) { + // If already uploaded + return attachment; + } else { + const params = removeNullUndefined({ + file, + description, }); - } - }); - const results = await Promise.allSettled(mediaPromises); - - // If any failed, return - if ( - results.some((result) => { - return result.status === 'rejected' || !result.value?.id; - }) - ) { - setUIState('error'); - // Alert all the reasons - results.forEach((result) => { - if (result.status === 'rejected') { - console.error(result); - alert(result.reason || `Attachment #${i} failed`); + return masto.v2.mediaAttachments + .create(params) + .then((res) => { + if (res.id) { + attachment.id = res.id; + } + return res; + }); } }); - return; + const results = await Promise.allSettled(mediaPromises); + + // If any failed, return + if ( + results.some((result) => { + return result.status === 'rejected' || !result.value?.id; + }) + ) { + setUIState('error'); + // Alert all the reasons + results.forEach((result) => { + if (result.status === 'rejected') { + console.error(result); + alert(result.reason || `Attachment #${i} failed`); + } + }); + return; + } + + console.log({ results, mediaAttachments }); } - console.log({ results, mediaAttachments }); - } - - /* NOTE: + /* NOTE: Using snakecase here because masto.js's `isObject` returns false for `params`, ONLY happens when opening in pop-out window. This is maybe due to `window.masto` variable being passed from the parent window. The check that failed is `x.constructor === Object`, so maybe the `Object` in new window is different than parent window's? Code: https://github.com/neet/masto.js/blob/dd0d649067b6a2b6e60fbb0a96597c373a255b00/src/serializers/is-object.ts#L2 */ - let params = { - status, - // spoilerText, - spoiler_text: spoilerText, - language, - sensitive, - poll, - // mediaIds: mediaAttachments.map((attachment) => attachment.id), - media_ids: mediaAttachments.map((attachment) => attachment.id), - }; - if (editStatus && supports('@mastodon/edit-media-attributes')) { - params.media_attributes = mediaAttachments.map((attachment) => { - return { - id: attachment.id, - description: attachment.description, - // focus - // thumbnail - }; - }); - } else if (!editStatus) { - params.visibility = visibility; - // params.inReplyToId = replyToStatus?.id || undefined; - params.in_reply_to_id = replyToStatus?.id || undefined; - } - params = removeNullUndefined(params); - console.log('POST', params); - - let newStatus; - if (editStatus) { - newStatus = await masto.v1.statuses.update( - editStatus.id, - params, - ); - saveStatus(newStatus, instance, { - skipThreading: true, - }); - } else { - newStatus = await masto.v1.statuses.create(params, { - idempotencyKey: UID.current, - }); - } - setUIState('default'); - - // Close - onClose({ - newStatus, - instance, - }); - } catch (e) { - console.error(e); - alert(e?.reason || e); - setUIState('error'); - } - })(); - }} - > -
    - { - updateCharCount(); - }} - /> -