waterui-internal 0.5.1

Internal implementation crate for WaterUI
#![doc = include_str!("README.md")]
extern crate alloc;
extern crate self as waterui;
#[macro_use]
mod macros;
mod appearance;
pub use appearance::{background, border, filter, floating, gradient, shape, style};
pub mod component;
mod interaction_support;
pub use interaction_support::{cursor, drag_drop, gesture, interaction};
mod runtime;
#[cfg(all(feature = "inspector", not(target_arch = "wasm32")))]
pub use runtime::inspector;
#[cfg(feature = "snackbar")]
pub use runtime::snackbar;
pub use runtime::{app, entry, error, fullscreen, metadata, realization, task, window};
/// Task management utilities and async support.
pub mod view;
/// Widget components for building complex UI elements.
pub mod widget;
#[doc(inline)]
pub use view::View;
pub use waterui_core::accessibility;

pub mod theme;
pub mod prelude {
    //! A collection of commonly used traits and types for easy importing.
    //!
    //! This module re-exports essential components from the library, allowing users to
    //! import them all at once with a single `use` statement. It includes traits for
    //! building views, handling signals, and working with colors and text.
    //!
    //! # Example
    //!
    //! ```rust
    //! use waterui::prelude::*;
    //!
    //! fn my_view() -> impl View {
    //!     // Your view implementation here
    //! }
    //! ```
    // Re-export core modules from super, excluding `background` to avoid conflict with layout::background
    #[cfg(feature = "gpu")]
    pub use super::FilterViewExt;
    pub use super::env::Environment;
    #[cfg(feature = "media")]
    pub use super::media;
    #[cfg(feature = "video")]
    pub use super::video;
    #[cfg(feature = "webview")]
    pub use super::webview;
    pub use super::{
        AnimationExt, AnyView, Binding, Color, Computed, Signal, SignalExt, State, Str, View,
        ViewExt, accessibility, animation, app, binding, color, component, cursor, drag_drop,
        entry, env, error, filter, form, fullscreen, gesture, gradient, id, layout, locale,
        metadata, navigation, reactive, regional, shape, signal, style, task, text, widget, window,
    };

    #[cfg(feature = "flow-markdown")]
    pub use crate::include_markdown;

    pub use super::color::*;
    pub use super::fullscreen::*;
    #[cfg(feature = "snackbar")]
    pub use super::snackbar::{Snackbar, SnackbarManager, SnackbarPosition, SnackbarTheme};

    pub use super::gesture::GestureObserver;

    pub use super::border::Border;
    pub use super::component::*;
    pub use super::form::*;
    pub use super::layout::padding::*;
    pub use super::layout::*;
    pub use super::navigation::*;
    pub use super::style::*;
    pub use waterui_core::dynamic::{DynamicHandler, watch};

    pub use super::theme::{
        self, ColorScheme, ColorSettings, FontSettings, Theme, color as theme_color,
    };

    pub use super::text::{TextConfig, font, highlight, styled};

    pub use super::component::link::{Link, LinkTarget, link};
    pub use super::component::list::{
        List, ListContent, ListItem, ListSection, Row, Section, detail_row, row,
    };
    pub use super::component::menu::{
        Command, CommandExt, Menu, MenuItem, Shortcut, ShortcutModifiers,
    };

    // Drag and drop extension traits
    pub use super::drag_drop::DropDestinationExt;

    pub use super::widget::{
        Avatar, Card, CardStyle, CardStyleTokens, CardTheme, Divider, avatar, card, suspense,
    };
    #[cfg(feature = "flow-markdown")]
    pub use super::widget::{
        FlowAnimationPolicy, FlowAnimationPreset, FlowElementKind, FlowMarkdown, FlowStreamMode,
        FlowTablePolicy, flow_markdown,
    };

    // Gradient types
    pub use super::gradient::{
        AngularGradient, ColorStop, Gradient, LinearGradient, MeshGradient, MeshVertex,
        RadialGradient, UnitPoint,
    };

    // Background types (explicit to avoid module name conflict with layout::background)
    pub use super::background::{Background, Glass, GlassStyle, Material};

    // Asset types
    #[cfg(feature = "assets")]
    pub use super::{AssetError, AssetKind, Data, asset, assets, include_bundle};
    #[cfg(all(feature = "assets", not(target_arch = "wasm32")))]
    pub use super::{
        AudioAsset, Bundle, DataAsset, FontAsset, ImageAsset, LargeFile, LargeFileAsset, VideoAsset,
    };

