@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.mjs CHANGED
@@ -5642,9 +5642,9 @@ var BackgroundGradientColorControl = createControl(() => {
5642
5642
  return {
5643
5643
  type: type.value,
5644
5644
  angle: angle?.value || 0,
5645
- stops: stops.value.map(({ value: { color, offset } }) => ({
5645
+ stops: stops.value.map(({ value: { color, offset } }, index, arr) => ({
5646
5646
  color: color.value,
5647
- offset: offset.value
5647
+ offset: offset?.value ?? (arr.length > 1 ? index / (arr.length - 1) * 100 : 0)
5648
5648
  })),
5649
5649
  positions: positions?.value.split(" ")
5650
5650
  };
@@ -6111,7 +6111,9 @@ var getFileExtensionFromFilename = (filename) => {
6111
6111
  };
6112
6112
  var getGradientValue = (value) => {
6113
6113
  const gradient = value.value;
6114
- const stops = gradient.stops.value?.map(({ value: { color, offset } }) => `${color.value} ${offset.value ?? 0}%`)?.join(",");
6114
+ const stops = gradient.stops.value?.map(
6115
+ ({ value: { color, offset } }) => offset ? `${color.value} ${offset.value ?? 0}%` : `${color.value}`
6116
+ )?.join(",");
6115
6117
  if (gradient.type.value === "linear") {
6116
6118
  return `linear-gradient(${gradient.angle.value}deg, ${stops})`;
6117
6119
  }