@elementor/editor-variables 3.33.0-151 → 3.33.0-153
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 +44 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -34
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -13
- package/src/components/fields/label-field.tsx +2 -1
- package/src/components/variables-manager/variable-editable-cell.tsx +4 -2
- package/src/components/variables-manager/variables-manager-table.tsx +8 -3
- /package/src/components/variables-manager/{variable-edit-menu.tsx → utils/variable-edit-menu.tsx} +0 -0
- /package/src/components/variables-manager/{variable-table-cell.tsx → utils/variable-table-cell.tsx} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -959,7 +959,8 @@ var LabelField = ({
|
|
|
959
959
|
onChange: (e) => handleChange(e.target.value),
|
|
960
960
|
inputProps: {
|
|
961
961
|
maxLength: VARIABLE_LABEL_MAX_LENGTH,
|
|
962
|
-
...selectOnShow && { onFocus: (e) => e.target.select() }
|
|
962
|
+
...selectOnShow && { onFocus: (e) => e.target.select() },
|
|
963
|
+
"aria-label": "Name"
|
|
963
964
|
},
|
|
964
965
|
autoFocus: focusOnShow
|
|
965
966
|
}
|
|
@@ -982,7 +983,7 @@ var LabelField = ({
|
|
|
982
983
|
return textField;
|
|
983
984
|
};
|
|
984
985
|
|
|
985
|
-
// src/components/variables-manager/variable-edit-menu.tsx
|
|
986
|
+
// src/components/variables-manager/utils/variable-edit-menu.tsx
|
|
986
987
|
import * as React6 from "react";
|
|
987
988
|
import { createElement as createElement8 } from "react";
|
|
988
989
|
import { DotsVerticalIcon } from "@elementor/icons";
|
|
@@ -1036,11 +1037,35 @@ var VariableEditMenu = ({ menuActions, disabled, itemId }) => {
|
|
|
1036
1037
|
));
|
|
1037
1038
|
};
|
|
1038
1039
|
|
|
1039
|
-
// src/components/variables-manager/variable-
|
|
1040
|
+
// src/components/variables-manager/utils/variable-table-cell.tsx
|
|
1040
1041
|
import * as React7 from "react";
|
|
1042
|
+
import { TableCell } from "@elementor/ui";
|
|
1043
|
+
var VariableTableCell = ({
|
|
1044
|
+
children,
|
|
1045
|
+
isHeader,
|
|
1046
|
+
width,
|
|
1047
|
+
maxWidth,
|
|
1048
|
+
align,
|
|
1049
|
+
noPadding,
|
|
1050
|
+
sx
|
|
1051
|
+
}) => {
|
|
1052
|
+
const baseSx = {
|
|
1053
|
+
maxWidth: maxWidth ?? 150,
|
|
1054
|
+
cursor: "initial",
|
|
1055
|
+
typography: "caption",
|
|
1056
|
+
...isHeader && { color: "text.primary", fontWeight: "bold" },
|
|
1057
|
+
...isHeader && !noPadding && { padding: "10px 16px" },
|
|
1058
|
+
...width && { width },
|
|
1059
|
+
...sx
|
|
1060
|
+
};
|
|
1061
|
+
return /* @__PURE__ */ React7.createElement(TableCell, { size: "small", padding: noPadding ? "none" : void 0, align, sx: baseSx }, children);
|
|
1062
|
+
};
|
|
1063
|
+
|
|
1064
|
+
// src/components/variables-manager/variable-editable-cell.tsx
|
|
1065
|
+
import * as React8 from "react";
|
|
1041
1066
|
import { useCallback as useCallback3, useEffect, useRef as useRef2, useState as useState4 } from "react";
|
|
1042
1067
|
import { ClickAwayListener, Stack as Stack2 } from "@elementor/ui";
|
|
1043
|
-
var VariableEditableCell =
|
|
1068
|
+
var VariableEditableCell = React8.memo(
|
|
1044
1069
|
({
|
|
1045
1070
|
initialValue,
|
|
1046
1071
|
children,
|
|
@@ -1050,6 +1075,7 @@ var VariableEditableCell = React7.memo(
|
|
|
1050
1075
|
autoEdit = false,
|
|
1051
1076
|
onRowRef,
|
|
1052
1077
|
onAutoEditComplete,
|
|
1078
|
+
gap = 1,
|
|
1053
1079
|
fieldType
|
|
1054
1080
|
}) => {
|
|
1055
1081
|
const [value, setValue] = useState4(initialValue);
|
|
@@ -1105,13 +1131,13 @@ var VariableEditableCell = React7.memo(
|
|
|
1105
1131
|
error: currentError
|
|
1106
1132
|
});
|
|
1107
1133
|
if (isEditing) {
|
|
1108
|
-
return /* @__PURE__ */
|
|
1134
|
+
return /* @__PURE__ */ React8.createElement(ClickAwayListener, { onClickAway: handleSave }, /* @__PURE__ */ React8.createElement(
|
|
1109
1135
|
Stack2,
|
|
1110
1136
|
{
|
|
1111
1137
|
ref: rowRef,
|
|
1112
1138
|
direction: "row",
|
|
1113
1139
|
alignItems: "center",
|
|
1114
|
-
gap
|
|
1140
|
+
gap,
|
|
1115
1141
|
onDoubleClick: handleDoubleClick,
|
|
1116
1142
|
onKeyDown: handleKeyDown,
|
|
1117
1143
|
tabIndex: 0,
|
|
@@ -1122,13 +1148,13 @@ var VariableEditableCell = React7.memo(
|
|
|
1122
1148
|
editableContent
|
|
1123
1149
|
));
|
|
1124
1150
|
}
|
|
1125
|
-
return /* @__PURE__ */
|
|
1151
|
+
return /* @__PURE__ */ React8.createElement(
|
|
1126
1152
|
Stack2,
|
|
1127
1153
|
{
|
|
1128
1154
|
ref: rowRef,
|
|
1129
1155
|
direction: "row",
|
|
1130
1156
|
alignItems: "center",
|
|
1131
|
-
gap
|
|
1157
|
+
gap,
|
|
1132
1158
|
onDoubleClick: handleDoubleClick,
|
|
1133
1159
|
onKeyDown: handleKeyDown,
|
|
1134
1160
|
tabIndex: 0,
|
|
@@ -1141,30 +1167,6 @@ var VariableEditableCell = React7.memo(
|
|
|
1141
1167
|
}
|
|
1142
1168
|
);
|
|
1143
1169
|
|
|
1144
|
-
// src/components/variables-manager/variable-table-cell.tsx
|
|
1145
|
-
import * as React8 from "react";
|
|
1146
|
-
import { TableCell } from "@elementor/ui";
|
|
1147
|
-
var VariableTableCell = ({
|
|
1148
|
-
children,
|
|
1149
|
-
isHeader,
|
|
1150
|
-
width,
|
|
1151
|
-
maxWidth,
|
|
1152
|
-
align,
|
|
1153
|
-
noPadding,
|
|
1154
|
-
sx
|
|
1155
|
-
}) => {
|
|
1156
|
-
const baseSx = {
|
|
1157
|
-
maxWidth: maxWidth ?? 150,
|
|
1158
|
-
cursor: "initial",
|
|
1159
|
-
typography: "caption",
|
|
1160
|
-
...isHeader && { color: "text.primary", fontWeight: "bold" },
|
|
1161
|
-
...isHeader && !noPadding && { padding: "10px 16px" },
|
|
1162
|
-
...width && { width },
|
|
1163
|
-
...sx
|
|
1164
|
-
};
|
|
1165
|
-
return /* @__PURE__ */ React8.createElement(TableCell, { size: "small", padding: noPadding ? "none" : void 0, align, sx: baseSx }, children);
|
|
1166
|
-
};
|
|
1167
|
-
|
|
1168
1170
|
// src/components/variables-manager/variables-manager-table.tsx
|
|
1169
1171
|
var VariablesManagerTable = ({
|
|
1170
1172
|
menuActions,
|
|
@@ -1362,14 +1364,19 @@ var VariablesManagerTable = ({
|
|
|
1362
1364
|
}
|
|
1363
1365
|
},
|
|
1364
1366
|
editableElement: row.valueField,
|
|
1365
|
-
onRowRef: handleRowRef(row.id)
|
|
1367
|
+
onRowRef: handleRowRef(row.id),
|
|
1368
|
+
gap: 0.25
|
|
1366
1369
|
},
|
|
1367
1370
|
row.startIcon && row.startIcon({ value: row.value }),
|
|
1368
1371
|
/* @__PURE__ */ React9.createElement(
|
|
1369
1372
|
EllipsisWithTooltip,
|
|
1370
1373
|
{
|
|
1371
1374
|
title: row.value,
|
|
1372
|
-
sx: {
|
|
1375
|
+
sx: {
|
|
1376
|
+
border: "4px solid transparent",
|
|
1377
|
+
lineHeight: "1",
|
|
1378
|
+
pt: 0.25
|
|
1379
|
+
}
|
|
1373
1380
|
},
|
|
1374
1381
|
row.value
|
|
1375
1382
|
)
|