@cdc/markup-include 4.25.5-1 → 4.25.6-1

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/markup-include",
3
- "version": "4.25.5-1",
3
+ "version": "4.25.6-1",
4
4
  "description": "React component for displaying HTML content from an outside link",
5
5
  "moduleName": "CdcMarkupInclude",
6
6
  "main": "dist/cdcmarkupinclude",
@@ -27,15 +27,15 @@
27
27
  "license": "Apache-2.0",
28
28
  "homepage": "https://github.com/CDCgov/cdc-open-viz#readme",
29
29
  "dependencies": {
30
- "@cdc/core": "^4.25.5-1",
31
- "axios": "^1.6.0",
30
+ "@cdc/core": "^4.25.6-1",
31
+ "axios": "^1.9.0",
32
32
  "chroma": "0.0.1",
33
- "interweave": "^13.0.0",
34
- "react-accessible-accordion": "^3.3.4"
33
+ "interweave": "^13.1.1",
34
+ "react-accessible-accordion": "^5.0.1"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "react": "^18.2.0",
38
38
  "react-dom": "^18.2.0"
39
39
  },
40
- "gitHead": "1d0a6e716bc113e6bea3636fcae90ebf2d19bb5c"
40
+ "gitHead": "ac45ee0f1d6a4045648c4e083992fc091795e084"
41
41
  }
@@ -24,16 +24,20 @@ import './scss/main.scss'
24
24
  type CdcMarkupIncludeProps = {
25
25
  config: MarkupIncludeConfig
26
26
  configUrl: string
27
+ datasets: Datasets
27
28
  isDashboard: boolean
28
29
  isEditor: boolean
29
30
  setConfig: any
30
31
  }
31
32
 
32
33
  import Title from '@cdc/core/components/ui/Title'
34
+ import FootnotesStandAlone from '@cdc/core/components/Footnotes/FootnotesStandAlone'
35
+ import { Datasets } from '@cdc/core/types/DataSet'
33
36
 
34
37
  const CdcMarkupInclude: React.FC<CdcMarkupIncludeProps> = ({
35
38
  configUrl,
36
39
  config: configObj,
40
+ datasets,
37
41
  isDashboard = true,
38
42
  isEditor = false,
39
43
  setConfig: setParentConfig
@@ -226,7 +230,7 @@ const CdcMarkupInclude: React.FC<CdcMarkupIncludeProps> = ({
226
230
 
227
231
  //Load initial config
228
232
  useEffect(() => {
229
- loadConfig().catch(err => console.log(err))
233
+ loadConfig().catch(err => console.error(err))
230
234
  publish('cove_loaded', { loadConfigHasRun: true })
231
235
  }, [])
232
236
 
@@ -239,7 +243,7 @@ const CdcMarkupInclude: React.FC<CdcMarkupIncludeProps> = ({
239
243
 
240
244
  //Reload any functions when config is updated
241
245
  useEffect(() => {
242
- loadConfigMarkupData().catch(err => console.log(err))
246
+ loadConfigMarkupData().catch(err => console.error(err))
243
247
  }, [config])
244
248
 
245
249
  let content = <Loading />
@@ -251,7 +255,7 @@ const CdcMarkupInclude: React.FC<CdcMarkupIncludeProps> = ({
251
255
  if (loading === false) {
252
256
  content = (
253
257
  <>
254
- {isEditor && <EditorPanel />}
258
+ {isEditor && <EditorPanel datasets={datasets} />}
255
259
  {!hideMarkupInclude && (
256
260
  <Layout.Responsive isEditor={isEditor}>
257
261
  <div className='markup-include-content-container cove-component__content no-borders'>
@@ -264,6 +268,7 @@ const CdcMarkupInclude: React.FC<CdcMarkupIncludeProps> = ({
264
268
  </div>
265
269
  </div>
266
270
  </div>
271
+ <FootnotesStandAlone config={configObj?.footnotes} filters={[]} />
267
272
  </div>
268
273
  </Layout.Responsive>
269
274
  )}
@@ -24,6 +24,8 @@ import '@cdc/core/styles/v2/components/editor.scss'
24
24
  import './editorPanel.style.css'
25
25
  import VariableSection from './Variables'
26
26
  import { CheckBox } from '@cdc/core/components/EditorPanel/Inputs'
27
+ import FootnotesEditor from '@cdc/core/components/EditorPanel/FootnotesEditor'
28
+ import { Datasets } from '@cdc/core/types/DataSet'
27
29
 
28
30
  const headerColors = [
29
31
  'theme-blue',
@@ -39,7 +41,11 @@ const headerColors = [
39
41
  'theme-amber'
40
42
  ]
41
43
 
42
- const EditorPanel: React.FC = () => {
44
+ type MarkupIncludeEditorPanelProps = {
45
+ datasets?: Datasets
46
+ }
47
+
48
+ const EditorPanel: React.FC<MarkupIncludeEditorPanelProps> = ({ datasets }) => {
43
49
  const { config, data, isDashboard, loading, setParentConfig, updateConfig } = useContext(ConfigContext)
44
50
  const { contentEditor, theme, visual } = config
45
51
  const { inlineHTML, markupVariables, srcUrl, title, useInlineHTML, allowHideSection } = contentEditor
@@ -296,6 +302,11 @@ const EditorPanel: React.FC = () => {
296
302
  />
297
303
  </div>
298
304
  </Accordion.Section>
305
+ {isDashboard && (
306
+ <Accordion.Section title='Footnotes'>
307
+ <FootnotesEditor config={config} updateField={updateField} datasets={datasets} />
308
+ </Accordion.Section>
309
+ )}
299
310
  </Accordion>
300
311
  )
301
312