@elementor/editor-editing-panel 1.2.0 → 1.3.0
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 +29 -0
- package/dist/index.js +657 -486
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +613 -433
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -11
- package/src/components/style-sections/border-section/border-radius-field.tsx +4 -4
- package/src/components/style-sections/border-section/border-width-field.tsx +4 -4
- package/src/components/style-sections/layout-section/align-items-field.tsx +40 -60
- package/src/components/style-sections/layout-section/align-self-child-field.tsx +72 -0
- package/src/components/style-sections/layout-section/flex-direction-field.tsx +2 -2
- package/src/components/style-sections/layout-section/flex-order-field.tsx +14 -8
- package/src/components/style-sections/layout-section/flex-size-field.tsx +164 -0
- package/src/components/style-sections/layout-section/justify-content-field.tsx +51 -78
- package/src/components/style-sections/layout-section/layout-section.tsx +7 -2
- package/src/components/style-sections/layout-section/utils/rotated-icon.tsx +52 -0
- package/src/components/style-sections/layout-section/wrap-field.tsx +1 -1
- package/src/components/style-sections/position-section/position-section.tsx +3 -3
- package/src/components/style-sections/typography-section/line-height-field.tsx +21 -0
- package/src/components/style-sections/typography-section/text-style-field.tsx +31 -8
- package/src/components/style-sections/typography-section/typography-section.tsx +3 -1
- package/src/controls-registry/controls-registry.tsx +4 -0
- package/src/dynamics/components/dynamic-selection-control.tsx +8 -5
- package/src/dynamics/components/dynamic-selection.tsx +10 -8
- package/src/dynamics/dynamic-control.tsx +9 -11
- package/src/dynamics/utils.ts +20 -3
package/dist/index.mjs
CHANGED
|
@@ -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 React58 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 __38 } 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
|
|
99
|
-
import { Fragment as
|
|
100
|
-
import { Divider as Divider8, Stack as
|
|
101
|
-
import { __ as
|
|
98
|
+
import * as React57 from "react";
|
|
99
|
+
import { Fragment as Fragment7 } from "react";
|
|
100
|
+
import { Divider as Divider8, Stack as Stack19, Tab, TabPanel, Tabs, useTabs } from "@elementor/ui";
|
|
101
|
+
import { __ as __37 } from "@wordpress/i18n";
|
|
102
102
|
|
|
103
103
|
// src/components/settings-tab.tsx
|
|
104
104
|
import * as React9 from "react";
|
|
@@ -111,17 +111,21 @@ import { createError } from "@elementor/utils";
|
|
|
111
111
|
// src/controls-registry/controls-registry.tsx
|
|
112
112
|
import {
|
|
113
113
|
ImageControl,
|
|
114
|
+
LinkControl,
|
|
114
115
|
SelectControl,
|
|
115
116
|
SizeControl,
|
|
116
117
|
TextAreaControl,
|
|
117
|
-
TextControl
|
|
118
|
+
TextControl,
|
|
119
|
+
UrlControl
|
|
118
120
|
} from "@elementor/editor-controls";
|
|
119
121
|
var controlTypes = {
|
|
120
122
|
image: { component: ImageControl, layout: "full" },
|
|
121
123
|
text: { component: TextControl, layout: "two-columns" },
|
|
122
124
|
textarea: { component: TextAreaControl, layout: "full" },
|
|
123
125
|
size: { component: SizeControl, layout: "two-columns" },
|
|
124
|
-
select: { component: SelectControl, layout: "two-columns" }
|
|
126
|
+
select: { component: SelectControl, layout: "two-columns" },
|
|
127
|
+
link: { component: LinkControl, layout: "full" },
|
|
128
|
+
url: { component: UrlControl, layout: "full" }
|
|
125
129
|
};
|
|
126
130
|
var getControlByType = (type) => controlTypes[type]?.component;
|
|
127
131
|
var getLayoutByType = (type) => controlTypes[type].layout;
|
|
@@ -254,13 +258,13 @@ var Control2 = ({ control }) => {
|
|
|
254
258
|
};
|
|
255
259
|
|
|
256
260
|
// src/components/style-tab.tsx
|
|
257
|
-
import * as
|
|
258
|
-
import { useState as
|
|
261
|
+
import * as React56 from "react";
|
|
262
|
+
import { useState as useState5 } from "react";
|
|
259
263
|
import { useElementSetting as useElementSetting3, useElementStyles as useElementStyles2 } from "@elementor/editor-elements";
|
|
260
264
|
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
261
265
|
import { generateId } from "@elementor/editor-styles";
|
|
262
266
|
import { Divider as Divider7 } from "@elementor/ui";
|
|
263
|
-
import { __ as
|
|
267
|
+
import { __ as __36 } from "@wordpress/i18n";
|
|
264
268
|
|
|
265
269
|
// src/contexts/classes-prop-context.tsx
|
|
266
270
|
import * as React10 from "react";
|
|
@@ -359,7 +363,7 @@ var createActionOption = (groupLabel, action, inputValue) => ({
|
|
|
359
363
|
var MultiCombobox = ({
|
|
360
364
|
actions = {},
|
|
361
365
|
selected,
|
|
362
|
-
options:
|
|
366
|
+
options: options10,
|
|
363
367
|
optionsLabel,
|
|
364
368
|
onSelect,
|
|
365
369
|
onCreate,
|
|
@@ -383,7 +387,7 @@ var MultiCombobox = ({
|
|
|
383
387
|
disableClearable: true,
|
|
384
388
|
handleHomeEndKeys: true,
|
|
385
389
|
value: selected,
|
|
386
|
-
options:
|
|
390
|
+
options: options10,
|
|
387
391
|
renderGroup,
|
|
388
392
|
renderInput: (params) => /* @__PURE__ */ React12.createElement(TextField, { ...params }),
|
|
389
393
|
getLimitTagsText: (more) => /* @__PURE__ */ React12.createElement(Chip, { size: "tiny", variant: "standard", label: `+${more}`, clickable: true }),
|
|
@@ -397,7 +401,7 @@ var MultiCombobox = ({
|
|
|
397
401
|
return actionProps.onChange(action);
|
|
398
402
|
}
|
|
399
403
|
const selectedValues = selectedOrTypedValue.filter((v) => typeof v !== "string");
|
|
400
|
-
const fixedValues =
|
|
404
|
+
const fixedValues = options10.filter((option) => option.fixed);
|
|
401
405
|
optionProps.onChange([.../* @__PURE__ */ new Set([...fixedValues, ...selectedValues])]);
|
|
402
406
|
},
|
|
403
407
|
getOptionLabel: (option) => {
|
|
@@ -438,19 +442,19 @@ var GroupItems = styled3("ul")`
|
|
|
438
442
|
var ID = "elementor-css-class-selector";
|
|
439
443
|
var TAGS_LIMIT = 8;
|
|
440
444
|
function CssClassSelector() {
|
|
441
|
-
const
|
|
445
|
+
const options10 = useOptions();
|
|
442
446
|
const { id: activeId, setId: setActiveId } = useStyle();
|
|
443
447
|
const [appliedIds] = useAppliedClassesIds();
|
|
444
448
|
const handleApply = useHandleApply();
|
|
445
449
|
const handleActivate = ({ value }) => setActiveId(value);
|
|
446
|
-
const active =
|
|
447
|
-
const applied = appliedIds.map((id) =>
|
|
450
|
+
const active = options10.find((option) => option.value === activeId) || null;
|
|
451
|
+
const applied = appliedIds.map((id) => options10.find((option) => option.value === id)).filter((option) => !!option);
|
|
448
452
|
return /* @__PURE__ */ React13.createElement(Stack3, { gap: 1, p: 2 }, /* @__PURE__ */ React13.createElement(Typography2, { component: "label", variant: "caption", htmlFor: ID }, __("CSS Classes", "elementor")), /* @__PURE__ */ React13.createElement(
|
|
449
453
|
MultiCombobox,
|
|
450
454
|
{
|
|
451
455
|
id: ID,
|
|
452
456
|
size: "tiny",
|
|
453
|
-
options:
|
|
457
|
+
options: options10,
|
|
454
458
|
selected: applied,
|
|
455
459
|
onSelect: handleApply,
|
|
456
460
|
limitTags: TAGS_LIMIT,
|
|
@@ -647,6 +651,7 @@ var BorderStyleField = () => {
|
|
|
647
651
|
// src/components/style-sections/border-section/border-width-field.tsx
|
|
648
652
|
import * as React20 from "react";
|
|
649
653
|
import { EqualUnequalSizesControl } from "@elementor/editor-controls";
|
|
654
|
+
import { borderWidthPropTypeUtil } from "@elementor/editor-props";
|
|
650
655
|
import { SideAllIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
651
656
|
import { __ as __5 } from "@wordpress/i18n";
|
|
652
657
|
var edges = [
|
|
@@ -675,10 +680,10 @@ var BorderWidthField = () => {
|
|
|
675
680
|
return /* @__PURE__ */ React20.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React20.createElement(
|
|
676
681
|
EqualUnequalSizesControl,
|
|
677
682
|
{
|
|
683
|
+
items: edges,
|
|
678
684
|
label: __5("Border Width", "elementor"),
|
|
679
685
|
icon: /* @__PURE__ */ React20.createElement(SideAllIcon, { fontSize: "tiny" }),
|
|
680
|
-
|
|
681
|
-
multiSizeType: "border-width"
|
|
686
|
+
multiSizePropTypeUtil: borderWidthPropTypeUtil
|
|
682
687
|
}
|
|
683
688
|
));
|
|
684
689
|
};
|
|
@@ -723,6 +728,7 @@ var BorderField = () => {
|
|
|
723
728
|
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
724
729
|
import * as React22 from "react";
|
|
725
730
|
import { EqualUnequalSizesControl as EqualUnequalSizesControl2 } from "@elementor/editor-controls";
|
|
731
|
+
import { borderRadiusPropTypeUtil } from "@elementor/editor-props";
|
|
726
732
|
import {
|
|
727
733
|
BorderCornersIcon,
|
|
728
734
|
RadiusBottomLeftIcon,
|
|
@@ -757,10 +763,10 @@ var BorderRadiusField = () => {
|
|
|
757
763
|
return /* @__PURE__ */ React22.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React22.createElement(
|
|
758
764
|
EqualUnequalSizesControl2,
|
|
759
765
|
{
|
|
766
|
+
items: corners,
|
|
760
767
|
label: __7("Border Radius", "elementor"),
|
|
761
768
|
icon: /* @__PURE__ */ React22.createElement(BorderCornersIcon, { fontSize: "tiny" }),
|
|
762
|
-
|
|
763
|
-
multiSizeType: "border-radius"
|
|
769
|
+
multiSizePropTypeUtil: borderRadiusPropTypeUtil
|
|
764
770
|
}
|
|
765
771
|
));
|
|
766
772
|
};
|
|
@@ -777,13 +783,13 @@ var EffectsSection = () => {
|
|
|
777
783
|
};
|
|
778
784
|
|
|
779
785
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
780
|
-
import * as
|
|
781
|
-
import { ControlLabel as
|
|
782
|
-
import { Divider as Divider3, Stack as
|
|
783
|
-
import { __ as
|
|
786
|
+
import * as React34 from "react";
|
|
787
|
+
import { ControlLabel as ControlLabel14 } from "@elementor/editor-controls";
|
|
788
|
+
import { Divider as Divider3, Stack as Stack12 } from "@elementor/ui";
|
|
789
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
784
790
|
|
|
785
791
|
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
786
|
-
import * as
|
|
792
|
+
import * as React26 from "react";
|
|
787
793
|
import { ControlLabel as ControlLabel6, ToggleControl } from "@elementor/editor-controls";
|
|
788
794
|
import {
|
|
789
795
|
LayoutAlignCenterIcon as CenterIcon,
|
|
@@ -791,7 +797,7 @@ import {
|
|
|
791
797
|
LayoutAlignRightIcon,
|
|
792
798
|
LayoutDistributeVerticalIcon as JustifyIcon
|
|
793
799
|
} from "@elementor/icons";
|
|
794
|
-
import { DirectionProvider, Grid as Grid4, ThemeProvider,
|
|
800
|
+
import { DirectionProvider, Grid as Grid4, ThemeProvider, withDirection } from "@elementor/ui";
|
|
795
801
|
import { __ as __8 } from "@wordpress/i18n";
|
|
796
802
|
|
|
797
803
|
// src/hooks/use-direction.ts
|
|
@@ -802,170 +808,241 @@ function useDirection() {
|
|
|
802
808
|
return { isSiteRtl, isUiRtl };
|
|
803
809
|
}
|
|
804
810
|
|
|
811
|
+
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
812
|
+
import * as React25 from "react";
|
|
813
|
+
import { useRef as useRef2 } from "react";
|
|
814
|
+
import { useTheme as useTheme2 } from "@elementor/ui";
|
|
815
|
+
var CLOCKWISE_ANGLES = {
|
|
816
|
+
row: 0,
|
|
817
|
+
column: 90,
|
|
818
|
+
"row-reverse": 180,
|
|
819
|
+
"column-reverse": 270
|
|
820
|
+
};
|
|
821
|
+
var COUNTER_CLOCKWISE_ANGLES = {
|
|
822
|
+
row: 0,
|
|
823
|
+
column: -90,
|
|
824
|
+
"row-reverse": -180,
|
|
825
|
+
"column-reverse": -270
|
|
826
|
+
};
|
|
827
|
+
var RotatedIcon = ({ icon: Icon, size, isClockwise = true, offset = 0 }) => {
|
|
828
|
+
const rotate = useRef2(useGetTargetAngle(isClockwise, offset));
|
|
829
|
+
rotate.current = useGetTargetAngle(isClockwise, offset, rotate);
|
|
830
|
+
return /* @__PURE__ */ React25.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
831
|
+
};
|
|
832
|
+
var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
833
|
+
const [direction] = useStylesField("flex-direction");
|
|
834
|
+
const isRtl = "rtl" === useTheme2().direction;
|
|
835
|
+
const rotationMultiplier = isRtl ? -1 : 1;
|
|
836
|
+
const angleMap = isClockwise ? CLOCKWISE_ANGLES : COUNTER_CLOCKWISE_ANGLES;
|
|
837
|
+
const currentAngle = existingRef ? existingRef.current * rotationMultiplier : angleMap[direction?.value || "row"] + offset;
|
|
838
|
+
const targetAngle = angleMap[direction?.value || "row"] + offset;
|
|
839
|
+
const diffToTargetAngle = (targetAngle - currentAngle + 360) % 360;
|
|
840
|
+
const formattedDiff = (diffToTargetAngle + 180) % 360 - 180;
|
|
841
|
+
return (currentAngle + formattedDiff) * rotationMultiplier;
|
|
842
|
+
};
|
|
843
|
+
|
|
805
844
|
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
845
|
+
var StartIcon = withDirection(LayoutAlignLeftIcon);
|
|
846
|
+
var EndIcon = withDirection(LayoutAlignRightIcon);
|
|
847
|
+
var iconProps = {
|
|
848
|
+
isClockwise: false,
|
|
849
|
+
offset: 90
|
|
850
|
+
};
|
|
851
|
+
var options = [
|
|
852
|
+
{
|
|
853
|
+
value: "start",
|
|
854
|
+
label: __8("Start", "elementor"),
|
|
855
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(RotatedIcon, { icon: StartIcon, size, ...iconProps }),
|
|
856
|
+
showTooltip: true
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
value: "center",
|
|
860
|
+
label: __8("Center", "elementor"),
|
|
861
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(RotatedIcon, { icon: CenterIcon, size, ...iconProps }),
|
|
862
|
+
showTooltip: true
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
value: "end",
|
|
866
|
+
label: __8("End", "elementor"),
|
|
867
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(RotatedIcon, { icon: EndIcon, size, ...iconProps }),
|
|
868
|
+
showTooltip: true
|
|
869
|
+
},
|
|
870
|
+
{
|
|
871
|
+
value: "stretch",
|
|
872
|
+
label: __8("Stretch", "elementor"),
|
|
873
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(RotatedIcon, { icon: JustifyIcon, size, ...iconProps }),
|
|
874
|
+
showTooltip: true
|
|
875
|
+
}
|
|
876
|
+
];
|
|
806
877
|
var AlignItemsField = () => {
|
|
807
|
-
const
|
|
808
|
-
return /* @__PURE__ */
|
|
878
|
+
const { isSiteRtl } = useDirection();
|
|
879
|
+
return /* @__PURE__ */ React26.createElement(DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React26.createElement(ThemeProvider, null, /* @__PURE__ */ React26.createElement(StylesField, { bind: "align-items" }, /* @__PURE__ */ React26.createElement(Grid4, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React26.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(ControlLabel6, null, __8("Align items", "elementor"))), /* @__PURE__ */ React26.createElement(Grid4, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React26.createElement(ToggleControl, { options }))))));
|
|
809
880
|
};
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
label: __8("End", "elementor"),
|
|
828
|
-
renderContent: ({ size }) => /* @__PURE__ */ React25.createElement(RotatedIcon, { icon: EndIcon, size }),
|
|
829
|
-
showTooltip: true
|
|
830
|
-
},
|
|
831
|
-
{
|
|
832
|
-
value: "justify",
|
|
833
|
-
label: __8("Justify", "elementor"),
|
|
834
|
-
renderContent: ({ size }) => /* @__PURE__ */ React25.createElement(RotatedIcon, { icon: JustifyIcon, size }),
|
|
835
|
-
showTooltip: true
|
|
836
|
-
}
|
|
837
|
-
];
|
|
881
|
+
|
|
882
|
+
// src/components/style-sections/layout-section/align-self-child-field.tsx
|
|
883
|
+
import * as React27 from "react";
|
|
884
|
+
import { ControlLabel as ControlLabel7, ToggleControl as ToggleControl2 } from "@elementor/editor-controls";
|
|
885
|
+
import {
|
|
886
|
+
LayoutAlignCenterIcon as CenterIcon2,
|
|
887
|
+
LayoutAlignLeftIcon as LayoutAlignLeftIcon2,
|
|
888
|
+
LayoutAlignRightIcon as LayoutAlignRightIcon2,
|
|
889
|
+
LayoutDistributeVerticalIcon as JustifyIcon2
|
|
890
|
+
} from "@elementor/icons";
|
|
891
|
+
import { DirectionProvider as DirectionProvider2, Grid as Grid5, ThemeProvider as ThemeProvider2, withDirection as withDirection2 } from "@elementor/ui";
|
|
892
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
893
|
+
var StartIcon2 = withDirection2(LayoutAlignLeftIcon2);
|
|
894
|
+
var EndIcon2 = withDirection2(LayoutAlignRightIcon2);
|
|
895
|
+
var iconProps2 = {
|
|
896
|
+
isClockwise: false,
|
|
897
|
+
offset: 90
|
|
838
898
|
};
|
|
839
|
-
var
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
{
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
899
|
+
var options2 = [
|
|
900
|
+
{
|
|
901
|
+
value: "start",
|
|
902
|
+
label: __9("Start", "elementor"),
|
|
903
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: StartIcon2, size, ...iconProps2 }),
|
|
904
|
+
showTooltip: true
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
value: "center",
|
|
908
|
+
label: __9("Center", "elementor"),
|
|
909
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: CenterIcon2, size, ...iconProps2 }),
|
|
910
|
+
showTooltip: true
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
value: "end",
|
|
914
|
+
label: __9("End", "elementor"),
|
|
915
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: EndIcon2, size, ...iconProps2 }),
|
|
916
|
+
showTooltip: true
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
value: "stretch",
|
|
920
|
+
label: __9("Stretch", "elementor"),
|
|
921
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: JustifyIcon2, size, ...iconProps2 }),
|
|
922
|
+
showTooltip: true
|
|
923
|
+
}
|
|
924
|
+
];
|
|
925
|
+
var AlignSelfChild = () => {
|
|
926
|
+
const { isSiteRtl } = useDirection();
|
|
927
|
+
return /* @__PURE__ */ React27.createElement(DirectionProvider2, { rtl: isSiteRtl }, /* @__PURE__ */ React27.createElement(ThemeProvider2, null, /* @__PURE__ */ React27.createElement(StylesField, { bind: "align-self" }, /* @__PURE__ */ React27.createElement(Grid5, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React27.createElement(ControlLabel7, null, __9("Align self", "elementor"))), /* @__PURE__ */ React27.createElement(Grid5, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React27.createElement(ToggleControl2, { options: options2 }))))));
|
|
854
928
|
};
|
|
855
929
|
|
|
856
930
|
// src/components/style-sections/layout-section/display-field.tsx
|
|
857
|
-
import * as
|
|
858
|
-
import { ControlLabel as
|
|
931
|
+
import * as React28 from "react";
|
|
932
|
+
import { ControlLabel as ControlLabel8, ToggleControl as ToggleControl3 } from "@elementor/editor-controls";
|
|
859
933
|
import { Stack as Stack8 } from "@elementor/ui";
|
|
860
|
-
import { __ as
|
|
934
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
861
935
|
var DisplayField = () => {
|
|
862
|
-
const
|
|
936
|
+
const options10 = [
|
|
863
937
|
{
|
|
864
938
|
value: "block",
|
|
865
|
-
renderContent: () =>
|
|
866
|
-
label:
|
|
939
|
+
renderContent: () => __10("Block", "elementor"),
|
|
940
|
+
label: __10("Block", "elementor")
|
|
867
941
|
},
|
|
868
942
|
{
|
|
869
943
|
value: "flex",
|
|
870
|
-
renderContent: () =>
|
|
871
|
-
label:
|
|
944
|
+
renderContent: () => __10("Flex", "elementor"),
|
|
945
|
+
label: __10("Flex", "elementor")
|
|
872
946
|
}
|
|
873
947
|
];
|
|
874
|
-
return /* @__PURE__ */
|
|
948
|
+
return /* @__PURE__ */ React28.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React28.createElement(Stack8, { gap: 1 }, /* @__PURE__ */ React28.createElement(ControlLabel8, null, __10("Display", "elementor")), /* @__PURE__ */ React28.createElement(ToggleControl3, { options: options10, fullWidth: true })));
|
|
875
949
|
};
|
|
876
950
|
|
|
877
951
|
// src/components/style-sections/layout-section/flex-direction-field.tsx
|
|
878
|
-
import * as
|
|
879
|
-
import { ControlLabel as
|
|
952
|
+
import * as React29 from "react";
|
|
953
|
+
import { ControlLabel as ControlLabel9, ToggleControl as ToggleControl4 } from "@elementor/editor-controls";
|
|
880
954
|
import { ArrowDownSmallIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpSmallIcon } from "@elementor/icons";
|
|
881
|
-
import { DirectionProvider as
|
|
882
|
-
import { __ as
|
|
883
|
-
var
|
|
955
|
+
import { DirectionProvider as DirectionProvider3, Grid as Grid6, ThemeProvider as ThemeProvider3, withDirection as withDirection3 } from "@elementor/ui";
|
|
956
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
957
|
+
var options3 = [
|
|
884
958
|
{
|
|
885
959
|
value: "row",
|
|
886
|
-
label:
|
|
960
|
+
label: __11("Row", "elementor"),
|
|
887
961
|
renderContent: ({ size }) => {
|
|
888
|
-
const
|
|
889
|
-
return /* @__PURE__ */
|
|
962
|
+
const StartIcon4 = withDirection3(ArrowRightIcon);
|
|
963
|
+
return /* @__PURE__ */ React29.createElement(StartIcon4, { fontSize: size });
|
|
890
964
|
},
|
|
891
965
|
showTooltip: true
|
|
892
966
|
},
|
|
893
967
|
{
|
|
894
968
|
value: "column",
|
|
895
|
-
label:
|
|
896
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
969
|
+
label: __11("Column", "elementor"),
|
|
970
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(ArrowDownSmallIcon, { fontSize: size }),
|
|
897
971
|
showTooltip: true
|
|
898
972
|
},
|
|
899
973
|
{
|
|
900
974
|
value: "row-reverse",
|
|
901
|
-
label:
|
|
975
|
+
label: __11("Reversed row", "elementor"),
|
|
902
976
|
renderContent: ({ size }) => {
|
|
903
|
-
const
|
|
904
|
-
return /* @__PURE__ */
|
|
977
|
+
const EndIcon4 = withDirection3(ArrowLeftIcon);
|
|
978
|
+
return /* @__PURE__ */ React29.createElement(EndIcon4, { fontSize: size });
|
|
905
979
|
},
|
|
906
980
|
showTooltip: true
|
|
907
981
|
},
|
|
908
982
|
{
|
|
909
983
|
value: "column-reverse",
|
|
910
|
-
label:
|
|
911
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
984
|
+
label: __11("Reversed column", "elementor"),
|
|
985
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(ArrowUpSmallIcon, { fontSize: size }),
|
|
912
986
|
showTooltip: true
|
|
913
987
|
}
|
|
914
988
|
];
|
|
915
989
|
var FlexDirectionField = () => {
|
|
916
990
|
const { isSiteRtl } = useDirection();
|
|
917
|
-
return /* @__PURE__ */
|
|
991
|
+
return /* @__PURE__ */ React29.createElement(DirectionProvider3, { rtl: isSiteRtl }, /* @__PURE__ */ React29.createElement(ThemeProvider3, null, /* @__PURE__ */ React29.createElement(StylesField, { bind: "flex-direction" }, /* @__PURE__ */ React29.createElement(Grid6, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React29.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React29.createElement(ControlLabel9, null, __11("Direction", "elementor"))), /* @__PURE__ */ React29.createElement(Grid6, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React29.createElement(ToggleControl4, { options: options3 }))))));
|
|
918
992
|
};
|
|
919
993
|
|
|
920
994
|
// src/components/style-sections/layout-section/flex-order-field.tsx
|
|
921
|
-
import * as
|
|
995
|
+
import * as React30 from "react";
|
|
922
996
|
import { useState as useState2 } from "react";
|
|
923
997
|
import {
|
|
924
|
-
ControlLabel as
|
|
998
|
+
ControlLabel as ControlLabel10,
|
|
925
999
|
ControlToggleButtonGroup,
|
|
926
1000
|
NumberControl
|
|
927
1001
|
} from "@elementor/editor-controls";
|
|
928
1002
|
import { ArrowDownSmallIcon as ArrowDownSmallIcon2, ArrowUpSmallIcon as ArrowUpSmallIcon2, PencilIcon } from "@elementor/icons";
|
|
929
|
-
import { DirectionProvider as
|
|
930
|
-
import { __ as
|
|
1003
|
+
import { DirectionProvider as DirectionProvider4, Grid as Grid7, Stack as Stack9, ThemeProvider as ThemeProvider4 } from "@elementor/ui";
|
|
1004
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
931
1005
|
var FIRST_DEFAULT_VALUE = -99999;
|
|
932
1006
|
var LAST_DEFAULT_VALUE = 99999;
|
|
933
1007
|
var FIRST = "first";
|
|
934
1008
|
var LAST = "last";
|
|
935
1009
|
var CUSTOM = "custom";
|
|
1010
|
+
var orderValueMap = {
|
|
1011
|
+
[FIRST]: FIRST_DEFAULT_VALUE,
|
|
1012
|
+
[LAST]: LAST_DEFAULT_VALUE
|
|
1013
|
+
};
|
|
936
1014
|
var items = [
|
|
937
1015
|
{
|
|
938
1016
|
value: FIRST,
|
|
939
|
-
label:
|
|
940
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1017
|
+
label: __12("First", "elementor"),
|
|
1018
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(ArrowUpSmallIcon2, { fontSize: size }),
|
|
941
1019
|
showTooltip: true
|
|
942
1020
|
},
|
|
943
1021
|
{
|
|
944
1022
|
value: LAST,
|
|
945
|
-
label:
|
|
946
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1023
|
+
label: __12("Last", "elementor"),
|
|
1024
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(ArrowDownSmallIcon2, { fontSize: size }),
|
|
947
1025
|
showTooltip: true
|
|
948
1026
|
},
|
|
949
1027
|
{
|
|
950
1028
|
value: CUSTOM,
|
|
951
|
-
label:
|
|
952
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1029
|
+
label: __12("Custom", "elementor"),
|
|
1030
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(PencilIcon, { fontSize: size }),
|
|
953
1031
|
showTooltip: true
|
|
954
1032
|
}
|
|
955
1033
|
];
|
|
956
1034
|
var FlexOrderField = () => {
|
|
957
1035
|
const { isSiteRtl } = useDirection(), [order, setOrder] = useStylesField("order");
|
|
958
|
-
const [groupControlValue, setGroupControlValue] = useState2(getGroupControlValue(order));
|
|
1036
|
+
const [groupControlValue, setGroupControlValue] = useState2(getGroupControlValue(order?.value || null));
|
|
959
1037
|
const handleToggleButtonChange = (group) => {
|
|
960
1038
|
setGroupControlValue(group);
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
};
|
|
966
|
-
setOrder(group ? orderValueMap[group] : null);
|
|
1039
|
+
if (!group || group === CUSTOM) {
|
|
1040
|
+
setOrder(null);
|
|
1041
|
+
return;
|
|
1042
|
+
}
|
|
1043
|
+
setOrder({ $$type: "number", value: orderValueMap[group] });
|
|
967
1044
|
};
|
|
968
|
-
return /* @__PURE__ */
|
|
1045
|
+
return /* @__PURE__ */ React30.createElement(DirectionProvider4, { rtl: isSiteRtl }, /* @__PURE__ */ React30.createElement(ThemeProvider4, null, /* @__PURE__ */ React30.createElement(Stack9, { gap: 2 }, /* @__PURE__ */ React30.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel10, null, __12("Order", "elementor"))), /* @__PURE__ */ React30.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React30.createElement(
|
|
969
1046
|
ControlToggleButtonGroup,
|
|
970
1047
|
{
|
|
971
1048
|
items,
|
|
@@ -973,7 +1050,7 @@ var FlexOrderField = () => {
|
|
|
973
1050
|
onChange: handleToggleButtonChange,
|
|
974
1051
|
exclusive: true
|
|
975
1052
|
}
|
|
976
|
-
))), CUSTOM === groupControlValue && /* @__PURE__ */
|
|
1053
|
+
))), CUSTOM === groupControlValue && /* @__PURE__ */ React30.createElement(StylesField, { bind: "order" }, /* @__PURE__ */ React30.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel10, null, __12("Custom order", "elementor"))), /* @__PURE__ */ React30.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React30.createElement(
|
|
977
1054
|
NumberControl,
|
|
978
1055
|
{
|
|
979
1056
|
min: FIRST_DEFAULT_VALUE + 1,
|
|
@@ -992,136 +1069,200 @@ var getGroupControlValue = (order) => {
|
|
|
992
1069
|
return 0 === order || order ? CUSTOM : null;
|
|
993
1070
|
};
|
|
994
1071
|
|
|
1072
|
+
// src/components/style-sections/layout-section/flex-size-field.tsx
|
|
1073
|
+
import * as React31 from "react";
|
|
1074
|
+
import {
|
|
1075
|
+
ControlLabel as ControlLabel11,
|
|
1076
|
+
ControlToggleButtonGroup as ControlToggleButtonGroup2,
|
|
1077
|
+
NumberControl as NumberControl2,
|
|
1078
|
+
SizeControl as SizeControl2
|
|
1079
|
+
} from "@elementor/editor-controls";
|
|
1080
|
+
import { ExpandIcon, PencilIcon as PencilIcon2, ShrinkIcon } from "@elementor/icons";
|
|
1081
|
+
import { DirectionProvider as DirectionProvider5, Grid as Grid8, Stack as Stack10, ThemeProvider as ThemeProvider5 } from "@elementor/ui";
|
|
1082
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
1083
|
+
var DEFAULT = 1;
|
|
1084
|
+
var items2 = [
|
|
1085
|
+
{
|
|
1086
|
+
value: "flex-grow",
|
|
1087
|
+
label: __13("Grow", "elementor"),
|
|
1088
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(ExpandIcon, { fontSize: size }),
|
|
1089
|
+
showTooltip: true
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
value: "flex-shrink",
|
|
1093
|
+
label: __13("Shrink", "elementor"),
|
|
1094
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(ShrinkIcon, { fontSize: size }),
|
|
1095
|
+
showTooltip: true
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
value: "custom",
|
|
1099
|
+
label: __13("Custom", "elementor"),
|
|
1100
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(PencilIcon2, { fontSize: size }),
|
|
1101
|
+
showTooltip: true
|
|
1102
|
+
}
|
|
1103
|
+
];
|
|
1104
|
+
var FlexSizeField = () => {
|
|
1105
|
+
const { isSiteRtl } = useDirection(), [growField, setGrowField] = useStylesField("flex-grow"), [shrinkField, setShrinkField] = useStylesField("flex-shrink"), [basisField, setBasisField] = useStylesField("flex-basis");
|
|
1106
|
+
const grow = growField?.value || null, shrink = shrinkField?.value || null, basis = basisField?.value || null;
|
|
1107
|
+
const currentGroup = React31.useMemo(() => getActiveGroup({ grow, shrink, basis }), [grow, shrink, basis]), [activeGroup, setActiveGroup] = React31.useState(currentGroup);
|
|
1108
|
+
const onChangeGroup = (group = null) => {
|
|
1109
|
+
setActiveGroup(group);
|
|
1110
|
+
setBasisField(null);
|
|
1111
|
+
if (!group || group === "custom") {
|
|
1112
|
+
setGrowField(null);
|
|
1113
|
+
setShrinkField(null);
|
|
1114
|
+
return;
|
|
1115
|
+
}
|
|
1116
|
+
if (group === "flex-grow") {
|
|
1117
|
+
setGrowField({ $$type: "number", value: DEFAULT });
|
|
1118
|
+
setShrinkField(null);
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
setGrowField(null);
|
|
1122
|
+
setShrinkField({ $$type: "number", value: DEFAULT });
|
|
1123
|
+
};
|
|
1124
|
+
return /* @__PURE__ */ React31.createElement(DirectionProvider5, { rtl: isSiteRtl }, /* @__PURE__ */ React31.createElement(ThemeProvider5, null, /* @__PURE__ */ React31.createElement(Stack10, { gap: 2 }, /* @__PURE__ */ React31.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlLabel11, null, __13("Size", "elementor"))), /* @__PURE__ */ React31.createElement(Grid8, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(
|
|
1125
|
+
ControlToggleButtonGroup2,
|
|
1126
|
+
{
|
|
1127
|
+
value: activeGroup,
|
|
1128
|
+
onChange: onChangeGroup,
|
|
1129
|
+
items: items2,
|
|
1130
|
+
exclusive: true
|
|
1131
|
+
}
|
|
1132
|
+
))), "custom" === activeGroup && /* @__PURE__ */ React31.createElement(FlexCustomField, null))));
|
|
1133
|
+
};
|
|
1134
|
+
var FlexCustomField = () => /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(StylesField, { bind: "flex-grow" }, /* @__PURE__ */ React31.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlLabel11, null, __13("Grow", "elementor"))), /* @__PURE__ */ React31.createElement(Grid8, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(NumberControl2, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React31.createElement(StylesField, { bind: "flex-shrink" }, /* @__PURE__ */ React31.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlLabel11, null, __13("Shrink", "elementor"))), /* @__PURE__ */ React31.createElement(Grid8, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(NumberControl2, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React31.createElement(StylesField, { bind: "flex-basis" }, /* @__PURE__ */ React31.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlLabel11, null, __13("Basis", "elementor"))), /* @__PURE__ */ React31.createElement(Grid8, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(SizeControl2, null)))));
|
|
1135
|
+
var getActiveGroup = ({
|
|
1136
|
+
grow,
|
|
1137
|
+
shrink,
|
|
1138
|
+
basis
|
|
1139
|
+
}) => {
|
|
1140
|
+
if (null === grow && null === shrink && !basis) {
|
|
1141
|
+
return null;
|
|
1142
|
+
}
|
|
1143
|
+
if (shrink && grow || basis) {
|
|
1144
|
+
return "custom";
|
|
1145
|
+
}
|
|
1146
|
+
if (grow === DEFAULT) {
|
|
1147
|
+
return "flex-grow";
|
|
1148
|
+
}
|
|
1149
|
+
if (shrink === DEFAULT) {
|
|
1150
|
+
return "flex-shrink";
|
|
1151
|
+
}
|
|
1152
|
+
return "custom";
|
|
1153
|
+
};
|
|
1154
|
+
|
|
995
1155
|
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
996
|
-
import * as
|
|
997
|
-
import { ControlLabel as
|
|
1156
|
+
import * as React32 from "react";
|
|
1157
|
+
import { ControlLabel as ControlLabel12, ToggleControl as ToggleControl5 } from "@elementor/editor-controls";
|
|
998
1158
|
import {
|
|
999
1159
|
JustifyBottomIcon,
|
|
1000
|
-
JustifyCenterIcon as
|
|
1160
|
+
JustifyCenterIcon as CenterIcon3,
|
|
1001
1161
|
JustifyDistributeVerticalIcon as EvenlyIcon,
|
|
1002
1162
|
JustifySpaceAroundVerticalIcon as AroundIcon,
|
|
1003
1163
|
JustifySpaceBetweenVerticalIcon as BetweenIcon,
|
|
1004
1164
|
JustifyTopIcon
|
|
1005
1165
|
} from "@elementor/icons";
|
|
1006
|
-
import {
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
import { __ as __12 } from "@wordpress/i18n";
|
|
1014
|
-
var JustifyContentField = () => {
|
|
1015
|
-
const options7 = useOptions3(), { isSiteRtl } = useDirection();
|
|
1016
|
-
return /* @__PURE__ */ React29.createElement(DirectionProvider4, { rtl: isSiteRtl }, /* @__PURE__ */ React29.createElement(ThemeProvider4, null, /* @__PURE__ */ React29.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React29.createElement(Stack10, { gap: 1 }, /* @__PURE__ */ React29.createElement(ControlLabel10, null, __12("Justify Content", "elementor")), /* @__PURE__ */ React29.createElement(ToggleControl4, { options: options7, fullWidth: true })))));
|
|
1017
|
-
};
|
|
1018
|
-
var useOptions3 = () => {
|
|
1019
|
-
const StartIcon = withDirection3(JustifyTopIcon), EndIcon = withDirection3(JustifyBottomIcon);
|
|
1020
|
-
return [
|
|
1021
|
-
{
|
|
1022
|
-
value: "start",
|
|
1023
|
-
label: __12("Start", "elementor"),
|
|
1024
|
-
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon2, { icon: StartIcon, size }),
|
|
1025
|
-
showTooltip: true
|
|
1026
|
-
},
|
|
1027
|
-
{
|
|
1028
|
-
value: "center",
|
|
1029
|
-
label: __12("Center", "elementor"),
|
|
1030
|
-
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon2, { icon: CenterIcon2, size }),
|
|
1031
|
-
showTooltip: true
|
|
1032
|
-
},
|
|
1033
|
-
{
|
|
1034
|
-
value: "end",
|
|
1035
|
-
label: __12("End", "elementor"),
|
|
1036
|
-
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon2, { icon: EndIcon, size }),
|
|
1037
|
-
showTooltip: true
|
|
1038
|
-
},
|
|
1039
|
-
{
|
|
1040
|
-
value: "space-between",
|
|
1041
|
-
label: __12("Space between", "elementor"),
|
|
1042
|
-
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon2, { icon: BetweenIcon, size }),
|
|
1043
|
-
showTooltip: true
|
|
1044
|
-
},
|
|
1045
|
-
{
|
|
1046
|
-
value: "space-around",
|
|
1047
|
-
label: __12("Space around", "elementor"),
|
|
1048
|
-
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon2, { icon: AroundIcon, size }),
|
|
1049
|
-
showTooltip: true
|
|
1050
|
-
},
|
|
1051
|
-
{
|
|
1052
|
-
value: "space-evenly",
|
|
1053
|
-
label: __12("Space evenly", "elementor"),
|
|
1054
|
-
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon2, { icon: EvenlyIcon, size }),
|
|
1055
|
-
showTooltip: true
|
|
1056
|
-
}
|
|
1057
|
-
];
|
|
1166
|
+
import { DirectionProvider as DirectionProvider6, Stack as Stack11, ThemeProvider as ThemeProvider6, withDirection as withDirection4 } from "@elementor/ui";
|
|
1167
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
1168
|
+
var StartIcon3 = withDirection4(JustifyTopIcon);
|
|
1169
|
+
var EndIcon3 = withDirection4(JustifyBottomIcon);
|
|
1170
|
+
var iconProps3 = {
|
|
1171
|
+
isClockwise: true,
|
|
1172
|
+
offset: -90
|
|
1058
1173
|
};
|
|
1059
|
-
var
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
{
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1174
|
+
var options4 = [
|
|
1175
|
+
{
|
|
1176
|
+
value: "start",
|
|
1177
|
+
label: __14("Start", "elementor"),
|
|
1178
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: StartIcon3, size, ...iconProps3 }),
|
|
1179
|
+
showTooltip: true
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
value: "center",
|
|
1183
|
+
label: __14("Center", "elementor"),
|
|
1184
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: CenterIcon3, size, ...iconProps3 }),
|
|
1185
|
+
showTooltip: true
|
|
1186
|
+
},
|
|
1187
|
+
{
|
|
1188
|
+
value: "end",
|
|
1189
|
+
label: __14("End", "elementor"),
|
|
1190
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: EndIcon3, size, ...iconProps3 }),
|
|
1191
|
+
showTooltip: true
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
value: "space-between",
|
|
1195
|
+
label: __14("Space between", "elementor"),
|
|
1196
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: BetweenIcon, size, ...iconProps3 }),
|
|
1197
|
+
showTooltip: true
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
value: "space-around",
|
|
1201
|
+
label: __14("Space around", "elementor"),
|
|
1202
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: AroundIcon, size, ...iconProps3 }),
|
|
1203
|
+
showTooltip: true
|
|
1204
|
+
},
|
|
1205
|
+
{
|
|
1206
|
+
value: "space-evenly",
|
|
1207
|
+
label: __14("Space evenly", "elementor"),
|
|
1208
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(RotatedIcon, { icon: EvenlyIcon, size, ...iconProps3 }),
|
|
1209
|
+
showTooltip: true
|
|
1210
|
+
}
|
|
1211
|
+
];
|
|
1212
|
+
var JustifyContentField = () => {
|
|
1213
|
+
const { isSiteRtl } = useDirection();
|
|
1214
|
+
return /* @__PURE__ */ React32.createElement(DirectionProvider6, { rtl: isSiteRtl }, /* @__PURE__ */ React32.createElement(ThemeProvider6, null, /* @__PURE__ */ React32.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React32.createElement(Stack11, { gap: 1 }, /* @__PURE__ */ React32.createElement(ControlLabel12, null, __14("Justify content", "elementor")), /* @__PURE__ */ React32.createElement(ToggleControl5, { options: options4, fullWidth: true })))));
|
|
1074
1215
|
};
|
|
1075
1216
|
|
|
1076
1217
|
// src/components/style-sections/layout-section/wrap-field.tsx
|
|
1077
|
-
import * as
|
|
1078
|
-
import { ControlLabel as
|
|
1218
|
+
import * as React33 from "react";
|
|
1219
|
+
import { ControlLabel as ControlLabel13, ToggleControl as ToggleControl6 } from "@elementor/editor-controls";
|
|
1079
1220
|
import { ArrowBackIcon, ArrowForwardIcon, ArrowRightIcon as ArrowRightIcon2 } from "@elementor/icons";
|
|
1080
|
-
import { DirectionProvider as
|
|
1081
|
-
import { __ as
|
|
1082
|
-
var
|
|
1221
|
+
import { DirectionProvider as DirectionProvider7, Grid as Grid9, ThemeProvider as ThemeProvider7 } from "@elementor/ui";
|
|
1222
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
1223
|
+
var options5 = [
|
|
1083
1224
|
{
|
|
1084
1225
|
value: "nowrap",
|
|
1085
|
-
label:
|
|
1086
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1226
|
+
label: __15("No wrap", "elementor"),
|
|
1227
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(ArrowRightIcon2, { fontSize: size }),
|
|
1087
1228
|
showTooltip: true
|
|
1088
1229
|
},
|
|
1089
1230
|
{
|
|
1090
1231
|
value: "wrap",
|
|
1091
|
-
label:
|
|
1092
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1232
|
+
label: __15("Wrap", "elementor"),
|
|
1233
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(ArrowBackIcon, { fontSize: size }),
|
|
1093
1234
|
showTooltip: true
|
|
1094
1235
|
},
|
|
1095
1236
|
{
|
|
1096
1237
|
value: "wrap-reverse",
|
|
1097
|
-
label:
|
|
1098
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1238
|
+
label: __15("Reversed wrap", "elementor"),
|
|
1239
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(ArrowForwardIcon, { fontSize: size }),
|
|
1099
1240
|
showTooltip: true
|
|
1100
1241
|
}
|
|
1101
1242
|
];
|
|
1102
1243
|
var WrapField = () => {
|
|
1103
1244
|
const { isSiteRtl } = useDirection();
|
|
1104
|
-
return /* @__PURE__ */
|
|
1245
|
+
return /* @__PURE__ */ React33.createElement(DirectionProvider7, { rtl: isSiteRtl }, /* @__PURE__ */ React33.createElement(ThemeProvider7, null, /* @__PURE__ */ React33.createElement(StylesField, { bind: "flex-wrap" }, /* @__PURE__ */ React33.createElement(Grid9, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(ControlLabel13, null, __15("Wrap", "elementor"))), /* @__PURE__ */ React33.createElement(Grid9, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React33.createElement(ToggleControl6, { options: options5 }))))));
|
|
1105
1246
|
};
|
|
1106
1247
|
|
|
1107
1248
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
1108
1249
|
var LayoutSection = () => {
|
|
1109
1250
|
const [display] = useStylesField("display");
|
|
1110
|
-
return /* @__PURE__ */
|
|
1251
|
+
return /* @__PURE__ */ React34.createElement(Stack12, { gap: 2 }, /* @__PURE__ */ React34.createElement(DisplayField, null), "flex" === display?.value && /* @__PURE__ */ React34.createElement(FlexFields, null));
|
|
1111
1252
|
};
|
|
1112
|
-
var FlexFields = () => /* @__PURE__ */
|
|
1253
|
+
var FlexFields = () => /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(FlexDirectionField, null), /* @__PURE__ */ React34.createElement(JustifyContentField, null), /* @__PURE__ */ React34.createElement(AlignItemsField, null), /* @__PURE__ */ React34.createElement(Divider3, null), /* @__PURE__ */ React34.createElement(WrapField, null), /* @__PURE__ */ React34.createElement(Divider3, null), /* @__PURE__ */ React34.createElement(ControlLabel14, null, __16("Flex child", "elementor")), /* @__PURE__ */ React34.createElement(AlignSelfChild, null), /* @__PURE__ */ React34.createElement(FlexOrderField, null), /* @__PURE__ */ React34.createElement(FlexSizeField, null));
|
|
1113
1254
|
|
|
1114
1255
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1115
|
-
import * as
|
|
1256
|
+
import * as React38 from "react";
|
|
1116
1257
|
import { useCallback as useCallback3 } from "react";
|
|
1117
|
-
import { Stack as
|
|
1258
|
+
import { Stack as Stack14 } from "@elementor/ui";
|
|
1118
1259
|
|
|
1119
1260
|
// src/hooks/use-style-prop-history.ts
|
|
1120
|
-
import { useCallback as useCallback2, useMemo as
|
|
1261
|
+
import { useCallback as useCallback2, useMemo as useMemo3 } from "react";
|
|
1121
1262
|
import { getElementStyles, getVariantByMeta, updateStyle as updateStyle2 } from "@elementor/editor-elements";
|
|
1122
1263
|
|
|
1123
1264
|
// src/hooks/use-prop-value-history.ts
|
|
1124
|
-
import { useCallback, useMemo } from "react";
|
|
1265
|
+
import { useCallback, useMemo as useMemo2 } from "react";
|
|
1125
1266
|
import { getSessionStorageItem, setSessionStorageItem } from "@elementor/utils";
|
|
1126
1267
|
var PROPS_VALUES_HISTORY_PREFIX = "elementor/editor-editing-panel/prop-value-history";
|
|
1127
1268
|
var usePropValueHistory = () => {
|
|
@@ -1155,7 +1296,7 @@ var usePropValueHistory = () => {
|
|
|
1155
1296
|
},
|
|
1156
1297
|
[getElementPropsHistory, elementKey]
|
|
1157
1298
|
);
|
|
1158
|
-
return
|
|
1299
|
+
return useMemo2(() => ({ getPropValue, setPropValue, removeProp }), [getPropValue, removeProp, setPropValue]);
|
|
1159
1300
|
};
|
|
1160
1301
|
|
|
1161
1302
|
// src/hooks/use-style-prop-history.ts
|
|
@@ -1211,53 +1352,53 @@ var useStylePropsHistory = (props) => {
|
|
|
1211
1352
|
bind: "classes"
|
|
1212
1353
|
});
|
|
1213
1354
|
}, [element.id, meta, props, styleDefID]);
|
|
1214
|
-
return
|
|
1355
|
+
return useMemo3(
|
|
1215
1356
|
() => ({ saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps }),
|
|
1216
1357
|
[saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps]
|
|
1217
1358
|
);
|
|
1218
1359
|
};
|
|
1219
1360
|
|
|
1220
1361
|
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
1221
|
-
import * as
|
|
1222
|
-
import { ControlLabel as
|
|
1362
|
+
import * as React35 from "react";
|
|
1363
|
+
import { ControlLabel as ControlLabel15, SizeControl as SizeControl3 } from "@elementor/editor-controls";
|
|
1223
1364
|
import { SideBottomIcon as SideBottomIcon2, SideLeftIcon as SideLeftIcon2, SideRightIcon as SideRightIcon2, SideTopIcon as SideTopIcon2 } from "@elementor/icons";
|
|
1224
|
-
import { Grid as
|
|
1225
|
-
import { __ as
|
|
1365
|
+
import { Grid as Grid10, Stack as Stack13 } from "@elementor/ui";
|
|
1366
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
1226
1367
|
var sideIcons = {
|
|
1227
|
-
left: /* @__PURE__ */
|
|
1228
|
-
right: /* @__PURE__ */
|
|
1229
|
-
top: /* @__PURE__ */
|
|
1230
|
-
bottom: /* @__PURE__ */
|
|
1368
|
+
left: /* @__PURE__ */ React35.createElement(SideLeftIcon2, { fontSize: "tiny" }),
|
|
1369
|
+
right: /* @__PURE__ */ React35.createElement(SideRightIcon2, { fontSize: "tiny" }),
|
|
1370
|
+
top: /* @__PURE__ */ React35.createElement(SideTopIcon2, { fontSize: "tiny" }),
|
|
1371
|
+
bottom: /* @__PURE__ */ React35.createElement(SideBottomIcon2, { fontSize: "tiny" })
|
|
1231
1372
|
};
|
|
1232
1373
|
var DimensionsField = () => {
|
|
1233
|
-
return /* @__PURE__ */
|
|
1374
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(Stack13, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(DimensionField, { side: "top", label: __17("Top", "elementor") }), /* @__PURE__ */ React35.createElement(DimensionField, { side: "right", label: __17("Right", "elementor") })), /* @__PURE__ */ React35.createElement(Stack13, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(DimensionField, { side: "bottom", label: __17("Bottom", "elementor") }), /* @__PURE__ */ React35.createElement(DimensionField, { side: "left", label: __17("Left", "elementor") })));
|
|
1234
1375
|
};
|
|
1235
1376
|
var DimensionField = ({ side, label }) => {
|
|
1236
|
-
return /* @__PURE__ */
|
|
1377
|
+
return /* @__PURE__ */ React35.createElement(Grid10, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(ControlLabel15, null, label)), /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(StylesField, { bind: side }, /* @__PURE__ */ React35.createElement(SizeControl3, { startIcon: sideIcons[side] }))));
|
|
1237
1378
|
};
|
|
1238
1379
|
|
|
1239
1380
|
// src/components/style-sections/position-section/position-field.tsx
|
|
1240
|
-
import * as
|
|
1241
|
-
import { ControlLabel as
|
|
1242
|
-
import { Grid as
|
|
1243
|
-
import { __ as
|
|
1381
|
+
import * as React36 from "react";
|
|
1382
|
+
import { ControlLabel as ControlLabel16, SelectControl as SelectControl3 } from "@elementor/editor-controls";
|
|
1383
|
+
import { Grid as Grid11 } from "@elementor/ui";
|
|
1384
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
1244
1385
|
var positionOptions = [
|
|
1245
|
-
{ label:
|
|
1246
|
-
{ label:
|
|
1247
|
-
{ label:
|
|
1248
|
-
{ label:
|
|
1386
|
+
{ label: __18("Static", "elementor"), value: "static" },
|
|
1387
|
+
{ label: __18("Relative", "elementor"), value: "relative" },
|
|
1388
|
+
{ label: __18("Absolute", "elementor"), value: "absolute" },
|
|
1389
|
+
{ label: __18("Fixed", "elementor"), value: "fixed" }
|
|
1249
1390
|
];
|
|
1250
1391
|
var PositionField = () => {
|
|
1251
|
-
return /* @__PURE__ */
|
|
1392
|
+
return /* @__PURE__ */ React36.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React36.createElement(Grid11, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel16, null, __18("Position", "elementor"))), /* @__PURE__ */ React36.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(SelectControl3, { options: positionOptions }))));
|
|
1252
1393
|
};
|
|
1253
1394
|
|
|
1254
1395
|
// src/components/style-sections/position-section/z-index-field.tsx
|
|
1255
|
-
import * as
|
|
1256
|
-
import { ControlLabel as
|
|
1257
|
-
import { Grid as
|
|
1258
|
-
import { __ as
|
|
1396
|
+
import * as React37 from "react";
|
|
1397
|
+
import { ControlLabel as ControlLabel17, NumberControl as NumberControl3 } from "@elementor/editor-controls";
|
|
1398
|
+
import { Grid as Grid12 } from "@elementor/ui";
|
|
1399
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
1259
1400
|
var ZIndexField = () => {
|
|
1260
|
-
return /* @__PURE__ */
|
|
1401
|
+
return /* @__PURE__ */ React37.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React37.createElement(Grid12, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel17, null, __19("Z-Index", "elementor"))), /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(NumberControl3, null))));
|
|
1261
1402
|
};
|
|
1262
1403
|
|
|
1263
1404
|
// src/components/style-sections/position-section/position-section.tsx
|
|
@@ -1265,8 +1406,8 @@ var dimensionsPropKeys = ["top", "bottom", "left", "right"];
|
|
|
1265
1406
|
var PositionSection = () => {
|
|
1266
1407
|
const [positionValue] = useStylesField("position");
|
|
1267
1408
|
usePositionChangeHandler();
|
|
1268
|
-
const isNotStatic = positionValue && positionValue !== "static";
|
|
1269
|
-
return /* @__PURE__ */
|
|
1409
|
+
const isNotStatic = positionValue && positionValue?.value !== "static";
|
|
1410
|
+
return /* @__PURE__ */ React38.createElement(Stack14, { gap: 1.5 }, /* @__PURE__ */ React38.createElement(PositionField, null), isNotStatic ? /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement(DimensionsField, null), /* @__PURE__ */ React38.createElement(ZIndexField, null)) : null);
|
|
1270
1411
|
};
|
|
1271
1412
|
var usePositionChangeHandler = () => {
|
|
1272
1413
|
const dimensionsHistory = useStylePropsHistory(dimensionsPropKeys);
|
|
@@ -1291,73 +1432,73 @@ var usePositionChangeHandler = () => {
|
|
|
1291
1432
|
};
|
|
1292
1433
|
|
|
1293
1434
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1294
|
-
import * as
|
|
1295
|
-
import { ControlLabel as
|
|
1296
|
-
import { Divider as Divider4, Grid as
|
|
1297
|
-
import { __ as
|
|
1435
|
+
import * as React40 from "react";
|
|
1436
|
+
import { ControlLabel as ControlLabel19, SizeControl as SizeControl4 } from "@elementor/editor-controls";
|
|
1437
|
+
import { Divider as Divider4, Grid as Grid14, Stack as Stack15 } from "@elementor/ui";
|
|
1438
|
+
import { __ as __21 } from "@wordpress/i18n";
|
|
1298
1439
|
|
|
1299
1440
|
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1300
|
-
import * as
|
|
1301
|
-
import { ControlLabel as
|
|
1441
|
+
import * as React39 from "react";
|
|
1442
|
+
import { ControlLabel as ControlLabel18, ToggleControl as ToggleControl7 } from "@elementor/editor-controls";
|
|
1302
1443
|
import { ExpandBottomIcon, EyeIcon, EyeOffIcon } from "@elementor/icons";
|
|
1303
|
-
import { Grid as
|
|
1304
|
-
import { __ as
|
|
1305
|
-
var
|
|
1444
|
+
import { Grid as Grid13 } from "@elementor/ui";
|
|
1445
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
1446
|
+
var options6 = [
|
|
1306
1447
|
{
|
|
1307
1448
|
value: "visible",
|
|
1308
|
-
label:
|
|
1309
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1449
|
+
label: __20("Visible", "elementor"),
|
|
1450
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(EyeIcon, { fontSize: size }),
|
|
1310
1451
|
showTooltip: true
|
|
1311
1452
|
},
|
|
1312
1453
|
{
|
|
1313
1454
|
value: "hidden",
|
|
1314
|
-
label:
|
|
1315
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1455
|
+
label: __20("Hidden", "elementor"),
|
|
1456
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(EyeOffIcon, { fontSize: size }),
|
|
1316
1457
|
showTooltip: true
|
|
1317
1458
|
},
|
|
1318
1459
|
{
|
|
1319
1460
|
value: "auto",
|
|
1320
|
-
label:
|
|
1321
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1461
|
+
label: __20("Auto", "elementor"),
|
|
1462
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(ExpandBottomIcon, { fontSize: size }),
|
|
1322
1463
|
showTooltip: true
|
|
1323
1464
|
}
|
|
1324
1465
|
];
|
|
1325
1466
|
var OverflowField = () => {
|
|
1326
|
-
return /* @__PURE__ */
|
|
1467
|
+
return /* @__PURE__ */ React39.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React39.createElement(Grid13, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel18, null, __20("Overflow", "elementor"))), /* @__PURE__ */ React39.createElement(Grid13, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React39.createElement(ToggleControl7, { options: options6 }))));
|
|
1327
1468
|
};
|
|
1328
1469
|
|
|
1329
1470
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1330
1471
|
var SizeSection = () => {
|
|
1331
|
-
return /* @__PURE__ */
|
|
1472
|
+
return /* @__PURE__ */ React40.createElement(Stack15, { gap: 1.5 }, /* @__PURE__ */ React40.createElement(Grid14, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(SizeField, { bind: "width", label: __21("Width", "elementor") })), /* @__PURE__ */ React40.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(SizeField, { bind: "height", label: __21("Height", "elementor") }))), /* @__PURE__ */ React40.createElement(Grid14, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(SizeField, { bind: "min-width", label: __21("Min. Width", "elementor") })), /* @__PURE__ */ React40.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(SizeField, { bind: "min-height", label: __21("Min. Height", "elementor") }))), /* @__PURE__ */ React40.createElement(Grid14, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(SizeField, { bind: "max-width", label: __21("Max. Width", "elementor") })), /* @__PURE__ */ React40.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(SizeField, { bind: "max-height", label: __21("Max. Height", "elementor") }))), /* @__PURE__ */ React40.createElement(Divider4, null), /* @__PURE__ */ React40.createElement(Stack15, null, /* @__PURE__ */ React40.createElement(OverflowField, null)));
|
|
1332
1473
|
};
|
|
1333
1474
|
var SizeField = ({ label, bind }) => {
|
|
1334
|
-
return /* @__PURE__ */
|
|
1475
|
+
return /* @__PURE__ */ React40.createElement(StylesField, { bind }, /* @__PURE__ */ React40.createElement(Grid14, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React40.createElement(Grid14, { item: true, xs: 12 }, /* @__PURE__ */ React40.createElement(ControlLabel19, null, label)), /* @__PURE__ */ React40.createElement(Grid14, { item: true, xs: 12 }, /* @__PURE__ */ React40.createElement(SizeControl4, null))));
|
|
1335
1476
|
};
|
|
1336
1477
|
|
|
1337
1478
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1338
|
-
import * as
|
|
1479
|
+
import * as React41 from "react";
|
|
1339
1480
|
import { LinkedDimensionsControl } from "@elementor/editor-controls";
|
|
1340
|
-
import { Divider as Divider5, Stack as
|
|
1341
|
-
import { __ as
|
|
1481
|
+
import { Divider as Divider5, Stack as Stack16 } from "@elementor/ui";
|
|
1482
|
+
import { __ as __22 } from "@wordpress/i18n";
|
|
1342
1483
|
var SpacingSection = () => {
|
|
1343
|
-
return /* @__PURE__ */
|
|
1484
|
+
return /* @__PURE__ */ React41.createElement(Stack16, { gap: 1.5 }, /* @__PURE__ */ React41.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React41.createElement(LinkedDimensionsControl, { label: __22("Padding", "elementor") })), /* @__PURE__ */ React41.createElement(Divider5, null), /* @__PURE__ */ React41.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React41.createElement(LinkedDimensionsControl, { label: __22("Margin", "elementor") })));
|
|
1344
1485
|
};
|
|
1345
1486
|
|
|
1346
1487
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1347
|
-
import * as
|
|
1348
|
-
import { Divider as Divider6, Stack as
|
|
1488
|
+
import * as React55 from "react";
|
|
1489
|
+
import { Divider as Divider6, Stack as Stack18 } from "@elementor/ui";
|
|
1349
1490
|
|
|
1350
1491
|
// src/components/collapsible-content.tsx
|
|
1351
|
-
import * as
|
|
1352
|
-
import { useState as
|
|
1353
|
-
import { Button, Collapse as Collapse3, Stack as
|
|
1354
|
-
import { __ as
|
|
1492
|
+
import * as React42 from "react";
|
|
1493
|
+
import { useState as useState4 } from "react";
|
|
1494
|
+
import { Button, Collapse as Collapse3, Stack as Stack17 } from "@elementor/ui";
|
|
1495
|
+
import { __ as __23 } from "@wordpress/i18n";
|
|
1355
1496
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
1356
|
-
const [open, setOpen] =
|
|
1497
|
+
const [open, setOpen] = useState4(defaultOpen);
|
|
1357
1498
|
const handleToggle = () => {
|
|
1358
1499
|
setOpen((prevOpen) => !prevOpen);
|
|
1359
1500
|
};
|
|
1360
|
-
return /* @__PURE__ */
|
|
1501
|
+
return /* @__PURE__ */ React42.createElement(Stack17, { sx: { py: 0.5 } }, /* @__PURE__ */ React42.createElement(
|
|
1361
1502
|
Button,
|
|
1362
1503
|
{
|
|
1363
1504
|
fullWidth: true,
|
|
@@ -1365,17 +1506,17 @@ var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
|
1365
1506
|
color: "secondary",
|
|
1366
1507
|
variant: "outlined",
|
|
1367
1508
|
onClick: handleToggle,
|
|
1368
|
-
endIcon: /* @__PURE__ */
|
|
1509
|
+
endIcon: /* @__PURE__ */ React42.createElement(CollapseIcon, { open })
|
|
1369
1510
|
},
|
|
1370
|
-
open ?
|
|
1371
|
-
), /* @__PURE__ */
|
|
1511
|
+
open ? __23("Show less", "elementor") : __23("Show more", "elementor")
|
|
1512
|
+
), /* @__PURE__ */ React42.createElement(Collapse3, { in: open, timeout: "auto", unmountOnExit: true }, children));
|
|
1372
1513
|
};
|
|
1373
1514
|
|
|
1374
1515
|
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1375
|
-
import * as
|
|
1376
|
-
import { ControlLabel as
|
|
1377
|
-
import { Grid as
|
|
1378
|
-
import { __ as
|
|
1516
|
+
import * as React43 from "react";
|
|
1517
|
+
import { ControlLabel as ControlLabel20, FontFamilyControl } from "@elementor/editor-controls";
|
|
1518
|
+
import { Grid as Grid15 } from "@elementor/ui";
|
|
1519
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
1379
1520
|
|
|
1380
1521
|
// src/sync/get-elementor-config.ts
|
|
1381
1522
|
var getElementorConfig = () => {
|
|
@@ -1389,118 +1530,127 @@ var FontFamilyField = () => {
|
|
|
1389
1530
|
if (!fontFamilies) {
|
|
1390
1531
|
return null;
|
|
1391
1532
|
}
|
|
1392
|
-
return /* @__PURE__ */
|
|
1533
|
+
return /* @__PURE__ */ React43.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React43.createElement(Grid15, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React43.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(ControlLabel20, null, __24("Font Family", "elementor"))), /* @__PURE__ */ React43.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(FontFamilyControl, { fontFamilies }))));
|
|
1393
1534
|
};
|
|
1394
1535
|
var getFontFamilies = () => {
|
|
1395
1536
|
const { controls } = getElementorConfig();
|
|
1396
|
-
const
|
|
1397
|
-
if (!
|
|
1537
|
+
const options10 = controls?.font?.options;
|
|
1538
|
+
if (!options10) {
|
|
1398
1539
|
return null;
|
|
1399
1540
|
}
|
|
1400
|
-
return
|
|
1541
|
+
return options10;
|
|
1401
1542
|
};
|
|
1402
1543
|
|
|
1403
1544
|
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1404
|
-
import * as
|
|
1405
|
-
import { ControlLabel as
|
|
1406
|
-
import { Grid as
|
|
1407
|
-
import { __ as
|
|
1545
|
+
import * as React44 from "react";
|
|
1546
|
+
import { ControlLabel as ControlLabel21, SizeControl as SizeControl5 } from "@elementor/editor-controls";
|
|
1547
|
+
import { Grid as Grid16 } from "@elementor/ui";
|
|
1548
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
1408
1549
|
var FontSizeField = () => {
|
|
1409
|
-
return /* @__PURE__ */
|
|
1550
|
+
return /* @__PURE__ */ React44.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React44.createElement(Grid16, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React44.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(ControlLabel21, null, __25("Font Size", "elementor"))), /* @__PURE__ */ React44.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(SizeControl5, null))));
|
|
1410
1551
|
};
|
|
1411
1552
|
|
|
1412
1553
|
// src/components/style-sections/typography-section/font-weight-field.tsx
|
|
1413
|
-
import * as
|
|
1414
|
-
import { ControlLabel as
|
|
1415
|
-
import { Grid as
|
|
1416
|
-
import { __ as
|
|
1554
|
+
import * as React45 from "react";
|
|
1555
|
+
import { ControlLabel as ControlLabel22, SelectControl as SelectControl4 } from "@elementor/editor-controls";
|
|
1556
|
+
import { Grid as Grid17 } from "@elementor/ui";
|
|
1557
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
1417
1558
|
var fontWeightOptions = [
|
|
1418
|
-
{ label:
|
|
1419
|
-
{ label:
|
|
1420
|
-
{ label:
|
|
1421
|
-
{ label:
|
|
1422
|
-
{ label:
|
|
1559
|
+
{ label: __26("Light - 400", "elementor"), value: "400" },
|
|
1560
|
+
{ label: __26("Regular - 500", "elementor"), value: "500" },
|
|
1561
|
+
{ label: __26("Semi Bold - 600", "elementor"), value: "600" },
|
|
1562
|
+
{ label: __26("Bold - 700", "elementor"), value: "700" },
|
|
1563
|
+
{ label: __26("Black - 900", "elementor"), value: "900" }
|
|
1423
1564
|
];
|
|
1424
1565
|
var FontWeightField = () => {
|
|
1425
|
-
return /* @__PURE__ */
|
|
1566
|
+
return /* @__PURE__ */ React45.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React45.createElement(Grid17, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(ControlLabel22, null, __26("Font Weight", "elementor"))), /* @__PURE__ */ React45.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(SelectControl4, { options: fontWeightOptions }))));
|
|
1426
1567
|
};
|
|
1427
1568
|
|
|
1428
1569
|
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
1429
|
-
import * as
|
|
1430
|
-
import { ControlLabel as
|
|
1431
|
-
import { Grid as
|
|
1432
|
-
import { __ as
|
|
1570
|
+
import * as React46 from "react";
|
|
1571
|
+
import { ControlLabel as ControlLabel23, SizeControl as SizeControl6 } from "@elementor/editor-controls";
|
|
1572
|
+
import { Grid as Grid18 } from "@elementor/ui";
|
|
1573
|
+
import { __ as __27 } from "@wordpress/i18n";
|
|
1433
1574
|
var LetterSpacingField = () => {
|
|
1434
|
-
return /* @__PURE__ */
|
|
1575
|
+
return /* @__PURE__ */ React46.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React46.createElement(Grid18, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlLabel23, null, __27("Letter Spacing", "elementor"))), /* @__PURE__ */ React46.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(SizeControl6, null))));
|
|
1576
|
+
};
|
|
1577
|
+
|
|
1578
|
+
// src/components/style-sections/typography-section/line-height-field.tsx
|
|
1579
|
+
import * as React47 from "react";
|
|
1580
|
+
import { ControlLabel as ControlLabel24, SizeControl as SizeControl7 } from "@elementor/editor-controls";
|
|
1581
|
+
import { Grid as Grid19 } from "@elementor/ui";
|
|
1582
|
+
import { __ as __28 } from "@wordpress/i18n";
|
|
1583
|
+
var LineHeightField = () => {
|
|
1584
|
+
return /* @__PURE__ */ React47.createElement(StylesField, { bind: "line-height" }, /* @__PURE__ */ React47.createElement(Grid19, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React47.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(ControlLabel24, null, __28("Line Height", "elementor"))), /* @__PURE__ */ React47.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(SizeControl7, null))));
|
|
1435
1585
|
};
|
|
1436
1586
|
|
|
1437
1587
|
// src/components/style-sections/typography-section/text-alignment-field.tsx
|
|
1438
|
-
import * as
|
|
1439
|
-
import { ControlLabel as
|
|
1588
|
+
import * as React48 from "react";
|
|
1589
|
+
import { ControlLabel as ControlLabel25, ToggleControl as ToggleControl8 } from "@elementor/editor-controls";
|
|
1440
1590
|
import { AlignCenterIcon, AlignJustifiedIcon, AlignLeftIcon, AlignRightIcon } from "@elementor/icons";
|
|
1441
|
-
import { Grid as
|
|
1442
|
-
import { __ as
|
|
1443
|
-
var
|
|
1591
|
+
import { Grid as Grid20 } from "@elementor/ui";
|
|
1592
|
+
import { __ as __29 } from "@wordpress/i18n";
|
|
1593
|
+
var options7 = [
|
|
1444
1594
|
{
|
|
1445
1595
|
value: "left",
|
|
1446
|
-
label:
|
|
1447
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1596
|
+
label: __29("Left", "elementor"),
|
|
1597
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(AlignLeftIcon, { fontSize: size })
|
|
1448
1598
|
},
|
|
1449
1599
|
{
|
|
1450
1600
|
value: "center",
|
|
1451
|
-
label:
|
|
1452
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1601
|
+
label: __29("Center", "elementor"),
|
|
1602
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(AlignCenterIcon, { fontSize: size })
|
|
1453
1603
|
},
|
|
1454
1604
|
{
|
|
1455
1605
|
value: "right",
|
|
1456
|
-
label:
|
|
1457
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1606
|
+
label: __29("Right", "elementor"),
|
|
1607
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(AlignRightIcon, { fontSize: size })
|
|
1458
1608
|
},
|
|
1459
1609
|
{
|
|
1460
1610
|
value: "justify",
|
|
1461
|
-
label:
|
|
1462
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1611
|
+
label: __29("Justify", "elementor"),
|
|
1612
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(AlignJustifiedIcon, { fontSize: size })
|
|
1463
1613
|
}
|
|
1464
1614
|
];
|
|
1465
1615
|
var TextAlignmentField = () => {
|
|
1466
|
-
return /* @__PURE__ */
|
|
1616
|
+
return /* @__PURE__ */ React48.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React48.createElement(Grid20, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React48.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(ControlLabel25, null, __29("Alignment", "elementor"))), /* @__PURE__ */ React48.createElement(Grid20, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React48.createElement(ToggleControl8, { options: options7 }))));
|
|
1467
1617
|
};
|
|
1468
1618
|
|
|
1469
1619
|
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
1470
|
-
import * as
|
|
1471
|
-
import { ColorControl as ColorControl3, ControlLabel as
|
|
1472
|
-
import { Grid as
|
|
1473
|
-
import { __ as
|
|
1620
|
+
import * as React49 from "react";
|
|
1621
|
+
import { ColorControl as ColorControl3, ControlLabel as ControlLabel26 } from "@elementor/editor-controls";
|
|
1622
|
+
import { Grid as Grid21 } from "@elementor/ui";
|
|
1623
|
+
import { __ as __30 } from "@wordpress/i18n";
|
|
1474
1624
|
var TextColorField = () => {
|
|
1475
|
-
return /* @__PURE__ */
|
|
1625
|
+
return /* @__PURE__ */ React49.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React49.createElement(Grid21, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React49.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(ControlLabel26, null, __30("Text Color", "elementor"))), /* @__PURE__ */ React49.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(ColorControl3, null))));
|
|
1476
1626
|
};
|
|
1477
1627
|
|
|
1478
1628
|
// src/components/style-sections/typography-section/text-direction-field.tsx
|
|
1479
|
-
import * as
|
|
1480
|
-
import { ControlLabel as
|
|
1629
|
+
import * as React50 from "react";
|
|
1630
|
+
import { ControlLabel as ControlLabel27, ToggleControl as ToggleControl9 } from "@elementor/editor-controls";
|
|
1481
1631
|
import { TextDirectionLtrIcon, TextDirectionRtlIcon } from "@elementor/icons";
|
|
1482
|
-
import { Grid as
|
|
1483
|
-
import { __ as
|
|
1484
|
-
var
|
|
1632
|
+
import { Grid as Grid22 } from "@elementor/ui";
|
|
1633
|
+
import { __ as __31 } from "@wordpress/i18n";
|
|
1634
|
+
var options8 = [
|
|
1485
1635
|
{
|
|
1486
1636
|
value: "ltr",
|
|
1487
|
-
label:
|
|
1488
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1637
|
+
label: __31("Left to Right", "elementor"),
|
|
1638
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(TextDirectionLtrIcon, { fontSize: size })
|
|
1489
1639
|
},
|
|
1490
1640
|
{
|
|
1491
1641
|
value: "rtl",
|
|
1492
|
-
label:
|
|
1493
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1642
|
+
label: __31("Right to Left", "elementor"),
|
|
1643
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(TextDirectionRtlIcon, { fontSize: size })
|
|
1494
1644
|
}
|
|
1495
1645
|
];
|
|
1496
1646
|
var TextDirectionField = () => {
|
|
1497
|
-
return /* @__PURE__ */
|
|
1647
|
+
return /* @__PURE__ */ React50.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React50.createElement(Grid22, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React50.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(ControlLabel27, null, __31("Direction", "elementor"))), /* @__PURE__ */ React50.createElement(Grid22, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React50.createElement(ToggleControl9, { options: options8 }))));
|
|
1498
1648
|
};
|
|
1499
1649
|
|
|
1500
1650
|
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1501
|
-
import * as
|
|
1651
|
+
import * as React51 from "react";
|
|
1502
1652
|
import { StrokeControl } from "@elementor/editor-controls";
|
|
1503
|
-
import { __ as
|
|
1653
|
+
import { __ as __32 } from "@wordpress/i18n";
|
|
1504
1654
|
var initTextStroke = {
|
|
1505
1655
|
$$type: "stroke",
|
|
1506
1656
|
value: {
|
|
@@ -1526,56 +1676,74 @@ var TextStrokeField = () => {
|
|
|
1526
1676
|
setTextStroke(null);
|
|
1527
1677
|
};
|
|
1528
1678
|
const hasTextStroke = Boolean(textStroke);
|
|
1529
|
-
return /* @__PURE__ */
|
|
1679
|
+
return /* @__PURE__ */ React51.createElement(
|
|
1530
1680
|
AddOrRemoveContent,
|
|
1531
1681
|
{
|
|
1532
|
-
label:
|
|
1682
|
+
label: __32("Text Stroke", "elementor"),
|
|
1533
1683
|
isAdded: hasTextStroke,
|
|
1534
1684
|
onAdd: addTextStroke,
|
|
1535
1685
|
onRemove: removeTextStroke
|
|
1536
1686
|
},
|
|
1537
|
-
/* @__PURE__ */
|
|
1687
|
+
/* @__PURE__ */ React51.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React51.createElement(StrokeControl, null))
|
|
1538
1688
|
);
|
|
1539
1689
|
};
|
|
1540
1690
|
|
|
1541
1691
|
// src/components/style-sections/typography-section/text-style-field.tsx
|
|
1542
|
-
import * as
|
|
1543
|
-
import { ControlLabel as
|
|
1692
|
+
import * as React52 from "react";
|
|
1693
|
+
import { ControlLabel as ControlLabel28 } from "@elementor/editor-controls";
|
|
1544
1694
|
import { ItalicIcon, StrikethroughIcon, UnderlineIcon } from "@elementor/icons";
|
|
1545
|
-
import { Grid as
|
|
1546
|
-
import { __ as
|
|
1695
|
+
import { Grid as Grid23, ToggleButton as ToggleButtonBase, ToggleButtonGroup } from "@elementor/ui";
|
|
1696
|
+
import { __ as __33 } from "@wordpress/i18n";
|
|
1547
1697
|
var buttonSize = "tiny";
|
|
1548
1698
|
var TextStyleField = () => {
|
|
1549
1699
|
const [fontStyle, setFontStyle] = useStylesField("font-style");
|
|
1550
1700
|
const [textDecoration, setTextDecoration] = useStylesField("text-decoration");
|
|
1551
|
-
const formats = [fontStyle, ...(textDecoration || "").split(" ")];
|
|
1552
|
-
|
|
1701
|
+
const formats = [fontStyle?.value, ...(textDecoration?.value || "").split(" ")];
|
|
1702
|
+
const handleSetFontStyle = (newValue) => {
|
|
1703
|
+
if (newValue === null) {
|
|
1704
|
+
return setFontStyle(null);
|
|
1705
|
+
}
|
|
1706
|
+
setFontStyle({
|
|
1707
|
+
$$type: "string",
|
|
1708
|
+
value: newValue
|
|
1709
|
+
});
|
|
1710
|
+
};
|
|
1711
|
+
const handleSetTextDecoration = (newValue) => {
|
|
1712
|
+
if (newValue === null) {
|
|
1713
|
+
return setTextDecoration(null);
|
|
1714
|
+
}
|
|
1715
|
+
setTextDecoration({
|
|
1716
|
+
$$type: "string",
|
|
1717
|
+
value: newValue
|
|
1718
|
+
});
|
|
1719
|
+
};
|
|
1720
|
+
return /* @__PURE__ */ React52.createElement(Grid23, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React52.createElement(Grid23, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(ControlLabel28, null, __33("Style", "elementor"))), /* @__PURE__ */ React52.createElement(Grid23, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React52.createElement(ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React52.createElement(
|
|
1553
1721
|
ToggleButton,
|
|
1554
1722
|
{
|
|
1555
1723
|
value: "italic",
|
|
1556
|
-
onChange: (v) =>
|
|
1724
|
+
onChange: (v) => handleSetFontStyle(fontStyle?.value === v ? null : v),
|
|
1557
1725
|
"aria-label": "italic",
|
|
1558
1726
|
sx: { marginLeft: "auto" }
|
|
1559
1727
|
},
|
|
1560
|
-
/* @__PURE__ */
|
|
1561
|
-
), /* @__PURE__ */
|
|
1728
|
+
/* @__PURE__ */ React52.createElement(ItalicIcon, { fontSize: buttonSize })
|
|
1729
|
+
), /* @__PURE__ */ React52.createElement(
|
|
1562
1730
|
ShorthandControl,
|
|
1563
1731
|
{
|
|
1564
1732
|
value: "line-through",
|
|
1565
|
-
currentValues: textDecoration || "",
|
|
1566
|
-
updateValues:
|
|
1733
|
+
currentValues: textDecoration?.value || "",
|
|
1734
|
+
updateValues: handleSetTextDecoration,
|
|
1567
1735
|
"aria-label": "line-through"
|
|
1568
1736
|
},
|
|
1569
|
-
/* @__PURE__ */
|
|
1570
|
-
), /* @__PURE__ */
|
|
1737
|
+
/* @__PURE__ */ React52.createElement(StrikethroughIcon, { fontSize: buttonSize })
|
|
1738
|
+
), /* @__PURE__ */ React52.createElement(
|
|
1571
1739
|
ShorthandControl,
|
|
1572
1740
|
{
|
|
1573
1741
|
value: "underline",
|
|
1574
|
-
currentValues: textDecoration || "",
|
|
1575
|
-
updateValues:
|
|
1742
|
+
currentValues: textDecoration?.value || "",
|
|
1743
|
+
updateValues: handleSetTextDecoration,
|
|
1576
1744
|
"aria-label": "underline"
|
|
1577
1745
|
},
|
|
1578
|
-
/* @__PURE__ */
|
|
1746
|
+
/* @__PURE__ */ React52.createElement(UnderlineIcon, { fontSize: buttonSize })
|
|
1579
1747
|
))));
|
|
1580
1748
|
};
|
|
1581
1749
|
var ShorthandControl = ({
|
|
@@ -1594,52 +1762,52 @@ var ShorthandControl = ({
|
|
|
1594
1762
|
updateValues([...valuesArr, newValue].join(" "));
|
|
1595
1763
|
}
|
|
1596
1764
|
};
|
|
1597
|
-
return /* @__PURE__ */
|
|
1765
|
+
return /* @__PURE__ */ React52.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
1598
1766
|
};
|
|
1599
1767
|
var ToggleButton = ({ onChange, ...props }) => {
|
|
1600
1768
|
const handleChange = (_e, newValue) => {
|
|
1601
1769
|
onChange(newValue);
|
|
1602
1770
|
};
|
|
1603
|
-
return /* @__PURE__ */
|
|
1771
|
+
return /* @__PURE__ */ React52.createElement(ToggleButtonBase, { ...props, onChange: handleChange, size: buttonSize });
|
|
1604
1772
|
};
|
|
1605
1773
|
|
|
1606
1774
|
// src/components/style-sections/typography-section/transform-field.tsx
|
|
1607
|
-
import * as
|
|
1608
|
-
import { ControlLabel as
|
|
1775
|
+
import * as React53 from "react";
|
|
1776
|
+
import { ControlLabel as ControlLabel29, ToggleControl as ToggleControl10 } from "@elementor/editor-controls";
|
|
1609
1777
|
import { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon } from "@elementor/icons";
|
|
1610
|
-
import { Grid as
|
|
1611
|
-
import { __ as
|
|
1612
|
-
var
|
|
1778
|
+
import { Grid as Grid24 } from "@elementor/ui";
|
|
1779
|
+
import { __ as __34 } from "@wordpress/i18n";
|
|
1780
|
+
var options9 = [
|
|
1613
1781
|
{
|
|
1614
1782
|
value: "capitalize",
|
|
1615
|
-
label:
|
|
1616
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1783
|
+
label: __34("Capitalize", "elementor"),
|
|
1784
|
+
renderContent: ({ size }) => /* @__PURE__ */ React53.createElement(LetterCaseIcon, { fontSize: size })
|
|
1617
1785
|
},
|
|
1618
1786
|
{
|
|
1619
1787
|
value: "uppercase",
|
|
1620
|
-
label:
|
|
1621
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1788
|
+
label: __34("Uppercase", "elementor"),
|
|
1789
|
+
renderContent: ({ size }) => /* @__PURE__ */ React53.createElement(LetterCaseUpperIcon, { fontSize: size })
|
|
1622
1790
|
},
|
|
1623
1791
|
{
|
|
1624
1792
|
value: "lowercase",
|
|
1625
|
-
label:
|
|
1626
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1793
|
+
label: __34("Lowercase", "elementor"),
|
|
1794
|
+
renderContent: ({ size }) => /* @__PURE__ */ React53.createElement(LetterCaseLowerIcon, { fontSize: size })
|
|
1627
1795
|
}
|
|
1628
1796
|
];
|
|
1629
|
-
var TransformField = () => /* @__PURE__ */
|
|
1797
|
+
var TransformField = () => /* @__PURE__ */ React53.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React53.createElement(Grid24, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React53.createElement(Grid24, { item: true, xs: 6 }, /* @__PURE__ */ React53.createElement(ControlLabel29, null, __34("Transform", "elementor"))), /* @__PURE__ */ React53.createElement(Grid24, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React53.createElement(ToggleControl10, { options: options9 }))));
|
|
1630
1798
|
|
|
1631
1799
|
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
1632
|
-
import * as
|
|
1633
|
-
import { ControlLabel as
|
|
1634
|
-
import { Grid as
|
|
1635
|
-
import { __ as
|
|
1800
|
+
import * as React54 from "react";
|
|
1801
|
+
import { ControlLabel as ControlLabel30, SizeControl as SizeControl8 } from "@elementor/editor-controls";
|
|
1802
|
+
import { Grid as Grid25 } from "@elementor/ui";
|
|
1803
|
+
import { __ as __35 } from "@wordpress/i18n";
|
|
1636
1804
|
var WordSpacingField = () => {
|
|
1637
|
-
return /* @__PURE__ */
|
|
1805
|
+
return /* @__PURE__ */ React54.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React54.createElement(Grid25, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(Grid25, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(ControlLabel30, null, __35("Word Spacing", "elementor"))), /* @__PURE__ */ React54.createElement(Grid25, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(SizeControl8, null))));
|
|
1638
1806
|
};
|
|
1639
1807
|
|
|
1640
1808
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1641
1809
|
var TypographySection = () => {
|
|
1642
|
-
return /* @__PURE__ */
|
|
1810
|
+
return /* @__PURE__ */ React55.createElement(Stack18, { gap: 1.5 }, /* @__PURE__ */ React55.createElement(FontFamilyField, null), /* @__PURE__ */ React55.createElement(FontWeightField, null), /* @__PURE__ */ React55.createElement(FontSizeField, null), /* @__PURE__ */ React55.createElement(Divider6, null), /* @__PURE__ */ React55.createElement(TextAlignmentField, null), /* @__PURE__ */ React55.createElement(TextColorField, null), /* @__PURE__ */ React55.createElement(CollapsibleContent, null, /* @__PURE__ */ React55.createElement(Stack18, { gap: 1.5, sx: { pt: 1.5 } }, /* @__PURE__ */ React55.createElement(LineHeightField, null), /* @__PURE__ */ React55.createElement(LetterSpacingField, null), /* @__PURE__ */ React55.createElement(WordSpacingField, null), /* @__PURE__ */ React55.createElement(Divider6, null), /* @__PURE__ */ React55.createElement(TextStyleField, null), /* @__PURE__ */ React55.createElement(TransformField, null), /* @__PURE__ */ React55.createElement(TextDirectionField, null), /* @__PURE__ */ React55.createElement(TextStrokeField, null))));
|
|
1643
1811
|
};
|
|
1644
1812
|
|
|
1645
1813
|
// src/components/style-tab.tsx
|
|
@@ -1648,10 +1816,10 @@ var StyleTab = () => {
|
|
|
1648
1816
|
const currentClassesProp = useCurrentClassesProp();
|
|
1649
1817
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
1650
1818
|
const breakpoint = useActiveBreakpoint();
|
|
1651
|
-
return /* @__PURE__ */
|
|
1819
|
+
return /* @__PURE__ */ React56.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React56.createElement(StyleProvider, { meta: { breakpoint, state: null }, id: activeStyleDefId, setId: setActiveStyleDefId }, /* @__PURE__ */ React56.createElement(CssClassSelector, null), /* @__PURE__ */ React56.createElement(Divider7, null), /* @__PURE__ */ React56.createElement(SectionsList, null, /* @__PURE__ */ React56.createElement(Section, { title: __36("Layout", "elementor") }, /* @__PURE__ */ React56.createElement(LayoutSection, null)), /* @__PURE__ */ React56.createElement(Section, { title: __36("Spacing", "elementor") }, /* @__PURE__ */ React56.createElement(SpacingSection, null)), /* @__PURE__ */ React56.createElement(Section, { title: __36("Size", "elementor") }, /* @__PURE__ */ React56.createElement(SizeSection, null)), /* @__PURE__ */ React56.createElement(Section, { title: __36("Position", "elementor") }, /* @__PURE__ */ React56.createElement(PositionSection, null)), /* @__PURE__ */ React56.createElement(Section, { title: __36("Typography", "elementor") }, /* @__PURE__ */ React56.createElement(TypographySection, null)), /* @__PURE__ */ React56.createElement(Section, { title: __36("Background", "elementor") }, /* @__PURE__ */ React56.createElement(BackgroundSection, null)), /* @__PURE__ */ React56.createElement(Section, { title: __36("Border", "elementor") }, /* @__PURE__ */ React56.createElement(BorderSection, null)), /* @__PURE__ */ React56.createElement(Section, { title: __36("Effects", "elementor") }, /* @__PURE__ */ React56.createElement(EffectsSection, null)))));
|
|
1652
1820
|
};
|
|
1653
1821
|
function useActiveStyleDefId(currentClassesProp) {
|
|
1654
|
-
const [activeStyledDefId, setActiveStyledDefId] =
|
|
1822
|
+
const [activeStyledDefId, setActiveStyledDefId] = useState5(null);
|
|
1655
1823
|
const fallback = useFirstElementStyleDef(currentClassesProp);
|
|
1656
1824
|
const newId = useGeneratedId();
|
|
1657
1825
|
return [activeStyledDefId || fallback?.id || newId, setActiveStyledDefId];
|
|
@@ -1685,7 +1853,7 @@ var EditingPanelTabs = () => {
|
|
|
1685
1853
|
return (
|
|
1686
1854
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
1687
1855
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
1688
|
-
/* @__PURE__ */
|
|
1856
|
+
/* @__PURE__ */ React57.createElement(Fragment7, { key: element.id }, /* @__PURE__ */ React57.createElement(Stack19, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React57.createElement(Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React57.createElement(Tab, { label: __37("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React57.createElement(Tab, { label: __37("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React57.createElement(Divider8, null), /* @__PURE__ */ React57.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React57.createElement(SettingsTab, null)), /* @__PURE__ */ React57.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React57.createElement(StyleTab, null))))
|
|
1689
1857
|
);
|
|
1690
1858
|
};
|
|
1691
1859
|
|
|
@@ -1698,8 +1866,8 @@ var EditingPanel = () => {
|
|
|
1698
1866
|
if (!element || !elementType) {
|
|
1699
1867
|
return null;
|
|
1700
1868
|
}
|
|
1701
|
-
const panelTitle =
|
|
1702
|
-
return /* @__PURE__ */
|
|
1869
|
+
const panelTitle = __38("Edit %s", "elementor").replace("%s", elementType.title);
|
|
1870
|
+
return /* @__PURE__ */ React58.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React58.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React58.createElement(Panel, null, /* @__PURE__ */ React58.createElement(PanelHeader, null, /* @__PURE__ */ React58.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React58.createElement(PanelBody, null, /* @__PURE__ */ React58.createElement(ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React58.createElement(ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React58.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React58.createElement(EditingPanelTabs, null)))))));
|
|
1703
1871
|
};
|
|
1704
1872
|
|
|
1705
1873
|
// src/panel.ts
|
|
@@ -1756,9 +1924,9 @@ var EditingPanelHooks = () => {
|
|
|
1756
1924
|
};
|
|
1757
1925
|
|
|
1758
1926
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1759
|
-
import * as
|
|
1927
|
+
import * as React61 from "react";
|
|
1760
1928
|
import { useId as useId3 } from "react";
|
|
1761
|
-
import { ControlLabel as
|
|
1929
|
+
import { ControlLabel as ControlLabel31, useBoundProp as useBoundProp3 } from "@elementor/editor-controls";
|
|
1762
1930
|
import { DatabaseIcon, SettingsIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
1763
1931
|
import {
|
|
1764
1932
|
bindPopover as bindPopover2,
|
|
@@ -1768,7 +1936,7 @@ import {
|
|
|
1768
1936
|
IconButton as IconButton3,
|
|
1769
1937
|
Paper,
|
|
1770
1938
|
Popover as Popover2,
|
|
1771
|
-
Stack as
|
|
1939
|
+
Stack as Stack21,
|
|
1772
1940
|
Tab as Tab2,
|
|
1773
1941
|
TabPanel as TabPanel2,
|
|
1774
1942
|
Tabs as Tabs2,
|
|
@@ -1777,17 +1945,18 @@ import {
|
|
|
1777
1945
|
usePopupState as usePopupState2,
|
|
1778
1946
|
useTabs as useTabs2
|
|
1779
1947
|
} from "@elementor/ui";
|
|
1780
|
-
import { __ as
|
|
1948
|
+
import { __ as __40 } from "@wordpress/i18n";
|
|
1781
1949
|
|
|
1782
1950
|
// src/dynamics/dynamic-control.tsx
|
|
1783
|
-
import * as
|
|
1951
|
+
import * as React59 from "react";
|
|
1784
1952
|
import { BoundPropProvider as BoundPropProvider3, useBoundProp } from "@elementor/editor-controls";
|
|
1953
|
+
import { isTransformable as isTransformable2 } from "@elementor/editor-props";
|
|
1785
1954
|
|
|
1786
1955
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
1787
|
-
import { useMemo as
|
|
1956
|
+
import { useMemo as useMemo5 } from "react";
|
|
1788
1957
|
|
|
1789
1958
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1790
|
-
import { useMemo as
|
|
1959
|
+
import { useMemo as useMemo4 } from "react";
|
|
1791
1960
|
|
|
1792
1961
|
// src/dynamics/sync/get-elementor-config.ts
|
|
1793
1962
|
var getElementorConfig2 = () => {
|
|
@@ -1808,7 +1977,11 @@ var getAtomicDynamicTags = () => {
|
|
|
1808
1977
|
};
|
|
1809
1978
|
|
|
1810
1979
|
// src/dynamics/utils.ts
|
|
1811
|
-
import {
|
|
1980
|
+
import {
|
|
1981
|
+
createPropUtils,
|
|
1982
|
+
isTransformable
|
|
1983
|
+
} from "@elementor/editor-props";
|
|
1984
|
+
import { z } from "@elementor/schema";
|
|
1812
1985
|
var DYNAMIC_PROP_TYPE_KEY = "dynamic";
|
|
1813
1986
|
var isDynamicPropType = (prop) => prop.key === DYNAMIC_PROP_TYPE_KEY;
|
|
1814
1987
|
var getDynamicPropType = (propType) => {
|
|
@@ -1821,6 +1994,13 @@ var isDynamicPropValue = (prop) => {
|
|
|
1821
1994
|
var supportsDynamic = (propType) => {
|
|
1822
1995
|
return !!getDynamicPropType(propType);
|
|
1823
1996
|
};
|
|
1997
|
+
var dynamicPropTypeUtil = createPropUtils(
|
|
1998
|
+
DYNAMIC_PROP_TYPE_KEY,
|
|
1999
|
+
z.strictObject({
|
|
2000
|
+
name: z.string(),
|
|
2001
|
+
settings: z.record(z.any()).optional()
|
|
2002
|
+
})
|
|
2003
|
+
);
|
|
1824
2004
|
|
|
1825
2005
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1826
2006
|
var usePropDynamicTags = (propName) => {
|
|
@@ -1831,7 +2011,7 @@ var usePropDynamicTags = (propName) => {
|
|
|
1831
2011
|
const propDynamicType = getDynamicPropType(propType);
|
|
1832
2012
|
categories = propDynamicType?.settings.categories || [];
|
|
1833
2013
|
}
|
|
1834
|
-
return
|
|
2014
|
+
return useMemo4(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
1835
2015
|
};
|
|
1836
2016
|
var getDynamicTagsByCategories = (categories) => {
|
|
1837
2017
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -1847,13 +2027,13 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
1847
2027
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
1848
2028
|
var useDynamicTag = (propName, tagName) => {
|
|
1849
2029
|
const dynamicTags = usePropDynamicTags(propName);
|
|
1850
|
-
return
|
|
2030
|
+
return useMemo5(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
1851
2031
|
};
|
|
1852
2032
|
|
|
1853
2033
|
// src/dynamics/dynamic-control.tsx
|
|
1854
2034
|
var DynamicControl = ({ bind, children }) => {
|
|
1855
|
-
const { value, setValue, bind: propName } = useBoundProp();
|
|
1856
|
-
const { name = "", settings } = value
|
|
2035
|
+
const { value, setValue, bind: propName } = useBoundProp(dynamicPropTypeUtil);
|
|
2036
|
+
const { name = "", settings } = value ?? {};
|
|
1857
2037
|
const dynamicTag = useDynamicTag(propName, name);
|
|
1858
2038
|
if (!dynamicTag) {
|
|
1859
2039
|
throw new Error(`Dynamic tag ${name} not found`);
|
|
@@ -1862,22 +2042,20 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
1862
2042
|
const dynamicValue = settings?.[bind] ?? defaultValue;
|
|
1863
2043
|
const setDynamicValue = (newValue) => {
|
|
1864
2044
|
setValue({
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
[bind]: newValue
|
|
1871
|
-
}
|
|
2045
|
+
name,
|
|
2046
|
+
settings: {
|
|
2047
|
+
...settings,
|
|
2048
|
+
// The value inside the dynamic is not a transformable value, so we need to store the whole object.
|
|
2049
|
+
[bind]: isTransformable2(newValue) ? newValue.value : newValue
|
|
1872
2050
|
}
|
|
1873
2051
|
});
|
|
1874
2052
|
};
|
|
1875
|
-
return /* @__PURE__ */
|
|
2053
|
+
return /* @__PURE__ */ React59.createElement(BoundPropProvider3, { setValue: setDynamicValue, value: dynamicValue, bind }, children);
|
|
1876
2054
|
};
|
|
1877
2055
|
|
|
1878
2056
|
// src/dynamics/components/dynamic-selection.tsx
|
|
1879
|
-
import * as
|
|
1880
|
-
import { Fragment as
|
|
2057
|
+
import * as React60 from "react";
|
|
2058
|
+
import { Fragment as Fragment8, useState as useState6 } from "react";
|
|
1881
2059
|
import { useBoundProp as useBoundProp2 } from "@elementor/editor-controls";
|
|
1882
2060
|
import { PhotoIcon, SearchIcon } from "@elementor/icons";
|
|
1883
2061
|
import {
|
|
@@ -1888,44 +2066,45 @@ import {
|
|
|
1888
2066
|
ListSubheader,
|
|
1889
2067
|
MenuItem,
|
|
1890
2068
|
MenuList,
|
|
1891
|
-
Stack as
|
|
2069
|
+
Stack as Stack20,
|
|
1892
2070
|
TextField as TextField2,
|
|
1893
2071
|
Typography as Typography3
|
|
1894
2072
|
} from "@elementor/ui";
|
|
1895
|
-
import { __ as
|
|
2073
|
+
import { __ as __39 } from "@wordpress/i18n";
|
|
1896
2074
|
var SIZE3 = "tiny";
|
|
1897
2075
|
var DynamicSelection = ({ onSelect }) => {
|
|
1898
|
-
const [searchValue, setSearchValue] =
|
|
2076
|
+
const [searchValue, setSearchValue] = useState6("");
|
|
1899
2077
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
1900
|
-
const {
|
|
2078
|
+
const { value: anyValue } = useBoundProp2();
|
|
2079
|
+
const { bind, value: dynamicvalue, setValue } = useBoundProp2(dynamicPropTypeUtil);
|
|
1901
2080
|
const { setPropValue: updatePropValueHistory } = usePropValueHistory();
|
|
1902
|
-
const isCurrentValueDynamic =
|
|
1903
|
-
const
|
|
2081
|
+
const isCurrentValueDynamic = !!dynamicvalue;
|
|
2082
|
+
const options10 = useFilteredOptions(bind, searchValue);
|
|
1904
2083
|
const handleSearch = (event) => {
|
|
1905
2084
|
setSearchValue(event.target.value);
|
|
1906
2085
|
};
|
|
1907
2086
|
const handleSetDynamicTag = (value) => {
|
|
1908
2087
|
if (!isCurrentValueDynamic) {
|
|
1909
|
-
updatePropValueHistory(bind,
|
|
2088
|
+
updatePropValueHistory(bind, anyValue);
|
|
1910
2089
|
}
|
|
1911
|
-
setValue({
|
|
2090
|
+
setValue({ name: value, settings: {} });
|
|
1912
2091
|
onSelect?.();
|
|
1913
2092
|
};
|
|
1914
|
-
return /* @__PURE__ */
|
|
2093
|
+
return /* @__PURE__ */ React60.createElement(Stack20, null, /* @__PURE__ */ React60.createElement(Box4, { px: 1.5, pb: 1 }, /* @__PURE__ */ React60.createElement(
|
|
1915
2094
|
TextField2,
|
|
1916
2095
|
{
|
|
1917
2096
|
fullWidth: true,
|
|
1918
2097
|
size: SIZE3,
|
|
1919
2098
|
value: searchValue,
|
|
1920
2099
|
onChange: handleSearch,
|
|
1921
|
-
placeholder:
|
|
2100
|
+
placeholder: __39("Search dynamic tag", "elementor"),
|
|
1922
2101
|
InputProps: {
|
|
1923
|
-
startAdornment: /* @__PURE__ */
|
|
2102
|
+
startAdornment: /* @__PURE__ */ React60.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React60.createElement(SearchIcon, { fontSize: SIZE3 }))
|
|
1924
2103
|
}
|
|
1925
2104
|
}
|
|
1926
|
-
)), /* @__PURE__ */
|
|
1927
|
-
const isSelected = isCurrentValueDynamic && value ===
|
|
1928
|
-
return /* @__PURE__ */
|
|
2105
|
+
)), /* @__PURE__ */ React60.createElement(Divider9, null), /* @__PURE__ */ React60.createElement(Box4, { sx: { overflowY: "auto", height: 260, width: 220 } }, options10.length > 0 ? /* @__PURE__ */ React60.createElement(MenuList, { role: "listbox", tabIndex: 0 }, options10.map(([category, items3], index) => /* @__PURE__ */ React60.createElement(Fragment8, { key: index }, /* @__PURE__ */ React60.createElement(ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items3.map(({ value, label: tagLabel }) => {
|
|
2106
|
+
const isSelected = isCurrentValueDynamic && value === dynamicvalue?.name;
|
|
2107
|
+
return /* @__PURE__ */ React60.createElement(
|
|
1929
2108
|
MenuItem,
|
|
1930
2109
|
{
|
|
1931
2110
|
key: value,
|
|
@@ -1936,7 +2115,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
1936
2115
|
},
|
|
1937
2116
|
tagLabel
|
|
1938
2117
|
);
|
|
1939
|
-
})))) : /* @__PURE__ */
|
|
2118
|
+
})))) : /* @__PURE__ */ React60.createElement(Stack20, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React60.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React60.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, __39("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React60.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React60.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React60.createElement(
|
|
1940
2119
|
Link,
|
|
1941
2120
|
{
|
|
1942
2121
|
color: "secondary",
|
|
@@ -1944,12 +2123,12 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
1944
2123
|
component: "button",
|
|
1945
2124
|
onClick: () => setSearchValue("")
|
|
1946
2125
|
},
|
|
1947
|
-
|
|
1948
|
-
), "\xA0",
|
|
2126
|
+
__39("Clear the filters", "elementor")
|
|
2127
|
+
), "\xA0", __39("and try again.", "elementor")))));
|
|
1949
2128
|
};
|
|
1950
2129
|
var useFilteredOptions = (bind, searchValue) => {
|
|
1951
2130
|
const dynamicTags = usePropDynamicTags(bind);
|
|
1952
|
-
const
|
|
2131
|
+
const options10 = dynamicTags.reduce((categories, { name, label, group }) => {
|
|
1953
2132
|
const isVisible = label.toLowerCase().includes(searchValue.trim().toLowerCase());
|
|
1954
2133
|
if (!isVisible) {
|
|
1955
2134
|
return categories;
|
|
@@ -1960,44 +2139,45 @@ var useFilteredOptions = (bind, searchValue) => {
|
|
|
1960
2139
|
categories.get(group)?.push({ label, value: name });
|
|
1961
2140
|
return categories;
|
|
1962
2141
|
}, /* @__PURE__ */ new Map());
|
|
1963
|
-
return [...
|
|
2142
|
+
return [...options10];
|
|
1964
2143
|
};
|
|
1965
2144
|
|
|
1966
2145
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1967
2146
|
var SIZE4 = "tiny";
|
|
1968
2147
|
var DynamicSelectionControl = () => {
|
|
1969
|
-
const {
|
|
2148
|
+
const { setValue: setAnyValue } = useBoundProp3();
|
|
2149
|
+
const { bind, value } = useBoundProp3(dynamicPropTypeUtil);
|
|
1970
2150
|
const { getPropValue: getPropValueFromHistory } = usePropValueHistory();
|
|
1971
|
-
const { name: tagName = "" } = value
|
|
2151
|
+
const { name: tagName = "" } = value;
|
|
1972
2152
|
const selectionPopoverId = useId3();
|
|
1973
2153
|
const selectionPopoverState = usePopupState2({ variant: "popover", popupId: selectionPopoverId });
|
|
1974
2154
|
const dynamicTag = useDynamicTag(bind, tagName);
|
|
1975
2155
|
const removeDynamicTag = () => {
|
|
1976
2156
|
const propValue = getPropValueFromHistory(bind);
|
|
1977
|
-
|
|
2157
|
+
setAnyValue(propValue ?? null);
|
|
1978
2158
|
};
|
|
1979
2159
|
if (!dynamicTag) {
|
|
1980
2160
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
1981
2161
|
}
|
|
1982
|
-
return /* @__PURE__ */
|
|
2162
|
+
return /* @__PURE__ */ React61.createElement(Box5, null, /* @__PURE__ */ React61.createElement(
|
|
1983
2163
|
Tag,
|
|
1984
2164
|
{
|
|
1985
2165
|
fullWidth: true,
|
|
1986
2166
|
showActionsOnHover: true,
|
|
1987
2167
|
label: dynamicTag.label,
|
|
1988
|
-
startIcon: /* @__PURE__ */
|
|
2168
|
+
startIcon: /* @__PURE__ */ React61.createElement(DatabaseIcon, { fontSize: SIZE4 }),
|
|
1989
2169
|
...bindTrigger(selectionPopoverState),
|
|
1990
|
-
actions: /* @__PURE__ */
|
|
2170
|
+
actions: /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React61.createElement(
|
|
1991
2171
|
IconButton3,
|
|
1992
2172
|
{
|
|
1993
2173
|
size: SIZE4,
|
|
1994
2174
|
onClick: removeDynamicTag,
|
|
1995
|
-
"aria-label":
|
|
2175
|
+
"aria-label": __40("Remove dynamic value", "elementor")
|
|
1996
2176
|
},
|
|
1997
|
-
/* @__PURE__ */
|
|
2177
|
+
/* @__PURE__ */ React61.createElement(XIcon2, { fontSize: SIZE4 })
|
|
1998
2178
|
))
|
|
1999
2179
|
}
|
|
2000
|
-
), /* @__PURE__ */
|
|
2180
|
+
), /* @__PURE__ */ React61.createElement(
|
|
2001
2181
|
Popover2,
|
|
2002
2182
|
{
|
|
2003
2183
|
disablePortal: true,
|
|
@@ -2005,7 +2185,7 @@ var DynamicSelectionControl = () => {
|
|
|
2005
2185
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
2006
2186
|
...bindPopover2(selectionPopoverState)
|
|
2007
2187
|
},
|
|
2008
|
-
/* @__PURE__ */
|
|
2188
|
+
/* @__PURE__ */ React61.createElement(Stack21, null, /* @__PURE__ */ React61.createElement(Stack21, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React61.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React61.createElement(Typography4, { variant: "subtitle2" }, __40("Dynamic Tags", "elementor")), /* @__PURE__ */ React61.createElement(IconButton3, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React61.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React61.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
2009
2189
|
));
|
|
2010
2190
|
};
|
|
2011
2191
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
@@ -2015,22 +2195,22 @@ var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
|
2015
2195
|
if (!hasDynamicSettings) {
|
|
2016
2196
|
return null;
|
|
2017
2197
|
}
|
|
2018
|
-
return /* @__PURE__ */
|
|
2198
|
+
return /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(
|
|
2019
2199
|
IconButton3,
|
|
2020
2200
|
{
|
|
2021
2201
|
size: SIZE4,
|
|
2022
2202
|
...bindTrigger(settingsPopupState),
|
|
2023
|
-
"aria-label":
|
|
2203
|
+
"aria-label": __40("Settings", "elementor")
|
|
2024
2204
|
},
|
|
2025
|
-
/* @__PURE__ */
|
|
2026
|
-
), /* @__PURE__ */
|
|
2205
|
+
/* @__PURE__ */ React61.createElement(SettingsIcon, { fontSize: SIZE4 })
|
|
2206
|
+
), /* @__PURE__ */ React61.createElement(
|
|
2027
2207
|
Popover2,
|
|
2028
2208
|
{
|
|
2029
2209
|
disableScrollLock: true,
|
|
2030
2210
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
2031
2211
|
...bindPopover2(settingsPopupState)
|
|
2032
2212
|
},
|
|
2033
|
-
/* @__PURE__ */
|
|
2213
|
+
/* @__PURE__ */ React61.createElement(Paper, { component: Stack21, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React61.createElement(Stack21, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React61.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React61.createElement(Typography4, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React61.createElement(IconButton3, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React61.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React61.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
2034
2214
|
));
|
|
2035
2215
|
};
|
|
2036
2216
|
var DynamicSettings = ({ controls }) => {
|
|
@@ -2039,10 +2219,10 @@ var DynamicSettings = ({ controls }) => {
|
|
|
2039
2219
|
if (!tabs.length) {
|
|
2040
2220
|
return null;
|
|
2041
2221
|
}
|
|
2042
|
-
return /* @__PURE__ */
|
|
2043
|
-
return /* @__PURE__ */
|
|
2222
|
+
return /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(Tabs2, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React61.createElement(Tab2, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React61.createElement(Divider10, null), tabs.map(({ value }, index) => {
|
|
2223
|
+
return /* @__PURE__ */ React61.createElement(TabPanel2, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React61.createElement(Stack21, { gap: 1, px: 2 }, value.items.map((item) => {
|
|
2044
2224
|
if (item.type === "control") {
|
|
2045
|
-
return /* @__PURE__ */
|
|
2225
|
+
return /* @__PURE__ */ React61.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
2046
2226
|
}
|
|
2047
2227
|
return null;
|
|
2048
2228
|
})));
|
|
@@ -2052,14 +2232,14 @@ var Control3 = ({ control }) => {
|
|
|
2052
2232
|
if (!getControlByType(control.type)) {
|
|
2053
2233
|
return null;
|
|
2054
2234
|
}
|
|
2055
|
-
return /* @__PURE__ */
|
|
2235
|
+
return /* @__PURE__ */ React61.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React61.createElement(ControlLabel31, null, control.label) : null, /* @__PURE__ */ React61.createElement(Control, { type: control.type, props: control.props }));
|
|
2056
2236
|
};
|
|
2057
2237
|
|
|
2058
2238
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
2059
|
-
import * as
|
|
2239
|
+
import * as React62 from "react";
|
|
2060
2240
|
import { useBoundProp as useBoundProp4 } from "@elementor/editor-controls";
|
|
2061
2241
|
import { DatabaseIcon as DatabaseIcon2 } from "@elementor/icons";
|
|
2062
|
-
import { __ as
|
|
2242
|
+
import { __ as __41 } from "@wordpress/i18n";
|
|
2063
2243
|
var usePropDynamicAction = () => {
|
|
2064
2244
|
const { bind } = useBoundProp4();
|
|
2065
2245
|
const { elementType } = useElement();
|
|
@@ -2068,8 +2248,8 @@ var usePropDynamicAction = () => {
|
|
|
2068
2248
|
return {
|
|
2069
2249
|
visible,
|
|
2070
2250
|
icon: DatabaseIcon2,
|
|
2071
|
-
title:
|
|
2072
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
2251
|
+
title: __41("Dynamic Tags", "elementor"),
|
|
2252
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React62.createElement(DynamicSelection, { onSelect: closePopover })
|
|
2073
2253
|
};
|
|
2074
2254
|
};
|
|
2075
2255
|
|