@cdc/markup-include 4.25.2-25 → 4.25.3

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.2-25",
3
+ "version": "4.25.3",
4
4
  "description": "React component for displaying HTML content from an outside link",
5
5
  "moduleName": "CdcMarkupInclude",
6
6
  "main": "dist/cdcmarkupinclude",
@@ -27,7 +27,7 @@
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.2-25",
30
+ "@cdc/core": "^4.25.3",
31
31
  "axios": "^1.6.0",
32
32
  "chroma": "0.0.1",
33
33
  "chroma-js": "^2.1.0",
@@ -39,5 +39,5 @@
39
39
  "react": "^18.2.0",
40
40
  "react-dom": "^18.2.0"
41
41
  },
42
- "gitHead": "f00bd8a0fc746def7cc23b91ef49a03a3ceac65e"
42
+ "gitHead": "b09566f5a7d57c8d0109e5f407257729d6b36846"
43
43
  }
@@ -75,7 +75,7 @@ const CdcMarkupInclude: React.FC<CdcMarkupIncludeProps> = ({
75
75
  dispatch({ type: 'SET_CONFIG', payload: newConfig })
76
76
  }
77
77
 
78
- const loadConfig = useCallback(async () => {
78
+ const loadConfig = async () => {
79
79
  let response = configObj || (await (await fetch(configUrl)).json())
80
80
  let responseData = response.data ?? {}
81
81
 
@@ -89,7 +89,7 @@ const CdcMarkupInclude: React.FC<CdcMarkupIncludeProps> = ({
89
89
 
90
90
  updateConfig({ ...configObj, ...processedConfig })
91
91
  dispatch({ type: 'SET_LOADING', payload: false })
92
- }, [])
92
+ }
93
93
 
94
94
  // Custom Functions
95
95
  useEffect(() => {
@@ -116,7 +116,7 @@ const CdcMarkupInclude: React.FC<CdcMarkupIncludeProps> = ({
116
116
  }
117
117
  }, [markupError])
118
118
 
119
- const loadConfigMarkupData = useCallback(async () => {
119
+ const loadConfigMarkupData = async () => {
120
120
  dispatch({ type: 'SET_MARKUP_ERROR', payload: null })
121
121
 
122
122
  if (srcUrl) {
@@ -147,7 +147,7 @@ const CdcMarkupInclude: React.FC<CdcMarkupIncludeProps> = ({
147
147
  } else {
148
148
  dispatch({ type: 'SET_URL_MARKUP', payload: '' })
149
149
  }
150
- }, [srcUrl])
150
+ }
151
151
 
152
152
  const filterOutConditions = (workingData, conditionList) => {
153
153
  const { columnName, isOrIsNotEqualTo, value } = conditionList[0]
@@ -212,11 +212,12 @@ const CdcMarkupInclude: React.FC<CdcMarkupIncludeProps> = ({
212
212
  let parse
213
213
  let hasBody = false
214
214
  if (markup && markup !== '' && markup !== null) {
215
- if (markup.toString().match(/<body[^>]*>/i) && markup.toString().match(/<\/body\s*>/i)) {
215
+ const markupString = markup.toString()
216
+ if (markupString.match(/<body[^>]*>/i) && markupString.match(/<\/body\s*>/i)) {
216
217
  hasBody = true
217
- parse = markup.toString().match(/<body[^>]*>([^<]*(?:(?!<\/?body)<[^<]*)*)<\/body\s*>/i)
218
+ parse = markupString.match(/<body[^>]*>([^<]*(?:(?!<\/?body)<[^<]*)*)<\/body\s*>/i)
218
219
  } else {
219
- parse = markup.toString()
220
+ parse = markupString
220
221
  }
221
222
  }
222
223
 
@@ -239,7 +240,7 @@ const CdcMarkupInclude: React.FC<CdcMarkupIncludeProps> = ({
239
240
  //Reload any functions when config is updated
240
241
  useEffect(() => {
241
242
  loadConfigMarkupData().catch(err => console.log(err))
242
- }, [loadConfigMarkupData])
243
+ }, [config])
243
244
 
244
245
  let content = <Loading />
245
246
 
@@ -73,7 +73,7 @@ const EditorPanel: React.FC = () => {
73
73
  }
74
74
 
75
75
  const convertStateToConfig = () => {
76
- const strippedState = JSON.parse(JSON.stringify(config))
76
+ const strippedState = _.cloneDeep(config)
77
77
  delete strippedState.newViz
78
78
  delete strippedState.runtime
79
79