11import React , { lazy } from 'react' ;
22import { Container , Row , Col } from 'react-bootstrap'
3- import ArticleCellOutput from './ArticleCellOutput '
3+ import ArticleCellOutputs from './ArticleCellOutputs '
44import ArticleCellContent from './ArticleCellContent'
55import ArticleCellSourceCode from './ArticleCellSourceCode'
66import ArticleCellFigure from './ArticleCellFigure'
@@ -25,6 +25,8 @@ const ArticleCell = ({
2525 isNarrativeStep,
2626 figure, // ArticleFigure instance
2727 headingLevel= 0 , // if isHeading, set this to its ArticleHeading.level value
28+ isJavascriptTrusted = false ,
29+ onNumClick,
2830} ) => {
2931 let cellBootstrapColumnLayout = metadata . jdh ?. text ?. bootstrapColumLayout || BootstrapColumLayout ;
3032 // we override or set the former layout if it appears in narrative-step
@@ -71,7 +73,14 @@ const ArticleCell = ({
7173 < Container >
7274 < Row >
7375 < Col className = "ArticleCellQuote" { ...BootstrapQuoteColumLayout } >
74- < ArticleCellContent layer = { layer } content = { content } idx = { idx } num = { num } hideNum = { hideNum } />
76+ < ArticleCellContent
77+ onNumClick = { onNumClick }
78+ layer = { layer }
79+ content = { content }
80+ idx = { idx }
81+ num = { num }
82+ hideNum = { hideNum }
83+ />
7584 </ Col >
7685 </ Row >
7786 </ Container >
@@ -85,17 +94,32 @@ const ArticleCell = ({
8594 metadata = { metadata }
8695 figure = { figure }
8796 figureColumnLayout = { cellObjectBootstrapColumnLayout }
97+ isJavascriptTrusted = { isJavascriptTrusted }
8898 isNarrativeStep = { isNarrativeStep }
8999 >
90- < ArticleCellContent hideNum = { ! ! figure } layer = { layer } content = { content } idx = { idx } num = { num } />
100+ < ArticleCellContent
101+ onNumClick = { onNumClick }
102+ layer = { layer }
103+ content = { content }
104+ idx = { idx }
105+ num = { num }
106+ />
91107 </ ArticleCellFigure >
92108 )
93109 }
94110 return (
95111 < Container >
96112 < Row >
97113 < Col { ... cellBootstrapColumnLayout } >
98- < ArticleCellContent headingLevel = { headingLevel } hideNum = { hideNum } layer = { layer } content = { content } idx = { idx } num = { num } />
114+ < ArticleCellContent
115+ headingLevel = { headingLevel }
116+ onNumClick = { onNumClick }
117+ hideNum = { hideNum }
118+ layer = { layer }
119+ content = { content }
120+ idx = { idx }
121+ num = { num }
122+ />
99123 </ Col >
100124 </ Row >
101125 </ Container >
@@ -110,21 +134,24 @@ const ArticleCell = ({
110134 figure = { figure }
111135 isNarrativeStep = { isNarrativeStep }
112136 figureColumnLayout = { cellObjectBootstrapColumnLayout }
137+ isJavascriptTrusted = { isJavascriptTrusted }
113138 sourceCode = { < ArticleCellSourceCode toggleVisibility content = { content } language = "python" /> }
114139 > </ ArticleCellFigure >
115140 )
116141 }
142+
117143 return (
118144 < Container >
119145 < Row >
120146 < Col { ... cellBootstrapColumnLayout } >
121147 < div className = "ArticleCellContent" >
122148 < div className = "ArticleCellContent_num" > </ div >
123149 < ArticleCellSourceCode visible content = { content } language = "python" />
124- { outputs . length
125- ? outputs . map ( ( output , i ) => < ArticleCellOutput output = { output } key = { i } /> )
126- : < div className = "ArticleCellSourceCode_no_output" > no output</ div >
127- }
150+ < ArticleCellOutputs
151+ isJavascriptTrusted = { false }
152+ cellIdx = { idx }
153+ outputs = { outputs }
154+ />
128155 </ div >
129156 </ Col >
130157 </ Row >
0 commit comments