@elementor/editor-editing-panel 1.11.0 → 1.11.1

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
@@ -1022,7 +1022,7 @@ var BackgroundSection = () => {
1022
1022
  };
1023
1023
 
1024
1024
  // src/components/style-sections/border-section/border-section.tsx
1025
- import * as React24 from "react";
1025
+ import * as React25 from "react";
1026
1026
  import { Divider as Divider3, Stack as Stack6 } from "@elementor/ui";
1027
1027
 
1028
1028
  // src/components/style-sections/border-section/border-field.tsx
@@ -1153,7 +1153,7 @@ var BorderField = () => {
1153
1153
  };
1154
1154
 
1155
1155
  // src/components/style-sections/border-section/border-radius-field.tsx
1156
- import * as React23 from "react";
1156
+ import * as React24 from "react";
1157
1157
  import { EqualUnequalSizesControl as EqualUnequalSizesControl2 } from "@elementor/editor-controls";
1158
1158
  import { borderRadiusPropTypeUtil } from "@elementor/editor-props";
1159
1159
  import {
@@ -1163,50 +1163,103 @@ import {
1163
1163
  RadiusTopLeftIcon,
1164
1164
  RadiusTopRightIcon
1165
1165
  } from "@elementor/icons";
1166
+ import { withDirection } from "@elementor/ui";
1166
1167
  import { __ as __9 } from "@wordpress/i18n";
1167
- var corners = [
1168
+
1169
+ // src/hooks/use-direction.ts
1170
+ import { useTheme } from "@elementor/ui";
1171
+ function useDirection() {
1172
+ const theme = useTheme(), extendedWindow = window;
1173
+ const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!extendedWindow.elementorFrontend?.config?.is_rtl;
1174
+ return { isSiteRtl, isUiRtl };
1175
+ }
1176
+
1177
+ // src/components/style-sections/layout-section/utils/rotated-icon.tsx
1178
+ import * as React23 from "react";
1179
+ import { useRef } from "react";
1180
+ import { useTheme as useTheme2 } from "@elementor/ui";
1181
+ var CLOCKWISE_ANGLES = {
1182
+ row: 0,
1183
+ column: 90,
1184
+ "row-reverse": 180,
1185
+ "column-reverse": 270
1186
+ };
1187
+ var COUNTER_CLOCKWISE_ANGLES = {
1188
+ row: 0,
1189
+ column: -90,
1190
+ "row-reverse": -180,
1191
+ "column-reverse": -270
1192
+ };
1193
+ var RotatedIcon = ({ icon: Icon, size, isClockwise = true, offset = 0 }) => {
1194
+ const rotate = useRef(useGetTargetAngle(isClockwise, offset));
1195
+ rotate.current = useGetTargetAngle(isClockwise, offset, rotate);
1196
+ return /* @__PURE__ */ React23.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
1197
+ };
1198
+ var useGetTargetAngle = (isClockwise, offset, existingRef) => {
1199
+ const [direction] = useStylesField("flex-direction");
1200
+ const isRtl = "rtl" === useTheme2().direction;
1201
+ const rotationMultiplier = isRtl ? -1 : 1;
1202
+ const angleMap = isClockwise ? CLOCKWISE_ANGLES : COUNTER_CLOCKWISE_ANGLES;
1203
+ const currentAngle = existingRef ? existingRef.current * rotationMultiplier : angleMap[direction?.value || "row"] + offset;
1204
+ const targetAngle = angleMap[direction?.value || "row"] + offset;
1205
+ const diffToTargetAngle = (targetAngle - currentAngle + 360) % 360;
1206
+ const formattedDiff = (diffToTargetAngle + 180) % 360 - 180;
1207
+ return (currentAngle + formattedDiff) * rotationMultiplier;
1208
+ };
1209
+
1210
+ // src/components/style-sections/border-section/border-radius-field.tsx
1211
+ var StartStartIcon = withDirection(RadiusTopLeftIcon);
1212
+ var StartEndIcon = withDirection(RadiusTopRightIcon);
1213
+ var EndStartIcon = withDirection(RadiusBottomLeftIcon);
1214
+ var EndEndIcon = withDirection(RadiusBottomRightIcon);
1215
+ var getStartStartLabel = (isSiteRtl) => isSiteRtl ? __9("Top Right", "elementor") : __9("Top Left", "elementor");
1216
+ var getStartEndLabel = (isSiteRtl) => isSiteRtl ? __9("Top Left", "elementor") : __9("Top Right", "elementor");
1217
+ var getEndStartLabel = (isSiteRtl) => isSiteRtl ? __9("Bottom Right", "elementor") : __9("Bottom Left", "elementor");
1218
+ var getEndEndLabel = (isSiteRtl) => isSiteRtl ? __9("Bottom Left", "elementor") : __9("Bottom Right", "elementor");
1219
+ var getCorners = (isSiteRtl) => [
1168
1220
  {
1169
- label: __9("Top Left", "elementor"),
1170
- icon: /* @__PURE__ */ React23.createElement(RadiusTopLeftIcon, { fontSize: "tiny" }),
1171
- bind: "top-left"
1221
+ label: getStartStartLabel(isSiteRtl),
1222
+ icon: /* @__PURE__ */ React24.createElement(RotatedIcon, { icon: StartStartIcon, size: "tiny" }),
1223
+ bind: "start-start"
1172
1224
  },
1173
1225
  {
1174
- label: __9("Top Right", "elementor"),
1175
- icon: /* @__PURE__ */ React23.createElement(RadiusTopRightIcon, { fontSize: "tiny" }),
1176
- bind: "top-right"
1226
+ label: getStartEndLabel(isSiteRtl),
1227
+ icon: /* @__PURE__ */ React24.createElement(RotatedIcon, { icon: StartEndIcon, size: "tiny" }),
1228
+ bind: "start-end"
1177
1229
  },
1178
1230
  {
1179
- label: __9("Bottom Right", "elementor"),
1180
- icon: /* @__PURE__ */ React23.createElement(RadiusBottomRightIcon, { fontSize: "tiny" }),
1181
- bind: "bottom-right"
1231
+ label: getEndEndLabel(isSiteRtl),
1232
+ icon: /* @__PURE__ */ React24.createElement(RotatedIcon, { icon: EndEndIcon, size: "tiny" }),
1233
+ bind: "end-end"
1182
1234
  },
1183
1235
  {
1184
- label: __9("Bottom Left", "elementor"),
1185
- icon: /* @__PURE__ */ React23.createElement(RadiusBottomLeftIcon, { fontSize: "tiny" }),
1186
- bind: "bottom-left"
1236
+ label: getEndStartLabel(isSiteRtl),
1237
+ icon: /* @__PURE__ */ React24.createElement(RotatedIcon, { icon: EndStartIcon, size: "tiny" }),
1238
+ bind: "end-start"
1187
1239
  }
1188
1240
  ];
1189
1241
  var BorderRadiusField = () => {
1190
- return /* @__PURE__ */ React23.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React23.createElement(
1242
+ const { isSiteRtl } = useDirection();
1243
+ return /* @__PURE__ */ React24.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React24.createElement(
1191
1244
  EqualUnequalSizesControl2,
1192
1245
  {
1193
- items: corners,
1246
+ items: getCorners(isSiteRtl),
1194
1247
  label: __9("Border Radius", "elementor"),
1195
- icon: /* @__PURE__ */ React23.createElement(BorderCornersIcon, { fontSize: "tiny" }),
1248
+ icon: /* @__PURE__ */ React24.createElement(BorderCornersIcon, { fontSize: "tiny" }),
1196
1249
  multiSizePropTypeUtil: borderRadiusPropTypeUtil
1197
1250
  }
1198
1251
  ));
1199
1252
  };
1200
1253
 
1201
1254
  // src/components/style-sections/border-section/border-section.tsx
1202
- var BorderSection = () => /* @__PURE__ */ React24.createElement(Stack6, { gap: 1.5 }, /* @__PURE__ */ React24.createElement(BorderRadiusField, null), /* @__PURE__ */ React24.createElement(Divider3, null), /* @__PURE__ */ React24.createElement(BorderField, null));
1255
+ var BorderSection = () => /* @__PURE__ */ React25.createElement(Stack6, { gap: 1.5 }, /* @__PURE__ */ React25.createElement(BorderRadiusField, null), /* @__PURE__ */ React25.createElement(Divider3, null), /* @__PURE__ */ React25.createElement(BorderField, null));
1203
1256
 
1204
1257
  // src/components/style-sections/effects-section/effects-section.tsx
1205
- import * as React25 from "react";
1258
+ import * as React26 from "react";
1206
1259
  import { BoxShadowRepeaterControl } from "@elementor/editor-controls";
1207
1260
  import { Stack as Stack7 } from "@elementor/ui";
1208
1261
  var EffectsSection = () => {
1209
- return /* @__PURE__ */ React25.createElement(Stack7, { gap: 1.5 }, /* @__PURE__ */ React25.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React25.createElement(BoxShadowRepeaterControl, null)));
1262
+ return /* @__PURE__ */ React26.createElement(Stack7, { gap: 1.5 }, /* @__PURE__ */ React26.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React26.createElement(BoxShadowRepeaterControl, null)));
1210
1263
  };
