Skip to content

Commit 0299406

Browse files
authored
Merge pull request #1798 from plotly/update-r-generation
Updating dashR component generation
2 parents 7c6713b + 4801e01 commit 0299406

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

components/dash-html-components/scripts/data/attributes.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"elements": [
7777
"input"
7878
],
79-
"description": "From the HTML Media CaptureThe definition of 'media capture' in that specification.spec, specifies a new file can be captured."
79+
"description": "From the Media Capture specification, specifies a new file can be captured."
8080
},
8181
"challenge": {
8282
"elements": [
@@ -307,7 +307,7 @@
307307
"object",
308308
"video"
309309
],
310-
"description": "Specifies the height of elements listed here. For all other elements, use the CSS height property. Note: In some instances, such as <div>, this is a legacy attribute, in which case the CSS height property should be used instead."
310+
"description": "Specifies the height of elements listed here. For all other elements, use the CSS height property. Note: In some instances, such as <div>, this is a legacy attribute, in which case the CSS height property should be used instead."
311311
},
312312
"hidden": {
313313
"elements": [
@@ -421,7 +421,7 @@
421421
"elements": [
422422
"html"
423423
],
424-
"description": "Specifies the URL of the document's cache manifest. Note: This attribute is obsolete, use <link rel=\"manifest\"> instead."
424+
"description": "Specifies the URL of the document's cache manifest. Note: This attribute is obsolete, use <link rel=\"manifest\"> instead."
425425
},
426426
"max": {
427427
"elements": [
@@ -787,7 +787,7 @@
787787
"object",
788788
"video"
789789
],
790-
"description": "For the elements listed here, this establishes the element's width. Note: For all other instances, such as <div>, this is a legacy attribute, in which case the CSS width property should be used instead."
790+
"description": "For the elements listed here, this establishes the element's width. Note: For all other instances, such as <div>, this is a legacy attribute, in which case the CSS width property should be used instead."
791791
},
792792
"wrap": {
793793
"elements": [

components/dash-html-components/scripts/extract-attributes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const supportedAttributes = ['accept', 'accessKey', 'action', 'allow',
2525
'manifest', 'marginHeight', 'marginWidth', 'max', 'maxLength', 'media',
2626
'mediaGroup', 'method', 'min', 'minLength', 'multiple', 'muted', 'name',
2727
'noValidate', 'nonce', 'open', 'optimum', 'pattern', 'placeholder', 'poster',
28-
'preload', 'profile', 'radioGroup', 'readOnly', 'referrerPolicy', 'rel', 'required',
28+
'preload', 'profile', 'radioGroup', 'readOnly', 'referrerPolicy', 'rel', 'required',
2929
'reversed', 'role', 'rowSpan', 'rows', 'sandbox', 'scope', 'scoped', 'scrolling',
3030
'seamless', 'selected', 'shape', 'size', 'sizes', 'span', 'spellCheck', 'src',
3131
'srcDoc', 'srcLang', 'srcSet', 'start', 'step', 'style', 'summary', 'tabIndex',
@@ -71,7 +71,7 @@ function extractAttributes($) {
7171
const description = $children.eq(2).text()
7272
.replace(/\n/g, '')
7373
// Fix irregular whitespace characters
74-
.replace(' ', ' ')
74+
.replace(/\s+/g, ' ')
7575
.trim();
7676

7777
const htmlAttribute = str(attribute)

dash/development/_r_components_generation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
# Declaring longer string templates as globals to improve
1414
# readability, make method logic clearer to anyone inspecting
1515
# code below
16-
r_component_string = """{funcname} <- function({default_argtext}{wildcards}) {{
16+
r_component_string = """#' @export
17+
{funcname} <- function({default_argtext}{wildcards}) {{
1718
{wildcard_declaration}
1819
props <- list({default_paramtext}{wildcards})
1920
if (length(props) > 0) {{

0 commit comments

Comments
 (0)