@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.js
CHANGED
|
@@ -31,10 +31,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
replaceControl: () => replaceControl,
|
|
34
|
-
useBoundProp: () =>
|
|
34
|
+
useBoundProp: () => import_editor_controls46.useBoundProp
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(index_exports);
|
|
37
|
-
var
|
|
37
|
+
var import_editor_controls46 = require("@elementor/editor-controls");
|
|
38
38
|
|
|
39
39
|
// src/control-replacement.tsx
|
|
40
40
|
var import_editor_controls = require("@elementor/editor-controls");
|
|
@@ -43,23 +43,23 @@ var { replaceControl, getControlReplacement } = (0, import_editor_controls.creat
|
|
|
43
43
|
// src/init.ts
|
|
44
44
|
var import_editor = require("@elementor/editor");
|
|
45
45
|
var import_editor_panels3 = require("@elementor/editor-panels");
|
|
46
|
-
var
|
|
46
|
+
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
47
47
|
|
|
48
48
|
// src/hooks/use-close-editor-panel.ts
|
|
49
|
-
var
|
|
49
|
+
var import_react13 = require("react");
|
|
50
50
|
var import_editor_elements8 = require("@elementor/editor-elements");
|
|
51
|
-
var
|
|
51
|
+
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
52
52
|
|
|
53
53
|
// src/panel.ts
|
|
54
54
|
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
55
55
|
|
|
56
56
|
// src/components/editing-panel.tsx
|
|
57
|
-
var
|
|
58
|
-
var
|
|
57
|
+
var React59 = __toESM(require("react"));
|
|
58
|
+
var import_editor_controls41 = require("@elementor/editor-controls");
|
|
59
59
|
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
60
60
|
var import_editor_panels = require("@elementor/editor-panels");
|
|
61
|
-
var
|
|
62
|
-
var
|
|
61
|
+
var import_ui50 = require("@elementor/ui");
|
|
62
|
+
var import_i18n39 = require("@wordpress/i18n");
|
|
63
63
|
|
|
64
64
|
// src/contexts/element-context.tsx
|
|
65
65
|
var React = __toESM(require("react"));
|
|
@@ -130,10 +130,10 @@ function EditorPanelErrorFallback() {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
// src/components/editing-panel-tabs.tsx
|
|
133
|
-
var
|
|
134
|
-
var
|
|
135
|
-
var
|
|
136
|
-
var
|
|
133
|
+
var React58 = __toESM(require("react"));
|
|
134
|
+
var import_react12 = require("react");
|
|
135
|
+
var import_ui49 = require("@elementor/ui");
|
|
136
|
+
var import_i18n38 = require("@wordpress/i18n");
|
|
137
137
|
|
|
138
138
|
// src/components/settings-tab.tsx
|
|
139
139
|
var React9 = __toESM(require("react"));
|
|
@@ -285,12 +285,12 @@ var Control2 = ({ control }) => {
|
|
|
285
285
|
};
|
|
286
286
|
|
|
287
287
|
// src/components/style-tab.tsx
|
|
288
|
-
var
|
|
289
|
-
var
|
|
288
|
+
var React57 = __toESM(require("react"));
|
|
289
|
+
var import_react11 = require("react");
|
|
290
290
|
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
291
291
|
var import_editor_responsive = require("@elementor/editor-responsive");
|
|
292
|
-
var
|
|
293
|
-
var
|
|
292
|
+
var import_ui48 = require("@elementor/ui");
|
|
293
|
+
var import_i18n37 = require("@wordpress/i18n");
|
|
294
294
|
|
|
295
295
|
// src/contexts/classes-prop-context.tsx
|
|
296
296
|
var React10 = __toESM(require("react"));
|
|
@@ -351,19 +351,18 @@ var ConditionalTooltipWrapper = ({ maxWidth, title }) => {
|
|
|
351
351
|
};
|
|
352
352
|
}, []);
|
|
353
353
|
if (isOverflown) {
|
|
354
|
-
return /* @__PURE__ */ React12.createElement(import_ui7.Tooltip, { title, placement: "top" }, /* @__PURE__ */ React12.createElement(Content, { maxWidth, ref: elRef, title
|
|
354
|
+
return /* @__PURE__ */ React12.createElement(import_ui7.Tooltip, { title, placement: "top" }, /* @__PURE__ */ React12.createElement(Content, { maxWidth, ref: elRef }, title));
|
|
355
355
|
}
|
|
356
|
-
return /* @__PURE__ */ React12.createElement(Content, { maxWidth, ref: elRef, title
|
|
356
|
+
return /* @__PURE__ */ React12.createElement(Content, { maxWidth, ref: elRef }, title);
|
|
357
357
|
};
|
|
358
|
-
var Content = React12.forwardRef(({ maxWidth,
|
|
358
|
+
var Content = React12.forwardRef(({ maxWidth, ...tooltipProps }, ref) => /* @__PURE__ */ React12.createElement(
|
|
359
359
|
import_ui7.Box,
|
|
360
360
|
{
|
|
361
361
|
ref,
|
|
362
362
|
position: "relative",
|
|
363
363
|
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", maxWidth },
|
|
364
|
-
...
|
|
365
|
-
}
|
|
366
|
-
title
|
|
364
|
+
...tooltipProps
|
|
365
|
+
}
|
|
367
366
|
));
|
|
368
367
|
|
|
369
368
|
// src/components/multi-combobox/multi-combobox.tsx
|
|
@@ -563,7 +562,7 @@ function useOptions() {
|
|
|
563
562
|
});
|
|
564
563
|
}
|
|
565
564
|
function useAppliedOptions(options10, appliedIds) {
|
|
566
|
-
const applied =
|
|
565
|
+
const applied = options10.filter((option) => appliedIds.includes(option.value));
|
|
567
566
|
const hasElementsProviderStyleApplied = applied.some(
|
|
568
567
|
(option) => option.provider === import_editor_styles_repository.ELEMENTS_STYLES_PROVIDER_KEY
|
|
569
568
|
);
|
|
@@ -608,51 +607,50 @@ function useHandleApply(appliedIds, setAppliedIds) {
|
|
|
608
607
|
}
|
|
609
608
|
|
|
610
609
|
// src/components/style-sections/background-section/background-section.tsx
|
|
611
|
-
var
|
|
612
|
-
var
|
|
613
|
-
var import_ui12 = require("@elementor/ui");
|
|
610
|
+
var React16 = __toESM(require("react"));
|
|
611
|
+
var import_editor_controls6 = require("@elementor/editor-controls");
|
|
614
612
|
|
|
615
613
|
// src/controls-registry/styles-field.tsx
|
|
616
614
|
var React15 = __toESM(require("react"));
|
|
617
615
|
var import_editor_controls5 = require("@elementor/editor-controls");
|
|
618
616
|
|
|
619
|
-
// src/hooks/use-styles-
|
|
620
|
-
var import_react7 = require("react");
|
|
617
|
+
// src/hooks/use-styles-fields.ts
|
|
621
618
|
var import_editor_elements3 = require("@elementor/editor-elements");
|
|
622
619
|
var import_i18n2 = require("@wordpress/i18n");
|
|
623
|
-
|
|
620
|
+
function useStylesFields(propNames) {
|
|
624
621
|
const { element } = useElement();
|
|
625
622
|
const { id, meta } = useStyle();
|
|
626
623
|
const classesProp = useClassesProp();
|
|
627
|
-
const
|
|
628
|
-
const onChangeCallbacks = (0, import_react7.useRef)(/* @__PURE__ */ new Set());
|
|
629
|
-
const value = (0, import_editor_elements3.useElementStyleProp)({
|
|
624
|
+
const value = (0, import_editor_elements3.useElementStyleProps)({
|
|
630
625
|
elementID: element.id,
|
|
631
626
|
styleDefID: id,
|
|
632
627
|
meta,
|
|
633
|
-
|
|
628
|
+
propNames
|
|
634
629
|
});
|
|
635
|
-
const setValue = (
|
|
630
|
+
const setValue = (newValues) => {
|
|
636
631
|
(0, import_editor_elements3.updateStyle)({
|
|
637
632
|
elementID: element.id,
|
|
638
633
|
styleDefID: id,
|
|
639
|
-
props:
|
|
634
|
+
props: newValues,
|
|
640
635
|
meta,
|
|
641
636
|
bind: classesProp,
|
|
642
637
|
label: (0, import_i18n2.__)("local", "elementor")
|
|
643
638
|
});
|
|
644
639
|
};
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
640
|
+
return [value, setValue];
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
// src/hooks/use-styles-field.ts
|
|
644
|
+
function useStylesField(propName) {
|
|
645
|
+
const [values, setValues] = useStylesFields([propName]);
|
|
646
|
+
const value = values?.[propName] ?? null;
|
|
647
|
+
const setValue = (newValue) => {
|
|
648
|
+
setValues({
|
|
649
|
+
[propName]: newValue
|
|
651
650
|
});
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
};
|
|
651
|
+
};
|
|
652
|
+
return [value, setValue];
|
|
653
|
+
}
|
|
656
654
|
|
|
657
655
|
// src/controls-registry/styles-field.tsx
|
|
658
656
|
var StylesField = ({ bind, children }) => {
|
|
@@ -660,37 +658,28 @@ var StylesField = ({ bind, children }) => {
|
|
|
660
658
|
return /* @__PURE__ */ React15.createElement(import_editor_controls5.BoundPropProvider, { setValue, value, bind }, children);
|
|
661
659
|
};
|
|
662
660
|
|
|
663
|
-
// src/components/style-sections/background-section/background-color-field.tsx
|
|
664
|
-
var React16 = __toESM(require("react"));
|
|
665
|
-
var import_editor_controls6 = require("@elementor/editor-controls");
|
|
666
|
-
var import_ui11 = require("@elementor/ui");
|
|
667
|
-
var import_i18n3 = require("@wordpress/i18n");
|
|
668
|
-
var BackgroundColorField = () => {
|
|
669
|
-
return /* @__PURE__ */ React16.createElement(StylesField, { bind: "background-color" }, /* @__PURE__ */ React16.createElement(import_ui11.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React16.createElement(import_ui11.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React16.createElement(import_editor_controls6.ControlLabel, null, (0, import_i18n3.__)("Color", "elementor"))), /* @__PURE__ */ React16.createElement(import_ui11.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React16.createElement(import_editor_controls6.ColorControl, null))));
|
|
670
|
-
};
|
|
671
|
-
|
|
672
661
|
// src/components/style-sections/background-section/background-section.tsx
|
|
673
662
|
var BackgroundSection = () => {
|
|
674
|
-
return /* @__PURE__ */
|
|
663
|
+
return /* @__PURE__ */ React16.createElement(StylesField, { bind: "background" }, /* @__PURE__ */ React16.createElement(import_editor_controls6.BackgroundControl, null));
|
|
675
664
|
};
|
|
676
665
|
|
|
677
666
|
// src/components/style-sections/border-section/border-section.tsx
|
|
678
|
-
var
|
|
679
|
-
var
|
|
667
|
+
var React23 = __toESM(require("react"));
|
|
668
|
+
var import_ui14 = require("@elementor/ui");
|
|
680
669
|
|
|
681
670
|
// src/components/style-sections/border-section/border-field.tsx
|
|
682
|
-
var
|
|
683
|
-
var
|
|
671
|
+
var React21 = __toESM(require("react"));
|
|
672
|
+
var import_i18n6 = require("@wordpress/i18n");
|
|
684
673
|
|
|
685
674
|
// src/components/add-or-remove-content.tsx
|
|
686
|
-
var
|
|
687
|
-
var
|
|
675
|
+
var React17 = __toESM(require("react"));
|
|
676
|
+
var import_editor_controls7 = require("@elementor/editor-controls");
|
|
688
677
|
var import_icons3 = require("@elementor/icons");
|
|
689
|
-
var
|
|
678
|
+
var import_ui11 = require("@elementor/ui");
|
|
690
679
|
var SIZE2 = "tiny";
|
|
691
680
|
var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
692
|
-
return /* @__PURE__ */
|
|
693
|
-
|
|
681
|
+
return /* @__PURE__ */ React17.createElement(import_ui11.Stack, { gap: 1.5 }, /* @__PURE__ */ React17.createElement(
|
|
682
|
+
import_ui11.Stack,
|
|
694
683
|
{
|
|
695
684
|
direction: "row",
|
|
696
685
|
sx: {
|
|
@@ -698,75 +687,75 @@ var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
|
698
687
|
alignItems: "center"
|
|
699
688
|
}
|
|
700
689
|
},
|
|
701
|
-
/* @__PURE__ */
|
|
702
|
-
isAdded ? /* @__PURE__ */
|
|
703
|
-
), /* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ React17.createElement(import_editor_controls7.ControlLabel, null, label),
|
|
691
|
+
isAdded ? /* @__PURE__ */ React17.createElement(import_ui11.IconButton, { size: SIZE2, onClick: onRemove }, /* @__PURE__ */ React17.createElement(import_icons3.MinusIcon, { fontSize: SIZE2 })) : /* @__PURE__ */ React17.createElement(import_ui11.IconButton, { size: SIZE2, onClick: onAdd }, /* @__PURE__ */ React17.createElement(import_icons3.PlusIcon, { fontSize: SIZE2 }))
|
|
692
|
+
), /* @__PURE__ */ React17.createElement(import_ui11.Collapse, { in: isAdded, unmountOnExit: true }, /* @__PURE__ */ React17.createElement(import_ui11.Stack, { gap: 1.5 }, children)));
|
|
704
693
|
};
|
|
705
694
|
|
|
706
695
|
// src/components/style-sections/border-section/border-color-field.tsx
|
|
707
|
-
var
|
|
708
|
-
var
|
|
709
|
-
var
|
|
710
|
-
var
|
|
696
|
+
var React18 = __toESM(require("react"));
|
|
697
|
+
var import_editor_controls8 = require("@elementor/editor-controls");
|
|
698
|
+
var import_ui12 = require("@elementor/ui");
|
|
699
|
+
var import_i18n3 = require("@wordpress/i18n");
|
|
711
700
|
var BorderColorField = () => {
|
|
712
|
-
return /* @__PURE__ */
|
|
701
|
+
return /* @__PURE__ */ React18.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React18.createElement(import_ui12.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React18.createElement(import_ui12.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React18.createElement(import_editor_controls8.ControlLabel, null, (0, import_i18n3.__)("Border Color", "elementor"))), /* @__PURE__ */ React18.createElement(import_ui12.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React18.createElement(import_editor_controls8.ColorControl, null))));
|
|
713
702
|
};
|
|
714
703
|
|
|
715
704
|
// src/components/style-sections/border-section/border-style-field.tsx
|
|
716
|
-
var
|
|
717
|
-
var
|
|
718
|
-
var
|
|
719
|
-
var
|
|
705
|
+
var React19 = __toESM(require("react"));
|
|
706
|
+
var import_editor_controls9 = require("@elementor/editor-controls");
|
|
707
|
+
var import_ui13 = require("@elementor/ui");
|
|
708
|
+
var import_i18n4 = require("@wordpress/i18n");
|
|
720
709
|
var borderStyles = [
|
|
721
|
-
{ value: "none", label: (0,
|
|
722
|
-
{ value: "solid", label: (0,
|
|
723
|
-
{ value: "dashed", label: (0,
|
|
724
|
-
{ value: "dotted", label: (0,
|
|
725
|
-
{ value: "double", label: (0,
|
|
726
|
-
{ value: "groove", label: (0,
|
|
727
|
-
{ value: "ridge", label: (0,
|
|
728
|
-
{ value: "inset", label: (0,
|
|
729
|
-
{ value: "outset", label: (0,
|
|
710
|
+
{ value: "none", label: (0, import_i18n4.__)("None", "elementor") },
|
|
711
|
+
{ value: "solid", label: (0, import_i18n4.__)("Solid", "elementor") },
|
|
712
|
+
{ value: "dashed", label: (0, import_i18n4.__)("Dashed", "elementor") },
|
|
713
|
+
{ value: "dotted", label: (0, import_i18n4.__)("Dotted", "elementor") },
|
|
714
|
+
{ value: "double", label: (0, import_i18n4.__)("Double", "elementor") },
|
|
715
|
+
{ value: "groove", label: (0, import_i18n4.__)("Groove", "elementor") },
|
|
716
|
+
{ value: "ridge", label: (0, import_i18n4.__)("Ridge", "elementor") },
|
|
717
|
+
{ value: "inset", label: (0, import_i18n4.__)("Inset", "elementor") },
|
|
718
|
+
{ value: "outset", label: (0, import_i18n4.__)("Outset", "elementor") }
|
|
730
719
|
];
|
|
731
720
|
var BorderStyleField = () => {
|
|
732
|
-
return /* @__PURE__ */
|
|
721
|
+
return /* @__PURE__ */ React19.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React19.createElement(import_ui13.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React19.createElement(import_ui13.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(import_editor_controls9.ControlLabel, null, (0, import_i18n4.__)("Border Type", "elementor"))), /* @__PURE__ */ React19.createElement(import_ui13.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(import_editor_controls9.SelectControl, { options: borderStyles }))));
|
|
733
722
|
};
|
|
734
723
|
|
|
735
724
|
// src/components/style-sections/border-section/border-width-field.tsx
|
|
736
|
-
var
|
|
737
|
-
var
|
|
725
|
+
var React20 = __toESM(require("react"));
|
|
726
|
+
var import_editor_controls10 = require("@elementor/editor-controls");
|
|
738
727
|
var import_editor_props2 = require("@elementor/editor-props");
|
|
739
728
|
var import_icons4 = require("@elementor/icons");
|
|
740
|
-
var
|
|
729
|
+
var import_i18n5 = require("@wordpress/i18n");
|
|
741
730
|
var edges = [
|
|
742
731
|
{
|
|
743
|
-
label: (0,
|
|
744
|
-
icon: /* @__PURE__ */
|
|
732
|
+
label: (0, import_i18n5.__)("Top", "elementor"),
|
|
733
|
+
icon: /* @__PURE__ */ React20.createElement(import_icons4.SideTopIcon, { fontSize: "tiny" }),
|
|
745
734
|
bind: "top"
|
|
746
735
|
},
|
|
747
736
|
{
|
|
748
|
-
label: (0,
|
|
749
|
-
icon: /* @__PURE__ */
|
|
737
|
+
label: (0, import_i18n5.__)("Right", "elementor"),
|
|
738
|
+
icon: /* @__PURE__ */ React20.createElement(import_icons4.SideRightIcon, { fontSize: "tiny" }),
|
|
750
739
|
bind: "right"
|
|
751
740
|
},
|
|
752
741
|
{
|
|
753
|
-
label: (0,
|
|
754
|
-
icon: /* @__PURE__ */
|
|
742
|
+
label: (0, import_i18n5.__)("Bottom", "elementor"),
|
|
743
|
+
icon: /* @__PURE__ */ React20.createElement(import_icons4.SideBottomIcon, { fontSize: "tiny" }),
|
|
755
744
|
bind: "bottom"
|
|
756
745
|
},
|
|
757
746
|
{
|
|
758
|
-
label: (0,
|
|
759
|
-
icon: /* @__PURE__ */
|
|
747
|
+
label: (0, import_i18n5.__)("Left", "elementor"),
|
|
748
|
+
icon: /* @__PURE__ */ React20.createElement(import_icons4.SideLeftIcon, { fontSize: "tiny" }),
|
|
760
749
|
bind: "left"
|
|
761
750
|
}
|
|
762
751
|
];
|
|
763
752
|
var BorderWidthField = () => {
|
|
764
|
-
return /* @__PURE__ */
|
|
765
|
-
|
|
753
|
+
return /* @__PURE__ */ React20.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React20.createElement(
|
|
754
|
+
import_editor_controls10.EqualUnequalSizesControl,
|
|
766
755
|
{
|
|
767
756
|
items: edges,
|
|
768
|
-
label: (0,
|
|
769
|
-
icon: /* @__PURE__ */
|
|
757
|
+
label: (0, import_i18n5.__)("Border Width", "elementor"),
|
|
758
|
+
icon: /* @__PURE__ */ React20.createElement(import_icons4.SideAllIcon, { fontSize: "tiny" }),
|
|
770
759
|
multiSizePropTypeUtil: import_editor_props2.borderWidthPropTypeUtil
|
|
771
760
|
}
|
|
772
761
|
));
|
|
@@ -795,96 +784,122 @@ var BorderField = () => {
|
|
|
795
784
|
setBorderStyle(null);
|
|
796
785
|
};
|
|
797
786
|
const hasBorder = Boolean(borderWidth || borderColor || borderStyle);
|
|
798
|
-
return /* @__PURE__ */
|
|
787
|
+
return /* @__PURE__ */ React21.createElement(
|
|
799
788
|
AddOrRemoveContent,
|
|
800
789
|
{
|
|
801
|
-
label: (0,
|
|
790
|
+
label: (0, import_i18n6.__)("Border", "elementor"),
|
|
802
791
|
isAdded: hasBorder,
|
|
803
792
|
onAdd: addBorder,
|
|
804
793
|
onRemove: removeBorder
|
|
805
794
|
},
|
|
806
|
-
/* @__PURE__ */
|
|
807
|
-
/* @__PURE__ */
|
|
808
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ React21.createElement(BorderWidthField, null),
|
|
796
|
+
/* @__PURE__ */ React21.createElement(BorderColorField, null),
|
|
797
|
+
/* @__PURE__ */ React21.createElement(BorderStyleField, null)
|
|
809
798
|
);
|
|
810
799
|
};
|
|
811
800
|
|
|
812
801
|
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
813
|
-
var
|
|
814
|
-
var
|
|
802
|
+
var React22 = __toESM(require("react"));
|
|
803
|
+
var import_editor_controls11 = require("@elementor/editor-controls");
|
|
815
804
|
var import_editor_props3 = require("@elementor/editor-props");
|
|
816
805
|
var import_icons5 = require("@elementor/icons");
|
|
817
|
-
var
|
|
806
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
818
807
|
var corners = [
|
|
819
808
|
{
|
|
820
|
-
label: (0,
|
|
821
|
-
icon: /* @__PURE__ */
|
|
809
|
+
label: (0, import_i18n7.__)("Top Left", "elementor"),
|
|
810
|
+
icon: /* @__PURE__ */ React22.createElement(import_icons5.RadiusTopLeftIcon, { fontSize: "tiny" }),
|
|
822
811
|
bind: "top-left"
|
|
823
812
|
},
|
|
824
813
|
{
|
|
825
|
-
label: (0,
|
|
826
|
-
icon: /* @__PURE__ */
|
|
814
|
+
label: (0, import_i18n7.__)("Top Right", "elementor"),
|
|
815
|
+
icon: /* @__PURE__ */ React22.createElement(import_icons5.RadiusTopRightIcon, { fontSize: "tiny" }),
|
|
827
816
|
bind: "top-right"
|
|
828
817
|
},
|
|
829
818
|
{
|
|
830
|
-
label: (0,
|
|
831
|
-
icon: /* @__PURE__ */
|
|
819
|
+
label: (0, import_i18n7.__)("Bottom Right", "elementor"),
|
|
820
|
+
icon: /* @__PURE__ */ React22.createElement(import_icons5.RadiusBottomRightIcon, { fontSize: "tiny" }),
|
|
832
821
|
bind: "bottom-right"
|
|
833
822
|
},
|
|
834
823
|
{
|
|
835
|
-
label: (0,
|
|
836
|
-
icon: /* @__PURE__ */
|
|
824
|
+
label: (0, import_i18n7.__)("Bottom Left", "elementor"),
|
|
825
|
+
icon: /* @__PURE__ */ React22.createElement(import_icons5.RadiusBottomLeftIcon, { fontSize: "tiny" }),
|
|
837
826
|
bind: "bottom-left"
|
|
838
827
|
}
|
|
839
828
|
];
|
|
840
829
|
var BorderRadiusField = () => {
|
|
841
|
-
return /* @__PURE__ */
|
|
842
|
-
|
|
830
|
+
return /* @__PURE__ */ React22.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React22.createElement(
|
|
831
|
+
import_editor_controls11.EqualUnequalSizesControl,
|
|
843
832
|
{
|
|
844
833
|
items: corners,
|
|
845
|
-
label: (0,
|
|
846
|
-
icon: /* @__PURE__ */
|
|
834
|
+
label: (0, import_i18n7.__)("Border Radius", "elementor"),
|
|
835
|
+
icon: /* @__PURE__ */ React22.createElement(import_icons5.BorderCornersIcon, { fontSize: "tiny" }),
|
|
847
836
|
multiSizePropTypeUtil: import_editor_props3.borderRadiusPropTypeUtil
|
|
848
837
|
}
|
|
849
838
|
));
|
|
850
839
|
};
|
|
851
840
|
|
|
852
841
|
// src/components/style-sections/border-section/border-section.tsx
|
|
853
|
-
var BorderSection = () => /* @__PURE__ */
|
|
842
|
+
var BorderSection = () => /* @__PURE__ */ React23.createElement(import_ui14.Stack, { gap: 1.5 }, /* @__PURE__ */ React23.createElement(BorderRadiusField, null), /* @__PURE__ */ React23.createElement(import_ui14.Divider, null), /* @__PURE__ */ React23.createElement(BorderField, null));
|
|
854
843
|
|
|
855
844
|
// src/components/style-sections/effects-section/effects-section.tsx
|
|
856
|
-
var
|
|
857
|
-
var
|
|
858
|
-
var
|
|
845
|
+
var React24 = __toESM(require("react"));
|
|
846
|
+
var import_editor_controls12 = require("@elementor/editor-controls");
|
|
847
|
+
var import_ui15 = require("@elementor/ui");
|
|
859
848
|
var EffectsSection = () => {
|
|
860
|
-
return /* @__PURE__ */
|
|
849
|
+
return /* @__PURE__ */ React24.createElement(import_ui15.Stack, { gap: 1.5 }, /* @__PURE__ */ React24.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React24.createElement(import_editor_controls12.BoxShadowRepeaterControl, null)));
|
|
861
850
|
};
|
|
862
851
|
|
|
863
852
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
864
|
-
var
|
|
865
|
-
var
|
|
866
|
-
var
|
|
867
|
-
var
|
|
853
|
+
var React35 = __toESM(require("react"));
|
|
854
|
+
var import_editor_controls22 = require("@elementor/editor-controls");
|
|
855
|
+
var import_editor_elements4 = require("@elementor/editor-elements");
|
|
856
|
+
var import_ui27 = require("@elementor/ui");
|
|
857
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
858
|
+
|
|
859
|
+
// src/hooks/use-computed-style.ts
|
|
860
|
+
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
861
|
+
function useComputedStyle(elementId) {
|
|
862
|
+
return (0, import_editor_v1_adapters.__privateUseListenTo)(
|
|
863
|
+
[
|
|
864
|
+
(0, import_editor_v1_adapters.windowEvent)("elementor/device-mode/change"),
|
|
865
|
+
(0, import_editor_v1_adapters.commandEndEvent)("document/elements/reset-style"),
|
|
866
|
+
(0, import_editor_v1_adapters.commandEndEvent)("document/elements/settings"),
|
|
867
|
+
(0, import_editor_v1_adapters.commandEndEvent)("document/elements/paste-style")
|
|
868
|
+
],
|
|
869
|
+
() => {
|
|
870
|
+
if (!elementId) {
|
|
871
|
+
return null;
|
|
872
|
+
}
|
|
873
|
+
const extendedWindow = window;
|
|
874
|
+
const element = extendedWindow.elementor?.getContainer?.(elementId);
|
|
875
|
+
if (!element?.view?.el) {
|
|
876
|
+
return null;
|
|
877
|
+
}
|
|
878
|
+
const resp = window.getComputedStyle(element.view.el);
|
|
879
|
+
return resp;
|
|
880
|
+
}
|
|
881
|
+
);
|
|
882
|
+
}
|
|
868
883
|
|
|
869
884
|
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
870
|
-
var
|
|
871
|
-
var
|
|
885
|
+
var React26 = __toESM(require("react"));
|
|
886
|
+
var import_editor_controls13 = require("@elementor/editor-controls");
|
|
872
887
|
var import_icons6 = require("@elementor/icons");
|
|
873
|
-
var
|
|
874
|
-
var
|
|
888
|
+
var import_ui18 = require("@elementor/ui");
|
|
889
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
875
890
|
|
|
876
891
|
// src/hooks/use-direction.ts
|
|
877
|
-
var
|
|
892
|
+
var import_ui16 = require("@elementor/ui");
|
|
878
893
|
function useDirection() {
|
|
879
|
-
const theme = (0,
|
|
894
|
+
const theme = (0, import_ui16.useTheme)(), extendedWindow = window;
|
|
880
895
|
const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!extendedWindow.elementorFrontend?.config?.is_rtl;
|
|
881
896
|
return { isSiteRtl, isUiRtl };
|
|
882
897
|
}
|
|
883
898
|
|
|
884
899
|
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
885
|
-
var
|
|
886
|
-
var
|
|
887
|
-
var
|
|
900
|
+
var React25 = __toESM(require("react"));
|
|
901
|
+
var import_react7 = require("react");
|
|
902
|
+
var import_ui17 = require("@elementor/ui");
|
|
888
903
|
var CLOCKWISE_ANGLES = {
|
|
889
904
|
row: 0,
|
|
890
905
|
column: 90,
|
|
@@ -898,13 +913,13 @@ var COUNTER_CLOCKWISE_ANGLES = {
|
|
|
898
913
|
"column-reverse": -270
|
|
899
914
|
};
|
|
900
915
|
var RotatedIcon = ({ icon: Icon, size, isClockwise = true, offset = 0 }) => {
|
|
901
|
-
const rotate = (0,
|
|
916
|
+
const rotate = (0, import_react7.useRef)(useGetTargetAngle(isClockwise, offset));
|
|
902
917
|
rotate.current = useGetTargetAngle(isClockwise, offset, rotate);
|
|
903
|
-
return /* @__PURE__ */
|
|
918
|
+
return /* @__PURE__ */ React25.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
904
919
|
};
|
|
905
920
|
var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
906
921
|
const [direction] = useStylesField("flex-direction");
|
|
907
|
-
const isRtl = "rtl" === (0,
|
|
922
|
+
const isRtl = "rtl" === (0, import_ui17.useTheme)().direction;
|
|
908
923
|
const rotationMultiplier = isRtl ? -1 : 1;
|
|
909
924
|
const angleMap = isClockwise ? CLOCKWISE_ANGLES : COUNTER_CLOCKWISE_ANGLES;
|
|
910
925
|
const currentAngle = existingRef ? existingRef.current * rotationMultiplier : angleMap[direction?.value || "row"] + offset;
|
|
@@ -915,8 +930,8 @@ var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
|
915
930
|
};
|
|
916
931
|
|
|
917
932
|
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
918
|
-
var StartIcon = (0,
|
|
919
|
-
var EndIcon = (0,
|
|
933
|
+
var StartIcon = (0, import_ui18.withDirection)(import_icons6.LayoutAlignLeftIcon);
|
|
934
|
+
var EndIcon = (0, import_ui18.withDirection)(import_icons6.LayoutAlignRightIcon);
|
|
920
935
|
var iconProps = {
|
|
921
936
|
isClockwise: false,
|
|
922
937
|
offset: 90
|
|
@@ -924,42 +939,42 @@ var iconProps = {
|
|
|
924
939
|
var options = [
|
|
925
940
|
{
|
|
926
941
|
value: "start",
|
|
927
|
-
label: (0,
|
|
928
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
942
|
+
label: (0, import_i18n8.__)("Start", "elementor"),
|
|
943
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(RotatedIcon, { icon: StartIcon, size, ...iconProps }),
|
|
929
944
|
showTooltip: true
|
|
930
945
|
},
|
|
931
946
|
{
|
|
932
947
|
value: "center",
|
|
933
|
-
label: (0,
|
|
934
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
948
|
+
label: (0, import_i18n8.__)("Center", "elementor"),
|
|
949
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(RotatedIcon, { icon: import_icons6.LayoutAlignCenterIcon, size, ...iconProps }),
|
|
935
950
|
showTooltip: true
|
|
936
951
|
},
|
|
937
952
|
{
|
|
938
953
|
value: "end",
|
|
939
|
-
label: (0,
|
|
940
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
954
|
+
label: (0, import_i18n8.__)("End", "elementor"),
|
|
955
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(RotatedIcon, { icon: EndIcon, size, ...iconProps }),
|
|
941
956
|
showTooltip: true
|
|
942
957
|
},
|
|
943
958
|
{
|
|
944
959
|
value: "stretch",
|
|
945
|
-
label: (0,
|
|
946
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
960
|
+
label: (0, import_i18n8.__)("Stretch", "elementor"),
|
|
961
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(RotatedIcon, { icon: import_icons6.LayoutDistributeVerticalIcon, size, ...iconProps }),
|
|
947
962
|
showTooltip: true
|
|
948
963
|
}
|
|
949
964
|
];
|
|
950
965
|
var AlignItemsField = () => {
|
|
951
966
|
const { isSiteRtl } = useDirection();
|
|
952
|
-
return /* @__PURE__ */
|
|
967
|
+
return /* @__PURE__ */ React26.createElement(import_ui18.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React26.createElement(import_ui18.ThemeProvider, null, /* @__PURE__ */ React26.createElement(StylesField, { bind: "align-items" }, /* @__PURE__ */ React26.createElement(import_ui18.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React26.createElement(import_ui18.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(import_editor_controls13.ControlLabel, null, (0, import_i18n8.__)("Align items", "elementor"))), /* @__PURE__ */ React26.createElement(import_ui18.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React26.createElement(import_editor_controls13.ToggleControl, { options }))))));
|
|
953
968
|
};
|
|
954
969
|
|
|
955
970
|
// src/components/style-sections/layout-section/align-self-child-field.tsx
|
|
956
|
-
var
|
|
957
|
-
var
|
|
971
|
+
var React27 = __toESM(require("react"));
|
|
972
|
+
var import_editor_controls14 = require("@elementor/editor-controls");
|
|
958
973
|
var import_icons7 = require("@elementor/icons");
|
|
959
|
-
var
|
|
960
|
-
var
|
|
961
|
-
var StartIcon2 = (0,
|
|
962
|
-
var EndIcon2 = (0,
|
|
974
|
+
var import_ui19 = require("@elementor/ui");
|
|
975
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
976
|
+
var StartIcon2 = (0, import_ui19.withDirection)(import_icons7.LayoutAlignLeftIcon);
|
|
977
|
+
var EndIcon2 = (0, import_ui19.withDirection)(import_icons7.LayoutAlignRightIcon);
|
|
963
978
|
var iconProps2 = {
|
|
964
979
|
isClockwise: false,
|
|
965
980
|
offset: 90
|
|
@@ -967,105 +982,105 @@ var iconProps2 = {
|
|
|
967
982
|
var options2 = [
|
|
968
983
|
{
|
|
969
984
|
value: "start",
|
|
970
|
-
label: (0,
|
|
971
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
985
|
+
label: (0, import_i18n9.__)("Start", "elementor"),
|
|
986
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: StartIcon2, size, ...iconProps2 }),
|
|
972
987
|
showTooltip: true
|
|
973
988
|
},
|
|
974
989
|
{
|
|
975
990
|
value: "center",
|
|
976
|
-
label: (0,
|
|
977
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
991
|
+
label: (0, import_i18n9.__)("Center", "elementor"),
|
|
992
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: import_icons7.LayoutAlignCenterIcon, size, ...iconProps2 }),
|
|
978
993
|
showTooltip: true
|
|
979
994
|
},
|
|
980
995
|
{
|
|
981
996
|
value: "end",
|
|
982
|
-
label: (0,
|
|
983
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
997
|
+
label: (0, import_i18n9.__)("End", "elementor"),
|
|
998
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: EndIcon2, size, ...iconProps2 }),
|
|
984
999
|
showTooltip: true
|
|
985
1000
|
},
|
|
986
1001
|
{
|
|
987
1002
|
value: "stretch",
|
|
988
|
-
label: (0,
|
|
989
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1003
|
+
label: (0, import_i18n9.__)("Stretch", "elementor"),
|
|
1004
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: import_icons7.LayoutDistributeVerticalIcon, size, ...iconProps2 }),
|
|
990
1005
|
showTooltip: true
|
|
991
1006
|
}
|
|
992
1007
|
];
|
|
993
1008
|
var AlignSelfChild = () => {
|
|
994
1009
|
const { isSiteRtl } = useDirection();
|
|
995
|
-
return /* @__PURE__ */
|
|
1010
|
+
return /* @__PURE__ */ React27.createElement(import_ui19.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React27.createElement(import_ui19.ThemeProvider, null, /* @__PURE__ */ React27.createElement(StylesField, { bind: "align-self" }, /* @__PURE__ */ React27.createElement(import_ui19.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(import_ui19.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React27.createElement(import_editor_controls14.ControlLabel, null, (0, import_i18n9.__)("Align self", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui19.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React27.createElement(import_editor_controls14.ToggleControl, { options: options2 }))))));
|
|
996
1011
|
};
|
|
997
1012
|
|
|
998
1013
|
// src/components/style-sections/layout-section/display-field.tsx
|
|
999
|
-
var
|
|
1000
|
-
var
|
|
1001
|
-
var
|
|
1002
|
-
var
|
|
1014
|
+
var React28 = __toESM(require("react"));
|
|
1015
|
+
var import_editor_controls15 = require("@elementor/editor-controls");
|
|
1016
|
+
var import_ui20 = require("@elementor/ui");
|
|
1017
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
1003
1018
|
var DisplayField = () => {
|
|
1004
1019
|
const options10 = [
|
|
1005
1020
|
{
|
|
1006
1021
|
value: "block",
|
|
1007
|
-
renderContent: () => (0,
|
|
1008
|
-
label: (0,
|
|
1022
|
+
renderContent: () => (0, import_i18n10.__)("Block", "elementor"),
|
|
1023
|
+
label: (0, import_i18n10.__)("Block", "elementor")
|
|
1009
1024
|
},
|
|
1010
1025
|
{
|
|
1011
1026
|
value: "flex",
|
|
1012
|
-
renderContent: () => (0,
|
|
1013
|
-
label: (0,
|
|
1027
|
+
renderContent: () => (0, import_i18n10.__)("Flex", "elementor"),
|
|
1028
|
+
label: (0, import_i18n10.__)("Flex", "elementor")
|
|
1014
1029
|
}
|
|
1015
1030
|
];
|
|
1016
|
-
return /* @__PURE__ */
|
|
1031
|
+
return /* @__PURE__ */ React28.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React28.createElement(import_ui20.Stack, { gap: 1 }, /* @__PURE__ */ React28.createElement(import_editor_controls15.ControlLabel, null, (0, import_i18n10.__)("Display", "elementor")), /* @__PURE__ */ React28.createElement(import_editor_controls15.ToggleControl, { options: options10, fullWidth: true })));
|
|
1017
1032
|
};
|
|
1018
1033
|
|
|
1019
1034
|
// src/components/style-sections/layout-section/flex-direction-field.tsx
|
|
1020
|
-
var
|
|
1021
|
-
var
|
|
1035
|
+
var React29 = __toESM(require("react"));
|
|
1036
|
+
var import_editor_controls16 = require("@elementor/editor-controls");
|
|
1022
1037
|
var import_icons8 = require("@elementor/icons");
|
|
1023
|
-
var
|
|
1024
|
-
var
|
|
1038
|
+
var import_ui21 = require("@elementor/ui");
|
|
1039
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
1025
1040
|
var options3 = [
|
|
1026
1041
|
{
|
|
1027
1042
|
value: "row",
|
|
1028
|
-
label: (0,
|
|
1043
|
+
label: (0, import_i18n11.__)("Row", "elementor"),
|
|
1029
1044
|
renderContent: ({ size }) => {
|
|
1030
|
-
const StartIcon4 = (0,
|
|
1031
|
-
return /* @__PURE__ */
|
|
1045
|
+
const StartIcon4 = (0, import_ui21.withDirection)(import_icons8.ArrowRightIcon);
|
|
1046
|
+
return /* @__PURE__ */ React29.createElement(StartIcon4, { fontSize: size });
|
|
1032
1047
|
},
|
|
1033
1048
|
showTooltip: true
|
|
1034
1049
|
},
|
|
1035
1050
|
{
|
|
1036
1051
|
value: "column",
|
|
1037
|
-
label: (0,
|
|
1038
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1052
|
+
label: (0, import_i18n11.__)("Column", "elementor"),
|
|
1053
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(import_icons8.ArrowDownSmallIcon, { fontSize: size }),
|
|
1039
1054
|
showTooltip: true
|
|
1040
1055
|
},
|
|
1041
1056
|
{
|
|
1042
1057
|
value: "row-reverse",
|
|
1043
|
-
label: (0,
|
|
1058
|
+
label: (0, import_i18n11.__)("Reversed row", "elementor"),
|
|
1044
1059
|
renderContent: ({ size }) => {
|
|
1045
|
-
const EndIcon4 = (0,
|
|
1046
|
-
return /* @__PURE__ */
|
|
1060
|
+
const EndIcon4 = (0, import_ui21.withDirection)(import_icons8.ArrowLeftIcon);
|
|
1061
|
+
return /* @__PURE__ */ React29.createElement(EndIcon4, { fontSize: size });
|
|
1047
1062
|
},
|
|
1048
1063
|
showTooltip: true
|
|
1049
1064
|
},
|
|
1050
1065
|
{
|
|
1051
1066
|
value: "column-reverse",
|
|
1052
|
-
label: (0,
|
|
1053
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1067
|
+
label: (0, import_i18n11.__)("Reversed column", "elementor"),
|
|
1068
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(import_icons8.ArrowUpSmallIcon, { fontSize: size }),
|
|
1054
1069
|
showTooltip: true
|
|
1055
1070
|
}
|
|
1056
1071
|
];
|
|
1057
1072
|
var FlexDirectionField = () => {
|
|
1058
1073
|
const { isSiteRtl } = useDirection();
|
|
1059
|
-
return /* @__PURE__ */
|
|
1074
|
+
return /* @__PURE__ */ React29.createElement(import_ui21.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React29.createElement(import_ui21.ThemeProvider, null, /* @__PURE__ */ React29.createElement(StylesField, { bind: "flex-direction" }, /* @__PURE__ */ React29.createElement(import_ui21.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React29.createElement(import_ui21.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React29.createElement(import_editor_controls16.ControlLabel, null, (0, import_i18n11.__)("Direction", "elementor"))), /* @__PURE__ */ React29.createElement(import_ui21.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React29.createElement(import_editor_controls16.ToggleControl, { options: options3 }))))));
|
|
1060
1075
|
};
|
|
1061
1076
|
|
|
1062
1077
|
// src/components/style-sections/layout-section/flex-order-field.tsx
|
|
1063
|
-
var
|
|
1064
|
-
var
|
|
1065
|
-
var
|
|
1078
|
+
var React30 = __toESM(require("react"));
|
|
1079
|
+
var import_react8 = require("react");
|
|
1080
|
+
var import_editor_controls17 = require("@elementor/editor-controls");
|
|
1066
1081
|
var import_icons9 = require("@elementor/icons");
|
|
1067
|
-
var
|
|
1068
|
-
var
|
|
1082
|
+
var import_ui22 = require("@elementor/ui");
|
|
1083
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
1069
1084
|
var FIRST_DEFAULT_VALUE = -99999;
|
|
1070
1085
|
var LAST_DEFAULT_VALUE = 99999;
|
|
1071
1086
|
var FIRST = "first";
|
|
@@ -1078,26 +1093,26 @@ var orderValueMap = {
|
|
|
1078
1093
|
var items = [
|
|
1079
1094
|
{
|
|
1080
1095
|
value: FIRST,
|
|
1081
|
-
label: (0,
|
|
1082
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1096
|
+
label: (0, import_i18n12.__)("First", "elementor"),
|
|
1097
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(import_icons9.ArrowUpSmallIcon, { fontSize: size }),
|
|
1083
1098
|
showTooltip: true
|
|
1084
1099
|
},
|
|
1085
1100
|
{
|
|
1086
1101
|
value: LAST,
|
|
1087
|
-
label: (0,
|
|
1088
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1102
|
+
label: (0, import_i18n12.__)("Last", "elementor"),
|
|
1103
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(import_icons9.ArrowDownSmallIcon, { fontSize: size }),
|
|
1089
1104
|
showTooltip: true
|
|
1090
1105
|
},
|
|
1091
1106
|
{
|
|
1092
1107
|
value: CUSTOM,
|
|
1093
|
-
label: (0,
|
|
1094
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1108
|
+
label: (0, import_i18n12.__)("Custom", "elementor"),
|
|
1109
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(import_icons9.PencilIcon, { fontSize: size }),
|
|
1095
1110
|
showTooltip: true
|
|
1096
1111
|
}
|
|
1097
1112
|
];
|
|
1098
1113
|
var FlexOrderField = () => {
|
|
1099
1114
|
const { isSiteRtl } = useDirection(), [order, setOrder] = useStylesField("order");
|
|
1100
|
-
const [groupControlValue, setGroupControlValue] = (0,
|
|
1115
|
+
const [groupControlValue, setGroupControlValue] = (0, import_react8.useState)(getGroupControlValue(order?.value || null));
|
|
1101
1116
|
const handleToggleButtonChange = (group) => {
|
|
1102
1117
|
setGroupControlValue(group);
|
|
1103
1118
|
if (!group || group === CUSTOM) {
|
|
@@ -1106,16 +1121,16 @@ var FlexOrderField = () => {
|
|
|
1106
1121
|
}
|
|
1107
1122
|
setOrder({ $$type: "number", value: orderValueMap[group] });
|
|
1108
1123
|
};
|
|
1109
|
-
return /* @__PURE__ */
|
|
1110
|
-
|
|
1124
|
+
return /* @__PURE__ */ React30.createElement(import_ui22.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React30.createElement(import_ui22.ThemeProvider, null, /* @__PURE__ */ React30.createElement(import_ui22.Stack, { gap: 2 }, /* @__PURE__ */ React30.createElement(import_ui22.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(import_editor_controls17.ControlLabel, null, (0, import_i18n12.__)("Order", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui22.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React30.createElement(
|
|
1125
|
+
import_editor_controls17.ControlToggleButtonGroup,
|
|
1111
1126
|
{
|
|
1112
1127
|
items,
|
|
1113
1128
|
value: groupControlValue,
|
|
1114
1129
|
onChange: handleToggleButtonChange,
|
|
1115
1130
|
exclusive: true
|
|
1116
1131
|
}
|
|
1117
|
-
))), CUSTOM === groupControlValue && /* @__PURE__ */
|
|
1118
|
-
|
|
1132
|
+
))), CUSTOM === groupControlValue && /* @__PURE__ */ React30.createElement(StylesField, { bind: "order" }, /* @__PURE__ */ React30.createElement(import_ui22.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(import_editor_controls17.ControlLabel, null, (0, import_i18n12.__)("Custom order", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui22.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React30.createElement(
|
|
1133
|
+
import_editor_controls17.NumberControl,
|
|
1119
1134
|
{
|
|
1120
1135
|
min: FIRST_DEFAULT_VALUE + 1,
|
|
1121
1136
|
max: LAST_DEFAULT_VALUE - 1,
|
|
@@ -1134,36 +1149,36 @@ var getGroupControlValue = (order) => {
|
|
|
1134
1149
|
};
|
|
1135
1150
|
|
|
1136
1151
|
// src/components/style-sections/layout-section/flex-size-field.tsx
|
|
1137
|
-
var
|
|
1138
|
-
var
|
|
1152
|
+
var React31 = __toESM(require("react"));
|
|
1153
|
+
var import_editor_controls18 = require("@elementor/editor-controls");
|
|
1139
1154
|
var import_icons10 = require("@elementor/icons");
|
|
1140
|
-
var
|
|
1141
|
-
var
|
|
1155
|
+
var import_ui23 = require("@elementor/ui");
|
|
1156
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
1142
1157
|
var DEFAULT = 1;
|
|
1143
1158
|
var items2 = [
|
|
1144
1159
|
{
|
|
1145
1160
|
value: "flex-grow",
|
|
1146
|
-
label: (0,
|
|
1147
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1161
|
+
label: (0, import_i18n13.__)("Grow", "elementor"),
|
|
1162
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(import_icons10.ExpandIcon, { fontSize: size }),
|
|
1148
1163
|
showTooltip: true
|
|
1149
1164
|
},
|
|
1150
1165
|
{
|
|
1151
1166
|
value: "flex-shrink",
|
|
1152
|
-
label: (0,
|
|
1153
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1167
|
+
label: (0, import_i18n13.__)("Shrink", "elementor"),
|
|
1168
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(import_icons10.ShrinkIcon, { fontSize: size }),
|
|
1154
1169
|
showTooltip: true
|
|
1155
1170
|
},
|
|
1156
1171
|
{
|
|
1157
1172
|
value: "custom",
|
|
1158
|
-
label: (0,
|
|
1159
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1173
|
+
label: (0, import_i18n13.__)("Custom", "elementor"),
|
|
1174
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(import_icons10.PencilIcon, { fontSize: size }),
|
|
1160
1175
|
showTooltip: true
|
|
1161
1176
|
}
|
|
1162
1177
|
];
|
|
1163
1178
|
var FlexSizeField = () => {
|
|
1164
1179
|
const { isSiteRtl } = useDirection(), [growField, setGrowField] = useStylesField("flex-grow"), [shrinkField, setShrinkField] = useStylesField("flex-shrink"), [basisField, setBasisField] = useStylesField("flex-basis");
|
|
1165
1180
|
const grow = growField?.value || null, shrink = shrinkField?.value || null, basis = basisField?.value || null;
|
|
1166
|
-
const currentGroup =
|
|
1181
|
+
const currentGroup = React31.useMemo(() => getActiveGroup({ grow, shrink, basis }), [grow, shrink, basis]), [activeGroup, setActiveGroup] = React31.useState(currentGroup);
|
|
1167
1182
|
const onChangeGroup = (group = null) => {
|
|
1168
1183
|
setActiveGroup(group);
|
|
1169
1184
|
setBasisField(null);
|
|
@@ -1180,17 +1195,17 @@ var FlexSizeField = () => {
|
|
|
1180
1195
|
setGrowField(null);
|
|
1181
1196
|
setShrinkField({ $$type: "number", value: DEFAULT });
|
|
1182
1197
|
};
|
|
1183
|
-
return /* @__PURE__ */
|
|
1184
|
-
|
|
1198
|
+
return /* @__PURE__ */ React31.createElement(import_ui23.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React31.createElement(import_ui23.ThemeProvider, null, /* @__PURE__ */ React31.createElement(import_ui23.Stack, { gap: 2 }, /* @__PURE__ */ React31.createElement(import_ui23.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n13.__)("Size", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui23.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(
|
|
1199
|
+
import_editor_controls18.ControlToggleButtonGroup,
|
|
1185
1200
|
{
|
|
1186
1201
|
value: activeGroup,
|
|
1187
1202
|
onChange: onChangeGroup,
|
|
1188
1203
|
items: items2,
|
|
1189
1204
|
exclusive: true
|
|
1190
1205
|
}
|
|
1191
|
-
))), "custom" === activeGroup && /* @__PURE__ */
|
|
1206
|
+
))), "custom" === activeGroup && /* @__PURE__ */ React31.createElement(FlexCustomField, null))));
|
|
1192
1207
|
};
|
|
1193
|
-
var FlexCustomField = () => /* @__PURE__ */
|
|
1208
|
+
var FlexCustomField = () => /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(StylesField, { bind: "flex-grow" }, /* @__PURE__ */ React31.createElement(import_ui23.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n13.__)("Grow", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui23.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(import_editor_controls18.NumberControl, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React31.createElement(StylesField, { bind: "flex-shrink" }, /* @__PURE__ */ React31.createElement(import_ui23.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n13.__)("Shrink", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui23.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(import_editor_controls18.NumberControl, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React31.createElement(StylesField, { bind: "flex-basis" }, /* @__PURE__ */ React31.createElement(import_ui23.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n13.__)("Basis", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui23.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(import_editor_controls18.SizeControl, null)))));
|
|
1194
1209
|
var getActiveGroup = ({
|
|
1195
1210
|
grow,
|
|
1196
1211
|
shrink,
|
|
@@ -1212,22 +1227,22 @@ var getActiveGroup = ({
|
|
|
1212
1227
|
};
|
|
1213
1228
|
|
|
1214
1229
|
// src/components/style-sections/layout-section/gap-control-field.tsx
|
|
1215
|
-
var
|
|
1216
|
-
var
|
|
1217
|
-
var
|
|
1218
|
-
var
|
|
1230
|
+
var React32 = __toESM(require("react"));
|
|
1231
|
+
var import_editor_controls19 = require("@elementor/editor-controls");
|
|
1232
|
+
var import_ui24 = require("@elementor/ui");
|
|
1233
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
1219
1234
|
var GapControlField = () => {
|
|
1220
|
-
return /* @__PURE__ */
|
|
1235
|
+
return /* @__PURE__ */ React32.createElement(import_ui24.Stack, { gap: 1 }, /* @__PURE__ */ React32.createElement(StylesField, { bind: "gap" }, /* @__PURE__ */ React32.createElement(import_editor_controls19.GapControl, { label: (0, import_i18n14.__)("Gaps", "elementor") })));
|
|
1221
1236
|
};
|
|
1222
1237
|
|
|
1223
1238
|
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
1224
|
-
var
|
|
1225
|
-
var
|
|
1239
|
+
var React33 = __toESM(require("react"));
|
|
1240
|
+
var import_editor_controls20 = require("@elementor/editor-controls");
|
|
1226
1241
|
var import_icons11 = require("@elementor/icons");
|
|
1227
|
-
var
|
|
1228
|
-
var
|
|
1229
|
-
var StartIcon3 = (0,
|
|
1230
|
-
var EndIcon3 = (0,
|
|
1242
|
+
var import_ui25 = require("@elementor/ui");
|
|
1243
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
1244
|
+
var StartIcon3 = (0, import_ui25.withDirection)(import_icons11.JustifyTopIcon);
|
|
1245
|
+
var EndIcon3 = (0, import_ui25.withDirection)(import_icons11.JustifyBottomIcon);
|
|
1231
1246
|
var iconProps3 = {
|
|
1232
1247
|
isClockwise: true,
|
|
1233
1248
|
offset: -90
|
|
@@ -1235,349 +1250,296 @@ var iconProps3 = {
|
|
|
1235
1250
|
var options4 = [
|
|
1236
1251
|
{
|
|
1237
1252
|
value: "start",
|
|
1238
|
-
label: (0,
|
|
1239
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1253
|
+
label: (0, import_i18n15.__)("Start", "elementor"),
|
|
1254
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(RotatedIcon, { icon: StartIcon3, size, ...iconProps3 }),
|
|
1240
1255
|
showTooltip: true
|
|
1241
1256
|
},
|
|
1242
1257
|
{
|
|
1243
1258
|
value: "center",
|
|
1244
|
-
label: (0,
|
|
1245
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1259
|
+
label: (0, import_i18n15.__)("Center", "elementor"),
|
|
1260
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(RotatedIcon, { icon: import_icons11.JustifyCenterIcon, size, ...iconProps3 }),
|
|
1246
1261
|
showTooltip: true
|
|
1247
1262
|
},
|
|
1248
1263
|
{
|
|
1249
1264
|
value: "end",
|
|
1250
|
-
label: (0,
|
|
1251
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1265
|
+
label: (0, import_i18n15.__)("End", "elementor"),
|
|
1266
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(RotatedIcon, { icon: EndIcon3, size, ...iconProps3 }),
|
|
1252
1267
|
showTooltip: true
|
|
1253
1268
|
},
|
|
1254
1269
|
{
|
|
1255
1270
|
value: "space-between",
|
|
1256
|
-
label: (0,
|
|
1257
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1271
|
+
label: (0, import_i18n15.__)("Space between", "elementor"),
|
|
1272
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(RotatedIcon, { icon: import_icons11.JustifySpaceBetweenVerticalIcon, size, ...iconProps3 }),
|
|
1258
1273
|
showTooltip: true
|
|
1259
1274
|
},
|
|
1260
1275
|
{
|
|
1261
1276
|
value: "space-around",
|
|
1262
|
-
label: (0,
|
|
1263
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1277
|
+
label: (0, import_i18n15.__)("Space around", "elementor"),
|
|
1278
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(RotatedIcon, { icon: import_icons11.JustifySpaceAroundVerticalIcon, size, ...iconProps3 }),
|
|
1264
1279
|
showTooltip: true
|
|
1265
1280
|
},
|
|
1266
1281
|
{
|
|
1267
1282
|
value: "space-evenly",
|
|
1268
|
-
label: (0,
|
|
1269
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1283
|
+
label: (0, import_i18n15.__)("Space evenly", "elementor"),
|
|
1284
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(RotatedIcon, { icon: import_icons11.JustifyDistributeVerticalIcon, size, ...iconProps3 }),
|
|
1270
1285
|
showTooltip: true
|
|
1271
1286
|
}
|
|
1272
1287
|
];
|
|
1273
1288
|
var JustifyContentField = () => {
|
|
1274
1289
|
const { isSiteRtl } = useDirection();
|
|
1275
|
-
return /* @__PURE__ */
|
|
1290
|
+
return /* @__PURE__ */ React33.createElement(import_ui25.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React33.createElement(import_ui25.ThemeProvider, null, /* @__PURE__ */ React33.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React33.createElement(import_ui25.Stack, { gap: 1 }, /* @__PURE__ */ React33.createElement(import_editor_controls20.ControlLabel, null, (0, import_i18n15.__)("Justify content", "elementor")), /* @__PURE__ */ React33.createElement(import_editor_controls20.ToggleControl, { options: options4, fullWidth: true })))));
|
|
1276
1291
|
};
|
|
1277
1292
|
|
|
1278
1293
|
// src/components/style-sections/layout-section/wrap-field.tsx
|
|
1279
|
-
var
|
|
1280
|
-
var
|
|
1294
|
+
var React34 = __toESM(require("react"));
|
|
1295
|
+
var import_editor_controls21 = require("@elementor/editor-controls");
|
|
1281
1296
|
var import_icons12 = require("@elementor/icons");
|
|
1282
|
-
var
|
|
1283
|
-
var
|
|
1297
|
+
var import_ui26 = require("@elementor/ui");
|
|
1298
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
1284
1299
|
var options5 = [
|
|
1285
1300
|
{
|
|
1286
1301
|
value: "nowrap",
|
|
1287
|
-
label: (0,
|
|
1288
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1302
|
+
label: (0, import_i18n16.__)("No wrap", "elementor"),
|
|
1303
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(import_icons12.ArrowRightIcon, { fontSize: size }),
|
|
1289
1304
|
showTooltip: true
|
|
1290
1305
|
},
|
|
1291
1306
|
{
|
|
1292
1307
|
value: "wrap",
|
|
1293
|
-
label: (0,
|
|
1294
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1308
|
+
label: (0, import_i18n16.__)("Wrap", "elementor"),
|
|
1309
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(import_icons12.ArrowBackIcon, { fontSize: size }),
|
|
1295
1310
|
showTooltip: true
|
|
1296
1311
|
},
|
|
1297
1312
|
{
|
|
1298
1313
|
value: "wrap-reverse",
|
|
1299
|
-
label: (0,
|
|
1300
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1314
|
+
label: (0, import_i18n16.__)("Reversed wrap", "elementor"),
|
|
1315
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(import_icons12.ArrowForwardIcon, { fontSize: size }),
|
|
1301
1316
|
showTooltip: true
|
|
1302
1317
|
}
|
|
1303
1318
|
];
|
|
1304
1319
|
var WrapField = () => {
|
|
1305
1320
|
const { isSiteRtl } = useDirection();
|
|
1306
|
-
return /* @__PURE__ */
|
|
1321
|
+
return /* @__PURE__ */ React34.createElement(import_ui26.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React34.createElement(import_ui26.ThemeProvider, null, /* @__PURE__ */ React34.createElement(StylesField, { bind: "flex-wrap" }, /* @__PURE__ */ React34.createElement(import_ui26.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React34.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(import_editor_controls21.ControlLabel, null, (0, import_i18n16.__)("Wrap", "elementor"))), /* @__PURE__ */ React34.createElement(import_ui26.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React34.createElement(import_editor_controls21.ToggleControl, { options: options5 }))))));
|
|
1307
1322
|
};
|
|
1308
1323
|
|
|
1309
1324
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
1310
1325
|
var LayoutSection = () => {
|
|
1311
1326
|
const [display] = useStylesField("display");
|
|
1312
|
-
|
|
1327
|
+
const { element } = useElement();
|
|
1328
|
+
const parent = (0, import_editor_elements4.useParentElement)(element.id);
|
|
1329
|
+
const parentStyle = useComputedStyle(parent?.id || null);
|
|
1330
|
+
return /* @__PURE__ */ React35.createElement(import_ui27.Stack, { gap: 2 }, /* @__PURE__ */ React35.createElement(DisplayField, null), "flex" === display?.value && /* @__PURE__ */ React35.createElement(FlexFields, null), "flex" === parentStyle?.display && /* @__PURE__ */ React35.createElement(FlexChildFields, null));
|
|
1313
1331
|
};
|
|
1314
|
-
var FlexFields = () => /* @__PURE__ */
|
|
1332
|
+
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(import_ui27.Divider, null), /* @__PURE__ */ React35.createElement(GapControlField, null), /* @__PURE__ */ React35.createElement(WrapField, null));
|
|
1333
|
+
var FlexChildFields = () => /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(import_ui27.Divider, null), /* @__PURE__ */ React35.createElement(import_editor_controls22.ControlLabel, null, (0, import_i18n17.__)("Flex child", "elementor")), /* @__PURE__ */ React35.createElement(AlignSelfChild, null), /* @__PURE__ */ React35.createElement(FlexOrderField, null), /* @__PURE__ */ React35.createElement(FlexSizeField, null));
|
|
1315
1334
|
|
|
1316
1335
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1317
|
-
var
|
|
1318
|
-
var
|
|
1319
|
-
var import_ui33 = require("@elementor/ui");
|
|
1320
|
-
|
|
1321
|
-
// src/hooks/use-style-prop-history.ts
|
|
1322
|
-
var import_react11 = require("react");
|
|
1323
|
-
var import_editor_elements4 = require("@elementor/editor-elements");
|
|
1336
|
+
var React39 = __toESM(require("react"));
|
|
1337
|
+
var import_ui31 = require("@elementor/ui");
|
|
1324
1338
|
|
|
1325
|
-
// src/hooks/use-
|
|
1326
|
-
var
|
|
1339
|
+
// src/hooks/use-session-storage.ts
|
|
1340
|
+
var import_react9 = require("react");
|
|
1327
1341
|
var import_utils2 = require("@elementor/utils");
|
|
1328
|
-
var
|
|
1329
|
-
|
|
1330
|
-
const
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
}, [elementKey]);
|
|
1335
|
-
const getPropValue = (0, import_react10.useCallback)(
|
|
1336
|
-
(propKey) => {
|
|
1337
|
-
const elementPropValues = getElementPropsHistory();
|
|
1338
|
-
return elementPropValues?.[propKey] ?? null;
|
|
1339
|
-
},
|
|
1340
|
-
[getElementPropsHistory]
|
|
1341
|
-
);
|
|
1342
|
-
const setPropValue = (0, import_react10.useCallback)(
|
|
1343
|
-
(propKey, propValue) => {
|
|
1344
|
-
const elementPropValues = getElementPropsHistory();
|
|
1345
|
-
const updatedElementPropValues = { ...elementPropValues, [propKey]: propValue };
|
|
1346
|
-
(0, import_utils2.setSessionStorageItem)(elementKey, updatedElementPropValues);
|
|
1347
|
-
},
|
|
1348
|
-
[getElementPropsHistory, elementKey]
|
|
1349
|
-
);
|
|
1350
|
-
const removeProp = (0, import_react10.useCallback)(
|
|
1351
|
-
(propKey) => {
|
|
1352
|
-
const elementPropValues = getElementPropsHistory();
|
|
1353
|
-
const updatedElementPropValues = Object.fromEntries(
|
|
1354
|
-
Object.entries(elementPropValues || {}).filter(([key]) => key !== propKey)
|
|
1355
|
-
);
|
|
1356
|
-
(0, import_utils2.setSessionStorageItem)(elementKey, updatedElementPropValues);
|
|
1357
|
-
},
|
|
1358
|
-
[getElementPropsHistory, elementKey]
|
|
1359
|
-
);
|
|
1360
|
-
return (0, import_react10.useMemo)(() => ({ getPropValue, setPropValue, removeProp }), [getPropValue, removeProp, setPropValue]);
|
|
1361
|
-
};
|
|
1362
|
-
|
|
1363
|
-
// src/hooks/use-style-prop-history.ts
|
|
1364
|
-
var useStylePropsHistory = (props) => {
|
|
1365
|
-
const { element } = useElement();
|
|
1366
|
-
const { id: styleDefID, meta } = useStyle();
|
|
1367
|
-
const { getPropValue, setPropValue, removeProp } = usePropValueHistory();
|
|
1368
|
-
const styleDef = styleDefID ? (0, import_editor_elements4.getElementStyles)(element.id)?.[styleDefID] : null;
|
|
1369
|
-
const styleVariant = styleDef ? (0, import_editor_elements4.getVariantByMeta)(styleDef, meta) : null;
|
|
1370
|
-
const styleVariantPath = `${styleDefID}-${styleVariant?.meta.breakpoint}-${styleVariant?.meta.state}`;
|
|
1371
|
-
const saveStylePropsHistory = (0, import_react11.useCallback)(() => {
|
|
1372
|
-
props.forEach((propKey) => {
|
|
1373
|
-
const propValue = styleVariant?.props[propKey];
|
|
1374
|
-
if (propValue) {
|
|
1375
|
-
const propPath = `${styleVariantPath}-${propKey}`;
|
|
1376
|
-
setPropValue(propPath, propValue);
|
|
1377
|
-
}
|
|
1342
|
+
var useSessionStorage = (key) => {
|
|
1343
|
+
const prefixedKey = `elementor/${key}`;
|
|
1344
|
+
const [value, setValue] = (0, import_react9.useState)();
|
|
1345
|
+
(0, import_react9.useEffect)(() => {
|
|
1346
|
+
return subscribeToSessionStorage(prefixedKey, (newValue) => {
|
|
1347
|
+
setValue(newValue ?? null);
|
|
1378
1348
|
});
|
|
1379
|
-
}, [
|
|
1380
|
-
const
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1349
|
+
}, [prefixedKey]);
|
|
1350
|
+
const saveValue = (newValue) => {
|
|
1351
|
+
(0, import_utils2.setSessionStorageItem)(prefixedKey, newValue);
|
|
1352
|
+
};
|
|
1353
|
+
const removeValue = () => {
|
|
1354
|
+
(0, import_utils2.removeSessionStorageItem)(prefixedKey);
|
|
1355
|
+
};
|
|
1356
|
+
return [value, saveValue, removeValue];
|
|
1357
|
+
};
|
|
1358
|
+
var subscribeToSessionStorage = (key, subscriber) => {
|
|
1359
|
+
subscriber((0, import_utils2.getSessionStorageItem)(key));
|
|
1360
|
+
const abortController = new AbortController();
|
|
1361
|
+
window.addEventListener(
|
|
1362
|
+
"storage",
|
|
1363
|
+
(e) => {
|
|
1364
|
+
if (e.key !== key || e.storageArea !== sessionStorage) {
|
|
1365
|
+
return;
|
|
1387
1366
|
}
|
|
1388
|
-
|
|
1389
|
-
},
|
|
1390
|
-
|
|
1391
|
-
(0, import_editor_elements4.updateStyle)({
|
|
1392
|
-
elementID: element.id,
|
|
1393
|
-
styleDefID,
|
|
1394
|
-
meta,
|
|
1395
|
-
props: propValuesFromHistory,
|
|
1396
|
-
bind: "classes"
|
|
1397
|
-
});
|
|
1398
|
-
}
|
|
1399
|
-
}, [element.id, getPropValue, meta, props, removeProp, styleDefID, styleVariantPath]);
|
|
1400
|
-
const clearCurrentStyleProps = (0, import_react11.useCallback)(() => {
|
|
1401
|
-
const resetValues = props.reduce(
|
|
1402
|
-
(allProps, currentPropKey) => ({
|
|
1403
|
-
...allProps,
|
|
1404
|
-
[currentPropKey]: void 0
|
|
1405
|
-
}),
|
|
1406
|
-
{}
|
|
1407
|
-
);
|
|
1408
|
-
(0, import_editor_elements4.updateStyle)({
|
|
1409
|
-
elementID: element.id,
|
|
1410
|
-
styleDefID,
|
|
1411
|
-
meta,
|
|
1412
|
-
props: resetValues,
|
|
1413
|
-
bind: "classes"
|
|
1414
|
-
});
|
|
1415
|
-
}, [element.id, meta, props, styleDefID]);
|
|
1416
|
-
return (0, import_react11.useMemo)(
|
|
1417
|
-
() => ({ saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps }),
|
|
1418
|
-
[saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps]
|
|
1367
|
+
subscriber((0, import_utils2.getSessionStorageItem)(key));
|
|
1368
|
+
},
|
|
1369
|
+
{ signal: abortController.signal }
|
|
1419
1370
|
);
|
|
1371
|
+
return () => {
|
|
1372
|
+
abortController.abort();
|
|
1373
|
+
};
|
|
1420
1374
|
};
|
|
1421
1375
|
|
|
1422
1376
|
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
1423
|
-
var
|
|
1424
|
-
var
|
|
1377
|
+
var React36 = __toESM(require("react"));
|
|
1378
|
+
var import_editor_controls23 = require("@elementor/editor-controls");
|
|
1425
1379
|
var import_icons13 = require("@elementor/icons");
|
|
1426
|
-
var
|
|
1427
|
-
var
|
|
1380
|
+
var import_ui28 = require("@elementor/ui");
|
|
1381
|
+
var import_i18n18 = require("@wordpress/i18n");
|
|
1428
1382
|
var sideIcons = {
|
|
1429
|
-
left: /* @__PURE__ */
|
|
1430
|
-
right: /* @__PURE__ */
|
|
1431
|
-
top: /* @__PURE__ */
|
|
1432
|
-
bottom: /* @__PURE__ */
|
|
1383
|
+
left: /* @__PURE__ */ React36.createElement(import_icons13.SideLeftIcon, { fontSize: "tiny" }),
|
|
1384
|
+
right: /* @__PURE__ */ React36.createElement(import_icons13.SideRightIcon, { fontSize: "tiny" }),
|
|
1385
|
+
top: /* @__PURE__ */ React36.createElement(import_icons13.SideTopIcon, { fontSize: "tiny" }),
|
|
1386
|
+
bottom: /* @__PURE__ */ React36.createElement(import_icons13.SideBottomIcon, { fontSize: "tiny" })
|
|
1433
1387
|
};
|
|
1434
1388
|
var DimensionsField = () => {
|
|
1435
|
-
return /* @__PURE__ */
|
|
1389
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(import_ui28.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(DimensionField, { side: "top", label: (0, import_i18n18.__)("Top", "elementor") }), /* @__PURE__ */ React36.createElement(DimensionField, { side: "right", label: (0, import_i18n18.__)("Right", "elementor") })), /* @__PURE__ */ React36.createElement(import_ui28.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(DimensionField, { side: "bottom", label: (0, import_i18n18.__)("Bottom", "elementor") }), /* @__PURE__ */ React36.createElement(DimensionField, { side: "left", label: (0, import_i18n18.__)("Left", "elementor") })));
|
|
1436
1390
|
};
|
|
1437
1391
|
var DimensionField = ({ side, label }) => {
|
|
1438
|
-
return /* @__PURE__ */
|
|
1392
|
+
return /* @__PURE__ */ React36.createElement(import_ui28.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React36.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(import_editor_controls23.ControlLabel, null, label)), /* @__PURE__ */ React36.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(StylesField, { bind: side }, /* @__PURE__ */ React36.createElement(import_editor_controls23.SizeControl, { startIcon: sideIcons[side] }))));
|
|
1439
1393
|
};
|
|
1440
1394
|
|
|
1441
1395
|
// src/components/style-sections/position-section/position-field.tsx
|
|
1442
|
-
var
|
|
1443
|
-
var
|
|
1444
|
-
var
|
|
1445
|
-
var
|
|
1396
|
+
var React37 = __toESM(require("react"));
|
|
1397
|
+
var import_editor_controls24 = require("@elementor/editor-controls");
|
|
1398
|
+
var import_ui29 = require("@elementor/ui");
|
|
1399
|
+
var import_i18n19 = require("@wordpress/i18n");
|
|
1446
1400
|
var positionOptions = [
|
|
1447
|
-
{ label: (0,
|
|
1448
|
-
{ label: (0,
|
|
1449
|
-
{ label: (0,
|
|
1450
|
-
{ label: (0,
|
|
1401
|
+
{ label: (0, import_i18n19.__)("Static", "elementor"), value: "static" },
|
|
1402
|
+
{ label: (0, import_i18n19.__)("Relative", "elementor"), value: "relative" },
|
|
1403
|
+
{ label: (0, import_i18n19.__)("Absolute", "elementor"), value: "absolute" },
|
|
1404
|
+
{ label: (0, import_i18n19.__)("Fixed", "elementor"), value: "fixed" }
|
|
1451
1405
|
];
|
|
1452
|
-
var PositionField = () => {
|
|
1453
|
-
return /* @__PURE__ */
|
|
1406
|
+
var PositionField = ({ onChange }) => {
|
|
1407
|
+
return /* @__PURE__ */ React37.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React37.createElement(import_ui29.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(import_editor_controls24.ControlLabel, null, (0, import_i18n19.__)("Position", "elementor"))), /* @__PURE__ */ React37.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(import_editor_controls24.SelectControl, { options: positionOptions, onChange }))));
|
|
1454
1408
|
};
|
|
1455
1409
|
|
|
1456
1410
|
// src/components/style-sections/position-section/z-index-field.tsx
|
|
1457
|
-
var
|
|
1458
|
-
var
|
|
1459
|
-
var
|
|
1460
|
-
var
|
|
1411
|
+
var React38 = __toESM(require("react"));
|
|
1412
|
+
var import_editor_controls25 = require("@elementor/editor-controls");
|
|
1413
|
+
var import_ui30 = require("@elementor/ui");
|
|
1414
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
1461
1415
|
var ZIndexField = () => {
|
|
1462
|
-
return /* @__PURE__ */
|
|
1416
|
+
return /* @__PURE__ */ React38.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React38.createElement(import_ui30.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React38.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(import_editor_controls25.ControlLabel, null, (0, import_i18n20.__)("Z-Index", "elementor"))), /* @__PURE__ */ React38.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(import_editor_controls25.NumberControl, null))));
|
|
1463
1417
|
};
|
|
1464
1418
|
|
|
1465
1419
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1466
|
-
var dimensionsPropKeys = ["top", "bottom", "left", "right"];
|
|
1467
1420
|
var PositionSection = () => {
|
|
1468
1421
|
const [positionValue] = useStylesField("position");
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
const
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1422
|
+
const [dimensionsValues, setDimensionsValues] = useStylesFields([
|
|
1423
|
+
"top",
|
|
1424
|
+
"bottom",
|
|
1425
|
+
"left",
|
|
1426
|
+
"right"
|
|
1427
|
+
]);
|
|
1428
|
+
const [dimensionsValuesFromHistory, updateDimensionsHistory, clearDimensionsHistory] = usePersistDimensions();
|
|
1429
|
+
const onPositionChange = (newPosition, previousPosition) => {
|
|
1430
|
+
if (newPosition === "static") {
|
|
1431
|
+
if (dimensionsValues) {
|
|
1432
|
+
updateDimensionsHistory(dimensionsValues);
|
|
1433
|
+
setDimensionsValues({
|
|
1434
|
+
top: void 0,
|
|
1435
|
+
bottom: void 0,
|
|
1436
|
+
left: void 0,
|
|
1437
|
+
right: void 0
|
|
1438
|
+
});
|
|
1479
1439
|
}
|
|
1480
|
-
|
|
1481
|
-
if (
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
} else if (previousPosition === "static") {
|
|
1485
|
-
updateStylePropsFromHistory();
|
|
1440
|
+
} else if (previousPosition === "static") {
|
|
1441
|
+
if (dimensionsValuesFromHistory) {
|
|
1442
|
+
setDimensionsValues(dimensionsValuesFromHistory);
|
|
1443
|
+
clearDimensionsHistory();
|
|
1486
1444
|
}
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
);
|
|
1491
|
-
|
|
1492
|
-
|
|
1445
|
+
}
|
|
1446
|
+
};
|
|
1447
|
+
const isNotStatic = positionValue && positionValue?.value !== "static";
|
|
1448
|
+
return /* @__PURE__ */ React39.createElement(import_ui31.Stack, { 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);
|
|
1449
|
+
};
|
|
1450
|
+
var usePersistDimensions = () => {
|
|
1451
|
+
const { id: styleDefID, meta } = useStyle();
|
|
1452
|
+
const styleVariantPath = `styles/${styleDefID}/${meta.breakpoint || "desktop"}/${meta.state || "null"}`;
|
|
1453
|
+
const dimensionsPath = `${styleVariantPath}/dimensions`;
|
|
1454
|
+
return useSessionStorage(dimensionsPath);
|
|
1493
1455
|
};
|
|
1494
1456
|
|
|
1495
1457
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1496
|
-
var React42 = __toESM(require("react"));
|
|
1497
|
-
var import_editor_controls28 = require("@elementor/editor-controls");
|
|
1498
|
-
var import_ui35 = require("@elementor/ui");
|
|
1499
|
-
var import_i18n23 = require("@wordpress/i18n");
|
|
1500
|
-
|
|
1501
|
-
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1502
1458
|
var React41 = __toESM(require("react"));
|
|
1503
1459
|
var import_editor_controls27 = require("@elementor/editor-controls");
|
|
1504
|
-
var
|
|
1505
|
-
var import_ui34 = require("@elementor/ui");
|
|
1460
|
+
var import_ui33 = require("@elementor/ui");
|
|
1506
1461
|
var import_i18n22 = require("@wordpress/i18n");
|
|
1462
|
+
|
|
1463
|
+
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1464
|
+
var React40 = __toESM(require("react"));
|
|
1465
|
+
var import_editor_controls26 = require("@elementor/editor-controls");
|
|
1466
|
+
var import_icons14 = require("@elementor/icons");
|
|
1467
|
+
var import_ui32 = require("@elementor/ui");
|
|
1468
|
+
var import_i18n21 = require("@wordpress/i18n");
|
|
1507
1469
|
var options6 = [
|
|
1508
1470
|
{
|
|
1509
1471
|
value: "visible",
|
|
1510
|
-
label: (0,
|
|
1511
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1472
|
+
label: (0, import_i18n21.__)("Visible", "elementor"),
|
|
1473
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(import_icons14.EyeIcon, { fontSize: size }),
|
|
1512
1474
|
showTooltip: true
|
|
1513
1475
|
},
|
|
1514
1476
|
{
|
|
1515
1477
|
value: "hidden",
|
|
1516
|
-
label: (0,
|
|
1517
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1478
|
+
label: (0, import_i18n21.__)("Hidden", "elementor"),
|
|
1479
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(import_icons14.EyeOffIcon, { fontSize: size }),
|
|
1518
1480
|
showTooltip: true
|
|
1519
1481
|
},
|
|
1520
1482
|
{
|
|
1521
1483
|
value: "auto",
|
|
1522
|
-
label: (0,
|
|
1523
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1484
|
+
label: (0, import_i18n21.__)("Auto", "elementor"),
|
|
1485
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(import_icons14.ExpandBottomIcon, { fontSize: size }),
|
|
1524
1486
|
showTooltip: true
|
|
1525
1487
|
}
|
|
1526
1488
|
];
|
|
1527
1489
|
var OverflowField = () => {
|
|
1528
|
-
return /* @__PURE__ */
|
|
1490
|
+
return /* @__PURE__ */ React40.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React40.createElement(import_ui32.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(import_editor_controls26.ControlLabel, null, (0, import_i18n21.__)("Overflow", "elementor"))), /* @__PURE__ */ React40.createElement(import_ui32.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React40.createElement(import_editor_controls26.ToggleControl, { options: options6 }))));
|
|
1529
1491
|
};
|
|
1530
1492
|
|
|
1531
1493
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1532
1494
|
var SizeSection = () => {
|
|
1533
|
-
return /* @__PURE__ */
|
|
1495
|
+
return /* @__PURE__ */ React41.createElement(import_ui33.Stack, { gap: 1.5 }, /* @__PURE__ */ React41.createElement(import_ui33.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(SizeField, { bind: "width", label: (0, import_i18n22.__)("Width", "elementor") })), /* @__PURE__ */ React41.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(SizeField, { bind: "height", label: (0, import_i18n22.__)("Height", "elementor") }))), /* @__PURE__ */ React41.createElement(import_ui33.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(SizeField, { bind: "min-width", label: (0, import_i18n22.__)("Min. Width", "elementor") })), /* @__PURE__ */ React41.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(SizeField, { bind: "min-height", label: (0, import_i18n22.__)("Min. Height", "elementor") }))), /* @__PURE__ */ React41.createElement(import_ui33.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(SizeField, { bind: "max-width", label: (0, import_i18n22.__)("Max. Width", "elementor") })), /* @__PURE__ */ React41.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(SizeField, { bind: "max-height", label: (0, import_i18n22.__)("Max. Height", "elementor") }))), /* @__PURE__ */ React41.createElement(import_ui33.Divider, null), /* @__PURE__ */ React41.createElement(import_ui33.Stack, null, /* @__PURE__ */ React41.createElement(OverflowField, null)));
|
|
1534
1496
|
};
|
|
1535
1497
|
var SizeField = ({ label, bind }) => {
|
|
1536
|
-
return /* @__PURE__ */
|
|
1498
|
+
return /* @__PURE__ */ React41.createElement(StylesField, { bind }, /* @__PURE__ */ React41.createElement(import_ui33.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React41.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React41.createElement(import_editor_controls27.ControlLabel, null, label)), /* @__PURE__ */ React41.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React41.createElement(import_editor_controls27.SizeControl, null))));
|
|
1537
1499
|
};
|
|
1538
1500
|
|
|
1539
1501
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1540
|
-
var
|
|
1541
|
-
var
|
|
1542
|
-
var
|
|
1543
|
-
var
|
|
1502
|
+
var React42 = __toESM(require("react"));
|
|
1503
|
+
var import_editor_controls28 = require("@elementor/editor-controls");
|
|
1504
|
+
var import_ui34 = require("@elementor/ui");
|
|
1505
|
+
var import_i18n23 = require("@wordpress/i18n");
|
|
1544
1506
|
var SpacingSection = () => {
|
|
1545
|
-
return /* @__PURE__ */
|
|
1507
|
+
return /* @__PURE__ */ React42.createElement(import_ui34.Stack, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React42.createElement(import_editor_controls28.LinkedDimensionsControl, { label: (0, import_i18n23.__)("Padding", "elementor") })), /* @__PURE__ */ React42.createElement(import_ui34.Divider, null), /* @__PURE__ */ React42.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React42.createElement(import_editor_controls28.LinkedDimensionsControl, { label: (0, import_i18n23.__)("Margin", "elementor") })));
|
|
1546
1508
|
};
|
|
1547
1509
|
|
|
1548
1510
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1549
|
-
var
|
|
1550
|
-
var
|
|
1511
|
+
var React56 = __toESM(require("react"));
|
|
1512
|
+
var import_ui47 = require("@elementor/ui");
|
|
1551
1513
|
|
|
1552
1514
|
// src/components/collapsible-content.tsx
|
|
1553
|
-
var
|
|
1554
|
-
var
|
|
1555
|
-
var
|
|
1556
|
-
var
|
|
1515
|
+
var React43 = __toESM(require("react"));
|
|
1516
|
+
var import_react10 = require("react");
|
|
1517
|
+
var import_ui35 = require("@elementor/ui");
|
|
1518
|
+
var import_i18n24 = require("@wordpress/i18n");
|
|
1557
1519
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
1558
|
-
const [open, setOpen] = (0,
|
|
1520
|
+
const [open, setOpen] = (0, import_react10.useState)(defaultOpen);
|
|
1559
1521
|
const handleToggle = () => {
|
|
1560
1522
|
setOpen((prevOpen) => !prevOpen);
|
|
1561
1523
|
};
|
|
1562
|
-
return /* @__PURE__ */
|
|
1563
|
-
|
|
1524
|
+
return /* @__PURE__ */ React43.createElement(import_ui35.Stack, { sx: { py: 0.5 } }, /* @__PURE__ */ React43.createElement(
|
|
1525
|
+
import_ui35.Button,
|
|
1564
1526
|
{
|
|
1565
1527
|
fullWidth: true,
|
|
1566
1528
|
size: "small",
|
|
1567
1529
|
color: "secondary",
|
|
1568
1530
|
variant: "outlined",
|
|
1569
1531
|
onClick: handleToggle,
|
|
1570
|
-
endIcon: /* @__PURE__ */
|
|
1532
|
+
endIcon: /* @__PURE__ */ React43.createElement(CollapseIcon, { open })
|
|
1571
1533
|
},
|
|
1572
|
-
open ? (0,
|
|
1573
|
-
), /* @__PURE__ */
|
|
1534
|
+
open ? (0, import_i18n24.__)("Show less", "elementor") : (0, import_i18n24.__)("Show more", "elementor")
|
|
1535
|
+
), /* @__PURE__ */ React43.createElement(import_ui35.Collapse, { in: open, timeout: "auto", unmountOnExit: true }, children));
|
|
1574
1536
|
};
|
|
1575
1537
|
|
|
1576
1538
|
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1577
|
-
var
|
|
1578
|
-
var
|
|
1579
|
-
var
|
|
1580
|
-
var
|
|
1539
|
+
var React44 = __toESM(require("react"));
|
|
1540
|
+
var import_editor_controls29 = require("@elementor/editor-controls");
|
|
1541
|
+
var import_ui36 = require("@elementor/ui");
|
|
1542
|
+
var import_i18n25 = require("@wordpress/i18n");
|
|
1581
1543
|
|
|
1582
1544
|
// src/sync/get-elementor-config.ts
|
|
1583
1545
|
var getElementorConfig = () => {
|
|
@@ -1591,7 +1553,7 @@ var FontFamilyField = () => {
|
|
|
1591
1553
|
if (!fontFamilies) {
|
|
1592
1554
|
return null;
|
|
1593
1555
|
}
|
|
1594
|
-
return /* @__PURE__ */
|
|
1556
|
+
return /* @__PURE__ */ React44.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React44.createElement(import_ui36.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React44.createElement(import_ui36.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(import_editor_controls29.ControlLabel, null, (0, import_i18n25.__)("Font Family", "elementor"))), /* @__PURE__ */ React44.createElement(import_ui36.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(import_editor_controls29.FontFamilyControl, { fontFamilies }))));
|
|
1595
1557
|
};
|
|
1596
1558
|
var getFontFamilies = () => {
|
|
1597
1559
|
const { controls } = getElementorConfig();
|
|
@@ -1603,115 +1565,115 @@ var getFontFamilies = () => {
|
|
|
1603
1565
|
};
|
|
1604
1566
|
|
|
1605
1567
|
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1606
|
-
var
|
|
1607
|
-
var
|
|
1608
|
-
var
|
|
1609
|
-
var
|
|
1568
|
+
var React45 = __toESM(require("react"));
|
|
1569
|
+
var import_editor_controls30 = require("@elementor/editor-controls");
|
|
1570
|
+
var import_ui37 = require("@elementor/ui");
|
|
1571
|
+
var import_i18n26 = require("@wordpress/i18n");
|
|
1610
1572
|
var FontSizeField = () => {
|
|
1611
|
-
return /* @__PURE__ */
|
|
1573
|
+
return /* @__PURE__ */ React45.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React45.createElement(import_ui37.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(import_editor_controls30.ControlLabel, null, (0, import_i18n26.__)("Font Size", "elementor"))), /* @__PURE__ */ React45.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(import_editor_controls30.SizeControl, null))));
|
|
1612
1574
|
};
|
|
1613
1575
|
|
|
1614
1576
|
// src/components/style-sections/typography-section/font-weight-field.tsx
|
|
1615
|
-
var
|
|
1616
|
-
var
|
|
1617
|
-
var
|
|
1618
|
-
var
|
|
1577
|
+
var React46 = __toESM(require("react"));
|
|
1578
|
+
var import_editor_controls31 = require("@elementor/editor-controls");
|
|
1579
|
+
var import_ui38 = require("@elementor/ui");
|
|
1580
|
+
var import_i18n27 = require("@wordpress/i18n");
|
|
1619
1581
|
var fontWeightOptions = [
|
|
1620
|
-
{ label: (0,
|
|
1621
|
-
{ label: (0,
|
|
1622
|
-
{ label: (0,
|
|
1623
|
-
{ label: (0,
|
|
1624
|
-
{ label: (0,
|
|
1582
|
+
{ label: (0, import_i18n27.__)("Light - 400", "elementor"), value: "400" },
|
|
1583
|
+
{ label: (0, import_i18n27.__)("Regular - 500", "elementor"), value: "500" },
|
|
1584
|
+
{ label: (0, import_i18n27.__)("Semi Bold - 600", "elementor"), value: "600" },
|
|
1585
|
+
{ label: (0, import_i18n27.__)("Bold - 700", "elementor"), value: "700" },
|
|
1586
|
+
{ label: (0, import_i18n27.__)("Black - 900", "elementor"), value: "900" }
|
|
1625
1587
|
];
|
|
1626
1588
|
var FontWeightField = () => {
|
|
1627
|
-
return /* @__PURE__ */
|
|
1589
|
+
return /* @__PURE__ */ React46.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React46.createElement(import_ui38.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(import_ui38.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(import_editor_controls31.ControlLabel, null, (0, import_i18n27.__)("Font Weight", "elementor"))), /* @__PURE__ */ React46.createElement(import_ui38.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(import_editor_controls31.SelectControl, { options: fontWeightOptions }))));
|
|
1628
1590
|
};
|
|
1629
1591
|
|
|
1630
1592
|
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
1631
|
-
var
|
|
1632
|
-
var
|
|
1633
|
-
var
|
|
1634
|
-
var
|
|
1593
|
+
var React47 = __toESM(require("react"));
|
|
1594
|
+
var import_editor_controls32 = require("@elementor/editor-controls");
|
|
1595
|
+
var import_ui39 = require("@elementor/ui");
|
|
1596
|
+
var import_i18n28 = require("@wordpress/i18n");
|
|
1635
1597
|
var LetterSpacingField = () => {
|
|
1636
|
-
return /* @__PURE__ */
|
|
1598
|
+
return /* @__PURE__ */ React47.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React47.createElement(import_ui39.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React47.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(import_editor_controls32.ControlLabel, null, (0, import_i18n28.__)("Letter Spacing", "elementor"))), /* @__PURE__ */ React47.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(import_editor_controls32.SizeControl, null))));
|
|
1637
1599
|
};
|
|
1638
1600
|
|
|
1639
1601
|
// src/components/style-sections/typography-section/line-height-field.tsx
|
|
1640
|
-
var
|
|
1641
|
-
var
|
|
1642
|
-
var
|
|
1643
|
-
var
|
|
1602
|
+
var React48 = __toESM(require("react"));
|
|
1603
|
+
var import_editor_controls33 = require("@elementor/editor-controls");
|
|
1604
|
+
var import_ui40 = require("@elementor/ui");
|
|
1605
|
+
var import_i18n29 = require("@wordpress/i18n");
|
|
1644
1606
|
var LineHeightField = () => {
|
|
1645
|
-
return /* @__PURE__ */
|
|
1607
|
+
return /* @__PURE__ */ React48.createElement(StylesField, { bind: "line-height" }, /* @__PURE__ */ React48.createElement(import_ui40.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React48.createElement(import_ui40.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(import_editor_controls33.ControlLabel, null, (0, import_i18n29.__)("Line Height", "elementor"))), /* @__PURE__ */ React48.createElement(import_ui40.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(import_editor_controls33.SizeControl, null))));
|
|
1646
1608
|
};
|
|
1647
1609
|
|
|
1648
1610
|
// src/components/style-sections/typography-section/text-alignment-field.tsx
|
|
1649
|
-
var
|
|
1650
|
-
var
|
|
1611
|
+
var React49 = __toESM(require("react"));
|
|
1612
|
+
var import_editor_controls34 = require("@elementor/editor-controls");
|
|
1651
1613
|
var import_icons15 = require("@elementor/icons");
|
|
1652
|
-
var
|
|
1653
|
-
var
|
|
1614
|
+
var import_ui41 = require("@elementor/ui");
|
|
1615
|
+
var import_i18n30 = require("@wordpress/i18n");
|
|
1654
1616
|
var options7 = [
|
|
1655
1617
|
{
|
|
1656
1618
|
value: "left",
|
|
1657
|
-
label: (0,
|
|
1658
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1619
|
+
label: (0, import_i18n30.__)("Left", "elementor"),
|
|
1620
|
+
renderContent: ({ size }) => /* @__PURE__ */ React49.createElement(import_icons15.AlignLeftIcon, { fontSize: size })
|
|
1659
1621
|
},
|
|
1660
1622
|
{
|
|
1661
1623
|
value: "center",
|
|
1662
|
-
label: (0,
|
|
1663
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1624
|
+
label: (0, import_i18n30.__)("Center", "elementor"),
|
|
1625
|
+
renderContent: ({ size }) => /* @__PURE__ */ React49.createElement(import_icons15.AlignCenterIcon, { fontSize: size })
|
|
1664
1626
|
},
|
|
1665
1627
|
{
|
|
1666
1628
|
value: "right",
|
|
1667
|
-
label: (0,
|
|
1668
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1629
|
+
label: (0, import_i18n30.__)("Right", "elementor"),
|
|
1630
|
+
renderContent: ({ size }) => /* @__PURE__ */ React49.createElement(import_icons15.AlignRightIcon, { fontSize: size })
|
|
1669
1631
|
},
|
|
1670
1632
|
{
|
|
1671
1633
|
value: "justify",
|
|
1672
|
-
label: (0,
|
|
1673
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1634
|
+
label: (0, import_i18n30.__)("Justify", "elementor"),
|
|
1635
|
+
renderContent: ({ size }) => /* @__PURE__ */ React49.createElement(import_icons15.AlignJustifiedIcon, { fontSize: size })
|
|
1674
1636
|
}
|
|
1675
1637
|
];
|
|
1676
1638
|
var TextAlignmentField = () => {
|
|
1677
|
-
return /* @__PURE__ */
|
|
1639
|
+
return /* @__PURE__ */ React49.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React49.createElement(import_ui41.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React49.createElement(import_ui41.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(import_editor_controls34.ControlLabel, null, (0, import_i18n30.__)("Alignment", "elementor"))), /* @__PURE__ */ React49.createElement(import_ui41.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React49.createElement(import_editor_controls34.ToggleControl, { options: options7 }))));
|
|
1678
1640
|
};
|
|
1679
1641
|
|
|
1680
1642
|
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
1681
|
-
var
|
|
1682
|
-
var
|
|
1683
|
-
var
|
|
1684
|
-
var
|
|
1643
|
+
var React50 = __toESM(require("react"));
|
|
1644
|
+
var import_editor_controls35 = require("@elementor/editor-controls");
|
|
1645
|
+
var import_ui42 = require("@elementor/ui");
|
|
1646
|
+
var import_i18n31 = require("@wordpress/i18n");
|
|
1685
1647
|
var TextColorField = () => {
|
|
1686
|
-
return /* @__PURE__ */
|
|
1648
|
+
return /* @__PURE__ */ React50.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React50.createElement(import_ui42.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React50.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(import_editor_controls35.ControlLabel, null, (0, import_i18n31.__)("Text Color", "elementor"))), /* @__PURE__ */ React50.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(import_editor_controls35.ColorControl, null))));
|
|
1687
1649
|
};
|
|
1688
1650
|
|
|
1689
1651
|
// src/components/style-sections/typography-section/text-direction-field.tsx
|
|
1690
|
-
var
|
|
1691
|
-
var
|
|
1652
|
+
var React51 = __toESM(require("react"));
|
|
1653
|
+
var import_editor_controls36 = require("@elementor/editor-controls");
|
|
1692
1654
|
var import_icons16 = require("@elementor/icons");
|
|
1693
|
-
var
|
|
1694
|
-
var
|
|
1655
|
+
var import_ui43 = require("@elementor/ui");
|
|
1656
|
+
var import_i18n32 = require("@wordpress/i18n");
|
|
1695
1657
|
var options8 = [
|
|
1696
1658
|
{
|
|
1697
1659
|
value: "ltr",
|
|
1698
|
-
label: (0,
|
|
1699
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1660
|
+
label: (0, import_i18n32.__)("Left to Right", "elementor"),
|
|
1661
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(import_icons16.TextDirectionLtrIcon, { fontSize: size })
|
|
1700
1662
|
},
|
|
1701
1663
|
{
|
|
1702
1664
|
value: "rtl",
|
|
1703
|
-
label: (0,
|
|
1704
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1665
|
+
label: (0, import_i18n32.__)("Right to Left", "elementor"),
|
|
1666
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(import_icons16.TextDirectionRtlIcon, { fontSize: size })
|
|
1705
1667
|
}
|
|
1706
1668
|
];
|
|
1707
1669
|
var TextDirectionField = () => {
|
|
1708
|
-
return /* @__PURE__ */
|
|
1670
|
+
return /* @__PURE__ */ React51.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React51.createElement(import_ui43.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React51.createElement(import_ui43.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(import_editor_controls36.ControlLabel, null, (0, import_i18n32.__)("Direction", "elementor"))), /* @__PURE__ */ React51.createElement(import_ui43.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React51.createElement(import_editor_controls36.ToggleControl, { options: options8 }))));
|
|
1709
1671
|
};
|
|
1710
1672
|
|
|
1711
1673
|
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1712
|
-
var
|
|
1713
|
-
var
|
|
1714
|
-
var
|
|
1674
|
+
var React52 = __toESM(require("react"));
|
|
1675
|
+
var import_editor_controls37 = require("@elementor/editor-controls");
|
|
1676
|
+
var import_i18n33 = require("@wordpress/i18n");
|
|
1715
1677
|
var initTextStroke = {
|
|
1716
1678
|
$$type: "stroke",
|
|
1717
1679
|
value: {
|
|
@@ -1737,24 +1699,24 @@ var TextStrokeField = () => {
|
|
|
1737
1699
|
setTextStroke(null);
|
|
1738
1700
|
};
|
|
1739
1701
|
const hasTextStroke = Boolean(textStroke);
|
|
1740
|
-
return /* @__PURE__ */
|
|
1702
|
+
return /* @__PURE__ */ React52.createElement(
|
|
1741
1703
|
AddOrRemoveContent,
|
|
1742
1704
|
{
|
|
1743
|
-
label: (0,
|
|
1705
|
+
label: (0, import_i18n33.__)("Text Stroke", "elementor"),
|
|
1744
1706
|
isAdded: hasTextStroke,
|
|
1745
1707
|
onAdd: addTextStroke,
|
|
1746
1708
|
onRemove: removeTextStroke
|
|
1747
1709
|
},
|
|
1748
|
-
/* @__PURE__ */
|
|
1710
|
+
/* @__PURE__ */ React52.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React52.createElement(import_editor_controls37.StrokeControl, null))
|
|
1749
1711
|
);
|
|
1750
1712
|
};
|
|
1751
1713
|
|
|
1752
1714
|
// src/components/style-sections/typography-section/text-style-field.tsx
|
|
1753
|
-
var
|
|
1754
|
-
var
|
|
1715
|
+
var React53 = __toESM(require("react"));
|
|
1716
|
+
var import_editor_controls38 = require("@elementor/editor-controls");
|
|
1755
1717
|
var import_icons17 = require("@elementor/icons");
|
|
1756
|
-
var
|
|
1757
|
-
var
|
|
1718
|
+
var import_ui44 = require("@elementor/ui");
|
|
1719
|
+
var import_i18n34 = require("@wordpress/i18n");
|
|
1758
1720
|
var buttonSize = "tiny";
|
|
1759
1721
|
var TextStyleField = () => {
|
|
1760
1722
|
const [fontStyle, setFontStyle] = useStylesField("font-style");
|
|
@@ -1778,7 +1740,7 @@ var TextStyleField = () => {
|
|
|
1778
1740
|
value: newValue
|
|
1779
1741
|
});
|
|
1780
1742
|
};
|
|
1781
|
-
return /* @__PURE__ */
|
|
1743
|
+
return /* @__PURE__ */ React53.createElement(import_ui44.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React53.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React53.createElement(import_editor_controls38.ControlLabel, null, (0, import_i18n34.__)("Style", "elementor"))), /* @__PURE__ */ React53.createElement(import_ui44.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React53.createElement(import_ui44.ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React53.createElement(
|
|
1782
1744
|
ToggleButton,
|
|
1783
1745
|
{
|
|
1784
1746
|
value: "italic",
|
|
@@ -1786,8 +1748,8 @@ var TextStyleField = () => {
|
|
|
1786
1748
|
"aria-label": "italic",
|
|
1787
1749
|
sx: { marginLeft: "auto" }
|
|
1788
1750
|
},
|
|
1789
|
-
/* @__PURE__ */
|
|
1790
|
-
), /* @__PURE__ */
|
|
1751
|
+
/* @__PURE__ */ React53.createElement(import_icons17.ItalicIcon, { fontSize: buttonSize })
|
|
1752
|
+
), /* @__PURE__ */ React53.createElement(
|
|
1791
1753
|
ShorthandControl,
|
|
1792
1754
|
{
|
|
1793
1755
|
value: "line-through",
|
|
@@ -1795,8 +1757,8 @@ var TextStyleField = () => {
|
|
|
1795
1757
|
updateValues: handleSetTextDecoration,
|
|
1796
1758
|
"aria-label": "line-through"
|
|
1797
1759
|
},
|
|
1798
|
-
/* @__PURE__ */
|
|
1799
|
-
), /* @__PURE__ */
|
|
1760
|
+
/* @__PURE__ */ React53.createElement(import_icons17.StrikethroughIcon, { fontSize: buttonSize })
|
|
1761
|
+
), /* @__PURE__ */ React53.createElement(
|
|
1800
1762
|
ShorthandControl,
|
|
1801
1763
|
{
|
|
1802
1764
|
value: "underline",
|
|
@@ -1804,7 +1766,7 @@ var TextStyleField = () => {
|
|
|
1804
1766
|
updateValues: handleSetTextDecoration,
|
|
1805
1767
|
"aria-label": "underline"
|
|
1806
1768
|
},
|
|
1807
|
-
/* @__PURE__ */
|
|
1769
|
+
/* @__PURE__ */ React53.createElement(import_icons17.UnderlineIcon, { fontSize: buttonSize })
|
|
1808
1770
|
))));
|
|
1809
1771
|
};
|
|
1810
1772
|
var ShorthandControl = ({
|
|
@@ -1823,52 +1785,52 @@ var ShorthandControl = ({
|
|
|
1823
1785
|
updateValues([...valuesArr, newValue].join(" "));
|
|
1824
1786
|
}
|
|
1825
1787
|
};
|
|
1826
|
-
return /* @__PURE__ */
|
|
1788
|
+
return /* @__PURE__ */ React53.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
1827
1789
|
};
|
|
1828
1790
|
var ToggleButton = ({ onChange, ...props }) => {
|
|
1829
1791
|
const handleChange = (_e, newValue) => {
|
|
1830
1792
|
onChange(newValue);
|
|
1831
1793
|
};
|
|
1832
|
-
return /* @__PURE__ */
|
|
1794
|
+
return /* @__PURE__ */ React53.createElement(import_ui44.ToggleButton, { ...props, onChange: handleChange, size: buttonSize });
|
|
1833
1795
|
};
|
|
1834
1796
|
|
|
1835
1797
|
// src/components/style-sections/typography-section/transform-field.tsx
|
|
1836
|
-
var
|
|
1837
|
-
var
|
|
1798
|
+
var React54 = __toESM(require("react"));
|
|
1799
|
+
var import_editor_controls39 = require("@elementor/editor-controls");
|
|
1838
1800
|
var import_icons18 = require("@elementor/icons");
|
|
1839
|
-
var
|
|
1840
|
-
var
|
|
1801
|
+
var import_ui45 = require("@elementor/ui");
|
|
1802
|
+
var import_i18n35 = require("@wordpress/i18n");
|
|
1841
1803
|
var options9 = [
|
|
1842
1804
|
{
|
|
1843
1805
|
value: "capitalize",
|
|
1844
|
-
label: (0,
|
|
1845
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1806
|
+
label: (0, import_i18n35.__)("Capitalize", "elementor"),
|
|
1807
|
+
renderContent: ({ size }) => /* @__PURE__ */ React54.createElement(import_icons18.LetterCaseIcon, { fontSize: size })
|
|
1846
1808
|
},
|
|
1847
1809
|
{
|
|
1848
1810
|
value: "uppercase",
|
|
1849
|
-
label: (0,
|
|
1850
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1811
|
+
label: (0, import_i18n35.__)("Uppercase", "elementor"),
|
|
1812
|
+
renderContent: ({ size }) => /* @__PURE__ */ React54.createElement(import_icons18.LetterCaseUpperIcon, { fontSize: size })
|
|
1851
1813
|
},
|
|
1852
1814
|
{
|
|
1853
1815
|
value: "lowercase",
|
|
1854
|
-
label: (0,
|
|
1855
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1816
|
+
label: (0, import_i18n35.__)("Lowercase", "elementor"),
|
|
1817
|
+
renderContent: ({ size }) => /* @__PURE__ */ React54.createElement(import_icons18.LetterCaseLowerIcon, { fontSize: size })
|
|
1856
1818
|
}
|
|
1857
1819
|
];
|
|
1858
|
-
var TransformField = () => /* @__PURE__ */
|
|
1820
|
+
var TransformField = () => /* @__PURE__ */ React54.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React54.createElement(import_ui45.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(import_ui45.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(import_editor_controls39.ControlLabel, null, (0, import_i18n35.__)("Transform", "elementor"))), /* @__PURE__ */ React54.createElement(import_ui45.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React54.createElement(import_editor_controls39.ToggleControl, { options: options9 }))));
|
|
1859
1821
|
|
|
1860
1822
|
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
1861
|
-
var
|
|
1862
|
-
var
|
|
1863
|
-
var
|
|
1864
|
-
var
|
|
1823
|
+
var React55 = __toESM(require("react"));
|
|
1824
|
+
var import_editor_controls40 = require("@elementor/editor-controls");
|
|
1825
|
+
var import_ui46 = require("@elementor/ui");
|
|
1826
|
+
var import_i18n36 = require("@wordpress/i18n");
|
|
1865
1827
|
var WordSpacingField = () => {
|
|
1866
|
-
return /* @__PURE__ */
|
|
1828
|
+
return /* @__PURE__ */ React55.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React55.createElement(import_ui46.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React55.createElement(import_ui46.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React55.createElement(import_editor_controls40.ControlLabel, null, (0, import_i18n36.__)("Word Spacing", "elementor"))), /* @__PURE__ */ React55.createElement(import_ui46.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React55.createElement(import_editor_controls40.SizeControl, null))));
|
|
1867
1829
|
};
|
|
1868
1830
|
|
|
1869
1831
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1870
1832
|
var TypographySection = () => {
|
|
1871
|
-
return /* @__PURE__ */
|
|
1833
|
+
return /* @__PURE__ */ React56.createElement(import_ui47.Stack, { gap: 1.5 }, /* @__PURE__ */ React56.createElement(FontFamilyField, null), /* @__PURE__ */ React56.createElement(FontWeightField, null), /* @__PURE__ */ React56.createElement(FontSizeField, null), /* @__PURE__ */ React56.createElement(import_ui47.Divider, null), /* @__PURE__ */ React56.createElement(TextAlignmentField, null), /* @__PURE__ */ React56.createElement(TextColorField, null), /* @__PURE__ */ React56.createElement(CollapsibleContent, null, /* @__PURE__ */ React56.createElement(import_ui47.Stack, { 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(import_ui47.Divider, null), /* @__PURE__ */ React56.createElement(TextStyleField, null), /* @__PURE__ */ React56.createElement(TransformField, null), /* @__PURE__ */ React56.createElement(TextDirectionField, null), /* @__PURE__ */ React56.createElement(TextStrokeField, null))));
|
|
1872
1834
|
};
|
|
1873
1835
|
|
|
1874
1836
|
// src/components/style-tab.tsx
|
|
@@ -1877,10 +1839,10 @@ var StyleTab = () => {
|
|
|
1877
1839
|
const currentClassesProp = useCurrentClassesProp();
|
|
1878
1840
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
1879
1841
|
const breakpoint = (0, import_editor_responsive.useActiveBreakpoint)();
|
|
1880
|
-
return /* @__PURE__ */
|
|
1842
|
+
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(import_ui48.Divider, null), /* @__PURE__ */ React57.createElement(SectionsList, null, /* @__PURE__ */ React57.createElement(Section, { title: (0, import_i18n37.__)("Layout", "elementor") }, /* @__PURE__ */ React57.createElement(LayoutSection, null)), /* @__PURE__ */ React57.createElement(Section, { title: (0, import_i18n37.__)("Spacing", "elementor") }, /* @__PURE__ */ React57.createElement(SpacingSection, null)), /* @__PURE__ */ React57.createElement(Section, { title: (0, import_i18n37.__)("Size", "elementor") }, /* @__PURE__ */ React57.createElement(SizeSection, null)), /* @__PURE__ */ React57.createElement(Section, { title: (0, import_i18n37.__)("Position", "elementor") }, /* @__PURE__ */ React57.createElement(PositionSection, null)), /* @__PURE__ */ React57.createElement(Section, { title: (0, import_i18n37.__)("Typography", "elementor") }, /* @__PURE__ */ React57.createElement(TypographySection, null)), /* @__PURE__ */ React57.createElement(Section, { title: (0, import_i18n37.__)("Background", "elementor") }, /* @__PURE__ */ React57.createElement(BackgroundSection, null)), /* @__PURE__ */ React57.createElement(Section, { title: (0, import_i18n37.__)("Border", "elementor") }, /* @__PURE__ */ React57.createElement(BorderSection, null)), /* @__PURE__ */ React57.createElement(Section, { title: (0, import_i18n37.__)("Effects", "elementor") }, /* @__PURE__ */ React57.createElement(EffectsSection, null)))));
|
|
1881
1843
|
};
|
|
1882
1844
|
function useActiveStyleDefId(currentClassesProp) {
|
|
1883
|
-
const [activeStyledDefId, setActiveStyledDefId] = (0,
|
|
1845
|
+
const [activeStyledDefId, setActiveStyledDefId] = (0, import_react11.useState)(null);
|
|
1884
1846
|
const fallback = useFirstElementStyleDef(currentClassesProp);
|
|
1885
1847
|
return [activeStyledDefId || fallback?.id || null, setActiveStyledDefId];
|
|
1886
1848
|
}
|
|
@@ -1904,11 +1866,11 @@ function useCurrentClassesProp() {
|
|
|
1904
1866
|
// src/components/editing-panel-tabs.tsx
|
|
1905
1867
|
var EditingPanelTabs = () => {
|
|
1906
1868
|
const { element } = useElement();
|
|
1907
|
-
const { getTabProps, getTabPanelProps, getTabsProps } = (0,
|
|
1869
|
+
const { getTabProps, getTabPanelProps, getTabsProps } = (0, import_ui49.useTabs)("settings");
|
|
1908
1870
|
return (
|
|
1909
1871
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
1910
1872
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
1911
|
-
/* @__PURE__ */
|
|
1873
|
+
/* @__PURE__ */ React58.createElement(import_react12.Fragment, { key: element.id }, /* @__PURE__ */ React58.createElement(import_ui49.Stack, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React58.createElement(import_ui49.Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React58.createElement(import_ui49.Tab, { label: (0, import_i18n38.__)("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React58.createElement(import_ui49.Tab, { label: (0, import_i18n38.__)("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React58.createElement(import_ui49.Divider, null), /* @__PURE__ */ React58.createElement(import_ui49.TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React58.createElement(SettingsTab, null)), /* @__PURE__ */ React58.createElement(import_ui49.TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React58.createElement(StyleTab, null))))
|
|
1912
1874
|
);
|
|
1913
1875
|
};
|
|
1914
1876
|
|
|
@@ -1921,8 +1883,8 @@ var EditingPanel = () => {
|
|
|
1921
1883
|
if (!element || !elementType) {
|
|
1922
1884
|
return null;
|
|
1923
1885
|
}
|
|
1924
|
-
const panelTitle = (0,
|
|
1925
|
-
return /* @__PURE__ */
|
|
1886
|
+
const panelTitle = (0, import_i18n39.__)("Edit %s", "elementor").replace("%s", elementType.title);
|
|
1887
|
+
return /* @__PURE__ */ React59.createElement(import_ui50.ErrorBoundary, { fallback: /* @__PURE__ */ React59.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React59.createElement(import_editor_panels.Panel, null, /* @__PURE__ */ React59.createElement(import_editor_panels.PanelHeader, null, /* @__PURE__ */ React59.createElement(import_editor_panels.PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React59.createElement(import_editor_panels.PanelBody, null, /* @__PURE__ */ React59.createElement(import_editor_controls41.ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React59.createElement(import_editor_controls41.ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React59.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React59.createElement(EditingPanelTabs, null)))))));
|
|
1926
1888
|
};
|
|
1927
1889
|
|
|
1928
1890
|
// src/panel.ts
|
|
@@ -1945,8 +1907,8 @@ var isAtomicWidgetSelected = () => {
|
|
|
1945
1907
|
// src/hooks/use-close-editor-panel.ts
|
|
1946
1908
|
var useCloseEditorPanel = () => {
|
|
1947
1909
|
const { close } = usePanelActions();
|
|
1948
|
-
return (0,
|
|
1949
|
-
return (0,
|
|
1910
|
+
return (0, import_react13.useEffect)(() => {
|
|
1911
|
+
return (0, import_editor_v1_adapters2.__privateListenTo)((0, import_editor_v1_adapters2.commandStartEvent)("document/elements/delete"), (e) => {
|
|
1950
1912
|
const selectedElement = (0, import_editor_elements8.getSelectedElements)()[0];
|
|
1951
1913
|
const { container: deletedContainer } = e?.args;
|
|
1952
1914
|
const isSelectedElementInDeletedContainer = deletedContainer && selectedElement && (0, import_editor_elements8.isElementInContainer)(selectedElement, deletedContainer);
|
|
@@ -1958,12 +1920,12 @@ var useCloseEditorPanel = () => {
|
|
|
1958
1920
|
};
|
|
1959
1921
|
|
|
1960
1922
|
// src/hooks/use-open-editor-panel.ts
|
|
1961
|
-
var
|
|
1962
|
-
var
|
|
1923
|
+
var import_react14 = require("react");
|
|
1924
|
+
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
1963
1925
|
var useOpenEditorPanel = () => {
|
|
1964
1926
|
const { open } = usePanelActions();
|
|
1965
|
-
(0,
|
|
1966
|
-
return (0,
|
|
1927
|
+
(0, import_react14.useEffect)(() => {
|
|
1928
|
+
return (0, import_editor_v1_adapters3.__privateListenTo)((0, import_editor_v1_adapters3.commandStartEvent)("panel/editor/open"), () => {
|
|
1967
1929
|
if (isAtomicWidgetSelected()) {
|
|
1968
1930
|
open();
|
|
1969
1931
|
}
|
|
@@ -1979,23 +1941,29 @@ var EditingPanelHooks = () => {
|
|
|
1979
1941
|
};
|
|
1980
1942
|
|
|
1981
1943
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1982
|
-
var
|
|
1983
|
-
var
|
|
1984
|
-
var
|
|
1944
|
+
var React62 = __toESM(require("react"));
|
|
1945
|
+
var import_react18 = require("react");
|
|
1946
|
+
var import_editor_controls44 = require("@elementor/editor-controls");
|
|
1985
1947
|
var import_icons20 = require("@elementor/icons");
|
|
1986
|
-
var
|
|
1987
|
-
var
|
|
1948
|
+
var import_ui52 = require("@elementor/ui");
|
|
1949
|
+
var import_i18n41 = require("@wordpress/i18n");
|
|
1950
|
+
|
|
1951
|
+
// src/hooks/use-persist-dynamic-value.ts
|
|
1952
|
+
var usePersistDynamicValue = (propKey) => {
|
|
1953
|
+
const { element } = useElement();
|
|
1954
|
+
const prefixedKey = `dynamic/non-dynamic-values-history/${element.id}/${propKey}`;
|
|
1955
|
+
return useSessionStorage(prefixedKey);
|
|
1956
|
+
};
|
|
1988
1957
|
|
|
1989
1958
|
// src/dynamics/dynamic-control.tsx
|
|
1990
|
-
var
|
|
1991
|
-
var
|
|
1992
|
-
var import_editor_props5 = require("@elementor/editor-props");
|
|
1959
|
+
var React60 = __toESM(require("react"));
|
|
1960
|
+
var import_editor_controls42 = require("@elementor/editor-controls");
|
|
1993
1961
|
|
|
1994
1962
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
1995
|
-
var
|
|
1963
|
+
var import_react16 = require("react");
|
|
1996
1964
|
|
|
1997
1965
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1998
|
-
var
|
|
1966
|
+
var import_react15 = require("react");
|
|
1999
1967
|
|
|
2000
1968
|
// src/dynamics/sync/get-elementor-config.ts
|
|
2001
1969
|
var getElementorConfig2 = () => {
|
|
@@ -2047,7 +2015,7 @@ var usePropDynamicTags = (propName) => {
|
|
|
2047
2015
|
const propDynamicType = getDynamicPropType(propType);
|
|
2048
2016
|
categories = propDynamicType?.settings.categories || [];
|
|
2049
2017
|
}
|
|
2050
|
-
return (0,
|
|
2018
|
+
return (0, import_react15.useMemo)(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
2051
2019
|
};
|
|
2052
2020
|
var getDynamicTagsByCategories = (categories) => {
|
|
2053
2021
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -2063,12 +2031,12 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
2063
2031
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2064
2032
|
var useDynamicTag = (propName, tagName) => {
|
|
2065
2033
|
const dynamicTags = usePropDynamicTags(propName);
|
|
2066
|
-
return (0,
|
|
2034
|
+
return (0, import_react16.useMemo)(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
2067
2035
|
};
|
|
2068
2036
|
|
|
2069
2037
|
// src/dynamics/dynamic-control.tsx
|
|
2070
2038
|
var DynamicControl = ({ bind, children }) => {
|
|
2071
|
-
const { value, setValue, bind: propName } = (0,
|
|
2039
|
+
const { value, setValue, bind: propName } = (0, import_editor_controls42.useBoundProp)(dynamicPropTypeUtil);
|
|
2072
2040
|
const { name = "", settings } = value ?? {};
|
|
2073
2041
|
const dynamicTag = useDynamicTag(propName, name);
|
|
2074
2042
|
if (!dynamicTag) {
|
|
@@ -2081,56 +2049,55 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
2081
2049
|
name,
|
|
2082
2050
|
settings: {
|
|
2083
2051
|
...settings,
|
|
2084
|
-
|
|
2085
|
-
[bind]: (0, import_editor_props5.isTransformable)(newValue) ? newValue.value : newValue
|
|
2052
|
+
[bind]: newValue
|
|
2086
2053
|
}
|
|
2087
2054
|
});
|
|
2088
2055
|
};
|
|
2089
|
-
return /* @__PURE__ */
|
|
2056
|
+
return /* @__PURE__ */ React60.createElement(import_editor_controls42.BoundPropProvider, { setValue: setDynamicValue, value: dynamicValue, bind }, children);
|
|
2090
2057
|
};
|
|
2091
2058
|
|
|
2092
2059
|
// src/dynamics/components/dynamic-selection.tsx
|
|
2093
|
-
var
|
|
2094
|
-
var
|
|
2095
|
-
var
|
|
2060
|
+
var React61 = __toESM(require("react"));
|
|
2061
|
+
var import_react17 = require("react");
|
|
2062
|
+
var import_editor_controls43 = require("@elementor/editor-controls");
|
|
2096
2063
|
var import_icons19 = require("@elementor/icons");
|
|
2097
|
-
var
|
|
2098
|
-
var
|
|
2064
|
+
var import_ui51 = require("@elementor/ui");
|
|
2065
|
+
var import_i18n40 = require("@wordpress/i18n");
|
|
2099
2066
|
var SIZE3 = "tiny";
|
|
2100
2067
|
var DynamicSelection = ({ onSelect }) => {
|
|
2101
|
-
const [searchValue, setSearchValue] = (0,
|
|
2068
|
+
const [searchValue, setSearchValue] = (0, import_react17.useState)("");
|
|
2102
2069
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
2103
|
-
const { value: anyValue } = (0,
|
|
2104
|
-
const { bind, value:
|
|
2105
|
-
const
|
|
2106
|
-
const isCurrentValueDynamic = !!
|
|
2070
|
+
const { value: anyValue } = (0, import_editor_controls43.useBoundProp)();
|
|
2071
|
+
const { bind, value: dynamicValue, setValue } = (0, import_editor_controls43.useBoundProp)(dynamicPropTypeUtil);
|
|
2072
|
+
const [, updatePropValueHistory] = usePersistDynamicValue(bind);
|
|
2073
|
+
const isCurrentValueDynamic = !!dynamicValue;
|
|
2107
2074
|
const options10 = useFilteredOptions(bind, searchValue);
|
|
2108
2075
|
const handleSearch = (event) => {
|
|
2109
2076
|
setSearchValue(event.target.value);
|
|
2110
2077
|
};
|
|
2111
2078
|
const handleSetDynamicTag = (value) => {
|
|
2112
2079
|
if (!isCurrentValueDynamic) {
|
|
2113
|
-
updatePropValueHistory(
|
|
2080
|
+
updatePropValueHistory(anyValue);
|
|
2114
2081
|
}
|
|
2115
2082
|
setValue({ name: value, settings: {} });
|
|
2116
2083
|
onSelect?.();
|
|
2117
2084
|
};
|
|
2118
|
-
return /* @__PURE__ */
|
|
2119
|
-
|
|
2085
|
+
return /* @__PURE__ */ React61.createElement(import_ui51.Stack, null, /* @__PURE__ */ React61.createElement(import_ui51.Box, { px: 1.5, pb: 1 }, /* @__PURE__ */ React61.createElement(
|
|
2086
|
+
import_ui51.TextField,
|
|
2120
2087
|
{
|
|
2121
2088
|
fullWidth: true,
|
|
2122
2089
|
size: SIZE3,
|
|
2123
2090
|
value: searchValue,
|
|
2124
2091
|
onChange: handleSearch,
|
|
2125
|
-
placeholder: (0,
|
|
2092
|
+
placeholder: (0, import_i18n40.__)("Search dynamic tag", "elementor"),
|
|
2126
2093
|
InputProps: {
|
|
2127
|
-
startAdornment: /* @__PURE__ */
|
|
2094
|
+
startAdornment: /* @__PURE__ */ React61.createElement(import_ui51.InputAdornment, { position: "start" }, /* @__PURE__ */ React61.createElement(import_icons19.SearchIcon, { fontSize: SIZE3 }))
|
|
2128
2095
|
}
|
|
2129
2096
|
}
|
|
2130
|
-
)), /* @__PURE__ */
|
|
2131
|
-
const isSelected = isCurrentValueDynamic && value ===
|
|
2132
|
-
return /* @__PURE__ */
|
|
2133
|
-
|
|
2097
|
+
)), /* @__PURE__ */ React61.createElement(import_ui51.Divider, null), /* @__PURE__ */ React61.createElement(import_ui51.Box, { sx: { overflowY: "auto", height: 260, width: 220 } }, options10.length > 0 ? /* @__PURE__ */ React61.createElement(import_ui51.MenuList, { role: "listbox", tabIndex: 0 }, options10.map(([category, items3], index) => /* @__PURE__ */ React61.createElement(import_react17.Fragment, { key: index }, /* @__PURE__ */ React61.createElement(import_ui51.ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items3.map(({ value, label: tagLabel }) => {
|
|
2098
|
+
const isSelected = isCurrentValueDynamic && value === dynamicValue?.name;
|
|
2099
|
+
return /* @__PURE__ */ React61.createElement(
|
|
2100
|
+
import_ui51.MenuItem,
|
|
2134
2101
|
{
|
|
2135
2102
|
key: value,
|
|
2136
2103
|
selected: isSelected,
|
|
@@ -2140,16 +2107,16 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2140
2107
|
},
|
|
2141
2108
|
tagLabel
|
|
2142
2109
|
);
|
|
2143
|
-
})))) : /* @__PURE__ */
|
|
2144
|
-
|
|
2110
|
+
})))) : /* @__PURE__ */ React61.createElement(import_ui51.Stack, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React61.createElement(import_icons19.PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React61.createElement(import_ui51.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n40.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React61.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React61.createElement(import_ui51.Typography, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React61.createElement(
|
|
2111
|
+
import_ui51.Link,
|
|
2145
2112
|
{
|
|
2146
2113
|
color: "secondary",
|
|
2147
2114
|
variant: "caption",
|
|
2148
2115
|
component: "button",
|
|
2149
2116
|
onClick: () => setSearchValue("")
|
|
2150
2117
|
},
|
|
2151
|
-
(0,
|
|
2152
|
-
), "\xA0", (0,
|
|
2118
|
+
(0, import_i18n40.__)("Clear the filters", "elementor")
|
|
2119
|
+
), "\xA0", (0, import_i18n40.__)("and try again.", "elementor")))));
|
|
2153
2120
|
};
|
|
2154
2121
|
var useFilteredOptions = (bind, searchValue) => {
|
|
2155
2122
|
const dynamicTags = usePropDynamicTags(bind);
|
|
@@ -2170,84 +2137,83 @@ var useFilteredOptions = (bind, searchValue) => {
|
|
|
2170
2137
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
2171
2138
|
var SIZE4 = "tiny";
|
|
2172
2139
|
var DynamicSelectionControl = () => {
|
|
2173
|
-
const { setValue: setAnyValue } = (0,
|
|
2174
|
-
const { bind, value } = (0,
|
|
2175
|
-
const
|
|
2140
|
+
const { setValue: setAnyValue } = (0, import_editor_controls44.useBoundProp)();
|
|
2141
|
+
const { bind, value } = (0, import_editor_controls44.useBoundProp)(dynamicPropTypeUtil);
|
|
2142
|
+
const [propValueFromHistory] = usePersistDynamicValue(bind);
|
|
2176
2143
|
const { name: tagName = "" } = value;
|
|
2177
|
-
const selectionPopoverId = (0,
|
|
2178
|
-
const selectionPopoverState = (0,
|
|
2144
|
+
const selectionPopoverId = (0, import_react18.useId)();
|
|
2145
|
+
const selectionPopoverState = (0, import_ui52.usePopupState)({ variant: "popover", popupId: selectionPopoverId });
|
|
2179
2146
|
const dynamicTag = useDynamicTag(bind, tagName);
|
|
2180
2147
|
const removeDynamicTag = () => {
|
|
2181
|
-
|
|
2182
|
-
setAnyValue(propValue ?? null);
|
|
2148
|
+
setAnyValue(propValueFromHistory ?? null);
|
|
2183
2149
|
};
|
|
2184
2150
|
if (!dynamicTag) {
|
|
2185
2151
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
2186
2152
|
}
|
|
2187
|
-
return /* @__PURE__ */
|
|
2188
|
-
|
|
2153
|
+
return /* @__PURE__ */ React62.createElement(import_ui52.Box, null, /* @__PURE__ */ React62.createElement(
|
|
2154
|
+
import_ui52.UnstableTag,
|
|
2189
2155
|
{
|
|
2190
2156
|
fullWidth: true,
|
|
2191
2157
|
showActionsOnHover: true,
|
|
2192
2158
|
label: dynamicTag.label,
|
|
2193
|
-
startIcon: /* @__PURE__ */
|
|
2194
|
-
...(0,
|
|
2195
|
-
actions: /* @__PURE__ */
|
|
2196
|
-
|
|
2159
|
+
startIcon: /* @__PURE__ */ React62.createElement(import_icons20.DatabaseIcon, { fontSize: SIZE4 }),
|
|
2160
|
+
...(0, import_ui52.bindTrigger)(selectionPopoverState),
|
|
2161
|
+
actions: /* @__PURE__ */ React62.createElement(React62.Fragment, null, /* @__PURE__ */ React62.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React62.createElement(
|
|
2162
|
+
import_ui52.IconButton,
|
|
2197
2163
|
{
|
|
2198
2164
|
size: SIZE4,
|
|
2199
2165
|
onClick: removeDynamicTag,
|
|
2200
|
-
"aria-label": (0,
|
|
2166
|
+
"aria-label": (0, import_i18n41.__)("Remove dynamic value", "elementor")
|
|
2201
2167
|
},
|
|
2202
|
-
/* @__PURE__ */
|
|
2168
|
+
/* @__PURE__ */ React62.createElement(import_icons20.XIcon, { fontSize: SIZE4 })
|
|
2203
2169
|
))
|
|
2204
2170
|
}
|
|
2205
|
-
), /* @__PURE__ */
|
|
2206
|
-
|
|
2171
|
+
), /* @__PURE__ */ React62.createElement(
|
|
2172
|
+
import_ui52.Popover,
|
|
2207
2173
|
{
|
|
2208
2174
|
disablePortal: true,
|
|
2209
2175
|
disableScrollLock: true,
|
|
2210
2176
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
2211
|
-
...(0,
|
|
2177
|
+
...(0, import_ui52.bindPopover)(selectionPopoverState)
|
|
2212
2178
|
},
|
|
2213
|
-
/* @__PURE__ */
|
|
2179
|
+
/* @__PURE__ */ React62.createElement(import_ui52.Stack, null, /* @__PURE__ */ React62.createElement(import_ui52.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React62.createElement(import_icons20.DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React62.createElement(import_ui52.Typography, { variant: "subtitle2" }, (0, import_i18n41.__)("Dynamic Tags", "elementor")), /* @__PURE__ */ React62.createElement(import_ui52.IconButton, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React62.createElement(import_icons20.XIcon, { fontSize: SIZE4 }))), /* @__PURE__ */ React62.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
2214
2180
|
));
|
|
2215
2181
|
};
|
|
2216
2182
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
2217
|
-
const popupId = (0,
|
|
2218
|
-
const settingsPopupState = (0,
|
|
2183
|
+
const popupId = (0, import_react18.useId)();
|
|
2184
|
+
const settingsPopupState = (0, import_ui52.usePopupState)({ variant: "popover", popupId });
|
|
2219
2185
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
2220
2186
|
if (!hasDynamicSettings) {
|
|
2221
2187
|
return null;
|
|
2222
2188
|
}
|
|
2223
|
-
return /* @__PURE__ */
|
|
2224
|
-
|
|
2189
|
+
return /* @__PURE__ */ React62.createElement(React62.Fragment, null, /* @__PURE__ */ React62.createElement(
|
|
2190
|
+
import_ui52.IconButton,
|
|
2225
2191
|
{
|
|
2226
2192
|
size: SIZE4,
|
|
2227
|
-
...(0,
|
|
2228
|
-
"aria-label": (0,
|
|
2193
|
+
...(0, import_ui52.bindTrigger)(settingsPopupState),
|
|
2194
|
+
"aria-label": (0, import_i18n41.__)("Settings", "elementor")
|
|
2229
2195
|
},
|
|
2230
|
-
/* @__PURE__ */
|
|
2231
|
-
), /* @__PURE__ */
|
|
2232
|
-
|
|
2196
|
+
/* @__PURE__ */ React62.createElement(import_icons20.SettingsIcon, { fontSize: SIZE4 })
|
|
2197
|
+
), /* @__PURE__ */ React62.createElement(
|
|
2198
|
+
import_ui52.Popover,
|
|
2233
2199
|
{
|
|
2234
2200
|
disableScrollLock: true,
|
|
2235
2201
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
2236
|
-
...(0,
|
|
2202
|
+
...(0, import_ui52.bindPopover)(settingsPopupState)
|
|
2237
2203
|
},
|
|
2238
|
-
/* @__PURE__ */
|
|
2204
|
+
/* @__PURE__ */ React62.createElement(import_ui52.Paper, { component: import_ui52.Stack, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React62.createElement(import_ui52.Stack, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React62.createElement(import_icons20.DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React62.createElement(import_ui52.Typography, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React62.createElement(import_ui52.IconButton, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React62.createElement(import_icons20.XIcon, { fontSize: SIZE4 }))), /* @__PURE__ */ React62.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
2239
2205
|
));
|
|
2240
2206
|
};
|
|
2241
2207
|
var DynamicSettings = ({ controls }) => {
|
|
2242
2208
|
const tabs = controls.filter(({ type }) => type === "section");
|
|
2243
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
2209
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui52.useTabs)(0);
|
|
2244
2210
|
if (!tabs.length) {
|
|
2245
2211
|
return null;
|
|
2246
2212
|
}
|
|
2247
|
-
return /* @__PURE__ */
|
|
2248
|
-
return /* @__PURE__ */
|
|
2213
|
+
return /* @__PURE__ */ React62.createElement(React62.Fragment, null, /* @__PURE__ */ React62.createElement(import_ui52.Tabs, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React62.createElement(import_ui52.Tab, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React62.createElement(import_ui52.Divider, null), tabs.map(({ value }, index) => {
|
|
2214
|
+
return /* @__PURE__ */ React62.createElement(import_ui52.TabPanel, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React62.createElement(import_ui52.Stack, { gap: 1, px: 2 }, value.items.map((item) => {
|
|
2249
2215
|
if (item.type === "control") {
|
|
2250
|
-
return /* @__PURE__ */
|
|
2216
|
+
return /* @__PURE__ */ React62.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
2251
2217
|
}
|
|
2252
2218
|
return null;
|
|
2253
2219
|
})));
|
|
@@ -2257,24 +2223,24 @@ var Control3 = ({ control }) => {
|
|
|
2257
2223
|
if (!getControlByType(control.type)) {
|
|
2258
2224
|
return null;
|
|
2259
2225
|
}
|
|
2260
|
-
return /* @__PURE__ */
|
|
2226
|
+
return /* @__PURE__ */ React62.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React62.createElement(import_editor_controls44.ControlLabel, null, control.label) : null, /* @__PURE__ */ React62.createElement(Control, { type: control.type, props: control.props }));
|
|
2261
2227
|
};
|
|
2262
2228
|
|
|
2263
2229
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
2264
|
-
var
|
|
2265
|
-
var
|
|
2230
|
+
var React63 = __toESM(require("react"));
|
|
2231
|
+
var import_editor_controls45 = require("@elementor/editor-controls");
|
|
2266
2232
|
var import_icons21 = require("@elementor/icons");
|
|
2267
|
-
var
|
|
2233
|
+
var import_i18n42 = require("@wordpress/i18n");
|
|
2268
2234
|
var usePropDynamicAction = () => {
|
|
2269
|
-
const { bind } = (0,
|
|
2235
|
+
const { bind } = (0, import_editor_controls45.useBoundProp)();
|
|
2270
2236
|
const { elementType } = useElement();
|
|
2271
2237
|
const propType = elementType.propsSchema[bind];
|
|
2272
2238
|
const visible = !!propType && supportsDynamic(propType);
|
|
2273
2239
|
return {
|
|
2274
2240
|
visible,
|
|
2275
2241
|
icon: import_icons21.DatabaseIcon,
|
|
2276
|
-
title: (0,
|
|
2277
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
2242
|
+
title: (0, import_i18n42.__)("Dynamic Tags", "elementor"),
|
|
2243
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React63.createElement(DynamicSelection, { onSelect: closePopover })
|
|
2278
2244
|
};
|
|
2279
2245
|
};
|
|
2280
2246
|
|
|
@@ -2302,7 +2268,7 @@ function init2() {
|
|
|
2302
2268
|
init();
|
|
2303
2269
|
}
|
|
2304
2270
|
var blockV1Panel = () => {
|
|
2305
|
-
(0,
|
|
2271
|
+
(0, import_editor_v1_adapters4.__privateBlockDataCommand)({
|
|
2306
2272
|
command: "panel/editor/open",
|
|
2307
2273
|
condition: isAtomicWidgetSelected
|
|
2308
2274
|
});
|