@cdc/markup-include 4.26.1 → 4.26.2
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/cdcmarkupinclude.js +10682 -10654
- package/examples/default.json +69 -0
- package/index.html +1 -29
- package/package.json +31 -34
- package/src/CdcMarkupInclude.tsx +1 -1
- package/src/data/initial-state.js +4 -2
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contentEditor": {
|
|
3
|
+
"inlineHTML": "<div>The age adjusted rate for {{race}} was 644.2, compared to Non-Hispanic American Indian, which was {{ageAdjustedRate}}.</div>",
|
|
4
|
+
"markupVariables": [
|
|
5
|
+
{
|
|
6
|
+
"name": "race",
|
|
7
|
+
"tag": "{{race}}",
|
|
8
|
+
"columnName": "Race",
|
|
9
|
+
"conditions": [
|
|
10
|
+
{
|
|
11
|
+
"columnName": "Age-adjusted rate",
|
|
12
|
+
"isOrIsNotEqualTo": "is",
|
|
13
|
+
"value": "644.2"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "ageAdjustedRate",
|
|
19
|
+
"tag": "{{ageAdjustedRate}}",
|
|
20
|
+
"columnName": "Age-adjusted rate",
|
|
21
|
+
"conditions": [
|
|
22
|
+
{
|
|
23
|
+
"columnName": "Race",
|
|
24
|
+
"isOrIsNotEqualTo": "is",
|
|
25
|
+
"value": "Non-Hispanic American Indian"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"showHeader": false,
|
|
31
|
+
"srcUrl": "https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/examples/Markup-Include-Button-and-Text.html",
|
|
32
|
+
"title": "",
|
|
33
|
+
"useInlineHTML": false
|
|
34
|
+
},
|
|
35
|
+
"data": [
|
|
36
|
+
{
|
|
37
|
+
"Race": "Hispanic or Latino",
|
|
38
|
+
"Age-adjusted rate": "644.2"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"Race": "Non-Hispanic American Indian",
|
|
42
|
+
"Age-adjusted rate": "636.1"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"Race": "Non-Hispanic Black",
|
|
46
|
+
"Age-adjusted rate": "563.7"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"Race": "Non-Hispanic Asian or Pacific Islander",
|
|
50
|
+
"Age-adjusted rate": "202.5"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"Race": "Non-Hispanic White",
|
|
54
|
+
"Age-adjusted rate": "183.6"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"legend": {},
|
|
58
|
+
"newViz": true,
|
|
59
|
+
"theme": "theme-amber",
|
|
60
|
+
"type": "markup-include",
|
|
61
|
+
"runtime": null,
|
|
62
|
+
"visual": {
|
|
63
|
+
"border": false,
|
|
64
|
+
"accent": true,
|
|
65
|
+
"background": true,
|
|
66
|
+
"hideBackgroundColor": false,
|
|
67
|
+
"borderColorTheme": false
|
|
68
|
+
}
|
|
69
|
+
}
|
package/index.html
CHANGED
|
@@ -1,29 +1 @@
|
|
|
1
|
-
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
|
6
|
-
<style type="text/css">
|
|
7
|
-
body {
|
|
8
|
-
margin: 0;
|
|
9
|
-
border-top: none !important;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/* Add 1rem padding to mimic DFE when editor is not visible */
|
|
13
|
-
.cdc-open-viz-module:not(.isEditor) {
|
|
14
|
-
padding: 1rem;
|
|
15
|
-
}
|
|
16
|
-
</style>
|
|
17
|
-
<link rel="stylesheet prefetch" href="https://www.cdc.gov/TemplatePackage/5.0/css/app.min.css?_=71669" />
|
|
18
|
-
</head>
|
|
19
|
-
|
|
20
|
-
<body>
|
|
21
|
-
<!-- Original -->
|
|
22
|
-
|
|
23
|
-
<!-- DATA PRESENTATION GALLERY: https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/Markup-Include.html#examples -->
|
|
24
|
-
<!-- <div class="react-container" data-config="/src/_stories/_mock/icon-no-text.json"></div> -->
|
|
25
|
-
<!-- <div class="react-container" data-config="/src/_stories/_mock/image-with-text.json"></div> -->
|
|
26
|
-
<div class="react-container" data-config="/src/_stories/_mock/button-and-text.json"></div>
|
|
27
|
-
<script type="module" src="./src/index.tsx"></script>
|
|
28
|
-
</body>
|
|
29
|
-
</html>
|
|
1
|
+
<!-- index.html is generated by @cdc/core/generateViteConfig.js using the files in @cdc/core/devTemplate/ -->
|
package/package.json
CHANGED
|
@@ -1,49 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/markup-include",
|
|
3
|
-
"version": "4.26.
|
|
3
|
+
"version": "4.26.2",
|
|
4
4
|
"description": "React component for displaying HTML content from an outside link",
|
|
5
|
-
"moduleName": "CdcMarkupInclude",
|
|
6
|
-
"main": "dist/cdcmarkupinclude",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"start": "vite --open",
|
|
10
|
-
"build": "vite build",
|
|
11
|
-
"preview": "vite preview",
|
|
12
|
-
"graph": "nx graph",
|
|
13
|
-
"prepublishOnly": "lerna run --scope @cdc/markup-include build",
|
|
14
|
-
"test": "vitest run --reporter verbose",
|
|
15
|
-
"test-watch": "vitest watch --reporter verbose",
|
|
16
|
-
"test-watch:ui": "vitest --ui"
|
|
17
|
-
},
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/CDCgov/cdc-open-viz",
|
|
21
|
-
"directory": "packages/markup-include"
|
|
22
|
-
},
|
|
23
|
-
"author": "Rob Shelnutt <rob@blackairplane.com>",
|
|
24
|
-
"bugs": {
|
|
25
|
-
"url": "https://github.com/CDCgov/cdc-open-viz/issues"
|
|
26
|
-
},
|
|
27
5
|
"license": "Apache-2.0",
|
|
28
|
-
"
|
|
6
|
+
"author": "Rob Shelnutt <rob@blackairplane.com>",
|
|
7
|
+
"bugs": "https://github.com/CDCgov/cdc-open-viz/issues",
|
|
29
8
|
"dependencies": {
|
|
30
|
-
"@cdc/core": "^4.26.
|
|
31
|
-
"axios": "^1.
|
|
32
|
-
"chroma": "0.0.1",
|
|
9
|
+
"@cdc/core": "^4.26.2",
|
|
10
|
+
"axios": "^1.13.2",
|
|
33
11
|
"interweave": "^13.1.1",
|
|
34
|
-
"lodash": "^4.17.
|
|
12
|
+
"lodash": "^4.17.23",
|
|
35
13
|
"react-accessible-accordion": "^5.0.1"
|
|
36
14
|
},
|
|
37
|
-
"peerDependencies": {
|
|
38
|
-
"react": "^18.2.0",
|
|
39
|
-
"react-dom": "^18.2.0"
|
|
40
|
-
},
|
|
41
15
|
"devDependencies": {
|
|
42
16
|
"@rollup/plugin-dsv": "^3.0.2",
|
|
43
|
-
"@vitejs/plugin-react": "^
|
|
17
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
44
18
|
"sass": "^1.89.2",
|
|
45
19
|
"vite-plugin-css-injected-by-js": "^2.4.0",
|
|
46
20
|
"vite-plugin-svgr": "^4.2.0"
|
|
47
21
|
},
|
|
48
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "be3413e8e1149abf94225108f86a7910f56e0616",
|
|
23
|
+
"homepage": "https://github.com/CDCgov/cdc-open-viz#readme",
|
|
24
|
+
"main": "dist/cdcmarkupinclude",
|
|
25
|
+
"moduleName": "CdcMarkupInclude",
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"react": "^18.2.0",
|
|
28
|
+
"react-dom": "^18.2.0"
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/CDCgov/cdc-open-viz",
|
|
33
|
+
"directory": "packages/markup-include"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "vite build",
|
|
37
|
+
"graph": "nx graph",
|
|
38
|
+
"prepublishOnly": "lerna run --scope @cdc/markup-include build",
|
|
39
|
+
"preview": "vite preview",
|
|
40
|
+
"start": "vite --open",
|
|
41
|
+
"test": "vitest run --reporter verbose",
|
|
42
|
+
"test-watch": "vitest watch --reporter verbose",
|
|
43
|
+
"test-watch:ui": "vitest --ui"
|
|
44
|
+
},
|
|
45
|
+
"type": "module"
|
|
49
46
|
}
|
package/src/CdcMarkupInclude.tsx
CHANGED
|
@@ -124,7 +124,7 @@ const CdcMarkupInclude: React.FC<CdcMarkupIncludeProps> = ({
|
|
|
124
124
|
processedConfig.filters = addValuesToFilters(processedConfig.filters, responseData)
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
updateConfig({ ...
|
|
127
|
+
updateConfig({ ...defaults, ...processedConfig })
|
|
128
128
|
dispatch({ type: 'SET_LOADING', payload: false })
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
contentEditor: {
|
|
3
|
-
inlineHTML: '<
|
|
3
|
+
inlineHTML: '<strong>Inline HTML</strong>',
|
|
4
4
|
showHeader: true,
|
|
5
5
|
srcUrl: '#example',
|
|
6
6
|
title: '',
|
|
7
7
|
titleStyle: 'small',
|
|
8
|
-
useInlineHTML:
|
|
8
|
+
useInlineHTML: true,
|
|
9
9
|
showNoDataMessage: false,
|
|
10
10
|
noDataMessageText: 'No Data Available'
|
|
11
11
|
},
|
|
12
12
|
data: [],
|
|
13
13
|
legend: {},
|
|
14
14
|
newViz: true,
|
|
15
|
+
showEditorPanel: true,
|
|
15
16
|
theme: 'theme-blue',
|
|
16
17
|
type: 'markup-include',
|
|
18
|
+
visualizationType: 'markup-include',
|
|
17
19
|
runtime: null,
|
|
18
20
|
visual: {
|
|
19
21
|
border: false,
|