@cdc/filtered-text 4.25.8 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdc/filtered-text",
3
- "version": "4.25.8",
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.8"
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
- "gitHead": "e369994230b5e3facff224e1d89d5937528ac5a0"
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
  }
@@ -22,7 +22,13 @@ import parse from 'html-react-parser'
22
22
  // styles
23
23
  import './scss/main.scss'
24
24
 
25
- const CdcFilteredText = ({ config: configObj, configUrl, isDashboard = false, isEditor = false, setConfig: setParentConfig }) => {
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.log(err))
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, memo, useContext } from 'react'
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 = _.cloneDeep(config)
151
+ let strippedState = cloneConfig(config)
151
152
  delete strippedState.newViz
152
153
  delete strippedState.runtime
153
154
 
package/src/index.jsx CHANGED
@@ -2,7 +2,6 @@ import React from 'react'
2
2
  import ReactDOM from 'react-dom/client'
3
3
 
4
4
  import '@cdc/core/styles/cove-main.scss'
5
- import './coreStyles_filteredtext.scss'
6
5
 
7
6
  import CdcFilteredText from './CdcFilteredText'
8
7
 
@@ -1,6 +1,11 @@
1
- // Placeholder test until we add them in.
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('has a test.', async () => {
4
- return true
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,4 +1,4 @@
1
- import GenerateViteConfig from '../../generateViteConfig.js'
1
+ import GenerateViteConfig from '@cdc/core/generateViteConfig.js'
2
2
  import { moduleName } from './package.json'
3
3
 
4
4
  export default GenerateViteConfig(moduleName)
@@ -1 +0,0 @@
1
- @import '@cdc/core/styles/base';