diff --git a/package.json b/package.json index a4d43b2..5be4073 100644 --- a/package.json +++ b/package.json @@ -4,16 +4,16 @@ "build": "node build.mjs" }, "dependencies": { - "@swc/helpers": "^0.4.14" + "@swc/helpers": "^0.5.3" }, "devDependencies": { - "@rollup/plugin-commonjs": "^24.0.0", - "@rollup/plugin-node-resolve": "^15.0.1", - "@swc/core": "^1.3.35", - "esbuild": "^0.16.14", - "rollup": "^3.9.1", - "rollup-plugin-esbuild": "^5.0.0", - "vendetta-types": "^2.4.20" + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-node-resolve": "^15.2.3", + "@swc/core": "^1.3.100", + "esbuild": "^0.19.9", + "rollup": "^4.8.0", + "rollup-plugin-esbuild": "^6.1.0", + "vendetta-types": "^2.4.21" }, "pnpm": { "peerDependencyRules": { diff --git a/plugins/FileContentPreview/Settings.jsx b/plugins/FileContentPreview/Settings.jsx index 057aa0a..93ed284 100644 --- a/plugins/FileContentPreview/Settings.jsx +++ b/plugins/FileContentPreview/Settings.jsx @@ -1,4 +1,4 @@ -import { findByProps, findByStoreName } from "@vendetta/metro"; +import { find, findByProps, findByStoreName } from "@vendetta/metro"; import { FormRow } from "@vendetta/ui/components/Forms"; import { ReactNative, constants } from "@vendetta/metro/common"; import { useProxy } from "@vendetta/storage"; @@ -11,7 +11,8 @@ const { ScrollView } = ReactNative; const { Text } = General; const ThemeStore = findByStoreName("ThemeStore"); -const { meta: { resolveSemanticColor } } = findByProps("colors", "meta"); +const resolveSemanticColor = find(m => m.default?.internal?.resolveSemanticColor)?.default.internal.resolveSemanticColor + ?? find(m => m.meta?.resolveSemanticColor)?.meta.resolveSemanticColor ?? (() => {}); const Colors = { text: resolveSemanticColor(ThemeStore.theme, semanticColors.TEXT_NORMAL) @@ -40,4 +41,4 @@ export default () => { ) -} \ No newline at end of file +} diff --git a/plugins/FileContentPreview/ui/FCModal.tsx b/plugins/FileContentPreview/ui/FCModal.tsx index b5509fb..d19f6e2 100644 --- a/plugins/FileContentPreview/ui/FCModal.tsx +++ b/plugins/FileContentPreview/ui/FCModal.tsx @@ -1,6 +1,6 @@ import { React, ReactNative, i18n, constants } from "@vendetta/metro/common"; import { storage } from "@vendetta/plugin"; -import { findByProps, findByName, findByStoreName } from "@vendetta/metro"; +import { find, findByProps, findByName, findByStoreName } from "@vendetta/metro"; import { General } from "@vendetta/ui/components"; import { getAssetIDByName } from "@vendetta/ui/assets"; import { showToast } from "@vendetta/ui/toasts"; @@ -12,7 +12,8 @@ import { semanticColors } from "@vendetta/ui"; import LoadMore from "./LoadMore"; const ThemeStore = findByStoreName("ThemeStore"); -const { meta: { resolveSemanticColor } } = findByProps("colors", "meta"); +const resolveSemanticColor = find(m => m.default?.internal?.resolveSemanticColor)?.default.internal.resolveSemanticColor + ?? find(m => m.meta?.resolveSemanticColor)?.meta.resolveSemanticColor ?? (() => {}); // https://github.com/nexpid/VendettaPlugins/blob/main/stuff/types.tsx#L43-L47 const Navigator = findByName("Navigator") ?? findByProps("Navigator")?.Navigator; diff --git a/plugins/FileContentPreview/ui/Swidew.jsx b/plugins/FileContentPreview/ui/Swidew.jsx index fec9f86..33d9848 100644 --- a/plugins/FileContentPreview/ui/Swidew.jsx +++ b/plugins/FileContentPreview/ui/Swidew.jsx @@ -1,13 +1,14 @@ import { React, ReactNative } from "@vendetta/metro/common"; -import { findByProps, findByStoreName } from "@vendetta/metro"; +import { find, findByStoreName } from "@vendetta/metro"; import { semanticColors } from "@vendetta/ui"; import { General } from "@vendetta/ui/components"; const { StyleSheet, PanResponder } = ReactNative; const ThemeStore = findByStoreName("ThemeStore"); -const { meta: { resolveSemanticColor } } = findByProps("colors", "meta"); const { View } = General; const { useState, useRef } = React; +const resolveSemanticColor = find(m => m.default?.internal?.resolveSemanticColor)?.default.internal.resolveSemanticColor + ?? find(m => m.meta?.resolveSemanticColor)?.meta.resolveSemanticColor ?? (() => {}); const Colors = { sliderOff: resolveSemanticColor(ThemeStore.theme, semanticColors.DEPRECATED_QUICKSWITCHER_INPUT_BACKGROUND), @@ -87,4 +88,4 @@ const Swidew = ({ onSlide, value }) => { ) } - export default Swidew; \ No newline at end of file + export default Swidew; diff --git a/plugins/RoleColorEverywhere/src/Settings.jsx b/plugins/RoleColorEverywhere/src/Settings.jsx index 01e4f1e..56b9875 100644 --- a/plugins/RoleColorEverywhere/src/Settings.jsx +++ b/plugins/RoleColorEverywhere/src/Settings.jsx @@ -1,5 +1,5 @@ import { ReactNative, constants } from "@vendetta/metro/common"; -import { findByProps, findByStoreName } from "@vendetta/metro"; +import { find, findByStoreName } from "@vendetta/metro"; import { FormSwitchRow, FormIcon, FormSection } from "@vendetta/ui/components/Forms"; import { useProxy } from "@vendetta/storage"; import { storage } from "@vendetta/plugin"; @@ -10,7 +10,8 @@ import Swidew from "./ui/Swidew"; const { Text, View } = General; const ThemeStore = findByStoreName("ThemeStore"); -const { meta: { resolveSemanticColor } } = findByProps("colors", "meta"); +const resolveSemanticColor = find(m => m.default?.internal?.resolveSemanticColor)?.default.internal.resolveSemanticColor + ?? find(m => m.meta?.resolveSemanticColor)?.meta.resolveSemanticColor ?? (() => {}); const Icons = { Typing: getAssetIDByName('ic_messages'), @@ -69,4 +70,4 @@ export default () => { ); -}; \ No newline at end of file +}; diff --git a/plugins/RoleColorEverywhere/src/patches/Rows.ts b/plugins/RoleColorEverywhere/src/patches/Rows.ts index 55cc471..fcee8eb 100644 --- a/plugins/RoleColorEverywhere/src/patches/Rows.ts +++ b/plugins/RoleColorEverywhere/src/patches/Rows.ts @@ -1,11 +1,12 @@ import { ReactNative } from '@vendetta/metro/common'; import { after, before } from "@vendetta/patcher"; -import { findByProps, findByStoreName, findByName } from "@vendetta/metro"; +import { find, findByStoreName, findByName } from "@vendetta/metro"; import { semanticColors } from "@vendetta/ui"; import { storage } from "@vendetta/plugin"; const ThemeStore = findByStoreName("ThemeStore"); -const { meta: { resolveSemanticColor } } = findByProps("colors", "meta"); +const resolveSemanticColor = find(m => m.default?.internal?.resolveSemanticColor)?.default.internal.resolveSemanticColor + ?? find(m => m.meta?.resolveSemanticColor)?.meta.resolveSemanticColor ?? (() => {}); const RowManager = findByName("RowManager"); const GuildMemberStore = findByStoreName("GuildMemberStore"); diff --git a/plugins/RoleColorEverywhere/src/patches/TypingWrapper.ts b/plugins/RoleColorEverywhere/src/patches/TypingWrapper.ts index c0efc11..587c487 100644 --- a/plugins/RoleColorEverywhere/src/patches/TypingWrapper.ts +++ b/plugins/RoleColorEverywhere/src/patches/TypingWrapper.ts @@ -1,6 +1,6 @@ import { React, constants } from '@vendetta/metro/common'; import { after } from "@vendetta/patcher"; -import { findByProps, findByStoreName } from "@vendetta/metro"; +import { find, findByProps, findByStoreName } from "@vendetta/metro"; import { General } from "@vendetta/ui/components"; import { semanticColors } from "@vendetta/ui"; import { storage } from "@vendetta/plugin"; @@ -8,7 +8,8 @@ import { storage } from "@vendetta/plugin"; const { Text } = General; const ThemeStore = findByStoreName("ThemeStore"); -const { meta: { resolveSemanticColor } } = findByProps("colors", "meta"); +const resolveSemanticColor = find(m => m.default?.internal?.resolveSemanticColor)?.default.internal.resolveSemanticColor + ?? find(m => m.meta?.resolveSemanticColor)?.meta.resolveSemanticColor ?? (() => {}); const UserStore = findByStoreName("UserStore"); const RelationshipStore = findByStoreName("RelationshipStore"); @@ -48,4 +49,4 @@ export default function patchTypingWrapper() { }); }); -}; \ No newline at end of file +}; diff --git a/plugins/RoleColorEverywhere/src/patches/VoiceUserConnected.ts b/plugins/RoleColorEverywhere/src/patches/VoiceUserConnected.ts index 630642a..7f065e6 100644 --- a/plugins/RoleColorEverywhere/src/patches/VoiceUserConnected.ts +++ b/plugins/RoleColorEverywhere/src/patches/VoiceUserConnected.ts @@ -1,10 +1,11 @@ import { after } from "@vendetta/patcher"; -import { findByName, findByProps, findByStoreName } from "@vendetta/metro"; +import { find, findByName, findByStoreName } from "@vendetta/metro"; import { storage } from "@vendetta/plugin"; import { semanticColors } from "@vendetta/ui"; const ThemeStore = findByStoreName("ThemeStore"); -const { meta: { resolveSemanticColor } } = findByProps("colors", "meta"); +const resolveSemanticColor = find(m => m.default?.internal?.resolveSemanticColor)?.default.internal.resolveSemanticColor + ?? find(m => m.meta?.resolveSemanticColor)?.meta.resolveSemanticColor ?? (() => {}); export default function patchVoiceUserConnected() { return after("default", findByName("VoiceUserConnected", false),([args],res)=>{ @@ -20,4 +21,4 @@ export default function patchVoiceUserConnected() { }); } catch { }; }); -}; \ No newline at end of file +}; diff --git a/plugins/RoleColorEverywhere/src/ui/Swidew.jsx b/plugins/RoleColorEverywhere/src/ui/Swidew.jsx index 07e0e1f..2d62b64 100644 --- a/plugins/RoleColorEverywhere/src/ui/Swidew.jsx +++ b/plugins/RoleColorEverywhere/src/ui/Swidew.jsx @@ -1,11 +1,12 @@ import { React, ReactNative } from "@vendetta/metro/common"; -import { findByProps, findByStoreName } from "@vendetta/metro"; +import { find, findByStoreName } from "@vendetta/metro"; import { semanticColors } from "@vendetta/ui"; import { General } from "@vendetta/ui/components"; const { StyleSheet, PanResponder } = ReactNative; const ThemeStore = findByStoreName("ThemeStore"); -const { meta: { resolveSemanticColor } } = findByProps("colors", "meta"); +const resolveSemanticColor = find(m => m.default?.internal?.resolveSemanticColor)?.default.internal.resolveSemanticColor + ?? find(m => m.meta?.resolveSemanticColor)?.meta.resolveSemanticColor ?? (() => {}); const { View } = General; const { useState, useRef } = React; @@ -87,4 +88,4 @@ const Swidew = ({ onSlide, value }) => { ) } -export default Swidew; \ No newline at end of file +export default Swidew;