UNPKG

7.98 kBJavaScriptView Raw
1let K = null
2
3// is it server?
4if (typeof exports !== 'undefined' && exports !== null)
5{
6 K = require('kcore')
7}
8else
9{
10 K = window.K
11}
12
13K.BSC.nateSvgAttributes = [
14 // Base on:
15 // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute#SVG_attributes_by_category
16 // Last updated at 2019-02-27.
17
18 // ---------------------------------------------------------------------------
19 // Generic Attributes
20 // ---------------------------------------------------------------------------
21
22 // Core attributes
23 'id', 'lang', 'tabindex', 'xml:base', 'xml:lang', 'xml:space',
24
25 // Style Attributes
26 'class', 'style',
27
28 // Conditional Processing Attributes
29 'externalResourcesRequired',
30 'requiredExtensions',
31 'requiredFeatures',
32 'systemLanguage',
33
34 // ---------------------------------------------------------------------------
35 // xlink attributes
36 // ---------------------------------------------------------------------------
37
38 'xlink:href',
39 'xlink:type',
40 'xlink:role',
41 'xlink:arcrole',
42 'xlink:title',
43 'xlink:show',
44 'xlink:actuate',
45
46 // ---------------------------------------------------------------------------
47 // Presentation Attributes
48 // ---------------------------------------------------------------------------
49
50 'alignment-baselin' , 'baseline-shift' , 'clip',
51 'clip-path' , 'clip-rule' , 'color',
52 'color-interpolation' , 'color-interpolation-filters' , 'color-profile',
53 'color-rendering' , 'cursor' , 'direction',
54 'display' , 'dominant-baseline' , 'enable-background',
55 'fill' , 'fill-opacity' , 'fill-rule',
56 'filter' , 'flood-color' , 'flood-opacity',
57 'font-family' , 'font-size' , 'font-size-adjust',
58 'font-stretch' , 'font-style' , 'font-variant',
59 'font-weight' , 'glyph-orientation-horizontal' , 'glyph-orientation-vertical',
60 'image-rendering' , 'kerning' , 'letter-spacing',
61 'lighting-color' , 'marker-end' , 'marker-mid',
62 'marker-start' , 'mask' , 'opacity',
63 'overflow' , 'pointer-events' , 'shape-rendering',
64 'stop-color' , 'stop-opacity' , 'stroke',
65 'stroke-dasharray' , 'stroke-dashoffset' , 'stroke-linecap',
66 'stroke-linejoin' , 'stroke-miterlimit' , 'stroke-opacity',
67 'stroke-width' , 'text-anchor' , 'transform',
68 'text-decoration' , 'text-rendering' , 'unicode-bidi',
69 'vector-effect' , 'visibility' , 'word-spacing',
70 'writing-mode',
71
72 // ---------------------------------------------------------------------------
73 // Filters Attributes
74 // ---------------------------------------------------------------------------
75
76 // Filter Primitive Attributes
77 'height', 'result', 'width', 'x', 'y',
78
79 // Transfer Function Attributes
80 'type',
81 'tableValues',
82 'slope',
83 'intercept',
84 'amplitude',
85 'exponent',
86 'offset',
87
88 // ---------------------------------------------------------------------------
89 // Animation Attributes
90 // ---------------------------------------------------------------------------
91
92 // Animation Attribute Target Attributes
93 'attributeType', 'attributeName',
94
95 // Animation Timing Attributes
96 'begin' , 'dur' , 'end' , 'min' , 'max',
97 'restart' , 'repeatCount' , 'repeatDur' , 'fill' ,
98
99 // Animation Value Attributes
100 'calcMode',
101 'values',
102 'keyTimes',
103 'keySplines',
104 'from',
105 'to',
106 'by',
107 'autoReverse',
108 'accelerate',
109 'decelerate',
110
111 // Animation Addition Attributes
112 'additive', 'accumulate',
113
114 // ---------------------------------------------------------------------------
115 // Animation Event Attributes
116 // ---------------------------------------------------------------------------
117
118 // Animation Event Attributes
119 'onbegin', 'onend', 'onrepeat',
120
121 // Document Event Attributes
122 'onabort', 'onerror', 'onresize', 'onscroll', 'onunload',
123
124 // Global Event Attributes
125 'oncancel' , 'oncanplay' , 'oncanplaythrough' , 'onchange',
126 'onclick' , 'onclose' , 'oncuechange' , 'ondblclick',
127 'ondrag' , 'ondragend' , 'ondragenter' , 'ondragexit',
128 'ondragleave' , 'ondragover' , 'ondragstart' , 'ondrop',
129 'ondurationchange' , 'onemptied' , 'onended' , 'onerror',
130 'onfocus' , 'oninput' , 'oninvalid' , 'onkeydown',
131 'onkeypress' , 'onkeyup' , 'onload' , 'onloadeddata',
132 'onloadedmetadata' , 'onloadstart' , 'onmousedown' , 'onmouseenter',
133 'onmouseleave' , 'onmousemove' , 'onmouseout' , 'onmouseover',
134 'onmouseup' , 'onmousewheel' , 'onpause' , 'onplay',
135 'onplaying' , 'onprogress' , 'onratechange' , 'onreset',
136 'onresize' , 'onscroll' , 'onseeked' , 'onseeking',
137 'onselect' , 'onshow' , 'onstalled' , 'onsubmit',
138 'onsuspend' , 'ontimeupdate' , 'ontoggle' , 'onvolumechange',
139 'onwaiting',
140
141 // Graphical Event Attributes
142 'onactivate', 'onfocusin', 'onfocusout',
143
144 // ---------------------------------------------------------------------------
145 // Other: common generics
146 // ---------------------------------------------------------------------------
147
148 'cx', 'cy',
149 'd' , 'dx', 'dy',
150 'fr', 'fx', 'fy',
151 'g1', 'g2',
152
153 'in', 'in2' ,
154 'k' , 'k1' , 'k2' , 'k3', 'k3', 'k4',
155
156 'points',
157
158 'r', 'refX', 'refY', 'rx', 'ry',
159
160 'targetX', 'targetY',
161
162 'u1', 'u2',
163 'x' , 'x1', 'x2',
164 'y' , 'y1', 'y2',
165 'z'
166]
167
168K.BSC.nateSvgCommonOpenCloseAtOnceTags = [
169 // Based on:
170 // https://developer.mozilla.org/pl/docs/Web/SVG/Element
171 // Last updated at 2019-02-27.
172 // A-Z list but self-closing only.
173 // Below tags do NOT need closing tag e.g.: <stop ... />
174 'animate',
175 'animateColor',
176 'animateTransform',
177
178 'circle',
179
180 'ellipse',
181
182 'feBlend',
183 'feColorMatrix',
184 'feComponentTransfer',
185 'feComposite',
186 'feConvolveMatrix',
187 'feDiffuseLighting',
188 'feDisplacementMap',
189 'feDistantLight',
190 'feDropShadow',
191 'feFlood',
192 'feFuncA',
193 'feFuncB',
194 'feFuncG',
195 'feFuncR',
196 'feGaussianBlur',
197 'feImage',
198 'feMerge',
199 'feMergeNode',
200 'feMorphology',
201 'feOffset',
202 'fePointLight',
203 'feSpecularLighting',
204 'feSpotLight',
205 'feTile',
206 'feTurbulence',
207
208 'hatchpath',
209
210 'image',
211
212 'line',
213
214 'path',
215 'polygon',
216 'polyline',
217
218 'rect',
219
220 'solidcolor',
221 'stop',
222
223 'use',
224
225 'view',
226]
227
228K.BSC.nateSvgCommonTags = [
229 // Based on:
230 // https://developer.mozilla.org/pl/docs/Web/SVG/Element
231 // Last updated at 2019-02-27.
232 // A-Z list, but without self-closing.
233 // Below tags need using closing tag explicite e.g. <filter>...</filter>
234
235 'a',
236 'animateMotion',
237
238 'clipPath',
239 'color-profile', // self-closing ?
240
241 'defs',
242 'desc', // self-closing ?
243 'discard', // self-closing ?
244
245 'filter',
246 'foreignObject',
247
248 'g',
249
250 'hatch',
251
252 'linearGradient',
253
254 'marker',
255 'mask',
256 'mesh', // self-closing ?
257 'meshgradient',
258 'meshpatch',
259 'meshrow',
260 'metadata',
261 'mpath',
262
263 'pattern',
264
265 'radialGradient',
266
267 'script',
268 'set', // self-closing?
269 'style',
270 'svg',
271 'switch',
272 'symbol',
273
274 'text',
275 'textPath',
276 'title',
277 'tspan',
278]
279
280K.BSC.NateSvgProto =
281{
282 clear() {
283 // Implement if needed.
284 }
285}