From e6a226c1be0c7dce8d9bb57d30efae88135d8bc9 Mon Sep 17 00:00:00 2001 From: Delusoire Date: Sat, 17 Aug 2024 17:53:36 +0100 Subject: [PATCH] fix --- deno.lock | 78 +++++++++++++ .../stdlib/src/registers/topbarLeftButton.tsx | 16 +-- modules/stdlib/src/utils/index.ts | 3 +- modules/stdlib/src/webpack/CODEGEN.ts | 108 +++++++++--------- modules/stdlib/src/webpack/CustomHooks.gen.ts | 2 - .../stdlib/src/webpack/CustomHooks.xpui.ts | 2 - modules/stdlib/src/webpack/ReactRouter.gen.ts | 2 + .../stdlib/src/webpack/ReactRouter.xpui.ts | 11 +- 8 files changed, 151 insertions(+), 71 deletions(-) create mode 100644 deno.lock diff --git a/deno.lock b/deno.lock new file mode 100644 index 0000000..8f4f2e8 --- /dev/null +++ b/deno.lock @@ -0,0 +1,78 @@ +{ + "version": "3", + "packages": { + "specifiers": { + "npm:@swc/core": "npm:@swc/core@1.7.3" + }, + "npm": { + "@swc/core-darwin-arm64@1.7.3": { + "integrity": "sha512-CTkHa6MJdov9t41vuV2kmQIMu+Q19LrEHGIR/UiJYH06SC/sOu35ZZH8DyfLp9ZoaCn21gwgWd61ixOGQlwzTw==", + "dependencies": {} + }, + "@swc/core-darwin-x64@1.7.3": { + "integrity": "sha512-mun623y6rCoZ2EFIYfIRqXYRFufJOopoYSJcxYhZUrfTpAvQ1zLngjQpWCUU1krggXR2U0PQj+ls0DfXUTraNg==", + "dependencies": {} + }, + "@swc/core-linux-arm-gnueabihf@1.7.3": { + "integrity": "sha512-4Jz4UcIcvZNMp9qoHbBx35bo3rjt8hpYLPqnR4FFq6gkAsJIMFC56UhRZwdEQoDuYiOFMBnnrsg31Fyo6YQypA==", + "dependencies": {} + }, + "@swc/core-linux-arm64-gnu@1.7.3": { + "integrity": "sha512-p+U/M/oqV7HC4erQ5TVWHhJU1984QD+wQBPxslAYq751bOQGm0R/mXK42GjugqjnR6yYrAiwKKbpq4iWVXNePA==", + "dependencies": {} + }, + "@swc/core-linux-arm64-musl@1.7.3": { + "integrity": "sha512-s6VzyaJwaRGTi2mz2h6Ywxfmgpkc69IxhuMzl+sl34plH0V0RgnZDm14HoCGIKIzRk4+a2EcBV1ZLAfWmPACQg==", + "dependencies": {} + }, + "@swc/core-linux-x64-gnu@1.7.3": { + "integrity": "sha512-IrFY48C356Z2dU2pjYg080yvMXzmSV3Lmm/Wna4cfcB1nkVLjWsuYwwRAk9CY7E19c+q8N1sMNggubAUDYoX2g==", + "dependencies": {} + }, + "@swc/core-linux-x64-musl@1.7.3": { + "integrity": "sha512-qoLgxBlBnnyUEDu5vmRQqX90h9jldU1JXI96e6eh2d1gJyKRA0oSK7xXmTzorv1fGHiHulv9qiJOUG+g6uzJWg==", + "dependencies": {} + }, + "@swc/core-win32-arm64-msvc@1.7.3": { + "integrity": "sha512-OAd7jVVJ7nb0Ev80VAa1aeK+FldPeC4eZ35H4Qn6EICzIz0iqJo2T33qLKkSZiZEBKSoF4KcwrqYfkjLOp5qWg==", + "dependencies": {} + }, + "@swc/core-win32-ia32-msvc@1.7.3": { + "integrity": "sha512-31+Le1NyfSnILFV9+AhxfFOG0DK0272MNhbIlbcv4w/iqpjkhaOnNQnLsYJD1Ow7lTX1MtIZzTjOhRlzSviRWg==", + "dependencies": {} + }, + "@swc/core-win32-x64-msvc@1.7.3": { + "integrity": "sha512-jVQPbYrwcuueI4QB0fHC29SVrkFOBcfIspYDlgSoHnEz6tmLMqUy+txZUypY/ZH/KaK0HEY74JkzgbRC1S6LFQ==", + "dependencies": {} + }, + "@swc/core@1.7.3": { + "integrity": "sha512-HHAlbXjWI6Kl9JmmUW1LSygT1YbblXgj2UvvDzMkTBPRzYMhW6xchxdO8HbtMPtFYRt/EQq9u1z7j4ttRSrFsA==", + "dependencies": { + "@swc/core-darwin-arm64": "@swc/core-darwin-arm64@1.7.3", + "@swc/core-darwin-x64": "@swc/core-darwin-x64@1.7.3", + "@swc/core-linux-arm-gnueabihf": "@swc/core-linux-arm-gnueabihf@1.7.3", + "@swc/core-linux-arm64-gnu": "@swc/core-linux-arm64-gnu@1.7.3", + "@swc/core-linux-arm64-musl": "@swc/core-linux-arm64-musl@1.7.3", + "@swc/core-linux-x64-gnu": "@swc/core-linux-x64-gnu@1.7.3", + "@swc/core-linux-x64-musl": "@swc/core-linux-x64-musl@1.7.3", + "@swc/core-win32-arm64-msvc": "@swc/core-win32-arm64-msvc@1.7.3", + "@swc/core-win32-ia32-msvc": "@swc/core-win32-ia32-msvc@1.7.3", + "@swc/core-win32-x64-msvc": "@swc/core-win32-x64-msvc@1.7.3", + "@swc/counter": "@swc/counter@0.1.3", + "@swc/types": "@swc/types@0.1.12" + } + }, + "@swc/counter@0.1.3": { + "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", + "dependencies": {} + }, + "@swc/types@0.1.12": { + "integrity": "sha512-wBJA+SdtkbFhHjTMYH+dEH1y4VpfGdAc2Kw/LK09i9bXd/K6j6PkDcFCEzb6iVfZMkPRrl/q0e3toqTAJdkIVA==", + "dependencies": { + "@swc/counter": "@swc/counter@0.1.3" + } + } + } + }, + "remote": {} +} diff --git a/modules/stdlib/src/registers/topbarLeftButton.tsx b/modules/stdlib/src/registers/topbarLeftButton.tsx index c4f092f..66de7c7 100644 --- a/modules/stdlib/src/registers/topbarLeftButton.tsx +++ b/modules/stdlib/src/registers/topbarLeftButton.tsx @@ -33,12 +33,13 @@ declare global { let topbarLeftButtonFactoryCtx: React.Context; globalThis.__renderTopbarLeftButtons = () => React.createElement(() => { - [, refresh] = React.useReducer(n => n + 1, 0); + [, refresh] = React.useReducer((n) => n + 1, 0); - const topbarLeftButtonFactory = isGlobalNavBarEnabled() ? _TopbarLeftButtonT : _TopbarLeftButton; + const topbarLeftButtonFactory = isGlobalNavBarEnabled() ? _TopbarLeftButtonB : _TopbarLeftButtonA; - if (!topbarLeftButtonFactoryCtx) + if (!topbarLeftButtonFactoryCtx) { topbarLeftButtonFactoryCtx = React.createContext(null!); + } return ( @@ -47,7 +48,7 @@ globalThis.__renderTopbarLeftButtons = () => ); }); transformer( - emit => str => { + (emit) => (str) => { str = str.replace(/("top-bar-forward-button"[^\]]*)/g, "$1,__renderTopbarLeftButtons()"); emit(); return str; @@ -70,13 +71,12 @@ export const TopbarLeftButton = (props: TopbarLeftButtonProps) => { type TopbarLeftButtonFactory = React.FC; -const _TopbarLeftButtonT: TopbarLeftButtonFactory = props => ( +const _TopbarLeftButtonB: TopbarLeftButtonFactory = (props) => ( - props.icon && createIconComponent({ icon: props.icon, iconSize: 16, realIconSize: 24 }) - } + props.icon && createIconComponent({ icon: props.icon, iconSize: 16, realIconSize: 24 })} condensed aria-label={props.label} disabled={props.disabled} @@ -86,7 +86,7 @@ const _TopbarLeftButtonT: TopbarLeftButtonFactory = props => ( ); -const _TopbarLeftButton: TopbarLeftButtonFactory = props => ( +const _TopbarLeftButtonA: TopbarLeftButtonFactory = (props) => (