@mjhls/mjh-framework 1.0.13 → 1.0.14
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 +70 -34
- package/dist/index.es.js +97 -107
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +97 -106
- package/dist/index.js.map +1 -1
- package/package.json +72 -72
package/README.md
CHANGED
|
@@ -1,34 +1,70 @@
|
|
|
1
|
-
# mjh-framework
|
|
2
|
-
|
|
3
|
-
> Foundation Framework
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/mjh-framework) [](https://standardjs.com)
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install --save @mjhls/mjh-framework
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```jsx
|
|
16
|
-
import React, { Component } from 'react'
|
|
17
|
-
|
|
18
|
-
import { NavMagazine, DeckQueue } from 'mjh-framework'
|
|
19
|
-
|
|
20
|
-
export default class App extends Component {
|
|
21
|
-
render() {
|
|
22
|
-
return (
|
|
23
|
-
<div>
|
|
24
|
-
<NavMagazine />
|
|
25
|
-
<DeckQueue />
|
|
26
|
-
</div>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
##
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
# mjh-framework
|
|
2
|
+
|
|
3
|
+
> Foundation Framework
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/mjh-framework) [](https://standardjs.com)
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install --save @mjhls/mjh-framework
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```jsx
|
|
16
|
+
import React, { Component } from 'react'
|
|
17
|
+
|
|
18
|
+
import { NavMagazine, DeckQueue } from 'mjh-framework'
|
|
19
|
+
|
|
20
|
+
export default class App extends Component {
|
|
21
|
+
render() {
|
|
22
|
+
return (
|
|
23
|
+
<div>
|
|
24
|
+
<NavMagazine />
|
|
25
|
+
<DeckQueue />
|
|
26
|
+
</div>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Publish new updates to the npm registry
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm publish
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## For getting updates in the template without publishing each time a change is made in the framework
|
|
39
|
+
|
|
40
|
+
Link react and react-dom of the template repo, so that it can be used by the framework.
|
|
41
|
+
This is to avoid the error arising due to multiple instances of React.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
cd mjh-template/node_modules/react
|
|
45
|
+
|
|
46
|
+
yarn link
|
|
47
|
+
|
|
48
|
+
cd ../react-dom
|
|
49
|
+
|
|
50
|
+
yarn link
|
|
51
|
+
|
|
52
|
+
cd ../../../mjh-framework
|
|
53
|
+
|
|
54
|
+
yarn link react && yarn link react-dom
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Link the framework repo so that it can be used in the template
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm link
|
|
61
|
+
|
|
62
|
+
cd ../mjh-template
|
|
63
|
+
|
|
64
|
+
npm link @mjhls/mjh-framework
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
MIT © [mjh-framework](https://github.com/mjh-framework)
|
package/dist/index.es.js
CHANGED
|
@@ -892,6 +892,27 @@ var DeckQueue = function (_React$Component) {
|
|
|
892
892
|
return DeckQueue;
|
|
893
893
|
}(React__default.Component);
|
|
894
894
|
|
|
895
|
+
var Column1 = function Column1(props) {
|
|
896
|
+
return React__default.createElement(
|
|
897
|
+
'section',
|
|
898
|
+
null,
|
|
899
|
+
React__default.createElement(
|
|
900
|
+
Row,
|
|
901
|
+
{ className: 'justify-content-md-center' },
|
|
902
|
+
React__default.createElement(
|
|
903
|
+
Col,
|
|
904
|
+
{ className: 'middleCol' },
|
|
905
|
+
React__default.createElement(
|
|
906
|
+
'h1',
|
|
907
|
+
null,
|
|
908
|
+
props.title
|
|
909
|
+
),
|
|
910
|
+
props.children
|
|
911
|
+
)
|
|
912
|
+
)
|
|
913
|
+
);
|
|
914
|
+
};
|
|
915
|
+
|
|
895
916
|
var Column2 = function Column2(props) {
|
|
896
917
|
var rightItems = props.rightItems;
|
|
897
918
|
|
|
@@ -3081,52 +3102,63 @@ var lib_1 = lib.DFPSlotsProvider;
|
|
|
3081
3102
|
var lib_2 = lib.AdSlot;
|
|
3082
3103
|
var lib_3 = lib.DFPManager;
|
|
3083
3104
|
|
|
3084
|
-
var
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3105
|
+
var AD = function AD(_ref) {
|
|
3106
|
+
var networkID = _ref.networkID,
|
|
3107
|
+
adUnit = _ref.adUnit,
|
|
3108
|
+
sizeMapping = _ref.sizeMapping,
|
|
3109
|
+
className = _ref.className,
|
|
3110
|
+
_ref$slotId = _ref.slotId,
|
|
3111
|
+
slotId = _ref$slotId === undefined ? 'test' : _ref$slotId,
|
|
3112
|
+
sizes = _ref.sizes,
|
|
3113
|
+
minInViewPercent = _ref.minInViewPercent;
|
|
3089
3114
|
|
|
3090
|
-
|
|
3115
|
+
return React__default.createElement(
|
|
3116
|
+
lib_1,
|
|
3117
|
+
{ dfpNetworkId: networkID, sizeMapping: sizeMapping },
|
|
3118
|
+
React__default.createElement(
|
|
3119
|
+
'div',
|
|
3120
|
+
{ className: className },
|
|
3121
|
+
React__default.createElement(lib_2, {
|
|
3122
|
+
slotId: slotId,
|
|
3123
|
+
sizes: sizes,
|
|
3124
|
+
adUnit: adUnit,
|
|
3125
|
+
sizeMapping: sizeMapping,
|
|
3126
|
+
onSlotVisibilityChanged: function onSlotVisibilityChanged(dfpEventData) {
|
|
3127
|
+
if (minInViewPercent && dfpEventData.event.inViewPercentage < minInViewPercent) {
|
|
3128
|
+
lib_3.refresh(slotId);
|
|
3129
|
+
}
|
|
3130
|
+
},
|
|
3131
|
+
onSlotIsViewable: function onSlotIsViewable(dfpEventData) {
|
|
3132
|
+
return console.log(slotId + ' viewable!.', dfpEventData);
|
|
3133
|
+
}
|
|
3134
|
+
})
|
|
3135
|
+
)
|
|
3136
|
+
);
|
|
3137
|
+
};
|
|
3091
3138
|
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3139
|
+
AD.propTypes = {
|
|
3140
|
+
networkID: PropTypes.number.isRequired,
|
|
3141
|
+
adUnit: PropTypes.string.isRequired,
|
|
3142
|
+
slotId: PropTypes.string.isRequired,
|
|
3143
|
+
className: PropTypes.string,
|
|
3144
|
+
sizeMapping: PropTypes.array,
|
|
3145
|
+
sizes: PropTypes.array,
|
|
3146
|
+
minInViewPercent: PropTypes.number
|
|
3147
|
+
};
|
|
3098
3148
|
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
sizes: [[728, 90], [320, 50]],
|
|
3113
|
-
adUnit: this.option.adUnit,
|
|
3114
|
-
sizeMapping: [{ viewport: [768, 1], sizes: [[728, 90]] }, { viewport: [1, 1], sizes: [[320, 50]] }],
|
|
3115
|
-
onSlotVisibilityChanged: function onSlotVisibilityChanged(dfpEventData) {
|
|
3116
|
-
if (dfpEventData.event.inViewPercentage < '70') {
|
|
3117
|
-
lib_3.refresh('test');
|
|
3118
|
-
}
|
|
3119
|
-
},
|
|
3120
|
-
onSlotIsViewable: function onSlotIsViewable(dfpEventData) {
|
|
3121
|
-
return console.log('slot 1 viewable!.', dfpEventData);
|
|
3122
|
-
}
|
|
3123
|
-
})
|
|
3124
|
-
)
|
|
3125
|
-
);
|
|
3126
|
-
}
|
|
3127
|
-
}]);
|
|
3128
|
-
return AD728x90;
|
|
3129
|
-
}(Component);
|
|
3149
|
+
var AD728x90 = function AD728x90(_ref) {
|
|
3150
|
+
var networkID = _ref.networkID,
|
|
3151
|
+
adUnit = _ref.adUnit;
|
|
3152
|
+
|
|
3153
|
+
return React__default.createElement(AD, {
|
|
3154
|
+
networkID: networkID,
|
|
3155
|
+
adUnit: adUnit,
|
|
3156
|
+
className: 'AD728x90',
|
|
3157
|
+
sizes: [[300, 250], [300, 600]],
|
|
3158
|
+
sizeMapping: [{ viewport: [768, 1], sizes: [[728, 90]] }, { viewport: [1, 1], sizes: [[320, 50]] }],
|
|
3159
|
+
minInViewPercent: 70
|
|
3160
|
+
});
|
|
3161
|
+
};
|
|
3130
3162
|
|
|
3131
3163
|
// Main
|
|
3132
3164
|
var TemplateNormal = function TemplateNormal(props) {
|
|
@@ -3152,6 +3184,12 @@ var TemplateNormal = function TemplateNormal(props) {
|
|
|
3152
3184
|
|
|
3153
3185
|
function layout() {
|
|
3154
3186
|
switch (config.columns) {
|
|
3187
|
+
case '1':
|
|
3188
|
+
return React__default.createElement(
|
|
3189
|
+
Column1,
|
|
3190
|
+
null,
|
|
3191
|
+
props.children
|
|
3192
|
+
);
|
|
3155
3193
|
case '2':
|
|
3156
3194
|
return React__default.createElement(
|
|
3157
3195
|
Column2,
|
|
@@ -3187,72 +3225,24 @@ var TemplateNormal = function TemplateNormal(props) {
|
|
|
3187
3225
|
);
|
|
3188
3226
|
};
|
|
3189
3227
|
|
|
3190
|
-
var AD300x250 = function (
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
function AD300x250(props) {
|
|
3194
|
-
classCallCheck(this, AD300x250);
|
|
3228
|
+
var AD300x250 = function AD300x250(_ref) {
|
|
3229
|
+
var networkID = _ref.networkID,
|
|
3230
|
+
adUnit = _ref.adUnit;
|
|
3195
3231
|
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
_this.option = {
|
|
3199
|
-
networkID: props.networkID,
|
|
3200
|
-
adUnit: props.adUnit
|
|
3201
|
-
};
|
|
3202
|
-
return _this;
|
|
3203
|
-
}
|
|
3204
|
-
|
|
3205
|
-
createClass(AD300x250, [{
|
|
3206
|
-
key: 'render',
|
|
3207
|
-
value: function render() {
|
|
3208
|
-
return React__default.createElement(
|
|
3209
|
-
lib_1,
|
|
3210
|
-
{ dfpNetworkId: this.option.networkID },
|
|
3211
|
-
React__default.createElement(
|
|
3212
|
-
'div',
|
|
3213
|
-
{ className: 'AD300x250' },
|
|
3214
|
-
React__default.createElement(lib_2, { sizes: [[300, 250]], adUnit: this.option.adUnit })
|
|
3215
|
-
)
|
|
3216
|
-
);
|
|
3217
|
-
}
|
|
3218
|
-
}]);
|
|
3219
|
-
return AD300x250;
|
|
3220
|
-
}(Component);
|
|
3221
|
-
|
|
3222
|
-
var AD300x250x600 = function (_Component) {
|
|
3223
|
-
inherits(AD300x250x600, _Component);
|
|
3224
|
-
|
|
3225
|
-
function AD300x250x600(props) {
|
|
3226
|
-
classCallCheck(this, AD300x250x600);
|
|
3227
|
-
|
|
3228
|
-
var _this = possibleConstructorReturn(this, (AD300x250x600.__proto__ || Object.getPrototypeOf(AD300x250x600)).call(this, props));
|
|
3232
|
+
return React__default.createElement(AD, { networkID: networkID, adUnit: adUnit, className: 'AD300x250', sizes: [[300, 250]] });
|
|
3233
|
+
};
|
|
3229
3234
|
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
adUnit
|
|
3233
|
-
};
|
|
3234
|
-
return _this;
|
|
3235
|
-
}
|
|
3235
|
+
var AD300x250x600 = function AD300x250x600(_ref) {
|
|
3236
|
+
var networkID = _ref.networkID,
|
|
3237
|
+
adUnit = _ref.adUnit;
|
|
3236
3238
|
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
'div',
|
|
3245
|
-
{ className: 'AD300x250' },
|
|
3246
|
-
React__default.createElement(lib_2, {
|
|
3247
|
-
sizes: [[300, 250], [300, 600]],
|
|
3248
|
-
adUnit: this.option.adUnit
|
|
3249
|
-
})
|
|
3250
|
-
)
|
|
3251
|
-
);
|
|
3252
|
-
}
|
|
3253
|
-
}]);
|
|
3254
|
-
return AD300x250x600;
|
|
3255
|
-
}(Component);
|
|
3239
|
+
return React__default.createElement(AD, {
|
|
3240
|
+
networkID: networkID,
|
|
3241
|
+
adUnit: adUnit,
|
|
3242
|
+
className: 'AD300x250',
|
|
3243
|
+
sizes: [[300, 250], [300, 600]]
|
|
3244
|
+
});
|
|
3245
|
+
};
|
|
3256
3246
|
|
|
3257
3247
|
var getYoutubeId = createCommonjsModule(function (module, exports) {
|
|
3258
3248
|
(function (root, factory) {
|
|
@@ -5933,5 +5923,5 @@ var getSerializers = function getSerializers() {
|
|
|
5933
5923
|
};
|
|
5934
5924
|
};
|
|
5935
5925
|
|
|
5936
|
-
export { DeckContent, DeckQueue, Column2, Column3, Header, LeftNav, NavMagazine, NavNative, NavNormal, TemplateNormal, AD300x250, AD300x250x600, AD728x90, getSerializers };
|
|
5926
|
+
export { DeckContent, DeckQueue, Column1, Column2, Column3, Header, LeftNav, NavMagazine, NavNative, NavNormal, TemplateNormal, AD300x250, AD300x250x600, AD728x90, getSerializers };
|
|
5937
5927
|
//# sourceMappingURL=index.es.js.map
|