@elementor/editor-editing-panel 1.16.0 → 1.17.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.
- package/CHANGELOG.md +31 -0
- package/dist/index.js +286 -226
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +184 -124
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
- package/src/components/editing-panel.tsx +2 -0
- package/src/components/style-sections/border-section/border-radius-field.tsx +1 -0
- package/src/components/style-sections/border-section/border-width-field.tsx +19 -10
- package/src/components/style-sections/position-section/dimensions-field.tsx +23 -11
- package/src/components/style-sections/position-section/position-section.tsx +12 -12
- package/src/components/style-sections/spacing-section/spacing-section.tsx +9 -2
- package/src/components/style-sections/typography-section/font-family-field.tsx +34 -2
- package/src/components/style-sections/typography-section/text-direction-field.tsx +4 -2
- package/src/dynamics/components/dynamic-selection.tsx +18 -11
package/dist/index.mjs
CHANGED
|
@@ -606,6 +606,7 @@ import * as React63 from "react";
|
|
|
606
606
|
import { ControlActionsProvider, ControlReplacementProvider } from "@elementor/editor-controls";
|
|
607
607
|
import { useSelectedElement } from "@elementor/editor-elements";
|
|
608
608
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
609
|
+
import { RocketIcon } from "@elementor/icons";
|
|
609
610
|
import { SessionStorageProvider as SessionStorageProvider3 } from "@elementor/session";
|
|
610
611
|
import { ErrorBoundary } from "@elementor/ui";
|
|
611
612
|
import { __ as __42 } from "@wordpress/i18n";
|
|
@@ -1027,7 +1028,7 @@ import { Stack as Stack5 } from "@elementor/ui";
|
|
|
1027
1028
|
var SectionContent = ({ gap = 2, sx, children }) => /* @__PURE__ */ React19.createElement(Stack5, { gap, sx: { ...sx } }, children);
|
|
1028
1029
|
|
|
1029
1030
|
// src/components/style-sections/border-section/border-field.tsx
|
|
1030
|
-
import * as
|
|
1031
|
+
import * as React25 from "react";
|
|
1031
1032
|
import { __ as __8 } from "@wordpress/i18n";
|
|
1032
1033
|
|
|
1033
1034
|
// src/components/add-or-remove-content.tsx
|
|
@@ -1081,40 +1082,88 @@ var BorderStyleField = () => {
|
|
|
1081
1082
|
};
|
|
1082
1083
|
|
|
1083
1084
|
// src/components/style-sections/border-section/border-width-field.tsx
|
|
1084
|
-
import * as
|
|
1085
|
+
import * as React24 from "react";
|
|
1085
1086
|
import { EqualUnequalSizesControl } from "@elementor/editor-controls";
|
|
1086
1087
|
import { borderWidthPropTypeUtil } from "@elementor/editor-props";
|
|
1087
1088
|
import { SideAllIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
1089
|
+
import { withDirection } from "@elementor/ui";
|
|
1088
1090
|
import { __ as __7 } from "@wordpress/i18n";
|
|
1089
|
-
|
|
1091
|
+
|
|
1092
|
+
// src/hooks/use-direction.ts
|
|
1093
|
+
import { useTheme } from "@elementor/ui";
|
|
1094
|
+
function useDirection() {
|
|
1095
|
+
const theme = useTheme(), extendedWindow = window;
|
|
1096
|
+
const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!extendedWindow.elementorFrontend?.config?.is_rtl;
|
|
1097
|
+
return { isSiteRtl, isUiRtl };
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
1101
|
+
import * as React23 from "react";
|
|
1102
|
+
import { useRef } from "react";
|
|
1103
|
+
import { useTheme as useTheme2 } from "@elementor/ui";
|
|
1104
|
+
var CLOCKWISE_ANGLES = {
|
|
1105
|
+
row: 0,
|
|
1106
|
+
column: 90,
|
|
1107
|
+
"row-reverse": 180,
|
|
1108
|
+
"column-reverse": 270
|
|
1109
|
+
};
|
|
1110
|
+
var COUNTER_CLOCKWISE_ANGLES = {
|
|
1111
|
+
row: 0,
|
|
1112
|
+
column: -90,
|
|
1113
|
+
"row-reverse": -180,
|
|
1114
|
+
"column-reverse": -270
|
|
1115
|
+
};
|
|
1116
|
+
var RotatedIcon = ({ icon: Icon, size, isClockwise = true, offset = 0 }) => {
|
|
1117
|
+
const rotate = useRef(useGetTargetAngle(isClockwise, offset));
|
|
1118
|
+
rotate.current = useGetTargetAngle(isClockwise, offset, rotate);
|
|
1119
|
+
return /* @__PURE__ */ React23.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
1120
|
+
};
|
|
1121
|
+
var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
1122
|
+
const [direction] = useStylesField("flex-direction");
|
|
1123
|
+
const isRtl = "rtl" === useTheme2().direction;
|
|
1124
|
+
const rotationMultiplier = isRtl ? -1 : 1;
|
|
1125
|
+
const angleMap = isClockwise ? CLOCKWISE_ANGLES : COUNTER_CLOCKWISE_ANGLES;
|
|
1126
|
+
const currentAngle = existingRef ? existingRef.current * rotationMultiplier : angleMap[direction?.value || "row"] + offset;
|
|
1127
|
+
const targetAngle = angleMap[direction?.value || "row"] + offset;
|
|
1128
|
+
const diffToTargetAngle = (targetAngle - currentAngle + 360) % 360;
|
|
1129
|
+
const formattedDiff = (diffToTargetAngle + 180) % 360 - 180;
|
|
1130
|
+
return (currentAngle + formattedDiff) * rotationMultiplier;
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
// src/components/style-sections/border-section/border-width-field.tsx
|
|
1134
|
+
var InlineStartIcon = withDirection(SideRightIcon);
|
|
1135
|
+
var InlineEndIcon = withDirection(SideLeftIcon);
|
|
1136
|
+
var getEdges = (isSiteRtl) => [
|
|
1090
1137
|
{
|
|
1091
1138
|
label: __7("Top", "elementor"),
|
|
1092
|
-
icon: /* @__PURE__ */
|
|
1093
|
-
bind: "
|
|
1139
|
+
icon: /* @__PURE__ */ React24.createElement(SideTopIcon, { fontSize: "tiny" }),
|
|
1140
|
+
bind: "block-start"
|
|
1094
1141
|
},
|
|
1095
1142
|
{
|
|
1096
|
-
label: __7("Right", "elementor"),
|
|
1097
|
-
icon: /* @__PURE__ */
|
|
1098
|
-
bind: "
|
|
1143
|
+
label: isSiteRtl ? __7("Left", "elementor") : __7("Right", "elementor"),
|
|
1144
|
+
icon: /* @__PURE__ */ React24.createElement(RotatedIcon, { icon: InlineStartIcon, size: "tiny" }),
|
|
1145
|
+
bind: "inline-end"
|
|
1099
1146
|
},
|
|
1100
1147
|
{
|
|
1101
1148
|
label: __7("Bottom", "elementor"),
|
|
1102
|
-
icon: /* @__PURE__ */
|
|
1103
|
-
bind: "
|
|
1149
|
+
icon: /* @__PURE__ */ React24.createElement(SideBottomIcon, { fontSize: "tiny" }),
|
|
1150
|
+
bind: "block-end"
|
|
1104
1151
|
},
|
|
1105
1152
|
{
|
|
1106
|
-
label: __7("Left", "elementor"),
|
|
1107
|
-
icon: /* @__PURE__ */
|
|
1108
|
-
bind: "
|
|
1153
|
+
label: isSiteRtl ? __7("Right", "elementor") : __7("Left", "elementor"),
|
|
1154
|
+
icon: /* @__PURE__ */ React24.createElement(RotatedIcon, { icon: InlineEndIcon, size: "tiny" }),
|
|
1155
|
+
bind: "inline-start"
|
|
1109
1156
|
}
|
|
1110
1157
|
];
|
|
1111
1158
|
var BorderWidthField = () => {
|
|
1112
|
-
|
|
1159
|
+
const { isSiteRtl } = useDirection();
|
|
1160
|
+
return /* @__PURE__ */ React24.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React24.createElement(
|
|
1113
1161
|
EqualUnequalSizesControl,
|
|
1114
1162
|
{
|
|
1115
|
-
items:
|
|
1163
|
+
items: getEdges(isSiteRtl),
|
|
1116
1164
|
label: __7("Border width", "elementor"),
|
|
1117
|
-
icon: /* @__PURE__ */
|
|
1165
|
+
icon: /* @__PURE__ */ React24.createElement(SideAllIcon, { fontSize: "tiny" }),
|
|
1166
|
+
tooltipLabel: __7("Adjust borders", "elementor"),
|
|
1118
1167
|
multiSizePropTypeUtil: borderWidthPropTypeUtil
|
|
1119
1168
|
}
|
|
1120
1169
|
));
|
|
@@ -1139,7 +1188,7 @@ var BorderField = () => {
|
|
|
1139
1188
|
});
|
|
1140
1189
|
};
|
|
1141
1190
|
const hasBorder = Object.values(border ?? {}).some(Boolean);
|
|
1142
|
-
return /* @__PURE__ */
|
|
1191
|
+
return /* @__PURE__ */ React25.createElement(
|
|
1143
1192
|
AddOrRemoveContent,
|
|
1144
1193
|
{
|
|
1145
1194
|
label: __8("Border", "elementor"),
|
|
@@ -1147,9 +1196,9 @@ var BorderField = () => {
|
|
|
1147
1196
|
onAdd: addBorder,
|
|
1148
1197
|
onRemove: removeBorder
|
|
1149
1198
|
},
|
|
1150
|
-
/* @__PURE__ */
|
|
1151
|
-
/* @__PURE__ */
|
|
1152
|
-
/* @__PURE__ */
|
|
1199
|
+
/* @__PURE__ */ React25.createElement(BorderWidthField, null),
|
|
1200
|
+
/* @__PURE__ */ React25.createElement(BorderColorField, null),
|
|
1201
|
+
/* @__PURE__ */ React25.createElement(BorderStyleField, null)
|
|
1153
1202
|
);
|
|
1154
1203
|
};
|
|
1155
1204
|
|
|
@@ -1164,55 +1213,12 @@ import {
|
|
|
1164
1213
|
RadiusTopLeftIcon,
|
|
1165
1214
|
RadiusTopRightIcon
|
|
1166
1215
|
} from "@elementor/icons";
|
|
1167
|
-
import { withDirection } from "@elementor/ui";
|
|
1216
|
+
import { withDirection as withDirection2 } from "@elementor/ui";
|
|
1168
1217
|
import { __ as __9 } from "@wordpress/i18n";
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
const theme = useTheme(), extendedWindow = window;
|
|
1174
|
-
const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!extendedWindow.elementorFrontend?.config?.is_rtl;
|
|
1175
|
-
return { isSiteRtl, isUiRtl };
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
1179
|
-
import * as React25 from "react";
|
|
1180
|
-
import { useRef } from "react";
|
|
1181
|
-
import { useTheme as useTheme2 } from "@elementor/ui";
|
|
1182
|
-
var CLOCKWISE_ANGLES = {
|
|
1183
|
-
row: 0,
|
|
1184
|
-
column: 90,
|
|
1185
|
-
"row-reverse": 180,
|
|
1186
|
-
"column-reverse": 270
|
|
1187
|
-
};
|
|
1188
|
-
var COUNTER_CLOCKWISE_ANGLES = {
|
|
1189
|
-
row: 0,
|
|
1190
|
-
column: -90,
|
|
1191
|
-
"row-reverse": -180,
|
|
1192
|
-
"column-reverse": -270
|
|
1193
|
-
};
|
|
1194
|
-
var RotatedIcon = ({ icon: Icon, size, isClockwise = true, offset = 0 }) => {
|
|
1195
|
-
const rotate = useRef(useGetTargetAngle(isClockwise, offset));
|
|
1196
|
-
rotate.current = useGetTargetAngle(isClockwise, offset, rotate);
|
|
1197
|
-
return /* @__PURE__ */ React25.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
1198
|
-
};
|
|
1199
|
-
var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
1200
|
-
const [direction] = useStylesField("flex-direction");
|
|
1201
|
-
const isRtl = "rtl" === useTheme2().direction;
|
|
1202
|
-
const rotationMultiplier = isRtl ? -1 : 1;
|
|
1203
|
-
const angleMap = isClockwise ? CLOCKWISE_ANGLES : COUNTER_CLOCKWISE_ANGLES;
|
|
1204
|
-
const currentAngle = existingRef ? existingRef.current * rotationMultiplier : angleMap[direction?.value || "row"] + offset;
|
|
1205
|
-
const targetAngle = angleMap[direction?.value || "row"] + offset;
|
|
1206
|
-
const diffToTargetAngle = (targetAngle - currentAngle + 360) % 360;
|
|
1207
|
-
const formattedDiff = (diffToTargetAngle + 180) % 360 - 180;
|
|
1208
|
-
return (currentAngle + formattedDiff) * rotationMultiplier;
|
|
1209
|
-
};
|
|
1210
|
-
|
|
1211
|
-
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
1212
|
-
var StartStartIcon = withDirection(RadiusTopLeftIcon);
|
|
1213
|
-
var StartEndIcon = withDirection(RadiusTopRightIcon);
|
|
1214
|
-
var EndStartIcon = withDirection(RadiusBottomLeftIcon);
|
|
1215
|
-
var EndEndIcon = withDirection(RadiusBottomRightIcon);
|
|
1218
|
+
var StartStartIcon = withDirection2(RadiusTopLeftIcon);
|
|
1219
|
+
var StartEndIcon = withDirection2(RadiusTopRightIcon);
|
|
1220
|
+
var EndStartIcon = withDirection2(RadiusBottomLeftIcon);
|
|
1221
|
+
var EndEndIcon = withDirection2(RadiusBottomRightIcon);
|
|
1216
1222
|
var getStartStartLabel = (isSiteRtl) => isSiteRtl ? __9("Top right", "elementor") : __9("Top left", "elementor");
|
|
1217
1223
|
var getStartEndLabel = (isSiteRtl) => isSiteRtl ? __9("Top left", "elementor") : __9("Top right", "elementor");
|
|
1218
1224
|
var getEndStartLabel = (isSiteRtl) => isSiteRtl ? __9("Bottom right", "elementor") : __9("Bottom left", "elementor");
|
|
@@ -1247,6 +1253,7 @@ var BorderRadiusField = () => {
|
|
|
1247
1253
|
items: getCorners(isSiteRtl),
|
|
1248
1254
|
label: __9("Border radius", "elementor"),
|
|
1249
1255
|
icon: /* @__PURE__ */ React26.createElement(BorderCornersIcon, { fontSize: "tiny" }),
|
|
1256
|
+
tooltipLabel: __9("Adjust corners", "elementor"),
|
|
1250
1257
|
multiSizePropTypeUtil: borderRadiusPropTypeUtil
|
|
1251
1258
|
}
|
|
1252
1259
|
));
|
|
@@ -1302,10 +1309,10 @@ import {
|
|
|
1302
1309
|
LayoutAlignRightIcon,
|
|
1303
1310
|
LayoutDistributeVerticalIcon as JustifyIcon
|
|
1304
1311
|
} from "@elementor/icons";
|
|
1305
|
-
import { DirectionProvider, Grid as Grid3, ThemeProvider, withDirection as
|
|
1312
|
+
import { DirectionProvider, Grid as Grid3, ThemeProvider, withDirection as withDirection3 } from "@elementor/ui";
|
|
1306
1313
|
import { __ as __10 } from "@wordpress/i18n";
|
|
1307
|
-
var StartIcon =
|
|
1308
|
-
var EndIcon =
|
|
1314
|
+
var StartIcon = withDirection3(LayoutAlignLeftIcon);
|
|
1315
|
+
var EndIcon = withDirection3(LayoutAlignRightIcon);
|
|
1309
1316
|
var iconProps = {
|
|
1310
1317
|
isClockwise: false,
|
|
1311
1318
|
offset: 90
|
|
@@ -1350,10 +1357,10 @@ import {
|
|
|
1350
1357
|
LayoutAlignRightIcon as LayoutAlignRightIcon2,
|
|
1351
1358
|
LayoutDistributeVerticalIcon as JustifyIcon2
|
|
1352
1359
|
} from "@elementor/icons";
|
|
1353
|
-
import { DirectionProvider as DirectionProvider2, Grid as Grid4, ThemeProvider as ThemeProvider2, withDirection as
|
|
1360
|
+
import { DirectionProvider as DirectionProvider2, Grid as Grid4, ThemeProvider as ThemeProvider2, withDirection as withDirection4 } from "@elementor/ui";
|
|
1354
1361
|
import { __ as __11 } from "@wordpress/i18n";
|
|
1355
|
-
var StartIcon2 =
|
|
1356
|
-
var EndIcon2 =
|
|
1362
|
+
var StartIcon2 = withDirection4(LayoutAlignLeftIcon2);
|
|
1363
|
+
var EndIcon2 = withDirection4(LayoutAlignRightIcon2);
|
|
1357
1364
|
var iconProps2 = {
|
|
1358
1365
|
isClockwise: false,
|
|
1359
1366
|
offset: 90
|
|
@@ -1428,14 +1435,14 @@ var DisplayField = () => {
|
|
|
1428
1435
|
import * as React32 from "react";
|
|
1429
1436
|
import { ControlLabel as ControlLabel8, ToggleControl as ToggleControl4 } from "@elementor/editor-controls";
|
|
1430
1437
|
import { ArrowDownSmallIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpSmallIcon } from "@elementor/icons";
|
|
1431
|
-
import { DirectionProvider as DirectionProvider3, Grid as Grid5, ThemeProvider as ThemeProvider3, withDirection as
|
|
1438
|
+
import { DirectionProvider as DirectionProvider3, Grid as Grid5, ThemeProvider as ThemeProvider3, withDirection as withDirection5 } from "@elementor/ui";
|
|
1432
1439
|
import { __ as __13 } from "@wordpress/i18n";
|
|
1433
1440
|
var options3 = [
|
|
1434
1441
|
{
|
|
1435
1442
|
value: "row",
|
|
1436
1443
|
label: __13("Row", "elementor"),
|
|
1437
1444
|
renderContent: ({ size }) => {
|
|
1438
|
-
const StartIcon5 =
|
|
1445
|
+
const StartIcon5 = withDirection5(ArrowRightIcon);
|
|
1439
1446
|
return /* @__PURE__ */ React32.createElement(StartIcon5, { fontSize: size });
|
|
1440
1447
|
},
|
|
1441
1448
|
showTooltip: true
|
|
@@ -1450,7 +1457,7 @@ var options3 = [
|
|
|
1450
1457
|
value: "row-reverse",
|
|
1451
1458
|
label: __13("Reversed row", "elementor"),
|
|
1452
1459
|
renderContent: ({ size }) => {
|
|
1453
|
-
const EndIcon5 =
|
|
1460
|
+
const EndIcon5 = withDirection5(ArrowLeftIcon);
|
|
1454
1461
|
return /* @__PURE__ */ React32.createElement(EndIcon5, { fontSize: size });
|
|
1455
1462
|
},
|
|
1456
1463
|
showTooltip: true
|
|
@@ -1649,10 +1656,10 @@ import {
|
|
|
1649
1656
|
JustifySpaceBetweenVerticalIcon as BetweenIcon,
|
|
1650
1657
|
JustifyTopIcon
|
|
1651
1658
|
} from "@elementor/icons";
|
|
1652
|
-
import { DirectionProvider as DirectionProvider6, Stack as Stack9, ThemeProvider as ThemeProvider6, withDirection as
|
|
1659
|
+
import { DirectionProvider as DirectionProvider6, Stack as Stack9, ThemeProvider as ThemeProvider6, withDirection as withDirection6 } from "@elementor/ui";
|
|
1653
1660
|
import { __ as __17 } from "@wordpress/i18n";
|
|
1654
|
-
var StartIcon3 =
|
|
1655
|
-
var EndIcon3 =
|
|
1661
|
+
var StartIcon3 = withDirection6(JustifyTopIcon);
|
|
1662
|
+
var EndIcon3 = withDirection6(JustifyBottomIcon);
|
|
1656
1663
|
var iconProps3 = {
|
|
1657
1664
|
isClockwise: true,
|
|
1658
1665
|
offset: -90
|
|
@@ -1750,16 +1757,21 @@ import { useSessionStorage } from "@elementor/session";
|
|
|
1750
1757
|
import * as React39 from "react";
|
|
1751
1758
|
import { ControlLabel as ControlLabel14, SizeControl as SizeControl3 } from "@elementor/editor-controls";
|
|
1752
1759
|
import { SideBottomIcon as SideBottomIcon2, SideLeftIcon as SideLeftIcon2, SideRightIcon as SideRightIcon2, SideTopIcon as SideTopIcon2 } from "@elementor/icons";
|
|
1753
|
-
import { Grid as Grid9, Stack as Stack10 } from "@elementor/ui";
|
|
1760
|
+
import { Grid as Grid9, Stack as Stack10, withDirection as withDirection7 } from "@elementor/ui";
|
|
1754
1761
|
import { __ as __20 } from "@wordpress/i18n";
|
|
1762
|
+
var InlineStartIcon2 = withDirection7(SideLeftIcon2);
|
|
1763
|
+
var InlineEndIcon2 = withDirection7(SideRightIcon2);
|
|
1755
1764
|
var sideIcons = {
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1765
|
+
"inset-block-start": /* @__PURE__ */ React39.createElement(SideTopIcon2, { fontSize: "tiny" }),
|
|
1766
|
+
"inset-block-end": /* @__PURE__ */ React39.createElement(SideBottomIcon2, { fontSize: "tiny" }),
|
|
1767
|
+
"inset-inline-start": /* @__PURE__ */ React39.createElement(RotatedIcon, { icon: InlineStartIcon2, size: "tiny" }),
|
|
1768
|
+
"inset-inline-end": /* @__PURE__ */ React39.createElement(RotatedIcon, { icon: InlineEndIcon2, size: "tiny" })
|
|
1760
1769
|
};
|
|
1770
|
+
var getInlineStartLabel = (isSiteRtl) => isSiteRtl ? __20("Right", "elementor") : __20("Left", "elementor");
|
|
1771
|
+
var getInlineEndLabel = (isSiteRtl) => isSiteRtl ? __20("Left", "elementor") : __20("Right", "elementor");
|
|
1761
1772
|
var DimensionsField = () => {
|
|
1762
|
-
|
|
1773
|
+
const { isSiteRtl } = useDirection();
|
|
1774
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(Stack10, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(DimensionField, { side: "inset-block-start", label: __20("Top", "elementor") }), /* @__PURE__ */ React39.createElement(DimensionField, { side: "inset-inline-start", label: getInlineStartLabel(isSiteRtl) })), /* @__PURE__ */ React39.createElement(Stack10, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(DimensionField, { side: "inset-block-end", label: __20("Bottom", "elementor") }), /* @__PURE__ */ React39.createElement(DimensionField, { side: "inset-inline-end", label: getInlineEndLabel(isSiteRtl) })));
|
|
1763
1775
|
};
|
|
1764
1776
|
var DimensionField = ({ side, label }) => {
|
|
1765
1777
|
return /* @__PURE__ */ React39.createElement(Grid9, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React39.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(ControlLabel14, null, label)), /* @__PURE__ */ React39.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(StylesField, { bind: side }, /* @__PURE__ */ React39.createElement(SizeControl3, { startIcon: sideIcons[side], extendedValues: ["auto"] }))));
|
|
@@ -1794,10 +1806,10 @@ var ZIndexField = () => {
|
|
|
1794
1806
|
var PositionSection = () => {
|
|
1795
1807
|
const [positionValue] = useStylesField("position");
|
|
1796
1808
|
const [dimensionsValues, setDimensionsValues] = useStylesFields([
|
|
1797
|
-
"
|
|
1798
|
-
"
|
|
1799
|
-
"
|
|
1800
|
-
"
|
|
1809
|
+
"inset-block-start",
|
|
1810
|
+
"inset-block-end",
|
|
1811
|
+
"inset-inline-start",
|
|
1812
|
+
"inset-inline-end"
|
|
1801
1813
|
]);
|
|
1802
1814
|
const [dimensionsValuesFromHistory, updateDimensionsHistory, clearDimensionsHistory] = usePersistDimensions();
|
|
1803
1815
|
const onPositionChange = (newPosition, previousPosition) => {
|
|
@@ -1805,10 +1817,10 @@ var PositionSection = () => {
|
|
|
1805
1817
|
if (dimensionsValues) {
|
|
1806
1818
|
updateDimensionsHistory(dimensionsValues);
|
|
1807
1819
|
setDimensionsValues({
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1820
|
+
"inset-block-start": void 0,
|
|
1821
|
+
"inset-block-end": void 0,
|
|
1822
|
+
"inset-inline-start": void 0,
|
|
1823
|
+
"inset-inline-end": void 0
|
|
1812
1824
|
});
|
|
1813
1825
|
}
|
|
1814
1826
|
} else if (previousPosition === "static") {
|
|
@@ -1891,7 +1903,15 @@ import * as React45 from "react";
|
|
|
1891
1903
|
import { LinkedDimensionsControl } from "@elementor/editor-controls";
|
|
1892
1904
|
import { __ as __25 } from "@wordpress/i18n";
|
|
1893
1905
|
var SpacingSection = () => {
|
|
1894
|
-
|
|
1906
|
+
const { isSiteRtl } = useDirection();
|
|
1907
|
+
return /* @__PURE__ */ React45.createElement(SectionContent, null, /* @__PURE__ */ React45.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React45.createElement(LinkedDimensionsControl, { label: __25("Padding", "elementor"), isSiteRtl })), /* @__PURE__ */ React45.createElement(PanelDivider, null), /* @__PURE__ */ React45.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React45.createElement(
|
|
1908
|
+
LinkedDimensionsControl,
|
|
1909
|
+
{
|
|
1910
|
+
label: __25("Margin", "elementor"),
|
|
1911
|
+
isSiteRtl,
|
|
1912
|
+
extendedValues: ["auto"]
|
|
1913
|
+
}
|
|
1914
|
+
)));
|
|
1895
1915
|
};
|
|
1896
1916
|
|
|
1897
1917
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
@@ -1924,6 +1944,7 @@ var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
|
1924
1944
|
|
|
1925
1945
|
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1926
1946
|
import * as React47 from "react";
|
|
1947
|
+
import { useMemo as useMemo3 } from "react";
|
|
1927
1948
|
import { ControlLabel as ControlLabel19, FontFamilyControl } from "@elementor/editor-controls";
|
|
1928
1949
|
import { Grid as Grid14 } from "@elementor/ui";
|
|
1929
1950
|
import { __ as __27 } from "@wordpress/i18n";
|
|
@@ -1935,9 +1956,14 @@ var getElementorConfig = () => {
|
|
|
1935
1956
|
};
|
|
1936
1957
|
|
|
1937
1958
|
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1959
|
+
var supportedCategories = {
|
|
1960
|
+
system: __27("System", "elementor"),
|
|
1961
|
+
custom: __27("Custom Fonts", "elementor"),
|
|
1962
|
+
googlefonts: __27("Google Fonts", "elementor")
|
|
1963
|
+
};
|
|
1938
1964
|
var FontFamilyField = () => {
|
|
1939
|
-
const fontFamilies =
|
|
1940
|
-
if (
|
|
1965
|
+
const fontFamilies = useFontFamilies();
|
|
1966
|
+
if (Object.keys(fontFamilies).length === 0) {
|
|
1941
1967
|
return null;
|
|
1942
1968
|
}
|
|
1943
1969
|
return /* @__PURE__ */ React47.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React47.createElement(Grid14, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React47.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(ControlLabel19, null, __27("Font family", "elementor"))), /* @__PURE__ */ React47.createElement(Grid14, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React47.createElement(FontFamilyControl, { fontFamilies }))));
|
|
@@ -1950,6 +1976,24 @@ var getFontFamilies = () => {
|
|
|
1950
1976
|
}
|
|
1951
1977
|
return options11;
|
|
1952
1978
|
};
|
|
1979
|
+
var useFontFamilies = () => {
|
|
1980
|
+
const fontFamilies = getFontFamilies();
|
|
1981
|
+
return useMemo3(
|
|
1982
|
+
() => Object.entries(fontFamilies || {}).reduce((acc, [font, category]) => {
|
|
1983
|
+
const categoryLabel = supportedCategories[category];
|
|
1984
|
+
const existingCategory = acc[categoryLabel];
|
|
1985
|
+
if (!categoryLabel) {
|
|
1986
|
+
return acc;
|
|
1987
|
+
}
|
|
1988
|
+
if (!existingCategory) {
|
|
1989
|
+
acc[categoryLabel] = [];
|
|
1990
|
+
}
|
|
1991
|
+
acc[categoryLabel].push(font);
|
|
1992
|
+
return acc;
|
|
1993
|
+
}, {}),
|
|
1994
|
+
[fontFamilies]
|
|
1995
|
+
);
|
|
1996
|
+
};
|
|
1953
1997
|
|
|
1954
1998
|
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1955
1999
|
import * as React48 from "react";
|
|
@@ -2024,10 +2068,10 @@ var LineHeightField = () => {
|
|
|
2024
2068
|
import * as React53 from "react";
|
|
2025
2069
|
import { ControlLabel as ControlLabel25, ToggleControl as ToggleControl9 } from "@elementor/editor-controls";
|
|
2026
2070
|
import { AlignCenterIcon, AlignJustifiedIcon, AlignLeftIcon, AlignRightIcon } from "@elementor/icons";
|
|
2027
|
-
import { Grid as Grid20, withDirection as
|
|
2071
|
+
import { Grid as Grid20, withDirection as withDirection8 } from "@elementor/ui";
|
|
2028
2072
|
import { __ as __33 } from "@wordpress/i18n";
|
|
2029
|
-
var StartIcon4 =
|
|
2030
|
-
var EndIcon4 =
|
|
2073
|
+
var StartIcon4 = withDirection8(AlignLeftIcon);
|
|
2074
|
+
var EndIcon4 = withDirection8(AlignRightIcon);
|
|
2031
2075
|
var options8 = [
|
|
2032
2076
|
{
|
|
2033
2077
|
value: "start",
|
|
@@ -2140,13 +2184,15 @@ import { __ as __36 } from "@wordpress/i18n";
|
|
|
2140
2184
|
var options9 = [
|
|
2141
2185
|
{
|
|
2142
2186
|
value: "ltr",
|
|
2143
|
-
label: __36("Left to
|
|
2144
|
-
renderContent: ({ size }) => /* @__PURE__ */ React56.createElement(TextDirectionLtrIcon, { fontSize: size })
|
|
2187
|
+
label: __36("Left to right", "elementor"),
|
|
2188
|
+
renderContent: ({ size }) => /* @__PURE__ */ React56.createElement(TextDirectionLtrIcon, { fontSize: size }),
|
|
2189
|
+
showTooltip: true
|
|
2145
2190
|
},
|
|
2146
2191
|
{
|
|
2147
2192
|
value: "rtl",
|
|
2148
|
-
label: __36("Right to
|
|
2149
|
-
renderContent: ({ size }) => /* @__PURE__ */ React56.createElement(TextDirectionRtlIcon, { fontSize: size })
|
|
2193
|
+
label: __36("Right to left", "elementor"),
|
|
2194
|
+
renderContent: ({ size }) => /* @__PURE__ */ React56.createElement(TextDirectionRtlIcon, { fontSize: size }),
|
|
2195
|
+
showTooltip: true
|
|
2150
2196
|
}
|
|
2151
2197
|
];
|
|
2152
2198
|
var TextDirectionField = () => {
|
|
@@ -2306,7 +2352,7 @@ var EditingPanel = () => {
|
|
|
2306
2352
|
return null;
|
|
2307
2353
|
}
|
|
2308
2354
|
const panelTitle = __42("Edit %s", "elementor").replace("%s", elementType.title);
|
|
2309
|
-
return /* @__PURE__ */ React63.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React63.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React63.createElement(SessionStorageProvider3, { prefix: "elementor" }, /* @__PURE__ */ React63.createElement(Panel, null, /* @__PURE__ */ React63.createElement(PanelHeader, null, /* @__PURE__ */ React63.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React63.createElement(PanelBody, null, /* @__PURE__ */ React63.createElement(ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React63.createElement(ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React63.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React63.createElement(EditingPanelTabs, null))))))));
|
|
2355
|
+
return /* @__PURE__ */ React63.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React63.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React63.createElement(SessionStorageProvider3, { prefix: "elementor" }, /* @__PURE__ */ React63.createElement(Panel, null, /* @__PURE__ */ React63.createElement(PanelHeader, null, /* @__PURE__ */ React63.createElement(PanelHeaderTitle, null, panelTitle), /* @__PURE__ */ React63.createElement(RocketIcon, { fontSize: "small", sx: { color: "text.disabled" } })), /* @__PURE__ */ React63.createElement(PanelBody, null, /* @__PURE__ */ React63.createElement(ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React63.createElement(ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React63.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React63.createElement(EditingPanelTabs, null))))))));
|
|
2310
2356
|
};
|
|
2311
2357
|
|
|
2312
2358
|
// src/panel.ts
|
|
@@ -2376,7 +2422,7 @@ var EditingPanelHooks = () => {
|
|
|
2376
2422
|
import * as React67 from "react";
|
|
2377
2423
|
import { useId as useId4 } from "react";
|
|
2378
2424
|
import { ControlLabel as ControlLabel31, useBoundProp as useBoundProp4 } from "@elementor/editor-controls";
|
|
2379
|
-
import { DatabaseIcon, SettingsIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
2425
|
+
import { DatabaseIcon as DatabaseIcon2, SettingsIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
2380
2426
|
import {
|
|
2381
2427
|
bindPopover as bindPopover2,
|
|
2382
2428
|
bindTrigger as bindTrigger2,
|
|
@@ -2415,10 +2461,10 @@ import * as React65 from "react";
|
|
|
2415
2461
|
import { PropKeyProvider as PropKeyProvider3, PropProvider as PropProvider3, useBoundProp as useBoundProp2 } from "@elementor/editor-controls";
|
|
2416
2462
|
|
|
2417
2463
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2418
|
-
import { useMemo as
|
|
2464
|
+
import { useMemo as useMemo5 } from "react";
|
|
2419
2465
|
|
|
2420
2466
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
2421
|
-
import { useMemo as
|
|
2467
|
+
import { useMemo as useMemo4 } from "react";
|
|
2422
2468
|
import { useBoundProp } from "@elementor/editor-controls";
|
|
2423
2469
|
|
|
2424
2470
|
// src/dynamics/sync/get-elementor-config.ts
|
|
@@ -2473,7 +2519,7 @@ var usePropDynamicTags = () => {
|
|
|
2473
2519
|
const propDynamicType = getDynamicPropType(propType);
|
|
2474
2520
|
categories = propDynamicType?.settings.categories || [];
|
|
2475
2521
|
}
|
|
2476
|
-
return
|
|
2522
|
+
return useMemo4(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
2477
2523
|
};
|
|
2478
2524
|
var getDynamicTagsByCategories = (categories) => {
|
|
2479
2525
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -2489,7 +2535,7 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
2489
2535
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2490
2536
|
var useDynamicTag = (tagName) => {
|
|
2491
2537
|
const dynamicTags = usePropDynamicTags();
|
|
2492
|
-
return
|
|
2538
|
+
return useMemo5(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
2493
2539
|
};
|
|
2494
2540
|
|
|
2495
2541
|
// src/dynamics/dynamic-control.tsx
|
|
@@ -2520,7 +2566,7 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
2520
2566
|
import * as React66 from "react";
|
|
2521
2567
|
import { Fragment as Fragment9, useState as useState8 } from "react";
|
|
2522
2568
|
import { useBoundProp as useBoundProp3 } from "@elementor/editor-controls";
|
|
2523
|
-
import {
|
|
2569
|
+
import { DatabaseIcon, SearchIcon } from "@elementor/icons";
|
|
2524
2570
|
import {
|
|
2525
2571
|
Box as Box4,
|
|
2526
2572
|
Divider as Divider6,
|
|
@@ -2578,16 +2624,30 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2578
2624
|
},
|
|
2579
2625
|
tagLabel
|
|
2580
2626
|
);
|
|
2581
|
-
})))) : /* @__PURE__ */ React66.createElement(
|
|
2582
|
-
|
|
2627
|
+
})))) : /* @__PURE__ */ React66.createElement(
|
|
2628
|
+
Stack15,
|
|
2583
2629
|
{
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2630
|
+
gap: 1,
|
|
2631
|
+
alignItems: "center",
|
|
2632
|
+
justifyContent: "center",
|
|
2633
|
+
height: "100%",
|
|
2634
|
+
p: 2.5,
|
|
2635
|
+
color: "text.secondary",
|
|
2636
|
+
sx: { pb: 3.5 }
|
|
2588
2637
|
},
|
|
2589
|
-
|
|
2590
|
-
|
|
2638
|
+
/* @__PURE__ */ React66.createElement(DatabaseIcon, { fontSize: "large" }),
|
|
2639
|
+
/* @__PURE__ */ React66.createElement(Typography4, { align: "center", variant: "subtitle2" }, __43("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React66.createElement("br", null), "\u201C", searchValue, "\u201D."),
|
|
2640
|
+
/* @__PURE__ */ React66.createElement(Typography4, { align: "center", variant: "caption" }, __43("Try something else.", "elementor"), "\xA0", /* @__PURE__ */ React66.createElement(
|
|
2641
|
+
Link,
|
|
2642
|
+
{
|
|
2643
|
+
color: "text.secondary",
|
|
2644
|
+
variant: "caption",
|
|
2645
|
+
component: "button",
|
|
2646
|
+
onClick: () => setSearchValue("")
|
|
2647
|
+
},
|
|
2648
|
+
__43("Clear & try again", "elementor")
|
|
2649
|
+
))
|
|
2650
|
+
)));
|
|
2591
2651
|
};
|
|
2592
2652
|
var useFilteredOptions = (searchValue) => {
|
|
2593
2653
|
const dynamicTags = usePropDynamicTags();
|
|
@@ -2627,7 +2687,7 @@ var DynamicSelectionControl = () => {
|
|
|
2627
2687
|
fullWidth: true,
|
|
2628
2688
|
showActionsOnHover: true,
|
|
2629
2689
|
label: dynamicTag.label,
|
|
2630
|
-
startIcon: /* @__PURE__ */ React67.createElement(
|
|
2690
|
+
startIcon: /* @__PURE__ */ React67.createElement(DatabaseIcon2, { fontSize: SIZE4 }),
|
|
2631
2691
|
...bindTrigger2(selectionPopoverState),
|
|
2632
2692
|
actions: /* @__PURE__ */ React67.createElement(React67.Fragment, null, /* @__PURE__ */ React67.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React67.createElement(
|
|
2633
2693
|
IconButton3,
|
|
@@ -2647,7 +2707,7 @@ var DynamicSelectionControl = () => {
|
|
|
2647
2707
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
2648
2708
|
...bindPopover2(selectionPopoverState)
|
|
2649
2709
|
},
|
|
2650
|
-
/* @__PURE__ */ React67.createElement(Stack16, null, /* @__PURE__ */ React67.createElement(Stack16, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React67.createElement(
|
|
2710
|
+
/* @__PURE__ */ React67.createElement(Stack16, null, /* @__PURE__ */ React67.createElement(Stack16, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React67.createElement(DatabaseIcon2, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React67.createElement(Typography5, { variant: "subtitle2" }, __44("Dynamic tags", "elementor")), /* @__PURE__ */ React67.createElement(IconButton3, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React67.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React67.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
2651
2711
|
));
|
|
2652
2712
|
};
|
|
2653
2713
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
@@ -2672,7 +2732,7 @@ var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
|
2672
2732
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
2673
2733
|
...bindPopover2(settingsPopupState)
|
|
2674
2734
|
},
|
|
2675
|
-
/* @__PURE__ */ React67.createElement(Paper, { component: Stack16, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React67.createElement(Stack16, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React67.createElement(
|
|
2735
|
+
/* @__PURE__ */ React67.createElement(Paper, { component: Stack16, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React67.createElement(Stack16, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React67.createElement(DatabaseIcon2, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React67.createElement(Typography5, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React67.createElement(IconButton3, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React67.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React67.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
2676
2736
|
));
|
|
2677
2737
|
};
|
|
2678
2738
|
var DynamicSettings = ({ controls }) => {
|
|
@@ -2700,14 +2760,14 @@ var Control3 = ({ control }) => {
|
|
|
2700
2760
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
2701
2761
|
import * as React68 from "react";
|
|
2702
2762
|
import { useBoundProp as useBoundProp5 } from "@elementor/editor-controls";
|
|
2703
|
-
import { DatabaseIcon as
|
|
2763
|
+
import { DatabaseIcon as DatabaseIcon3 } from "@elementor/icons";
|
|
2704
2764
|
import { __ as __45 } from "@wordpress/i18n";
|
|
2705
2765
|
var usePropDynamicAction = () => {
|
|
2706
2766
|
const { propType } = useBoundProp5();
|
|
2707
2767
|
const visible = !!propType && supportsDynamic(propType);
|
|
2708
2768
|
return {
|
|
2709
2769
|
visible,
|
|
2710
|
-
icon:
|
|
2770
|
+
icon: DatabaseIcon3,
|
|
2711
2771
|
title: __45("Dynamic tags", "elementor"),
|
|
2712
2772
|
popoverContent: ({ closePopover }) => /* @__PURE__ */ React68.createElement(DynamicSelection, { onSelect: closePopover })
|
|
2713
2773
|
};
|