@elementor/editor-editing-panel 1.3.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -1
- package/dist/index.js +650 -635
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +543 -528
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -5
- package/src/components/conditional-tooltip-wrapper.tsx +52 -0
- package/src/components/css-class-selector.tsx +59 -19
- package/src/components/multi-combobox/types.ts +1 -0
- package/src/components/style-sections/layout-section/gap-control-field.tsx +18 -0
- package/src/components/style-sections/layout-section/layout-section.tsx +2 -0
- package/src/components/style-sections/position-section/position-field.tsx +6 -2
- package/src/components/style-sections/position-section/position-section.tsx +51 -30
- package/src/components/style-tab.tsx +2 -11
- package/src/contexts/style-context.tsx +2 -2
- package/src/dynamics/components/dynamic-selection-control.tsx +3 -5
- package/src/dynamics/components/dynamic-selection.tsx +6 -6
- package/src/hooks/use-persist-dynamic-value.ts +11 -0
- package/src/hooks/use-session-storage.ts +46 -0
- package/src/hooks/use-styles-field.ts +8 -42
- package/src/hooks/use-styles-fields.ts +32 -0
- package/src/hooks/use-prop-value-history.ts +0 -45
- package/src/hooks/use-style-prop-history.ts +0 -75
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { __registerPanel as registerPanel } from "@elementor/editor-panels";
|
|
|
11
11
|
import { __privateBlockDataCommand as blockDataCommand } from "@elementor/editor-v1-adapters";
|
|
12
12
|
|
|
13
13
|
// src/hooks/use-close-editor-panel.ts
|
|
14
|
-
import { useEffect as
|
|
14
|
+
import { useEffect as useEffect3 } from "react";
|
|
15
15
|
import { getSelectedElements as getSelectedElements2, isElementInContainer } from "@elementor/editor-elements";
|
|
16
16
|
import { __privateListenTo as listenTo, commandStartEvent } from "@elementor/editor-v1-adapters";
|
|
17
17
|
|
|
@@ -19,12 +19,12 @@ import { __privateListenTo as listenTo, commandStartEvent } from "@elementor/edi
|
|
|
19
19
|
import { __createPanel as createPanel } from "@elementor/editor-panels";
|
|
20
20
|
|
|
21
21
|
// src/components/editing-panel.tsx
|
|
22
|
-
import * as
|
|
22
|
+
import * as React60 from "react";
|
|
23
23
|
import { ControlActionsProvider, ControlReplacementProvider } from "@elementor/editor-controls";
|
|
24
24
|
import { useSelectedElement } from "@elementor/editor-elements";
|
|
25
25
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
26
26
|
import { ErrorBoundary } from "@elementor/ui";
|
|
27
|
-
import { __ as
|
|
27
|
+
import { __ as __40 } from "@wordpress/i18n";
|
|
28
28
|
|
|
29
29
|
// src/contexts/element-context.tsx
|
|
30
30
|
import * as React from "react";
|
|
@@ -95,10 +95,10 @@ function EditorPanelErrorFallback() {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
// src/components/editing-panel-tabs.tsx
|
|
98
|
-
import * as
|
|
98
|
+
import * as React59 from "react";
|
|
99
99
|
import { Fragment as Fragment7 } from "react";
|
|
100
|
-
import { Divider as Divider8, Stack as
|
|
101
|
-
import { __ as
|
|
100
|
+
import { Divider as Divider8, Stack as Stack20, Tab, TabPanel, Tabs, useTabs } from "@elementor/ui";
|
|
101
|
+
import { __ as __39 } from "@wordpress/i18n";
|
|
102
102
|
|
|
103
103
|
// src/components/settings-tab.tsx
|
|
104
104
|
import * as React9 from "react";
|
|
@@ -258,13 +258,12 @@ var Control2 = ({ control }) => {
|
|
|
258
258
|
};
|
|
259
259
|
|
|
260
260
|
// src/components/style-tab.tsx
|
|
261
|
-
import * as
|
|
262
|
-
import { useState as
|
|
263
|
-
import { useElementSetting as useElementSetting3, useElementStyles
|
|
261
|
+
import * as React58 from "react";
|
|
262
|
+
import { useState as useState7 } from "react";
|
|
263
|
+
import { useElementSetting as useElementSetting3, useElementStyles } from "@elementor/editor-elements";
|
|
264
264
|
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
265
|
-
import { generateId } from "@elementor/editor-styles";
|
|
266
265
|
import { Divider as Divider7 } from "@elementor/ui";
|
|
267
|
-
import { __ as
|
|
266
|
+
import { __ as __38 } from "@wordpress/i18n";
|
|
268
267
|
|
|
269
268
|
// src/contexts/classes-prop-context.tsx
|
|
270
269
|
import * as React10 from "react";
|
|
@@ -297,17 +296,54 @@ function useStyle() {
|
|
|
297
296
|
}
|
|
298
297
|
|
|
299
298
|
// src/components/css-class-selector.tsx
|
|
300
|
-
import * as
|
|
301
|
-
import { updateSettings as updateSettings2, useElementSetting as useElementSetting2
|
|
299
|
+
import * as React14 from "react";
|
|
300
|
+
import { updateSettings as updateSettings2, useElementSetting as useElementSetting2 } from "@elementor/editor-elements";
|
|
302
301
|
import { classesPropTypeUtil } from "@elementor/editor-props";
|
|
302
|
+
import { ELEMENTS_STYLES_PROVIDER_KEY, useAllStylesByProvider } from "@elementor/editor-styles-repository";
|
|
303
303
|
import { Chip as Chip2, Stack as Stack3, Typography as Typography2 } from "@elementor/ui";
|
|
304
304
|
import { __ } from "@wordpress/i18n";
|
|
305
305
|
|
|
306
|
-
// src/components/
|
|
306
|
+
// src/components/conditional-tooltip-wrapper.tsx
|
|
307
|
+
import { useEffect, useRef, useState as useState2 } from "react";
|
|
307
308
|
import * as React12 from "react";
|
|
309
|
+
import { Box as Box3, Tooltip as Tooltip2 } from "@elementor/ui";
|
|
310
|
+
var ConditionalTooltipWrapper = ({ maxWidth, title }) => {
|
|
311
|
+
const elRef = useRef(null);
|
|
312
|
+
const [isOverflown, setIsOverflown] = useState2(false);
|
|
313
|
+
useEffect(() => {
|
|
314
|
+
const onResize = () => {
|
|
315
|
+
const element = elRef.current;
|
|
316
|
+
if (element) {
|
|
317
|
+
setIsOverflown(element.scrollWidth > element.clientWidth);
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
onResize();
|
|
321
|
+
window.addEventListener("resize", onResize);
|
|
322
|
+
return () => {
|
|
323
|
+
window.removeEventListener("resize", onResize);
|
|
324
|
+
};
|
|
325
|
+
}, []);
|
|
326
|
+
if (isOverflown) {
|
|
327
|
+
return /* @__PURE__ */ React12.createElement(Tooltip2, { title, placement: "top" }, /* @__PURE__ */ React12.createElement(Content, { maxWidth, ref: elRef, title }));
|
|
328
|
+
}
|
|
329
|
+
return /* @__PURE__ */ React12.createElement(Content, { maxWidth, ref: elRef, title });
|
|
330
|
+
};
|
|
331
|
+
var Content = React12.forwardRef(({ maxWidth, title, ...rest }, ref) => /* @__PURE__ */ React12.createElement(
|
|
332
|
+
Box3,
|
|
333
|
+
{
|
|
334
|
+
ref,
|
|
335
|
+
position: "relative",
|
|
336
|
+
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", maxWidth },
|
|
337
|
+
...rest
|
|
338
|
+
},
|
|
339
|
+
title
|
|
340
|
+
));
|
|
341
|
+
|
|
342
|
+
// src/components/multi-combobox/multi-combobox.tsx
|
|
343
|
+
import * as React13 from "react";
|
|
308
344
|
import {
|
|
309
345
|
Autocomplete,
|
|
310
|
-
Box as
|
|
346
|
+
Box as Box4,
|
|
311
347
|
Chip,
|
|
312
348
|
styled as styled3,
|
|
313
349
|
TextField
|
|
@@ -376,7 +412,7 @@ var MultiCombobox = ({
|
|
|
376
412
|
optionsLabel,
|
|
377
413
|
onSelect
|
|
378
414
|
);
|
|
379
|
-
return /* @__PURE__ */
|
|
415
|
+
return /* @__PURE__ */ React13.createElement(
|
|
380
416
|
Autocomplete,
|
|
381
417
|
{
|
|
382
418
|
...props,
|
|
@@ -389,8 +425,8 @@ var MultiCombobox = ({
|
|
|
389
425
|
value: selected,
|
|
390
426
|
options: options10,
|
|
391
427
|
renderGroup,
|
|
392
|
-
renderInput: (params) => /* @__PURE__ */
|
|
393
|
-
getLimitTagsText: (more) => /* @__PURE__ */
|
|
428
|
+
renderInput: (params) => /* @__PURE__ */ React13.createElement(TextField, { ...params }),
|
|
429
|
+
getLimitTagsText: (more) => /* @__PURE__ */ React13.createElement(Chip, { size: "tiny", variant: "standard", label: `+${more}`, clickable: true }),
|
|
394
430
|
onChange: (_, selectedOrTypedValue, reason) => {
|
|
395
431
|
if (reason === "createOption") {
|
|
396
432
|
const typedValue = selectedOrTypedValue.find((option) => typeof option === "string");
|
|
@@ -422,13 +458,13 @@ var MultiCombobox = ({
|
|
|
422
458
|
}
|
|
423
459
|
);
|
|
424
460
|
};
|
|
425
|
-
var renderGroup = (params) => /* @__PURE__ */
|
|
461
|
+
var renderGroup = (params) => /* @__PURE__ */ React13.createElement(Group, { key: params.key }, /* @__PURE__ */ React13.createElement(GroupHeader, null, params.group), /* @__PURE__ */ React13.createElement(GroupItems, null, params.children));
|
|
426
462
|
var Group = styled3("li")`
|
|
427
463
|
&:not( :last-of-type ) {
|
|
428
464
|
border-bottom: 1px solid ${({ theme }) => theme.palette.divider};
|
|
429
465
|
}
|
|
430
466
|
`;
|
|
431
|
-
var GroupHeader = styled3(
|
|
467
|
+
var GroupHeader = styled3(Box4)(({ theme }) => ({
|
|
432
468
|
position: "sticky",
|
|
433
469
|
top: "-8px",
|
|
434
470
|
padding: theme.spacing(1, 2),
|
|
@@ -441,15 +477,22 @@ var GroupItems = styled3("ul")`
|
|
|
441
477
|
// src/components/css-class-selector.tsx
|
|
442
478
|
var ID = "elementor-css-class-selector";
|
|
443
479
|
var TAGS_LIMIT = 8;
|
|
480
|
+
var EMPTY_OPTION = {
|
|
481
|
+
label: __("local", "elementor"),
|
|
482
|
+
value: "",
|
|
483
|
+
fixed: true,
|
|
484
|
+
color: "primary",
|
|
485
|
+
provider: ELEMENTS_STYLES_PROVIDER_KEY
|
|
486
|
+
};
|
|
444
487
|
function CssClassSelector() {
|
|
445
488
|
const options10 = useOptions();
|
|
489
|
+
const [appliedIds, setAppliedIds] = useAppliedClassesIds();
|
|
446
490
|
const { id: activeId, setId: setActiveId } = useStyle();
|
|
447
|
-
const
|
|
448
|
-
const handleApply = useHandleApply();
|
|
491
|
+
const handleApply = useHandleApply(appliedIds, setAppliedIds);
|
|
449
492
|
const handleActivate = ({ value }) => setActiveId(value);
|
|
450
|
-
const
|
|
451
|
-
const
|
|
452
|
-
return /* @__PURE__ */
|
|
493
|
+
const applied = useAppliedOptions(options10, appliedIds);
|
|
494
|
+
const active = applied.find((option) => option.value === activeId) ?? EMPTY_OPTION;
|
|
495
|
+
return /* @__PURE__ */ React14.createElement(Stack3, { gap: 1, p: 2 }, /* @__PURE__ */ React14.createElement(Typography2, { component: "label", variant: "caption", htmlFor: ID }, __("CSS Classes", "elementor")), /* @__PURE__ */ React14.createElement(
|
|
453
496
|
MultiCombobox,
|
|
454
497
|
{
|
|
455
498
|
id: ID,
|
|
@@ -462,17 +505,18 @@ function CssClassSelector() {
|
|
|
462
505
|
renderTags: (values, getTagProps) => values.map((value, index) => {
|
|
463
506
|
const chipProps = getTagProps({ index });
|
|
464
507
|
const isActive = value.value === active?.value;
|
|
465
|
-
return /* @__PURE__ */
|
|
508
|
+
return /* @__PURE__ */ React14.createElement(
|
|
466
509
|
Chip2,
|
|
467
510
|
{
|
|
468
511
|
...chipProps,
|
|
469
512
|
key: chipProps.key,
|
|
470
513
|
size: "small",
|
|
471
|
-
label: value.label,
|
|
514
|
+
label: /* @__PURE__ */ React14.createElement(ConditionalTooltipWrapper, { maxWidth: "10ch", title: value.label }),
|
|
472
515
|
variant: isActive ? "filled" : "standard",
|
|
473
516
|
color: isActive && value.color ? value.color : "default",
|
|
474
517
|
onClick: () => handleActivate(value),
|
|
475
|
-
onDelete: null
|
|
518
|
+
onDelete: null,
|
|
519
|
+
"aria-pressed": isActive
|
|
476
520
|
}
|
|
477
521
|
);
|
|
478
522
|
})
|
|
@@ -481,13 +525,31 @@ function CssClassSelector() {
|
|
|
481
525
|
}
|
|
482
526
|
function useOptions() {
|
|
483
527
|
const { element } = useElement();
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
528
|
+
return useAllStylesByProvider({ elementId: element.id }).flatMap(([providerKey, styleDefs]) => {
|
|
529
|
+
const isElements = providerKey === ELEMENTS_STYLES_PROVIDER_KEY;
|
|
530
|
+
if (isElements && styleDefs.length === 0) {
|
|
531
|
+
return [EMPTY_OPTION];
|
|
532
|
+
}
|
|
533
|
+
return styleDefs.map((styleDef) => {
|
|
534
|
+
return {
|
|
535
|
+
label: styleDef.label,
|
|
536
|
+
value: styleDef.id,
|
|
537
|
+
fixed: isElements,
|
|
538
|
+
color: isElements ? "primary" : "global",
|
|
539
|
+
provider: providerKey
|
|
540
|
+
};
|
|
541
|
+
});
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
function useAppliedOptions(options10, appliedIds) {
|
|
545
|
+
const applied = appliedIds.map((id) => options10.find((option) => option.value === id)).filter((option) => !!option);
|
|
546
|
+
const hasElementsProviderStyleApplied = applied.some(
|
|
547
|
+
(option) => option.provider === ELEMENTS_STYLES_PROVIDER_KEY
|
|
548
|
+
);
|
|
549
|
+
if (!hasElementsProviderStyleApplied) {
|
|
550
|
+
applied.unshift(EMPTY_OPTION);
|
|
551
|
+
}
|
|
552
|
+
return applied;
|
|
491
553
|
}
|
|
492
554
|
function useAppliedClassesIds() {
|
|
493
555
|
const { element } = useElement();
|
|
@@ -503,11 +565,10 @@ function useAppliedClassesIds() {
|
|
|
503
565
|
};
|
|
504
566
|
return [value, setValue];
|
|
505
567
|
}
|
|
506
|
-
function useHandleApply() {
|
|
568
|
+
function useHandleApply(appliedIds, setAppliedIds) {
|
|
507
569
|
const { id: activeId, setId: setActiveId } = useStyle();
|
|
508
|
-
const [appliedIds, setAppliedIds] = useAppliedClassesIds();
|
|
509
570
|
return (selectedOptions) => {
|
|
510
|
-
const selectedValues = selectedOptions.map(({ value }) => value);
|
|
571
|
+
const selectedValues = selectedOptions.map(({ value }) => value).filter((value) => value !== EMPTY_OPTION.value);
|
|
511
572
|
const isSameClassesAlreadyApplied = selectedValues.length === appliedIds.length && selectedValues.every((value) => appliedIds.includes(value));
|
|
512
573
|
if (isSameClassesAlreadyApplied) {
|
|
513
574
|
return;
|
|
@@ -526,86 +587,88 @@ function useHandleApply() {
|
|
|
526
587
|
}
|
|
527
588
|
|
|
528
589
|
// src/components/style-sections/background-section/background-section.tsx
|
|
529
|
-
import * as
|
|
590
|
+
import * as React17 from "react";
|
|
530
591
|
import { BackgroundOverlayRepeaterControl } from "@elementor/editor-controls";
|
|
531
592
|
import { Stack as Stack4 } from "@elementor/ui";
|
|
532
593
|
|
|
533
594
|
// src/controls-registry/styles-field.tsx
|
|
534
|
-
import * as
|
|
595
|
+
import * as React15 from "react";
|
|
535
596
|
import { BoundPropProvider as BoundPropProvider2 } from "@elementor/editor-controls";
|
|
536
597
|
|
|
537
|
-
// src/hooks/use-styles-
|
|
538
|
-
import {
|
|
539
|
-
import {
|
|
540
|
-
|
|
598
|
+
// src/hooks/use-styles-fields.ts
|
|
599
|
+
import { updateStyle, useElementStyleProps } from "@elementor/editor-elements";
|
|
600
|
+
import { __ as __2 } from "@wordpress/i18n";
|
|
601
|
+
function useStylesFields(propNames) {
|
|
541
602
|
const { element } = useElement();
|
|
542
603
|
const { id, meta } = useStyle();
|
|
543
604
|
const classesProp = useClassesProp();
|
|
544
|
-
const
|
|
545
|
-
const onChangeCallbacks = useRef(/* @__PURE__ */ new Set());
|
|
546
|
-
const value = useElementStyleProp({
|
|
605
|
+
const value = useElementStyleProps({
|
|
547
606
|
elementID: element.id,
|
|
548
607
|
styleDefID: id,
|
|
549
608
|
meta,
|
|
550
|
-
|
|
609
|
+
propNames
|
|
551
610
|
});
|
|
552
|
-
const setValue = (
|
|
611
|
+
const setValue = (newValues) => {
|
|
553
612
|
updateStyle({
|
|
554
613
|
elementID: element.id,
|
|
555
614
|
styleDefID: id,
|
|
556
|
-
props:
|
|
615
|
+
props: newValues,
|
|
557
616
|
meta,
|
|
558
|
-
bind: classesProp
|
|
617
|
+
bind: classesProp,
|
|
618
|
+
label: __2("local", "elementor")
|
|
559
619
|
});
|
|
560
620
|
};
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
621
|
+
return [value, setValue];
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// src/hooks/use-styles-field.ts
|
|
625
|
+
function useStylesField(propName) {
|
|
626
|
+
const [values, setValues] = useStylesFields([propName]);
|
|
627
|
+
const value = values?.[propName] ?? null;
|
|
628
|
+
const setValue = (newValue) => {
|
|
629
|
+
setValues({
|
|
630
|
+
[propName]: newValue
|
|
567
631
|
});
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
};
|
|
632
|
+
};
|
|
633
|
+
return [value, setValue];
|
|
634
|
+
}
|
|
572
635
|
|
|
573
636
|
// src/controls-registry/styles-field.tsx
|
|
574
637
|
var StylesField = ({ bind, children }) => {
|
|
575
638
|
const [value, setValue] = useStylesField(bind);
|
|
576
|
-
return /* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ React15.createElement(BoundPropProvider2, { setValue, value, bind }, children);
|
|
577
640
|
};
|
|
578
641
|
|
|
579
642
|
// src/components/style-sections/background-section/background-color-field.tsx
|
|
580
|
-
import * as
|
|
643
|
+
import * as React16 from "react";
|
|
581
644
|
import { ColorControl, ControlLabel as ControlLabel2 } from "@elementor/editor-controls";
|
|
582
645
|
import { Grid } from "@elementor/ui";
|
|
583
|
-
import { __ as
|
|
646
|
+
import { __ as __3 } from "@wordpress/i18n";
|
|
584
647
|
var BackgroundColorField = () => {
|
|
585
|
-
return /* @__PURE__ */
|
|
648
|
+
return /* @__PURE__ */ React16.createElement(StylesField, { bind: "background-color" }, /* @__PURE__ */ React16.createElement(Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React16.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React16.createElement(ControlLabel2, null, __3("Color", "elementor"))), /* @__PURE__ */ React16.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React16.createElement(ColorControl, null))));
|
|
586
649
|
};
|
|
587
650
|
|
|
588
651
|
// src/components/style-sections/background-section/background-section.tsx
|
|
589
652
|
var BackgroundSection = () => {
|
|
590
|
-
return /* @__PURE__ */
|
|
653
|
+
return /* @__PURE__ */ React17.createElement(Stack4, { gap: 1.5 }, /* @__PURE__ */ React17.createElement(StylesField, { bind: "background-image" }, /* @__PURE__ */ React17.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React17.createElement(BackgroundColorField, null));
|
|
591
654
|
};
|
|
592
655
|
|
|
593
656
|
// src/components/style-sections/border-section/border-section.tsx
|
|
594
|
-
import * as
|
|
657
|
+
import * as React24 from "react";
|
|
595
658
|
import { Divider as Divider2, Stack as Stack6 } from "@elementor/ui";
|
|
596
659
|
|
|
597
660
|
// src/components/style-sections/border-section/border-field.tsx
|
|
598
|
-
import * as
|
|
599
|
-
import { __ as
|
|
661
|
+
import * as React22 from "react";
|
|
662
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
600
663
|
|
|
601
664
|
// src/components/add-or-remove-content.tsx
|
|
602
|
-
import * as
|
|
665
|
+
import * as React18 from "react";
|
|
603
666
|
import { ControlLabel as ControlLabel3 } from "@elementor/editor-controls";
|
|
604
667
|
import { MinusIcon, PlusIcon } from "@elementor/icons";
|
|
605
668
|
import { Collapse as Collapse2, IconButton as IconButton2, Stack as Stack5 } from "@elementor/ui";
|
|
606
669
|
var SIZE2 = "tiny";
|
|
607
670
|
var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
608
|
-
return /* @__PURE__ */
|
|
671
|
+
return /* @__PURE__ */ React18.createElement(Stack5, { gap: 1.5 }, /* @__PURE__ */ React18.createElement(
|
|
609
672
|
Stack5,
|
|
610
673
|
{
|
|
611
674
|
direction: "row",
|
|
@@ -614,75 +677,75 @@ var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
|
614
677
|
alignItems: "center"
|
|
615
678
|
}
|
|
616
679
|
},
|
|
617
|
-
/* @__PURE__ */
|
|
618
|
-
isAdded ? /* @__PURE__ */
|
|
619
|
-
), /* @__PURE__ */
|
|
680
|
+
/* @__PURE__ */ React18.createElement(ControlLabel3, null, label),
|
|
681
|
+
isAdded ? /* @__PURE__ */ React18.createElement(IconButton2, { size: SIZE2, onClick: onRemove }, /* @__PURE__ */ React18.createElement(MinusIcon, { fontSize: SIZE2 })) : /* @__PURE__ */ React18.createElement(IconButton2, { size: SIZE2, onClick: onAdd }, /* @__PURE__ */ React18.createElement(PlusIcon, { fontSize: SIZE2 }))
|
|
682
|
+
), /* @__PURE__ */ React18.createElement(Collapse2, { in: isAdded, unmountOnExit: true }, /* @__PURE__ */ React18.createElement(Stack5, { gap: 1.5 }, children)));
|
|
620
683
|
};
|
|
621
684
|
|
|
622
685
|
// src/components/style-sections/border-section/border-color-field.tsx
|
|
623
|
-
import * as
|
|
686
|
+
import * as React19 from "react";
|
|
624
687
|
import { ColorControl as ColorControl2, ControlLabel as ControlLabel4 } from "@elementor/editor-controls";
|
|
625
688
|
import { Grid as Grid2 } from "@elementor/ui";
|
|
626
|
-
import { __ as
|
|
689
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
627
690
|
var BorderColorField = () => {
|
|
628
|
-
return /* @__PURE__ */
|
|
691
|
+
return /* @__PURE__ */ React19.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React19.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React19.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(ControlLabel4, null, __4("Border Color", "elementor"))), /* @__PURE__ */ React19.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(ColorControl2, null))));
|
|
629
692
|
};
|
|
630
693
|
|
|
631
694
|
// src/components/style-sections/border-section/border-style-field.tsx
|
|
632
|
-
import * as
|
|
695
|
+
import * as React20 from "react";
|
|
633
696
|
import { ControlLabel as ControlLabel5, SelectControl as SelectControl2 } from "@elementor/editor-controls";
|
|
634
697
|
import { Grid as Grid3 } from "@elementor/ui";
|
|
635
|
-
import { __ as
|
|
698
|
+
import { __ as __5 } from "@wordpress/i18n";
|
|
636
699
|
var borderStyles = [
|
|
637
|
-
{ value: "none", label:
|
|
638
|
-
{ value: "solid", label:
|
|
639
|
-
{ value: "dashed", label:
|
|
640
|
-
{ value: "dotted", label:
|
|
641
|
-
{ value: "double", label:
|
|
642
|
-
{ value: "groove", label:
|
|
643
|
-
{ value: "ridge", label:
|
|
644
|
-
{ value: "inset", label:
|
|
645
|
-
{ value: "outset", label:
|
|
700
|
+
{ value: "none", label: __5("None", "elementor") },
|
|
701
|
+
{ value: "solid", label: __5("Solid", "elementor") },
|
|
702
|
+
{ value: "dashed", label: __5("Dashed", "elementor") },
|
|
703
|
+
{ value: "dotted", label: __5("Dotted", "elementor") },
|
|
704
|
+
{ value: "double", label: __5("Double", "elementor") },
|
|
705
|
+
{ value: "groove", label: __5("Groove", "elementor") },
|
|
706
|
+
{ value: "ridge", label: __5("Ridge", "elementor") },
|
|
707
|
+
{ value: "inset", label: __5("Inset", "elementor") },
|
|
708
|
+
{ value: "outset", label: __5("Outset", "elementor") }
|
|
646
709
|
];
|
|
647
710
|
var BorderStyleField = () => {
|
|
648
|
-
return /* @__PURE__ */
|
|
711
|
+
return /* @__PURE__ */ React20.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React20.createElement(Grid3, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React20.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React20.createElement(ControlLabel5, null, __5("Border Type", "elementor"))), /* @__PURE__ */ React20.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React20.createElement(SelectControl2, { options: borderStyles }))));
|
|
649
712
|
};
|
|
650
713
|
|
|
651
714
|
// src/components/style-sections/border-section/border-width-field.tsx
|
|
652
|
-
import * as
|
|
715
|
+
import * as React21 from "react";
|
|
653
716
|
import { EqualUnequalSizesControl } from "@elementor/editor-controls";
|
|
654
717
|
import { borderWidthPropTypeUtil } from "@elementor/editor-props";
|
|
655
718
|
import { SideAllIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
656
|
-
import { __ as
|
|
719
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
657
720
|
var edges = [
|
|
658
721
|
{
|
|
659
|
-
label:
|
|
660
|
-
icon: /* @__PURE__ */
|
|
722
|
+
label: __6("Top", "elementor"),
|
|
723
|
+
icon: /* @__PURE__ */ React21.createElement(SideTopIcon, { fontSize: "tiny" }),
|
|
661
724
|
bind: "top"
|
|
662
725
|
},
|
|
663
726
|
{
|
|
664
|
-
label:
|
|
665
|
-
icon: /* @__PURE__ */
|
|
727
|
+
label: __6("Right", "elementor"),
|
|
728
|
+
icon: /* @__PURE__ */ React21.createElement(SideRightIcon, { fontSize: "tiny" }),
|
|
666
729
|
bind: "right"
|
|
667
730
|
},
|
|
668
731
|
{
|
|
669
|
-
label:
|
|
670
|
-
icon: /* @__PURE__ */
|
|
732
|
+
label: __6("Bottom", "elementor"),
|
|
733
|
+
icon: /* @__PURE__ */ React21.createElement(SideBottomIcon, { fontSize: "tiny" }),
|
|
671
734
|
bind: "bottom"
|
|
672
735
|
},
|
|
673
736
|
{
|
|
674
|
-
label:
|
|
675
|
-
icon: /* @__PURE__ */
|
|
737
|
+
label: __6("Left", "elementor"),
|
|
738
|
+
icon: /* @__PURE__ */ React21.createElement(SideLeftIcon, { fontSize: "tiny" }),
|
|
676
739
|
bind: "left"
|
|
677
740
|
}
|
|
678
741
|
];
|
|
679
742
|
var BorderWidthField = () => {
|
|
680
|
-
return /* @__PURE__ */
|
|
743
|
+
return /* @__PURE__ */ React21.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React21.createElement(
|
|
681
744
|
EqualUnequalSizesControl,
|
|
682
745
|
{
|
|
683
746
|
items: edges,
|
|
684
|
-
label:
|
|
685
|
-
icon: /* @__PURE__ */
|
|
747
|
+
label: __6("Border Width", "elementor"),
|
|
748
|
+
icon: /* @__PURE__ */ React21.createElement(SideAllIcon, { fontSize: "tiny" }),
|
|
686
749
|
multiSizePropTypeUtil: borderWidthPropTypeUtil
|
|
687
750
|
}
|
|
688
751
|
));
|
|
@@ -711,22 +774,22 @@ var BorderField = () => {
|
|
|
711
774
|
setBorderStyle(null);
|
|
712
775
|
};
|
|
713
776
|
const hasBorder = Boolean(borderWidth || borderColor || borderStyle);
|
|
714
|
-
return /* @__PURE__ */
|
|
777
|
+
return /* @__PURE__ */ React22.createElement(
|
|
715
778
|
AddOrRemoveContent,
|
|
716
779
|
{
|
|
717
|
-
label:
|
|
780
|
+
label: __7("Border", "elementor"),
|
|
718
781
|
isAdded: hasBorder,
|
|
719
782
|
onAdd: addBorder,
|
|
720
783
|
onRemove: removeBorder
|
|
721
784
|
},
|
|
722
|
-
/* @__PURE__ */
|
|
723
|
-
/* @__PURE__ */
|
|
724
|
-
/* @__PURE__ */
|
|
785
|
+
/* @__PURE__ */ React22.createElement(BorderWidthField, null),
|
|
786
|
+
/* @__PURE__ */ React22.createElement(BorderColorField, null),
|
|
787
|
+
/* @__PURE__ */ React22.createElement(BorderStyleField, null)
|
|
725
788
|
);
|
|
726
789
|
};
|
|
727
790
|
|
|
728
791
|
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
729
|
-
import * as
|
|
792
|
+
import * as React23 from "react";
|
|
730
793
|
import { EqualUnequalSizesControl as EqualUnequalSizesControl2 } from "@elementor/editor-controls";
|
|
731
794
|
import { borderRadiusPropTypeUtil } from "@elementor/editor-props";
|
|
732
795
|
import {
|
|
@@ -736,60 +799,60 @@ import {
|
|
|
736
799
|
RadiusTopLeftIcon,
|
|
737
800
|
RadiusTopRightIcon
|
|
738
801
|
} from "@elementor/icons";
|
|
739
|
-
import { __ as
|
|
802
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
740
803
|
var corners = [
|
|
741
804
|
{
|
|
742
|
-
label:
|
|
743
|
-
icon: /* @__PURE__ */
|
|
805
|
+
label: __8("Top Left", "elementor"),
|
|
806
|
+
icon: /* @__PURE__ */ React23.createElement(RadiusTopLeftIcon, { fontSize: "tiny" }),
|
|
744
807
|
bind: "top-left"
|
|
745
808
|
},
|
|
746
809
|
{
|
|
747
|
-
label:
|
|
748
|
-
icon: /* @__PURE__ */
|
|
810
|
+
label: __8("Top Right", "elementor"),
|
|
811
|
+
icon: /* @__PURE__ */ React23.createElement(RadiusTopRightIcon, { fontSize: "tiny" }),
|
|
749
812
|
bind: "top-right"
|
|
750
813
|
},
|
|
751
814
|
{
|
|
752
|
-
label:
|
|
753
|
-
icon: /* @__PURE__ */
|
|
815
|
+
label: __8("Bottom Right", "elementor"),
|
|
816
|
+
icon: /* @__PURE__ */ React23.createElement(RadiusBottomRightIcon, { fontSize: "tiny" }),
|
|
754
817
|
bind: "bottom-right"
|
|
755
818
|
},
|
|
756
819
|
{
|
|
757
|
-
label:
|
|
758
|
-
icon: /* @__PURE__ */
|
|
820
|
+
label: __8("Bottom Left", "elementor"),
|
|
821
|
+
icon: /* @__PURE__ */ React23.createElement(RadiusBottomLeftIcon, { fontSize: "tiny" }),
|
|
759
822
|
bind: "bottom-left"
|
|
760
823
|
}
|
|
761
824
|
];
|
|
762
825
|
var BorderRadiusField = () => {
|
|
763
|
-
return /* @__PURE__ */
|
|
826
|
+
return /* @__PURE__ */ React23.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React23.createElement(
|
|
764
827
|
EqualUnequalSizesControl2,
|
|
765
828
|
{
|
|
766
829
|
items: corners,
|
|
767
|
-
label:
|
|
768
|
-
icon: /* @__PURE__ */
|
|
830
|
+
label: __8("Border Radius", "elementor"),
|
|
831
|
+
icon: /* @__PURE__ */ React23.createElement(BorderCornersIcon, { fontSize: "tiny" }),
|
|
769
832
|
multiSizePropTypeUtil: borderRadiusPropTypeUtil
|
|
770
833
|
}
|
|
771
834
|
));
|
|
772
835
|
};
|
|
773
836
|
|
|
774
837
|
// src/components/style-sections/border-section/border-section.tsx
|
|
775
|
-
var BorderSection = () => /* @__PURE__ */
|
|
838
|
+
var BorderSection = () => /* @__PURE__ */ React24.createElement(Stack6, { gap: 1.5 }, /* @__PURE__ */ React24.createElement(BorderRadiusField, null), /* @__PURE__ */ React24.createElement(Divider2, null), /* @__PURE__ */ React24.createElement(BorderField, null));
|
|
776
839
|
|
|
777
840
|
// src/components/style-sections/effects-section/effects-section.tsx
|
|
778
|
-
import * as
|
|
841
|
+
import * as React25 from "react";
|
|
779
842
|
import { BoxShadowRepeaterControl } from "@elementor/editor-controls";
|
|
780
843
|
import { Stack as Stack7 } from "@elementor/ui";
|
|
781
844
|
var EffectsSection = () => {
|
|
782
|
-
return /* @__PURE__ */
|
|
845
|
+
return /* @__PURE__ */ React25.createElement(Stack7, { gap: 1.5 }, /* @__PURE__ */ React25.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React25.createElement(BoxShadowRepeaterControl, null)));
|
|
783
846
|
};
|
|
784
847
|
|
|
785
848
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
786
|
-
import * as
|
|
849
|
+
import * as React36 from "react";
|
|
787
850
|
import { ControlLabel as ControlLabel14 } from "@elementor/editor-controls";
|
|
788
|
-
import { Divider as Divider3, Stack as
|
|
789
|
-
import { __ as
|
|
851
|
+
import { Divider as Divider3, Stack as Stack13 } from "@elementor/ui";
|
|
852
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
790
853
|
|
|
791
854
|
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
792
|
-
import * as
|
|
855
|
+
import * as React27 from "react";
|
|
793
856
|
import { ControlLabel as ControlLabel6, ToggleControl } from "@elementor/editor-controls";
|
|
794
857
|
import {
|
|
795
858
|
LayoutAlignCenterIcon as CenterIcon,
|
|
@@ -798,7 +861,7 @@ import {
|
|
|
798
861
|
LayoutDistributeVerticalIcon as JustifyIcon
|
|
799
862
|
} from "@elementor/icons";
|
|
800
863
|
import { DirectionProvider, Grid as Grid4, ThemeProvider, withDirection } from "@elementor/ui";
|
|
801
|
-
import { __ as
|
|
864
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
802
865
|
|
|
803
866
|
// src/hooks/use-direction.ts
|
|
804
867
|
import { useTheme } from "@elementor/ui";
|
|
@@ -809,7 +872,7 @@ function useDirection() {
|
|
|
809
872
|
}
|
|
810
873
|
|
|
811
874
|
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
812
|
-
import * as
|
|
875
|
+
import * as React26 from "react";
|
|
813
876
|
import { useRef as useRef2 } from "react";
|
|
814
877
|
import { useTheme as useTheme2 } from "@elementor/ui";
|
|
815
878
|
var CLOCKWISE_ANGLES = {
|
|
@@ -827,7 +890,7 @@ var COUNTER_CLOCKWISE_ANGLES = {
|
|
|
827
890
|
var RotatedIcon = ({ icon: Icon, size, isClockwise = true, offset = 0 }) => {
|
|
828
891
|
const rotate = useRef2(useGetTargetAngle(isClockwise, offset));
|
|
829
892
|
rotate.current = useGetTargetAngle(isClockwise, offset, rotate);
|
|
830
|
-
return /* @__PURE__ */
|
|
893
|
+
return /* @__PURE__ */ React26.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
831
894
|
};
|
|
832
895
|
var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
833
896
|
const [direction] = useStylesField("flex-direction");
|
|
@@ -851,36 +914,36 @@ var iconProps = {
|
|
|
851
914
|
var options = [
|
|
852
915
|
{
|
|
853
916
|
value: "start",
|
|
854
|
-
label:
|
|
855
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
917
|
+
label: __9("Start", "elementor"),
|
|
918
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: StartIcon, size, ...iconProps }),
|
|
856
919
|
showTooltip: true
|
|
857
920
|
},
|
|
858
921
|
{
|
|
859
922
|
value: "center",
|
|
860
|
-
label:
|
|
861
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
923
|
+
label: __9("Center", "elementor"),
|
|
924
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: CenterIcon, size, ...iconProps }),
|
|
862
925
|
showTooltip: true
|
|
863
926
|
},
|
|
864
927
|
{
|
|
865
928
|
value: "end",
|
|
866
|
-
label:
|
|
867
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
929
|
+
label: __9("End", "elementor"),
|
|
930
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: EndIcon, size, ...iconProps }),
|
|
868
931
|
showTooltip: true
|
|
869
932
|
},
|
|
870
933
|
{
|
|
871
934
|
value: "stretch",
|
|
872
|
-
label:
|
|
873
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
935
|
+
label: __9("Stretch", "elementor"),
|
|
936
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: JustifyIcon, size, ...iconProps }),
|
|
874
937
|
showTooltip: true
|
|
875
938
|
}
|
|
876
939
|
];
|
|
877
940
|
var AlignItemsField = () => {
|
|
878
941
|
const { isSiteRtl } = useDirection();
|
|
879
|
-
return /* @__PURE__ */
|
|
942
|
+
return /* @__PURE__ */ React27.createElement(DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React27.createElement(ThemeProvider, null, /* @__PURE__ */ React27.createElement(StylesField, { bind: "align-items" }, /* @__PURE__ */ React27.createElement(Grid4, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React27.createElement(ControlLabel6, null, __9("Align items", "elementor"))), /* @__PURE__ */ React27.createElement(Grid4, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React27.createElement(ToggleControl, { options }))))));
|
|
880
943
|
};
|
|
881
944
|
|
|
882
945
|
// src/components/style-sections/layout-section/align-self-child-field.tsx
|
|
883
|
-
import * as
|
|
946
|
+
import * as React28 from "react";
|
|
884
947
|
import { ControlLabel as ControlLabel7, ToggleControl as ToggleControl2 } from "@elementor/editor-controls";
|
|
885
948
|
import {
|
|
886
949
|
LayoutAlignCenterIcon as CenterIcon2,
|
|
@@ -889,7 +952,7 @@ import {
|
|
|
889
952
|
LayoutDistributeVerticalIcon as JustifyIcon2
|
|
890
953
|
} from "@elementor/icons";
|
|
891
954
|
import { DirectionProvider as DirectionProvider2, Grid as Grid5, ThemeProvider as ThemeProvider2, withDirection as withDirection2 } from "@elementor/ui";
|
|
892
|
-
import { __ as
|
|
955
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
893
956
|
var StartIcon2 = withDirection2(LayoutAlignLeftIcon2);
|
|
894
957
|
var EndIcon2 = withDirection2(LayoutAlignRightIcon2);
|
|
895
958
|
var iconProps2 = {
|
|
@@ -899,101 +962,101 @@ var iconProps2 = {
|
|
|
899
962
|
var options2 = [
|
|
900
963
|
{
|
|
901
964
|
value: "start",
|
|
902
|
-
label:
|
|
903
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
965
|
+
label: __10("Start", "elementor"),
|
|
966
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: StartIcon2, size, ...iconProps2 }),
|
|
904
967
|
showTooltip: true
|
|
905
968
|
},
|
|
906
969
|
{
|
|
907
970
|
value: "center",
|
|
908
|
-
label:
|
|
909
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
971
|
+
label: __10("Center", "elementor"),
|
|
972
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: CenterIcon2, size, ...iconProps2 }),
|
|
910
973
|
showTooltip: true
|
|
911
974
|
},
|
|
912
975
|
{
|
|
913
976
|
value: "end",
|
|
914
|
-
label:
|
|
915
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
977
|
+
label: __10("End", "elementor"),
|
|
978
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: EndIcon2, size, ...iconProps2 }),
|
|
916
979
|
showTooltip: true
|
|
917
980
|
},
|
|
918
981
|
{
|
|
919
982
|
value: "stretch",
|
|
920
|
-
label:
|
|
921
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
983
|
+
label: __10("Stretch", "elementor"),
|
|
984
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: JustifyIcon2, size, ...iconProps2 }),
|
|
922
985
|
showTooltip: true
|
|
923
986
|
}
|
|
924
987
|
];
|
|
925
988
|
var AlignSelfChild = () => {
|
|
926
989
|
const { isSiteRtl } = useDirection();
|
|
927
|
-
return /* @__PURE__ */
|
|
990
|
+
return /* @__PURE__ */ React28.createElement(DirectionProvider2, { rtl: isSiteRtl }, /* @__PURE__ */ React28.createElement(ThemeProvider2, null, /* @__PURE__ */ React28.createElement(StylesField, { bind: "align-self" }, /* @__PURE__ */ React28.createElement(Grid5, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlLabel7, null, __10("Align self", "elementor"))), /* @__PURE__ */ React28.createElement(Grid5, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React28.createElement(ToggleControl2, { options: options2 }))))));
|
|
928
991
|
};
|
|
929
992
|
|
|
930
993
|
// src/components/style-sections/layout-section/display-field.tsx
|
|
931
|
-
import * as
|
|
994
|
+
import * as React29 from "react";
|
|
932
995
|
import { ControlLabel as ControlLabel8, ToggleControl as ToggleControl3 } from "@elementor/editor-controls";
|
|
933
996
|
import { Stack as Stack8 } from "@elementor/ui";
|
|
934
|
-
import { __ as
|
|
997
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
935
998
|
var DisplayField = () => {
|
|
936
999
|
const options10 = [
|
|
937
1000
|
{
|
|
938
1001
|
value: "block",
|
|
939
|
-
renderContent: () =>
|
|
940
|
-
label:
|
|
1002
|
+
renderContent: () => __11("Block", "elementor"),
|
|
1003
|
+
label: __11("Block", "elementor")
|
|
941
1004
|
},
|
|
942
1005
|
{
|
|
943
1006
|
value: "flex",
|
|
944
|
-
renderContent: () =>
|
|
945
|
-
label:
|
|
1007
|
+
renderContent: () => __11("Flex", "elementor"),
|
|
1008
|
+
label: __11("Flex", "elementor")
|
|
946
1009
|
}
|
|
947
1010
|
];
|
|
948
|
-
return /* @__PURE__ */
|
|
1011
|
+
return /* @__PURE__ */ React29.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React29.createElement(Stack8, { gap: 1 }, /* @__PURE__ */ React29.createElement(ControlLabel8, null, __11("Display", "elementor")), /* @__PURE__ */ React29.createElement(ToggleControl3, { options: options10, fullWidth: true })));
|
|
949
1012
|
};
|
|
950
1013
|
|
|
951
1014
|
// src/components/style-sections/layout-section/flex-direction-field.tsx
|
|
952
|
-
import * as
|
|
1015
|
+
import * as React30 from "react";
|
|
953
1016
|
import { ControlLabel as ControlLabel9, ToggleControl as ToggleControl4 } from "@elementor/editor-controls";
|
|
954
1017
|
import { ArrowDownSmallIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpSmallIcon } from "@elementor/icons";
|
|
955
1018
|
import { DirectionProvider as DirectionProvider3, Grid as Grid6, ThemeProvider as ThemeProvider3, withDirection as withDirection3 } from "@elementor/ui";
|
|
956
|
-
import { __ as
|
|
1019
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
957
1020
|
var options3 = [
|
|
958
1021
|
{
|
|
959
1022
|
value: "row",
|
|
960
|
-
label:
|
|
1023
|
+
label: __12("Row", "elementor"),
|
|
961
1024
|
renderContent: ({ size }) => {
|
|
962
1025
|
const StartIcon4 = withDirection3(ArrowRightIcon);
|
|
963
|
-
return /* @__PURE__ */
|
|
1026
|
+
return /* @__PURE__ */ React30.createElement(StartIcon4, { fontSize: size });
|
|
964
1027
|
},
|
|
965
1028
|
showTooltip: true
|
|
966
1029
|
},
|
|
967
1030
|
{
|
|
968
1031
|
value: "column",
|
|
969
|
-
label:
|
|
970
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1032
|
+
label: __12("Column", "elementor"),
|
|
1033
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(ArrowDownSmallIcon, { fontSize: size }),
|
|
971
1034
|
showTooltip: true
|
|
972
1035
|
},
|
|
973
1036
|
{
|
|
974
1037
|
value: "row-reverse",
|
|
975
|
-
label:
|
|
1038
|
+
label: __12("Reversed row", "elementor"),
|
|
976
1039
|
renderContent: ({ size }) => {
|
|
977
1040
|
const EndIcon4 = withDirection3(ArrowLeftIcon);
|
|
978
|
-
return /* @__PURE__ */
|
|
1041
|
+
return /* @__PURE__ */ React30.createElement(EndIcon4, { fontSize: size });
|
|
979
1042
|
},
|
|
980
1043
|
showTooltip: true
|
|
981
1044
|
},
|
|
982
1045
|
{
|
|
983
1046
|
value: "column-reverse",
|
|
984
|
-
label:
|
|
985
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1047
|
+
label: __12("Reversed column", "elementor"),
|
|
1048
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(ArrowUpSmallIcon, { fontSize: size }),
|
|
986
1049
|
showTooltip: true
|
|
987
1050
|
}
|
|
988
1051
|
];
|
|
989
1052
|
var FlexDirectionField = () => {
|
|
990
1053
|
const { isSiteRtl } = useDirection();
|
|
991
|
-
return /* @__PURE__ */
|
|
1054
|
+
return /* @__PURE__ */ React30.createElement(DirectionProvider3, { rtl: isSiteRtl }, /* @__PURE__ */ React30.createElement(ThemeProvider3, null, /* @__PURE__ */ React30.createElement(StylesField, { bind: "flex-direction" }, /* @__PURE__ */ React30.createElement(Grid6, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel9, null, __12("Direction", "elementor"))), /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React30.createElement(ToggleControl4, { options: options3 }))))));
|
|
992
1055
|
};
|
|
993
1056
|
|
|
994
1057
|
// src/components/style-sections/layout-section/flex-order-field.tsx
|
|
995
|
-
import * as
|
|
996
|
-
import { useState as
|
|
1058
|
+
import * as React31 from "react";
|
|
1059
|
+
import { useState as useState3 } from "react";
|
|
997
1060
|
import {
|
|
998
1061
|
ControlLabel as ControlLabel10,
|
|
999
1062
|
ControlToggleButtonGroup,
|
|
@@ -1001,7 +1064,7 @@ import {
|
|
|
1001
1064
|
} from "@elementor/editor-controls";
|
|
1002
1065
|
import { ArrowDownSmallIcon as ArrowDownSmallIcon2, ArrowUpSmallIcon as ArrowUpSmallIcon2, PencilIcon } from "@elementor/icons";
|
|
1003
1066
|
import { DirectionProvider as DirectionProvider4, Grid as Grid7, Stack as Stack9, ThemeProvider as ThemeProvider4 } from "@elementor/ui";
|
|
1004
|
-
import { __ as
|
|
1067
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
1005
1068
|
var FIRST_DEFAULT_VALUE = -99999;
|
|
1006
1069
|
var LAST_DEFAULT_VALUE = 99999;
|
|
1007
1070
|
var FIRST = "first";
|
|
@@ -1014,26 +1077,26 @@ var orderValueMap = {
|
|
|
1014
1077
|
var items = [
|
|
1015
1078
|
{
|
|
1016
1079
|
value: FIRST,
|
|
1017
|
-
label:
|
|
1018
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1080
|
+
label: __13("First", "elementor"),
|
|
1081
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(ArrowUpSmallIcon2, { fontSize: size }),
|
|
1019
1082
|
showTooltip: true
|
|
1020
1083
|
},
|
|
1021
1084
|
{
|
|
1022
1085
|
value: LAST,
|
|
1023
|
-
label:
|
|
1024
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1086
|
+
label: __13("Last", "elementor"),
|
|
1087
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(ArrowDownSmallIcon2, { fontSize: size }),
|
|
1025
1088
|
showTooltip: true
|
|
1026
1089
|
},
|
|
1027
1090
|
{
|
|
1028
1091
|
value: CUSTOM,
|
|
1029
|
-
label:
|
|
1030
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1092
|
+
label: __13("Custom", "elementor"),
|
|
1093
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(PencilIcon, { fontSize: size }),
|
|
1031
1094
|
showTooltip: true
|
|
1032
1095
|
}
|
|
1033
1096
|
];
|
|
1034
1097
|
var FlexOrderField = () => {
|
|
1035
1098
|
const { isSiteRtl } = useDirection(), [order, setOrder] = useStylesField("order");
|
|
1036
|
-
const [groupControlValue, setGroupControlValue] =
|
|
1099
|
+
const [groupControlValue, setGroupControlValue] = useState3(getGroupControlValue(order?.value || null));
|
|
1037
1100
|
const handleToggleButtonChange = (group) => {
|
|
1038
1101
|
setGroupControlValue(group);
|
|
1039
1102
|
if (!group || group === CUSTOM) {
|
|
@@ -1042,7 +1105,7 @@ var FlexOrderField = () => {
|
|
|
1042
1105
|
}
|
|
1043
1106
|
setOrder({ $$type: "number", value: orderValueMap[group] });
|
|
1044
1107
|
};
|
|
1045
|
-
return /* @__PURE__ */
|
|
1108
|
+
return /* @__PURE__ */ React31.createElement(DirectionProvider4, { rtl: isSiteRtl }, /* @__PURE__ */ React31.createElement(ThemeProvider4, null, /* @__PURE__ */ React31.createElement(Stack9, { gap: 2 }, /* @__PURE__ */ React31.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlLabel10, null, __13("Order", "elementor"))), /* @__PURE__ */ React31.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(
|
|
1046
1109
|
ControlToggleButtonGroup,
|
|
1047
1110
|
{
|
|
1048
1111
|
items,
|
|
@@ -1050,7 +1113,7 @@ var FlexOrderField = () => {
|
|
|
1050
1113
|
onChange: handleToggleButtonChange,
|
|
1051
1114
|
exclusive: true
|
|
1052
1115
|
}
|
|
1053
|
-
))), CUSTOM === groupControlValue && /* @__PURE__ */
|
|
1116
|
+
))), CUSTOM === groupControlValue && /* @__PURE__ */ React31.createElement(StylesField, { bind: "order" }, /* @__PURE__ */ React31.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlLabel10, null, __13("Custom order", "elementor"))), /* @__PURE__ */ React31.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(
|
|
1054
1117
|
NumberControl,
|
|
1055
1118
|
{
|
|
1056
1119
|
min: FIRST_DEFAULT_VALUE + 1,
|
|
@@ -1070,7 +1133,7 @@ var getGroupControlValue = (order) => {
|
|
|
1070
1133
|
};
|
|
1071
1134
|
|
|
1072
1135
|
// src/components/style-sections/layout-section/flex-size-field.tsx
|
|
1073
|
-
import * as
|
|
1136
|
+
import * as React32 from "react";
|
|
1074
1137
|
import {
|
|
1075
1138
|
ControlLabel as ControlLabel11,
|
|
1076
1139
|
ControlToggleButtonGroup as ControlToggleButtonGroup2,
|
|
@@ -1079,32 +1142,32 @@ import {
|
|
|
1079
1142
|
} from "@elementor/editor-controls";
|
|
1080
1143
|
import { ExpandIcon, PencilIcon as PencilIcon2, ShrinkIcon } from "@elementor/icons";
|
|
1081
1144
|
import { DirectionProvider as DirectionProvider5, Grid as Grid8, Stack as Stack10, ThemeProvider as ThemeProvider5 } from "@elementor/ui";
|
|
1082
|
-
import { __ as
|
|
1145
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
1083
1146
|
var DEFAULT = 1;
|
|
1084
1147
|
var items2 = [
|
|
1085
1148
|
{
|
|
1086
1149
|
value: "flex-grow",
|
|
1087
|
-
label:
|
|
1088
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1150
|
+
label: __14("Grow", "elementor"),
|
|
1151
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(ExpandIcon, { fontSize: size }),
|
|
1089
1152
|
showTooltip: true
|
|
1090
1153
|
},
|
|
1091
1154
|
{
|
|
1092
1155
|
value: "flex-shrink",
|
|
1093
|
-
label:
|
|
1094
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1156
|
+
label: __14("Shrink", "elementor"),
|
|
1157
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(ShrinkIcon, { fontSize: size }),
|
|
1095
1158
|
showTooltip: true
|
|
1096
1159
|
},
|
|
1097
1160
|
{
|
|
1098
1161
|
value: "custom",
|
|
1099
|
-
label:
|
|
1100
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1162
|
+
label: __14("Custom", "elementor"),
|
|
1163
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(PencilIcon2, { fontSize: size }),
|
|
1101
1164
|
showTooltip: true
|
|
1102
1165
|
}
|
|
1103
1166
|
];
|
|
1104
1167
|
var FlexSizeField = () => {
|
|
1105
1168
|
const { isSiteRtl } = useDirection(), [growField, setGrowField] = useStylesField("flex-grow"), [shrinkField, setShrinkField] = useStylesField("flex-shrink"), [basisField, setBasisField] = useStylesField("flex-basis");
|
|
1106
1169
|
const grow = growField?.value || null, shrink = shrinkField?.value || null, basis = basisField?.value || null;
|
|
1107
|
-
const currentGroup =
|
|
1170
|
+
const currentGroup = React32.useMemo(() => getActiveGroup({ grow, shrink, basis }), [grow, shrink, basis]), [activeGroup, setActiveGroup] = React32.useState(currentGroup);
|
|
1108
1171
|
const onChangeGroup = (group = null) => {
|
|
1109
1172
|
setActiveGroup(group);
|
|
1110
1173
|
setBasisField(null);
|
|
@@ -1121,7 +1184,7 @@ var FlexSizeField = () => {
|
|
|
1121
1184
|
setGrowField(null);
|
|
1122
1185
|
setShrinkField({ $$type: "number", value: DEFAULT });
|
|
1123
1186
|
};
|
|
1124
|
-
return /* @__PURE__ */
|
|
1187
|
+
return /* @__PURE__ */ React32.createElement(DirectionProvider5, { rtl: isSiteRtl }, /* @__PURE__ */ React32.createElement(ThemeProvider5, null, /* @__PURE__ */ React32.createElement(Stack10, { gap: 2 }, /* @__PURE__ */ React32.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel11, null, __14("Size", "elementor"))), /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(
|
|
1125
1188
|
ControlToggleButtonGroup2,
|
|
1126
1189
|
{
|
|
1127
1190
|
value: activeGroup,
|
|
@@ -1129,9 +1192,9 @@ var FlexSizeField = () => {
|
|
|
1129
1192
|
items: items2,
|
|
1130
1193
|
exclusive: true
|
|
1131
1194
|
}
|
|
1132
|
-
))), "custom" === activeGroup && /* @__PURE__ */
|
|
1195
|
+
))), "custom" === activeGroup && /* @__PURE__ */ React32.createElement(FlexCustomField, null))));
|
|
1133
1196
|
};
|
|
1134
|
-
var FlexCustomField = () => /* @__PURE__ */
|
|
1197
|
+
var FlexCustomField = () => /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(StylesField, { bind: "flex-grow" }, /* @__PURE__ */ React32.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel11, null, __14("Grow", "elementor"))), /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(NumberControl2, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React32.createElement(StylesField, { bind: "flex-shrink" }, /* @__PURE__ */ React32.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel11, null, __14("Shrink", "elementor"))), /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(NumberControl2, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React32.createElement(StylesField, { bind: "flex-basis" }, /* @__PURE__ */ React32.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel11, null, __14("Basis", "elementor"))), /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(SizeControl2, null)))));
|
|
1135
1198
|
var getActiveGroup = ({
|
|
1136
1199
|
grow,
|
|
1137
1200
|
shrink,
|
|
@@ -1152,8 +1215,17 @@ var getActiveGroup = ({
|
|
|
1152
1215
|
return "custom";
|
|
1153
1216
|
};
|
|
1154
1217
|
|
|
1218
|
+
// src/components/style-sections/layout-section/gap-control-field.tsx
|
|
1219
|
+
import * as React33 from "react";
|
|
1220
|
+
import { GapControl } from "@elementor/editor-controls";
|
|
1221
|
+
import { Stack as Stack11 } from "@elementor/ui";
|
|
1222
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
1223
|
+
var GapControlField = () => {
|
|
1224
|
+
return /* @__PURE__ */ React33.createElement(Stack11, { gap: 1 }, /* @__PURE__ */ React33.createElement(StylesField, { bind: "gap" }, /* @__PURE__ */ React33.createElement(GapControl, { label: __15("Gaps", "elementor") })));
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1155
1227
|
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
1156
|
-
import * as
|
|
1228
|
+
import * as React34 from "react";
|
|
1157
1229
|
import { ControlLabel as ControlLabel12, ToggleControl as ToggleControl5 } from "@elementor/editor-controls";
|
|
1158
1230
|
import {
|
|
1159
1231
|
JustifyBottomIcon,
|
|
@@ -1163,8 +1235,8 @@ import {
|
|
|
1163
1235
|
JustifySpaceBetweenVerticalIcon as BetweenIcon,
|
|
1164
1236
|
JustifyTopIcon
|
|
1165
1237
|
} from "@elementor/icons";
|
|
1166
|
-
import { DirectionProvider as DirectionProvider6, Stack as
|
|
1167
|
-
import { __ as
|
|
1238
|
+
import { DirectionProvider as DirectionProvider6, Stack as Stack12, ThemeProvider as ThemeProvider6, withDirection as withDirection4 } from "@elementor/ui";
|
|
1239
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
1168
1240
|
var StartIcon3 = withDirection4(JustifyTopIcon);
|
|
1169
1241
|
var EndIcon3 = withDirection4(JustifyBottomIcon);
|
|
1170
1242
|
var iconProps3 = {
|
|
@@ -1174,331 +1246,274 @@ var iconProps3 = {
|
|
|
1174
1246
|
var options4 = [
|
|
1175
1247
|
{
|
|
1176
1248
|
value: "start",
|
|
1177
|
-
label:
|
|
1178
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1249
|
+
label: __16("Start", "elementor"),
|
|
1250
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: StartIcon3, size, ...iconProps3 }),
|
|
1179
1251
|
showTooltip: true
|
|
1180
1252
|
},
|
|
1181
1253
|
{
|
|
1182
1254
|
value: "center",
|
|
1183
|
-
label:
|
|
1184
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1255
|
+
label: __16("Center", "elementor"),
|
|
1256
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: CenterIcon3, size, ...iconProps3 }),
|
|
1185
1257
|
showTooltip: true
|
|
1186
1258
|
},
|
|
1187
1259
|
{
|
|
1188
1260
|
value: "end",
|
|
1189
|
-
label:
|
|
1190
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1261
|
+
label: __16("End", "elementor"),
|
|
1262
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: EndIcon3, size, ...iconProps3 }),
|
|
1191
1263
|
showTooltip: true
|
|
1192
1264
|
},
|
|
1193
1265
|
{
|
|
1194
1266
|
value: "space-between",
|
|
1195
|
-
label:
|
|
1196
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1267
|
+
label: __16("Space between", "elementor"),
|
|
1268
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: BetweenIcon, size, ...iconProps3 }),
|
|
1197
1269
|
showTooltip: true
|
|
1198
1270
|
},
|
|
1199
1271
|
{
|
|
1200
1272
|
value: "space-around",
|
|
1201
|
-
label:
|
|
1202
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1273
|
+
label: __16("Space around", "elementor"),
|
|
1274
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: AroundIcon, size, ...iconProps3 }),
|
|
1203
1275
|
showTooltip: true
|
|
1204
1276
|
},
|
|
1205
1277
|
{
|
|
1206
1278
|
value: "space-evenly",
|
|
1207
|
-
label:
|
|
1208
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1279
|
+
label: __16("Space evenly", "elementor"),
|
|
1280
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: EvenlyIcon, size, ...iconProps3 }),
|
|
1209
1281
|
showTooltip: true
|
|
1210
1282
|
}
|
|
1211
1283
|
];
|
|
1212
1284
|
var JustifyContentField = () => {
|
|
1213
1285
|
const { isSiteRtl } = useDirection();
|
|
1214
|
-
return /* @__PURE__ */
|
|
1286
|
+
return /* @__PURE__ */ React34.createElement(DirectionProvider6, { rtl: isSiteRtl }, /* @__PURE__ */ React34.createElement(ThemeProvider6, null, /* @__PURE__ */ React34.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React34.createElement(Stack12, { gap: 1 }, /* @__PURE__ */ React34.createElement(ControlLabel12, null, __16("Justify content", "elementor")), /* @__PURE__ */ React34.createElement(ToggleControl5, { options: options4, fullWidth: true })))));
|
|
1215
1287
|
};
|
|
1216
1288
|
|
|
1217
1289
|
// src/components/style-sections/layout-section/wrap-field.tsx
|
|
1218
|
-
import * as
|
|
1290
|
+
import * as React35 from "react";
|
|
1219
1291
|
import { ControlLabel as ControlLabel13, ToggleControl as ToggleControl6 } from "@elementor/editor-controls";
|
|
1220
1292
|
import { ArrowBackIcon, ArrowForwardIcon, ArrowRightIcon as ArrowRightIcon2 } from "@elementor/icons";
|
|
1221
1293
|
import { DirectionProvider as DirectionProvider7, Grid as Grid9, ThemeProvider as ThemeProvider7 } from "@elementor/ui";
|
|
1222
|
-
import { __ as
|
|
1294
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
1223
1295
|
var options5 = [
|
|
1224
1296
|
{
|
|
1225
1297
|
value: "nowrap",
|
|
1226
|
-
label:
|
|
1227
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1298
|
+
label: __17("No wrap", "elementor"),
|
|
1299
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(ArrowRightIcon2, { fontSize: size }),
|
|
1228
1300
|
showTooltip: true
|
|
1229
1301
|
},
|
|
1230
1302
|
{
|
|
1231
1303
|
value: "wrap",
|
|
1232
|
-
label:
|
|
1233
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1304
|
+
label: __17("Wrap", "elementor"),
|
|
1305
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(ArrowBackIcon, { fontSize: size }),
|
|
1234
1306
|
showTooltip: true
|
|
1235
1307
|
},
|
|
1236
1308
|
{
|
|
1237
1309
|
value: "wrap-reverse",
|
|
1238
|
-
label:
|
|
1239
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1310
|
+
label: __17("Reversed wrap", "elementor"),
|
|
1311
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(ArrowForwardIcon, { fontSize: size }),
|
|
1240
1312
|
showTooltip: true
|
|
1241
1313
|
}
|
|
1242
1314
|
];
|
|
1243
1315
|
var WrapField = () => {
|
|
1244
1316
|
const { isSiteRtl } = useDirection();
|
|
1245
|
-
return /* @__PURE__ */
|
|
1317
|
+
return /* @__PURE__ */ React35.createElement(DirectionProvider7, { rtl: isSiteRtl }, /* @__PURE__ */ React35.createElement(ThemeProvider7, null, /* @__PURE__ */ React35.createElement(StylesField, { bind: "flex-wrap" }, /* @__PURE__ */ React35.createElement(Grid9, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel13, null, __17("Wrap", "elementor"))), /* @__PURE__ */ React35.createElement(Grid9, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React35.createElement(ToggleControl6, { options: options5 }))))));
|
|
1246
1318
|
};
|
|
1247
1319
|
|
|
1248
1320
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
1249
1321
|
var LayoutSection = () => {
|
|
1250
1322
|
const [display] = useStylesField("display");
|
|
1251
|
-
return /* @__PURE__ */
|
|
1323
|
+
return /* @__PURE__ */ React36.createElement(Stack13, { gap: 2 }, /* @__PURE__ */ React36.createElement(DisplayField, null), "flex" === display?.value && /* @__PURE__ */ React36.createElement(FlexFields, null));
|
|
1252
1324
|
};
|
|
1253
|
-
var FlexFields = () => /* @__PURE__ */
|
|
1325
|
+
var FlexFields = () => /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(FlexDirectionField, null), /* @__PURE__ */ React36.createElement(JustifyContentField, null), /* @__PURE__ */ React36.createElement(AlignItemsField, null), /* @__PURE__ */ React36.createElement(Divider3, null), /* @__PURE__ */ React36.createElement(GapControlField, null), /* @__PURE__ */ React36.createElement(WrapField, null), /* @__PURE__ */ React36.createElement(Divider3, null), /* @__PURE__ */ React36.createElement(ControlLabel14, null, __18("Flex child", "elementor")), /* @__PURE__ */ React36.createElement(AlignSelfChild, null), /* @__PURE__ */ React36.createElement(FlexOrderField, null), /* @__PURE__ */ React36.createElement(FlexSizeField, null));
|
|
1254
1326
|
|
|
1255
1327
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1256
|
-
import * as
|
|
1257
|
-
import {
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
import {
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
var usePropValueHistory = () => {
|
|
1269
|
-
const { element } = useElement();
|
|
1270
|
-
const elementKey = `${PROPS_VALUES_HISTORY_PREFIX}/${element.id}`;
|
|
1271
|
-
const getElementPropsHistory = useCallback(() => {
|
|
1272
|
-
return getSessionStorageItem(elementKey);
|
|
1273
|
-
}, [elementKey]);
|
|
1274
|
-
const getPropValue = useCallback(
|
|
1275
|
-
(propKey) => {
|
|
1276
|
-
const elementPropValues = getElementPropsHistory();
|
|
1277
|
-
return elementPropValues?.[propKey] ?? null;
|
|
1278
|
-
},
|
|
1279
|
-
[getElementPropsHistory]
|
|
1280
|
-
);
|
|
1281
|
-
const setPropValue = useCallback(
|
|
1282
|
-
(propKey, propValue) => {
|
|
1283
|
-
const elementPropValues = getElementPropsHistory();
|
|
1284
|
-
const updatedElementPropValues = { ...elementPropValues, [propKey]: propValue };
|
|
1285
|
-
setSessionStorageItem(elementKey, updatedElementPropValues);
|
|
1286
|
-
},
|
|
1287
|
-
[getElementPropsHistory, elementKey]
|
|
1288
|
-
);
|
|
1289
|
-
const removeProp = useCallback(
|
|
1290
|
-
(propKey) => {
|
|
1291
|
-
const elementPropValues = getElementPropsHistory();
|
|
1292
|
-
const updatedElementPropValues = Object.fromEntries(
|
|
1293
|
-
Object.entries(elementPropValues || {}).filter(([key]) => key !== propKey)
|
|
1294
|
-
);
|
|
1295
|
-
setSessionStorageItem(elementKey, updatedElementPropValues);
|
|
1296
|
-
},
|
|
1297
|
-
[getElementPropsHistory, elementKey]
|
|
1298
|
-
);
|
|
1299
|
-
return useMemo2(() => ({ getPropValue, setPropValue, removeProp }), [getPropValue, removeProp, setPropValue]);
|
|
1300
|
-
};
|
|
1301
|
-
|
|
1302
|
-
// src/hooks/use-style-prop-history.ts
|
|
1303
|
-
var useStylePropsHistory = (props) => {
|
|
1304
|
-
const { element } = useElement();
|
|
1305
|
-
const { id: styleDefID, meta } = useStyle();
|
|
1306
|
-
const { getPropValue, setPropValue, removeProp } = usePropValueHistory();
|
|
1307
|
-
const styleDef = getElementStyles(element.id)?.[styleDefID];
|
|
1308
|
-
const styleVariant = styleDef ? getVariantByMeta(styleDef, meta) : null;
|
|
1309
|
-
const styleVariantPath = `${styleDefID}-${styleVariant?.meta.breakpoint}-${styleVariant?.meta.state}`;
|
|
1310
|
-
const saveStylePropsHistory = useCallback2(() => {
|
|
1311
|
-
props.forEach((propKey) => {
|
|
1312
|
-
const propValue = styleVariant?.props[propKey];
|
|
1313
|
-
if (propValue) {
|
|
1314
|
-
const propPath = `${styleVariantPath}-${propKey}`;
|
|
1315
|
-
setPropValue(propPath, propValue);
|
|
1316
|
-
}
|
|
1328
|
+
import * as React40 from "react";
|
|
1329
|
+
import { Stack as Stack15 } from "@elementor/ui";
|
|
1330
|
+
|
|
1331
|
+
// src/hooks/use-session-storage.ts
|
|
1332
|
+
import { useEffect as useEffect2, useState as useState5 } from "react";
|
|
1333
|
+
import { getSessionStorageItem, removeSessionStorageItem, setSessionStorageItem } from "@elementor/utils";
|
|
1334
|
+
var useSessionStorage = (key) => {
|
|
1335
|
+
const prefixedKey = `elementor/${key}`;
|
|
1336
|
+
const [value, setValue] = useState5();
|
|
1337
|
+
useEffect2(() => {
|
|
1338
|
+
return subscribeToSessionStorage(prefixedKey, (newValue) => {
|
|
1339
|
+
setValue(newValue ?? null);
|
|
1317
1340
|
});
|
|
1318
|
-
}, [
|
|
1319
|
-
const
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1341
|
+
}, [prefixedKey]);
|
|
1342
|
+
const saveValue = (newValue) => {
|
|
1343
|
+
setSessionStorageItem(prefixedKey, newValue);
|
|
1344
|
+
};
|
|
1345
|
+
const removeValue = () => {
|
|
1346
|
+
removeSessionStorageItem(prefixedKey);
|
|
1347
|
+
};
|
|
1348
|
+
return [value, saveValue, removeValue];
|
|
1349
|
+
};
|
|
1350
|
+
var subscribeToSessionStorage = (key, subscriber) => {
|
|
1351
|
+
subscriber(getSessionStorageItem(key));
|
|
1352
|
+
const abortController = new AbortController();
|
|
1353
|
+
window.addEventListener(
|
|
1354
|
+
"storage",
|
|
1355
|
+
(e) => {
|
|
1356
|
+
if (e.key !== key || e.storageArea !== sessionStorage) {
|
|
1357
|
+
return;
|
|
1326
1358
|
}
|
|
1327
|
-
|
|
1328
|
-
},
|
|
1329
|
-
|
|
1330
|
-
updateStyle2({
|
|
1331
|
-
elementID: element.id,
|
|
1332
|
-
styleDefID,
|
|
1333
|
-
meta,
|
|
1334
|
-
props: propValuesFromHistory,
|
|
1335
|
-
bind: "classes"
|
|
1336
|
-
});
|
|
1337
|
-
}
|
|
1338
|
-
}, [element.id, getPropValue, meta, props, removeProp, styleDefID, styleVariantPath]);
|
|
1339
|
-
const clearCurrentStyleProps = useCallback2(() => {
|
|
1340
|
-
const resetValues = props.reduce(
|
|
1341
|
-
(allProps, currentPropKey) => ({
|
|
1342
|
-
...allProps,
|
|
1343
|
-
[currentPropKey]: void 0
|
|
1344
|
-
}),
|
|
1345
|
-
{}
|
|
1346
|
-
);
|
|
1347
|
-
updateStyle2({
|
|
1348
|
-
elementID: element.id,
|
|
1349
|
-
styleDefID,
|
|
1350
|
-
meta,
|
|
1351
|
-
props: resetValues,
|
|
1352
|
-
bind: "classes"
|
|
1353
|
-
});
|
|
1354
|
-
}, [element.id, meta, props, styleDefID]);
|
|
1355
|
-
return useMemo3(
|
|
1356
|
-
() => ({ saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps }),
|
|
1357
|
-
[saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps]
|
|
1359
|
+
subscriber(getSessionStorageItem(key));
|
|
1360
|
+
},
|
|
1361
|
+
{ signal: abortController.signal }
|
|
1358
1362
|
);
|
|
1363
|
+
return () => {
|
|
1364
|
+
abortController.abort();
|
|
1365
|
+
};
|
|
1359
1366
|
};
|
|
1360
1367
|
|
|
1361
1368
|
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
1362
|
-
import * as
|
|
1369
|
+
import * as React37 from "react";
|
|
1363
1370
|
import { ControlLabel as ControlLabel15, SizeControl as SizeControl3 } from "@elementor/editor-controls";
|
|
1364
1371
|
import { SideBottomIcon as SideBottomIcon2, SideLeftIcon as SideLeftIcon2, SideRightIcon as SideRightIcon2, SideTopIcon as SideTopIcon2 } from "@elementor/icons";
|
|
1365
|
-
import { Grid as Grid10, Stack as
|
|
1366
|
-
import { __ as
|
|
1372
|
+
import { Grid as Grid10, Stack as Stack14 } from "@elementor/ui";
|
|
1373
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
1367
1374
|
var sideIcons = {
|
|
1368
|
-
left: /* @__PURE__ */
|
|
1369
|
-
right: /* @__PURE__ */
|
|
1370
|
-
top: /* @__PURE__ */
|
|
1371
|
-
bottom: /* @__PURE__ */
|
|
1375
|
+
left: /* @__PURE__ */ React37.createElement(SideLeftIcon2, { fontSize: "tiny" }),
|
|
1376
|
+
right: /* @__PURE__ */ React37.createElement(SideRightIcon2, { fontSize: "tiny" }),
|
|
1377
|
+
top: /* @__PURE__ */ React37.createElement(SideTopIcon2, { fontSize: "tiny" }),
|
|
1378
|
+
bottom: /* @__PURE__ */ React37.createElement(SideBottomIcon2, { fontSize: "tiny" })
|
|
1372
1379
|
};
|
|
1373
1380
|
var DimensionsField = () => {
|
|
1374
|
-
return /* @__PURE__ */
|
|
1381
|
+
return /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(Stack14, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(DimensionField, { side: "top", label: __19("Top", "elementor") }), /* @__PURE__ */ React37.createElement(DimensionField, { side: "right", label: __19("Right", "elementor") })), /* @__PURE__ */ React37.createElement(Stack14, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(DimensionField, { side: "bottom", label: __19("Bottom", "elementor") }), /* @__PURE__ */ React37.createElement(DimensionField, { side: "left", label: __19("Left", "elementor") })));
|
|
1375
1382
|
};
|
|
1376
1383
|
var DimensionField = ({ side, label }) => {
|
|
1377
|
-
return /* @__PURE__ */
|
|
1384
|
+
return /* @__PURE__ */ React37.createElement(Grid10, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React37.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(ControlLabel15, null, label)), /* @__PURE__ */ React37.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(StylesField, { bind: side }, /* @__PURE__ */ React37.createElement(SizeControl3, { startIcon: sideIcons[side] }))));
|
|
1378
1385
|
};
|
|
1379
1386
|
|
|
1380
1387
|
// src/components/style-sections/position-section/position-field.tsx
|
|
1381
|
-
import * as
|
|
1388
|
+
import * as React38 from "react";
|
|
1382
1389
|
import { ControlLabel as ControlLabel16, SelectControl as SelectControl3 } from "@elementor/editor-controls";
|
|
1383
1390
|
import { Grid as Grid11 } from "@elementor/ui";
|
|
1384
|
-
import { __ as
|
|
1391
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
1385
1392
|
var positionOptions = [
|
|
1386
|
-
{ label:
|
|
1387
|
-
{ label:
|
|
1388
|
-
{ label:
|
|
1389
|
-
{ label:
|
|
1393
|
+
{ label: __20("Static", "elementor"), value: "static" },
|
|
1394
|
+
{ label: __20("Relative", "elementor"), value: "relative" },
|
|
1395
|
+
{ label: __20("Absolute", "elementor"), value: "absolute" },
|
|
1396
|
+
{ label: __20("Fixed", "elementor"), value: "fixed" }
|
|
1390
1397
|
];
|
|
1391
|
-
var PositionField = () => {
|
|
1392
|
-
return /* @__PURE__ */
|
|
1398
|
+
var PositionField = ({ onChange }) => {
|
|
1399
|
+
return /* @__PURE__ */ React38.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React38.createElement(Grid11, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React38.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(ControlLabel16, null, __20("Position", "elementor"))), /* @__PURE__ */ React38.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(SelectControl3, { options: positionOptions, onChange }))));
|
|
1393
1400
|
};
|
|
1394
1401
|
|
|
1395
1402
|
// src/components/style-sections/position-section/z-index-field.tsx
|
|
1396
|
-
import * as
|
|
1403
|
+
import * as React39 from "react";
|
|
1397
1404
|
import { ControlLabel as ControlLabel17, NumberControl as NumberControl3 } from "@elementor/editor-controls";
|
|
1398
1405
|
import { Grid as Grid12 } from "@elementor/ui";
|
|
1399
|
-
import { __ as
|
|
1406
|
+
import { __ as __21 } from "@wordpress/i18n";
|
|
1400
1407
|
var ZIndexField = () => {
|
|
1401
|
-
return /* @__PURE__ */
|
|
1408
|
+
return /* @__PURE__ */ React39.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React39.createElement(Grid12, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel17, null, __21("Z-Index", "elementor"))), /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(NumberControl3, null))));
|
|
1402
1409
|
};
|
|
1403
1410
|
|
|
1404
1411
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1405
|
-
var dimensionsPropKeys = ["top", "bottom", "left", "right"];
|
|
1406
1412
|
var PositionSection = () => {
|
|
1407
1413
|
const [positionValue] = useStylesField("position");
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
const
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1414
|
+
const [dimensionsValues, setDimensionsValues] = useStylesFields([
|
|
1415
|
+
"top",
|
|
1416
|
+
"bottom",
|
|
1417
|
+
"left",
|
|
1418
|
+
"right"
|
|
1419
|
+
]);
|
|
1420
|
+
const [dimensionsValuesFromHistory, updateDimensionsHistory, clearDimensionsHistory] = usePersistDimensions();
|
|
1421
|
+
const onPositionChange = (newPosition, previousPosition) => {
|
|
1422
|
+
if (newPosition === "static") {
|
|
1423
|
+
if (dimensionsValues) {
|
|
1424
|
+
updateDimensionsHistory(dimensionsValues);
|
|
1425
|
+
setDimensionsValues({
|
|
1426
|
+
top: void 0,
|
|
1427
|
+
bottom: void 0,
|
|
1428
|
+
left: void 0,
|
|
1429
|
+
right: void 0
|
|
1430
|
+
});
|
|
1418
1431
|
}
|
|
1419
|
-
|
|
1420
|
-
if (
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
} else if (previousPosition === "static") {
|
|
1424
|
-
updateStylePropsFromHistory();
|
|
1432
|
+
} else if (previousPosition === "static") {
|
|
1433
|
+
if (dimensionsValuesFromHistory) {
|
|
1434
|
+
setDimensionsValues(dimensionsValuesFromHistory);
|
|
1435
|
+
clearDimensionsHistory();
|
|
1425
1436
|
}
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
);
|
|
1430
|
-
|
|
1431
|
-
|
|
1437
|
+
}
|
|
1438
|
+
};
|
|
1439
|
+
const isNotStatic = positionValue && positionValue?.value !== "static";
|
|
1440
|
+
return /* @__PURE__ */ React40.createElement(Stack15, { gap: 1.5 }, /* @__PURE__ */ React40.createElement(PositionField, { onChange: onPositionChange }), isNotStatic ? /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(DimensionsField, null), /* @__PURE__ */ React40.createElement(ZIndexField, null)) : null);
|
|
1441
|
+
};
|
|
1442
|
+
var usePersistDimensions = () => {
|
|
1443
|
+
const { id: styleDefID, meta } = useStyle();
|
|
1444
|
+
const styleVariantPath = `styles/${styleDefID}/${meta.breakpoint || "desktop"}/${meta.state || "null"}`;
|
|
1445
|
+
const dimensionsPath = `${styleVariantPath}/dimensions`;
|
|
1446
|
+
return useSessionStorage(dimensionsPath);
|
|
1432
1447
|
};
|
|
1433
1448
|
|
|
1434
1449
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1435
|
-
import * as
|
|
1450
|
+
import * as React42 from "react";
|
|
1436
1451
|
import { ControlLabel as ControlLabel19, SizeControl as SizeControl4 } from "@elementor/editor-controls";
|
|
1437
|
-
import { Divider as Divider4, Grid as Grid14, Stack as
|
|
1438
|
-
import { __ as
|
|
1452
|
+
import { Divider as Divider4, Grid as Grid14, Stack as Stack16 } from "@elementor/ui";
|
|
1453
|
+
import { __ as __23 } from "@wordpress/i18n";
|
|
1439
1454
|
|
|
1440
1455
|
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1441
|
-
import * as
|
|
1456
|
+
import * as React41 from "react";
|
|
1442
1457
|
import { ControlLabel as ControlLabel18, ToggleControl as ToggleControl7 } from "@elementor/editor-controls";
|
|
1443
1458
|
import { ExpandBottomIcon, EyeIcon, EyeOffIcon } from "@elementor/icons";
|
|
1444
1459
|
import { Grid as Grid13 } from "@elementor/ui";
|
|
1445
|
-
import { __ as
|
|
1460
|
+
import { __ as __22 } from "@wordpress/i18n";
|
|
1446
1461
|
var options6 = [
|
|
1447
1462
|
{
|
|
1448
1463
|
value: "visible",
|
|
1449
|
-
label:
|
|
1450
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1464
|
+
label: __22("Visible", "elementor"),
|
|
1465
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(EyeIcon, { fontSize: size }),
|
|
1451
1466
|
showTooltip: true
|
|
1452
1467
|
},
|
|
1453
1468
|
{
|
|
1454
1469
|
value: "hidden",
|
|
1455
|
-
label:
|
|
1456
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1470
|
+
label: __22("Hidden", "elementor"),
|
|
1471
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(EyeOffIcon, { fontSize: size }),
|
|
1457
1472
|
showTooltip: true
|
|
1458
1473
|
},
|
|
1459
1474
|
{
|
|
1460
1475
|
value: "auto",
|
|
1461
|
-
label:
|
|
1462
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1476
|
+
label: __22("Auto", "elementor"),
|
|
1477
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(ExpandBottomIcon, { fontSize: size }),
|
|
1463
1478
|
showTooltip: true
|
|
1464
1479
|
}
|
|
1465
1480
|
];
|
|
1466
1481
|
var OverflowField = () => {
|
|
1467
|
-
return /* @__PURE__ */
|
|
1482
|
+
return /* @__PURE__ */ React41.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React41.createElement(Grid13, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlLabel18, null, __22("Overflow", "elementor"))), /* @__PURE__ */ React41.createElement(Grid13, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React41.createElement(ToggleControl7, { options: options6 }))));
|
|
1468
1483
|
};
|
|
1469
1484
|
|
|
1470
1485
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1471
1486
|
var SizeSection = () => {
|
|
1472
|
-
return /* @__PURE__ */
|
|
1487
|
+
return /* @__PURE__ */ React42.createElement(Stack16, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(Grid14, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "width", label: __23("Width", "elementor") })), /* @__PURE__ */ React42.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "height", label: __23("Height", "elementor") }))), /* @__PURE__ */ React42.createElement(Grid14, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "min-width", label: __23("Min. Width", "elementor") })), /* @__PURE__ */ React42.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "min-height", label: __23("Min. Height", "elementor") }))), /* @__PURE__ */ React42.createElement(Grid14, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "max-width", label: __23("Max. Width", "elementor") })), /* @__PURE__ */ React42.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "max-height", label: __23("Max. Height", "elementor") }))), /* @__PURE__ */ React42.createElement(Divider4, null), /* @__PURE__ */ React42.createElement(Stack16, null, /* @__PURE__ */ React42.createElement(OverflowField, null)));
|
|
1473
1488
|
};
|
|
1474
1489
|
var SizeField = ({ label, bind }) => {
|
|
1475
|
-
return /* @__PURE__ */
|
|
1490
|
+
return /* @__PURE__ */ React42.createElement(StylesField, { bind }, /* @__PURE__ */ React42.createElement(Grid14, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React42.createElement(Grid14, { item: true, xs: 12 }, /* @__PURE__ */ React42.createElement(ControlLabel19, null, label)), /* @__PURE__ */ React42.createElement(Grid14, { item: true, xs: 12 }, /* @__PURE__ */ React42.createElement(SizeControl4, null))));
|
|
1476
1491
|
};
|
|
1477
1492
|
|
|
1478
1493
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1479
|
-
import * as
|
|
1494
|
+
import * as React43 from "react";
|
|
1480
1495
|
import { LinkedDimensionsControl } from "@elementor/editor-controls";
|
|
1481
|
-
import { Divider as Divider5, Stack as
|
|
1482
|
-
import { __ as
|
|
1496
|
+
import { Divider as Divider5, Stack as Stack17 } from "@elementor/ui";
|
|
1497
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
1483
1498
|
var SpacingSection = () => {
|
|
1484
|
-
return /* @__PURE__ */
|
|
1499
|
+
return /* @__PURE__ */ React43.createElement(Stack17, { gap: 1.5 }, /* @__PURE__ */ React43.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React43.createElement(LinkedDimensionsControl, { label: __24("Padding", "elementor") })), /* @__PURE__ */ React43.createElement(Divider5, null), /* @__PURE__ */ React43.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React43.createElement(LinkedDimensionsControl, { label: __24("Margin", "elementor") })));
|
|
1485
1500
|
};
|
|
1486
1501
|
|
|
1487
1502
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1488
|
-
import * as
|
|
1489
|
-
import { Divider as Divider6, Stack as
|
|
1503
|
+
import * as React57 from "react";
|
|
1504
|
+
import { Divider as Divider6, Stack as Stack19 } from "@elementor/ui";
|
|
1490
1505
|
|
|
1491
1506
|
// src/components/collapsible-content.tsx
|
|
1492
|
-
import * as
|
|
1493
|
-
import { useState as
|
|
1494
|
-
import { Button, Collapse as Collapse3, Stack as
|
|
1495
|
-
import { __ as
|
|
1507
|
+
import * as React44 from "react";
|
|
1508
|
+
import { useState as useState6 } from "react";
|
|
1509
|
+
import { Button, Collapse as Collapse3, Stack as Stack18 } from "@elementor/ui";
|
|
1510
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
1496
1511
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
1497
|
-
const [open, setOpen] =
|
|
1512
|
+
const [open, setOpen] = useState6(defaultOpen);
|
|
1498
1513
|
const handleToggle = () => {
|
|
1499
1514
|
setOpen((prevOpen) => !prevOpen);
|
|
1500
1515
|
};
|
|
1501
|
-
return /* @__PURE__ */
|
|
1516
|
+
return /* @__PURE__ */ React44.createElement(Stack18, { sx: { py: 0.5 } }, /* @__PURE__ */ React44.createElement(
|
|
1502
1517
|
Button,
|
|
1503
1518
|
{
|
|
1504
1519
|
fullWidth: true,
|
|
@@ -1506,17 +1521,17 @@ var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
|
1506
1521
|
color: "secondary",
|
|
1507
1522
|
variant: "outlined",
|
|
1508
1523
|
onClick: handleToggle,
|
|
1509
|
-
endIcon: /* @__PURE__ */
|
|
1524
|
+
endIcon: /* @__PURE__ */ React44.createElement(CollapseIcon, { open })
|
|
1510
1525
|
},
|
|
1511
|
-
open ?
|
|
1512
|
-
), /* @__PURE__ */
|
|
1526
|
+
open ? __25("Show less", "elementor") : __25("Show more", "elementor")
|
|
1527
|
+
), /* @__PURE__ */ React44.createElement(Collapse3, { in: open, timeout: "auto", unmountOnExit: true }, children));
|
|
1513
1528
|
};
|
|
1514
1529
|
|
|
1515
1530
|
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1516
|
-
import * as
|
|
1531
|
+
import * as React45 from "react";
|
|
1517
1532
|
import { ControlLabel as ControlLabel20, FontFamilyControl } from "@elementor/editor-controls";
|
|
1518
1533
|
import { Grid as Grid15 } from "@elementor/ui";
|
|
1519
|
-
import { __ as
|
|
1534
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
1520
1535
|
|
|
1521
1536
|
// src/sync/get-elementor-config.ts
|
|
1522
1537
|
var getElementorConfig = () => {
|
|
@@ -1530,7 +1545,7 @@ var FontFamilyField = () => {
|
|
|
1530
1545
|
if (!fontFamilies) {
|
|
1531
1546
|
return null;
|
|
1532
1547
|
}
|
|
1533
|
-
return /* @__PURE__ */
|
|
1548
|
+
return /* @__PURE__ */ React45.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React45.createElement(Grid15, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(ControlLabel20, null, __26("Font Family", "elementor"))), /* @__PURE__ */ React45.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(FontFamilyControl, { fontFamilies }))));
|
|
1534
1549
|
};
|
|
1535
1550
|
var getFontFamilies = () => {
|
|
1536
1551
|
const { controls } = getElementorConfig();
|
|
@@ -1542,115 +1557,115 @@ var getFontFamilies = () => {
|
|
|
1542
1557
|
};
|
|
1543
1558
|
|
|
1544
1559
|
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1545
|
-
import * as
|
|
1560
|
+
import * as React46 from "react";
|
|
1546
1561
|
import { ControlLabel as ControlLabel21, SizeControl as SizeControl5 } from "@elementor/editor-controls";
|
|
1547
1562
|
import { Grid as Grid16 } from "@elementor/ui";
|
|
1548
|
-
import { __ as
|
|
1563
|
+
import { __ as __27 } from "@wordpress/i18n";
|
|
1549
1564
|
var FontSizeField = () => {
|
|
1550
|
-
return /* @__PURE__ */
|
|
1565
|
+
return /* @__PURE__ */ React46.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React46.createElement(Grid16, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlLabel21, null, __27("Font Size", "elementor"))), /* @__PURE__ */ React46.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(SizeControl5, null))));
|
|
1551
1566
|
};
|
|
1552
1567
|
|
|
1553
1568
|
// src/components/style-sections/typography-section/font-weight-field.tsx
|
|
1554
|
-
import * as
|
|
1569
|
+
import * as React47 from "react";
|
|
1555
1570
|
import { ControlLabel as ControlLabel22, SelectControl as SelectControl4 } from "@elementor/editor-controls";
|
|
1556
1571
|
import { Grid as Grid17 } from "@elementor/ui";
|
|
1557
|
-
import { __ as
|
|
1572
|
+
import { __ as __28 } from "@wordpress/i18n";
|
|
1558
1573
|
var fontWeightOptions = [
|
|
1559
|
-
{ label:
|
|
1560
|
-
{ label:
|
|
1561
|
-
{ label:
|
|
1562
|
-
{ label:
|
|
1563
|
-
{ label:
|
|
1574
|
+
{ label: __28("Light - 400", "elementor"), value: "400" },
|
|
1575
|
+
{ label: __28("Regular - 500", "elementor"), value: "500" },
|
|
1576
|
+
{ label: __28("Semi Bold - 600", "elementor"), value: "600" },
|
|
1577
|
+
{ label: __28("Bold - 700", "elementor"), value: "700" },
|
|
1578
|
+
{ label: __28("Black - 900", "elementor"), value: "900" }
|
|
1564
1579
|
];
|
|
1565
1580
|
var FontWeightField = () => {
|
|
1566
|
-
return /* @__PURE__ */
|
|
1581
|
+
return /* @__PURE__ */ React47.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React47.createElement(Grid17, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React47.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(ControlLabel22, null, __28("Font Weight", "elementor"))), /* @__PURE__ */ React47.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(SelectControl4, { options: fontWeightOptions }))));
|
|
1567
1582
|
};
|
|
1568
1583
|
|
|
1569
1584
|
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
1570
|
-
import * as
|
|
1585
|
+
import * as React48 from "react";
|
|
1571
1586
|
import { ControlLabel as ControlLabel23, SizeControl as SizeControl6 } from "@elementor/editor-controls";
|
|
1572
1587
|
import { Grid as Grid18 } from "@elementor/ui";
|
|
1573
|
-
import { __ as
|
|
1588
|
+
import { __ as __29 } from "@wordpress/i18n";
|
|
1574
1589
|
var LetterSpacingField = () => {
|
|
1575
|
-
return /* @__PURE__ */
|
|
1590
|
+
return /* @__PURE__ */ React48.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React48.createElement(Grid18, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React48.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(ControlLabel23, null, __29("Letter Spacing", "elementor"))), /* @__PURE__ */ React48.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(SizeControl6, null))));
|
|
1576
1591
|
};
|
|
1577
1592
|
|
|
1578
1593
|
// src/components/style-sections/typography-section/line-height-field.tsx
|
|
1579
|
-
import * as
|
|
1594
|
+
import * as React49 from "react";
|
|
1580
1595
|
import { ControlLabel as ControlLabel24, SizeControl as SizeControl7 } from "@elementor/editor-controls";
|
|
1581
1596
|
import { Grid as Grid19 } from "@elementor/ui";
|
|
1582
|
-
import { __ as
|
|
1597
|
+
import { __ as __30 } from "@wordpress/i18n";
|
|
1583
1598
|
var LineHeightField = () => {
|
|
1584
|
-
return /* @__PURE__ */
|
|
1599
|
+
return /* @__PURE__ */ React49.createElement(StylesField, { bind: "line-height" }, /* @__PURE__ */ React49.createElement(Grid19, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React49.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(ControlLabel24, null, __30("Line Height", "elementor"))), /* @__PURE__ */ React49.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(SizeControl7, null))));
|
|
1585
1600
|
};
|
|
1586
1601
|
|
|
1587
1602
|
// src/components/style-sections/typography-section/text-alignment-field.tsx
|
|
1588
|
-
import * as
|
|
1603
|
+
import * as React50 from "react";
|
|
1589
1604
|
import { ControlLabel as ControlLabel25, ToggleControl as ToggleControl8 } from "@elementor/editor-controls";
|
|
1590
1605
|
import { AlignCenterIcon, AlignJustifiedIcon, AlignLeftIcon, AlignRightIcon } from "@elementor/icons";
|
|
1591
1606
|
import { Grid as Grid20 } from "@elementor/ui";
|
|
1592
|
-
import { __ as
|
|
1607
|
+
import { __ as __31 } from "@wordpress/i18n";
|
|
1593
1608
|
var options7 = [
|
|
1594
1609
|
{
|
|
1595
1610
|
value: "left",
|
|
1596
|
-
label:
|
|
1597
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1611
|
+
label: __31("Left", "elementor"),
|
|
1612
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(AlignLeftIcon, { fontSize: size })
|
|
1598
1613
|
},
|
|
1599
1614
|
{
|
|
1600
1615
|
value: "center",
|
|
1601
|
-
label:
|
|
1602
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1616
|
+
label: __31("Center", "elementor"),
|
|
1617
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(AlignCenterIcon, { fontSize: size })
|
|
1603
1618
|
},
|
|
1604
1619
|
{
|
|
1605
1620
|
value: "right",
|
|
1606
|
-
label:
|
|
1607
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1621
|
+
label: __31("Right", "elementor"),
|
|
1622
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(AlignRightIcon, { fontSize: size })
|
|
1608
1623
|
},
|
|
1609
1624
|
{
|
|
1610
1625
|
value: "justify",
|
|
1611
|
-
label:
|
|
1612
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1626
|
+
label: __31("Justify", "elementor"),
|
|
1627
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(AlignJustifiedIcon, { fontSize: size })
|
|
1613
1628
|
}
|
|
1614
1629
|
];
|
|
1615
1630
|
var TextAlignmentField = () => {
|
|
1616
|
-
return /* @__PURE__ */
|
|
1631
|
+
return /* @__PURE__ */ React50.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React50.createElement(Grid20, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React50.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(ControlLabel25, null, __31("Alignment", "elementor"))), /* @__PURE__ */ React50.createElement(Grid20, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React50.createElement(ToggleControl8, { options: options7 }))));
|
|
1617
1632
|
};
|
|
1618
1633
|
|
|
1619
1634
|
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
1620
|
-
import * as
|
|
1635
|
+
import * as React51 from "react";
|
|
1621
1636
|
import { ColorControl as ColorControl3, ControlLabel as ControlLabel26 } from "@elementor/editor-controls";
|
|
1622
1637
|
import { Grid as Grid21 } from "@elementor/ui";
|
|
1623
|
-
import { __ as
|
|
1638
|
+
import { __ as __32 } from "@wordpress/i18n";
|
|
1624
1639
|
var TextColorField = () => {
|
|
1625
|
-
return /* @__PURE__ */
|
|
1640
|
+
return /* @__PURE__ */ React51.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React51.createElement(Grid21, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React51.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(ControlLabel26, null, __32("Text Color", "elementor"))), /* @__PURE__ */ React51.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(ColorControl3, null))));
|
|
1626
1641
|
};
|
|
1627
1642
|
|
|
1628
1643
|
// src/components/style-sections/typography-section/text-direction-field.tsx
|
|
1629
|
-
import * as
|
|
1644
|
+
import * as React52 from "react";
|
|
1630
1645
|
import { ControlLabel as ControlLabel27, ToggleControl as ToggleControl9 } from "@elementor/editor-controls";
|
|
1631
1646
|
import { TextDirectionLtrIcon, TextDirectionRtlIcon } from "@elementor/icons";
|
|
1632
1647
|
import { Grid as Grid22 } from "@elementor/ui";
|
|
1633
|
-
import { __ as
|
|
1648
|
+
import { __ as __33 } from "@wordpress/i18n";
|
|
1634
1649
|
var options8 = [
|
|
1635
1650
|
{
|
|
1636
1651
|
value: "ltr",
|
|
1637
|
-
label:
|
|
1638
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1652
|
+
label: __33("Left to Right", "elementor"),
|
|
1653
|
+
renderContent: ({ size }) => /* @__PURE__ */ React52.createElement(TextDirectionLtrIcon, { fontSize: size })
|
|
1639
1654
|
},
|
|
1640
1655
|
{
|
|
1641
1656
|
value: "rtl",
|
|
1642
|
-
label:
|
|
1643
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1657
|
+
label: __33("Right to Left", "elementor"),
|
|
1658
|
+
renderContent: ({ size }) => /* @__PURE__ */ React52.createElement(TextDirectionRtlIcon, { fontSize: size })
|
|
1644
1659
|
}
|
|
1645
1660
|
];
|
|
1646
1661
|
var TextDirectionField = () => {
|
|
1647
|
-
return /* @__PURE__ */
|
|
1662
|
+
return /* @__PURE__ */ React52.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React52.createElement(Grid22, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React52.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(ControlLabel27, null, __33("Direction", "elementor"))), /* @__PURE__ */ React52.createElement(Grid22, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React52.createElement(ToggleControl9, { options: options8 }))));
|
|
1648
1663
|
};
|
|
1649
1664
|
|
|
1650
1665
|
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1651
|
-
import * as
|
|
1666
|
+
import * as React53 from "react";
|
|
1652
1667
|
import { StrokeControl } from "@elementor/editor-controls";
|
|
1653
|
-
import { __ as
|
|
1668
|
+
import { __ as __34 } from "@wordpress/i18n";
|
|
1654
1669
|
var initTextStroke = {
|
|
1655
1670
|
$$type: "stroke",
|
|
1656
1671
|
value: {
|
|
@@ -1676,24 +1691,24 @@ var TextStrokeField = () => {
|
|
|
1676
1691
|
setTextStroke(null);
|
|
1677
1692
|
};
|
|
1678
1693
|
const hasTextStroke = Boolean(textStroke);
|
|
1679
|
-
return /* @__PURE__ */
|
|
1694
|
+
return /* @__PURE__ */ React53.createElement(
|
|
1680
1695
|
AddOrRemoveContent,
|
|
1681
1696
|
{
|
|
1682
|
-
label:
|
|
1697
|
+
label: __34("Text Stroke", "elementor"),
|
|
1683
1698
|
isAdded: hasTextStroke,
|
|
1684
1699
|
onAdd: addTextStroke,
|
|
1685
1700
|
onRemove: removeTextStroke
|
|
1686
1701
|
},
|
|
1687
|
-
/* @__PURE__ */
|
|
1702
|
+
/* @__PURE__ */ React53.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React53.createElement(StrokeControl, null))
|
|
1688
1703
|
);
|
|
1689
1704
|
};
|
|
1690
1705
|
|
|
1691
1706
|
// src/components/style-sections/typography-section/text-style-field.tsx
|
|
1692
|
-
import * as
|
|
1707
|
+
import * as React54 from "react";
|
|
1693
1708
|
import { ControlLabel as ControlLabel28 } from "@elementor/editor-controls";
|
|
1694
1709
|
import { ItalicIcon, StrikethroughIcon, UnderlineIcon } from "@elementor/icons";
|
|
1695
1710
|
import { Grid as Grid23, ToggleButton as ToggleButtonBase, ToggleButtonGroup } from "@elementor/ui";
|
|
1696
|
-
import { __ as
|
|
1711
|
+
import { __ as __35 } from "@wordpress/i18n";
|
|
1697
1712
|
var buttonSize = "tiny";
|
|
1698
1713
|
var TextStyleField = () => {
|
|
1699
1714
|
const [fontStyle, setFontStyle] = useStylesField("font-style");
|
|
@@ -1717,7 +1732,7 @@ var TextStyleField = () => {
|
|
|
1717
1732
|
value: newValue
|
|
1718
1733
|
});
|
|
1719
1734
|
};
|
|
1720
|
-
return /* @__PURE__ */
|
|
1735
|
+
return /* @__PURE__ */ React54.createElement(Grid23, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(Grid23, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(ControlLabel28, null, __35("Style", "elementor"))), /* @__PURE__ */ React54.createElement(Grid23, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React54.createElement(ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React54.createElement(
|
|
1721
1736
|
ToggleButton,
|
|
1722
1737
|
{
|
|
1723
1738
|
value: "italic",
|
|
@@ -1725,8 +1740,8 @@ var TextStyleField = () => {
|
|
|
1725
1740
|
"aria-label": "italic",
|
|
1726
1741
|
sx: { marginLeft: "auto" }
|
|
1727
1742
|
},
|
|
1728
|
-
/* @__PURE__ */
|
|
1729
|
-
), /* @__PURE__ */
|
|
1743
|
+
/* @__PURE__ */ React54.createElement(ItalicIcon, { fontSize: buttonSize })
|
|
1744
|
+
), /* @__PURE__ */ React54.createElement(
|
|
1730
1745
|
ShorthandControl,
|
|
1731
1746
|
{
|
|
1732
1747
|
value: "line-through",
|
|
@@ -1734,8 +1749,8 @@ var TextStyleField = () => {
|
|
|
1734
1749
|
updateValues: handleSetTextDecoration,
|
|
1735
1750
|
"aria-label": "line-through"
|
|
1736
1751
|
},
|
|
1737
|
-
/* @__PURE__ */
|
|
1738
|
-
), /* @__PURE__ */
|
|
1752
|
+
/* @__PURE__ */ React54.createElement(StrikethroughIcon, { fontSize: buttonSize })
|
|
1753
|
+
), /* @__PURE__ */ React54.createElement(
|
|
1739
1754
|
ShorthandControl,
|
|
1740
1755
|
{
|
|
1741
1756
|
value: "underline",
|
|
@@ -1743,7 +1758,7 @@ var TextStyleField = () => {
|
|
|
1743
1758
|
updateValues: handleSetTextDecoration,
|
|
1744
1759
|
"aria-label": "underline"
|
|
1745
1760
|
},
|
|
1746
|
-
/* @__PURE__ */
|
|
1761
|
+
/* @__PURE__ */ React54.createElement(UnderlineIcon, { fontSize: buttonSize })
|
|
1747
1762
|
))));
|
|
1748
1763
|
};
|
|
1749
1764
|
var ShorthandControl = ({
|
|
@@ -1762,52 +1777,52 @@ var ShorthandControl = ({
|
|
|
1762
1777
|
updateValues([...valuesArr, newValue].join(" "));
|
|
1763
1778
|
}
|
|
1764
1779
|
};
|
|
1765
|
-
return /* @__PURE__ */
|
|
1780
|
+
return /* @__PURE__ */ React54.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
1766
1781
|
};
|
|
1767
1782
|
var ToggleButton = ({ onChange, ...props }) => {
|
|
1768
1783
|
const handleChange = (_e, newValue) => {
|
|
1769
1784
|
onChange(newValue);
|
|
1770
1785
|
};
|
|
1771
|
-
return /* @__PURE__ */
|
|
1786
|
+
return /* @__PURE__ */ React54.createElement(ToggleButtonBase, { ...props, onChange: handleChange, size: buttonSize });
|
|
1772
1787
|
};
|
|
1773
1788
|
|
|
1774
1789
|
// src/components/style-sections/typography-section/transform-field.tsx
|
|
1775
|
-
import * as
|
|
1790
|
+
import * as React55 from "react";
|
|
1776
1791
|
import { ControlLabel as ControlLabel29, ToggleControl as ToggleControl10 } from "@elementor/editor-controls";
|
|
1777
1792
|
import { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon } from "@elementor/icons";
|
|
1778
1793
|
import { Grid as Grid24 } from "@elementor/ui";
|
|
1779
|
-
import { __ as
|
|
1794
|
+
import { __ as __36 } from "@wordpress/i18n";
|
|
1780
1795
|
var options9 = [
|
|
1781
1796
|
{
|
|
1782
1797
|
value: "capitalize",
|
|
1783
|
-
label:
|
|
1784
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1798
|
+
label: __36("Capitalize", "elementor"),
|
|
1799
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(LetterCaseIcon, { fontSize: size })
|
|
1785
1800
|
},
|
|
1786
1801
|
{
|
|
1787
1802
|
value: "uppercase",
|
|
1788
|
-
label:
|
|
1789
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1803
|
+
label: __36("Uppercase", "elementor"),
|
|
1804
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(LetterCaseUpperIcon, { fontSize: size })
|
|
1790
1805
|
},
|
|
1791
1806
|
{
|
|
1792
1807
|
value: "lowercase",
|
|
1793
|
-
label:
|
|
1794
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1808
|
+
label: __36("Lowercase", "elementor"),
|
|
1809
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(LetterCaseLowerIcon, { fontSize: size })
|
|
1795
1810
|
}
|
|
1796
1811
|
];
|
|
1797
|
-
var TransformField = () => /* @__PURE__ */
|
|
1812
|
+
var TransformField = () => /* @__PURE__ */ React55.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React55.createElement(Grid24, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React55.createElement(Grid24, { item: true, xs: 6 }, /* @__PURE__ */ React55.createElement(ControlLabel29, null, __36("Transform", "elementor"))), /* @__PURE__ */ React55.createElement(Grid24, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React55.createElement(ToggleControl10, { options: options9 }))));
|
|
1798
1813
|
|
|
1799
1814
|
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
1800
|
-
import * as
|
|
1815
|
+
import * as React56 from "react";
|
|
1801
1816
|
import { ControlLabel as ControlLabel30, SizeControl as SizeControl8 } from "@elementor/editor-controls";
|
|
1802
1817
|
import { Grid as Grid25 } from "@elementor/ui";
|
|
1803
|
-
import { __ as
|
|
1818
|
+
import { __ as __37 } from "@wordpress/i18n";
|
|
1804
1819
|
var WordSpacingField = () => {
|
|
1805
|
-
return /* @__PURE__ */
|
|
1820
|
+
return /* @__PURE__ */ React56.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React56.createElement(Grid25, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(Grid25, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(ControlLabel30, null, __37("Word Spacing", "elementor"))), /* @__PURE__ */ React56.createElement(Grid25, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(SizeControl8, null))));
|
|
1806
1821
|
};
|
|
1807
1822
|
|
|
1808
1823
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1809
1824
|
var TypographySection = () => {
|
|
1810
|
-
return /* @__PURE__ */
|
|
1825
|
+
return /* @__PURE__ */ React57.createElement(Stack19, { gap: 1.5 }, /* @__PURE__ */ React57.createElement(FontFamilyField, null), /* @__PURE__ */ React57.createElement(FontWeightField, null), /* @__PURE__ */ React57.createElement(FontSizeField, null), /* @__PURE__ */ React57.createElement(Divider6, null), /* @__PURE__ */ React57.createElement(TextAlignmentField, null), /* @__PURE__ */ React57.createElement(TextColorField, null), /* @__PURE__ */ React57.createElement(CollapsibleContent, null, /* @__PURE__ */ React57.createElement(Stack19, { gap: 1.5, sx: { pt: 1.5 } }, /* @__PURE__ */ React57.createElement(LineHeightField, null), /* @__PURE__ */ React57.createElement(LetterSpacingField, null), /* @__PURE__ */ React57.createElement(WordSpacingField, null), /* @__PURE__ */ React57.createElement(Divider6, null), /* @__PURE__ */ React57.createElement(TextStyleField, null), /* @__PURE__ */ React57.createElement(TransformField, null), /* @__PURE__ */ React57.createElement(TextDirectionField, null), /* @__PURE__ */ React57.createElement(TextStrokeField, null))));
|
|
1811
1826
|
};
|
|
1812
1827
|
|
|
1813
1828
|
// src/components/style-tab.tsx
|
|
@@ -1816,25 +1831,19 @@ var StyleTab = () => {
|
|
|
1816
1831
|
const currentClassesProp = useCurrentClassesProp();
|
|
1817
1832
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
1818
1833
|
const breakpoint = useActiveBreakpoint();
|
|
1819
|
-
return /* @__PURE__ */
|
|
1834
|
+
return /* @__PURE__ */ React58.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React58.createElement(StyleProvider, { meta: { breakpoint, state: null }, id: activeStyleDefId, setId: setActiveStyleDefId }, /* @__PURE__ */ React58.createElement(CssClassSelector, null), /* @__PURE__ */ React58.createElement(Divider7, null), /* @__PURE__ */ React58.createElement(SectionsList, null, /* @__PURE__ */ React58.createElement(Section, { title: __38("Layout", "elementor") }, /* @__PURE__ */ React58.createElement(LayoutSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: __38("Spacing", "elementor") }, /* @__PURE__ */ React58.createElement(SpacingSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: __38("Size", "elementor") }, /* @__PURE__ */ React58.createElement(SizeSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: __38("Position", "elementor") }, /* @__PURE__ */ React58.createElement(PositionSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: __38("Typography", "elementor") }, /* @__PURE__ */ React58.createElement(TypographySection, null)), /* @__PURE__ */ React58.createElement(Section, { title: __38("Background", "elementor") }, /* @__PURE__ */ React58.createElement(BackgroundSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: __38("Border", "elementor") }, /* @__PURE__ */ React58.createElement(BorderSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: __38("Effects", "elementor") }, /* @__PURE__ */ React58.createElement(EffectsSection, null)))));
|
|
1820
1835
|
};
|
|
1821
1836
|
function useActiveStyleDefId(currentClassesProp) {
|
|
1822
|
-
const [activeStyledDefId, setActiveStyledDefId] =
|
|
1837
|
+
const [activeStyledDefId, setActiveStyledDefId] = useState7(null);
|
|
1823
1838
|
const fallback = useFirstElementStyleDef(currentClassesProp);
|
|
1824
|
-
|
|
1825
|
-
return [activeStyledDefId || fallback?.id || newId, setActiveStyledDefId];
|
|
1839
|
+
return [activeStyledDefId || fallback?.id || null, setActiveStyledDefId];
|
|
1826
1840
|
}
|
|
1827
1841
|
function useFirstElementStyleDef(currentClassesProp) {
|
|
1828
1842
|
const { element } = useElement();
|
|
1829
1843
|
const classesIds = useElementSetting3(element.id, currentClassesProp)?.value || [];
|
|
1830
|
-
const stylesDefs =
|
|
1844
|
+
const stylesDefs = useElementStyles(element.id);
|
|
1831
1845
|
return Object.values(stylesDefs).find((styleDef) => classesIds.includes(styleDef.id));
|
|
1832
1846
|
}
|
|
1833
|
-
function useGeneratedId() {
|
|
1834
|
-
const { element } = useElement();
|
|
1835
|
-
const stylesDefs = useElementStyles2(element.id);
|
|
1836
|
-
return generateId(`e-${element.id}-`, Object.keys(stylesDefs));
|
|
1837
|
-
}
|
|
1838
1847
|
function useCurrentClassesProp() {
|
|
1839
1848
|
const { elementType } = useElement();
|
|
1840
1849
|
const prop = Object.entries(elementType.propsSchema).find(
|
|
@@ -1853,7 +1862,7 @@ var EditingPanelTabs = () => {
|
|
|
1853
1862
|
return (
|
|
1854
1863
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
1855
1864
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
1856
|
-
/* @__PURE__ */
|
|
1865
|
+
/* @__PURE__ */ React59.createElement(Fragment7, { key: element.id }, /* @__PURE__ */ React59.createElement(Stack20, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React59.createElement(Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React59.createElement(Tab, { label: __39("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React59.createElement(Tab, { label: __39("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React59.createElement(Divider8, null), /* @__PURE__ */ React59.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React59.createElement(SettingsTab, null)), /* @__PURE__ */ React59.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React59.createElement(StyleTab, null))))
|
|
1857
1866
|
);
|
|
1858
1867
|
};
|
|
1859
1868
|
|
|
@@ -1866,8 +1875,8 @@ var EditingPanel = () => {
|
|
|
1866
1875
|
if (!element || !elementType) {
|
|
1867
1876
|
return null;
|
|
1868
1877
|
}
|
|
1869
|
-
const panelTitle =
|
|
1870
|
-
return /* @__PURE__ */
|
|
1878
|
+
const panelTitle = __40("Edit %s", "elementor").replace("%s", elementType.title);
|
|
1879
|
+
return /* @__PURE__ */ React60.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React60.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React60.createElement(Panel, null, /* @__PURE__ */ React60.createElement(PanelHeader, null, /* @__PURE__ */ React60.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React60.createElement(PanelBody, null, /* @__PURE__ */ React60.createElement(ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React60.createElement(ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React60.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React60.createElement(EditingPanelTabs, null)))))));
|
|
1871
1880
|
};
|
|
1872
1881
|
|
|
1873
1882
|
// src/panel.ts
|
|
@@ -1890,7 +1899,7 @@ var isAtomicWidgetSelected = () => {
|
|
|
1890
1899
|
// src/hooks/use-close-editor-panel.ts
|
|
1891
1900
|
var useCloseEditorPanel = () => {
|
|
1892
1901
|
const { close } = usePanelActions();
|
|
1893
|
-
return
|
|
1902
|
+
return useEffect3(() => {
|
|
1894
1903
|
return listenTo(commandStartEvent("document/elements/delete"), (e) => {
|
|
1895
1904
|
const selectedElement = getSelectedElements2()[0];
|
|
1896
1905
|
const { container: deletedContainer } = e?.args;
|
|
@@ -1903,11 +1912,11 @@ var useCloseEditorPanel = () => {
|
|
|
1903
1912
|
};
|
|
1904
1913
|
|
|
1905
1914
|
// src/hooks/use-open-editor-panel.ts
|
|
1906
|
-
import { useEffect as
|
|
1915
|
+
import { useEffect as useEffect4 } from "react";
|
|
1907
1916
|
import { __privateListenTo as listenTo2, commandStartEvent as commandStartEvent2 } from "@elementor/editor-v1-adapters";
|
|
1908
1917
|
var useOpenEditorPanel = () => {
|
|
1909
1918
|
const { open } = usePanelActions();
|
|
1910
|
-
|
|
1919
|
+
useEffect4(() => {
|
|
1911
1920
|
return listenTo2(commandStartEvent2("panel/editor/open"), () => {
|
|
1912
1921
|
if (isAtomicWidgetSelected()) {
|
|
1913
1922
|
open();
|
|
@@ -1924,19 +1933,19 @@ var EditingPanelHooks = () => {
|
|
|
1924
1933
|
};
|
|
1925
1934
|
|
|
1926
1935
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1927
|
-
import * as
|
|
1936
|
+
import * as React63 from "react";
|
|
1928
1937
|
import { useId as useId3 } from "react";
|
|
1929
1938
|
import { ControlLabel as ControlLabel31, useBoundProp as useBoundProp3 } from "@elementor/editor-controls";
|
|
1930
1939
|
import { DatabaseIcon, SettingsIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
1931
1940
|
import {
|
|
1932
1941
|
bindPopover as bindPopover2,
|
|
1933
1942
|
bindTrigger,
|
|
1934
|
-
Box as
|
|
1943
|
+
Box as Box6,
|
|
1935
1944
|
Divider as Divider10,
|
|
1936
1945
|
IconButton as IconButton3,
|
|
1937
1946
|
Paper,
|
|
1938
1947
|
Popover as Popover2,
|
|
1939
|
-
Stack as
|
|
1948
|
+
Stack as Stack22,
|
|
1940
1949
|
Tab as Tab2,
|
|
1941
1950
|
TabPanel as TabPanel2,
|
|
1942
1951
|
Tabs as Tabs2,
|
|
@@ -1945,18 +1954,25 @@ import {
|
|
|
1945
1954
|
usePopupState as usePopupState2,
|
|
1946
1955
|
useTabs as useTabs2
|
|
1947
1956
|
} from "@elementor/ui";
|
|
1948
|
-
import { __ as
|
|
1957
|
+
import { __ as __42 } from "@wordpress/i18n";
|
|
1958
|
+
|
|
1959
|
+
// src/hooks/use-persist-dynamic-value.ts
|
|
1960
|
+
var usePersistDynamicValue = (propKey) => {
|
|
1961
|
+
const { element } = useElement();
|
|
1962
|
+
const prefixedKey = `dynamic/non-dynamic-values-history/${element.id}/${propKey}`;
|
|
1963
|
+
return useSessionStorage(prefixedKey);
|
|
1964
|
+
};
|
|
1949
1965
|
|
|
1950
1966
|
// src/dynamics/dynamic-control.tsx
|
|
1951
|
-
import * as
|
|
1967
|
+
import * as React61 from "react";
|
|
1952
1968
|
import { BoundPropProvider as BoundPropProvider3, useBoundProp } from "@elementor/editor-controls";
|
|
1953
1969
|
import { isTransformable as isTransformable2 } from "@elementor/editor-props";
|
|
1954
1970
|
|
|
1955
1971
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
1956
|
-
import { useMemo as
|
|
1972
|
+
import { useMemo as useMemo3 } from "react";
|
|
1957
1973
|
|
|
1958
1974
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1959
|
-
import { useMemo as
|
|
1975
|
+
import { useMemo as useMemo2 } from "react";
|
|
1960
1976
|
|
|
1961
1977
|
// src/dynamics/sync/get-elementor-config.ts
|
|
1962
1978
|
var getElementorConfig2 = () => {
|
|
@@ -2011,7 +2027,7 @@ var usePropDynamicTags = (propName) => {
|
|
|
2011
2027
|
const propDynamicType = getDynamicPropType(propType);
|
|
2012
2028
|
categories = propDynamicType?.settings.categories || [];
|
|
2013
2029
|
}
|
|
2014
|
-
return
|
|
2030
|
+
return useMemo2(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
2015
2031
|
};
|
|
2016
2032
|
var getDynamicTagsByCategories = (categories) => {
|
|
2017
2033
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -2027,7 +2043,7 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
2027
2043
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2028
2044
|
var useDynamicTag = (propName, tagName) => {
|
|
2029
2045
|
const dynamicTags = usePropDynamicTags(propName);
|
|
2030
|
-
return
|
|
2046
|
+
return useMemo3(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
2031
2047
|
};
|
|
2032
2048
|
|
|
2033
2049
|
// src/dynamics/dynamic-control.tsx
|
|
@@ -2050,61 +2066,61 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
2050
2066
|
}
|
|
2051
2067
|
});
|
|
2052
2068
|
};
|
|
2053
|
-
return /* @__PURE__ */
|
|
2069
|
+
return /* @__PURE__ */ React61.createElement(BoundPropProvider3, { setValue: setDynamicValue, value: dynamicValue, bind }, children);
|
|
2054
2070
|
};
|
|
2055
2071
|
|
|
2056
2072
|
// src/dynamics/components/dynamic-selection.tsx
|
|
2057
|
-
import * as
|
|
2058
|
-
import { Fragment as Fragment8, useState as
|
|
2073
|
+
import * as React62 from "react";
|
|
2074
|
+
import { Fragment as Fragment8, useState as useState8 } from "react";
|
|
2059
2075
|
import { useBoundProp as useBoundProp2 } from "@elementor/editor-controls";
|
|
2060
2076
|
import { PhotoIcon, SearchIcon } from "@elementor/icons";
|
|
2061
2077
|
import {
|
|
2062
|
-
Box as
|
|
2078
|
+
Box as Box5,
|
|
2063
2079
|
Divider as Divider9,
|
|
2064
2080
|
InputAdornment,
|
|
2065
2081
|
Link,
|
|
2066
2082
|
ListSubheader,
|
|
2067
2083
|
MenuItem,
|
|
2068
2084
|
MenuList,
|
|
2069
|
-
Stack as
|
|
2085
|
+
Stack as Stack21,
|
|
2070
2086
|
TextField as TextField2,
|
|
2071
2087
|
Typography as Typography3
|
|
2072
2088
|
} from "@elementor/ui";
|
|
2073
|
-
import { __ as
|
|
2089
|
+
import { __ as __41 } from "@wordpress/i18n";
|
|
2074
2090
|
var SIZE3 = "tiny";
|
|
2075
2091
|
var DynamicSelection = ({ onSelect }) => {
|
|
2076
|
-
const [searchValue, setSearchValue] =
|
|
2092
|
+
const [searchValue, setSearchValue] = useState8("");
|
|
2077
2093
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
2078
2094
|
const { value: anyValue } = useBoundProp2();
|
|
2079
|
-
const { bind, value:
|
|
2080
|
-
const
|
|
2081
|
-
const isCurrentValueDynamic = !!
|
|
2095
|
+
const { bind, value: dynamicValue, setValue } = useBoundProp2(dynamicPropTypeUtil);
|
|
2096
|
+
const [, updatePropValueHistory] = usePersistDynamicValue(bind);
|
|
2097
|
+
const isCurrentValueDynamic = !!dynamicValue;
|
|
2082
2098
|
const options10 = useFilteredOptions(bind, searchValue);
|
|
2083
2099
|
const handleSearch = (event) => {
|
|
2084
2100
|
setSearchValue(event.target.value);
|
|
2085
2101
|
};
|
|
2086
2102
|
const handleSetDynamicTag = (value) => {
|
|
2087
2103
|
if (!isCurrentValueDynamic) {
|
|
2088
|
-
updatePropValueHistory(
|
|
2104
|
+
updatePropValueHistory(anyValue);
|
|
2089
2105
|
}
|
|
2090
2106
|
setValue({ name: value, settings: {} });
|
|
2091
2107
|
onSelect?.();
|
|
2092
2108
|
};
|
|
2093
|
-
return /* @__PURE__ */
|
|
2109
|
+
return /* @__PURE__ */ React62.createElement(Stack21, null, /* @__PURE__ */ React62.createElement(Box5, { px: 1.5, pb: 1 }, /* @__PURE__ */ React62.createElement(
|
|
2094
2110
|
TextField2,
|
|
2095
2111
|
{
|
|
2096
2112
|
fullWidth: true,
|
|
2097
2113
|
size: SIZE3,
|
|
2098
2114
|
value: searchValue,
|
|
2099
2115
|
onChange: handleSearch,
|
|
2100
|
-
placeholder:
|
|
2116
|
+
placeholder: __41("Search dynamic tag", "elementor"),
|
|
2101
2117
|
InputProps: {
|
|
2102
|
-
startAdornment: /* @__PURE__ */
|
|
2118
|
+
startAdornment: /* @__PURE__ */ React62.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React62.createElement(SearchIcon, { fontSize: SIZE3 }))
|
|
2103
2119
|
}
|
|
2104
2120
|
}
|
|
2105
|
-
)), /* @__PURE__ */
|
|
2106
|
-
const isSelected = isCurrentValueDynamic && value ===
|
|
2107
|
-
return /* @__PURE__ */
|
|
2121
|
+
)), /* @__PURE__ */ React62.createElement(Divider9, null), /* @__PURE__ */ React62.createElement(Box5, { sx: { overflowY: "auto", height: 260, width: 220 } }, options10.length > 0 ? /* @__PURE__ */ React62.createElement(MenuList, { role: "listbox", tabIndex: 0 }, options10.map(([category, items3], index) => /* @__PURE__ */ React62.createElement(Fragment8, { key: index }, /* @__PURE__ */ React62.createElement(ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items3.map(({ value, label: tagLabel }) => {
|
|
2122
|
+
const isSelected = isCurrentValueDynamic && value === dynamicValue?.name;
|
|
2123
|
+
return /* @__PURE__ */ React62.createElement(
|
|
2108
2124
|
MenuItem,
|
|
2109
2125
|
{
|
|
2110
2126
|
key: value,
|
|
@@ -2115,7 +2131,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2115
2131
|
},
|
|
2116
2132
|
tagLabel
|
|
2117
2133
|
);
|
|
2118
|
-
})))) : /* @__PURE__ */
|
|
2134
|
+
})))) : /* @__PURE__ */ React62.createElement(Stack21, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React62.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React62.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, __41("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React62.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React62.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React62.createElement(
|
|
2119
2135
|
Link,
|
|
2120
2136
|
{
|
|
2121
2137
|
color: "secondary",
|
|
@@ -2123,8 +2139,8 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2123
2139
|
component: "button",
|
|
2124
2140
|
onClick: () => setSearchValue("")
|
|
2125
2141
|
},
|
|
2126
|
-
|
|
2127
|
-
), "\xA0",
|
|
2142
|
+
__41("Clear the filters", "elementor")
|
|
2143
|
+
), "\xA0", __41("and try again.", "elementor")))));
|
|
2128
2144
|
};
|
|
2129
2145
|
var useFilteredOptions = (bind, searchValue) => {
|
|
2130
2146
|
const dynamicTags = usePropDynamicTags(bind);
|
|
@@ -2147,37 +2163,36 @@ var SIZE4 = "tiny";
|
|
|
2147
2163
|
var DynamicSelectionControl = () => {
|
|
2148
2164
|
const { setValue: setAnyValue } = useBoundProp3();
|
|
2149
2165
|
const { bind, value } = useBoundProp3(dynamicPropTypeUtil);
|
|
2150
|
-
const
|
|
2166
|
+
const [propValueFromHistory] = usePersistDynamicValue(bind);
|
|
2151
2167
|
const { name: tagName = "" } = value;
|
|
2152
2168
|
const selectionPopoverId = useId3();
|
|
2153
2169
|
const selectionPopoverState = usePopupState2({ variant: "popover", popupId: selectionPopoverId });
|
|
2154
2170
|
const dynamicTag = useDynamicTag(bind, tagName);
|
|
2155
2171
|
const removeDynamicTag = () => {
|
|
2156
|
-
|
|
2157
|
-
setAnyValue(propValue ?? null);
|
|
2172
|
+
setAnyValue(propValueFromHistory ?? null);
|
|
2158
2173
|
};
|
|
2159
2174
|
if (!dynamicTag) {
|
|
2160
2175
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
2161
2176
|
}
|
|
2162
|
-
return /* @__PURE__ */
|
|
2177
|
+
return /* @__PURE__ */ React63.createElement(Box6, null, /* @__PURE__ */ React63.createElement(
|
|
2163
2178
|
Tag,
|
|
2164
2179
|
{
|
|
2165
2180
|
fullWidth: true,
|
|
2166
2181
|
showActionsOnHover: true,
|
|
2167
2182
|
label: dynamicTag.label,
|
|
2168
|
-
startIcon: /* @__PURE__ */
|
|
2183
|
+
startIcon: /* @__PURE__ */ React63.createElement(DatabaseIcon, { fontSize: SIZE4 }),
|
|
2169
2184
|
...bindTrigger(selectionPopoverState),
|
|
2170
|
-
actions: /* @__PURE__ */
|
|
2185
|
+
actions: /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React63.createElement(
|
|
2171
2186
|
IconButton3,
|
|
2172
2187
|
{
|
|
2173
2188
|
size: SIZE4,
|
|
2174
2189
|
onClick: removeDynamicTag,
|
|
2175
|
-
"aria-label":
|
|
2190
|
+
"aria-label": __42("Remove dynamic value", "elementor")
|
|
2176
2191
|
},
|
|
2177
|
-
/* @__PURE__ */
|
|
2192
|
+
/* @__PURE__ */ React63.createElement(XIcon2, { fontSize: SIZE4 })
|
|
2178
2193
|
))
|
|
2179
2194
|
}
|
|
2180
|
-
), /* @__PURE__ */
|
|
2195
|
+
), /* @__PURE__ */ React63.createElement(
|
|
2181
2196
|
Popover2,
|
|
2182
2197
|
{
|
|
2183
2198
|
disablePortal: true,
|
|
@@ -2185,7 +2200,7 @@ var DynamicSelectionControl = () => {
|
|
|
2185
2200
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
2186
2201
|
...bindPopover2(selectionPopoverState)
|
|
2187
2202
|
},
|
|
2188
|
-
/* @__PURE__ */
|
|
2203
|
+
/* @__PURE__ */ React63.createElement(Stack22, null, /* @__PURE__ */ React63.createElement(Stack22, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React63.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React63.createElement(Typography4, { variant: "subtitle2" }, __42("Dynamic Tags", "elementor")), /* @__PURE__ */ React63.createElement(IconButton3, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React63.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React63.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
2189
2204
|
));
|
|
2190
2205
|
};
|
|
2191
2206
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
@@ -2195,22 +2210,22 @@ var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
|
2195
2210
|
if (!hasDynamicSettings) {
|
|
2196
2211
|
return null;
|
|
2197
2212
|
}
|
|
2198
|
-
return /* @__PURE__ */
|
|
2213
|
+
return /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(
|
|
2199
2214
|
IconButton3,
|
|
2200
2215
|
{
|
|
2201
2216
|
size: SIZE4,
|
|
2202
2217
|
...bindTrigger(settingsPopupState),
|
|
2203
|
-
"aria-label":
|
|
2218
|
+
"aria-label": __42("Settings", "elementor")
|
|
2204
2219
|
},
|
|
2205
|
-
/* @__PURE__ */
|
|
2206
|
-
), /* @__PURE__ */
|
|
2220
|
+
/* @__PURE__ */ React63.createElement(SettingsIcon, { fontSize: SIZE4 })
|
|
2221
|
+
), /* @__PURE__ */ React63.createElement(
|
|
2207
2222
|
Popover2,
|
|
2208
2223
|
{
|
|
2209
2224
|
disableScrollLock: true,
|
|
2210
2225
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
2211
2226
|
...bindPopover2(settingsPopupState)
|
|
2212
2227
|
},
|
|
2213
|
-
/* @__PURE__ */
|
|
2228
|
+
/* @__PURE__ */ React63.createElement(Paper, { component: Stack22, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React63.createElement(Stack22, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React63.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React63.createElement(Typography4, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React63.createElement(IconButton3, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React63.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React63.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
2214
2229
|
));
|
|
2215
2230
|
};
|
|
2216
2231
|
var DynamicSettings = ({ controls }) => {
|
|
@@ -2219,10 +2234,10 @@ var DynamicSettings = ({ controls }) => {
|
|
|
2219
2234
|
if (!tabs.length) {
|
|
2220
2235
|
return null;
|
|
2221
2236
|
}
|
|
2222
|
-
return /* @__PURE__ */
|
|
2223
|
-
return /* @__PURE__ */
|
|
2237
|
+
return /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(Tabs2, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React63.createElement(Tab2, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React63.createElement(Divider10, null), tabs.map(({ value }, index) => {
|
|
2238
|
+
return /* @__PURE__ */ React63.createElement(TabPanel2, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React63.createElement(Stack22, { gap: 1, px: 2 }, value.items.map((item) => {
|
|
2224
2239
|
if (item.type === "control") {
|
|
2225
|
-
return /* @__PURE__ */
|
|
2240
|
+
return /* @__PURE__ */ React63.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
2226
2241
|
}
|
|
2227
2242
|
return null;
|
|
2228
2243
|
})));
|
|
@@ -2232,14 +2247,14 @@ var Control3 = ({ control }) => {
|
|
|
2232
2247
|
if (!getControlByType(control.type)) {
|
|
2233
2248
|
return null;
|
|
2234
2249
|
}
|
|
2235
|
-
return /* @__PURE__ */
|
|
2250
|
+
return /* @__PURE__ */ React63.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React63.createElement(ControlLabel31, null, control.label) : null, /* @__PURE__ */ React63.createElement(Control, { type: control.type, props: control.props }));
|
|
2236
2251
|
};
|
|
2237
2252
|
|
|
2238
2253
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
2239
|
-
import * as
|
|
2254
|
+
import * as React64 from "react";
|
|
2240
2255
|
import { useBoundProp as useBoundProp4 } from "@elementor/editor-controls";
|
|
2241
2256
|
import { DatabaseIcon as DatabaseIcon2 } from "@elementor/icons";
|
|
2242
|
-
import { __ as
|
|
2257
|
+
import { __ as __43 } from "@wordpress/i18n";
|
|
2243
2258
|
var usePropDynamicAction = () => {
|
|
2244
2259
|
const { bind } = useBoundProp4();
|
|
2245
2260
|
const { elementType } = useElement();
|
|
@@ -2248,8 +2263,8 @@ var usePropDynamicAction = () => {
|
|
|
2248
2263
|
return {
|
|
2249
2264
|
visible,
|
|
2250
2265
|
icon: DatabaseIcon2,
|
|
2251
|
-
title:
|
|
2252
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
2266
|
+
title: __43("Dynamic Tags", "elementor"),
|
|
2267
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React64.createElement(DynamicSelection, { onSelect: closePopover })
|
|
2253
2268
|
};
|
|
2254
2269
|
};
|
|
2255
2270
|
|