1211
1264
 
1212
1265
  // src/components/style-sections/layout-section/layout-section.tsx
@@ -1250,53 +1303,10 @@ import {
1250
1303
  LayoutAlignRightIcon,
1251
1304
  LayoutDistributeVerticalIcon as JustifyIcon
1252
1305
  } from "@elementor/icons";
1253
- import { DirectionProvider, Grid as Grid3, ThemeProvider, withDirection } from "@elementor/ui";
1306
+ import { DirectionProvider, Grid as Grid3, ThemeProvider, withDirection as withDirection2 } from "@elementor/ui";
1254
1307
  import { __ as __10 } from "@wordpress/i18n";
1255
-
1256
- // src/hooks/use-direction.ts
1257
- import { useTheme } from "@elementor/ui";
1258
- function useDirection() {
1259
- const theme = useTheme(), extendedWindow = window;
1260
- const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!extendedWindow.elementorFrontend?.config?.is_rtl;
1261
- return { isSiteRtl, isUiRtl };
1262
- }
1263
-
1264
- // src/components/style-sections/layout-section/utils/rotated-icon.tsx
1265
- import * as React26 from "react";
1266
- import { useRef } from "react";
1267
- import { useTheme as useTheme2 } from "@elementor/ui";
1268
- var CLOCKWISE_ANGLES = {
1269
- row: 0,
1270
- column: 90,
1271
- "row-reverse": 180,
1272
- "column-reverse": 270
1273
- };
1274
- var COUNTER_CLOCKWISE_ANGLES = {
1275
- row: 0,
1276
- column: -90,
1277
- "row-reverse": -180,
1278
- "column-reverse": -270
1279
- };
1280
- var RotatedIcon = ({ icon: Icon, size, isClockwise = true, offset = 0 }) => {
1281
- const rotate = useRef(useGetTargetAngle(isClockwise, offset));
1282
- rotate.current = useGetTargetAngle(isClockwise, offset, rotate);
1283
- return /* @__PURE__ */ React26.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
1284
- };
1285
- var useGetTargetAngle = (isClockwise, offset, existingRef) => {
1286
- const [direction] = useStylesField("flex-direction");
1287
- const isRtl = "rtl" === useTheme2().direction;
1288
- const rotationMultiplier = isRtl ? -1 : 1;
1289
- const angleMap = isClockwise ? CLOCKWISE_ANGLES : COUNTER_CLOCKWISE_ANGLES;
1290
- const currentAngle = existingRef ? existingRef.current * rotationMultiplier : angleMap[direction?.value || "row"] + offset;
1291
- const targetAngle = angleMap[direction?.value || "row"] + offset;
1292
- const diffToTargetAngle = (targetAngle - currentAngle + 360) % 360;
1293
- const formattedDiff = (diffToTargetAngle + 180) % 360 - 180;
1294
- return (currentAngle + formattedDiff) * rotationMultiplier;
1295
- };
1296
-
1297
- // src/components/style-sections/layout-section/align-items-field.tsx
1298
- var StartIcon = withDirection(LayoutAlignLeftIcon);
1299
- var EndIcon = withDirection(LayoutAlignRightIcon);
1308
+ var StartIcon = withDirection2(LayoutAlignLeftIcon);
1309
+ var EndIcon = withDirection2(LayoutAlignRightIcon);
1300
1310
  var iconProps = {
1301
1311
  isClockwise: false,
1302
1312
  offset: 90
@@ -1341,10 +1351,10 @@ import {
1341
1351
  LayoutAlignRightIcon as LayoutAlignRightIcon2,
1342
1352
  LayoutDistributeVerticalIcon as JustifyIcon2
1343
1353
  } from "@elementor/icons";
1344
- import { DirectionProvider as DirectionProvider2, Grid as Grid4, ThemeProvider as ThemeProvider2, withDirection as withDirection2 } from "@elementor/ui";
1354
+ import { DirectionProvider as DirectionProvider2, Grid as Grid4, ThemeProvider as ThemeProvider2, withDirection as withDirection3 } from "@elementor/ui";
1345
1355
  import { __ as __11 } from "@wordpress/i18n";
1346
- var StartIcon2 = withDirection2(LayoutAlignLeftIcon2);
1347
- var EndIcon2 = withDirection2(LayoutAlignRightIcon2);
1356
+ var StartIcon2 = withDirection3(LayoutAlignLeftIcon2);
1357
+ var EndIcon2 = withDirection3(LayoutAlignRightIcon2);
1348
1358
  var iconProps2 = {
1349
1359
  isClockwise: false,
1350
1360
  offset: 90
@@ -1413,14 +1423,14 @@ var DisplayField = () => {
1413
1423
  import * as React30 from "react";
1414
1424
  import { ControlLabel as ControlLabel8, ToggleControl as ToggleControl4 } from "@elementor/editor-controls";
1415
1425
  import { ArrowDownSmallIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpSmallIcon } from "@elementor/icons";
1416
- import { DirectionProvider as DirectionProvider3, Grid as Grid5, ThemeProvider as ThemeProvider3, withDirection as withDirection3 } from "@elementor/ui";
1426
+ import { DirectionProvider as DirectionProvider3, Grid as Grid5, ThemeProvider as ThemeProvider3, withDirection as withDirection4 } from "@elementor/ui";
1417
1427
  import { __ as __13 } from "@wordpress/i18n";
1418
1428
  var options3 = [
1419
1429
  {
1420
1430
  value: "row",
1421
1431
  label: __13("Row", "elementor"),
1422
1432
  renderContent: ({ size }) => {
1423
- const StartIcon5 = withDirection3(ArrowRightIcon);
1433
+ const StartIcon5 = withDirection4(ArrowRightIcon);
1424
1434
  return /* @__PURE__ */ React30.createElement(StartIcon5, { fontSize: size });
1425
1435
  },
1426
1436
  showTooltip: true
@@ -1435,7 +1445,7 @@ var options3 = [
1435
1445
  value: "row-reverse",
1436
1446
  label: __13("Reversed row", "elementor"),
1437
1447
  renderContent: ({ size }) => {
1438
- const EndIcon5 = withDirection3(ArrowLeftIcon);
1448
+ const EndIcon5 = withDirection4(ArrowLeftIcon);
1439
1449
  return /* @__PURE__ */ React30.createElement(EndIcon5, { fontSize: size });
1440
1450
  },
1441
1451
  showTooltip: true
@@ -1634,10 +1644,10 @@ import {
1634
1644
  JustifySpaceBetweenVerticalIcon as BetweenIcon,
1635
1645
  JustifyTopIcon
1636
1646
  } from "@elementor/icons";
1637
- import { DirectionProvider as DirectionProvider6, Stack as Stack12, ThemeProvider as ThemeProvider6, withDirection as withDirection4 } from "@elementor/ui";
1647
+ import { DirectionProvider as DirectionProvider6, Stack as Stack12, ThemeProvider as ThemeProvider6, withDirection as withDirection5 } from "@elementor/ui";
1638
1648
  import { __ as __17 } from "@wordpress/i18n";
1639
- var StartIcon3 = withDirection4(JustifyTopIcon);
1640
- var EndIcon3 = withDirection4(JustifyBottomIcon);
1649
+ var StartIcon3 = withDirection5(JustifyTopIcon);
1650
+ var EndIcon3 = withDirection5(JustifyBottomIcon);
1641
1651
  var iconProps3 = {
1642
1652
  isClockwise: true,
1643
1653
  offset: -90
@@ -1975,10 +1985,10 @@ var LineHeightField = () => {
1975
1985
  import * as React50 from "react";
1976
1986
  import { ControlLabel as ControlLabel24, ToggleControl as ToggleControl8 } from "@elementor/editor-controls";
1977
1987
  import { AlignCenterIcon, AlignJustifiedIcon, AlignLeftIcon, AlignRightIcon } from "@elementor/icons";
1978
- import { Grid as Grid19, withDirection as withDirection5 } from "@elementor/ui";
1988
+ import { Grid as Grid19, withDirection as withDirection6 } from "@elementor/ui";
1979
1989
  import { __ as __32 } from "@wordpress/i18n";
1980
- var StartIcon4 = withDirection5(AlignLeftIcon);
1981
- var EndIcon4 = withDirection5(AlignRightIcon);
1990
+ var StartIcon4 = withDirection6(AlignLeftIcon);
1991
+ var EndIcon4 = withDirection6(AlignRightIcon);
1982
1992
  var options7 = [
1983
1993
  {
1984
1994
  value: "start",
@@ -2061,7 +2071,7 @@ var initTextStroke = {
2061
2071
  }
2062
2072
  };
2063
2073
  var TextStrokeField = () => {
2064
- const [textStroke, setTextStroke] = useStylesField("-webkit-text-stroke");
2074
+ const [textStroke, setTextStroke] = useStylesField("stroke");
2065
2075
  const addTextStroke = () => {
2066
2076
  setTextStroke(initTextStroke);
2067
2077
  };
@@ -2077,7 +2087,7 @@ var TextStrokeField = () => {
2077
2087
  onAdd: addTextStroke,
2078
2088
  onRemove: removeTextStroke
2079
2089
  },
2080
- /* @__PURE__ */ React53.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React53.createElement(StrokeControl, null))
2090
+ /* @__PURE__ */ React53.createElement(StylesField, { bind: "stroke" }, /* @__PURE__ */ React53.createElement(StrokeControl, null))
2081
2091
  );
2082
2092
  };
2083
2093