@mjhls/mjh-framework 1.0.356 → 1.0.358
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/index.js +84 -56
- package/dist/esm/index.js +84 -56
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -2982,6 +2982,7 @@ var ADWelcome = function ADWelcome(_ref) {
|
|
|
2982
2982
|
setTimeLeft(calculateTimeLeft(timeLeft));
|
|
2983
2983
|
}, 1000);
|
|
2984
2984
|
} else {
|
|
2985
|
+
document.body.style.overflow = 'auto';
|
|
2985
2986
|
setFlag(true);
|
|
2986
2987
|
}
|
|
2987
2988
|
});
|
|
@@ -5878,7 +5879,13 @@ var Media = function Media(_ref) {
|
|
|
5878
5879
|
var uploadDoc = node.upload_doc,
|
|
5879
5880
|
poster = node.poster,
|
|
5880
5881
|
blank = node.blank,
|
|
5881
|
-
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;
|
|
5882
5889
|
|
|
5883
5890
|
var builder = index.imageUrlBuilder(client);
|
|
5884
5891
|
|
|
@@ -5886,64 +5893,85 @@ var Media = function Media(_ref) {
|
|
|
5886
5893
|
return builder.image(source).auto('format');
|
|
5887
5894
|
};
|
|
5888
5895
|
|
|
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
|
-
|
|
5927
|
-
|
|
5928
|
-
caption
|
|
5929
|
-
);
|
|
5930
|
-
}
|
|
5931
|
-
return React__default.createElement(
|
|
5932
|
-
'a',
|
|
5933
|
-
{ href: uploadDoc.asset.url, target: blank ? '_blank' : '_self', className: 'd-block text-center' },
|
|
5934
|
-
caption
|
|
5935
|
-
);
|
|
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%';
|
|
5936
5935
|
}
|
|
5937
|
-
|
|
5936
|
+
} else {
|
|
5937
|
+
imageWidth = widthP + '%';
|
|
5938
5938
|
}
|
|
5939
|
-
|
|
5940
|
-
|
|
5939
|
+
} else {
|
|
5940
|
+
imageWidth = '100%';
|
|
5941
|
+
}
|
|
5941
5942
|
|
|
5942
|
-
return
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
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
|
+
}
|
|
5947
5975
|
};
|
|
5948
5976
|
|
|
5949
5977
|
var IFrame = function IFrame(_ref) {
|
package/dist/esm/index.js
CHANGED
|
@@ -2979,6 +2979,7 @@ var ADWelcome = function ADWelcome(_ref) {
|
|
|
2979
2979
|
setTimeLeft(calculateTimeLeft(timeLeft));
|
|
2980
2980
|
}, 1000);
|
|
2981
2981
|
} else {
|
|
2982
|
+
document.body.style.overflow = 'auto';
|
|
2982
2983
|
setFlag(true);
|
|
2983
2984
|
}
|
|
2984
2985
|
});
|
|
@@ -5875,7 +5876,13 @@ var Media = function Media(_ref) {
|
|
|
5875
5876
|
var uploadDoc = node.upload_doc,
|
|
5876
5877
|
poster = node.poster,
|
|
5877
5878
|
blank = node.blank,
|
|
5878
|
-
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;
|
|
5879
5886
|
|
|
5880
5887
|
var builder = imageUrlBuilder(client);
|
|
5881
5888
|
|
|
@@ -5883,64 +5890,85 @@ var Media = function Media(_ref) {
|
|
|
5883
5890
|
return builder.image(source).auto('format');
|
|
5884
5891
|
};
|
|
5885
5892
|
|
|
5886
|
-
|
|
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
|
-
caption
|
|
5926
|
-
);
|
|
5927
|
-
}
|
|
5928
|
-
return React__default.createElement(
|
|
5929
|
-
'a',
|
|
5930
|
-
{ href: uploadDoc.asset.url, target: blank ? '_blank' : '_self', className: 'd-block text-center' },
|
|
5931
|
-
caption
|
|
5932
|
-
);
|
|
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%';
|
|
5933
5932
|
}
|
|
5934
|
-
|
|
5933
|
+
} else {
|
|
5934
|
+
imageWidth = widthP + '%';
|
|
5935
5935
|
}
|
|
5936
|
-
|
|
5937
|
-
|
|
5936
|
+
} else {
|
|
5937
|
+
imageWidth = '100%';
|
|
5938
|
+
}
|
|
5938
5939
|
|
|
5939
|
-
return
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
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
|
+
}
|
|
5944
5972
|
};
|
|
5945
5973
|
|
|
5946
5974
|
var IFrame = function IFrame(_ref) {
|