File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " react-chart-editor" ,
33 "description" : " plotly.js chart editor react component UI" ,
4- "version" : " 0.35.3 " ,
4+ "version" : " 0.35.4 " ,
55 "author" : " Plotly, Inc." ,
66 "bugs" : {
77 "url" : " https://github.com/plotly/react-chart-editor/issues"
Original file line number Diff line number Diff line change @@ -245,9 +245,9 @@ Embed images in your figure to make the data more readable or to brand your cont
245245Enable // react-chart-editor: /default_panels/StyleAxesPanel.js:67
246246Enabled // react-chart-editor: /default_panels/GraphTransformsPanel.js:73
247247End Point // react-chart-editor: /default_panels/StyleShapesPanel.js:33
248- Enter LaTeX formatted text // react-chart-editor: /components/fields/TextEditor.js:71
248+ Enter LaTeX formatted text // react-chart-editor: /components/fields/TextEditor.js:79
249249Enter Link URL // react-chart-editor: /components/widgets/text_editors/RichText/LinkEditor.js:89
250- Enter html formatted text // react-chart-editor: /components/fields/TextEditor.js:84
250+ Enter html formatted text // react-chart-editor: /components/fields/TextEditor.js:92
251251Equirectangular // react-chart-editor: /default_panels/GraphSubplotsPanel.js:115
252252Error (+) // react-chart-editor: /components/fields/ErrorBars.js:146
253253Error (-) // react-chart-editor: /components/fields/ErrorBars.js:147
Original file line number Diff line number Diff line change @@ -242,9 +242,9 @@ Embed images in your figure to make the data more readable or to brand your cont
242242Enable // /default_panels/StyleAxesPanel.js:67
243243Enabled // /default_panels/GraphTransformsPanel.js:73
244244End Point // /default_panels/StyleShapesPanel.js:33
245- Enter LaTeX formatted text // /components/fields/TextEditor.js:71
245+ Enter LaTeX formatted text // /components/fields/TextEditor.js:79
246246Enter Link URL // /components/widgets/text_editors/RichText/LinkEditor.js:89
247- Enter html formatted text // /components/fields/TextEditor.js:84
247+ Enter html formatted text // /components/fields/TextEditor.js:92
248248Equirectangular // /default_panels/GraphSubplotsPanel.js:115
249249Error (+) // /components/fields/ErrorBars.js:146
250250Error (-) // /components/fields/ErrorBars.js:147
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ const INDEX_IN_TEMPLATE_STRING_REGEX = /%{(meta(\[(\d+)]))}/;
1414
1515export class UnconnectedTextEditor extends Component {
1616 hasTemplateStrings ( value ) {
17+ if ( ! value ) {
18+ return false ;
19+ }
1720 return value . match ( TEMPLATE_STRING_REGEX ) ;
1821 }
1922
@@ -28,7 +31,9 @@ export class UnconnectedTextEditor extends Component {
2831 const index = INDEX_IN_TEMPLATE_STRING_REGEX . exec ( match ) ;
2932 if ( index ) {
3033 const adjustedIndex = parseInt ( index [ 3 ] , 10 ) - 1 ;
31- return `%{meta[${ adjustedIndex } ]}` ;
34+ if ( ! isNaN ( adjustedIndex ) ) {
35+ return `%{meta[${ adjustedIndex } ]}` ;
36+ }
3237 }
3338 return match ;
3439 } ) ;
@@ -44,7 +49,10 @@ export class UnconnectedTextEditor extends Component {
4449 const index = INDEX_IN_TEMPLATE_STRING_REGEX . exec ( match ) ;
4550 if ( index ) {
4651 const adjustedIndex = parseInt ( index [ 3 ] , 10 ) + 1 ;
47- return `%{meta[${ adjustedIndex } ]}` ;
52+ if ( ! isNaN ( adjustedIndex ) ) {
53+ return `%{meta[${ adjustedIndex } ]}` ;
54+ }
55+ return match ;
4856 }
4957 return match ;
5058 } ) ;
You can’t perform that action at this time.
0 commit comments