@mjhls/mjh-framework 1.0.63 → 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 -46
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +89 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3852,10 +3852,10 @@ var DeckContent = function (_React$Component) {
|
|
|
3852
3852
|
var client = _this.props.client;
|
|
3853
3853
|
|
|
3854
3854
|
|
|
3855
|
-
var params = { from: from, to: to
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
client.fetch(
|
|
3855
|
+
var params = _extends({}, _this.params, { from: from, to: to
|
|
3856
|
+
// const queryUpdated = query.replace('$from', params.from).replace('$to', params.to)
|
|
3857
|
+
// const query = '*[_type == "article" && defined(title) && defined(thumbnail)][$from...$to] { title, summary, thumbnail { asset-> }, url }'
|
|
3858
|
+
});client.fetch(query, params).then(function (dataArr) {
|
|
3859
3859
|
if (_this.pointer && _this.pointerArray) {
|
|
3860
3860
|
var pointer = _this.pointer;
|
|
3861
3861
|
dataArr = dataArr[_this.pointerArray][pointer];
|
|
@@ -3898,7 +3898,6 @@ var DeckContent = function (_React$Component) {
|
|
|
3898
3898
|
var currentPage = _this.state.currentPage;
|
|
3899
3899
|
|
|
3900
3900
|
if (seoPaginate) {
|
|
3901
|
-
|
|
3902
3901
|
var path = router$$1.asPath;
|
|
3903
3902
|
var qrIndex = path.indexOf('?');
|
|
3904
3903
|
var pathname = router$$1.pathname;
|
|
@@ -3910,7 +3909,7 @@ var DeckContent = function (_React$Component) {
|
|
|
3910
3909
|
var partialQS = router$$1.asPath.substring(qrIndex + 1);
|
|
3911
3910
|
var partialQSArr = partialQS.split('&');
|
|
3912
3911
|
|
|
3913
|
-
// exclude page=xxx from query string
|
|
3912
|
+
// exclude page=xxx from query string
|
|
3914
3913
|
partialQSArr.map(function (item) {
|
|
3915
3914
|
var itemArr = item.split('=');
|
|
3916
3915
|
var key = itemArr[0];
|
|
@@ -3929,7 +3928,6 @@ var DeckContent = function (_React$Component) {
|
|
|
3929
3928
|
pageNumber = parseInt(pageNumber);
|
|
3930
3929
|
|
|
3931
3930
|
if (currentPage !== pageNumber) {
|
|
3932
|
-
|
|
3933
3931
|
lib_3.refresh();
|
|
3934
3932
|
if (pageview) {
|
|
3935
3933
|
_this.setState({
|
|
@@ -3942,15 +3940,15 @@ var DeckContent = function (_React$Component) {
|
|
|
3942
3940
|
var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
|
|
3943
3941
|
|
|
3944
3942
|
// please leave this for later debug purpose : Yong Jun.
|
|
3945
|
-
/*console.log('page change reported', {
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
})*/
|
|
3943
|
+
/* console.log('page change reported', {
|
|
3944
|
+
currentPage: currentPage,
|
|
3945
|
+
pageNumber: pageNumber,
|
|
3946
|
+
pathname: pathname,
|
|
3947
|
+
path: path,
|
|
3948
|
+
newPath: newPath,
|
|
3949
|
+
firstPage: pageNumber === 1,
|
|
3950
|
+
queryString: queryString
|
|
3951
|
+
}) */
|
|
3954
3952
|
|
|
3955
3953
|
pageview(newPath);
|
|
3956
3954
|
|
|
@@ -5169,12 +5167,12 @@ var DeckQueue = function (_React$Component) {
|
|
|
5169
5167
|
var client = _this.props.client;
|
|
5170
5168
|
|
|
5171
5169
|
|
|
5172
|
-
var params = { from: from, to: to
|
|
5173
|
-
|
|
5170
|
+
var params = _extends({}, _this.params, { from: from, to: to
|
|
5171
|
+
// const queryUpdated = query.replace('$from', params.from).replace('$to', params.to)
|
|
5174
5172
|
|
|
5175
|
-
if (_this.pointer && _this.pointerArray) {
|
|
5173
|
+
});if (_this.pointer && _this.pointerArray) {
|
|
5176
5174
|
var pointer = _this.pointer;
|
|
5177
|
-
client.fetch(
|
|
5175
|
+
client.fetch(query, params).then(function (dataArr) {
|
|
5178
5176
|
_this.setState(function (state, props) {
|
|
5179
5177
|
if (dataArr[_this.pointerArray][pointer].length > 0) {
|
|
5180
5178
|
return {
|
|
@@ -5189,7 +5187,7 @@ var DeckQueue = function (_React$Component) {
|
|
|
5189
5187
|
});
|
|
5190
5188
|
});
|
|
5191
5189
|
} else {
|
|
5192
|
-
client.fetch(
|
|
5190
|
+
client.fetch(query, params).then(function (dataArr) {
|
|
5193
5191
|
_this.setState(function (state, props) {
|
|
5194
5192
|
if (dataArr.length > 0) {
|
|
5195
5193
|
return {
|
|
@@ -7393,14 +7391,17 @@ var AD300x250x600 = function AD300x250x600(_ref) {
|
|
|
7393
7391
|
};
|
|
7394
7392
|
|
|
7395
7393
|
var FigureComponent = function FigureComponent(_ref) {
|
|
7396
|
-
var
|
|
7397
|
-
_ref$widthP = _ref.widthP,
|
|
7398
|
-
widthP = _ref$widthP === undefined ? '100' : _ref$widthP,
|
|
7399
|
-
_ref$alignment = _ref.alignment,
|
|
7400
|
-
alignment = _ref$alignment === undefined ? 'center' : _ref$alignment,
|
|
7401
|
-
asset = _ref.asset,
|
|
7394
|
+
var node$$1 = _ref.node,
|
|
7402
7395
|
client = _ref.client;
|
|
7403
|
-
|
|
7396
|
+
var caption = node$$1.caption,
|
|
7397
|
+
asset = node$$1.asset,
|
|
7398
|
+
alt = node$$1.alt,
|
|
7399
|
+
blank = node$$1.blank,
|
|
7400
|
+
link = node$$1.link,
|
|
7401
|
+
_node$widthP = node$$1.widthP,
|
|
7402
|
+
widthP = _node$widthP === undefined ? '100' : _node$widthP,
|
|
7403
|
+
_node$alignment = node$$1.alignment,
|
|
7404
|
+
alignment = _node$alignment === undefined ? 'center' : _node$alignment;
|
|
7404
7405
|
|
|
7405
7406
|
var builder = imageUrlBuilder(client);
|
|
7406
7407
|
|
|
@@ -7408,13 +7409,33 @@ var FigureComponent = function FigureComponent(_ref) {
|
|
|
7408
7409
|
return builder.image(source);
|
|
7409
7410
|
};
|
|
7410
7411
|
var imgWidth = widthP + '%';
|
|
7412
|
+
var imgFloat = alignment.toLowerCase() === 'center' ? 'none' : alignment.toLowerCase();
|
|
7413
|
+
var figureMargin = void 0;
|
|
7414
|
+
if (imgFloat === 'none') {
|
|
7415
|
+
figureMargin = '0 auto 2rem';
|
|
7416
|
+
}
|
|
7417
|
+
if (imgFloat === 'left') {
|
|
7418
|
+
figureMargin = '0 2rem 2rem 0';
|
|
7419
|
+
}
|
|
7420
|
+
if (imgFloat === 'right') {
|
|
7421
|
+
figureMargin = '0 0 2rem 2rem';
|
|
7422
|
+
}
|
|
7411
7423
|
return React__default.createElement(
|
|
7412
|
-
|
|
7413
|
-
{ style: {
|
|
7414
|
-
React__default.createElement(
|
|
7415
|
-
|
|
7416
|
-
{
|
|
7417
|
-
React__default.createElement(reactBootstrap.Figure.Image, { src: urlFor(asset).url() }),
|
|
7424
|
+
reactBootstrap.Figure,
|
|
7425
|
+
{ className: 'd-block text-center mb-3', style: { width: imgWidth, float: imgFloat, margin: figureMargin } },
|
|
7426
|
+
link ? React__default.createElement(
|
|
7427
|
+
'a',
|
|
7428
|
+
{ href: link, target: blank ? '_blank' : '_self' },
|
|
7429
|
+
React__default.createElement(reactBootstrap.Figure.Image, { src: urlFor(asset).url(), alt: alt && alt }),
|
|
7430
|
+
caption && React__default.createElement(
|
|
7431
|
+
reactBootstrap.Figure.Caption,
|
|
7432
|
+
null,
|
|
7433
|
+
caption
|
|
7434
|
+
)
|
|
7435
|
+
) : React__default.createElement(
|
|
7436
|
+
React__default.Fragment,
|
|
7437
|
+
null,
|
|
7438
|
+
React__default.createElement(reactBootstrap.Figure.Image, { src: urlFor(asset).url(), alt: alt && alt }),
|
|
7418
7439
|
caption && React__default.createElement(
|
|
7419
7440
|
reactBootstrap.Figure.Caption,
|
|
7420
7441
|
null,
|
|
@@ -11093,17 +11114,43 @@ var Media$1 = function Media$$1(_ref) {
|
|
|
11093
11114
|
return builder.image(source);
|
|
11094
11115
|
};
|
|
11095
11116
|
|
|
11117
|
+
var renderFigure = function renderFigure(uploadDoc, poster, blank, caption) {
|
|
11118
|
+
if (uploadDoc && uploadDoc.asset && poster && poster.asset) {
|
|
11119
|
+
return React__default.createElement(
|
|
11120
|
+
reactBootstrap.Figure,
|
|
11121
|
+
{ className: 'd-block text-center mb-3' },
|
|
11122
|
+
React__default.createElement(
|
|
11123
|
+
'a',
|
|
11124
|
+
{ href: uploadDoc.asset.url, target: blank ? '_blank' : '_self' },
|
|
11125
|
+
React__default.createElement(reactBootstrap.Figure.Image, { src: urlFor(poster.asset).url(), fluid: true }),
|
|
11126
|
+
caption && React__default.createElement(
|
|
11127
|
+
reactBootstrap.Figure.Caption,
|
|
11128
|
+
null,
|
|
11129
|
+
caption
|
|
11130
|
+
)
|
|
11131
|
+
)
|
|
11132
|
+
);
|
|
11133
|
+
} else if (poster && poster.asset) {
|
|
11134
|
+
return React__default.createElement(
|
|
11135
|
+
reactBootstrap.Figure,
|
|
11136
|
+
{ className: 'd-block text-center mb-3' },
|
|
11137
|
+
React__default.createElement(reactBootstrap.Figure.Image, { src: urlFor(poster.asset).url() }),
|
|
11138
|
+
caption && React__default.createElement(
|
|
11139
|
+
reactBootstrap.Figure.Caption,
|
|
11140
|
+
null,
|
|
11141
|
+
caption
|
|
11142
|
+
)
|
|
11143
|
+
);
|
|
11144
|
+
}
|
|
11145
|
+
};
|
|
11146
|
+
|
|
11096
11147
|
return React__default.createElement(
|
|
11097
|
-
|
|
11148
|
+
React__default.Fragment,
|
|
11098
11149
|
null,
|
|
11099
|
-
uploadDoc
|
|
11150
|
+
renderFigure(uploadDoc, poster, blank, caption),
|
|
11151
|
+
!poster && uploadDoc && uploadDoc.asset && React__default.createElement(
|
|
11100
11152
|
'a',
|
|
11101
11153
|
{ href: uploadDoc.asset.url, target: blank ? '_blank' : '_self' },
|
|
11102
|
-
React__default.createElement(reactBootstrap.Figure.Image, { src: urlFor(poster.asset).url() })
|
|
11103
|
-
) : React__default.createElement(reactBootstrap.Figure.Image, { src: urlFor(poster.asset).url() }),
|
|
11104
|
-
caption && React__default.createElement(
|
|
11105
|
-
reactBootstrap.Figure.Caption,
|
|
11106
|
-
null,
|
|
11107
11154
|
caption
|
|
11108
11155
|
)
|
|
11109
11156
|
);
|
|
@@ -11120,12 +11167,8 @@ var getSerializers$1 = function getSerializers(client) {
|
|
|
11120
11167
|
},
|
|
11121
11168
|
figure: function figure(_ref2) {
|
|
11122
11169
|
var node = _ref2.node;
|
|
11123
|
-
var asset = node.asset,
|
|
11124
|
-
caption = node.caption,
|
|
11125
|
-
widthP = node.widthP,
|
|
11126
|
-
alignment = node.alignment;
|
|
11127
11170
|
|
|
11128
|
-
return React__default.createElement(FigureComponent, {
|
|
11171
|
+
return React__default.createElement(FigureComponent, { node: node, client: client });
|
|
11129
11172
|
},
|
|
11130
11173
|
slideshow: function slideshow(_ref3) {
|
|
11131
11174
|
var node = _ref3.node;
|