@elementor/editor-editing-panel 4.5.0-1180 → 4.5.0-1182
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 +33 -21
- package/dist/index.d.ts +33 -21
- package/dist/index.js +212 -87
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +147 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +25 -25
- package/src/components/css-classes/css-class-selector.tsx +3 -0
- package/src/components/custom-css-header-location.tsx +11 -0
- package/src/components/section.tsx +19 -1
- package/src/components/style-section-header-location.tsx +29 -0
- package/src/components/style-tab-header-location.tsx +12 -0
- package/src/components/style-tab-section.tsx +6 -0
- package/src/controls-registry/controls-registry.tsx +1 -1
- package/src/controls-registry/element-controls/menu-items-control/menu-items-control.tsx +59 -4
- package/src/controls-registry/element-controls/menu-items-control/use-actions.ts +14 -3
- package/src/controls-registry/element-controls/menu-items-control/use-entry-item.ts +33 -0
- package/src/index.ts +7 -0
- package/src/init.ts +3 -0
package/dist/index.mjs
CHANGED
|
@@ -507,7 +507,7 @@ import {
|
|
|
507
507
|
} from "@elementor/editor-styles-repository";
|
|
508
508
|
import { InfoAlert, WarningInfotip } from "@elementor/editor-ui";
|
|
509
509
|
import { ColorSwatchIcon, MapPinIcon } from "@elementor/icons";
|
|
510
|
-
import { createLocation as
|
|
510
|
+
import { createLocation as createLocation3 } from "@elementor/locations";
|
|
511
511
|
import {
|
|
512
512
|
Box as Box2,
|
|
513
513
|
Button,
|
|
@@ -560,6 +560,14 @@ var trackStyles = (provider, event, data) => {
|
|
|
560
560
|
providerInstance?.actions.tracking?.({ event, ...data });
|
|
561
561
|
};
|
|
562
562
|
|
|
563
|
+
// src/components/style-tab-header-location.tsx
|
|
564
|
+
import { createLocation as createLocation2 } from "@elementor/locations";
|
|
565
|
+
var {
|
|
566
|
+
Slot: StyleTabHeaderSlot,
|
|
567
|
+
inject: injectIntoStyleTabHeader,
|
|
568
|
+
useInjections: useStyleTabHeaderInjections
|
|
569
|
+
} = createLocation2();
|
|
570
|
+
|
|
563
571
|
// src/components/css-classes/css-class-item.tsx
|
|
564
572
|
import * as React11 from "react";
|
|
565
573
|
import { useEffect, useMemo as useMemo3, useState as useState3 } from "react";
|
|
@@ -1343,8 +1351,9 @@ var EMPTY_OPTION = {
|
|
|
1343
1351
|
icon: /* @__PURE__ */ React13.createElement(MapPinIcon, null),
|
|
1344
1352
|
provider: null
|
|
1345
1353
|
};
|
|
1346
|
-
var { Slot: ClassSelectorActionsSlot, inject: injectIntoClassSelectorActions } =
|
|
1354
|
+
var { Slot: ClassSelectorActionsSlot, inject: injectIntoClassSelectorActions } = createLocation3();
|
|
1347
1355
|
function CssClassSelector() {
|
|
1356
|
+
const { element } = useElement();
|
|
1348
1357
|
const options13 = useOptions();
|
|
1349
1358
|
const { id: activeId, setId: setActiveId } = useStyle();
|
|
1350
1359
|
const autocompleteRef = useRef(null);
|
|
@@ -1362,7 +1371,7 @@ function CssClassSelector() {
|
|
|
1362
1371
|
const clearMissingClasses = useCallback2(() => {
|
|
1363
1372
|
unapplyClasses(missingClassesIds);
|
|
1364
1373
|
}, [missingClassesIds, unapplyClasses]);
|
|
1365
|
-
return /* @__PURE__ */ React13.createElement(Stack4, { p: 2 }, /* @__PURE__ */ React13.createElement(Stack4, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React13.createElement(FormLabel, { htmlFor: ID, size: "small" }, __8("Classes", "elementor")), /* @__PURE__ */ React13.createElement(Stack4, { direction: "row", gap: 1 }, /* @__PURE__ */ React13.createElement(ClassSelectorActionsSlot, null))), /* @__PURE__ */ React13.createElement(
|
|
1374
|
+
return /* @__PURE__ */ React13.createElement(Stack4, { p: 2 }, /* @__PURE__ */ React13.createElement(Stack4, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React13.createElement(FormLabel, { htmlFor: ID, size: "small" }, __8("Classes", "elementor")), /* @__PURE__ */ React13.createElement(Stack4, { direction: "row", gap: 1 }, /* @__PURE__ */ React13.createElement(StyleTabHeaderSlot, { elementId: element.id }), /* @__PURE__ */ React13.createElement(ClassSelectorActionsSlot, null))), /* @__PURE__ */ React13.createElement(
|
|
1366
1375
|
WarningInfotip,
|
|
1367
1376
|
{
|
|
1368
1377
|
open: Boolean(renameError),
|
|
@@ -1934,7 +1943,7 @@ import { useSelectedElementSettings } from "@elementor/editor-elements";
|
|
|
1934
1943
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
1935
1944
|
import { ThemeProvider as ThemeProvider3 } from "@elementor/editor-ui";
|
|
1936
1945
|
import { AtomIcon } from "@elementor/icons";
|
|
1937
|
-
import { createLocation as
|
|
1946
|
+
import { createLocation as createLocation7 } from "@elementor/locations";
|
|
1938
1947
|
import { controlActionsMenu } from "@elementor/menus";
|
|
1939
1948
|
import { SessionStorageProvider as SessionStorageProvider3 } from "@elementor/session";
|
|
1940
1949
|
import { ErrorBoundary } from "@elementor/ui";
|
|
@@ -2378,7 +2387,15 @@ import * as React21 from "react";
|
|
|
2378
2387
|
import { useId as useId2, useRef as useRef3 } from "react";
|
|
2379
2388
|
import { CollapseIcon, getCollapsibleValue, SectionRefContext } from "@elementor/editor-ui";
|
|
2380
2389
|
import { Collapse, Divider as Divider2, ListItemButton, ListItemText, Stack as Stack5 } from "@elementor/ui";
|
|
2381
|
-
function Section({
|
|
2390
|
+
function Section({
|
|
2391
|
+
title,
|
|
2392
|
+
children,
|
|
2393
|
+
defaultExpanded = false,
|
|
2394
|
+
titleEnd,
|
|
2395
|
+
titleActions,
|
|
2396
|
+
unmountOnExit = true,
|
|
2397
|
+
action
|
|
2398
|
+
}) {
|
|
2382
2399
|
const [isOpen, setIsOpen] = useStateByElement(title, !!defaultExpanded);
|
|
2383
2400
|
const ref = useRef3(null);
|
|
2384
2401
|
const isDisabled = !!action;
|
|
@@ -2408,7 +2425,15 @@ function Section({ title, children, defaultExpanded = false, titleEnd, unmountOn
|
|
|
2408
2425
|
secondaryTypographyProps: { color: "text.primary", variant: "caption", fontWeight: "bold" },
|
|
2409
2426
|
sx: { flexGrow: 0, flexShrink: 1, marginInlineEnd: 1 }
|
|
2410
2427
|
}
|
|
2411
|
-
), getCollapsibleValue(titleEnd, isOpen)
|
|
2428
|
+
), getCollapsibleValue(titleEnd, isOpen), titleActions && /* @__PURE__ */ React21.createElement(
|
|
2429
|
+
Stack5,
|
|
2430
|
+
{
|
|
2431
|
+
direction: "row",
|
|
2432
|
+
alignItems: "center",
|
|
2433
|
+
onClick: (event) => event.stopPropagation()
|
|
2434
|
+
},
|
|
2435
|
+
titleActions
|
|
2436
|
+
)),
|
|
2412
2437
|
action?.component,
|
|
2413
2438
|
/* @__PURE__ */ React21.createElement(
|
|
2414
2439
|
CollapseIcon,
|
|
@@ -2518,7 +2543,7 @@ var controlTypes = {
|
|
|
2518
2543
|
toggle: { component: ToggleControl, layout: "full", propTypeUtil: stringPropTypeUtil2 },
|
|
2519
2544
|
"date-time": { component: DateTimeControl, layout: "full", propTypeUtil: DateTimePropTypeUtil },
|
|
2520
2545
|
video: { component: VideoMediaControl, layout: "full", propTypeUtil: videoSrcPropTypeUtil },
|
|
2521
|
-
"inline-editing": { component: InlineEditingControl, layout: "
|
|
2546
|
+
"inline-editing": { component: InlineEditingControl, layout: "custom", propTypeUtil: escapedHtmlPropTypeUtil },
|
|
2522
2547
|
email: { component: EmailFormActionControl, layout: "custom", propTypeUtil: emailsPropTypeUtil },
|
|
2523
2548
|
"date-range": {
|
|
2524
2549
|
component: DateRangeControl,
|
|
@@ -2884,7 +2909,7 @@ import * as React91 from "react";
|
|
|
2884
2909
|
import { useState as useState10 } from "react";
|
|
2885
2910
|
import { CLASSES_PROP_KEY } from "@elementor/editor-props";
|
|
2886
2911
|
import { useActiveBreakpoint as useActiveBreakpoint2 } from "@elementor/editor-responsive";
|
|
2887
|
-
import { createLocation as
|
|
2912
|
+
import { createLocation as createLocation6 } from "@elementor/locations";
|
|
2888
2913
|
import { SessionStorageProvider as SessionStorageProvider2 } from "@elementor/session";
|
|
2889
2914
|
import { Box as Box8, Divider as Divider5, Stack as Stack13 } from "@elementor/ui";
|
|
2890
2915
|
|
|
@@ -3734,7 +3759,7 @@ var EffectsSection = () => {
|
|
|
3734
3759
|
import * as React62 from "react";
|
|
3735
3760
|
import { ControlFormLabel as ControlFormLabel2 } from "@elementor/editor-controls";
|
|
3736
3761
|
import { useParentElement } from "@elementor/editor-elements";
|
|
3737
|
-
import { createLocation as
|
|
3762
|
+
import { createLocation as createLocation4 } from "@elementor/locations";
|
|
3738
3763
|
import { __ as __39 } from "@wordpress/i18n";
|
|
3739
3764
|
|
|
3740
3765
|
// src/hooks/use-computed-style.ts
|
|
@@ -4941,7 +4966,7 @@ var WrapField = () => {
|
|
|
4941
4966
|
var DISPLAY_LABEL2 = __39("Display", "elementor");
|
|
4942
4967
|
var FLEX_WRAP_LABEL2 = __39("Flex wrap", "elementor");
|
|
4943
4968
|
var DEFAULT_PARENT_FLOW_DIRECTION = "row";
|
|
4944
|
-
var { Slot: GridFieldsSlot, inject: injectIntoGridFields } =
|
|
4969
|
+
var { Slot: GridFieldsSlot, inject: injectIntoGridFields } = createLocation4();
|
|
4945
4970
|
var LayoutSection = () => {
|
|
4946
4971
|
const { value: display } = useStylesField("display", {
|
|
4947
4972
|
history: { propDisplayName: DISPLAY_LABEL2 }
|
|
@@ -5757,8 +5782,25 @@ var STYLE_SECTION_NAMES = STYLE_SECTIONS.map((section) => section.name);
|
|
|
5757
5782
|
|
|
5758
5783
|
// src/components/style-tab-section.tsx
|
|
5759
5784
|
import * as React89 from "react";
|
|
5785
|
+
|
|
5786
|
+
// src/components/style-section-header-location.tsx
|
|
5787
|
+
import { createElement as createElement89 } from "react";
|
|
5788
|
+
import { createLocation as createLocation5 } from "@elementor/locations";
|
|
5789
|
+
var { Slot: StyleSectionHeaderSlot, inject: injectStyleSectionHeader } = createLocation5();
|
|
5790
|
+
var injectIntoStyleSectionHeader = ({ id, component, sections, options: options13 }) => {
|
|
5791
|
+
const filteredComponent = (props) => {
|
|
5792
|
+
if (sections && !sections.includes(props.sectionName)) {
|
|
5793
|
+
return null;
|
|
5794
|
+
}
|
|
5795
|
+
return createElement89(component, props);
|
|
5796
|
+
};
|
|
5797
|
+
injectStyleSectionHeader({ id, component: filteredComponent, options: options13 });
|
|
5798
|
+
};
|
|
5799
|
+
|
|
5800
|
+
// src/components/style-tab-section.tsx
|
|
5760
5801
|
var StyleTabSection = ({ section, fields = [], unmountOnExit = true }) => {
|
|
5761
5802
|
const { component, name, title, action } = section;
|
|
5803
|
+
const { element } = useElement();
|
|
5762
5804
|
const tabDefaults = useDefaultPanelSettings();
|
|
5763
5805
|
const SectionComponent = component || (() => /* @__PURE__ */ React89.createElement(React89.Fragment, null));
|
|
5764
5806
|
const isExpanded = tabDefaults.defaultSectionsExpanded.style?.includes(name);
|
|
@@ -5768,6 +5810,7 @@ var StyleTabSection = ({ section, fields = [], unmountOnExit = true }) => {
|
|
|
5768
5810
|
title,
|
|
5769
5811
|
defaultExpanded: isExpanded,
|
|
5770
5812
|
titleEnd: getStylesInheritanceIndicators(fields),
|
|
5813
|
+
titleActions: element ? /* @__PURE__ */ React89.createElement(StyleSectionHeaderSlot, { elementId: element.id, sectionName: name }) : void 0,
|
|
5771
5814
|
unmountOnExit,
|
|
5772
5815
|
action
|
|
5773
5816
|
},
|
|
@@ -5793,7 +5836,7 @@ var StyleSections = () => {
|
|
|
5793
5836
|
|
|
5794
5837
|
// src/components/style-tab.tsx
|
|
5795
5838
|
var TABS_HEADER_HEIGHT = "37px";
|
|
5796
|
-
var { Slot: StyleTabSlot, inject: injectIntoStyleTab } =
|
|
5839
|
+
var { Slot: StyleTabSlot, inject: injectIntoStyleTab } = createLocation6();
|
|
5797
5840
|
var stickyHeaderStyles = {
|
|
5798
5841
|
position: "sticky",
|
|
5799
5842
|
zIndex: 1100,
|
|
@@ -5924,7 +5967,7 @@ var resolveCurrentTab = ({
|
|
|
5924
5967
|
};
|
|
5925
5968
|
|
|
5926
5969
|
// src/components/editing-panel.tsx
|
|
5927
|
-
var { Slot: PanelHeaderTopSlot, inject: injectIntoPanelHeaderTop } =
|
|
5970
|
+
var { Slot: PanelHeaderTopSlot, inject: injectIntoPanelHeaderTop } = createLocation7();
|
|
5928
5971
|
var { useMenuItems } = controlActionsMenu;
|
|
5929
5972
|
var EditingPanel = () => {
|
|
5930
5973
|
const { element, elementType, settings } = useSelectedElementSettings();
|
|
@@ -5974,8 +6017,17 @@ function PseudoStateMenuItems({ states, activeState, onSelectState, onClose }) {
|
|
|
5974
6017
|
)));
|
|
5975
6018
|
}
|
|
5976
6019
|
|
|
6020
|
+
// src/components/custom-css-header-location.tsx
|
|
6021
|
+
import { createLocation as createLocation8 } from "@elementor/locations";
|
|
6022
|
+
var {
|
|
6023
|
+
Slot: CustomCssHeaderSlot,
|
|
6024
|
+
inject: injectIntoCustomCssHeader,
|
|
6025
|
+
useInjections: useCustomCssHeaderInjections
|
|
6026
|
+
} = createLocation8();
|
|
6027
|
+
|
|
5977
6028
|
// src/init.ts
|
|
5978
6029
|
import { injectIntoLogic } from "@elementor/editor";
|
|
6030
|
+
import { init as initEditorControls } from "@elementor/editor-controls";
|
|
5979
6031
|
import { registerPanel } from "@elementor/editor-panels";
|
|
5980
6032
|
import { blockCommand } from "@elementor/editor-v1-adapters";
|
|
5981
6033
|
|
|
@@ -6779,10 +6831,12 @@ import * as React98 from "react";
|
|
|
6779
6831
|
import { useId as useId3 } from "react";
|
|
6780
6832
|
import { ControlFormLabel as ControlFormLabel5, Repeater as Repeater3 } from "@elementor/editor-controls";
|
|
6781
6833
|
import {
|
|
6834
|
+
getElementType as getElementType2,
|
|
6782
6835
|
updateElementEditorSettings as updateElementEditorSettings4,
|
|
6783
6836
|
useElementChildren as useElementChildren3,
|
|
6784
6837
|
useElementEditorSettings as useElementEditorSettings4
|
|
6785
6838
|
} from "@elementor/editor-elements";
|
|
6839
|
+
import { SessionStorageProvider as SessionStorageProvider4 } from "@elementor/session";
|
|
6786
6840
|
import { Stack as Stack17, TextField as TextField4 } from "@elementor/ui";
|
|
6787
6841
|
import { __ as __76 } from "@wordpress/i18n";
|
|
6788
6842
|
|
|
@@ -6813,6 +6867,7 @@ import { __ as __75 } from "@wordpress/i18n";
|
|
|
6813
6867
|
var MENU_ITEMS_ELEMENT_TYPE = "e-menu-items";
|
|
6814
6868
|
var MENU_ENTRY_ELEMENT_TYPE = "e-menu-entry";
|
|
6815
6869
|
var MENU_ITEM_ELEMENT_TYPE = "e-menu-item";
|
|
6870
|
+
var MIN_ENTRIES = 1;
|
|
6816
6871
|
var PARAGRAPH_WIDGET_TYPE3 = "e-paragraph";
|
|
6817
6872
|
var getEntryTitle = () => __75("Menu item", "elementor");
|
|
6818
6873
|
var buildEntryModel = (title) => ({
|
|
@@ -6856,10 +6911,17 @@ var useActions2 = () => {
|
|
|
6856
6911
|
});
|
|
6857
6912
|
});
|
|
6858
6913
|
};
|
|
6859
|
-
const removeItem2 = ({ items: items3 }) => {
|
|
6914
|
+
const removeItem2 = ({ menuItemsId, items: items3 }) => {
|
|
6915
|
+
const entriesCount = getContainer8(menuItemsId)?.children?.filter(
|
|
6916
|
+
(child) => child.model.get("elType") === MENU_ENTRY_ELEMENT_TYPE
|
|
6917
|
+
).length ?? 0;
|
|
6918
|
+
const removableCount = Math.max(0, Math.min(items3.length, entriesCount - MIN_ENTRIES));
|
|
6919
|
+
if (removableCount === 0) {
|
|
6920
|
+
return;
|
|
6921
|
+
}
|
|
6860
6922
|
removeElements3({
|
|
6861
6923
|
title: __75("Menu", "elementor"),
|
|
6862
|
-
elementIds: items3.map(({ item }) => item.id)
|
|
6924
|
+
elementIds: items3.slice(0, removableCount).map(({ item }) => item.id)
|
|
6863
6925
|
});
|
|
6864
6926
|
};
|
|
6865
6927
|
const duplicateItem2 = ({ items: items3 }) => {
|
|
@@ -6892,7 +6954,31 @@ var useActions2 = () => {
|
|
|
6892
6954
|
return { addItem: addItem2, removeItem: removeItem2, duplicateItem: duplicateItem2, moveItem: moveItem2 };
|
|
6893
6955
|
};
|
|
6894
6956
|
|
|
6957
|
+
// src/controls-registry/element-controls/menu-items-control/use-entry-item.ts
|
|
6958
|
+
import { getContainer as getContainer9, getElementSettings as getElementSettings4, getElementType } from "@elementor/editor-elements";
|
|
6959
|
+
import { __privateUseListenTo as useListenTo4, commandEndEvent as commandEndEvent4 } from "@elementor/editor-v1-adapters";
|
|
6960
|
+
var useEntryItem = (entryId) => {
|
|
6961
|
+
return useListenTo4(
|
|
6962
|
+
[commandEndEvent4("document/elements/set-settings"), commandEndEvent4("document/elements/settings")],
|
|
6963
|
+
() => {
|
|
6964
|
+
const item = getContainer9(entryId)?.children?.find(
|
|
6965
|
+
(child) => child.model.get("elType") === MENU_ITEM_ELEMENT_TYPE
|
|
6966
|
+
);
|
|
6967
|
+
return {
|
|
6968
|
+
itemId: item?.id ?? null,
|
|
6969
|
+
settings: item ? getEntrySettings(item.id) : {}
|
|
6970
|
+
};
|
|
6971
|
+
},
|
|
6972
|
+
[entryId]
|
|
6973
|
+
);
|
|
6974
|
+
};
|
|
6975
|
+
var getEntrySettings = (itemId) => {
|
|
6976
|
+
const propsSchema = getElementType(MENU_ITEM_ELEMENT_TYPE)?.propsSchema ?? {};
|
|
6977
|
+
return getElementSettings4(itemId, Object.keys(propsSchema));
|
|
6978
|
+
};
|
|
6979
|
+
|
|
6895
6980
|
// src/controls-registry/element-controls/menu-items-control/menu-items-control.tsx
|
|
6981
|
+
var LINK_BIND = "link";
|
|
6896
6982
|
var MenuItemsControl = ({ label }) => {
|
|
6897
6983
|
const { element } = useElement();
|
|
6898
6984
|
const { addItem: addItem2, duplicateItem: duplicateItem2, moveItem: moveItem2, removeItem: removeItem2 } = useActions2();
|
|
@@ -6916,7 +7002,7 @@ var MenuItemsControl = ({ label }) => {
|
|
|
6916
7002
|
});
|
|
6917
7003
|
}
|
|
6918
7004
|
if (meta?.action?.type === "remove") {
|
|
6919
|
-
return removeItem2({ items: meta.action.payload });
|
|
7005
|
+
return removeItem2({ menuItemsId: menuItems.id, items: meta.action.payload });
|
|
6920
7006
|
}
|
|
6921
7007
|
if (meta?.action?.type === "duplicate") {
|
|
6922
7008
|
return duplicateItem2({ items: meta.action.payload });
|
|
@@ -6958,12 +7044,12 @@ var ItemContent3 = ({ value }) => {
|
|
|
6958
7044
|
if (!value.id) {
|
|
6959
7045
|
return null;
|
|
6960
7046
|
}
|
|
6961
|
-
return /* @__PURE__ */ React98.createElement(Stack17, { p: 2, gap: 1.5 }, /* @__PURE__ */ React98.createElement(ItemNameControl2, { elementId: value.id }));
|
|
7047
|
+
return /* @__PURE__ */ React98.createElement(Stack17, { p: 2, gap: 1.5 }, /* @__PURE__ */ React98.createElement(ItemNameControl2, { elementId: value.id }), /* @__PURE__ */ React98.createElement(ItemLinkControl, { entryId: value.id }));
|
|
6962
7048
|
};
|
|
6963
7049
|
var ItemNameControl2 = ({ elementId }) => {
|
|
6964
7050
|
const editorSettings = useElementEditorSettings4(elementId);
|
|
6965
7051
|
const inputId = useId3();
|
|
6966
|
-
return /* @__PURE__ */ React98.createElement(Stack17, { gap: 1 }, /* @__PURE__ */ React98.createElement(ControlFormLabel5, { htmlFor: inputId }, __76("
|
|
7052
|
+
return /* @__PURE__ */ React98.createElement(Stack17, { gap: 1 }, /* @__PURE__ */ React98.createElement(ControlFormLabel5, { htmlFor: inputId }, __76("Item name", "elementor")), /* @__PURE__ */ React98.createElement(
|
|
6967
7053
|
TextField4,
|
|
6968
7054
|
{
|
|
6969
7055
|
id: inputId,
|
|
@@ -6975,6 +7061,37 @@ var ItemNameControl2 = ({ elementId }) => {
|
|
|
6975
7061
|
}
|
|
6976
7062
|
));
|
|
6977
7063
|
};
|
|
7064
|
+
var ItemLinkControl = ({ entryId }) => {
|
|
7065
|
+
const { itemId, settings } = useEntryItem(entryId);
|
|
7066
|
+
const elementType = itemId ? getElementType2(MENU_ITEM_ELEMENT_TYPE) : null;
|
|
7067
|
+
const linkControl = elementType ? findControlByBind(elementType.controls, LINK_BIND) : null;
|
|
7068
|
+
if (!itemId || !elementType || !linkControl) {
|
|
7069
|
+
return null;
|
|
7070
|
+
}
|
|
7071
|
+
return /* @__PURE__ */ React98.createElement(
|
|
7072
|
+
ElementProvider,
|
|
7073
|
+
{
|
|
7074
|
+
element: { id: itemId, type: MENU_ITEM_ELEMENT_TYPE },
|
|
7075
|
+
elementType,
|
|
7076
|
+
settings
|
|
7077
|
+
},
|
|
7078
|
+
/* @__PURE__ */ React98.createElement(SessionStorageProvider4, { prefix: itemId }, /* @__PURE__ */ React98.createElement(SettingsControl, { control: linkControl }))
|
|
7079
|
+
);
|
|
7080
|
+
};
|
|
7081
|
+
var findControlByBind = (items3, bind) => {
|
|
7082
|
+
for (const item of items3) {
|
|
7083
|
+
if (item.type === "section") {
|
|
7084
|
+
const found = findControlByBind(item.value.items, bind);
|
|
7085
|
+
if (found) {
|
|
7086
|
+
return found;
|
|
7087
|
+
}
|
|
7088
|
+
}
|
|
7089
|
+
if (item.type === "control" && item.value.bind === bind) {
|
|
7090
|
+
return item;
|
|
7091
|
+
}
|
|
7092
|
+
}
|
|
7093
|
+
return null;
|
|
7094
|
+
};
|
|
6978
7095
|
|
|
6979
7096
|
// src/controls-registry/element-controls/tabs-control/tabs-control.tsx
|
|
6980
7097
|
import * as React99 from "react";
|
|
@@ -6998,7 +7115,7 @@ import { useBoundProp as useBoundProp7 } from "@elementor/editor-controls";
|
|
|
6998
7115
|
import {
|
|
6999
7116
|
createElements as createElements4,
|
|
7000
7117
|
duplicateElements as duplicateElements4,
|
|
7001
|
-
getContainer as
|
|
7118
|
+
getContainer as getContainer10,
|
|
7002
7119
|
moveElements as moveElements4,
|
|
7003
7120
|
removeElements as removeElements4
|
|
7004
7121
|
} from "@elementor/editor-elements";
|
|
@@ -7019,7 +7136,7 @@ var useActions3 = () => {
|
|
|
7019
7136
|
});
|
|
7020
7137
|
items3.forEach(({ item, index }) => {
|
|
7021
7138
|
const tabId = item.id;
|
|
7022
|
-
const tabContentAreaContainer =
|
|
7139
|
+
const tabContentAreaContainer = getContainer10(tabContentAreaId);
|
|
7023
7140
|
const tabContentId = tabContentAreaContainer?.children?.[index]?.id;
|
|
7024
7141
|
if (!tabContentId) {
|
|
7025
7142
|
throw new Error("Original content ID is required for duplication");
|
|
@@ -7047,10 +7164,10 @@ var useActions3 = () => {
|
|
|
7047
7164
|
movedElementId,
|
|
7048
7165
|
movedElementIndex
|
|
7049
7166
|
}) => {
|
|
7050
|
-
const tabContentContainer =
|
|
7167
|
+
const tabContentContainer = getContainer10(tabContentAreaId);
|
|
7051
7168
|
const tabContent = tabContentContainer?.children?.[movedElementIndex];
|
|
7052
|
-
const movedElement =
|
|
7053
|
-
const tabsMenu =
|
|
7169
|
+
const movedElement = getContainer10(movedElementId);
|
|
7170
|
+
const tabsMenu = getContainer10(tabsMenuId);
|
|
7054
7171
|
if (!tabContent) {
|
|
7055
7172
|
throw new Error("Content element is required");
|
|
7056
7173
|
}
|
|
@@ -7100,7 +7217,7 @@ var useActions3 = () => {
|
|
|
7100
7217
|
title: __77("Tabs", "elementor"),
|
|
7101
7218
|
elementIds: items3.flatMap(({ item, index }) => {
|
|
7102
7219
|
const tabId = item.id;
|
|
7103
|
-
const tabContentContainer =
|
|
7220
|
+
const tabContentContainer = getContainer10(tabContentAreaId);
|
|
7104
7221
|
const tabContentId = tabContentContainer?.children?.[index]?.id;
|
|
7105
7222
|
if (!tabContentId) {
|
|
7106
7223
|
throw new Error("Content ID is required");
|
|
@@ -7124,8 +7241,8 @@ var useActions3 = () => {
|
|
|
7124
7241
|
tabsMenuId,
|
|
7125
7242
|
items: items3
|
|
7126
7243
|
}) => {
|
|
7127
|
-
const tabContentArea =
|
|
7128
|
-
const tabsMenu =
|
|
7244
|
+
const tabContentArea = getContainer10(tabContentAreaId);
|
|
7245
|
+
const tabsMenu = getContainer10(tabsMenuId);
|
|
7129
7246
|
if (!tabContentArea || !tabsMenu) {
|
|
7130
7247
|
throw new Error("Tab containers not found");
|
|
7131
7248
|
}
|
|
@@ -8816,6 +8933,7 @@ var init3 = () => {
|
|
|
8816
8933
|
|
|
8817
8934
|
// src/init.ts
|
|
8818
8935
|
function init4() {
|
|
8936
|
+
initEditorControls();
|
|
8819
8937
|
registerPanel(panel);
|
|
8820
8938
|
blockV1Panel();
|
|
8821
8939
|
injectIntoLogic({
|
|
@@ -8840,6 +8958,7 @@ export {
|
|
|
8840
8958
|
ControlLabel,
|
|
8841
8959
|
ControlTypeContainer,
|
|
8842
8960
|
CreatableAutocomplete,
|
|
8961
|
+
CustomCssHeaderSlot,
|
|
8843
8962
|
CustomCssIndicator,
|
|
8844
8963
|
DEFAULT_PSEUDO_STATES,
|
|
8845
8964
|
EditingPanelTabs,
|
|
@@ -8875,9 +8994,12 @@ export {
|
|
|
8875
8994
|
init4 as init,
|
|
8876
8995
|
injectIntoClassSelectorActions,
|
|
8877
8996
|
injectIntoCssClassConvert,
|
|
8997
|
+
injectIntoCustomCssHeader,
|
|
8878
8998
|
injectIntoGridFields,
|
|
8879
8999
|
injectIntoPanelHeaderTop,
|
|
9000
|
+
injectIntoStyleSectionHeader,
|
|
8880
9001
|
injectIntoStyleTab,
|
|
9002
|
+
injectIntoStyleTabHeader,
|
|
8881
9003
|
isDynamicPropValue,
|
|
8882
9004
|
registerEditingPanelReplacement,
|
|
8883
9005
|
registerElementPanelDefaults,
|