@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.js
CHANGED
|
@@ -35,6 +35,7 @@ __export(index_exports, {
|
|
|
35
35
|
ControlLabel: () => ControlLabel,
|
|
36
36
|
ControlTypeContainer: () => ControlTypeContainer,
|
|
37
37
|
CreatableAutocomplete: () => CreatableAutocomplete,
|
|
38
|
+
CustomCssHeaderSlot: () => CustomCssHeaderSlot,
|
|
38
39
|
CustomCssIndicator: () => CustomCssIndicator,
|
|
39
40
|
DEFAULT_PSEUDO_STATES: () => DEFAULT_PSEUDO_STATES,
|
|
40
41
|
EditingPanelTabs: () => EditingPanelTabs,
|
|
@@ -70,9 +71,12 @@ __export(index_exports, {
|
|
|
70
71
|
init: () => init4,
|
|
71
72
|
injectIntoClassSelectorActions: () => injectIntoClassSelectorActions,
|
|
72
73
|
injectIntoCssClassConvert: () => injectIntoCssClassConvert,
|
|
74
|
+
injectIntoCustomCssHeader: () => injectIntoCustomCssHeader,
|
|
73
75
|
injectIntoGridFields: () => injectIntoGridFields,
|
|
74
76
|
injectIntoPanelHeaderTop: () => injectIntoPanelHeaderTop,
|
|
77
|
+
injectIntoStyleSectionHeader: () => injectIntoStyleSectionHeader,
|
|
75
78
|
injectIntoStyleTab: () => injectIntoStyleTab,
|
|
79
|
+
injectIntoStyleTabHeader: () => injectIntoStyleTabHeader,
|
|
76
80
|
isDynamicPropValue: () => isDynamicPropValue,
|
|
77
81
|
registerEditingPanelReplacement: () => registerEditingPanelReplacement,
|
|
78
82
|
registerElementPanelDefaults: () => registerElementPanelDefaults,
|
|
@@ -587,7 +591,7 @@ var import_react10 = require("react");
|
|
|
587
591
|
var import_editor_styles_repository11 = require("@elementor/editor-styles-repository");
|
|
588
592
|
var import_editor_ui4 = require("@elementor/editor-ui");
|
|
589
593
|
var import_icons4 = require("@elementor/icons");
|
|
590
|
-
var
|
|
594
|
+
var import_locations3 = require("@elementor/locations");
|
|
591
595
|
var import_ui9 = require("@elementor/ui");
|
|
592
596
|
var import_i18n8 = require("@wordpress/i18n");
|
|
593
597
|
|
|
@@ -632,6 +636,14 @@ var trackStyles = (provider, event, data) => {
|
|
|
632
636
|
providerInstance?.actions.tracking?.({ event, ...data });
|
|
633
637
|
};
|
|
634
638
|
|
|
639
|
+
// src/components/style-tab-header-location.tsx
|
|
640
|
+
var import_locations2 = require("@elementor/locations");
|
|
641
|
+
var {
|
|
642
|
+
Slot: StyleTabHeaderSlot,
|
|
643
|
+
inject: injectIntoStyleTabHeader,
|
|
644
|
+
useInjections: useStyleTabHeaderInjections
|
|
645
|
+
} = (0, import_locations2.createLocation)();
|
|
646
|
+
|
|
635
647
|
// src/components/css-classes/css-class-item.tsx
|
|
636
648
|
var React11 = __toESM(require("react"));
|
|
637
649
|
var import_react9 = require("react");
|
|
@@ -1404,8 +1416,9 @@ var EMPTY_OPTION = {
|
|
|
1404
1416
|
icon: /* @__PURE__ */ React13.createElement(import_icons4.MapPinIcon, null),
|
|
1405
1417
|
provider: null
|
|
1406
1418
|
};
|
|
1407
|
-
var { Slot: ClassSelectorActionsSlot, inject: injectIntoClassSelectorActions } = (0,
|
|
1419
|
+
var { Slot: ClassSelectorActionsSlot, inject: injectIntoClassSelectorActions } = (0, import_locations3.createLocation)();
|
|
1408
1420
|
function CssClassSelector() {
|
|
1421
|
+
const { element } = useElement();
|
|
1409
1422
|
const options13 = useOptions();
|
|
1410
1423
|
const { id: activeId, setId: setActiveId } = useStyle();
|
|
1411
1424
|
const autocompleteRef = (0, import_react10.useRef)(null);
|
|
@@ -1423,7 +1436,7 @@ function CssClassSelector() {
|
|
|
1423
1436
|
const clearMissingClasses = (0, import_react10.useCallback)(() => {
|
|
1424
1437
|
unapplyClasses(missingClassesIds);
|
|
1425
1438
|
}, [missingClassesIds, unapplyClasses]);
|
|
1426
|
-
return /* @__PURE__ */ React13.createElement(import_ui9.Stack, { p: 2 }, /* @__PURE__ */ React13.createElement(import_ui9.Stack, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React13.createElement(import_ui9.FormLabel, { htmlFor: ID, size: "small" }, (0, import_i18n8.__)("Classes", "elementor")), /* @__PURE__ */ React13.createElement(import_ui9.Stack, { direction: "row", gap: 1 }, /* @__PURE__ */ React13.createElement(ClassSelectorActionsSlot, null))), /* @__PURE__ */ React13.createElement(
|
|
1439
|
+
return /* @__PURE__ */ React13.createElement(import_ui9.Stack, { p: 2 }, /* @__PURE__ */ React13.createElement(import_ui9.Stack, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React13.createElement(import_ui9.FormLabel, { htmlFor: ID, size: "small" }, (0, import_i18n8.__)("Classes", "elementor")), /* @__PURE__ */ React13.createElement(import_ui9.Stack, { direction: "row", gap: 1 }, /* @__PURE__ */ React13.createElement(StyleTabHeaderSlot, { elementId: element.id }), /* @__PURE__ */ React13.createElement(ClassSelectorActionsSlot, null))), /* @__PURE__ */ React13.createElement(
|
|
1427
1440
|
import_editor_ui4.WarningInfotip,
|
|
1428
1441
|
{
|
|
1429
1442
|
open: Boolean(renameError),
|
|
@@ -1980,7 +1993,7 @@ var import_editor_elements16 = require("@elementor/editor-elements");
|
|
|
1980
1993
|
var import_editor_panels = require("@elementor/editor-panels");
|
|
1981
1994
|
var import_editor_ui9 = require("@elementor/editor-ui");
|
|
1982
1995
|
var import_icons28 = require("@elementor/icons");
|
|
1983
|
-
var
|
|
1996
|
+
var import_locations7 = require("@elementor/locations");
|
|
1984
1997
|
var import_menus = require("@elementor/menus");
|
|
1985
1998
|
var import_session9 = require("@elementor/session");
|
|
1986
1999
|
var import_ui46 = require("@elementor/ui");
|
|
@@ -2019,7 +2032,7 @@ var EditingPanelStickyPromotion = () => {
|
|
|
2019
2032
|
};
|
|
2020
2033
|
|
|
2021
2034
|
// src/components/editing-panel-tabs.tsx
|
|
2022
|
-
var
|
|
2035
|
+
var import_react39 = require("react");
|
|
2023
2036
|
var React92 = __toESM(require("react"));
|
|
2024
2037
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
2025
2038
|
var import_editor_elements15 = require("@elementor/editor-elements");
|
|
@@ -2417,7 +2430,15 @@ var React21 = __toESM(require("react"));
|
|
|
2417
2430
|
var import_react18 = require("react");
|
|
2418
2431
|
var import_editor_ui5 = require("@elementor/editor-ui");
|
|
2419
2432
|
var import_ui14 = require("@elementor/ui");
|
|
2420
|
-
function Section({
|
|
2433
|
+
function Section({
|
|
2434
|
+
title,
|
|
2435
|
+
children,
|
|
2436
|
+
defaultExpanded = false,
|
|
2437
|
+
titleEnd,
|
|
2438
|
+
titleActions,
|
|
2439
|
+
unmountOnExit = true,
|
|
2440
|
+
action
|
|
2441
|
+
}) {
|
|
2421
2442
|
const [isOpen, setIsOpen] = useStateByElement(title, !!defaultExpanded);
|
|
2422
2443
|
const ref = (0, import_react18.useRef)(null);
|
|
2423
2444
|
const isDisabled = !!action;
|
|
@@ -2447,7 +2468,15 @@ function Section({ title, children, defaultExpanded = false, titleEnd, unmountOn
|
|
|
2447
2468
|
secondaryTypographyProps: { color: "text.primary", variant: "caption", fontWeight: "bold" },
|
|
2448
2469
|
sx: { flexGrow: 0, flexShrink: 1, marginInlineEnd: 1 }
|
|
2449
2470
|
}
|
|
2450
|
-
), (0, import_editor_ui5.getCollapsibleValue)(titleEnd, isOpen)
|
|
2471
|
+
), (0, import_editor_ui5.getCollapsibleValue)(titleEnd, isOpen), titleActions && /* @__PURE__ */ React21.createElement(
|
|
2472
|
+
import_ui14.Stack,
|
|
2473
|
+
{
|
|
2474
|
+
direction: "row",
|
|
2475
|
+
alignItems: "center",
|
|
2476
|
+
onClick: (event) => event.stopPropagation()
|
|
2477
|
+
},
|
|
2478
|
+
titleActions
|
|
2479
|
+
)),
|
|
2451
2480
|
action?.component,
|
|
2452
2481
|
/* @__PURE__ */ React21.createElement(
|
|
2453
2482
|
import_editor_ui5.CollapseIcon,
|
|
@@ -2510,7 +2539,7 @@ var controlTypes = {
|
|
|
2510
2539
|
toggle: { component: import_editor_controls2.ToggleControl, layout: "full", propTypeUtil: import_editor_props6.stringPropTypeUtil },
|
|
2511
2540
|
"date-time": { component: import_editor_controls2.DateTimeControl, layout: "full", propTypeUtil: import_editor_props6.DateTimePropTypeUtil },
|
|
2512
2541
|
video: { component: import_editor_controls2.VideoMediaControl, layout: "full", propTypeUtil: import_editor_props6.videoSrcPropTypeUtil },
|
|
2513
|
-
"inline-editing": { component: import_editor_controls2.InlineEditingControl, layout: "
|
|
2542
|
+
"inline-editing": { component: import_editor_controls2.InlineEditingControl, layout: "custom", propTypeUtil: import_editor_props6.escapedHtmlPropTypeUtil },
|
|
2514
2543
|
email: { component: import_editor_controls2.EmailFormActionControl, layout: "custom", propTypeUtil: import_editor_props6.emailsPropTypeUtil },
|
|
2515
2544
|
"date-range": {
|
|
2516
2545
|
component: import_editor_controls2.DateRangeControl,
|
|
@@ -2870,10 +2899,10 @@ function isControlHiddenByDependencies(control, propsSchema, settings, elementId
|
|
|
2870
2899
|
|
|
2871
2900
|
// src/components/style-tab.tsx
|
|
2872
2901
|
var React91 = __toESM(require("react"));
|
|
2873
|
-
var
|
|
2902
|
+
var import_react38 = require("react");
|
|
2874
2903
|
var import_editor_props17 = require("@elementor/editor-props");
|
|
2875
2904
|
var import_editor_responsive4 = require("@elementor/editor-responsive");
|
|
2876
|
-
var
|
|
2905
|
+
var import_locations6 = require("@elementor/locations");
|
|
2877
2906
|
var import_session8 = require("@elementor/session");
|
|
2878
2907
|
var import_ui44 = require("@elementor/ui");
|
|
2879
2908
|
|
|
@@ -3709,7 +3738,7 @@ var EffectsSection = () => {
|
|
|
3709
3738
|
var React62 = __toESM(require("react"));
|
|
3710
3739
|
var import_editor_controls31 = require("@elementor/editor-controls");
|
|
3711
3740
|
var import_editor_elements14 = require("@elementor/editor-elements");
|
|
3712
|
-
var
|
|
3741
|
+
var import_locations4 = require("@elementor/locations");
|
|
3713
3742
|
var import_i18n39 = require("@wordpress/i18n");
|
|
3714
3743
|
|
|
3715
3744
|
// src/hooks/use-computed-style.ts
|
|
@@ -4868,7 +4897,7 @@ var WrapField = () => {
|
|
|
4868
4897
|
var DISPLAY_LABEL2 = (0, import_i18n39.__)("Display", "elementor");
|
|
4869
4898
|
var FLEX_WRAP_LABEL2 = (0, import_i18n39.__)("Flex wrap", "elementor");
|
|
4870
4899
|
var DEFAULT_PARENT_FLOW_DIRECTION = "row";
|
|
4871
|
-
var { Slot: GridFieldsSlot, inject: injectIntoGridFields } = (0,
|
|
4900
|
+
var { Slot: GridFieldsSlot, inject: injectIntoGridFields } = (0, import_locations4.createLocation)();
|
|
4872
4901
|
var LayoutSection = () => {
|
|
4873
4902
|
const { value: display } = useStylesField("display", {
|
|
4874
4903
|
history: { propDisplayName: DISPLAY_LABEL2 }
|
|
@@ -5684,8 +5713,25 @@ var STYLE_SECTION_NAMES = STYLE_SECTIONS.map((section) => section.name);
|
|
|
5684
5713
|
|
|
5685
5714
|
// src/components/style-tab-section.tsx
|
|
5686
5715
|
var React89 = __toESM(require("react"));
|
|
5716
|
+
|
|
5717
|
+
// src/components/style-section-header-location.tsx
|
|
5718
|
+
var import_react37 = require("react");
|
|
5719
|
+
var import_locations5 = require("@elementor/locations");
|
|
5720
|
+
var { Slot: StyleSectionHeaderSlot, inject: injectStyleSectionHeader } = (0, import_locations5.createLocation)();
|
|
5721
|
+
var injectIntoStyleSectionHeader = ({ id, component, sections, options: options13 }) => {
|
|
5722
|
+
const filteredComponent = (props) => {
|
|
5723
|
+
if (sections && !sections.includes(props.sectionName)) {
|
|
5724
|
+
return null;
|
|
5725
|
+
}
|
|
5726
|
+
return (0, import_react37.createElement)(component, props);
|
|
5727
|
+
};
|
|
5728
|
+
injectStyleSectionHeader({ id, component: filteredComponent, options: options13 });
|
|
5729
|
+
};
|
|
5730
|
+
|
|
5731
|
+
// src/components/style-tab-section.tsx
|
|
5687
5732
|
var StyleTabSection = ({ section, fields = [], unmountOnExit = true }) => {
|
|
5688
5733
|
const { component, name, title, action } = section;
|
|
5734
|
+
const { element } = useElement();
|
|
5689
5735
|
const tabDefaults = useDefaultPanelSettings();
|
|
5690
5736
|
const SectionComponent = component || (() => /* @__PURE__ */ React89.createElement(React89.Fragment, null));
|
|
5691
5737
|
const isExpanded = tabDefaults.defaultSectionsExpanded.style?.includes(name);
|
|
@@ -5695,6 +5741,7 @@ var StyleTabSection = ({ section, fields = [], unmountOnExit = true }) => {
|
|
|
5695
5741
|
title,
|
|
5696
5742
|
defaultExpanded: isExpanded,
|
|
5697
5743
|
titleEnd: getStylesInheritanceIndicators(fields),
|
|
5744
|
+
titleActions: element ? /* @__PURE__ */ React89.createElement(StyleSectionHeaderSlot, { elementId: element.id, sectionName: name }) : void 0,
|
|
5698
5745
|
unmountOnExit,
|
|
5699
5746
|
action
|
|
5700
5747
|
},
|
|
@@ -5720,7 +5767,7 @@ var StyleSections = () => {
|
|
|
5720
5767
|
|
|
5721
5768
|
// src/components/style-tab.tsx
|
|
5722
5769
|
var TABS_HEADER_HEIGHT = "37px";
|
|
5723
|
-
var { Slot: StyleTabSlot, inject: injectIntoStyleTab } = (0,
|
|
5770
|
+
var { Slot: StyleTabSlot, inject: injectIntoStyleTab } = (0, import_locations6.createLocation)();
|
|
5724
5771
|
var stickyHeaderStyles = {
|
|
5725
5772
|
position: "sticky",
|
|
5726
5773
|
zIndex: 1100,
|
|
@@ -5731,7 +5778,7 @@ var stickyHeaderStyles = {
|
|
|
5731
5778
|
var StyleTab = () => {
|
|
5732
5779
|
const currentClassesProp = useCurrentClassesProp();
|
|
5733
5780
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp ?? "");
|
|
5734
|
-
const [activeStyleState, setActiveStyleState] = (0,
|
|
5781
|
+
const [activeStyleState, setActiveStyleState] = (0, import_react38.useState)(null);
|
|
5735
5782
|
const breakpoint = (0, import_editor_responsive4.useActiveBreakpoint)();
|
|
5736
5783
|
if (!currentClassesProp) {
|
|
5737
5784
|
return null;
|
|
@@ -5782,7 +5829,7 @@ var EditingPanelTabs = () => {
|
|
|
5782
5829
|
return (
|
|
5783
5830
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
5784
5831
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
5785
|
-
/* @__PURE__ */ React92.createElement(
|
|
5832
|
+
/* @__PURE__ */ React92.createElement(import_react39.Fragment, { key: element.id }, /* @__PURE__ */ React92.createElement(PanelTabContent, null))
|
|
5786
5833
|
);
|
|
5787
5834
|
};
|
|
5788
5835
|
var PanelTabContent = () => {
|
|
@@ -5851,7 +5898,7 @@ var resolveCurrentTab = ({
|
|
|
5851
5898
|
};
|
|
5852
5899
|
|
|
5853
5900
|
// src/components/editing-panel.tsx
|
|
5854
|
-
var { Slot: PanelHeaderTopSlot, inject: injectIntoPanelHeaderTop } = (0,
|
|
5901
|
+
var { Slot: PanelHeaderTopSlot, inject: injectIntoPanelHeaderTop } = (0, import_locations7.createLocation)();
|
|
5855
5902
|
var { useMenuItems } = import_menus.controlActionsMenu;
|
|
5856
5903
|
var EditingPanel = () => {
|
|
5857
5904
|
const { element, elementType, settings } = (0, import_editor_elements16.useSelectedElementSettings)();
|
|
@@ -5901,13 +5948,22 @@ function PseudoStateMenuItems({ states, activeState, onSelectState, onClose }) {
|
|
|
5901
5948
|
)));
|
|
5902
5949
|
}
|
|
5903
5950
|
|
|
5951
|
+
// src/components/custom-css-header-location.tsx
|
|
5952
|
+
var import_locations8 = require("@elementor/locations");
|
|
5953
|
+
var {
|
|
5954
|
+
Slot: CustomCssHeaderSlot,
|
|
5955
|
+
inject: injectIntoCustomCssHeader,
|
|
5956
|
+
useInjections: useCustomCssHeaderInjections
|
|
5957
|
+
} = (0, import_locations8.createLocation)();
|
|
5958
|
+
|
|
5904
5959
|
// src/init.ts
|
|
5905
5960
|
var import_editor = require("@elementor/editor");
|
|
5961
|
+
var import_editor_controls72 = require("@elementor/editor-controls");
|
|
5906
5962
|
var import_editor_panels3 = require("@elementor/editor-panels");
|
|
5907
|
-
var
|
|
5963
|
+
var import_editor_v1_adapters15 = require("@elementor/editor-v1-adapters");
|
|
5908
5964
|
|
|
5909
5965
|
// src/hooks/use-open-editor-panel.ts
|
|
5910
|
-
var
|
|
5966
|
+
var import_react40 = require("react");
|
|
5911
5967
|
var import_editor_v1_adapters9 = require("@elementor/editor-v1-adapters");
|
|
5912
5968
|
|
|
5913
5969
|
// src/panel.ts
|
|
@@ -5931,7 +5987,7 @@ var isAtomicWidgetSelected = () => {
|
|
|
5931
5987
|
// src/hooks/use-open-editor-panel.ts
|
|
5932
5988
|
var useOpenEditorPanel = () => {
|
|
5933
5989
|
const { open } = usePanelActions();
|
|
5934
|
-
(0,
|
|
5990
|
+
(0, import_react40.useEffect)(() => {
|
|
5935
5991
|
return (0, import_editor_v1_adapters9.__privateListenTo)((0, import_editor_v1_adapters9.commandStartEvent)("panel/editor/open"), () => {
|
|
5936
5992
|
if (isAtomicWidgetSelected()) {
|
|
5937
5993
|
open();
|
|
@@ -5951,12 +6007,12 @@ var import_editor_controls57 = require("@elementor/editor-controls");
|
|
|
5951
6007
|
|
|
5952
6008
|
// src/components/promotions/custom-css.tsx
|
|
5953
6009
|
var React95 = __toESM(require("react"));
|
|
5954
|
-
var
|
|
6010
|
+
var import_react41 = require("react");
|
|
5955
6011
|
var import_editor_controls56 = require("@elementor/editor-controls");
|
|
5956
6012
|
var import_i18n68 = require("@wordpress/i18n");
|
|
5957
6013
|
var TRACKING_DATA = { target_name: "custom_css", location_l2: "style" };
|
|
5958
6014
|
var CustomCssSection = () => {
|
|
5959
|
-
const triggerRef = (0,
|
|
6015
|
+
const triggerRef = (0, import_react41.useRef)(null);
|
|
5960
6016
|
return /* @__PURE__ */ React95.createElement(
|
|
5961
6017
|
StyleTabSection,
|
|
5962
6018
|
{
|
|
@@ -6162,7 +6218,7 @@ var useActions = () => {
|
|
|
6162
6218
|
};
|
|
6163
6219
|
|
|
6164
6220
|
// src/controls-registry/element-controls/accordion-items-control/use-show-icon-write-through.ts
|
|
6165
|
-
var
|
|
6221
|
+
var import_react42 = require("react");
|
|
6166
6222
|
var import_editor_elements19 = require("@elementor/editor-elements");
|
|
6167
6223
|
var import_editor_props19 = require("@elementor/editor-props");
|
|
6168
6224
|
var import_editor_v1_adapters10 = require("@elementor/editor-v1-adapters");
|
|
@@ -6268,8 +6324,8 @@ var cascadeDifferentOpenIconToHeaders = (0, import_editor_v1_adapters10.undoable
|
|
|
6268
6324
|
}
|
|
6269
6325
|
);
|
|
6270
6326
|
function useDifferentOpenIconWriteThrough(accordionId, differentOpenIcon) {
|
|
6271
|
-
const previousRef = (0,
|
|
6272
|
-
(0,
|
|
6327
|
+
const previousRef = (0, import_react42.useRef)(null);
|
|
6328
|
+
(0, import_react42.useEffect)(() => {
|
|
6273
6329
|
const previous = previousRef.current;
|
|
6274
6330
|
previousRef.current = { accordionId, differentOpenIcon };
|
|
6275
6331
|
if (!previous || previous.accordionId !== accordionId || previous.differentOpenIcon === differentOpenIcon) {
|
|
@@ -6279,8 +6335,8 @@ function useDifferentOpenIconWriteThrough(accordionId, differentOpenIcon) {
|
|
|
6279
6335
|
}, [accordionId, differentOpenIcon]);
|
|
6280
6336
|
}
|
|
6281
6337
|
function useShowIconWriteThrough(accordionId, showIcon) {
|
|
6282
|
-
const previousRef = (0,
|
|
6283
|
-
(0,
|
|
6338
|
+
const previousRef = (0, import_react42.useRef)(null);
|
|
6339
|
+
(0, import_react42.useEffect)(() => {
|
|
6284
6340
|
const previous = previousRef.current;
|
|
6285
6341
|
previousRef.current = { accordionId, showIcon };
|
|
6286
6342
|
if (!previous || previous.accordionId !== accordionId || previous.showIcon === showIcon) {
|
|
@@ -6523,7 +6579,7 @@ var addItem = ({
|
|
|
6523
6579
|
};
|
|
6524
6580
|
|
|
6525
6581
|
// src/controls-registry/element-controls/list-items-control/use-show-markers-write-through.ts
|
|
6526
|
-
var
|
|
6582
|
+
var import_react43 = require("react");
|
|
6527
6583
|
var import_editor_elements22 = require("@elementor/editor-elements");
|
|
6528
6584
|
var import_editor_props22 = require("@elementor/editor-props");
|
|
6529
6585
|
var import_editor_v1_adapters11 = require("@elementor/editor-v1-adapters");
|
|
@@ -6575,8 +6631,8 @@ function getListItemIds(listId) {
|
|
|
6575
6631
|
return itemContainers.map((item) => item.id);
|
|
6576
6632
|
}
|
|
6577
6633
|
function useShowMarkersWriteThrough(listId, showMarkers) {
|
|
6578
|
-
const previousRef = (0,
|
|
6579
|
-
(0,
|
|
6634
|
+
const previousRef = (0, import_react43.useRef)(null);
|
|
6635
|
+
(0, import_react43.useEffect)(() => {
|
|
6580
6636
|
const previous = previousRef.current;
|
|
6581
6637
|
previousRef.current = { listId, showMarkers };
|
|
6582
6638
|
if (!previous || previous.listId !== listId || previous.showMarkers === showMarkers) {
|
|
@@ -6689,9 +6745,10 @@ var ListItemLabelControl = ({ elementId, fallbackLabel }) => {
|
|
|
6689
6745
|
|
|
6690
6746
|
// src/controls-registry/element-controls/menu-items-control/menu-items-control.tsx
|
|
6691
6747
|
var React98 = __toESM(require("react"));
|
|
6692
|
-
var
|
|
6748
|
+
var import_react44 = require("react");
|
|
6693
6749
|
var import_editor_controls60 = require("@elementor/editor-controls");
|
|
6694
|
-
var
|
|
6750
|
+
var import_editor_elements27 = require("@elementor/editor-elements");
|
|
6751
|
+
var import_session10 = require("@elementor/session");
|
|
6695
6752
|
var import_ui50 = require("@elementor/ui");
|
|
6696
6753
|
var import_i18n76 = require("@wordpress/i18n");
|
|
6697
6754
|
|
|
@@ -6715,6 +6772,7 @@ var import_i18n75 = require("@wordpress/i18n");
|
|
|
6715
6772
|
var MENU_ITEMS_ELEMENT_TYPE = "e-menu-items";
|
|
6716
6773
|
var MENU_ENTRY_ELEMENT_TYPE = "e-menu-entry";
|
|
6717
6774
|
var MENU_ITEM_ELEMENT_TYPE = "e-menu-item";
|
|
6775
|
+
var MIN_ENTRIES = 1;
|
|
6718
6776
|
var PARAGRAPH_WIDGET_TYPE3 = "e-paragraph";
|
|
6719
6777
|
var getEntryTitle = () => (0, import_i18n75.__)("Menu item", "elementor");
|
|
6720
6778
|
var buildEntryModel = (title) => ({
|
|
@@ -6758,10 +6816,17 @@ var useActions2 = () => {
|
|
|
6758
6816
|
});
|
|
6759
6817
|
});
|
|
6760
6818
|
};
|
|
6761
|
-
const removeItem2 = ({ items: items3 }) => {
|
|
6819
|
+
const removeItem2 = ({ menuItemsId, items: items3 }) => {
|
|
6820
|
+
const entriesCount = (0, import_editor_elements25.getContainer)(menuItemsId)?.children?.filter(
|
|
6821
|
+
(child) => child.model.get("elType") === MENU_ENTRY_ELEMENT_TYPE
|
|
6822
|
+
).length ?? 0;
|
|
6823
|
+
const removableCount = Math.max(0, Math.min(items3.length, entriesCount - MIN_ENTRIES));
|
|
6824
|
+
if (removableCount === 0) {
|
|
6825
|
+
return;
|
|
6826
|
+
}
|
|
6762
6827
|
(0, import_editor_elements25.removeElements)({
|
|
6763
6828
|
title: (0, import_i18n75.__)("Menu", "elementor"),
|
|
6764
|
-
elementIds: items3.map(({ item }) => item.id)
|
|
6829
|
+
elementIds: items3.slice(0, removableCount).map(({ item }) => item.id)
|
|
6765
6830
|
});
|
|
6766
6831
|
};
|
|
6767
6832
|
const duplicateItem2 = ({ items: items3 }) => {
|
|
@@ -6794,11 +6859,35 @@ var useActions2 = () => {
|
|
|
6794
6859
|
return { addItem: addItem2, removeItem: removeItem2, duplicateItem: duplicateItem2, moveItem: moveItem2 };
|
|
6795
6860
|
};
|
|
6796
6861
|
|
|
6862
|
+
// src/controls-registry/element-controls/menu-items-control/use-entry-item.ts
|
|
6863
|
+
var import_editor_elements26 = require("@elementor/editor-elements");
|
|
6864
|
+
var import_editor_v1_adapters12 = require("@elementor/editor-v1-adapters");
|
|
6865
|
+
var useEntryItem = (entryId) => {
|
|
6866
|
+
return (0, import_editor_v1_adapters12.__privateUseListenTo)(
|
|
6867
|
+
[(0, import_editor_v1_adapters12.commandEndEvent)("document/elements/set-settings"), (0, import_editor_v1_adapters12.commandEndEvent)("document/elements/settings")],
|
|
6868
|
+
() => {
|
|
6869
|
+
const item = (0, import_editor_elements26.getContainer)(entryId)?.children?.find(
|
|
6870
|
+
(child) => child.model.get("elType") === MENU_ITEM_ELEMENT_TYPE
|
|
6871
|
+
);
|
|
6872
|
+
return {
|
|
6873
|
+
itemId: item?.id ?? null,
|
|
6874
|
+
settings: item ? getEntrySettings(item.id) : {}
|
|
6875
|
+
};
|
|
6876
|
+
},
|
|
6877
|
+
[entryId]
|
|
6878
|
+
);
|
|
6879
|
+
};
|
|
6880
|
+
var getEntrySettings = (itemId) => {
|
|
6881
|
+
const propsSchema = (0, import_editor_elements26.getElementType)(MENU_ITEM_ELEMENT_TYPE)?.propsSchema ?? {};
|
|
6882
|
+
return (0, import_editor_elements26.getElementSettings)(itemId, Object.keys(propsSchema));
|
|
6883
|
+
};
|
|
6884
|
+
|
|
6797
6885
|
// src/controls-registry/element-controls/menu-items-control/menu-items-control.tsx
|
|
6886
|
+
var LINK_BIND = "link";
|
|
6798
6887
|
var MenuItemsControl = ({ label }) => {
|
|
6799
6888
|
const { element } = useElement();
|
|
6800
6889
|
const { addItem: addItem2, duplicateItem: duplicateItem2, moveItem: moveItem2, removeItem: removeItem2 } = useActions2();
|
|
6801
|
-
const { [MENU_ENTRY_ELEMENT_TYPE]: entries } = (0,
|
|
6890
|
+
const { [MENU_ENTRY_ELEMENT_TYPE]: entries } = (0, import_editor_elements27.useElementChildren)(element.id, {
|
|
6802
6891
|
[MENU_ITEMS_ELEMENT_TYPE]: MENU_ENTRY_ELEMENT_TYPE
|
|
6803
6892
|
});
|
|
6804
6893
|
const menuItems = getElementByType(element.id, MENU_ITEMS_ELEMENT_TYPE);
|
|
@@ -6818,7 +6907,7 @@ var MenuItemsControl = ({ label }) => {
|
|
|
6818
6907
|
});
|
|
6819
6908
|
}
|
|
6820
6909
|
if (meta?.action?.type === "remove") {
|
|
6821
|
-
return removeItem2({ items: meta.action.payload });
|
|
6910
|
+
return removeItem2({ menuItemsId: menuItems.id, items: meta.action.payload });
|
|
6822
6911
|
}
|
|
6823
6912
|
if (meta?.action?.type === "duplicate") {
|
|
6824
6913
|
return duplicateItem2({ items: meta.action.payload });
|
|
@@ -6853,35 +6942,66 @@ var MenuItemsControl = ({ label }) => {
|
|
|
6853
6942
|
};
|
|
6854
6943
|
var ItemLabel3 = ({ value }) => /* @__PURE__ */ React98.createElement(import_ui50.Stack, { sx: { minHeight: 20 }, direction: "row", alignItems: "center", gap: 1.5 }, value.id ? /* @__PURE__ */ React98.createElement(EntryLabel, { elementId: value.id, fallbackTitle: value.title }) : /* @__PURE__ */ React98.createElement("span", null, value?.title));
|
|
6855
6944
|
var EntryLabel = ({ elementId, fallbackTitle }) => {
|
|
6856
|
-
const editorSettings = (0,
|
|
6945
|
+
const editorSettings = (0, import_editor_elements27.useElementEditorSettings)(elementId);
|
|
6857
6946
|
return /* @__PURE__ */ React98.createElement("span", null, editorSettings?.title ?? fallbackTitle ?? "");
|
|
6858
6947
|
};
|
|
6859
6948
|
var ItemContent3 = ({ value }) => {
|
|
6860
6949
|
if (!value.id) {
|
|
6861
6950
|
return null;
|
|
6862
6951
|
}
|
|
6863
|
-
return /* @__PURE__ */ React98.createElement(import_ui50.Stack, { p: 2, gap: 1.5 }, /* @__PURE__ */ React98.createElement(ItemNameControl2, { elementId: value.id }));
|
|
6952
|
+
return /* @__PURE__ */ React98.createElement(import_ui50.Stack, { p: 2, gap: 1.5 }, /* @__PURE__ */ React98.createElement(ItemNameControl2, { elementId: value.id }), /* @__PURE__ */ React98.createElement(ItemLinkControl, { entryId: value.id }));
|
|
6864
6953
|
};
|
|
6865
6954
|
var ItemNameControl2 = ({ elementId }) => {
|
|
6866
|
-
const editorSettings = (0,
|
|
6867
|
-
const inputId = (0,
|
|
6868
|
-
return /* @__PURE__ */ React98.createElement(import_ui50.Stack, { gap: 1 }, /* @__PURE__ */ React98.createElement(import_editor_controls60.ControlFormLabel, { htmlFor: inputId }, (0, import_i18n76.__)("
|
|
6955
|
+
const editorSettings = (0, import_editor_elements27.useElementEditorSettings)(elementId);
|
|
6956
|
+
const inputId = (0, import_react44.useId)();
|
|
6957
|
+
return /* @__PURE__ */ React98.createElement(import_ui50.Stack, { gap: 1 }, /* @__PURE__ */ React98.createElement(import_editor_controls60.ControlFormLabel, { htmlFor: inputId }, (0, import_i18n76.__)("Item name", "elementor")), /* @__PURE__ */ React98.createElement(
|
|
6869
6958
|
import_ui50.TextField,
|
|
6870
6959
|
{
|
|
6871
6960
|
id: inputId,
|
|
6872
6961
|
size: "tiny",
|
|
6873
6962
|
value: editorSettings?.title ?? "",
|
|
6874
6963
|
onChange: ({ target }) => {
|
|
6875
|
-
(0,
|
|
6964
|
+
(0, import_editor_elements27.updateElementEditorSettings)({ elementId, settings: { title: target.value } });
|
|
6876
6965
|
}
|
|
6877
6966
|
}
|
|
6878
6967
|
));
|
|
6879
6968
|
};
|
|
6969
|
+
var ItemLinkControl = ({ entryId }) => {
|
|
6970
|
+
const { itemId, settings } = useEntryItem(entryId);
|
|
6971
|
+
const elementType = itemId ? (0, import_editor_elements27.getElementType)(MENU_ITEM_ELEMENT_TYPE) : null;
|
|
6972
|
+
const linkControl = elementType ? findControlByBind(elementType.controls, LINK_BIND) : null;
|
|
6973
|
+
if (!itemId || !elementType || !linkControl) {
|
|
6974
|
+
return null;
|
|
6975
|
+
}
|
|
6976
|
+
return /* @__PURE__ */ React98.createElement(
|
|
6977
|
+
ElementProvider,
|
|
6978
|
+
{
|
|
6979
|
+
element: { id: itemId, type: MENU_ITEM_ELEMENT_TYPE },
|
|
6980
|
+
elementType,
|
|
6981
|
+
settings
|
|
6982
|
+
},
|
|
6983
|
+
/* @__PURE__ */ React98.createElement(import_session10.SessionStorageProvider, { prefix: itemId }, /* @__PURE__ */ React98.createElement(SettingsControl, { control: linkControl }))
|
|
6984
|
+
);
|
|
6985
|
+
};
|
|
6986
|
+
var findControlByBind = (items3, bind) => {
|
|
6987
|
+
for (const item of items3) {
|
|
6988
|
+
if (item.type === "section") {
|
|
6989
|
+
const found = findControlByBind(item.value.items, bind);
|
|
6990
|
+
if (found) {
|
|
6991
|
+
return found;
|
|
6992
|
+
}
|
|
6993
|
+
}
|
|
6994
|
+
if (item.type === "control" && item.value.bind === bind) {
|
|
6995
|
+
return item;
|
|
6996
|
+
}
|
|
6997
|
+
}
|
|
6998
|
+
return null;
|
|
6999
|
+
};
|
|
6880
7000
|
|
|
6881
7001
|
// src/controls-registry/element-controls/tabs-control/tabs-control.tsx
|
|
6882
7002
|
var React99 = __toESM(require("react"));
|
|
6883
7003
|
var import_editor_controls62 = require("@elementor/editor-controls");
|
|
6884
|
-
var
|
|
7004
|
+
var import_editor_elements29 = require("@elementor/editor-elements");
|
|
6885
7005
|
var import_editor_props26 = require("@elementor/editor-props");
|
|
6886
7006
|
var import_icons29 = require("@elementor/icons");
|
|
6887
7007
|
var import_ui51 = require("@elementor/ui");
|
|
@@ -6889,7 +7009,7 @@ var import_i18n78 = require("@wordpress/i18n");
|
|
|
6889
7009
|
|
|
6890
7010
|
// src/controls-registry/element-controls/tabs-control/use-actions.ts
|
|
6891
7011
|
var import_editor_controls61 = require("@elementor/editor-controls");
|
|
6892
|
-
var
|
|
7012
|
+
var import_editor_elements28 = require("@elementor/editor-elements");
|
|
6893
7013
|
var import_editor_props25 = require("@elementor/editor-props");
|
|
6894
7014
|
var import_i18n77 = require("@wordpress/i18n");
|
|
6895
7015
|
var TAB_ELEMENT_TYPE = "e-tab";
|
|
@@ -6907,12 +7027,12 @@ var useActions3 = () => {
|
|
|
6907
7027
|
});
|
|
6908
7028
|
items3.forEach(({ item, index }) => {
|
|
6909
7029
|
const tabId = item.id;
|
|
6910
|
-
const tabContentAreaContainer = (0,
|
|
7030
|
+
const tabContentAreaContainer = (0, import_editor_elements28.getContainer)(tabContentAreaId);
|
|
6911
7031
|
const tabContentId = tabContentAreaContainer?.children?.[index]?.id;
|
|
6912
7032
|
if (!tabContentId) {
|
|
6913
7033
|
throw new Error("Original content ID is required for duplication");
|
|
6914
7034
|
}
|
|
6915
|
-
(0,
|
|
7035
|
+
(0, import_editor_elements28.duplicateElements)({
|
|
6916
7036
|
elementIds: [tabId, tabContentId],
|
|
6917
7037
|
title: (0, import_i18n77.__)("Duplicate Tab", "elementor"),
|
|
6918
7038
|
onDuplicateElements: () => {
|
|
@@ -6935,10 +7055,10 @@ var useActions3 = () => {
|
|
|
6935
7055
|
movedElementId,
|
|
6936
7056
|
movedElementIndex
|
|
6937
7057
|
}) => {
|
|
6938
|
-
const tabContentContainer = (0,
|
|
7058
|
+
const tabContentContainer = (0, import_editor_elements28.getContainer)(tabContentAreaId);
|
|
6939
7059
|
const tabContent = tabContentContainer?.children?.[movedElementIndex];
|
|
6940
|
-
const movedElement = (0,
|
|
6941
|
-
const tabsMenu = (0,
|
|
7060
|
+
const movedElement = (0, import_editor_elements28.getContainer)(movedElementId);
|
|
7061
|
+
const tabsMenu = (0, import_editor_elements28.getContainer)(tabsMenuId);
|
|
6942
7062
|
if (!tabContent) {
|
|
6943
7063
|
throw new Error("Content element is required");
|
|
6944
7064
|
}
|
|
@@ -6950,7 +7070,7 @@ var useActions3 = () => {
|
|
|
6950
7070
|
to: toIndex,
|
|
6951
7071
|
defaultActiveTab
|
|
6952
7072
|
});
|
|
6953
|
-
(0,
|
|
7073
|
+
(0, import_editor_elements28.moveElements)({
|
|
6954
7074
|
title: (0, import_i18n77.__)("Reorder Tabs", "elementor"),
|
|
6955
7075
|
moves: [
|
|
6956
7076
|
{
|
|
@@ -6984,11 +7104,11 @@ var useActions3 = () => {
|
|
|
6984
7104
|
items: items3,
|
|
6985
7105
|
defaultActiveTab
|
|
6986
7106
|
});
|
|
6987
|
-
(0,
|
|
7107
|
+
(0, import_editor_elements28.removeElements)({
|
|
6988
7108
|
title: (0, import_i18n77.__)("Tabs", "elementor"),
|
|
6989
7109
|
elementIds: items3.flatMap(({ item, index }) => {
|
|
6990
7110
|
const tabId = item.id;
|
|
6991
|
-
const tabContentContainer = (0,
|
|
7111
|
+
const tabContentContainer = (0, import_editor_elements28.getContainer)(tabContentAreaId);
|
|
6992
7112
|
const tabContentId = tabContentContainer?.children?.[index]?.id;
|
|
6993
7113
|
if (!tabContentId) {
|
|
6994
7114
|
throw new Error("Content ID is required");
|
|
@@ -7012,14 +7132,14 @@ var useActions3 = () => {
|
|
|
7012
7132
|
tabsMenuId,
|
|
7013
7133
|
items: items3
|
|
7014
7134
|
}) => {
|
|
7015
|
-
const tabContentArea = (0,
|
|
7016
|
-
const tabsMenu = (0,
|
|
7135
|
+
const tabContentArea = (0, import_editor_elements28.getContainer)(tabContentAreaId);
|
|
7136
|
+
const tabsMenu = (0, import_editor_elements28.getContainer)(tabsMenuId);
|
|
7017
7137
|
if (!tabContentArea || !tabsMenu) {
|
|
7018
7138
|
throw new Error("Tab containers not found");
|
|
7019
7139
|
}
|
|
7020
7140
|
items3.forEach(({ index }) => {
|
|
7021
7141
|
const position = index + 1;
|
|
7022
|
-
(0,
|
|
7142
|
+
(0, import_editor_elements28.createElements)({
|
|
7023
7143
|
title: (0, import_i18n77.__)("Tabs", "elementor"),
|
|
7024
7144
|
elements: [
|
|
7025
7145
|
{
|
|
@@ -7094,7 +7214,7 @@ var TabsControl = ({ label }) => {
|
|
|
7094
7214
|
var TabsControlContent = ({ label }) => {
|
|
7095
7215
|
const { element } = useElement();
|
|
7096
7216
|
const { addItem: addItem2, duplicateItem: duplicateItem2, moveItem: moveItem2, removeItem: removeItem2 } = useActions3();
|
|
7097
|
-
const { [TAB_ELEMENT_TYPE]: tabLinks } = (0,
|
|
7217
|
+
const { [TAB_ELEMENT_TYPE]: tabLinks } = (0, import_editor_elements29.useElementChildren)(element.id, {
|
|
7098
7218
|
[TAB_MENU_ELEMENT_TYPE]: TAB_ELEMENT_TYPE
|
|
7099
7219
|
});
|
|
7100
7220
|
const tabList = getElementByType(element.id, TAB_MENU_ELEMENT_TYPE);
|
|
@@ -7155,7 +7275,7 @@ var ItemLabel4 = ({ value, index }) => {
|
|
|
7155
7275
|
return /* @__PURE__ */ React99.createElement(import_ui51.Stack, { sx: { minHeight: 20 }, direction: "row", alignItems: "center", gap: 1.5 }, value.id ? /* @__PURE__ */ React99.createElement(TabRepeaterLabel, { elementId: value.id, fallbackTitle: value.title }) : /* @__PURE__ */ React99.createElement("span", null, value?.title), /* @__PURE__ */ React99.createElement(ItemDefaultTab, { index }));
|
|
7156
7276
|
};
|
|
7157
7277
|
var TabRepeaterLabel = ({ elementId, fallbackTitle }) => {
|
|
7158
|
-
const editorSettings = (0,
|
|
7278
|
+
const editorSettings = (0, import_editor_elements29.useElementEditorSettings)(elementId);
|
|
7159
7279
|
const label = editorSettings?.title ?? fallbackTitle ?? "";
|
|
7160
7280
|
return /* @__PURE__ */ React99.createElement("span", null, label);
|
|
7161
7281
|
};
|
|
@@ -7192,7 +7312,7 @@ var DefaultTabControl = ({ tabIndex }) => {
|
|
|
7192
7312
|
)));
|
|
7193
7313
|
};
|
|
7194
7314
|
var TabLabelControl = ({ elementId }) => {
|
|
7195
|
-
const editorSettings = (0,
|
|
7315
|
+
const editorSettings = (0, import_editor_elements29.useElementEditorSettings)(elementId);
|
|
7196
7316
|
const label = editorSettings?.title ?? "";
|
|
7197
7317
|
return /* @__PURE__ */ React99.createElement(import_ui51.Stack, { gap: 1 }, /* @__PURE__ */ React99.createElement(import_editor_controls62.ControlFormLabel, null, (0, import_i18n78.__)("Tab name", "elementor")), /* @__PURE__ */ React99.createElement(
|
|
7198
7318
|
import_ui51.TextField,
|
|
@@ -7200,7 +7320,7 @@ var TabLabelControl = ({ elementId }) => {
|
|
|
7200
7320
|
size: "tiny",
|
|
7201
7321
|
value: label,
|
|
7202
7322
|
onChange: ({ target }) => {
|
|
7203
|
-
(0,
|
|
7323
|
+
(0, import_editor_elements29.updateElementEditorSettings)({
|
|
7204
7324
|
elementId,
|
|
7205
7325
|
settings: { title: target.value }
|
|
7206
7326
|
});
|
|
@@ -7261,17 +7381,17 @@ var import_editor_props28 = require("@elementor/editor-props");
|
|
|
7261
7381
|
var import_icons30 = require("@elementor/icons");
|
|
7262
7382
|
|
|
7263
7383
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
7264
|
-
var
|
|
7384
|
+
var import_react47 = require("react");
|
|
7265
7385
|
|
|
7266
7386
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
7267
|
-
var
|
|
7387
|
+
var import_react46 = require("react");
|
|
7268
7388
|
var import_editor_controls63 = require("@elementor/editor-controls");
|
|
7269
7389
|
|
|
7270
7390
|
// src/dynamics/sync/get-atomic-dynamic-tags.ts
|
|
7271
|
-
var
|
|
7391
|
+
var import_editor_v1_adapters13 = require("@elementor/editor-v1-adapters");
|
|
7272
7392
|
|
|
7273
7393
|
// src/hooks/use-license-config.ts
|
|
7274
|
-
var
|
|
7394
|
+
var import_react45 = require("react");
|
|
7275
7395
|
var config = { expired: false };
|
|
7276
7396
|
var listeners = /* @__PURE__ */ new Set();
|
|
7277
7397
|
function setLicenseConfig(newConfig) {
|
|
@@ -7286,12 +7406,12 @@ function subscribe(listener) {
|
|
|
7286
7406
|
return () => listeners.delete(listener);
|
|
7287
7407
|
}
|
|
7288
7408
|
function useLicenseConfig() {
|
|
7289
|
-
return (0,
|
|
7409
|
+
return (0, import_react45.useSyncExternalStore)(subscribe, getLicenseConfig, getLicenseConfig);
|
|
7290
7410
|
}
|
|
7291
7411
|
|
|
7292
7412
|
// src/dynamics/sync/get-atomic-dynamic-tags.ts
|
|
7293
7413
|
var getAtomicDynamicTags = (shouldFilterByLicense = true) => {
|
|
7294
|
-
const { atomicDynamicTags } = (0,
|
|
7414
|
+
const { atomicDynamicTags } = (0, import_editor_v1_adapters13.getElementorConfig)();
|
|
7295
7415
|
if (!atomicDynamicTags) {
|
|
7296
7416
|
return null;
|
|
7297
7417
|
}
|
|
@@ -7314,7 +7434,7 @@ var filterByLicense = (tags) => {
|
|
|
7314
7434
|
|
|
7315
7435
|
// src/dynamics/utils.ts
|
|
7316
7436
|
var import_editor_props27 = require("@elementor/editor-props");
|
|
7317
|
-
var
|
|
7437
|
+
var import_editor_v1_adapters14 = require("@elementor/editor-v1-adapters");
|
|
7318
7438
|
var import_schema = require("@elementor/schema");
|
|
7319
7439
|
var DYNAMIC_PROP_TYPE_KEY = "dynamic";
|
|
7320
7440
|
var dynamicPropTypeUtil = (0, import_editor_props27.createPropUtils)(
|
|
@@ -7326,7 +7446,7 @@ var dynamicPropTypeUtil = (0, import_editor_props27.createPropUtils)(
|
|
|
7326
7446
|
})
|
|
7327
7447
|
);
|
|
7328
7448
|
var isDynamicTagSupported = (tagName) => {
|
|
7329
|
-
return !!(0,
|
|
7449
|
+
return !!(0, import_editor_v1_adapters14.getElementorConfig)()?.atomicDynamicTags?.tags?.[tagName];
|
|
7330
7450
|
};
|
|
7331
7451
|
var isDynamicPropType = (prop) => prop.key === DYNAMIC_PROP_TYPE_KEY;
|
|
7332
7452
|
var getDynamicPropType = (propType) => {
|
|
@@ -7355,7 +7475,7 @@ var usePropDynamicTagsInternal = (filterByLicense2) => {
|
|
|
7355
7475
|
categories = propDynamicType?.settings.categories || [];
|
|
7356
7476
|
}
|
|
7357
7477
|
const categoriesKey = categories.join();
|
|
7358
|
-
return (0,
|
|
7478
|
+
return (0, import_react46.useMemo)(
|
|
7359
7479
|
() => getDynamicTagsByCategories(categories, filterByLicense2),
|
|
7360
7480
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7361
7481
|
[categoriesKey, filterByLicense2]
|
|
@@ -7389,7 +7509,7 @@ var getDynamicTagsByCategories = (categories, filterByLicense2) => {
|
|
|
7389
7509
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
7390
7510
|
var useDynamicTag = (tagName) => {
|
|
7391
7511
|
const dynamicTags = useAllPropDynamicTags();
|
|
7392
|
-
return (0,
|
|
7512
|
+
return (0, import_react47.useMemo)(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
7393
7513
|
};
|
|
7394
7514
|
|
|
7395
7515
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
@@ -7418,11 +7538,11 @@ var import_ui53 = require("@elementor/ui");
|
|
|
7418
7538
|
var import_i18n80 = require("@wordpress/i18n");
|
|
7419
7539
|
|
|
7420
7540
|
// src/hooks/use-persist-dynamic-value.ts
|
|
7421
|
-
var
|
|
7541
|
+
var import_session11 = require("@elementor/session");
|
|
7422
7542
|
var usePersistDynamicValue = (propKey) => {
|
|
7423
7543
|
const { element } = useElement();
|
|
7424
7544
|
const prefixedKey = `dynamic/non-dynamic-values-history/${element.id}/${propKey}`;
|
|
7425
|
-
return (0,
|
|
7545
|
+
return (0, import_session11.useSessionStorage)(prefixedKey);
|
|
7426
7546
|
};
|
|
7427
7547
|
|
|
7428
7548
|
// src/dynamics/dynamic-control.tsx
|
|
@@ -7431,7 +7551,7 @@ var import_editor_controls65 = require("@elementor/editor-controls");
|
|
|
7431
7551
|
|
|
7432
7552
|
// src/dynamics/components/dynamic-conditional-control.tsx
|
|
7433
7553
|
var React101 = __toESM(require("react"));
|
|
7434
|
-
var
|
|
7554
|
+
var import_react48 = require("react");
|
|
7435
7555
|
var import_editor_props29 = require("@elementor/editor-props");
|
|
7436
7556
|
var DynamicConditionalControl = ({
|
|
7437
7557
|
children,
|
|
@@ -7439,7 +7559,7 @@ var DynamicConditionalControl = ({
|
|
|
7439
7559
|
propsSchema,
|
|
7440
7560
|
dynamicSettings
|
|
7441
7561
|
}) => {
|
|
7442
|
-
const defaults = (0,
|
|
7562
|
+
const defaults = (0, import_react48.useMemo)(() => {
|
|
7443
7563
|
if (!propsSchema) {
|
|
7444
7564
|
return {};
|
|
7445
7565
|
}
|
|
@@ -7449,7 +7569,7 @@ var DynamicConditionalControl = ({
|
|
|
7449
7569
|
return result;
|
|
7450
7570
|
}, {});
|
|
7451
7571
|
}, [propsSchema]);
|
|
7452
|
-
const convertedSettings = (0,
|
|
7572
|
+
const convertedSettings = (0, import_react48.useMemo)(() => {
|
|
7453
7573
|
if (!dynamicSettings) {
|
|
7454
7574
|
return {};
|
|
7455
7575
|
}
|
|
@@ -7468,7 +7588,7 @@ var DynamicConditionalControl = ({
|
|
|
7468
7588
|
{}
|
|
7469
7589
|
);
|
|
7470
7590
|
}, [dynamicSettings]);
|
|
7471
|
-
const effectiveSettings = (0,
|
|
7591
|
+
const effectiveSettings = (0, import_react48.useMemo)(() => {
|
|
7472
7592
|
return { ...defaults, ...convertedSettings };
|
|
7473
7593
|
}, [defaults, convertedSettings]);
|
|
7474
7594
|
if (!propType?.dependencies?.terms.length) {
|
|
@@ -7513,7 +7633,7 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
7513
7633
|
|
|
7514
7634
|
// src/dynamics/components/dynamic-selection.tsx
|
|
7515
7635
|
var React103 = __toESM(require("react"));
|
|
7516
|
-
var
|
|
7636
|
+
var import_react49 = require("react");
|
|
7517
7637
|
var import_editor_controls66 = require("@elementor/editor-controls");
|
|
7518
7638
|
var import_editor_ui11 = require("@elementor/editor-ui");
|
|
7519
7639
|
var import_icons31 = require("@elementor/icons");
|
|
@@ -7524,7 +7644,7 @@ var PROMO_TEXT_WIDTH = 170;
|
|
|
7524
7644
|
var PRO_DYNAMIC_TAGS_URL = "https://go.elementor.com/go-pro-dynamic-tags-modal/";
|
|
7525
7645
|
var RENEW_DYNAMIC_TAGS_URL = "https://go.elementor.com/go-pro-dynamic-tags-renew-modal/";
|
|
7526
7646
|
var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
7527
|
-
const [searchValue, setSearchValue] = (0,
|
|
7647
|
+
const [searchValue, setSearchValue] = (0, import_react49.useState)("");
|
|
7528
7648
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
7529
7649
|
const theme = (0, import_ui52.useTheme)();
|
|
7530
7650
|
const { value: anyValue } = (0, import_editor_controls66.useBoundProp)();
|
|
@@ -7533,7 +7653,7 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
|
7533
7653
|
const isCurrentValueDynamic = !!dynamicValue;
|
|
7534
7654
|
const options13 = useFilteredOptions(searchValue);
|
|
7535
7655
|
const hasNoDynamicTags = !options13.length && !searchValue.trim();
|
|
7536
|
-
(0,
|
|
7656
|
+
(0, import_react49.useEffect)(() => {
|
|
7537
7657
|
if (hasNoDynamicTags) {
|
|
7538
7658
|
(0, import_editor_controls66.trackViewPromotion)({ target_name: "dynamic_tags" });
|
|
7539
7659
|
} else if (expired) {
|
|
@@ -7570,7 +7690,7 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
|
7570
7690
|
if (expired) {
|
|
7571
7691
|
return /* @__PURE__ */ React103.createElement(ExpiredDynamicTags, null);
|
|
7572
7692
|
}
|
|
7573
|
-
return /* @__PURE__ */ React103.createElement(
|
|
7693
|
+
return /* @__PURE__ */ React103.createElement(import_react49.Fragment, null, /* @__PURE__ */ React103.createElement(
|
|
7574
7694
|
import_editor_ui11.SearchField,
|
|
7575
7695
|
{
|
|
7576
7696
|
value: searchValue,
|
|
@@ -8040,22 +8160,22 @@ var import_i18n86 = require("@wordpress/i18n");
|
|
|
8040
8160
|
|
|
8041
8161
|
// src/styles-inheritance/components/styles-inheritance-infotip.tsx
|
|
8042
8162
|
var React110 = __toESM(require("react"));
|
|
8043
|
-
var
|
|
8163
|
+
var import_react51 = require("react");
|
|
8044
8164
|
var import_editor_canvas5 = require("@elementor/editor-canvas");
|
|
8045
8165
|
var import_editor_ui13 = require("@elementor/editor-ui");
|
|
8046
8166
|
var import_ui58 = require("@elementor/ui");
|
|
8047
8167
|
var import_i18n85 = require("@wordpress/i18n");
|
|
8048
8168
|
|
|
8049
8169
|
// src/styles-inheritance/hooks/use-normalized-inheritance-chain-items.tsx
|
|
8050
|
-
var
|
|
8170
|
+
var import_react50 = require("react");
|
|
8051
8171
|
var import_editor_canvas4 = require("@elementor/editor-canvas");
|
|
8052
8172
|
var import_editor_styles8 = require("@elementor/editor-styles");
|
|
8053
8173
|
var import_editor_styles_repository18 = require("@elementor/editor-styles-repository");
|
|
8054
8174
|
var import_i18n83 = require("@wordpress/i18n");
|
|
8055
8175
|
var MAXIMUM_ITEMS = 2;
|
|
8056
8176
|
var useNormalizedInheritanceChainItems = (inheritanceChain, bind, resolve) => {
|
|
8057
|
-
const [items3, setItems] = (0,
|
|
8058
|
-
(0,
|
|
8177
|
+
const [items3, setItems] = (0, import_react50.useState)([]);
|
|
8178
|
+
(0, import_react50.useEffect)(() => {
|
|
8059
8179
|
(async () => {
|
|
8060
8180
|
const normalizedItems = await Promise.all(
|
|
8061
8181
|
inheritanceChain.filter(({ style }) => style).map((item, index) => normalizeInheritanceItem(item, index, bind, resolve))
|
|
@@ -8106,7 +8226,7 @@ var getTransformedValue = async (item, bind, resolve) => {
|
|
|
8106
8226
|
}
|
|
8107
8227
|
});
|
|
8108
8228
|
const value = result?.[bind] ?? result;
|
|
8109
|
-
if ((0,
|
|
8229
|
+
if ((0, import_react50.isValidElement)(value)) {
|
|
8110
8230
|
return value;
|
|
8111
8231
|
}
|
|
8112
8232
|
if (typeof value === "object") {
|
|
@@ -8221,8 +8341,8 @@ var StylesInheritanceInfotip = ({
|
|
|
8221
8341
|
children,
|
|
8222
8342
|
isDisabled
|
|
8223
8343
|
}) => {
|
|
8224
|
-
const [showInfotip, setShowInfotip] = (0,
|
|
8225
|
-
const triggerRef = (0,
|
|
8344
|
+
const [showInfotip, setShowInfotip] = (0, import_react51.useState)(false);
|
|
8345
|
+
const triggerRef = (0, import_react51.useRef)(null);
|
|
8226
8346
|
const toggleInfotip = () => {
|
|
8227
8347
|
if (isDisabled) {
|
|
8228
8348
|
return;
|
|
@@ -8237,7 +8357,7 @@ var StylesInheritanceInfotip = ({
|
|
|
8237
8357
|
};
|
|
8238
8358
|
const key = path.join(".");
|
|
8239
8359
|
const sectionWidth = (0, import_editor_ui13.useSectionWidth)();
|
|
8240
|
-
const resolve = (0,
|
|
8360
|
+
const resolve = (0, import_react51.useMemo)(() => {
|
|
8241
8361
|
return (0, import_editor_canvas5.createPropsResolver)({
|
|
8242
8362
|
transformers: import_editor_canvas5.stylesInheritanceTransformersRegistry,
|
|
8243
8363
|
schema: { [key]: propType }
|
|
@@ -8647,6 +8767,7 @@ var init3 = () => {
|
|
|
8647
8767
|
|
|
8648
8768
|
// src/init.ts
|
|
8649
8769
|
function init4() {
|
|
8770
|
+
(0, import_editor_controls72.init)();
|
|
8650
8771
|
(0, import_editor_panels3.registerPanel)(panel);
|
|
8651
8772
|
blockV1Panel();
|
|
8652
8773
|
(0, import_editor.injectIntoLogic)({
|
|
@@ -8660,7 +8781,7 @@ function init4() {
|
|
|
8660
8781
|
init();
|
|
8661
8782
|
}
|
|
8662
8783
|
var blockV1Panel = () => {
|
|
8663
|
-
(0,
|
|
8784
|
+
(0, import_editor_v1_adapters15.blockCommand)({
|
|
8664
8785
|
command: "panel/editor/open",
|
|
8665
8786
|
condition: isAtomicWidgetSelected
|
|
8666
8787
|
});
|
|
@@ -8672,6 +8793,7 @@ var blockV1Panel = () => {
|
|
|
8672
8793
|
ControlLabel,
|
|
8673
8794
|
ControlTypeContainer,
|
|
8674
8795
|
CreatableAutocomplete,
|
|
8796
|
+
CustomCssHeaderSlot,
|
|
8675
8797
|
CustomCssIndicator,
|
|
8676
8798
|
DEFAULT_PSEUDO_STATES,
|
|
8677
8799
|
EditingPanelTabs,
|
|
@@ -8707,9 +8829,12 @@ var blockV1Panel = () => {
|
|
|
8707
8829
|
init,
|
|
8708
8830
|
injectIntoClassSelectorActions,
|
|
8709
8831
|
injectIntoCssClassConvert,
|
|
8832
|
+
injectIntoCustomCssHeader,
|
|
8710
8833
|
injectIntoGridFields,
|
|
8711
8834
|
injectIntoPanelHeaderTop,
|
|
8835
|
+
injectIntoStyleSectionHeader,
|
|
8712
8836
|
injectIntoStyleTab,
|
|
8837
|
+
injectIntoStyleTabHeader,
|
|
8713
8838
|
isDynamicPropValue,
|
|
8714
8839
|
registerEditingPanelReplacement,
|
|
8715
8840
|
registerElementPanelDefaults,
|