From 9174bd774a7222ed2b9dfeec3912e6dd67a48a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Mon, 26 Feb 2024 14:43:39 +0100 Subject: [PATCH 1/3] Replace react-hotkeys with updated fork for Vite compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- package.json | 2 +- src/features/ui/components/hotkeys.tsx | 22 +++++----------- yarn.lock | 36 +++++++------------------- 3 files changed, 17 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index 9f3b2f933..136cc34af 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "@lexical/react": "^0.13.1", "@lexical/selection": "^0.13.1", "@lexical/utils": "^0.13.1", + "@mkljczk/react-hotkeys": "^1.2.2", "@noble/hashes": "^1.3.3", "@popperjs/core": "^2.11.5", "@reach/combobox": "^0.18.0", @@ -147,7 +148,6 @@ "react-error-boundary": "^4.0.11", "react-helmet": "^6.1.0", "react-hot-toast": "^2.4.0", - "react-hotkeys": "^1.1.4", "react-immutable-pure-component": "^2.2.2", "react-inlinesvg": "^4.0.0", "react-intl": "^6.0.0", diff --git a/src/features/ui/components/hotkeys.tsx b/src/features/ui/components/hotkeys.tsx index e735cde86..813469bab 100644 --- a/src/features/ui/components/hotkeys.tsx +++ b/src/features/ui/components/hotkeys.tsx @@ -1,22 +1,14 @@ +import { HotKeys as _HotKeys, type HotKeysProps } from '@mkljczk/react-hotkeys'; import React from 'react'; -import { HotKeys as _HotKeys } from 'react-hotkeys'; - -type IHotKeys = React.ComponentProps; /** * Wrapper component around `react-hotkeys`. * `react-hotkeys` is a legacy component, so confining its import to one place is beneficial. - * - * NOTE: Temporarily disabled due to incompatibility with Vite. */ -const HotKeys = React.forwardRef(({ children, ...rest }, ref) => { - // return ( - // <_HotKeys {...rest} ref={ref}> - // {children} - // - // ); +const HotKeys = React.forwardRef(({ children, ...rest }, ref) => ( + <_HotKeys {...rest} ref={ref}> + {children} + +)); - return <>{children}; -}); - -export { HotKeys, type IHotKeys }; \ No newline at end of file +export { HotKeys, type HotKeysProps as IHotKeys }; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 4d69e9d5c..46431ed94 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1832,6 +1832,14 @@ resolved "https://registry.yarnpkg.com/@mdn/browser-compat-data/-/browser-compat-data-5.3.16.tgz#c3b6585c256461fe5e2eac85182b11b36ea2678b" integrity sha512-b0kKg2weqKDLI+Ai5+tocgUEIidccdSfzUndbS2YnwIp5aVvd3M0D+DCcbrsSOSgMyrV9QKMqogtqMIjKwvDxw== +"@mkljczk/react-hotkeys@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@mkljczk/react-hotkeys/-/react-hotkeys-1.2.2.tgz#9e27d1f54f6fcc96657643d07534cf71987eba09" + integrity sha512-BGGdSdPtpu+XbqvfO3gxzUNHzMJN0ztmQoIuqEEPBsogH6oAzlGdFnfy5VDxExJ+8LufmLHHr3yZ7eiqYqGvog== + dependencies: + lodash "^4.17.21" + mousetrap "^1.6.5" + "@noble/ciphers@0.2.0", "@noble/ciphers@^0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@noble/ciphers/-/ciphers-0.2.0.tgz#a12cda60f3cf1ab5d7c77068c3711d2366649ed7" @@ -6176,21 +6184,6 @@ lodash.debounce@^4.0.8: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== -lodash.isboolean@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6" - integrity sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY= - -lodash.isequal@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" - integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= - -lodash.isobject@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/lodash.isobject/-/lodash.isobject-3.0.2.tgz#3c8fb8d5b5bf4bf90ae06e14f2a530a4ed935e1d" - integrity sha1-PI+41bW/S/kK4G4U8qUwpO2TXh0= - lodash.isplainobject@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" @@ -6490,7 +6483,7 @@ mlly@^1.2.0, mlly@^1.4.2: pkg-types "^1.0.3" ufo "^1.3.0" -mousetrap@^1.5.2: +mousetrap@^1.6.5: version "1.6.5" resolved "https://registry.yarnpkg.com/mousetrap/-/mousetrap-1.6.5.tgz#8a766d8c272b08393d5f56074e0b5ec183485bf9" integrity sha512-QNo4kEepaIBwiT8CDhP98umTetp+JNfQYBWvC1pc6/OAibuXtRcxZ58Qz8skvEHYvURne/7R8T5VoOI7rDsEUA== @@ -7476,17 +7469,6 @@ react-hot-toast@^2.4.0: dependencies: goober "^2.1.10" -react-hotkeys@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/react-hotkeys/-/react-hotkeys-1.1.4.tgz#a0712aa2e0c03a759fd7885808598497a4dace72" - integrity sha1-oHEqouDAOnWf14hYCFmEl6TaznI= - dependencies: - lodash.isboolean "^3.0.3" - lodash.isequal "^4.5.0" - lodash.isobject "^3.0.2" - mousetrap "^1.5.2" - prop-types "^15.6.0" - react-immutable-pure-component@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/react-immutable-pure-component/-/react-immutable-pure-component-2.2.2.tgz#3014d3e20cd5a7a4db73b81f1f1464f4d351684b" From 3786c786e2158acde5d48630bbc41572c0fb974d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 29 Feb 2024 23:13:39 +0100 Subject: [PATCH 2/3] Align poll option text to center MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/components/polls/poll-option.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/polls/poll-option.tsx b/src/components/polls/poll-option.tsx index 760945ff9..7fb7a64d8 100644 --- a/src/components/polls/poll-option.tsx +++ b/src/components/polls/poll-option.tsx @@ -67,6 +67,7 @@ const PollOptionText: React.FC = ({ poll, option, index, active From a0aba764509fbdf3f71fe470e42bebcc0f14ad02 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 6 Mar 2024 15:49:16 -0600 Subject: [PATCH 3/3] Add .npmrc for JSR --- .npmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000..41583e36c --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +@jsr:registry=https://npm.jsr.io