From 082f9a0bd1308398513a59a516153153ba489361 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Mon, 11 Nov 2024 14:41:31 -0800 Subject: [PATCH] export Color and ImportDict in top-level namespace (#4352) These are useful for typing purposes and should be exposed at the top level to avoid requiring deep imports from subpackages that we may need to change later. --- reflex/__init__.py | 3 ++- reflex/__init__.pyi | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/reflex/__init__.py b/reflex/__init__.py index cfb971a99..3941542f2 100644 --- a/reflex/__init__.py +++ b/reflex/__init__.py @@ -298,6 +298,7 @@ _MAPPING: dict = { "components.moment": ["MomentDelta", "moment"], "config": ["Config", "DBConfig"], "constants": ["Env"], + "constants.colors": ["Color"], "event": [ "EventChain", "EventHandler", @@ -338,7 +339,7 @@ _MAPPING: dict = { ], "istate.wrappers": ["get_state"], "style": ["Style", "toggle_color_mode"], - "utils.imports": ["ImportVar"], + "utils.imports": ["ImportDict", "ImportVar"], "utils.serializers": ["serializer"], "vars": ["Var", "field", "Field"], } diff --git a/reflex/__init__.pyi b/reflex/__init__.pyi index 2d22fe497..30a498db4 100644 --- a/reflex/__init__.pyi +++ b/reflex/__init__.pyi @@ -152,6 +152,7 @@ from .components.suneditor import editor as editor from .config import Config as Config from .config import DBConfig as DBConfig from .constants import Env as Env +from .constants.colors import Color as Color from .event import EventChain as EventChain from .event import EventHandler as EventHandler from .event import background as background @@ -192,6 +193,7 @@ from .state import dynamic as dynamic from .state import var as var from .style import Style as Style from .style import toggle_color_mode as toggle_color_mode +from .utils.imports import ImportDict as ImportDict from .utils.imports import ImportVar as ImportVar from .utils.serializers import serializer as serializer from .vars import Field as Field