Merge remote-tracking branch 'upstream/dev' into dev

# Conflicts:
#	eslint.config.mjs
#	package.json
#	pnpm-lock.yaml
#	src/components/PluginSettings/index.tsx
#	src/plugins/imageZoom/index.tsx
#	src/plugins/messageLogger/index.tsx
#	src/plugins/pictureInPicture/index.tsx
#	src/plugins/serverInfo/GuildInfoModal.tsx
#	src/plugins/whoReacted/index.tsx
This commit is contained in:
thororen1234 2025-01-04 17:57:05 -05:00
commit f8879cc801
114 changed files with 2092 additions and 893 deletions

View file

@ -5,6 +5,7 @@
*/
import { classes } from "@utils/misc";
import { JSX } from "react";
export default ({ className }: { className?: string; }): JSX.Element => (
<svg

View file

@ -4,6 +4,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { JSX } from "react";
const component = (props: React.SVGProps<SVGSVGElement>): JSX.Element => (
<svg viewBox="6 3.7 16 16" width={24} height={24} {...(props as React.SVGProps<SVGSVGElement>)}>
<path

View file

@ -4,6 +4,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { JSX } from "react";
const OverFlowIcon = ({ width = 24, height = 24, color = "var(--interactive-normal)", className, ...rest }) => (
<svg
{...rest}

View file

@ -12,7 +12,7 @@ import { SvgOverFlowIcon } from "../icons/overFlowIcon";
export function NoteBookTabs({ tabs, selectedTabId, onSelectTab }: { tabs: string[], selectedTabId: string, onSelectTab: (tab: string) => void }) {
export function NoteBookTabs({ tabs, selectedTabId, onSelectTab }: { tabs: string[], selectedTabId: string, onSelectTab: (tab: string) => void; }) {
const tabBarRef = React.useRef<HTMLDivElement>(null);
const widthRef = React.useRef<number>(0);
const tabWidthMapRef = React.useRef(new Map());
@ -64,7 +64,7 @@ export function NoteBookTabs({ tabs, selectedTabId, onSelectTab }: { tabs: strin
};
}, [handleResize]);
const TabItem = React.forwardRef(function ({ id, selected, onClick, children }: { id: string, selected: boolean, onClick: () => void, children: React.ReactNode }, ref) {
const TabItem = React.forwardRef(function ({ id, selected, onClick, children }: { id: string, selected: boolean, onClick: () => void, children: React.ReactNode; }, ref) {
return (
<Clickable
className={classes("vc-notebook-tabbar-item", selected ? "vc-notebook-selected" : "")}
@ -111,6 +111,7 @@ export function NoteBookTabs({ tabs, selectedTabId, onSelectTab }: { tabs: strin
if (!overflowedTabs.includes(tab)) {
return (
<TabItem
key={tab}
id={tab}
selected={selectedTabId === tab}
ref={(el: HTMLElement | null) => {
@ -120,7 +121,7 @@ export function NoteBookTabs({ tabs, selectedTabId, onSelectTab }: { tabs: strin
width: el ? el.getBoundingClientRect().width : width
});
}}
onClick={selectedTabId !== tab ? () => onSelectTab(tab) : () => {}}
onClick={selectedTabId !== tab ? () => onSelectTab(tab) : () => { }}
>
{tab}
</TabItem>
@ -145,7 +146,7 @@ export function NoteBookTabs({ tabs, selectedTabId, onSelectTab }: { tabs: strin
look={Button.Looks.BLANK}
onClick={() => setShow(v => !v)}
>
<SvgOverFlowIcon className={classes(overflowIcon)} width={16} height={16}/>
<SvgOverFlowIcon className={classes(overflowIcon)} width={16} height={16} />
</Button>
)}
</Popout>

View file

@ -32,6 +32,7 @@ const renderNotebook = ({
}) => {
const messageArray = Object.values(notes).map(note => (
<RenderMessage
key={notebook}
note={note}
notebook={notebook}
updateParent={updateParent}

View file

@ -35,6 +35,7 @@ export default ({ onClose, notebook, onChangeTab, ...props }: ModalProps & { onC
{notes && Object.keys(notes).length > 0 ? (
Object.values(notes).map(note => (
<RenderMessage
key={notebook}
note={note}
notebook={notebook}
fromDeleteModal={true} />

View file

@ -165,6 +165,7 @@ const NoteContextMenu = (
if (key !== notebook) {
return (
<Menu.MenuItem
key={key}
label={`Move to ${key}`}
id={key}
action={() => {

View file

@ -42,6 +42,7 @@ const messageContextMenuPatch: NavContextMenuPatchCallback = async (children, {
<Menu.MenuItem label="Add Message To" id="add-message-to-note">
{Object.keys(noteHandler.getAllNotes()).map((notebook: string, index: number) => (
<Menu.MenuItem
key={notebook}
label={notebook}
id={notebook}
action={() => noteHandler.addNote(message, notebook)}
@ -103,7 +104,7 @@ export default definePlugin({
);
e.toolbar = [
<ErrorBoundary noop={true}>
<ErrorBoundary noop={true} key={"HolyNotes"}>
<ToolBarHeader />
</ErrorBoundary>,
e.toolbar,