Expand description
reexport prelude from sauron core
Modules
This module provides functionalities for manipulating the actual Document Object Model in the browser
Provides functions and macros to build html elements
Bindings to JavaScript’s standard, built-in objects, including their methods and properties.
Provides convenient functions and macro to build dynamic css
Leaf node for html dom tree
mt-dom is a generic virtual dom implementation which doesn’t specify the types of the data that is being processed. It’s up to the library user to specify those types
Provides functions and macros to build svg elements
provides function and macro for html units such as px, %, em, etc.
This module contains types that are derived from mt-dom where we assign concrete types into the generics
Runtime support for the wasm-bindgen
tool
Raw API bindings for Web APIs
Macros
declare a function with the name corresponds to attribute name for easy usage in html elements Example:
Creat a style attribute
creates a text node using a formatter
Structs
The AnimationEvent
class.
A generic wrapper for a closure in rust where we can transform and pass around.
A handle to both a closure in Rust as well as JS closure which will invoke the Rust closure.
A node along with all of the closures that were created for that node’s events and all of it’s child node’s events.
Used for keeping a real DOM node up to date based on the current Node and a new incoming Node that represents our latest DOM state.
Effects is a convenient way to group Msg for component to execute subsequent updates based on certain conditions. This can be used for doing animation and incremental changes to the view to provide an effect of transition or animation.
The HashChangeEvent
class.
Provides functions for doing http network request
a custom InputEvent to contain the input string value
Convenience type for use on exported fn() -> Result<T, JsError>
functions, where you wish to
throw a JavaScript Error
object.
Representation of an object owned by JS.
The KeyboardEvent
class.
Contains the time it took for the last app update call for the component TODO: Maybe rename to Diagnostics
an event when a virtual Node is mounted the field node is the actual dom node where the virtual Node is created in the actual dom
The MouseEvent
class.
Holds the user App and the dom updater This is passed into the event listener and the dispatch program will be called after the event is triggered.
The Attributes partition into 4 different types
css styles style can be converted into an attribute
The TransitionEvent
class.
Provides access to the Browser window
Enums
Values of an attribute can be in these variants
Map the Event to DomEvent, which are browser events
A leaf node value of html dom tree
Wraps different primitive variants used as values in html This is needed since html attributes can have different value types such as checked(bool), name(String), tab_index(i32)
Constants
html events
SVG namespace const, use this when creating an svg element dynamically in the DOM
Traits
An Application is the root component of your program. Everything that happens in your application is done here.
Add mapping function for Attribute
A component has a view and can update itself.
A Container have children that is set from the parent component
This trait is used in the DomUpdater to call the dispatch method when an event occured
Add mapping function for Element
Add mapping function for Node, Element, Attribute,
additional traits for mt_dom::Node
render node, elements to a writable buffer
Special Node attributes that are treated differently such as key and skip which both greatly affects the diffing algorithm
An extension trait for Option<T>
and Result<T, E>
for unwrapping the T
value, or throwing a JS error if it is not available.
Just a view, no events, no update. The properties of the component is set directly from the parent
Functions
Creates html accent-height attribute
Creates html accept-charset attribute
Creates html accumulate attribute
Creates html alignment-baseline attribute
Creates html allowReorder attribute
Creates html alphabetic attribute
Creates an svg animateMotion element
Creates an svg animateTransform element
Creates html arabic-form attribute
a utility function to convert simple value into attribute
Creates html attributeName attribute
Creates html attributeType attribute
A helper function for setting attributes with no values such as checked in checkbox input type This is best called to be appended to the node since this returns an array of attributes which doesn’t play well with the others
Creates html autoReverse attribute
Creates html autocapitalize attribute
Creates html autocomplete attribute
Creates html background attribute
Creates html baseFrequency attribute
Creates html baseProfile attribute
Creates html baseline-shift attribute
Creates an html blockquote element
Creates html cap-height attribute
Relative to the width of the “0” (zero)
set the checked value, used checkbox and radio buttons
return a class attribute where the classnames are transformed with namespace
a helper function to add multiple classes to a node
A helper function which takes an array of tuple of class and a flag. The final class is assembled using only the values that has a flag which evaluates to true.
return a class namespaced with flag
Creates html clipPathUnits attribute
Creates html color-interpolation attribute
Creates html color-interpolation-filters attribute
Creates html color-profile attribute
Creates html color-rendering attribute
create a comment node
Creates html contentScriptType attribute
Creates html contentStyleType attribute
Creates html contenteditable attribute
Creates html contextmenu attribute
Creates html crossorigin attribute
Creates html decelerate attribute
This is a sauron html specific functionality
diff 2 nodes with attribute using &'static str
instead of generic ATT
Creates html diffuseConstant attribute
set whether an element is disabled or not
provides access to the document element
Creates html dominant-baseline attribute
create a virtual node with tag, attrs and children
create a virtual node with namespace, tag, attrs and children
Relative to the font-size of the element (2em means 2 times the size of the current font)
a utility function to return create an empty attr, useful for cases where branch expression need to return an attribute which otherwise it can not produce example:
Creates html enable-background attribute
Creates html enterkeyhint attribute
Creates html externalResourcesRequired attribute
Creates an svg feColorMatrix element
Creates an svg feComponentTransfer element
Creates an svg feComposite element
Creates an svg feConvolveMatrix element
Creates an svg feDiffuseLighting element
Creates an svg feDisplacementMap element
Creates an svg feDistantLight element
Creates an svg feDropShadow element
Creates an svg feGaussianBlur element
Creates an svg feMergeNode element
Creates an svg feMorphology element
Creates an svg fePointLight element
Creates an svg feSpecularLighting element
Creates an svg feSpotLight element
Creates an svg feTurbulence element
Creates an html figcaption element
Creates html fill-opacity attribute
Creates html filterUnits attribute
Creates html flex-direction attribute
Creates html flood-color attribute
Creates html flood-opacity attribute
focus the html element
Creates html font-family attribute
Creates html font-size-adjust attribute
Creates html font-stretch attribute
Creates html font-style attribute
Creates html font-variant attribute
Creates html font-weight attribute
Creates an svg foreignObject element
Creates html formaction attribute
Creates html formnovalidate attribute
Creates html glyph-name attribute
Creates html glyph-orientation-horizontal attribute
Creates html glyph-orientation-vertical attribute
Creates html gradientTransform attribute
Creates html gradientUnits attribute
utility function which returns the history api of the browser
Creates html horiz-adv-x attribute
Creates html horiz-origin-x attribute
Creates an html element with the element tag name and namespace This is specifically used for creating svg element where a namespace is needed, otherwise the browser will not render it correctly.
Creates html ideographic attribute
Creates html image-rendering attribute
Creates html importance attribute
set the inner html of this element without comparing in the diff this always sets the value This is for optimization purposes and will lead to some hacks in the implementation
Creates html intrinsicsize attribute
Creates html kernelMatrix attribute
Creates html kernelUnitLength attribute
key attributes is used to match old element and new element when diffing
Creates html keySplines attribute
Creates html lengthAdjust attribute
Creates html letter-spacing attribute
Creates html lighting-color attribute
Creates html limitingConeAngle attribute
Creates an svg linearGradient element
Creates html markerHeight attribute
Creates html markerUnits attribute
Creates html markerWidth attribute
Creates html marker-end attribute
Creates html marker-mid attribute
Creates html marker-start attribute
Creates html maskContentUnits attribute
Creates html mathematical attribute
Set the attribute of this element if value is Some, empty attribute otherwise
Creates an svg meshgradient element
Creates html novalidate attribute
return the instantaneous time
Creates html numOctaves attribute
an event builder
attach an on_animationend event to the html element
attach an on_auxclick event to the html element
attach an on_broadcast event to the html element
attach an on_checked event to the html element
on click event
attach an on_contextmenu event to the html element
attach an on_dblclick event to the html element
attach an on_doubleclick event to the html element
custom on_enter event, which is triggered from key_press when the Enter key is pressed
attach an on_hashchange event to the html element
attach an on_keydown event to the html element
attach an on_keypress event to the html element
custom mount event
attach an on_mousedown event to the html element
attach an on_mouseenter event to the html element
attach an on_mouseleave event to the html element
attach an on_mousemove event to the html element
attach an on_mouseout event to the html element
attach an on_mouseover event to the html element
attach an on_mouseup event to the html element
attach an on_pointerlockchange event to the html element
attach an on_pointerlockerror event to the html element
attach an on_popstate event to the html element
attach an on_readystatechange event to the html element
attach callback to the scroll event
attach an on_transitionend event to the html element
Creates html orientation attribute
Creates html overline-position attribute
Creates html overline-thickness attribute
Creates html paint-order attribute
Creates html pathLength attribute
Creates html patternContentUnits attribute
Creates html patternTransform attribute
Creates html patternUnits attribute
percentage Example:
provides access to the window Performance api
Creates html placeholder attribute
Creates html pointer-events attribute
Creates html preserveAlpha attribute
Creates html preserveAspectRatio attribute
Creates html primitiveUnits attribute
points (1pt = 1/72 of 1in)
pixels (1px = 1/96th of 1in)
Creates an svg radialGradient element
Creates html radiogroup attribute
Creates html referrerPolicy attribute
Creates html referrerpolicy attribute
Relative to font-size of the root element
Creates html rendering-intent attribute
Creates html repeatCount attribute
if the value is true, then this node is made to replace the old node it matches
utility function which a closure in request animation frame
Creates html requiredExtensions attribute
Creates html requiredFeatures attribute
Create an html and instruct the DOM renderer and/or DOM patcher that the operation is safe.
Creates html shape-rendering attribute
if the value is true, then the diffing of this element and its descendants are skip entirely
Creates an svg solidcolor element
Creates html specularConstant attribute
Creates html specularExponent attribute
Creates html spellcheck attribute
Creates html spreadMethod attribute
Creates html startOffset attribute
Creates html stdDeviation attribute
Creates html stitchTiles attribute
Creates html stop-color attribute
Creates html stop-opacity attribute
Creates html strikethrough-position attribute
Creates html strikethrough-thickness attribute
Creates html stroke-dasharray attribute
Creates html stroke-dashoffset attribute
Creates html stroke-linecap attribute
Creates html stroke-linejoin attribute
Creates html stroke-miterlimit attribute
Creates html stroke-opacity attribute
Creates html stroke-width attribute
A helper function which creates a style attribute by assembling the tuples into a string for the style value.
A helper function which creates a style attribute by assembling only the parts that passed the boolean flag.
A helper function to build styles by accepting pairs
Creates html surfaceScale attribute
creates an svg element with the tag, attributes and children. Example:
Creates html systemLanguage attribute
Creates html tableValues attribute
Create a text node element
Creates html textLength attribute
Creates html text-anchor attribute
Creates html text-decoration attribute
Creates html text-rendering attribute
Creates html underline-position attribute
Creates html underline-thickness attribute
Creates html unicode-bidi attribute
Creates html unicode-range attribute
Creates html units-per-em attribute
Creates html v-alphabetic attribute
Creates html v-ideographic attribute
Creates html v-mathematical attribute
Creates html vector-effect attribute
Creates html vert-adv-y attribute
Creates html vert-origin-x attribute
Creates html vert-origin-y attribute
Creates html viewTarget attribute
A help function which render the view when the condition is met, otherwise
just display a span(vec![], vec![])
Creates html visibility attribute
utility function which returns the Window element
Creates html word-spacing attribute
Creates html writing-mode attribute
Creates html xChannelSelector attribute
creates a function where the function name is the attribute name of the svg element
creates a function where the function name is the attribute name of the svg element
creates a function where the function name is the attribute name of the svg element
creates a function where the function name is the attribute name of the svg element
creates a function where the function name is the attribute name of the svg element
creates a function where the function name is the attribute name of the svg element
creates a function where the function name is the attribute name of the svg element
Creates html xmlns:xlink attribute
Creates html yChannelSelector attribute
Creates html zoomAndPan attribute
Type Definitions
Attribute type used in sauron where the type of the Attribute name is &’static str
attribute keys or attribute names
alias Cmd to use Program as the APP
Element type with tag and attribute name type set to &’static str
Callback where Event type is supplied for Components
namespace type in node, which could be change to an enum
A simplified version of saurdon_vdom node, where we supplied the type for the tag which is a &’static str. The missing type is now only MSG which will be supplied by the users App code.
Patch as result of diffing the current_vdom and the new vdom. The tag and attribute name types is set to &’static str
tags are using static str for now, can also be enum tags