@cdc/markup-include 4.23.1 → 4.23.3
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 +6496 -2
- package/{src/index.html → index.html} +1 -1
- package/package.json +16 -13
- package/src/index.jsx +18 -0
- package/src/scss/main.scss +1 -1
- package/src/test/CdcMarkupInclude.test.jsx +6 -0
- package/vite.config.js +4 -0
- package/src/index.js +0 -20
- /package/src/{ConfigContext.js → ConfigContext.jsx} +0 -0
- /package/src/components/{EditorPanel.js → EditorPanel.jsx} +0 -0
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
<!-- <div class="react-container" data-config="/examples/gallery/icon-no-text.json"></div> -->
|
|
26
26
|
<!-- <div class="react-container" data-config="/examples/gallery/image-with-text.json"></div> -->
|
|
27
27
|
<!-- <div class="react-container" data-config="/examples/gallery/button-and-text.json"></div> -->
|
|
28
|
-
<
|
|
28
|
+
<script type="module" src="./src/index.jsx"></script>
|
|
29
29
|
</body>
|
|
30
30
|
</html>
|
package/package.json
CHANGED
|
@@ -1,39 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/markup-include",
|
|
3
|
-
"version": "4.23.
|
|
3
|
+
"version": "4.23.3",
|
|
4
4
|
"description": "React component for displaying HTML content from an outside link",
|
|
5
|
+
"moduleName": "CdcMarkupInclude",
|
|
5
6
|
"main": "dist/cdcmarkupinclude",
|
|
7
|
+
"type": "module",
|
|
6
8
|
"scripts": {
|
|
7
|
-
"start": "
|
|
8
|
-
"build": "
|
|
9
|
-
"
|
|
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 watch --reporter verbose",
|
|
15
|
+
"test:ui": "vitest --ui"
|
|
10
16
|
},
|
|
11
17
|
"repository": {
|
|
12
18
|
"type": "git",
|
|
13
19
|
"url": "git+https://github.com/CDCgov/cdc-open-viz",
|
|
14
20
|
"directory": "packages/markup-include"
|
|
15
21
|
},
|
|
16
|
-
"author": "
|
|
22
|
+
"author": "Rob Shelnutt <rob@blackairplane.com>",
|
|
17
23
|
"bugs": {
|
|
18
24
|
"url": "https://github.com/CDCgov/cdc-open-viz/issues"
|
|
19
25
|
},
|
|
20
26
|
"license": "Apache-2.0",
|
|
21
27
|
"homepage": "https://github.com/CDCgov/cdc-open-viz#readme",
|
|
22
28
|
"dependencies": {
|
|
23
|
-
"@cdc/core": "^4.23.
|
|
29
|
+
"@cdc/core": "^4.23.3",
|
|
24
30
|
"axios": "^0.26.1",
|
|
25
31
|
"chroma": "0.0.1",
|
|
26
32
|
"chroma-js": "^2.1.0",
|
|
27
|
-
"html-react-parser": "
|
|
33
|
+
"html-react-parser": "^3.0.8",
|
|
28
34
|
"interweave": "^13.0.0",
|
|
29
35
|
"react-accessible-accordion": "^3.3.4"
|
|
30
36
|
},
|
|
31
37
|
"peerDependencies": {
|
|
32
|
-
"react": "^
|
|
33
|
-
"react-dom": "^
|
|
38
|
+
"react": "^18.2.0",
|
|
39
|
+
"react-dom": "^18.2.0"
|
|
34
40
|
},
|
|
35
|
-
"
|
|
36
|
-
"@types/react": "17.x"
|
|
37
|
-
},
|
|
38
|
-
"gitHead": "58163844cc9ce2c379235413b19f49679eab4bef"
|
|
41
|
+
"gitHead": "6fa3b11db159d38538f18023fe70b67a29e7d327"
|
|
39
42
|
}
|
package/src/index.jsx
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import ReactDOM from 'react-dom/client'
|
|
3
|
+
|
|
4
|
+
import { GlobalContextProvider } from '@cdc/core/components/GlobalContext'
|
|
5
|
+
|
|
6
|
+
import CdcMarkupInclude from './CdcMarkupInclude'
|
|
7
|
+
|
|
8
|
+
let isEditor = window.location.href.includes('editor=true')
|
|
9
|
+
|
|
10
|
+
let domContainer = document.getElementsByClassName('react-container')[0]
|
|
11
|
+
|
|
12
|
+
ReactDOM.createRoot(domContainer).render(
|
|
13
|
+
<React.StrictMode>
|
|
14
|
+
<GlobalContextProvider>
|
|
15
|
+
<CdcMarkupInclude configUrl={domContainer.attributes['data-config'].value} isEditor={isEditor} />
|
|
16
|
+
</GlobalContextProvider>
|
|
17
|
+
</React.StrictMode>,
|
|
18
|
+
)
|
package/src/scss/main.scss
CHANGED
package/vite.config.js
ADDED
package/src/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { render } from 'react-dom'
|
|
3
|
-
|
|
4
|
-
import { GlobalContextProvider } from '@cdc/core/components/GlobalContext'
|
|
5
|
-
import CdcMarkupInclude from './CdcMarkupInclude'
|
|
6
|
-
|
|
7
|
-
const domContainers = document.querySelectorAll('.react-container')
|
|
8
|
-
|
|
9
|
-
let isEditor = window.location.href.includes('editor=true')
|
|
10
|
-
|
|
11
|
-
domContainers.forEach(domContainer => {
|
|
12
|
-
render(
|
|
13
|
-
<React.StrictMode>
|
|
14
|
-
<GlobalContextProvider>
|
|
15
|
-
<CdcMarkupInclude configUrl={domContainer.attributes['data-config'].value} isEditor={isEditor} />
|
|
16
|
-
</GlobalContextProvider>
|
|
17
|
-
</React.StrictMode>,
|
|
18
|
-
domContainer
|
|
19
|
-
)
|
|
20
|
-
})
|
|
File without changes
|
|
File without changes
|