@elementor/editor-editing-panel 1.32.0 → 1.33.1
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 +23 -0
- package/dist/index.js +165 -166
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/components/settings-tab.tsx +7 -3
- package/src/components/style-sections/position-section/position-section.tsx +9 -2
- package/src/controls-registry/control-type-container.tsx +2 -8
- package/src/controls-registry/control.tsx +2 -2
- package/src/controls-registry/controls-registry.tsx +3 -4
- package/src/dynamics/components/dynamic-selection-control.tsx +2 -2
- package/src/sync/types.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -962,7 +962,7 @@ function EditorPanelErrorFallback() {
|
|
|
962
962
|
// src/components/editing-panel-tabs.tsx
|
|
963
963
|
import * as React69 from "react";
|
|
964
964
|
import { Fragment as Fragment8 } from "react";
|
|
965
|
-
import { Divider as
|
|
965
|
+
import { Divider as Divider6, Stack as Stack17, Tab, TabPanel, Tabs, useTabs } from "@elementor/ui";
|
|
966
966
|
import { __ as __45 } from "@wordpress/i18n";
|
|
967
967
|
|
|
968
968
|
// src/contexts/scroll-context.tsx
|
|
@@ -1008,6 +1008,7 @@ function useScrollDirection() {
|
|
|
1008
1008
|
import * as React16 from "react";
|
|
1009
1009
|
import { ControlFormLabel } from "@elementor/editor-controls";
|
|
1010
1010
|
import { SessionStorageProvider } from "@elementor/session";
|
|
1011
|
+
import { Divider as Divider3 } from "@elementor/ui";
|
|
1011
1012
|
|
|
1012
1013
|
// src/controls-registry/control.tsx
|
|
1013
1014
|
import * as React11 from "react";
|
|
@@ -1033,12 +1034,12 @@ var controlTypes = {
|
|
|
1033
1034
|
link: { component: LinkControl, layout: "full" },
|
|
1034
1035
|
url: { component: UrlControl, layout: "full" }
|
|
1035
1036
|
};
|
|
1036
|
-
var
|
|
1037
|
-
var
|
|
1037
|
+
var getControl = (type) => controlTypes[type]?.component;
|
|
1038
|
+
var getDefaultLayout = (type) => controlTypes[type].layout;
|
|
1038
1039
|
|
|
1039
1040
|
// src/controls-registry/control.tsx
|
|
1040
1041
|
var Control = ({ props, type }) => {
|
|
1041
|
-
const ControlByType =
|
|
1042
|
+
const ControlByType = getControl(type);
|
|
1042
1043
|
const { element } = useElement();
|
|
1043
1044
|
if (!ControlByType) {
|
|
1044
1045
|
throw new ControlTypeNotFoundError({
|
|
@@ -1051,11 +1052,7 @@ var Control = ({ props, type }) => {
|
|
|
1051
1052
|
// src/controls-registry/control-type-container.tsx
|
|
1052
1053
|
import * as React12 from "react";
|
|
1053
1054
|
import { Box as Box3, styled as styled4 } from "@elementor/ui";
|
|
1054
|
-
var ControlTypeContainer = ({
|
|
1055
|
-
controlType,
|
|
1056
|
-
children
|
|
1057
|
-
}) => {
|
|
1058
|
-
const layout = getLayoutByType(controlType);
|
|
1055
|
+
var ControlTypeContainer = ({ children, layout }) => {
|
|
1059
1056
|
return /* @__PURE__ */ React12.createElement(StyledContainer, { layout }, children);
|
|
1060
1057
|
};
|
|
1061
1058
|
var StyledContainer = styled4(Box3, {
|
|
@@ -1174,10 +1171,11 @@ var SettingsTab = () => {
|
|
|
1174
1171
|
})));
|
|
1175
1172
|
};
|
|
1176
1173
|
var Control2 = ({ control }) => {
|
|
1177
|
-
if (!
|
|
1174
|
+
if (!getControl(control.type)) {
|
|
1178
1175
|
return null;
|
|
1179
1176
|
}
|
|
1180
|
-
|
|
1177
|
+
const layout = control.meta?.layout || getDefaultLayout(control.type);
|
|
1178
|
+
return /* @__PURE__ */ React16.createElement(SettingsField, { bind: control.bind }, control.meta?.topDivider && /* @__PURE__ */ React16.createElement(Divider3, null), /* @__PURE__ */ React16.createElement(ControlTypeContainer, { layout }, control.label ? /* @__PURE__ */ React16.createElement(ControlFormLabel, null, control.label) : null, /* @__PURE__ */ React16.createElement(Control, { type: control.type, props: control.props })));
|
|
1181
1179
|
};
|
|
1182
1180
|
|
|
1183
1181
|
// src/components/style-tab.tsx
|
|
@@ -1186,7 +1184,7 @@ import { useState as useState12 } from "react";
|
|
|
1186
1184
|
import { CLASSES_PROP_KEY } from "@elementor/editor-props";
|
|
1187
1185
|
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
1188
1186
|
import { SessionStorageProvider as SessionStorageProvider2 } from "@elementor/session";
|
|
1189
|
-
import { Divider as
|
|
1187
|
+
import { Divider as Divider5, Stack as Stack16 } from "@elementor/ui";
|
|
1190
1188
|
import { __ as __44 } from "@wordpress/i18n";
|
|
1191
1189
|
|
|
1192
1190
|
// src/contexts/styles-inheritance-context.tsx
|
|
@@ -1758,8 +1756,8 @@ import * as React31 from "react";
|
|
|
1758
1756
|
|
|
1759
1757
|
// src/components/panel-divider.tsx
|
|
1760
1758
|
import * as React22 from "react";
|
|
1761
|
-
import { Divider as
|
|
1762
|
-
var PanelDivider = () => /* @__PURE__ */ React22.createElement(
|
|
1759
|
+
import { Divider as Divider4 } from "@elementor/ui";
|
|
1760
|
+
var PanelDivider = () => /* @__PURE__ */ React22.createElement(Divider4, { sx: { my: 0.5 } });
|
|
1763
1761
|
|
|
1764
1762
|
// src/components/section-content.tsx
|
|
1765
1763
|
import * as React23 from "react";
|
|
@@ -2704,6 +2702,7 @@ var PositionSection = () => {
|
|
|
2704
2702
|
"inset-inline-end"
|
|
2705
2703
|
]);
|
|
2706
2704
|
const [dimensionsValuesFromHistory, updateDimensionsHistory, clearDimensionsHistory] = usePersistDimensions();
|
|
2705
|
+
const { e_css_id: eCssId } = getExperimentsConfig();
|
|
2707
2706
|
const onPositionChange = (newPosition, previousPosition) => {
|
|
2708
2707
|
if (newPosition === "static") {
|
|
2709
2708
|
if (dimensionsValues) {
|
|
@@ -2723,7 +2722,7 @@ var PositionSection = () => {
|
|
|
2723
2722
|
}
|
|
2724
2723
|
};
|
|
2725
2724
|
const isNotStatic = positionValue && positionValue?.value !== "static";
|
|
2726
|
-
return /* @__PURE__ */ React49.createElement(SectionContent, null, /* @__PURE__ */ React49.createElement(PositionField, { onChange: onPositionChange }), isNotStatic ? /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(DimensionsField, null), /* @__PURE__ */ React49.createElement(ZIndexField, null)) : null, /* @__PURE__ */ React49.createElement(PanelDivider, null), /* @__PURE__ */ React49.createElement(OffsetField, null));
|
|
2725
|
+
return /* @__PURE__ */ React49.createElement(SectionContent, null, /* @__PURE__ */ React49.createElement(PositionField, { onChange: onPositionChange }), isNotStatic ? /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(DimensionsField, null), /* @__PURE__ */ React49.createElement(ZIndexField, null)) : null, eCssId && /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(PanelDivider, null), /* @__PURE__ */ React49.createElement(OffsetField, null)));
|
|
2727
2726
|
};
|
|
2728
2727
|
var usePersistDimensions = () => {
|
|
2729
2728
|
const { id: styleDefID, meta } = useStyle();
|
|
@@ -3183,7 +3182,7 @@ var StyleTab = () => {
|
|
|
3183
3182
|
},
|
|
3184
3183
|
setMetaState: setActiveStyleState
|
|
3185
3184
|
},
|
|
3186
|
-
/* @__PURE__ */ React68.createElement(SessionStorageProvider2, { prefix: activeStyleDefId ?? "" }, /* @__PURE__ */ React68.createElement(StyleInheritanceProvider, null, /* @__PURE__ */ React68.createElement(ClassesHeader, null, /* @__PURE__ */ React68.createElement(CssClassSelector, null), /* @__PURE__ */ React68.createElement(
|
|
3185
|
+
/* @__PURE__ */ React68.createElement(SessionStorageProvider2, { prefix: activeStyleDefId ?? "" }, /* @__PURE__ */ React68.createElement(StyleInheritanceProvider, null, /* @__PURE__ */ React68.createElement(ClassesHeader, null, /* @__PURE__ */ React68.createElement(CssClassSelector, null), /* @__PURE__ */ React68.createElement(Divider5, null)), /* @__PURE__ */ React68.createElement(SectionsList, null, /* @__PURE__ */ React68.createElement(Section, { title: __44("Layout", "elementor") }, /* @__PURE__ */ React68.createElement(LayoutSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: __44("Spacing", "elementor") }, /* @__PURE__ */ React68.createElement(SpacingSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: __44("Size", "elementor") }, /* @__PURE__ */ React68.createElement(SizeSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: __44("Position", "elementor") }, /* @__PURE__ */ React68.createElement(PositionSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: __44("Typography", "elementor") }, /* @__PURE__ */ React68.createElement(TypographySection, null)), /* @__PURE__ */ React68.createElement(Section, { title: __44("Background", "elementor") }, /* @__PURE__ */ React68.createElement(BackgroundSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: __44("Border", "elementor") }, /* @__PURE__ */ React68.createElement(BorderSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: __44("Effects", "elementor") }, /* @__PURE__ */ React68.createElement(EffectsSection, null)))))
|
|
3187
3186
|
));
|
|
3188
3187
|
};
|
|
3189
3188
|
function ClassesHeader({ children }) {
|
|
@@ -3208,7 +3207,7 @@ var EditingPanelTabs = () => {
|
|
|
3208
3207
|
return (
|
|
3209
3208
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
3210
3209
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
3211
|
-
/* @__PURE__ */ React69.createElement(Fragment8, { key: element.id }, /* @__PURE__ */ React69.createElement(ScrollProvider, null, /* @__PURE__ */ React69.createElement(Stack17, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React69.createElement(Stack17, { sx: { ...stickyHeaderStyles, top: 0 } }, /* @__PURE__ */ React69.createElement(Tabs, { variant: "fullWidth", size: "small", sx: { mt: 0.5 }, ...getTabsProps() }, /* @__PURE__ */ React69.createElement(Tab, { label: __45("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React69.createElement(Tab, { label: __45("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React69.createElement(
|
|
3210
|
+
/* @__PURE__ */ React69.createElement(Fragment8, { key: element.id }, /* @__PURE__ */ React69.createElement(ScrollProvider, null, /* @__PURE__ */ React69.createElement(Stack17, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React69.createElement(Stack17, { sx: { ...stickyHeaderStyles, top: 0 } }, /* @__PURE__ */ React69.createElement(Tabs, { variant: "fullWidth", size: "small", sx: { mt: 0.5 }, ...getTabsProps() }, /* @__PURE__ */ React69.createElement(Tab, { label: __45("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React69.createElement(Tab, { label: __45("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React69.createElement(Divider6, null)), /* @__PURE__ */ React69.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React69.createElement(SettingsTab, null)), /* @__PURE__ */ React69.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React69.createElement(StyleTab, null)))))
|
|
3212
3211
|
);
|
|
3213
3212
|
};
|
|
3214
3213
|
|
|
@@ -3281,7 +3280,7 @@ import {
|
|
|
3281
3280
|
bindPopover as bindPopover2,
|
|
3282
3281
|
bindTrigger as bindTrigger2,
|
|
3283
3282
|
Box as Box5,
|
|
3284
|
-
Divider as
|
|
3283
|
+
Divider as Divider8,
|
|
3285
3284
|
Grid as Grid27,
|
|
3286
3285
|
IconButton as IconButton4,
|
|
3287
3286
|
Paper,
|
|
@@ -3423,7 +3422,7 @@ import { useBoundProp as useBoundProp4 } from "@elementor/editor-controls";
|
|
|
3423
3422
|
import { DatabaseIcon, SearchIcon } from "@elementor/icons";
|
|
3424
3423
|
import {
|
|
3425
3424
|
Box as Box4,
|
|
3426
|
-
Divider as
|
|
3425
|
+
Divider as Divider7,
|
|
3427
3426
|
InputAdornment,
|
|
3428
3427
|
Link,
|
|
3429
3428
|
MenuItem,
|
|
@@ -3466,7 +3465,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
3466
3465
|
startAdornment: /* @__PURE__ */ React73.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React73.createElement(SearchIcon, { fontSize: SIZE3 }))
|
|
3467
3466
|
}
|
|
3468
3467
|
}
|
|
3469
|
-
)), /* @__PURE__ */ React73.createElement(
|
|
3468
|
+
)), /* @__PURE__ */ React73.createElement(Divider7, null), /* @__PURE__ */ React73.createElement(Box4, { sx: { overflowY: "auto", height: 260, width: 220 } }, options12.length > 0 ? /* @__PURE__ */ React73.createElement(MenuList, { role: "listbox", tabIndex: 0 }, options12.map(([category, items3], index) => /* @__PURE__ */ React73.createElement(Fragment9, { key: index }, /* @__PURE__ */ React73.createElement(
|
|
3470
3469
|
MenuSubheader2,
|
|
3471
3470
|
{
|
|
3472
3471
|
sx: { px: 1.5, typography: "caption", color: "text.tertiary" }
|
|
@@ -3502,7 +3501,7 @@ var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React73.createElem
|
|
|
3502
3501
|
/* @__PURE__ */ React73.createElement(Typography4, { align: "center", variant: "subtitle2" }, __47("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React73.createElement("br", null), "\u201C", searchValue, "\u201D."),
|
|
3503
3502
|
/* @__PURE__ */ React73.createElement(Typography4, { align: "center", variant: "caption" }, __47("Try something else.", "elementor"), "\xA0", /* @__PURE__ */ React73.createElement(Link, { color: "text.secondary", variant: "caption", component: "button", onClick: onClear }, __47("Clear & try again", "elementor")))
|
|
3504
3503
|
);
|
|
3505
|
-
var NoDynamicTags = () => /* @__PURE__ */ React73.createElement(Box4, { sx: { overflowY: "hidden", height: 297, width: 220 } }, /* @__PURE__ */ React73.createElement(
|
|
3504
|
+
var NoDynamicTags = () => /* @__PURE__ */ React73.createElement(Box4, { sx: { overflowY: "hidden", height: 297, width: 220 } }, /* @__PURE__ */ React73.createElement(Divider7, null), /* @__PURE__ */ React73.createElement(
|
|
3506
3505
|
Stack19,
|
|
3507
3506
|
{
|
|
3508
3507
|
gap: 1,
|
|
@@ -3600,7 +3599,7 @@ var DynamicSettings = ({ controls }) => {
|
|
|
3600
3599
|
if (!tabs.length) {
|
|
3601
3600
|
return null;
|
|
3602
3601
|
}
|
|
3603
|
-
return /* @__PURE__ */ React74.createElement(React74.Fragment, null, /* @__PURE__ */ React74.createElement(Tabs2, { size: "small", variant: "fullWidth", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React74.createElement(Tab2, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React74.createElement(
|
|
3602
|
+
return /* @__PURE__ */ React74.createElement(React74.Fragment, null, /* @__PURE__ */ React74.createElement(Tabs2, { size: "small", variant: "fullWidth", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React74.createElement(Tab2, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React74.createElement(Divider8, null), tabs.map(({ value }, index) => {
|
|
3604
3603
|
return /* @__PURE__ */ React74.createElement(TabPanel2, { key: index, sx: { flexGrow: 1, py: 0 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React74.createElement(PopoverContent, { p: 2, gap: 2 }, value.items.map((item) => {
|
|
3605
3604
|
if (item.type === "control") {
|
|
3606
3605
|
return /* @__PURE__ */ React74.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
@@ -3610,7 +3609,7 @@ var DynamicSettings = ({ controls }) => {
|
|
|
3610
3609
|
}));
|
|
3611
3610
|
};
|
|
3612
3611
|
var Control3 = ({ control }) => {
|
|
3613
|
-
if (!
|
|
3612
|
+
if (!getControl(control.type)) {
|
|
3614
3613
|
return null;
|
|
3615
3614
|
}
|
|
3616
3615
|
return /* @__PURE__ */ React74.createElement(DynamicControl, { bind: control.bind }, /* @__PURE__ */ React74.createElement(Grid27, { container: true, gap: 0.75 }, control.label ? /* @__PURE__ */ React74.createElement(Grid27, { item: true, xs: 12 }, /* @__PURE__ */ React74.createElement(ControlFormLabel5, null, control.label)) : null, /* @__PURE__ */ React74.createElement(Grid27, { item: true, xs: 12 }, /* @__PURE__ */ React74.createElement(Control, { type: control.type, props: control.props }))));
|