@mjhls/mjh-framework 1.0.760-page-refresh → 1.0.760

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.
Files changed (44) hide show
  1. package/README.md +167 -167
  2. package/dist/cjs/ConferenceArticleCard.js +15 -15
  3. package/dist/cjs/DeckContent.js +8 -8
  4. package/dist/cjs/EventsDeck.js +18 -18
  5. package/dist/cjs/ExternalResources.js +1 -1
  6. package/dist/cjs/HamMagazine.js +12 -12
  7. package/dist/cjs/IssueLanding.js +29 -29
  8. package/dist/cjs/KMTracker.js +15 -15
  9. package/dist/cjs/MasterDeck.js +8 -8
  10. package/dist/cjs/NavMagazine.js +18 -38
  11. package/dist/cjs/NavNative.js +12 -12
  12. package/dist/cjs/PublicationLanding.js +33 -33
  13. package/dist/cjs/RelatedContent.js +28 -28
  14. package/dist/cjs/RelatedTopicsDropdown.js +10 -10
  15. package/dist/cjs/SideFooter.js +2 -2
  16. package/dist/cjs/VideoSeriesCard.js +1 -1
  17. package/dist/cjs/View.js +2 -2
  18. package/dist/cjs/YoutubeGroup.js +4 -4
  19. package/dist/cjs/{getTargeting-963303c6.js → getTargeting-497b581d.js} +9 -9
  20. package/dist/cjs/getTargeting.js +1 -1
  21. package/dist/cjs/{index-cb6ed1fc.js → index-4d74ffd6.js} +29 -29
  22. package/dist/cjs/index.js +2 -2
  23. package/dist/esm/ConferenceArticleCard.js +15 -15
  24. package/dist/esm/DeckContent.js +8 -8
  25. package/dist/esm/EventsDeck.js +18 -18
  26. package/dist/esm/ExternalResources.js +1 -1
  27. package/dist/esm/HamMagazine.js +12 -12
  28. package/dist/esm/IssueLanding.js +29 -29
  29. package/dist/esm/KMTracker.js +15 -15
  30. package/dist/esm/MasterDeck.js +8 -8
  31. package/dist/esm/NavMagazine.js +18 -38
  32. package/dist/esm/NavNative.js +12 -12
  33. package/dist/esm/PublicationLanding.js +33 -33
  34. package/dist/esm/RelatedContent.js +28 -28
  35. package/dist/esm/RelatedTopicsDropdown.js +10 -10
  36. package/dist/esm/SideFooter.js +2 -2
  37. package/dist/esm/VideoSeriesCard.js +1 -1
  38. package/dist/esm/View.js +2 -2
  39. package/dist/esm/YoutubeGroup.js +4 -4
  40. package/dist/esm/{getTargeting-85315091.js → getTargeting-2d402d66.js} +9 -9
  41. package/dist/esm/getTargeting.js +1 -1
  42. package/dist/esm/{index-750a7380.js → index-ccb770c7.js} +29 -29
  43. package/dist/esm/index.js +2 -2
  44. package/package.json +107 -107
