@asante-org/atlascopco-vt-litesitegenerator 3.6.13 → 3.6.15

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/dist/index.esm.js CHANGED
@@ -148,37 +148,80 @@ var LsgImage = function (_a) {
148
148
  var imageUrl = _a.imageUrl,
149
149
  _b = _a.imageAlt,
150
150
  imageAlt = _b === void 0 ? "" : _b,
151
- _c = _a.tags,
152
- tags = _c === void 0 ? [] : _c,
151
+ srcset = _a.srcset,
152
+ _c = _a.sources,
153
+ sources = _c === void 0 ? [] : _c,
154
+ width = _a.width,
155
+ height = _a.height,
156
+ srcUriTemplate = _a.srcUriTemplate,
157
+ _d = _a.lazyEnabled,
158
+ lazyEnabled = _d === void 0 ? true : _d,
159
+ _e = _a.displayPopupTitle,
160
+ displayPopupTitle = _e === void 0 ? false : _e,
161
+ id = _a.id,
162
+ dataLayer = _a.dataLayer,
163
+ assetId = _a.assetId,
164
+ dmImage = _a.dmImage,
165
+ _f = _a.tags,
166
+ tags = _f === void 0 ? [] : _f,
153
167
  title = _a.title,
154
168
  description = _a.description,
155
169
  caption = _a.caption,
156
170
  href = _a.href,
157
- _d = _a.className,
158
- className = _d === void 0 ? "" : _d;
171
+ _g = _a.className,
172
+ className = _g === void 0 ? "" : _g;
173
+ // Core Image v3 renders nothing without a src; the AEM LSG model gates on the
174
+ // same condition via `model.ready`.
175
+ if (!imageUrl) {
176
+ return null;
177
+ }
159
178
  var text = description !== null && description !== void 0 ? description : caption;
160
179
  var visibleTags = Array.isArray(tags) ? tags.filter(function (tag) {
161
180
  return Boolean(tag) && typeof tag.label === "string" && tag.label.trim().length > 0;
162
181
  }).slice(0, 3) : [];
163
- var rootClass = ["lsg-image", className].filter(Boolean).join(" ");
182
+ var visibleSources = Array.isArray(sources) ? sources.filter(function (source) {
183
+ return Boolean(source) && typeof source.srcset === "string" && source.srcset.trim().length > 0;
184
+ }) : [];
185
+ var rootClass = ["lsg-image", "cmp-image", className].filter(Boolean).join(" ");
164
186
  var safeHref = href && isSafeUrl$1(href) ? href : undefined;
165
187
  var linkLabel = title ? "View ".concat(title) : "View image";
166
- var showCaption = Boolean(title) || Boolean(text);
188
+ var showTitle = Boolean(title) && !displayPopupTitle;
189
+ var showCaption = showTitle || Boolean(text);
167
190
  return /*#__PURE__*/React.createElement("div", {
168
- className: rootClass
191
+ className: rootClass,
192
+ id: id,
193
+ "data-cmp-data-layer": dataLayer,
194
+ "data-asset-id": assetId,
195
+ "data-cmp-dmimage": dmImage ? String(dmImage) : undefined,
196
+ itemScope: true,
197
+ itemType: "http://schema.org/ImageObject"
169
198
  }, /*#__PURE__*/React.createElement("div", {
170
199
  className: "lsg-image__media"
171
200
  }, /*#__PURE__*/React.createElement("div", {
172
201
  className: "lsg-image__picture"
173
- }, imageUrl && /*#__PURE__*/React.createElement("img", {
174
- className: "lsg-image__img",
202
+ }, /*#__PURE__*/React.createElement("picture", null, visibleSources.map(function (source, index) {
203
+ var _a;
204
+ return /*#__PURE__*/React.createElement("source", {
205
+ key: "".concat((_a = source.media) !== null && _a !== void 0 ? _a : "default", "-").concat(index),
206
+ media: source.media,
207
+ srcSet: source.srcset
208
+ });
209
+ }), /*#__PURE__*/React.createElement("img", {
210
+ className: "lsg-image__img cmp-image__image",
175
211
  src: imageUrl,
212
+ srcSet: visibleSources.length > 0 ? undefined : srcset,
176
213
  alt: imageAlt,
177
- loading: "lazy"
178
- })), safeHref && /*#__PURE__*/React.createElement("a", {
179
- className: "lsg-image__link",
214
+ title: displayPopupTitle ? title : undefined,
215
+ width: width,
216
+ height: height,
217
+ "data-cmp-src": srcUriTemplate,
218
+ itemProp: "contentUrl",
219
+ loading: lazyEnabled ? "lazy" : undefined
220
+ }))), safeHref && /*#__PURE__*/React.createElement("a", {
221
+ className: "lsg-image__link cmp-image__link",
180
222
  href: safeHref,
181
- "aria-label": linkLabel
223
+ "aria-label": linkLabel,
224
+ "data-cmp-clickable": dataLayer ? true : undefined
182
225
  }), visibleTags.length > 0 && /*#__PURE__*/React.createElement("div", {
183
226
  className: "lsg-image__tags"
184
227
  }, visibleTags.map(function (tag, index) {
@@ -188,11 +231,15 @@ var LsgImage = function (_a) {
188
231
  }, tag.label);
189
232
  }))), showCaption && /*#__PURE__*/React.createElement("div", {
190
233
  className: "lsg-image__caption"
191
- }, title && /*#__PURE__*/React.createElement("p", {
192
- className: "lsg-image__title"
234
+ }, showTitle && /*#__PURE__*/React.createElement("p", {
235
+ className: "lsg-image__title cmp-image__title",
236
+ itemProp: "caption"
193
237
  }, title), text && /*#__PURE__*/React.createElement("p", {
194
238
  className: "lsg-image__text"
195
- }, text)));
239
+ }, text)), title && displayPopupTitle && /*#__PURE__*/React.createElement("meta", {
240
+ itemProp: "caption",
241
+ content: title
242
+ }));
196
243
  };
197
244
 
198
245
  function buildUrl(base, params) {
@@ -2592,10 +2639,16 @@ var LsgNavigation = function (_a) {
2592
2639
  className: "lsg-nav__chevron",
2593
2640
  "aria-hidden": "true"
2594
2641
  }, /*#__PURE__*/React.createElement("svg", {
2595
- viewBox: "0 0 640 640",
2642
+ viewBox: "0 0 10 5",
2643
+ preserveAspectRatio: "xMidYMid meet",
2596
2644
  focusable: "false"
2597
2645
  }, /*#__PURE__*/React.createElement("path", {
2598
- d: "M471.1 297.4C483.6 309.9 483.6 330.2 471.1 342.7L279.1 534.7C266.6 547.2 246.3 547.2 233.8 534.7C221.3 522.2 221.3 501.9 233.8 489.4L403.2 320L233.9 150.6C221.4 138.1 221.4 117.8 233.9 105.3C246.4 92.8 266.7 92.8 279.2 105.3L471.2 297.3z"
2646
+ d: "M1 0.5L5 4.5L9 0.5",
2647
+ fill: "none",
2648
+ stroke: "currentColor",
2649
+ strokeWidth: "1.2",
2650
+ strokeLinecap: "round",
2651
+ strokeLinejoin: "round"
2599
2652
  })))), hasChildren && renderItems(item.children || [], level + 1));
2600
2653
  }));
2601
2654
  };