@mjhls/mjh-framework 1.0.62 → 1.0.64
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 +1 -1
- package/dist/index.es.js +89 -39
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +89 -39
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -3845,10 +3845,10 @@ var DeckContent = function (_React$Component) {
|
|
|
3845
3845
|
var client = _this.props.client;
|
|
3846
3846
|
|
|
3847
3847
|
|
|
3848
|
-
var params = { from: from, to: to
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
client.fetch(
|
|
3848
|
+
var params = _extends({}, _this.params, { from: from, to: to
|
|
3849
|
+
// const queryUpdated = query.replace('$from', params.from).replace('$to', params.to)
|
|
3850
|
+
// const query = '*[_type == "article" && defined(title) && defined(thumbnail)][$from...$to] { title, summary, thumbnail { asset-> }, url }'
|
|
3851
|
+
});client.fetch(query, params).then(function (dataArr) {
|
|
3852
3852
|
if (_this.pointer && _this.pointerArray) {
|
|
3853
3853
|
var pointer = _this.pointer;
|
|
3854
3854
|
dataArr = dataArr[_this.pointerArray][pointer];
|
|
@@ -3891,7 +3891,6 @@ var DeckContent = function (_React$Component) {
|
|
|
3891
3891
|
var currentPage = _this.state.currentPage;
|
|
3892
3892
|
|
|
3893
3893
|
if (seoPaginate) {
|
|
3894
|
-
|
|
3895
3894
|
var path = router.asPath;
|
|
3896
3895
|
var qrIndex = path.indexOf('?');
|
|
3897
3896
|
var pathname = router.pathname;
|
|
@@ -3903,7 +3902,7 @@ var DeckContent = function (_React$Component) {
|
|
|
3903
3902
|
var partialQS = router.asPath.substring(qrIndex + 1);
|
|
3904
3903
|
var partialQSArr = partialQS.split('&');
|
|
3905
3904
|
|
|
3906
|
-
// exclude page=xxx from query string
|
|
3905
|
+
// exclude page=xxx from query string
|
|
3907
3906
|
partialQSArr.map(function (item) {
|
|
3908
3907
|
var itemArr = item.split('=');
|
|
3909
3908
|
var key = itemArr[0];
|
|
@@ -3922,7 +3921,6 @@ var DeckContent = function (_React$Component) {
|
|
|
3922
3921
|
pageNumber = parseInt(pageNumber);
|
|
3923
3922
|
|
|
3924
3923
|
if (currentPage !== pageNumber) {
|
|
3925
|
-
|
|
3926
3924
|
lib_3.refresh();
|
|
3927
3925
|
if (pageview) {
|
|
3928
3926
|
_this.setState({
|
|
@@ -3935,15 +3933,15 @@ var DeckContent = function (_React$Component) {
|
|
|
3935
3933
|
var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
|
|
3936
3934
|
|
|
3937
3935
|
// please leave this for later debug purpose : Yong Jun.
|
|
3938
|
-
/*console.log('page change reported', {
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
})*/
|
|
3936
|
+
/* console.log('page change reported', {
|
|
3937
|
+
currentPage: currentPage,
|
|
3938
|
+
pageNumber: pageNumber,
|
|
3939
|
+
pathname: pathname,
|
|
3940
|
+
path: path,
|
|
3941
|
+
newPath: newPath,
|
|
3942
|
+
firstPage: pageNumber === 1,
|
|
3943
|
+
queryString: queryString
|
|
3944
|
+
}) */
|
|
3947
3945
|
|
|
3948
3946
|
pageview(newPath);
|
|
3949
3947
|
|
|
@@ -5162,12 +5160,12 @@ var DeckQueue = function (_React$Component) {
|
|
|
5162
5160
|
var client = _this.props.client;
|
|
5163
5161
|
|
|
5164
5162
|
|
|
5165
|
-
var params = { from: from, to: to
|
|
5166
|
-
|
|
5163
|
+
var params = _extends({}, _this.params, { from: from, to: to
|
|
5164
|
+
// const queryUpdated = query.replace('$from', params.from).replace('$to', params.to)
|
|
5167
5165
|
|
|
5168
|
-
if (_this.pointer && _this.pointerArray) {
|
|
5166
|
+
});if (_this.pointer && _this.pointerArray) {
|
|
5169
5167
|
var pointer = _this.pointer;
|
|
5170
|
-
client.fetch(
|
|
5168
|
+
client.fetch(query, params).then(function (dataArr) {
|
|
5171
5169
|
_this.setState(function (state, props) {
|
|
5172
5170
|
if (dataArr[_this.pointerArray][pointer].length > 0) {
|
|
5173
5171
|
return {
|
|
@@ -5182,7 +5180,7 @@ var DeckQueue = function (_React$Component) {
|
|
|
5182
5180
|
});
|
|
5183
5181
|
});
|
|
5184
5182
|
} else {
|
|
5185
|
-
client.fetch(
|
|
5183
|
+
client.fetch(query, params).then(function (dataArr) {
|
|
5186
5184
|
_this.setState(function (state, props) {
|
|
5187
5185
|
if (dataArr.length > 0) {
|
|
5188
5186
|
return {
|
|
@@ -7386,23 +7384,51 @@ var AD300x250x600 = function AD300x250x600(_ref) {
|
|
|
7386
7384
|
};
|
|
7387
7385
|
|
|
7388
7386
|
var FigureComponent = function FigureComponent(_ref) {
|
|
7389
|
-
var
|
|
7390
|
-
asset = _ref.asset,
|
|
7387
|
+
var node$$1 = _ref.node,
|
|
7391
7388
|
client = _ref.client;
|
|
7389
|
+
var caption = node$$1.caption,
|
|
7390
|
+
asset = node$$1.asset,
|
|
7391
|
+
alt = node$$1.alt,
|
|
7392
|
+
blank = node$$1.blank,
|
|
7393
|
+
link = node$$1.link,
|
|
7394
|
+
_node$widthP = node$$1.widthP,
|
|
7395
|
+
widthP = _node$widthP === undefined ? '100' : _node$widthP,
|
|
7396
|
+
_node$alignment = node$$1.alignment,
|
|
7397
|
+
alignment = _node$alignment === undefined ? 'center' : _node$alignment;
|
|
7392
7398
|
|
|
7393
7399
|
var builder = imageUrlBuilder(client);
|
|
7394
7400
|
|
|
7395
7401
|
var urlFor = function urlFor(source) {
|
|
7396
7402
|
return builder.image(source);
|
|
7397
7403
|
};
|
|
7398
|
-
|
|
7404
|
+
var imgWidth = widthP + '%';
|
|
7405
|
+
var imgFloat = alignment.toLowerCase() === 'center' ? 'none' : alignment.toLowerCase();
|
|
7406
|
+
var figureMargin = void 0;
|
|
7407
|
+
if (imgFloat === 'none') {
|
|
7408
|
+
figureMargin = '0 auto 2rem';
|
|
7409
|
+
}
|
|
7410
|
+
if (imgFloat === 'left') {
|
|
7411
|
+
figureMargin = '0 2rem 2rem 0';
|
|
7412
|
+
}
|
|
7413
|
+
if (imgFloat === 'right') {
|
|
7414
|
+
figureMargin = '0 0 2rem 2rem';
|
|
7415
|
+
}
|
|
7399
7416
|
return React__default.createElement(
|
|
7400
|
-
|
|
7401
|
-
{ style: {
|
|
7402
|
-
React__default.createElement(
|
|
7403
|
-
|
|
7417
|
+
Figure,
|
|
7418
|
+
{ className: 'd-block text-center mb-3', style: { width: imgWidth, float: imgFloat, margin: figureMargin } },
|
|
7419
|
+
link ? React__default.createElement(
|
|
7420
|
+
'a',
|
|
7421
|
+
{ href: link, target: blank ? '_blank' : '_self' },
|
|
7422
|
+
React__default.createElement(Figure.Image, { src: urlFor(asset).url(), alt: alt && alt }),
|
|
7423
|
+
caption && React__default.createElement(
|
|
7424
|
+
Figure.Caption,
|
|
7425
|
+
null,
|
|
7426
|
+
caption
|
|
7427
|
+
)
|
|
7428
|
+
) : React__default.createElement(
|
|
7429
|
+
React__default.Fragment,
|
|
7404
7430
|
null,
|
|
7405
|
-
React__default.createElement(Figure.Image, { src: urlFor(asset).url() }),
|
|
7431
|
+
React__default.createElement(Figure.Image, { src: urlFor(asset).url(), alt: alt && alt }),
|
|
7406
7432
|
caption && React__default.createElement(
|
|
7407
7433
|
Figure.Caption,
|
|
7408
7434
|
null,
|
|
@@ -11081,17 +11107,43 @@ var Media$1 = function Media$$1(_ref) {
|
|
|
11081
11107
|
return builder.image(source);
|
|
11082
11108
|
};
|
|
11083
11109
|
|
|
11110
|
+
var renderFigure = function renderFigure(uploadDoc, poster, blank, caption) {
|
|
11111
|
+
if (uploadDoc && uploadDoc.asset && poster && poster.asset) {
|
|
11112
|
+
return React__default.createElement(
|
|
11113
|
+
Figure,
|
|
11114
|
+
{ className: 'd-block text-center mb-3' },
|
|
11115
|
+
React__default.createElement(
|
|
11116
|
+
'a',
|
|
11117
|
+
{ href: uploadDoc.asset.url, target: blank ? '_blank' : '_self' },
|
|
11118
|
+
React__default.createElement(Figure.Image, { src: urlFor(poster.asset).url(), fluid: true }),
|
|
11119
|
+
caption && React__default.createElement(
|
|
11120
|
+
Figure.Caption,
|
|
11121
|
+
null,
|
|
11122
|
+
caption
|
|
11123
|
+
)
|
|
11124
|
+
)
|
|
11125
|
+
);
|
|
11126
|
+
} else if (poster && poster.asset) {
|
|
11127
|
+
return React__default.createElement(
|
|
11128
|
+
Figure,
|
|
11129
|
+
{ className: 'd-block text-center mb-3' },
|
|
11130
|
+
React__default.createElement(Figure.Image, { src: urlFor(poster.asset).url() }),
|
|
11131
|
+
caption && React__default.createElement(
|
|
11132
|
+
Figure.Caption,
|
|
11133
|
+
null,
|
|
11134
|
+
caption
|
|
11135
|
+
)
|
|
11136
|
+
);
|
|
11137
|
+
}
|
|
11138
|
+
};
|
|
11139
|
+
|
|
11084
11140
|
return React__default.createElement(
|
|
11085
|
-
|
|
11141
|
+
React__default.Fragment,
|
|
11086
11142
|
null,
|
|
11087
|
-
uploadDoc
|
|
11143
|
+
renderFigure(uploadDoc, poster, blank, caption),
|
|
11144
|
+
!poster && uploadDoc && uploadDoc.asset && React__default.createElement(
|
|
11088
11145
|
'a',
|
|
11089
11146
|
{ href: uploadDoc.asset.url, target: blank ? '_blank' : '_self' },
|
|
11090
|
-
React__default.createElement(Figure.Image, { src: urlFor(poster.asset).url() })
|
|
11091
|
-
) : React__default.createElement(Figure.Image, { src: urlFor(poster.asset).url() }),
|
|
11092
|
-
caption && React__default.createElement(
|
|
11093
|
-
Figure.Caption,
|
|
11094
|
-
null,
|
|
11095
11147
|
caption
|
|
11096
11148
|
)
|
|
11097
11149
|
);
|
|
@@ -11108,10 +11160,8 @@ var getSerializers$1 = function getSerializers(client) {
|
|
|
11108
11160
|
},
|
|
11109
11161
|
figure: function figure(_ref2) {
|
|
11110
11162
|
var node = _ref2.node;
|
|
11111
|
-
var asset = node.asset,
|
|
11112
|
-
caption = node.caption;
|
|
11113
11163
|
|
|
11114
|
-
return React__default.createElement(FigureComponent, {
|
|
11164
|
+
return React__default.createElement(FigureComponent, { node: node, client: client });
|
|
11115
11165
|
},
|
|
11116
11166
|
slideshow: function slideshow(_ref3) {
|
|
11117
11167
|
var node = _ref3.node;
|