From 89106a52769794633d98fcc915083337c2093b7c Mon Sep 17 00:00:00 2001 From: Julian Waller Date: Wed, 2 Oct 2024 20:06:04 +0100 Subject: [PATCH] fix: patch coreui #3042 #2965 https://github.com/coreui/coreui-react/pull/412 --- .../@coreui-react-npm-5.4.0-6fcb3b510a.patch | 31 +++++++++++++++++++ webui/package.json | 2 +- yarn.lock | 28 ++++++++++++----- 3 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 .yarn/patches/@coreui-react-npm-5.4.0-6fcb3b510a.patch diff --git a/.yarn/patches/@coreui-react-npm-5.4.0-6fcb3b510a.patch b/.yarn/patches/@coreui-react-npm-5.4.0-6fcb3b510a.patch new file mode 100644 index 000000000..6ec0e52a4 --- /dev/null +++ b/.yarn/patches/@coreui-react-npm-5.4.0-6fcb3b510a.patch @@ -0,0 +1,31 @@ +diff --git a/dist/esm/components/modal/CModal.js b/dist/esm/components/modal/CModal.js +index 58f4c61c71168a624a9c0d79318dad9993e3d2aa..315befe3e56de29738642d573253833085d87409 100644 +--- a/dist/esm/components/modal/CModal.js ++++ b/dist/esm/components/modal/CModal.js +@@ -30,14 +30,14 @@ var CModal = forwardRef(function (_a, ref) { + var _a; + if (_visible) { + activeElementRef.current = document.activeElement; +- document.addEventListener('mouseup', handleClickOutside); ++ document.addEventListener('mousedown', handleMouseDown); + document.addEventListener('keydown', handleKeyDown); + } + else { + (_a = activeElementRef.current) === null || _a === void 0 ? void 0 : _a.focus(); + } + return function () { +- document.removeEventListener('mouseup', handleClickOutside); ++ document.removeEventListener('mousedown', handleMouseDown); + document.removeEventListener('keydown', handleKeyDown); + }; + }, [_visible]); +@@ -85,6 +85,9 @@ var CModal = forwardRef(function (_a, ref) { + handleDismiss(); + } + }; ++ var handleMouseDown = function (event) { ++ document.addEventListener('mouseup', function () { handleClickOutside(event) }, { once: true }) ++ } + var handleKeyDown = function (event) { + if (event.key === 'Escape' && keyboard) { + handleDismiss(); diff --git a/webui/package.json b/webui/package.json index 4476f6bdd..21c3c1c56 100644 --- a/webui/package.json +++ b/webui/package.json @@ -6,7 +6,7 @@ "dependencies": { "@companion-app/shared": "*", "@coreui/coreui": "^5.1.2", - "@coreui/react": "^5.3.0", + "@coreui/react": "patch:@coreui/react@npm%3A5.4.0#~/.yarn/patches/@coreui-react-npm-5.4.0-6fcb3b510a.patch", "@fontsource/fira-code": "^5.0.20", "@fontsource/roboto": "^5.0.15", "@fortawesome/fontawesome-svg-core": "^6.6.0", diff --git a/yarn.lock b/yarn.lock index 7cfa42beb..710eeb0b2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1492,7 +1492,7 @@ __metadata: dependencies: "@companion-app/shared": "npm:*" "@coreui/coreui": "npm:^5.1.2" - "@coreui/react": "npm:^5.3.0" + "@coreui/react": "patch:@coreui/react@npm%3A5.4.0#~/.yarn/patches/@coreui-react-npm-5.4.0-6fcb3b510a.patch" "@fontsource/fira-code": "npm:^5.0.20" "@fontsource/roboto": "npm:^5.0.15" "@fortawesome/fontawesome-svg-core": "npm:^6.6.0" @@ -1590,7 +1590,7 @@ __metadata: languageName: node linkType: hard -"@coreui/coreui@npm:^5.1.0, @coreui/coreui@npm:^5.1.2": +"@coreui/coreui@npm:^5.1.2": version: 5.1.2 resolution: "@coreui/coreui@npm:5.1.2" peerDependencies: @@ -1599,17 +1599,31 @@ __metadata: languageName: node linkType: hard -"@coreui/react@npm:^5.3.0": - version: 5.3.0 - resolution: "@coreui/react@npm:5.3.0" +"@coreui/react@npm:5.4.0": + version: 5.4.0 + resolution: "@coreui/react@npm:5.4.0" + dependencies: + "@coreui/coreui": "npm:^5.1.2" + "@popperjs/core": "npm:^2.11.8" + prop-types: "npm:^15.8.1" + peerDependencies: + react: ">=17" + react-dom: ">=17" + checksum: 10c0/0989cb36e2f400110b255ecbf4bfea5ee9d4ff8435a0271c6b67b023d9285b402f0c3eb7d7095f0005d5436ec83f5ffa1efe0c8524af8509c2e0be77797517b0 + languageName: node + linkType: hard + +"@coreui/react@patch:@coreui/react@npm%3A5.4.0#~/.yarn/patches/@coreui-react-npm-5.4.0-6fcb3b510a.patch": + version: 5.4.0 + resolution: "@coreui/react@patch:@coreui/react@npm%3A5.4.0#~/.yarn/patches/@coreui-react-npm-5.4.0-6fcb3b510a.patch::version=5.4.0&hash=56767e" dependencies: - "@coreui/coreui": "npm:^5.1.0" + "@coreui/coreui": "npm:^5.1.2" "@popperjs/core": "npm:^2.11.8" prop-types: "npm:^15.8.1" peerDependencies: react: ">=17" react-dom: ">=17" - checksum: 10c0/6d7904706e4751a1f2e23f97878294415fdcccee996fc119f629c9c629436c89d612dc3b55b17982fc96a5a2126600bde00c4ae5b7b6d2aa50b0c7c9874d0461 + checksum: 10c0/d05537106c03eeeb39d1f21a80fa695c82ed12f1235c99475fc8cdbf6f361951d072e5eb80632d39e6c8dab6c8280ce146269b43a2c9d791b41503d5da561dda languageName: node linkType: hard