@websolutespa/bom-mixer-ui 1.9.16 → 1.9.17
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 +40 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/media/media-image.js +2 -1
- package/dist/esm/components/media/media-image.js.map +1 -1
- package/dist/esm/components/media/media-items.js +3 -2
- package/dist/esm/components/media/media-items.js.map +1 -1
- package/dist/esm/components/media/media.js +3 -1
- package/dist/esm/components/media/media.js.map +1 -1
- package/dist/esm/components/meta/meta.js +35 -6
- package/dist/esm/components/meta/meta.js.map +1 -1
- package/dist/types/components/media/media-image.d.ts.map +1 -1
- package/dist/types/components/media/media-items.d.ts +2 -0
- package/dist/types/components/media/media-items.d.ts.map +1 -1
- package/dist/types/components/media/media.d.ts +1 -0
- package/dist/types/components/media/media.d.ts.map +1 -1
- package/dist/types/components/meta/meta.d.ts.map +1 -1
- package/dist/types/forms/radio-card/radio-card-base.d.ts +1 -0
- package/dist/types/forms/radio-card/radio-card-base.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/media/media-image.tsx +1 -0
- package/src/components/media/media-items.tsx +5 -2
- package/src/components/media/media.tsx +3 -0
- package/src/components/meta/meta.tsx +32 -4
package/CHANGELOG.md
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -4842,7 +4842,8 @@ const MediaImage_ = _a => {
|
|
|
4842
4842
|
}, canLoad ? imageProps : undefined, {
|
|
4843
4843
|
className: classNames,
|
|
4844
4844
|
loading: loading,
|
|
4845
|
-
draggable: false
|
|
4845
|
+
draggable: false,
|
|
4846
|
+
"aria-hidden": !props.informative
|
|
4846
4847
|
}));
|
|
4847
4848
|
};
|
|
4848
4849
|
const MediaImage = /*#__PURE__*/React.memo(MediaImage_);
|
|
@@ -5052,8 +5053,8 @@ function getMediaItemProps(mediaItem, options) {
|
|
|
5052
5053
|
const media = __rest(mediaItem, ["width", "height", "sizes"]);
|
|
5053
5054
|
const title = media.title || options.title;
|
|
5054
5055
|
// console.log('getMediaItemProps', media.alt, options.alt);
|
|
5055
|
-
|
|
5056
|
-
const alt = options.alt || '';
|
|
5056
|
+
const alt = media.alt || options.alt;
|
|
5057
|
+
// const alt: string = (options.alt || '');
|
|
5057
5058
|
const src = media.src || media.url || '';
|
|
5058
5059
|
const mediaItemProps = {
|
|
5059
5060
|
src,
|
|
@@ -5088,6 +5089,7 @@ function getMediaItemProps(mediaItem, options) {
|
|
|
5088
5089
|
mediaItemProps.aspectRatioMd = options.aspectRatioMd;
|
|
5089
5090
|
mediaItemProps.aspectRatioLg = options.aspectRatioLg;
|
|
5090
5091
|
mediaItemProps.aspectRatioXl = options.aspectRatioXl;
|
|
5092
|
+
mediaItemProps.informative = options.informative;
|
|
5091
5093
|
if (options.eager) {
|
|
5092
5094
|
mediaItemProps.loading = 'eager';
|
|
5093
5095
|
}
|
|
@@ -5214,12 +5216,13 @@ const MediaBase = /*#__PURE__*/React.forwardRef((_a, ref) => {
|
|
|
5214
5216
|
eager,
|
|
5215
5217
|
alt,
|
|
5216
5218
|
title,
|
|
5219
|
+
informative,
|
|
5217
5220
|
onClick,
|
|
5218
5221
|
onLoaded,
|
|
5219
5222
|
canLoad,
|
|
5220
5223
|
as = 'div'
|
|
5221
5224
|
} = _a,
|
|
5222
|
-
props = __rest(_a, ["children", "item", "className", "width", "height", "size", "eager", "alt", "title", "onClick", "onLoaded", "canLoad", "as"]);
|
|
5225
|
+
props = __rest(_a, ["children", "item", "className", "width", "height", "size", "eager", "alt", "title", "informative", "onClick", "onLoaded", "canLoad", "as"]);
|
|
5223
5226
|
const {
|
|
5224
5227
|
id,
|
|
5225
5228
|
open
|
|
@@ -5254,6 +5257,7 @@ const MediaBase = /*#__PURE__*/React.forwardRef((_a, ref) => {
|
|
|
5254
5257
|
eager,
|
|
5255
5258
|
alt,
|
|
5256
5259
|
title,
|
|
5260
|
+
informative,
|
|
5257
5261
|
open,
|
|
5258
5262
|
onLoaded,
|
|
5259
5263
|
canLoad
|
|
@@ -6142,8 +6146,36 @@ function Meta(_a) {
|
|
|
6142
6146
|
brand
|
|
6143
6147
|
} = _a,
|
|
6144
6148
|
props = __rest(_a, ["children", "structuredDataCollections", "brand"]);
|
|
6149
|
+
const layout = bomMixerHooks.useLayout();
|
|
6145
6150
|
const page = bomMixerHooks.usePage();
|
|
6146
6151
|
const extra = bomMixerHooks.useExtra();
|
|
6152
|
+
// alternates
|
|
6153
|
+
const alternates = React.useMemo(() => {
|
|
6154
|
+
const alternates = [];
|
|
6155
|
+
page.alternates.forEach(alternate => {
|
|
6156
|
+
const market = layout.markets.find(x => x.id === alternate.market);
|
|
6157
|
+
if (market) {
|
|
6158
|
+
if (market.countries && market.countries.length > 0) {
|
|
6159
|
+
market.countries.forEach(country => {
|
|
6160
|
+
// country: string | { alpha2Code: string };
|
|
6161
|
+
const alpha2Code = typeof country === 'string' ? country : country.alpha2Code;
|
|
6162
|
+
alternates.push({
|
|
6163
|
+
id: `${alternate.market}-${alternate.locale}-${alpha2Code}`,
|
|
6164
|
+
href: bomMixerModels.resolveHref(alternate.id),
|
|
6165
|
+
hrefLang: `${alternate.locale}-${alpha2Code}`
|
|
6166
|
+
});
|
|
6167
|
+
});
|
|
6168
|
+
} else {
|
|
6169
|
+
alternates.push({
|
|
6170
|
+
id: `${alternate.market}-${alternate.locale}`,
|
|
6171
|
+
href: bomMixerModels.resolveHref(alternate.id),
|
|
6172
|
+
hrefLang: alternate.locale
|
|
6173
|
+
});
|
|
6174
|
+
}
|
|
6175
|
+
}
|
|
6176
|
+
});
|
|
6177
|
+
return alternates;
|
|
6178
|
+
}, [layout, page]);
|
|
6147
6179
|
// title
|
|
6148
6180
|
let title = ((_b = page.meta) === null || _b === void 0 ? void 0 : _b.title) || page.title;
|
|
6149
6181
|
// description
|
|
@@ -6211,11 +6243,11 @@ function Meta(_a) {
|
|
|
6211
6243
|
}), relNext && jsxRuntime.jsx("link", {
|
|
6212
6244
|
rel: "next",
|
|
6213
6245
|
href: bomMixerModels.resolveHref(relNext)
|
|
6214
|
-
}),
|
|
6246
|
+
}), alternates.map(alternate => jsxRuntime.jsx("link", {
|
|
6215
6247
|
rel: "alternate",
|
|
6216
|
-
href:
|
|
6217
|
-
hrefLang: alternate.
|
|
6218
|
-
},
|
|
6248
|
+
href: alternate.href,
|
|
6249
|
+
hrefLang: alternate.hrefLang
|
|
6250
|
+
}, alternate.id)), image && jsxRuntime.jsx("meta", {
|
|
6219
6251
|
property: "og:image",
|
|
6220
6252
|
content: bomMixerModels.resolveHref(image)
|
|
6221
6253
|
}), false , structuredData && jsxRuntime.jsx("script", {
|