@mjhls/mjh-framework 1.0.357 → 1.0.359
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/cjs/MasterDeck.js +7 -1
- package/dist/cjs/index.js +83 -56
- package/dist/esm/MasterDeck.js +7 -1
- package/dist/esm/index.js +83 -56
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/MasterDeck.js
CHANGED
|
@@ -164,8 +164,14 @@ var MasterDeck = function (_React$Component) {
|
|
|
164
164
|
if (path[0] !== '/') {
|
|
165
165
|
path = '/' + path;
|
|
166
166
|
}
|
|
167
|
-
|
|
168
167
|
var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
|
|
168
|
+
if (window.location.href.includes('?')) {
|
|
169
|
+
if (window.location.href.includes('?page')) {
|
|
170
|
+
newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
|
|
171
|
+
} else {
|
|
172
|
+
newPath = pageNumber === 1 ? '' + path : path + '&page=' + pageNumber;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
169
175
|
|
|
170
176
|
// please leave this for later debug purpose : Yong Jun.
|
|
171
177
|
/* console.log('page change reported', {
|
package/dist/cjs/index.js
CHANGED
|
@@ -5879,7 +5879,13 @@ var Media = function Media(_ref) {
|
|
|
5879
5879
|
var uploadDoc = node.upload_doc,
|
|
5880
5880
|
poster = node.poster,
|
|
5881
5881
|
blank = node.blank,
|
|
5882
|
-
caption = node.caption
|
|
5882
|
+
caption = node.caption,
|
|
5883
|
+
_node$alignment = node.alignment,
|
|
5884
|
+
alignment = _node$alignment === undefined ? 'center' : _node$alignment,
|
|
5885
|
+
alt = node.alt,
|
|
5886
|
+
className = node.class,
|
|
5887
|
+
_node$widthP = node.widthP,
|
|
5888
|
+
widthP = _node$widthP === undefined ? 'auto' : _node$widthP;
|
|
5883
5889
|
|
|
5884
5890
|
var builder = index.imageUrlBuilder(client);
|
|
5885
5891
|
|
|
@@ -5887,64 +5893,85 @@ var Media = function Media(_ref) {
|
|
|
5887
5893
|
return builder.image(source).auto('format');
|
|
5888
5894
|
};
|
|
5889
5895
|
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
caption
|
|
5930
|
-
);
|
|
5931
|
-
}
|
|
5932
|
-
return React__default.createElement(
|
|
5933
|
-
'a',
|
|
5934
|
-
{ href: uploadDoc.asset.url, target: blank ? '_blank' : '_self', className: 'd-block text-center' },
|
|
5935
|
-
caption
|
|
5936
|
-
);
|
|
5896
|
+
if (typeof window === 'undefined') {
|
|
5897
|
+
return null;
|
|
5898
|
+
}
|
|
5899
|
+
|
|
5900
|
+
React.useEffect(function () {
|
|
5901
|
+
var mediaLink = document.getElementById('media-link');
|
|
5902
|
+
if (mediaLink) {
|
|
5903
|
+
var prevSibling = mediaLink.previousSibling;
|
|
5904
|
+
if (prevSibling) prevSibling.style.display = 'inline';
|
|
5905
|
+
var nextSibling = mediaLink.nextSibling;
|
|
5906
|
+
if (nextSibling) nextSibling.style.display = 'inline';
|
|
5907
|
+
}
|
|
5908
|
+
}, []);
|
|
5909
|
+
|
|
5910
|
+
var screenWidth = window.innerWidth;
|
|
5911
|
+
var imageFloat = 'none';
|
|
5912
|
+
if (screenWidth > 1000) {
|
|
5913
|
+
var align = ['center', 'top'].includes(alignment.toLowerCase()) ? 'none' : alignment.toLowerCase();
|
|
5914
|
+
imageFloat = align;
|
|
5915
|
+
}
|
|
5916
|
+
|
|
5917
|
+
var imageMargin = null;
|
|
5918
|
+
if (imageFloat === 'none') {
|
|
5919
|
+
imageMargin = '0 auto 1rem';
|
|
5920
|
+
}
|
|
5921
|
+
if (imageFloat === 'left') {
|
|
5922
|
+
imageMargin = '0 1.5rem 1.5rem 0';
|
|
5923
|
+
}
|
|
5924
|
+
if (imageFloat === 'right') {
|
|
5925
|
+
imageMargin = '0 0 1.5rem 1.5rem';
|
|
5926
|
+
}
|
|
5927
|
+
|
|
5928
|
+
var imageWidth = null;
|
|
5929
|
+
if (screenWidth > 1000) {
|
|
5930
|
+
if (widthP === 'auto') {
|
|
5931
|
+
if (imageFloat === 'none') {
|
|
5932
|
+
imageWidth = 'auto';
|
|
5933
|
+
} else {
|
|
5934
|
+
imageWidth = '30%';
|
|
5937
5935
|
}
|
|
5938
|
-
|
|
5936
|
+
} else {
|
|
5937
|
+
imageWidth = widthP + '%';
|
|
5939
5938
|
}
|
|
5940
|
-
|
|
5941
|
-
|
|
5939
|
+
} else {
|
|
5940
|
+
imageWidth = '100%';
|
|
5941
|
+
}
|
|
5942
5942
|
|
|
5943
|
-
return
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5943
|
+
if (!uploadDoc || !uploadDoc.asset) return null;
|
|
5944
|
+
|
|
5945
|
+
if (poster && poster.asset && imageFloat && imageMargin && imageWidth) {
|
|
5946
|
+
return React__default.createElement(
|
|
5947
|
+
reactBootstrap.Figure,
|
|
5948
|
+
{ className: 'd-block ' + className, style: { width: imageWidth, maxWidth: '100%', clear: 'both', float: imageFloat, margin: imageMargin } },
|
|
5949
|
+
React__default.createElement(
|
|
5950
|
+
'a',
|
|
5951
|
+
{ href: uploadDoc.asset.url, target: blank ? '_blank' : '_self' },
|
|
5952
|
+
React__default.createElement(reactBootstrap.Figure.Image, _extends$2._extends({ className: 'media-image', style: { width: '100%' }, src: urlFor(poster).url() }, alt && { alt: alt })),
|
|
5953
|
+
caption && React__default.createElement(
|
|
5954
|
+
reactBootstrap.Figure.Caption,
|
|
5955
|
+
{ className: 'media-caption' },
|
|
5956
|
+
caption
|
|
5957
|
+
)
|
|
5958
|
+
)
|
|
5959
|
+
);
|
|
5960
|
+
} else if (caption && caption !== '') {
|
|
5961
|
+
return React__default.createElement(
|
|
5962
|
+
'a',
|
|
5963
|
+
_extends$2._extends({}, uploadDoc.downloadMedia ? {
|
|
5964
|
+
onClick: function onClick() {
|
|
5965
|
+
download(uploadDoc.asset.url, uploadDoc.asset.originalFilename);
|
|
5966
|
+
}
|
|
5967
|
+
} : { href: uploadDoc.asset.url, target: '_blank', rel: 'noopener noreferrer' }, {
|
|
5968
|
+
style: { paddingLeft: '4px', paddingRight: '4px' },
|
|
5969
|
+
id: 'media-link' }),
|
|
5970
|
+
caption
|
|
5971
|
+
);
|
|
5972
|
+
} else {
|
|
5973
|
+
return null;
|
|
5974
|
+
}
|
|
5948
5975
|
};
|
|
5949
5976
|
|
|
5950
5977
|
var IFrame = function IFrame(_ref) {
|
package/dist/esm/MasterDeck.js
CHANGED
|
@@ -158,8 +158,14 @@ var MasterDeck = function (_React$Component) {
|
|
|
158
158
|
if (path[0] !== '/') {
|
|
159
159
|
path = '/' + path;
|
|
160
160
|
}
|
|
161
|
-
|
|
162
161
|
var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
|
|
162
|
+
if (window.location.href.includes('?')) {
|
|
163
|
+
if (window.location.href.includes('?page')) {
|
|
164
|
+
newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
|
|
165
|
+
} else {
|
|
166
|
+
newPath = pageNumber === 1 ? '' + path : path + '&page=' + pageNumber;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
163
169
|
|
|
164
170
|
// please leave this for later debug purpose : Yong Jun.
|
|
165
171
|
/* console.log('page change reported', {
|
package/dist/esm/index.js
CHANGED
|
@@ -5876,7 +5876,13 @@ var Media = function Media(_ref) {
|
|
|
5876
5876
|
var uploadDoc = node.upload_doc,
|
|
5877
5877
|
poster = node.poster,
|
|
5878
5878
|
blank = node.blank,
|
|
5879
|
-
caption = node.caption
|
|
5879
|
+
caption = node.caption,
|
|
5880
|
+
_node$alignment = node.alignment,
|
|
5881
|
+
alignment = _node$alignment === undefined ? 'center' : _node$alignment,
|
|
5882
|
+
alt = node.alt,
|
|
5883
|
+
className = node.class,
|
|
5884
|
+
_node$widthP = node.widthP,
|
|
5885
|
+
widthP = _node$widthP === undefined ? 'auto' : _node$widthP;
|
|
5880
5886
|
|
|
5881
5887
|
var builder = imageUrlBuilder(client);
|
|
5882
5888
|
|
|
@@ -5884,64 +5890,85 @@ var Media = function Media(_ref) {
|
|
|
5884
5890
|
return builder.image(source).auto('format');
|
|
5885
5891
|
};
|
|
5886
5892
|
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
caption
|
|
5927
|
-
);
|
|
5928
|
-
}
|
|
5929
|
-
return React__default.createElement(
|
|
5930
|
-
'a',
|
|
5931
|
-
{ href: uploadDoc.asset.url, target: blank ? '_blank' : '_self', className: 'd-block text-center' },
|
|
5932
|
-
caption
|
|
5933
|
-
);
|
|
5893
|
+
if (typeof window === 'undefined') {
|
|
5894
|
+
return null;
|
|
5895
|
+
}
|
|
5896
|
+
|
|
5897
|
+
useEffect(function () {
|
|
5898
|
+
var mediaLink = document.getElementById('media-link');
|
|
5899
|
+
if (mediaLink) {
|
|
5900
|
+
var prevSibling = mediaLink.previousSibling;
|
|
5901
|
+
if (prevSibling) prevSibling.style.display = 'inline';
|
|
5902
|
+
var nextSibling = mediaLink.nextSibling;
|
|
5903
|
+
if (nextSibling) nextSibling.style.display = 'inline';
|
|
5904
|
+
}
|
|
5905
|
+
}, []);
|
|
5906
|
+
|
|
5907
|
+
var screenWidth = window.innerWidth;
|
|
5908
|
+
var imageFloat = 'none';
|
|
5909
|
+
if (screenWidth > 1000) {
|
|
5910
|
+
var align = ['center', 'top'].includes(alignment.toLowerCase()) ? 'none' : alignment.toLowerCase();
|
|
5911
|
+
imageFloat = align;
|
|
5912
|
+
}
|
|
5913
|
+
|
|
5914
|
+
var imageMargin = null;
|
|
5915
|
+
if (imageFloat === 'none') {
|
|
5916
|
+
imageMargin = '0 auto 1rem';
|
|
5917
|
+
}
|
|
5918
|
+
if (imageFloat === 'left') {
|
|
5919
|
+
imageMargin = '0 1.5rem 1.5rem 0';
|
|
5920
|
+
}
|
|
5921
|
+
if (imageFloat === 'right') {
|
|
5922
|
+
imageMargin = '0 0 1.5rem 1.5rem';
|
|
5923
|
+
}
|
|
5924
|
+
|
|
5925
|
+
var imageWidth = null;
|
|
5926
|
+
if (screenWidth > 1000) {
|
|
5927
|
+
if (widthP === 'auto') {
|
|
5928
|
+
if (imageFloat === 'none') {
|
|
5929
|
+
imageWidth = 'auto';
|
|
5930
|
+
} else {
|
|
5931
|
+
imageWidth = '30%';
|
|
5934
5932
|
}
|
|
5935
|
-
|
|
5933
|
+
} else {
|
|
5934
|
+
imageWidth = widthP + '%';
|
|
5936
5935
|
}
|
|
5937
|
-
|
|
5938
|
-
|
|
5936
|
+
} else {
|
|
5937
|
+
imageWidth = '100%';
|
|
5938
|
+
}
|
|
5939
5939
|
|
|
5940
|
-
return
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5940
|
+
if (!uploadDoc || !uploadDoc.asset) return null;
|
|
5941
|
+
|
|
5942
|
+
if (poster && poster.asset && imageFloat && imageMargin && imageWidth) {
|
|
5943
|
+
return React__default.createElement(
|
|
5944
|
+
Figure$1,
|
|
5945
|
+
{ className: 'd-block ' + className, style: { width: imageWidth, maxWidth: '100%', clear: 'both', float: imageFloat, margin: imageMargin } },
|
|
5946
|
+
React__default.createElement(
|
|
5947
|
+
'a',
|
|
5948
|
+
{ href: uploadDoc.asset.url, target: blank ? '_blank' : '_self' },
|
|
5949
|
+
React__default.createElement(Figure$1.Image, _extends$2({ className: 'media-image', style: { width: '100%' }, src: urlFor(poster).url() }, alt && { alt: alt })),
|
|
5950
|
+
caption && React__default.createElement(
|
|
5951
|
+
Figure$1.Caption,
|
|
5952
|
+
{ className: 'media-caption' },
|
|
5953
|
+
caption
|
|
5954
|
+
)
|
|
5955
|
+
)
|
|
5956
|
+
);
|
|
5957
|
+
} else if (caption && caption !== '') {
|
|
5958
|
+
return React__default.createElement(
|
|
5959
|
+
'a',
|
|
5960
|
+
_extends$2({}, uploadDoc.downloadMedia ? {
|
|
5961
|
+
onClick: function onClick() {
|
|
5962
|
+
download(uploadDoc.asset.url, uploadDoc.asset.originalFilename);
|
|
5963
|
+
}
|
|
5964
|
+
} : { href: uploadDoc.asset.url, target: '_blank', rel: 'noopener noreferrer' }, {
|
|
5965
|
+
style: { paddingLeft: '4px', paddingRight: '4px' },
|
|
5966
|
+
id: 'media-link' }),
|
|
5967
|
+
caption
|
|
5968
|
+
);
|
|
5969
|
+
} else {
|
|
5970
|
+
return null;
|
|
5971
|
+
}
|
|
5945
5972
|
};
|
|
5946
5973
|
|
|
5947
5974
|
var IFrame = function IFrame(_ref) {
|