Module sauron::prelude [−][src]
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.
json css
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
Serde JSON
Provides functions and macros to build svg elements
provides function and macro for html units such as px, %, em, etc.
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:
jss macro
jss with namespace
Quasi-quoting macro for building sauron Nodes.
a utility function for convenient styling of elements
creates a text node Example
Structs
The AnimationEvent
class.
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.
The HashChangeEvent
class.
Provides functions for doing http network request
a custom InputEvent to contain the input string value
Representation of an object owned by JS.
The KeyboardEvent
class.
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.
css styles style can be converted into an attribute ie:
Text node
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
TODO: merge this with AttributeValue Value is an abstraction of the values used in the actual backend. Html and gtk-rs have different set of compatible values therefore a need for a storage of these intermediate value is needed
Constants
These are most commonly used html attributes such as class, id, etc
These are html attributes with names that are non proper rust identifier therefore handled differently. ie: (for, in)
html events
These are the self closing tags such as <input/>
, <br/>
,
HTML style names
These are the comonly used html tags such as div, input, buttons,.. etc
These are html tags which are non commonly used. Put together in this collection to avoid import conflicts with the commonly used ones.
These are html tags with macro which are non commonly used. Put together in this collection to avoid import conflicts with the commonly used ones.
These are most commonly used svg attributes
These are svg attributes with names that are non proper rust identifier therefore they are handled differently. ie: (color-profile, accent-height, etc)
Svg attributes with xlink namespace
SVG namespace const, use this when creating an svg element dynamically in the DOM
Traits
The app should implement this trait for it to be handled by the Program
This trait is used in the DomUpdater to call the dispatch method when an event occured
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 unwraping the T
value, or throwing a JS error if it is not available.
Functions
Creates an html a element
Creates an html abbr element
Creates html accent-height attribute
Creates html accept attribute
Creates html accept-charset attribute
Creates html accesskey attribute
Creates html accumulate attribute
Creates html action attribute
Creates html additive attribute
Creates an html address element
Creates html align attribute
Creates html alignment-baseline attribute
Creates html allow attribute
Creates html allowReorder attribute
Creates html alphabetic attribute
Creates html alt attribute
Creates html amplitude attribute
Creates an svg animate element
Creates an svg animateMotion element
Creates an svg animateTransform element
Creates html arabic-form attribute
Creates an html area element
Creates an html article element
Creates html ascent attribute
Creates an html aside element
Creates html async attribute
Creates html async 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 Example:
Creates an html audio element
Creates html autoReverse attribute
Creates html autocapitalize attribute
Creates html autocomplete attribute
Creates html autofocus attribute
Creates html autoplay attribute
Creates html azimuth attribute
Creates an html b element
Creates html background attribute
Creates an html base element
Creates html baseFrequency attribute
Creates html baseProfile attribute
Creates html baseline-shift attribute
Creates html bbox attribute
Creates an html bdi element
Creates an html bdo element
Creates html begin attribute
Creates html bgcolor attribute
Creates html bias attribute
Creates an html blockquote element
Creates html border attribute
Creates an html br element
Creates html buffered attribute
Creates an html button element
Creates html by attribute
Creates html calcMode attribute
Creates an html canvas element
Creates html cap-height attribute
Creates an html caption element
Relative to the width of the “0” (zero)
Creates html challenge attribute
Creates html charset attribute
set the checked value, used checkbox and radio buttons
Creates an svg circle element
Creates html class attribute
a helper function to add multiple classes to a node
Creates html clip attribute
Creates an svg clipPath element
Creates html clipPathUnits attribute
Creates html clip-path attribute
Creates html clip-rule attribute
centimeters
Creates an html code element
Creates html codebase attribute
Creates an html col element
Creates an html colgroup element
Creates html color-interpolation attribute
Creates html color-interpolation-filters attribute
Creates html color-profile attribute
Creates html color-rendering attribute
Creates html cols attribute
Creates html colspan attribute
Creates an html command element
Creates html content attribute
Creates html contentScriptType attribute
Creates html contentStyleType attribute
Creates html contenteditable attribute
Creates html contextmenu attribute
Creates html controls attribute
Creates html coords attribute
Creates html crossorigin attribute
Creates html csp attribute
Creates html cursor attribute
Creates html cx attribute
Creates html cy attribute
Creates html d attribute
Creates an html datalist element
Creates html datetime attribute
Creates an html dd element
Creates html decelerate attribute
Creates html decoding attribute
Creates html default attribute
Creates html defer attribute
Creates an svg defs element
Creates an html del element
Creates an svg desc element
Creates html descent attribute
Creates an html details element
Creates an html dfn element
Creates an html dialog element
This is a sauron html specific functionality
diff 2 nodes with attribute using &'static str
instead of generic ATT
Creates html diffuseConstant attribute
Creates html dir attribute
Creates html direction attribute
Creates html dirname attribute
set whether an element is disabled or not
Creates an svg discard element
Creates html display attribute
Creates an html div element
Creates html divisor attribute
Creates an html dl element
provides access to the document element
Creates html dominant-baseline attribute
Creates html download attribute
Creates html draggable attribute
Creates html dropzone attribute
Creates an html dt element
Creates html dur attribute
Creates html dx attribute
Creates html dy attribute
Creates html edgeMode attribute
create a virtual node with tag, attrs and children
create a virtual node with namespace, tag, attrs and children
Creates html elevation attribute
Creates an svg ellipse element
Creates an html embed element
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 enctype attribute
Creates html end attribute
Creates html enterkeyhint attribute
Relative to the x-height of the current font (rarely used)
request animation frame and execute function
Creates html exponent attribute
Creates html externalResourcesRequired attribute
Creates an svg feBlend element
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 feFlood element
Creates an svg feFuncA element
Creates an svg feFuncB element
Creates an svg feFuncG element
Creates an svg feFuncR element
Creates an svg feGaussianBlur element
Creates an svg feImage element
Creates an svg feMerge element
Creates an svg feMergeNode element
Creates an svg feMorphology element
Creates an svg feOffset element
Creates an svg fePointLight element
Creates an svg feSpecularLighting element
Creates an svg feSpotLight element
Creates an svg feTile element
Creates an svg feTurbulence element
Creates an html fieldset element
Creates an html figcaption element
Creates an html figure element
Creates html fill attribute
Creates html fill-opacity attribute
Creates html fill-rule attribute
Creates html filterRes 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 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 html footer element
Creates html for attribute
Creates html for attribute
Creates an svg foreignObject element
Creates an html form element
Creates html formaction attribute
Creates html format attribute
Creates html formnovalidate attribute
Creates html fr attribute
Creates html from attribute
Creates html fx attribute
Creates html fy attribute
Creates an svg g element
Creates html g1 attribute
Creates html g2 attribute
Creates html glyphRef 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
Creates an html h1 element
Creates an html h2 element
Creates an html h3 element
Creates an html h4 element
Creates an html h5 element
Creates an html h6 element
Creates html hanging attribute
Creates an svg hatch element
Creates an svg hatchpath element
Creates an html head element
Creates an html header element
Creates html headers attribute
Creates html height attribute
Creates an html hgroup element
Creates html hidden attribute
Creates html high 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 hr element
Creates html href attribute
Creates an html html element
creates an html element, where the first argument: tag is the html element tag. Example:
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.
for self closing tags
Creates html http attribute
Creates an html i element
Creates html icon attribute
Creates html id attribute
Creates html ideographic attribute
Creates an html iframe element
Creates an svg image element
Creates html image-rendering attribute
Creates an html img element
Creates html importance attribute
Creates html in2 attribute
Creates html in 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 an html input element
Creates html inputmode attribute
Creates an html ins element
Creates html integrity attribute
Creates html intercept attribute
Creates html intrinsicsize attribute
Creates html ismap attribute
Creates html itemprop attribute
Creates html k attribute
Creates html k1 attribute
Creates html k2 attribute
Creates html k3 attribute
Creates html k4 attribute
Creates an html kbd element
Creates html kernelMatrix attribute
Creates html kernelUnitLength attribute
Creates html kerning attribute
key attributes is used to match old element and new element when diffing
Creates html keyPoints attribute
Creates html keySplines attribute
Creates html keyTimes attribute
Creates an html keygen element
Creates html keytype attribute
Creates html kind attribute
Creates an html label element
Creates html language attribute
Creates an html legend element
Creates html lengthAdjust attribute
Creates html letter-spacing attribute
Creates an html li element
Creates html lighting-color attribute
Creates html limitingConeAngle attribute
Creates an svg linearGradient element
Creates an html link element
Creates html list attribute
Creates html loading attribute
Creates html local attribute
Creates html loop attribute
Creates html loop attribute
Creates html low attribute
Creates an html main element
Creates html manifest attribute
Creates an html map element
Creates an html mark element
Creates an svg marker 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 maskUnits attribute
Creates html mathematical attribute
Creates html maxlength attribute
Creates an html menu element
Creates an html menuitem element
Creates an svg mesh element
Creates an svg meshgradient element
Creates an svg meshpatch element
Creates an svg meshrow element
Creates an html meta element
Creates an svg metadata element
Creates an html meter element
Creates html minlength attribute
milimeters
Creates html mode attribute
Creates an svg mpath element
Creates html multiple attribute
Creates html muted attribute
Creates an html nav element
Creates an html noscript element
Creates html novalidate attribute
return the instantaneous time
Creates html numOctaves attribute
Creates an html object element
Creates html offset attribute
Creates an html ol element
an event builder
attach an on_animationend event to the html element
attach an on_auxclick event to the html element
attach an on_blur event to the html element
attach an on_broadcast event to the html element
attach an on_change 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_focus event to the html element
attach an on_hashchange event to the html element
attach an on_input event to the html element
attach an on_keydown event to the html element
attach an on_keypress event to the html element
attach an on_keyup 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_readystatechange event to the html element
attach an on_reset event to the html element
attach callback to the scroll event
attach an on_select event to the html element
attach an on_submit event to the html element
attach an on_transitionend event to the html element
attach an on_wheel event to the html element
Creates html opacity attribute
Creates html open attribute
Creates html operator attribute
Creates an html optgroup element
Creates html optimum attribute
Creates an html option element
Creates html order attribute
Creates html orient attribute
Creates html orientation attribute
Creates html origin attribute
Creates an html output element
Creates html overflow attribute
Creates html overline-position attribute
Creates html overline-thickness attribute
Creates an html p element
Creates html paint-order attribute
Creates html panose-1 attribute
Creates an html param element
Creates an svg path element
Creates html pathLength attribute
Creates html patternContentUnits attribute
Creates html patternTransform attribute
Creates html patternUnits attribute
picas (1pc = 12 pt)
percentage
provides access to the window Performance api
Creates an html picture element
Creates html placeholder attribute
Creates html pointer-events attribute
Creates html points attribute
Creates html pointsAtX attribute
Creates html pointsAtY attribute
Creates html pointsAtZ attribute
Creates an svg polygon element
Creates an svg polyline element
Creates html poster attribute
Creates an html pre element
Creates html preload attribute
Creates html preserveAlpha attribute
Creates html preserveAspectRatio attribute
Creates html primitiveUnits attribute
Creates an html progress element
points (1pt = 1/72 of 1in)
pixels (1px = 1/96th of 1in)
Creates html r attribute
Creates an svg radialGradient element
Creates html radiogroup attribute
Creates html radius attribute
Creates an html rb element
Creates html readonly attribute
Creates an svg rect element
Creates html refX attribute
Creates html refY 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
Creates html repeatDur attribute
if the value is true, then this node is made to replace the old node it matches
utility function which executes the agument closure in a request animation frame
Creates html required attribute
Creates html requiredExtensions attribute
Creates html requiredFeatures attribute
Creates html restart attribute
Creates html result attribute
Creates html reversed attribute
Creates html rotate attribute
Creates html rows attribute
Creates html rowspan attribute
Creates an html rp element
Creates an html rt element
Creates an html rtc element
Creates an html ruby element
Creates html rx attribute
Creates html ry attribute
Creates an html s element
Creates an html samp element
Creates html sandbox attribute
Creates html scale attribute
Creates html scope attribute
Creates html scoped attribute
Creates an html script element
Creates an html section element
Creates html seed attribute
Creates an html select element
Creates html selected attribute
Creates an svg set element
Creates html shape attribute
Creates html shape-rendering attribute
Creates html size attribute
Creates html sizes attribute
if the value is true, then the diffing of this element and its descendants are skip entirely
Creates html slope attribute
Creates an html small element
Creates an svg solidcolor element
Creates an html source element
Creates html spacing attribute
Creates an html span element
Creates html specularConstant attribute
Creates html specularExponent attribute
Creates html speed attribute
Creates html spellcheck attribute
Creates html spreadMethod attribute
Creates html src attribute
Creates html srcdoc attribute
Creates html srclang attribute
Creates html srcset attribute
Creates html start attribute
Creates html startOffset attribute
Creates html stdDeviation attribute
Creates html stemh attribute
Creates html stemv attribute
Creates html step attribute
Creates html stitchTiles attribute
Creates an svg stop element
Creates html stop-color attribute
Creates html stop-opacity attribute
Creates html strikethrough-position attribute
Creates html strikethrough-thickness attribute
Creates html string attribute
Creates html stroke 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
Creates an html strong element
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 an html sub element
Creates an html sup element
Creates html surfaceScale attribute
Creates an svg svg element
creates an svg element with the tag, attributes and children. Example:
Creates an svg switch element
Creates an svg symbol element
Creates html systemLanguage attribute
Creates an html table element
Creates html tableValues attribute
Creates html targetX attribute
Creates html targetY attribute
Creates an html tbody element
Creates an html td element
Creates an html template element
Create a textnode element
Creates html textLength attribute
Creates an svg textPath element
Creates html text-anchor attribute
Creates html text-decoration attribute
Creates html text-rendering attribute
Creates an html textarea element
Creates an html tfoot element
Creates an html th element
Creates an html thead element
Creates an html time element
Creates html to attribute
Creates an html tr element
Creates an html track element
Creates html transform attribute
Creates html translate attribute
Creates an svg tspan element
Creates html type attribute
Creates html type attribute
Creates an html u element
Creates html u1 attribute
Creates html u2 attribute
Creates an html ul element
Creates html underline-position attribute
Creates html underline-thickness attribute
Creates html unicode attribute
Creates html unicode-bidi attribute
Creates html unicode-range attribute
Creates html units-per-em attribute
Creates an svg unknown element
Creates html usemap attribute
Creates html v-alphabetic attribute
Creates html v-hanging attribute
Creates html v-ideographic attribute
Creates html v-mathematical attribute
Creates html value attribute
Creates html values attribute
Creates an html var element
Creates html vector-effect attribute
Creates html version attribute
Creates html vert-adv-y attribute
Creates html vert-origin-x attribute
Creates html vert-origin-y attribute
Relative to 1% of the height of the viewport*
Creates an html video element
Creates an svg view element
Creates html viewBox 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
Relative to 1% of the width of the viewport*
Creates an html wbr element
Creates html width attribute
Creates html widths attribute
utility function which returns the Window element
Creates html word-spacing attribute
Creates html wrap attribute
Creates html writing-mode attribute
Creates html x attribute
Creates html x1 attribute
Creates html x2 attribute
Creates html xChannelSelector attribute
Creates html x-height 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 xml:base attribute
Creates html xml:lang attribute
Creates html xml:space attribute
Creates html xmlns attribute
Creates html xmlns:xlink attribute
Creates html y attribute
Creates html y1 attribute
Creates html y2 attribute
Creates html yChannelSelector attribute
Creates html z attribute
Creates html zoomAndPan attribute
Type Definitions
Attribute type used in sauron where the type of the Attribute name is &’static str
attribute keys
Callback where Event type is supplied
alias Cmd to use Program as the APP
Element type with tag and attribute name type set to &’static str
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