mirror of
https://github.com/Equicord/Equicord.git
synced 2025-01-18 13:23:28 -05:00
LoginWithQR: Use JSQR NPM
This commit is contained in:
parent
e874012b61
commit
25e9249d59
6 changed files with 13 additions and 10143 deletions
|
@ -4,8 +4,7 @@
|
||||||
"ignorePatterns": [
|
"ignorePatterns": [
|
||||||
"dist",
|
"dist",
|
||||||
"browser",
|
"browser",
|
||||||
"packages/vencord-types",
|
"packages/vencord-types"
|
||||||
"src/equicordplugins/loginWithQR/jsQR.js"
|
|
||||||
],
|
],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"@typescript-eslint",
|
"@typescript-eslint",
|
||||||
|
@ -193,4 +192,4 @@
|
||||||
"simple-import-sort/exports": "error",
|
"simple-import-sort/exports": "error",
|
||||||
"unused-imports/no-unused-imports": "error"
|
"unused-imports/no-unused-imports": "error"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -42,9 +42,9 @@
|
||||||
"@types/tinycolor2": "^1.4.6",
|
"@types/tinycolor2": "^1.4.6",
|
||||||
"@vap/core": "0.0.12",
|
"@vap/core": "0.0.12",
|
||||||
"@vap/shiki": "0.10.5",
|
"@vap/shiki": "0.10.5",
|
||||||
"axios": "^1.6.8",
|
|
||||||
"fflate": "^0.7.4",
|
"fflate": "^0.7.4",
|
||||||
"gifenc": "github:mattdesl/gifenc#64842fca317b112a8590f8fef2bf3825da8f6fe3",
|
"gifenc": "github:mattdesl/gifenc#64842fca317b112a8590f8fef2bf3825da8f6fe3",
|
||||||
|
"jsqr": "1.4.0",
|
||||||
"monaco-editor": "^0.50.0",
|
"monaco-editor": "^0.50.0",
|
||||||
"nanoid": "^4.0.2",
|
"nanoid": "^4.0.2",
|
||||||
"usercss-meta": "^0.12.0",
|
"usercss-meta": "^0.12.0",
|
||||||
|
@ -117,4 +117,4 @@
|
||||||
"node": ">=20",
|
"node": ">=20",
|
||||||
"pnpm": ">=9"
|
"pnpm": ">=9"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -34,15 +34,15 @@ importers:
|
||||||
'@vap/shiki':
|
'@vap/shiki':
|
||||||
specifier: 0.10.5
|
specifier: 0.10.5
|
||||||
version: 0.10.5
|
version: 0.10.5
|
||||||
axios:
|
|
||||||
specifier: ^1.6.8
|
|
||||||
version: 1.6.8
|
|
||||||
fflate:
|
fflate:
|
||||||
specifier: ^0.7.4
|
specifier: ^0.7.4
|
||||||
version: 0.7.4
|
version: 0.7.4
|
||||||
gifenc:
|
gifenc:
|
||||||
specifier: github:mattdesl/gifenc#64842fca317b112a8590f8fef2bf3825da8f6fe3
|
specifier: github:mattdesl/gifenc#64842fca317b112a8590f8fef2bf3825da8f6fe3
|
||||||
version: https://codeload.github.com/mattdesl/gifenc/tar.gz/64842fca317b112a8590f8fef2bf3825da8f6fe3
|
version: https://codeload.github.com/mattdesl/gifenc/tar.gz/64842fca317b112a8590f8fef2bf3825da8f6fe3
|
||||||
|
jsqr:
|
||||||
|
specifier: 1.4.0
|
||||||
|
version: 1.4.0
|
||||||
monaco-editor:
|
monaco-editor:
|
||||||
specifier: ^0.50.0
|
specifier: ^0.50.0
|
||||||
version: 0.50.0
|
version: 0.50.0
|
||||||
|
@ -996,9 +996,6 @@ packages:
|
||||||
resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
|
resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
axios@1.6.8:
|
|
||||||
resolution: {integrity: sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==}
|
|
||||||
|
|
||||||
balanced-match@1.0.2:
|
balanced-match@1.0.2:
|
||||||
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
|
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
|
||||||
|
|
||||||
|
@ -1443,15 +1440,6 @@ packages:
|
||||||
flatted@3.2.7:
|
flatted@3.2.7:
|
||||||
resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==}
|
resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==}
|
||||||
|
|
||||||
follow-redirects@1.15.6:
|
|
||||||
resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==}
|
|
||||||
engines: {node: '>=4.0'}
|
|
||||||
peerDependencies:
|
|
||||||
debug: '*'
|
|
||||||
peerDependenciesMeta:
|
|
||||||
debug:
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
for-each@0.3.3:
|
for-each@0.3.3:
|
||||||
resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==}
|
resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==}
|
||||||
|
|
||||||
|
@ -1798,6 +1786,9 @@ packages:
|
||||||
jsonfile@6.1.0:
|
jsonfile@6.1.0:
|
||||||
resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
|
resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
|
||||||
|
|
||||||
|
jsqr@1.4.0:
|
||||||
|
resolution: {integrity: sha512-dxLob7q65Xg2DvstYkRpkYtmKm2sPJ9oFhrhmudT1dZvNFFTlroai3AWSpLey/w5vMcLBXRgOJsbXpdN9HzU/A==}
|
||||||
|
|
||||||
jszip@2.7.0:
|
jszip@2.7.0:
|
||||||
resolution: {integrity: sha512-JIsRKRVC3gTRo2vM4Wy9WBC3TRcfnIZU8k65Phi3izkvPH975FowRYtKGT6PxevA0XnJ/yO8b0QwV0ydVyQwfw==}
|
resolution: {integrity: sha512-JIsRKRVC3gTRo2vM4Wy9WBC3TRcfnIZU8k65Phi3izkvPH975FowRYtKGT6PxevA0XnJ/yO8b0QwV0ydVyQwfw==}
|
||||||
|
|
||||||
|
@ -3243,14 +3234,6 @@ snapshots:
|
||||||
dependencies:
|
dependencies:
|
||||||
possible-typed-array-names: 1.0.0
|
possible-typed-array-names: 1.0.0
|
||||||
|
|
||||||
axios@1.6.8:
|
|
||||||
dependencies:
|
|
||||||
follow-redirects: 1.15.6
|
|
||||||
form-data: 4.0.0
|
|
||||||
proxy-from-env: 1.1.0
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- debug
|
|
||||||
|
|
||||||
balanced-match@1.0.2: {}
|
balanced-match@1.0.2: {}
|
||||||
|
|
||||||
balanced-match@2.0.0: {}
|
balanced-match@2.0.0: {}
|
||||||
|
@ -3839,8 +3822,6 @@ snapshots:
|
||||||
|
|
||||||
flatted@3.2.7: {}
|
flatted@3.2.7: {}
|
||||||
|
|
||||||
follow-redirects@1.15.6: {}
|
|
||||||
|
|
||||||
for-each@0.3.3:
|
for-each@0.3.3:
|
||||||
dependencies:
|
dependencies:
|
||||||
is-callable: 1.2.7
|
is-callable: 1.2.7
|
||||||
|
@ -4172,6 +4153,8 @@ snapshots:
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
graceful-fs: 4.2.11
|
graceful-fs: 4.2.11
|
||||||
|
|
||||||
|
jsqr@1.4.0: {}
|
||||||
|
|
||||||
jszip@2.7.0:
|
jszip@2.7.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
pako: 1.0.11
|
pako: 1.0.11
|
||||||
|
|
|
@ -14,16 +14,6 @@ import { ReactElement } from "react";
|
||||||
import { cl, QrCodeCameraIcon } from "./ui";
|
import { cl, QrCodeCameraIcon } from "./ui";
|
||||||
import openQrModal from "./ui/modals/QrModal";
|
import openQrModal from "./ui/modals/QrModal";
|
||||||
|
|
||||||
export let jsQR: (img: Uint8ClampedArray, width: number, height: number) => {
|
|
||||||
binaryData: number[];
|
|
||||||
data: string;
|
|
||||||
chunks: any[];
|
|
||||||
version: number;
|
|
||||||
location: object;
|
|
||||||
};
|
|
||||||
|
|
||||||
import("./jsQR.js").then(x => (jsQR = x.default));
|
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "LoginWithQR",
|
name: "LoginWithQR",
|
||||||
description: "Allows you to login to another device by scanning a login QR code, just like on mobile!",
|
description: "Allows you to login to another device by scanning a login QR code, just like on mobile!",
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -22,8 +22,8 @@ import {
|
||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
} from "@webpack/common";
|
} from "@webpack/common";
|
||||||
|
import jsQR from "jsqr";
|
||||||
|
|
||||||
import { jsQR } from "../../";
|
|
||||||
import { cl, Spinner, SpinnerTypes } from "..";
|
import { cl, Spinner, SpinnerTypes } from "..";
|
||||||
import openVerifyModal from "./VerifyModal";
|
import openVerifyModal from "./VerifyModal";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue