407 lines
10 KiB
JavaScript
407 lines
10 KiB
JavaScript
'use strict'
|
|
|
|
var types = require('./util/types')
|
|
var create = require('./util/create')
|
|
var caseSensitiveTransform = require('./util/case-sensitive-transform')
|
|
|
|
var boolean = types.boolean
|
|
var number = types.number
|
|
var spaceSeparated = types.spaceSeparated
|
|
var commaSeparated = types.commaSeparated
|
|
var commaOrSpaceSeparated = types.commaOrSpaceSeparated
|
|
|
|
module.exports = create({
|
|
space: 'svg',
|
|
attributes: {
|
|
accentHeight: 'accent-height',
|
|
alignmentBaseline: 'alignment-baseline',
|
|
arabicForm: 'arabic-form',
|
|
baselineShift: 'baseline-shift',
|
|
capHeight: 'cap-height',
|
|
className: 'class',
|
|
clipPath: 'clip-path',
|
|
clipRule: 'clip-rule',
|
|
colorInterpolation: 'color-interpolation',
|
|
colorInterpolationFilters: 'color-interpolation-filters',
|
|
colorProfile: 'color-profile',
|
|
colorRendering: 'color-rendering',
|
|
crossOrigin: 'crossorigin',
|
|
dataType: 'datatype',
|
|
dominantBaseline: 'dominant-baseline',
|
|
enableBackground: 'enable-background',
|
|
fillOpacity: 'fill-opacity',
|
|
fillRule: 'fill-rule',
|
|
floodColor: 'flood-color',
|
|
floodOpacity: 'flood-opacity',
|
|
fontFamily: 'font-family',
|
|
fontSize: 'font-size',
|
|
fontSizeAdjust: 'font-size-adjust',
|
|
fontStretch: 'font-stretch',
|
|
fontStyle: 'font-style',
|
|
fontVariant: 'font-variant',
|
|
fontWeight: 'font-weight',
|
|
glyphName: 'glyph-name',
|
|
glyphOrientationHorizontal: 'glyph-orientation-horizontal',
|
|
glyphOrientationVertical: 'glyph-orientation-vertical',
|
|
hrefLang: 'hreflang',
|
|
horizAdvX: 'horiz-adv-x',
|
|
horizOriginX: 'horiz-origin-x',
|
|
horizOriginY: 'horiz-origin-y',
|
|
imageRendering: 'image-rendering',
|
|
letterSpacing: 'letter-spacing',
|
|
lightingColor: 'lighting-color',
|
|
markerEnd: 'marker-end',
|
|
markerMid: 'marker-mid',
|
|
markerStart: 'marker-start',
|
|
navDown: 'nav-down',
|
|
navDownLeft: 'nav-down-left',
|
|
navDownRight: 'nav-down-right',
|
|
navLeft: 'nav-left',
|
|
navNext: 'nav-next',
|
|
navPrev: 'nav-prev',
|
|
navRight: 'nav-right',
|
|
navUp: 'nav-up',
|
|
navUpLeft: 'nav-up-left',
|
|
navUpRight: 'nav-up-right',
|
|
overlinePosition: 'overline-position',
|
|
overlineThickness: 'overline-thickness',
|
|
paintOrder: 'paint-order',
|
|
panose1: 'panose-1',
|
|
pointerEvents: 'pointer-events',
|
|
renderingIntent: 'rendering-intent',
|
|
shapeRendering: 'shape-rendering',
|
|
stopColor: 'stop-color',
|
|
stopOpacity: 'stop-opacity',
|
|
strikethroughPosition: 'strikethrough-position',
|
|
strikethroughThickness: 'strikethrough-thickness',
|
|
strokeDashArray: 'stroke-dasharray',
|
|
strokeDashOffset: 'stroke-dashoffset',
|
|
strokeLineCap: 'stroke-linecap',
|
|
strokeLineJoin: 'stroke-linejoin',
|
|
strokeMiterLimit: 'stroke-miterlimit',
|
|
strokeOpacity: 'stroke-opacity',
|
|
strokeWidth: 'stroke-width',
|
|
tabIndex: 'tabindex',
|
|
textAnchor: 'text-anchor',
|
|
textDecoration: 'text-decoration',
|
|
textRendering: 'text-rendering',
|
|
typeOf: 'typeof',
|
|
underlinePosition: 'underline-position',
|
|
underlineThickness: 'underline-thickness',
|
|
unicodeBidi: 'unicode-bidi',
|
|
unicodeRange: 'unicode-range',
|
|
unitsPerEm: 'units-per-em',
|
|
vAlphabetic: 'v-alphabetic',
|
|
vHanging: 'v-hanging',
|
|
vIdeographic: 'v-ideographic',
|
|
vMathematical: 'v-mathematical',
|
|
vectorEffect: 'vector-effect',
|
|
vertAdvY: 'vert-adv-y',
|
|
vertOriginX: 'vert-origin-x',
|
|
vertOriginY: 'vert-origin-y',
|
|
wordSpacing: 'word-spacing',
|
|
writingMode: 'writing-mode',
|
|
xHeight: 'x-height',
|
|
// These were camelcased in Tiny. Now lowercased in SVG 2
|
|
playbackOrder: 'playbackorder',
|
|
timelineBegin: 'timelinebegin'
|
|
},
|
|
transform: caseSensitiveTransform,
|
|
properties: {
|
|
about: commaOrSpaceSeparated,
|
|
accentHeight: number,
|
|
accumulate: null,
|
|
additive: null,
|
|
alignmentBaseline: null,
|
|
alphabetic: number,
|
|
amplitude: number,
|
|
arabicForm: null,
|
|
ascent: number,
|
|
attributeName: null,
|
|
attributeType: null,
|
|
azimuth: number,
|
|
bandwidth: null,
|
|
baselineShift: null,
|
|
baseFrequency: null,
|
|
baseProfile: null,
|
|
bbox: null,
|
|
begin: null,
|
|
bias: number,
|
|
by: null,
|
|
calcMode: null,
|
|
capHeight: number,
|
|
className: spaceSeparated,
|
|
clip: null,
|
|
clipPath: null,
|
|
clipPathUnits: null,
|
|
clipRule: null,
|
|
color: null,
|
|
colorInterpolation: null,
|
|
colorInterpolationFilters: null,
|
|
colorProfile: null,
|
|
colorRendering: null,
|
|
content: null,
|
|
contentScriptType: null,
|
|
contentStyleType: null,
|
|
crossOrigin: null,
|
|
cursor: null,
|
|
cx: null,
|
|
cy: null,
|
|
d: null,
|
|
dataType: null,
|
|
defaultAction: null,
|
|
descent: number,
|
|
diffuseConstant: number,
|
|
direction: null,
|
|
display: null,
|
|
dur: null,
|
|
divisor: number,
|
|
dominantBaseline: null,
|
|
download: boolean,
|
|
dx: null,
|
|
dy: null,
|
|
edgeMode: null,
|
|
editable: null,
|
|
elevation: number,
|
|
enableBackground: null,
|
|
end: null,
|
|
event: null,
|
|
exponent: number,
|
|
externalResourcesRequired: null,
|
|
fill: null,
|
|
fillOpacity: number,
|
|
fillRule: null,
|
|
filter: null,
|
|
filterRes: null,
|
|
filterUnits: null,
|
|
floodColor: null,
|
|
floodOpacity: null,
|
|
focusable: null,
|
|
focusHighlight: null,
|
|
fontFamily: null,
|
|
fontSize: null,
|
|
fontSizeAdjust: null,
|
|
fontStretch: null,
|
|
fontStyle: null,
|
|
fontVariant: null,
|
|
fontWeight: null,
|
|
format: null,
|
|
fr: null,
|
|
from: null,
|
|
fx: null,
|
|
fy: null,
|
|
g1: commaSeparated,
|
|
g2: commaSeparated,
|
|
glyphName: commaSeparated,
|
|
glyphOrientationHorizontal: null,
|
|
glyphOrientationVertical: null,
|
|
glyphRef: null,
|
|
gradientTransform: null,
|
|
gradientUnits: null,
|
|
handler: null,
|
|
hanging: number,
|
|
hatchContentUnits: null,
|
|
hatchUnits: null,
|
|
height: null,
|
|
href: null,
|
|
hrefLang: null,
|
|
horizAdvX: number,
|
|
horizOriginX: number,
|
|
horizOriginY: number,
|
|
id: null,
|
|
ideographic: number,
|
|
imageRendering: null,
|
|
initialVisibility: null,
|
|
in: null,
|
|
in2: null,
|
|
intercept: number,
|
|
k: number,
|
|
k1: number,
|
|
k2: number,
|
|
k3: number,
|
|
k4: number,
|
|
kernelMatrix: commaOrSpaceSeparated,
|
|
kernelUnitLength: null,
|
|
keyPoints: null, // SEMI_COLON_SEPARATED
|
|
keySplines: null, // SEMI_COLON_SEPARATED
|
|
keyTimes: null, // SEMI_COLON_SEPARATED
|
|
kerning: null,
|
|
lang: null,
|
|
lengthAdjust: null,
|
|
letterSpacing: null,
|
|
lightingColor: null,
|
|
limitingConeAngle: number,
|
|
local: null,
|
|
markerEnd: null,
|
|
markerMid: null,
|
|
markerStart: null,
|
|
markerHeight: null,
|
|
markerUnits: null,
|
|
markerWidth: null,
|
|
mask: null,
|
|
maskContentUnits: null,
|
|
maskUnits: null,
|
|
mathematical: null,
|
|
max: null,
|
|
media: null,
|
|
mediaCharacterEncoding: null,
|
|
mediaContentEncodings: null,
|
|
mediaSize: number,
|
|
mediaTime: null,
|
|
method: null,
|
|
min: null,
|
|
mode: null,
|
|
name: null,
|
|
navDown: null,
|
|
navDownLeft: null,
|
|
navDownRight: null,
|
|
navLeft: null,
|
|
navNext: null,
|
|
navPrev: null,
|
|
navRight: null,
|
|
navUp: null,
|
|
navUpLeft: null,
|
|
navUpRight: null,
|
|
numOctaves: null,
|
|
observer: null,
|
|
offset: null,
|
|
opacity: null,
|
|
operator: null,
|
|
order: null,
|
|
orient: null,
|
|
orientation: null,
|
|
origin: null,
|
|
overflow: null,
|
|
overlay: null,
|
|
overlinePosition: number,
|
|
overlineThickness: number,
|
|
paintOrder: null,
|
|
panose1: null,
|
|
path: null,
|
|
pathLength: number,
|
|
patternContentUnits: null,
|
|
patternTransform: null,
|
|
patternUnits: null,
|
|
phase: null,
|
|
pitch: null,
|
|
playbackOrder: null,
|
|
pointerEvents: null,
|
|
points: null,
|
|
pointsAtX: number,
|
|
pointsAtY: number,
|
|
pointsAtZ: number,
|
|
preserveAlpha: null,
|
|
preserveAspectRatio: null,
|
|
primitiveUnits: null,
|
|
propagate: null,
|
|
property: commaOrSpaceSeparated,
|
|
r: null,
|
|
radius: null,
|
|
refX: null,
|
|
refY: null,
|
|
rel: commaOrSpaceSeparated,
|
|
rev: commaOrSpaceSeparated,
|
|
renderingIntent: null,
|
|
repeatCount: null,
|
|
repeatDur: null,
|
|
requiredExtensions: commaOrSpaceSeparated,
|
|
requiredFeatures: commaOrSpaceSeparated,
|
|
requiredFonts: commaOrSpaceSeparated,
|
|
requiredFormats: commaOrSpaceSeparated,
|
|
resource: null,
|
|
restart: null,
|
|
result: null,
|
|
rotate: null,
|
|
rx: null,
|
|
ry: null,
|
|
scale: null,
|
|
seed: null,
|
|
shapeRendering: null,
|
|
side: null,
|
|
slope: null,
|
|
snapshotTime: null,
|
|
specularConstant: number,
|
|
specularExponent: number,
|
|
spreadMethod: null,
|
|
spacing: null,
|
|
startOffset: null,
|
|
stdDeviation: null,
|
|
stemh: null,
|
|
stemv: null,
|
|
stitchTiles: null,
|
|
stopColor: null,
|
|
stopOpacity: null,
|
|
strikethroughPosition: number,
|
|
strikethroughThickness: number,
|
|
string: null,
|
|
stroke: null,
|
|
strokeDashArray: commaOrSpaceSeparated,
|
|
strokeDashOffset: null,
|
|
strokeLineCap: null,
|
|
strokeLineJoin: null,
|
|
strokeMiterLimit: number,
|
|
strokeOpacity: number,
|
|
strokeWidth: null,
|
|
style: null,
|
|
surfaceScale: number,
|
|
syncBehavior: null,
|
|
syncBehaviorDefault: null,
|
|
syncMaster: null,
|
|
syncTolerance: null,
|
|
syncToleranceDefault: null,
|
|
systemLanguage: commaOrSpaceSeparated,
|
|
tabIndex: number,
|
|
tableValues: null,
|
|
target: null,
|
|
targetX: number,
|
|
targetY: number,
|
|
textAnchor: null,
|
|
textDecoration: null,
|
|
textRendering: null,
|
|
textLength: null,
|
|
timelineBegin: null,
|
|
title: null,
|
|
transformBehavior: null,
|
|
type: null,
|
|
typeOf: commaOrSpaceSeparated,
|
|
to: null,
|
|
transform: null,
|
|
u1: null,
|
|
u2: null,
|
|
underlinePosition: number,
|
|
underlineThickness: number,
|
|
unicode: null,
|
|
unicodeBidi: null,
|
|
unicodeRange: null,
|
|
unitsPerEm: number,
|
|
values: null,
|
|
vAlphabetic: number,
|
|
vMathematical: number,
|
|
vectorEffect: null,
|
|
vHanging: number,
|
|
vIdeographic: number,
|
|
version: null,
|
|
vertAdvY: number,
|
|
vertOriginX: number,
|
|
vertOriginY: number,
|
|
viewBox: null,
|
|
viewTarget: null,
|
|
visibility: null,
|
|
width: null,
|
|
widths: null,
|
|
wordSpacing: null,
|
|
writingMode: null,
|
|
x: null,
|
|
x1: null,
|
|
x2: null,
|
|
xChannelSelector: null,
|
|
xHeight: number,
|
|
y: null,
|
|
y1: null,
|
|
y2: null,
|
|
yChannelSelector: null,
|
|
z: null,
|
|
zoomAndPan: null
|
|
}
|
|
})
|