@cdc/markup-include 1.0.2 → 4.22.11
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/LICENSE +201 -0
- package/README.md +2 -1
- package/dist/cdcmarkupinclude.js +2 -2
- package/examples/example-config.json +2 -1
- package/examples/gallery/button-and-text.json +31 -0
- package/examples/gallery/icon-no-text.json +31 -0
- package/examples/gallery/image-with-text.json +31 -0
- package/examples/test.html +26 -1
- package/package.json +3 -3
- package/src/CdcMarkupInclude.jsx +51 -78
- package/src/ConfigContext.js +3 -3
- package/src/components/EditorPanel.js +61 -66
- package/src/data/initial-state.js +12 -12
- package/src/index.html +27 -8
- package/src/index.js +2 -2
- package/src/scss/main.scss +18 -2
package/src/index.html
CHANGED
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
/* max-width: 1000px; */
|
|
9
|
+
margin: 0 auto !important;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.react-container + .react-container {
|
|
16
|
+
margin-top: 3rem;
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<!-- Original -->
|
|
22
|
+
<div class="react-container" data-config="/examples/example-config.json"></div>
|
|
23
|
+
|
|
24
|
+
<!-- DATA PRESENTATION GALLERY: https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/Markup-Include.html#examples -->
|
|
25
|
+
<!-- <div class="react-container" data-config="/examples/gallery/icon-no-text.json"></div> -->
|
|
26
|
+
<!-- <div class="react-container" data-config="/examples/gallery/image-with-text.json"></div> -->
|
|
27
|
+
<!-- <div class="react-container" data-config="/examples/gallery/button-and-text.json"></div> -->
|
|
28
|
+
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
29
|
+
</body>
|
|
11
30
|
</html>
|
package/src/index.js
CHANGED
|
@@ -8,11 +8,11 @@ const domContainers = document.querySelectorAll('.react-container')
|
|
|
8
8
|
|
|
9
9
|
let isEditor = window.location.href.includes('editor=true')
|
|
10
10
|
|
|
11
|
-
domContainers.forEach(
|
|
11
|
+
domContainers.forEach(domContainer => {
|
|
12
12
|
render(
|
|
13
13
|
<React.StrictMode>
|
|
14
14
|
<GlobalContextProvider>
|
|
15
|
-
<CdcMarkupInclude configUrl={domContainer.attributes['data-config'].value} isEditor={isEditor}/>
|
|
15
|
+
<CdcMarkupInclude configUrl={domContainer.attributes['data-config'].value} isEditor={isEditor} />
|
|
16
16
|
</GlobalContextProvider>
|
|
17
17
|
</React.StrictMode>,
|
|
18
18
|
domContainer
|
package/src/scss/main.scss
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
@import '~@cdc/core/styles/v2/main';
|
|
2
2
|
|
|
3
3
|
.markup-include {
|
|
4
|
+
.checkbox-group {
|
|
5
|
+
padding: 16px;
|
|
6
|
+
border: 1px solid #c4c4c4;
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
margin-top: 8px;
|
|
9
|
+
margin-bottom: 24px;
|
|
10
|
+
}
|
|
4
11
|
|
|
5
|
-
.cove-component__header {
|
|
12
|
+
.cove-component__header {
|
|
6
13
|
font-size: unset;
|
|
7
14
|
}
|
|
8
|
-
|
|
15
|
+
|
|
9
16
|
.cove-component__content {
|
|
10
17
|
background-color: #f2f2f2;
|
|
11
18
|
font-size: 14px;
|
|
@@ -14,3 +21,12 @@
|
|
|
14
21
|
background: transparent;
|
|
15
22
|
}
|
|
16
23
|
}
|
|
24
|
+
|
|
25
|
+
.cove-accordion__panel-section {
|
|
26
|
+
overflow: auto;
|
|
27
|
+
|
|
28
|
+
label {
|
|
29
|
+
display: block;
|
|
30
|
+
float: left;
|
|
31
|
+
}
|
|
32
|
+
}
|