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