@mjhls/mjh-framework 1.0.221 → 1.0.223
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/README.md +174 -174
- package/dist/cjs/AdSlot-d87cef08.js +69 -0
- package/dist/cjs/DeckContent.js +116 -59
- package/dist/cjs/DeckQueue.js +3 -3
- package/dist/cjs/{Dfp-c4f1f12a.js → Dfp-8b6f25fe.js} +1 -1
- package/dist/cjs/{GridContent-089aa22c.js → GridContent-8b0ebfec.js} +26 -10
- package/dist/cjs/GridContent.js +5 -4
- package/dist/cjs/IssueContentDeck.js +1 -1
- package/dist/cjs/IssueDeck.js +1 -1
- package/dist/cjs/MasterDeck.js +11 -11
- package/dist/cjs/{Normal-47d9e184.js → Normal-78631b6e.js} +78 -93
- package/dist/cjs/PublicationDeck.js +1 -1
- package/dist/cjs/QueueDeckExpanded.js +6 -5
- package/dist/cjs/{TaxonomyCard-d97685e2.js → TaxonomyCard-f24d8ec9.js} +1 -1
- package/dist/cjs/TaxonomyCard.js +2 -2
- package/dist/cjs/TemplateNormal.js +3 -2
- package/dist/cjs/ThumbnailCard.js +1 -1
- package/dist/cjs/VideoSeriesListing.js +2 -2
- package/dist/cjs/{YoutubeGroup-ad994d02.js → YoutubeGroup-d2d9e57c.js} +4 -4
- package/dist/cjs/YoutubeGroup.js +1 -1
- package/dist/cjs/{index-a4c53ff4.js → index-eb596973.js} +18 -18
- package/dist/cjs/index.js +203 -182
- package/dist/cjs/{main-58839f4e.js → main-c1bd47fe.js} +6 -6
- package/dist/cjs/{visibility-sensor-bea3105d.js → visibility-sensor-59b2685c.js} +2501 -1437
- package/dist/esm/AdSlot-b67f8534.js +64 -0
- package/dist/esm/DeckContent.js +116 -59
- package/dist/esm/DeckQueue.js +3 -3
- package/dist/esm/{Dfp-6731ac01.js → Dfp-6c8d69e6.js} +1 -1
- package/dist/esm/{GridContent-214acb61.js → GridContent-0777cc42.js} +26 -10
- package/dist/esm/GridContent.js +5 -4
- package/dist/esm/IssueContentDeck.js +1 -1
- package/dist/esm/IssueDeck.js +1 -1
- package/dist/esm/MasterDeck.js +11 -11
- package/dist/esm/{Normal-be430fa9.js → Normal-7d33c7bf.js} +78 -92
- package/dist/esm/PublicationDeck.js +1 -1
- package/dist/esm/QueueDeckExpanded.js +6 -5
- package/dist/esm/{TaxonomyCard-f9c93953.js → TaxonomyCard-ca8c7c8a.js} +1 -1
- package/dist/esm/TaxonomyCard.js +2 -2
- package/dist/esm/TemplateNormal.js +3 -2
- package/dist/esm/ThumbnailCard.js +1 -1
- package/dist/esm/VideoSeriesListing.js +2 -2
- package/dist/esm/{YoutubeGroup-1368335c.js → YoutubeGroup-d3b92eb5.js} +4 -4
- package/dist/esm/YoutubeGroup.js +1 -1
- package/dist/esm/{index-ca4ff5cb.js → index-b7bbf1d4.js} +18 -18
- package/dist/esm/index.js +204 -183
- package/dist/esm/{main-dea495b7.js → main-2504c03f.js} +6 -6
- package/dist/esm/{visibility-sensor-675d3fa1.js → visibility-sensor-61158020.js} +2501 -1437
- package/package.json +93 -93
package/README.md
CHANGED
|
@@ -1,174 +1,174 @@
|
|
|
1
|
-
|
|
2
|
-
# mjh-framework v. 1.0.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
> Foundation Framework
|
|
8
|
-
|
|
9
|
-
[](https://www.npmjs.com/package/mjh-framework) [](https://standardjs.com)
|
|
10
|
-
|
|
11
|
-
## Install
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm install --save @mjhls/mjh-framework
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Usage
|
|
18
|
-
|
|
19
|
-
```jsx
|
|
20
|
-
import React, { Component } from 'react'
|
|
21
|
-
|
|
22
|
-
import { NavMagazine, DeckQueue } from 'mjh-framework'
|
|
23
|
-
|
|
24
|
-
export default class App extends Component {
|
|
25
|
-
render() {
|
|
26
|
-
return (
|
|
27
|
-
<div>
|
|
28
|
-
<NavMagazine />
|
|
29
|
-
<DeckQueue />
|
|
30
|
-
</div>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Publish new updates to the npm registry
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
npm publish
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## For getting updates in the template without publishing each time a change is made in the framework
|
|
43
|
-
|
|
44
|
-
Link react and react-dom of the template repo, so that it can be used by the framework.
|
|
45
|
-
This is to avoid the error arising due to multiple instances of React.
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
cd ../mjh-template/node_modules/react
|
|
49
|
-
|
|
50
|
-
yarn link
|
|
51
|
-
|
|
52
|
-
cd ../react-dom
|
|
53
|
-
|
|
54
|
-
yarn link
|
|
55
|
-
|
|
56
|
-
cd ../../../mjh-framework
|
|
57
|
-
|
|
58
|
-
yarn link react && yarn link react-dom
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Link the framework repo so that it can be used in the template
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
npm link
|
|
65
|
-
|
|
66
|
-
cd ../mjh-template
|
|
67
|
-
|
|
68
|
-
npm link @mjhls/mjh-framework
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Components and "props"
|
|
72
|
-
|
|
73
|
-
### Deck Components
|
|
74
|
-
|
|
75
|
-
- #### DeckContent
|
|
76
|
-
|
|
77
|
-
##### Props
|
|
78
|
-
|
|
79
|
-
- mapping
|
|
80
|
-
- dataRecord
|
|
81
|
-
- query
|
|
82
|
-
- params
|
|
83
|
-
- pointer
|
|
84
|
-
- pointerArray
|
|
85
|
-
- defaultImage
|
|
86
|
-
|
|
87
|
-
- #### DeckQueue
|
|
88
|
-
##### Props
|
|
89
|
-
- page
|
|
90
|
-
- dataRecord
|
|
91
|
-
- query
|
|
92
|
-
- params
|
|
93
|
-
- pointer
|
|
94
|
-
- pointerArray
|
|
95
|
-
|
|
96
|
-
### Layout Components
|
|
97
|
-
|
|
98
|
-
- #### Column1
|
|
99
|
-
- #### Column2
|
|
100
|
-
##### Props
|
|
101
|
-
- rightItems
|
|
102
|
-
- #### Column3
|
|
103
|
-
##### Props
|
|
104
|
-
- leftItems
|
|
105
|
-
- rightItems
|
|
106
|
-
##### Common Props (Column1, Column2, Column3)
|
|
107
|
-
- title
|
|
108
|
-
- children
|
|
109
|
-
- #### Header
|
|
110
|
-
##### Props
|
|
111
|
-
- title
|
|
112
|
-
- keyword
|
|
113
|
-
- description
|
|
114
|
-
- #### LeftNav
|
|
115
|
-
##### Props
|
|
116
|
-
- leftItems
|
|
117
|
-
- #### AccordionPanel
|
|
118
|
-
##### Props
|
|
119
|
-
- accordionClassName
|
|
120
|
-
- data
|
|
121
|
-
|
|
122
|
-
### Navigation Components
|
|
123
|
-
|
|
124
|
-
- #### NavMagazine
|
|
125
|
-
##### Props
|
|
126
|
-
- logo
|
|
127
|
-
- dataObject
|
|
128
|
-
- #### NavNative
|
|
129
|
-
##### Props
|
|
130
|
-
- logo
|
|
131
|
-
- dataObject
|
|
132
|
-
- #### NavNormal
|
|
133
|
-
##### Props
|
|
134
|
-
- logo
|
|
135
|
-
- dataObject
|
|
136
|
-
- variant
|
|
137
|
-
- #### NavDvm
|
|
138
|
-
##### Props
|
|
139
|
-
- logo
|
|
140
|
-
- dataObject
|
|
141
|
-
- subNavHeads
|
|
142
|
-
|
|
143
|
-
### Template Components
|
|
144
|
-
|
|
145
|
-
- #### TemplateNormal
|
|
146
|
-
##### Props
|
|
147
|
-
- config
|
|
148
|
-
- title
|
|
149
|
-
- keywords
|
|
150
|
-
- description
|
|
151
|
-
- website
|
|
152
|
-
|
|
153
|
-
### Ad Components
|
|
154
|
-
|
|
155
|
-
- #### AD300x250
|
|
156
|
-
- #### AD300x250x600
|
|
157
|
-
- #### AD728x90
|
|
158
|
-
##### Common Props
|
|
159
|
-
- networkID
|
|
160
|
-
- adUnit
|
|
161
|
-
|
|
162
|
-
### Serializers
|
|
163
|
-
|
|
164
|
-
- #### getSerializers (function)
|
|
165
|
-
##### arguments
|
|
166
|
-
- client
|
|
167
|
-
##### types
|
|
168
|
-
- youtube
|
|
169
|
-
- figure
|
|
170
|
-
- slideshow
|
|
171
|
-
|
|
172
|
-
## License
|
|
173
|
-
|
|
174
|
-
MIT © [mjh-framework](https://github.com/mjh-framework)
|
|
1
|
+
|
|
2
|
+
# mjh-framework v. 1.0.223
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
> Foundation Framework
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/mjh-framework) [](https://standardjs.com)
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install --save @mjhls/mjh-framework
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
import React, { Component } from 'react'
|
|
21
|
+
|
|
22
|
+
import { NavMagazine, DeckQueue } from 'mjh-framework'
|
|
23
|
+
|
|
24
|
+
export default class App extends Component {
|
|
25
|
+
render() {
|
|
26
|
+
return (
|
|
27
|
+
<div>
|
|
28
|
+
<NavMagazine />
|
|
29
|
+
<DeckQueue />
|
|
30
|
+
</div>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Publish new updates to the npm registry
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm publish
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## For getting updates in the template without publishing each time a change is made in the framework
|
|
43
|
+
|
|
44
|
+
Link react and react-dom of the template repo, so that it can be used by the framework.
|
|
45
|
+
This is to avoid the error arising due to multiple instances of React.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
cd ../mjh-template/node_modules/react
|
|
49
|
+
|
|
50
|
+
yarn link
|
|
51
|
+
|
|
52
|
+
cd ../react-dom
|
|
53
|
+
|
|
54
|
+
yarn link
|
|
55
|
+
|
|
56
|
+
cd ../../../mjh-framework
|
|
57
|
+
|
|
58
|
+
yarn link react && yarn link react-dom
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Link the framework repo so that it can be used in the template
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm link
|
|
65
|
+
|
|
66
|
+
cd ../mjh-template
|
|
67
|
+
|
|
68
|
+
npm link @mjhls/mjh-framework
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Components and "props"
|
|
72
|
+
|
|
73
|
+
### Deck Components
|
|
74
|
+
|
|
75
|
+
- #### DeckContent
|
|
76
|
+
|
|
77
|
+
##### Props
|
|
78
|
+
|
|
79
|
+
- mapping
|
|
80
|
+
- dataRecord
|
|
81
|
+
- query
|
|
82
|
+
- params
|
|
83
|
+
- pointer
|
|
84
|
+
- pointerArray
|
|
85
|
+
- defaultImage
|
|
86
|
+
|
|
87
|
+
- #### DeckQueue
|
|
88
|
+
##### Props
|
|
89
|
+
- page
|
|
90
|
+
- dataRecord
|
|
91
|
+
- query
|
|
92
|
+
- params
|
|
93
|
+
- pointer
|
|
94
|
+
- pointerArray
|
|
95
|
+
|
|
96
|
+
### Layout Components
|
|
97
|
+
|
|
98
|
+
- #### Column1
|
|
99
|
+
- #### Column2
|
|
100
|
+
##### Props
|
|
101
|
+
- rightItems
|
|
102
|
+
- #### Column3
|
|
103
|
+
##### Props
|
|
104
|
+
- leftItems
|
|
105
|
+
- rightItems
|
|
106
|
+
##### Common Props (Column1, Column2, Column3)
|
|
107
|
+
- title
|
|
108
|
+
- children
|
|
109
|
+
- #### Header
|
|
110
|
+
##### Props
|
|
111
|
+
- title
|
|
112
|
+
- keyword
|
|
113
|
+
- description
|
|
114
|
+
- #### LeftNav
|
|
115
|
+
##### Props
|
|
116
|
+
- leftItems
|
|
117
|
+
- #### AccordionPanel
|
|
118
|
+
##### Props
|
|
119
|
+
- accordionClassName
|
|
120
|
+
- data
|
|
121
|
+
|
|
122
|
+
### Navigation Components
|
|
123
|
+
|
|
124
|
+
- #### NavMagazine
|
|
125
|
+
##### Props
|
|
126
|
+
- logo
|
|
127
|
+
- dataObject
|
|
128
|
+
- #### NavNative
|
|
129
|
+
##### Props
|
|
130
|
+
- logo
|
|
131
|
+
- dataObject
|
|
132
|
+
- #### NavNormal
|
|
133
|
+
##### Props
|
|
134
|
+
- logo
|
|
135
|
+
- dataObject
|
|
136
|
+
- variant
|
|
137
|
+
- #### NavDvm
|
|
138
|
+
##### Props
|
|
139
|
+
- logo
|
|
140
|
+
- dataObject
|
|
141
|
+
- subNavHeads
|
|
142
|
+
|
|
143
|
+
### Template Components
|
|
144
|
+
|
|
145
|
+
- #### TemplateNormal
|
|
146
|
+
##### Props
|
|
147
|
+
- config
|
|
148
|
+
- title
|
|
149
|
+
- keywords
|
|
150
|
+
- description
|
|
151
|
+
- website
|
|
152
|
+
|
|
153
|
+
### Ad Components
|
|
154
|
+
|
|
155
|
+
- #### AD300x250
|
|
156
|
+
- #### AD300x250x600
|
|
157
|
+
- #### AD728x90
|
|
158
|
+
##### Common Props
|
|
159
|
+
- networkID
|
|
160
|
+
- adUnit
|
|
161
|
+
|
|
162
|
+
### Serializers
|
|
163
|
+
|
|
164
|
+
- #### getSerializers (function)
|
|
165
|
+
##### arguments
|
|
166
|
+
- client
|
|
167
|
+
##### types
|
|
168
|
+
- youtube
|
|
169
|
+
- figure
|
|
170
|
+
- slideshow
|
|
171
|
+
|
|
172
|
+
## License
|
|
173
|
+
|
|
174
|
+
MIT © [mjh-framework](https://github.com/mjh-framework)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var React__default = _interopDefault(React);
|
|
7
|
+
var index = require('./index-0322e486.js');
|
|
8
|
+
var PropTypes = _interopDefault(require('prop-types'));
|
|
9
|
+
var debounce = require('./debounce-a963b136.js');
|
|
10
|
+
var _babelHelpers = require('./_babelHelpers-f321c258.js');
|
|
11
|
+
|
|
12
|
+
var DFPAdSlot = function DFPAdSlot(_ref) {
|
|
13
|
+
var adUnit = _ref.adUnit,
|
|
14
|
+
sizeMapping = _ref.sizeMapping,
|
|
15
|
+
className = _ref.className,
|
|
16
|
+
slotId = _ref.slotId,
|
|
17
|
+
sizes = _ref.sizes,
|
|
18
|
+
_ref$targeting = _ref.targeting,
|
|
19
|
+
targeting = _ref$targeting === undefined ? {} : _ref$targeting;
|
|
20
|
+
|
|
21
|
+
var _useState = React.useState(false),
|
|
22
|
+
_useState2 = _babelHelpers.slicedToArray(_useState, 2),
|
|
23
|
+
adRendered = _useState2[0],
|
|
24
|
+
setAdRendered = _useState2[1];
|
|
25
|
+
|
|
26
|
+
var _useState3 = React.useState(false),
|
|
27
|
+
_useState4 = _babelHelpers.slicedToArray(_useState3, 2),
|
|
28
|
+
adRefreshable = _useState4[0],
|
|
29
|
+
setAdRefreshable = _useState4[1];
|
|
30
|
+
|
|
31
|
+
var handleVisibilityChange = debounce.debounce_1(function (_ref2) {
|
|
32
|
+
var event = _ref2.event;
|
|
33
|
+
|
|
34
|
+
if (event.inViewPercentage <= 0) {
|
|
35
|
+
setAdRefreshable(false);
|
|
36
|
+
} else {
|
|
37
|
+
setAdRefreshable(true);
|
|
38
|
+
}
|
|
39
|
+
}, 500);
|
|
40
|
+
|
|
41
|
+
return React__default.createElement(
|
|
42
|
+
'div',
|
|
43
|
+
{ className: className },
|
|
44
|
+
React__default.createElement(index.lib_2, {
|
|
45
|
+
slotId: slotId,
|
|
46
|
+
sizes: sizes,
|
|
47
|
+
adUnit: adUnit,
|
|
48
|
+
sizeMapping: sizeMapping,
|
|
49
|
+
targetingArguments: targeting,
|
|
50
|
+
onSlotRender: function onSlotRender(eventData) {
|
|
51
|
+
setAdRendered(true);
|
|
52
|
+
},
|
|
53
|
+
onSlotVisibilityChanged: handleVisibilityChange,
|
|
54
|
+
shouldRefresh: function shouldRefresh() {
|
|
55
|
+
if (adRendered && adRefreshable) return true;else return false;
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
DFPAdSlot.propTypes = {
|
|
62
|
+
adUnit: PropTypes.string.isRequired,
|
|
63
|
+
slotId: PropTypes.string,
|
|
64
|
+
className: PropTypes.string,
|
|
65
|
+
sizeMapping: PropTypes.array,
|
|
66
|
+
sizes: PropTypes.array
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
exports.DFPAdSlot = DFPAdSlot;
|
package/dist/cjs/DeckContent.js
CHANGED
|
@@ -11,17 +11,18 @@ var Container = _interopDefault(require('react-bootstrap/Container'));
|
|
|
11
11
|
var Row = _interopDefault(require('react-bootstrap/Row'));
|
|
12
12
|
var Col = _interopDefault(require('react-bootstrap/Col'));
|
|
13
13
|
var Card = _interopDefault(require('react-bootstrap/Card'));
|
|
14
|
-
var visibilitySensor = require('./visibility-sensor-
|
|
14
|
+
var visibilitySensor = require('./visibility-sensor-59b2685c.js');
|
|
15
15
|
require('next/link');
|
|
16
16
|
var Router = require('next/router');
|
|
17
17
|
var Router__default = _interopDefault(Router);
|
|
18
18
|
var debounce = require('./debounce-a963b136.js');
|
|
19
19
|
require('react-dom');
|
|
20
|
-
var index$1 = require('./index-
|
|
20
|
+
var index$1 = require('./index-eb596973.js');
|
|
21
21
|
var index$2 = require('./index-0d0efcfa.js');
|
|
22
|
-
var main = require('./main-
|
|
22
|
+
var main = require('./main-c1bd47fe.js');
|
|
23
23
|
var entities = require('./entities-3e0b4a16.js');
|
|
24
24
|
var _babelHelpers = require('./_babelHelpers-f321c258.js');
|
|
25
|
+
var AdSlot = require('./AdSlot-d87cef08.js');
|
|
25
26
|
|
|
26
27
|
var DeckContent = function (_React$Component) {
|
|
27
28
|
_babelHelpers.inherits(DeckContent, _React$Component);
|
|
@@ -162,14 +163,14 @@ var DeckContent = function (_React$Component) {
|
|
|
162
163
|
var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
|
|
163
164
|
|
|
164
165
|
// please leave this for later debug purpose : Yong Jun.
|
|
165
|
-
/* console.log('page change reported', {
|
|
166
|
-
currentPage: currentPage,
|
|
167
|
-
pageNumber: pageNumber,
|
|
168
|
-
pathname: pathname,
|
|
169
|
-
path: path,
|
|
170
|
-
newPath: newPath,
|
|
171
|
-
firstPage: pageNumber === 1,
|
|
172
|
-
queryString: queryString
|
|
166
|
+
/* console.log('page change reported', {
|
|
167
|
+
currentPage: currentPage,
|
|
168
|
+
pageNumber: pageNumber,
|
|
169
|
+
pathname: pathname,
|
|
170
|
+
path: path,
|
|
171
|
+
newPath: newPath,
|
|
172
|
+
firstPage: pageNumber === 1,
|
|
173
|
+
queryString: queryString
|
|
173
174
|
}) */
|
|
174
175
|
|
|
175
176
|
if (pageview) {
|
|
@@ -222,16 +223,47 @@ var DeckContent = function (_React$Component) {
|
|
|
222
223
|
);
|
|
223
224
|
}
|
|
224
225
|
} else return null;
|
|
225
|
-
}, _this.cardLoader = function (page, columns, variant) {
|
|
226
|
+
}, _this.cardLoader = function (page, columns, variant, showBI, brandInsight) {
|
|
226
227
|
var mode = variant && variant === 'bottom' ? 'column-reverse' : 'column';
|
|
227
228
|
|
|
228
229
|
var itemCounter = 0;
|
|
229
230
|
var lgVar = 12;
|
|
230
231
|
var numberOfItemsBeforeAd = 6;
|
|
232
|
+
|
|
233
|
+
var insert = function insert(arr, index, newElement) {
|
|
234
|
+
return [].concat(_babelHelpers.toConsumableArray(arr.slice(0, index)), [newElement], _babelHelpers.toConsumableArray(arr.slice(index)));
|
|
235
|
+
};
|
|
236
|
+
var articles = [];
|
|
237
|
+
if (showBI) {
|
|
238
|
+
var data = _this.state.data;
|
|
239
|
+
articles = data;
|
|
240
|
+
var pos = 3;
|
|
241
|
+
for (var i = 1; pos < articles.length; i++) {
|
|
242
|
+
var inFeedAd = {
|
|
243
|
+
adUnit: brandInsight.adUnit,
|
|
244
|
+
className: brandInsight.className,
|
|
245
|
+
networkID: brandInsight.networkID,
|
|
246
|
+
sizes: brandInsight.sizes,
|
|
247
|
+
slotId: brandInsight.slotId,
|
|
248
|
+
targeting: {
|
|
249
|
+
pos: 'article' + i,
|
|
250
|
+
content_placement: brandInsight.targeting.content_placement,
|
|
251
|
+
document_url: brandInsight.targeting.document_url
|
|
252
|
+
},
|
|
253
|
+
_type: 'BrandInsight'
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
articles = insert(articles, pos, inFeedAd);
|
|
257
|
+
pos += brandInsight.interval + 1;
|
|
258
|
+
}
|
|
259
|
+
} else {
|
|
260
|
+
articles = _this.state.data;
|
|
261
|
+
}
|
|
262
|
+
|
|
231
263
|
return React__default.createElement(
|
|
232
264
|
Row,
|
|
233
265
|
null,
|
|
234
|
-
|
|
266
|
+
articles && articles.map(function (row, index) {
|
|
235
267
|
if (columns === 'rotate' && itemCounter % 3 === 0) {
|
|
236
268
|
lgVar = 12;
|
|
237
269
|
} else if (columns && columns !== 'rotate') {
|
|
@@ -239,64 +271,87 @@ var DeckContent = function (_React$Component) {
|
|
|
239
271
|
} else {
|
|
240
272
|
lgVar = 6;
|
|
241
273
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
React__default.Fragment,
|
|
247
|
-
{ key: itemCounter },
|
|
248
|
-
React__default.createElement(
|
|
249
|
-
visibilitySensor.VisibilitySensor,
|
|
250
|
-
{
|
|
251
|
-
onChange: function onChange(isVisible) {
|
|
252
|
-
isVisible && _this.changePageNumber(pageNumber);
|
|
253
|
-
} },
|
|
274
|
+
if (row._type === 'BrandInsight' && row.adUnit) {
|
|
275
|
+
return React__default.createElement(
|
|
276
|
+
React__default.Fragment,
|
|
277
|
+
{ key: itemCounter, className: 'brand-insight-wrapper' },
|
|
254
278
|
React__default.createElement(
|
|
255
279
|
Col,
|
|
256
|
-
{
|
|
280
|
+
{ sm: 12, counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
|
|
257
281
|
React__default.createElement(
|
|
258
282
|
Card,
|
|
259
|
-
{ className: 'content-card', style: { flexDirection:
|
|
260
|
-
(row.thumbnail && row.thumbnail.asset || _this.props.defaultImage) && React__default.createElement(
|
|
261
|
-
'a',
|
|
262
|
-
{ href: _this.mapping[contentCategoryName] + '/' + row.url.current },
|
|
263
|
-
React__default.createElement(
|
|
264
|
-
index$2.LazyLoad,
|
|
265
|
-
{ height: _this.props.imageHeight },
|
|
266
|
-
React__default.createElement(Card.Img, { variant: 'top', src: _this.renderCardImage(row, page), alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : '' })
|
|
267
|
-
)
|
|
268
|
-
),
|
|
283
|
+
{ className: 'content-card ad-wrapper', style: { flexDirection: index === 0 || index % 4 === 0 ? 'top' : 'row' } },
|
|
269
284
|
React__default.createElement(
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
React__default.createElement(
|
|
285
|
+
'div',
|
|
286
|
+
{ className: row.className, style: { width: '100%', height: 'auto' } },
|
|
287
|
+
React__default.createElement(AdSlot.DFPAdSlot, { networkID: row.networkID, adUnit: row.adUnit, slotId: row.slotId, targeting: row.targeting, sizes: row.sizes })
|
|
288
|
+
)
|
|
289
|
+
)
|
|
290
|
+
)
|
|
291
|
+
);
|
|
292
|
+
} else {
|
|
293
|
+
var pageNumber = row.pageNumber || _this.state.page;
|
|
294
|
+
var contentCategoryName = row.contentCategory && row.contentCategory.name && _this.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
|
|
295
|
+
return React__default.createElement(
|
|
296
|
+
React__default.Fragment,
|
|
297
|
+
{ key: itemCounter },
|
|
298
|
+
React__default.createElement(
|
|
299
|
+
visibilitySensor.VisibilitySensor,
|
|
300
|
+
{
|
|
301
|
+
onChange: function onChange(isVisible) {
|
|
302
|
+
isVisible && _this.changePageNumber(pageNumber);
|
|
303
|
+
} },
|
|
304
|
+
React__default.createElement(
|
|
305
|
+
Col,
|
|
306
|
+
{ md: 12, lg: lgVar, counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
|
|
307
|
+
React__default.createElement(
|
|
308
|
+
Card,
|
|
309
|
+
{ className: 'content-card', style: { flexDirection: mode } },
|
|
310
|
+
(row.thumbnail && row.thumbnail.asset || _this.props.defaultImage) && React__default.createElement(
|
|
273
311
|
'a',
|
|
274
312
|
{ href: _this.mapping[contentCategoryName] + '/' + row.url.current },
|
|
275
313
|
React__default.createElement(
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
314
|
+
index$2.LazyLoad,
|
|
315
|
+
{ height: _this.props.imageHeight },
|
|
316
|
+
React__default.createElement(Card.Img, {
|
|
317
|
+
variant: 'top',
|
|
318
|
+
src: _this.renderCardImage(row, page),
|
|
319
|
+
alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
|
|
320
|
+
})
|
|
279
321
|
)
|
|
280
322
|
),
|
|
281
|
-
_this.props.showPublished && row.published && React__default.createElement(
|
|
282
|
-
Card.Subtitle,
|
|
283
|
-
null,
|
|
284
|
-
visibilitySensor.moment(row.published).format('MMMM DD, YYYY')
|
|
285
|
-
),
|
|
286
|
-
_this.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index) {
|
|
287
|
-
return _this.renderAuthor(authorDetail, index, row.authorMapping.length);
|
|
288
|
-
}),
|
|
289
323
|
React__default.createElement(
|
|
290
|
-
Card.
|
|
324
|
+
Card.Body,
|
|
291
325
|
null,
|
|
292
|
-
|
|
326
|
+
React__default.createElement(
|
|
327
|
+
'a',
|
|
328
|
+
{ href: _this.mapping[contentCategoryName] + '/' + row.url.current },
|
|
329
|
+
React__default.createElement(
|
|
330
|
+
Card.Title,
|
|
331
|
+
null,
|
|
332
|
+
row.title
|
|
333
|
+
)
|
|
334
|
+
),
|
|
335
|
+
_this.props.showPublished && row.published && React__default.createElement(
|
|
336
|
+
Card.Subtitle,
|
|
337
|
+
null,
|
|
338
|
+
visibilitySensor.moment(row.published).format('MMMM DD, YYYY')
|
|
339
|
+
),
|
|
340
|
+
_this.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index) {
|
|
341
|
+
return _this.renderAuthor(authorDetail, index, row.authorMapping.length);
|
|
342
|
+
}),
|
|
343
|
+
React__default.createElement(
|
|
344
|
+
Card.Text,
|
|
345
|
+
null,
|
|
346
|
+
entities.clean_html_1(row.summary)
|
|
347
|
+
)
|
|
293
348
|
)
|
|
294
349
|
)
|
|
295
350
|
)
|
|
296
|
-
)
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
351
|
+
),
|
|
352
|
+
main.main_36 && _this.props.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && _this.renderMobileAd(index, numberOfItemsBeforeAd)
|
|
353
|
+
);
|
|
354
|
+
}
|
|
300
355
|
})
|
|
301
356
|
);
|
|
302
357
|
}, _this.renderMobileAd = function (index, numberOfItemsBeforeAd) {
|
|
@@ -360,7 +415,9 @@ var DeckContent = function (_React$Component) {
|
|
|
360
415
|
columns = _props.columns,
|
|
361
416
|
variant = _props.variant,
|
|
362
417
|
autoScroll = _props.autoScroll,
|
|
363
|
-
page = _props.page
|
|
418
|
+
page = _props.page,
|
|
419
|
+
showBI = _props.showBI,
|
|
420
|
+
brandInsight = _props.brandInsight;
|
|
364
421
|
|
|
365
422
|
|
|
366
423
|
return React__default.createElement(
|
|
@@ -375,7 +432,7 @@ var DeckContent = function (_React$Component) {
|
|
|
375
432
|
React__default.createElement(
|
|
376
433
|
Container,
|
|
377
434
|
null,
|
|
378
|
-
this.cardLoader(page, columns, variant)
|
|
435
|
+
this.cardLoader(page, columns, variant, showBI, brandInsight)
|
|
379
436
|
)
|
|
380
437
|
),
|
|
381
438
|
React__default.createElement(
|
|
@@ -389,7 +446,7 @@ var DeckContent = function (_React$Component) {
|
|
|
389
446
|
React__default.createElement(
|
|
390
447
|
Container,
|
|
391
448
|
null,
|
|
392
|
-
this.cardLoader(page, columns, variant)
|
|
449
|
+
this.cardLoader(page, columns, variant, showBI, brandInsight)
|
|
393
450
|
),
|
|
394
451
|
React__default.createElement(
|
|
395
452
|
'div',
|
package/dist/cjs/DeckQueue.js
CHANGED
|
@@ -11,15 +11,15 @@ var Container = _interopDefault(require('react-bootstrap/Container'));
|
|
|
11
11
|
var Row = _interopDefault(require('react-bootstrap/Row'));
|
|
12
12
|
var Col = _interopDefault(require('react-bootstrap/Col'));
|
|
13
13
|
var Card = _interopDefault(require('react-bootstrap/Card'));
|
|
14
|
-
var visibilitySensor = require('./visibility-sensor-
|
|
14
|
+
var visibilitySensor = require('./visibility-sensor-59b2685c.js');
|
|
15
15
|
require('next/link');
|
|
16
16
|
var Router = require('next/router');
|
|
17
17
|
var Router__default = _interopDefault(Router);
|
|
18
18
|
var debounce = require('./debounce-a963b136.js');
|
|
19
19
|
require('react-dom');
|
|
20
|
-
var index$1 = require('./index-
|
|
20
|
+
var index$1 = require('./index-eb596973.js');
|
|
21
21
|
var index$2 = require('./index-0d0efcfa.js');
|
|
22
|
-
var main = require('./main-
|
|
22
|
+
var main = require('./main-c1bd47fe.js');
|
|
23
23
|
var entities = require('./entities-3e0b4a16.js');
|
|
24
24
|
var _babelHelpers = require('./_babelHelpers-f321c258.js');
|
|
25
25
|
var get$1 = require('./get-126b1712.js');
|