package/README.md CHANGED
@@ -1,167 +1,167 @@
1
- # mjh-framework v. 1.0.760
2
- [![NPM](https://img.shields.io/npm/v/mjh-framework.svg)](https://www.npmjs.com/package/mjh-framework) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
3
-
4
- ## Install
5
-
6
- ```bash
7
- npm install --save @mjhls/mjh-framework
8
- ```
9
-
10
- ## Usage
11
-
12
- ```jsx
13
- import React, { Component } from 'react'
14
-
15
- import { NavMagazine, DeckQueue } from 'mjh-framework'
16
-
17
- export default class App extends Component {
18
- render() {
19
- return (
20
- <div>
21
- <NavMagazine />
22
- <DeckQueue />
23
- </div>
24
- )
25
- }
26
- }
27
- ```
28
-
29
- ## Publish new updates to the npm registry
30
-
31
- ```bash
32
- npm publish
33
- ```
34
-
35
- ## For getting updates in the template without publishing each time a change is made in the framework
36
-
37
- Link react and react-dom of the template repo, so that it can be used by the framework.
38
- This is to avoid the error arising due to multiple instances of React.
39
-
40
- ```bash
41
- cd ../mjh-template/node_modules/react
42
-
43
- yarn link
44
-
45
- cd ../react-dom
46
-
47
- yarn link
48
-
49
- cd ../../../mjh-framework
50
-
51
- yarn link react && yarn link react-dom
52
- ```
53
-
54
- Link the framework repo so that it can be used in the template
55
-
56
- ```bash
57
- npm link
58
-
59
- cd ../mjh-template
60
-
61
- npm link @mjhls/mjh-framework
62
- ```
63
-
64
- ## Components and "props"
65
-
66
- ### Deck Components
67
-
68
- - #### DeckContent
69
-
70
- ##### Props
71
-
72
- - mapping
73
- - dataRecord
74
- - query
75
- - params
76
- - pointer
77
- - pointerArray
78
- - defaultImage
79
-
80
- - #### DeckQueue
81
- ##### Props
82
- - page
83
- - dataRecord
84
- - query
85
- - params
86
- - pointer
87
- - pointerArray
88
-
89
- ### Layout Components
90
-
91
- - #### Column1
92
- - #### Column2
93
- ##### Props
94
- - rightItems
95
- - #### Column3
96
- ##### Props
97
- - leftItems
98
- - rightItems
99
- ##### Common Props (Column1, Column2, Column3)
100
- - title
101
- - children
102
- - #### Header
103
- ##### Props
104
- - title
105
- - keyword
106
- - description
107
- - #### LeftNav
108
- ##### Props
109
- - leftItems
110
- - #### AccordionPanel
111
- ##### Props
112
- - accordionClassName
113
- - data
114
-
115
- ### Navigation Components
116
-
117
- - #### NavMagazine
118
- ##### Props
119
- - logo
120
- - dataObject
121
- - #### NavNative
122
- ##### Props
123
- - logo
124
- - dataObject
125
- - #### NavNormal
126
- ##### Props
127
- - logo
128
- - dataObject
129
- - variant
130
- - #### NavDvm
131
- ##### Props
132
- - logo
133
- - dataObject
134
- - subNavHeads
135
-
136
- ### Template Components
137
-
138
- - #### TemplateNormal
139
- ##### Props
140
- - config
141
- - title
142
- - keywords
143
- - description
144
- - website
145
-
146
- ### Ad Components
147
-
148
- - #### AD300x250
149
- - #### AD300x250x600
150
- - #### AD728x90
151
- ##### Common Props
152
- - networkID
153
- - adUnit
154
-
155
- ### Serializers
156
-
157
- - #### getSerializers (function)
158
- ##### arguments
159
- - client
160
- ##### types
161
- - youtube
162
- - figure
163
- - slideshow
164
-
165
- ## License
166
-
167
- MIT © [mjh-framework](https://github.com/mjh-framework)
1
+ # mjh-framework v. 1.0.760
2
+ [![NPM](https://img.shields.io/npm/v/mjh-framework.svg)](https://www.npmjs.com/package/mjh-framework) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
3
+
4
+ ## Install
5
+
6
+ ```bash
7
+ npm install --save @mjhls/mjh-framework
8
+ ```
9
+
10
+ ## Usage
11
+
12
+ ```jsx
13
+ import React, { Component } from 'react'
14
+
15
+ import { NavMagazine, DeckQueue } from 'mjh-framework'
16
+
17
+ export default class App extends Component {
18
+ render() {
19
+ return (
20
+ <div>
21
+ <NavMagazine />
22
+ <DeckQueue />
23
+ </div>
24
+ )
25
+ }
26
+ }
27
+ ```
28
+
29
+ ## Publish new updates to the npm registry
30
+
31
+ ```bash
32
+ npm publish
33
+ ```
34
+
35
+ ## For getting updates in the template without publishing each time a change is made in the framework
36
+
37
+ Link react and react-dom of the template repo, so that it can be used by the framework.
38
+ This is to avoid the error arising due to multiple instances of React.
39
+
40
+ ```bash
41
+ cd ../mjh-template/node_modules/react
42
+
43
+ yarn link
44
+
45
+ cd ../react-dom
46
+
47
+ yarn link
48
+
49
+ cd ../../../mjh-framework
50
+
51
+ yarn link react && yarn link react-dom
52
+ ```
53
+
54
+ Link the framework repo so that it can be used in the template
55
+
56
+ ```bash
57
+ npm link
58
+
59
+ cd ../mjh-template
60
+
61
+ npm link @mjhls/mjh-framework
62
+ ```
63
+
64
+ ## Components and "props"
65
+
66
+ ### Deck Components
67
+
68
+ - #### DeckContent
69
+
70
+ ##### Props
71
+
72
+ - mapping
73
+ - dataRecord
74
+ - query
75
+ - params
76
+ - pointer
77
+ - pointerArray
78
+ - defaultImage
79
+
80
+ - #### DeckQueue
81
+ ##### Props
82
+ - page
83
+ - dataRecord
84
+ - query
85
+ - params
86
+ - pointer
87
+ - pointerArray
88
+
89
+ ### Layout Components
90
+
91
+ - #### Column1
92
+ - #### Column2
93
+ ##### Props
94
+ - rightItems
95
+ - #### Column3
96
+ ##### Props
97
+ - leftItems
98
+ - rightItems
99
+ ##### Common Props (Column1, Column2, Column3)
100
+ - title
101
+ - children
102
+ - #### Header
103
+ ##### Props
104
+ - title
105
+ - keyword
106
+ - description
107
+ - #### LeftNav
108
+ ##### Props
109
+ - leftItems
110
+ - #### AccordionPanel
111
+ ##### Props
112
+ - accordionClassName
113
+ - data
114
+
115
+ ### Navigation Components
116
+
117
+ - #### NavMagazine
118
+ ##### Props
119
+ - logo
120
+ - dataObject
121
+ - #### NavNative
122
+ ##### Props
123
+ - logo
124
+ - dataObject
125
+ - #### NavNormal
126
+ ##### Props
127
+ - logo
128
+ - dataObject
129
+ - variant
130
+ - #### NavDvm
131
+ ##### Props
132
+ - logo
133
+ - dataObject
134
+ - subNavHeads
135
+
136
+ ### Template Components
137
+
138
+ - #### TemplateNormal
139
+ ##### Props
140
+ - config
141
+ - title
142
+ - keywords
143
+ - description
144
+ - website
145
+
146
+ ### Ad Components
147
+
148
+ - #### AD300x250
149
+ - #### AD300x250x600
150
+ - #### AD728x90
151
+ ##### Common Props
152
+ - networkID
153
+ - adUnit
154
+
155
+ ### Serializers
156
+
157
+ - #### getSerializers (function)
158
+ ##### arguments
159
+ - client
160
+ ##### types
161
+ - youtube
162
+ - figure
163
+ - slideshow
164
+
165
+ ## License
166
+
167
+ MIT © [mjh-framework](https://github.com/mjh-framework)
@@ -9,21 +9,21 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
11
 
12
- /*
13
- Example usage - targetedonc.com/latest-conference
14
- const query = `*[!(_id in path("drafts.**")) && _type == "article" && defined(title) && is_visible == true && published <= '${today}' && references('b49d36b8-aa56-4183-a2bc-1568c229fb72') ] | order(published desc) [$from...$to] {
15
- ...,
16
- title,
17
- summary,
18
- thumbnail,
19
- url,
20
- published,
21
- documentGroup->,
22
- contentCategory->,
23
- 'pageNumber': ${currentPage}
24
- }`
25
-
26
- const posts = await client.fetch(query, params)
12
+ /*
13
+ Example usage - targetedonc.com/latest-conference
14
+ const query = `*[!(_id in path("drafts.**")) && _type == "article" && defined(title) && is_visible == true && published <= '${today}' && references('b49d36b8-aa56-4183-a2bc-1568c229fb72') ] | order(published desc) [$from...$to] {
15
+ ...,
16
+ title,
17
+ summary,
18
+ thumbnail,
19
+ url,
20
+ published,
21
+ documentGroup->,
22
+ contentCategory->,
23
+ 'pageNumber': ${currentPage}
24
+ }`
25
+
26
+ const posts = await client.fetch(query, params)
27
27
  */
28
28
 
29
29
  var ConferenceArticleCard = function ConferenceArticleCard(props) {
@@ -189,14 +189,14 @@ var DeckContent = function (_React$Component) {
189
189
  var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
190
190
 
191
191
  // please leave this for later debug purpose : Yong Jun.
192
- /* console.log('page change reported', {
193
- currentPage: currentPage,
194
- pageNumber: pageNumber,
195
- pathname: pathname,
196
- path: path,
197
- newPath: newPath,
198
- firstPage: pageNumber === 1,
199
- queryString: queryString
192
+ /* console.log('page change reported', {
193
+ currentPage: currentPage,
194
+ pageNumber: pageNumber,
195
+ pathname: pathname,
196
+ path: path,
197
+ newPath: newPath,
198
+ firstPage: pageNumber === 1,
199
+ queryString: queryString
200
200
  }) */
201
201
 
202
202
  if (pageview) {
@@ -18,7 +18,7 @@ var Card = require('react-bootstrap/Card');
18
18
  var Form = require('react-bootstrap/Form');
19
19
  var Button = require('react-bootstrap/Button');
20
20
  require('./main-dc082238.js');
21
- var index = require('./index-cb6ed1fc.js');
21
+ var index = require('./index-4d74ffd6.js');
22
22
  var js_cookie = require('./js.cookie-a511c430.js');
23
23
  var Router = require('next/router');
24
24
  require('./define-property-aff11f8a.js');
@@ -258,23 +258,23 @@ var EventsDeck = function EventsDeck(_ref) {
258
258
  if (cventAccessToken && cventAccessToken !== 'undefined') {
259
259
  setAccessToken(cventAccessToken);
260
260
  } else {
261
- /*const encodedData = window.btoa(clientId + ':' + clientSecret)
262
- //const url = `${corsProxy}https://api-platform.cvent.com/ea/oauth2/token`
263
- const url = `https://api-platform.cvent.com/ea/oauth2/token`
264
- fetch(url, {
265
- headers: {
266
- 'Content-Type': 'application/x-www-form-urlencoded',
267
- Authorization: `Basic ${encodedData}`
268
- },
269
- method: 'POST',
270
- body: `grant_type=client_credentials&client_id=${clientId}`
271
- })
272
- .then((response) => response.json())
273
- .then((json) => {
274
- const inOneHour = new Date(new Date().getTime() + 60 * 60 * 1000)
275
- Cookies.set('cvent_access_token', json.access_token, { expires: inOneHour })
276
- setAccessToken(json.access_token)
277
- })
261
+ /*const encodedData = window.btoa(clientId + ':' + clientSecret)
262
+ //const url = `${corsProxy}https://api-platform.cvent.com/ea/oauth2/token`
263
+ const url = `https://api-platform.cvent.com/ea/oauth2/token`
264
+ fetch(url, {
265
+ headers: {
266
+ 'Content-Type': 'application/x-www-form-urlencoded',
267
+ Authorization: `Basic ${encodedData}`
268
+ },
269
+ method: 'POST',
270
+ body: `grant_type=client_credentials&client_id=${clientId}`
271
+ })
272
+ .then((response) => response.json())
273
+ .then((json) => {
274
+ const inOneHour = new Date(new Date().getTime() + 60 * 60 * 1000)
275
+ Cookies.set('cvent_access_token', json.access_token, { expires: inOneHour })
276
+ setAccessToken(json.access_token)
277
+ })
278
278
  .catch((e) => console.log(e))*/
279
279
  // hello
280
280
  var url = 'https://beam.mjhlifesciences.com/api/cvent/token';
@@ -5,7 +5,7 @@ var slicedToArray = require('./slicedToArray-db24842a.js');
5
5
  var React = require('react');
6
6
  var BlockContent = require('./BlockContent-eca358e4.js');
7
7
  var getSerializers = require('./index-9e0ebc87.js');
8
- var index = require('./index-cb6ed1fc.js');
8
+ var index = require('./index-4d74ffd6.js');
9
9
  var Router = require('next/router');
10
10
  var Button = require('react-bootstrap/Button');
11
11
  require('./_commonjsHelpers-06173234.js');
@@ -41,15 +41,15 @@ var Navbar__default = /*#__PURE__*/_interopDefaultLegacy(Navbar);
41
41
  var NavDropdown__default = /*#__PURE__*/_interopDefaultLegacy(NavDropdown);
42
42
 
43
43
  var HamMagazine = function HamMagazine(props) {
44
- /*
45
- Example Nav with acceptable props
46
- <MagazineNav
47
- showLogin
48
- logo={props.settings.logo}
49
- dataObject={props.cache.mainNavCache}
50
- website={website}
51
- subNav={props.cache.subNavCache}
52
- />
44
+ /*
45
+ Example Nav with acceptable props
46
+ <MagazineNav
47
+ showLogin
48
+ logo={props.settings.logo}
49
+ dataObject={props.cache.mainNavCache}
50
+ website={website}
51
+ subNav={props.cache.subNavCache}
52
+ />
53
53
  */
54
54
 
55
55
  // Setting 'socialIconVariant' as 'light' as default to make the social icons and search icon black
@@ -108,7 +108,7 @@ var HamMagazine = function HamMagazine(props) {
108
108
 
109
109
  React.useEffect(function () {
110
110
  // Check for desktop or mobile device
111
- if (window && window.innerWidth < 568) setIsDesktop(false);
111
+ if (window && window.innerWidth < 1200) setIsDesktop(false);
112
112
 
113
113
  // Hiding light-nav with logo on mobile devices
114
114
  if (window && window.innerWidth < 1200 && topNavRef) topNavRef.current.style.display = 'none';
@@ -139,11 +139,11 @@ var HamMagazine = function HamMagazine(props) {
139
139
  if (resolution === 0) {
140
140
  setResolution(window.innerWidth);
141
141
  } else {
142
- if (window.innerWidth < 568 && resolution >= 568 && isDesktop) {
142
+ if (window.innerWidth < 768 && resolution >= 768 && isDesktop) {
143
143
  console.log('Detected Mobile Resolution');
144
144
  window.location.reload();
145
145
  // Updating the condition to reload the page on resize in desktop view
146
- } else if (window.innerWidth >= 568 && !isDesktop) {
146
+ } else if (window.innerWidth >= 768 && !isDesktop) {
147
147
  console.log('Detected Tablet/Desktop Resolution');
148
148
  window.location.reload();
149
149
  }
@@ -47,35 +47,35 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
47
47
 
48
48
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
49
49
 
50
- /* usage
51
- import Settings, { Ads } from '../../../../settings'
52
- import { IssueLanding, getQuery } from '@mjhls/mjh-framework'
53
- import client from '../../../../client'
54
- import moment from 'moment'
55
- import Shell from '../../../../components/2.0/Shell'
56
- import { pageview } from '../../../../utilities/gtag'
57
-
58
- const Issue = (props) => {
59
- const { pubIssue, cache } = props
60
- const targeting = {
61
- content_placement: [`/publications/${pubIssue.identifier.current}/${pubIssue.issue.identifier.current}`],
62
- document_url: [`/publications/${pubIssue.identifier.current}/${pubIssue.issue.identifier.current}`],
63
- }
64
- return (
65
- <Shell cache={cache} settings={Settings} targeting={targeting} ads={Ads} layout='3' title={pubIssue.issue.name}>
66
- <IssueLanding pubIssue={pubIssue} client={client} settings={Settings} pageview={pageview} rightItems={Ads.getMobileAds(targeting)} />
67
- </Shell>
68
- )
69
- }
70
-
71
- Issue.getInitialProps = async (ctx) => {
72
- const { query } = ctx
73
- const pubIssue = await client.fetch(getQuery('issue'), { ...query, currentDate: moment().utc().format() }
74
- )
75
- return { pubIssue }
76
- }
77
-
78
- export default Issue
50
+ /* usage
51
+ import Settings, { Ads } from '../../../../settings'
52
+ import { IssueLanding, getQuery } from '@mjhls/mjh-framework'
53
+ import client from '../../../../client'
54
+ import moment from 'moment'
55
+ import Shell from '../../../../components/2.0/Shell'
56
+ import { pageview } from '../../../../utilities/gtag'
57
+
58
+ const Issue = (props) => {
59
+ const { pubIssue, cache } = props
60
+ const targeting = {
61
+ content_placement: [`/publications/${pubIssue.identifier.current}/${pubIssue.issue.identifier.current}`],
62
+ document_url: [`/publications/${pubIssue.identifier.current}/${pubIssue.issue.identifier.current}`],
63
+ }
64
+ return (
65
+ <Shell cache={cache} settings={Settings} targeting={targeting} ads={Ads} layout='3' title={pubIssue.issue.name}>
66
+ <IssueLanding pubIssue={pubIssue} client={client} settings={Settings} pageview={pageview} rightItems={Ads.getMobileAds(targeting)} />
67
+ </Shell>
68
+ )
69
+ }
70
+
71
+ Issue.getInitialProps = async (ctx) => {
72
+ const { query } = ctx
73
+ const pubIssue = await client.fetch(getQuery('issue'), { ...query, currentDate: moment().utc().format() }
74
+ )
75
+ return { pubIssue }
76
+ }
77
+
78
+ export default Issue
79
79
  */
80
80
 
81
81
  var IssueLanding = function IssueLanding(props) {
@@ -1,27 +1,27 @@
1
1
  'use strict';
2
2
 
3
3
  var KMTracker = function KMTracker(props) {
4
- var id = props.id;
4
+ var id = props.id;
5
5
 
6
- if (document && id) {
6
+ if (document && id) {
7
7
  (function () {
8
- var ecnJquery = document.createElement('script');
8
+ var ecnJquery = document.createElement('script');
9
9
 
10
- ecnJquery.type = 'text/javascript';
11
- ecnJquery.async = true;
12
- ecnJquery.src = 'https://apidt.ecn5.com/ECN_jQuery.min.js';
10
+ ecnJquery.type = 'text/javascript';
11
+ ecnJquery.async = true;
12
+ ecnJquery.src = 'https://apidt.ecn5.com/ECN_jQuery.min.js';
13
13
 
14
- var ecnScript = document.createElement('script');
14
+ var ecnScript = document.createElement('script');
15
15
 
16
- ecnScript.type = 'text/javascript';
17
- ecnScript.async = true;
18
- ecnScript.id = 'km-tracker';
19
- ecnScript.src = 'https://apidt.ecn5.com/ECN_tracker_Secure.js?TrackerKey=' + id;
16
+ ecnScript.type = 'text/javascript';
17
+ ecnScript.async = true;
18
+ ecnScript.id = 'km-tracker';
19
+ ecnScript.src = 'https://apidt.ecn5.com/ECN_tracker_Secure.js?TrackerKey=' + id;
20
20
 
21
- document.head.appendChild(ecnJquery);
22
- document.head.appendChild(ecnScript);
23
- })();
24
- }
21
+ document.head.appendChild(ecnJquery);
22
+ document.head.appendChild(ecnScript);
23
+ })();
24
+ }
25
25
  };
26
26
 
27
27
  module.exports = KMTracker;
@@ -231,14 +231,14 @@ var MasterDeck = function (_React$Component) {
231
231
  }
232
232
 
233
233
  // please leave this for later debug purpose : Yong Jun.
234
- /* console.log('page change reported', {
235
- currentPage: currentPage,
236
- pageNumber: pageNumber,
237
- pathname: pathname,
238
- path: path,
239
- newPath: newPath,
240
- firstPage: pageNumber === 1,
241
- queryString: queryString
234
+ /* console.log('page change reported', {
235
+ currentPage: currentPage,
236
+ pageNumber: pageNumber,
237
+ pathname: pathname,
238
+ path: path,
239
+ newPath: newPath,
240
+ firstPage: pageNumber === 1,
241
+ queryString: queryString
242
242
  }) */
243
243
 
244
244
  if (pageview) {