@elementor/editor-editing-panel 4.5.0-1176 → 4.5.0-1178
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.js +458 -279
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +380 -190
- package/dist/index.mjs.map +1 -1
- package/package.json +25 -25
- package/src/controls-registry/element-controls/menu-items-control/menu-items-control.tsx +133 -0
- package/src/controls-registry/element-controls/menu-items-control/use-actions.ts +115 -0
- package/src/controls-registry/element-controls/registry.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -6687,12 +6687,11 @@ var ListItemLabelControl = ({ elementId, fallbackLabel }) => {
|
|
|
6687
6687
|
));
|
|
6688
6688
|
};
|
|
6689
6689
|
|
|
6690
|
-
// src/controls-registry/element-controls/
|
|
6690
|
+
// src/controls-registry/element-controls/menu-items-control/menu-items-control.tsx
|
|
6691
6691
|
var React98 = __toESM(require("react"));
|
|
6692
|
-
var
|
|
6692
|
+
var import_react43 = require("react");
|
|
6693
|
+
var import_editor_controls60 = require("@elementor/editor-controls");
|
|
6693
6694
|
var import_editor_elements26 = require("@elementor/editor-elements");
|
|
6694
|
-
var import_editor_props25 = require("@elementor/editor-props");
|
|
6695
|
-
var import_icons29 = require("@elementor/icons");
|
|
6696
6695
|
var import_ui50 = require("@elementor/ui");
|
|
6697
6696
|
var import_i18n76 = require("@wordpress/i18n");
|
|
6698
6697
|
|
|
@@ -6709,15 +6708,194 @@ var getElementByType = (elementId, type) => {
|
|
|
6709
6708
|
return currentElement.children?.findRecursive?.((child) => child.model.get("elType") === type) ?? null;
|
|
6710
6709
|
};
|
|
6711
6710
|
|
|
6712
|
-
// src/controls-registry/element-controls/
|
|
6713
|
-
var import_editor_controls60 = require("@elementor/editor-controls");
|
|
6711
|
+
// src/controls-registry/element-controls/menu-items-control/use-actions.ts
|
|
6714
6712
|
var import_editor_elements25 = require("@elementor/editor-elements");
|
|
6715
6713
|
var import_editor_props24 = require("@elementor/editor-props");
|
|
6716
6714
|
var import_i18n75 = require("@wordpress/i18n");
|
|
6715
|
+
var MENU_ITEMS_ELEMENT_TYPE = "e-menu-items";
|
|
6716
|
+
var MENU_ENTRY_ELEMENT_TYPE = "e-menu-entry";
|
|
6717
|
+
var MENU_ITEM_ELEMENT_TYPE = "e-menu-item";
|
|
6718
|
+
var PARAGRAPH_WIDGET_TYPE3 = "e-paragraph";
|
|
6719
|
+
var getEntryTitle = () => (0, import_i18n75.__)("Menu item", "elementor");
|
|
6720
|
+
var buildEntryModel = (title) => ({
|
|
6721
|
+
elType: MENU_ENTRY_ELEMENT_TYPE,
|
|
6722
|
+
id: (0, import_editor_elements25.generateElementId)(),
|
|
6723
|
+
editor_settings: { title },
|
|
6724
|
+
elements: [
|
|
6725
|
+
{
|
|
6726
|
+
elType: MENU_ITEM_ELEMENT_TYPE,
|
|
6727
|
+
id: (0, import_editor_elements25.generateElementId)(),
|
|
6728
|
+
elements: [
|
|
6729
|
+
{
|
|
6730
|
+
elType: "widget",
|
|
6731
|
+
widgetType: PARAGRAPH_WIDGET_TYPE3,
|
|
6732
|
+
id: (0, import_editor_elements25.generateElementId)(),
|
|
6733
|
+
elements: [],
|
|
6734
|
+
settings: {
|
|
6735
|
+
paragraph: import_editor_props24.escapedHtmlPropTypeUtil.create(title),
|
|
6736
|
+
tag: { $$type: "string", value: "span" }
|
|
6737
|
+
}
|
|
6738
|
+
}
|
|
6739
|
+
]
|
|
6740
|
+
}
|
|
6741
|
+
]
|
|
6742
|
+
});
|
|
6743
|
+
var useActions2 = () => {
|
|
6744
|
+
const addItem2 = ({ menuItemsId, items: items3 }) => {
|
|
6745
|
+
const menuItems = (0, import_editor_elements25.getContainer)(menuItemsId);
|
|
6746
|
+
if (!menuItems) {
|
|
6747
|
+
throw new Error("Menu items container not found");
|
|
6748
|
+
}
|
|
6749
|
+
items3.forEach(() => {
|
|
6750
|
+
(0, import_editor_elements25.createElements)({
|
|
6751
|
+
title: (0, import_i18n75.__)("Menu", "elementor"),
|
|
6752
|
+
elements: [
|
|
6753
|
+
{
|
|
6754
|
+
container: menuItems,
|
|
6755
|
+
model: buildEntryModel(getEntryTitle())
|
|
6756
|
+
}
|
|
6757
|
+
]
|
|
6758
|
+
});
|
|
6759
|
+
});
|
|
6760
|
+
};
|
|
6761
|
+
const removeItem2 = ({ items: items3 }) => {
|
|
6762
|
+
(0, import_editor_elements25.removeElements)({
|
|
6763
|
+
title: (0, import_i18n75.__)("Menu", "elementor"),
|
|
6764
|
+
elementIds: items3.map(({ item }) => item.id)
|
|
6765
|
+
});
|
|
6766
|
+
};
|
|
6767
|
+
const duplicateItem2 = ({ items: items3 }) => {
|
|
6768
|
+
(0, import_editor_elements25.duplicateElements)({
|
|
6769
|
+
title: (0, import_i18n75.__)("Duplicate Menu item", "elementor"),
|
|
6770
|
+
elementIds: items3.map(({ item }) => item.id)
|
|
6771
|
+
});
|
|
6772
|
+
};
|
|
6773
|
+
const moveItem2 = ({
|
|
6774
|
+
menuItemsId,
|
|
6775
|
+
movedElementId,
|
|
6776
|
+
toIndex
|
|
6777
|
+
}) => {
|
|
6778
|
+
const menuItems = (0, import_editor_elements25.getContainer)(menuItemsId);
|
|
6779
|
+
const movedElement = (0, import_editor_elements25.getContainer)(movedElementId);
|
|
6780
|
+
if (!menuItems || !movedElement) {
|
|
6781
|
+
throw new Error("Menu item or container not found");
|
|
6782
|
+
}
|
|
6783
|
+
(0, import_editor_elements25.moveElements)({
|
|
6784
|
+
title: (0, import_i18n75.__)("Reorder Menu items", "elementor"),
|
|
6785
|
+
moves: [
|
|
6786
|
+
{
|
|
6787
|
+
element: movedElement,
|
|
6788
|
+
targetContainer: menuItems,
|
|
6789
|
+
options: { at: toIndex }
|
|
6790
|
+
}
|
|
6791
|
+
]
|
|
6792
|
+
});
|
|
6793
|
+
};
|
|
6794
|
+
return { addItem: addItem2, removeItem: removeItem2, duplicateItem: duplicateItem2, moveItem: moveItem2 };
|
|
6795
|
+
};
|
|
6796
|
+
|
|
6797
|
+
// src/controls-registry/element-controls/menu-items-control/menu-items-control.tsx
|
|
6798
|
+
var MenuItemsControl = ({ label }) => {
|
|
6799
|
+
const { element } = useElement();
|
|
6800
|
+
const { addItem: addItem2, duplicateItem: duplicateItem2, moveItem: moveItem2, removeItem: removeItem2 } = useActions2();
|
|
6801
|
+
const { [MENU_ENTRY_ELEMENT_TYPE]: entries } = (0, import_editor_elements26.useElementChildren)(element.id, {
|
|
6802
|
+
[MENU_ITEMS_ELEMENT_TYPE]: MENU_ENTRY_ELEMENT_TYPE
|
|
6803
|
+
});
|
|
6804
|
+
const menuItems = getElementByType(element.id, MENU_ITEMS_ELEMENT_TYPE);
|
|
6805
|
+
const repeaterValues = entries.map((entry, index) => ({
|
|
6806
|
+
id: entry.id,
|
|
6807
|
+
title: entry.editorSettings?.title,
|
|
6808
|
+
index
|
|
6809
|
+
}));
|
|
6810
|
+
const setValue = (_newValues, _options, meta) => {
|
|
6811
|
+
if (!menuItems) {
|
|
6812
|
+
return;
|
|
6813
|
+
}
|
|
6814
|
+
if (meta?.action?.type === "add") {
|
|
6815
|
+
return addItem2({
|
|
6816
|
+
menuItemsId: menuItems.id,
|
|
6817
|
+
items: meta.action.payload
|
|
6818
|
+
});
|
|
6819
|
+
}
|
|
6820
|
+
if (meta?.action?.type === "remove") {
|
|
6821
|
+
return removeItem2({ items: meta.action.payload });
|
|
6822
|
+
}
|
|
6823
|
+
if (meta?.action?.type === "duplicate") {
|
|
6824
|
+
return duplicateItem2({ items: meta.action.payload });
|
|
6825
|
+
}
|
|
6826
|
+
if (meta?.action?.type === "reorder") {
|
|
6827
|
+
const { from, to } = meta.action.payload;
|
|
6828
|
+
return moveItem2({
|
|
6829
|
+
menuItemsId: menuItems.id,
|
|
6830
|
+
movedElementId: entries[from].id,
|
|
6831
|
+
toIndex: to
|
|
6832
|
+
});
|
|
6833
|
+
}
|
|
6834
|
+
};
|
|
6835
|
+
return /* @__PURE__ */ React98.createElement(
|
|
6836
|
+
import_editor_controls60.Repeater,
|
|
6837
|
+
{
|
|
6838
|
+
showToggle: false,
|
|
6839
|
+
values: repeaterValues,
|
|
6840
|
+
setValues: setValue,
|
|
6841
|
+
showRemove: repeaterValues.length > 1,
|
|
6842
|
+
label,
|
|
6843
|
+
adornment: () => null,
|
|
6844
|
+
itemSettings: {
|
|
6845
|
+
getId: ({ item }) => item.id,
|
|
6846
|
+
initialValues: { id: "", title: (0, import_i18n76.__)("Menu item", "elementor") },
|
|
6847
|
+
Label: ItemLabel3,
|
|
6848
|
+
Content: ItemContent3,
|
|
6849
|
+
Icon: () => null
|
|
6850
|
+
}
|
|
6851
|
+
}
|
|
6852
|
+
);
|
|
6853
|
+
};
|
|
6854
|
+
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
|
+
var EntryLabel = ({ elementId, fallbackTitle }) => {
|
|
6856
|
+
const editorSettings = (0, import_editor_elements26.useElementEditorSettings)(elementId);
|
|
6857
|
+
return /* @__PURE__ */ React98.createElement("span", null, editorSettings?.title ?? fallbackTitle ?? "");
|
|
6858
|
+
};
|
|
6859
|
+
var ItemContent3 = ({ value }) => {
|
|
6860
|
+
if (!value.id) {
|
|
6861
|
+
return null;
|
|
6862
|
+
}
|
|
6863
|
+
return /* @__PURE__ */ React98.createElement(import_ui50.Stack, { p: 2, gap: 1.5 }, /* @__PURE__ */ React98.createElement(ItemNameControl2, { elementId: value.id }));
|
|
6864
|
+
};
|
|
6865
|
+
var ItemNameControl2 = ({ elementId }) => {
|
|
6866
|
+
const editorSettings = (0, import_editor_elements26.useElementEditorSettings)(elementId);
|
|
6867
|
+
const inputId = (0, import_react43.useId)();
|
|
6868
|
+
return /* @__PURE__ */ React98.createElement(import_ui50.Stack, { gap: 1 }, /* @__PURE__ */ React98.createElement(import_editor_controls60.ControlFormLabel, { htmlFor: inputId }, (0, import_i18n76.__)("Name", "elementor")), /* @__PURE__ */ React98.createElement(
|
|
6869
|
+
import_ui50.TextField,
|
|
6870
|
+
{
|
|
6871
|
+
id: inputId,
|
|
6872
|
+
size: "tiny",
|
|
6873
|
+
value: editorSettings?.title ?? "",
|
|
6874
|
+
onChange: ({ target }) => {
|
|
6875
|
+
(0, import_editor_elements26.updateElementEditorSettings)({ elementId, settings: { title: target.value } });
|
|
6876
|
+
}
|
|
6877
|
+
}
|
|
6878
|
+
));
|
|
6879
|
+
};
|
|
6880
|
+
|
|
6881
|
+
// src/controls-registry/element-controls/tabs-control/tabs-control.tsx
|
|
6882
|
+
var React99 = __toESM(require("react"));
|
|
6883
|
+
var import_editor_controls62 = require("@elementor/editor-controls");
|
|
6884
|
+
var import_editor_elements28 = require("@elementor/editor-elements");
|
|
6885
|
+
var import_editor_props26 = require("@elementor/editor-props");
|
|
6886
|
+
var import_icons29 = require("@elementor/icons");
|
|
6887
|
+
var import_ui51 = require("@elementor/ui");
|
|
6888
|
+
var import_i18n78 = require("@wordpress/i18n");
|
|
6889
|
+
|
|
6890
|
+
// src/controls-registry/element-controls/tabs-control/use-actions.ts
|
|
6891
|
+
var import_editor_controls61 = require("@elementor/editor-controls");
|
|
6892
|
+
var import_editor_elements27 = require("@elementor/editor-elements");
|
|
6893
|
+
var import_editor_props25 = require("@elementor/editor-props");
|
|
6894
|
+
var import_i18n77 = require("@wordpress/i18n");
|
|
6717
6895
|
var TAB_ELEMENT_TYPE = "e-tab";
|
|
6718
6896
|
var TAB_CONTENT_ELEMENT_TYPE = "e-tab-content";
|
|
6719
|
-
var
|
|
6720
|
-
const { value, setValue: setDefaultActiveTab } = (0,
|
|
6897
|
+
var useActions3 = () => {
|
|
6898
|
+
const { value, setValue: setDefaultActiveTab } = (0, import_editor_controls61.useBoundProp)(import_editor_props25.numberPropTypeUtil);
|
|
6721
6899
|
const defaultActiveTab = value ?? 0;
|
|
6722
6900
|
const duplicateItem2 = ({
|
|
6723
6901
|
items: items3,
|
|
@@ -6729,14 +6907,14 @@ var useActions2 = () => {
|
|
|
6729
6907
|
});
|
|
6730
6908
|
items3.forEach(({ item, index }) => {
|
|
6731
6909
|
const tabId = item.id;
|
|
6732
|
-
const tabContentAreaContainer = (0,
|
|
6910
|
+
const tabContentAreaContainer = (0, import_editor_elements27.getContainer)(tabContentAreaId);
|
|
6733
6911
|
const tabContentId = tabContentAreaContainer?.children?.[index]?.id;
|
|
6734
6912
|
if (!tabContentId) {
|
|
6735
6913
|
throw new Error("Original content ID is required for duplication");
|
|
6736
6914
|
}
|
|
6737
|
-
(0,
|
|
6915
|
+
(0, import_editor_elements27.duplicateElements)({
|
|
6738
6916
|
elementIds: [tabId, tabContentId],
|
|
6739
|
-
title: (0,
|
|
6917
|
+
title: (0, import_i18n77.__)("Duplicate Tab", "elementor"),
|
|
6740
6918
|
onDuplicateElements: () => {
|
|
6741
6919
|
if (newDefault !== defaultActiveTab) {
|
|
6742
6920
|
setDefaultActiveTab(newDefault, {}, { withHistory: false });
|
|
@@ -6757,10 +6935,10 @@ var useActions2 = () => {
|
|
|
6757
6935
|
movedElementId,
|
|
6758
6936
|
movedElementIndex
|
|
6759
6937
|
}) => {
|
|
6760
|
-
const tabContentContainer = (0,
|
|
6938
|
+
const tabContentContainer = (0, import_editor_elements27.getContainer)(tabContentAreaId);
|
|
6761
6939
|
const tabContent = tabContentContainer?.children?.[movedElementIndex];
|
|
6762
|
-
const movedElement = (0,
|
|
6763
|
-
const tabsMenu = (0,
|
|
6940
|
+
const movedElement = (0, import_editor_elements27.getContainer)(movedElementId);
|
|
6941
|
+
const tabsMenu = (0, import_editor_elements27.getContainer)(tabsMenuId);
|
|
6764
6942
|
if (!tabContent) {
|
|
6765
6943
|
throw new Error("Content element is required");
|
|
6766
6944
|
}
|
|
@@ -6772,8 +6950,8 @@ var useActions2 = () => {
|
|
|
6772
6950
|
to: toIndex,
|
|
6773
6951
|
defaultActiveTab
|
|
6774
6952
|
});
|
|
6775
|
-
(0,
|
|
6776
|
-
title: (0,
|
|
6953
|
+
(0, import_editor_elements27.moveElements)({
|
|
6954
|
+
title: (0, import_i18n77.__)("Reorder Tabs", "elementor"),
|
|
6777
6955
|
moves: [
|
|
6778
6956
|
{
|
|
6779
6957
|
element: movedElement,
|
|
@@ -6806,11 +6984,11 @@ var useActions2 = () => {
|
|
|
6806
6984
|
items: items3,
|
|
6807
6985
|
defaultActiveTab
|
|
6808
6986
|
});
|
|
6809
|
-
(0,
|
|
6810
|
-
title: (0,
|
|
6987
|
+
(0, import_editor_elements27.removeElements)({
|
|
6988
|
+
title: (0, import_i18n77.__)("Tabs", "elementor"),
|
|
6811
6989
|
elementIds: items3.flatMap(({ item, index }) => {
|
|
6812
6990
|
const tabId = item.id;
|
|
6813
|
-
const tabContentContainer = (0,
|
|
6991
|
+
const tabContentContainer = (0, import_editor_elements27.getContainer)(tabContentAreaId);
|
|
6814
6992
|
const tabContentId = tabContentContainer?.children?.[index]?.id;
|
|
6815
6993
|
if (!tabContentId) {
|
|
6816
6994
|
throw new Error("Content ID is required");
|
|
@@ -6834,15 +7012,15 @@ var useActions2 = () => {
|
|
|
6834
7012
|
tabsMenuId,
|
|
6835
7013
|
items: items3
|
|
6836
7014
|
}) => {
|
|
6837
|
-
const tabContentArea = (0,
|
|
6838
|
-
const tabsMenu = (0,
|
|
7015
|
+
const tabContentArea = (0, import_editor_elements27.getContainer)(tabContentAreaId);
|
|
7016
|
+
const tabsMenu = (0, import_editor_elements27.getContainer)(tabsMenuId);
|
|
6839
7017
|
if (!tabContentArea || !tabsMenu) {
|
|
6840
7018
|
throw new Error("Tab containers not found");
|
|
6841
7019
|
}
|
|
6842
7020
|
items3.forEach(({ index }) => {
|
|
6843
7021
|
const position = index + 1;
|
|
6844
|
-
(0,
|
|
6845
|
-
title: (0,
|
|
7022
|
+
(0, import_editor_elements27.createElements)({
|
|
7023
|
+
title: (0, import_i18n77.__)("Tabs", "elementor"),
|
|
6846
7024
|
elements: [
|
|
6847
7025
|
{
|
|
6848
7026
|
container: tabContentArea,
|
|
@@ -6911,12 +7089,12 @@ var calculateDefaultOnDuplicate = ({
|
|
|
6911
7089
|
var TAB_MENU_ELEMENT_TYPE = "e-tabs-menu";
|
|
6912
7090
|
var TAB_CONTENT_AREA_ELEMENT_TYPE = "e-tabs-content-area";
|
|
6913
7091
|
var TabsControl = ({ label }) => {
|
|
6914
|
-
return /* @__PURE__ */
|
|
7092
|
+
return /* @__PURE__ */ React99.createElement(SettingsField, { bind: "default-active-tab", propDisplayName: (0, import_i18n78.__)("Tabs", "elementor") }, /* @__PURE__ */ React99.createElement(TabsControlContent, { label }));
|
|
6915
7093
|
};
|
|
6916
7094
|
var TabsControlContent = ({ label }) => {
|
|
6917
7095
|
const { element } = useElement();
|
|
6918
|
-
const { addItem: addItem2, duplicateItem: duplicateItem2, moveItem: moveItem2, removeItem: removeItem2 } =
|
|
6919
|
-
const { [TAB_ELEMENT_TYPE]: tabLinks } = (0,
|
|
7096
|
+
const { addItem: addItem2, duplicateItem: duplicateItem2, moveItem: moveItem2, removeItem: removeItem2 } = useActions3();
|
|
7097
|
+
const { [TAB_ELEMENT_TYPE]: tabLinks } = (0, import_editor_elements28.useElementChildren)(element.id, {
|
|
6920
7098
|
[TAB_MENU_ELEMENT_TYPE]: TAB_ELEMENT_TYPE
|
|
6921
7099
|
});
|
|
6922
7100
|
const tabList = getElementByType(element.id, TAB_MENU_ELEMENT_TYPE);
|
|
@@ -6955,8 +7133,8 @@ var TabsControlContent = ({ label }) => {
|
|
|
6955
7133
|
});
|
|
6956
7134
|
}
|
|
6957
7135
|
};
|
|
6958
|
-
return /* @__PURE__ */
|
|
6959
|
-
|
|
7136
|
+
return /* @__PURE__ */ React99.createElement(
|
|
7137
|
+
import_editor_controls62.Repeater,
|
|
6960
7138
|
{
|
|
6961
7139
|
showToggle: false,
|
|
6962
7140
|
values: repeaterValues,
|
|
@@ -6966,40 +7144,40 @@ var TabsControlContent = ({ label }) => {
|
|
|
6966
7144
|
itemSettings: {
|
|
6967
7145
|
getId: ({ item }) => item.id,
|
|
6968
7146
|
initialValues: { id: "", title: "Tab" },
|
|
6969
|
-
Label:
|
|
6970
|
-
Content:
|
|
7147
|
+
Label: ItemLabel4,
|
|
7148
|
+
Content: ItemContent4,
|
|
6971
7149
|
Icon: () => null
|
|
6972
7150
|
}
|
|
6973
7151
|
}
|
|
6974
7152
|
);
|
|
6975
7153
|
};
|
|
6976
|
-
var
|
|
6977
|
-
return /* @__PURE__ */
|
|
7154
|
+
var ItemLabel4 = ({ value, index }) => {
|
|
7155
|
+
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 }));
|
|
6978
7156
|
};
|
|
6979
7157
|
var TabRepeaterLabel = ({ elementId, fallbackTitle }) => {
|
|
6980
|
-
const editorSettings = (0,
|
|
7158
|
+
const editorSettings = (0, import_editor_elements28.useElementEditorSettings)(elementId);
|
|
6981
7159
|
const label = editorSettings?.title ?? fallbackTitle ?? "";
|
|
6982
|
-
return /* @__PURE__ */
|
|
7160
|
+
return /* @__PURE__ */ React99.createElement("span", null, label);
|
|
6983
7161
|
};
|
|
6984
7162
|
var ItemDefaultTab = ({ index }) => {
|
|
6985
|
-
const { value: defaultItem } = (0,
|
|
7163
|
+
const { value: defaultItem } = (0, import_editor_controls62.useBoundProp)(import_editor_props26.numberPropTypeUtil);
|
|
6986
7164
|
const isDefault = defaultItem === index;
|
|
6987
7165
|
if (!isDefault) {
|
|
6988
7166
|
return null;
|
|
6989
7167
|
}
|
|
6990
|
-
return /* @__PURE__ */
|
|
7168
|
+
return /* @__PURE__ */ React99.createElement(import_ui51.Chip, { size: "tiny", shape: "rounded", label: (0, import_i18n78.__)("Default", "elementor") });
|
|
6991
7169
|
};
|
|
6992
|
-
var
|
|
7170
|
+
var ItemContent4 = ({ value, index }) => {
|
|
6993
7171
|
if (!value.id) {
|
|
6994
7172
|
return null;
|
|
6995
7173
|
}
|
|
6996
|
-
return /* @__PURE__ */
|
|
7174
|
+
return /* @__PURE__ */ React99.createElement(import_ui51.Stack, { p: 2, gap: 1.5 }, /* @__PURE__ */ React99.createElement(TabLabelControl, { elementId: value.id }), /* @__PURE__ */ React99.createElement(SettingsField, { bind: "default-active-tab", propDisplayName: (0, import_i18n78.__)("Tabs", "elementor") }, /* @__PURE__ */ React99.createElement(DefaultTabControl, { tabIndex: index })));
|
|
6997
7175
|
};
|
|
6998
7176
|
var DefaultTabControl = ({ tabIndex }) => {
|
|
6999
|
-
const { value, setValue } = (0,
|
|
7177
|
+
const { value, setValue } = (0, import_editor_controls62.useBoundProp)(import_editor_props26.numberPropTypeUtil);
|
|
7000
7178
|
const isDefault = value === tabIndex;
|
|
7001
|
-
return /* @__PURE__ */
|
|
7002
|
-
|
|
7179
|
+
return /* @__PURE__ */ React99.createElement(import_ui51.Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 2 }, /* @__PURE__ */ React99.createElement(import_editor_controls62.ControlFormLabel, null, (0, import_i18n78.__)("Set as default tab", "elementor")), /* @__PURE__ */ React99.createElement(ConditionalTooltip, { showTooltip: isDefault, placement: "right" }, /* @__PURE__ */ React99.createElement(
|
|
7180
|
+
import_ui51.Switch,
|
|
7003
7181
|
{
|
|
7004
7182
|
size: "small",
|
|
7005
7183
|
checked: isDefault,
|
|
@@ -7014,15 +7192,15 @@ var DefaultTabControl = ({ tabIndex }) => {
|
|
|
7014
7192
|
)));
|
|
7015
7193
|
};
|
|
7016
7194
|
var TabLabelControl = ({ elementId }) => {
|
|
7017
|
-
const editorSettings = (0,
|
|
7195
|
+
const editorSettings = (0, import_editor_elements28.useElementEditorSettings)(elementId);
|
|
7018
7196
|
const label = editorSettings?.title ?? "";
|
|
7019
|
-
return /* @__PURE__ */
|
|
7020
|
-
|
|
7197
|
+
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
|
+
import_ui51.TextField,
|
|
7021
7199
|
{
|
|
7022
7200
|
size: "tiny",
|
|
7023
7201
|
value: label,
|
|
7024
7202
|
onChange: ({ target }) => {
|
|
7025
|
-
(0,
|
|
7203
|
+
(0, import_editor_elements28.updateElementEditorSettings)({
|
|
7026
7204
|
elementId,
|
|
7027
7205
|
settings: { title: target.value }
|
|
7028
7206
|
});
|
|
@@ -7037,28 +7215,29 @@ var ConditionalTooltip = ({
|
|
|
7037
7215
|
if (!showTooltip) {
|
|
7038
7216
|
return children;
|
|
7039
7217
|
}
|
|
7040
|
-
return /* @__PURE__ */
|
|
7041
|
-
|
|
7218
|
+
return /* @__PURE__ */ React99.createElement(
|
|
7219
|
+
import_ui51.Infotip,
|
|
7042
7220
|
{
|
|
7043
7221
|
arrow: false,
|
|
7044
|
-
content: /* @__PURE__ */
|
|
7045
|
-
|
|
7222
|
+
content: /* @__PURE__ */ React99.createElement(
|
|
7223
|
+
import_ui51.Alert,
|
|
7046
7224
|
{
|
|
7047
7225
|
color: "secondary",
|
|
7048
|
-
icon: /* @__PURE__ */
|
|
7226
|
+
icon: /* @__PURE__ */ React99.createElement(import_icons29.InfoCircleFilledIcon, { fontSize: "tiny" }),
|
|
7049
7227
|
size: "small",
|
|
7050
7228
|
sx: { width: 288 }
|
|
7051
7229
|
},
|
|
7052
|
-
/* @__PURE__ */
|
|
7230
|
+
/* @__PURE__ */ React99.createElement(import_ui51.Typography, { variant: "body2" }, (0, import_i18n78.__)("To change the default tab, simply set another tab as default.", "elementor"))
|
|
7053
7231
|
)
|
|
7054
7232
|
},
|
|
7055
|
-
/* @__PURE__ */
|
|
7233
|
+
/* @__PURE__ */ React99.createElement("span", null, children)
|
|
7056
7234
|
);
|
|
7057
7235
|
};
|
|
7058
7236
|
|
|
7059
7237
|
// src/controls-registry/element-controls/registry.ts
|
|
7060
7238
|
var controlTypes2 = {
|
|
7061
7239
|
"list-items": { component: ListItemsControl, layout: "full" },
|
|
7240
|
+
"menu-items": { component: MenuItemsControl, layout: "full" },
|
|
7062
7241
|
tabs: { component: TabsControl, layout: "full" },
|
|
7063
7242
|
"accordion-items": { component: AccordionItemsControl, layout: "full" }
|
|
7064
7243
|
};
|
|
@@ -7072,27 +7251,27 @@ var registerElementControls = () => {
|
|
|
7072
7251
|
|
|
7073
7252
|
// src/dynamics/init.ts
|
|
7074
7253
|
var import_editor_canvas3 = require("@elementor/editor-canvas");
|
|
7075
|
-
var
|
|
7254
|
+
var import_editor_controls69 = require("@elementor/editor-controls");
|
|
7076
7255
|
var import_menus2 = require("@elementor/menus");
|
|
7077
7256
|
|
|
7078
7257
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
7079
|
-
var
|
|
7080
|
-
var
|
|
7081
|
-
var
|
|
7258
|
+
var React100 = __toESM(require("react"));
|
|
7259
|
+
var import_editor_controls64 = require("@elementor/editor-controls");
|
|
7260
|
+
var import_editor_props28 = require("@elementor/editor-props");
|
|
7082
7261
|
var import_icons30 = require("@elementor/icons");
|
|
7083
7262
|
|
|
7084
7263
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
7085
|
-
var
|
|
7264
|
+
var import_react46 = require("react");
|
|
7086
7265
|
|
|
7087
7266
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
7088
|
-
var
|
|
7089
|
-
var
|
|
7267
|
+
var import_react45 = require("react");
|
|
7268
|
+
var import_editor_controls63 = require("@elementor/editor-controls");
|
|
7090
7269
|
|
|
7091
7270
|
// src/dynamics/sync/get-atomic-dynamic-tags.ts
|
|
7092
7271
|
var import_editor_v1_adapters12 = require("@elementor/editor-v1-adapters");
|
|
7093
7272
|
|
|
7094
7273
|
// src/hooks/use-license-config.ts
|
|
7095
|
-
var
|
|
7274
|
+
var import_react44 = require("react");
|
|
7096
7275
|
var config = { expired: false };
|
|
7097
7276
|
var listeners = /* @__PURE__ */ new Set();
|
|
7098
7277
|
function setLicenseConfig(newConfig) {
|
|
@@ -7107,7 +7286,7 @@ function subscribe(listener) {
|
|
|
7107
7286
|
return () => listeners.delete(listener);
|
|
7108
7287
|
}
|
|
7109
7288
|
function useLicenseConfig() {
|
|
7110
|
-
return (0,
|
|
7289
|
+
return (0, import_react44.useSyncExternalStore)(subscribe, getLicenseConfig, getLicenseConfig);
|
|
7111
7290
|
}
|
|
7112
7291
|
|
|
7113
7292
|
// src/dynamics/sync/get-atomic-dynamic-tags.ts
|
|
@@ -7134,11 +7313,11 @@ var filterByLicense = (tags) => {
|
|
|
7134
7313
|
};
|
|
7135
7314
|
|
|
7136
7315
|
// src/dynamics/utils.ts
|
|
7137
|
-
var
|
|
7316
|
+
var import_editor_props27 = require("@elementor/editor-props");
|
|
7138
7317
|
var import_editor_v1_adapters13 = require("@elementor/editor-v1-adapters");
|
|
7139
7318
|
var import_schema = require("@elementor/schema");
|
|
7140
7319
|
var DYNAMIC_PROP_TYPE_KEY = "dynamic";
|
|
7141
|
-
var dynamicPropTypeUtil = (0,
|
|
7320
|
+
var dynamicPropTypeUtil = (0, import_editor_props27.createPropUtils)(
|
|
7142
7321
|
DYNAMIC_PROP_TYPE_KEY,
|
|
7143
7322
|
import_schema.z.strictObject({
|
|
7144
7323
|
name: import_schema.z.string(),
|
|
@@ -7155,7 +7334,7 @@ var getDynamicPropType = (propType) => {
|
|
|
7155
7334
|
return dynamicPropType && isDynamicPropType(dynamicPropType) ? dynamicPropType : null;
|
|
7156
7335
|
};
|
|
7157
7336
|
var isDynamicPropValue = (prop) => {
|
|
7158
|
-
return (0,
|
|
7337
|
+
return (0, import_editor_props27.isTransformable)(prop) && prop.$$type === DYNAMIC_PROP_TYPE_KEY;
|
|
7159
7338
|
};
|
|
7160
7339
|
var supportsDynamic = (propType) => {
|
|
7161
7340
|
return !!getDynamicPropType(propType);
|
|
@@ -7170,13 +7349,13 @@ var useAllPropDynamicTags = () => {
|
|
|
7170
7349
|
};
|
|
7171
7350
|
var usePropDynamicTagsInternal = (filterByLicense2) => {
|
|
7172
7351
|
let categories = [];
|
|
7173
|
-
const { propType } = (0,
|
|
7352
|
+
const { propType } = (0, import_editor_controls63.useBoundProp)();
|
|
7174
7353
|
if (propType) {
|
|
7175
7354
|
const propDynamicType = getDynamicPropType(propType);
|
|
7176
7355
|
categories = propDynamicType?.settings.categories || [];
|
|
7177
7356
|
}
|
|
7178
7357
|
const categoriesKey = categories.join();
|
|
7179
|
-
return (0,
|
|
7358
|
+
return (0, import_react45.useMemo)(
|
|
7180
7359
|
() => getDynamicTagsByCategories(categories, filterByLicense2),
|
|
7181
7360
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7182
7361
|
[categoriesKey, filterByLicense2]
|
|
@@ -7210,33 +7389,33 @@ var getDynamicTagsByCategories = (categories, filterByLicense2) => {
|
|
|
7210
7389
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
7211
7390
|
var useDynamicTag = (tagName) => {
|
|
7212
7391
|
const dynamicTags = useAllPropDynamicTags();
|
|
7213
|
-
return (0,
|
|
7392
|
+
return (0, import_react46.useMemo)(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
7214
7393
|
};
|
|
7215
7394
|
|
|
7216
7395
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
7217
|
-
var BackgroundControlDynamicTagIcon = () => /* @__PURE__ */
|
|
7396
|
+
var BackgroundControlDynamicTagIcon = () => /* @__PURE__ */ React100.createElement(import_icons30.DatabaseIcon, { fontSize: "tiny" });
|
|
7218
7397
|
var BackgroundControlDynamicTagLabel = ({ value }) => {
|
|
7219
|
-
const context = (0,
|
|
7220
|
-
return /* @__PURE__ */
|
|
7398
|
+
const context = (0, import_editor_controls64.useBoundProp)(import_editor_props28.backgroundImageOverlayPropTypeUtil);
|
|
7399
|
+
return /* @__PURE__ */ React100.createElement(import_editor_controls64.PropProvider, { ...context, value: value.value }, /* @__PURE__ */ React100.createElement(import_editor_controls64.PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React100.createElement(Wrapper2, { rawValue: value.value })));
|
|
7221
7400
|
};
|
|
7222
7401
|
var Wrapper2 = ({ rawValue }) => {
|
|
7223
|
-
const { propType } = (0,
|
|
7402
|
+
const { propType } = (0, import_editor_controls64.useBoundProp)();
|
|
7224
7403
|
const imageOverlayPropType = propType.prop_types["background-image-overlay"];
|
|
7225
|
-
return /* @__PURE__ */
|
|
7404
|
+
return /* @__PURE__ */ React100.createElement(import_editor_controls64.PropProvider, { propType: imageOverlayPropType.shape.image, value: rawValue, setValue: () => void 0 }, /* @__PURE__ */ React100.createElement(import_editor_controls64.PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React100.createElement(Content, { rawValue: rawValue.image })));
|
|
7226
7405
|
};
|
|
7227
7406
|
var Content = ({ rawValue }) => {
|
|
7228
7407
|
const src = rawValue.value.src;
|
|
7229
7408
|
const dynamicTag = useDynamicTag(src.value.name || "");
|
|
7230
|
-
return /* @__PURE__ */
|
|
7409
|
+
return /* @__PURE__ */ React100.createElement(React100.Fragment, null, dynamicTag?.label);
|
|
7231
7410
|
};
|
|
7232
7411
|
|
|
7233
7412
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
7234
|
-
var
|
|
7235
|
-
var
|
|
7413
|
+
var React104 = __toESM(require("react"));
|
|
7414
|
+
var import_editor_controls67 = require("@elementor/editor-controls");
|
|
7236
7415
|
var import_editor_ui12 = require("@elementor/editor-ui");
|
|
7237
7416
|
var import_icons32 = require("@elementor/icons");
|
|
7238
|
-
var
|
|
7239
|
-
var
|
|
7417
|
+
var import_ui53 = require("@elementor/ui");
|
|
7418
|
+
var import_i18n80 = require("@wordpress/i18n");
|
|
7240
7419
|
|
|
7241
7420
|
// src/hooks/use-persist-dynamic-value.ts
|
|
7242
7421
|
var import_session10 = require("@elementor/session");
|
|
@@ -7247,20 +7426,20 @@ var usePersistDynamicValue = (propKey) => {
|
|
|
7247
7426
|
};
|
|
7248
7427
|
|
|
7249
7428
|
// src/dynamics/dynamic-control.tsx
|
|
7250
|
-
var
|
|
7251
|
-
var
|
|
7429
|
+
var React102 = __toESM(require("react"));
|
|
7430
|
+
var import_editor_controls65 = require("@elementor/editor-controls");
|
|
7252
7431
|
|
|
7253
7432
|
// src/dynamics/components/dynamic-conditional-control.tsx
|
|
7254
|
-
var
|
|
7255
|
-
var
|
|
7256
|
-
var
|
|
7433
|
+
var React101 = __toESM(require("react"));
|
|
7434
|
+
var import_react47 = require("react");
|
|
7435
|
+
var import_editor_props29 = require("@elementor/editor-props");
|
|
7257
7436
|
var DynamicConditionalControl = ({
|
|
7258
7437
|
children,
|
|
7259
7438
|
propType,
|
|
7260
7439
|
propsSchema,
|
|
7261
7440
|
dynamicSettings
|
|
7262
7441
|
}) => {
|
|
7263
|
-
const defaults = (0,
|
|
7442
|
+
const defaults = (0, import_react47.useMemo)(() => {
|
|
7264
7443
|
if (!propsSchema) {
|
|
7265
7444
|
return {};
|
|
7266
7445
|
}
|
|
@@ -7270,7 +7449,7 @@ var DynamicConditionalControl = ({
|
|
|
7270
7449
|
return result;
|
|
7271
7450
|
}, {});
|
|
7272
7451
|
}, [propsSchema]);
|
|
7273
|
-
const convertedSettings = (0,
|
|
7452
|
+
const convertedSettings = (0, import_react47.useMemo)(() => {
|
|
7274
7453
|
if (!dynamicSettings) {
|
|
7275
7454
|
return {};
|
|
7276
7455
|
}
|
|
@@ -7289,19 +7468,19 @@ var DynamicConditionalControl = ({
|
|
|
7289
7468
|
{}
|
|
7290
7469
|
);
|
|
7291
7470
|
}, [dynamicSettings]);
|
|
7292
|
-
const effectiveSettings = (0,
|
|
7471
|
+
const effectiveSettings = (0, import_react47.useMemo)(() => {
|
|
7293
7472
|
return { ...defaults, ...convertedSettings };
|
|
7294
7473
|
}, [defaults, convertedSettings]);
|
|
7295
7474
|
if (!propType?.dependencies?.terms.length) {
|
|
7296
|
-
return /* @__PURE__ */
|
|
7475
|
+
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, children);
|
|
7297
7476
|
}
|
|
7298
|
-
const isHidden = !(0,
|
|
7299
|
-
return isHidden ? null : /* @__PURE__ */
|
|
7477
|
+
const isHidden = !(0, import_editor_props29.isDependencyMet)(propType?.dependencies, effectiveSettings).isMet;
|
|
7478
|
+
return isHidden ? null : /* @__PURE__ */ React101.createElement(React101.Fragment, null, children);
|
|
7300
7479
|
};
|
|
7301
7480
|
|
|
7302
7481
|
// src/dynamics/dynamic-control.tsx
|
|
7303
7482
|
var DynamicControl = ({ bind, children }) => {
|
|
7304
|
-
const { value, setValue } = (0,
|
|
7483
|
+
const { value, setValue } = (0, import_editor_controls65.useBoundProp)(dynamicPropTypeUtil);
|
|
7305
7484
|
const { name = "", group = "", settings } = value ?? {};
|
|
7306
7485
|
const dynamicTag = useDynamicTag(name);
|
|
7307
7486
|
if (!dynamicTag) {
|
|
@@ -7321,7 +7500,7 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
7321
7500
|
});
|
|
7322
7501
|
};
|
|
7323
7502
|
const propType = createTopLevelObjectType({ schema: dynamicTag.props_schema });
|
|
7324
|
-
return /* @__PURE__ */
|
|
7503
|
+
return /* @__PURE__ */ React102.createElement(import_editor_controls65.PropProvider, { propType, setValue: setDynamicValue, value: { [bind]: dynamicValue } }, /* @__PURE__ */ React102.createElement(import_editor_controls65.PropKeyProvider, { bind }, /* @__PURE__ */ React102.createElement(
|
|
7325
7504
|
DynamicConditionalControl,
|
|
7326
7505
|
{
|
|
7327
7506
|
propType: dynamicPropType,
|
|
@@ -7333,32 +7512,32 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
7333
7512
|
};
|
|
7334
7513
|
|
|
7335
7514
|
// src/dynamics/components/dynamic-selection.tsx
|
|
7336
|
-
var
|
|
7337
|
-
var
|
|
7338
|
-
var
|
|
7515
|
+
var React103 = __toESM(require("react"));
|
|
7516
|
+
var import_react48 = require("react");
|
|
7517
|
+
var import_editor_controls66 = require("@elementor/editor-controls");
|
|
7339
7518
|
var import_editor_ui11 = require("@elementor/editor-ui");
|
|
7340
7519
|
var import_icons31 = require("@elementor/icons");
|
|
7341
|
-
var
|
|
7342
|
-
var
|
|
7520
|
+
var import_ui52 = require("@elementor/ui");
|
|
7521
|
+
var import_i18n79 = require("@wordpress/i18n");
|
|
7343
7522
|
var SIZE2 = "tiny";
|
|
7344
7523
|
var PROMO_TEXT_WIDTH = 170;
|
|
7345
7524
|
var PRO_DYNAMIC_TAGS_URL = "https://go.elementor.com/go-pro-dynamic-tags-modal/";
|
|
7346
7525
|
var RENEW_DYNAMIC_TAGS_URL = "https://go.elementor.com/go-pro-dynamic-tags-renew-modal/";
|
|
7347
7526
|
var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
7348
|
-
const [searchValue, setSearchValue] = (0,
|
|
7527
|
+
const [searchValue, setSearchValue] = (0, import_react48.useState)("");
|
|
7349
7528
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
7350
|
-
const theme = (0,
|
|
7351
|
-
const { value: anyValue } = (0,
|
|
7352
|
-
const { bind, value: dynamicValue, setValue } = (0,
|
|
7529
|
+
const theme = (0, import_ui52.useTheme)();
|
|
7530
|
+
const { value: anyValue } = (0, import_editor_controls66.useBoundProp)();
|
|
7531
|
+
const { bind, value: dynamicValue, setValue } = (0, import_editor_controls66.useBoundProp)(dynamicPropTypeUtil);
|
|
7353
7532
|
const [, updatePropValueHistory] = usePersistDynamicValue(bind);
|
|
7354
7533
|
const isCurrentValueDynamic = !!dynamicValue;
|
|
7355
7534
|
const options13 = useFilteredOptions(searchValue);
|
|
7356
7535
|
const hasNoDynamicTags = !options13.length && !searchValue.trim();
|
|
7357
|
-
(0,
|
|
7536
|
+
(0, import_react48.useEffect)(() => {
|
|
7358
7537
|
if (hasNoDynamicTags) {
|
|
7359
|
-
(0,
|
|
7538
|
+
(0, import_editor_controls66.trackViewPromotion)({ target_name: "dynamic_tags" });
|
|
7360
7539
|
} else if (expired) {
|
|
7361
|
-
(0,
|
|
7540
|
+
(0, import_editor_controls66.trackViewPromotion)({ target_name: "dynamic_tags" });
|
|
7362
7541
|
}
|
|
7363
7542
|
}, [hasNoDynamicTags, expired]);
|
|
7364
7543
|
const handleSearch = (value) => {
|
|
@@ -7386,19 +7565,19 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
|
7386
7565
|
]);
|
|
7387
7566
|
const getPopOverContent = () => {
|
|
7388
7567
|
if (hasNoDynamicTags) {
|
|
7389
|
-
return /* @__PURE__ */
|
|
7568
|
+
return /* @__PURE__ */ React103.createElement(NoDynamicTags, null);
|
|
7390
7569
|
}
|
|
7391
7570
|
if (expired) {
|
|
7392
|
-
return /* @__PURE__ */
|
|
7571
|
+
return /* @__PURE__ */ React103.createElement(ExpiredDynamicTags, null);
|
|
7393
7572
|
}
|
|
7394
|
-
return /* @__PURE__ */
|
|
7573
|
+
return /* @__PURE__ */ React103.createElement(import_react48.Fragment, null, /* @__PURE__ */ React103.createElement(
|
|
7395
7574
|
import_editor_ui11.SearchField,
|
|
7396
7575
|
{
|
|
7397
7576
|
value: searchValue,
|
|
7398
7577
|
onSearch: handleSearch,
|
|
7399
|
-
placeholder: (0,
|
|
7578
|
+
placeholder: (0, import_i18n79.__)("Search dynamic tags\u2026", "elementor")
|
|
7400
7579
|
}
|
|
7401
|
-
), /* @__PURE__ */
|
|
7580
|
+
), /* @__PURE__ */ React103.createElement(import_ui52.Divider, null), /* @__PURE__ */ React103.createElement(
|
|
7402
7581
|
import_editor_ui11.PopoverMenuList,
|
|
7403
7582
|
{
|
|
7404
7583
|
items: virtualizedItems,
|
|
@@ -7406,21 +7585,21 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
|
7406
7585
|
onClose: closePopover,
|
|
7407
7586
|
selectedValue: dynamicValue?.name,
|
|
7408
7587
|
itemStyle: (item) => item.type === "item" ? { paddingInlineStart: theme.spacing(3.5) } : {},
|
|
7409
|
-
noResultsComponent: /* @__PURE__ */
|
|
7588
|
+
noResultsComponent: /* @__PURE__ */ React103.createElement(NoResults, { searchValue, onClear: () => setSearchValue("") })
|
|
7410
7589
|
}
|
|
7411
7590
|
));
|
|
7412
7591
|
};
|
|
7413
|
-
return /* @__PURE__ */
|
|
7592
|
+
return /* @__PURE__ */ React103.createElement(import_editor_ui11.SectionPopoverBody, { "aria-label": (0, import_i18n79.__)("Dynamic tags", "elementor") }, /* @__PURE__ */ React103.createElement(
|
|
7414
7593
|
import_editor_ui11.PopoverHeader,
|
|
7415
7594
|
{
|
|
7416
|
-
title: (0,
|
|
7595
|
+
title: (0, import_i18n79.__)("Dynamic tags", "elementor"),
|
|
7417
7596
|
onClose: closePopover,
|
|
7418
|
-
icon: /* @__PURE__ */
|
|
7597
|
+
icon: /* @__PURE__ */ React103.createElement(import_icons31.DatabaseIcon, { fontSize: SIZE2 })
|
|
7419
7598
|
}
|
|
7420
7599
|
), getPopOverContent());
|
|
7421
7600
|
};
|
|
7422
|
-
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */
|
|
7423
|
-
|
|
7601
|
+
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React103.createElement(
|
|
7602
|
+
import_ui52.Stack,
|
|
7424
7603
|
{
|
|
7425
7604
|
gap: 1,
|
|
7426
7605
|
alignItems: "center",
|
|
@@ -7430,12 +7609,12 @@ var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React102.createEle
|
|
|
7430
7609
|
color: "text.secondary",
|
|
7431
7610
|
sx: { pb: 3.5 }
|
|
7432
7611
|
},
|
|
7433
|
-
/* @__PURE__ */
|
|
7434
|
-
/* @__PURE__ */
|
|
7435
|
-
/* @__PURE__ */
|
|
7612
|
+
/* @__PURE__ */ React103.createElement(import_icons31.DatabaseIcon, { fontSize: "large" }),
|
|
7613
|
+
/* @__PURE__ */ React103.createElement(import_ui52.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n79.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React103.createElement("br", null), "\u201C", searchValue, "\u201D."),
|
|
7614
|
+
/* @__PURE__ */ React103.createElement(import_ui52.Typography, { align: "center", variant: "caption", sx: { display: "flex", flexDirection: "column" } }, (0, import_i18n79.__)("Try something else.", "elementor"), /* @__PURE__ */ React103.createElement(import_ui52.Link, { color: "text.secondary", variant: "caption", component: "button", onClick: onClear }, (0, import_i18n79.__)("Clear & try again", "elementor")))
|
|
7436
7615
|
);
|
|
7437
|
-
var NoDynamicTags = () => /* @__PURE__ */
|
|
7438
|
-
|
|
7616
|
+
var NoDynamicTags = () => /* @__PURE__ */ React103.createElement(React103.Fragment, null, /* @__PURE__ */ React103.createElement(import_ui52.Divider, null), /* @__PURE__ */ React103.createElement(
|
|
7617
|
+
import_ui52.Stack,
|
|
7439
7618
|
{
|
|
7440
7619
|
gap: 1,
|
|
7441
7620
|
alignItems: "center",
|
|
@@ -7445,20 +7624,20 @@ var NoDynamicTags = () => /* @__PURE__ */ React102.createElement(React102.Fragme
|
|
|
7445
7624
|
color: "text.secondary",
|
|
7446
7625
|
sx: { pb: 3.5 }
|
|
7447
7626
|
},
|
|
7448
|
-
/* @__PURE__ */
|
|
7449
|
-
/* @__PURE__ */
|
|
7450
|
-
/* @__PURE__ */
|
|
7451
|
-
/* @__PURE__ */
|
|
7627
|
+
/* @__PURE__ */ React103.createElement(import_icons31.DatabaseIcon, { fontSize: "large" }),
|
|
7628
|
+
/* @__PURE__ */ React103.createElement(import_ui52.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n79.__)("Streamline your workflow with dynamic tags", "elementor")),
|
|
7629
|
+
/* @__PURE__ */ React103.createElement(import_ui52.Typography, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, (0, import_i18n79.__)("Upgrade now to display your content dynamically.", "elementor")),
|
|
7630
|
+
/* @__PURE__ */ React103.createElement(
|
|
7452
7631
|
import_editor_ui11.CtaButton,
|
|
7453
7632
|
{
|
|
7454
7633
|
size: "small",
|
|
7455
7634
|
href: PRO_DYNAMIC_TAGS_URL,
|
|
7456
|
-
onClick: () => (0,
|
|
7635
|
+
onClick: () => (0, import_editor_controls66.trackUpgradePromotionClick)({ target_name: "dynamic_tags" })
|
|
7457
7636
|
}
|
|
7458
7637
|
)
|
|
7459
7638
|
));
|
|
7460
|
-
var ExpiredDynamicTags = () => /* @__PURE__ */
|
|
7461
|
-
|
|
7639
|
+
var ExpiredDynamicTags = () => /* @__PURE__ */ React103.createElement(React103.Fragment, null, /* @__PURE__ */ React103.createElement(import_ui52.Divider, null), /* @__PURE__ */ React103.createElement(
|
|
7640
|
+
import_ui52.Stack,
|
|
7462
7641
|
{
|
|
7463
7642
|
gap: 1,
|
|
7464
7643
|
alignItems: "center",
|
|
@@ -7468,16 +7647,16 @@ var ExpiredDynamicTags = () => /* @__PURE__ */ React102.createElement(React102.F
|
|
|
7468
7647
|
color: "text.secondary",
|
|
7469
7648
|
sx: { pb: 3.5 }
|
|
7470
7649
|
},
|
|
7471
|
-
/* @__PURE__ */
|
|
7472
|
-
/* @__PURE__ */
|
|
7473
|
-
/* @__PURE__ */
|
|
7474
|
-
/* @__PURE__ */
|
|
7650
|
+
/* @__PURE__ */ React103.createElement(import_icons31.DatabaseIcon, { fontSize: "large" }),
|
|
7651
|
+
/* @__PURE__ */ React103.createElement(import_ui52.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n79.__)("Unlock your Dynamic tags again", "elementor")),
|
|
7652
|
+
/* @__PURE__ */ React103.createElement(import_ui52.Typography, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, (0, import_i18n79.__)("Dynamic tags need Elementor Pro. Renew now to keep them active.", "elementor")),
|
|
7653
|
+
/* @__PURE__ */ React103.createElement(
|
|
7475
7654
|
import_editor_ui11.CtaButton,
|
|
7476
7655
|
{
|
|
7477
7656
|
size: "small",
|
|
7478
7657
|
href: RENEW_DYNAMIC_TAGS_URL,
|
|
7479
|
-
onClick: () => (0,
|
|
7480
|
-
children: (0,
|
|
7658
|
+
onClick: () => (0, import_editor_controls66.trackUpgradePromotionClick)({ target_name: "dynamic_tags" }),
|
|
7659
|
+
children: (0, import_i18n79.__)("Renew Now", "elementor")
|
|
7481
7660
|
}
|
|
7482
7661
|
)
|
|
7483
7662
|
));
|
|
@@ -7501,8 +7680,8 @@ var useFilteredOptions = (searchValue) => {
|
|
|
7501
7680
|
var SIZE3 = "tiny";
|
|
7502
7681
|
var tagsWithoutTabs = ["popup"];
|
|
7503
7682
|
var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
7504
|
-
const { setValue: setAnyValue, propType } = (0,
|
|
7505
|
-
const { bind, value } = (0,
|
|
7683
|
+
const { setValue: setAnyValue, propType } = (0, import_editor_controls67.useBoundProp)();
|
|
7684
|
+
const { bind, value } = (0, import_editor_controls67.useBoundProp)(dynamicPropTypeUtil);
|
|
7506
7685
|
const { expired: readonly } = useLicenseConfig();
|
|
7507
7686
|
const originalPropType = createTopLevelObjectType({
|
|
7508
7687
|
schema: {
|
|
@@ -7510,11 +7689,11 @@ var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
|
7510
7689
|
}
|
|
7511
7690
|
});
|
|
7512
7691
|
const [propValueFromHistory] = usePersistDynamicValue(bind);
|
|
7513
|
-
const selectionPopoverState = (0,
|
|
7692
|
+
const selectionPopoverState = (0, import_ui53.usePopupState)({ variant: "popover" });
|
|
7514
7693
|
const { name: tagName = "" } = value;
|
|
7515
7694
|
const dynamicTag = useDynamicTag(tagName);
|
|
7516
7695
|
if (!isDynamicTagSupported(tagName) && OriginalControl) {
|
|
7517
|
-
return /* @__PURE__ */
|
|
7696
|
+
return /* @__PURE__ */ React104.createElement(import_editor_controls67.PropProvider, { propType: originalPropType, value: { [bind]: null }, setValue: setAnyValue }, /* @__PURE__ */ React104.createElement(import_editor_controls67.PropKeyProvider, { bind }, /* @__PURE__ */ React104.createElement(OriginalControl, { ...props })));
|
|
7518
7697
|
}
|
|
7519
7698
|
const removeDynamicTag = () => {
|
|
7520
7699
|
setAnyValue(propValueFromHistory ?? null);
|
|
@@ -7522,26 +7701,26 @@ var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
|
7522
7701
|
if (!dynamicTag) {
|
|
7523
7702
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
7524
7703
|
}
|
|
7525
|
-
return /* @__PURE__ */
|
|
7526
|
-
|
|
7704
|
+
return /* @__PURE__ */ React104.createElement(import_ui53.Box, null, /* @__PURE__ */ React104.createElement(
|
|
7705
|
+
import_ui53.UnstableTag,
|
|
7527
7706
|
{
|
|
7528
7707
|
fullWidth: true,
|
|
7529
7708
|
showActionsOnHover: true,
|
|
7530
7709
|
label: dynamicTag.label,
|
|
7531
|
-
startIcon: /* @__PURE__ */
|
|
7532
|
-
...(0,
|
|
7533
|
-
actions: /* @__PURE__ */
|
|
7534
|
-
|
|
7710
|
+
startIcon: /* @__PURE__ */ React104.createElement(import_icons32.DatabaseIcon, { fontSize: SIZE3 }),
|
|
7711
|
+
...(0, import_ui53.bindTrigger)(selectionPopoverState),
|
|
7712
|
+
actions: /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(DynamicSettingsPopover, { dynamicTag, disabled: readonly }), /* @__PURE__ */ React104.createElement(
|
|
7713
|
+
import_ui53.IconButton,
|
|
7535
7714
|
{
|
|
7536
7715
|
size: SIZE3,
|
|
7537
7716
|
onClick: removeDynamicTag,
|
|
7538
|
-
"aria-label": (0,
|
|
7717
|
+
"aria-label": (0, import_i18n80.__)("Remove dynamic value", "elementor")
|
|
7539
7718
|
},
|
|
7540
|
-
/* @__PURE__ */
|
|
7719
|
+
/* @__PURE__ */ React104.createElement(import_icons32.XIcon, { fontSize: SIZE3 })
|
|
7541
7720
|
))
|
|
7542
7721
|
}
|
|
7543
|
-
), /* @__PURE__ */
|
|
7544
|
-
|
|
7722
|
+
), /* @__PURE__ */ React104.createElement(
|
|
7723
|
+
import_ui53.Popover,
|
|
7545
7724
|
{
|
|
7546
7725
|
disablePortal: true,
|
|
7547
7726
|
disableScrollLock: true,
|
|
@@ -7550,31 +7729,31 @@ var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
|
7550
7729
|
PaperProps: {
|
|
7551
7730
|
sx: { my: 1 }
|
|
7552
7731
|
},
|
|
7553
|
-
...(0,
|
|
7732
|
+
...(0, import_ui53.bindPopover)(selectionPopoverState)
|
|
7554
7733
|
},
|
|
7555
|
-
/* @__PURE__ */
|
|
7734
|
+
/* @__PURE__ */ React104.createElement(import_editor_ui12.SectionPopoverBody, { "aria-label": (0, import_i18n80.__)("Dynamic tags", "elementor") }, /* @__PURE__ */ React104.createElement(DynamicSelection, { close: selectionPopoverState.close, expired: readonly }))
|
|
7556
7735
|
));
|
|
7557
7736
|
};
|
|
7558
7737
|
var DynamicSettingsPopover = ({
|
|
7559
7738
|
dynamicTag,
|
|
7560
7739
|
disabled = false
|
|
7561
7740
|
}) => {
|
|
7562
|
-
const popupState = (0,
|
|
7741
|
+
const popupState = (0, import_ui53.usePopupState)({ variant: "popover" });
|
|
7563
7742
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
7564
7743
|
if (!hasDynamicSettings) {
|
|
7565
7744
|
return null;
|
|
7566
7745
|
}
|
|
7567
|
-
return /* @__PURE__ */
|
|
7568
|
-
|
|
7746
|
+
return /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(
|
|
7747
|
+
import_ui53.IconButton,
|
|
7569
7748
|
{
|
|
7570
7749
|
size: SIZE3,
|
|
7571
7750
|
disabled,
|
|
7572
|
-
...!disabled && (0,
|
|
7573
|
-
"aria-label": (0,
|
|
7751
|
+
...!disabled && (0, import_ui53.bindTrigger)(popupState),
|
|
7752
|
+
"aria-label": (0, import_i18n80.__)("Dynamic settings", "elementor")
|
|
7574
7753
|
},
|
|
7575
|
-
/* @__PURE__ */
|
|
7576
|
-
), /* @__PURE__ */
|
|
7577
|
-
|
|
7754
|
+
/* @__PURE__ */ React104.createElement(import_icons32.SettingsIcon, { fontSize: SIZE3 })
|
|
7755
|
+
), /* @__PURE__ */ React104.createElement(
|
|
7756
|
+
import_ui53.Popover,
|
|
7578
7757
|
{
|
|
7579
7758
|
disablePortal: true,
|
|
7580
7759
|
disableScrollLock: true,
|
|
@@ -7583,45 +7762,45 @@ var DynamicSettingsPopover = ({
|
|
|
7583
7762
|
PaperProps: {
|
|
7584
7763
|
sx: { my: 1 }
|
|
7585
7764
|
},
|
|
7586
|
-
...(0,
|
|
7765
|
+
...(0, import_ui53.bindPopover)(popupState)
|
|
7587
7766
|
},
|
|
7588
|
-
/* @__PURE__ */
|
|
7767
|
+
/* @__PURE__ */ React104.createElement(import_editor_ui12.SectionPopoverBody, { "aria-label": (0, import_i18n80.__)("Dynamic settings", "elementor") }, /* @__PURE__ */ React104.createElement(
|
|
7589
7768
|
import_editor_ui12.PopoverHeader,
|
|
7590
7769
|
{
|
|
7591
7770
|
title: dynamicTag.label,
|
|
7592
7771
|
onClose: popupState.close,
|
|
7593
|
-
icon: /* @__PURE__ */
|
|
7772
|
+
icon: /* @__PURE__ */ React104.createElement(import_icons32.DatabaseIcon, { fontSize: SIZE3 })
|
|
7594
7773
|
}
|
|
7595
|
-
), /* @__PURE__ */
|
|
7774
|
+
), /* @__PURE__ */ React104.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls, tagName: dynamicTag.name }))
|
|
7596
7775
|
));
|
|
7597
7776
|
};
|
|
7598
7777
|
var DynamicSettings = ({ controls, tagName }) => {
|
|
7599
7778
|
const tabs = controls.filter(({ type }) => type === "section");
|
|
7600
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
7779
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui53.useTabs)(0);
|
|
7601
7780
|
if (!tabs.length) {
|
|
7602
7781
|
return null;
|
|
7603
7782
|
}
|
|
7604
7783
|
if (tagsWithoutTabs.includes(tagName)) {
|
|
7605
7784
|
const singleTab = tabs[0];
|
|
7606
|
-
return /* @__PURE__ */
|
|
7785
|
+
return /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(import_ui53.Divider, null), /* @__PURE__ */ React104.createElement(ControlsItemsStack, { items: singleTab.value.items }));
|
|
7607
7786
|
}
|
|
7608
|
-
return /* @__PURE__ */
|
|
7609
|
-
|
|
7787
|
+
return /* @__PURE__ */ React104.createElement(React104.Fragment, null, tabs.length > 1 && /* @__PURE__ */ React104.createElement(import_ui53.Tabs, { size: "small", variant: "fullWidth", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React104.createElement(
|
|
7788
|
+
import_ui53.Tab,
|
|
7610
7789
|
{
|
|
7611
7790
|
key: index,
|
|
7612
7791
|
label: value.label,
|
|
7613
7792
|
sx: { px: 1, py: 0.5 },
|
|
7614
7793
|
...getTabProps(index)
|
|
7615
7794
|
}
|
|
7616
|
-
))), /* @__PURE__ */
|
|
7617
|
-
return /* @__PURE__ */
|
|
7618
|
-
|
|
7795
|
+
))), /* @__PURE__ */ React104.createElement(import_ui53.Divider, null), tabs.map(({ value }, index) => {
|
|
7796
|
+
return /* @__PURE__ */ React104.createElement(
|
|
7797
|
+
import_ui53.TabPanel,
|
|
7619
7798
|
{
|
|
7620
7799
|
key: index,
|
|
7621
7800
|
sx: { flexGrow: 1, py: 0, overflowY: "auto" },
|
|
7622
7801
|
...getTabPanelProps(index)
|
|
7623
7802
|
},
|
|
7624
|
-
/* @__PURE__ */
|
|
7803
|
+
/* @__PURE__ */ React104.createElement(ControlsItemsStack, { items: value.items })
|
|
7625
7804
|
);
|
|
7626
7805
|
}));
|
|
7627
7806
|
};
|
|
@@ -7663,17 +7842,17 @@ var Control2 = ({ control }) => {
|
|
|
7663
7842
|
display: "grid",
|
|
7664
7843
|
gridTemplateColumns: isSwitchControl ? "minmax(0, 1fr) max-content" : "1fr 1fr"
|
|
7665
7844
|
} : {};
|
|
7666
|
-
return /* @__PURE__ */
|
|
7845
|
+
return /* @__PURE__ */ React104.createElement(DynamicControl, { bind: control.bind }, /* @__PURE__ */ React104.createElement(import_ui53.Grid, { container: true, gap: 0.75, sx: layoutStyleProps }, control.label ? /* @__PURE__ */ React104.createElement(import_ui53.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React104.createElement(import_editor_controls67.ControlFormLabel, null, control.label)) : null, /* @__PURE__ */ React104.createElement(import_ui53.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React104.createElement(Control, { type: control.type, props: controlProps }))));
|
|
7667
7846
|
};
|
|
7668
7847
|
function ControlsItemsStack({ items: items3 }) {
|
|
7669
|
-
return /* @__PURE__ */
|
|
7670
|
-
(item) => item.type === "control" ? /* @__PURE__ */
|
|
7848
|
+
return /* @__PURE__ */ React104.createElement(import_ui53.Stack, { p: 2, gap: 2, sx: { overflowY: "auto" } }, items3.map(
|
|
7849
|
+
(item) => item.type === "control" ? /* @__PURE__ */ React104.createElement(Control2, { key: item.value.bind, control: item.value }) : null
|
|
7671
7850
|
));
|
|
7672
7851
|
}
|
|
7673
7852
|
|
|
7674
7853
|
// src/dynamics/dynamic-transformer.ts
|
|
7675
7854
|
var import_editor_canvas2 = require("@elementor/editor-canvas");
|
|
7676
|
-
var
|
|
7855
|
+
var import_editor_props30 = require("@elementor/editor-props");
|
|
7677
7856
|
|
|
7678
7857
|
// src/dynamics/errors.ts
|
|
7679
7858
|
var import_utils9 = require("@elementor/utils");
|
|
@@ -7692,7 +7871,7 @@ var dynamicTransformer = (0, import_editor_canvas2.createTransformer)((value, {
|
|
|
7692
7871
|
});
|
|
7693
7872
|
function simpleTransform(props) {
|
|
7694
7873
|
const transformed = Object.entries(props).map(([settingKey, settingValue]) => {
|
|
7695
|
-
const value = (0,
|
|
7874
|
+
const value = (0, import_editor_props30.isTransformable)(settingValue) ? settingValue.value : settingValue;
|
|
7696
7875
|
return [settingKey, value];
|
|
7697
7876
|
});
|
|
7698
7877
|
return Object.fromEntries(transformed);
|
|
@@ -7724,34 +7903,34 @@ function getDynamicValue(name, settings, renderPostId) {
|
|
|
7724
7903
|
}
|
|
7725
7904
|
|
|
7726
7905
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
7727
|
-
var
|
|
7728
|
-
var
|
|
7906
|
+
var React105 = __toESM(require("react"));
|
|
7907
|
+
var import_editor_controls68 = require("@elementor/editor-controls");
|
|
7729
7908
|
var import_icons33 = require("@elementor/icons");
|
|
7730
|
-
var
|
|
7909
|
+
var import_i18n81 = require("@wordpress/i18n");
|
|
7731
7910
|
var usePropDynamicAction = () => {
|
|
7732
|
-
const { propType } = (0,
|
|
7911
|
+
const { propType } = (0, import_editor_controls68.useBoundProp)();
|
|
7733
7912
|
const visible = !!propType && supportsDynamic(propType);
|
|
7734
7913
|
return {
|
|
7735
7914
|
visible,
|
|
7736
7915
|
icon: import_icons33.DatabaseIcon,
|
|
7737
|
-
title: (0,
|
|
7738
|
-
content: ({ close }) => /* @__PURE__ */
|
|
7916
|
+
title: (0, import_i18n81.__)("Dynamic tags", "elementor"),
|
|
7917
|
+
content: ({ close }) => /* @__PURE__ */ React105.createElement(DynamicSelection, { close })
|
|
7739
7918
|
};
|
|
7740
7919
|
};
|
|
7741
7920
|
|
|
7742
7921
|
// src/dynamics/init.ts
|
|
7743
7922
|
var { registerPopoverAction } = import_menus2.controlActionsMenu;
|
|
7744
7923
|
var init2 = () => {
|
|
7745
|
-
(0,
|
|
7924
|
+
(0, import_editor_controls69.registerControlReplacement)({
|
|
7746
7925
|
component: DynamicSelectionControl,
|
|
7747
7926
|
condition: ({ value }) => isDynamicPropValue(value)
|
|
7748
7927
|
});
|
|
7749
|
-
(0,
|
|
7928
|
+
(0, import_editor_controls69.injectIntoRepeaterItemLabel)({
|
|
7750
7929
|
id: "dynamic-background-image",
|
|
7751
7930
|
condition: ({ value }) => isDynamicPropValue(value.value?.image?.value?.src),
|
|
7752
7931
|
component: BackgroundControlDynamicTagLabel
|
|
7753
7932
|
});
|
|
7754
|
-
(0,
|
|
7933
|
+
(0, import_editor_controls69.injectIntoRepeaterItemIcon)({
|
|
7755
7934
|
id: "dynamic-background-image",
|
|
7756
7935
|
condition: ({ value }) => isDynamicPropValue(value.value?.image?.value?.src),
|
|
7757
7936
|
component: BackgroundControlDynamicTagIcon
|
|
@@ -7766,11 +7945,11 @@ var init2 = () => {
|
|
|
7766
7945
|
};
|
|
7767
7946
|
|
|
7768
7947
|
// src/reset-style-props.tsx
|
|
7769
|
-
var
|
|
7948
|
+
var import_editor_controls70 = require("@elementor/editor-controls");
|
|
7770
7949
|
var import_editor_variables2 = require("@elementor/editor-variables");
|
|
7771
7950
|
var import_icons34 = require("@elementor/icons");
|
|
7772
7951
|
var import_menus3 = require("@elementor/menus");
|
|
7773
|
-
var
|
|
7952
|
+
var import_i18n82 = require("@wordpress/i18n");
|
|
7774
7953
|
|
|
7775
7954
|
// src/utils/is-equal.ts
|
|
7776
7955
|
function isEqual(a, b) {
|
|
@@ -7826,7 +8005,7 @@ function initResetStyleProps() {
|
|
|
7826
8005
|
}
|
|
7827
8006
|
function useResetStyleValueProps() {
|
|
7828
8007
|
const isStyle = useIsStyle();
|
|
7829
|
-
const { value, resetValue, propType } = (0,
|
|
8008
|
+
const { value, resetValue, propType } = (0, import_editor_controls70.useBoundProp)();
|
|
7830
8009
|
const hasValue = value !== null && value !== void 0;
|
|
7831
8010
|
const hasInitial = propType.initial_value !== void 0 && propType.initial_value !== null;
|
|
7832
8011
|
const isRequired = !!propType.settings?.required;
|
|
@@ -7846,44 +8025,44 @@ function useResetStyleValueProps() {
|
|
|
7846
8025
|
const visible = calculateVisibility();
|
|
7847
8026
|
return {
|
|
7848
8027
|
visible,
|
|
7849
|
-
title: (0,
|
|
8028
|
+
title: (0, import_i18n82.__)("Clear", "elementor"),
|
|
7850
8029
|
icon: import_icons34.BrushBigIcon,
|
|
7851
8030
|
onClick: () => resetValue()
|
|
7852
8031
|
};
|
|
7853
8032
|
}
|
|
7854
8033
|
|
|
7855
8034
|
// src/styles-inheritance/components/styles-inheritance-indicator.tsx
|
|
7856
|
-
var
|
|
7857
|
-
var
|
|
7858
|
-
var
|
|
8035
|
+
var React111 = __toESM(require("react"));
|
|
8036
|
+
var import_editor_controls71 = require("@elementor/editor-controls");
|
|
8037
|
+
var import_editor_props31 = require("@elementor/editor-props");
|
|
7859
8038
|
var import_editor_styles_repository20 = require("@elementor/editor-styles-repository");
|
|
7860
|
-
var
|
|
8039
|
+
var import_i18n86 = require("@wordpress/i18n");
|
|
7861
8040
|
|
|
7862
8041
|
// src/styles-inheritance/components/styles-inheritance-infotip.tsx
|
|
7863
|
-
var
|
|
7864
|
-
var
|
|
8042
|
+
var React110 = __toESM(require("react"));
|
|
8043
|
+
var import_react50 = require("react");
|
|
7865
8044
|
var import_editor_canvas5 = require("@elementor/editor-canvas");
|
|
7866
8045
|
var import_editor_ui13 = require("@elementor/editor-ui");
|
|
7867
|
-
var
|
|
7868
|
-
var
|
|
8046
|
+
var import_ui58 = require("@elementor/ui");
|
|
8047
|
+
var import_i18n85 = require("@wordpress/i18n");
|
|
7869
8048
|
|
|
7870
8049
|
// src/styles-inheritance/hooks/use-normalized-inheritance-chain-items.tsx
|
|
7871
|
-
var
|
|
8050
|
+
var import_react49 = require("react");
|
|
7872
8051
|
var import_editor_canvas4 = require("@elementor/editor-canvas");
|
|
7873
8052
|
var import_editor_styles8 = require("@elementor/editor-styles");
|
|
7874
8053
|
var import_editor_styles_repository18 = require("@elementor/editor-styles-repository");
|
|
7875
|
-
var
|
|
8054
|
+
var import_i18n83 = require("@wordpress/i18n");
|
|
7876
8055
|
var MAXIMUM_ITEMS = 2;
|
|
7877
8056
|
var useNormalizedInheritanceChainItems = (inheritanceChain, bind, resolve) => {
|
|
7878
|
-
const [items3, setItems] = (0,
|
|
7879
|
-
(0,
|
|
8057
|
+
const [items3, setItems] = (0, import_react49.useState)([]);
|
|
8058
|
+
(0, import_react49.useEffect)(() => {
|
|
7880
8059
|
(async () => {
|
|
7881
8060
|
const normalizedItems = await Promise.all(
|
|
7882
8061
|
inheritanceChain.filter(({ style }) => style).map((item, index) => normalizeInheritanceItem(item, index, bind, resolve))
|
|
7883
8062
|
);
|
|
7884
8063
|
const validItems = normalizedItems.map((item) => ({
|
|
7885
8064
|
...item,
|
|
7886
|
-
displayLabel: import_editor_styles_repository18.ELEMENTS_BASE_STYLES_PROVIDER_KEY !== item.provider ? item.displayLabel : (0,
|
|
8065
|
+
displayLabel: import_editor_styles_repository18.ELEMENTS_BASE_STYLES_PROVIDER_KEY !== item.provider ? item.displayLabel : (0, import_i18n83.__)("Base", "elementor")
|
|
7887
8066
|
})).filter((item) => !item.value || item.displayLabel !== "").slice(0, MAXIMUM_ITEMS);
|
|
7888
8067
|
setItems(validItems);
|
|
7889
8068
|
})();
|
|
@@ -7927,7 +8106,7 @@ var getTransformedValue = async (item, bind, resolve) => {
|
|
|
7927
8106
|
}
|
|
7928
8107
|
});
|
|
7929
8108
|
const value = result?.[bind] ?? result;
|
|
7930
|
-
if ((0,
|
|
8109
|
+
if ((0, import_react49.isValidElement)(value)) {
|
|
7931
8110
|
return value;
|
|
7932
8111
|
}
|
|
7933
8112
|
if (typeof value === "object") {
|
|
@@ -7940,10 +8119,10 @@ var getTransformedValue = async (item, bind, resolve) => {
|
|
|
7940
8119
|
};
|
|
7941
8120
|
|
|
7942
8121
|
// src/styles-inheritance/components/infotip/breakpoint-icon.tsx
|
|
7943
|
-
var
|
|
8122
|
+
var React106 = __toESM(require("react"));
|
|
7944
8123
|
var import_editor_responsive5 = require("@elementor/editor-responsive");
|
|
7945
8124
|
var import_icons35 = require("@elementor/icons");
|
|
7946
|
-
var
|
|
8125
|
+
var import_ui54 = require("@elementor/ui");
|
|
7947
8126
|
var SIZE4 = "tiny";
|
|
7948
8127
|
var DEFAULT_BREAKPOINT3 = "desktop";
|
|
7949
8128
|
var breakpointIconMap = {
|
|
@@ -7963,21 +8142,21 @@ var BreakpointIcon = ({ breakpoint }) => {
|
|
|
7963
8142
|
return null;
|
|
7964
8143
|
}
|
|
7965
8144
|
const breakpointLabel = breakpoints.find((breakpointItem) => breakpointItem.id === currentBreakpoint)?.label;
|
|
7966
|
-
return /* @__PURE__ */
|
|
8145
|
+
return /* @__PURE__ */ React106.createElement(import_ui54.Tooltip, { title: breakpointLabel, placement: "top" }, /* @__PURE__ */ React106.createElement(IconComponent, { fontSize: SIZE4, sx: { mt: "2px" } }));
|
|
7967
8146
|
};
|
|
7968
8147
|
|
|
7969
8148
|
// src/styles-inheritance/components/infotip/label-chip.tsx
|
|
7970
|
-
var
|
|
8149
|
+
var React107 = __toESM(require("react"));
|
|
7971
8150
|
var import_editor_styles_repository19 = require("@elementor/editor-styles-repository");
|
|
7972
8151
|
var import_icons36 = require("@elementor/icons");
|
|
7973
|
-
var
|
|
7974
|
-
var
|
|
8152
|
+
var import_ui55 = require("@elementor/ui");
|
|
8153
|
+
var import_i18n84 = require("@wordpress/i18n");
|
|
7975
8154
|
var SIZE5 = "tiny";
|
|
7976
8155
|
var LabelChip = ({ displayLabel, provider }) => {
|
|
7977
8156
|
const isBaseStyle = provider === import_editor_styles_repository19.ELEMENTS_BASE_STYLES_PROVIDER_KEY;
|
|
7978
|
-
const chipIcon = isBaseStyle ? /* @__PURE__ */
|
|
7979
|
-
return /* @__PURE__ */
|
|
7980
|
-
|
|
8157
|
+
const chipIcon = isBaseStyle ? /* @__PURE__ */ React107.createElement(import_ui55.Tooltip, { title: (0, import_i18n84.__)("Inherited from base styles", "elementor"), placement: "top" }, /* @__PURE__ */ React107.createElement(import_icons36.InfoCircleIcon, { fontSize: SIZE5 })) : void 0;
|
|
8158
|
+
return /* @__PURE__ */ React107.createElement(
|
|
8159
|
+
import_ui55.Chip,
|
|
7981
8160
|
{
|
|
7982
8161
|
label: displayLabel,
|
|
7983
8162
|
size: SIZE5,
|
|
@@ -8002,11 +8181,11 @@ var LabelChip = ({ displayLabel, provider }) => {
|
|
|
8002
8181
|
};
|
|
8003
8182
|
|
|
8004
8183
|
// src/styles-inheritance/components/infotip/value-component.tsx
|
|
8005
|
-
var
|
|
8006
|
-
var
|
|
8184
|
+
var React108 = __toESM(require("react"));
|
|
8185
|
+
var import_ui56 = require("@elementor/ui");
|
|
8007
8186
|
var ValueComponent = ({ index, value }) => {
|
|
8008
|
-
return /* @__PURE__ */
|
|
8009
|
-
|
|
8187
|
+
return /* @__PURE__ */ React108.createElement(import_ui56.Tooltip, { title: value, placement: "top" }, /* @__PURE__ */ React108.createElement(
|
|
8188
|
+
import_ui56.Typography,
|
|
8010
8189
|
{
|
|
8011
8190
|
variant: "caption",
|
|
8012
8191
|
color: "text.tertiary",
|
|
@@ -8027,9 +8206,9 @@ var ValueComponent = ({ index, value }) => {
|
|
|
8027
8206
|
};
|
|
8028
8207
|
|
|
8029
8208
|
// src/styles-inheritance/components/infotip/action-icons.tsx
|
|
8030
|
-
var
|
|
8031
|
-
var
|
|
8032
|
-
var ActionIcons = () => /* @__PURE__ */
|
|
8209
|
+
var React109 = __toESM(require("react"));
|
|
8210
|
+
var import_ui57 = require("@elementor/ui");
|
|
8211
|
+
var ActionIcons = () => /* @__PURE__ */ React109.createElement(import_ui57.Box, { display: "flex", gap: 0.5, alignItems: "center" });
|
|
8033
8212
|
|
|
8034
8213
|
// src/styles-inheritance/components/styles-inheritance-infotip.tsx
|
|
8035
8214
|
var SECTION_PADDING_INLINE = 32;
|
|
@@ -8042,8 +8221,8 @@ var StylesInheritanceInfotip = ({
|
|
|
8042
8221
|
children,
|
|
8043
8222
|
isDisabled
|
|
8044
8223
|
}) => {
|
|
8045
|
-
const [showInfotip, setShowInfotip] = (0,
|
|
8046
|
-
const triggerRef = (0,
|
|
8224
|
+
const [showInfotip, setShowInfotip] = (0, import_react50.useState)(false);
|
|
8225
|
+
const triggerRef = (0, import_react50.useRef)(null);
|
|
8047
8226
|
const toggleInfotip = () => {
|
|
8048
8227
|
if (isDisabled) {
|
|
8049
8228
|
return;
|
|
@@ -8058,15 +8237,15 @@ var StylesInheritanceInfotip = ({
|
|
|
8058
8237
|
};
|
|
8059
8238
|
const key = path.join(".");
|
|
8060
8239
|
const sectionWidth = (0, import_editor_ui13.useSectionWidth)();
|
|
8061
|
-
const resolve = (0,
|
|
8240
|
+
const resolve = (0, import_react50.useMemo)(() => {
|
|
8062
8241
|
return (0, import_editor_canvas5.createPropsResolver)({
|
|
8063
8242
|
transformers: import_editor_canvas5.stylesInheritanceTransformersRegistry,
|
|
8064
8243
|
schema: { [key]: propType }
|
|
8065
8244
|
});
|
|
8066
8245
|
}, [key, propType]);
|
|
8067
8246
|
const items3 = useNormalizedInheritanceChainItems(inheritanceChain, key, resolve);
|
|
8068
|
-
const infotipContent = /* @__PURE__ */
|
|
8069
|
-
|
|
8247
|
+
const infotipContent = /* @__PURE__ */ React110.createElement(import_ui58.ClickAwayListener, { onClickAway: closeInfotip }, /* @__PURE__ */ React110.createElement(
|
|
8248
|
+
import_ui58.Card,
|
|
8070
8249
|
{
|
|
8071
8250
|
elevation: 0,
|
|
8072
8251
|
sx: {
|
|
@@ -8078,8 +8257,8 @@ var StylesInheritanceInfotip = ({
|
|
|
8078
8257
|
flexDirection: "column"
|
|
8079
8258
|
}
|
|
8080
8259
|
},
|
|
8081
|
-
/* @__PURE__ */
|
|
8082
|
-
|
|
8260
|
+
/* @__PURE__ */ React110.createElement(
|
|
8261
|
+
import_ui58.Box,
|
|
8083
8262
|
{
|
|
8084
8263
|
sx: {
|
|
8085
8264
|
position: "sticky",
|
|
@@ -8088,10 +8267,10 @@ var StylesInheritanceInfotip = ({
|
|
|
8088
8267
|
backgroundColor: "background.paper"
|
|
8089
8268
|
}
|
|
8090
8269
|
},
|
|
8091
|
-
/* @__PURE__ */
|
|
8270
|
+
/* @__PURE__ */ React110.createElement(import_editor_ui13.PopoverHeader, { title: (0, import_i18n85.__)("Style origin", "elementor"), onClose: closeInfotip })
|
|
8092
8271
|
),
|
|
8093
|
-
/* @__PURE__ */
|
|
8094
|
-
|
|
8272
|
+
/* @__PURE__ */ React110.createElement(
|
|
8273
|
+
import_ui58.CardContent,
|
|
8095
8274
|
{
|
|
8096
8275
|
sx: {
|
|
8097
8276
|
display: "flex",
|
|
@@ -8104,39 +8283,39 @@ var StylesInheritanceInfotip = ({
|
|
|
8104
8283
|
}
|
|
8105
8284
|
}
|
|
8106
8285
|
},
|
|
8107
|
-
/* @__PURE__ */
|
|
8108
|
-
return /* @__PURE__ */
|
|
8109
|
-
|
|
8286
|
+
/* @__PURE__ */ React110.createElement(import_ui58.Stack, { gap: 1.5, sx: { pl: 2, pr: 1, pt: 1.5, pb: 1.5 }, role: "list" }, items3.map((item, index) => {
|
|
8287
|
+
return /* @__PURE__ */ React110.createElement(
|
|
8288
|
+
import_ui58.Box,
|
|
8110
8289
|
{
|
|
8111
8290
|
key: item.id,
|
|
8112
8291
|
display: "flex",
|
|
8113
8292
|
gap: 0.5,
|
|
8114
8293
|
role: "listitem",
|
|
8115
|
-
"aria-label": (0,
|
|
8294
|
+
"aria-label": (0, import_i18n85.__)("Inheritance item: %s", "elementor").replace(
|
|
8116
8295
|
"%s",
|
|
8117
8296
|
item.displayLabel
|
|
8118
8297
|
)
|
|
8119
8298
|
},
|
|
8120
|
-
/* @__PURE__ */
|
|
8121
|
-
|
|
8299
|
+
/* @__PURE__ */ React110.createElement(
|
|
8300
|
+
import_ui58.Box,
|
|
8122
8301
|
{
|
|
8123
8302
|
display: "flex",
|
|
8124
8303
|
gap: 0.5,
|
|
8125
8304
|
sx: { flexWrap: "wrap", width: "100%", alignItems: "flex-start" }
|
|
8126
8305
|
},
|
|
8127
|
-
/* @__PURE__ */
|
|
8128
|
-
/* @__PURE__ */
|
|
8129
|
-
/* @__PURE__ */
|
|
8306
|
+
/* @__PURE__ */ React110.createElement(BreakpointIcon, { breakpoint: item.breakpoint }),
|
|
8307
|
+
/* @__PURE__ */ React110.createElement(LabelChip, { displayLabel: item.displayLabel, provider: item.provider }),
|
|
8308
|
+
/* @__PURE__ */ React110.createElement(ValueComponent, { index, value: item.value })
|
|
8130
8309
|
),
|
|
8131
|
-
/* @__PURE__ */
|
|
8310
|
+
/* @__PURE__ */ React110.createElement(ActionIcons, null)
|
|
8132
8311
|
);
|
|
8133
8312
|
}))
|
|
8134
8313
|
)
|
|
8135
8314
|
));
|
|
8136
8315
|
if (isDisabled) {
|
|
8137
|
-
return /* @__PURE__ */
|
|
8316
|
+
return /* @__PURE__ */ React110.createElement(import_ui58.Box, { sx: { display: "inline-flex" } }, children);
|
|
8138
8317
|
}
|
|
8139
|
-
return /* @__PURE__ */
|
|
8318
|
+
return /* @__PURE__ */ React110.createElement(import_ui58.Box, { ref: triggerRef, sx: { display: "inline-flex" } }, /* @__PURE__ */ React110.createElement(
|
|
8140
8319
|
TooltipOrInfotip,
|
|
8141
8320
|
{
|
|
8142
8321
|
showInfotip,
|
|
@@ -8144,8 +8323,8 @@ var StylesInheritanceInfotip = ({
|
|
|
8144
8323
|
infotipContent,
|
|
8145
8324
|
isDisabled
|
|
8146
8325
|
},
|
|
8147
|
-
/* @__PURE__ */
|
|
8148
|
-
|
|
8326
|
+
/* @__PURE__ */ React110.createElement(
|
|
8327
|
+
import_ui58.IconButton,
|
|
8149
8328
|
{
|
|
8150
8329
|
onClick: toggleInfotip,
|
|
8151
8330
|
"aria-label": label,
|
|
@@ -8164,11 +8343,11 @@ function TooltipOrInfotip({
|
|
|
8164
8343
|
isDisabled
|
|
8165
8344
|
}) {
|
|
8166
8345
|
if (isDisabled) {
|
|
8167
|
-
return /* @__PURE__ */
|
|
8346
|
+
return /* @__PURE__ */ React110.createElement(import_ui58.Box, { sx: { display: "inline-flex" } }, children);
|
|
8168
8347
|
}
|
|
8169
8348
|
if (showInfotip) {
|
|
8170
|
-
return /* @__PURE__ */
|
|
8171
|
-
|
|
8349
|
+
return /* @__PURE__ */ React110.createElement(React110.Fragment, null, /* @__PURE__ */ React110.createElement(
|
|
8350
|
+
import_ui58.Backdrop,
|
|
8172
8351
|
{
|
|
8173
8352
|
open: showInfotip,
|
|
8174
8353
|
onClick: onClose,
|
|
@@ -8177,8 +8356,8 @@ function TooltipOrInfotip({
|
|
|
8177
8356
|
zIndex: (theme) => theme.zIndex.modal - 1
|
|
8178
8357
|
}
|
|
8179
8358
|
}
|
|
8180
|
-
), /* @__PURE__ */
|
|
8181
|
-
|
|
8359
|
+
), /* @__PURE__ */ React110.createElement(
|
|
8360
|
+
import_ui58.Infotip,
|
|
8182
8361
|
{
|
|
8183
8362
|
placement: "top-end",
|
|
8184
8363
|
content: infotipContent,
|
|
@@ -8189,25 +8368,25 @@ function TooltipOrInfotip({
|
|
|
8189
8368
|
children
|
|
8190
8369
|
));
|
|
8191
8370
|
}
|
|
8192
|
-
return /* @__PURE__ */
|
|
8371
|
+
return /* @__PURE__ */ React110.createElement(import_ui58.Tooltip, { title: (0, import_i18n85.__)("Style origin", "elementor"), placement: "top" }, children);
|
|
8193
8372
|
}
|
|
8194
8373
|
|
|
8195
8374
|
// src/styles-inheritance/components/styles-inheritance-indicator.tsx
|
|
8196
8375
|
var StylesInheritanceIndicator = ({
|
|
8197
8376
|
customContext
|
|
8198
8377
|
}) => {
|
|
8199
|
-
const context = (0,
|
|
8378
|
+
const context = (0, import_editor_controls71.useBoundProp)();
|
|
8200
8379
|
const { path, propType } = customContext || context;
|
|
8201
8380
|
const inheritanceChain = useStylesInheritanceChain(path);
|
|
8202
8381
|
if (!path || !inheritanceChain.length) {
|
|
8203
8382
|
return null;
|
|
8204
8383
|
}
|
|
8205
|
-
return /* @__PURE__ */
|
|
8384
|
+
return /* @__PURE__ */ React111.createElement(Indicator, { inheritanceChain, path, propType });
|
|
8206
8385
|
};
|
|
8207
8386
|
var Indicator = ({ inheritanceChain, path, propType, isDisabled }) => {
|
|
8208
8387
|
const { id: currentStyleId, provider: currentStyleProvider, meta: currentStyleMeta } = useStyle();
|
|
8209
8388
|
const currentItem = currentStyleId ? getValueFromInheritanceChain(inheritanceChain, currentStyleId, currentStyleMeta) : null;
|
|
8210
|
-
const hasValue = !(0,
|
|
8389
|
+
const hasValue = !(0, import_editor_props31.isEmpty)(currentItem?.value);
|
|
8211
8390
|
const [actualStyle] = inheritanceChain;
|
|
8212
8391
|
if (actualStyle.provider === import_editor_styles_repository20.ELEMENTS_BASE_STYLES_PROVIDER_KEY) {
|
|
8213
8392
|
return null;
|
|
@@ -8218,7 +8397,7 @@ var Indicator = ({ inheritanceChain, path, propType, isDisabled }) => {
|
|
|
8218
8397
|
getColor: isFinalValue && currentStyleProvider ? getStylesProviderThemeColor(currentStyleProvider.getKey()) : void 0,
|
|
8219
8398
|
isOverridden: hasValue && !isFinalValue ? true : void 0
|
|
8220
8399
|
};
|
|
8221
|
-
return /* @__PURE__ */
|
|
8400
|
+
return /* @__PURE__ */ React111.createElement(
|
|
8222
8401
|
StylesInheritanceInfotip,
|
|
8223
8402
|
{
|
|
8224
8403
|
inheritanceChain,
|
|
@@ -8227,17 +8406,17 @@ var Indicator = ({ inheritanceChain, path, propType, isDisabled }) => {
|
|
|
8227
8406
|
label,
|
|
8228
8407
|
isDisabled
|
|
8229
8408
|
},
|
|
8230
|
-
/* @__PURE__ */
|
|
8409
|
+
/* @__PURE__ */ React111.createElement(StyleIndicator, { ...styleIndicatorProps })
|
|
8231
8410
|
);
|
|
8232
8411
|
};
|
|
8233
8412
|
var getLabel = ({ isFinalValue, hasValue }) => {
|
|
8234
8413
|
if (isFinalValue) {
|
|
8235
|
-
return (0,
|
|
8414
|
+
return (0, import_i18n86.__)("This is the final value", "elementor");
|
|
8236
8415
|
}
|
|
8237
8416
|
if (hasValue) {
|
|
8238
|
-
return (0,
|
|
8417
|
+
return (0, import_i18n86.__)("This value is overridden by another style", "elementor");
|
|
8239
8418
|
}
|
|
8240
|
-
return (0,
|
|
8419
|
+
return (0, import_i18n86.__)("This has value from another style", "elementor");
|
|
8241
8420
|
};
|
|
8242
8421
|
|
|
8243
8422
|
// src/styles-inheritance/init-styles-inheritance-transformers.ts
|
|
@@ -8258,7 +8437,7 @@ var excludePropTypeTransformers = /* @__PURE__ */ new Set([
|
|
|
8258
8437
|
]);
|
|
8259
8438
|
|
|
8260
8439
|
// src/styles-inheritance/transformers/array-transformer.tsx
|
|
8261
|
-
var
|
|
8440
|
+
var React112 = __toESM(require("react"));
|
|
8262
8441
|
var import_editor_canvas6 = require("@elementor/editor-canvas");
|
|
8263
8442
|
var arrayTransformer = (0, import_editor_canvas6.createTransformer)((values) => {
|
|
8264
8443
|
if (!values || values.length === 0) {
|
|
@@ -8268,18 +8447,18 @@ var arrayTransformer = (0, import_editor_canvas6.createTransformer)((values) =>
|
|
|
8268
8447
|
if (allStrings) {
|
|
8269
8448
|
return values.join(" ");
|
|
8270
8449
|
}
|
|
8271
|
-
return /* @__PURE__ */
|
|
8450
|
+
return /* @__PURE__ */ React112.createElement(React112.Fragment, null, values.map((item, index) => /* @__PURE__ */ React112.createElement(React112.Fragment, { key: index }, index > 0 && " ", item)));
|
|
8272
8451
|
});
|
|
8273
8452
|
|
|
8274
8453
|
// src/styles-inheritance/transformers/background-color-overlay-transformer.tsx
|
|
8275
|
-
var
|
|
8454
|
+
var React113 = __toESM(require("react"));
|
|
8276
8455
|
var import_editor_canvas7 = require("@elementor/editor-canvas");
|
|
8277
|
-
var
|
|
8278
|
-
var backgroundColorOverlayTransformer = (0, import_editor_canvas7.createTransformer)((value) => /* @__PURE__ */
|
|
8456
|
+
var import_ui59 = require("@elementor/ui");
|
|
8457
|
+
var backgroundColorOverlayTransformer = (0, import_editor_canvas7.createTransformer)((value) => /* @__PURE__ */ React113.createElement(import_ui59.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React113.createElement(ItemLabelColor, { value })));
|
|
8279
8458
|
var ItemLabelColor = ({ value: { color } }) => {
|
|
8280
|
-
return /* @__PURE__ */
|
|
8459
|
+
return /* @__PURE__ */ React113.createElement("span", null, color);
|
|
8281
8460
|
};
|
|
8282
|
-
var StyledUnstableColorIndicator = (0,
|
|
8461
|
+
var StyledUnstableColorIndicator = (0, import_ui59.styled)(import_ui59.UnstableColorIndicator)(({ theme }) => ({
|
|
8283
8462
|
width: "1em",
|
|
8284
8463
|
height: "1em",
|
|
8285
8464
|
borderRadius: `${theme.shape.borderRadius / 2}px`,
|
|
@@ -8288,20 +8467,20 @@ var StyledUnstableColorIndicator = (0, import_ui58.styled)(import_ui58.UnstableC
|
|
|
8288
8467
|
}));
|
|
8289
8468
|
|
|
8290
8469
|
// src/styles-inheritance/transformers/background-gradient-overlay-transformer.tsx
|
|
8291
|
-
var
|
|
8470
|
+
var React114 = __toESM(require("react"));
|
|
8292
8471
|
var import_editor_canvas8 = require("@elementor/editor-canvas");
|
|
8293
|
-
var
|
|
8294
|
-
var
|
|
8295
|
-
var backgroundGradientOverlayTransformer = (0, import_editor_canvas8.createTransformer)((value) => /* @__PURE__ */
|
|
8472
|
+
var import_ui60 = require("@elementor/ui");
|
|
8473
|
+
var import_i18n87 = require("@wordpress/i18n");
|
|
8474
|
+
var backgroundGradientOverlayTransformer = (0, import_editor_canvas8.createTransformer)((value) => /* @__PURE__ */ React114.createElement(import_ui60.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React114.createElement(ItemIconGradient, { value }), /* @__PURE__ */ React114.createElement(ItemLabelGradient, { value })));
|
|
8296
8475
|
var ItemIconGradient = ({ value }) => {
|
|
8297
8476
|
const gradient = getGradientValue(value);
|
|
8298
|
-
return /* @__PURE__ */
|
|
8477
|
+
return /* @__PURE__ */ React114.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
8299
8478
|
};
|
|
8300
8479
|
var ItemLabelGradient = ({ value }) => {
|
|
8301
8480
|
if (value.type === "linear") {
|
|
8302
|
-
return /* @__PURE__ */
|
|
8481
|
+
return /* @__PURE__ */ React114.createElement("span", null, (0, import_i18n87.__)("Linear gradient", "elementor"));
|
|
8303
8482
|
}
|
|
8304
|
-
return /* @__PURE__ */
|
|
8483
|
+
return /* @__PURE__ */ React114.createElement("span", null, (0, import_i18n87.__)("Radial gradient", "elementor"));
|
|
8305
8484
|
};
|
|
8306
8485
|
var getGradientValue = (gradient) => {
|
|
8307
8486
|
const stops = gradient.stops?.map(({ color, offset }) => `${color} ${offset ?? 0}%`)?.join(",");
|
|
@@ -8315,16 +8494,16 @@ var getGradientValue = (gradient) => {
|
|
|
8315
8494
|
};
|
|
8316
8495
|
|
|
8317
8496
|
// src/styles-inheritance/transformers/background-image-overlay-transformer.tsx
|
|
8318
|
-
var
|
|
8497
|
+
var React115 = __toESM(require("react"));
|
|
8319
8498
|
var import_editor_canvas9 = require("@elementor/editor-canvas");
|
|
8320
8499
|
var import_editor_ui14 = require("@elementor/editor-ui");
|
|
8321
|
-
var
|
|
8500
|
+
var import_ui61 = require("@elementor/ui");
|
|
8322
8501
|
var import_wp_media = require("@elementor/wp-media");
|
|
8323
|
-
var backgroundImageOverlayTransformer = (0, import_editor_canvas9.createTransformer)((value) => /* @__PURE__ */
|
|
8502
|
+
var backgroundImageOverlayTransformer = (0, import_editor_canvas9.createTransformer)((value) => /* @__PURE__ */ React115.createElement(import_ui61.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React115.createElement(ItemIconImage, { value }), /* @__PURE__ */ React115.createElement(ItemLabelImage, { value })));
|
|
8324
8503
|
var ItemIconImage = ({ value }) => {
|
|
8325
8504
|
const { imageUrl } = useImage(value);
|
|
8326
|
-
return /* @__PURE__ */
|
|
8327
|
-
|
|
8505
|
+
return /* @__PURE__ */ React115.createElement(
|
|
8506
|
+
import_ui61.CardMedia,
|
|
8328
8507
|
{
|
|
8329
8508
|
image: imageUrl,
|
|
8330
8509
|
sx: (theme) => ({
|
|
@@ -8339,7 +8518,7 @@ var ItemIconImage = ({ value }) => {
|
|
|
8339
8518
|
};
|
|
8340
8519
|
var ItemLabelImage = ({ value }) => {
|
|
8341
8520
|
const { imageTitle } = useImage(value);
|
|
8342
|
-
return /* @__PURE__ */
|
|
8521
|
+
return /* @__PURE__ */ React115.createElement(import_editor_ui14.EllipsisWithTooltip, { title: imageTitle }, /* @__PURE__ */ React115.createElement("span", null, imageTitle));
|
|
8343
8522
|
};
|
|
8344
8523
|
var useImage = (image) => {
|
|
8345
8524
|
let imageTitle, imageUrl = null;
|
|
@@ -8364,7 +8543,7 @@ var getFileExtensionFromFilename = (filename) => {
|
|
|
8364
8543
|
};
|
|
8365
8544
|
|
|
8366
8545
|
// src/styles-inheritance/transformers/box-shadow-transformer.tsx
|
|
8367
|
-
var
|
|
8546
|
+
var React116 = __toESM(require("react"));
|
|
8368
8547
|
var import_editor_canvas10 = require("@elementor/editor-canvas");
|
|
8369
8548
|
var boxShadowTransformer = (0, import_editor_canvas10.createTransformer)((value) => {
|
|
8370
8549
|
if (!value) {
|
|
@@ -8374,20 +8553,20 @@ var boxShadowTransformer = (0, import_editor_canvas10.createTransformer)((value)
|
|
|
8374
8553
|
const colorValue = color || "#000000";
|
|
8375
8554
|
const sizes = [hOffset || "0px", vOffset || "0px", blur || "10px", spread || "0px"].join(" ");
|
|
8376
8555
|
const positionValue = position || "outset";
|
|
8377
|
-
return /* @__PURE__ */
|
|
8556
|
+
return /* @__PURE__ */ React116.createElement(React116.Fragment, null, colorValue, " ", positionValue, ", ", sizes);
|
|
8378
8557
|
});
|
|
8379
8558
|
|
|
8380
8559
|
// src/styles-inheritance/transformers/color-transformer.tsx
|
|
8381
|
-
var
|
|
8560
|
+
var React117 = __toESM(require("react"));
|
|
8382
8561
|
var import_editor_canvas11 = require("@elementor/editor-canvas");
|
|
8383
|
-
var
|
|
8562
|
+
var import_ui62 = require("@elementor/ui");
|
|
8384
8563
|
function isValidCSSColor(value) {
|
|
8385
8564
|
if (!value.trim()) {
|
|
8386
8565
|
return false;
|
|
8387
8566
|
}
|
|
8388
8567
|
return CSS.supports("color", value.trim());
|
|
8389
8568
|
}
|
|
8390
|
-
var StyledColorIndicator = (0,
|
|
8569
|
+
var StyledColorIndicator = (0, import_ui62.styled)(import_ui62.UnstableColorIndicator)(({ theme }) => ({
|
|
8391
8570
|
width: "1em",
|
|
8392
8571
|
height: "1em",
|
|
8393
8572
|
borderRadius: `${theme.shape.borderRadius / 2}px`,
|
|
@@ -8398,7 +8577,7 @@ var colorTransformer = (0, import_editor_canvas11.createTransformer)((value) =>
|
|
|
8398
8577
|
if (!isValidCSSColor(value)) {
|
|
8399
8578
|
return value;
|
|
8400
8579
|
}
|
|
8401
|
-
return /* @__PURE__ */
|
|
8580
|
+
return /* @__PURE__ */ React117.createElement(import_ui62.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React117.createElement(StyledColorIndicator, { size: "inherit", component: "span", value }), /* @__PURE__ */ React117.createElement("span", null, value));
|
|
8402
8581
|
});
|
|
8403
8582
|
|
|
8404
8583
|
// src/styles-inheritance/transformers/repeater-to-items-transformer.tsx
|