chore: Remove reexport prelude. (#599)

This is useless, we can just use `gpui::prelude`, so I removed it.

## Break changes

- The `ui::prelude` has been removed, you can replace by use
`gpui::prelude`.
This commit is contained in:
Jason Lee 2025-02-04 17:37:28 +08:00 committed by GitHub
parent 155f2ee3b9
commit 3e16c0d220
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 20 additions and 37 deletions

View file

@ -1,14 +1,13 @@
use gpui::{ use gpui::{
actions, px, App, AppContext as _, ClickEvent, Context, Entity, Focusable, InteractiveElement, actions, prelude::FluentBuilder, px, App, AppContext as _, ClickEvent, Context, Entity,
IntoElement, ParentElement as _, Render, Styled as _, Window, Focusable, InteractiveElement, IntoElement, ParentElement as _, Render, Styled as _, Window,
}; };
use ui::{ use ui::{
button::{Button, ButtonCustomVariant, ButtonGroup, ButtonVariants as _, DropdownButton}, button::{Button, ButtonCustomVariant, ButtonGroup, ButtonVariants as _, DropdownButton},
checkbox::Checkbox, checkbox::Checkbox,
h_flex, h_flex, v_flex, ActiveTheme, Disableable as _, Icon, IconName, Selectable as _, Sizable as _,
prelude::FluentBuilder, Theme,
v_flex, ActiveTheme, Disableable as _, Icon, IconName, Selectable as _, Sizable as _, Theme,
}; };
use crate::section; use crate::section;

View file

@ -1,6 +1,6 @@
use gpui::{ use gpui::{
actions, div, App, AppContext, Axis, Context, Entity, Focusable, InteractiveElement, actions, div, prelude::FluentBuilder as _, App, AppContext, Axis, Context, Entity, Focusable,
IntoElement, ParentElement as _, Render, Styled, Window, InteractiveElement, IntoElement, ParentElement as _, Render, Styled, Window,
}; };
use ui::{ use ui::{
button::{Button, ButtonGroup}, button::{Button, ButtonGroup},
@ -10,7 +10,6 @@ use ui::{
form::{form_field, v_form}, form::{form_field, v_form},
h_flex, h_flex,
input::TextInput, input::TextInput,
prelude::FluentBuilder as _,
switch::Switch, switch::Switch,
v_flex, AxisExt, FocusableCycle, Selectable, Sizable, Size, v_flex, AxisExt, FocusableCycle, Selectable, Sizable, Size,
}; };

View file

@ -1,7 +1,7 @@
use gpui::{ use gpui::{
actions, div, px, App, AppContext as _, Context, Entity, FocusHandle, Focusable, actions, div, prelude::FluentBuilder as _, px, App, AppContext as _, Context, Entity,
InteractiveElement, IntoElement, KeyBinding, ParentElement as _, Render, SharedString, Styled, FocusHandle, Focusable, InteractiveElement, IntoElement, KeyBinding, ParentElement as _,
Window, Render, SharedString, Styled, Window,
}; };
use regex::Regex; use regex::Regex;
@ -11,7 +11,6 @@ use ui::{
checkbox::Checkbox, checkbox::Checkbox,
h_flex, h_flex,
input::{InputEvent, NumberInput, NumberInputEvent, OtpInput, TextInput}, input::{InputEvent, NumberInput, NumberInputEvent, OtpInput, TextInput},
prelude::FluentBuilder as _,
v_flex, FocusableCycle, IconName, Sizable, v_flex, FocusableCycle, IconName, Sizable,
}; };

View file

@ -1,6 +1,6 @@
use gpui::{ use gpui::{
div, impl_internal_actions, relative, App, AppContext, ClickEvent, Context, Entity, Focusable, div, impl_internal_actions, prelude::FluentBuilder, relative, App, AppContext, ClickEvent,
ParentElement, Render, SharedString, Styled, Window, Context, Entity, Focusable, ParentElement, Render, SharedString, Styled, Window,
}; };
use serde::Deserialize; use serde::Deserialize;
@ -9,7 +9,6 @@ use ui::{
divider::Divider, divider::Divider,
h_flex, h_flex,
popup_menu::PopupMenuExt, popup_menu::PopupMenuExt,
prelude::FluentBuilder,
sidebar::{ sidebar::{
Sidebar, SidebarFooter, SidebarGroup, SidebarHeader, SidebarMenu, SidebarToggleButton, Sidebar, SidebarFooter, SidebarGroup, SidebarHeader, SidebarMenu, SidebarToggleButton,
}, },

View file

@ -5,9 +5,9 @@ use std::{
use fake::{Fake, Faker}; use fake::{Fake, Faker};
use gpui::{ use gpui::{
div, impl_internal_actions, px, AnyElement, App, AppContext, Context, Edges, Entity, Focusable, div, impl_internal_actions, prelude::FluentBuilder as _, px, AnyElement, App, AppContext,
InteractiveElement, IntoElement, ParentElement, Pixels, Render, SharedString, Styled, Timer, Context, Edges, Entity, Focusable, InteractiveElement, IntoElement, ParentElement, Pixels,
Window, Render, SharedString, Styled, Timer, Window,
}; };
use serde::Deserialize; use serde::Deserialize;
use ui::{ use ui::{
@ -18,7 +18,6 @@ use ui::{
input::{InputEvent, TextInput}, input::{InputEvent, TextInput},
label::Label, label::Label,
popup_menu::{PopupMenu, PopupMenuExt}, popup_menu::{PopupMenu, PopupMenuExt},
prelude::FluentBuilder as _,
table::{ColFixed, ColSort, Table, TableDelegate, TableEvent}, table::{ColFixed, ColSort, Table, TableDelegate, TableEvent},
v_flex, ActiveTheme as _, Selectable, Sizable as _, Size, StyleSized as _, v_flex, ActiveTheme as _, Selectable, Sizable as _, Size, StyleSized as _,
}; };

View file

@ -1,16 +1,15 @@
use std::rc::Rc; use std::rc::Rc;
use gpui::{ use gpui::{
div, px, AnyElement, App, AppContext, ClickEvent, Context, Corner, Entity, FocusHandle, Hsla, div, prelude::FluentBuilder as _, px, AnyElement, App, AppContext, ClickEvent, Context, Corner,
InteractiveElement as _, IntoElement, MouseButton, ParentElement as _, Render, SharedString, Entity, FocusHandle, Hsla, InteractiveElement as _, IntoElement, MouseButton,
Styled as _, Subscription, Window, ParentElement as _, Render, SharedString, Styled as _, Subscription, Window,
}; };
use ui::{ use ui::{
badge::Badge, badge::Badge,
button::{Button, ButtonVariants as _}, button::{Button, ButtonVariants as _},
color_picker::{ColorPicker, ColorPickerEvent}, color_picker::{ColorPicker, ColorPickerEvent},
popup_menu::PopupMenuExt as _, popup_menu::PopupMenuExt as _,
prelude::FluentBuilder as _,
scroll::ScrollbarShow, scroll::ScrollbarShow,
ActiveTheme as _, ContextModal as _, IconName, Sizable as _, Theme, TitleBar, ActiveTheme as _, ContextModal as _, IconName, Sizable as _, Theme, TitleBar,
}; };

View file

@ -1,7 +1,7 @@
use gpui::{ use gpui::{
actions, px, App, AppContext as _, Context, Entity, EventEmitter, FocusHandle, Focusable, actions, prelude::FluentBuilder as _, px, App, AppContext as _, Context, Entity, EventEmitter,
InteractiveElement, IntoElement, KeyBinding, ParentElement, Pixels, Render, SharedString, FocusHandle, Focusable, InteractiveElement, IntoElement, KeyBinding, ParentElement, Pixels,
Styled, Subscription, Window, Render, SharedString, Styled, Subscription, Window,
}; };
use regex::Regex; use regex::Regex;
@ -9,7 +9,6 @@ use crate::{
button::{Button, ButtonVariants as _}, button::{Button, ButtonVariants as _},
h_flex, h_flex,
input::{InputEvent, TextInput}, input::{InputEvent, TextInput},
prelude::FluentBuilder,
ActiveTheme, IconName, Sizable, Size, StyleSized, StyledExt, ActiveTheme, IconName, Sizable, Size, StyleSized, StyledExt,
}; };

View file

@ -34,7 +34,6 @@ pub mod modal;
pub mod notification; pub mod notification;
pub mod popover; pub mod popover;
pub mod popup_menu; pub mod popup_menu;
pub mod prelude;
pub mod progress; pub mod progress;
pub mod radio; pub mod radio;
pub mod resizable; pub mod resizable;

View file

@ -1,9 +0,0 @@
//! The prelude of this crate. When building UI in Zed you almost always want to import this.
pub use gpui::prelude::*;
#[allow(unused_imports)]
pub use gpui::{
div, px, relative, rems, AbsoluteLength, App, Context, DefiniteLength, Div, Element, ElementId,
Entity, InteractiveElement, ParentElement, Pixels, Rems, RenderOnce, SharedString, Styled,
Window,
};