@elementor/editor-variables 3.33.0-101 → 3.33.0-102
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 +16 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
- package/src/components/ui/deleted-variable-alert.tsx +14 -10
- package/src/components/ui/mismatch-variable-alert.tsx +5 -9
- package/src/components/ui/missing-variable-alert.tsx +8 -9
package/dist/index.js
CHANGED
|
@@ -37,7 +37,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
37
37
|
|
|
38
38
|
// src/init.ts
|
|
39
39
|
var import_editor = require("@elementor/editor");
|
|
40
|
-
var
|
|
40
|
+
var import_editor_editing_panel8 = require("@elementor/editor-editing-panel");
|
|
41
41
|
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
42
42
|
|
|
43
43
|
// src/components/variables-manager/variables-manager-panel.tsx
|
|
@@ -2042,11 +2042,9 @@ var VariableRestore = ({ variableId, onClose, onSubmit }) => {
|
|
|
2042
2042
|
|
|
2043
2043
|
// src/components/ui/deleted-variable-alert.tsx
|
|
2044
2044
|
var React23 = __toESM(require("react"));
|
|
2045
|
-
var import_editor_editing_panel6 = require("@elementor/editor-editing-panel");
|
|
2046
2045
|
var import_ui23 = require("@elementor/ui");
|
|
2047
2046
|
var import_i18n16 = require("@wordpress/i18n");
|
|
2048
2047
|
var DeletedVariableAlert = ({ onClose, onUnlink, onRestore, label }) => {
|
|
2049
|
-
const sectionWidth = (0, import_editor_editing_panel6.useSectionWidth)();
|
|
2050
2048
|
return /* @__PURE__ */ React23.createElement(import_ui23.ClickAwayListener, { onClickAway: onClose }, /* @__PURE__ */ React23.createElement(
|
|
2051
2049
|
import_ui23.Alert,
|
|
2052
2050
|
{
|
|
@@ -2054,18 +2052,13 @@ var DeletedVariableAlert = ({ onClose, onUnlink, onRestore, label }) => {
|
|
|
2054
2052
|
severity: "warning",
|
|
2055
2053
|
onClose,
|
|
2056
2054
|
action: /* @__PURE__ */ React23.createElement(React23.Fragment, null, onUnlink && /* @__PURE__ */ React23.createElement(import_ui23.AlertAction, { variant: "contained", onClick: onUnlink }, (0, import_i18n16.__)("Unlink", "elementor")), onRestore && /* @__PURE__ */ React23.createElement(import_ui23.AlertAction, { variant: "outlined", onClick: onRestore }, (0, import_i18n16.__)("Restore", "elementor"))),
|
|
2057
|
-
sx: {
|
|
2055
|
+
sx: { maxWidth: 300 }
|
|
2058
2056
|
},
|
|
2059
2057
|
/* @__PURE__ */ React23.createElement(import_ui23.AlertTitle, null, (0, import_i18n16.__)("Deleted variable", "elementor")),
|
|
2060
|
-
(0, import_i18n16.__)("The variable", "elementor"),
|
|
2061
|
-
" '",
|
|
2062
|
-
label,
|
|
2063
|
-
"'",
|
|
2064
|
-
" ",
|
|
2065
|
-
(0, import_i18n16.__)(
|
|
2058
|
+
/* @__PURE__ */ React23.createElement(import_ui23.Typography, { variant: "body2", color: "textPrimary" }, (0, import_i18n16.__)("The variable", "elementor"), "\xA0'", /* @__PURE__ */ React23.createElement(import_ui23.Typography, { variant: "body2", component: "span", sx: { lineBreak: "anywhere" } }, label), "'\xA0", (0, import_i18n16.__)(
|
|
2066
2059
|
"has been deleted, but it is still referenced in this location. You may restore the variable or unlink it to assign a different value.",
|
|
2067
2060
|
"elementor"
|
|
2068
|
-
)
|
|
2061
|
+
))
|
|
2069
2062
|
));
|
|
2070
2063
|
};
|
|
2071
2064
|
|
|
@@ -2192,7 +2185,6 @@ var import_ui28 = require("@elementor/ui");
|
|
|
2192
2185
|
|
|
2193
2186
|
// src/components/ui/mismatch-variable-alert.tsx
|
|
2194
2187
|
var React26 = __toESM(require("react"));
|
|
2195
|
-
var import_editor_editing_panel7 = require("@elementor/editor-editing-panel");
|
|
2196
2188
|
var import_ui26 = require("@elementor/ui");
|
|
2197
2189
|
var import_i18n18 = require("@wordpress/i18n");
|
|
2198
2190
|
var i18n = {
|
|
@@ -2207,7 +2199,6 @@ var i18n = {
|
|
|
2207
2199
|
}
|
|
2208
2200
|
};
|
|
2209
2201
|
var MismatchVariableAlert = ({ onClose, onClear, triggerSelect }) => {
|
|
2210
|
-
const sectionWidth = (0, import_editor_editing_panel7.useSectionWidth)();
|
|
2211
2202
|
return /* @__PURE__ */ React26.createElement(import_ui26.ClickAwayListener, { onClickAway: onClose }, /* @__PURE__ */ React26.createElement(
|
|
2212
2203
|
import_ui26.Alert,
|
|
2213
2204
|
{
|
|
@@ -2215,13 +2206,10 @@ var MismatchVariableAlert = ({ onClose, onClear, triggerSelect }) => {
|
|
|
2215
2206
|
severity: "warning",
|
|
2216
2207
|
onClose,
|
|
2217
2208
|
action: /* @__PURE__ */ React26.createElement(React26.Fragment, null, onClear && /* @__PURE__ */ React26.createElement(import_ui26.AlertAction, { variant: "contained", onClick: onClear }, i18n.buttons.clear), triggerSelect && /* @__PURE__ */ React26.createElement(import_ui26.AlertAction, { variant: "outlined", onClick: triggerSelect }, i18n.buttons.select)),
|
|
2218
|
-
sx: {
|
|
2219
|
-
width: sectionWidth,
|
|
2220
|
-
minWidth: 300
|
|
2221
|
-
}
|
|
2209
|
+
sx: { maxWidth: 300 }
|
|
2222
2210
|
},
|
|
2223
2211
|
/* @__PURE__ */ React26.createElement(import_ui26.AlertTitle, null, i18n.title),
|
|
2224
|
-
i18n.message
|
|
2212
|
+
/* @__PURE__ */ React26.createElement(import_ui26.Typography, { variant: "body2", color: "textPrimary" }, i18n.message)
|
|
2225
2213
|
));
|
|
2226
2214
|
};
|
|
2227
2215
|
|
|
@@ -2334,11 +2322,9 @@ var import_i18n21 = require("@wordpress/i18n");
|
|
|
2334
2322
|
|
|
2335
2323
|
// src/components/ui/missing-variable-alert.tsx
|
|
2336
2324
|
var React29 = __toESM(require("react"));
|
|
2337
|
-
var import_editor_editing_panel8 = require("@elementor/editor-editing-panel");
|
|
2338
2325
|
var import_ui29 = require("@elementor/ui");
|
|
2339
2326
|
var import_i18n20 = require("@wordpress/i18n");
|
|
2340
2327
|
var MissingVariableAlert = ({ onClose, onClear }) => {
|
|
2341
|
-
const sectionWidth = (0, import_editor_editing_panel8.useSectionWidth)();
|
|
2342
2328
|
return /* @__PURE__ */ React29.createElement(import_ui29.ClickAwayListener, { onClickAway: onClose }, /* @__PURE__ */ React29.createElement(
|
|
2343
2329
|
import_ui29.Alert,
|
|
2344
2330
|
{
|
|
@@ -2346,13 +2332,13 @@ var MissingVariableAlert = ({ onClose, onClear }) => {
|
|
|
2346
2332
|
severity: "warning",
|
|
2347
2333
|
onClose,
|
|
2348
2334
|
action: /* @__PURE__ */ React29.createElement(React29.Fragment, null, onClear && /* @__PURE__ */ React29.createElement(import_ui29.AlertAction, { variant: "contained", onClick: onClear }, (0, import_i18n20.__)("Clear", "elementor"))),
|
|
2349
|
-
sx: {
|
|
2335
|
+
sx: { maxWidth: 300 }
|
|
2350
2336
|
},
|
|
2351
2337
|
/* @__PURE__ */ React29.createElement(import_ui29.AlertTitle, null, (0, import_i18n20.__)("This variable is missing", "elementor")),
|
|
2352
|
-
(0, import_i18n20.__)(
|
|
2338
|
+
/* @__PURE__ */ React29.createElement(import_ui29.Typography, { variant: "body2", color: "textPrimary" }, (0, import_i18n20.__)(
|
|
2353
2339
|
"It may have been deleted. Try clearing this field and select a different value or variable.",
|
|
2354
2340
|
"elementor"
|
|
2355
|
-
)
|
|
2341
|
+
))
|
|
2356
2342
|
));
|
|
2357
2343
|
};
|
|
2358
2344
|
|
|
@@ -2435,11 +2421,11 @@ var VariableControl = () => {
|
|
|
2435
2421
|
|
|
2436
2422
|
// src/hooks/use-prop-variable-action.tsx
|
|
2437
2423
|
var React33 = __toESM(require("react"));
|
|
2438
|
-
var
|
|
2424
|
+
var import_editor_editing_panel6 = require("@elementor/editor-editing-panel");
|
|
2439
2425
|
var import_icons15 = require("@elementor/icons");
|
|
2440
2426
|
var import_i18n22 = require("@wordpress/i18n");
|
|
2441
2427
|
var usePropVariableAction = () => {
|
|
2442
|
-
const { propType, path } = (0,
|
|
2428
|
+
const { propType, path } = (0, import_editor_editing_panel6.useBoundProp)();
|
|
2443
2429
|
const variable = resolveVariableFromPropType(propType);
|
|
2444
2430
|
return {
|
|
2445
2431
|
visible: Boolean(variable),
|
|
@@ -2526,7 +2512,7 @@ var ColorField = ({ value, onChange, onValidationChange }) => {
|
|
|
2526
2512
|
var React35 = __toESM(require("react"));
|
|
2527
2513
|
var import_react20 = require("react");
|
|
2528
2514
|
var import_editor_controls12 = require("@elementor/editor-controls");
|
|
2529
|
-
var
|
|
2515
|
+
var import_editor_editing_panel7 = require("@elementor/editor-editing-panel");
|
|
2530
2516
|
var import_icons16 = require("@elementor/icons");
|
|
2531
2517
|
var import_ui33 = require("@elementor/ui");
|
|
2532
2518
|
var import_i18n23 = require("@wordpress/i18n");
|
|
@@ -2535,8 +2521,8 @@ var FontField = ({ value, onChange, onValidationChange }) => {
|
|
|
2535
2521
|
const defaultRef = (0, import_react20.useRef)(null);
|
|
2536
2522
|
const anchorRef = usePopoverContentRef() ?? defaultRef.current;
|
|
2537
2523
|
const fontPopoverState = (0, import_ui33.usePopupState)({ variant: "popover" });
|
|
2538
|
-
const fontFamilies = (0,
|
|
2539
|
-
const sectionWidth = (0,
|
|
2524
|
+
const fontFamilies = (0, import_editor_editing_panel7.useFontFamilies)();
|
|
2525
|
+
const sectionWidth = (0, import_editor_editing_panel7.useSectionWidth)();
|
|
2540
2526
|
const mapFontSubs = React35.useMemo(() => {
|
|
2541
2527
|
return fontFamilies.map(({ label, fonts }) => ({
|
|
2542
2528
|
label,
|
|
@@ -2710,11 +2696,11 @@ var hasAssignedColorVariable = (propValue) => {
|
|
|
2710
2696
|
};
|
|
2711
2697
|
|
|
2712
2698
|
// src/init.ts
|
|
2713
|
-
var { registerPopoverAction } =
|
|
2699
|
+
var { registerPopoverAction } = import_editor_editing_panel8.controlActionsMenu;
|
|
2714
2700
|
function init() {
|
|
2715
2701
|
registerVariableTypes();
|
|
2716
2702
|
registerRepeaterInjections();
|
|
2717
|
-
(0,
|
|
2703
|
+
(0, import_editor_editing_panel8.registerControlReplacement)({
|
|
2718
2704
|
component: VariableControl,
|
|
2719
2705
|
condition: ({ value }) => hasAssignedVariable(value)
|
|
2720
2706
|
});
|