From 068a6f4b78aae51f747fb5653485c157e51695c5 Mon Sep 17 00:00:00 2001 From: Tharki-god Date: Wed, 7 Jun 2023 23:34:25 +0530 Subject: [PATCH] 0.9.4 --- manifest.json | 2 +- package.json | 4 ++-- pnpm-lock.yaml | 8 ++++---- src/Components/MenuItem.tsx | 1 + src/lib/HomeButtonContextMenuApi.tsx | 19 ++++++------------ src/types.ts | 30 ++-------------------------- 6 files changed, 16 insertions(+), 48 deletions(-) diff --git a/manifest.json b/manifest.json index 97a7486..9863363 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ "discordID": "1025214794766221384", "github": "Tharki-God" }, - "version": "0.9.3", + "version": "0.9.4", "updater": { "type": "store", "id": "dev.tharki.Address" diff --git a/package.json b/package.json index da46920..357debf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "address", - "version": "0.9.3", + "version": "0.9.4", "description": "Get an option to copy the current web address by right clicking on the home button.", "engines": { "node": ">=14.0.0" @@ -30,7 +30,7 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-react": "^7.31.10", "prettier": "^2.8.1", - "replugged": "^4.3.0", + "replugged": "^4.3.1", "typescript": "^4.8.4" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 397bd9b..c3b1d24 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,8 +29,8 @@ devDependencies: specifier: ^2.8.1 version: 2.8.4 replugged: - specifier: ^4.3.0 - version: 4.3.0(@codemirror/view@6.9.1)(@lezer/common@1.0.2) + specifier: ^4.3.1 + version: 4.3.1(@codemirror/view@6.9.1)(@lezer/common@1.0.2) typescript: specifier: ^4.8.4 version: 4.9.5 @@ -3692,8 +3692,8 @@ packages: rc: 1.2.8 dev: true - /replugged@4.3.0(@codemirror/view@6.9.1)(@lezer/common@1.0.2): - resolution: {integrity: sha512-Sa9O+hA5N2J7Cez2qegqW+HV8ekXxpXK1lZDCSXrp4slqHvBfUBVgySXrCvTXh2JQfl4JR6FfOf9SqfKabnb/Q==} + /replugged@4.3.1(@codemirror/view@6.9.1)(@lezer/common@1.0.2): + resolution: {integrity: sha512-E3KPJsB31oOXC4kZBYj+iEF/i8wk8+hoGBsihby4ThcVffmg1upTTpzVTihy8uM2PFTS2KIWBPk5Zu4ba/W/+Q==} engines: {node: '>=18.0.0', pnpm: '>=8.0.0'} hasBin: true dependencies: diff --git a/src/Components/MenuItem.tsx b/src/Components/MenuItem.tsx index 0bcca38..9acd970 100644 --- a/src/Components/MenuItem.tsx +++ b/src/Components/MenuItem.tsx @@ -13,6 +13,7 @@ export const AddressMenuItem = ( label: "Copy Address", id: "copy-address", icon: () => Icons.glob("20", "20"), + children: [], action: () => { try { const Address = SettingValues.get("normalizeAddress", defaultSettings.normalizeAddress) diff --git a/src/lib/HomeButtonContextMenuApi.tsx b/src/lib/HomeButtonContextMenuApi.tsx index 29ea4eb..698b539 100644 --- a/src/lib/HomeButtonContextMenuApi.tsx +++ b/src/lib/HomeButtonContextMenuApi.tsx @@ -2,7 +2,7 @@ import { common, components } from "replugged"; import * as Types from "../types"; const { contextMenu: ContextMenuApi } = common; const { - ContextMenu: { ContextMenu, MenuItem }, + ContextMenu: { ContextMenu }, } = components; class HomeButtonContextMenuApi { items: Map; @@ -16,25 +16,18 @@ class HomeButtonContextMenuApi { removeItem(id: string) { this.items.delete(id); } - openContextMenu(event: Types.UIEvent) { + openContextMenu(event: Types.MouseEvent) { const HomeButtonContextMenuItems = this.items.size ? Array.from(this.items.values()) .filter(Boolean) .sort((a, b) => a?.props?.label?.localeCompare(b?.props?.label)) - : [ - , - ]; - const HomeButtonContextMenu = (props: Types.ExtendedContextMenuArgs) => ( + : []; + const HomeButtonContextMenu = (props) => ( {...HomeButtonContextMenuItems} ); - ContextMenuApi.open(event, ((e: Types.ContextMenuArgs) => ( + ContextMenuApi.open(event, (e) => ( - )) as unknown as Types.ContextMenu); + )); } } diff --git a/src/types.ts b/src/types.ts index fac1410..395565c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,38 +1,12 @@ import { types as DefaultTypes } from "replugged"; export { types as DefaultTypes } from "replugged"; -export { ReactElement, ComponentClass, UIEvent } from "react"; -import { ReactElement, UIEvent } from "react"; +export { ReactElement, ComponentClass, MouseEvent } from "react"; +import { ReactElement } from "react"; declare global { interface Window { HomeButtonContextMenuApi: HomeButtonContextMenuApi; } } -export interface ContextMenuArgs { - className: string; - config: { context: string }; - context: string; - onHeightUpdate: DefaultTypes.AnyFunction; - position: null | number; - target: HTMLElement; - theme: string; -} -export interface ExtendedContextMenuArgs extends ContextMenuArgs { - onClose: DefaultTypes.AnyFunction; -} -export interface ContextMenu { - close: DefaultTypes.AnyFunction; - open: ( - event: UIEvent, - render?: ContextMenu, - options?: { enableSpellCheck?: boolean }, - renderLazy?: Promise, - ) => void; - openLazy: ( - event: UIEvent, - renderLazy?: Promise, - options?: { enableSpellCheck?: boolean }, - ) => void; -} export interface HomeButtonContextMenuApi { items?: Map; constructor?: DefaultTypes.AnyFunction;