@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.
@@ -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
- <noscript>You need to enable JavaScript to run this app.</noscript>
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.1",
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": "npx webpack serve --mode development -c ../../webpack.config.js",
8
- "build": "npx webpack --mode production --env packageName=CdcMarkupInclude --env folderName=markup-include -c ../../webpack.config.js",
9
- "prepublishOnly": "lerna run --scope @cdc/markup-include build"
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": "rshelnutt <qyu6@cdc.gov>",
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.1",
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": "1.4.9",
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": "^17.0.2",
33
- "react-dom": "^17.0.2"
38
+ "react": "^18.2.0",
39
+ "react-dom": "^18.2.0"
34
40
  },
35
- "resolutions": {
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
+ )
@@ -1,4 +1,4 @@
1
- @import '~@cdc/core/styles/v2/main';
1
+ @import '@cdc/core/styles/v2/main';
2
2
 
3
3
  .markup-include {
4
4
  .checkbox-group {
@@ -0,0 +1,6 @@
1
+ // Placeholder test until we add them in.
2
+ describe('Markup Include', () => {
3
+ it('has a test.', async () => {
4
+ return true
5
+ })
6
+ })
package/vite.config.js ADDED
@@ -0,0 +1,4 @@
1
+ import GenerateViteConfig from '../../generateViteConfig.js'
2
+ import { moduleName } from './package.json'
3
+
4
+ export default GenerateViteConfig(moduleName)
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