mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-24 10:15:37 +03:00
Revert "Test upgrade react-hotkeys-hook for the keys fix"
This reverts commit 9285a0ba9a
.
This commit is contained in:
parent
44e910b8c9
commit
effbe189e1
18 changed files with 21 additions and 37 deletions
8
package-lock.json
generated
8
package-lock.json
generated
|
@ -31,7 +31,7 @@
|
|||
"p-throttle": "~6.1.0",
|
||||
"preact": "~10.20.1",
|
||||
"punycode": "~2.3.1",
|
||||
"react-hotkeys-hook": "~5.0.0-1",
|
||||
"react-hotkeys-hook": "~4.5.0",
|
||||
"react-intersection-observer": "~9.8.1",
|
||||
"react-quick-pinch-zoom": "~5.1.0",
|
||||
"react-router-dom": "6.6.2",
|
||||
|
@ -7221,9 +7221,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/react-hotkeys-hook": {
|
||||
"version": "5.0.0-1",
|
||||
"resolved": "https://registry.npmjs.org/react-hotkeys-hook/-/react-hotkeys-hook-5.0.0-1.tgz",
|
||||
"integrity": "sha512-nb8WD8IBrlEn3O2nlMoaBrWCxg2/vjgK3XFquDMM50qMbRzlOrR/p4PUlvh0rfuOMqEtKTGaL5BwkCh3rZ3T1w==",
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/react-hotkeys-hook/-/react-hotkeys-hook-4.5.0.tgz",
|
||||
"integrity": "sha512-Samb85GSgAWFQNvVt3PS90LPPGSf9mkH/r4au81ZP1yOIFayLC3QAvqTgGtJ8YEDMXtPmaVBs6NgipHO6h4Mug==",
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8.1",
|
||||
"react-dom": ">=16.8.1"
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
"p-throttle": "~6.1.0",
|
||||
"preact": "~10.20.1",
|
||||
"punycode": "~2.3.1",
|
||||
"react-hotkeys-hook": "~5.0.0-1",
|
||||
"react-hotkeys-hook": "~4.5.0",
|
||||
"react-intersection-observer": "~9.8.1",
|
||||
"react-quick-pinch-zoom": "~5.1.0",
|
||||
"react-router-dom": "6.6.2",
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { memo } from 'preact/compat';
|
||||
import { useEffect, useRef, useState } from 'preact/hooks';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
|
||||
import { api } from '../utils/api';
|
||||
import showToast from '../utils/show-toast';
|
||||
import states, { saveStatus } from '../utils/states';
|
||||
import useHotkeys from '../utils/useHotkeys';
|
||||
import useInterval from '../utils/useInterval';
|
||||
import usePageVisibility from '../utils/usePageVisibility';
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { useSnapshot } from 'valtio';
|
||||
|
||||
import Bookmarks from '../pages/bookmarks';
|
||||
|
@ -11,7 +12,6 @@ import Public from '../pages/public';
|
|||
import Search from '../pages/search';
|
||||
import Trending from '../pages/trending';
|
||||
import states from '../utils/states';
|
||||
import useHotkeys from '../utils/useHotkeys';
|
||||
import useTitle from '../utils/useTitle';
|
||||
|
||||
function Columns() {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
|
||||
import openCompose from '../utils/open-compose';
|
||||
import openOSK from '../utils/open-osk';
|
||||
import states from '../utils/states';
|
||||
import useHotkeys from '../utils/useHotkeys';
|
||||
|
||||
import Icon from './icon';
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import { MenuItem } from '@szhsin/react-menu';
|
|||
import { deepEqual } from 'fast-equals';
|
||||
import { forwardRef } from 'preact/compat';
|
||||
import { useEffect, useMemo, useRef, useState } from 'preact/hooks';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import stringLength from 'string-length';
|
||||
import { uid } from 'uid/single';
|
||||
import { useDebouncedCallback, useThrottledCallback } from 'use-debounce';
|
||||
|
@ -32,7 +33,6 @@ import {
|
|||
} from '../utils/store-utils';
|
||||
import supports from '../utils/supports';
|
||||
import useCloseWatcher from '../utils/useCloseWatcher';
|
||||
import useHotkeys from '../utils/useHotkeys';
|
||||
import useInterval from '../utils/useInterval';
|
||||
import visibilityIconsMap from '../utils/visibility-icons-map';
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import './keyboard-shortcuts-help.css';
|
||||
|
||||
import { memo } from 'preact/compat';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { useSnapshot } from 'valtio';
|
||||
|
||||
import states from '../utils/states';
|
||||
import useHotkeys from '../utils/useHotkeys';
|
||||
|
||||
import Icon from './icon';
|
||||
import Modal from './modal';
|
||||
|
|
|
@ -7,11 +7,11 @@ import {
|
|||
useRef,
|
||||
useState,
|
||||
} from 'preact/hooks';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
|
||||
import { oklab2rgb, rgb2oklab } from '../utils/color-utils';
|
||||
import showToast from '../utils/show-toast';
|
||||
import states from '../utils/states';
|
||||
import useHotkeys from '../utils/useHotkeys';
|
||||
|
||||
import Icon from './icon';
|
||||
import Link from './link';
|
||||
|
|
|
@ -2,9 +2,9 @@ import './modal.css';
|
|||
|
||||
import { createPortal } from 'preact/compat';
|
||||
import { useEffect, useRef } from 'preact/hooks';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
|
||||
import useCloseWatcher from '../utils/useCloseWatcher';
|
||||
import useHotkeys from '../utils/useHotkeys';
|
||||
|
||||
const $modalContainer = document.getElementById('modal-container');
|
||||
|
||||
|
|
|
@ -2,8 +2,7 @@ import './search-command.css';
|
|||
|
||||
import { memo } from 'preact/compat';
|
||||
import { useRef, useState } from 'preact/hooks';
|
||||
|
||||
import useHotkeys from '../utils/useHotkeys';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
|
||||
import SearchForm from './search-form';
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ import './shortcuts.css';
|
|||
import { MenuDivider } from '@szhsin/react-menu';
|
||||
import { memo } from 'preact/compat';
|
||||
import { useRef, useState } from 'preact/hooks';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useSnapshot } from 'valtio';
|
||||
|
||||
|
@ -10,7 +11,6 @@ import { SHORTCUTS_META } from '../components/shortcuts-settings';
|
|||
import { api } from '../utils/api';
|
||||
import { getLists } from '../utils/lists';
|
||||
import states from '../utils/states';
|
||||
import useHotkeys from '../utils/useHotkeys';
|
||||
|
||||
import AsyncText from './AsyncText';
|
||||
import Icon from './icon';
|
||||
|
|
|
@ -22,6 +22,7 @@ import {
|
|||
useState,
|
||||
} from 'preact/hooks';
|
||||
import punycode from 'punycode';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { useLongPress } from 'use-long-press';
|
||||
import { useSnapshot } from 'valtio';
|
||||
|
||||
|
@ -58,7 +59,6 @@ import store from '../utils/store';
|
|||
import { getCurrentAccountID } from '../utils/store-utils';
|
||||
import supports from '../utils/supports';
|
||||
import unfurlMastodonLink from '../utils/unfurl-link';
|
||||
import useHotkeys from '../utils/useHotkeys';
|
||||
import useTruncated from '../utils/useTruncated';
|
||||
import visibilityIconsMap from '../utils/visibility-icons-map';
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import {
|
|||
useRef,
|
||||
useState,
|
||||
} from 'preact/hooks';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { InView } from 'react-intersection-observer';
|
||||
import { useDebouncedCallback } from 'use-debounce';
|
||||
import { useSnapshot } from 'valtio';
|
||||
|
@ -16,7 +17,6 @@ import states, { statusKey } from '../utils/states';
|
|||
import statusPeek from '../utils/status-peek';
|
||||
import { isMediaFirstInstance } from '../utils/store-utils';
|
||||
import { groupBoosts, groupContext } from '../utils/timeline-utils';
|
||||
import useHotkeys from '../utils/useHotkeys';
|
||||
import useInterval from '../utils/useInterval';
|
||||
import usePageVisibility from '../utils/usePageVisibility';
|
||||
import useScroll from '../utils/useScroll';
|
||||
|
|
|
@ -14,6 +14,7 @@ import {
|
|||
useState,
|
||||
} from 'preact/hooks';
|
||||
import punycode from 'punycode';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { uid } from 'uid/single';
|
||||
|
||||
|
@ -41,7 +42,6 @@ import statusPeek from '../utils/status-peek';
|
|||
import store from '../utils/store';
|
||||
import { getCurrentAccountID, getCurrentAccountNS } from '../utils/store-utils';
|
||||
import { assignFollowedTags } from '../utils/timeline-utils';
|
||||
import useHotkeys from '../utils/useHotkeys';
|
||||
import useTitle from '../utils/useTitle';
|
||||
|
||||
const FILTER_CONTEXT = 'home';
|
||||
|
|
|
@ -3,6 +3,7 @@ import './notifications.css';
|
|||
import { Fragment } from 'preact';
|
||||
import { memo } from 'preact/compat';
|
||||
import { useCallback, useEffect, useRef, useState } from 'preact/hooks';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { InView } from 'react-intersection-observer';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { useSnapshot } from 'valtio';
|
||||
|
@ -28,7 +29,6 @@ import showToast from '../utils/show-toast';
|
|||
import states, { saveStatus } from '../utils/states';
|
||||
import { getCurrentInstance } from '../utils/store-utils';
|
||||
import supports from '../utils/supports';
|
||||
import useHotkeys from '../utils/useHotkeys';
|
||||
import usePageVisibility from '../utils/usePageVisibility';
|
||||
import useScroll from '../utils/useScroll';
|
||||
import useTitle from '../utils/useTitle';
|
||||
|
|
|
@ -2,6 +2,7 @@ import './search.css';
|
|||
|
||||
import { useAutoAnimate } from '@formkit/auto-animate/preact';
|
||||
import { useEffect, useLayoutEffect, useRef, useState } from 'preact/hooks';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { InView } from 'react-intersection-observer';
|
||||
import { useParams, useSearchParams } from 'react-router-dom';
|
||||
|
||||
|
@ -15,7 +16,6 @@ import Status from '../components/status';
|
|||
import { api } from '../utils/api';
|
||||
import { fetchRelationships } from '../utils/relationships';
|
||||
import shortenNumber from '../utils/shorten-number';
|
||||
import useHotkeys from '../utils/useHotkeys';
|
||||
import usePageVisibility from '../utils/usePageVisibility';
|
||||
import useTitle from '../utils/useTitle';
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import {
|
|||
useState,
|
||||
} from 'preact/hooks';
|
||||
import punycode from 'punycode';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { InView } from 'react-intersection-observer';
|
||||
import { matchPath, useSearchParams } from 'react-router-dom';
|
||||
import { useSnapshot } from 'valtio';
|
||||
|
@ -37,7 +38,6 @@ import states, {
|
|||
} from '../utils/states';
|
||||
import statusPeek from '../utils/status-peek';
|
||||
import { getCurrentAccount } from '../utils/store-utils';
|
||||
import useHotkeys from '../utils/useHotkeys';
|
||||
import useScroll from '../utils/useScroll';
|
||||
import useTitle from '../utils/useTitle';
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
|
||||
// Patch useHotKeys to add additional option
|
||||
// E.g. useHotkeys('!', callback, {useKey: true})
|
||||
|
||||
export default function (keys, callback, options, deps) {
|
||||
return useHotkeys(
|
||||
keys,
|
||||
callback,
|
||||
{
|
||||
useKey: true,
|
||||
...options,
|
||||
},
|
||||
deps,
|
||||
);
|
||||
}
|
Loading…
Reference in a new issue