@elementor/editor-variables 4.0.0-564 → 4.0.0-591
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 +542 -549
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +399 -416
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/variables-manager/variables-manager-panel.tsx +53 -5
- package/src/components/ui/stop-sync-confirmation-dialog.tsx +0 -77
package/dist/index.js
CHANGED
|
@@ -50,18 +50,19 @@ var import_editor_props7 = require("@elementor/editor-props");
|
|
|
50
50
|
var import_menus = require("@elementor/menus");
|
|
51
51
|
|
|
52
52
|
// src/components/open-panel-from-url.tsx
|
|
53
|
-
var
|
|
53
|
+
var import_react14 = require("react");
|
|
54
54
|
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
55
55
|
|
|
56
56
|
// src/components/variables-manager/variables-manager-panel.tsx
|
|
57
|
-
var
|
|
58
|
-
var
|
|
57
|
+
var React14 = __toESM(require("react"));
|
|
58
|
+
var import_react13 = require("react");
|
|
59
|
+
var import_editor_current_user2 = require("@elementor/editor-current-user");
|
|
59
60
|
var import_editor_panels = require("@elementor/editor-panels");
|
|
60
61
|
var import_editor_ui5 = require("@elementor/editor-ui");
|
|
61
62
|
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
-
var
|
|
63
|
+
var import_icons5 = require("@elementor/icons");
|
|
64
|
+
var import_ui14 = require("@elementor/ui");
|
|
65
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
65
66
|
|
|
66
67
|
// src/utils/tracking.ts
|
|
67
68
|
var import_events = require("@elementor/events");
|
|
@@ -829,52 +830,14 @@ var NoSearchResults = ({ searchValue, onClear, icon }) => {
|
|
|
829
830
|
);
|
|
830
831
|
};
|
|
831
832
|
|
|
832
|
-
// src/components/ui/stop-sync-confirmation-dialog.tsx
|
|
833
|
-
var React5 = __toESM(require("react"));
|
|
834
|
-
var import_react = require("react");
|
|
835
|
-
var import_icons2 = require("@elementor/icons");
|
|
836
|
-
var import_ui6 = require("@elementor/ui");
|
|
837
|
-
var import_i18n7 = require("@wordpress/i18n");
|
|
838
|
-
var StopSyncConfirmationDialog = ({
|
|
839
|
-
open,
|
|
840
|
-
closeDialog,
|
|
841
|
-
onConfirm,
|
|
842
|
-
onSuppressMessage
|
|
843
|
-
}) => {
|
|
844
|
-
const [dontShowAgain, setDontShowAgain] = (0, import_react.useState)(false);
|
|
845
|
-
const handleConfirm = () => {
|
|
846
|
-
if (dontShowAgain) {
|
|
847
|
-
onSuppressMessage?.();
|
|
848
|
-
}
|
|
849
|
-
onConfirm();
|
|
850
|
-
};
|
|
851
|
-
return /* @__PURE__ */ React5.createElement(import_ui6.Dialog, { open, onClose: closeDialog, maxWidth: "xs" }, /* @__PURE__ */ React5.createElement(import_ui6.DialogTitle, { display: "flex", alignItems: "center", gap: 1 }, /* @__PURE__ */ React5.createElement(import_icons2.BrushIcon, { color: "secondary" }), (0, import_i18n7.__)("Stop syncing variable color", "elementor")), /* @__PURE__ */ React5.createElement(import_ui6.DialogContent, null, /* @__PURE__ */ React5.createElement(import_ui6.DialogContentText, { variant: "body2", color: "textPrimary" }, (0, import_i18n7.__)(
|
|
852
|
-
"This will disconnect the variable color from version 3. Existing uses on your site will automatically switch to a default color.",
|
|
853
|
-
"elementor"
|
|
854
|
-
))), /* @__PURE__ */ React5.createElement(import_ui6.DialogActions, { sx: { justifyContent: "space-between", alignItems: "center" } }, /* @__PURE__ */ React5.createElement(
|
|
855
|
-
import_ui6.FormControlLabel,
|
|
856
|
-
{
|
|
857
|
-
control: /* @__PURE__ */ React5.createElement(
|
|
858
|
-
import_ui6.Checkbox,
|
|
859
|
-
{
|
|
860
|
-
checked: dontShowAgain,
|
|
861
|
-
onChange: (event) => setDontShowAgain(event.target.checked),
|
|
862
|
-
size: "small"
|
|
863
|
-
}
|
|
864
|
-
),
|
|
865
|
-
label: /* @__PURE__ */ React5.createElement(import_ui6.Typography, { variant: "body2" }, (0, import_i18n7.__)("Don't show this again", "elementor"))
|
|
866
|
-
}
|
|
867
|
-
), /* @__PURE__ */ React5.createElement("div", null, /* @__PURE__ */ React5.createElement(import_ui6.Button, { color: "secondary", onClick: closeDialog }, (0, import_i18n7.__)("Cancel", "elementor")), /* @__PURE__ */ React5.createElement(import_ui6.Button, { variant: "contained", color: "secondary", onClick: handleConfirm, sx: { ml: 1 } }, (0, import_i18n7.__)("Got it", "elementor")))));
|
|
868
|
-
};
|
|
869
|
-
|
|
870
833
|
// src/components/variables-manager/hooks/use-auto-edit.ts
|
|
871
|
-
var
|
|
834
|
+
var import_react = require("react");
|
|
872
835
|
var useAutoEdit = () => {
|
|
873
|
-
const [autoEditVariableId, setAutoEditVariableId] = (0,
|
|
874
|
-
const startAutoEdit = (0,
|
|
836
|
+
const [autoEditVariableId, setAutoEditVariableId] = (0, import_react.useState)(void 0);
|
|
837
|
+
const startAutoEdit = (0, import_react.useCallback)((variableId) => {
|
|
875
838
|
setAutoEditVariableId(variableId);
|
|
876
839
|
}, []);
|
|
877
|
-
const handleAutoEditComplete = (0,
|
|
840
|
+
const handleAutoEditComplete = (0, import_react.useCallback)(() => {
|
|
878
841
|
setTimeout(() => {
|
|
879
842
|
setAutoEditVariableId(void 0);
|
|
880
843
|
}, 100);
|
|
@@ -887,10 +850,10 @@ var useAutoEdit = () => {
|
|
|
887
850
|
};
|
|
888
851
|
|
|
889
852
|
// src/components/variables-manager/hooks/use-error-navigation.ts
|
|
890
|
-
var
|
|
853
|
+
var import_react2 = require("react");
|
|
891
854
|
var useErrorNavigation = () => {
|
|
892
|
-
const currentIndexRef = (0,
|
|
893
|
-
const createNavigationCallback = (0,
|
|
855
|
+
const currentIndexRef = (0, import_react2.useRef)(0);
|
|
856
|
+
const createNavigationCallback = (0, import_react2.useCallback)(
|
|
894
857
|
(ids, onNavigate, onComplete) => {
|
|
895
858
|
return () => {
|
|
896
859
|
if (!ids?.length) {
|
|
@@ -912,7 +875,7 @@ var useErrorNavigation = () => {
|
|
|
912
875
|
},
|
|
913
876
|
[]
|
|
914
877
|
);
|
|
915
|
-
const resetNavigation = (0,
|
|
878
|
+
const resetNavigation = (0, import_react2.useCallback)(() => {
|
|
916
879
|
currentIndexRef.current = 0;
|
|
917
880
|
}, []);
|
|
918
881
|
return {
|
|
@@ -922,21 +885,21 @@ var useErrorNavigation = () => {
|
|
|
922
885
|
};
|
|
923
886
|
|
|
924
887
|
// src/components/variables-manager/hooks/use-variables-manager-state.ts
|
|
925
|
-
var
|
|
888
|
+
var import_react5 = require("react");
|
|
926
889
|
|
|
927
890
|
// src/hooks/use-prop-variables.ts
|
|
928
|
-
var
|
|
891
|
+
var import_react4 = require("react");
|
|
929
892
|
var import_editor_controls = require("@elementor/editor-controls");
|
|
930
893
|
|
|
931
894
|
// src/context/variable-type-context.tsx
|
|
932
|
-
var
|
|
933
|
-
var
|
|
934
|
-
var VariableTypeContext = (0,
|
|
895
|
+
var React5 = __toESM(require("react"));
|
|
896
|
+
var import_react3 = require("react");
|
|
897
|
+
var VariableTypeContext = (0, import_react3.createContext)(null);
|
|
935
898
|
function VariableTypeProvider({ children, propTypeKey }) {
|
|
936
|
-
return /* @__PURE__ */
|
|
899
|
+
return /* @__PURE__ */ React5.createElement(VariableTypeContext.Provider, { value: propTypeKey }, children);
|
|
937
900
|
}
|
|
938
901
|
function useVariableType() {
|
|
939
|
-
const context = (0,
|
|
902
|
+
const context = (0, import_react3.useContext)(VariableTypeContext);
|
|
940
903
|
if (context === null) {
|
|
941
904
|
throw new Error("useVariableType must be used within a VariableTypeProvider");
|
|
942
905
|
}
|
|
@@ -1019,7 +982,7 @@ var useVariableSelectionFilter = (variables) => {
|
|
|
1019
982
|
return selectionFilter ? selectionFilter(variables, propType) : variables;
|
|
1020
983
|
};
|
|
1021
984
|
var usePropVariables = (propKey) => {
|
|
1022
|
-
return (0,
|
|
985
|
+
return (0, import_react4.useMemo)(() => normalizeVariables(propKey), [propKey]);
|
|
1023
986
|
};
|
|
1024
987
|
var getMatchingTypes = (propKey) => {
|
|
1025
988
|
const matchingTypes = [];
|
|
@@ -1053,20 +1016,20 @@ var restoreVariable = (restoreId, label, value, type) => {
|
|
|
1053
1016
|
|
|
1054
1017
|
// src/components/variables-manager/hooks/use-variables-manager-state.ts
|
|
1055
1018
|
var useVariablesManagerState = () => {
|
|
1056
|
-
const [variables, setVariables] = (0,
|
|
1057
|
-
const [deletedVariables, setDeletedVariables] = (0,
|
|
1058
|
-
const [isSaveDisabled, setIsSaveDisabled] = (0,
|
|
1059
|
-
const [isDirty, setIsDirty] = (0,
|
|
1060
|
-
const [isSaving, setIsSaving] = (0,
|
|
1061
|
-
const [searchValue, setSearchValue] = (0,
|
|
1062
|
-
const handleOnChange = (0,
|
|
1019
|
+
const [variables, setVariables] = (0, import_react5.useState)(() => getVariables(false));
|
|
1020
|
+
const [deletedVariables, setDeletedVariables] = (0, import_react5.useState)([]);
|
|
1021
|
+
const [isSaveDisabled, setIsSaveDisabled] = (0, import_react5.useState)(false);
|
|
1022
|
+
const [isDirty, setIsDirty] = (0, import_react5.useState)(false);
|
|
1023
|
+
const [isSaving, setIsSaving] = (0, import_react5.useState)(false);
|
|
1024
|
+
const [searchValue, setSearchValue] = (0, import_react5.useState)("");
|
|
1025
|
+
const handleOnChange = (0, import_react5.useCallback)(
|
|
1063
1026
|
(newVariables) => {
|
|
1064
1027
|
setVariables({ ...variables, ...newVariables });
|
|
1065
1028
|
setIsDirty(true);
|
|
1066
1029
|
},
|
|
1067
1030
|
[variables]
|
|
1068
1031
|
);
|
|
1069
|
-
const createVariable2 = (0,
|
|
1032
|
+
const createVariable2 = (0, import_react5.useCallback)((type, defaultName, defaultValue) => {
|
|
1070
1033
|
const newId = generateTempId();
|
|
1071
1034
|
const newVariable = {
|
|
1072
1035
|
id: newId,
|
|
@@ -1078,19 +1041,19 @@ var useVariablesManagerState = () => {
|
|
|
1078
1041
|
setIsDirty(true);
|
|
1079
1042
|
return newId;
|
|
1080
1043
|
}, []);
|
|
1081
|
-
const handleDeleteVariable = (0,
|
|
1044
|
+
const handleDeleteVariable = (0, import_react5.useCallback)((itemId) => {
|
|
1082
1045
|
setDeletedVariables((prev) => [...prev, itemId]);
|
|
1083
1046
|
setVariables((prev) => ({ ...prev, [itemId]: { ...prev[itemId], deleted: true } }));
|
|
1084
1047
|
setIsDirty(true);
|
|
1085
1048
|
}, []);
|
|
1086
|
-
const handleStartSync = (0,
|
|
1049
|
+
const handleStartSync = (0, import_react5.useCallback)((itemId) => {
|
|
1087
1050
|
setVariables((prev) => ({
|
|
1088
1051
|
...prev,
|
|
1089
1052
|
[itemId]: { ...prev[itemId], sync_to_v3: true }
|
|
1090
1053
|
}));
|
|
1091
1054
|
setIsDirty(true);
|
|
1092
1055
|
}, []);
|
|
1093
|
-
const handleStopSync = (0,
|
|
1056
|
+
const handleStopSync = (0, import_react5.useCallback)((itemId) => {
|
|
1094
1057
|
setVariables((prev) => ({
|
|
1095
1058
|
...prev,
|
|
1096
1059
|
[itemId]: { ...prev[itemId], sync_to_v3: false }
|
|
@@ -1100,7 +1063,7 @@ var useVariablesManagerState = () => {
|
|
|
1100
1063
|
const handleSearch = (searchTerm) => {
|
|
1101
1064
|
setSearchValue(searchTerm);
|
|
1102
1065
|
};
|
|
1103
|
-
const handleSave = (0,
|
|
1066
|
+
const handleSave = (0, import_react5.useCallback)(async () => {
|
|
1104
1067
|
const originalVariables = getVariables(false);
|
|
1105
1068
|
setIsSaving(true);
|
|
1106
1069
|
const result = await service.batchSave(originalVariables, variables, deletedVariables);
|
|
@@ -1113,7 +1076,7 @@ var useVariablesManagerState = () => {
|
|
|
1113
1076
|
}
|
|
1114
1077
|
return { success: result.success };
|
|
1115
1078
|
}, [variables, deletedVariables]);
|
|
1116
|
-
const filteredVariables = (0,
|
|
1079
|
+
const filteredVariables = (0, import_react5.useCallback)(() => {
|
|
1117
1080
|
const list = variablesToList(variables).filter((v) => !v.deleted);
|
|
1118
1081
|
const typeFiltered = applySelectionFilters(list, getVariableTypes());
|
|
1119
1082
|
const searchFiltered = filterBySearch(typeFiltered, searchValue);
|
|
@@ -1139,12 +1102,12 @@ var useVariablesManagerState = () => {
|
|
|
1139
1102
|
};
|
|
1140
1103
|
|
|
1141
1104
|
// src/components/variables-manager/variables-manager-create-menu.tsx
|
|
1142
|
-
var
|
|
1143
|
-
var
|
|
1144
|
-
var
|
|
1145
|
-
var
|
|
1105
|
+
var React7 = __toESM(require("react"));
|
|
1106
|
+
var import_react7 = require("react");
|
|
1107
|
+
var import_icons2 = require("@elementor/icons");
|
|
1108
|
+
var import_ui7 = require("@elementor/ui");
|
|
1146
1109
|
var import_utils2 = require("@elementor/utils");
|
|
1147
|
-
var
|
|
1110
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
1148
1111
|
|
|
1149
1112
|
// src/hooks/use-quota-permissions.ts
|
|
1150
1113
|
var useQuotaPermissions = (variableType) => {
|
|
@@ -1162,43 +1125,43 @@ var useQuotaPermissions = (variableType) => {
|
|
|
1162
1125
|
};
|
|
1163
1126
|
|
|
1164
1127
|
// src/components/ui/variable-promotion-chip.tsx
|
|
1165
|
-
var
|
|
1166
|
-
var
|
|
1128
|
+
var React6 = __toESM(require("react"));
|
|
1129
|
+
var import_react6 = require("react");
|
|
1167
1130
|
var import_editor_ui2 = require("@elementor/editor-ui");
|
|
1168
|
-
var
|
|
1131
|
+
var import_ui6 = require("@elementor/ui");
|
|
1169
1132
|
var import_utils = require("@elementor/utils");
|
|
1170
|
-
var
|
|
1171
|
-
var VariablePromotionChip = (0,
|
|
1133
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
1134
|
+
var VariablePromotionChip = (0, import_react6.forwardRef)(
|
|
1172
1135
|
({ variableType, upgradeUrl }, ref) => {
|
|
1173
|
-
const [isOpen, setIsOpen] = (0,
|
|
1136
|
+
const [isOpen, setIsOpen] = (0, import_react6.useState)(false);
|
|
1174
1137
|
(0, import_editor_ui2.useCanvasClickHandler)(isOpen, () => setIsOpen(false));
|
|
1175
1138
|
const toggle = () => setIsOpen((prev) => !prev);
|
|
1176
|
-
(0,
|
|
1177
|
-
const title = (0,
|
|
1139
|
+
(0, import_react6.useImperativeHandle)(ref, () => ({ toggle }), []);
|
|
1140
|
+
const title = (0, import_i18n7.sprintf)(
|
|
1178
1141
|
/* translators: %s: Variable Type. */
|
|
1179
|
-
(0,
|
|
1142
|
+
(0, import_i18n7.__)("%s variables", "elementor"),
|
|
1180
1143
|
(0, import_utils.capitalize)(variableType)
|
|
1181
1144
|
);
|
|
1182
|
-
const content = (0,
|
|
1145
|
+
const content = (0, import_i18n7.sprintf)(
|
|
1183
1146
|
/* translators: %s: Variable Type. */
|
|
1184
|
-
(0,
|
|
1147
|
+
(0, import_i18n7.__)("Upgrade to continue creating and editing %s variables.", "elementor"),
|
|
1185
1148
|
variableType
|
|
1186
1149
|
);
|
|
1187
|
-
return /* @__PURE__ */
|
|
1150
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1188
1151
|
import_editor_ui2.PromotionPopover,
|
|
1189
1152
|
{
|
|
1190
1153
|
open: isOpen,
|
|
1191
1154
|
title,
|
|
1192
1155
|
content,
|
|
1193
|
-
ctaText: (0,
|
|
1156
|
+
ctaText: (0, import_i18n7.__)("Upgrade now", "elementor"),
|
|
1194
1157
|
ctaUrl: upgradeUrl,
|
|
1195
1158
|
onClose: (e) => {
|
|
1196
1159
|
e.stopPropagation();
|
|
1197
1160
|
setIsOpen(false);
|
|
1198
1161
|
}
|
|
1199
1162
|
},
|
|
1200
|
-
/* @__PURE__ */
|
|
1201
|
-
|
|
1163
|
+
/* @__PURE__ */ React6.createElement(
|
|
1164
|
+
import_ui6.Box,
|
|
1202
1165
|
{
|
|
1203
1166
|
onClick: (e) => {
|
|
1204
1167
|
e.stopPropagation();
|
|
@@ -1206,7 +1169,7 @@ var VariablePromotionChip = (0, import_react7.forwardRef)(
|
|
|
1206
1169
|
},
|
|
1207
1170
|
sx: { cursor: "pointer", display: "inline-flex" }
|
|
1208
1171
|
},
|
|
1209
|
-
/* @__PURE__ */
|
|
1172
|
+
/* @__PURE__ */ React6.createElement(import_editor_ui2.PromotionChip, null)
|
|
1210
1173
|
)
|
|
1211
1174
|
);
|
|
1212
1175
|
}
|
|
@@ -1215,9 +1178,9 @@ var VariablePromotionChip = (0, import_react7.forwardRef)(
|
|
|
1215
1178
|
// src/components/variables-manager/variables-manager-create-menu.tsx
|
|
1216
1179
|
var SIZE = "tiny";
|
|
1217
1180
|
var VariableManagerCreateMenu = ({ variables, onCreate, menuState }) => {
|
|
1218
|
-
const buttonRef = (0,
|
|
1181
|
+
const buttonRef = (0, import_react7.useRef)(null);
|
|
1219
1182
|
const variableTypes = getVariableTypes();
|
|
1220
|
-
const menuOptionConfigs = (0,
|
|
1183
|
+
const menuOptionConfigs = (0, import_react7.useMemo)(
|
|
1221
1184
|
() => Object.entries(variableTypes).filter(([, variable]) => !!variable.defaultValue).map(([key, variable]) => ({
|
|
1222
1185
|
key,
|
|
1223
1186
|
propTypeKey: variable.propTypeUtil.key,
|
|
@@ -1227,17 +1190,17 @@ var VariableManagerCreateMenu = ({ variables, onCreate, menuState }) => {
|
|
|
1227
1190
|
})),
|
|
1228
1191
|
[variableTypes]
|
|
1229
1192
|
);
|
|
1230
|
-
return /* @__PURE__ */
|
|
1231
|
-
|
|
1193
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(
|
|
1194
|
+
import_ui7.IconButton,
|
|
1232
1195
|
{
|
|
1233
|
-
...(0,
|
|
1196
|
+
...(0, import_ui7.bindTrigger)(menuState),
|
|
1234
1197
|
ref: buttonRef,
|
|
1235
1198
|
size: SIZE,
|
|
1236
|
-
"aria-label": (0,
|
|
1199
|
+
"aria-label": (0, import_i18n8.__)("Add variable", "elementor")
|
|
1237
1200
|
},
|
|
1238
|
-
/* @__PURE__ */
|
|
1239
|
-
), /* @__PURE__ */
|
|
1240
|
-
|
|
1201
|
+
/* @__PURE__ */ React7.createElement(import_icons2.PlusIcon, { fontSize: SIZE })
|
|
1202
|
+
), /* @__PURE__ */ React7.createElement(
|
|
1203
|
+
import_ui7.Menu,
|
|
1241
1204
|
{
|
|
1242
1205
|
disablePortal: true,
|
|
1243
1206
|
MenuListProps: {
|
|
@@ -1246,7 +1209,7 @@ var VariableManagerCreateMenu = ({ variables, onCreate, menuState }) => {
|
|
|
1246
1209
|
PaperProps: {
|
|
1247
1210
|
elevation: 6
|
|
1248
1211
|
},
|
|
1249
|
-
...(0,
|
|
1212
|
+
...(0, import_ui7.bindMenu)(menuState),
|
|
1250
1213
|
anchorEl: buttonRef.current,
|
|
1251
1214
|
anchorOrigin: {
|
|
1252
1215
|
vertical: "bottom",
|
|
@@ -1258,7 +1221,7 @@ var VariableManagerCreateMenu = ({ variables, onCreate, menuState }) => {
|
|
|
1258
1221
|
},
|
|
1259
1222
|
"data-testid": "variable-manager-create-menu"
|
|
1260
1223
|
},
|
|
1261
|
-
menuOptionConfigs.map((config) => /* @__PURE__ */
|
|
1224
|
+
menuOptionConfigs.map((config) => /* @__PURE__ */ React7.createElement(
|
|
1262
1225
|
MenuOption,
|
|
1263
1226
|
{
|
|
1264
1227
|
key: config.key,
|
|
@@ -1276,7 +1239,7 @@ var MenuOption = ({
|
|
|
1276
1239
|
onCreate,
|
|
1277
1240
|
onClose
|
|
1278
1241
|
}) => {
|
|
1279
|
-
const promotionRef = (0,
|
|
1242
|
+
const promotionRef = (0, import_react7.useRef)(null);
|
|
1280
1243
|
const userQuotaPermissions = useQuotaPermissions(config.propTypeKey);
|
|
1281
1244
|
const displayName = (0, import_utils2.capitalize)(config.variableType);
|
|
1282
1245
|
const isDisabled = !userQuotaPermissions.canAdd();
|
|
@@ -1290,7 +1253,7 @@ var MenuOption = ({
|
|
|
1290
1253
|
trackVariablesManagerEvent({ action: "add", varType: config.variableType });
|
|
1291
1254
|
onClose();
|
|
1292
1255
|
};
|
|
1293
|
-
return /* @__PURE__ */
|
|
1256
|
+
return /* @__PURE__ */ React7.createElement(import_ui7.MenuItem, { onClick: handleClick, sx: { gap: 1.5, cursor: "pointer" } }, (0, import_react7.createElement)(config.icon, { fontSize: SIZE, color: isDisabled ? "disabled" : "action" }), /* @__PURE__ */ React7.createElement(import_ui7.Typography, { variant: "caption", color: isDisabled ? "text.disabled" : "text.primary" }, displayName), isDisabled && /* @__PURE__ */ React7.createElement(
|
|
1294
1257
|
VariablePromotionChip,
|
|
1295
1258
|
{
|
|
1296
1259
|
variableType: config.variableType,
|
|
@@ -1311,14 +1274,14 @@ var getDefaultName = (variables, type, baseName) => {
|
|
|
1311
1274
|
};
|
|
1312
1275
|
|
|
1313
1276
|
// src/components/variables-manager/variables-manager-table.tsx
|
|
1314
|
-
var
|
|
1315
|
-
var
|
|
1316
|
-
var
|
|
1317
|
-
var
|
|
1277
|
+
var React13 = __toESM(require("react"));
|
|
1278
|
+
var import_react12 = require("react");
|
|
1279
|
+
var import_ui13 = require("@elementor/ui");
|
|
1280
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
1318
1281
|
|
|
1319
1282
|
// src/components/variables-manager/ui/variable-table-cell.tsx
|
|
1320
|
-
var
|
|
1321
|
-
var
|
|
1283
|
+
var React8 = __toESM(require("react"));
|
|
1284
|
+
var import_ui8 = require("@elementor/ui");
|
|
1322
1285
|
var VariableTableCell = ({
|
|
1323
1286
|
children,
|
|
1324
1287
|
isHeader,
|
|
@@ -1337,26 +1300,26 @@ var VariableTableCell = ({
|
|
|
1337
1300
|
...width && { width },
|
|
1338
1301
|
...sx
|
|
1339
1302
|
};
|
|
1340
|
-
return /* @__PURE__ */
|
|
1303
|
+
return /* @__PURE__ */ React8.createElement(import_ui8.TableCell, { size: "small", padding: noPadding ? "none" : void 0, align, sx: baseSx }, children);
|
|
1341
1304
|
};
|
|
1342
1305
|
|
|
1343
1306
|
// src/components/variables-manager/ui/variable-table-row.tsx
|
|
1344
|
-
var
|
|
1345
|
-
var
|
|
1307
|
+
var React12 = __toESM(require("react"));
|
|
1308
|
+
var import_react11 = require("react");
|
|
1346
1309
|
var import_editor_ui4 = require("@elementor/editor-ui");
|
|
1347
|
-
var
|
|
1348
|
-
var
|
|
1310
|
+
var import_icons4 = require("@elementor/icons");
|
|
1311
|
+
var import_ui12 = require("@elementor/ui");
|
|
1349
1312
|
|
|
1350
1313
|
// src/components/fields/label-field.tsx
|
|
1351
|
-
var
|
|
1352
|
-
var
|
|
1314
|
+
var React9 = __toESM(require("react"));
|
|
1315
|
+
var import_react8 = require("react");
|
|
1353
1316
|
var import_editor_ui3 = require("@elementor/editor-ui");
|
|
1354
|
-
var
|
|
1317
|
+
var import_ui9 = require("@elementor/ui");
|
|
1355
1318
|
function isLabelEqual(a, b) {
|
|
1356
1319
|
return a.trim().toLowerCase() === b.trim().toLowerCase();
|
|
1357
1320
|
}
|
|
1358
1321
|
var useLabelError = (initialError) => {
|
|
1359
|
-
const [error, setError] = (0,
|
|
1322
|
+
const [error, setError] = (0, import_react8.useState)(initialError ?? { value: "", message: "" });
|
|
1360
1323
|
return {
|
|
1361
1324
|
labelFieldError: error,
|
|
1362
1325
|
setLabelFieldError: setError
|
|
@@ -1375,9 +1338,9 @@ var LabelField = ({
|
|
|
1375
1338
|
variables,
|
|
1376
1339
|
onKeyDown
|
|
1377
1340
|
}) => {
|
|
1378
|
-
const [label, setLabel] = (0,
|
|
1379
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
1380
|
-
const fieldRef = (0,
|
|
1341
|
+
const [label, setLabel] = (0, import_react8.useState)(value);
|
|
1342
|
+
const [errorMessage, setErrorMessage] = (0, import_react8.useState)("");
|
|
1343
|
+
const fieldRef = (0, import_react8.useRef)(null);
|
|
1381
1344
|
const handleChange = (newValue) => {
|
|
1382
1345
|
setLabel(newValue);
|
|
1383
1346
|
const errorMsg2 = validateLabel(newValue, variables);
|
|
@@ -1390,8 +1353,8 @@ var LabelField = ({
|
|
|
1390
1353
|
errorMsg = error.message;
|
|
1391
1354
|
}
|
|
1392
1355
|
const hintMsg = !errorMsg ? labelHint(label) : "";
|
|
1393
|
-
const textField = /* @__PURE__ */
|
|
1394
|
-
|
|
1356
|
+
const textField = /* @__PURE__ */ React9.createElement(
|
|
1357
|
+
import_ui9.TextField,
|
|
1395
1358
|
{
|
|
1396
1359
|
ref: fieldRef,
|
|
1397
1360
|
id: id2,
|
|
@@ -1411,7 +1374,7 @@ var LabelField = ({
|
|
|
1411
1374
|
);
|
|
1412
1375
|
if (showWarningInfotip) {
|
|
1413
1376
|
const tooltipWidth = Math.max(240, fieldRef.current?.getBoundingClientRect().width ?? 240);
|
|
1414
|
-
return /* @__PURE__ */
|
|
1377
|
+
return /* @__PURE__ */ React9.createElement(
|
|
1415
1378
|
import_editor_ui3.WarningInfotip,
|
|
1416
1379
|
{
|
|
1417
1380
|
open: Boolean(errorMsg || hintMsg),
|
|
@@ -1428,10 +1391,10 @@ var LabelField = ({
|
|
|
1428
1391
|
};
|
|
1429
1392
|
|
|
1430
1393
|
// src/components/variables-manager/variable-editable-cell.tsx
|
|
1431
|
-
var
|
|
1432
|
-
var
|
|
1433
|
-
var
|
|
1434
|
-
var VariableEditableCell =
|
|
1394
|
+
var React10 = __toESM(require("react"));
|
|
1395
|
+
var import_react9 = require("react");
|
|
1396
|
+
var import_ui10 = require("@elementor/ui");
|
|
1397
|
+
var VariableEditableCell = React10.memo(
|
|
1435
1398
|
({
|
|
1436
1399
|
initialValue,
|
|
1437
1400
|
children,
|
|
@@ -1445,22 +1408,22 @@ var VariableEditableCell = React11.memo(
|
|
|
1445
1408
|
fieldType,
|
|
1446
1409
|
disabled = false
|
|
1447
1410
|
}) => {
|
|
1448
|
-
const [value, setValue] = (0,
|
|
1449
|
-
const [isEditing, setIsEditing] = (0,
|
|
1411
|
+
const [value, setValue] = (0, import_react9.useState)(initialValue);
|
|
1412
|
+
const [isEditing, setIsEditing] = (0, import_react9.useState)(false);
|
|
1450
1413
|
const { labelFieldError, setLabelFieldError } = useLabelError();
|
|
1451
|
-
const [valueFieldError, setValueFieldError] = (0,
|
|
1452
|
-
const rowRef = (0,
|
|
1453
|
-
const handleSave = (0,
|
|
1414
|
+
const [valueFieldError, setValueFieldError] = (0, import_react9.useState)("");
|
|
1415
|
+
const rowRef = (0, import_react9.useRef)(null);
|
|
1416
|
+
const handleSave = (0, import_react9.useCallback)(() => {
|
|
1454
1417
|
const hasError = fieldType === "label" && labelFieldError?.message || fieldType === "value" && valueFieldError;
|
|
1455
1418
|
if (!hasError) {
|
|
1456
1419
|
onChange(value);
|
|
1457
1420
|
}
|
|
1458
1421
|
setIsEditing(false);
|
|
1459
1422
|
}, [value, onChange, fieldType, labelFieldError, valueFieldError]);
|
|
1460
|
-
(0,
|
|
1423
|
+
(0, import_react9.useEffect)(() => {
|
|
1461
1424
|
onRowRef?.(rowRef?.current);
|
|
1462
1425
|
}, [onRowRef]);
|
|
1463
|
-
(0,
|
|
1426
|
+
(0, import_react9.useEffect)(() => {
|
|
1464
1427
|
if (autoEdit && !isEditing && !disabled) {
|
|
1465
1428
|
setIsEditing(true);
|
|
1466
1429
|
onAutoEditComplete?.();
|
|
@@ -1486,10 +1449,10 @@ var VariableEditableCell = React11.memo(
|
|
|
1486
1449
|
setIsEditing(true);
|
|
1487
1450
|
}
|
|
1488
1451
|
};
|
|
1489
|
-
const handleChange = (0,
|
|
1452
|
+
const handleChange = (0, import_react9.useCallback)((newValue) => {
|
|
1490
1453
|
setValue(newValue);
|
|
1491
1454
|
}, []);
|
|
1492
|
-
const handleValidationChange = (0,
|
|
1455
|
+
const handleValidationChange = (0, import_react9.useCallback)(
|
|
1493
1456
|
(errorMsg) => {
|
|
1494
1457
|
if (fieldType === "label") {
|
|
1495
1458
|
setLabelFieldError({
|
|
@@ -1515,8 +1478,8 @@ var VariableEditableCell = React11.memo(
|
|
|
1515
1478
|
error: currentError
|
|
1516
1479
|
});
|
|
1517
1480
|
if (isEditing) {
|
|
1518
|
-
return /* @__PURE__ */
|
|
1519
|
-
|
|
1481
|
+
return /* @__PURE__ */ React10.createElement(import_ui10.ClickAwayListener, { onClickAway: handleSave }, /* @__PURE__ */ React10.createElement(
|
|
1482
|
+
import_ui10.Stack,
|
|
1520
1483
|
{
|
|
1521
1484
|
ref: rowRef,
|
|
1522
1485
|
direction: "row",
|
|
@@ -1532,8 +1495,8 @@ var VariableEditableCell = React11.memo(
|
|
|
1532
1495
|
editableContent
|
|
1533
1496
|
));
|
|
1534
1497
|
}
|
|
1535
|
-
return /* @__PURE__ */
|
|
1536
|
-
|
|
1498
|
+
return /* @__PURE__ */ React10.createElement(
|
|
1499
|
+
import_ui10.Stack,
|
|
1537
1500
|
{
|
|
1538
1501
|
ref: rowRef,
|
|
1539
1502
|
direction: "row",
|
|
@@ -1552,17 +1515,17 @@ var VariableEditableCell = React11.memo(
|
|
|
1552
1515
|
);
|
|
1553
1516
|
|
|
1554
1517
|
// src/components/variables-manager/ui/variable-edit-menu.tsx
|
|
1555
|
-
var
|
|
1556
|
-
var
|
|
1557
|
-
var
|
|
1558
|
-
var
|
|
1518
|
+
var React11 = __toESM(require("react"));
|
|
1519
|
+
var import_react10 = require("react");
|
|
1520
|
+
var import_icons3 = require("@elementor/icons");
|
|
1521
|
+
var import_ui11 = require("@elementor/ui");
|
|
1559
1522
|
var VariableEditMenu = ({ menuActions, disabled, itemId }) => {
|
|
1560
|
-
const menuState = (0,
|
|
1523
|
+
const menuState = (0, import_ui11.usePopupState)({
|
|
1561
1524
|
variant: "popover"
|
|
1562
1525
|
});
|
|
1563
|
-
const triggerProps = (0,
|
|
1564
|
-
return /* @__PURE__ */
|
|
1565
|
-
|
|
1526
|
+
const triggerProps = (0, import_ui11.bindTrigger)(menuState);
|
|
1527
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(
|
|
1528
|
+
import_ui11.IconButton,
|
|
1566
1529
|
{
|
|
1567
1530
|
...triggerProps,
|
|
1568
1531
|
disabled,
|
|
@@ -1572,9 +1535,9 @@ var VariableEditMenu = ({ menuActions, disabled, itemId }) => {
|
|
|
1572
1535
|
triggerProps.onClick?.(e);
|
|
1573
1536
|
}
|
|
1574
1537
|
},
|
|
1575
|
-
/* @__PURE__ */
|
|
1576
|
-
), /* @__PURE__ */
|
|
1577
|
-
|
|
1538
|
+
/* @__PURE__ */ React11.createElement(import_icons3.DotsVerticalIcon, { fontSize: "tiny" })
|
|
1539
|
+
), /* @__PURE__ */ React11.createElement(
|
|
1540
|
+
import_ui11.Menu,
|
|
1578
1541
|
{
|
|
1579
1542
|
disablePortal: true,
|
|
1580
1543
|
MenuListProps: {
|
|
@@ -1583,7 +1546,7 @@ var VariableEditMenu = ({ menuActions, disabled, itemId }) => {
|
|
|
1583
1546
|
PaperProps: {
|
|
1584
1547
|
elevation: 6
|
|
1585
1548
|
},
|
|
1586
|
-
...(0,
|
|
1549
|
+
...(0, import_ui11.bindMenu)(menuState),
|
|
1587
1550
|
anchorEl: menuState.anchorEl,
|
|
1588
1551
|
anchorOrigin: {
|
|
1589
1552
|
vertical: "bottom",
|
|
@@ -1596,8 +1559,8 @@ var VariableEditMenu = ({ menuActions, disabled, itemId }) => {
|
|
|
1596
1559
|
open: menuState.isOpen,
|
|
1597
1560
|
onClose: menuState.close
|
|
1598
1561
|
},
|
|
1599
|
-
menuActions.map((action) => /* @__PURE__ */
|
|
1600
|
-
|
|
1562
|
+
menuActions.map((action) => /* @__PURE__ */ React11.createElement(
|
|
1563
|
+
import_ui11.MenuItem,
|
|
1601
1564
|
{
|
|
1602
1565
|
key: action.name,
|
|
1603
1566
|
onClick: (e) => {
|
|
@@ -1610,7 +1573,7 @@ var VariableEditMenu = ({ menuActions, disabled, itemId }) => {
|
|
|
1610
1573
|
gap: 1
|
|
1611
1574
|
}
|
|
1612
1575
|
},
|
|
1613
|
-
action.icon && (0,
|
|
1576
|
+
action.icon && (0, import_react10.createElement)(action.icon, {
|
|
1614
1577
|
fontSize: "inherit"
|
|
1615
1578
|
}),
|
|
1616
1579
|
" ",
|
|
@@ -1640,12 +1603,12 @@ var VariableRow = (props) => {
|
|
|
1640
1603
|
setTriggerRef,
|
|
1641
1604
|
isSorting
|
|
1642
1605
|
} = props;
|
|
1643
|
-
const promotionRef = (0,
|
|
1606
|
+
const promotionRef = (0, import_react11.useRef)(null);
|
|
1644
1607
|
const isDisabled = !useQuotaPermissions(row.type).canEdit();
|
|
1645
1608
|
const showIndicationBefore = showDropIndication && dropPosition === "before";
|
|
1646
1609
|
const showIndicationAfter = showDropIndication && dropPosition === "after";
|
|
1647
|
-
return /* @__PURE__ */
|
|
1648
|
-
|
|
1610
|
+
return /* @__PURE__ */ React12.createElement(
|
|
1611
|
+
import_ui12.TableRow,
|
|
1649
1612
|
{
|
|
1650
1613
|
...itemProps,
|
|
1651
1614
|
ref: itemProps.ref,
|
|
@@ -1685,8 +1648,8 @@ var VariableRow = (props) => {
|
|
|
1685
1648
|
}
|
|
1686
1649
|
}
|
|
1687
1650
|
},
|
|
1688
|
-
/* @__PURE__ */
|
|
1689
|
-
/* @__PURE__ */
|
|
1651
|
+
/* @__PURE__ */ React12.createElement(VariableTableCell, { noPadding: true, width: 10, maxWidth: 10 }, /* @__PURE__ */ React12.createElement(import_ui12.IconButton, { size: "small", ref: setTriggerRef, ...triggerProps, disabled: isSorting, draggable: true }, /* @__PURE__ */ React12.createElement(import_icons4.GripVerticalIcon, { fontSize: "inherit" }))),
|
|
1652
|
+
/* @__PURE__ */ React12.createElement(VariableTableCell, null, /* @__PURE__ */ React12.createElement(
|
|
1690
1653
|
VariableEditableCell,
|
|
1691
1654
|
{
|
|
1692
1655
|
initialValue: row.name,
|
|
@@ -1698,11 +1661,11 @@ var VariableRow = (props) => {
|
|
|
1698
1661
|
});
|
|
1699
1662
|
}
|
|
1700
1663
|
},
|
|
1701
|
-
prefixElement: (0,
|
|
1664
|
+
prefixElement: (0, import_react11.createElement)(row.icon, {
|
|
1702
1665
|
fontSize: "inherit",
|
|
1703
1666
|
color: isDisabled ? "disabled" : "inherit"
|
|
1704
1667
|
}),
|
|
1705
|
-
editableElement: ({ value, onChange, onValidationChange, error }) => /* @__PURE__ */
|
|
1668
|
+
editableElement: ({ value, onChange, onValidationChange, error }) => /* @__PURE__ */ React12.createElement(
|
|
1706
1669
|
LabelField,
|
|
1707
1670
|
{
|
|
1708
1671
|
id: "variable-label-" + row.id,
|
|
@@ -1726,9 +1689,9 @@ var VariableRow = (props) => {
|
|
|
1726
1689
|
fieldType: "label",
|
|
1727
1690
|
disabled: isDisabled
|
|
1728
1691
|
},
|
|
1729
|
-
/* @__PURE__ */
|
|
1692
|
+
/* @__PURE__ */ React12.createElement(import_editor_ui4.EllipsisWithTooltip, { title: row.name, sx: { border: "4px solid transparent" } }, row.name)
|
|
1730
1693
|
)),
|
|
1731
|
-
/* @__PURE__ */
|
|
1694
|
+
/* @__PURE__ */ React12.createElement(VariableTableCell, null, /* @__PURE__ */ React12.createElement(
|
|
1732
1695
|
VariableEditableCell,
|
|
1733
1696
|
{
|
|
1734
1697
|
initialValue: row.value,
|
|
@@ -1757,14 +1720,14 @@ var VariableRow = (props) => {
|
|
|
1757
1720
|
onFieldError?.(!!errorMsg);
|
|
1758
1721
|
},
|
|
1759
1722
|
error
|
|
1760
|
-
}) ?? /* @__PURE__ */
|
|
1723
|
+
}) ?? /* @__PURE__ */ React12.createElement(React12.Fragment, null),
|
|
1761
1724
|
onRowRef: handleRowRef(row.id),
|
|
1762
1725
|
gap: 0.25,
|
|
1763
1726
|
fieldType: "value",
|
|
1764
1727
|
disabled: isDisabled
|
|
1765
1728
|
},
|
|
1766
1729
|
row.startIcon && row.startIcon({ value: row.value }),
|
|
1767
|
-
/* @__PURE__ */
|
|
1730
|
+
/* @__PURE__ */ React12.createElement(
|
|
1768
1731
|
import_editor_ui4.EllipsisWithTooltip,
|
|
1769
1732
|
{
|
|
1770
1733
|
title: row.value,
|
|
@@ -1777,14 +1740,14 @@ var VariableRow = (props) => {
|
|
|
1777
1740
|
row.value
|
|
1778
1741
|
)
|
|
1779
1742
|
)),
|
|
1780
|
-
/* @__PURE__ */
|
|
1743
|
+
/* @__PURE__ */ React12.createElement(VariableTableCell, { align: "right", noPadding: true, width: 16, maxWidth: 16, sx: { paddingInlineEnd: 1 } }, /* @__PURE__ */ React12.createElement(import_ui12.Stack, { role: "toolbar", direction: "row", justifyContent: "flex-end", alignItems: "center" }, isDisabled && /* @__PURE__ */ React12.createElement(
|
|
1781
1744
|
VariablePromotionChip,
|
|
1782
1745
|
{
|
|
1783
1746
|
variableType: row.variableType,
|
|
1784
1747
|
upgradeUrl: `https://go.elementor.com/renew-license-manager-${row.variableType}-variable`,
|
|
1785
1748
|
ref: promotionRef
|
|
1786
1749
|
}
|
|
1787
|
-
), /* @__PURE__ */
|
|
1750
|
+
), /* @__PURE__ */ React12.createElement(VariableEditMenu, { menuActions: menuActions(row.id), disabled: isSorting, itemId: row.id })))
|
|
1788
1751
|
);
|
|
1789
1752
|
};
|
|
1790
1753
|
|
|
@@ -1797,9 +1760,9 @@ var VariablesManagerTable = ({
|
|
|
1797
1760
|
onAutoEditComplete,
|
|
1798
1761
|
onFieldError
|
|
1799
1762
|
}) => {
|
|
1800
|
-
const tableContainerRef = (0,
|
|
1801
|
-
const variableRowRefs = (0,
|
|
1802
|
-
(0,
|
|
1763
|
+
const tableContainerRef = (0, import_react12.useRef)(null);
|
|
1764
|
+
const variableRowRefs = (0, import_react12.useRef)(/* @__PURE__ */ new Map());
|
|
1765
|
+
(0, import_react12.useEffect)(() => {
|
|
1803
1766
|
if (autoEditVariableId && tableContainerRef.current) {
|
|
1804
1767
|
const rowElement = variableRowRefs.current.get(autoEditVariableId);
|
|
1805
1768
|
if (rowElement) {
|
|
@@ -1850,21 +1813,21 @@ var VariablesManagerTable = ({
|
|
|
1850
1813
|
});
|
|
1851
1814
|
handleOnChange(updatedVariables);
|
|
1852
1815
|
};
|
|
1853
|
-
return /* @__PURE__ */
|
|
1854
|
-
|
|
1816
|
+
return /* @__PURE__ */ React13.createElement(import_ui13.TableContainer, { ref: tableContainerRef, sx: { overflow: "initial" } }, /* @__PURE__ */ React13.createElement(import_ui13.Table, { sx: tableSX, "aria-label": "Variables manager list with drag and drop reordering", stickyHeader: true }, /* @__PURE__ */ React13.createElement(import_ui13.TableHead, null, /* @__PURE__ */ React13.createElement(import_ui13.TableRow, null, /* @__PURE__ */ React13.createElement(VariableTableCell, { isHeader: true, noPadding: true, width: 10, maxWidth: 10 }), /* @__PURE__ */ React13.createElement(VariableTableCell, { isHeader: true }, (0, import_i18n9.__)("Name", "elementor")), /* @__PURE__ */ React13.createElement(VariableTableCell, { isHeader: true }, (0, import_i18n9.__)("Value", "elementor")), /* @__PURE__ */ React13.createElement(VariableTableCell, { isHeader: true, noPadding: true, width: 16, maxWidth: 16 }))), /* @__PURE__ */ React13.createElement(import_ui13.TableBody, null, /* @__PURE__ */ React13.createElement(
|
|
1817
|
+
import_ui13.UnstableSortableProvider,
|
|
1855
1818
|
{
|
|
1856
1819
|
value: ids,
|
|
1857
1820
|
onChange: handleReorder,
|
|
1858
1821
|
variant: "static",
|
|
1859
1822
|
restrictAxis: true,
|
|
1860
|
-
dragOverlay: ({ children: dragOverlayChildren, ...dragOverlayProps }) => /* @__PURE__ */
|
|
1823
|
+
dragOverlay: ({ children: dragOverlayChildren, ...dragOverlayProps }) => /* @__PURE__ */ React13.createElement(import_ui13.Table, { sx: tableSX, ...dragOverlayProps }, /* @__PURE__ */ React13.createElement(import_ui13.TableBody, null, dragOverlayChildren))
|
|
1861
1824
|
},
|
|
1862
|
-
rows.map((row) => /* @__PURE__ */
|
|
1863
|
-
|
|
1825
|
+
rows.map((row) => /* @__PURE__ */ React13.createElement(
|
|
1826
|
+
import_ui13.UnstableSortableItem,
|
|
1864
1827
|
{
|
|
1865
1828
|
key: row.id,
|
|
1866
1829
|
id: row.id,
|
|
1867
|
-
render: (props) => /* @__PURE__ */
|
|
1830
|
+
render: (props) => /* @__PURE__ */ React13.createElement(
|
|
1868
1831
|
VariableRow,
|
|
1869
1832
|
{
|
|
1870
1833
|
...props,
|
|
@@ -1892,6 +1855,7 @@ function sortVariablesOrder(variables) {
|
|
|
1892
1855
|
|
|
1893
1856
|
// src/components/variables-manager/variables-manager-panel.tsx
|
|
1894
1857
|
var id = "variables-manager";
|
|
1858
|
+
var STOP_SYNC_MESSAGE_KEY = "stop-sync-variable";
|
|
1895
1859
|
var { panel, usePanelActions } = (0, import_editor_panels.__createPanel)({
|
|
1896
1860
|
id,
|
|
1897
1861
|
component: VariablesManagerPanel,
|
|
@@ -1907,7 +1871,8 @@ var { panel, usePanelActions } = (0, import_editor_panels.__createPanel)({
|
|
|
1907
1871
|
function VariablesManagerPanel() {
|
|
1908
1872
|
const { close: closePanel } = usePanelActions();
|
|
1909
1873
|
const { open: openSaveChangesDialog, close: closeSaveChangesDialog, isOpen: isSaveChangesDialogOpen } = (0, import_editor_ui5.useDialog)();
|
|
1910
|
-
const
|
|
1874
|
+
const [isStopSyncSuppressed] = (0, import_editor_current_user2.useSuppressedMessage)(STOP_SYNC_MESSAGE_KEY);
|
|
1875
|
+
const createMenuState = (0, import_ui14.usePopupState)({
|
|
1911
1876
|
variant: "popover"
|
|
1912
1877
|
});
|
|
1913
1878
|
const {
|
|
@@ -1928,9 +1893,9 @@ function VariablesManagerPanel() {
|
|
|
1928
1893
|
} = useVariablesManagerState();
|
|
1929
1894
|
const { autoEditVariableId, startAutoEdit, handleAutoEditComplete } = useAutoEdit();
|
|
1930
1895
|
const { createNavigationCallback, resetNavigation } = useErrorNavigation();
|
|
1931
|
-
const [deleteConfirmation, setDeleteConfirmation] = (0,
|
|
1932
|
-
const [stopSyncConfirmation, setStopSyncConfirmation] = (0,
|
|
1933
|
-
const [serverError, setServerError] = (0,
|
|
1896
|
+
const [deleteConfirmation, setDeleteConfirmation] = (0, import_react13.useState)(null);
|
|
1897
|
+
const [stopSyncConfirmation, setStopSyncConfirmation] = (0, import_react13.useState)(null);
|
|
1898
|
+
const [serverError, setServerError] = (0, import_react13.useState)(null);
|
|
1934
1899
|
usePreventUnload(isDirty);
|
|
1935
1900
|
const handleClosePanel = () => {
|
|
1936
1901
|
if (isDirty) {
|
|
@@ -1939,7 +1904,7 @@ function VariablesManagerPanel() {
|
|
|
1939
1904
|
}
|
|
1940
1905
|
closePanel();
|
|
1941
1906
|
};
|
|
1942
|
-
const handleCreateVariable = (0,
|
|
1907
|
+
const handleCreateVariable = (0, import_react13.useCallback)(
|
|
1943
1908
|
(type, defaultName, defaultValue) => {
|
|
1944
1909
|
const newId = createVariable2(type, defaultName, defaultValue);
|
|
1945
1910
|
if (newId) {
|
|
@@ -1973,21 +1938,31 @@ function VariablesManagerPanel() {
|
|
|
1973
1938
|
setIsSaving(false);
|
|
1974
1939
|
}
|
|
1975
1940
|
};
|
|
1976
|
-
const handleDeleteVariableWithConfirmation = (0,
|
|
1941
|
+
const handleDeleteVariableWithConfirmation = (0, import_react13.useCallback)(
|
|
1977
1942
|
(itemId) => {
|
|
1978
1943
|
handleDeleteVariable(itemId);
|
|
1979
1944
|
setDeleteConfirmation(null);
|
|
1980
1945
|
},
|
|
1981
1946
|
[handleDeleteVariable]
|
|
1982
1947
|
);
|
|
1983
|
-
const handleStopSyncWithConfirmation = (0,
|
|
1948
|
+
const handleStopSyncWithConfirmation = (0, import_react13.useCallback)(
|
|
1984
1949
|
(itemId) => {
|
|
1985
1950
|
handleStopSync(itemId);
|
|
1986
1951
|
setStopSyncConfirmation(null);
|
|
1987
1952
|
},
|
|
1988
1953
|
[handleStopSync]
|
|
1989
1954
|
);
|
|
1990
|
-
const
|
|
1955
|
+
const handleShowStopSyncDialog = (0, import_react13.useCallback)(
|
|
1956
|
+
(itemId) => {
|
|
1957
|
+
if (!isStopSyncSuppressed) {
|
|
1958
|
+
setStopSyncConfirmation(itemId);
|
|
1959
|
+
} else {
|
|
1960
|
+
handleStopSync(itemId);
|
|
1961
|
+
}
|
|
1962
|
+
},
|
|
1963
|
+
[isStopSyncSuppressed, handleStopSync]
|
|
1964
|
+
);
|
|
1965
|
+
const buildMenuActions = (0, import_react13.useCallback)(
|
|
1991
1966
|
(variableId) => {
|
|
1992
1967
|
const variable = variables[variableId];
|
|
1993
1968
|
if (!variable) {
|
|
@@ -1998,12 +1973,12 @@ function VariablesManagerPanel() {
|
|
|
1998
1973
|
variableId,
|
|
1999
1974
|
handlers: {
|
|
2000
1975
|
onStartSync: handleStartSync,
|
|
2001
|
-
onStopSync:
|
|
1976
|
+
onStopSync: handleShowStopSyncDialog
|
|
2002
1977
|
}
|
|
2003
1978
|
});
|
|
2004
1979
|
const deleteAction = {
|
|
2005
|
-
name: (0,
|
|
2006
|
-
icon:
|
|
1980
|
+
name: (0, import_i18n10.__)("Delete", "elementor"),
|
|
1981
|
+
icon: import_icons5.TrashIcon,
|
|
2007
1982
|
color: "error.main",
|
|
2008
1983
|
onClick: (itemId) => {
|
|
2009
1984
|
const v = variables[itemId];
|
|
@@ -2016,25 +1991,25 @@ function VariablesManagerPanel() {
|
|
|
2016
1991
|
};
|
|
2017
1992
|
return [...typeActions, deleteAction];
|
|
2018
1993
|
},
|
|
2019
|
-
[variables, handleStartSync]
|
|
1994
|
+
[variables, handleStartSync, handleShowStopSyncDialog]
|
|
2020
1995
|
);
|
|
2021
1996
|
const hasVariables = Object.keys(variables).length > 0;
|
|
2022
|
-
return /* @__PURE__ */
|
|
1997
|
+
return /* @__PURE__ */ React14.createElement(import_editor_ui5.ThemeProvider, null, /* @__PURE__ */ React14.createElement(import_editor_panels.Panel, null, /* @__PURE__ */ React14.createElement(
|
|
2023
1998
|
import_editor_panels.PanelHeader,
|
|
2024
1999
|
{
|
|
2025
2000
|
sx: {
|
|
2026
2001
|
height: "unset"
|
|
2027
2002
|
}
|
|
2028
2003
|
},
|
|
2029
|
-
/* @__PURE__ */
|
|
2004
|
+
/* @__PURE__ */ React14.createElement(import_ui14.Stack, { width: "100%", direction: "column", alignItems: "center" }, /* @__PURE__ */ React14.createElement(import_ui14.Stack, { p: 1, pl: 2, width: "100%", direction: "row", alignItems: "center" }, /* @__PURE__ */ React14.createElement(import_ui14.Stack, { width: "100%", direction: "row", gap: 1 }, /* @__PURE__ */ React14.createElement(import_editor_panels.PanelHeaderTitle, { sx: { display: "flex", alignItems: "center", gap: 0.5 } }, /* @__PURE__ */ React14.createElement(import_icons5.ColorFilterIcon, { fontSize: "inherit" }), (0, import_i18n10.__)("Variables Manager", "elementor"))), /* @__PURE__ */ React14.createElement(import_ui14.Stack, { direction: "row", gap: 0.5, alignItems: "center" }, /* @__PURE__ */ React14.createElement(
|
|
2030
2005
|
VariableManagerCreateMenu,
|
|
2031
2006
|
{
|
|
2032
2007
|
onCreate: handleCreateVariable,
|
|
2033
2008
|
variables,
|
|
2034
2009
|
menuState: createMenuState
|
|
2035
2010
|
}
|
|
2036
|
-
), /* @__PURE__ */
|
|
2037
|
-
|
|
2011
|
+
), /* @__PURE__ */ React14.createElement(
|
|
2012
|
+
import_ui14.CloseButton,
|
|
2038
2013
|
{
|
|
2039
2014
|
"aria-label": "Close",
|
|
2040
2015
|
slotProps: { icon: { fontSize: SIZE } },
|
|
@@ -2042,19 +2017,19 @@ function VariablesManagerPanel() {
|
|
|
2042
2017
|
handleClosePanel();
|
|
2043
2018
|
}
|
|
2044
2019
|
}
|
|
2045
|
-
))), /* @__PURE__ */
|
|
2020
|
+
))), /* @__PURE__ */ React14.createElement(import_ui14.Stack, { width: "100%", direction: "row", gap: 1 }, /* @__PURE__ */ React14.createElement(
|
|
2046
2021
|
import_editor_ui5.SearchField,
|
|
2047
2022
|
{
|
|
2048
2023
|
sx: {
|
|
2049
2024
|
display: "flex",
|
|
2050
2025
|
flex: 1
|
|
2051
2026
|
},
|
|
2052
|
-
placeholder: (0,
|
|
2027
|
+
placeholder: (0, import_i18n10.__)("Search", "elementor"),
|
|
2053
2028
|
value: searchValue,
|
|
2054
2029
|
onSearch: handleSearch
|
|
2055
2030
|
}
|
|
2056
|
-
)), /* @__PURE__ */
|
|
2057
|
-
), /* @__PURE__ */
|
|
2031
|
+
)), /* @__PURE__ */ React14.createElement(import_ui14.Divider, { sx: { width: "100%" } }))
|
|
2032
|
+
), /* @__PURE__ */ React14.createElement(
|
|
2058
2033
|
import_editor_panels.PanelBody,
|
|
2059
2034
|
{
|
|
2060
2035
|
sx: {
|
|
@@ -2063,7 +2038,7 @@ function VariablesManagerPanel() {
|
|
|
2063
2038
|
height: "100%"
|
|
2064
2039
|
}
|
|
2065
2040
|
},
|
|
2066
|
-
hasVariables && /* @__PURE__ */
|
|
2041
|
+
hasVariables && /* @__PURE__ */ React14.createElement(
|
|
2067
2042
|
VariablesManagerTable,
|
|
2068
2043
|
{
|
|
2069
2044
|
menuActions: buildMenuActions,
|
|
@@ -2074,43 +2049,43 @@ function VariablesManagerPanel() {
|
|
|
2074
2049
|
onFieldError: setIsSaveDisabled
|
|
2075
2050
|
}
|
|
2076
2051
|
),
|
|
2077
|
-
!hasVariables && searchValue && /* @__PURE__ */
|
|
2052
|
+
!hasVariables && searchValue && /* @__PURE__ */ React14.createElement(
|
|
2078
2053
|
NoSearchResults,
|
|
2079
2054
|
{
|
|
2080
2055
|
searchValue,
|
|
2081
2056
|
onClear: () => handleSearch(""),
|
|
2082
|
-
icon: /* @__PURE__ */
|
|
2057
|
+
icon: /* @__PURE__ */ React14.createElement(import_icons5.ColorFilterIcon, { fontSize: "large" })
|
|
2083
2058
|
}
|
|
2084
2059
|
),
|
|
2085
|
-
!hasVariables && !searchValue && /* @__PURE__ */
|
|
2060
|
+
!hasVariables && !searchValue && /* @__PURE__ */ React14.createElement(
|
|
2086
2061
|
EmptyState,
|
|
2087
2062
|
{
|
|
2088
|
-
title: (0,
|
|
2089
|
-
message: (0,
|
|
2063
|
+
title: (0, import_i18n10.__)("Create your first variable", "elementor"),
|
|
2064
|
+
message: (0, import_i18n10.__)(
|
|
2090
2065
|
"Variables are saved attributes that you can apply anywhere on your site.",
|
|
2091
2066
|
"elementor"
|
|
2092
2067
|
),
|
|
2093
|
-
icon: /* @__PURE__ */
|
|
2068
|
+
icon: /* @__PURE__ */ React14.createElement(import_icons5.ColorFilterIcon, { fontSize: "large" }),
|
|
2094
2069
|
onAdd: createMenuState.open
|
|
2095
2070
|
}
|
|
2096
2071
|
)
|
|
2097
|
-
), /* @__PURE__ */
|
|
2098
|
-
|
|
2072
|
+
), /* @__PURE__ */ React14.createElement(import_editor_panels.PanelFooter, null, /* @__PURE__ */ React14.createElement(
|
|
2073
|
+
import_ui14.Infotip,
|
|
2099
2074
|
{
|
|
2100
2075
|
placement: "right",
|
|
2101
2076
|
open: !!serverError,
|
|
2102
|
-
content: serverError ? /* @__PURE__ */
|
|
2103
|
-
|
|
2077
|
+
content: serverError ? /* @__PURE__ */ React14.createElement(
|
|
2078
|
+
import_ui14.Alert,
|
|
2104
2079
|
{
|
|
2105
2080
|
severity: serverError.severity ?? "error",
|
|
2106
|
-
action: serverError.action?.label ? /* @__PURE__ */
|
|
2081
|
+
action: serverError.action?.label ? /* @__PURE__ */ React14.createElement(import_ui14.AlertAction, { onClick: serverError.action.callback }, serverError.action.label) : void 0,
|
|
2107
2082
|
onClose: !serverError.action?.label ? () => {
|
|
2108
2083
|
setServerError(null);
|
|
2109
2084
|
setIsSaveDisabled(false);
|
|
2110
2085
|
} : void 0,
|
|
2111
|
-
icon: serverError.IconComponent ? /* @__PURE__ */
|
|
2086
|
+
icon: serverError.IconComponent ? /* @__PURE__ */ React14.createElement(serverError.IconComponent, null) : /* @__PURE__ */ React14.createElement(import_icons5.AlertTriangleFilledIcon, null)
|
|
2112
2087
|
},
|
|
2113
|
-
/* @__PURE__ */
|
|
2088
|
+
/* @__PURE__ */ React14.createElement(import_ui14.AlertTitle, null, serverError.message),
|
|
2114
2089
|
serverError.action?.message
|
|
2115
2090
|
) : null,
|
|
2116
2091
|
arrow: false,
|
|
@@ -2125,8 +2100,8 @@ function VariablesManagerPanel() {
|
|
|
2125
2100
|
}
|
|
2126
2101
|
}
|
|
2127
2102
|
},
|
|
2128
|
-
/* @__PURE__ */
|
|
2129
|
-
|
|
2103
|
+
/* @__PURE__ */ React14.createElement(
|
|
2104
|
+
import_ui14.Button,
|
|
2130
2105
|
{
|
|
2131
2106
|
fullWidth: true,
|
|
2132
2107
|
size: "small",
|
|
@@ -2136,9 +2111,9 @@ function VariablesManagerPanel() {
|
|
|
2136
2111
|
onClick: handleSaveClick,
|
|
2137
2112
|
loading: isSaving
|
|
2138
2113
|
},
|
|
2139
|
-
(0,
|
|
2114
|
+
(0, import_i18n10.__)("Save changes", "elementor")
|
|
2140
2115
|
)
|
|
2141
|
-
))), deleteConfirmation && /* @__PURE__ */
|
|
2116
|
+
))), deleteConfirmation && /* @__PURE__ */ React14.createElement(
|
|
2142
2117
|
DeleteConfirmationDialog,
|
|
2143
2118
|
{
|
|
2144
2119
|
open: true,
|
|
@@ -2146,26 +2121,26 @@ function VariablesManagerPanel() {
|
|
|
2146
2121
|
onConfirm: () => handleDeleteVariableWithConfirmation(deleteConfirmation.id),
|
|
2147
2122
|
closeDialog: () => setDeleteConfirmation(null)
|
|
2148
2123
|
}
|
|
2149
|
-
), stopSyncConfirmation && /* @__PURE__ */
|
|
2124
|
+
), stopSyncConfirmation && /* @__PURE__ */ React14.createElement(
|
|
2150
2125
|
StopSyncConfirmationDialog,
|
|
2151
2126
|
{
|
|
2152
2127
|
open: true,
|
|
2153
|
-
|
|
2128
|
+
onClose: () => setStopSyncConfirmation(null),
|
|
2154
2129
|
onConfirm: () => handleStopSyncWithConfirmation(stopSyncConfirmation)
|
|
2155
2130
|
}
|
|
2156
|
-
), isSaveChangesDialogOpen && /* @__PURE__ */
|
|
2131
|
+
), isSaveChangesDialogOpen && /* @__PURE__ */ React14.createElement(import_editor_ui5.SaveChangesDialog, null, /* @__PURE__ */ React14.createElement(import_editor_ui5.SaveChangesDialog.Title, { onClose: closeSaveChangesDialog }, (0, import_i18n10.__)("You have unsaved changes", "elementor")), /* @__PURE__ */ React14.createElement(import_editor_ui5.SaveChangesDialog.Content, null, /* @__PURE__ */ React14.createElement(import_editor_ui5.SaveChangesDialog.ContentText, null, (0, import_i18n10.__)("To avoid losing your updates, save your changes before leaving.", "elementor"))), /* @__PURE__ */ React14.createElement(
|
|
2157
2132
|
import_editor_ui5.SaveChangesDialog.Actions,
|
|
2158
2133
|
{
|
|
2159
2134
|
actions: {
|
|
2160
2135
|
discard: {
|
|
2161
|
-
label: (0,
|
|
2136
|
+
label: (0, import_i18n10.__)("Discard", "elementor"),
|
|
2162
2137
|
action: () => {
|
|
2163
2138
|
closeSaveChangesDialog();
|
|
2164
2139
|
closePanel();
|
|
2165
2140
|
}
|
|
2166
2141
|
},
|
|
2167
2142
|
confirm: {
|
|
2168
|
-
label: (0,
|
|
2143
|
+
label: (0, import_i18n10.__)("Save", "elementor"),
|
|
2169
2144
|
action: async () => {
|
|
2170
2145
|
const result = await handleSaveClick();
|
|
2171
2146
|
closeSaveChangesDialog();
|
|
@@ -2179,7 +2154,7 @@ function VariablesManagerPanel() {
|
|
|
2179
2154
|
)));
|
|
2180
2155
|
}
|
|
2181
2156
|
var usePreventUnload = (isDirty) => {
|
|
2182
|
-
(0,
|
|
2157
|
+
(0, import_react13.useEffect)(() => {
|
|
2183
2158
|
const handleBeforeUnload = (event) => {
|
|
2184
2159
|
if (isDirty) {
|
|
2185
2160
|
event.preventDefault();
|
|
@@ -2191,6 +2166,24 @@ var usePreventUnload = (isDirty) => {
|
|
|
2191
2166
|
};
|
|
2192
2167
|
}, [isDirty]);
|
|
2193
2168
|
};
|
|
2169
|
+
var StopSyncConfirmationDialog = ({ open, onClose, onConfirm }) => {
|
|
2170
|
+
const [, suppressStopSyncMessage] = (0, import_editor_current_user2.useSuppressedMessage)(STOP_SYNC_MESSAGE_KEY);
|
|
2171
|
+
return /* @__PURE__ */ React14.createElement(import_editor_ui5.ConfirmationDialog, { open, onClose }, /* @__PURE__ */ React14.createElement(import_editor_ui5.ConfirmationDialog.Title, { icon: import_icons5.ColorFilterIcon, iconColor: "primary" }, (0, import_i18n10.__)("Stop syncing variable color", "elementor")), /* @__PURE__ */ React14.createElement(import_editor_ui5.ConfirmationDialog.Content, null, /* @__PURE__ */ React14.createElement(import_editor_ui5.ConfirmationDialog.ContentText, null, (0, import_i18n10.__)(
|
|
2172
|
+
"This will disconnect the variable color from version 3. Existing uses on your site will automatically switch to a default color.",
|
|
2173
|
+
"elementor"
|
|
2174
|
+
))), /* @__PURE__ */ React14.createElement(
|
|
2175
|
+
import_editor_ui5.ConfirmationDialog.Actions,
|
|
2176
|
+
{
|
|
2177
|
+
onClose,
|
|
2178
|
+
onConfirm,
|
|
2179
|
+
cancelLabel: (0, import_i18n10.__)("Cancel", "elementor"),
|
|
2180
|
+
confirmLabel: (0, import_i18n10.__)("Got it", "elementor"),
|
|
2181
|
+
color: "primary",
|
|
2182
|
+
onSuppressMessage: suppressStopSyncMessage,
|
|
2183
|
+
suppressLabel: (0, import_i18n10.__)("Don't show again", "elementor")
|
|
2184
|
+
}
|
|
2185
|
+
));
|
|
2186
|
+
};
|
|
2194
2187
|
|
|
2195
2188
|
// src/components/open-panel-from-url.tsx
|
|
2196
2189
|
var ACTIVE_PANEL_PARAM = "active-panel";
|
|
@@ -2198,8 +2191,8 @@ var PANEL_ID = "variables-manager";
|
|
|
2198
2191
|
var DEFAULT_PANEL_ROUTE = "panel/elements";
|
|
2199
2192
|
function OpenPanelFromUrl() {
|
|
2200
2193
|
const { open } = usePanelActions();
|
|
2201
|
-
const hasOpened = (0,
|
|
2202
|
-
(0,
|
|
2194
|
+
const hasOpened = (0, import_react14.useRef)(false);
|
|
2195
|
+
(0, import_react14.useEffect)(() => {
|
|
2203
2196
|
const urlParams = new URLSearchParams(window.location.search);
|
|
2204
2197
|
const activePanel = urlParams.get(ACTIVE_PANEL_PARAM);
|
|
2205
2198
|
if (activePanel !== PANEL_ID) {
|
|
@@ -2220,15 +2213,15 @@ function OpenPanelFromUrl() {
|
|
|
2220
2213
|
}
|
|
2221
2214
|
|
|
2222
2215
|
// src/controls/variable-control.tsx
|
|
2223
|
-
var
|
|
2216
|
+
var React33 = __toESM(require("react"));
|
|
2224
2217
|
var import_editor_controls11 = require("@elementor/editor-controls");
|
|
2225
2218
|
|
|
2226
2219
|
// src/components/ui/variable/assigned-variable.tsx
|
|
2227
|
-
var
|
|
2228
|
-
var
|
|
2220
|
+
var import_react21 = require("react");
|
|
2221
|
+
var React24 = __toESM(require("react"));
|
|
2229
2222
|
var import_editor_controls6 = require("@elementor/editor-controls");
|
|
2230
|
-
var
|
|
2231
|
-
var
|
|
2223
|
+
var import_icons12 = require("@elementor/icons");
|
|
2224
|
+
var import_ui24 = require("@elementor/ui");
|
|
2232
2225
|
|
|
2233
2226
|
// src/utils/unlink-variable.ts
|
|
2234
2227
|
function transformValueBeforeUnlink(variable, propTypeKey) {
|
|
@@ -2247,31 +2240,31 @@ function createUnlinkHandler(variable, propTypeKey, setValue) {
|
|
|
2247
2240
|
}
|
|
2248
2241
|
|
|
2249
2242
|
// src/components/variable-selection-popover.tsx
|
|
2250
|
-
var
|
|
2251
|
-
var
|
|
2243
|
+
var React22 = __toESM(require("react"));
|
|
2244
|
+
var import_react20 = require("react");
|
|
2252
2245
|
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
2253
2246
|
|
|
2254
2247
|
// src/context/variable-selection-popover.context.tsx
|
|
2255
|
-
var
|
|
2256
|
-
var
|
|
2257
|
-
var
|
|
2258
|
-
var PopoverContentRefContext = (0,
|
|
2248
|
+
var React15 = __toESM(require("react"));
|
|
2249
|
+
var import_react15 = require("react");
|
|
2250
|
+
var import_ui15 = require("@elementor/ui");
|
|
2251
|
+
var PopoverContentRefContext = (0, import_react15.createContext)(null);
|
|
2259
2252
|
var PopoverContentRefContextProvider = ({ children }) => {
|
|
2260
|
-
const [anchorRef, setAnchorRef] = (0,
|
|
2261
|
-
return /* @__PURE__ */
|
|
2253
|
+
const [anchorRef, setAnchorRef] = (0, import_react15.useState)(null);
|
|
2254
|
+
return /* @__PURE__ */ React15.createElement(PopoverContentRefContext.Provider, { value: anchorRef }, /* @__PURE__ */ React15.createElement(import_ui15.Box, { ref: setAnchorRef }, children));
|
|
2262
2255
|
};
|
|
2263
2256
|
var usePopoverContentRef = () => {
|
|
2264
|
-
return (0,
|
|
2257
|
+
return (0, import_react15.useContext)(PopoverContentRefContext);
|
|
2265
2258
|
};
|
|
2266
2259
|
|
|
2267
2260
|
// src/components/variable-creation.tsx
|
|
2268
|
-
var
|
|
2269
|
-
var
|
|
2261
|
+
var React17 = __toESM(require("react"));
|
|
2262
|
+
var import_react16 = require("react");
|
|
2270
2263
|
var import_editor_controls4 = require("@elementor/editor-controls");
|
|
2271
2264
|
var import_editor_ui6 = require("@elementor/editor-ui");
|
|
2272
|
-
var
|
|
2273
|
-
var
|
|
2274
|
-
var
|
|
2265
|
+
var import_icons6 = require("@elementor/icons");
|
|
2266
|
+
var import_ui17 = require("@elementor/ui");
|
|
2267
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
2275
2268
|
|
|
2276
2269
|
// src/hooks/use-initial-value.ts
|
|
2277
2270
|
var import_editor_controls2 = require("@elementor/editor-controls");
|
|
@@ -2314,10 +2307,10 @@ var unwrapValue = (input) => {
|
|
|
2314
2307
|
};
|
|
2315
2308
|
|
|
2316
2309
|
// src/components/ui/form-field.tsx
|
|
2317
|
-
var
|
|
2318
|
-
var
|
|
2310
|
+
var React16 = __toESM(require("react"));
|
|
2311
|
+
var import_ui16 = require("@elementor/ui");
|
|
2319
2312
|
var FormField = ({ id: id2, label, errorMsg, noticeMsg, children }) => {
|
|
2320
|
-
return /* @__PURE__ */
|
|
2313
|
+
return /* @__PURE__ */ React16.createElement(import_ui16.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React16.createElement(import_ui16.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React16.createElement(import_ui16.FormLabel, { htmlFor: id2, size: "tiny" }, label)), /* @__PURE__ */ React16.createElement(import_ui16.Grid, { item: true, xs: 12 }, children, errorMsg && /* @__PURE__ */ React16.createElement(import_ui16.FormHelperText, { error: true }, errorMsg), noticeMsg && /* @__PURE__ */ React16.createElement(import_ui16.FormHelperText, null, noticeMsg)));
|
|
2321
2314
|
};
|
|
2322
2315
|
|
|
2323
2316
|
// src/components/variable-creation.tsx
|
|
@@ -2327,11 +2320,11 @@ var VariableCreation = ({ onGoBack, onClose }) => {
|
|
|
2327
2320
|
const { setVariableValue: setVariable, path } = useVariableBoundProp();
|
|
2328
2321
|
const { propType } = (0, import_editor_controls4.useBoundProp)();
|
|
2329
2322
|
const initialValue = useInitialValue();
|
|
2330
|
-
const [value, setValue] = (0,
|
|
2331
|
-
const [label, setLabel] = (0,
|
|
2332
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
2333
|
-
const [valueFieldError, setValueFieldError] = (0,
|
|
2334
|
-
const [propTypeKey, setPropTypeKey] = (0,
|
|
2323
|
+
const [value, setValue] = (0, import_react16.useState)(initialValue);
|
|
2324
|
+
const [label, setLabel] = (0, import_react16.useState)("");
|
|
2325
|
+
const [errorMessage, setErrorMessage] = (0, import_react16.useState)("");
|
|
2326
|
+
const [valueFieldError, setValueFieldError] = (0, import_react16.useState)("");
|
|
2327
|
+
const [propTypeKey, setPropTypeKey] = (0, import_react16.useState)(propTypeUtil.key);
|
|
2335
2328
|
const { labelFieldError, setLabelFieldError } = useLabelError();
|
|
2336
2329
|
const resetFields = () => {
|
|
2337
2330
|
setValue("");
|
|
@@ -2388,22 +2381,22 @@ var VariableCreation = ({ onGoBack, onClose }) => {
|
|
|
2388
2381
|
handleCreateAndTrack();
|
|
2389
2382
|
}
|
|
2390
2383
|
};
|
|
2391
|
-
return /* @__PURE__ */
|
|
2384
|
+
return /* @__PURE__ */ React17.createElement(import_editor_ui6.SectionPopoverBody, { height: "auto" }, /* @__PURE__ */ React17.createElement(
|
|
2392
2385
|
import_editor_ui6.PopoverHeader,
|
|
2393
2386
|
{
|
|
2394
|
-
icon: /* @__PURE__ */
|
|
2395
|
-
title: (0,
|
|
2387
|
+
icon: /* @__PURE__ */ React17.createElement(React17.Fragment, null, onGoBack && /* @__PURE__ */ React17.createElement(import_ui17.IconButton, { size: SIZE2, "aria-label": (0, import_i18n11.__)("Go Back", "elementor"), onClick: onGoBack }, /* @__PURE__ */ React17.createElement(import_icons6.ArrowLeftIcon, { fontSize: SIZE2 })), /* @__PURE__ */ React17.createElement(VariableIcon, { fontSize: SIZE2 })),
|
|
2388
|
+
title: (0, import_i18n11.__)("Create variable", "elementor"),
|
|
2396
2389
|
onClose: closePopover
|
|
2397
2390
|
}
|
|
2398
|
-
), /* @__PURE__ */
|
|
2391
|
+
), /* @__PURE__ */ React17.createElement(import_ui17.Divider, null), /* @__PURE__ */ React17.createElement(import_editor_controls4.PopoverContent, { p: 2 }, /* @__PURE__ */ React17.createElement(
|
|
2399
2392
|
FormField,
|
|
2400
2393
|
{
|
|
2401
2394
|
id: "variable-label",
|
|
2402
|
-
label: (0,
|
|
2395
|
+
label: (0, import_i18n11.__)("Name", "elementor"),
|
|
2403
2396
|
errorMsg: labelFieldError?.message,
|
|
2404
2397
|
noticeMsg: labelHint(label)
|
|
2405
2398
|
},
|
|
2406
|
-
/* @__PURE__ */
|
|
2399
|
+
/* @__PURE__ */ React17.createElement(
|
|
2407
2400
|
LabelField,
|
|
2408
2401
|
{
|
|
2409
2402
|
id: "variable-label",
|
|
@@ -2422,7 +2415,7 @@ var VariableCreation = ({ onGoBack, onClose }) => {
|
|
|
2422
2415
|
onKeyDown: handleKeyDown
|
|
2423
2416
|
}
|
|
2424
2417
|
)
|
|
2425
|
-
), ValueField && /* @__PURE__ */
|
|
2418
|
+
), ValueField && /* @__PURE__ */ React17.createElement(FormField, { errorMsg: valueFieldError, label: (0, import_i18n11.__)("Value", "elementor") }, /* @__PURE__ */ React17.createElement(import_ui17.Typography, { variant: "h5", id: "variable-value-wrapper" }, /* @__PURE__ */ React17.createElement(
|
|
2426
2419
|
ValueField,
|
|
2427
2420
|
{
|
|
2428
2421
|
value,
|
|
@@ -2436,8 +2429,8 @@ var VariableCreation = ({ onGoBack, onClose }) => {
|
|
|
2436
2429
|
propType,
|
|
2437
2430
|
onKeyDown: handleKeyDown
|
|
2438
2431
|
}
|
|
2439
|
-
))), errorMessage && /* @__PURE__ */
|
|
2440
|
-
|
|
2432
|
+
))), errorMessage && /* @__PURE__ */ React17.createElement(import_ui17.FormHelperText, { error: true }, errorMessage)), /* @__PURE__ */ React17.createElement(import_ui17.CardActions, { sx: { pt: 0.5, pb: 1 } }, /* @__PURE__ */ React17.createElement(
|
|
2433
|
+
import_ui17.Button,
|
|
2441
2434
|
{
|
|
2442
2435
|
id: "create-variable-button",
|
|
2443
2436
|
size: "small",
|
|
@@ -2445,80 +2438,80 @@ var VariableCreation = ({ onGoBack, onClose }) => {
|
|
|
2445
2438
|
disabled: isSubmitDisabled,
|
|
2446
2439
|
onClick: handleCreateAndTrack
|
|
2447
2440
|
},
|
|
2448
|
-
(0,
|
|
2441
|
+
(0, import_i18n11.__)("Create", "elementor")
|
|
2449
2442
|
)));
|
|
2450
2443
|
};
|
|
2451
2444
|
|
|
2452
2445
|
// src/components/variable-edit.tsx
|
|
2453
|
-
var React20 = __toESM(require("react"));
|
|
2454
|
-
var import_react19 = require("react");
|
|
2455
|
-
var import_editor_controls5 = require("@elementor/editor-controls");
|
|
2456
|
-
var import_editor_current_user2 = require("@elementor/editor-current-user");
|
|
2457
|
-
var import_editor_ui7 = require("@elementor/editor-ui");
|
|
2458
|
-
var import_icons9 = require("@elementor/icons");
|
|
2459
|
-
var import_ui20 = require("@elementor/ui");
|
|
2460
|
-
var import_i18n14 = require("@wordpress/i18n");
|
|
2461
|
-
|
|
2462
|
-
// src/components/ui/edit-confirmation-dialog.tsx
|
|
2463
2446
|
var React19 = __toESM(require("react"));
|
|
2464
2447
|
var import_react18 = require("react");
|
|
2448
|
+
var import_editor_controls5 = require("@elementor/editor-controls");
|
|
2449
|
+
var import_editor_current_user3 = require("@elementor/editor-current-user");
|
|
2450
|
+
var import_editor_ui7 = require("@elementor/editor-ui");
|
|
2465
2451
|
var import_icons8 = require("@elementor/icons");
|
|
2466
2452
|
var import_ui19 = require("@elementor/ui");
|
|
2467
2453
|
var import_i18n13 = require("@wordpress/i18n");
|
|
2454
|
+
|
|
2455
|
+
// src/components/ui/edit-confirmation-dialog.tsx
|
|
2456
|
+
var React18 = __toESM(require("react"));
|
|
2457
|
+
var import_react17 = require("react");
|
|
2458
|
+
var import_icons7 = require("@elementor/icons");
|
|
2459
|
+
var import_ui18 = require("@elementor/ui");
|
|
2460
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
2468
2461
|
var EDIT_CONFIRMATION_DIALOG_ID = "edit-confirmation-dialog";
|
|
2469
2462
|
var EditConfirmationDialog = ({
|
|
2470
2463
|
closeDialog,
|
|
2471
2464
|
onConfirm,
|
|
2472
2465
|
onSuppressMessage
|
|
2473
2466
|
}) => {
|
|
2474
|
-
const [dontShowAgain, setDontShowAgain] = (0,
|
|
2467
|
+
const [dontShowAgain, setDontShowAgain] = (0, import_react17.useState)(false);
|
|
2475
2468
|
const handleSave = () => {
|
|
2476
2469
|
if (dontShowAgain) {
|
|
2477
2470
|
onSuppressMessage?.();
|
|
2478
2471
|
}
|
|
2479
2472
|
onConfirm?.();
|
|
2480
2473
|
};
|
|
2481
|
-
return /* @__PURE__ */
|
|
2474
|
+
return /* @__PURE__ */ React18.createElement(import_ui18.Dialog, { open: true, onClose: closeDialog, maxWidth: "xs" }, /* @__PURE__ */ React18.createElement(import_ui18.DialogTitle, { display: "flex", alignItems: "center", gap: 1 }, /* @__PURE__ */ React18.createElement(import_icons7.AlertTriangleFilledIcon, { color: "secondary" }), (0, import_i18n12.__)("Changes to variables go live right away.", "elementor")), /* @__PURE__ */ React18.createElement(import_ui18.DialogContent, null, /* @__PURE__ */ React18.createElement(import_ui18.DialogContentText, { variant: "body2", color: "textPrimary" }, (0, import_i18n12.__)(
|
|
2482
2475
|
"Don't worry - all other changes you make will wait until you publish your site.",
|
|
2483
2476
|
"elementor"
|
|
2484
|
-
))), /* @__PURE__ */
|
|
2485
|
-
|
|
2477
|
+
))), /* @__PURE__ */ React18.createElement(import_ui18.DialogActions, { sx: { justifyContent: "space-between", alignItems: "center" } }, /* @__PURE__ */ React18.createElement(
|
|
2478
|
+
import_ui18.FormControlLabel,
|
|
2486
2479
|
{
|
|
2487
|
-
control: /* @__PURE__ */
|
|
2488
|
-
|
|
2480
|
+
control: /* @__PURE__ */ React18.createElement(
|
|
2481
|
+
import_ui18.Checkbox,
|
|
2489
2482
|
{
|
|
2490
2483
|
checked: dontShowAgain,
|
|
2491
2484
|
onChange: (event) => setDontShowAgain(event.target.checked),
|
|
2492
2485
|
size: "small"
|
|
2493
2486
|
}
|
|
2494
2487
|
),
|
|
2495
|
-
label: /* @__PURE__ */
|
|
2488
|
+
label: /* @__PURE__ */ React18.createElement(import_ui18.Typography, { variant: "body2" }, (0, import_i18n12.__)("Don't show me again", "elementor"))
|
|
2496
2489
|
}
|
|
2497
|
-
), /* @__PURE__ */
|
|
2490
|
+
), /* @__PURE__ */ React18.createElement("div", null, /* @__PURE__ */ React18.createElement(import_ui18.Button, { color: "secondary", onClick: closeDialog }, (0, import_i18n12.__)("Keep editing", "elementor")), /* @__PURE__ */ React18.createElement(import_ui18.Button, { variant: "contained", color: "secondary", onClick: handleSave, sx: { ml: 1 } }, (0, import_i18n12.__)("Save", "elementor")))));
|
|
2498
2491
|
};
|
|
2499
2492
|
|
|
2500
2493
|
// src/components/variable-edit.tsx
|
|
2501
2494
|
var SIZE3 = "tiny";
|
|
2502
|
-
var DELETE_LABEL = (0,
|
|
2495
|
+
var DELETE_LABEL = (0, import_i18n13.__)("Delete variable", "elementor");
|
|
2503
2496
|
var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
2504
2497
|
const { icon: VariableIcon, valueField: ValueField, variableType, propTypeUtil } = useVariableType();
|
|
2505
2498
|
const { setVariableValue: notifyBoundPropChange, variableId } = useVariableBoundProp();
|
|
2506
2499
|
const { propType } = (0, import_editor_controls5.useBoundProp)();
|
|
2507
|
-
const [isMessageSuppressed, suppressMessage] = (0,
|
|
2508
|
-
const [deleteConfirmation, setDeleteConfirmation] = (0,
|
|
2509
|
-
const [editConfirmation, setEditConfirmation] = (0,
|
|
2510
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
2511
|
-
const [valueFieldError, setValueFieldError] = (0,
|
|
2500
|
+
const [isMessageSuppressed, suppressMessage] = (0, import_editor_current_user3.useSuppressedMessage)(EDIT_CONFIRMATION_DIALOG_ID);
|
|
2501
|
+
const [deleteConfirmation, setDeleteConfirmation] = (0, import_react18.useState)(false);
|
|
2502
|
+
const [editConfirmation, setEditConfirmation] = (0, import_react18.useState)(false);
|
|
2503
|
+
const [errorMessage, setErrorMessage] = (0, import_react18.useState)("");
|
|
2504
|
+
const [valueFieldError, setValueFieldError] = (0, import_react18.useState)("");
|
|
2512
2505
|
const { labelFieldError, setLabelFieldError } = useLabelError();
|
|
2513
2506
|
const variable = useVariable(editId);
|
|
2514
|
-
const [propTypeKey, setPropTypeKey] = (0,
|
|
2507
|
+
const [propTypeKey, setPropTypeKey] = (0, import_react18.useState)(variable?.type ?? propTypeUtil.key);
|
|
2515
2508
|
if (!variable) {
|
|
2516
2509
|
throw new Error(`Global ${variableType} variable not found`);
|
|
2517
2510
|
}
|
|
2518
2511
|
const userPermissions = usePermissions();
|
|
2519
|
-
const [value, setValue] = (0,
|
|
2520
|
-
const [label, setLabel] = (0,
|
|
2521
|
-
(0,
|
|
2512
|
+
const [value, setValue] = (0, import_react18.useState)(() => variable.value);
|
|
2513
|
+
const [label, setLabel] = (0, import_react18.useState)(() => variable.label);
|
|
2514
|
+
(0, import_react18.useEffect)(() => {
|
|
2522
2515
|
styleVariablesRepository.update({
|
|
2523
2516
|
[editId]: {
|
|
2524
2517
|
...variable,
|
|
@@ -2580,7 +2573,7 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
|
2580
2573
|
const actions = [];
|
|
2581
2574
|
if (userPermissions.canDelete()) {
|
|
2582
2575
|
actions.push(
|
|
2583
|
-
/* @__PURE__ */
|
|
2576
|
+
/* @__PURE__ */ React19.createElement(import_ui19.Tooltip, { key: "delete", placement: "top", title: DELETE_LABEL }, /* @__PURE__ */ React19.createElement(import_ui19.IconButton, { size: SIZE3, onClick: handleDeleteConfirmation, "aria-label": DELETE_LABEL }, /* @__PURE__ */ React19.createElement(import_icons8.TrashIcon, { fontSize: SIZE3 })))
|
|
2584
2577
|
);
|
|
2585
2578
|
}
|
|
2586
2579
|
const hasEmptyFields = () => {
|
|
@@ -2605,31 +2598,31 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
|
2605
2598
|
handleUpdate();
|
|
2606
2599
|
}
|
|
2607
2600
|
};
|
|
2608
|
-
return /* @__PURE__ */
|
|
2601
|
+
return /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(import_editor_ui7.SectionPopoverBody, { height: "auto" }, /* @__PURE__ */ React19.createElement(
|
|
2609
2602
|
import_editor_ui7.PopoverHeader,
|
|
2610
2603
|
{
|
|
2611
|
-
title: (0,
|
|
2604
|
+
title: (0, import_i18n13.__)("Edit variable", "elementor"),
|
|
2612
2605
|
onClose,
|
|
2613
|
-
icon: /* @__PURE__ */
|
|
2614
|
-
|
|
2606
|
+
icon: /* @__PURE__ */ React19.createElement(React19.Fragment, null, onGoBack && /* @__PURE__ */ React19.createElement(
|
|
2607
|
+
import_ui19.IconButton,
|
|
2615
2608
|
{
|
|
2616
2609
|
size: SIZE3,
|
|
2617
|
-
"aria-label": (0,
|
|
2610
|
+
"aria-label": (0, import_i18n13.__)("Go Back", "elementor"),
|
|
2618
2611
|
onClick: onGoBack
|
|
2619
2612
|
},
|
|
2620
|
-
/* @__PURE__ */
|
|
2621
|
-
), /* @__PURE__ */
|
|
2613
|
+
/* @__PURE__ */ React19.createElement(import_icons8.ArrowLeftIcon, { fontSize: SIZE3 })
|
|
2614
|
+
), /* @__PURE__ */ React19.createElement(VariableIcon, { fontSize: SIZE3 })),
|
|
2622
2615
|
actions
|
|
2623
2616
|
}
|
|
2624
|
-
), /* @__PURE__ */
|
|
2617
|
+
), /* @__PURE__ */ React19.createElement(import_ui19.Divider, null), /* @__PURE__ */ React19.createElement(import_editor_controls5.PopoverContent, { p: 2 }, /* @__PURE__ */ React19.createElement(
|
|
2625
2618
|
FormField,
|
|
2626
2619
|
{
|
|
2627
2620
|
id: "variable-label",
|
|
2628
|
-
label: (0,
|
|
2621
|
+
label: (0, import_i18n13.__)("Name", "elementor"),
|
|
2629
2622
|
errorMsg: labelFieldError?.message,
|
|
2630
2623
|
noticeMsg: labelHint(label)
|
|
2631
2624
|
},
|
|
2632
|
-
/* @__PURE__ */
|
|
2625
|
+
/* @__PURE__ */ React19.createElement(
|
|
2633
2626
|
LabelField,
|
|
2634
2627
|
{
|
|
2635
2628
|
id: "variable-label",
|
|
@@ -2648,7 +2641,7 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
|
2648
2641
|
onKeyDown: handleKeyDown
|
|
2649
2642
|
}
|
|
2650
2643
|
)
|
|
2651
|
-
), ValueField && /* @__PURE__ */
|
|
2644
|
+
), ValueField && /* @__PURE__ */ React19.createElement(FormField, { errorMsg: valueFieldError, label: (0, import_i18n13.__)("Value", "elementor") }, /* @__PURE__ */ React19.createElement(import_ui19.Typography, { variant: "h5" }, /* @__PURE__ */ React19.createElement(
|
|
2652
2645
|
ValueField,
|
|
2653
2646
|
{
|
|
2654
2647
|
propTypeKey: variable.type,
|
|
@@ -2663,7 +2656,7 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
|
2663
2656
|
onValidationChange: setValueFieldError,
|
|
2664
2657
|
propType
|
|
2665
2658
|
}
|
|
2666
|
-
))), errorMessage && /* @__PURE__ */
|
|
2659
|
+
))), errorMessage && /* @__PURE__ */ React19.createElement(import_ui19.FormHelperText, { error: true }, errorMessage)), /* @__PURE__ */ React19.createElement(import_ui19.CardActions, { sx: { pt: 0.5, pb: 1 } }, /* @__PURE__ */ React19.createElement(import_ui19.Button, { size: "small", variant: "contained", disabled: isSubmitDisabled, onClick: handleUpdate }, (0, import_i18n13.__)("Save", "elementor")))), deleteConfirmation && /* @__PURE__ */ React19.createElement(
|
|
2667
2660
|
DeleteConfirmationDialog,
|
|
2668
2661
|
{
|
|
2669
2662
|
open: true,
|
|
@@ -2671,7 +2664,7 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
|
2671
2664
|
onConfirm: handleDelete,
|
|
2672
2665
|
closeDialog: closeDeleteDialog()
|
|
2673
2666
|
}
|
|
2674
|
-
), editConfirmation && !isMessageSuppressed && /* @__PURE__ */
|
|
2667
|
+
), editConfirmation && !isMessageSuppressed && /* @__PURE__ */ React19.createElement(
|
|
2675
2668
|
EditConfirmationDialog,
|
|
2676
2669
|
{
|
|
2677
2670
|
closeDialog: closeEditDialog(),
|
|
@@ -2682,26 +2675,26 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
|
2682
2675
|
};
|
|
2683
2676
|
|
|
2684
2677
|
// src/components/variables-selection.tsx
|
|
2685
|
-
var
|
|
2686
|
-
var
|
|
2678
|
+
var import_react19 = require("react");
|
|
2679
|
+
var React21 = __toESM(require("react"));
|
|
2687
2680
|
var import_editor_ui9 = require("@elementor/editor-ui");
|
|
2688
2681
|
var import_editor_ui10 = require("@elementor/editor-ui");
|
|
2689
|
-
var
|
|
2690
|
-
var
|
|
2691
|
-
var
|
|
2682
|
+
var import_icons10 = require("@elementor/icons");
|
|
2683
|
+
var import_ui22 = require("@elementor/ui");
|
|
2684
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
2692
2685
|
|
|
2693
2686
|
// src/components/ui/menu-item-content.tsx
|
|
2694
|
-
var
|
|
2687
|
+
var React20 = __toESM(require("react"));
|
|
2695
2688
|
var import_editor_ui8 = require("@elementor/editor-ui");
|
|
2696
|
-
var
|
|
2697
|
-
var
|
|
2698
|
-
var
|
|
2689
|
+
var import_icons9 = require("@elementor/icons");
|
|
2690
|
+
var import_ui20 = require("@elementor/ui");
|
|
2691
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
2699
2692
|
var SIZE4 = "tiny";
|
|
2700
|
-
var EDIT_LABEL = (0,
|
|
2693
|
+
var EDIT_LABEL = (0, import_i18n14.__)("Edit variable", "elementor");
|
|
2701
2694
|
var MenuItemContent = ({ item, disabled = false }) => {
|
|
2702
2695
|
const onEdit = item.onEdit;
|
|
2703
|
-
return /* @__PURE__ */
|
|
2704
|
-
|
|
2696
|
+
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(import_ui20.ListItemIcon, { sx: { color: disabled ? "text.disabled" : "inherit" } }, item.icon), /* @__PURE__ */ React20.createElement(
|
|
2697
|
+
import_ui20.Box,
|
|
2705
2698
|
{
|
|
2706
2699
|
sx: {
|
|
2707
2700
|
flex: 1,
|
|
@@ -2711,30 +2704,30 @@ var MenuItemContent = ({ item, disabled = false }) => {
|
|
|
2711
2704
|
gap: 1
|
|
2712
2705
|
}
|
|
2713
2706
|
},
|
|
2714
|
-
/* @__PURE__ */
|
|
2707
|
+
/* @__PURE__ */ React20.createElement(
|
|
2715
2708
|
import_editor_ui8.EllipsisWithTooltip,
|
|
2716
2709
|
{
|
|
2717
2710
|
title: item.label || item.value,
|
|
2718
|
-
as:
|
|
2711
|
+
as: import_ui20.Typography,
|
|
2719
2712
|
variant: "caption",
|
|
2720
2713
|
color: disabled ? "text.disabled" : "text.primary",
|
|
2721
2714
|
sx: { marginTop: "1px", lineHeight: "2" },
|
|
2722
2715
|
maxWidth: "50%"
|
|
2723
2716
|
}
|
|
2724
2717
|
),
|
|
2725
|
-
item.secondaryText && /* @__PURE__ */
|
|
2718
|
+
item.secondaryText && /* @__PURE__ */ React20.createElement(
|
|
2726
2719
|
import_editor_ui8.EllipsisWithTooltip,
|
|
2727
2720
|
{
|
|
2728
2721
|
title: item.secondaryText,
|
|
2729
|
-
as:
|
|
2722
|
+
as: import_ui20.Typography,
|
|
2730
2723
|
variant: "caption",
|
|
2731
2724
|
color: disabled ? "text.disabled" : "text.tertiary",
|
|
2732
2725
|
sx: { marginTop: "1px", lineHeight: "1" },
|
|
2733
2726
|
maxWidth: "50%"
|
|
2734
2727
|
}
|
|
2735
2728
|
)
|
|
2736
|
-
), !!onEdit && !disabled && /* @__PURE__ */
|
|
2737
|
-
|
|
2729
|
+
), !!onEdit && !disabled && /* @__PURE__ */ React20.createElement(import_ui20.Tooltip, { placement: "top", title: EDIT_LABEL }, /* @__PURE__ */ React20.createElement(
|
|
2730
|
+
import_ui20.IconButton,
|
|
2738
2731
|
{
|
|
2739
2732
|
sx: { mx: 1, opacity: "0" },
|
|
2740
2733
|
onClick: (e) => {
|
|
@@ -2743,13 +2736,13 @@ var MenuItemContent = ({ item, disabled = false }) => {
|
|
|
2743
2736
|
},
|
|
2744
2737
|
"aria-label": EDIT_LABEL
|
|
2745
2738
|
},
|
|
2746
|
-
/* @__PURE__ */
|
|
2739
|
+
/* @__PURE__ */ React20.createElement(import_icons9.EditIcon, { color: "action", fontSize: SIZE4 })
|
|
2747
2740
|
)));
|
|
2748
2741
|
};
|
|
2749
2742
|
|
|
2750
2743
|
// src/components/ui/styled-menu-list.tsx
|
|
2751
|
-
var
|
|
2752
|
-
var VariablesStyledMenuList = (0,
|
|
2744
|
+
var import_ui21 = require("@elementor/ui");
|
|
2745
|
+
var VariablesStyledMenuList = (0, import_ui21.styled)(import_ui21.MenuList)(({ theme, disabled }) => ({
|
|
2753
2746
|
"& > li": {
|
|
2754
2747
|
height: 32,
|
|
2755
2748
|
width: "100%",
|
|
@@ -2783,13 +2776,13 @@ var VariablesStyledMenuList = (0, import_ui22.styled)(import_ui22.MenuList)(({ t
|
|
|
2783
2776
|
|
|
2784
2777
|
// src/components/variables-selection.tsx
|
|
2785
2778
|
var SIZE5 = "tiny";
|
|
2786
|
-
var CREATE_LABEL = (0,
|
|
2787
|
-
var MANAGER_LABEL = (0,
|
|
2779
|
+
var CREATE_LABEL = (0, import_i18n15.__)("Create variable", "elementor");
|
|
2780
|
+
var MANAGER_LABEL = (0, import_i18n15.__)("Variables Manager", "elementor");
|
|
2788
2781
|
var getProUpgradeUrl = (variableType) => `https://go.elementor.com/renew-license-panel-${variableType}-variable`;
|
|
2789
2782
|
var VariablesSelection = ({ closePopover, onAdd, onEdit, onSettings, disabled = false }) => {
|
|
2790
2783
|
const { icon: VariableIcon, startIcon, variableType, propTypeUtil, emptyState } = useVariableType();
|
|
2791
2784
|
const { value: variable, setValue: setVariable, path } = useVariableBoundProp();
|
|
2792
|
-
const [searchValue, setSearchValue] = (0,
|
|
2785
|
+
const [searchValue, setSearchValue] = (0, import_react19.useState)("");
|
|
2793
2786
|
const {
|
|
2794
2787
|
list: variables,
|
|
2795
2788
|
hasMatches: hasSearchResults,
|
|
@@ -2816,8 +2809,8 @@ var VariablesSelection = ({ closePopover, onAdd, onEdit, onSettings, disabled =
|
|
|
2816
2809
|
const actions = [];
|
|
2817
2810
|
if (onAdd) {
|
|
2818
2811
|
actions.push(
|
|
2819
|
-
/* @__PURE__ */
|
|
2820
|
-
|
|
2812
|
+
/* @__PURE__ */ React21.createElement(import_ui22.Tooltip, { key: "add", placement: "top", title: CREATE_LABEL }, /* @__PURE__ */ React21.createElement("span", null, /* @__PURE__ */ React21.createElement(
|
|
2813
|
+
import_ui22.IconButton,
|
|
2821
2814
|
{
|
|
2822
2815
|
id: "add-variable-button",
|
|
2823
2816
|
size: SIZE5,
|
|
@@ -2825,7 +2818,7 @@ var VariablesSelection = ({ closePopover, onAdd, onEdit, onSettings, disabled =
|
|
|
2825
2818
|
"aria-label": CREATE_LABEL,
|
|
2826
2819
|
disabled
|
|
2827
2820
|
},
|
|
2828
|
-
/* @__PURE__ */
|
|
2821
|
+
/* @__PURE__ */ React21.createElement(import_icons10.PlusIcon, { fontSize: SIZE5 })
|
|
2829
2822
|
)))
|
|
2830
2823
|
);
|
|
2831
2824
|
}
|
|
@@ -2839,24 +2832,24 @@ var VariablesSelection = ({ closePopover, onAdd, onEdit, onSettings, disabled =
|
|
|
2839
2832
|
});
|
|
2840
2833
|
};
|
|
2841
2834
|
actions.push(
|
|
2842
|
-
/* @__PURE__ */
|
|
2843
|
-
|
|
2835
|
+
/* @__PURE__ */ React21.createElement(import_ui22.Tooltip, { key: "settings", placement: "top", title: MANAGER_LABEL }, /* @__PURE__ */ React21.createElement(
|
|
2836
|
+
import_ui22.IconButton,
|
|
2844
2837
|
{
|
|
2845
2838
|
id: "variables-manager-button",
|
|
2846
2839
|
size: SIZE5,
|
|
2847
2840
|
onClick: handleOpenManager,
|
|
2848
2841
|
"aria-label": MANAGER_LABEL
|
|
2849
2842
|
},
|
|
2850
|
-
/* @__PURE__ */
|
|
2843
|
+
/* @__PURE__ */ React21.createElement(import_icons10.SettingsIcon, { fontSize: SIZE5 })
|
|
2851
2844
|
))
|
|
2852
2845
|
);
|
|
2853
2846
|
}
|
|
2854
|
-
const StartIcon = startIcon || (() => /* @__PURE__ */
|
|
2847
|
+
const StartIcon = startIcon || (() => /* @__PURE__ */ React21.createElement(VariableIcon, { fontSize: SIZE5 }));
|
|
2855
2848
|
const items = variables.map(({ value, label, key }) => ({
|
|
2856
2849
|
type: "item",
|
|
2857
2850
|
value: key,
|
|
2858
2851
|
label,
|
|
2859
|
-
icon: /* @__PURE__ */
|
|
2852
|
+
icon: /* @__PURE__ */ React21.createElement(StartIcon, { value }),
|
|
2860
2853
|
secondaryText: value,
|
|
2861
2854
|
onEdit: onEdit ? () => onEdit?.(key) : void 0
|
|
2862
2855
|
}));
|
|
@@ -2866,22 +2859,22 @@ var VariablesSelection = ({ closePopover, onAdd, onEdit, onSettings, disabled =
|
|
|
2866
2859
|
const handleClearSearch = () => {
|
|
2867
2860
|
setSearchValue("");
|
|
2868
2861
|
};
|
|
2869
|
-
return /* @__PURE__ */
|
|
2862
|
+
return /* @__PURE__ */ React21.createElement(import_editor_ui9.SectionPopoverBody, null, /* @__PURE__ */ React21.createElement(
|
|
2870
2863
|
import_editor_ui9.PopoverHeader,
|
|
2871
2864
|
{
|
|
2872
|
-
title: (0,
|
|
2873
|
-
icon: /* @__PURE__ */
|
|
2865
|
+
title: (0, import_i18n15.__)("Variables", "elementor"),
|
|
2866
|
+
icon: /* @__PURE__ */ React21.createElement(import_icons10.ColorFilterIcon, { fontSize: SIZE5 }),
|
|
2874
2867
|
onClose: closePopover,
|
|
2875
2868
|
actions
|
|
2876
2869
|
}
|
|
2877
|
-
), hasVariables && /* @__PURE__ */
|
|
2870
|
+
), hasVariables && /* @__PURE__ */ React21.createElement(
|
|
2878
2871
|
import_editor_ui9.SearchField,
|
|
2879
2872
|
{
|
|
2880
2873
|
value: searchValue,
|
|
2881
2874
|
onSearch: handleSearch,
|
|
2882
|
-
placeholder: (0,
|
|
2875
|
+
placeholder: (0, import_i18n15.__)("Search", "elementor")
|
|
2883
2876
|
}
|
|
2884
|
-
), /* @__PURE__ */
|
|
2877
|
+
), /* @__PURE__ */ React21.createElement(import_ui22.Divider, null), hasVariables && hasSearchResults && /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
2885
2878
|
import_editor_ui9.PopoverMenuList,
|
|
2886
2879
|
{
|
|
2887
2880
|
items,
|
|
@@ -2891,66 +2884,66 @@ var VariablesSelection = ({ closePopover, onAdd, onEdit, onSettings, disabled =
|
|
|
2891
2884
|
},
|
|
2892
2885
|
selectedValue: variable,
|
|
2893
2886
|
"data-testid": `${variableType}-variables-list`,
|
|
2894
|
-
menuListTemplate: (props) => /* @__PURE__ */
|
|
2895
|
-
menuItemContentTemplate: (item) => /* @__PURE__ */
|
|
2887
|
+
menuListTemplate: (props) => /* @__PURE__ */ React21.createElement(VariablesStyledMenuList, { ...props, disabled }),
|
|
2888
|
+
menuItemContentTemplate: (item) => /* @__PURE__ */ React21.createElement(MenuItemContent, { item, disabled })
|
|
2896
2889
|
}
|
|
2897
|
-
), disabled && /* @__PURE__ */
|
|
2890
|
+
), disabled && /* @__PURE__ */ React21.createElement(
|
|
2898
2891
|
import_editor_ui10.PromotionAlert,
|
|
2899
2892
|
{
|
|
2900
|
-
message: (0,
|
|
2893
|
+
message: (0, import_i18n15.sprintf)(
|
|
2901
2894
|
/* translators: %s: Variable Type. */
|
|
2902
|
-
(0,
|
|
2895
|
+
(0, import_i18n15.__)("Upgrade to continue creating and editing %s variables.", "elementor"),
|
|
2903
2896
|
variableType
|
|
2904
2897
|
),
|
|
2905
2898
|
upgradeUrl: getProUpgradeUrl(variableType)
|
|
2906
2899
|
}
|
|
2907
|
-
)), !hasSearchResults && hasVariables && /* @__PURE__ */
|
|
2900
|
+
)), !hasSearchResults && hasVariables && /* @__PURE__ */ React21.createElement(
|
|
2908
2901
|
NoSearchResults,
|
|
2909
2902
|
{
|
|
2910
2903
|
searchValue,
|
|
2911
2904
|
onClear: handleClearSearch,
|
|
2912
|
-
icon: /* @__PURE__ */
|
|
2905
|
+
icon: /* @__PURE__ */ React21.createElement(VariableIcon, { fontSize: "large" })
|
|
2913
2906
|
}
|
|
2914
|
-
), disabled && !hasVariables && /* @__PURE__ */
|
|
2907
|
+
), disabled && !hasVariables && /* @__PURE__ */ React21.createElement(
|
|
2915
2908
|
EmptyState,
|
|
2916
2909
|
{
|
|
2917
|
-
title: (0,
|
|
2910
|
+
title: (0, import_i18n15.sprintf)(
|
|
2918
2911
|
/* translators: %s: Variable Type. */
|
|
2919
|
-
(0,
|
|
2912
|
+
(0, import_i18n15.__)("No %s variables yet", "elementor"),
|
|
2920
2913
|
variableType
|
|
2921
2914
|
),
|
|
2922
|
-
message: (0,
|
|
2915
|
+
message: (0, import_i18n15.sprintf)(
|
|
2923
2916
|
/* translators: %s: Variable Type. */
|
|
2924
|
-
(0,
|
|
2917
|
+
(0, import_i18n15.__)("Upgrade to create %s variables and maintain consistent element sizing.", "elementor"),
|
|
2925
2918
|
variableType
|
|
2926
2919
|
),
|
|
2927
|
-
icon: /* @__PURE__ */
|
|
2920
|
+
icon: /* @__PURE__ */ React21.createElement(VariableIcon, { fontSize: "large" })
|
|
2928
2921
|
},
|
|
2929
2922
|
emptyState
|
|
2930
|
-
), !hasVariables && !hasNoCompatibleVariables && !disabled && /* @__PURE__ */
|
|
2923
|
+
), !hasVariables && !hasNoCompatibleVariables && !disabled && /* @__PURE__ */ React21.createElement(
|
|
2931
2924
|
EmptyState,
|
|
2932
2925
|
{
|
|
2933
|
-
title: (0,
|
|
2926
|
+
title: (0, import_i18n15.sprintf)(
|
|
2934
2927
|
/* translators: %s: Variable Type. */
|
|
2935
|
-
(0,
|
|
2928
|
+
(0, import_i18n15.__)("Create your first %s variable", "elementor"),
|
|
2936
2929
|
variableType
|
|
2937
2930
|
),
|
|
2938
|
-
message: (0,
|
|
2931
|
+
message: (0, import_i18n15.__)(
|
|
2939
2932
|
"Variables are saved attributes that you can apply anywhere on your site.",
|
|
2940
2933
|
"elementor"
|
|
2941
2934
|
),
|
|
2942
|
-
icon: /* @__PURE__ */
|
|
2935
|
+
icon: /* @__PURE__ */ React21.createElement(VariableIcon, { fontSize: "large" }),
|
|
2943
2936
|
onAdd
|
|
2944
2937
|
}
|
|
2945
|
-
), hasNoCompatibleVariables && !disabled && /* @__PURE__ */
|
|
2938
|
+
), hasNoCompatibleVariables && !disabled && /* @__PURE__ */ React21.createElement(
|
|
2946
2939
|
EmptyState,
|
|
2947
2940
|
{
|
|
2948
|
-
title: (0,
|
|
2949
|
-
message: (0,
|
|
2941
|
+
title: (0, import_i18n15.__)("No compatible variables", "elementor"),
|
|
2942
|
+
message: (0, import_i18n15.__)(
|
|
2950
2943
|
"Looks like none of your variables work with this control. Create a new variable to use it here.",
|
|
2951
2944
|
"elementor"
|
|
2952
2945
|
),
|
|
2953
|
-
icon: /* @__PURE__ */
|
|
2946
|
+
icon: /* @__PURE__ */ React21.createElement(VariableIcon, { fontSize: "large" }),
|
|
2954
2947
|
onAdd
|
|
2955
2948
|
}
|
|
2956
2949
|
));
|
|
@@ -2961,13 +2954,13 @@ var VIEW_LIST = "list";
|
|
|
2961
2954
|
var VIEW_ADD = "add";
|
|
2962
2955
|
var VIEW_EDIT = "edit";
|
|
2963
2956
|
var VariableSelectionPopover = ({ closePopover, propTypeKey, selectedVariable }) => {
|
|
2964
|
-
const [currentView, setCurrentView] = (0,
|
|
2965
|
-
const [editId, setEditId] = (0,
|
|
2957
|
+
const [currentView, setCurrentView] = (0, import_react20.useState)(VIEW_LIST);
|
|
2958
|
+
const [editId, setEditId] = (0, import_react20.useState)("");
|
|
2966
2959
|
const { open } = usePanelActions();
|
|
2967
2960
|
const onSettingsAvailable = (0, import_editor_v1_adapters4.isExperimentActive)("e_variables_manager") ? () => {
|
|
2968
2961
|
open();
|
|
2969
2962
|
} : void 0;
|
|
2970
|
-
return /* @__PURE__ */
|
|
2963
|
+
return /* @__PURE__ */ React22.createElement(VariableTypeProvider, { propTypeKey }, /* @__PURE__ */ React22.createElement(PopoverContentRefContextProvider, null, RenderView({
|
|
2971
2964
|
propTypeKey,
|
|
2972
2965
|
currentView,
|
|
2973
2966
|
selectedVariable,
|
|
@@ -3014,7 +3007,7 @@ function RenderView(props) {
|
|
|
3014
3007
|
}
|
|
3015
3008
|
};
|
|
3016
3009
|
if (VIEW_LIST === props.currentView) {
|
|
3017
|
-
return /* @__PURE__ */
|
|
3010
|
+
return /* @__PURE__ */ React22.createElement(
|
|
3018
3011
|
VariablesSelection,
|
|
3019
3012
|
{
|
|
3020
3013
|
closePopover: handlers.onClose,
|
|
@@ -3026,10 +3019,10 @@ function RenderView(props) {
|
|
|
3026
3019
|
);
|
|
3027
3020
|
}
|
|
3028
3021
|
if (VIEW_ADD === props.currentView) {
|
|
3029
|
-
return /* @__PURE__ */
|
|
3022
|
+
return /* @__PURE__ */ React22.createElement(VariableCreation, { onGoBack: handlers.onGoBack, onClose: handlers.onClose });
|
|
3030
3023
|
}
|
|
3031
3024
|
if (VIEW_EDIT === props.currentView) {
|
|
3032
|
-
return /* @__PURE__ */
|
|
3025
|
+
return /* @__PURE__ */ React22.createElement(
|
|
3033
3026
|
VariableEdit,
|
|
3034
3027
|
{
|
|
3035
3028
|
editId: props.editId,
|
|
@@ -3043,26 +3036,26 @@ function RenderView(props) {
|
|
|
3043
3036
|
}
|
|
3044
3037
|
|
|
3045
3038
|
// src/components/ui/tags/assigned-tag.tsx
|
|
3046
|
-
var
|
|
3047
|
-
var
|
|
3048
|
-
var
|
|
3049
|
-
var
|
|
3039
|
+
var React23 = __toESM(require("react"));
|
|
3040
|
+
var import_icons11 = require("@elementor/icons");
|
|
3041
|
+
var import_ui23 = require("@elementor/ui");
|
|
3042
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
3050
3043
|
var SIZE6 = "tiny";
|
|
3051
|
-
var UNLINK_LABEL = (0,
|
|
3044
|
+
var UNLINK_LABEL = (0, import_i18n16.__)("Unlink variable", "elementor");
|
|
3052
3045
|
var AssignedTag = ({ startIcon, label, onUnlink, ...props }) => {
|
|
3053
3046
|
const actions = [];
|
|
3054
3047
|
if (onUnlink) {
|
|
3055
3048
|
actions.push(
|
|
3056
|
-
/* @__PURE__ */
|
|
3049
|
+
/* @__PURE__ */ React23.createElement(import_ui23.Tooltip, { key: "unlink", title: UNLINK_LABEL, placement: "bottom" }, /* @__PURE__ */ React23.createElement(import_ui23.IconButton, { size: SIZE6, onClick: onUnlink, "aria-label": UNLINK_LABEL }, /* @__PURE__ */ React23.createElement(import_icons11.DetachIcon, { fontSize: SIZE6 })))
|
|
3057
3050
|
);
|
|
3058
3051
|
}
|
|
3059
|
-
return /* @__PURE__ */
|
|
3060
|
-
|
|
3052
|
+
return /* @__PURE__ */ React23.createElement(import_ui23.Tooltip, { title: label, placement: "top" }, /* @__PURE__ */ React23.createElement(
|
|
3053
|
+
import_ui23.UnstableTag,
|
|
3061
3054
|
{
|
|
3062
3055
|
fullWidth: true,
|
|
3063
3056
|
showActionsOnHover: true,
|
|
3064
|
-
startIcon: /* @__PURE__ */
|
|
3065
|
-
label: /* @__PURE__ */
|
|
3057
|
+
startIcon: /* @__PURE__ */ React23.createElement(import_ui23.Stack, { gap: 0.5, direction: "row", alignItems: "center" }, startIcon),
|
|
3058
|
+
label: /* @__PURE__ */ React23.createElement(import_ui23.Box, { sx: { display: "inline-grid", minWidth: 0 } }, /* @__PURE__ */ React23.createElement(import_ui23.Typography, { sx: { lineHeight: 1.34 }, variant: "caption", noWrap: true }, label)),
|
|
3066
3059
|
actions,
|
|
3067
3060
|
...props
|
|
3068
3061
|
}
|
|
@@ -3073,24 +3066,24 @@ var AssignedTag = ({ startIcon, label, onUnlink, ...props }) => {
|
|
|
3073
3066
|
var AssignedVariable = ({ variable, propTypeKey }) => {
|
|
3074
3067
|
const { startIcon, propTypeUtil } = getVariableType(propTypeKey);
|
|
3075
3068
|
const { setValue } = (0, import_editor_controls6.useBoundProp)();
|
|
3076
|
-
const anchorRef = (0,
|
|
3077
|
-
const popupId = (0,
|
|
3078
|
-
const popupState = (0,
|
|
3069
|
+
const anchorRef = (0, import_react21.useRef)(null);
|
|
3070
|
+
const popupId = (0, import_react21.useId)();
|
|
3071
|
+
const popupState = (0, import_ui24.usePopupState)({
|
|
3079
3072
|
variant: "popover",
|
|
3080
3073
|
popupId: `elementor-variables-list-${popupId}`
|
|
3081
3074
|
});
|
|
3082
3075
|
const unlinkVariable = createUnlinkHandler(variable, propTypeKey, setValue);
|
|
3083
3076
|
const StartIcon = startIcon || (() => null);
|
|
3084
|
-
return /* @__PURE__ */
|
|
3077
|
+
return /* @__PURE__ */ React24.createElement(import_ui24.Box, { ref: anchorRef }, /* @__PURE__ */ React24.createElement(
|
|
3085
3078
|
AssignedTag,
|
|
3086
3079
|
{
|
|
3087
3080
|
label: variable.label,
|
|
3088
|
-
startIcon: /* @__PURE__ */
|
|
3081
|
+
startIcon: /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(import_icons12.ColorFilterIcon, { fontSize: SIZE6 }), /* @__PURE__ */ React24.createElement(StartIcon, { value: variable.value })),
|
|
3089
3082
|
onUnlink: unlinkVariable,
|
|
3090
|
-
...(0,
|
|
3083
|
+
...(0, import_ui24.bindTrigger)(popupState)
|
|
3091
3084
|
}
|
|
3092
|
-
), /* @__PURE__ */
|
|
3093
|
-
|
|
3085
|
+
), /* @__PURE__ */ React24.createElement(
|
|
3086
|
+
import_ui24.Popover,
|
|
3094
3087
|
{
|
|
3095
3088
|
disableScrollLock: true,
|
|
3096
3089
|
anchorEl: anchorRef.current,
|
|
@@ -3099,9 +3092,9 @@ var AssignedVariable = ({ variable, propTypeKey }) => {
|
|
|
3099
3092
|
PaperProps: {
|
|
3100
3093
|
sx: { my: 1 }
|
|
3101
3094
|
},
|
|
3102
|
-
...(0,
|
|
3095
|
+
...(0, import_ui24.bindPopover)(popupState)
|
|
3103
3096
|
},
|
|
3104
|
-
/* @__PURE__ */
|
|
3097
|
+
/* @__PURE__ */ React24.createElement(
|
|
3105
3098
|
VariableSelectionPopover,
|
|
3106
3099
|
{
|
|
3107
3100
|
selectedVariable: variable,
|
|
@@ -3113,19 +3106,19 @@ var AssignedVariable = ({ variable, propTypeKey }) => {
|
|
|
3113
3106
|
};
|
|
3114
3107
|
|
|
3115
3108
|
// src/components/ui/variable/deleted-variable.tsx
|
|
3116
|
-
var
|
|
3117
|
-
var
|
|
3109
|
+
var React28 = __toESM(require("react"));
|
|
3110
|
+
var import_react23 = require("react");
|
|
3118
3111
|
var import_editor_controls8 = require("@elementor/editor-controls");
|
|
3119
|
-
var
|
|
3120
|
-
var
|
|
3112
|
+
var import_ui28 = require("@elementor/ui");
|
|
3113
|
+
var import_i18n19 = require("@wordpress/i18n");
|
|
3121
3114
|
|
|
3122
3115
|
// src/components/variable-restore.tsx
|
|
3123
|
-
var
|
|
3124
|
-
var
|
|
3116
|
+
var React25 = __toESM(require("react"));
|
|
3117
|
+
var import_react22 = require("react");
|
|
3125
3118
|
var import_editor_controls7 = require("@elementor/editor-controls");
|
|
3126
3119
|
var import_editor_ui11 = require("@elementor/editor-ui");
|
|
3127
|
-
var
|
|
3128
|
-
var
|
|
3120
|
+
var import_ui25 = require("@elementor/ui");
|
|
3121
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
3129
3122
|
var SIZE7 = "tiny";
|
|
3130
3123
|
var VariableRestore = ({ variableId, onClose, onSubmit }) => {
|
|
3131
3124
|
const { icon: VariableIcon, valueField: ValueField, variableType, propTypeUtil } = useVariableType();
|
|
@@ -3135,11 +3128,11 @@ var VariableRestore = ({ variableId, onClose, onSubmit }) => {
|
|
|
3135
3128
|
if (!variable) {
|
|
3136
3129
|
throw new Error(`Global ${variableType} variable not found`);
|
|
3137
3130
|
}
|
|
3138
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
3139
|
-
const [valueFieldError, setValueFieldError] = (0,
|
|
3140
|
-
const [label, setLabel] = (0,
|
|
3141
|
-
const [value, setValue] = (0,
|
|
3142
|
-
const [propTypeKey, setPropTypeKey] = (0,
|
|
3131
|
+
const [errorMessage, setErrorMessage] = (0, import_react22.useState)("");
|
|
3132
|
+
const [valueFieldError, setValueFieldError] = (0, import_react22.useState)("");
|
|
3133
|
+
const [label, setLabel] = (0, import_react22.useState)(variable.label);
|
|
3134
|
+
const [value, setValue] = (0, import_react22.useState)(variable.value);
|
|
3135
|
+
const [propTypeKey, setPropTypeKey] = (0, import_react22.useState)(variable?.type ?? propTypeUtil.key);
|
|
3143
3136
|
const { labelFieldError, setLabelFieldError } = useLabelError({
|
|
3144
3137
|
value: variable.label,
|
|
3145
3138
|
message: ERROR_MESSAGES.DUPLICATED_LABEL
|
|
@@ -3185,22 +3178,22 @@ var VariableRestore = ({ variableId, onClose, onSubmit }) => {
|
|
|
3185
3178
|
handleRestore();
|
|
3186
3179
|
}
|
|
3187
3180
|
};
|
|
3188
|
-
return /* @__PURE__ */
|
|
3181
|
+
return /* @__PURE__ */ React25.createElement(PopoverContentRefContextProvider, null, /* @__PURE__ */ React25.createElement(import_editor_ui11.SectionPopoverBody, { height: "auto" }, /* @__PURE__ */ React25.createElement(
|
|
3189
3182
|
import_editor_ui11.PopoverHeader,
|
|
3190
3183
|
{
|
|
3191
|
-
icon: /* @__PURE__ */
|
|
3192
|
-
title: (0,
|
|
3184
|
+
icon: /* @__PURE__ */ React25.createElement(VariableIcon, { fontSize: SIZE7 }),
|
|
3185
|
+
title: (0, import_i18n17.__)("Restore variable", "elementor"),
|
|
3193
3186
|
onClose
|
|
3194
3187
|
}
|
|
3195
|
-
), /* @__PURE__ */
|
|
3188
|
+
), /* @__PURE__ */ React25.createElement(import_ui25.Divider, null), /* @__PURE__ */ React25.createElement(import_editor_controls7.PopoverContent, { p: 2 }, /* @__PURE__ */ React25.createElement(
|
|
3196
3189
|
FormField,
|
|
3197
3190
|
{
|
|
3198
3191
|
id: "variable-label",
|
|
3199
|
-
label: (0,
|
|
3192
|
+
label: (0, import_i18n17.__)("Name", "elementor"),
|
|
3200
3193
|
errorMsg: labelFieldError?.message,
|
|
3201
3194
|
noticeMsg: labelHint(label)
|
|
3202
3195
|
},
|
|
3203
|
-
/* @__PURE__ */
|
|
3196
|
+
/* @__PURE__ */ React25.createElement(
|
|
3204
3197
|
LabelField,
|
|
3205
3198
|
{
|
|
3206
3199
|
id: "variable-label",
|
|
@@ -3219,7 +3212,7 @@ var VariableRestore = ({ variableId, onClose, onSubmit }) => {
|
|
|
3219
3212
|
onKeyDown: handleKeyDown
|
|
3220
3213
|
}
|
|
3221
3214
|
)
|
|
3222
|
-
), ValueField && /* @__PURE__ */
|
|
3215
|
+
), ValueField && /* @__PURE__ */ React25.createElement(FormField, { errorMsg: valueFieldError, label: (0, import_i18n17.__)("Value", "elementor") }, /* @__PURE__ */ React25.createElement(import_ui25.Typography, { variant: "h5" }, /* @__PURE__ */ React25.createElement(
|
|
3223
3216
|
ValueField,
|
|
3224
3217
|
{
|
|
3225
3218
|
propTypeKey,
|
|
@@ -3234,25 +3227,25 @@ var VariableRestore = ({ variableId, onClose, onSubmit }) => {
|
|
|
3234
3227
|
propType,
|
|
3235
3228
|
onKeyDown: handleKeyDown
|
|
3236
3229
|
}
|
|
3237
|
-
))), errorMessage && /* @__PURE__ */
|
|
3230
|
+
))), errorMessage && /* @__PURE__ */ React25.createElement(import_ui25.FormHelperText, { error: true }, errorMessage)), /* @__PURE__ */ React25.createElement(import_ui25.CardActions, { sx: { pt: 0.5, pb: 1 } }, /* @__PURE__ */ React25.createElement(import_ui25.Button, { size: "small", variant: "contained", disabled: isSubmitDisabled, onClick: handleRestore }, (0, import_i18n17.__)("Restore", "elementor")))));
|
|
3238
3231
|
};
|
|
3239
3232
|
|
|
3240
3233
|
// src/components/ui/deleted-variable-alert.tsx
|
|
3241
|
-
var
|
|
3242
|
-
var
|
|
3243
|
-
var
|
|
3234
|
+
var React26 = __toESM(require("react"));
|
|
3235
|
+
var import_ui26 = require("@elementor/ui");
|
|
3236
|
+
var import_i18n18 = require("@wordpress/i18n");
|
|
3244
3237
|
var DeletedVariableAlert = ({ onClose, onUnlink, onRestore, label }) => {
|
|
3245
|
-
return /* @__PURE__ */
|
|
3246
|
-
|
|
3238
|
+
return /* @__PURE__ */ React26.createElement(import_ui26.ClickAwayListener, { onClickAway: onClose }, /* @__PURE__ */ React26.createElement(
|
|
3239
|
+
import_ui26.Alert,
|
|
3247
3240
|
{
|
|
3248
3241
|
variant: "standard",
|
|
3249
3242
|
severity: "warning",
|
|
3250
3243
|
onClose,
|
|
3251
|
-
action: /* @__PURE__ */
|
|
3244
|
+
action: /* @__PURE__ */ React26.createElement(React26.Fragment, null, onUnlink && /* @__PURE__ */ React26.createElement(import_ui26.AlertAction, { variant: "contained", onClick: onUnlink }, (0, import_i18n18.__)("Unlink", "elementor")), onRestore && /* @__PURE__ */ React26.createElement(import_ui26.AlertAction, { variant: "outlined", onClick: onRestore }, (0, import_i18n18.__)("Restore", "elementor"))),
|
|
3252
3245
|
sx: { maxWidth: 300 }
|
|
3253
3246
|
},
|
|
3254
|
-
/* @__PURE__ */
|
|
3255
|
-
/* @__PURE__ */
|
|
3247
|
+
/* @__PURE__ */ React26.createElement(import_ui26.AlertTitle, null, (0, import_i18n18.__)("Deleted variable", "elementor")),
|
|
3248
|
+
/* @__PURE__ */ React26.createElement(import_ui26.Typography, { variant: "body2", color: "textPrimary" }, (0, import_i18n18.__)("The variable", "elementor"), "\xA0'", /* @__PURE__ */ React26.createElement(import_ui26.Typography, { variant: "body2", component: "span", sx: { lineBreak: "anywhere" } }, label), "'\xA0", (0, import_i18n18.__)(
|
|
3256
3249
|
"has been deleted, but it is still referenced in this location. You may restore the variable or unlink it to assign a different value.",
|
|
3257
3250
|
"elementor"
|
|
3258
3251
|
))
|
|
@@ -3260,14 +3253,14 @@ var DeletedVariableAlert = ({ onClose, onUnlink, onRestore, label }) => {
|
|
|
3260
3253
|
};
|
|
3261
3254
|
|
|
3262
3255
|
// src/components/ui/tags/warning-variable-tag.tsx
|
|
3263
|
-
var
|
|
3264
|
-
var
|
|
3265
|
-
var
|
|
3266
|
-
var WarningVariableTag =
|
|
3256
|
+
var React27 = __toESM(require("react"));
|
|
3257
|
+
var import_icons13 = require("@elementor/icons");
|
|
3258
|
+
var import_ui27 = require("@elementor/ui");
|
|
3259
|
+
var WarningVariableTag = React27.forwardRef(
|
|
3267
3260
|
({ label, suffix, onClick, icon, ...props }, ref) => {
|
|
3268
3261
|
const displayText = suffix ? `${label} (${suffix})` : label;
|
|
3269
|
-
return /* @__PURE__ */
|
|
3270
|
-
|
|
3262
|
+
return /* @__PURE__ */ React27.createElement(
|
|
3263
|
+
import_ui27.Chip,
|
|
3271
3264
|
{
|
|
3272
3265
|
ref,
|
|
3273
3266
|
size: "tiny",
|
|
@@ -3275,8 +3268,8 @@ var WarningVariableTag = React28.forwardRef(
|
|
|
3275
3268
|
shape: "rounded",
|
|
3276
3269
|
variant: "standard",
|
|
3277
3270
|
onClick,
|
|
3278
|
-
icon: /* @__PURE__ */
|
|
3279
|
-
label: /* @__PURE__ */
|
|
3271
|
+
icon: /* @__PURE__ */ React27.createElement(import_icons13.AlertTriangleFilledIcon, null),
|
|
3272
|
+
label: /* @__PURE__ */ React27.createElement(import_ui27.Tooltip, { title: displayText, placement: "top" }, /* @__PURE__ */ React27.createElement(import_ui27.Box, { sx: { display: "inline-grid", minWidth: 0 } }, /* @__PURE__ */ React27.createElement(import_ui27.Typography, { variant: "caption", noWrap: true, sx: { lineHeight: 1.34 } }, displayText))),
|
|
3280
3273
|
sx: {
|
|
3281
3274
|
height: (theme) => theme.spacing(3.5),
|
|
3282
3275
|
borderRadius: (theme) => theme.spacing(1),
|
|
@@ -3295,12 +3288,12 @@ var DeletedVariable = ({ variable, propTypeKey }) => {
|
|
|
3295
3288
|
const { propTypeUtil } = getVariableType(propTypeKey);
|
|
3296
3289
|
const boundProp = (0, import_editor_controls8.useBoundProp)();
|
|
3297
3290
|
const userPermissions = usePermissions();
|
|
3298
|
-
const [showInfotip, setShowInfotip] = (0,
|
|
3291
|
+
const [showInfotip, setShowInfotip] = (0, import_react23.useState)(false);
|
|
3299
3292
|
const toggleInfotip = () => setShowInfotip((prev) => !prev);
|
|
3300
3293
|
const closeInfotip = () => setShowInfotip(false);
|
|
3301
|
-
const deletedChipAnchorRef = (0,
|
|
3302
|
-
const popupId = (0,
|
|
3303
|
-
const popupState = (0,
|
|
3294
|
+
const deletedChipAnchorRef = (0, import_react23.useRef)(null);
|
|
3295
|
+
const popupId = (0, import_react23.useId)();
|
|
3296
|
+
const popupState = (0, import_ui28.usePopupState)({
|
|
3304
3297
|
variant: "popover",
|
|
3305
3298
|
popupId: `elementor-variables-restore-${popupId}`
|
|
3306
3299
|
});
|
|
@@ -3326,15 +3319,15 @@ var DeletedVariable = ({ variable, propTypeKey }) => {
|
|
|
3326
3319
|
const handleRestoreWithOverrides = () => {
|
|
3327
3320
|
popupState.close();
|
|
3328
3321
|
};
|
|
3329
|
-
return /* @__PURE__ */
|
|
3330
|
-
|
|
3322
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(import_ui28.Box, { ref: deletedChipAnchorRef }, showInfotip && /* @__PURE__ */ React28.createElement(import_ui28.Backdrop, { open: true, onClick: closeInfotip, invisible: true }), /* @__PURE__ */ React28.createElement(
|
|
3323
|
+
import_ui28.Infotip,
|
|
3331
3324
|
{
|
|
3332
3325
|
color: "warning",
|
|
3333
3326
|
placement: "right-start",
|
|
3334
3327
|
open: showInfotip,
|
|
3335
3328
|
disableHoverListener: true,
|
|
3336
3329
|
onClose: closeInfotip,
|
|
3337
|
-
content: /* @__PURE__ */
|
|
3330
|
+
content: /* @__PURE__ */ React28.createElement(
|
|
3338
3331
|
DeletedVariableAlert,
|
|
3339
3332
|
{
|
|
3340
3333
|
onClose: closeInfotip,
|
|
@@ -3354,16 +3347,16 @@ var DeletedVariable = ({ variable, propTypeKey }) => {
|
|
|
3354
3347
|
}
|
|
3355
3348
|
}
|
|
3356
3349
|
},
|
|
3357
|
-
/* @__PURE__ */
|
|
3350
|
+
/* @__PURE__ */ React28.createElement(
|
|
3358
3351
|
WarningVariableTag,
|
|
3359
3352
|
{
|
|
3360
3353
|
label: variable.label,
|
|
3361
3354
|
onClick: toggleInfotip,
|
|
3362
|
-
suffix: (0,
|
|
3355
|
+
suffix: (0, import_i18n19.__)("deleted", "elementor")
|
|
3363
3356
|
}
|
|
3364
3357
|
)
|
|
3365
|
-
), /* @__PURE__ */
|
|
3366
|
-
|
|
3358
|
+
), /* @__PURE__ */ React28.createElement(
|
|
3359
|
+
import_ui28.Popover,
|
|
3367
3360
|
{
|
|
3368
3361
|
disableScrollLock: true,
|
|
3369
3362
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
@@ -3371,9 +3364,9 @@ var DeletedVariable = ({ variable, propTypeKey }) => {
|
|
|
3371
3364
|
PaperProps: {
|
|
3372
3365
|
sx: { my: 1 }
|
|
3373
3366
|
},
|
|
3374
|
-
...(0,
|
|
3367
|
+
...(0, import_ui28.bindPopover)(popupState)
|
|
3375
3368
|
},
|
|
3376
|
-
/* @__PURE__ */
|
|
3369
|
+
/* @__PURE__ */ React28.createElement(VariableTypeProvider, { propTypeKey }, /* @__PURE__ */ React28.createElement(
|
|
3377
3370
|
VariableRestore,
|
|
3378
3371
|
{
|
|
3379
3372
|
variableId: variable.key ?? "",
|
|
@@ -3385,52 +3378,52 @@ var DeletedVariable = ({ variable, propTypeKey }) => {
|
|
|
3385
3378
|
};
|
|
3386
3379
|
|
|
3387
3380
|
// src/components/ui/variable/mismatch-variable.tsx
|
|
3388
|
-
var React31 = __toESM(require("react"));
|
|
3389
|
-
var import_react25 = require("react");
|
|
3390
|
-
var import_editor_controls9 = require("@elementor/editor-controls");
|
|
3391
|
-
var import_ui31 = require("@elementor/ui");
|
|
3392
|
-
var import_i18n22 = require("@wordpress/i18n");
|
|
3393
|
-
|
|
3394
|
-
// src/components/ui/mismatch-variable-alert.tsx
|
|
3395
3381
|
var React30 = __toESM(require("react"));
|
|
3382
|
+
var import_react24 = require("react");
|
|
3383
|
+
var import_editor_controls9 = require("@elementor/editor-controls");
|
|
3396
3384
|
var import_ui30 = require("@elementor/ui");
|
|
3397
3385
|
var import_i18n21 = require("@wordpress/i18n");
|
|
3386
|
+
|
|
3387
|
+
// src/components/ui/mismatch-variable-alert.tsx
|
|
3388
|
+
var React29 = __toESM(require("react"));
|
|
3389
|
+
var import_ui29 = require("@elementor/ui");
|
|
3390
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
3398
3391
|
var i18n = {
|
|
3399
|
-
title: (0,
|
|
3400
|
-
message: (0,
|
|
3392
|
+
title: (0, import_i18n20.__)("Variable has changed", "elementor"),
|
|
3393
|
+
message: (0, import_i18n20.__)(
|
|
3401
3394
|
`This variable is no longer compatible with this property. You can clear it or select a different one.`,
|
|
3402
3395
|
"elementor"
|
|
3403
3396
|
),
|
|
3404
3397
|
buttons: {
|
|
3405
|
-
clear: (0,
|
|
3406
|
-
select: (0,
|
|
3398
|
+
clear: (0, import_i18n20.__)("Clear", "elementor"),
|
|
3399
|
+
select: (0, import_i18n20.__)("Select variable", "elementor")
|
|
3407
3400
|
}
|
|
3408
3401
|
};
|
|
3409
3402
|
var MismatchVariableAlert = ({ onClose, onClear, triggerSelect }) => {
|
|
3410
|
-
return /* @__PURE__ */
|
|
3411
|
-
|
|
3403
|
+
return /* @__PURE__ */ React29.createElement(import_ui29.ClickAwayListener, { onClickAway: onClose }, /* @__PURE__ */ React29.createElement(
|
|
3404
|
+
import_ui29.Alert,
|
|
3412
3405
|
{
|
|
3413
3406
|
variant: "standard",
|
|
3414
3407
|
severity: "warning",
|
|
3415
3408
|
onClose,
|
|
3416
|
-
action: /* @__PURE__ */
|
|
3409
|
+
action: /* @__PURE__ */ React29.createElement(React29.Fragment, null, onClear && /* @__PURE__ */ React29.createElement(import_ui29.AlertAction, { variant: "contained", onClick: onClear }, i18n.buttons.clear), triggerSelect && /* @__PURE__ */ React29.createElement(import_ui29.AlertAction, { variant: "outlined", onClick: triggerSelect }, i18n.buttons.select)),
|
|
3417
3410
|
sx: { maxWidth: 300 }
|
|
3418
3411
|
},
|
|
3419
|
-
/* @__PURE__ */
|
|
3420
|
-
/* @__PURE__ */
|
|
3412
|
+
/* @__PURE__ */ React29.createElement(import_ui29.AlertTitle, null, i18n.title),
|
|
3413
|
+
/* @__PURE__ */ React29.createElement(import_ui29.Typography, { variant: "body2", color: "textPrimary" }, i18n.message)
|
|
3421
3414
|
));
|
|
3422
3415
|
};
|
|
3423
3416
|
|
|
3424
3417
|
// src/components/ui/variable/mismatch-variable.tsx
|
|
3425
3418
|
var MismatchVariable = ({ variable }) => {
|
|
3426
3419
|
const { setValue, value } = (0, import_editor_controls9.useBoundProp)();
|
|
3427
|
-
const anchorRef = (0,
|
|
3428
|
-
const popupId = (0,
|
|
3429
|
-
const popupState = (0,
|
|
3420
|
+
const anchorRef = (0, import_react24.useRef)(null);
|
|
3421
|
+
const popupId = (0, import_react24.useId)();
|
|
3422
|
+
const popupState = (0, import_ui30.usePopupState)({
|
|
3430
3423
|
variant: "popover",
|
|
3431
3424
|
popupId: `elementor-variables-list-${popupId}`
|
|
3432
3425
|
});
|
|
3433
|
-
const [infotipVisible, setInfotipVisible] = (0,
|
|
3426
|
+
const [infotipVisible, setInfotipVisible] = (0, import_react24.useState)(false);
|
|
3434
3427
|
const toggleInfotip = () => setInfotipVisible((prev) => !prev);
|
|
3435
3428
|
const closeInfotip = () => setInfotipVisible(false);
|
|
3436
3429
|
const triggerSelect = () => {
|
|
@@ -3443,15 +3436,15 @@ var MismatchVariable = ({ variable }) => {
|
|
|
3443
3436
|
setValue(null);
|
|
3444
3437
|
};
|
|
3445
3438
|
const showClearButton = !!value;
|
|
3446
|
-
return /* @__PURE__ */
|
|
3447
|
-
|
|
3439
|
+
return /* @__PURE__ */ React30.createElement(import_ui30.Box, { ref: anchorRef }, infotipVisible && /* @__PURE__ */ React30.createElement(import_ui30.Backdrop, { open: true, onClick: closeInfotip, invisible: true }), /* @__PURE__ */ React30.createElement(
|
|
3440
|
+
import_ui30.Infotip,
|
|
3448
3441
|
{
|
|
3449
3442
|
color: "warning",
|
|
3450
3443
|
placement: "right-start",
|
|
3451
3444
|
open: infotipVisible,
|
|
3452
3445
|
disableHoverListener: true,
|
|
3453
3446
|
onClose: closeInfotip,
|
|
3454
|
-
content: /* @__PURE__ */
|
|
3447
|
+
content: /* @__PURE__ */ React30.createElement(
|
|
3455
3448
|
MismatchVariableAlert,
|
|
3456
3449
|
{
|
|
3457
3450
|
onClose: closeInfotip,
|
|
@@ -3470,16 +3463,16 @@ var MismatchVariable = ({ variable }) => {
|
|
|
3470
3463
|
}
|
|
3471
3464
|
}
|
|
3472
3465
|
},
|
|
3473
|
-
/* @__PURE__ */
|
|
3466
|
+
/* @__PURE__ */ React30.createElement(
|
|
3474
3467
|
WarningVariableTag,
|
|
3475
3468
|
{
|
|
3476
3469
|
label: variable.label,
|
|
3477
3470
|
onClick: toggleInfotip,
|
|
3478
|
-
suffix: (0,
|
|
3471
|
+
suffix: (0, import_i18n21.__)("changed", "elementor")
|
|
3479
3472
|
}
|
|
3480
3473
|
)
|
|
3481
|
-
), /* @__PURE__ */
|
|
3482
|
-
|
|
3474
|
+
), /* @__PURE__ */ React30.createElement(
|
|
3475
|
+
import_ui30.Popover,
|
|
3483
3476
|
{
|
|
3484
3477
|
disableScrollLock: true,
|
|
3485
3478
|
anchorEl: anchorRef.current,
|
|
@@ -3488,9 +3481,9 @@ var MismatchVariable = ({ variable }) => {
|
|
|
3488
3481
|
PaperProps: {
|
|
3489
3482
|
sx: { my: 1 }
|
|
3490
3483
|
},
|
|
3491
|
-
...(0,
|
|
3484
|
+
...(0, import_ui30.bindPopover)(popupState)
|
|
3492
3485
|
},
|
|
3493
|
-
/* @__PURE__ */
|
|
3486
|
+
/* @__PURE__ */ React30.createElement(
|
|
3494
3487
|
VariableSelectionPopover,
|
|
3495
3488
|
{
|
|
3496
3489
|
selectedVariable: variable,
|
|
@@ -3502,28 +3495,28 @@ var MismatchVariable = ({ variable }) => {
|
|
|
3502
3495
|
};
|
|
3503
3496
|
|
|
3504
3497
|
// src/components/ui/variable/missing-variable.tsx
|
|
3505
|
-
var React33 = __toESM(require("react"));
|
|
3506
|
-
var import_react26 = require("react");
|
|
3507
|
-
var import_editor_controls10 = require("@elementor/editor-controls");
|
|
3508
|
-
var import_ui33 = require("@elementor/ui");
|
|
3509
|
-
var import_i18n24 = require("@wordpress/i18n");
|
|
3510
|
-
|
|
3511
|
-
// src/components/ui/missing-variable-alert.tsx
|
|
3512
3498
|
var React32 = __toESM(require("react"));
|
|
3499
|
+
var import_react25 = require("react");
|
|
3500
|
+
var import_editor_controls10 = require("@elementor/editor-controls");
|
|
3513
3501
|
var import_ui32 = require("@elementor/ui");
|
|
3514
3502
|
var import_i18n23 = require("@wordpress/i18n");
|
|
3503
|
+
|
|
3504
|
+
// src/components/ui/missing-variable-alert.tsx
|
|
3505
|
+
var React31 = __toESM(require("react"));
|
|
3506
|
+
var import_ui31 = require("@elementor/ui");
|
|
3507
|
+
var import_i18n22 = require("@wordpress/i18n");
|
|
3515
3508
|
var MissingVariableAlert = ({ onClose, onClear }) => {
|
|
3516
|
-
return /* @__PURE__ */
|
|
3517
|
-
|
|
3509
|
+
return /* @__PURE__ */ React31.createElement(import_ui31.ClickAwayListener, { onClickAway: onClose }, /* @__PURE__ */ React31.createElement(
|
|
3510
|
+
import_ui31.Alert,
|
|
3518
3511
|
{
|
|
3519
3512
|
variant: "standard",
|
|
3520
3513
|
severity: "warning",
|
|
3521
3514
|
onClose,
|
|
3522
|
-
action: /* @__PURE__ */
|
|
3515
|
+
action: /* @__PURE__ */ React31.createElement(React31.Fragment, null, onClear && /* @__PURE__ */ React31.createElement(import_ui31.AlertAction, { variant: "contained", onClick: onClear }, (0, import_i18n22.__)("Clear", "elementor"))),
|
|
3523
3516
|
sx: { maxWidth: 300 }
|
|
3524
3517
|
},
|
|
3525
|
-
/* @__PURE__ */
|
|
3526
|
-
/* @__PURE__ */
|
|
3518
|
+
/* @__PURE__ */ React31.createElement(import_ui31.AlertTitle, null, (0, import_i18n22.__)("This variable is missing", "elementor")),
|
|
3519
|
+
/* @__PURE__ */ React31.createElement(import_ui31.Typography, { variant: "body2", color: "textPrimary" }, (0, import_i18n22.__)(
|
|
3527
3520
|
"It may have been deleted. Try clearing this field and select a different value or variable.",
|
|
3528
3521
|
"elementor"
|
|
3529
3522
|
))
|
|
@@ -3533,19 +3526,19 @@ var MissingVariableAlert = ({ onClose, onClear }) => {
|
|
|
3533
3526
|
// src/components/ui/variable/missing-variable.tsx
|
|
3534
3527
|
var MissingVariable = () => {
|
|
3535
3528
|
const { setValue } = (0, import_editor_controls10.useBoundProp)();
|
|
3536
|
-
const [infotipVisible, setInfotipVisible] = (0,
|
|
3529
|
+
const [infotipVisible, setInfotipVisible] = (0, import_react25.useState)(false);
|
|
3537
3530
|
const toggleInfotip = () => setInfotipVisible((prev) => !prev);
|
|
3538
3531
|
const closeInfotip = () => setInfotipVisible(false);
|
|
3539
3532
|
const clearValue = () => setValue(null);
|
|
3540
|
-
return /* @__PURE__ */
|
|
3541
|
-
|
|
3533
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, infotipVisible && /* @__PURE__ */ React32.createElement(import_ui32.Backdrop, { open: true, onClick: closeInfotip, invisible: true }), /* @__PURE__ */ React32.createElement(
|
|
3534
|
+
import_ui32.Infotip,
|
|
3542
3535
|
{
|
|
3543
3536
|
color: "warning",
|
|
3544
3537
|
placement: "right-start",
|
|
3545
3538
|
open: infotipVisible,
|
|
3546
3539
|
disableHoverListener: true,
|
|
3547
3540
|
onClose: closeInfotip,
|
|
3548
|
-
content: /* @__PURE__ */
|
|
3541
|
+
content: /* @__PURE__ */ React32.createElement(MissingVariableAlert, { onClose: closeInfotip, onClear: clearValue }),
|
|
3549
3542
|
slotProps: {
|
|
3550
3543
|
popper: {
|
|
3551
3544
|
modifiers: [
|
|
@@ -3557,7 +3550,7 @@ var MissingVariable = () => {
|
|
|
3557
3550
|
}
|
|
3558
3551
|
}
|
|
3559
3552
|
},
|
|
3560
|
-
/* @__PURE__ */
|
|
3553
|
+
/* @__PURE__ */ React32.createElement(WarningVariableTag, { label: (0, import_i18n23.__)("Missing variable", "elementor"), onClick: toggleInfotip })
|
|
3561
3554
|
));
|
|
3562
3555
|
};
|
|
3563
3556
|
|
|
@@ -3567,37 +3560,37 @@ var VariableControl = () => {
|
|
|
3567
3560
|
const boundPropValue = boundProp.value ?? boundProp.placeholder;
|
|
3568
3561
|
const assignedVariable = useVariable(boundPropValue?.value);
|
|
3569
3562
|
if (!assignedVariable) {
|
|
3570
|
-
return /* @__PURE__ */
|
|
3563
|
+
return /* @__PURE__ */ React33.createElement(MissingVariable, null);
|
|
3571
3564
|
}
|
|
3572
3565
|
const { $$type: propTypeKey } = boundPropValue;
|
|
3573
3566
|
if (assignedVariable?.deleted) {
|
|
3574
|
-
return /* @__PURE__ */
|
|
3567
|
+
return /* @__PURE__ */ React33.createElement(DeletedVariable, { variable: assignedVariable, propTypeKey });
|
|
3575
3568
|
}
|
|
3576
3569
|
const { isCompatible } = getVariableType(assignedVariable.type);
|
|
3577
3570
|
if (isCompatible && !isCompatible(boundProp?.propType, assignedVariable)) {
|
|
3578
|
-
return /* @__PURE__ */
|
|
3571
|
+
return /* @__PURE__ */ React33.createElement(MismatchVariable, { variable: assignedVariable });
|
|
3579
3572
|
}
|
|
3580
|
-
return /* @__PURE__ */
|
|
3573
|
+
return /* @__PURE__ */ React33.createElement(AssignedVariable, { variable: assignedVariable, propTypeKey });
|
|
3581
3574
|
};
|
|
3582
3575
|
|
|
3583
3576
|
// src/hooks/use-prop-variable-action.tsx
|
|
3584
|
-
var
|
|
3577
|
+
var React34 = __toESM(require("react"));
|
|
3585
3578
|
var import_editor_controls12 = require("@elementor/editor-controls");
|
|
3586
|
-
var
|
|
3587
|
-
var
|
|
3579
|
+
var import_icons14 = require("@elementor/icons");
|
|
3580
|
+
var import_i18n24 = require("@wordpress/i18n");
|
|
3588
3581
|
var usePropVariableAction = () => {
|
|
3589
3582
|
const { propType, path } = (0, import_editor_controls12.useBoundProp)();
|
|
3590
3583
|
const variable = resolveVariableFromPropType(propType);
|
|
3591
3584
|
return {
|
|
3592
3585
|
visible: Boolean(variable),
|
|
3593
|
-
icon:
|
|
3594
|
-
title: (0,
|
|
3586
|
+
icon: import_icons14.ColorFilterIcon,
|
|
3587
|
+
title: (0, import_i18n24.__)("Variables", "elementor"),
|
|
3595
3588
|
content: ({ close: closePopover }) => {
|
|
3596
3589
|
if (!variable) {
|
|
3597
3590
|
return null;
|
|
3598
3591
|
}
|
|
3599
3592
|
trackOpenVariablePopover(path, variable.variableType);
|
|
3600
|
-
return /* @__PURE__ */
|
|
3593
|
+
return /* @__PURE__ */ React34.createElement(VariableSelectionPopover, { closePopover, propTypeKey: variable.propTypeUtil.key });
|
|
3601
3594
|
}
|
|
3602
3595
|
};
|
|
3603
3596
|
};
|
|
@@ -3744,21 +3737,21 @@ function initMcp() {
|
|
|
3744
3737
|
}
|
|
3745
3738
|
|
|
3746
3739
|
// src/register-variable-types.tsx
|
|
3747
|
-
var
|
|
3740
|
+
var React37 = __toESM(require("react"));
|
|
3748
3741
|
var import_editor_props5 = require("@elementor/editor-props");
|
|
3749
3742
|
var import_editor_ui13 = require("@elementor/editor-ui");
|
|
3750
3743
|
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
3751
|
-
var
|
|
3752
|
-
var
|
|
3744
|
+
var import_icons16 = require("@elementor/icons");
|
|
3745
|
+
var import_i18n26 = require("@wordpress/i18n");
|
|
3753
3746
|
|
|
3754
3747
|
// src/components/fields/color-field.tsx
|
|
3755
|
-
var
|
|
3756
|
-
var
|
|
3757
|
-
var
|
|
3748
|
+
var React35 = __toESM(require("react"));
|
|
3749
|
+
var import_react26 = require("react");
|
|
3750
|
+
var import_ui33 = require("@elementor/ui");
|
|
3758
3751
|
var ColorField = ({ value, onChange, onValidationChange }) => {
|
|
3759
|
-
const [color, setColor] = (0,
|
|
3760
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
3761
|
-
const defaultRef = (0,
|
|
3752
|
+
const [color, setColor] = (0, import_react26.useState)(value);
|
|
3753
|
+
const [errorMessage, setErrorMessage] = (0, import_react26.useState)("");
|
|
3754
|
+
const defaultRef = (0, import_react26.useRef)(null);
|
|
3762
3755
|
const anchorRef = usePopoverContentRef() ?? defaultRef.current;
|
|
3763
3756
|
const handleChange = (newValue) => {
|
|
3764
3757
|
setColor(newValue);
|
|
@@ -3767,8 +3760,8 @@ var ColorField = ({ value, onChange, onValidationChange }) => {
|
|
|
3767
3760
|
onValidationChange?.(errorMsg);
|
|
3768
3761
|
onChange(errorMsg ? "" : newValue);
|
|
3769
3762
|
};
|
|
3770
|
-
return /* @__PURE__ */
|
|
3771
|
-
|
|
3763
|
+
return /* @__PURE__ */ React35.createElement(
|
|
3764
|
+
import_ui33.UnstableColorField,
|
|
3772
3765
|
{
|
|
3773
3766
|
id: "color-variable-field",
|
|
3774
3767
|
size: "tiny",
|
|
@@ -3796,21 +3789,21 @@ var ColorField = ({ value, onChange, onValidationChange }) => {
|
|
|
3796
3789
|
};
|
|
3797
3790
|
|
|
3798
3791
|
// src/components/fields/font-field.tsx
|
|
3799
|
-
var
|
|
3800
|
-
var
|
|
3792
|
+
var React36 = __toESM(require("react"));
|
|
3793
|
+
var import_react27 = require("react");
|
|
3801
3794
|
var import_editor_controls13 = require("@elementor/editor-controls");
|
|
3802
3795
|
var import_editor_ui12 = require("@elementor/editor-ui");
|
|
3803
|
-
var
|
|
3804
|
-
var
|
|
3805
|
-
var
|
|
3796
|
+
var import_icons15 = require("@elementor/icons");
|
|
3797
|
+
var import_ui34 = require("@elementor/ui");
|
|
3798
|
+
var import_i18n25 = require("@wordpress/i18n");
|
|
3806
3799
|
var FontField = ({ value, onChange, onValidationChange }) => {
|
|
3807
|
-
const [fontFamily, setFontFamily] = (0,
|
|
3808
|
-
const defaultRef = (0,
|
|
3800
|
+
const [fontFamily, setFontFamily] = (0, import_react27.useState)(value);
|
|
3801
|
+
const defaultRef = (0, import_react27.useRef)(null);
|
|
3809
3802
|
const anchorRef = usePopoverContentRef() ?? defaultRef.current;
|
|
3810
|
-
const fontPopoverState = (0,
|
|
3803
|
+
const fontPopoverState = (0, import_ui34.usePopupState)({ variant: "popover" });
|
|
3811
3804
|
const fontFamilies = (0, import_editor_controls13.useFontFamilies)();
|
|
3812
3805
|
const sectionWidth = (0, import_editor_ui12.useSectionWidth)();
|
|
3813
|
-
const mapFontSubs =
|
|
3806
|
+
const mapFontSubs = React36.useMemo(() => {
|
|
3814
3807
|
return fontFamilies.map(({ label, fonts }) => ({
|
|
3815
3808
|
label,
|
|
3816
3809
|
items: fonts
|
|
@@ -3826,28 +3819,28 @@ var FontField = ({ value, onChange, onValidationChange }) => {
|
|
|
3826
3819
|
handleChange(newFontFamily);
|
|
3827
3820
|
fontPopoverState.close();
|
|
3828
3821
|
};
|
|
3829
|
-
const id2 = (0,
|
|
3830
|
-
return /* @__PURE__ */
|
|
3831
|
-
|
|
3822
|
+
const id2 = (0, import_react27.useId)();
|
|
3823
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(
|
|
3824
|
+
import_ui34.UnstableTag,
|
|
3832
3825
|
{
|
|
3833
3826
|
id: id2,
|
|
3834
3827
|
variant: "outlined",
|
|
3835
3828
|
label: fontFamily,
|
|
3836
|
-
endIcon: /* @__PURE__ */
|
|
3837
|
-
...(0,
|
|
3829
|
+
endIcon: /* @__PURE__ */ React36.createElement(import_icons15.ChevronDownIcon, { fontSize: "tiny" }),
|
|
3830
|
+
...(0, import_ui34.bindTrigger)(fontPopoverState),
|
|
3838
3831
|
fullWidth: true
|
|
3839
3832
|
}
|
|
3840
|
-
), /* @__PURE__ */
|
|
3841
|
-
|
|
3833
|
+
), /* @__PURE__ */ React36.createElement(
|
|
3834
|
+
import_ui34.Popover,
|
|
3842
3835
|
{
|
|
3843
3836
|
disablePortal: true,
|
|
3844
3837
|
disableScrollLock: true,
|
|
3845
3838
|
anchorEl: anchorRef,
|
|
3846
3839
|
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
3847
3840
|
transformOrigin: { vertical: "top", horizontal: -28 },
|
|
3848
|
-
...(0,
|
|
3841
|
+
...(0, import_ui34.bindPopover)(fontPopoverState)
|
|
3849
3842
|
},
|
|
3850
|
-
/* @__PURE__ */
|
|
3843
|
+
/* @__PURE__ */ React36.createElement(
|
|
3851
3844
|
import_editor_controls13.ItemSelector,
|
|
3852
3845
|
{
|
|
3853
3846
|
id: "font-family-variables-selector",
|
|
@@ -3856,10 +3849,10 @@ var FontField = ({ value, onChange, onValidationChange }) => {
|
|
|
3856
3849
|
onItemChange: handleFontFamilyChange,
|
|
3857
3850
|
onClose: fontPopoverState.close,
|
|
3858
3851
|
sectionWidth,
|
|
3859
|
-
title: (0,
|
|
3852
|
+
title: (0, import_i18n25.__)("Font family", "elementor"),
|
|
3860
3853
|
itemStyle: (item) => ({ fontFamily: item.value }),
|
|
3861
3854
|
onDebounce: import_editor_controls13.enqueueFont,
|
|
3862
|
-
icon:
|
|
3855
|
+
icon: import_icons15.TextIcon
|
|
3863
3856
|
}
|
|
3864
3857
|
)
|
|
3865
3858
|
));
|
|
@@ -3881,11 +3874,11 @@ function registerVariableTypes() {
|
|
|
3881
3874
|
registerVariableType({
|
|
3882
3875
|
key: colorVariablePropTypeUtil.key,
|
|
3883
3876
|
valueField: ColorField,
|
|
3884
|
-
icon:
|
|
3877
|
+
icon: import_icons16.BrushIcon,
|
|
3885
3878
|
propTypeUtil: colorVariablePropTypeUtil,
|
|
3886
3879
|
fallbackPropTypeUtil: import_editor_props5.colorPropTypeUtil,
|
|
3887
3880
|
variableType: "color",
|
|
3888
|
-
startIcon: ({ value }) => /* @__PURE__ */
|
|
3881
|
+
startIcon: ({ value }) => /* @__PURE__ */ React37.createElement(ColorIndicator, { size: "inherit", component: "span", value }),
|
|
3889
3882
|
defaultValue: "#ffffff",
|
|
3890
3883
|
menuActionsFactory: ({ variable, variableId, handlers }) => {
|
|
3891
3884
|
const actions = [];
|
|
@@ -3894,15 +3887,15 @@ function registerVariableTypes() {
|
|
|
3894
3887
|
}
|
|
3895
3888
|
if (variable.sync_to_v3) {
|
|
3896
3889
|
actions.push({
|
|
3897
|
-
name: (0,
|
|
3898
|
-
icon:
|
|
3890
|
+
name: (0, import_i18n26.__)("Stop syncing to Version 3", "elementor"),
|
|
3891
|
+
icon: import_icons16.ResetIcon,
|
|
3899
3892
|
color: "text.primary",
|
|
3900
3893
|
onClick: () => handlers.onStopSync(variableId)
|
|
3901
3894
|
});
|
|
3902
3895
|
} else {
|
|
3903
3896
|
actions.push({
|
|
3904
|
-
name: (0,
|
|
3905
|
-
icon:
|
|
3897
|
+
name: (0, import_i18n26.__)("Sync to Version 3", "elementor"),
|
|
3898
|
+
icon: import_icons16.ResetIcon,
|
|
3906
3899
|
color: "text.primary",
|
|
3907
3900
|
onClick: () => handlers.onStartSync(variableId)
|
|
3908
3901
|
});
|
|
@@ -3913,7 +3906,7 @@ function registerVariableTypes() {
|
|
|
3913
3906
|
registerVariableType({
|
|
3914
3907
|
key: fontVariablePropTypeUtil.key,
|
|
3915
3908
|
valueField: FontField,
|
|
3916
|
-
icon:
|
|
3909
|
+
icon: import_icons16.TextIcon,
|
|
3917
3910
|
propTypeUtil: fontVariablePropTypeUtil,
|
|
3918
3911
|
fallbackPropTypeUtil: import_editor_props5.stringPropTypeUtil,
|
|
3919
3912
|
variableType: "font",
|
|
@@ -3921,13 +3914,13 @@ function registerVariableTypes() {
|
|
|
3921
3914
|
});
|
|
3922
3915
|
const sizePromotions = {
|
|
3923
3916
|
isActive: false,
|
|
3924
|
-
icon:
|
|
3917
|
+
icon: import_icons16.ExpandDiagonalIcon,
|
|
3925
3918
|
propTypeUtil: sizeVariablePropTypeUtil,
|
|
3926
3919
|
fallbackPropTypeUtil: import_editor_props5.sizePropTypeUtil,
|
|
3927
3920
|
styleTransformer: EmptyTransformer,
|
|
3928
3921
|
variableType: "size",
|
|
3929
3922
|
selectionFilter: () => [],
|
|
3930
|
-
emptyState: /* @__PURE__ */
|
|
3923
|
+
emptyState: /* @__PURE__ */ React37.createElement(import_editor_ui13.CtaButton, { size: "small", href: "https://go.elementor.com/go-pro-panel-size-variable/" })
|
|
3931
3924
|
};
|
|
3932
3925
|
registerVariableType({
|
|
3933
3926
|
...sizePromotions,
|
|
@@ -3941,10 +3934,10 @@ function registerVariableTypes() {
|
|
|
3941
3934
|
}
|
|
3942
3935
|
|
|
3943
3936
|
// src/renderers/style-variables-renderer.tsx
|
|
3944
|
-
var
|
|
3945
|
-
var
|
|
3937
|
+
var React38 = __toESM(require("react"));
|
|
3938
|
+
var import_react28 = require("react");
|
|
3946
3939
|
var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
3947
|
-
var
|
|
3940
|
+
var import_ui35 = require("@elementor/ui");
|
|
3948
3941
|
var VARIABLES_WRAPPER = "body";
|
|
3949
3942
|
function StyleVariablesRenderer() {
|
|
3950
3943
|
const container = usePortalContainer();
|
|
@@ -3955,14 +3948,14 @@ function StyleVariablesRenderer() {
|
|
|
3955
3948
|
}
|
|
3956
3949
|
const cssVariables = convertToCssVariables(styleVariables);
|
|
3957
3950
|
const wrappedCss = `${VARIABLES_WRAPPER}{${cssVariables}}`;
|
|
3958
|
-
return /* @__PURE__ */
|
|
3951
|
+
return /* @__PURE__ */ React38.createElement(import_ui35.Portal, { container }, /* @__PURE__ */ React38.createElement("style", { "data-e-style-id": "e-variables", key: wrappedCss }, wrappedCss));
|
|
3959
3952
|
}
|
|
3960
3953
|
function usePortalContainer() {
|
|
3961
3954
|
return (0, import_editor_v1_adapters6.__privateUseListenTo)((0, import_editor_v1_adapters6.commandEndEvent)("editor/documents/attach-preview"), () => (0, import_editor_v1_adapters6.getCanvasIframeDocument)()?.head);
|
|
3962
3955
|
}
|
|
3963
3956
|
function useStyleVariables() {
|
|
3964
|
-
const [variables, setVariables] = (0,
|
|
3965
|
-
(0,
|
|
3957
|
+
const [variables, setVariables] = (0, import_react28.useState)({});
|
|
3958
|
+
(0, import_react28.useEffect)(() => {
|
|
3966
3959
|
const unsubscribe = styleVariablesRepository.subscribe(setVariables);
|
|
3967
3960
|
return () => {
|
|
3968
3961
|
unsubscribe();
|
|
@@ -3985,22 +3978,22 @@ var import_editor_controls14 = require("@elementor/editor-controls");
|
|
|
3985
3978
|
var import_editor_props6 = require("@elementor/editor-props");
|
|
3986
3979
|
|
|
3987
3980
|
// src/components/variables-repeater-item-slot.tsx
|
|
3988
|
-
var
|
|
3981
|
+
var React39 = __toESM(require("react"));
|
|
3989
3982
|
var useColorVariable = (value) => {
|
|
3990
3983
|
const variableId = value?.value?.color?.value;
|
|
3991
3984
|
return useVariable(variableId || "");
|
|
3992
3985
|
};
|
|
3993
3986
|
var BackgroundRepeaterColorIndicator = ({ value }) => {
|
|
3994
3987
|
const colorVariable = useColorVariable(value);
|
|
3995
|
-
return /* @__PURE__ */
|
|
3988
|
+
return /* @__PURE__ */ React39.createElement(ColorIndicator, { component: "span", size: "inherit", value: colorVariable?.value });
|
|
3996
3989
|
};
|
|
3997
3990
|
var BackgroundRepeaterLabel = ({ value }) => {
|
|
3998
3991
|
const colorVariable = useColorVariable(value);
|
|
3999
|
-
return /* @__PURE__ */
|
|
3992
|
+
return /* @__PURE__ */ React39.createElement("span", null, colorVariable?.label);
|
|
4000
3993
|
};
|
|
4001
3994
|
var BoxShadowRepeaterColorIndicator = ({ value }) => {
|
|
4002
3995
|
const colorVariable = useColorVariable(value);
|
|
4003
|
-
return /* @__PURE__ */
|
|
3996
|
+
return /* @__PURE__ */ React39.createElement(ColorIndicator, { component: "span", size: "inherit", value: colorVariable?.value });
|
|
4004
3997
|
};
|
|
4005
3998
|
|
|
4006
3999
|
// src/repeater-injections.ts
|