@elementor/editor-components 3.35.0-346 → 3.35.0-348
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 +33 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +58 -32
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -21
- package/src/components/components-tab/components-item.tsx +32 -13
package/dist/index.mjs
CHANGED
|
@@ -458,7 +458,7 @@ var ComponentSearch = () => {
|
|
|
458
458
|
// src/components/components-tab/components-list.tsx
|
|
459
459
|
import * as React7 from "react";
|
|
460
460
|
import { ComponentsIcon as ComponentsIcon2, EyeIcon } from "@elementor/icons";
|
|
461
|
-
import { Box as Box6, Divider as Divider2, Icon, Link, List, Stack as
|
|
461
|
+
import { Box as Box6, Divider as Divider2, Icon, Link, List, Stack as Stack5, Typography as Typography3 } from "@elementor/ui";
|
|
462
462
|
import { __ as __6 } from "@wordpress/i18n";
|
|
463
463
|
|
|
464
464
|
// src/hooks/use-components.ts
|
|
@@ -473,7 +473,7 @@ var useComponents = () => {
|
|
|
473
473
|
import * as React5 from "react";
|
|
474
474
|
import { endDragElementFromPanel, startDragElementFromPanel } from "@elementor/editor-canvas";
|
|
475
475
|
import { dropElement } from "@elementor/editor-elements";
|
|
476
|
-
import { MenuListItem } from "@elementor/editor-ui";
|
|
476
|
+
import { EllipsisWithTooltip, MenuListItem } from "@elementor/editor-ui";
|
|
477
477
|
import { ComponentsIcon, DotsVerticalIcon } from "@elementor/icons";
|
|
478
478
|
import {
|
|
479
479
|
bindMenu,
|
|
@@ -482,8 +482,8 @@ import {
|
|
|
482
482
|
IconButton as IconButton2,
|
|
483
483
|
ListItemButton,
|
|
484
484
|
ListItemIcon,
|
|
485
|
-
ListItemText,
|
|
486
485
|
Menu,
|
|
486
|
+
Stack as Stack3,
|
|
487
487
|
Typography as Typography2,
|
|
488
488
|
usePopupState
|
|
489
489
|
} from "@elementor/ui";
|
|
@@ -889,21 +889,47 @@ var ComponentItem = ({ component }) => {
|
|
|
889
889
|
}
|
|
890
890
|
archiveComponent(component.id);
|
|
891
891
|
};
|
|
892
|
-
return /* @__PURE__ */ React5.createElement(
|
|
892
|
+
return /* @__PURE__ */ React5.createElement(Stack3, null, /* @__PURE__ */ React5.createElement(
|
|
893
893
|
ListItemButton,
|
|
894
894
|
{
|
|
895
895
|
draggable: true,
|
|
896
896
|
onDragStart: () => startDragElementFromPanel(componentModel),
|
|
897
897
|
onDragEnd: handleDragEnd,
|
|
898
898
|
shape: "rounded",
|
|
899
|
-
sx: {
|
|
899
|
+
sx: {
|
|
900
|
+
border: "solid 1px",
|
|
901
|
+
borderColor: "divider",
|
|
902
|
+
py: 0.5,
|
|
903
|
+
px: 1,
|
|
904
|
+
display: "flex",
|
|
905
|
+
width: "100%",
|
|
906
|
+
alignItems: "center",
|
|
907
|
+
gap: 1
|
|
908
|
+
}
|
|
900
909
|
},
|
|
901
|
-
/* @__PURE__ */ React5.createElement(
|
|
902
|
-
|
|
910
|
+
/* @__PURE__ */ React5.createElement(
|
|
911
|
+
Box4,
|
|
903
912
|
{
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
913
|
+
onClick: handleClick,
|
|
914
|
+
sx: {
|
|
915
|
+
display: "flex",
|
|
916
|
+
alignItems: "center",
|
|
917
|
+
gap: 1,
|
|
918
|
+
minWidth: 0,
|
|
919
|
+
flexGrow: 1
|
|
920
|
+
}
|
|
921
|
+
},
|
|
922
|
+
/* @__PURE__ */ React5.createElement(ListItemIcon, { size: "tiny" }, /* @__PURE__ */ React5.createElement(ComponentsIcon, { fontSize: "tiny" })),
|
|
923
|
+
/* @__PURE__ */ React5.createElement(Box4, { display: "flex", flex: 1, minWidth: 0, flexGrow: 1 }, /* @__PURE__ */ React5.createElement(
|
|
924
|
+
EllipsisWithTooltip,
|
|
925
|
+
{
|
|
926
|
+
title: component.name,
|
|
927
|
+
as: Typography2,
|
|
928
|
+
variant: "caption",
|
|
929
|
+
color: "text.primary"
|
|
930
|
+
}
|
|
931
|
+
))
|
|
932
|
+
),
|
|
907
933
|
/* @__PURE__ */ React5.createElement(IconButton2, { size: "tiny", ...bindTrigger(popupState), "aria-label": "More actions" }, /* @__PURE__ */ React5.createElement(DotsVerticalIcon, { fontSize: "tiny" }))
|
|
908
934
|
), /* @__PURE__ */ React5.createElement(
|
|
909
935
|
Menu,
|
|
@@ -936,12 +962,12 @@ var addComponentToPage = (model) => {
|
|
|
936
962
|
|
|
937
963
|
// src/components/components-tab/loading-components.tsx
|
|
938
964
|
import * as React6 from "react";
|
|
939
|
-
import { Box as Box5, ListItemButton as ListItemButton2, Skeleton, Stack as
|
|
965
|
+
import { Box as Box5, ListItemButton as ListItemButton2, Skeleton, Stack as Stack4 } from "@elementor/ui";
|
|
940
966
|
var ROWS_COUNT = 6;
|
|
941
967
|
var rows = Array.from({ length: ROWS_COUNT }, (_, index) => index);
|
|
942
968
|
var LoadingComponents = () => {
|
|
943
969
|
return /* @__PURE__ */ React6.createElement(
|
|
944
|
-
|
|
970
|
+
Stack4,
|
|
945
971
|
{
|
|
946
972
|
"aria-label": "Loading components",
|
|
947
973
|
gap: 1,
|
|
@@ -991,7 +1017,7 @@ function ComponentsList() {
|
|
|
991
1017
|
}
|
|
992
1018
|
var EmptyState = () => {
|
|
993
1019
|
return /* @__PURE__ */ React7.createElement(
|
|
994
|
-
|
|
1020
|
+
Stack5,
|
|
995
1021
|
{
|
|
996
1022
|
alignItems: "center",
|
|
997
1023
|
justifyContent: "center",
|
|
@@ -1025,7 +1051,7 @@ var EmptyState = () => {
|
|
|
1025
1051
|
var EmptySearchResult = () => {
|
|
1026
1052
|
const { searchValue, clearSearch } = useSearch();
|
|
1027
1053
|
return /* @__PURE__ */ React7.createElement(
|
|
1028
|
-
|
|
1054
|
+
Stack5,
|
|
1029
1055
|
{
|
|
1030
1056
|
color: "text.secondary",
|
|
1031
1057
|
pt: 5,
|
|
@@ -1099,7 +1125,7 @@ import { useEffect as useEffect2, useMemo as useMemo2, useRef as useRef2, useSta
|
|
|
1099
1125
|
import { getElementLabel } from "@elementor/editor-elements";
|
|
1100
1126
|
import { Form as FormElement, ThemeProvider as ThemeProvider2 } from "@elementor/editor-ui";
|
|
1101
1127
|
import { StarIcon } from "@elementor/icons";
|
|
1102
|
-
import { Alert, Button, FormLabel, Grid, Popover, Snackbar, Stack as
|
|
1128
|
+
import { Alert, Button, FormLabel, Grid, Popover, Snackbar, Stack as Stack6, TextField as TextField2, Typography as Typography4 } from "@elementor/ui";
|
|
1103
1129
|
import { __ as __8 } from "@wordpress/i18n";
|
|
1104
1130
|
|
|
1105
1131
|
// src/store/actions/create-unpublished-component.ts
|
|
@@ -1344,8 +1370,8 @@ var Form = ({
|
|
|
1344
1370
|
create: __8("Create", "elementor")
|
|
1345
1371
|
};
|
|
1346
1372
|
const nameInputId = "component-name";
|
|
1347
|
-
return /* @__PURE__ */ React9.createElement(FormElement, { onSubmit: handleSubmit }, /* @__PURE__ */ React9.createElement(
|
|
1348
|
-
|
|
1373
|
+
return /* @__PURE__ */ React9.createElement(FormElement, { onSubmit: handleSubmit }, /* @__PURE__ */ React9.createElement(Stack6, { alignItems: "start", width: "268px" }, /* @__PURE__ */ React9.createElement(
|
|
1374
|
+
Stack6,
|
|
1349
1375
|
{
|
|
1350
1376
|
direction: "row",
|
|
1351
1377
|
alignItems: "center",
|
|
@@ -1367,7 +1393,7 @@ var Form = ({
|
|
|
1367
1393
|
error: Boolean(errors.componentName),
|
|
1368
1394
|
helperText: errors.componentName
|
|
1369
1395
|
}
|
|
1370
|
-
))), /* @__PURE__ */ React9.createElement(
|
|
1396
|
+
))), /* @__PURE__ */ React9.createElement(Stack6, { direction: "row", justifyContent: "flex-end", alignSelf: "end", py: 1, px: 1.5 }, /* @__PURE__ */ React9.createElement(Button, { onClick: closePopup, color: "secondary", variant: "text", size: "small" }, texts.cancel), /* @__PURE__ */ React9.createElement(Button, { type: "submit", disabled: !isValid, variant: "contained", color: "primary", size: "small" }, texts.create))));
|
|
1371
1397
|
};
|
|
1372
1398
|
|
|
1373
1399
|
// src/components/edit-component/edit-component.tsx
|
|
@@ -1636,7 +1662,7 @@ function getComponentDOMElement(id) {
|
|
|
1636
1662
|
import * as React12 from "react";
|
|
1637
1663
|
import { closeDialog, openDialog } from "@elementor/editor-ui";
|
|
1638
1664
|
import { InfoCircleFilledIcon } from "@elementor/icons";
|
|
1639
|
-
import { Box as Box7, Button as Button2, DialogActions, DialogContent, DialogHeader, Icon as Icon2, Stack as
|
|
1665
|
+
import { Box as Box7, Button as Button2, DialogActions, DialogContent, DialogHeader, Icon as Icon2, Stack as Stack7, Typography as Typography5 } from "@elementor/ui";
|
|
1640
1666
|
import { __ as __10 } from "@wordpress/i18n";
|
|
1641
1667
|
var openEditModeDialog = (lockedBy) => {
|
|
1642
1668
|
openDialog({
|
|
@@ -1645,7 +1671,7 @@ var openEditModeDialog = (lockedBy) => {
|
|
|
1645
1671
|
};
|
|
1646
1672
|
var EditModeDialog = ({ lockedBy }) => {
|
|
1647
1673
|
const content = __10("%s is currently editing this document", "elementor").replace("%s", lockedBy);
|
|
1648
|
-
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React12.createElement(Box7, { display: "flex", alignItems: "center", gap: 1 }, /* @__PURE__ */ React12.createElement(Icon2, { color: "secondary" }, /* @__PURE__ */ React12.createElement(InfoCircleFilledIcon, { fontSize: "medium" })), /* @__PURE__ */ React12.createElement(Typography5, { variant: "subtitle1" }, content))), /* @__PURE__ */ React12.createElement(DialogContent, null, /* @__PURE__ */ React12.createElement(
|
|
1674
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React12.createElement(Box7, { display: "flex", alignItems: "center", gap: 1 }, /* @__PURE__ */ React12.createElement(Icon2, { color: "secondary" }, /* @__PURE__ */ React12.createElement(InfoCircleFilledIcon, { fontSize: "medium" })), /* @__PURE__ */ React12.createElement(Typography5, { variant: "subtitle1" }, content))), /* @__PURE__ */ React12.createElement(DialogContent, null, /* @__PURE__ */ React12.createElement(Stack7, { spacing: 2, direction: "column" }, /* @__PURE__ */ React12.createElement(Typography5, { variant: "body2" }, __10(
|
|
1649
1675
|
"You can wait for them to finish or reach out to coordinate your changes together.",
|
|
1650
1676
|
"elementor"
|
|
1651
1677
|
)), /* @__PURE__ */ React12.createElement(DialogActions, null, /* @__PURE__ */ React12.createElement(Button2, { color: "secondary", variant: "contained", onClick: closeDialog }, __10("Close", "elementor"))))));
|
|
@@ -1658,7 +1684,7 @@ import { useElementSetting, useSelectedElement } from "@elementor/editor-element
|
|
|
1658
1684
|
import { PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
1659
1685
|
import { ComponentsIcon as ComponentsIcon3, PencilIcon as PencilIcon2 } from "@elementor/icons";
|
|
1660
1686
|
import { __getState as getState5 } from "@elementor/store";
|
|
1661
|
-
import { IconButton as IconButton3, Stack as
|
|
1687
|
+
import { IconButton as IconButton3, Stack as Stack10, Tooltip as Tooltip2 } from "@elementor/ui";
|
|
1662
1688
|
import { __ as __12 } from "@wordpress/i18n";
|
|
1663
1689
|
|
|
1664
1690
|
// src/prop-types/component-instance-prop-type.ts
|
|
@@ -1702,11 +1728,11 @@ var componentInstancePropTypeUtil = createPropUtils3(
|
|
|
1702
1728
|
// src/components/instance-editing-panel/empty-state.tsx
|
|
1703
1729
|
import * as React13 from "react";
|
|
1704
1730
|
import { ComponentPropListIcon as ComponentPropListIcon2, PencilIcon } from "@elementor/icons";
|
|
1705
|
-
import { Button as Button3, Stack as
|
|
1731
|
+
import { Button as Button3, Stack as Stack8, Typography as Typography6 } from "@elementor/ui";
|
|
1706
1732
|
import { __ as __11 } from "@wordpress/i18n";
|
|
1707
1733
|
var EmptyState2 = ({ onEditComponent }) => {
|
|
1708
1734
|
return /* @__PURE__ */ React13.createElement(
|
|
1709
|
-
|
|
1735
|
+
Stack8,
|
|
1710
1736
|
{
|
|
1711
1737
|
alignItems: "center",
|
|
1712
1738
|
justifyContent: "start",
|
|
@@ -1730,7 +1756,7 @@ import * as React14 from "react";
|
|
|
1730
1756
|
import { useId } from "react";
|
|
1731
1757
|
import { useStateByElement } from "@elementor/editor-editing-panel";
|
|
1732
1758
|
import { CollapseIcon } from "@elementor/editor-ui";
|
|
1733
|
-
import { Collapse, ListItemButton as ListItemButton3, ListItemText
|
|
1759
|
+
import { Collapse, ListItemButton as ListItemButton3, ListItemText, Stack as Stack9 } from "@elementor/ui";
|
|
1734
1760
|
function OverridePropsGroup({ group, props }) {
|
|
1735
1761
|
const [isOpen, setIsOpen] = useStateByElement(group.id, true);
|
|
1736
1762
|
const handleClick = () => {
|
|
@@ -1750,8 +1776,8 @@ function OverridePropsGroup({ group, props }) {
|
|
|
1750
1776
|
p: 0,
|
|
1751
1777
|
sx: { "&:hover": { backgroundColor: "transparent" } }
|
|
1752
1778
|
},
|
|
1753
|
-
/* @__PURE__ */ React14.createElement(
|
|
1754
|
-
|
|
1779
|
+
/* @__PURE__ */ React14.createElement(Stack9, { direction: "row", alignItems: "center", justifyItems: "start", flexGrow: 1, gap: 0.5 }, /* @__PURE__ */ React14.createElement(
|
|
1780
|
+
ListItemText,
|
|
1755
1781
|
{
|
|
1756
1782
|
secondary: title,
|
|
1757
1783
|
secondaryTypographyProps: { color: "text.primary", variant: "caption", fontWeight: "bold" },
|
|
@@ -1759,7 +1785,7 @@ function OverridePropsGroup({ group, props }) {
|
|
|
1759
1785
|
}
|
|
1760
1786
|
)),
|
|
1761
1787
|
/* @__PURE__ */ React14.createElement(CollapseIcon, { open: isOpen, color: "secondary", fontSize: "tiny" })
|
|
1762
|
-
), /* @__PURE__ */ React14.createElement(Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto" }, /* @__PURE__ */ React14.createElement(
|
|
1788
|
+
), /* @__PURE__ */ React14.createElement(Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto" }, /* @__PURE__ */ React14.createElement(Stack9, { direction: "column", gap: 1, p: 2 }, group.props.map((propId) => (
|
|
1763
1789
|
// TODO: Render actual controls
|
|
1764
1790
|
/* @__PURE__ */ React14.createElement("pre", { key: propId }, JSON.stringify(props[propId], null, 2))
|
|
1765
1791
|
)))));
|
|
@@ -1782,7 +1808,7 @@ function InstanceEditingPanel() {
|
|
|
1782
1808
|
(groupId) => overridableProps.groups.items[groupId] ? overridableProps.groups.items[groupId] : null
|
|
1783
1809
|
).filter(Boolean);
|
|
1784
1810
|
const isEmpty = groups.length === 0 || Object.keys(overridableProps.props).length === 0;
|
|
1785
|
-
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(PanelHeader, { sx: { justifyContent: "start" } }, /* @__PURE__ */ React15.createElement(
|
|
1811
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(PanelHeader, { sx: { justifyContent: "start" } }, /* @__PURE__ */ React15.createElement(Stack10, { direction: "row", alignContent: "space-between", flexGrow: 1 }, /* @__PURE__ */ React15.createElement(Stack10, { direction: "row", alignItems: "center", justifyContent: "start", gap: 1, flexGrow: 1 }, /* @__PURE__ */ React15.createElement(ComponentsIcon3, { fontSize: "small", sx: { color: "text.tertiary" } }), /* @__PURE__ */ React15.createElement(PanelHeaderTitle, null, component.name)), /* @__PURE__ */ React15.createElement(Tooltip2, { title: panelTitle }, /* @__PURE__ */ React15.createElement(IconButton3, { size: "tiny", onClick: handleEditComponent, "aria-label": panelTitle }, /* @__PURE__ */ React15.createElement(PencilIcon2, { fontSize: "tiny" }))))), /* @__PURE__ */ React15.createElement(PanelBody, null, isEmpty ? /* @__PURE__ */ React15.createElement(EmptyState2, { onEditComponent: handleEditComponent }) : /* @__PURE__ */ React15.createElement(Stack10, { direction: "column", alignItems: "stretch" }, groups.map((group) => /* @__PURE__ */ React15.createElement(OverridePropsGroup, { key: group.id, group, props: overridableProps.props })))));
|
|
1786
1812
|
}
|
|
1787
1813
|
|
|
1788
1814
|
// src/components/overridable-props/overridable-prop-control.tsx
|
|
@@ -2109,7 +2135,7 @@ var Indicator = forwardRef(({ isOpen, isOverridable, ...props }, ref) => /* @__P
|
|
|
2109
2135
|
import * as React19 from "react";
|
|
2110
2136
|
import { useState as useState4 } from "react";
|
|
2111
2137
|
import { Form as Form2, MenuListItem as MenuListItem2 } from "@elementor/editor-ui";
|
|
2112
|
-
import { Button as Button4, FormLabel as FormLabel2, Grid as Grid2, Select, Stack as
|
|
2138
|
+
import { Button as Button4, FormLabel as FormLabel2, Grid as Grid2, Select, Stack as Stack11, TextField as TextField3, Typography as Typography7 } from "@elementor/ui";
|
|
2113
2139
|
import { __ as __15 } from "@wordpress/i18n";
|
|
2114
2140
|
var SIZE2 = "tiny";
|
|
2115
2141
|
var DEFAULT_GROUP = { value: null, label: __15("Default", "elementor") };
|
|
@@ -2121,8 +2147,8 @@ function OverridablePropForm({ onSubmit, groups, currentValue }) {
|
|
|
2121
2147
|
const isCreate = currentValue === void 0;
|
|
2122
2148
|
const title = isCreate ? __15("Create new property", "elementor") : __15("Update property", "elementor");
|
|
2123
2149
|
const ctaLabel = isCreate ? __15("Create", "elementor") : __15("Update", "elementor");
|
|
2124
|
-
return /* @__PURE__ */ React19.createElement(Form2, { onSubmit: () => onSubmit({ label: propLabel ?? "", group }) }, /* @__PURE__ */ React19.createElement(
|
|
2125
|
-
|
|
2150
|
+
return /* @__PURE__ */ React19.createElement(Form2, { onSubmit: () => onSubmit({ label: propLabel ?? "", group }) }, /* @__PURE__ */ React19.createElement(Stack11, { alignItems: "start", width: "268px" }, /* @__PURE__ */ React19.createElement(
|
|
2151
|
+
Stack11,
|
|
2126
2152
|
{
|
|
2127
2153
|
direction: "row",
|
|
2128
2154
|
alignItems: "center",
|
|
@@ -2159,7 +2185,7 @@ function OverridablePropForm({ onSubmit, groups, currentValue }) {
|
|
|
2159
2185
|
}
|
|
2160
2186
|
},
|
|
2161
2187
|
(groups ?? [DEFAULT_GROUP]).map(({ label: groupLabel, ...props }) => /* @__PURE__ */ React19.createElement(MenuListItem2, { key: props.value, ...props, value: props.value ?? "" }, groupLabel))
|
|
2162
|
-
))), /* @__PURE__ */ React19.createElement(
|
|
2188
|
+
))), /* @__PURE__ */ React19.createElement(Stack11, { direction: "row", justifyContent: "flex-end", alignSelf: "end", mt: 1.5, py: 1, px: 1.5 }, /* @__PURE__ */ React19.createElement(Button4, { type: "submit", disabled: !propLabel, variant: "contained", color: "primary", size: "small" }, ctaLabel))));
|
|
2163
2189
|
}
|
|
2164
2190
|
|
|
2165
2191
|
// src/components/overridable-props/utils/get-overridable-prop.ts
|