@elementor/editor-editing-panel 1.32.0 → 1.33.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 +15 -0
- package/dist/index.js +163 -165
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/components/settings-tab.tsx +7 -3
- 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/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";
|
|
@@ -3183,7 +3181,7 @@ var StyleTab = () => {
|
|
|
3183
3181
|
},
|
|
3184
3182
|
setMetaState: setActiveStyleState
|
|
3185
3183
|
},
|
|
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(
|
|
3184
|
+
/* @__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
3185
|
));
|
|
3188
3186
|
};
|
|
3189
3187
|
function ClassesHeader({ children }) {
|
|
@@ -3208,7 +3206,7 @@ var EditingPanelTabs = () => {
|
|
|
3208
3206
|
return (
|
|
3209
3207
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
3210
3208
|
// 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(
|
|
3209
|
+
/* @__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
3210
|
);
|
|
3213
3211
|
};
|
|
3214
3212
|
|
|
@@ -3281,7 +3279,7 @@ import {
|
|
|
3281
3279
|
bindPopover as bindPopover2,
|
|
3282
3280
|
bindTrigger as bindTrigger2,
|
|
3283
3281
|
Box as Box5,
|
|
3284
|
-
Divider as
|
|
3282
|
+
Divider as Divider8,
|
|
3285
3283
|
Grid as Grid27,
|
|
3286
3284
|
IconButton as IconButton4,
|
|
3287
3285
|
Paper,
|
|
@@ -3423,7 +3421,7 @@ import { useBoundProp as useBoundProp4 } from "@elementor/editor-controls";
|
|
|
3423
3421
|
import { DatabaseIcon, SearchIcon } from "@elementor/icons";
|
|
3424
3422
|
import {
|
|
3425
3423
|
Box as Box4,
|
|
3426
|
-
Divider as
|
|
3424
|
+
Divider as Divider7,
|
|
3427
3425
|
InputAdornment,
|
|
3428
3426
|
Link,
|
|
3429
3427
|
MenuItem,
|
|
@@ -3466,7 +3464,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
3466
3464
|
startAdornment: /* @__PURE__ */ React73.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React73.createElement(SearchIcon, { fontSize: SIZE3 }))
|
|
3467
3465
|
}
|
|
3468
3466
|
}
|
|
3469
|
-
)), /* @__PURE__ */ React73.createElement(
|
|
3467
|
+
)), /* @__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
3468
|
MenuSubheader2,
|
|
3471
3469
|
{
|
|
3472
3470
|
sx: { px: 1.5, typography: "caption", color: "text.tertiary" }
|
|
@@ -3502,7 +3500,7 @@ var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React73.createElem
|
|
|
3502
3500
|
/* @__PURE__ */ React73.createElement(Typography4, { align: "center", variant: "subtitle2" }, __47("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React73.createElement("br", null), "\u201C", searchValue, "\u201D."),
|
|
3503
3501
|
/* @__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
3502
|
);
|
|
3505
|
-
var NoDynamicTags = () => /* @__PURE__ */ React73.createElement(Box4, { sx: { overflowY: "hidden", height: 297, width: 220 } }, /* @__PURE__ */ React73.createElement(
|
|
3503
|
+
var NoDynamicTags = () => /* @__PURE__ */ React73.createElement(Box4, { sx: { overflowY: "hidden", height: 297, width: 220 } }, /* @__PURE__ */ React73.createElement(Divider7, null), /* @__PURE__ */ React73.createElement(
|
|
3506
3504
|
Stack19,
|
|
3507
3505
|
{
|
|
3508
3506
|
gap: 1,
|
|
@@ -3600,7 +3598,7 @@ var DynamicSettings = ({ controls }) => {
|
|
|
3600
3598
|
if (!tabs.length) {
|
|
3601
3599
|
return null;
|
|
3602
3600
|
}
|
|
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(
|
|
3601
|
+
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
3602
|
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
3603
|
if (item.type === "control") {
|
|
3606
3604
|
return /* @__PURE__ */ React74.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
@@ -3610,7 +3608,7 @@ var DynamicSettings = ({ controls }) => {
|
|
|
3610
3608
|
}));
|
|
3611
3609
|
};
|
|
3612
3610
|
var Control3 = ({ control }) => {
|
|
3613
|
-
if (!
|
|
3611
|
+
if (!getControl(control.type)) {
|
|
3614
3612
|
return null;
|
|
3615
3613
|
}
|
|
3616
3614
|
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 }))));
|