@cdc/filtered-text 4.25.7 → 4.25.10
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/cdcfilteredtext.js +4265 -3984
- package/package.json +12 -3
- package/src/CdcFilteredText.jsx +8 -2
- package/src/components/EditorPanel.jsx +3 -2
- package/src/index.jsx +0 -1
- package/src/test/CdcFilteredText.test.jsx +8 -3
- package/vite.config.js +1 -1
- package/src/coreStyles_filteredtext.scss +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/filtered-text",
|
|
3
|
-
"version": "4.25.
|
|
3
|
+
"version": "4.25.10",
|
|
4
4
|
"description": "React component for adding filtered text on dashboards.",
|
|
5
5
|
"moduleName": "CdcFilteredText",
|
|
6
6
|
"main": "dist/cdcfilteredtext",
|
|
@@ -26,11 +26,20 @@
|
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
27
|
"homepage": "https://github.com/CDCgov/cdc-open-viz#readme",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@cdc/core": "^4.25.
|
|
29
|
+
"@cdc/core": "^4.25.10",
|
|
30
|
+
"html-react-parser": "5.2.3",
|
|
31
|
+
"lodash": "^4.17.21"
|
|
30
32
|
},
|
|
31
33
|
"peerDependencies": {
|
|
32
34
|
"react": "^18.2.0",
|
|
33
35
|
"react-dom": "^18.2.0"
|
|
34
36
|
},
|
|
35
|
-
"
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@rollup/plugin-dsv": "^3.0.2",
|
|
39
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
40
|
+
"vite": "^4.4.11",
|
|
41
|
+
"vite-plugin-css-injected-by-js": "^2.4.0",
|
|
42
|
+
"vite-plugin-svgr": "^2.4.0"
|
|
43
|
+
},
|
|
44
|
+
"gitHead": "c2db758e74ab9b9ca1667a6f9cb41dd0dccf985d"
|
|
36
45
|
}
|
package/src/CdcFilteredText.jsx
CHANGED
|
@@ -22,7 +22,13 @@ import parse from 'html-react-parser'
|
|
|
22
22
|
// styles
|
|
23
23
|
import './scss/main.scss'
|
|
24
24
|
|
|
25
|
-
const CdcFilteredText = ({
|
|
25
|
+
const CdcFilteredText = ({
|
|
26
|
+
config: configObj,
|
|
27
|
+
configUrl,
|
|
28
|
+
isDashboard = false,
|
|
29
|
+
isEditor = false,
|
|
30
|
+
setConfig: setParentConfig
|
|
31
|
+
}) => {
|
|
26
32
|
const transform = new DataTransform()
|
|
27
33
|
// Default States
|
|
28
34
|
const [config, setConfig] = useState(defaults)
|
|
@@ -103,7 +109,7 @@ const CdcFilteredText = ({ config: configObj, configUrl, isDashboard = false, is
|
|
|
103
109
|
|
|
104
110
|
//Load initial config
|
|
105
111
|
useEffect(() => {
|
|
106
|
-
loadConfig().catch(err => console.
|
|
112
|
+
loadConfig().catch(err => console.error(err))
|
|
107
113
|
}, []) // eslint-disable-line
|
|
108
114
|
|
|
109
115
|
useEffect(() => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { useState, useEffect,
|
|
1
|
+
import React, { memo, useState, useEffect, useContext } from 'react'
|
|
2
|
+
import cloneConfig from '@cdc/core/helpers/cloneConfig'
|
|
2
3
|
import _ from 'lodash'
|
|
3
4
|
import ConfigContext from '../ConfigContext'
|
|
4
5
|
|
|
@@ -147,7 +148,7 @@ const EditorPanel = memo(props => {
|
|
|
147
148
|
)
|
|
148
149
|
}
|
|
149
150
|
const convertStateToConfig = () => {
|
|
150
|
-
let strippedState =
|
|
151
|
+
let strippedState = cloneConfig(config)
|
|
151
152
|
delete strippedState.newViz
|
|
152
153
|
delete strippedState.runtime
|
|
153
154
|
|
package/src/index.jsx
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import path from 'path'
|
|
2
|
+
import { testStandaloneBuild } from '@cdc/core/helpers/tests/testStandaloneBuild.ts'
|
|
3
|
+
import { describe, it, expect } from 'vitest'
|
|
4
|
+
|
|
2
5
|
describe('Filtered Text', () => {
|
|
3
|
-
it('
|
|
4
|
-
|
|
6
|
+
it('Can be built in isolation', async () => {
|
|
7
|
+
const pkgDir = path.join(__dirname, '..')
|
|
8
|
+
const result = testStandaloneBuild(pkgDir)
|
|
9
|
+
expect(result).toBe(true)
|
|
5
10
|
})
|
|
6
11
|
})
|
package/vite.config.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import '@cdc/core/styles/base';
|