@elementor/editor-variables 3.33.0-106 → 3.33.0-108
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 +107 -143
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +84 -120
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
- package/src/components/ui/tags/warning-variable-tag.tsx +44 -0
- package/src/components/ui/variable/deleted-variable.tsx +7 -2
- package/src/components/ui/variable/mismatch-variable.tsx +7 -2
- package/src/components/ui/variable/missing-variable.tsx +2 -2
- package/src/components/ui/tags/deleted-tag.tsx +0 -37
- package/src/components/ui/tags/mismatch-tag.tsx +0 -37
- package/src/components/ui/tags/missing-tag.tsx +0 -25
package/dist/index.js
CHANGED
|
@@ -1179,7 +1179,7 @@ var usePreventUnload = (isDirty) => {
|
|
|
1179
1179
|
};
|
|
1180
1180
|
|
|
1181
1181
|
// src/controls/variable-control.tsx
|
|
1182
|
-
var
|
|
1182
|
+
var React30 = __toESM(require("react"));
|
|
1183
1183
|
var import_editor_controls11 = require("@elementor/editor-controls");
|
|
1184
1184
|
|
|
1185
1185
|
// src/components/ui/variable/assigned-variable.tsx
|
|
@@ -2067,6 +2067,7 @@ var React25 = __toESM(require("react"));
|
|
|
2067
2067
|
var import_react16 = require("react");
|
|
2068
2068
|
var import_editor_controls8 = require("@elementor/editor-controls");
|
|
2069
2069
|
var import_ui25 = require("@elementor/ui");
|
|
2070
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
2070
2071
|
|
|
2071
2072
|
// src/components/variable-restore.tsx
|
|
2072
2073
|
var React22 = __toESM(require("react"));
|
|
@@ -2196,33 +2197,36 @@ var DeletedVariableAlert = ({ onClose, onUnlink, onRestore, label }) => {
|
|
|
2196
2197
|
));
|
|
2197
2198
|
};
|
|
2198
2199
|
|
|
2199
|
-
// src/components/ui/tags/
|
|
2200
|
+
// src/components/ui/tags/warning-variable-tag.tsx
|
|
2200
2201
|
var React24 = __toESM(require("react"));
|
|
2201
2202
|
var import_icons12 = require("@elementor/icons");
|
|
2202
2203
|
var import_ui24 = require("@elementor/ui");
|
|
2203
|
-
var
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2204
|
+
var WarningVariableTag = React24.forwardRef(
|
|
2205
|
+
({ label, suffix, onClick, icon, ...props }, ref) => {
|
|
2206
|
+
const displayText = suffix ? `${label} (${suffix})` : label;
|
|
2207
|
+
return /* @__PURE__ */ React24.createElement(
|
|
2208
|
+
import_ui24.Chip,
|
|
2209
|
+
{
|
|
2210
|
+
ref,
|
|
2211
|
+
size: "tiny",
|
|
2212
|
+
color: "warning",
|
|
2213
|
+
shape: "rounded",
|
|
2214
|
+
variant: "standard",
|
|
2215
|
+
onClick,
|
|
2216
|
+
icon: /* @__PURE__ */ React24.createElement(import_icons12.AlertTriangleFilledIcon, null),
|
|
2217
|
+
label: /* @__PURE__ */ React24.createElement(import_ui24.Tooltip, { title: displayText, placement: "top" }, /* @__PURE__ */ React24.createElement(import_ui24.Box, { sx: { display: "inline-grid", minWidth: 0 } }, /* @__PURE__ */ React24.createElement(import_ui24.Typography, { variant: "caption", noWrap: true, sx: { lineHeight: 1.34 } }, displayText))),
|
|
2218
|
+
sx: {
|
|
2219
|
+
height: (theme) => theme.spacing(3.5),
|
|
2220
|
+
borderRadius: (theme) => theme.spacing(1),
|
|
2221
|
+
justifyContent: "flex-start",
|
|
2222
|
+
width: "100%"
|
|
2223
|
+
},
|
|
2224
|
+
...props
|
|
2225
|
+
}
|
|
2226
|
+
);
|
|
2227
|
+
}
|
|
2228
|
+
);
|
|
2229
|
+
WarningVariableTag.displayName = "WarningVariableTag";
|
|
2226
2230
|
|
|
2227
2231
|
// src/components/ui/variable/deleted-variable.tsx
|
|
2228
2232
|
var DeletedVariable = ({ variable, propTypeKey }) => {
|
|
@@ -2288,7 +2292,14 @@ var DeletedVariable = ({ variable, propTypeKey }) => {
|
|
|
2288
2292
|
}
|
|
2289
2293
|
}
|
|
2290
2294
|
},
|
|
2291
|
-
/* @__PURE__ */ React25.createElement(
|
|
2295
|
+
/* @__PURE__ */ React25.createElement(
|
|
2296
|
+
WarningVariableTag,
|
|
2297
|
+
{
|
|
2298
|
+
label: variable.label,
|
|
2299
|
+
onClick: toggleInfotip,
|
|
2300
|
+
suffix: (0, import_i18n17.__)("deleted", "elementor")
|
|
2301
|
+
}
|
|
2302
|
+
)
|
|
2292
2303
|
), /* @__PURE__ */ React25.createElement(
|
|
2293
2304
|
import_ui25.Popover,
|
|
2294
2305
|
{
|
|
@@ -2312,10 +2323,11 @@ var DeletedVariable = ({ variable, propTypeKey }) => {
|
|
|
2312
2323
|
};
|
|
2313
2324
|
|
|
2314
2325
|
// src/components/ui/variable/mismatch-variable.tsx
|
|
2315
|
-
var
|
|
2326
|
+
var React27 = __toESM(require("react"));
|
|
2316
2327
|
var import_react17 = require("react");
|
|
2317
2328
|
var import_editor_controls9 = require("@elementor/editor-controls");
|
|
2318
|
-
var
|
|
2329
|
+
var import_ui27 = require("@elementor/ui");
|
|
2330
|
+
var import_i18n19 = require("@wordpress/i18n");
|
|
2319
2331
|
|
|
2320
2332
|
// src/components/ui/mismatch-variable-alert.tsx
|
|
2321
2333
|
var React26 = __toESM(require("react"));
|
|
@@ -2347,40 +2359,12 @@ var MismatchVariableAlert = ({ onClose, onClear, triggerSelect }) => {
|
|
|
2347
2359
|
));
|
|
2348
2360
|
};
|
|
2349
2361
|
|
|
2350
|
-
// src/components/ui/tags/mismatch-tag.tsx
|
|
2351
|
-
var React27 = __toESM(require("react"));
|
|
2352
|
-
var import_icons13 = require("@elementor/icons");
|
|
2353
|
-
var import_ui27 = require("@elementor/ui");
|
|
2354
|
-
var import_i18n19 = require("@wordpress/i18n");
|
|
2355
|
-
var MismatchTag = React27.forwardRef(({ label, onClick, ...props }, ref) => {
|
|
2356
|
-
return /* @__PURE__ */ React27.createElement(
|
|
2357
|
-
import_ui27.Chip,
|
|
2358
|
-
{
|
|
2359
|
-
ref,
|
|
2360
|
-
size: "tiny",
|
|
2361
|
-
color: "warning",
|
|
2362
|
-
shape: "rounded",
|
|
2363
|
-
variant: "standard",
|
|
2364
|
-
onClick,
|
|
2365
|
-
icon: /* @__PURE__ */ React27.createElement(import_icons13.AlertTriangleFilledIcon, null),
|
|
2366
|
-
label: /* @__PURE__ */ React27.createElement(import_ui27.Tooltip, { title: label, placement: "top" }, /* @__PURE__ */ React27.createElement(import_ui27.Box, { sx: { display: "flex", gap: 0.5, alignItems: "center" } }, /* @__PURE__ */ React27.createElement(import_ui27.Typography, { variant: "caption", noWrap: true }, label), /* @__PURE__ */ React27.createElement(import_ui27.Typography, { variant: "caption", noWrap: true, sx: { textOverflow: "initial", overflow: "visible" } }, "(", (0, import_i18n19.__)("changed", "elementor"), ")"))),
|
|
2367
|
-
sx: {
|
|
2368
|
-
height: (theme) => theme.spacing(3.5),
|
|
2369
|
-
borderRadius: (theme) => theme.spacing(1),
|
|
2370
|
-
justifyContent: "flex-start",
|
|
2371
|
-
width: "100%"
|
|
2372
|
-
},
|
|
2373
|
-
...props
|
|
2374
|
-
}
|
|
2375
|
-
);
|
|
2376
|
-
});
|
|
2377
|
-
|
|
2378
2362
|
// src/components/ui/variable/mismatch-variable.tsx
|
|
2379
2363
|
var MismatchVariable = ({ variable }) => {
|
|
2380
2364
|
const { setValue } = (0, import_editor_controls9.useBoundProp)();
|
|
2381
2365
|
const anchorRef = (0, import_react17.useRef)(null);
|
|
2382
2366
|
const popupId = (0, import_react17.useId)();
|
|
2383
|
-
const popupState = (0,
|
|
2367
|
+
const popupState = (0, import_ui27.usePopupState)({
|
|
2384
2368
|
variant: "popover",
|
|
2385
2369
|
popupId: `elementor-variables-list-${popupId}`
|
|
2386
2370
|
});
|
|
@@ -2396,15 +2380,15 @@ var MismatchVariable = ({ variable }) => {
|
|
|
2396
2380
|
closeInfotip();
|
|
2397
2381
|
setValue(null);
|
|
2398
2382
|
};
|
|
2399
|
-
return /* @__PURE__ */
|
|
2400
|
-
|
|
2383
|
+
return /* @__PURE__ */ React27.createElement(import_ui27.Box, { ref: anchorRef }, infotipVisible && /* @__PURE__ */ React27.createElement(import_ui27.Backdrop, { open: true, onClick: closeInfotip, invisible: true }), /* @__PURE__ */ React27.createElement(
|
|
2384
|
+
import_ui27.Infotip,
|
|
2401
2385
|
{
|
|
2402
2386
|
color: "warning",
|
|
2403
2387
|
placement: "right-start",
|
|
2404
2388
|
open: infotipVisible,
|
|
2405
2389
|
disableHoverListener: true,
|
|
2406
2390
|
onClose: closeInfotip,
|
|
2407
|
-
content: /* @__PURE__ */
|
|
2391
|
+
content: /* @__PURE__ */ React27.createElement(
|
|
2408
2392
|
MismatchVariableAlert,
|
|
2409
2393
|
{
|
|
2410
2394
|
onClose: closeInfotip,
|
|
@@ -2423,9 +2407,16 @@ var MismatchVariable = ({ variable }) => {
|
|
|
2423
2407
|
}
|
|
2424
2408
|
}
|
|
2425
2409
|
},
|
|
2426
|
-
/* @__PURE__ */
|
|
2427
|
-
|
|
2428
|
-
|
|
2410
|
+
/* @__PURE__ */ React27.createElement(
|
|
2411
|
+
WarningVariableTag,
|
|
2412
|
+
{
|
|
2413
|
+
label: variable.label,
|
|
2414
|
+
onClick: toggleInfotip,
|
|
2415
|
+
suffix: (0, import_i18n19.__)("changed", "elementor")
|
|
2416
|
+
}
|
|
2417
|
+
)
|
|
2418
|
+
), /* @__PURE__ */ React27.createElement(
|
|
2419
|
+
import_ui27.Popover,
|
|
2429
2420
|
{
|
|
2430
2421
|
disableScrollLock: true,
|
|
2431
2422
|
anchorEl: anchorRef.current,
|
|
@@ -2434,9 +2425,9 @@ var MismatchVariable = ({ variable }) => {
|
|
|
2434
2425
|
PaperProps: {
|
|
2435
2426
|
sx: { my: 1 }
|
|
2436
2427
|
},
|
|
2437
|
-
...(0,
|
|
2428
|
+
...(0, import_ui27.bindPopover)(popupState)
|
|
2438
2429
|
},
|
|
2439
|
-
/* @__PURE__ */
|
|
2430
|
+
/* @__PURE__ */ React27.createElement(
|
|
2440
2431
|
VariableSelectionPopover,
|
|
2441
2432
|
{
|
|
2442
2433
|
selectedVariable: variable,
|
|
@@ -2448,61 +2439,34 @@ var MismatchVariable = ({ variable }) => {
|
|
|
2448
2439
|
};
|
|
2449
2440
|
|
|
2450
2441
|
// src/components/ui/variable/missing-variable.tsx
|
|
2451
|
-
var
|
|
2442
|
+
var React29 = __toESM(require("react"));
|
|
2452
2443
|
var import_react18 = require("react");
|
|
2453
2444
|
var import_editor_controls10 = require("@elementor/editor-controls");
|
|
2454
|
-
var
|
|
2445
|
+
var import_ui29 = require("@elementor/ui");
|
|
2455
2446
|
var import_i18n21 = require("@wordpress/i18n");
|
|
2456
2447
|
|
|
2457
2448
|
// src/components/ui/missing-variable-alert.tsx
|
|
2458
|
-
var
|
|
2459
|
-
var
|
|
2449
|
+
var React28 = __toESM(require("react"));
|
|
2450
|
+
var import_ui28 = require("@elementor/ui");
|
|
2460
2451
|
var import_i18n20 = require("@wordpress/i18n");
|
|
2461
2452
|
var MissingVariableAlert = ({ onClose, onClear }) => {
|
|
2462
|
-
return /* @__PURE__ */
|
|
2463
|
-
|
|
2453
|
+
return /* @__PURE__ */ React28.createElement(import_ui28.ClickAwayListener, { onClickAway: onClose }, /* @__PURE__ */ React28.createElement(
|
|
2454
|
+
import_ui28.Alert,
|
|
2464
2455
|
{
|
|
2465
2456
|
variant: "standard",
|
|
2466
2457
|
severity: "warning",
|
|
2467
2458
|
onClose,
|
|
2468
|
-
action: /* @__PURE__ */
|
|
2459
|
+
action: /* @__PURE__ */ React28.createElement(React28.Fragment, null, onClear && /* @__PURE__ */ React28.createElement(import_ui28.AlertAction, { variant: "contained", onClick: onClear }, (0, import_i18n20.__)("Clear", "elementor"))),
|
|
2469
2460
|
sx: { maxWidth: 300 }
|
|
2470
2461
|
},
|
|
2471
|
-
/* @__PURE__ */
|
|
2472
|
-
/* @__PURE__ */
|
|
2462
|
+
/* @__PURE__ */ React28.createElement(import_ui28.AlertTitle, null, (0, import_i18n20.__)("This variable is missing", "elementor")),
|
|
2463
|
+
/* @__PURE__ */ React28.createElement(import_ui28.Typography, { variant: "body2", color: "textPrimary" }, (0, import_i18n20.__)(
|
|
2473
2464
|
"It may have been deleted. Try clearing this field and select a different value or variable.",
|
|
2474
2465
|
"elementor"
|
|
2475
2466
|
))
|
|
2476
2467
|
));
|
|
2477
2468
|
};
|
|
2478
2469
|
|
|
2479
|
-
// src/components/ui/tags/missing-tag.tsx
|
|
2480
|
-
var React30 = __toESM(require("react"));
|
|
2481
|
-
var import_icons14 = require("@elementor/icons");
|
|
2482
|
-
var import_ui30 = require("@elementor/ui");
|
|
2483
|
-
var MissingTag = React30.forwardRef(({ label, onClick, ...props }, ref) => {
|
|
2484
|
-
return /* @__PURE__ */ React30.createElement(
|
|
2485
|
-
import_ui30.Chip,
|
|
2486
|
-
{
|
|
2487
|
-
ref,
|
|
2488
|
-
size: "tiny",
|
|
2489
|
-
color: "warning",
|
|
2490
|
-
shape: "rounded",
|
|
2491
|
-
variant: "standard",
|
|
2492
|
-
onClick,
|
|
2493
|
-
icon: /* @__PURE__ */ React30.createElement(import_icons14.AlertTriangleFilledIcon, null),
|
|
2494
|
-
label,
|
|
2495
|
-
sx: {
|
|
2496
|
-
height: (theme) => theme.spacing(3.5),
|
|
2497
|
-
borderRadius: (theme) => theme.spacing(1),
|
|
2498
|
-
justifyContent: "flex-start",
|
|
2499
|
-
width: "100%"
|
|
2500
|
-
},
|
|
2501
|
-
...props
|
|
2502
|
-
}
|
|
2503
|
-
);
|
|
2504
|
-
});
|
|
2505
|
-
|
|
2506
2470
|
// src/components/ui/variable/missing-variable.tsx
|
|
2507
2471
|
var MissingVariable = () => {
|
|
2508
2472
|
const { setValue } = (0, import_editor_controls10.useBoundProp)();
|
|
@@ -2510,15 +2474,15 @@ var MissingVariable = () => {
|
|
|
2510
2474
|
const toggleInfotip = () => setInfotipVisible((prev) => !prev);
|
|
2511
2475
|
const closeInfotip = () => setInfotipVisible(false);
|
|
2512
2476
|
const clearValue = () => setValue(null);
|
|
2513
|
-
return /* @__PURE__ */
|
|
2514
|
-
|
|
2477
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, infotipVisible && /* @__PURE__ */ React29.createElement(import_ui29.Backdrop, { open: true, onClick: closeInfotip, invisible: true }), /* @__PURE__ */ React29.createElement(
|
|
2478
|
+
import_ui29.Infotip,
|
|
2515
2479
|
{
|
|
2516
2480
|
color: "warning",
|
|
2517
2481
|
placement: "right-start",
|
|
2518
2482
|
open: infotipVisible,
|
|
2519
2483
|
disableHoverListener: true,
|
|
2520
2484
|
onClose: closeInfotip,
|
|
2521
|
-
content: /* @__PURE__ */
|
|
2485
|
+
content: /* @__PURE__ */ React29.createElement(MissingVariableAlert, { onClose: closeInfotip, onClear: clearValue }),
|
|
2522
2486
|
slotProps: {
|
|
2523
2487
|
popper: {
|
|
2524
2488
|
modifiers: [
|
|
@@ -2530,7 +2494,7 @@ var MissingVariable = () => {
|
|
|
2530
2494
|
}
|
|
2531
2495
|
}
|
|
2532
2496
|
},
|
|
2533
|
-
/* @__PURE__ */
|
|
2497
|
+
/* @__PURE__ */ React29.createElement(WarningVariableTag, { label: (0, import_i18n21.__)("Missing variable", "elementor"), onClick: toggleInfotip })
|
|
2534
2498
|
));
|
|
2535
2499
|
};
|
|
2536
2500
|
|
|
@@ -2540,37 +2504,37 @@ var VariableControl = () => {
|
|
|
2540
2504
|
const boundPropValue = boundProp.value;
|
|
2541
2505
|
const assignedVariable = useVariable(boundPropValue?.value);
|
|
2542
2506
|
if (!assignedVariable) {
|
|
2543
|
-
return /* @__PURE__ */
|
|
2507
|
+
return /* @__PURE__ */ React30.createElement(MissingVariable, null);
|
|
2544
2508
|
}
|
|
2545
2509
|
const { $$type: propTypeKey } = boundPropValue;
|
|
2546
2510
|
if (assignedVariable?.deleted) {
|
|
2547
|
-
return /* @__PURE__ */
|
|
2511
|
+
return /* @__PURE__ */ React30.createElement(DeletedVariable, { variable: assignedVariable, propTypeKey });
|
|
2548
2512
|
}
|
|
2549
2513
|
const { isCompatible } = getVariableType(assignedVariable.type);
|
|
2550
2514
|
if (isCompatible && !isCompatible(boundProp?.propType, assignedVariable)) {
|
|
2551
|
-
return /* @__PURE__ */
|
|
2515
|
+
return /* @__PURE__ */ React30.createElement(MismatchVariable, { variable: assignedVariable });
|
|
2552
2516
|
}
|
|
2553
|
-
return /* @__PURE__ */
|
|
2517
|
+
return /* @__PURE__ */ React30.createElement(AssignedVariable, { variable: assignedVariable, propTypeKey });
|
|
2554
2518
|
};
|
|
2555
2519
|
|
|
2556
2520
|
// src/hooks/use-prop-variable-action.tsx
|
|
2557
|
-
var
|
|
2521
|
+
var React31 = __toESM(require("react"));
|
|
2558
2522
|
var import_editor_editing_panel6 = require("@elementor/editor-editing-panel");
|
|
2559
|
-
var
|
|
2523
|
+
var import_icons13 = require("@elementor/icons");
|
|
2560
2524
|
var import_i18n22 = require("@wordpress/i18n");
|
|
2561
2525
|
var usePropVariableAction = () => {
|
|
2562
2526
|
const { propType, path } = (0, import_editor_editing_panel6.useBoundProp)();
|
|
2563
2527
|
const variable = resolveVariableFromPropType(propType);
|
|
2564
2528
|
return {
|
|
2565
2529
|
visible: Boolean(variable),
|
|
2566
|
-
icon:
|
|
2530
|
+
icon: import_icons13.ColorFilterIcon,
|
|
2567
2531
|
title: (0, import_i18n22.__)("Variables", "elementor"),
|
|
2568
2532
|
content: ({ close: closePopover }) => {
|
|
2569
2533
|
if (!variable) {
|
|
2570
2534
|
return null;
|
|
2571
2535
|
}
|
|
2572
2536
|
trackOpenVariablePopover(path, variable.variableType);
|
|
2573
|
-
return /* @__PURE__ */
|
|
2537
|
+
return /* @__PURE__ */ React31.createElement(VariableSelectionPopover, { closePopover, propTypeKey: variable.propTypeUtil.key });
|
|
2574
2538
|
}
|
|
2575
2539
|
};
|
|
2576
2540
|
};
|
|
@@ -2595,14 +2559,14 @@ var trackOpenVariablePopover = (path, variableType) => {
|
|
|
2595
2559
|
};
|
|
2596
2560
|
|
|
2597
2561
|
// src/register-variable-types.tsx
|
|
2598
|
-
var
|
|
2562
|
+
var React34 = __toESM(require("react"));
|
|
2599
2563
|
var import_editor_props3 = require("@elementor/editor-props");
|
|
2600
|
-
var
|
|
2564
|
+
var import_icons15 = require("@elementor/icons");
|
|
2601
2565
|
|
|
2602
2566
|
// src/components/fields/color-field.tsx
|
|
2603
|
-
var
|
|
2567
|
+
var React32 = __toESM(require("react"));
|
|
2604
2568
|
var import_react19 = require("react");
|
|
2605
|
-
var
|
|
2569
|
+
var import_ui30 = require("@elementor/ui");
|
|
2606
2570
|
var ColorField = ({ value, onChange, onValidationChange }) => {
|
|
2607
2571
|
const [color, setColor] = (0, import_react19.useState)(value);
|
|
2608
2572
|
const [errorMessage, setErrorMessage] = (0, import_react19.useState)("");
|
|
@@ -2615,8 +2579,8 @@ var ColorField = ({ value, onChange, onValidationChange }) => {
|
|
|
2615
2579
|
onValidationChange?.(errorMsg);
|
|
2616
2580
|
onChange(errorMsg ? "" : newValue);
|
|
2617
2581
|
};
|
|
2618
|
-
return /* @__PURE__ */
|
|
2619
|
-
|
|
2582
|
+
return /* @__PURE__ */ React32.createElement(
|
|
2583
|
+
import_ui30.UnstableColorField,
|
|
2620
2584
|
{
|
|
2621
2585
|
size: "tiny",
|
|
2622
2586
|
fullWidth: true,
|
|
@@ -2643,21 +2607,21 @@ var ColorField = ({ value, onChange, onValidationChange }) => {
|
|
|
2643
2607
|
};
|
|
2644
2608
|
|
|
2645
2609
|
// src/components/fields/font-field.tsx
|
|
2646
|
-
var
|
|
2610
|
+
var React33 = __toESM(require("react"));
|
|
2647
2611
|
var import_react20 = require("react");
|
|
2648
2612
|
var import_editor_controls12 = require("@elementor/editor-controls");
|
|
2649
2613
|
var import_editor_editing_panel7 = require("@elementor/editor-editing-panel");
|
|
2650
|
-
var
|
|
2651
|
-
var
|
|
2614
|
+
var import_icons14 = require("@elementor/icons");
|
|
2615
|
+
var import_ui31 = require("@elementor/ui");
|
|
2652
2616
|
var import_i18n23 = require("@wordpress/i18n");
|
|
2653
2617
|
var FontField = ({ value, onChange, onValidationChange }) => {
|
|
2654
2618
|
const [fontFamily, setFontFamily] = (0, import_react20.useState)(value);
|
|
2655
2619
|
const defaultRef = (0, import_react20.useRef)(null);
|
|
2656
2620
|
const anchorRef = usePopoverContentRef() ?? defaultRef.current;
|
|
2657
|
-
const fontPopoverState = (0,
|
|
2621
|
+
const fontPopoverState = (0, import_ui31.usePopupState)({ variant: "popover" });
|
|
2658
2622
|
const fontFamilies = (0, import_editor_editing_panel7.useFontFamilies)();
|
|
2659
2623
|
const sectionWidth = (0, import_editor_editing_panel7.useSectionWidth)();
|
|
2660
|
-
const mapFontSubs =
|
|
2624
|
+
const mapFontSubs = React33.useMemo(() => {
|
|
2661
2625
|
return fontFamilies.map(({ label, fonts }) => ({
|
|
2662
2626
|
label,
|
|
2663
2627
|
items: fonts
|
|
@@ -2674,27 +2638,27 @@ var FontField = ({ value, onChange, onValidationChange }) => {
|
|
|
2674
2638
|
fontPopoverState.close();
|
|
2675
2639
|
};
|
|
2676
2640
|
const id2 = (0, import_react20.useId)();
|
|
2677
|
-
return /* @__PURE__ */
|
|
2678
|
-
|
|
2641
|
+
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(
|
|
2642
|
+
import_ui31.UnstableTag,
|
|
2679
2643
|
{
|
|
2680
2644
|
id: id2,
|
|
2681
2645
|
variant: "outlined",
|
|
2682
2646
|
label: fontFamily,
|
|
2683
|
-
endIcon: /* @__PURE__ */
|
|
2684
|
-
...(0,
|
|
2647
|
+
endIcon: /* @__PURE__ */ React33.createElement(import_icons14.ChevronDownIcon, { fontSize: "tiny" }),
|
|
2648
|
+
...(0, import_ui31.bindTrigger)(fontPopoverState),
|
|
2685
2649
|
fullWidth: true
|
|
2686
2650
|
}
|
|
2687
|
-
), /* @__PURE__ */
|
|
2688
|
-
|
|
2651
|
+
), /* @__PURE__ */ React33.createElement(
|
|
2652
|
+
import_ui31.Popover,
|
|
2689
2653
|
{
|
|
2690
2654
|
disablePortal: true,
|
|
2691
2655
|
disableScrollLock: true,
|
|
2692
2656
|
anchorEl: anchorRef,
|
|
2693
2657
|
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
2694
2658
|
transformOrigin: { vertical: "top", horizontal: -28 },
|
|
2695
|
-
...(0,
|
|
2659
|
+
...(0, import_ui31.bindPopover)(fontPopoverState)
|
|
2696
2660
|
},
|
|
2697
|
-
/* @__PURE__ */
|
|
2661
|
+
/* @__PURE__ */ React33.createElement(
|
|
2698
2662
|
import_editor_controls12.ItemSelector,
|
|
2699
2663
|
{
|
|
2700
2664
|
itemsList: mapFontSubs,
|
|
@@ -2705,7 +2669,7 @@ var FontField = ({ value, onChange, onValidationChange }) => {
|
|
|
2705
2669
|
title: (0, import_i18n23.__)("Font Family", "elementor"),
|
|
2706
2670
|
itemStyle: (item) => ({ fontFamily: item.value }),
|
|
2707
2671
|
onDebounce: import_editor_controls12.enqueueFont,
|
|
2708
|
-
icon:
|
|
2672
|
+
icon: import_icons14.TextIcon
|
|
2709
2673
|
}
|
|
2710
2674
|
)
|
|
2711
2675
|
));
|
|
@@ -2715,15 +2679,15 @@ var FontField = ({ value, onChange, onValidationChange }) => {
|
|
|
2715
2679
|
function registerVariableTypes() {
|
|
2716
2680
|
registerVariableType({
|
|
2717
2681
|
valueField: ColorField,
|
|
2718
|
-
icon:
|
|
2682
|
+
icon: import_icons15.BrushIcon,
|
|
2719
2683
|
propTypeUtil: colorVariablePropTypeUtil,
|
|
2720
2684
|
fallbackPropTypeUtil: import_editor_props3.colorPropTypeUtil,
|
|
2721
2685
|
variableType: "color",
|
|
2722
|
-
startIcon: ({ value }) => /* @__PURE__ */
|
|
2686
|
+
startIcon: ({ value }) => /* @__PURE__ */ React34.createElement(ColorIndicator, { size: "inherit", component: "span", value })
|
|
2723
2687
|
});
|
|
2724
2688
|
registerVariableType({
|
|
2725
2689
|
valueField: FontField,
|
|
2726
|
-
icon:
|
|
2690
|
+
icon: import_icons15.TextIcon,
|
|
2727
2691
|
propTypeUtil: fontVariablePropTypeUtil,
|
|
2728
2692
|
fallbackPropTypeUtil: import_editor_props3.stringPropTypeUtil,
|
|
2729
2693
|
variableType: "font"
|
|
@@ -2731,10 +2695,10 @@ function registerVariableTypes() {
|
|
|
2731
2695
|
}
|
|
2732
2696
|
|
|
2733
2697
|
// src/renderers/style-variables-renderer.tsx
|
|
2734
|
-
var
|
|
2698
|
+
var React35 = __toESM(require("react"));
|
|
2735
2699
|
var import_react21 = require("react");
|
|
2736
2700
|
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
2737
|
-
var
|
|
2701
|
+
var import_ui32 = require("@elementor/ui");
|
|
2738
2702
|
|
|
2739
2703
|
// src/sync/get-canvas-iframe-document.ts
|
|
2740
2704
|
function getCanvasIframeDocument() {
|
|
@@ -2753,7 +2717,7 @@ function StyleVariablesRenderer() {
|
|
|
2753
2717
|
}
|
|
2754
2718
|
const cssVariables = convertToCssVariables(styleVariables);
|
|
2755
2719
|
const wrappedCss = `${VARIABLES_WRAPPER}{${cssVariables}}`;
|
|
2756
|
-
return /* @__PURE__ */
|
|
2720
|
+
return /* @__PURE__ */ React35.createElement(import_ui32.Portal, { container }, /* @__PURE__ */ React35.createElement("style", { "data-e-style-id": "e-variables", key: wrappedCss }, wrappedCss));
|
|
2757
2721
|
}
|
|
2758
2722
|
function usePortalContainer() {
|
|
2759
2723
|
return (0, import_editor_v1_adapters3.__privateUseListenTo)((0, import_editor_v1_adapters3.commandEndEvent)("editor/documents/attach-preview"), () => getCanvasIframeDocument()?.head);
|
|
@@ -2783,22 +2747,22 @@ var import_editor_controls13 = require("@elementor/editor-controls");
|
|
|
2783
2747
|
var import_editor_props4 = require("@elementor/editor-props");
|
|
2784
2748
|
|
|
2785
2749
|
// src/components/variables-repeater-item-slot.tsx
|
|
2786
|
-
var
|
|
2750
|
+
var React36 = __toESM(require("react"));
|
|
2787
2751
|
var useColorVariable = (value) => {
|
|
2788
2752
|
const variableId = value?.value?.color?.value;
|
|
2789
2753
|
return useVariable(variableId || "");
|
|
2790
2754
|
};
|
|
2791
2755
|
var BackgroundRepeaterColorIndicator = ({ value }) => {
|
|
2792
2756
|
const colorVariable = useColorVariable(value);
|
|
2793
|
-
return /* @__PURE__ */
|
|
2757
|
+
return /* @__PURE__ */ React36.createElement(ColorIndicator, { component: "span", size: "inherit", value: colorVariable?.value });
|
|
2794
2758
|
};
|
|
2795
2759
|
var BackgroundRepeaterLabel = ({ value }) => {
|
|
2796
2760
|
const colorVariable = useColorVariable(value);
|
|
2797
|
-
return /* @__PURE__ */
|
|
2761
|
+
return /* @__PURE__ */ React36.createElement("span", null, colorVariable?.label);
|
|
2798
2762
|
};
|
|
2799
2763
|
var BoxShadowRepeaterColorIndicator = ({ value }) => {
|
|
2800
2764
|
const colorVariable = useColorVariable(value);
|
|
2801
|
-
return /* @__PURE__ */
|
|
2765
|
+
return /* @__PURE__ */ React36.createElement(ColorIndicator, { component: "span", size: "inherit", value: colorVariable?.value });
|
|
2802
2766
|
};
|
|
2803
2767
|
|
|
2804
2768
|
// src/repeater-injections.ts
|