nsh-core 0.2.0

Platform-independent core: shadow tree, styles, layout and mount instructions.
Documentation
//! Platform-independent core of nsh.
//!
//! The core receives [`Op`]s from the JS renderer, maintains the shadow tree,
//! converts styles to [`taffy`] layout, merges inline text into
//! [`AttributedText`], runs layout and finally emits a [`MountBatch`] of
//! [`MountItem`]s that a platform backend applies to native views.
//!
//! Everything here is single-threaded and allocation-conscious: the core runs
//! on the engine thread, between the JS host and the platform backend.

pub mod access;
pub mod animation;
pub mod canvas;
pub mod clipboard;
pub mod color;
mod core;
mod css;
mod css_named;
pub mod desktop;
mod effects;
mod fenwick;
pub mod filesystem;
pub mod geometry;
mod grid;
pub mod input;
pub mod js;
pub mod keymap;
mod mount;
pub mod navigation;
mod ops;
pub mod overlay;
pub mod platform;
mod props;
pub mod reactive;
pub mod resource;
pub mod runtime;
pub mod scroll;
pub mod selection;
pub mod shape;
pub mod storage;
mod style;
#[cfg(feature = "svg")]
pub mod svg;
pub mod tailwind;
mod text;
pub mod text_edit;
pub mod time;
mod transform;
pub mod transition;
pub mod ui;
pub mod websocket;

// The derive macros name `::nsh_core`, also in this crate's own tests.
extern crate self as nsh_core;

/// The values registered native components take and emit (props, events,
/// command arguments): JSON.
pub use serde_json::Value as JsonValue;

pub use crate::{
    color::{Hsla, Rgba},
    core::{ApplyError, Core, ListBind, Measurement},
    effects::{
        BlendMode, BoxShadow, ColorStop, Cursor, Effects, Filter, Gradient, GradientKind,
        GradientSize, KeyframeAnimation, Keyframes, Outline, Transition, TransitionProps,
        blur_radius, compose_color_matrices,
    },
    geometry::{Bounds, Corners, Edges, Point, Points, Size},
    mount::{
        ImageOptions, InputConfig, ModalConfig, MountBatch, MountItem, NO_NATIVE_HEADER,
        NativeProps, ScreenConfig, ScrollBehavior, StickyCell, VideoProps, ViewKind, WebProps,
    },
    ops::{
        AutoCapitalize, AutoFill, CellSlot, Command, ContextMenuEvent, Dialog, DialogButton,
        DialogButtonStyle, EventKind, EventMask, EventPayload, HeaderSlot, HoverEvent,
        IMAGE_SCALES, ImageProp, ImageScales, ImageSource, KeyboardAppearance, KeyboardDismissMode,
        KeyboardTaps, KeyboardType, ListContentStyle, ModalAnimation, ModalPresentation, ModalProp,
        NativeProp, NodeId, Op, OverlayProp, PayloadValue, Prop, ROOT_ID, ResizeMode,
        ReturnKeyType, ScreenAnimation, ScreenProp, ScrollProp, SnapAlignment, StatusBarConfig,
        StatusBarSetting, StatusBarStyle, SubmitBehavior, Tag, TouchEvent, TouchPhase, TouchPoint,
        Viewability, WebSource,
    },
    props::{
        Accessibility, AccessibilityActionDef, AccessibilityProp, AccessibilityRole,
        AccessibilityState, AccessibilityValue, Checked, EdgeInsets, GestureValues,
        LayoutAnimation, LayoutCurve, LayoutProperty, LayoutTransition, LiveRegion, PanActivation,
        PointerEvents, Ripple, ViewProps,
    },
    style::{
        BorderStyle, Borders, Color, CornerRadii, DecorationStyle, EllipsizeMode, FontFamily,
        FontVariant, PatchValue, Shadow, Style, StyleDecl, StyleError, StyleKey, StylePatch,
        StyleValue, TextAlign, TextDecoration, TextShadow, TextStyle, TextTransform,
        TransformOrigin, VerticalAlign, ViewStyle,
    },
    text::{
        ATTACHMENT_CHAR, ApproxTextEngine, AttachmentAlignments, AttributedText, BackgroundBox,
        FontExtent, LinePiece, ResolvedTextStyle, TextAttachment, TextBackground, TextEngine,
        TextLayout, TextLine, TextLink, TextSpan,
    },
    transform::{Decomposed, MAX_TRANSFORMS, Matrix, Transform, TransformKind, TransformOp},
};