mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-15 17:43:08 -04:00
Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
f3ec0d86eb
13 changed files with 111 additions and 59 deletions
19
src/webpack/common/types/utils.d.ts
vendored
19
src/webpack/common/types/utils.d.ts
vendored
|
@ -223,9 +223,26 @@ export interface Constants {
|
|||
FriendsSections: Record<string, string>;
|
||||
}
|
||||
|
||||
export type ActiveView = LiteralUnion<"emoji" | "gif" | "sticker" | "soundboard", string>;
|
||||
|
||||
export interface ExpressionPickerStoreState extends Record<PropertyKey, any> {
|
||||
activeView: ActiveView | null;
|
||||
lastActiveView: ActiveView | null;
|
||||
activeViewType: any | null;
|
||||
searchQuery: string;
|
||||
isSearchSuggestion: boolean,
|
||||
pickerId: string;
|
||||
}
|
||||
|
||||
export interface ExpressionPickerStore {
|
||||
openExpressionPicker(activeView: ActiveView, activeViewType?: any): void;
|
||||
closeExpressionPicker(activeViewType?: any): void;
|
||||
openExpressionPicker(activeView: LiteralUnion<"emoji" | "gif" | "sticker", string>, activeViewType?: any): void;
|
||||
toggleMultiExpressionPicker(activeViewType?: any): void;
|
||||
toggleExpressionPicker(activeView: ActiveView, activeViewType?: any): void;
|
||||
setExpressionPickerView(activeView: ActiveView): void;
|
||||
setSearchQuery(searchQuery: string, isSearchSuggestion?: boolean): void;
|
||||
useExpressionPickerStore(): ExpressionPickerStoreState;
|
||||
useExpressionPickerStore<T>(selector: (state: ExpressionPickerStoreState) => T): T;
|
||||
}
|
||||
|
||||
export interface BrowserWindowFeatures {
|
||||
|
|
|
@ -16,10 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { canonicalizeMatch } from "@utils/patches";
|
||||
import { _resolveReady, filters, findByCodeLazy, findByPropsLazy, findLazy, mapMangledModuleLazy, waitFor } from "@webpack";
|
||||
import type { Channel } from "discord-types/general";
|
||||
|
||||
import { _resolveReady, filters, findByCodeLazy, findByPropsLazy, findLazy, mapMangledModuleLazy, waitFor } from "../webpack";
|
||||
import type * as t from "./types/utils";
|
||||
|
||||
export let FluxDispatcher: t.FluxDispatcher;
|
||||
|
@ -168,11 +167,14 @@ export const ReadStateUtils = mapMangledModuleLazy('type:"ENABLE_AUTOMATIC_ACK",
|
|||
ackChannel: filters.byCode(".getActiveJoinedThreadsForParent(")
|
||||
});
|
||||
|
||||
const openExpressionPickerMatcher = canonicalizeMatch(/setState\({activeView:\i,activeViewType:/);
|
||||
// TODO: type
|
||||
export const ExpressionPickerStore: t.ExpressionPickerStore = mapMangledModuleLazy("expression-picker-last-active-view", {
|
||||
openExpressionPicker: filters.byCode(/setState\({activeView:(?:(?!null)\i),activeViewType:/),
|
||||
closeExpressionPicker: filters.byCode("setState({activeView:null"),
|
||||
openExpressionPicker: m => typeof m === "function" && openExpressionPickerMatcher.test(m.toString()),
|
||||
toggleMultiExpressionPicker: filters.byCode(".EMOJI,"),
|
||||
toggleExpressionPicker: filters.byCode(/getState\(\)\.activeView===\i\?\i\(\):\i\(/),
|
||||
setExpressionPickerView: filters.byCode(/setState\({activeView:\i,lastActiveView:/),
|
||||
setSearchQuery: filters.byCode("searchQuery:"),
|
||||
useExpressionPickerStore: filters.byCode("Object.is")
|
||||
});
|
||||
|
||||
export const PopoutActions: t.PopoutActions = mapMangledModuleLazy('type:"POPOUT_WINDOW_OPEN"', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue