diff --git a/src/plugins/devCompanion.dev/index.tsx b/src/plugins/devCompanion.dev/index.tsx index 178d5c681..852e79490 100644 --- a/src/plugins/devCompanion.dev/index.tsx +++ b/src/plugins/devCompanion.dev/index.tsx @@ -48,13 +48,12 @@ export const settings = definePluginSettings({ export default definePlugin({ name: "DevCompanion", description: "Dev Companion Plugin. Please report anything not working or being weird (most likely its a bug) to sadan, either ping or dm, thanks!", - authors: [Devs.Ven, Devs.sadan, Devs.Samwich], + authors: [Devs.Ven, Devs.sadan], reporterTestable: ReporterTestable.None, isModified: true, - settings, toolboxActions: { - "Reconnect"() { + Reconnect() { socket?.close(1000, "Reconnecting"); initWs(true); } @@ -64,6 +63,10 @@ export default definePlugin({ // if we're running the reporter, we need to initws in the reporter file to avoid a race condition if (!IS_DEV) throw new Error("This plugin requires dev mode to run, please build with pnpm build --dev"); initWs(); + window.reconnectDevtools = () => { + socket?.close(1000, "Reconnecting"); + initWs(true); + }; }, stop: stopWs, diff --git a/src/plugins/devCompanion.dev/initWs.tsx b/src/plugins/devCompanion.dev/initWs.tsx index 27e77bb0b..89bee1d38 100644 --- a/src/plugins/devCompanion.dev/initWs.tsx +++ b/src/plugins/devCompanion.dev/initWs.tsx @@ -262,6 +262,9 @@ export function initWs(isManual = false) { case "Component": results = findAll(parsedArgs[0]); break; + case "CssClasses": + results = findAll(filters.byClassNames(...parsedArgs), { topLevelOnly: true }); + break; case "ByProps": results = findAll(filters.byProps(...parsedArgs)); break; @@ -373,6 +376,9 @@ export function initWs(isManual = false) { case "ByProps": results = findAll(filters.byProps(...parsedArgs)); break; + case "CssClasses": + results = findAll(filters.byClassNames(...parsedArgs), { topLevelOnly: true }); + break; case "Store": results = findAll(filters.byStoreName(parsedArgs[0])); break; diff --git a/src/plugins/devCompanion.dev/types/recieve.ts b/src/plugins/devCompanion.dev/types/recieve.ts index 486481ea4..b56269539 100644 --- a/src/plugins/devCompanion.dev/types/recieve.ts +++ b/src/plugins/devCompanion.dev/types/recieve.ts @@ -35,7 +35,7 @@ export type FindOrSearchData = } & _PrefixKeys<_CapitalizeKeys, "find">); export type AnyFindType = - `find${"Component" | "ByProps" | "Store" | "ByCode" | "ModuleId" | "ComponentByCode" | ""}${"Lazy" | ""}`; + `find${"Component" | "ByProps" | "CssClasses" | "Store" | "ByCode" | "ModuleId" | "ComponentByCode" | ""}${"Lazy" | ""}`; export type StringNode = { type: "string";