    // Re-export macros. The UI-test attribute is `ui_test` here rather than
    // `test`: glob-importing a macro named `test` shadows the built-in `#[test]`
    // in every file that writes `use waterui::prelude::*`, and the resulting
    // error names neither the prelude nor the collision.
    pub use waterui_macros::*;
}
pub use color::Color;
pub use form::FormBuilder;
#[cfg(feature = "gpu")]
#[doc(inline)]
pub use view::FilterViewExt;
#[doc(inline)]
pub use view::ViewExt;
#[cfg(feature = "barcode")]
pub use waterui_barcode as barcode;
#[cfg(feature = "canvas")]
pub use waterui_canvas as canvas;
#[cfg(feature = "chart")]
pub use waterui_chart as chart;
pub use waterui_form as form;
pub use waterui_graphics::color;
#[cfg(feature = "gpu")]
pub use waterui_graphics::image_analysis;
#[cfg(feature = "gpu")]
pub use waterui_graphics::image_generator;
#[cfg(feature = "gpu")]
pub use waterui_graphics::{
    CheckerboardGenerator, DominantColor, DotGridGenerator, GeneratedImage, Histogram,
    ImageAnalysis, ImageGenerator, LinearGradientGenerator, MinMaxLuma, NoiseGenerator,
    RadialGradientGenerator, StripeGenerator,
};
pub use waterui_icon as icon;
#[cfg(feature = "particle")]
pub use waterui_particle as particle;

#[cfg(feature = "assets")]
pub use waterui_assets as assets;
pub use waterui_layout as layout;
pub use waterui_locale as locale;
pub use waterui_locale::regional;
/// The UI-test attribute, written qualified as `#[waterui::test(...)]`.
///
/// It is `ui_test` inside [`prelude`] so that a glob import of the prelude does
/// not shadow the built-in `#[test]`; this alias keeps the short spelling at the
/// path where it is actually written.
pub use waterui_macros::ui_test as test;
#[doc(inline)]
pub use waterui_macros::*;
#[cfg(feature = "media")]
pub use waterui_media as media;
pub use waterui_navigation as navigation;
#[cfg(feature = "gpu")]
pub use waterui_svg as svg;
pub use waterui_text as text;
#[cfg(feature = "video")]
pub use waterui_video as video;
#[cfg(feature = "webview")]
pub use waterui_webview as webview;

// Asset types re-exported for convenience
#[doc(inline)]
#[cfg(all(feature = "assets", not(target_arch = "wasm32")))]
pub use waterui_assets::{
    AssetError, AssetKind, AudioAsset, Bundle, Data, DataAsset, FontAsset, ImageAsset, LargeFile,
    LargeFileAsset, VideoAsset,
};
#[cfg(all(feature = "assets", target_arch = "wasm32"))]
pub use waterui_assets::{AssetError, AssetKind, Data};
/// `include_web!("web")` — the one-macro web frontend. Its expansion speaks
/// [`webview`](crate::webview)'s asset-origin API and serves a staged
/// [`Bundle`], so it is exported only when both features are on.
#[doc(inline)]
#[cfg(all(feature = "webview", feature = "assets"))]
pub use waterui_assets_macros::include_web;
#[doc(inline)]
#[cfg(feature = "assets")]
pub use waterui_assets_macros::{asset, assets, include_bundle};
pub use waterui_url::Url;

#[doc(inline)]
pub use waterui_core::{
    AnyView, Error, Str, animation,
    easing::{self, EasingCurve, Interpolatable},
    env::{self, Environment},
    event,
    extract::{self, Extractor, State, Use},
    handler::{self, Handler, HandlerOnce},
    id::{self, Identifiable},
    impl_extractor, raw_view,
    resolve::{self, AnyResolvable, Resolvable},
    views,
};

/// Haptic feedback intensity for the `on_*_haptic` modifiers.
#[cfg(feature = "std")]
#[doc(inline)]
pub use waterkit_haptic::Intensity;

pub(crate) mod view_ext;
pub use nami as reactive;
pub use nami::SignalExt;
#[doc(inline)]
pub use reactive::{Binding, Computed, Signal, binding, signal};
#[doc(inline)]
pub use waterui_core::AnimationExt;

pub use waterui_core::plugin::Plugin;
/// Graphics primitives including GPU rendering surface.
pub use waterui_graphics as graphics;

pub use tracing as log;

/// Internal helper macro for generating preview export symbols.
///
/// Symbol format: `waterui_preview_{crate_name}_{fn_name}`
#[doc(hidden)]
#[macro_export]
macro_rules! __export_preview {
    ($fn_name:expr, $body:block) => {
        $crate::pastey::paste! {
            #[doc(hidden)]
            #[cfg(debug_assertions)]
            #[unsafe(no_mangle)]
            pub unsafe extern "C" fn [<waterui_preview_ env!("CARGO_PKG_NAME") _ $fn_name>]() -> *mut () {
                $body
            }
        }
    };
}

#[doc(hidden)]
pub use pastey;

// `configure_environment!` lives in `waterui-core` so generated backend crates
// that do not depend on the facade (the ESP32 harness names `waterui-core`,
// `waterui-dew` and `waterui-locale` only) can still install the app catalog.
pub use waterui_core::configure_environment;