@wix/editor-react-components 1.2617.0 → 1.2618.0

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.
@@ -13,6 +13,7 @@ export type Image3Props = {
13
13
  displayMode?: 'fill' | 'fit' | 'fitWidth';
14
14
  image?: {
15
15
  uri?: string;
16
+ url?: string;
16
17
  name?: string;
17
18
  width?: number;
18
19
  height?: number;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { c as clsx } from "../chunks/clsx.js";
3
- import { a as getDataAttributes, n as normalizeWixUri } from "../chunks/dataUtils.js";
3
+ import { a as getDataAttributes, c as getExternalImageUrl, n as normalizeWixUri } from "../chunks/dataUtils.js";
4
4
  import { e as getTabIndexAttribute } from "../chunks/a11y.js";
5
5
  import { L as Link } from "../chunks/Link.js";
6
6
  import * as React from "react";
@@ -141,18 +141,46 @@ const Image3 = (props) => {
141
141
  dataset: { motionPart: `BG_IMG ${id}` },
142
142
  sources
143
143
  };
144
- image2.uri = normalizeWixUri(image2.uri ?? "");
145
- const seoImageUrl = renderingContext.SEO && image2.uri ? getPlaceholder(
144
+ const externalImageUrl = getExternalImageUrl(image2.uri, image2.url);
145
+ const normalizedUri = !externalImageUrl && image2.uri ? normalizeWixUri(image2.uri) : "";
146
+ const seoImageUrl = renderingContext.SEO && normalizedUri ? getPlaceholder(
146
147
  "fill",
147
- { ...image2, id: image2.uri },
148
+ {
149
+ ...image2,
150
+ id: normalizedUri,
151
+ uri: normalizedUri
152
+ },
148
153
  { alignment: "center", htmlTag: "img" },
149
154
  { hasAnimation: image2.animated, isSEOBot: true }
150
155
  ).uri : void 0;
156
+ const imgProps = {
157
+ loading: priority === "low" ? "lazy" : void 0,
158
+ fetchpriority: priority === "high" ? "high" : void 0,
159
+ ...role && { role }
160
+ };
151
161
  let InnerImg;
152
162
  if (sources && sources.length) {
153
163
  InnerImg = /* @__PURE__ */ jsx(ImageNG, { ...imageNGProps });
154
- } else {
155
- InnerImg = image2.uri ? /* @__PURE__ */ jsx(
164
+ } else if (externalImageUrl) {
165
+ InnerImg = /* @__PURE__ */ jsx(
166
+ "div",
167
+ {
168
+ id: `img-${id}`,
169
+ "data-motion-part": `BG_IMG ${id}`,
170
+ className: style.wowImage,
171
+ children: /* @__PURE__ */ jsx("picture", { children: /* @__PURE__ */ jsx(
172
+ "img",
173
+ {
174
+ ...imgProps,
175
+ alt: image2.alt ?? "",
176
+ src: externalImageUrl,
177
+ style: { objectFit: displayMode === "fit" ? "contain" : "cover" }
178
+ }
179
+ ) })
180
+ }
181
+ );
182
+ } else if (normalizedUri) {
183
+ InnerImg = /* @__PURE__ */ jsx(
156
184
  "wow-image",
157
185
  {
158
186
  id: `img-${id}`,
@@ -161,22 +189,22 @@ const Image3 = (props) => {
161
189
  containerId: id,
162
190
  encoding: "AVIF",
163
191
  hasAnimation: image2.animated,
164
- imageData: { ...image2, displayMode }
192
+ imageData: { ...image2, uri: normalizedUri, displayMode }
165
193
  }),
166
194
  "data-motion-part": `BG_IMG ${id}`,
167
195
  class: style.wowImage,
168
196
  children: /* @__PURE__ */ jsx("picture", { children: /* @__PURE__ */ jsx(
169
197
  "img",
170
198
  {
171
- loading: priority === "low" ? "lazy" : void 0,
172
- fetchpriority: priority === "high" ? "high" : void 0,
199
+ ...imgProps,
173
200
  alt: image2.alt ?? "",
174
- src: renderingContext.SEO ? `${STATIC_MEDIA_URL$1}${seoImageUrl}` : void 0,
175
- ...role && { role }
201
+ src: renderingContext.SEO ? `${STATIC_MEDIA_URL$1}${seoImageUrl}` : void 0
176
202
  }
177
203
  ) })
178
204
  }
179
- ) : /* @__PURE__ */ jsx("svg", { width: "1", height: "1", viewBox: "0 0 1 1" });
205
+ );
206
+ } else {
207
+ InnerImg = /* @__PURE__ */ jsx("svg", { width: "1", height: "1", viewBox: "0 0 1 1" });
180
208
  }
181
209
  const InnerLayout = /* @__PURE__ */ jsx(
182
210
  "div",
@@ -57,6 +57,10 @@
57
57
  mask-repeat: no-repeat;
58
58
  mask-image: var(--maskImage, none);
59
59
  }
60
+ .image3__6ufCe .wowImage__1yncg img {
61
+ inline-size: 100%;
62
+ block-size: 100%;
63
+ }
60
64
 
61
65
  .linkLayer__hoVt- {
62
66
  display: block;
@@ -142,6 +142,10 @@
142
142
  mask-repeat: no-repeat;
143
143
  mask-image: var(--maskImage, none);
144
144
  }
145
+ .image3__6ufCe .wowImage__1yncg img {
146
+ inline-size: 100%;
147
+ block-size: 100%;
148
+ }
145
149
 
146
150
  .linkLayer__hoVt- {
147
151
  display: block;
@@ -128,6 +128,16 @@ export declare const slideshowCssPropertiesDefaults: {
128
128
  readonly borderRadius: "0";
129
129
  readonly boxShadow: "none";
130
130
  };
131
+ export declare const iconPlacementAxis: {
132
+ readonly 'next-to-text': "row";
133
+ readonly 'above-text': "column";
134
+ readonly 'below-text': "column";
135
+ readonly 'vertically-stacked': "column";
136
+ readonly 'before-text': "row";
137
+ readonly 'after-text': "row";
138
+ };
139
+ export type IconPlacement = keyof typeof iconPlacementAxis;
140
+ export declare const navigationButtonGapFields: readonly ["rowGap", "columnGap"];
131
141
  export declare const slideshowCssCustomPropertiesDefaults: {
132
142
  readonly 'animation-duration': "0.5s";
133
143
  readonly orientation: "horizontal";
@@ -30,9 +30,19 @@ const normalizeWixUri = (uri) => {
30
30
  }
31
31
  return withoutHash.replace(/^wix:\/\/v1\//, "").replace(/\/.*$/, "");
32
32
  };
33
+ const getExternalImageUrl = (uri, url) => {
34
+ if (uri && /^https?:\/\//i.test(uri)) {
35
+ return uri;
36
+ }
37
+ if (!uri && url && /^https?:\/\//i.test(url)) {
38
+ return url;
39
+ }
40
+ return void 0;
41
+ };
33
42
  export {
34
43
  getDataAttributes as a,
35
44
  getUniqueId as b,
45
+ getExternalImageUrl as c,
36
46
  getQaDataAttributes as g,
37
47
  isEmptyObject as i,
38
48
  normalizeWixUri as n
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/editor-react-components",
3
- "version": "1.2617.0",
3
+ "version": "1.2618.0",
4
4
  "description": "React components for the Wix Editor",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -198,5 +198,5 @@
198
198
  "registry": "https://registry.npmjs.org/",
199
199
  "access": "public"
200
200
  },
201
- "falconPackageHash": "43052776f6ccf8f7fe05c6a510ff3aa7deecc80ad853f7c75c1190fd"
201
+ "falconPackageHash": "2b07aec047b3714ee2e2901cd11669e1cf689f95fc3f842553784405"
202
202
  }