@wix/editor-react-components 1.2907.0 → 1.2909.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.
@@ -15,7 +15,7 @@
15
15
  .item__EzhwB {
16
16
  display: inline-flex;
17
17
  align-items: center;
18
- column-gap: var(--gap, 4px);
18
+ column-gap: var(--gap);
19
19
  }
20
20
 
21
21
  .indicator__dzBy2 {
@@ -31,6 +31,9 @@ const manifest = {
31
31
  presetCssUrl: `./site/components/Checkbox/presets/${basePresetName}.css`,
32
32
  displayName: DisplayNames.root.presets.baseCheckbox,
33
33
  presetDefaults: {
34
+ cssCustomProperties: {
35
+ gap: { defaultValue: "0px" }
36
+ },
34
37
  elements: {
35
38
  indicator: {
36
39
  cssProperties: {
@@ -89,8 +92,7 @@ const manifest = {
89
92
  cssCustomProperties: {
90
93
  gap: {
91
94
  cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.columnGap,
92
- displayName: DisplayNames.root.cssCustomProperties.gap,
93
- defaultValue: "4px"
95
+ displayName: DisplayNames.root.cssCustomProperties.gap
94
96
  }
95
97
  },
96
98
  elements: {
@@ -53,15 +53,15 @@ function setVideoFocalPoint(videoNode, focalPoint) {
53
53
  videoNode.style.setProperty("--focal-x", focalX.toString());
54
54
  videoNode.style.setProperty("--focal-y", focalY.toString());
55
55
  }
56
- async function getVideoSource(width, height, uri, qualityPolicy, sources, adaptiveSources, duration, onError) {
56
+ async function getVideoSource(width, height, uri, qualityPolicy, sources, adaptiveSources, duration, onError, url) {
57
57
  const hasProgressiveSources = sources && sources.length > 0;
58
- const hasAbsoluteUri = uri && isAbsoluteUrl(uri);
58
+ const hasAbsoluteUrl = uri && isAbsoluteUrl(uri) || !uri && url;
59
59
  const shouldSkipAdaptiveShortVideo = duration && duration < 40;
60
60
  if (qualityPolicy === "adaptive" && adaptiveSources && adaptiveSources.length > 0 && !shouldSkipAdaptiveShortVideo) {
61
61
  const hlsSource = adaptiveSources.find((s) => s.format === "hls");
62
62
  const Hls = await import("./hls.js");
63
- if (hlsSource && Hls && Hls.default.isSupported()) {
64
- const videoSourceUrl = getCompleteUrl(hlsSource.uri, STATIC_ADAPTIVE_VIDEO_URL);
63
+ if (hlsSource && (hlsSource.url || hlsSource.uri) && Hls && Hls.default.isSupported()) {
64
+ const videoSourceUrl = hlsSource.uri ? getCompleteUrl(hlsSource.uri, STATIC_ADAPTIVE_VIDEO_URL) : hlsSource.url;
65
65
  const patchVideoSource = (videoNode) => {
66
66
  const hls = new Hls.default();
67
67
  hls.loadSource(videoSourceUrl);
@@ -103,10 +103,9 @@ Unrecoverable playback error`));
103
103
  if (hasProgressiveSources) {
104
104
  const highestQuality = sources[sources.length - 1];
105
105
  if (qualityPolicy === "highest") {
106
- var _highestQuality$types;
107
- const url = (_highestQuality$types = highestQuality.types.find((type) => type.format === "mp4")) == null ? void 0 : _highestQuality$types.uri;
108
- if (url) {
109
- const videoSourceUrl = getCompleteUrl(url, STATIC_VIDEO_URL);
106
+ const source = highestQuality.types.find((type) => type.format === "mp4");
107
+ if (source != null && source.url || source != null && source.uri) {
108
+ const videoSourceUrl = source.uri ? getCompleteUrl(source.uri, STATIC_VIDEO_URL) : source.url;
110
109
  return {
111
110
  videoSourceUrl,
112
111
  patchVideoSource: (videoNode) => {
@@ -116,15 +115,14 @@ Unrecoverable playback error`));
116
115
  };
117
116
  }
118
117
  } else {
119
- var _targetQuality$types$;
120
118
  const videoWidth = parseInt(highestQuality.width.toString(), 10);
121
119
  const videoHeight = parseInt(highestQuality.height.toString(), 10);
122
120
  const scaleFactor = getScaleFactor(width, height, videoWidth, videoHeight);
123
121
  const videoScaledDimensions = getVideoDimension(scaleFactor, videoWidth, videoHeight);
124
122
  const targetQuality = getVideoQualityBySize(sources, videoScaledDimensions);
125
- const url = (_targetQuality$types$ = targetQuality.types.find((type) => type.format === "mp4")) == null ? void 0 : _targetQuality$types$.uri;
126
- if (url) {
127
- const videoSourceUrl = getCompleteUrl(url, STATIC_VIDEO_URL);
123
+ const source = targetQuality.types.find((type) => type.format === "mp4");
124
+ if (source != null && source.url || source != null && source.uri) {
125
+ const videoSourceUrl = source.uri ? getCompleteUrl(source.uri, STATIC_VIDEO_URL) : source.url;
128
126
  return {
129
127
  videoSourceUrl,
130
128
  patchVideoSource: (videoNode) => {
@@ -135,11 +133,12 @@ Unrecoverable playback error`));
135
133
  }
136
134
  }
137
135
  }
138
- if (hasAbsoluteUri) {
136
+ if (hasAbsoluteUrl) {
137
+ const videoSourceUrl = uri || url;
139
138
  return {
140
- videoSourceUrl: uri,
139
+ videoSourceUrl,
141
140
  patchVideoSource: (videoNode) => {
142
- videoNode.src = uri;
141
+ videoNode.src = videoSourceUrl;
143
142
  videoNode.load();
144
143
  }
145
144
  };
@@ -192,11 +191,11 @@ const videoLayout = {
192
191
  * @param {(error: Error) => void} onError
193
192
  * @return {{currentSrc: string, videoSourceUrl: string}}
194
193
  */
195
- async measure(videoNode, container, quality, uri, sources, adaptiveSources, duration, onError) {
194
+ async measure(videoNode, container, quality, uri, sources, adaptiveSources, duration, onError, url) {
196
195
  const {
197
196
  videoSourceUrl,
198
197
  patchVideoSource
199
- } = await getVideoSource(container.offsetWidth, container.offsetHeight, uri, quality, sources, adaptiveSources, duration, onError);
198
+ } = await getVideoSource(container.offsetWidth, container.offsetHeight, uri, quality, sources, adaptiveSources, duration, onError, url);
200
199
  const needsSrcUpdate = shouldUpdateSrc(videoNode, videoSourceUrl);
201
200
  return {
202
201
  needsSrcUpdate,
@@ -317,6 +316,7 @@ function wowVideoFactory(services, contextWindow) {
317
316
  }
318
317
  const {
319
318
  uri,
319
+ url,
320
320
  sources,
321
321
  adaptiveSources,
322
322
  autoplay,
@@ -331,7 +331,7 @@ function wowVideoFactory(services, contextWindow) {
331
331
  const videoNode = this.querySelector("video");
332
332
  const poster = this.querySelector("img");
333
333
  services.mutationService.measure(async () => {
334
- const measures = await videoLayout.measure(videoNode, this, qualityPolicy, uri, sources, adaptiveSources, duration, (error) => this.dispatchVideoError(error));
334
+ const measures = await videoLayout.measure(videoNode, this, qualityPolicy, uri, sources, adaptiveSources, duration, (error) => this.dispatchVideoError(error), url);
335
335
  const {
336
336
  needsSrcUpdate,
337
337
  patchVideoSource
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/editor-react-components",
3
- "version": "1.2907.0",
3
+ "version": "1.2909.0",
4
4
  "description": "React components for the Wix Editor",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -155,7 +155,7 @@
155
155
  "@wix/sled-playwright": "^1.416.0",
156
156
  "@wix/thunderbolt-components-native": "^1.0.0",
157
157
  "@wix/unidriver-core": "^1.5.6",
158
- "@wix/video": "^1.116.0",
158
+ "@wix/video": "^1.118.0",
159
159
  "@wix/viewer-playwright-app": "^1.0.730",
160
160
  "@wix/viewer-service-anchors": "^1.0.56",
161
161
  "@wix/viewer-service-consent-policy": "^1.0.114",
@@ -226,5 +226,5 @@
226
226
  "registry": "https://registry.npmjs.org/",
227
227
  "access": "public"
228
228
  },
229
- "falconPackageHash": "48a819aebdae45afd622deac84b045f22dec870136bad6e4a6972c5a"
229
+ "falconPackageHash": "fa47c155e3ab4d3f7234ddc9d4a89d0cdbdb09c052a7a27f64e5f91a"
230
230
  }