6
6
var utilities = require ( './utilities' ) ;
7
7
8
8
// HTML and SVG DOM Property Configs
9
- var HTMLDOMPropertyConfig = require ( 'react-dom/lib/HTMLDOMPropertyConfig' ) ;
10
- var SVGDOMPropertyConfig = require ( 'react-dom/lib/SVGDOMPropertyConfig' ) ;
9
+ var HTMLDOMPropertyConfig = require ( 'react-dom-core /lib/HTMLDOMPropertyConfig' ) ;
10
+ var SVGDOMPropertyConfig = require ( 'react-dom-core /lib/SVGDOMPropertyConfig' ) ;
11
11
12
12
var config = {
13
13
html : { } ,
@@ -18,44 +18,42 @@ var propertyName;
18
18
19
19
/**
20
20
* HTML DOM property config.
21
+ * https://github.com/facebook/react/blob/master/src/renderers/dom/shared/HTMLDOMPropertyConfig.js
21
22
*/
22
23
23
- // first map out the HTML DOM attribute names
24
+ // first map out the HTML attribute names
24
25
// e.g., { className: 'class' } => { 'class': 'className' }
25
- // https://github.com/facebook/react/blob/master/src/renderers/dom/shared/HTMLDOMPropertyConfig.js#L204
26
26
config . html = utilities . invertObject (
27
27
HTMLDOMPropertyConfig . DOMAttributeNames
28
28
) ;
29
29
30
- // then map out the rest of the HTML DOM properties
31
- // e.g., { charSet: 0 } => { charset: 'charSet' }
32
- // https://github.com/facebook/react/blob/master/src/renderers/dom/shared/HTMLDOMPropertyConfig.js#L28
30
+ // then map out the rest of the HTML properties
31
+ // e.g., { readOnly: 0 } => { readonly: 'readOnly' }
33
32
for ( propertyName in HTMLDOMPropertyConfig . Properties ) {
34
33
// lowercase to make matching property names easier
35
34
config . html [ propertyName . toLowerCase ( ) ] = propertyName ;
36
35
}
37
36
38
37
/**
39
38
* SVG DOM property config.
39
+ * https://github.com/facebook/react/blob/master/src/renderers/dom/shared/SVGDOMPropertyConfig.js
40
40
*/
41
41
42
- // first map out the SVG DOM attribute names
42
+ // first map out the SVG attribute names
43
43
// e.g., { fontSize: 'font-size' } => { 'font-size': 'fontSize' }
44
- // https://github.com/facebook/react/blob/master/src/renderers/dom/shared/SVGDOMPropertyConfig.js#L36
45
44
config . svg = utilities . invertObject (
46
45
SVGDOMPropertyConfig . DOMAttributeNames
47
46
) ;
48
47
49
- // then map out the rest of the SVG DOM properties
50
- // e.g., { preserveAlpha: 0 } => { preserveAlpha: 'preserveAlpha' }
51
- // https://github.com/facebook/react/blob/master/src/renderers/dom/shared/HTMLDOMPropertyConfig.js#L28
48
+ // then map out the rest of the SVG properties
49
+ // e.g., { fillRule: 0 } => { fillRule: 'fillRule' }
52
50
for ( propertyName in SVGDOMPropertyConfig . Properties ) {
53
51
// do not lowercase as some svg properties are camel cased
54
52
config . html [ propertyName ] = propertyName ;
55
53
}
56
54
57
55
/**
58
- * Export React property configs.
56
+ * Export property configs.
59
57
*/
60
58
module . exports = {
61
59
config : config ,
0 commit comments