diff --git a/modules/stdlib/src/webpack/ReactComponents.xpui.ts b/modules/stdlib/src/webpack/ReactComponents.xpui.ts index c852c64..ee5ccd4 100644 --- a/modules/stdlib/src/webpack/ReactComponents.xpui.ts +++ b/modules/stdlib/src/webpack/ReactComponents.xpui.ts @@ -5,7 +5,13 @@ import { capitalize } from "../../deps.ts"; import { Platform } from "../expose/Platform.ts"; -import { chunks, exportedForwardRefs, exportedFunctions, exportedMemos, require } from "./index.ts"; +import { + chunks, + exportedForwardRefs, + exportedFunctions, + exportedMemos, + require, +} from "./index.ts"; import { findBy } from "/hooks/util.ts"; import { React } from "../expose/React.ts"; @@ -28,7 +34,9 @@ export const Menus: any = Object.fromEntries( }), ); -const [ContextMenuModuleID] = chunks.find(([_, v]) => v.toString().includes("toggleContextMenu"))!; +const [ContextMenuModuleID] = chunks.find(([_, v]) => + v.toString().includes("toggleContextMenu") +)!; const [playlistMenuChunkID] = chunks.find( ([, v]) => v.toString().includes('value:"playlist"') && @@ -106,8 +114,8 @@ export const NavTo: React.NamedExoticComponent = exportedMemoFRefs.find((m) => (m as any).type.render.toString().includes("pageId") )!; -export const InstrumentedRedirect: React.FC = findBy("getInteractionId")( - exportedFunctions, +export const InstrumentedRedirect: React.FC = exportedFunctions.find((f) => + f.toString().includes("getInteractionId") && /\bto:/.test(f) ); export const SnackbarProvider: SnackbarProviderT = findBy( @@ -161,7 +169,8 @@ export const PanelHeader: React.FC = exportedFunctions.find((m) => export const PanelContent: React.FC = exportedForwardRefs.find((f) => f.render.toString().includes("fixedHeader") ); -export const PanelSkeleton: React.FC = findBy("label", "aside")(exportedFunctions) || +export const PanelSkeleton: React.FC = + findBy("label", "aside")(exportedFunctions) || findBy((m) => m.render.toString().includes("section"))(exportedForwardRefs); export const Snackbar = { diff --git a/modules/stdlib/src/webpack/ReactRouter.xpui.ts b/modules/stdlib/src/webpack/ReactRouter.xpui.ts index 1bc85b2..0910715 100644 --- a/modules/stdlib/src/webpack/ReactRouter.xpui.ts +++ b/modules/stdlib/src/webpack/ReactRouter.xpui.ts @@ -4,14 +4,18 @@ */ import { chunks, require } from "./index.ts"; -import { findBy } from "/hooks/util.ts"; + +import type { useMatch as useMatchT } from "npm:react-router"; await CHUNKS.xpui.promise; -const [ReactRouterModuleID] = chunks.find(([_, v]) => v.toString().includes("React Router"))!; +const [ReactRouterModuleID] = chunks.find(([_, v]) => + v.toString().includes("React Router") +)!; const ReactRouterModule = Object.values(require(ReactRouterModuleID)); // https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/hooks.tsx#L131 -export const useMatch: Function = ReactRouterModule.find((f) => - f.toString().includes("let{pathname:") && !f.toString().includes(".createElement(") +export const useMatch: typeof useMatchT = ReactRouterModule.find((f) => + f.toString().includes("let{pathname:") && + !f.toString().includes(".createElement(") );