diff --git a/lib/metadata.json b/lib/metadata.json index 60afec4a..ec8646e1 100644 --- a/lib/metadata.json +++ b/lib/metadata.json @@ -1327,162 +1327,26 @@ "required": false, "description": "Indicates whether the media should start playing from the start when it's finished." }, - "preload": { - "type": { - "name": "string" - }, - "required": false, - "description": "Indicates whether the whole resource, parts of it or nothing should be preloaded." - }, - "src": { - "type": { - "name": "string" - }, - "required": false, - "description": "The URL of the embeddable content." - }, - "accessKey": { - "type": { - "name": "string" - }, - "required": false, - "description": "Defines a keyboard shortcut to activate or add focus to the element." - }, - "className": { - "type": { - "name": "string" - }, - "required": false, - "description": "Often used with CSS to style elements with common properties." - }, - "contentEditable": { - "type": { - "name": "string" - }, - "required": false, - "description": "Indicates whether the element's content is editable." - }, - "contextMenu": { - "type": { - "name": "string" - }, - "required": false, - "description": "Defines the ID of a element which will serve as the element's context menu." - }, - "dir": { - "type": { - "name": "string" - }, - "required": false, - "description": "Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)" - }, - "draggable": { - "type": { - "name": "string" - }, - "required": false, - "description": "Defines whether the element can be dragged." - }, - "hidden": { - "type": { - "name": "string" - }, - "required": false, - "description": "Prevents rendering of given element, while keeping child elements, e.g. script elements, active." - }, - "lang": { - "type": { - "name": "string" - }, - "required": false, - "description": "Defines the language used in the element." - }, - "spellCheck": { - "type": { - "name": "string" - }, - "required": false, - "description": "Indicates whether spell checking is allowed for the element." - }, - "style": { - "type": { - "name": "object" - }, - "required": false, - "description": "Defines CSS styles which will override styles previously set." - }, - "tabIndex": { - "type": { - "name": "string" - }, - "required": false, - "description": "Overrides the browser's default tab order and follows the one specified instead." - }, - "title": { + "muted": { "type": { "name": "string" }, "required": false, - "description": "Text to be displayed in a tooltip when hovering over the element." - }, - "fireEvent": { - "type": { - "name": "func" - }, - "required": false, - "description": "A callback for firing events to dash." + "description": "Indicates whether the audio will be initially silenced on page load." }, - "dashEvents": { - "type": { - "name": "enum", - "value": [ - { - "value": "'click'", - "computed": false - } - ] - }, - "required": false, - "description": "" - } - } - }, - "src/components/B.react.js": { - "description": "", - "methods": [], - "props": { - "id": { + "preload": { "type": { "name": "string" }, "required": false, - "description": "The ID of this component, used to identify dash components\nin callbacks. The ID needs to be unique across all of the\ncomponents in an app." - }, - "children": { - "type": { - "name": "node" - }, - "required": false, - "description": "The children of this component" - }, - "n_clicks": { - "type": { - "name": "custom", - "raw": "PropTypes.integer" - }, - "required": false, - "description": "An integer that represents the number of times\nthat this element has been clicked on.", - "defaultValue": { - "value": "0", - "computed": false - } + "description": "Indicates whether the whole resource, parts of it or nothing should be preloaded." }, - "key": { + "src": { "type": { "name": "string" }, "required": false, - "description": "A unique identifier for the component, used to improve\nperformance by React.js while rendering components\nSee https://reactjs.org/docs/lists-and-keys.html for more info" + "description": "The URL of the embeddable content." }, "accessKey": { "type": { @@ -1590,7 +1454,7 @@ } } }, - "src/components/Base.react.js": { + "src/components/B.react.js": { "description": "", "methods": [], "props": { @@ -1627,20 +1491,6 @@ "required": false, "description": "A unique identifier for the component, used to improve\nperformance by React.js while rendering components\nSee https://reactjs.org/docs/lists-and-keys.html for more info" }, - "href": { - "type": { - "name": "string" - }, - "required": false, - "description": "The URL of a linked resource." - }, - "target": { - "type": { - "name": "string" - }, - "required": false, - "description": "" - }, "accessKey": { "type": { "name": "string" @@ -9198,6 +9048,149 @@ } } }, + "src/components/Image.react.js": { + "description": "", + "methods": [], + "props": { + "id": { + "type": { + "name": "string" + }, + "required": false, + "description": "The ID of this component, used to identify dash components\nin callbacks. The ID needs to be unique across all of the\ncomponents in an app." + }, + "children": { + "type": { + "name": "node" + }, + "required": false, + "description": "The children of this component" + }, + "n_clicks": { + "type": { + "name": "custom", + "raw": "PropTypes.integer" + }, + "required": false, + "description": "An integer that represents the number of times\nthat this element has been clicked on.", + "defaultValue": { + "value": "0", + "computed": false + } + }, + "key": { + "type": { + "name": "string" + }, + "required": false, + "description": "A unique identifier for the component, used to improve\nperformance by React.js while rendering components\nSee https://reactjs.org/docs/lists-and-keys.html for more info" + }, + "accessKey": { + "type": { + "name": "string" + }, + "required": false, + "description": "Defines a keyboard shortcut to activate or add focus to the element." + }, + "className": { + "type": { + "name": "string" + }, + "required": false, + "description": "Often used with CSS to style elements with common properties." + }, + "contentEditable": { + "type": { + "name": "string" + }, + "required": false, + "description": "Indicates whether the element's content is editable." + }, + "contextMenu": { + "type": { + "name": "string" + }, + "required": false, + "description": "Defines the ID of a element which will serve as the element's context menu." + }, + "dir": { + "type": { + "name": "string" + }, + "required": false, + "description": "Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)" + }, + "draggable": { + "type": { + "name": "string" + }, + "required": false, + "description": "Defines whether the element can be dragged." + }, + "hidden": { + "type": { + "name": "string" + }, + "required": false, + "description": "Prevents rendering of given element, while keeping child elements, e.g. script elements, active." + }, + "lang": { + "type": { + "name": "string" + }, + "required": false, + "description": "Defines the language used in the element." + }, + "spellCheck": { + "type": { + "name": "string" + }, + "required": false, + "description": "Indicates whether spell checking is allowed for the element." + }, + "style": { + "type": { + "name": "object" + }, + "required": false, + "description": "Defines CSS styles which will override styles previously set." + }, + "tabIndex": { + "type": { + "name": "string" + }, + "required": false, + "description": "Overrides the browser's default tab order and follows the one specified instead." + }, + "title": { + "type": { + "name": "string" + }, + "required": false, + "description": "Text to be displayed in a tooltip when hovering over the element." + }, + "fireEvent": { + "type": { + "name": "func" + }, + "required": false, + "description": "A callback for firing events to dash." + }, + "dashEvents": { + "type": { + "name": "enum", + "value": [ + { + "value": "'click'", + "computed": false + } + ] + }, + "required": false, + "description": "" + } + } + }, "src/components/Img.react.js": { "description": "", "methods": [], @@ -18907,149 +18900,6 @@ } } }, - "src/components/Title.react.js": { - "description": "", - "methods": [], - "props": { - "id": { - "type": { - "name": "string" - }, - "required": false, - "description": "The ID of this component, used to identify dash components\nin callbacks. The ID needs to be unique across all of the\ncomponents in an app." - }, - "children": { - "type": { - "name": "node" - }, - "required": false, - "description": "The children of this component" - }, - "n_clicks": { - "type": { - "name": "custom", - "raw": "PropTypes.integer" - }, - "required": false, - "description": "An integer that represents the number of times\nthat this element has been clicked on.", - "defaultValue": { - "value": "0", - "computed": false - } - }, - "key": { - "type": { - "name": "string" - }, - "required": false, - "description": "A unique identifier for the component, used to improve\nperformance by React.js while rendering components\nSee https://reactjs.org/docs/lists-and-keys.html for more info" - }, - "accessKey": { - "type": { - "name": "string" - }, - "required": false, - "description": "Defines a keyboard shortcut to activate or add focus to the element." - }, - "className": { - "type": { - "name": "string" - }, - "required": false, - "description": "Often used with CSS to style elements with common properties." - }, - "contentEditable": { - "type": { - "name": "string" - }, - "required": false, - "description": "Indicates whether the element's content is editable." - }, - "contextMenu": { - "type": { - "name": "string" - }, - "required": false, - "description": "Defines the ID of a element which will serve as the element's context menu." - }, - "dir": { - "type": { - "name": "string" - }, - "required": false, - "description": "Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)" - }, - "draggable": { - "type": { - "name": "string" - }, - "required": false, - "description": "Defines whether the element can be dragged." - }, - "hidden": { - "type": { - "name": "string" - }, - "required": false, - "description": "Prevents rendering of given element, while keeping child elements, e.g. script elements, active." - }, - "lang": { - "type": { - "name": "string" - }, - "required": false, - "description": "Defines the language used in the element." - }, - "spellCheck": { - "type": { - "name": "string" - }, - "required": false, - "description": "Indicates whether spell checking is allowed for the element." - }, - "style": { - "type": { - "name": "object" - }, - "required": false, - "description": "Defines CSS styles which will override styles previously set." - }, - "tabIndex": { - "type": { - "name": "string" - }, - "required": false, - "description": "Overrides the browser's default tab order and follows the one specified instead." - }, - "title": { - "type": { - "name": "string" - }, - "required": false, - "description": "Text to be displayed in a tooltip when hovering over the element." - }, - "fireEvent": { - "type": { - "name": "func" - }, - "required": false, - "description": "A callback for firing events to dash." - }, - "dashEvents": { - "type": { - "name": "enum", - "value": [ - { - "value": "'click'", - "computed": false - } - ] - }, - "required": false, - "description": "" - } - } - }, "src/components/Tr.react.js": { "description": "", "methods": [], diff --git a/scripts/data/attributes.json b/scripts/data/attributes.json index f27df9e0..5e8b8d97 100644 --- a/scripts/data/attributes.json +++ b/scripts/data/attributes.json @@ -420,6 +420,7 @@ }, "muted": { "elements": [ + "audio", "video" ], "description": "Indicates whether the audio will be initially silenced on page load." @@ -863,6 +864,7 @@ "controls", "crossOrigin", "loop", + "muted", "preload", "src" ], diff --git a/scripts/data/elements.txt b/scripts/data/elements.txt index d9144eb2..a6d296e2 100644 --- a/scripts/data/elements.txt +++ b/scripts/data/elements.txt @@ -1,7 +1,5 @@ -base link meta -title address article aside @@ -115,6 +113,7 @@ element font frame frameset +image isindex keygen listing diff --git a/src/components/Audio.react.js b/src/components/Audio.react.js index 150d1806..d43eca61 100644 --- a/src/components/Audio.react.js +++ b/src/components/Audio.react.js @@ -74,6 +74,11 @@ Audio.propTypes = { */ 'loop': PropTypes.string, + /** + * Indicates whether the audio will be initially silenced on page load. + */ + 'muted': PropTypes.string, + /** * Indicates whether the whole resource, parts of it or nothing should be preloaded. */ diff --git a/src/components/Base.react.js b/src/components/Base.react.js deleted file mode 100644 index 0116d259..00000000 --- a/src/components/Base.react.js +++ /dev/null @@ -1,136 +0,0 @@ - -import React, {PropTypes} from 'react'; - -const Base = (props) => { - if (props.fireEvent || props.setProps) { - return ( - { - if (props.setProps) props.setProps({n_clicks: props.n_clicks + 1}); - if (props.fireEvent) props.fireEvent({event: 'click'}); - }} - {...props} - > - {props.children} - - ); - } else { - return ( - - {props.children} - - ); - } -}; - -Base.defaultProps = { - n_clicks: 0 -}; - -Base.propTypes = { - /** - * The ID of this component, used to identify dash components - * in callbacks. The ID needs to be unique across all of the - * components in an app. - */ - 'id': PropTypes.string, - - /** - * The children of this component - */ - 'children': PropTypes.node, - - /** - * An integer that represents the number of times - * that this element has been clicked on. - */ - 'n_clicks': PropTypes.integer, - - /** - * A unique identifier for the component, used to improve - * performance by React.js while rendering components - * See https://reactjs.org/docs/lists-and-keys.html for more info - */ - 'key': PropTypes.string, - - - /** - * The URL of a linked resource. - */ - 'href': PropTypes.string, - - /** - * - */ - 'target': PropTypes.string, - - /** - * Defines a keyboard shortcut to activate or add focus to the element. - */ - 'accessKey': PropTypes.string, - - /** - * Often used with CSS to style elements with common properties. - */ - 'className': PropTypes.string, - - /** - * Indicates whether the element's content is editable. - */ - 'contentEditable': PropTypes.string, - - /** - * Defines the ID of a element which will serve as the element's context menu. - */ - 'contextMenu': PropTypes.string, - - /** - * Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) - */ - 'dir': PropTypes.string, - - /** - * Defines whether the element can be dragged. - */ - 'draggable': PropTypes.string, - - /** - * Prevents rendering of given element, while keeping child elements, e.g. script elements, active. - */ - 'hidden': PropTypes.string, - - /** - * Defines the language used in the element. - */ - 'lang': PropTypes.string, - - /** - * Indicates whether spell checking is allowed for the element. - */ - 'spellCheck': PropTypes.string, - - /** - * Defines CSS styles which will override styles previously set. - */ - 'style': PropTypes.object, - - /** - * Overrides the browser's default tab order and follows the one specified instead. - */ - 'tabIndex': PropTypes.string, - - /** - * Text to be displayed in a tooltip when hovering over the element. - */ - 'title': PropTypes.string, - - /** - * A callback for firing events to dash. - */ - 'fireEvent': PropTypes.func, - - 'dashEvents': PropTypes.oneOf(['click']) - -}; - -export default Base; diff --git a/src/components/Title.react.js b/src/components/Image.react.js similarity index 93% rename from src/components/Title.react.js rename to src/components/Image.react.js index 5e7b7f8a..c454f4b4 100644 --- a/src/components/Title.react.js +++ b/src/components/Image.react.js @@ -1,10 +1,10 @@ import React, {PropTypes} from 'react'; -const Title = (props) => { +const Image = (props) => { if (props.fireEvent || props.setProps) { return ( - { if (props.setProps) props.setProps({n_clicks: props.n_clicks + 1}); if (props.fireEvent) props.fireEvent({event: 'click'}); @@ -12,22 +12,22 @@ const Title = (props) => { {...props} > {props.children} - + ); } else { return ( - + <image {...props}> {props.children} - + ); } }; -Title.defaultProps = { +Image.defaultProps = { n_clicks: 0 }; -Title.propTypes = { +Image.propTypes = { /** * The ID of this component, used to identify dash components * in callbacks. The ID needs to be unique across all of the @@ -123,4 +123,4 @@ Title.propTypes = { }; -export default Title; +export default Image; diff --git a/src/index.js b/src/index.js index b4539df0..605695dd 100644 --- a/src/index.js +++ b/src/index.js @@ -8,7 +8,6 @@ import Article from './components/Article.react'; import Aside from './components/Aside.react'; import Audio from './components/Audio.react'; import B from './components/B.react'; -import Base from './components/Base.react'; import Basefont from './components/Basefont.react'; import Bdi from './components/Bdi.react'; import Bdo from './components/Bdo.react'; @@ -59,6 +58,7 @@ import Hgroup from './components/Hgroup.react'; import Hr from './components/Hr.react'; import I from './components/I.react'; import Iframe from './components/Iframe.react'; +import Image from './components/Image.react'; import Img from './components/Img.react'; import Ins from './components/Ins.react'; import Isindex from './components/Isindex.react'; @@ -122,7 +122,6 @@ import Tfoot from './components/Tfoot.react'; import Th from './components/Th.react'; import Thead from './components/Thead.react'; import Time from './components/Time.react'; -import Title from './components/Title.react'; import Tr from './components/Tr.react'; import Track from './components/Track.react'; import Tt from './components/Tt.react'; @@ -133,4 +132,4 @@ import Video from './components/Video.react'; import Wbr from './components/Wbr.react'; import Xmp from './components/Xmp.react'; -export {A,Abbr,Acronym,Address,Applet,Area,Article,Aside,Audio,B,Base,Basefont,Bdi,Bdo,Big,Blink,Blockquote,Br,Button,Canvas,Caption,Center,Cite,Code,Col,Colgroup,Command,Content,Data,Datalist,Dd,Del,Details,Dfn,Dialog,Dir,Div,Dl,Dt,Element,Em,Embed,Fieldset,Figcaption,Figure,Font,Footer,Form,Frame,Frameset,H1,H2,H3,H4,H5,H6,Header,Hgroup,Hr,I,Iframe,Img,Ins,Isindex,Kbd,Keygen,Label,Legend,Li,Link,Listing,Main,MapEl,Mark,Marquee,Menu,Menuitem,Meta,Meter,Multicol,Nav,Nextid,Noembed,Noscript,ObjectEl,Ol,Optgroup,Option,Output,P,Param,Plaintext,Pre,Progress,Q,Rp,Rt,Rtc,Ruby,S,Samp,Script,Section,Select,Shadow,Slot,Small,Source,Spacer,Span,Strike,Strong,Sub,Summary,Sup,Table,Tbody,Td,Template,Textarea,Tfoot,Th,Thead,Time,Title,Tr,Track,Tt,U,Ul,Var,Video,Wbr,Xmp}; +export {A,Abbr,Acronym,Address,Applet,Area,Article,Aside,Audio,B,Basefont,Bdi,Bdo,Big,Blink,Blockquote,Br,Button,Canvas,Caption,Center,Cite,Code,Col,Colgroup,Command,Content,Data,Datalist,Dd,Del,Details,Dfn,Dialog,Dir,Div,Dl,Dt,Element,Em,Embed,Fieldset,Figcaption,Figure,Font,Footer,Form,Frame,Frameset,H1,H2,H3,H4,H5,H6,Header,Hgroup,Hr,I,Iframe,Image,Img,Ins,Isindex,Kbd,Keygen,Label,Legend,Li,Link,Listing,Main,MapEl,Mark,Marquee,Menu,Menuitem,Meta,Meter,Multicol,Nav,Nextid,Noembed,Noscript,ObjectEl,Ol,Optgroup,Option,Output,P,Param,Plaintext,Pre,Progress,Q,Rp,Rt,Rtc,Ruby,S,Samp,Script,Section,Select,Shadow,Slot,Small,Source,Spacer,Span,Strike,Strong,Sub,Summary,Sup,Table,Tbody,Td,Template,Textarea,Tfoot,Th,Thead,Time,Tr,Track,Tt,U,Ul,Var,Video,Wbr,Xmp};