@elementor/editor-editing-panel 3.35.0-341 → 3.35.0-343
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.d.mts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +304 -293
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
- package/src/components/collapsible-content.tsx +1 -2
- package/src/components/editing-panel.tsx +29 -16
- package/src/components/section.tsx +1 -1
- package/src/editing-panel-replacement-registry.tsx +30 -0
- package/src/index.ts +3 -1
- package/src/components/collapse-icon.tsx +0 -12
package/dist/index.mjs
CHANGED
|
@@ -1788,6 +1788,18 @@ var controlActionsMenu = createMenu({
|
|
|
1788
1788
|
}
|
|
1789
1789
|
});
|
|
1790
1790
|
|
|
1791
|
+
// src/editing-panel-replacement-registry.tsx
|
|
1792
|
+
var registry = /* @__PURE__ */ new Map();
|
|
1793
|
+
var DEFAULT_PRIORITY = 10;
|
|
1794
|
+
var registerEditingPanelReplacement = ({
|
|
1795
|
+
id,
|
|
1796
|
+
priority = DEFAULT_PRIORITY,
|
|
1797
|
+
...props
|
|
1798
|
+
}) => {
|
|
1799
|
+
registry.set(id, { ...props, priority });
|
|
1800
|
+
};
|
|
1801
|
+
var getEditingPanelReplacement = (element, elementType) => Array.from(registry.values()).filter(({ condition }) => condition(element, elementType)).sort((a, b) => a.priority - b.priority)?.[0] ?? null;
|
|
1802
|
+
|
|
1791
1803
|
// src/components/editing-panel-error-fallback.tsx
|
|
1792
1804
|
import * as React14 from "react";
|
|
1793
1805
|
import { Alert, Box as Box3 } from "@elementor/ui";
|
|
@@ -1909,6 +1921,7 @@ import { SessionStorageProvider } from "@elementor/session";
|
|
|
1909
1921
|
// src/components/section.tsx
|
|
1910
1922
|
import * as React19 from "react";
|
|
1911
1923
|
import { useId as useId2, useRef as useRef3 } from "react";
|
|
1924
|
+
import { CollapseIcon as CollapseIcon2 } from "@elementor/editor-ui";
|
|
1912
1925
|
import { Collapse as Collapse2, Divider as Divider2, ListItemButton, ListItemText, Stack as Stack5 } from "@elementor/ui";
|
|
1913
1926
|
|
|
1914
1927
|
// src/contexts/section-context.tsx
|
|
@@ -1921,24 +1934,13 @@ var useSectionWidth = () => {
|
|
|
1921
1934
|
return sectionRef?.current?.offsetWidth ?? FALLBACK_SECTION_WIDTH;
|
|
1922
1935
|
};
|
|
1923
1936
|
|
|
1924
|
-
// src/components/collapse-icon.tsx
|
|
1925
|
-
import { ChevronDownIcon } from "@elementor/icons";
|
|
1926
|
-
import { styled as styled4 } from "@elementor/ui";
|
|
1927
|
-
var CollapseIcon = styled4(ChevronDownIcon, {
|
|
1928
|
-
shouldForwardProp: (prop) => prop !== "open"
|
|
1929
|
-
})(({ theme, open }) => ({
|
|
1930
|
-
transform: open ? "rotate(180deg)" : "rotate(0deg)",
|
|
1931
|
-
transition: theme.transitions.create("transform", {
|
|
1932
|
-
duration: theme.transitions.duration.standard
|
|
1933
|
-
})
|
|
1934
|
-
}));
|
|
1935
|
-
|
|
1936
1937
|
// src/components/collapsible-content.tsx
|
|
1937
1938
|
import * as React18 from "react";
|
|
1938
1939
|
import { useState as useState7 } from "react";
|
|
1939
|
-
import {
|
|
1940
|
+
import { CollapseIcon } from "@elementor/editor-ui";
|
|
1941
|
+
import { Button, Collapse, Stack as Stack4, styled as styled4 } from "@elementor/ui";
|
|
1940
1942
|
import { __ as __7 } from "@wordpress/i18n";
|
|
1941
|
-
var IndicatorsWrapper =
|
|
1943
|
+
var IndicatorsWrapper = styled4("div")`
|
|
1942
1944
|
position: absolute;
|
|
1943
1945
|
top: 0;
|
|
1944
1946
|
right: ${({ theme }) => theme.spacing(3)};
|
|
@@ -2002,7 +2004,7 @@ function Section({ title, children, defaultExpanded = false, titleEnd, unmountOn
|
|
|
2002
2004
|
sx: { flexGrow: 0, flexShrink: 1, marginInlineEnd: 1 }
|
|
2003
2005
|
}
|
|
2004
2006
|
), getCollapsibleValue(titleEnd, isOpen)),
|
|
2005
|
-
/* @__PURE__ */ React19.createElement(
|
|
2007
|
+
/* @__PURE__ */ React19.createElement(CollapseIcon2, { open: isOpen, color: "secondary", fontSize: "tiny" })
|
|
2006
2008
|
), /* @__PURE__ */ React19.createElement(
|
|
2007
2009
|
Collapse2,
|
|
2008
2010
|
{
|
|
@@ -2019,7 +2021,7 @@ function Section({ title, children, defaultExpanded = false, titleEnd, unmountOn
|
|
|
2019
2021
|
// src/components/settings-control.tsx
|
|
2020
2022
|
import * as React24 from "react";
|
|
2021
2023
|
import { ControlAdornmentsProvider } from "@elementor/editor-controls";
|
|
2022
|
-
import { Divider as Divider3, styled as
|
|
2024
|
+
import { Divider as Divider3, styled as styled6 } from "@elementor/ui";
|
|
2023
2025
|
|
|
2024
2026
|
// src/controls-registry/control.tsx
|
|
2025
2027
|
import * as React20 from "react";
|
|
@@ -2122,14 +2124,14 @@ var Control = ({ props, type }) => {
|
|
|
2122
2124
|
|
|
2123
2125
|
// src/controls-registry/control-type-container.tsx
|
|
2124
2126
|
import * as React21 from "react";
|
|
2125
|
-
import { Box as Box4, styled as
|
|
2127
|
+
import { Box as Box4, styled as styled5 } from "@elementor/ui";
|
|
2126
2128
|
var ControlTypeContainer = ({ children, layout }) => {
|
|
2127
2129
|
if (layout === "custom") {
|
|
2128
2130
|
return children;
|
|
2129
2131
|
}
|
|
2130
2132
|
return /* @__PURE__ */ React21.createElement(StyledContainer, { layout }, children);
|
|
2131
2133
|
};
|
|
2132
|
-
var StyledContainer =
|
|
2134
|
+
var StyledContainer = styled5(Box4, {
|
|
2133
2135
|
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
2134
2136
|
})(({ layout, theme }) => ({
|
|
2135
2137
|
display: "grid",
|
|
@@ -2394,7 +2396,7 @@ var indicatorsRegistry = {
|
|
|
2394
2396
|
settings: /* @__PURE__ */ new Map(),
|
|
2395
2397
|
styles: /* @__PURE__ */ new Map()
|
|
2396
2398
|
};
|
|
2397
|
-
var
|
|
2399
|
+
var DEFAULT_PRIORITY2 = 10;
|
|
2398
2400
|
var FIELD_TYPE = {
|
|
2399
2401
|
SETTINGS: "settings",
|
|
2400
2402
|
STYLES: "styles"
|
|
@@ -2403,7 +2405,7 @@ var registerFieldIndicator = ({
|
|
|
2403
2405
|
fieldType,
|
|
2404
2406
|
id,
|
|
2405
2407
|
indicator,
|
|
2406
|
-
priority =
|
|
2408
|
+
priority = DEFAULT_PRIORITY2
|
|
2407
2409
|
}) => {
|
|
2408
2410
|
indicatorsRegistry[fieldType].set(id, { id, indicator, priority });
|
|
2409
2411
|
};
|
|
@@ -2418,7 +2420,7 @@ var ControlLabel = ({ children }) => {
|
|
|
2418
2420
|
};
|
|
2419
2421
|
|
|
2420
2422
|
// src/components/settings-control.tsx
|
|
2421
|
-
var Wrapper =
|
|
2423
|
+
var Wrapper = styled6("span")`
|
|
2422
2424
|
display: contents;
|
|
2423
2425
|
`;
|
|
2424
2426
|
var SettingsControl = ({ control: { value, type } }) => {
|
|
@@ -4917,7 +4919,12 @@ var EditingPanel = () => {
|
|
|
4917
4919
|
return null;
|
|
4918
4920
|
}
|
|
4919
4921
|
const panelTitle = __57("Edit %s", "elementor").replace("%s", elementType.title);
|
|
4920
|
-
|
|
4922
|
+
const { component: ReplacementComponent } = getEditingPanelReplacement(element, elementType) ?? {};
|
|
4923
|
+
let panelContent = /* @__PURE__ */ React84.createElement(React84.Fragment, null, /* @__PURE__ */ React84.createElement(PanelHeader, null, /* @__PURE__ */ React84.createElement(PanelHeaderTitle, null, panelTitle), /* @__PURE__ */ React84.createElement(AtomIcon, { fontSize: "small", sx: { color: "text.tertiary" } })), /* @__PURE__ */ React84.createElement(PanelBody, null, /* @__PURE__ */ React84.createElement(EditingPanelTabs, null)));
|
|
4924
|
+
if (ReplacementComponent) {
|
|
4925
|
+
panelContent = /* @__PURE__ */ React84.createElement(ReplacementComponent, null);
|
|
4926
|
+
}
|
|
4927
|
+
return /* @__PURE__ */ React84.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React84.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React84.createElement(SessionStorageProvider3, { prefix: "elementor" }, /* @__PURE__ */ React84.createElement(ThemeProvider3, null, /* @__PURE__ */ React84.createElement(ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React84.createElement(ControlReplacementsProvider, { replacements: controlReplacements }, /* @__PURE__ */ React84.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React84.createElement(Panel, null, /* @__PURE__ */ React84.createElement(PanelHeaderTopSlot, null), panelContent)))))));
|
|
4921
4928
|
};
|
|
4922
4929
|
|
|
4923
4930
|
// src/components/popover-body.tsx
|
|
@@ -5577,7 +5584,7 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
5577
5584
|
};
|
|
5578
5585
|
|
|
5579
5586
|
// src/dynamics/components/dynamic-selection.tsx
|
|
5580
|
-
import { Fragment as
|
|
5587
|
+
import { Fragment as Fragment13, useState as useState11 } from "react";
|
|
5581
5588
|
import * as React90 from "react";
|
|
5582
5589
|
import { useBoundProp as useBoundProp9 } from "@elementor/editor-controls";
|
|
5583
5590
|
import { PopoverHeader, PopoverMenuList, SearchField } from "@elementor/editor-ui";
|
|
@@ -5625,7 +5632,7 @@ var DynamicSelection = ({ close: closePopover }) => {
|
|
|
5625
5632
|
onClose: closePopover,
|
|
5626
5633
|
icon: /* @__PURE__ */ React90.createElement(DatabaseIcon2, { fontSize: SIZE4 })
|
|
5627
5634
|
}
|
|
5628
|
-
), hasNoDynamicTags ? /* @__PURE__ */ React90.createElement(NoDynamicTags, null) : /* @__PURE__ */ React90.createElement(
|
|
5635
|
+
), hasNoDynamicTags ? /* @__PURE__ */ React90.createElement(NoDynamicTags, null) : /* @__PURE__ */ React90.createElement(Fragment13, null, /* @__PURE__ */ React90.createElement(
|
|
5629
5636
|
SearchField,
|
|
5630
5637
|
{
|
|
5631
5638
|
value: searchValue,
|
|
@@ -6468,12 +6475,12 @@ var arrayTransformer = createTransformer2((values) => {
|
|
|
6468
6475
|
// src/styles-inheritance/transformers/background-color-overlay-transformer.tsx
|
|
6469
6476
|
import * as React100 from "react";
|
|
6470
6477
|
import { createTransformer as createTransformer3 } from "@elementor/editor-canvas";
|
|
6471
|
-
import { Stack as Stack20, styled as
|
|
6478
|
+
import { Stack as Stack20, styled as styled7, UnstableColorIndicator } from "@elementor/ui";
|
|
6472
6479
|
var backgroundColorOverlayTransformer = createTransformer3((value) => /* @__PURE__ */ React100.createElement(Stack20, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React100.createElement(ItemLabelColor, { value })));
|
|
6473
6480
|
var ItemLabelColor = ({ value: { color } }) => {
|
|
6474
6481
|
return /* @__PURE__ */ React100.createElement("span", null, color);
|
|
6475
6482
|
};
|
|
6476
|
-
var StyledUnstableColorIndicator =
|
|
6483
|
+
var StyledUnstableColorIndicator = styled7(UnstableColorIndicator)(({ theme }) => ({
|
|
6477
6484
|
width: "1em",
|
|
6478
6485
|
height: "1em",
|
|
6479
6486
|
borderRadius: `${theme.shape.borderRadius / 2}px`,
|
|
@@ -6572,14 +6579,14 @@ var boxShadowTransformer = createTransformer6((value) => {
|
|
|
6572
6579
|
// src/styles-inheritance/transformers/color-transformer.tsx
|
|
6573
6580
|
import * as React104 from "react";
|
|
6574
6581
|
import { createTransformer as createTransformer7 } from "@elementor/editor-canvas";
|
|
6575
|
-
import { Stack as Stack24, styled as
|
|
6582
|
+
import { Stack as Stack24, styled as styled8, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
6576
6583
|
function isValidCSSColor(value) {
|
|
6577
6584
|
if (!value.trim()) {
|
|
6578
6585
|
return false;
|
|
6579
6586
|
}
|
|
6580
6587
|
return CSS.supports("color", value.trim());
|
|
6581
6588
|
}
|
|
6582
|
-
var StyledColorIndicator =
|
|
6589
|
+
var StyledColorIndicator = styled8(UnstableColorIndicator2)(({ theme }) => ({
|
|
6583
6590
|
width: "1em",
|
|
6584
6591
|
height: "1em",
|
|
6585
6592
|
borderRadius: `${theme.shape.borderRadius / 2}px`,
|
|
@@ -6708,6 +6715,7 @@ export {
|
|
|
6708
6715
|
injectIntoPanelHeaderTop,
|
|
6709
6716
|
injectIntoStyleTab,
|
|
6710
6717
|
registerControlReplacement,
|
|
6718
|
+
registerEditingPanelReplacement,
|
|
6711
6719
|
registerFieldIndicator,
|
|
6712
6720
|
registerStyleProviderToColors,
|
|
6713
6721
|
stylesInheritanceTransformersRegistry,
|
|
@@ -6719,6 +6727,7 @@ export {
|
|
|
6719
6727
|
usePanelActions,
|
|
6720
6728
|
usePanelStatus,
|
|
6721
6729
|
useSectionWidth,
|
|
6730
|
+
useStateByElement,
|
|
6722
6731
|
useStyle,
|
|
6723
6732
|
useStylesRerender
|
|
6724
6733
|
};
|