@elementor/editor-controls 4.3.0-1012 → 4.3.0-1013

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.js CHANGED
@@ -5682,9 +5682,9 @@ var BackgroundGradientColorControl = createControl(() => {
5682
5682
  return {
5683
5683
  type: type.value,
5684
5684
  angle: angle?.value || 0,
5685
- stops: stops.value.map(({ value: { color, offset } }) => ({
5685
+ stops: stops.value.map(({ value: { color, offset } }, index, arr) => ({
5686
5686
  color: color.value,
5687
- offset: offset.value
5687
+ offset: offset?.value ?? (arr.length > 1 ? index / (arr.length - 1) * 100 : 0)
5688
5688
  })),
5689
5689
  positions: positions?.value.split(" ")
5690
5690
  };
@@ -6140,7 +6140,9 @@ var getFileExtensionFromFilename = (filename) => {
6140
6140
  };
6141
6141
  var getGradientValue = (value) => {
6142
6142
  const gradient = value.value;
6143
- const stops = gradient.stops.value?.map(({ value: { color, offset } }) => `${color.value} ${offset.value ?? 0}%`)?.join(",");
6143
+ const stops = gradient.stops.value?.map(
6144
+ ({ value: { color, offset } }) => offset ? `${color.value} ${offset.value ?? 0}%` : `${color.value}`
6145
+ )?.join(",");
6144
6146
  if (gradient.type.value === "linear") {
6145
6147
  return `linear-gradient(${gradient.angle.value}deg, ${stops})`;
6146
6148
  }