@cdc/editor 4.23.11 → 4.24.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/dist/cdceditor.js +166411 -164247
- package/example/private/DEV-6574.json +514 -0
- package/example/private/filters/Alabama.json +4217 -0
- package/example/private/filters/Alaska.json +1737 -0
- package/example/private/filters/All.json +146 -0
- package/example/private/filters/Arkansas.json +4713 -0
- package/example/private/filters/California.json +198 -0
- package/example/private/filters/Colorado.json +1500 -0
- package/example/private/filters/Connecticut.json +559 -0
- package/example/private/filters/Delaware.json +63 -0
- package/example/private/filters/DistrictofColumbia.json +63 -0
- package/example/private/filters/Florida.json +4217 -0
- package/package.json +9 -9
- package/src/CdcEditor.jsx +15 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/editor",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.24.1",
|
|
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.
|
|
28
|
-
"@cdc/core": "^4.
|
|
29
|
-
"@cdc/dashboard": "^4.
|
|
30
|
-
"@cdc/data-bite": "^4.
|
|
31
|
-
"@cdc/map": "^4.
|
|
32
|
-
"@cdc/markup-include": "^4.
|
|
33
|
-
"@cdc/waffle-chart": "^4.
|
|
27
|
+
"@cdc/chart": "^4.24.1",
|
|
28
|
+
"@cdc/core": "^4.24.1",
|
|
29
|
+
"@cdc/dashboard": "^4.24.1",
|
|
30
|
+
"@cdc/data-bite": "^4.24.1",
|
|
31
|
+
"@cdc/map": "^4.24.1",
|
|
32
|
+
"@cdc/markup-include": "^4.24.1",
|
|
33
|
+
"@cdc/waffle-chart": "^4.24.1",
|
|
34
34
|
"axios": "^1.6.0",
|
|
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": "
|
|
46
|
+
"gitHead": "a352a3f74f4b681191e3244061dbb3621f36eec3"
|
|
47
47
|
}
|
package/src/CdcEditor.jsx
CHANGED
|
@@ -24,6 +24,11 @@ export default function CdcEditor({ config: configObj = { newViz: true }, hostna
|
|
|
24
24
|
const [tempConfig, setTempConfig] = useState(null)
|
|
25
25
|
const [errors, setErrors] = useState([])
|
|
26
26
|
|
|
27
|
+
const setTempConfigAndUpdate = config => {
|
|
28
|
+
updateVizConfig(JSON.parse(JSON.stringify(config)))
|
|
29
|
+
setTempConfig(config)
|
|
30
|
+
}
|
|
31
|
+
|
|
27
32
|
const [currentViewport, setCurrentViewport] = useState('lg')
|
|
28
33
|
const [dimensions, setDimensions] = useState([])
|
|
29
34
|
|
|
@@ -127,18 +132,22 @@ export default function CdcEditor({ config: configObj = { newViz: true }, hostna
|
|
|
127
132
|
return strippedConfig
|
|
128
133
|
}
|
|
129
134
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
if (null !== tempConfig) {
|
|
135
|
+
const updateVizConfig = newTempConfig => {
|
|
136
|
+
if (null !== newTempConfig) {
|
|
133
137
|
// Remove runtime/unnecessary items from config before saving to WCMS, performance optimization
|
|
134
|
-
let strippedConfig = stripConfig(
|
|
138
|
+
let strippedConfig = stripConfig(newTempConfig)
|
|
135
139
|
|
|
136
140
|
const parsedData = JSON.stringify(strippedConfig)
|
|
137
141
|
// Emit the data in a regular JS event so it can be consumed by anything.
|
|
138
142
|
const event = new CustomEvent('updateVizConfig', { detail: parsedData, bubbles: true })
|
|
139
143
|
window.dispatchEvent(event)
|
|
140
144
|
}
|
|
141
|
-
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Temp Config is for changes made in the components proper - to prevent render cycles. Regular config is for changes made in the first two tabs.
|
|
148
|
+
useEffect(() => {
|
|
149
|
+
updateVizConfig(tempConfig)
|
|
150
|
+
}, [JSON.stringify(tempConfig)])
|
|
142
151
|
|
|
143
152
|
useEffect(() => {
|
|
144
153
|
let strippedConfig = stripConfig(config)
|
|
@@ -180,7 +189,7 @@ export default function CdcEditor({ config: configObj = { newViz: true }, hostna
|
|
|
180
189
|
globalActive,
|
|
181
190
|
setGlobalActive,
|
|
182
191
|
tempConfig,
|
|
183
|
-
setTempConfig,
|
|
192
|
+
setTempConfig: setTempConfigAndUpdate,
|
|
184
193
|
sharepath,
|
|
185
194
|
isDebug
|
|
186
195
|
}
|