Merge remote-tracking branch 'upstream/dev'

This commit is contained in:
thororen1234 2025-12-10 19:42:28 -05:00
commit e2384214ca
No known key found for this signature in database
2 changed files with 31 additions and 20 deletions

View file

@ -31,7 +31,7 @@ let LayoutTypes = {
PANEL: 3,
PANE: 4
};
waitFor(["SECTION", "SIDEBAR_ITEM", "PANEL", "PANE"], v => LayoutTypes = v);
waitFor(["SECTION", "SIDEBAR_ITEM", "PANEL"], v => LayoutTypes = v);
const FallbackSectionTypes = {
HEADER: "HEADER",
@ -174,6 +174,34 @@ export default definePlugin({
buildEntry(options: EntryOptions): SettingsLayoutNode {
const { key, title, panelTitle = title, Component, Icon } = options;
const panel: SettingsLayoutNode = {
key: key + "_panel",
type: LayoutTypes.PANEL,
useTitle: () => panelTitle,
};
const render = {
// FIXME
StronglyDiscouragedCustomComponent: () => <Component />,
render: () => <Component />,
};
// FIXME
if (LayoutTypes.PANE) {
panel.buildLayout = () => [
{
key: key + "_pane",
type: LayoutTypes.PANE,
useTitle: () => panelTitle,
buildLayout: () => [],
...render
}
];
} else {
Object.assign(panel, render);
panel.buildLayout = () => [];
}
return ({
key,
type: LayoutTypes.SIDEBAR_ITEM,
@ -182,24 +210,7 @@ export default definePlugin({
getLegacySearchKey: () => title.toUpperCase(),
useTitle: () => title,
icon: () => <Icon width={20} height={20} />,
buildLayout: () => [
{
key: key + "_panel",
type: LayoutTypes.PANEL,
useTitle: () => panelTitle,
buildLayout: () => [
{
key: key + "_pane",
type: LayoutTypes.PANE,
buildLayout: () => [],
// FIXME
StronglyDiscouragedCustomComponent: () => <Component />,
render: () => <Component />,
useTitle: () => panelTitle
}
]
}
]
buildLayout: () => [panel]
});
},

View file

@ -50,7 +50,7 @@ export default definePlugin({
},
{
find: "numLockedEmojiResults:",
find: "numEmojiResults:",
replacement: [
// set maxCount to Infinity so our sortEmojis callback gets the entire list, not just the first 10
// and remove Discord's emojiResult slice, storing the endIndex on the array for us to use later