@cdc/editor 4.23.3 → 4.23.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdc/editor",
3
- "version": "4.23.3",
3
+ "version": "4.23.4",
4
4
  "description": "React component for generating a new component entry",
5
5
  "moduleName": "CdcEditor",
6
6
  "main": "dist/cdceditor",
@@ -24,13 +24,13 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@cdc/chart": "^4.23.3",
28
- "@cdc/core": "^4.23.3",
29
- "@cdc/dashboard": "^4.23.3",
30
- "@cdc/data-bite": "^4.23.3",
31
- "@cdc/map": "^4.23.3",
32
- "@cdc/markup-include": "^4.23.3",
33
- "@cdc/waffle-chart": "^4.23.3",
27
+ "@cdc/chart": "^4.23.4",
28
+ "@cdc/core": "^4.23.4",
29
+ "@cdc/dashboard": "^4.23.4",
30
+ "@cdc/data-bite": "^4.23.4",
31
+ "@cdc/map": "^4.23.4",
32
+ "@cdc/markup-include": "^4.23.4",
33
+ "@cdc/waffle-chart": "^4.23.4",
34
34
  "axios": "^0.21.1",
35
35
  "d3": "^7.0.0",
36
36
  "html-react-parser": "^3.0.8",
@@ -43,5 +43,5 @@
43
43
  "react": "^18.2.0",
44
44
  "react-dom": "^18.2.0"
45
45
  },
46
- "gitHead": "6fa3b11db159d38538f18023fe70b67a29e7d327"
46
+ "gitHead": "dcd395d76f70b2d113f2b4c6fe50a52522655cd1"
47
47
  }
package/src/CdcEditor.jsx CHANGED
@@ -19,7 +19,7 @@ import Tabs from './components/Tabs'
19
19
 
20
20
  import './scss/main.scss'
21
21
 
22
- export default function CdcEditor({ config: configObj = { newViz: true }, hostname, containerEl, sharepath }) {
22
+ export default function CdcEditor({ config: configObj = { newViz: true }, hostname, containerEl, sharepath, isDebug }) {
23
23
  const [config, setConfig] = useState(configObj)
24
24
  const [tempConfig, setTempConfig] = useState(null)
25
25
  const [errors, setErrors] = useState([])
@@ -146,7 +146,8 @@ export default function CdcEditor({ config: configObj = { newViz: true }, hostna
146
146
  setGlobalActive,
147
147
  tempConfig,
148
148
  setTempConfig,
149
- sharepath
149
+ sharepath,
150
+ isDebug
150
151
  }
151
152
 
152
153
  let configureDisabled = true
@@ -18,6 +18,7 @@ import PairedBarIcon from '@cdc/core/assets/icon-chart-bar-paired.svg'
18
18
  import HorizontalStackIcon from '@cdc/core/assets/icon-chart-bar-stacked.svg'
19
19
  import ScatterPlotIcon from '@cdc/core/assets/icon-chart-scatterplot.svg'
20
20
  import BoxPlotIcon from '@cdc/core/assets/icon-chart-box-whisker.svg'
21
+ import AreaChartIcon from '@cdc/core/assets/icon-area-chart.svg'
21
22
 
22
23
  export default function ChooseTab() {
23
24
  const { config, setConfig, setGlobalActive, tempConfig, setTempConfig } = useContext(ConfigContext)
@@ -208,7 +209,7 @@ export default function ChooseTab() {
208
209
  {/* <li>
209
210
  <Tooltip>
210
211
  <Tooltip.Target>
211
- <IconButton label='Area Chart' type='chart' subType='Area Chart' orientation='vertical' icon={<GenericIcon />} />
212
+ <IconButton label='Area Chart' type='chart' subType='Area Chart' orientation='vertical' icon={<AreaChartIcon />} />
212
213
  </Tooltip.Target>
213
214
  <Tooltip.Content>Display an area chart</Tooltip.Content>
214
215
  </Tooltip>
@@ -13,7 +13,7 @@ import ErrorBoundary from '@cdc/core/components/ErrorBoundary'
13
13
  import ConfigContext from '../ConfigContext'
14
14
 
15
15
  export default function ConfigureTab({ containerEl }) {
16
- const { config, setTempConfig, hostname } = useContext(ConfigContext)
16
+ const { config, setTempConfig, hostname, isDebug } = useContext(ConfigContext)
17
17
 
18
18
  let { type } = config
19
19
 
@@ -21,37 +21,37 @@ export default function ConfigureTab({ containerEl }) {
21
21
  case 'map':
22
22
  return (
23
23
  <ErrorBoundary component='CdcMap'>
24
- <CdcMap isEditor={true} config={config} hostname={hostname} setConfig={setTempConfig} containerEl={containerEl} />
24
+ <CdcMap isEditor={true} isDebug={isDebug} config={config} hostname={hostname} setConfig={setTempConfig} containerEl={containerEl} />
25
25
  </ErrorBoundary>
26
26
  )
27
27
  case 'chart':
28
28
  return (
29
29
  <ErrorBoundary component='CdcChart'>
30
- <CdcChart isEditor={true} config={config} setConfig={setTempConfig} />
30
+ <CdcChart isEditor={true} isDebug={isDebug} config={config} setConfig={setTempConfig} />
31
31
  </ErrorBoundary>
32
32
  )
33
33
  case 'dashboard':
34
34
  return (
35
35
  <ErrorBoundary component='CdcDashboard'>
36
- <CdcDashboard isEditor={true} config={config} setConfig={setTempConfig} />
36
+ <CdcDashboard isEditor={true} isDebug={isDebug} config={config} setConfig={setTempConfig} />
37
37
  </ErrorBoundary>
38
38
  )
39
39
  case 'data-bite':
40
40
  return (
41
41
  <ErrorBoundary component='CdcDashboard'>
42
- <CdcDataBite isEditor={true} config={config} setConfig={setTempConfig} />
42
+ <CdcDataBite isEditor={true} isDebug={isDebug} config={config} setConfig={setTempConfig} />
43
43
  </ErrorBoundary>
44
44
  )
45
45
  case 'waffle-chart':
46
46
  return (
47
47
  <ErrorBoundary component='CdcDashboard'>
48
- <CdcWaffleChart isEditor={true} config={config} setConfig={setTempConfig} />
48
+ <CdcWaffleChart isEditor={true} isDebug={isDebug} config={config} setConfig={setTempConfig} />
49
49
  </ErrorBoundary>
50
50
  )
51
51
  case 'markup-include':
52
52
  return (
53
53
  <ErrorBoundary component='CdcDashboard'>
54
- <CdcMarkupInclude isEditor={true} config={config} setConfig={setTempConfig} />
54
+ <CdcMarkupInclude isEditor={true} isDebug={isDebug} config={config} setConfig={setTempConfig} />
55
55
  </ErrorBoundary>
56
56
  )
57
57
  default:
package/src/index.jsx CHANGED
@@ -9,8 +9,10 @@ let activeTab = Number.parseInt(standaloneParams.get('active')) - 1 || null
9
9
 
10
10
  let domContainer = document.getElementsByClassName('react-container')[0]
11
11
 
12
+ let isDebug = window.location.href.includes('debug=true')
13
+
12
14
  ReactDOM.createRoot(domContainer).render(
13
15
  <React.StrictMode>
14
- <CdcEditor startingTab={activeTab} containerEl={domContainer} />
15
- </React.StrictMode>,
16
+ <CdcEditor startingTab={activeTab} containerEl={domContainer} isDebug={isDebug} />
17
+ </React.StrictMode>
16
18
  )