Skip to content

Commit

Permalink
chore: Remove reexport prelude. (#599)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
huacnlee authored Feb 4, 2025
1 parent 155f2ee commit 3e16c0d
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 37 deletions.
9 changes: 4 additions & 5 deletions crates/story/src/button_story.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use gpui::{
actions, px, App, AppContext as _, ClickEvent, Context, Entity, Focusable, InteractiveElement,
IntoElement, ParentElement as _, Render, Styled as _, Window,
actions, prelude::FluentBuilder, px, App, AppContext as _, ClickEvent, Context, Entity,
Focusable, InteractiveElement, IntoElement, ParentElement as _, Render, Styled as _, Window,
};

use ui::{
button::{Button, ButtonCustomVariant, ButtonGroup, ButtonVariants as _, DropdownButton},
checkbox::Checkbox,
h_flex,
prelude::FluentBuilder,
v_flex, ActiveTheme, Disableable as _, Icon, IconName, Selectable as _, Sizable as _, Theme,
h_flex, v_flex, ActiveTheme, Disableable as _, Icon, IconName, Selectable as _, Sizable as _,
Theme,
};

use crate::section;
Expand Down
5 changes: 2 additions & 3 deletions crates/story/src/form_story.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use gpui::{
actions, div, App, AppContext, Axis, Context, Entity, Focusable, InteractiveElement,
IntoElement, ParentElement as _, Render, Styled, Window,
actions, div, prelude::FluentBuilder as _, App, AppContext, Axis, Context, Entity, Focusable,
InteractiveElement, IntoElement, ParentElement as _, Render, Styled, Window,
};
use ui::{
button::{Button, ButtonGroup},
Expand All @@ -10,7 +10,6 @@ use ui::{
form::{form_field, v_form},
h_flex,
input::TextInput,
prelude::FluentBuilder as _,
switch::Switch,
v_flex, AxisExt, FocusableCycle, Selectable, Sizable, Size,
};
Expand Down
7 changes: 3 additions & 4 deletions crates/story/src/input_story.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use gpui::{
actions, div, px, App, AppContext as _, Context, Entity, FocusHandle, Focusable,
InteractiveElement, IntoElement, KeyBinding, ParentElement as _, Render, SharedString, Styled,
Window,
actions, div, prelude::FluentBuilder as _, px, App, AppContext as _, Context, Entity,
FocusHandle, Focusable, InteractiveElement, IntoElement, KeyBinding, ParentElement as _,
Render, SharedString, Styled, Window,
};
use regex::Regex;

Expand All @@ -11,7 +11,6 @@ use ui::{
checkbox::Checkbox,
h_flex,
input::{InputEvent, NumberInput, NumberInputEvent, OtpInput, TextInput},
prelude::FluentBuilder as _,
v_flex, FocusableCycle, IconName, Sizable,
};

Expand Down
5 changes: 2 additions & 3 deletions crates/story/src/sidebar_story.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use gpui::{
div, impl_internal_actions, relative, App, AppContext, ClickEvent, Context, Entity, Focusable,
ParentElement, Render, SharedString, Styled, Window,
div, impl_internal_actions, prelude::FluentBuilder, relative, App, AppContext, ClickEvent,
Context, Entity, Focusable, ParentElement, Render, SharedString, Styled, Window,
};

use serde::Deserialize;
Expand All @@ -9,7 +9,6 @@ use ui::{
divider::Divider,
h_flex,
popup_menu::PopupMenuExt,
prelude::FluentBuilder,
sidebar::{
Sidebar, SidebarFooter, SidebarGroup, SidebarHeader, SidebarMenu, SidebarToggleButton,
},
Expand Down
7 changes: 3 additions & 4 deletions crates/story/src/table_story.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use std::{

use fake::{Fake, Faker};
use gpui::{
div, impl_internal_actions, px, AnyElement, App, AppContext, Context, Edges, Entity, Focusable,
InteractiveElement, IntoElement, ParentElement, Pixels, Render, SharedString, Styled, Timer,
Window,
div, impl_internal_actions, prelude::FluentBuilder as _, px, AnyElement, App, AppContext,
Context, Edges, Entity, Focusable, InteractiveElement, IntoElement, ParentElement, Pixels,
Render, SharedString, Styled, Timer, Window,
};
use serde::Deserialize;
use ui::{
Expand All @@ -18,7 +18,6 @@ use ui::{
input::{InputEvent, TextInput},
label::Label,
popup_menu::{PopupMenu, PopupMenuExt},
prelude::FluentBuilder as _,
table::{ColFixed, ColSort, Table, TableDelegate, TableEvent},
v_flex, ActiveTheme as _, Selectable, Sizable as _, Size, StyleSized as _,
};
Expand Down
7 changes: 3 additions & 4 deletions crates/story/src/title_bar.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
use std::rc::Rc;

use gpui::{
div, px, AnyElement, App, AppContext, ClickEvent, Context, Corner, Entity, FocusHandle, Hsla,
InteractiveElement as _, IntoElement, MouseButton, ParentElement as _, Render, SharedString,
Styled as _, Subscription, Window,
div, prelude::FluentBuilder as _, px, AnyElement, App, AppContext, ClickEvent, Context, Corner,
Entity, FocusHandle, Hsla, InteractiveElement as _, IntoElement, MouseButton,
ParentElement as _, Render, SharedString, Styled as _, Subscription, Window,
};
use ui::{
badge::Badge,
button::{Button, ButtonVariants as _},
color_picker::{ColorPicker, ColorPickerEvent},
popup_menu::PopupMenuExt as _,
prelude::FluentBuilder as _,
scroll::ScrollbarShow,
ActiveTheme as _, ContextModal as _, IconName, Sizable as _, Theme, TitleBar,
};
Expand Down
7 changes: 3 additions & 4 deletions crates/ui/src/input/number_input.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
use gpui::{
actions, px, App, AppContext as _, Context, Entity, EventEmitter, FocusHandle, Focusable,
InteractiveElement, IntoElement, KeyBinding, ParentElement, Pixels, Render, SharedString,
Styled, Subscription, Window,
actions, prelude::FluentBuilder as _, px, App, AppContext as _, Context, Entity, EventEmitter,
FocusHandle, Focusable, InteractiveElement, IntoElement, KeyBinding, ParentElement, Pixels,
Render, SharedString, Styled, Subscription, Window,
};
use regex::Regex;

use crate::{
button::{Button, ButtonVariants as _},
h_flex,
input::{InputEvent, TextInput},
prelude::FluentBuilder,
ActiveTheme, IconName, Sizable, Size, StyleSized, StyledExt,
};

Expand Down
1 change: 0 additions & 1 deletion crates/ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ pub mod modal;
pub mod notification;
pub mod popover;
pub mod popup_menu;
pub mod prelude;
pub mod progress;
pub mod radio;
pub mod resizable;
Expand Down
9 changes: 0 additions & 9 deletions crates/ui/src/prelude.rs

This file was deleted.

0 comments on commit 3e16c0d

Please sign in to comment.