@websolutespa/bom-mixer-ui 1.9.11 → 1.9.12
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/CHANGELOG.md +6 -0
- package/dist/cjs/index.js +18 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/media/media-image.js +3 -3
- package/dist/esm/components/media/media-image.js.map +1 -1
- package/dist/esm/components/media/media-items.js +1 -0
- package/dist/esm/components/media/media-items.js.map +1 -1
- package/dist/esm/components/media/media-video.js +14 -10
- package/dist/esm/components/media/media-video.js.map +1 -1
- package/dist/types/components/media/media-image.d.ts +4 -14
- package/dist/types/components/media/media-image.d.ts.map +1 -1
- package/dist/types/components/media/media-items.d.ts +1 -0
- package/dist/types/components/media/media-items.d.ts.map +1 -1
- package/dist/types/components/media/media-video.d.ts +4 -10
- package/dist/types/components/media/media-video.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/media/media-image.tsx +6 -16
- package/src/components/media/media-items.tsx +2 -0
- package/src/components/media/media-video.tsx +13 -16
package/CHANGELOG.md
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -4799,12 +4799,12 @@ function isSVG(src) {
|
|
|
4799
4799
|
const MediaImage_ = _a => {
|
|
4800
4800
|
var {
|
|
4801
4801
|
className,
|
|
4802
|
-
type,
|
|
4803
4802
|
loading = 'lazy',
|
|
4804
4803
|
onLoaded,
|
|
4805
|
-
canLoad = true
|
|
4804
|
+
canLoad = true,
|
|
4805
|
+
mimeType
|
|
4806
4806
|
} = _a,
|
|
4807
|
-
props = __rest(_a, ["className", "
|
|
4807
|
+
props = __rest(_a, ["className", "loading", "onLoaded", "canLoad", "mimeType"]);
|
|
4808
4808
|
const theme = React.useContext(styled.ThemeContext);
|
|
4809
4809
|
if (!theme) {
|
|
4810
4810
|
throw new Error('MediaImage must be used within ThemeProvider');
|
|
@@ -4876,9 +4876,11 @@ const MediaVideo_ = _a => {
|
|
|
4876
4876
|
var {
|
|
4877
4877
|
className,
|
|
4878
4878
|
onLoaded,
|
|
4879
|
-
canLoad = true
|
|
4879
|
+
canLoad = true,
|
|
4880
|
+
src: mediaSrc,
|
|
4881
|
+
mimeType = 'video/mp4'
|
|
4880
4882
|
} = _a,
|
|
4881
|
-
props = __rest(_a, ["className", "onLoaded", "canLoad"]);
|
|
4883
|
+
props = __rest(_a, ["className", "onLoaded", "canLoad", "src", "mimeType"]);
|
|
4882
4884
|
const videoRef = React.useRef(null);
|
|
4883
4885
|
const {
|
|
4884
4886
|
locale
|
|
@@ -4923,10 +4925,10 @@ const MediaVideo_ = _a => {
|
|
|
4923
4925
|
const shouldLoad = isIntersecting && canLoad;
|
|
4924
4926
|
// handle intersection
|
|
4925
4927
|
React.useEffect(() => {
|
|
4926
|
-
if (shouldLoad && src !==
|
|
4927
|
-
setSrc(
|
|
4928
|
+
if (shouldLoad && src !== mediaSrc) {
|
|
4929
|
+
setSrc(mediaSrc);
|
|
4928
4930
|
}
|
|
4929
|
-
}, [shouldLoad, src,
|
|
4931
|
+
}, [shouldLoad, src, mediaSrc]);
|
|
4930
4932
|
const mounted = bomMixerHooks.useMounted();
|
|
4931
4933
|
const id = React.useId();
|
|
4932
4934
|
const {
|
|
@@ -4957,15 +4959,17 @@ const MediaVideo_ = _a => {
|
|
|
4957
4959
|
ref: videoRef,
|
|
4958
4960
|
id: id,
|
|
4959
4961
|
className: classNames,
|
|
4960
|
-
playsInline: true,
|
|
4961
4962
|
autoPlay: shouldPlay,
|
|
4962
4963
|
muted: true,
|
|
4963
|
-
loop: true
|
|
4964
|
-
|
|
4964
|
+
loop: true,
|
|
4965
|
+
playsInline: true
|
|
4966
|
+
}, props, mimeType ? {} : {
|
|
4967
|
+
src
|
|
4968
|
+
}, {
|
|
4965
4969
|
children: src && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4966
|
-
children: [jsxRuntime.jsx("source", {
|
|
4970
|
+
children: [mimeType && jsxRuntime.jsx("source", {
|
|
4967
4971
|
src: src,
|
|
4968
|
-
type:
|
|
4972
|
+
type: mimeType
|
|
4969
4973
|
}), locale && jsxRuntime.jsx("track", {
|
|
4970
4974
|
src: `/captions.vtt?locale=${locale}&title=${props.title}`,
|
|
4971
4975
|
kind: "captions",
|
|
@@ -5056,6 +5060,7 @@ function getMediaItemProps(mediaItem, options) {
|
|
|
5056
5060
|
title,
|
|
5057
5061
|
alt,
|
|
5058
5062
|
size: options.size,
|
|
5063
|
+
mimeType: media.mimeType,
|
|
5059
5064
|
onLoaded: mediaItem.onLoaded,
|
|
5060
5065
|
canLoad: mediaItem.canLoad
|
|
5061
5066
|
};
|