@elementor/editor-components 3.35.0-381 → 3.35.0-383
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +229 -211
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +183 -165
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -22
- package/src/components/component-properties-panel/component-properties-panel-content.tsx +9 -3
- package/src/components/component-properties-panel/properties-empty-state.tsx +38 -31
- package/src/components/component-properties-panel/sortable.tsx +1 -1
- package/src/components/components-tab/component-introduction.tsx +1 -1
package/dist/index.mjs
CHANGED
|
@@ -356,23 +356,23 @@ function useNavigateBack() {
|
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
// src/components/component-properties-panel/component-properties-panel.tsx
|
|
359
|
-
import * as
|
|
359
|
+
import * as React8 from "react";
|
|
360
360
|
import { ElementProvider, usePanelActions as useEditingPanelActions } from "@elementor/editor-editing-panel";
|
|
361
361
|
import { useSelectedElement } from "@elementor/editor-elements";
|
|
362
362
|
import { __createPanel as createPanel, Panel } from "@elementor/editor-panels";
|
|
363
363
|
import { ThemeProvider } from "@elementor/editor-ui";
|
|
364
|
-
import { Alert, Box as
|
|
365
|
-
import { __ as
|
|
364
|
+
import { Alert, Box as Box5, ErrorBoundary } from "@elementor/ui";
|
|
365
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
366
366
|
|
|
367
367
|
// src/components/component-properties-panel/component-properties-panel-content.tsx
|
|
368
|
-
import * as
|
|
369
|
-
import { useMemo, useState as
|
|
368
|
+
import * as React7 from "react";
|
|
369
|
+
import { useMemo, useRef, useState as useState4 } from "react";
|
|
370
370
|
import { setDocumentModifiedStatus as setDocumentModifiedStatus2 } from "@elementor/editor-documents";
|
|
371
371
|
import { PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
372
372
|
import { ComponentPropListIcon as ComponentPropListIcon2, FolderPlusIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
373
|
-
import { Divider, IconButton as IconButton3, List as List2, Stack as
|
|
373
|
+
import { Divider, IconButton as IconButton3, List as List2, Stack as Stack5, Tooltip as Tooltip2 } from "@elementor/ui";
|
|
374
374
|
import { generateUniqueId as generateUniqueId2 } from "@elementor/utils";
|
|
375
|
-
import { __ as
|
|
375
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
376
376
|
|
|
377
377
|
// src/store/actions/add-overridable-group.ts
|
|
378
378
|
import { __dispatch as dispatch, __getState as getState2 } from "@elementor/store";
|
|
@@ -721,14 +721,63 @@ function useOverridableProps(componentId) {
|
|
|
721
721
|
}
|
|
722
722
|
|
|
723
723
|
// src/components/component-properties-panel/properties-empty-state.tsx
|
|
724
|
-
import * as
|
|
724
|
+
import * as React2 from "react";
|
|
725
|
+
import { useState } from "react";
|
|
725
726
|
import { ComponentPropListIcon } from "@elementor/icons";
|
|
726
|
-
import { Link, Stack, Typography } from "@elementor/ui";
|
|
727
|
+
import { Link, Stack as Stack2, Typography as Typography2 } from "@elementor/ui";
|
|
728
|
+
import { __ as __3 } from "@wordpress/i18n";
|
|
729
|
+
|
|
730
|
+
// src/components/components-tab/component-introduction.tsx
|
|
731
|
+
import * as React from "react";
|
|
732
|
+
import { PopoverContent } from "@elementor/editor-controls";
|
|
733
|
+
import { PopoverHeader } from "@elementor/editor-ui";
|
|
734
|
+
import { Box, Button, Image, Popover, Stack, Typography } from "@elementor/ui";
|
|
727
735
|
import { __ as __2 } from "@wordpress/i18n";
|
|
728
|
-
var
|
|
729
|
-
|
|
736
|
+
var ComponentIntroduction = ({
|
|
737
|
+
anchorRef,
|
|
738
|
+
shouldShowIntroduction,
|
|
739
|
+
onClose
|
|
740
|
+
}) => {
|
|
741
|
+
if (!anchorRef.current || !shouldShowIntroduction) {
|
|
742
|
+
return null;
|
|
743
|
+
}
|
|
730
744
|
return /* @__PURE__ */ React.createElement(
|
|
731
|
-
|
|
745
|
+
Popover,
|
|
746
|
+
{
|
|
747
|
+
anchorEl: anchorRef.current,
|
|
748
|
+
open: shouldShowIntroduction,
|
|
749
|
+
anchorOrigin: {
|
|
750
|
+
vertical: "top",
|
|
751
|
+
horizontal: "right"
|
|
752
|
+
},
|
|
753
|
+
transformOrigin: {
|
|
754
|
+
vertical: "top",
|
|
755
|
+
horizontal: -30
|
|
756
|
+
},
|
|
757
|
+
onClose
|
|
758
|
+
},
|
|
759
|
+
/* @__PURE__ */ React.createElement(Box, { sx: { width: "296px" } }, /* @__PURE__ */ React.createElement(PopoverHeader, { title: __2("Add your first property", "elementor"), onClose }), /* @__PURE__ */ React.createElement(
|
|
760
|
+
Image,
|
|
761
|
+
{
|
|
762
|
+
sx: { width: "296px", height: "160px" },
|
|
763
|
+
src: "https://assets.elementor.com/packages/v1/images/components-properties-intro.png",
|
|
764
|
+
alt: ""
|
|
765
|
+
}
|
|
766
|
+
), /* @__PURE__ */ React.createElement(PopoverContent, null, /* @__PURE__ */ React.createElement(Stack, { gap: 1, sx: { p: 2 } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, __2("Properties make instances flexible.", "elementor")), /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, __2(
|
|
767
|
+
"Click next to any setting you want users to customize - like text, images, or links.",
|
|
768
|
+
"elementor"
|
|
769
|
+
)), /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, __2(
|
|
770
|
+
"Your properties will appear in the Properties panel, where you can organize and manage them anytime.",
|
|
771
|
+
"elementor"
|
|
772
|
+
)), /* @__PURE__ */ React.createElement(Stack, { direction: "row", alignItems: "center", justifyContent: "flex-end" }, /* @__PURE__ */ React.createElement(Button, { size: "medium", variant: "contained", onClick: onClose }, __2("Got it", "elementor"))))))
|
|
773
|
+
);
|
|
774
|
+
};
|
|
775
|
+
|
|
776
|
+
// src/components/component-properties-panel/properties-empty-state.tsx
|
|
777
|
+
function PropertiesEmptyState({ introductionRef }) {
|
|
778
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
779
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
|
780
|
+
Stack2,
|
|
732
781
|
{
|
|
733
782
|
alignItems: "center",
|
|
734
783
|
justifyContent: "flex-start",
|
|
@@ -737,67 +786,72 @@ function PropertiesEmptyState() {
|
|
|
737
786
|
sx: { px: 2.5, pt: 10, pb: 5.5 },
|
|
738
787
|
gap: 1
|
|
739
788
|
},
|
|
740
|
-
/* @__PURE__ */
|
|
741
|
-
/* @__PURE__ */
|
|
742
|
-
/* @__PURE__ */
|
|
743
|
-
/* @__PURE__ */
|
|
744
|
-
/* @__PURE__ */
|
|
789
|
+
/* @__PURE__ */ React2.createElement(ComponentPropListIcon, { fontSize: "large" }),
|
|
790
|
+
/* @__PURE__ */ React2.createElement(Typography2, { align: "center", variant: "subtitle2" }, __3("Add your first property", "elementor")),
|
|
791
|
+
/* @__PURE__ */ React2.createElement(Typography2, { align: "center", variant: "caption" }, __3("Make instances flexible while keeping design synced.", "elementor")),
|
|
792
|
+
/* @__PURE__ */ React2.createElement(Typography2, { align: "center", variant: "caption" }, __3("Select any element, then click + next to a setting to expose it.", "elementor")),
|
|
793
|
+
/* @__PURE__ */ React2.createElement(
|
|
745
794
|
Link,
|
|
746
795
|
{
|
|
747
796
|
variant: "caption",
|
|
748
797
|
color: "secondary",
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
rel: "noopener noreferrer",
|
|
752
|
-
sx: { textDecorationLine: "underline" }
|
|
798
|
+
sx: { textDecorationLine: "underline" },
|
|
799
|
+
onClick: () => setIsOpen(true)
|
|
753
800
|
},
|
|
754
|
-
|
|
801
|
+
__3("Learn more", "elementor")
|
|
755
802
|
)
|
|
756
|
-
)
|
|
803
|
+
), /* @__PURE__ */ React2.createElement(
|
|
804
|
+
ComponentIntroduction,
|
|
805
|
+
{
|
|
806
|
+
anchorRef: introductionRef,
|
|
807
|
+
shouldShowIntroduction: isOpen,
|
|
808
|
+
onClose: () => setIsOpen(false)
|
|
809
|
+
}
|
|
810
|
+
));
|
|
757
811
|
}
|
|
758
812
|
|
|
759
813
|
// src/components/component-properties-panel/properties-group.tsx
|
|
760
|
-
import * as
|
|
814
|
+
import * as React6 from "react";
|
|
761
815
|
import { EditableField, MenuListItem as MenuListItem2 } from "@elementor/editor-ui";
|
|
762
816
|
import { DotsVerticalIcon } from "@elementor/icons";
|
|
763
817
|
import {
|
|
764
818
|
bindMenu,
|
|
765
819
|
bindTrigger as bindTrigger2,
|
|
766
|
-
Box as
|
|
820
|
+
Box as Box4,
|
|
767
821
|
IconButton as IconButton2,
|
|
768
822
|
List,
|
|
769
823
|
Menu,
|
|
770
|
-
Stack as
|
|
824
|
+
Stack as Stack4,
|
|
771
825
|
Tooltip,
|
|
772
|
-
Typography as
|
|
826
|
+
Typography as Typography5,
|
|
773
827
|
usePopupState as usePopupState2
|
|
774
828
|
} from "@elementor/ui";
|
|
775
|
-
import { __ as
|
|
829
|
+
import { __ as __5 } from "@wordpress/i18n";
|
|
776
830
|
|
|
777
831
|
// src/components/component-properties-panel/property-item.tsx
|
|
778
|
-
import * as
|
|
832
|
+
import * as React5 from "react";
|
|
779
833
|
import { getWidgetsCache } from "@elementor/editor-elements";
|
|
780
834
|
import { XIcon } from "@elementor/icons";
|
|
781
|
-
import { bindPopover, bindTrigger, Box as
|
|
835
|
+
import { bindPopover, bindTrigger, Box as Box3, IconButton, Popover as Popover2, Typography as Typography4, usePopupState } from "@elementor/ui";
|
|
782
836
|
|
|
783
837
|
// src/components/overridable-props/overridable-prop-form.tsx
|
|
784
|
-
import * as
|
|
785
|
-
import { useState } from "react";
|
|
838
|
+
import * as React3 from "react";
|
|
839
|
+
import { useState as useState2 } from "react";
|
|
786
840
|
import { Form, MenuListItem } from "@elementor/editor-ui";
|
|
787
|
-
import { Button, FormLabel, Grid, Select, Stack as
|
|
788
|
-
import { __ as
|
|
841
|
+
import { Button as Button2, FormLabel, Grid, Select, Stack as Stack3, TextField, Typography as Typography3 } from "@elementor/ui";
|
|
842
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
789
843
|
var SIZE = "tiny";
|
|
790
|
-
var DEFAULT_GROUP = { value: null, label:
|
|
844
|
+
var DEFAULT_GROUP = { value: null, label: __4("Default", "elementor") };
|
|
791
845
|
function OverridablePropForm({ onSubmit, groups, currentValue, sx }) {
|
|
792
|
-
const [propLabel, setPropLabel] =
|
|
793
|
-
const [group, setGroup] =
|
|
794
|
-
const name =
|
|
795
|
-
const groupName =
|
|
846
|
+
const [propLabel, setPropLabel] = useState2(currentValue?.label ?? null);
|
|
847
|
+
const [group, setGroup] = useState2(currentValue?.groupId ?? groups?.[0]?.value ?? null);
|
|
848
|
+
const name = __4("Name", "elementor");
|
|
849
|
+
const groupName = __4("Group Name", "elementor");
|
|
796
850
|
const isCreate = currentValue === void 0;
|
|
797
|
-
const title = isCreate ?
|
|
798
|
-
const ctaLabel = isCreate ?
|
|
799
|
-
return /* @__PURE__ */
|
|
800
|
-
|
|
851
|
+
const title = isCreate ? __4("Create new property", "elementor") : __4("Update property", "elementor");
|
|
852
|
+
const ctaLabel = isCreate ? __4("Create", "elementor") : __4("Update", "elementor");
|
|
853
|
+
return /* @__PURE__ */ React3.createElement(Form, { onSubmit: () => onSubmit({ label: propLabel ?? "", group }) }, /* @__PURE__ */ React3.createElement(Stack3, { alignItems: "start", sx: { width: "268px", ...sx } }, /* @__PURE__ */ React3.createElement(
|
|
854
|
+
Stack3,
|
|
801
855
|
{
|
|
802
856
|
direction: "row",
|
|
803
857
|
alignItems: "center",
|
|
@@ -805,18 +859,18 @@ function OverridablePropForm({ onSubmit, groups, currentValue, sx }) {
|
|
|
805
859
|
px: 1.5,
|
|
806
860
|
sx: { columnGap: 0.5, borderBottom: "1px solid", borderColor: "divider", width: "100%", mb: 1.5 }
|
|
807
861
|
},
|
|
808
|
-
/* @__PURE__ */
|
|
809
|
-
), /* @__PURE__ */
|
|
862
|
+
/* @__PURE__ */ React3.createElement(Typography3, { variant: "caption", sx: { color: "text.primary", fontWeight: "500", lineHeight: 1 } }, title)
|
|
863
|
+
), /* @__PURE__ */ React3.createElement(Grid, { container: true, gap: 0.75, alignItems: "start", px: 1.5, mb: 1.5 }, /* @__PURE__ */ React3.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React3.createElement(FormLabel, { size: "tiny" }, name)), /* @__PURE__ */ React3.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React3.createElement(
|
|
810
864
|
TextField,
|
|
811
865
|
{
|
|
812
866
|
name,
|
|
813
867
|
size: SIZE,
|
|
814
868
|
fullWidth: true,
|
|
815
|
-
placeholder:
|
|
869
|
+
placeholder: __4("Enter value", "elementor"),
|
|
816
870
|
value: propLabel ?? "",
|
|
817
871
|
onChange: (e) => setPropLabel(e.target.value)
|
|
818
872
|
}
|
|
819
|
-
))), /* @__PURE__ */
|
|
873
|
+
))), /* @__PURE__ */ React3.createElement(Grid, { container: true, gap: 0.75, alignItems: "start", px: 1.5, mb: 1.5 }, /* @__PURE__ */ React3.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React3.createElement(FormLabel, { size: "tiny" }, groupName)), /* @__PURE__ */ React3.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React3.createElement(
|
|
820
874
|
Select,
|
|
821
875
|
{
|
|
822
876
|
name: groupName,
|
|
@@ -833,21 +887,21 @@ function OverridablePropForm({ onSubmit, groups, currentValue, sx }) {
|
|
|
833
887
|
return groups?.find(({ value }) => value === selectedValue)?.label ?? selectedValue;
|
|
834
888
|
}
|
|
835
889
|
},
|
|
836
|
-
(groups ?? [DEFAULT_GROUP]).map(({ label: groupLabel, ...props }) => /* @__PURE__ */
|
|
837
|
-
))), /* @__PURE__ */
|
|
890
|
+
(groups ?? [DEFAULT_GROUP]).map(({ label: groupLabel, ...props }) => /* @__PURE__ */ React3.createElement(MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, groupLabel))
|
|
891
|
+
))), /* @__PURE__ */ React3.createElement(Stack3, { direction: "row", justifyContent: "flex-end", alignSelf: "end", mt: 1.5, py: 1, px: 1.5 }, /* @__PURE__ */ React3.createElement(Button2, { type: "submit", disabled: !propLabel, variant: "contained", color: "primary", size: "small" }, ctaLabel))));
|
|
838
892
|
}
|
|
839
893
|
|
|
840
894
|
// src/components/component-properties-panel/sortable.tsx
|
|
841
|
-
import * as
|
|
895
|
+
import * as React4 from "react";
|
|
842
896
|
import { GripVerticalIcon } from "@elementor/icons";
|
|
843
897
|
import {
|
|
844
|
-
Box,
|
|
898
|
+
Box as Box2,
|
|
845
899
|
styled,
|
|
846
900
|
UnstableSortableItem,
|
|
847
901
|
UnstableSortableProvider
|
|
848
902
|
} from "@elementor/ui";
|
|
849
|
-
var SortableProvider = (props) => /* @__PURE__ */
|
|
850
|
-
var SortableTrigger = ({ triggerClassName, ...props }) => /* @__PURE__ */
|
|
903
|
+
var SortableProvider = (props) => /* @__PURE__ */ React4.createElement(UnstableSortableProvider, { restrictAxis: true, variant: "static", dragPlaceholderStyle: { opacity: "1" }, ...props });
|
|
904
|
+
var SortableTrigger = ({ triggerClassName, ...props }) => /* @__PURE__ */ React4.createElement(
|
|
851
905
|
StyledSortableTrigger,
|
|
852
906
|
{
|
|
853
907
|
...props,
|
|
@@ -855,9 +909,9 @@ var SortableTrigger = ({ triggerClassName, ...props }) => /* @__PURE__ */ React3
|
|
|
855
909
|
className: `sortable-trigger ${triggerClassName ?? ""}`.trim(),
|
|
856
910
|
"aria-label": "sort"
|
|
857
911
|
},
|
|
858
|
-
/* @__PURE__ */
|
|
912
|
+
/* @__PURE__ */ React4.createElement(GripVerticalIcon, { fontSize: "tiny" })
|
|
859
913
|
);
|
|
860
|
-
var SortableItem = ({ children, id: id2 }) => /* @__PURE__ */
|
|
914
|
+
var SortableItem = ({ children, id: id2 }) => /* @__PURE__ */ React4.createElement(
|
|
861
915
|
UnstableSortableItem,
|
|
862
916
|
{
|
|
863
917
|
id: id2,
|
|
@@ -871,8 +925,8 @@ var SortableItem = ({ children, id: id2 }) => /* @__PURE__ */ React3.createEleme
|
|
|
871
925
|
showDropIndication,
|
|
872
926
|
isDragOverlay,
|
|
873
927
|
isDragPlaceholder
|
|
874
|
-
}) => /* @__PURE__ */
|
|
875
|
-
|
|
928
|
+
}) => /* @__PURE__ */ React4.createElement(
|
|
929
|
+
Box2,
|
|
876
930
|
{
|
|
877
931
|
...itemProps,
|
|
878
932
|
style: itemStyle,
|
|
@@ -888,19 +942,19 @@ var SortableItem = ({ children, id: id2 }) => /* @__PURE__ */ React3.createEleme
|
|
|
888
942
|
triggerProps,
|
|
889
943
|
triggerStyle
|
|
890
944
|
}),
|
|
891
|
-
showDropIndication && /* @__PURE__ */
|
|
945
|
+
showDropIndication && /* @__PURE__ */ React4.createElement(SortableItemIndicator, { style: dropIndicationStyle })
|
|
892
946
|
)
|
|
893
947
|
}
|
|
894
948
|
);
|
|
895
949
|
var StyledSortableTrigger = styled("div")(({ theme }) => ({
|
|
896
950
|
position: "absolute",
|
|
897
|
-
left:
|
|
951
|
+
left: "-2px",
|
|
898
952
|
top: "50%",
|
|
899
953
|
transform: `translate( -${theme.spacing(1.5)}, -50% )`,
|
|
900
954
|
color: theme.palette.action.active,
|
|
901
955
|
cursor: "grab"
|
|
902
956
|
}));
|
|
903
|
-
var SortableItemIndicator = styled(
|
|
957
|
+
var SortableItemIndicator = styled(Box2)`
|
|
904
958
|
width: 100%;
|
|
905
959
|
height: 1px;
|
|
906
960
|
background-color: ${({ theme }) => theme.palette.text.primary};
|
|
@@ -928,8 +982,8 @@ function PropertyItem({
|
|
|
928
982
|
event.stopPropagation();
|
|
929
983
|
onDelete(prop.overrideKey);
|
|
930
984
|
};
|
|
931
|
-
return /* @__PURE__ */
|
|
932
|
-
|
|
985
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
|
|
986
|
+
Box3,
|
|
933
987
|
{
|
|
934
988
|
...bindTrigger(popoverState),
|
|
935
989
|
sx: {
|
|
@@ -963,25 +1017,25 @@ function PropertyItem({
|
|
|
963
1017
|
}
|
|
964
1018
|
}
|
|
965
1019
|
},
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
/* @__PURE__ */
|
|
968
|
-
|
|
1020
|
+
/* @__PURE__ */ React5.createElement(SortableTrigger, { ...sortableTriggerProps }),
|
|
1021
|
+
/* @__PURE__ */ React5.createElement(
|
|
1022
|
+
Box3,
|
|
969
1023
|
{
|
|
970
1024
|
sx: { display: "flex", alignItems: "center", color: "text.primary", fontSize: 12, padding: 0.25 }
|
|
971
1025
|
},
|
|
972
|
-
/* @__PURE__ */
|
|
1026
|
+
/* @__PURE__ */ React5.createElement("i", { className: icon })
|
|
973
1027
|
),
|
|
974
|
-
/* @__PURE__ */
|
|
975
|
-
/* @__PURE__ */
|
|
976
|
-
), /* @__PURE__ */
|
|
977
|
-
|
|
1028
|
+
/* @__PURE__ */ React5.createElement(Typography4, { variant: "caption", sx: { color: "text.primary", flexGrow: 1, fontSize: 10 } }, prop.label),
|
|
1029
|
+
/* @__PURE__ */ React5.createElement(IconButton, { size: "tiny", onClick: handleDelete, "aria-label": "Delete property", sx: { p: 0.25 } }, /* @__PURE__ */ React5.createElement(XIcon, { fontSize: "tiny" }))
|
|
1030
|
+
), /* @__PURE__ */ React5.createElement(
|
|
1031
|
+
Popover2,
|
|
978
1032
|
{
|
|
979
1033
|
...popoverProps,
|
|
980
1034
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
981
1035
|
transformOrigin: { vertical: "top", horizontal: "left" },
|
|
982
1036
|
PaperProps: { sx: { width: popoverState.anchorEl?.getBoundingClientRect().width } }
|
|
983
1037
|
},
|
|
984
|
-
/* @__PURE__ */
|
|
1038
|
+
/* @__PURE__ */ React5.createElement(
|
|
985
1039
|
OverridablePropForm,
|
|
986
1040
|
{
|
|
987
1041
|
onSubmit: handleSubmit,
|
|
@@ -1031,15 +1085,15 @@ function PropertiesGroup({
|
|
|
1031
1085
|
popupState.close();
|
|
1032
1086
|
onGroupDelete(group.id);
|
|
1033
1087
|
};
|
|
1034
|
-
return /* @__PURE__ */
|
|
1035
|
-
|
|
1088
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1089
|
+
Box4,
|
|
1036
1090
|
{
|
|
1037
1091
|
sx: {
|
|
1038
1092
|
opacity: isDragPlaceholder ? 0.5 : 1
|
|
1039
1093
|
}
|
|
1040
1094
|
},
|
|
1041
|
-
/* @__PURE__ */
|
|
1042
|
-
|
|
1095
|
+
/* @__PURE__ */ React6.createElement(Stack4, { gap: 1 }, /* @__PURE__ */ React6.createElement(
|
|
1096
|
+
Box4,
|
|
1043
1097
|
{
|
|
1044
1098
|
className: "group-header",
|
|
1045
1099
|
sx: {
|
|
@@ -1058,9 +1112,9 @@ function PropertiesGroup({
|
|
|
1058
1112
|
}
|
|
1059
1113
|
}
|
|
1060
1114
|
},
|
|
1061
|
-
/* @__PURE__ */
|
|
1062
|
-
/* @__PURE__ */
|
|
1063
|
-
|
|
1115
|
+
/* @__PURE__ */ React6.createElement(SortableTrigger, { triggerClassName: "group-sortable-trigger", ...sortableTriggerProps }),
|
|
1116
|
+
/* @__PURE__ */ React6.createElement(Stack4, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 2 }, isThisGroupEditing ? /* @__PURE__ */ React6.createElement(
|
|
1117
|
+
Box4,
|
|
1064
1118
|
{
|
|
1065
1119
|
sx: {
|
|
1066
1120
|
flex: 1,
|
|
@@ -1073,36 +1127,36 @@ function PropertiesGroup({
|
|
|
1073
1127
|
pl: 0.5
|
|
1074
1128
|
}
|
|
1075
1129
|
},
|
|
1076
|
-
/* @__PURE__ */
|
|
1130
|
+
/* @__PURE__ */ React6.createElement(
|
|
1077
1131
|
EditableField,
|
|
1078
1132
|
{
|
|
1079
1133
|
ref: editableRef,
|
|
1080
|
-
as:
|
|
1134
|
+
as: Typography5,
|
|
1081
1135
|
variant: "caption",
|
|
1082
1136
|
error: error ?? void 0,
|
|
1083
1137
|
sx: { color: "text.primary", fontWeight: 400, lineHeight: 1.66 },
|
|
1084
1138
|
...getEditableProps()
|
|
1085
1139
|
}
|
|
1086
1140
|
)
|
|
1087
|
-
) : /* @__PURE__ */
|
|
1088
|
-
|
|
1141
|
+
) : /* @__PURE__ */ React6.createElement(
|
|
1142
|
+
Typography5,
|
|
1089
1143
|
{
|
|
1090
1144
|
variant: "caption",
|
|
1091
1145
|
sx: { color: "text.primary", fontWeight: 400, lineHeight: 1.66 }
|
|
1092
1146
|
},
|
|
1093
1147
|
group.label
|
|
1094
|
-
), /* @__PURE__ */
|
|
1148
|
+
), /* @__PURE__ */ React6.createElement(
|
|
1095
1149
|
IconButton2,
|
|
1096
1150
|
{
|
|
1097
1151
|
className: "group-menu",
|
|
1098
1152
|
size: "tiny",
|
|
1099
1153
|
sx: { p: 0.25, visibility: isThisGroupEditing ? "visible" : void 0 },
|
|
1100
|
-
"aria-label":
|
|
1154
|
+
"aria-label": __5("Group actions", "elementor"),
|
|
1101
1155
|
...bindTrigger2(popupState)
|
|
1102
1156
|
},
|
|
1103
|
-
/* @__PURE__ */
|
|
1157
|
+
/* @__PURE__ */ React6.createElement(DotsVerticalIcon, { fontSize: "tiny" })
|
|
1104
1158
|
))
|
|
1105
|
-
), /* @__PURE__ */
|
|
1159
|
+
), /* @__PURE__ */ React6.createElement(List, { sx: { p: 0, display: "flex", flexDirection: "column", gap: 1 } }, /* @__PURE__ */ React6.createElement(SortableProvider, { value: group.props, onChange: onPropsReorder }, groupProps.map((prop) => /* @__PURE__ */ React6.createElement(SortableItem, { key: prop.overrideKey, id: prop.overrideKey }, ({ triggerProps, triggerStyle, isDragPlaceholder: isItemDragPlaceholder }) => /* @__PURE__ */ React6.createElement(
|
|
1106
1160
|
PropertyItem,
|
|
1107
1161
|
{
|
|
1108
1162
|
prop,
|
|
@@ -1113,27 +1167,27 @@ function PropertiesGroup({
|
|
|
1113
1167
|
onUpdate: (data) => onPropertyUpdate(prop.overrideKey, data)
|
|
1114
1168
|
}
|
|
1115
1169
|
)))))),
|
|
1116
|
-
/* @__PURE__ */
|
|
1170
|
+
/* @__PURE__ */ React6.createElement(
|
|
1117
1171
|
Menu,
|
|
1118
1172
|
{
|
|
1119
1173
|
...bindMenu(popupState),
|
|
1120
1174
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1121
1175
|
transformOrigin: { vertical: "top", horizontal: "right" }
|
|
1122
1176
|
},
|
|
1123
|
-
/* @__PURE__ */
|
|
1124
|
-
/* @__PURE__ */
|
|
1177
|
+
/* @__PURE__ */ React6.createElement(MenuListItem2, { sx: { minWidth: "160px" }, onClick: handleRenameClick }, /* @__PURE__ */ React6.createElement(Typography5, { variant: "caption", sx: { color: "text.primary" } }, __5("Rename", "elementor"))),
|
|
1178
|
+
/* @__PURE__ */ React6.createElement(
|
|
1125
1179
|
Tooltip,
|
|
1126
1180
|
{
|
|
1127
|
-
title: hasProperties ?
|
|
1181
|
+
title: hasProperties ? __5("To delete the group, first remove all the properties", "elementor") : "",
|
|
1128
1182
|
placement: "right"
|
|
1129
1183
|
},
|
|
1130
|
-
/* @__PURE__ */
|
|
1131
|
-
|
|
1184
|
+
/* @__PURE__ */ React6.createElement("span", null, /* @__PURE__ */ React6.createElement(MenuListItem2, { onClick: handleDeleteClick, disabled: hasProperties }, /* @__PURE__ */ React6.createElement(
|
|
1185
|
+
Typography5,
|
|
1132
1186
|
{
|
|
1133
1187
|
variant: "caption",
|
|
1134
1188
|
sx: { color: hasProperties ? "text.disabled" : "error.light" }
|
|
1135
1189
|
},
|
|
1136
|
-
|
|
1190
|
+
__5("Delete", "elementor")
|
|
1137
1191
|
)))
|
|
1138
1192
|
)
|
|
1139
1193
|
)
|
|
@@ -1141,10 +1195,10 @@ function PropertiesGroup({
|
|
|
1141
1195
|
}
|
|
1142
1196
|
|
|
1143
1197
|
// src/components/component-properties-panel/use-current-editable-item.ts
|
|
1144
|
-
import { useState as
|
|
1198
|
+
import { useState as useState3 } from "react";
|
|
1145
1199
|
import { setDocumentModifiedStatus } from "@elementor/editor-documents";
|
|
1146
1200
|
import { useEditable } from "@elementor/editor-ui";
|
|
1147
|
-
import { __ as
|
|
1201
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
1148
1202
|
|
|
1149
1203
|
// src/store/actions/rename-overridable-group.ts
|
|
1150
1204
|
import { __dispatch as dispatch7, __getState as getState8 } from "@elementor/store";
|
|
@@ -1171,10 +1225,10 @@ function renameOverridableGroup({ componentId, groupId, label }) {
|
|
|
1171
1225
|
}
|
|
1172
1226
|
|
|
1173
1227
|
// src/components/component-properties-panel/utils/validate-group-label.ts
|
|
1174
|
-
import { __ as
|
|
1228
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
1175
1229
|
var ERROR_MESSAGES = {
|
|
1176
|
-
EMPTY_NAME:
|
|
1177
|
-
DUPLICATE_NAME:
|
|
1230
|
+
EMPTY_NAME: __6("Group name is required", "elementor"),
|
|
1231
|
+
DUPLICATE_NAME: __6("Group name already exists", "elementor")
|
|
1178
1232
|
};
|
|
1179
1233
|
function validateGroupLabel(label, existingGroups) {
|
|
1180
1234
|
const trimmedLabel = label.trim();
|
|
@@ -1190,7 +1244,7 @@ function validateGroupLabel(label, existingGroups) {
|
|
|
1190
1244
|
|
|
1191
1245
|
// src/components/component-properties-panel/use-current-editable-item.ts
|
|
1192
1246
|
function useCurrentEditableItem() {
|
|
1193
|
-
const [editingGroupId, setEditingGroupId] =
|
|
1247
|
+
const [editingGroupId, setEditingGroupId] = useState3(null);
|
|
1194
1248
|
const currentComponentId = useCurrentComponentId();
|
|
1195
1249
|
const overridableProps = useOverridableProps(currentComponentId);
|
|
1196
1250
|
const allGroupsRecord = overridableProps?.groups?.items ?? {};
|
|
@@ -1203,7 +1257,7 @@ function useCurrentEditableItem() {
|
|
|
1203
1257
|
};
|
|
1204
1258
|
const handleSubmit = (newLabel) => {
|
|
1205
1259
|
if (!editingGroupId || !currentComponentId) {
|
|
1206
|
-
throw new Error(
|
|
1260
|
+
throw new Error(__7("Group ID or component ID is missing", "elementor"));
|
|
1207
1261
|
}
|
|
1208
1262
|
renameOverridableGroup({
|
|
1209
1263
|
componentId: currentComponentId,
|
|
@@ -1256,7 +1310,8 @@ function generateUniqueLabel(groups) {
|
|
|
1256
1310
|
function ComponentPropertiesPanelContent({ onClose }) {
|
|
1257
1311
|
const currentComponentId = useCurrentComponentId();
|
|
1258
1312
|
const overridableProps = useOverridableProps(currentComponentId);
|
|
1259
|
-
const [isAddingGroup, setIsAddingGroup] =
|
|
1313
|
+
const [isAddingGroup, setIsAddingGroup] = useState4(false);
|
|
1314
|
+
const introductionRef = useRef(null);
|
|
1260
1315
|
const groupLabelEditable = useCurrentEditableItem();
|
|
1261
1316
|
const groups = useMemo(() => {
|
|
1262
1317
|
if (!overridableProps) {
|
|
@@ -1310,15 +1365,24 @@ function ComponentPropertiesPanelContent({ onClose }) {
|
|
|
1310
1365
|
deleteOverridableGroup({ componentId: currentComponentId, groupId });
|
|
1311
1366
|
setDocumentModifiedStatus2(true);
|
|
1312
1367
|
};
|
|
1313
|
-
return /* @__PURE__ */
|
|
1368
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(PanelHeader, { sx: { justifyContent: "start", pl: 1.5, pr: 1, py: 1 } }, /* @__PURE__ */ React7.createElement(Stack5, { direction: "row", alignItems: "center", gap: 0.5, flexGrow: 1 }, /* @__PURE__ */ React7.createElement(ComponentPropListIcon2, { fontSize: "tiny" }), /* @__PURE__ */ React7.createElement(PanelHeaderTitle, { variant: "subtitle2" }, __8("Component properties", "elementor"))), !showEmptyState && /* @__PURE__ */ React7.createElement(Tooltip2, { title: __8("Add new group", "elementor") }, /* @__PURE__ */ React7.createElement(
|
|
1314
1369
|
IconButton3,
|
|
1315
1370
|
{
|
|
1316
1371
|
size: "tiny",
|
|
1317
|
-
"aria-label":
|
|
1372
|
+
"aria-label": __8("Add new group", "elementor"),
|
|
1318
1373
|
onClick: handleAddGroupClick
|
|
1319
1374
|
},
|
|
1320
|
-
/* @__PURE__ */
|
|
1321
|
-
)), /* @__PURE__ */
|
|
1375
|
+
/* @__PURE__ */ React7.createElement(FolderPlusIcon, { fontSize: "tiny" })
|
|
1376
|
+
)), /* @__PURE__ */ React7.createElement(Tooltip2, { title: __8("Close panel", "elementor") }, /* @__PURE__ */ React7.createElement(
|
|
1377
|
+
IconButton3,
|
|
1378
|
+
{
|
|
1379
|
+
ref: introductionRef,
|
|
1380
|
+
size: "tiny",
|
|
1381
|
+
"aria-label": __8("Close panel", "elementor"),
|
|
1382
|
+
onClick: onClose
|
|
1383
|
+
},
|
|
1384
|
+
/* @__PURE__ */ React7.createElement(XIcon2, { fontSize: "tiny" })
|
|
1385
|
+
))), /* @__PURE__ */ React7.createElement(Divider, null), /* @__PURE__ */ React7.createElement(PanelBody, null, showEmptyState ? /* @__PURE__ */ React7.createElement(PropertiesEmptyState, { introductionRef }) : /* @__PURE__ */ React7.createElement(List2, { sx: { p: 2, display: "flex", flexDirection: "column", gap: 2 } }, /* @__PURE__ */ React7.createElement(SortableProvider, { value: groupIds, onChange: handleGroupsReorder }, groups.map((group) => /* @__PURE__ */ React7.createElement(SortableItem, { key: group.id, id: group.id }, ({ triggerProps, triggerStyle, isDragPlaceholder }) => /* @__PURE__ */ React7.createElement(
|
|
1322
1386
|
PropertiesGroup,
|
|
1323
1387
|
{
|
|
1324
1388
|
group,
|
|
@@ -1350,7 +1414,7 @@ function ComponentPropertiesPanel() {
|
|
|
1350
1414
|
if (!element || !elementType) {
|
|
1351
1415
|
return null;
|
|
1352
1416
|
}
|
|
1353
|
-
return /* @__PURE__ */
|
|
1417
|
+
return /* @__PURE__ */ React8.createElement(ThemeProvider, null, /* @__PURE__ */ React8.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React8.createElement(ErrorBoundaryFallback, null) }, /* @__PURE__ */ React8.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React8.createElement(Panel, null, /* @__PURE__ */ React8.createElement(
|
|
1354
1418
|
ComponentPropertiesPanelContent,
|
|
1355
1419
|
{
|
|
1356
1420
|
onClose: () => {
|
|
@@ -1360,57 +1424,11 @@ function ComponentPropertiesPanel() {
|
|
|
1360
1424
|
}
|
|
1361
1425
|
)))));
|
|
1362
1426
|
}
|
|
1363
|
-
var ErrorBoundaryFallback = () => /* @__PURE__ */
|
|
1364
|
-
|
|
1365
|
-
// src/components/components-tab/component-introduction.tsx
|
|
1366
|
-
import * as React8 from "react";
|
|
1367
|
-
import { PopoverContent } from "@elementor/editor-controls";
|
|
1368
|
-
import { PopoverHeader } from "@elementor/editor-ui";
|
|
1369
|
-
import { Box as Box5, Button as Button2, Image, Popover as Popover2, Stack as Stack5, Typography as Typography5 } from "@elementor/ui";
|
|
1370
|
-
import { __ as __9 } from "@wordpress/i18n";
|
|
1371
|
-
var ComponentIntroduction = ({
|
|
1372
|
-
anchorRef,
|
|
1373
|
-
shouldShowIntroduction,
|
|
1374
|
-
onClose
|
|
1375
|
-
}) => {
|
|
1376
|
-
if (!anchorRef.current || !shouldShowIntroduction) {
|
|
1377
|
-
return null;
|
|
1378
|
-
}
|
|
1379
|
-
return /* @__PURE__ */ React8.createElement(
|
|
1380
|
-
Popover2,
|
|
1381
|
-
{
|
|
1382
|
-
anchorEl: anchorRef.current,
|
|
1383
|
-
open: shouldShowIntroduction,
|
|
1384
|
-
anchorOrigin: {
|
|
1385
|
-
vertical: "top",
|
|
1386
|
-
horizontal: "right"
|
|
1387
|
-
},
|
|
1388
|
-
transformOrigin: {
|
|
1389
|
-
vertical: "top",
|
|
1390
|
-
horizontal: -30
|
|
1391
|
-
},
|
|
1392
|
-
onClose
|
|
1393
|
-
},
|
|
1394
|
-
/* @__PURE__ */ React8.createElement(Box5, { sx: { width: "296px" } }, /* @__PURE__ */ React8.createElement(PopoverHeader, { title: __9("Add your first property", "elementor"), onClose }), /* @__PURE__ */ React8.createElement(
|
|
1395
|
-
Image,
|
|
1396
|
-
{
|
|
1397
|
-
sx: { width: "296px", height: "160px" },
|
|
1398
|
-
src: "https://assets.elementor.com/packages/v1/images/components-properties-intro.png",
|
|
1399
|
-
alt: ""
|
|
1400
|
-
}
|
|
1401
|
-
), /* @__PURE__ */ React8.createElement(PopoverContent, null, /* @__PURE__ */ React8.createElement(Stack5, { gap: 1, sx: { p: 2 } }, /* @__PURE__ */ React8.createElement(Typography5, { variant: "body2" }, __9("Properties make instances flexible.", "elementor")), /* @__PURE__ */ React8.createElement(Typography5, { variant: "body2" }, __9(
|
|
1402
|
-
"Click next to any setting you want users to customize - like text, images, or links.",
|
|
1403
|
-
"elementor"
|
|
1404
|
-
)), /* @__PURE__ */ React8.createElement(Typography5, { variant: "body2" }, __9(
|
|
1405
|
-
"Your properties will appear in the Properties panel, where you can organize and manage them anytime.",
|
|
1406
|
-
"elementor"
|
|
1407
|
-
)), /* @__PURE__ */ React8.createElement(Stack5, { direction: "row", alignItems: "center", justifyContent: "flex-end" }, /* @__PURE__ */ React8.createElement(Button2, { size: "medium", variant: "contained", onClick: onClose }, __9("Got it", "elementor"))))))
|
|
1408
|
-
);
|
|
1409
|
-
};
|
|
1427
|
+
var ErrorBoundaryFallback = () => /* @__PURE__ */ React8.createElement(Box5, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React8.createElement(Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React8.createElement("strong", null, __9("Something went wrong", "elementor"))));
|
|
1410
1428
|
|
|
1411
1429
|
// src/components/component-panel-header/component-badge.tsx
|
|
1412
1430
|
import * as React9 from "react";
|
|
1413
|
-
import { useEffect, useRef } from "react";
|
|
1431
|
+
import { useEffect, useRef as useRef2 } from "react";
|
|
1414
1432
|
import { ComponentPropListIcon as ComponentPropListIcon3 } from "@elementor/icons";
|
|
1415
1433
|
import { Badge, Box as Box6, keyframes, styled as styled2, ToggleButton } from "@elementor/ui";
|
|
1416
1434
|
import { __ as __10 } from "@wordpress/i18n";
|
|
@@ -1455,7 +1473,7 @@ var StyledBadge = styled2(Badge, { shouldForwardProp: (prop) => prop !== "animat
|
|
|
1455
1473
|
})
|
|
1456
1474
|
);
|
|
1457
1475
|
function usePrevious(value) {
|
|
1458
|
-
const ref =
|
|
1476
|
+
const ref = useRef2(value);
|
|
1459
1477
|
useEffect(() => {
|
|
1460
1478
|
ref.current = value;
|
|
1461
1479
|
}, [value]);
|
|
@@ -2235,7 +2253,7 @@ var COMPONENT_DOCUMENT_TYPE = "elementor_component";
|
|
|
2235
2253
|
|
|
2236
2254
|
// src/components/create-component-form/create-component-form.tsx
|
|
2237
2255
|
import * as React17 from "react";
|
|
2238
|
-
import { useEffect as useEffect2, useMemo as useMemo3, useRef as
|
|
2256
|
+
import { useEffect as useEffect2, useMemo as useMemo3, useRef as useRef4, useState as useState7 } from "react";
|
|
2239
2257
|
import { getElementLabel } from "@elementor/editor-elements";
|
|
2240
2258
|
import { Form as FormElement, ThemeProvider as ThemeProvider3 } from "@elementor/editor-ui";
|
|
2241
2259
|
import { StarIcon } from "@elementor/icons";
|
|
@@ -2268,10 +2286,10 @@ function createUnpublishedComponent(name, element, eventData, overridableProps,
|
|
|
2268
2286
|
}
|
|
2269
2287
|
|
|
2270
2288
|
// src/components/create-component-form/hooks/use-form.ts
|
|
2271
|
-
import { useMemo as useMemo2, useState as
|
|
2289
|
+
import { useMemo as useMemo2, useState as useState6 } from "react";
|
|
2272
2290
|
var useForm = (initialValues) => {
|
|
2273
|
-
const [values, setValues] =
|
|
2274
|
-
const [errors, setErrors] =
|
|
2291
|
+
const [values, setValues] = useState6(initialValues);
|
|
2292
|
+
const [errors, setErrors] = useState6({});
|
|
2275
2293
|
const isValid = useMemo2(() => {
|
|
2276
2294
|
return !Object.values(errors).some((error) => error);
|
|
2277
2295
|
}, [errors]);
|
|
@@ -2373,10 +2391,10 @@ function countNestedElements(container) {
|
|
|
2373
2391
|
|
|
2374
2392
|
// src/components/create-component-form/create-component-form.tsx
|
|
2375
2393
|
function CreateComponentForm() {
|
|
2376
|
-
const [element, setElement] =
|
|
2377
|
-
const [anchorPosition, setAnchorPosition] =
|
|
2378
|
-
const [resultNotification, setResultNotification] =
|
|
2379
|
-
const eventData =
|
|
2394
|
+
const [element, setElement] = useState7(null);
|
|
2395
|
+
const [anchorPosition, setAnchorPosition] = useState7();
|
|
2396
|
+
const [resultNotification, setResultNotification] = useState7(null);
|
|
2397
|
+
const eventData = useRef4(null);
|
|
2380
2398
|
useEffect2(() => {
|
|
2381
2399
|
const OPEN_SAVE_AS_COMPONENT_FORM_EVENT = "elementor/editor/open-save-as-component-form";
|
|
2382
2400
|
const openPopup = (event) => {
|
|
@@ -2547,10 +2565,10 @@ function useCanvasDocument() {
|
|
|
2547
2565
|
}
|
|
2548
2566
|
|
|
2549
2567
|
// src/hooks/use-element-rect.ts
|
|
2550
|
-
import { useEffect as useEffect3, useState as
|
|
2568
|
+
import { useEffect as useEffect3, useState as useState8 } from "react";
|
|
2551
2569
|
import { throttle } from "@elementor/utils";
|
|
2552
2570
|
function useElementRect(element) {
|
|
2553
|
-
const [rect, setRect] =
|
|
2571
|
+
const [rect, setRect] = useState8(new DOMRect(0, 0, 0, 0));
|
|
2554
2572
|
const onChange = throttle(
|
|
2555
2573
|
() => {
|
|
2556
2574
|
setRect(element?.getBoundingClientRect() ?? new DOMRect(0, 0, 0, 0));
|