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
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
pub use sauron_vdom::builder::{
    attr,
    element,
    element_ns,
};

pub mod attributes;

pub(in crate) const SVG_NAMESPACE: &str = "http://www.w3.org/2000/svg";

macro_rules! declare_svg_tags{

    ( $(
         $(#[$attr:meta])*
         $name:ident;
       )*
     ) => {
        $(
            $(#[$attr])*
            pub fn $name<A, C,MSG>(attrs: A, children: C) -> $crate::Node<MSG>
                where C: AsRef<[$crate::Node<MSG>]>,
                      A: AsRef<[$crate::Attribute<MSG>]>,
                      MSG: Clone,
                {
                    $crate::html::html_element_ns(stringify!($name), SVG_NAMESPACE, attrs, children)
                }
         )*
    };

    ( $(
         $(#[$attr:meta])*
         $name:ident => $attribute:tt;
       )*
     ) => {
        $(
            $(#[$attr])*
            pub fn $name<A, C,MSG>(attrs: A, children: C) -> $crate::Node<MSG>
                where C: AsRef<[$crate::Node<MSG>]>,
                      A: AsRef<[$crate::Attribute<MSG>]>,
                      MSG: Clone,
                {
                    $crate::html::html_element_ns($attribute, SVG_NAMESPACE, attrs, children)
                }
         )*
    }

}

declare_svg_tags! {
    animate;
    #[allow(non_snake_case)]
    animateMotion;
    #[allow(non_snake_case)]
    animateTransform;
    circle;
    #[allow(non_snake_case)]
    clipPath;
    defs;
    desc;
    discard;
    ellipse;
    #[allow(non_snake_case)]
    feBlend;
    #[allow(non_snake_case)]
    feColorMatrix;
    #[allow(non_snake_case)]
    feComponentTransfer;
    #[allow(non_snake_case)]
    feComposite;
    #[allow(non_snake_case)]
    feConvolveMatrix;
    #[allow(non_snake_case)]
    feDiffuseLighting;
    #[allow(non_snake_case)]
    feDisplacementMap;
    #[allow(non_snake_case)]
    feDistantLight;
    #[allow(non_snake_case)]
    feDropShadow;
    #[allow(non_snake_case)]
    feFlood;
    #[allow(non_snake_case)]
    feFuncA;
    #[allow(non_snake_case)]
    feFuncB;
    #[allow(non_snake_case)]
    feFuncG;
    #[allow(non_snake_case)]
    feFuncR;
    #[allow(non_snake_case)]
    feGaussianBlur;
    #[allow(non_snake_case)]
    feImage;
    #[allow(non_snake_case)]
    feMerge;
    #[allow(non_snake_case)]
    feMergeNode;
    #[allow(non_snake_case)]
    feMorphology;
    #[allow(non_snake_case)]
    feOffset;
    #[allow(non_snake_case)]
    fePointLight;
    #[allow(non_snake_case)]
    feSpecularLighting;
    #[allow(non_snake_case)]
    feSpotLight;
    #[allow(non_snake_case)]
    feTile;
    #[allow(non_snake_case)]
    feTurbulence;
    filter;
    #[allow(non_snake_case)]
    foreignObject;
    g;
    hatch;
    hatchpath;
    image;
    line;
    #[allow(non_snake_case)]
    linearGradient;
    marker;
    mask;
    mesh;
    meshgradient;
    meshpatch;
    meshrow;
    metadata;
    mpath;
    path;
    pattern;
    polygon;
    polyline;
    #[allow(non_snake_case)]
    radialGradient;
    rect;
    script;
    set;
    solidcolor;
    stop;
    svg;
    switch;
    symbol;
    #[allow(non_snake_case)]
    textPath;
    tspan;
    unknown;
    view;
}

declare_svg_tags! {
    color_profile => "color-profile";
    r#use => "use";
}