1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
use floating_ui_core::middleware::{
    Arrow as CoreArrow, AutoPlacement as CoreAutoPlacement, Flip as CoreFlip, Hide as CoreHide,
    Inline as CoreInline, Offset as CoreOffset, Shift as CoreShift, Size as CoreSize,
};
use web_sys::{Element, Window};

pub use floating_ui_core::middleware::{
    ApplyState, ArrowData, ArrowOptions, AutoPlacementData, AutoPlacementDataOverflow,
    AutoPlacementOptions, DefaultLimiter, FallbackStrategy, FlipData, FlipDataOverflow,
    FlipOptions, HideData, HideOptions, HideStrategy, InlineOptions, LimitShift, LimitShiftOffset,
    LimitShiftOffsetValues, LimitShiftOptions, OffsetData, OffsetOptions, OffsetOptionsValues,
    ShiftData, ShiftOptions, SizeOptions, ARROW_NAME, AUTO_PLACEMENT_NAME, FLIP_NAME, HIDE_NAME,
    INLINE_NAME, OFFSET_NAME, SHIFT_NAME, SIZE_NAME,
};

/// Provides data to position an inner element of the floating element so that it appears centered to the reference element.
///
/// See <https://floating-ui.com/docs/arrow> for the original documentation.
pub type Arrow<'a> = CoreArrow<'a, Element, Window>;

/// Optimizes the visibility of the floating element by choosing the placement that has the most space available automatically, without needing to specify a preferred placement.
/// Alternative to [`Flip`].
///
/// See <https://floating-ui.com/docs/autoPlacement> for the original documentation.
pub type AutoPlacement<'a> = CoreAutoPlacement<'a, Element, Window>;

/// Optimizes the visibility of the floating element by flipping the `placement` in order to keep it in view when the preferred placement(s) will overflow the clipping boundary.
/// Alternative to [`AutoPlacement`].
///
/// See <https://floating-ui.com/docs/flip> for the original documentation.
pub type Flip<'a> = CoreFlip<'a, Element, Window>;

/// Provides data to hide the floating element in applicable situations,
/// such as when it is not in the same clipping context as the reference element.
///
/// See <https://floating-ui.com/docs/hide> for the original documentation.
pub type Hide<'a> = CoreHide<'a, Element, Window>;

/// Provides improved positioning for inline reference elements that can span over multiple lines, such as hyperlinks or range selections.
///
/// See <https://floating-ui.com/docs/inline> for the original documentation.
pub type Inline<'a> = CoreInline<'a, Element, Window>;

/// Modifies the placement by translating the floating element along the specified axes.
///
/// See <https://floating-ui.com/docs/offset> for the original documentation.
pub type Offset<'a> = CoreOffset<'a, Element, Window>;

/// Optimizes the visibility of the floating element by shifting it in order to keep it in view when it will overflow the clipping boundary.
///
/// See <https://floating-ui.com/docs/shift> for the original documentation.
pub type Shift<'a> = CoreShift<'a, Element, Window>;

/// Provides data that allows you to change the size of the floating element -
/// for instance, prevent it from overflowing the clipping boundary or match the width of the reference element.
///
/// See <https://floating-ui.com/docs/size> for the original documentation.
pub type Size<'a> = CoreSize<'a, Element, Window>;