This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,52 @@
// Metro module 13623 (f13624).
import { useMemo } from "react";
import AccessibilityStore from "../a11y/AccessibilityStore";
import ThemeStore from "../user_settings/ThemeStore";
import { ThemeTypes } from "../../_bundle/Module505";
import { useStateFromStoresObject } from "../../_bundle/Module589";
import useColorThemeBackground from "../client_themes/native/useColorThemeBackground";
import { useMobileVisualRefreshConfig } from "./experiments/MobileVisualRefreshExperiment";
import { useManaTypeConsolidationExperiment } from "../design/ManaTypeConsolidationExperiment";
import { setThemeFlag, ThemeContextFlags } from "../../_bundle/Module3901";
import * as _RootThemeContextProvider_native from "../../design/components/ThemeContextProvider/native/RootThemeContextProvider.native";
export function RootThemeContextProvider(props) {
let enabled, chatInputFloating, chatInputLegacySendButton, manaTypeConsolidationExperiment;
const children = props.children;
enabled = void 0;
chatInputFloating = void 0;
chatInputLegacySendButton = void 0;
manaTypeConsolidationExperiment = void 0;
const stateFromStoresObject = useStateFromStoresObject([AccessibilityStore, ThemeStore], () => ({
saturation: AccessibilityStore.saturation,
contrast: AccessibilityStore.contrast,
theme: ThemeStore.theme
}));
const { saturation, contrast, theme } = stateFromStoresObject;
const colorThemeBackground = useColorThemeBackground();
const mobileVisualRefreshConfig = useMobileVisualRefreshConfig({
location: "RootThemeContextProvider"
});
enabled = mobileVisualRefreshConfig.enabled;
chatInputFloating = mobileVisualRefreshConfig.chatInputFloating;
chatInputLegacySendButton = mobileVisualRefreshConfig.chatInputLegacySendButton;
manaTypeConsolidationExperiment = useManaTypeConsolidationExperiment("RootThemeContextProvider");
const memo = useMemo(() => {
const r3 = [];
if (chatInputLegacySendButton) {
r3.push("mobile-visual-refresh-legacy-send-button");
}
if (chatInputFloating) {
r3.push("mobile-visual-refresh-floating");
}
if (enabled) {
r3.push("mobile-visual-refresh");
}
if (manaTypeConsolidationExperiment) {
r3.push("mana-type-consolidation");
}
return r3.length > 0 ? r3 : void 0;
}, [enabled, chatInputFloating, chatInputLegacySendButton, manaTypeConsolidationExperiment]);
const r43 = colorThemeBackground != null ? colorThemeBackground.theme === ThemeTypes.LIGHT ? setThemeFlag(0, ThemeContextFlags.MOBILE_LIGHT_GRADIENT_THEME_ENABLED) : setThemeFlag(0, ThemeContextFlags.MOBILE_DARK_GRADIENT_THEME_ENABLED) : 0;
const r63 = saturation !== 1 ? setThemeFlag(r43, ThemeContextFlags.REDUCE_SATURATION_ENABLED) : r43;
return <_RootThemeContextProvider_native.RootThemeContextProvider theme={theme} flags={contrast !== 1 ? setThemeFlag(r63, contrast > 1 ? ThemeContextFlags.INCREASED_CONTRAST_ENABLED : ThemeContextFlags.REDUCED_CONTRAST_ENABLED) : r63} saturation={saturation} contrast={contrast} enabledExperiments={memo}>{children}</_RootThemeContextProvider_native.RootThemeContextProvider>;
}
@@ -0,0 +1,59 @@
// Metro module 1348 (f1349).
import ApexExperiment from "../../experiments/apex/ApexExperiment";
let c1120_0 = ApexExperiment({
kind: "user",
name: "2026-02-mobile-visual-refresh",
defaultConfig: {
enabled: false,
chatInputFloating: false,
chatInputLegacySendButton: false
},
variations: {
0: {
enabled: false,
chatInputFloating: false,
chatInputLegacySendButton: false
},
1: {
enabled: true,
chatInputFloating: false,
chatInputLegacySendButton: false
},
2: {
enabled: true,
chatInputFloating: true,
chatInputLegacySendButton: false
},
3: {
enabled: true,
chatInputFloating: true,
chatInputLegacySendButton: false
},
4: {
enabled: true,
chatInputFloating: true,
chatInputLegacySendButton: true
}
}
});
export default function useIsMobileVisualRefreshExperimentEnabled(a0) {
return c1120_0.useConfig({
location: a0
}).enabled;
};
export { c1120_0 as MobileVisualRefreshExperiment };
export function useMobileVisualRefreshConfig(a0) {
return c1120_0.useConfig({
location: a0.location
});
}
export function isMobileVisualRefreshEnabled(a0) {
return c1120_0.getConfig({
location: a0
}).enabled;
}
export function resolveRefreshToken(a0, a1) {
return a0.resolve.call(a0, {
enabledExperiments: a1 ? ["mobile-visual-refresh"] : []
});
}
+13
View File
@@ -0,0 +1,13 @@
// Metro module 1339 (f1340).
import { Appearance } from "react-native";
import { SystemTheme } from "../user_settings/ThemeConstants";
export default function getSystemTheme() {
const colorScheme = Appearance.getColorScheme();
if (colorScheme === "light") {
return SystemTheme.LIGHT;
}
if (colorScheme === "dark") {
return SystemTheme.DARK;
}
return SystemTheme.NO_PREFERENCE;
};
@@ -0,0 +1,7 @@
// Metro module 13503 (f13504).
import { NativeModules } from "react-native";
import { isAndroid } from "../../../utils/PlatformUtils";
import Module13504 from "../../../_bundle/Module13504";
export function updateSaturation(a0) {
return isAndroid() ? Module13504.updateSaturation(a0) : NativeModules.DCDTheme.updateSaturation(a0);
}
+7
View File
@@ -0,0 +1,7 @@
// Metro module 15785 (f15786).
import { NativeModules } from "react-native";
import { isAndroid } from "../../../utils/PlatformUtils";
import Module13504 from "../../../_bundle/Module13504";
export function updateTheme(a0) {
return isAndroid() ? Module13504.updateTheme(a0) : NativeModules.DCDTheme.updateTheme(a0);
}
@@ -0,0 +1,7 @@
// Metro module 15784 (f15785).
import { NativeModules } from "react-native";
import { isAndroid } from "../../../utils/PlatformUtils";
import Module13504 from "../../../_bundle/Module13504";
export function updateVisualRefresh(a0) {
return isAndroid() ? Module13504.setVisualRefreshEnabled(a0) : NativeModules.DCDTheme.setVisualRefreshEnabled(a0);
}
@@ -0,0 +1,27 @@
// Metro module 15783 (f15784).
import { useRef, useLayoutEffect } from "react";
import ThemeStore from "../../user_settings/ThemeStore";
import MobileVisualRefreshExperiment from "../experiments/MobileVisualRefreshExperiment";
import { updateVisualRefresh } from "./updateVisualRefresh";
import { updateTheme } from "./updateTheme";
export default function useNativeThemeUpdater() {
const r9 = MobileVisualRefreshExperiment("useNativeThemeUpdater");
let c22440_0 = r9;
const ref = useRef(ThemeStore.theme);
useLayoutEffect(() => {
updateVisualRefresh(c22440_0);
}, [r9]);
useLayoutEffect(() => {
const handleThemeUpdate2 = function handleThemeUpdate() {
if (ThemeStore.theme !== ref.current) {
ref.current = ThemeStore.theme;
updateTheme(ThemeStore.theme);
}
};
updateTheme(ThemeStore.theme);
ThemeStore.addChangeListener(handleThemeUpdate2);
return () => {
ThemeStore.removeChangeListener(handleThemeUpdate2);
};
}, []);
};
+27
View File
@@ -0,0 +1,27 @@
// Metro module 1345 (f1346).
import CustomThemeMobileStore from "../client_themes/native/CustomThemeMobileStore";
import SelectivelySyncedUserSettingsStore from "../user_settings/SelectivelySyncedUserSettingsStore";
import UnsyncedUserSettingsStore from "../user_settings/UnsyncedUserSettingsStore";
import UserSettingsProtoStore from "../user_settings/UserSettingsProtoStore";
import { PROTO_THEME_MAP_MOBILE, PROTO_THEME_MAP_MOBILE_REFRESH, SystemTheme, SystemThemeState } from "../user_settings/ThemeConstants";
import { isAuthenticated } from "../../utils/AuthenticationUtils";
import { Theme } from "../../_bundle/Module1306";
import { isMobileVisualRefreshEnabled } from "./experiments/MobileVisualRefreshExperiment";
export default function resolveTheme(a0, a1) {
const previewTheme = CustomThemeMobileStore.getPreviewTheme();
if (previewTheme !== void 0) {
return previewTheme.baseTheme;
}
if (!(isAuthenticated() && UnsyncedUserSettingsStore.useSystemTheme !== SystemThemeState.ON) && a0 !== SystemTheme.NO_PREFERENCE) {
return a1[a0];
}
const theme = SelectivelySyncedUserSettingsStore.getAppearanceSettings()?.theme;
if (theme != null) {
return theme;
}
let r29 = UserSettingsProtoStore.settings.appearance?.theme;
if (r29 == null) {
r29 = Theme.UNSET;
}
return r29 === Theme.UNSET && a0 !== SystemTheme.NO_PREFERENCE ? a1[a0] : (isMobileVisualRefreshEnabled("resolveTheme") ? PROTO_THEME_MAP_MOBILE_REFRESH : PROTO_THEME_MAP_MOBILE)[r29];
};
@@ -0,0 +1,2 @@
// Metro module 1354 (f1355).
export default function updateBackgroundColor() {};