@elementor/editor-editing-panel 4.5.0-1202 → 4.5.0-1204
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 +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +406 -304
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +296 -196
- 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 +8 -0
- package/src/controls-registry/element-controls/menu-items-control/submenu-toggle-registry.ts +15 -0
- package/src/controls-registry/element-controls/menu-items-control/submenu-toggle.tsx +64 -0
- package/src/controls-registry/element-controls/menu-items-control/use-submenu.ts +28 -0
- package/src/controls-registry/element-controls/registry.ts +2 -0
- package/src/controls-registry/element-controls/submenu-toggle-control/submenu-toggle-control.tsx +12 -0
- package/src/index.ts +5 -0
package/dist/index.js
CHANGED
|
@@ -58,6 +58,7 @@ __export(index_exports, {
|
|
|
58
58
|
StyleTabSection: () => StyleTabSection,
|
|
59
59
|
StyleTabSlot: () => StyleTabSlot,
|
|
60
60
|
StylesProviderCannotUpdatePropsError: () => StylesProviderCannotUpdatePropsError,
|
|
61
|
+
SubmenuToggle: () => SubmenuToggle,
|
|
61
62
|
controlsRegistry: () => controlsRegistry,
|
|
62
63
|
createTopLevelObjectType: () => createTopLevelObjectType,
|
|
63
64
|
doApplyClasses: () => doApplyClasses,
|
|
@@ -85,6 +86,7 @@ __export(index_exports, {
|
|
|
85
86
|
registerElementPanelDefaults: () => registerElementPanelDefaults,
|
|
86
87
|
registerFieldIndicator: () => registerFieldIndicator,
|
|
87
88
|
registerStyleProviderToColors: () => registerStyleProviderToColors,
|
|
89
|
+
registerSubmenuToggle: () => registerSubmenuToggle,
|
|
88
90
|
setLicenseConfig: () => setLicenseConfig,
|
|
89
91
|
useClassesProp: () => useClassesProp,
|
|
90
92
|
useControlsByWidgetType: () => useControlsByWidgetType,
|
|
@@ -6019,7 +6021,7 @@ function getControlsByBind(controls) {
|
|
|
6019
6021
|
|
|
6020
6022
|
// src/init.ts
|
|
6021
6023
|
var import_editor = require("@elementor/editor");
|
|
6022
|
-
var
|
|
6024
|
+
var import_editor_controls73 = require("@elementor/editor-controls");
|
|
6023
6025
|
var import_editor_panels3 = require("@elementor/editor-panels");
|
|
6024
6026
|
var import_editor_v1_adapters15 = require("@elementor/editor-v1-adapters");
|
|
6025
6027
|
|
|
@@ -6805,13 +6807,13 @@ var ListItemLabelControl = ({ elementId, fallbackLabel }) => {
|
|
|
6805
6807
|
};
|
|
6806
6808
|
|
|
6807
6809
|
// src/controls-registry/element-controls/menu-items-control/menu-items-control.tsx
|
|
6808
|
-
var
|
|
6809
|
-
var
|
|
6810
|
-
var
|
|
6811
|
-
var
|
|
6810
|
+
var React99 = __toESM(require("react"));
|
|
6811
|
+
var import_react46 = require("react");
|
|
6812
|
+
var import_editor_controls61 = require("@elementor/editor-controls");
|
|
6813
|
+
var import_editor_elements29 = require("@elementor/editor-elements");
|
|
6812
6814
|
var import_session10 = require("@elementor/session");
|
|
6813
|
-
var
|
|
6814
|
-
var
|
|
6815
|
+
var import_ui51 = require("@elementor/ui");
|
|
6816
|
+
var import_i18n77 = require("@wordpress/i18n");
|
|
6815
6817
|
|
|
6816
6818
|
// src/controls-registry/element-controls/get-element-by-type.ts
|
|
6817
6819
|
var import_editor_elements25 = require("@elementor/editor-elements");
|
|
@@ -6826,6 +6828,17 @@ var getElementByType = (elementId, type) => {
|
|
|
6826
6828
|
return currentElement.children?.findRecursive?.((child) => child.model.get("elType") === type) ?? null;
|
|
6827
6829
|
};
|
|
6828
6830
|
|
|
6831
|
+
// src/controls-registry/element-controls/menu-items-control/submenu-toggle.tsx
|
|
6832
|
+
var React98 = __toESM(require("react"));
|
|
6833
|
+
var import_react45 = require("react");
|
|
6834
|
+
var import_editor_controls60 = require("@elementor/editor-controls");
|
|
6835
|
+
var import_editor_ui11 = require("@elementor/editor-ui");
|
|
6836
|
+
var import_ui50 = require("@elementor/ui");
|
|
6837
|
+
var import_i18n76 = require("@wordpress/i18n");
|
|
6838
|
+
|
|
6839
|
+
// src/controls-registry/element-controls/menu-items-control/use-submenu.ts
|
|
6840
|
+
var import_editor_elements27 = require("@elementor/editor-elements");
|
|
6841
|
+
|
|
6829
6842
|
// src/controls-registry/element-controls/menu-items-control/use-actions.ts
|
|
6830
6843
|
var import_editor_elements26 = require("@elementor/editor-elements");
|
|
6831
6844
|
var import_editor_props24 = require("@elementor/editor-props");
|
|
@@ -6920,14 +6933,88 @@ var useActions2 = () => {
|
|
|
6920
6933
|
return { addItem: addItem2, removeItem: removeItem2, duplicateItem: duplicateItem2, moveItem: moveItem2 };
|
|
6921
6934
|
};
|
|
6922
6935
|
|
|
6936
|
+
// src/controls-registry/element-controls/menu-items-control/use-submenu.ts
|
|
6937
|
+
var getSubmenuPromotion = () => {
|
|
6938
|
+
const entitlement = (0, import_editor_elements27.getWidgetsCache)()?.[MENU_ENTRY_ELEMENT_TYPE]?.meta?.submenu_entitlement;
|
|
6939
|
+
return entitlement?.locked ? entitlement.promotion : null;
|
|
6940
|
+
};
|
|
6941
|
+
var getParentEntryId = (elementId) => {
|
|
6942
|
+
const parent = (0, import_editor_elements27.getContainer)(elementId)?.parent;
|
|
6943
|
+
return parent?.model.get("elType") === MENU_ENTRY_ELEMENT_TYPE ? parent.id : null;
|
|
6944
|
+
};
|
|
6945
|
+
|
|
6946
|
+
// src/controls-registry/element-controls/menu-items-control/submenu-toggle.tsx
|
|
6947
|
+
var SubmenuToggle = ({ entryId }) => {
|
|
6948
|
+
const [isPromotionOpen, setIsPromotionOpen] = (0, import_react45.useState)(false);
|
|
6949
|
+
const anchorRef = (0, import_react45.useRef)(null);
|
|
6950
|
+
const promotion = getSubmenuPromotion();
|
|
6951
|
+
if (!entryId || !promotion) {
|
|
6952
|
+
return null;
|
|
6953
|
+
}
|
|
6954
|
+
return /* @__PURE__ */ React98.createElement(
|
|
6955
|
+
import_ui50.Stack,
|
|
6956
|
+
{
|
|
6957
|
+
direction: "row",
|
|
6958
|
+
alignItems: "center",
|
|
6959
|
+
justifyContent: "space-between",
|
|
6960
|
+
ref: anchorRef,
|
|
6961
|
+
"data-testid": "submenu-toggle-row"
|
|
6962
|
+
},
|
|
6963
|
+
/* @__PURE__ */ React98.createElement(import_ui50.Stack, { direction: "row", alignItems: "center" }, /* @__PURE__ */ React98.createElement(import_editor_controls60.ControlFormLabel, null, (0, import_i18n76.__)("Enable Submenu", "elementor")), /* @__PURE__ */ React98.createElement(
|
|
6964
|
+
import_editor_ui11.PromotionPopover,
|
|
6965
|
+
{
|
|
6966
|
+
open: isPromotionOpen,
|
|
6967
|
+
title: promotion.title,
|
|
6968
|
+
content: promotion.content,
|
|
6969
|
+
ctaUrl: promotion.ctaUrl,
|
|
6970
|
+
ctaText: (0, import_i18n76.__)("Upgrade Now", "elementor"),
|
|
6971
|
+
onClose: () => setIsPromotionOpen(false),
|
|
6972
|
+
anchorRef
|
|
6973
|
+
},
|
|
6974
|
+
/* @__PURE__ */ React98.createElement(
|
|
6975
|
+
import_ui50.Box,
|
|
6976
|
+
{
|
|
6977
|
+
component: "span",
|
|
6978
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
6979
|
+
onClick: () => setIsPromotionOpen((open) => !open),
|
|
6980
|
+
sx: { display: "inline-flex", cursor: "pointer" }
|
|
6981
|
+
},
|
|
6982
|
+
/* @__PURE__ */ React98.createElement(import_editor_ui11.PromotionChip, null)
|
|
6983
|
+
)
|
|
6984
|
+
)),
|
|
6985
|
+
/* @__PURE__ */ React98.createElement(import_ui50.Box, { sx: { marginInlineEnd: -1 }, onMouseDown: (e) => e.stopPropagation() }, /* @__PURE__ */ React98.createElement(
|
|
6986
|
+
import_ui50.Switch,
|
|
6987
|
+
{
|
|
6988
|
+
size: "small",
|
|
6989
|
+
checked: false,
|
|
6990
|
+
onChange: () => setIsPromotionOpen((open) => !open),
|
|
6991
|
+
sx: { cursor: "pointer" },
|
|
6992
|
+
inputProps: {
|
|
6993
|
+
"aria-label": (0, import_i18n76.__)("Enable Submenu", "elementor"),
|
|
6994
|
+
"aria-haspopup": "dialog",
|
|
6995
|
+
"aria-expanded": isPromotionOpen,
|
|
6996
|
+
style: { cursor: "pointer" }
|
|
6997
|
+
}
|
|
6998
|
+
}
|
|
6999
|
+
))
|
|
7000
|
+
);
|
|
7001
|
+
};
|
|
7002
|
+
|
|
7003
|
+
// src/controls-registry/element-controls/menu-items-control/submenu-toggle-registry.ts
|
|
7004
|
+
var submenuToggle = SubmenuToggle;
|
|
7005
|
+
var registerSubmenuToggle = (component) => {
|
|
7006
|
+
submenuToggle = component;
|
|
7007
|
+
};
|
|
7008
|
+
var getSubmenuToggle = () => submenuToggle;
|
|
7009
|
+
|
|
6923
7010
|
// src/controls-registry/element-controls/menu-items-control/use-entry-item.ts
|
|
6924
|
-
var
|
|
7011
|
+
var import_editor_elements28 = require("@elementor/editor-elements");
|
|
6925
7012
|
var import_editor_v1_adapters12 = require("@elementor/editor-v1-adapters");
|
|
6926
7013
|
var useEntryItem = (entryId) => {
|
|
6927
7014
|
return (0, import_editor_v1_adapters12.__privateUseListenTo)(
|
|
6928
7015
|
[(0, import_editor_v1_adapters12.commandEndEvent)("document/elements/set-settings"), (0, import_editor_v1_adapters12.commandEndEvent)("document/elements/settings")],
|
|
6929
7016
|
() => {
|
|
6930
|
-
const item = (0,
|
|
7017
|
+
const item = (0, import_editor_elements28.getContainer)(entryId)?.children?.find(
|
|
6931
7018
|
(child) => child.model.get("elType") === MENU_ITEM_ELEMENT_TYPE
|
|
6932
7019
|
);
|
|
6933
7020
|
return {
|
|
@@ -6939,8 +7026,8 @@ var useEntryItem = (entryId) => {
|
|
|
6939
7026
|
);
|
|
6940
7027
|
};
|
|
6941
7028
|
var getEntrySettings = (itemId) => {
|
|
6942
|
-
const propsSchema = (0,
|
|
6943
|
-
return (0,
|
|
7029
|
+
const propsSchema = (0, import_editor_elements28.getElementType)(MENU_ITEM_ELEMENT_TYPE)?.propsSchema ?? {};
|
|
7030
|
+
return (0, import_editor_elements28.getElementSettings)(itemId, Object.keys(propsSchema));
|
|
6944
7031
|
};
|
|
6945
7032
|
|
|
6946
7033
|
// src/controls-registry/element-controls/menu-items-control/menu-items-control.tsx
|
|
@@ -6948,7 +7035,7 @@ var LINK_BIND = "link";
|
|
|
6948
7035
|
var MenuItemsControl = ({ label }) => {
|
|
6949
7036
|
const { element } = useElement();
|
|
6950
7037
|
const { addItem: addItem2, duplicateItem: duplicateItem2, moveItem: moveItem2, removeItem: removeItem2 } = useActions2();
|
|
6951
|
-
const { [MENU_ENTRY_ELEMENT_TYPE]: entries } = (0,
|
|
7038
|
+
const { [MENU_ENTRY_ELEMENT_TYPE]: entries } = (0, import_editor_elements29.useElementChildren)(element.id, {
|
|
6952
7039
|
[MENU_ITEMS_ELEMENT_TYPE]: MENU_ENTRY_ELEMENT_TYPE
|
|
6953
7040
|
});
|
|
6954
7041
|
const menuItems = getElementByType(element.id, MENU_ITEMS_ELEMENT_TYPE);
|
|
@@ -6982,8 +7069,8 @@ var MenuItemsControl = ({ label }) => {
|
|
|
6982
7069
|
});
|
|
6983
7070
|
}
|
|
6984
7071
|
};
|
|
6985
|
-
return /* @__PURE__ */
|
|
6986
|
-
|
|
7072
|
+
return /* @__PURE__ */ React99.createElement(
|
|
7073
|
+
import_editor_controls61.Repeater,
|
|
6987
7074
|
{
|
|
6988
7075
|
showToggle: false,
|
|
6989
7076
|
values: repeaterValues,
|
|
@@ -6993,7 +7080,7 @@ var MenuItemsControl = ({ label }) => {
|
|
|
6993
7080
|
adornment: () => null,
|
|
6994
7081
|
itemSettings: {
|
|
6995
7082
|
getId: ({ item }) => item.id,
|
|
6996
|
-
initialValues: { id: "", title: (0,
|
|
7083
|
+
initialValues: { id: "", title: (0, import_i18n77.__)("Menu item", "elementor") },
|
|
6997
7084
|
Label: ItemLabel3,
|
|
6998
7085
|
Content: ItemContent3,
|
|
6999
7086
|
Icon: () => null
|
|
@@ -7001,47 +7088,47 @@ var MenuItemsControl = ({ label }) => {
|
|
|
7001
7088
|
}
|
|
7002
7089
|
);
|
|
7003
7090
|
};
|
|
7004
|
-
var ItemLabel3 = ({ value }) => /* @__PURE__ */
|
|
7091
|
+
var ItemLabel3 = ({ value }) => /* @__PURE__ */ React99.createElement(import_ui51.Stack, { sx: { minHeight: 20 }, direction: "row", alignItems: "center", gap: 1.5 }, value.id ? /* @__PURE__ */ React99.createElement(EntryLabel, { elementId: value.id, fallbackTitle: value.title }) : /* @__PURE__ */ React99.createElement("span", null, value?.title));
|
|
7005
7092
|
var EntryLabel = ({ elementId, fallbackTitle }) => {
|
|
7006
|
-
const editorSettings = (0,
|
|
7007
|
-
return /* @__PURE__ */
|
|
7093
|
+
const editorSettings = (0, import_editor_elements29.useElementEditorSettings)(elementId);
|
|
7094
|
+
return /* @__PURE__ */ React99.createElement("span", null, editorSettings?.title ?? fallbackTitle ?? "");
|
|
7008
7095
|
};
|
|
7009
7096
|
var ItemContent3 = ({ value }) => {
|
|
7010
7097
|
if (!value.id) {
|
|
7011
7098
|
return null;
|
|
7012
7099
|
}
|
|
7013
|
-
return /* @__PURE__ */
|
|
7100
|
+
return /* @__PURE__ */ React99.createElement(import_ui51.Stack, { p: 2, gap: 1.5 }, /* @__PURE__ */ React99.createElement(ItemNameControl2, { elementId: value.id }), /* @__PURE__ */ React99.createElement(ItemLinkControl, { entryId: value.id }), /* @__PURE__ */ React99.createElement(SubmenuToggleSlot, { entryId: value.id }));
|
|
7014
7101
|
};
|
|
7015
7102
|
var ItemNameControl2 = ({ elementId }) => {
|
|
7016
|
-
const editorSettings = (0,
|
|
7017
|
-
const inputId = (0,
|
|
7018
|
-
return /* @__PURE__ */
|
|
7019
|
-
|
|
7103
|
+
const editorSettings = (0, import_editor_elements29.useElementEditorSettings)(elementId);
|
|
7104
|
+
const inputId = (0, import_react46.useId)();
|
|
7105
|
+
return /* @__PURE__ */ React99.createElement(import_ui51.Stack, { gap: 1 }, /* @__PURE__ */ React99.createElement(import_editor_controls61.ControlFormLabel, { htmlFor: inputId }, (0, import_i18n77.__)("Item name", "elementor")), /* @__PURE__ */ React99.createElement(
|
|
7106
|
+
import_ui51.TextField,
|
|
7020
7107
|
{
|
|
7021
7108
|
id: inputId,
|
|
7022
7109
|
size: "tiny",
|
|
7023
7110
|
value: editorSettings?.title ?? "",
|
|
7024
7111
|
onChange: ({ target }) => {
|
|
7025
|
-
(0,
|
|
7112
|
+
(0, import_editor_elements29.updateElementEditorSettings)({ elementId, settings: { title: target.value } });
|
|
7026
7113
|
}
|
|
7027
7114
|
}
|
|
7028
7115
|
));
|
|
7029
7116
|
};
|
|
7030
7117
|
var ItemLinkControl = ({ entryId }) => {
|
|
7031
7118
|
const { itemId, settings } = useEntryItem(entryId);
|
|
7032
|
-
const elementType = itemId ? (0,
|
|
7119
|
+
const elementType = itemId ? (0, import_editor_elements29.getElementType)(MENU_ITEM_ELEMENT_TYPE) : null;
|
|
7033
7120
|
const linkControl = elementType ? findControlByBind(elementType.controls, LINK_BIND) : null;
|
|
7034
7121
|
if (!itemId || !elementType || !linkControl) {
|
|
7035
7122
|
return null;
|
|
7036
7123
|
}
|
|
7037
|
-
return /* @__PURE__ */
|
|
7124
|
+
return /* @__PURE__ */ React99.createElement(
|
|
7038
7125
|
ElementProvider,
|
|
7039
7126
|
{
|
|
7040
7127
|
element: { id: itemId, type: MENU_ITEM_ELEMENT_TYPE },
|
|
7041
7128
|
elementType,
|
|
7042
7129
|
settings
|
|
7043
7130
|
},
|
|
7044
|
-
/* @__PURE__ */
|
|
7131
|
+
/* @__PURE__ */ React99.createElement(import_session10.SessionStorageProvider, { prefix: itemId }, /* @__PURE__ */ React99.createElement(SettingsControl, { control: linkControl }))
|
|
7045
7132
|
);
|
|
7046
7133
|
};
|
|
7047
7134
|
var findControlByBind = (items3, bind) => {
|
|
@@ -7058,25 +7145,37 @@ var findControlByBind = (items3, bind) => {
|
|
|
7058
7145
|
}
|
|
7059
7146
|
return null;
|
|
7060
7147
|
};
|
|
7148
|
+
var SubmenuToggleSlot = ({ entryId }) => {
|
|
7149
|
+
const Toggle = getSubmenuToggle();
|
|
7150
|
+
return /* @__PURE__ */ React99.createElement(Toggle, { entryId });
|
|
7151
|
+
};
|
|
7152
|
+
|
|
7153
|
+
// src/controls-registry/element-controls/submenu-toggle-control/submenu-toggle-control.tsx
|
|
7154
|
+
var React100 = __toESM(require("react"));
|
|
7155
|
+
var SubmenuToggleControl = () => {
|
|
7156
|
+
const { element } = useElement();
|
|
7157
|
+
const Toggle = getSubmenuToggle();
|
|
7158
|
+
return /* @__PURE__ */ React100.createElement(Toggle, { entryId: getParentEntryId(element.id) });
|
|
7159
|
+
};
|
|
7061
7160
|
|
|
7062
7161
|
// src/controls-registry/element-controls/tabs-control/tabs-control.tsx
|
|
7063
|
-
var
|
|
7064
|
-
var
|
|
7065
|
-
var
|
|
7162
|
+
var React101 = __toESM(require("react"));
|
|
7163
|
+
var import_editor_controls63 = require("@elementor/editor-controls");
|
|
7164
|
+
var import_editor_elements31 = require("@elementor/editor-elements");
|
|
7066
7165
|
var import_editor_props26 = require("@elementor/editor-props");
|
|
7067
7166
|
var import_icons29 = require("@elementor/icons");
|
|
7068
|
-
var
|
|
7069
|
-
var
|
|
7167
|
+
var import_ui52 = require("@elementor/ui");
|
|
7168
|
+
var import_i18n79 = require("@wordpress/i18n");
|
|
7070
7169
|
|
|
7071
7170
|
// src/controls-registry/element-controls/tabs-control/use-actions.ts
|
|
7072
|
-
var
|
|
7073
|
-
var
|
|
7171
|
+
var import_editor_controls62 = require("@elementor/editor-controls");
|
|
7172
|
+
var import_editor_elements30 = require("@elementor/editor-elements");
|
|
7074
7173
|
var import_editor_props25 = require("@elementor/editor-props");
|
|
7075
|
-
var
|
|
7174
|
+
var import_i18n78 = require("@wordpress/i18n");
|
|
7076
7175
|
var TAB_ELEMENT_TYPE = "e-tab";
|
|
7077
7176
|
var TAB_CONTENT_ELEMENT_TYPE = "e-tab-content";
|
|
7078
7177
|
var useActions3 = () => {
|
|
7079
|
-
const { value, setValue: setDefaultActiveTab } = (0,
|
|
7178
|
+
const { value, setValue: setDefaultActiveTab } = (0, import_editor_controls62.useBoundProp)(import_editor_props25.numberPropTypeUtil);
|
|
7080
7179
|
const defaultActiveTab = value ?? 0;
|
|
7081
7180
|
const duplicateItem2 = ({
|
|
7082
7181
|
items: items3,
|
|
@@ -7088,14 +7187,14 @@ var useActions3 = () => {
|
|
|
7088
7187
|
});
|
|
7089
7188
|
items3.forEach(({ item, index }) => {
|
|
7090
7189
|
const tabId = item.id;
|
|
7091
|
-
const tabContentAreaContainer = (0,
|
|
7190
|
+
const tabContentAreaContainer = (0, import_editor_elements30.getContainer)(tabContentAreaId);
|
|
7092
7191
|
const tabContentId = tabContentAreaContainer?.children?.[index]?.id;
|
|
7093
7192
|
if (!tabContentId) {
|
|
7094
7193
|
throw new Error("Original content ID is required for duplication");
|
|
7095
7194
|
}
|
|
7096
|
-
(0,
|
|
7195
|
+
(0, import_editor_elements30.duplicateElements)({
|
|
7097
7196
|
elementIds: [tabId, tabContentId],
|
|
7098
|
-
title: (0,
|
|
7197
|
+
title: (0, import_i18n78.__)("Duplicate Tab", "elementor"),
|
|
7099
7198
|
onDuplicateElements: () => {
|
|
7100
7199
|
if (newDefault !== defaultActiveTab) {
|
|
7101
7200
|
setDefaultActiveTab(newDefault, {}, { withHistory: false });
|
|
@@ -7116,10 +7215,10 @@ var useActions3 = () => {
|
|
|
7116
7215
|
movedElementId,
|
|
7117
7216
|
movedElementIndex
|
|
7118
7217
|
}) => {
|
|
7119
|
-
const tabContentContainer = (0,
|
|
7218
|
+
const tabContentContainer = (0, import_editor_elements30.getContainer)(tabContentAreaId);
|
|
7120
7219
|
const tabContent = tabContentContainer?.children?.[movedElementIndex];
|
|
7121
|
-
const movedElement = (0,
|
|
7122
|
-
const tabsMenu = (0,
|
|
7220
|
+
const movedElement = (0, import_editor_elements30.getContainer)(movedElementId);
|
|
7221
|
+
const tabsMenu = (0, import_editor_elements30.getContainer)(tabsMenuId);
|
|
7123
7222
|
if (!tabContent) {
|
|
7124
7223
|
throw new Error("Content element is required");
|
|
7125
7224
|
}
|
|
@@ -7131,8 +7230,8 @@ var useActions3 = () => {
|
|
|
7131
7230
|
to: toIndex,
|
|
7132
7231
|
defaultActiveTab
|
|
7133
7232
|
});
|
|
7134
|
-
(0,
|
|
7135
|
-
title: (0,
|
|
7233
|
+
(0, import_editor_elements30.moveElements)({
|
|
7234
|
+
title: (0, import_i18n78.__)("Reorder Tabs", "elementor"),
|
|
7136
7235
|
moves: [
|
|
7137
7236
|
{
|
|
7138
7237
|
element: movedElement,
|
|
@@ -7165,11 +7264,11 @@ var useActions3 = () => {
|
|
|
7165
7264
|
items: items3,
|
|
7166
7265
|
defaultActiveTab
|
|
7167
7266
|
});
|
|
7168
|
-
(0,
|
|
7169
|
-
title: (0,
|
|
7267
|
+
(0, import_editor_elements30.removeElements)({
|
|
7268
|
+
title: (0, import_i18n78.__)("Tabs", "elementor"),
|
|
7170
7269
|
elementIds: items3.flatMap(({ item, index }) => {
|
|
7171
7270
|
const tabId = item.id;
|
|
7172
|
-
const tabContentContainer = (0,
|
|
7271
|
+
const tabContentContainer = (0, import_editor_elements30.getContainer)(tabContentAreaId);
|
|
7173
7272
|
const tabContentId = tabContentContainer?.children?.[index]?.id;
|
|
7174
7273
|
if (!tabContentId) {
|
|
7175
7274
|
throw new Error("Content ID is required");
|
|
@@ -7193,15 +7292,15 @@ var useActions3 = () => {
|
|
|
7193
7292
|
tabsMenuId,
|
|
7194
7293
|
items: items3
|
|
7195
7294
|
}) => {
|
|
7196
|
-
const tabContentArea = (0,
|
|
7197
|
-
const tabsMenu = (0,
|
|
7295
|
+
const tabContentArea = (0, import_editor_elements30.getContainer)(tabContentAreaId);
|
|
7296
|
+
const tabsMenu = (0, import_editor_elements30.getContainer)(tabsMenuId);
|
|
7198
7297
|
if (!tabContentArea || !tabsMenu) {
|
|
7199
7298
|
throw new Error("Tab containers not found");
|
|
7200
7299
|
}
|
|
7201
7300
|
items3.forEach(({ index }) => {
|
|
7202
7301
|
const position = index + 1;
|
|
7203
|
-
(0,
|
|
7204
|
-
title: (0,
|
|
7302
|
+
(0, import_editor_elements30.createElements)({
|
|
7303
|
+
title: (0, import_i18n78.__)("Tabs", "elementor"),
|
|
7205
7304
|
elements: [
|
|
7206
7305
|
{
|
|
7207
7306
|
container: tabContentArea,
|
|
@@ -7270,12 +7369,12 @@ var calculateDefaultOnDuplicate = ({
|
|
|
7270
7369
|
var TAB_MENU_ELEMENT_TYPE = "e-tabs-menu";
|
|
7271
7370
|
var TAB_CONTENT_AREA_ELEMENT_TYPE = "e-tabs-content-area";
|
|
7272
7371
|
var TabsControl = ({ label }) => {
|
|
7273
|
-
return /* @__PURE__ */
|
|
7372
|
+
return /* @__PURE__ */ React101.createElement(SettingsField, { bind: "default-active-tab", propDisplayName: (0, import_i18n79.__)("Tabs", "elementor") }, /* @__PURE__ */ React101.createElement(TabsControlContent, { label }));
|
|
7274
7373
|
};
|
|
7275
7374
|
var TabsControlContent = ({ label }) => {
|
|
7276
7375
|
const { element } = useElement();
|
|
7277
7376
|
const { addItem: addItem2, duplicateItem: duplicateItem2, moveItem: moveItem2, removeItem: removeItem2 } = useActions3();
|
|
7278
|
-
const { [TAB_ELEMENT_TYPE]: tabLinks } = (0,
|
|
7377
|
+
const { [TAB_ELEMENT_TYPE]: tabLinks } = (0, import_editor_elements31.useElementChildren)(element.id, {
|
|
7279
7378
|
[TAB_MENU_ELEMENT_TYPE]: TAB_ELEMENT_TYPE
|
|
7280
7379
|
});
|
|
7281
7380
|
const tabList = getElementByType(element.id, TAB_MENU_ELEMENT_TYPE);
|
|
@@ -7314,8 +7413,8 @@ var TabsControlContent = ({ label }) => {
|
|
|
7314
7413
|
});
|
|
7315
7414
|
}
|
|
7316
7415
|
};
|
|
7317
|
-
return /* @__PURE__ */
|
|
7318
|
-
|
|
7416
|
+
return /* @__PURE__ */ React101.createElement(
|
|
7417
|
+
import_editor_controls63.Repeater,
|
|
7319
7418
|
{
|
|
7320
7419
|
showToggle: false,
|
|
7321
7420
|
values: repeaterValues,
|
|
@@ -7333,32 +7432,32 @@ var TabsControlContent = ({ label }) => {
|
|
|
7333
7432
|
);
|
|
7334
7433
|
};
|
|
7335
7434
|
var ItemLabel4 = ({ value, index }) => {
|
|
7336
|
-
return /* @__PURE__ */
|
|
7435
|
+
return /* @__PURE__ */ React101.createElement(import_ui52.Stack, { sx: { minHeight: 20 }, direction: "row", alignItems: "center", gap: 1.5 }, value.id ? /* @__PURE__ */ React101.createElement(TabRepeaterLabel, { elementId: value.id, fallbackTitle: value.title }) : /* @__PURE__ */ React101.createElement("span", null, value?.title), /* @__PURE__ */ React101.createElement(ItemDefaultTab, { index }));
|
|
7337
7436
|
};
|
|
7338
7437
|
var TabRepeaterLabel = ({ elementId, fallbackTitle }) => {
|
|
7339
|
-
const editorSettings = (0,
|
|
7438
|
+
const editorSettings = (0, import_editor_elements31.useElementEditorSettings)(elementId);
|
|
7340
7439
|
const label = editorSettings?.title ?? fallbackTitle ?? "";
|
|
7341
|
-
return /* @__PURE__ */
|
|
7440
|
+
return /* @__PURE__ */ React101.createElement("span", null, label);
|
|
7342
7441
|
};
|
|
7343
7442
|
var ItemDefaultTab = ({ index }) => {
|
|
7344
|
-
const { value: defaultItem } = (0,
|
|
7443
|
+
const { value: defaultItem } = (0, import_editor_controls63.useBoundProp)(import_editor_props26.numberPropTypeUtil);
|
|
7345
7444
|
const isDefault = defaultItem === index;
|
|
7346
7445
|
if (!isDefault) {
|
|
7347
7446
|
return null;
|
|
7348
7447
|
}
|
|
7349
|
-
return /* @__PURE__ */
|
|
7448
|
+
return /* @__PURE__ */ React101.createElement(import_ui52.Chip, { size: "tiny", shape: "rounded", label: (0, import_i18n79.__)("Default", "elementor") });
|
|
7350
7449
|
};
|
|
7351
7450
|
var ItemContent4 = ({ value, index }) => {
|
|
7352
7451
|
if (!value.id) {
|
|
7353
7452
|
return null;
|
|
7354
7453
|
}
|
|
7355
|
-
return /* @__PURE__ */
|
|
7454
|
+
return /* @__PURE__ */ React101.createElement(import_ui52.Stack, { p: 2, gap: 1.5 }, /* @__PURE__ */ React101.createElement(TabLabelControl, { elementId: value.id }), /* @__PURE__ */ React101.createElement(SettingsField, { bind: "default-active-tab", propDisplayName: (0, import_i18n79.__)("Tabs", "elementor") }, /* @__PURE__ */ React101.createElement(DefaultTabControl, { tabIndex: index })));
|
|
7356
7455
|
};
|
|
7357
7456
|
var DefaultTabControl = ({ tabIndex }) => {
|
|
7358
|
-
const { value, setValue } = (0,
|
|
7457
|
+
const { value, setValue } = (0, import_editor_controls63.useBoundProp)(import_editor_props26.numberPropTypeUtil);
|
|
7359
7458
|
const isDefault = value === tabIndex;
|
|
7360
|
-
return /* @__PURE__ */
|
|
7361
|
-
|
|
7459
|
+
return /* @__PURE__ */ React101.createElement(import_ui52.Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 2 }, /* @__PURE__ */ React101.createElement(import_editor_controls63.ControlFormLabel, null, (0, import_i18n79.__)("Set as default tab", "elementor")), /* @__PURE__ */ React101.createElement(ConditionalTooltip, { showTooltip: isDefault, placement: "right" }, /* @__PURE__ */ React101.createElement(
|
|
7460
|
+
import_ui52.Switch,
|
|
7362
7461
|
{
|
|
7363
7462
|
size: "small",
|
|
7364
7463
|
checked: isDefault,
|
|
@@ -7373,15 +7472,15 @@ var DefaultTabControl = ({ tabIndex }) => {
|
|
|
7373
7472
|
)));
|
|
7374
7473
|
};
|
|
7375
7474
|
var TabLabelControl = ({ elementId }) => {
|
|
7376
|
-
const editorSettings = (0,
|
|
7475
|
+
const editorSettings = (0, import_editor_elements31.useElementEditorSettings)(elementId);
|
|
7377
7476
|
const label = editorSettings?.title ?? "";
|
|
7378
|
-
return /* @__PURE__ */
|
|
7379
|
-
|
|
7477
|
+
return /* @__PURE__ */ React101.createElement(import_ui52.Stack, { gap: 1 }, /* @__PURE__ */ React101.createElement(import_editor_controls63.ControlFormLabel, null, (0, import_i18n79.__)("Tab name", "elementor")), /* @__PURE__ */ React101.createElement(
|
|
7478
|
+
import_ui52.TextField,
|
|
7380
7479
|
{
|
|
7381
7480
|
size: "tiny",
|
|
7382
7481
|
value: label,
|
|
7383
7482
|
onChange: ({ target }) => {
|
|
7384
|
-
(0,
|
|
7483
|
+
(0, import_editor_elements31.updateElementEditorSettings)({
|
|
7385
7484
|
elementId,
|
|
7386
7485
|
settings: { title: target.value }
|
|
7387
7486
|
});
|
|
@@ -7396,22 +7495,22 @@ var ConditionalTooltip = ({
|
|
|
7396
7495
|
if (!showTooltip) {
|
|
7397
7496
|
return children;
|
|
7398
7497
|
}
|
|
7399
|
-
return /* @__PURE__ */
|
|
7400
|
-
|
|
7498
|
+
return /* @__PURE__ */ React101.createElement(
|
|
7499
|
+
import_ui52.Infotip,
|
|
7401
7500
|
{
|
|
7402
7501
|
arrow: false,
|
|
7403
|
-
content: /* @__PURE__ */
|
|
7404
|
-
|
|
7502
|
+
content: /* @__PURE__ */ React101.createElement(
|
|
7503
|
+
import_ui52.Alert,
|
|
7405
7504
|
{
|
|
7406
7505
|
color: "secondary",
|
|
7407
|
-
icon: /* @__PURE__ */
|
|
7506
|
+
icon: /* @__PURE__ */ React101.createElement(import_icons29.InfoCircleFilledIcon, { fontSize: "tiny" }),
|
|
7408
7507
|
size: "small",
|
|
7409
7508
|
sx: { width: 288 }
|
|
7410
7509
|
},
|
|
7411
|
-
/* @__PURE__ */
|
|
7510
|
+
/* @__PURE__ */ React101.createElement(import_ui52.Typography, { variant: "body2" }, (0, import_i18n79.__)("To change the default tab, simply set another tab as default.", "elementor"))
|
|
7412
7511
|
)
|
|
7413
7512
|
},
|
|
7414
|
-
/* @__PURE__ */
|
|
7513
|
+
/* @__PURE__ */ React101.createElement("span", null, children)
|
|
7415
7514
|
);
|
|
7416
7515
|
};
|
|
7417
7516
|
|
|
@@ -7419,6 +7518,7 @@ var ConditionalTooltip = ({
|
|
|
7419
7518
|
var controlTypes2 = {
|
|
7420
7519
|
"list-items": { component: ListItemsControl, layout: "full" },
|
|
7421
7520
|
"menu-items": { component: MenuItemsControl, layout: "full" },
|
|
7521
|
+
"submenu-toggle": { component: SubmenuToggleControl, layout: "full" },
|
|
7422
7522
|
tabs: { component: TabsControl, layout: "full" },
|
|
7423
7523
|
"accordion-items": { component: AccordionItemsControl, layout: "full" }
|
|
7424
7524
|
};
|
|
@@ -7432,27 +7532,27 @@ var registerElementControls = () => {
|
|
|
7432
7532
|
|
|
7433
7533
|
// src/dynamics/init.ts
|
|
7434
7534
|
var import_editor_canvas3 = require("@elementor/editor-canvas");
|
|
7435
|
-
var
|
|
7535
|
+
var import_editor_controls70 = require("@elementor/editor-controls");
|
|
7436
7536
|
var import_menus2 = require("@elementor/menus");
|
|
7437
7537
|
|
|
7438
7538
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
7439
|
-
var
|
|
7440
|
-
var
|
|
7539
|
+
var React102 = __toESM(require("react"));
|
|
7540
|
+
var import_editor_controls65 = require("@elementor/editor-controls");
|
|
7441
7541
|
var import_editor_props28 = require("@elementor/editor-props");
|
|
7442
7542
|
var import_icons30 = require("@elementor/icons");
|
|
7443
7543
|
|
|
7444
7544
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
7445
|
-
var
|
|
7545
|
+
var import_react49 = require("react");
|
|
7446
7546
|
|
|
7447
7547
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
7448
|
-
var
|
|
7449
|
-
var
|
|
7548
|
+
var import_react48 = require("react");
|
|
7549
|
+
var import_editor_controls64 = require("@elementor/editor-controls");
|
|
7450
7550
|
|
|
7451
7551
|
// src/dynamics/sync/get-atomic-dynamic-tags.ts
|
|
7452
7552
|
var import_editor_v1_adapters13 = require("@elementor/editor-v1-adapters");
|
|
7453
7553
|
|
|
7454
7554
|
// src/hooks/use-license-config.ts
|
|
7455
|
-
var
|
|
7555
|
+
var import_react47 = require("react");
|
|
7456
7556
|
var config = { expired: false };
|
|
7457
7557
|
var listeners = /* @__PURE__ */ new Set();
|
|
7458
7558
|
function setLicenseConfig(newConfig) {
|
|
@@ -7467,7 +7567,7 @@ function subscribe(listener) {
|
|
|
7467
7567
|
return () => listeners.delete(listener);
|
|
7468
7568
|
}
|
|
7469
7569
|
function useLicenseConfig() {
|
|
7470
|
-
return (0,
|
|
7570
|
+
return (0, import_react47.useSyncExternalStore)(subscribe, getLicenseConfig, getLicenseConfig);
|
|
7471
7571
|
}
|
|
7472
7572
|
|
|
7473
7573
|
// src/dynamics/sync/get-atomic-dynamic-tags.ts
|
|
@@ -7530,13 +7630,13 @@ var useAllPropDynamicTags = () => {
|
|
|
7530
7630
|
};
|
|
7531
7631
|
var usePropDynamicTagsInternal = (filterByLicense2) => {
|
|
7532
7632
|
let categories = [];
|
|
7533
|
-
const { propType } = (0,
|
|
7633
|
+
const { propType } = (0, import_editor_controls64.useBoundProp)();
|
|
7534
7634
|
if (propType) {
|
|
7535
7635
|
const propDynamicType = getDynamicPropType(propType);
|
|
7536
7636
|
categories = propDynamicType?.settings.categories || [];
|
|
7537
7637
|
}
|
|
7538
7638
|
const categoriesKey = categories.join();
|
|
7539
|
-
return (0,
|
|
7639
|
+
return (0, import_react48.useMemo)(
|
|
7540
7640
|
() => getDynamicTagsByCategories(categories, filterByLicense2),
|
|
7541
7641
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7542
7642
|
[categoriesKey, filterByLicense2]
|
|
@@ -7570,33 +7670,33 @@ var getDynamicTagsByCategories = (categories, filterByLicense2) => {
|
|
|
7570
7670
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
7571
7671
|
var useDynamicTag = (tagName) => {
|
|
7572
7672
|
const dynamicTags = useAllPropDynamicTags();
|
|
7573
|
-
return (0,
|
|
7673
|
+
return (0, import_react49.useMemo)(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
7574
7674
|
};
|
|
7575
7675
|
|
|
7576
7676
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
7577
|
-
var BackgroundControlDynamicTagIcon = () => /* @__PURE__ */
|
|
7677
|
+
var BackgroundControlDynamicTagIcon = () => /* @__PURE__ */ React102.createElement(import_icons30.DatabaseIcon, { fontSize: "tiny" });
|
|
7578
7678
|
var BackgroundControlDynamicTagLabel = ({ value }) => {
|
|
7579
|
-
const context = (0,
|
|
7580
|
-
return /* @__PURE__ */
|
|
7679
|
+
const context = (0, import_editor_controls65.useBoundProp)(import_editor_props28.backgroundImageOverlayPropTypeUtil);
|
|
7680
|
+
return /* @__PURE__ */ React102.createElement(import_editor_controls65.PropProvider, { ...context, value: value.value }, /* @__PURE__ */ React102.createElement(import_editor_controls65.PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React102.createElement(Wrapper2, { rawValue: value.value })));
|
|
7581
7681
|
};
|
|
7582
7682
|
var Wrapper2 = ({ rawValue }) => {
|
|
7583
|
-
const { propType } = (0,
|
|
7683
|
+
const { propType } = (0, import_editor_controls65.useBoundProp)();
|
|
7584
7684
|
const imageOverlayPropType = propType.prop_types["background-image-overlay"];
|
|
7585
|
-
return /* @__PURE__ */
|
|
7685
|
+
return /* @__PURE__ */ React102.createElement(import_editor_controls65.PropProvider, { propType: imageOverlayPropType.shape.image, value: rawValue, setValue: () => void 0 }, /* @__PURE__ */ React102.createElement(import_editor_controls65.PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React102.createElement(Content, { rawValue: rawValue.image })));
|
|
7586
7686
|
};
|
|
7587
7687
|
var Content = ({ rawValue }) => {
|
|
7588
7688
|
const src = rawValue.value.src;
|
|
7589
7689
|
const dynamicTag = useDynamicTag(src.value.name || "");
|
|
7590
|
-
return /* @__PURE__ */
|
|
7690
|
+
return /* @__PURE__ */ React102.createElement(React102.Fragment, null, dynamicTag?.label);
|
|
7591
7691
|
};
|
|
7592
7692
|
|
|
7593
7693
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
7594
|
-
var
|
|
7595
|
-
var
|
|
7596
|
-
var
|
|
7694
|
+
var React106 = __toESM(require("react"));
|
|
7695
|
+
var import_editor_controls68 = require("@elementor/editor-controls");
|
|
7696
|
+
var import_editor_ui13 = require("@elementor/editor-ui");
|
|
7597
7697
|
var import_icons32 = require("@elementor/icons");
|
|
7598
|
-
var
|
|
7599
|
-
var
|
|
7698
|
+
var import_ui54 = require("@elementor/ui");
|
|
7699
|
+
var import_i18n81 = require("@wordpress/i18n");
|
|
7600
7700
|
|
|
7601
7701
|
// src/hooks/use-persist-dynamic-value.ts
|
|
7602
7702
|
var import_session11 = require("@elementor/session");
|
|
@@ -7607,12 +7707,12 @@ var usePersistDynamicValue = (propKey) => {
|
|
|
7607
7707
|
};
|
|
7608
7708
|
|
|
7609
7709
|
// src/dynamics/dynamic-control.tsx
|
|
7610
|
-
var
|
|
7611
|
-
var
|
|
7710
|
+
var React104 = __toESM(require("react"));
|
|
7711
|
+
var import_editor_controls66 = require("@elementor/editor-controls");
|
|
7612
7712
|
|
|
7613
7713
|
// src/dynamics/components/dynamic-conditional-control.tsx
|
|
7614
|
-
var
|
|
7615
|
-
var
|
|
7714
|
+
var React103 = __toESM(require("react"));
|
|
7715
|
+
var import_react50 = require("react");
|
|
7616
7716
|
var import_editor_props29 = require("@elementor/editor-props");
|
|
7617
7717
|
var DynamicConditionalControl = ({
|
|
7618
7718
|
children,
|
|
@@ -7620,7 +7720,7 @@ var DynamicConditionalControl = ({
|
|
|
7620
7720
|
propsSchema,
|
|
7621
7721
|
dynamicSettings
|
|
7622
7722
|
}) => {
|
|
7623
|
-
const defaults = (0,
|
|
7723
|
+
const defaults = (0, import_react50.useMemo)(() => {
|
|
7624
7724
|
if (!propsSchema) {
|
|
7625
7725
|
return {};
|
|
7626
7726
|
}
|
|
@@ -7630,7 +7730,7 @@ var DynamicConditionalControl = ({
|
|
|
7630
7730
|
return result;
|
|
7631
7731
|
}, {});
|
|
7632
7732
|
}, [propsSchema]);
|
|
7633
|
-
const convertedSettings = (0,
|
|
7733
|
+
const convertedSettings = (0, import_react50.useMemo)(() => {
|
|
7634
7734
|
if (!dynamicSettings) {
|
|
7635
7735
|
return {};
|
|
7636
7736
|
}
|
|
@@ -7649,19 +7749,19 @@ var DynamicConditionalControl = ({
|
|
|
7649
7749
|
{}
|
|
7650
7750
|
);
|
|
7651
7751
|
}, [dynamicSettings]);
|
|
7652
|
-
const effectiveSettings = (0,
|
|
7752
|
+
const effectiveSettings = (0, import_react50.useMemo)(() => {
|
|
7653
7753
|
return { ...defaults, ...convertedSettings };
|
|
7654
7754
|
}, [defaults, convertedSettings]);
|
|
7655
7755
|
if (!propType?.dependencies?.terms.length) {
|
|
7656
|
-
return /* @__PURE__ */
|
|
7756
|
+
return /* @__PURE__ */ React103.createElement(React103.Fragment, null, children);
|
|
7657
7757
|
}
|
|
7658
7758
|
const isHidden = !(0, import_editor_props29.isDependencyMet)(propType?.dependencies, effectiveSettings).isMet;
|
|
7659
|
-
return isHidden ? null : /* @__PURE__ */
|
|
7759
|
+
return isHidden ? null : /* @__PURE__ */ React103.createElement(React103.Fragment, null, children);
|
|
7660
7760
|
};
|
|
7661
7761
|
|
|
7662
7762
|
// src/dynamics/dynamic-control.tsx
|
|
7663
7763
|
var DynamicControl = ({ bind, children }) => {
|
|
7664
|
-
const { value, setValue } = (0,
|
|
7764
|
+
const { value, setValue } = (0, import_editor_controls66.useBoundProp)(dynamicPropTypeUtil);
|
|
7665
7765
|
const { name = "", group = "", settings } = value ?? {};
|
|
7666
7766
|
const dynamicTag = useDynamicTag(name);
|
|
7667
7767
|
if (!dynamicTag) {
|
|
@@ -7681,7 +7781,7 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
7681
7781
|
});
|
|
7682
7782
|
};
|
|
7683
7783
|
const propType = createTopLevelObjectType({ schema: dynamicTag.props_schema });
|
|
7684
|
-
return /* @__PURE__ */
|
|
7784
|
+
return /* @__PURE__ */ React104.createElement(import_editor_controls66.PropProvider, { propType, setValue: setDynamicValue, value: { [bind]: dynamicValue } }, /* @__PURE__ */ React104.createElement(import_editor_controls66.PropKeyProvider, { bind }, /* @__PURE__ */ React104.createElement(
|
|
7685
7785
|
DynamicConditionalControl,
|
|
7686
7786
|
{
|
|
7687
7787
|
propType: dynamicPropType,
|
|
@@ -7693,32 +7793,32 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
7693
7793
|
};
|
|
7694
7794
|
|
|
7695
7795
|
// src/dynamics/components/dynamic-selection.tsx
|
|
7696
|
-
var
|
|
7697
|
-
var
|
|
7698
|
-
var
|
|
7699
|
-
var
|
|
7796
|
+
var React105 = __toESM(require("react"));
|
|
7797
|
+
var import_react51 = require("react");
|
|
7798
|
+
var import_editor_controls67 = require("@elementor/editor-controls");
|
|
7799
|
+
var import_editor_ui12 = require("@elementor/editor-ui");
|
|
7700
7800
|
var import_icons31 = require("@elementor/icons");
|
|
7701
|
-
var
|
|
7702
|
-
var
|
|
7801
|
+
var import_ui53 = require("@elementor/ui");
|
|
7802
|
+
var import_i18n80 = require("@wordpress/i18n");
|
|
7703
7803
|
var SIZE2 = "tiny";
|
|
7704
7804
|
var PROMO_TEXT_WIDTH = 170;
|
|
7705
7805
|
var PRO_DYNAMIC_TAGS_URL = "https://go.elementor.com/go-pro-dynamic-tags-modal/";
|
|
7706
7806
|
var RENEW_DYNAMIC_TAGS_URL = "https://go.elementor.com/go-pro-dynamic-tags-renew-modal/";
|
|
7707
7807
|
var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
7708
|
-
const [searchValue, setSearchValue] = (0,
|
|
7808
|
+
const [searchValue, setSearchValue] = (0, import_react51.useState)("");
|
|
7709
7809
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
7710
|
-
const theme = (0,
|
|
7711
|
-
const { value: anyValue } = (0,
|
|
7712
|
-
const { bind, value: dynamicValue, setValue } = (0,
|
|
7810
|
+
const theme = (0, import_ui53.useTheme)();
|
|
7811
|
+
const { value: anyValue } = (0, import_editor_controls67.useBoundProp)();
|
|
7812
|
+
const { bind, value: dynamicValue, setValue } = (0, import_editor_controls67.useBoundProp)(dynamicPropTypeUtil);
|
|
7713
7813
|
const [, updatePropValueHistory] = usePersistDynamicValue(bind);
|
|
7714
7814
|
const isCurrentValueDynamic = !!dynamicValue;
|
|
7715
7815
|
const options13 = useFilteredOptions(searchValue);
|
|
7716
7816
|
const hasNoDynamicTags = !options13.length && !searchValue.trim();
|
|
7717
|
-
(0,
|
|
7817
|
+
(0, import_react51.useEffect)(() => {
|
|
7718
7818
|
if (hasNoDynamicTags) {
|
|
7719
|
-
(0,
|
|
7819
|
+
(0, import_editor_controls67.trackViewPromotion)({ target_name: "dynamic_tags" });
|
|
7720
7820
|
} else if (expired) {
|
|
7721
|
-
(0,
|
|
7821
|
+
(0, import_editor_controls67.trackViewPromotion)({ target_name: "dynamic_tags" });
|
|
7722
7822
|
}
|
|
7723
7823
|
}, [hasNoDynamicTags, expired]);
|
|
7724
7824
|
const handleSearch = (value) => {
|
|
@@ -7746,41 +7846,41 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
|
7746
7846
|
]);
|
|
7747
7847
|
const getPopOverContent = () => {
|
|
7748
7848
|
if (hasNoDynamicTags) {
|
|
7749
|
-
return /* @__PURE__ */
|
|
7849
|
+
return /* @__PURE__ */ React105.createElement(NoDynamicTags, null);
|
|
7750
7850
|
}
|
|
7751
7851
|
if (expired) {
|
|
7752
|
-
return /* @__PURE__ */
|
|
7852
|
+
return /* @__PURE__ */ React105.createElement(ExpiredDynamicTags, null);
|
|
7753
7853
|
}
|
|
7754
|
-
return /* @__PURE__ */
|
|
7755
|
-
|
|
7854
|
+
return /* @__PURE__ */ React105.createElement(import_react51.Fragment, null, /* @__PURE__ */ React105.createElement(
|
|
7855
|
+
import_editor_ui12.SearchField,
|
|
7756
7856
|
{
|
|
7757
7857
|
value: searchValue,
|
|
7758
7858
|
onSearch: handleSearch,
|
|
7759
|
-
placeholder: (0,
|
|
7859
|
+
placeholder: (0, import_i18n80.__)("Search dynamic tags\u2026", "elementor")
|
|
7760
7860
|
}
|
|
7761
|
-
), /* @__PURE__ */
|
|
7762
|
-
|
|
7861
|
+
), /* @__PURE__ */ React105.createElement(import_ui53.Divider, null), /* @__PURE__ */ React105.createElement(
|
|
7862
|
+
import_editor_ui12.PopoverMenuList,
|
|
7763
7863
|
{
|
|
7764
7864
|
items: virtualizedItems,
|
|
7765
7865
|
onSelect: handleSetDynamicTag,
|
|
7766
7866
|
onClose: closePopover,
|
|
7767
7867
|
selectedValue: dynamicValue?.name,
|
|
7768
7868
|
itemStyle: (item) => item.type === "item" ? { paddingInlineStart: theme.spacing(3.5) } : {},
|
|
7769
|
-
noResultsComponent: /* @__PURE__ */
|
|
7869
|
+
noResultsComponent: /* @__PURE__ */ React105.createElement(NoResults, { searchValue, onClear: () => setSearchValue("") })
|
|
7770
7870
|
}
|
|
7771
7871
|
));
|
|
7772
7872
|
};
|
|
7773
|
-
return /* @__PURE__ */
|
|
7774
|
-
|
|
7873
|
+
return /* @__PURE__ */ React105.createElement(import_editor_ui12.SectionPopoverBody, { "aria-label": (0, import_i18n80.__)("Dynamic tags", "elementor") }, /* @__PURE__ */ React105.createElement(
|
|
7874
|
+
import_editor_ui12.PopoverHeader,
|
|
7775
7875
|
{
|
|
7776
|
-
title: (0,
|
|
7876
|
+
title: (0, import_i18n80.__)("Dynamic tags", "elementor"),
|
|
7777
7877
|
onClose: closePopover,
|
|
7778
|
-
icon: /* @__PURE__ */
|
|
7878
|
+
icon: /* @__PURE__ */ React105.createElement(import_icons31.DatabaseIcon, { fontSize: SIZE2 })
|
|
7779
7879
|
}
|
|
7780
7880
|
), getPopOverContent());
|
|
7781
7881
|
};
|
|
7782
|
-
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */
|
|
7783
|
-
|
|
7882
|
+
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React105.createElement(
|
|
7883
|
+
import_ui53.Stack,
|
|
7784
7884
|
{
|
|
7785
7885
|
gap: 1,
|
|
7786
7886
|
alignItems: "center",
|
|
@@ -7790,12 +7890,12 @@ var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React103.createEle
|
|
|
7790
7890
|
color: "text.secondary",
|
|
7791
7891
|
sx: { pb: 3.5 }
|
|
7792
7892
|
},
|
|
7793
|
-
/* @__PURE__ */
|
|
7794
|
-
/* @__PURE__ */
|
|
7795
|
-
/* @__PURE__ */
|
|
7893
|
+
/* @__PURE__ */ React105.createElement(import_icons31.DatabaseIcon, { fontSize: "large" }),
|
|
7894
|
+
/* @__PURE__ */ React105.createElement(import_ui53.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n80.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React105.createElement("br", null), "\u201C", searchValue, "\u201D."),
|
|
7895
|
+
/* @__PURE__ */ React105.createElement(import_ui53.Typography, { align: "center", variant: "caption", sx: { display: "flex", flexDirection: "column" } }, (0, import_i18n80.__)("Try something else.", "elementor"), /* @__PURE__ */ React105.createElement(import_ui53.Link, { color: "text.secondary", variant: "caption", component: "button", onClick: onClear }, (0, import_i18n80.__)("Clear & try again", "elementor")))
|
|
7796
7896
|
);
|
|
7797
|
-
var NoDynamicTags = () => /* @__PURE__ */
|
|
7798
|
-
|
|
7897
|
+
var NoDynamicTags = () => /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(import_ui53.Divider, null), /* @__PURE__ */ React105.createElement(
|
|
7898
|
+
import_ui53.Stack,
|
|
7799
7899
|
{
|
|
7800
7900
|
gap: 1,
|
|
7801
7901
|
alignItems: "center",
|
|
@@ -7805,20 +7905,20 @@ var NoDynamicTags = () => /* @__PURE__ */ React103.createElement(React103.Fragme
|
|
|
7805
7905
|
color: "text.secondary",
|
|
7806
7906
|
sx: { pb: 3.5 }
|
|
7807
7907
|
},
|
|
7808
|
-
/* @__PURE__ */
|
|
7809
|
-
/* @__PURE__ */
|
|
7810
|
-
/* @__PURE__ */
|
|
7811
|
-
/* @__PURE__ */
|
|
7812
|
-
|
|
7908
|
+
/* @__PURE__ */ React105.createElement(import_icons31.DatabaseIcon, { fontSize: "large" }),
|
|
7909
|
+
/* @__PURE__ */ React105.createElement(import_ui53.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n80.__)("Streamline your workflow with dynamic tags", "elementor")),
|
|
7910
|
+
/* @__PURE__ */ React105.createElement(import_ui53.Typography, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, (0, import_i18n80.__)("Upgrade now to display your content dynamically.", "elementor")),
|
|
7911
|
+
/* @__PURE__ */ React105.createElement(
|
|
7912
|
+
import_editor_ui12.CtaButton,
|
|
7813
7913
|
{
|
|
7814
7914
|
size: "small",
|
|
7815
7915
|
href: PRO_DYNAMIC_TAGS_URL,
|
|
7816
|
-
onClick: () => (0,
|
|
7916
|
+
onClick: () => (0, import_editor_controls67.trackUpgradePromotionClick)({ target_name: "dynamic_tags" })
|
|
7817
7917
|
}
|
|
7818
7918
|
)
|
|
7819
7919
|
));
|
|
7820
|
-
var ExpiredDynamicTags = () => /* @__PURE__ */
|
|
7821
|
-
|
|
7920
|
+
var ExpiredDynamicTags = () => /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(import_ui53.Divider, null), /* @__PURE__ */ React105.createElement(
|
|
7921
|
+
import_ui53.Stack,
|
|
7822
7922
|
{
|
|
7823
7923
|
gap: 1,
|
|
7824
7924
|
alignItems: "center",
|
|
@@ -7828,16 +7928,16 @@ var ExpiredDynamicTags = () => /* @__PURE__ */ React103.createElement(React103.F
|
|
|
7828
7928
|
color: "text.secondary",
|
|
7829
7929
|
sx: { pb: 3.5 }
|
|
7830
7930
|
},
|
|
7831
|
-
/* @__PURE__ */
|
|
7832
|
-
/* @__PURE__ */
|
|
7833
|
-
/* @__PURE__ */
|
|
7834
|
-
/* @__PURE__ */
|
|
7835
|
-
|
|
7931
|
+
/* @__PURE__ */ React105.createElement(import_icons31.DatabaseIcon, { fontSize: "large" }),
|
|
7932
|
+
/* @__PURE__ */ React105.createElement(import_ui53.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n80.__)("Unlock your Dynamic tags again", "elementor")),
|
|
7933
|
+
/* @__PURE__ */ React105.createElement(import_ui53.Typography, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, (0, import_i18n80.__)("Dynamic tags need Elementor Pro. Renew now to keep them active.", "elementor")),
|
|
7934
|
+
/* @__PURE__ */ React105.createElement(
|
|
7935
|
+
import_editor_ui12.CtaButton,
|
|
7836
7936
|
{
|
|
7837
7937
|
size: "small",
|
|
7838
7938
|
href: RENEW_DYNAMIC_TAGS_URL,
|
|
7839
|
-
onClick: () => (0,
|
|
7840
|
-
children: (0,
|
|
7939
|
+
onClick: () => (0, import_editor_controls67.trackUpgradePromotionClick)({ target_name: "dynamic_tags" }),
|
|
7940
|
+
children: (0, import_i18n80.__)("Renew Now", "elementor")
|
|
7841
7941
|
}
|
|
7842
7942
|
)
|
|
7843
7943
|
));
|
|
@@ -7861,8 +7961,8 @@ var useFilteredOptions = (searchValue) => {
|
|
|
7861
7961
|
var SIZE3 = "tiny";
|
|
7862
7962
|
var tagsWithoutTabs = ["popup"];
|
|
7863
7963
|
var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
7864
|
-
const { setValue: setAnyValue, propType } = (0,
|
|
7865
|
-
const { bind, value } = (0,
|
|
7964
|
+
const { setValue: setAnyValue, propType } = (0, import_editor_controls68.useBoundProp)();
|
|
7965
|
+
const { bind, value } = (0, import_editor_controls68.useBoundProp)(dynamicPropTypeUtil);
|
|
7866
7966
|
const { expired: readonly } = useLicenseConfig();
|
|
7867
7967
|
const originalPropType = createTopLevelObjectType({
|
|
7868
7968
|
schema: {
|
|
@@ -7870,11 +7970,11 @@ var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
|
7870
7970
|
}
|
|
7871
7971
|
});
|
|
7872
7972
|
const [propValueFromHistory] = usePersistDynamicValue(bind);
|
|
7873
|
-
const selectionPopoverState = (0,
|
|
7973
|
+
const selectionPopoverState = (0, import_ui54.usePopupState)({ variant: "popover" });
|
|
7874
7974
|
const { name: tagName = "" } = value;
|
|
7875
7975
|
const dynamicTag = useDynamicTag(tagName);
|
|
7876
7976
|
if (!isDynamicTagSupported(tagName) && OriginalControl) {
|
|
7877
|
-
return /* @__PURE__ */
|
|
7977
|
+
return /* @__PURE__ */ React106.createElement(import_editor_controls68.PropProvider, { propType: originalPropType, value: { [bind]: null }, setValue: setAnyValue }, /* @__PURE__ */ React106.createElement(import_editor_controls68.PropKeyProvider, { bind }, /* @__PURE__ */ React106.createElement(OriginalControl, { ...props })));
|
|
7878
7978
|
}
|
|
7879
7979
|
const removeDynamicTag = () => {
|
|
7880
7980
|
setAnyValue(propValueFromHistory ?? null);
|
|
@@ -7882,26 +7982,26 @@ var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
|
7882
7982
|
if (!dynamicTag) {
|
|
7883
7983
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
7884
7984
|
}
|
|
7885
|
-
return /* @__PURE__ */
|
|
7886
|
-
|
|
7985
|
+
return /* @__PURE__ */ React106.createElement(import_ui54.Box, null, /* @__PURE__ */ React106.createElement(
|
|
7986
|
+
import_ui54.UnstableTag,
|
|
7887
7987
|
{
|
|
7888
7988
|
fullWidth: true,
|
|
7889
7989
|
showActionsOnHover: true,
|
|
7890
7990
|
label: dynamicTag.label,
|
|
7891
|
-
startIcon: /* @__PURE__ */
|
|
7892
|
-
...(0,
|
|
7893
|
-
actions: /* @__PURE__ */
|
|
7894
|
-
|
|
7991
|
+
startIcon: /* @__PURE__ */ React106.createElement(import_icons32.DatabaseIcon, { fontSize: SIZE3 }),
|
|
7992
|
+
...(0, import_ui54.bindTrigger)(selectionPopoverState),
|
|
7993
|
+
actions: /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(DynamicSettingsPopover, { dynamicTag, disabled: readonly }), /* @__PURE__ */ React106.createElement(
|
|
7994
|
+
import_ui54.IconButton,
|
|
7895
7995
|
{
|
|
7896
7996
|
size: SIZE3,
|
|
7897
7997
|
onClick: removeDynamicTag,
|
|
7898
|
-
"aria-label": (0,
|
|
7998
|
+
"aria-label": (0, import_i18n81.__)("Remove dynamic value", "elementor")
|
|
7899
7999
|
},
|
|
7900
|
-
/* @__PURE__ */
|
|
8000
|
+
/* @__PURE__ */ React106.createElement(import_icons32.XIcon, { fontSize: SIZE3 })
|
|
7901
8001
|
))
|
|
7902
8002
|
}
|
|
7903
|
-
), /* @__PURE__ */
|
|
7904
|
-
|
|
8003
|
+
), /* @__PURE__ */ React106.createElement(
|
|
8004
|
+
import_ui54.Popover,
|
|
7905
8005
|
{
|
|
7906
8006
|
disablePortal: true,
|
|
7907
8007
|
disableScrollLock: true,
|
|
@@ -7910,31 +8010,31 @@ var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
|
7910
8010
|
PaperProps: {
|
|
7911
8011
|
sx: { my: 1 }
|
|
7912
8012
|
},
|
|
7913
|
-
...(0,
|
|
8013
|
+
...(0, import_ui54.bindPopover)(selectionPopoverState)
|
|
7914
8014
|
},
|
|
7915
|
-
/* @__PURE__ */
|
|
8015
|
+
/* @__PURE__ */ React106.createElement(import_editor_ui13.SectionPopoverBody, { "aria-label": (0, import_i18n81.__)("Dynamic tags", "elementor") }, /* @__PURE__ */ React106.createElement(DynamicSelection, { close: selectionPopoverState.close, expired: readonly }))
|
|
7916
8016
|
));
|
|
7917
8017
|
};
|
|
7918
8018
|
var DynamicSettingsPopover = ({
|
|
7919
8019
|
dynamicTag,
|
|
7920
8020
|
disabled = false
|
|
7921
8021
|
}) => {
|
|
7922
|
-
const popupState = (0,
|
|
8022
|
+
const popupState = (0, import_ui54.usePopupState)({ variant: "popover" });
|
|
7923
8023
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
7924
8024
|
if (!hasDynamicSettings) {
|
|
7925
8025
|
return null;
|
|
7926
8026
|
}
|
|
7927
|
-
return /* @__PURE__ */
|
|
7928
|
-
|
|
8027
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(
|
|
8028
|
+
import_ui54.IconButton,
|
|
7929
8029
|
{
|
|
7930
8030
|
size: SIZE3,
|
|
7931
8031
|
disabled,
|
|
7932
|
-
...!disabled && (0,
|
|
7933
|
-
"aria-label": (0,
|
|
8032
|
+
...!disabled && (0, import_ui54.bindTrigger)(popupState),
|
|
8033
|
+
"aria-label": (0, import_i18n81.__)("Dynamic settings", "elementor")
|
|
7934
8034
|
},
|
|
7935
|
-
/* @__PURE__ */
|
|
7936
|
-
), /* @__PURE__ */
|
|
7937
|
-
|
|
8035
|
+
/* @__PURE__ */ React106.createElement(import_icons32.SettingsIcon, { fontSize: SIZE3 })
|
|
8036
|
+
), /* @__PURE__ */ React106.createElement(
|
|
8037
|
+
import_ui54.Popover,
|
|
7938
8038
|
{
|
|
7939
8039
|
disablePortal: true,
|
|
7940
8040
|
disableScrollLock: true,
|
|
@@ -7943,45 +8043,45 @@ var DynamicSettingsPopover = ({
|
|
|
7943
8043
|
PaperProps: {
|
|
7944
8044
|
sx: { my: 1 }
|
|
7945
8045
|
},
|
|
7946
|
-
...(0,
|
|
8046
|
+
...(0, import_ui54.bindPopover)(popupState)
|
|
7947
8047
|
},
|
|
7948
|
-
/* @__PURE__ */
|
|
7949
|
-
|
|
8048
|
+
/* @__PURE__ */ React106.createElement(import_editor_ui13.SectionPopoverBody, { "aria-label": (0, import_i18n81.__)("Dynamic settings", "elementor") }, /* @__PURE__ */ React106.createElement(
|
|
8049
|
+
import_editor_ui13.PopoverHeader,
|
|
7950
8050
|
{
|
|
7951
8051
|
title: dynamicTag.label,
|
|
7952
8052
|
onClose: popupState.close,
|
|
7953
|
-
icon: /* @__PURE__ */
|
|
8053
|
+
icon: /* @__PURE__ */ React106.createElement(import_icons32.DatabaseIcon, { fontSize: SIZE3 })
|
|
7954
8054
|
}
|
|
7955
|
-
), /* @__PURE__ */
|
|
8055
|
+
), /* @__PURE__ */ React106.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls, tagName: dynamicTag.name }))
|
|
7956
8056
|
));
|
|
7957
8057
|
};
|
|
7958
8058
|
var DynamicSettings = ({ controls, tagName }) => {
|
|
7959
8059
|
const tabs = controls.filter(({ type }) => type === "section");
|
|
7960
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
8060
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui54.useTabs)(0);
|
|
7961
8061
|
if (!tabs.length) {
|
|
7962
8062
|
return null;
|
|
7963
8063
|
}
|
|
7964
8064
|
if (tagsWithoutTabs.includes(tagName)) {
|
|
7965
8065
|
const singleTab = tabs[0];
|
|
7966
|
-
return /* @__PURE__ */
|
|
8066
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(import_ui54.Divider, null), /* @__PURE__ */ React106.createElement(ControlsItemsStack, { items: singleTab.value.items }));
|
|
7967
8067
|
}
|
|
7968
|
-
return /* @__PURE__ */
|
|
7969
|
-
|
|
8068
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, tabs.length > 1 && /* @__PURE__ */ React106.createElement(import_ui54.Tabs, { size: "small", variant: "fullWidth", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React106.createElement(
|
|
8069
|
+
import_ui54.Tab,
|
|
7970
8070
|
{
|
|
7971
8071
|
key: index,
|
|
7972
8072
|
label: value.label,
|
|
7973
8073
|
sx: { px: 1, py: 0.5 },
|
|
7974
8074
|
...getTabProps(index)
|
|
7975
8075
|
}
|
|
7976
|
-
))), /* @__PURE__ */
|
|
7977
|
-
return /* @__PURE__ */
|
|
7978
|
-
|
|
8076
|
+
))), /* @__PURE__ */ React106.createElement(import_ui54.Divider, null), tabs.map(({ value }, index) => {
|
|
8077
|
+
return /* @__PURE__ */ React106.createElement(
|
|
8078
|
+
import_ui54.TabPanel,
|
|
7979
8079
|
{
|
|
7980
8080
|
key: index,
|
|
7981
8081
|
sx: { flexGrow: 1, py: 0, overflowY: "auto" },
|
|
7982
8082
|
...getTabPanelProps(index)
|
|
7983
8083
|
},
|
|
7984
|
-
/* @__PURE__ */
|
|
8084
|
+
/* @__PURE__ */ React106.createElement(ControlsItemsStack, { items: value.items })
|
|
7985
8085
|
);
|
|
7986
8086
|
}));
|
|
7987
8087
|
};
|
|
@@ -8023,11 +8123,11 @@ var Control2 = ({ control }) => {
|
|
|
8023
8123
|
display: "grid",
|
|
8024
8124
|
gridTemplateColumns: isSwitchControl ? "minmax(0, 1fr) max-content" : "1fr 1fr"
|
|
8025
8125
|
} : {};
|
|
8026
|
-
return /* @__PURE__ */
|
|
8126
|
+
return /* @__PURE__ */ React106.createElement(DynamicControl, { bind: control.bind }, /* @__PURE__ */ React106.createElement(import_ui54.Grid, { container: true, gap: 0.75, sx: layoutStyleProps }, control.label ? /* @__PURE__ */ React106.createElement(import_ui54.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React106.createElement(import_editor_controls68.ControlFormLabel, null, control.label)) : null, /* @__PURE__ */ React106.createElement(import_ui54.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React106.createElement(Control, { type: control.type, props: controlProps }))));
|
|
8027
8127
|
};
|
|
8028
8128
|
function ControlsItemsStack({ items: items3 }) {
|
|
8029
|
-
return /* @__PURE__ */
|
|
8030
|
-
(item) => item.type === "control" ? /* @__PURE__ */
|
|
8129
|
+
return /* @__PURE__ */ React106.createElement(import_ui54.Stack, { p: 2, gap: 2, sx: { overflowY: "auto" } }, items3.map(
|
|
8130
|
+
(item) => item.type === "control" ? /* @__PURE__ */ React106.createElement(Control2, { key: item.value.bind, control: item.value }) : null
|
|
8031
8131
|
));
|
|
8032
8132
|
}
|
|
8033
8133
|
|
|
@@ -8084,34 +8184,34 @@ function getDynamicValue(name, settings, renderPostId) {
|
|
|
8084
8184
|
}
|
|
8085
8185
|
|
|
8086
8186
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
8087
|
-
var
|
|
8088
|
-
var
|
|
8187
|
+
var React107 = __toESM(require("react"));
|
|
8188
|
+
var import_editor_controls69 = require("@elementor/editor-controls");
|
|
8089
8189
|
var import_icons33 = require("@elementor/icons");
|
|
8090
|
-
var
|
|
8190
|
+
var import_i18n82 = require("@wordpress/i18n");
|
|
8091
8191
|
var usePropDynamicAction = () => {
|
|
8092
|
-
const { propType } = (0,
|
|
8192
|
+
const { propType } = (0, import_editor_controls69.useBoundProp)();
|
|
8093
8193
|
const visible = !!propType && supportsDynamic(propType);
|
|
8094
8194
|
return {
|
|
8095
8195
|
visible,
|
|
8096
8196
|
icon: import_icons33.DatabaseIcon,
|
|
8097
|
-
title: (0,
|
|
8098
|
-
content: ({ close }) => /* @__PURE__ */
|
|
8197
|
+
title: (0, import_i18n82.__)("Dynamic tags", "elementor"),
|
|
8198
|
+
content: ({ close }) => /* @__PURE__ */ React107.createElement(DynamicSelection, { close })
|
|
8099
8199
|
};
|
|
8100
8200
|
};
|
|
8101
8201
|
|
|
8102
8202
|
// src/dynamics/init.ts
|
|
8103
8203
|
var { registerPopoverAction } = import_menus2.controlActionsMenu;
|
|
8104
8204
|
var init2 = () => {
|
|
8105
|
-
(0,
|
|
8205
|
+
(0, import_editor_controls70.registerControlReplacement)({
|
|
8106
8206
|
component: DynamicSelectionControl,
|
|
8107
8207
|
condition: ({ value }) => isDynamicPropValue(value)
|
|
8108
8208
|
});
|
|
8109
|
-
(0,
|
|
8209
|
+
(0, import_editor_controls70.injectIntoRepeaterItemLabel)({
|
|
8110
8210
|
id: "dynamic-background-image",
|
|
8111
8211
|
condition: ({ value }) => isDynamicPropValue(value.value?.image?.value?.src),
|
|
8112
8212
|
component: BackgroundControlDynamicTagLabel
|
|
8113
8213
|
});
|
|
8114
|
-
(0,
|
|
8214
|
+
(0, import_editor_controls70.injectIntoRepeaterItemIcon)({
|
|
8115
8215
|
id: "dynamic-background-image",
|
|
8116
8216
|
condition: ({ value }) => isDynamicPropValue(value.value?.image?.value?.src),
|
|
8117
8217
|
component: BackgroundControlDynamicTagIcon
|
|
@@ -8126,11 +8226,11 @@ var init2 = () => {
|
|
|
8126
8226
|
};
|
|
8127
8227
|
|
|
8128
8228
|
// src/reset-style-props.tsx
|
|
8129
|
-
var
|
|
8229
|
+
var import_editor_controls71 = require("@elementor/editor-controls");
|
|
8130
8230
|
var import_editor_variables2 = require("@elementor/editor-variables");
|
|
8131
8231
|
var import_icons34 = require("@elementor/icons");
|
|
8132
8232
|
var import_menus3 = require("@elementor/menus");
|
|
8133
|
-
var
|
|
8233
|
+
var import_i18n83 = require("@wordpress/i18n");
|
|
8134
8234
|
|
|
8135
8235
|
// src/utils/is-equal.ts
|
|
8136
8236
|
function isEqual(a, b) {
|
|
@@ -8186,7 +8286,7 @@ function initResetStyleProps() {
|
|
|
8186
8286
|
}
|
|
8187
8287
|
function useResetStyleValueProps() {
|
|
8188
8288
|
const isStyle = useIsStyle();
|
|
8189
|
-
const { value, resetValue, propType } = (0,
|
|
8289
|
+
const { value, resetValue, propType } = (0, import_editor_controls71.useBoundProp)();
|
|
8190
8290
|
const hasValue = value !== null && value !== void 0;
|
|
8191
8291
|
const hasInitial = propType.initial_value !== void 0 && propType.initial_value !== null;
|
|
8192
8292
|
const isRequired = !!propType.settings?.required;
|
|
@@ -8206,44 +8306,44 @@ function useResetStyleValueProps() {
|
|
|
8206
8306
|
const visible = calculateVisibility();
|
|
8207
8307
|
return {
|
|
8208
8308
|
visible,
|
|
8209
|
-
title: (0,
|
|
8309
|
+
title: (0, import_i18n83.__)("Clear", "elementor"),
|
|
8210
8310
|
icon: import_icons34.BrushBigIcon,
|
|
8211
8311
|
onClick: () => resetValue()
|
|
8212
8312
|
};
|
|
8213
8313
|
}
|
|
8214
8314
|
|
|
8215
8315
|
// src/styles-inheritance/components/styles-inheritance-indicator.tsx
|
|
8216
|
-
var
|
|
8217
|
-
var
|
|
8316
|
+
var React113 = __toESM(require("react"));
|
|
8317
|
+
var import_editor_controls72 = require("@elementor/editor-controls");
|
|
8218
8318
|
var import_editor_props31 = require("@elementor/editor-props");
|
|
8219
8319
|
var import_editor_styles_repository20 = require("@elementor/editor-styles-repository");
|
|
8220
|
-
var
|
|
8320
|
+
var import_i18n87 = require("@wordpress/i18n");
|
|
8221
8321
|
|
|
8222
8322
|
// src/styles-inheritance/components/styles-inheritance-infotip.tsx
|
|
8223
|
-
var
|
|
8224
|
-
var
|
|
8323
|
+
var React112 = __toESM(require("react"));
|
|
8324
|
+
var import_react53 = require("react");
|
|
8225
8325
|
var import_editor_canvas5 = require("@elementor/editor-canvas");
|
|
8226
|
-
var
|
|
8227
|
-
var
|
|
8228
|
-
var
|
|
8326
|
+
var import_editor_ui14 = require("@elementor/editor-ui");
|
|
8327
|
+
var import_ui59 = require("@elementor/ui");
|
|
8328
|
+
var import_i18n86 = require("@wordpress/i18n");
|
|
8229
8329
|
|
|
8230
8330
|
// src/styles-inheritance/hooks/use-normalized-inheritance-chain-items.tsx
|
|
8231
|
-
var
|
|
8331
|
+
var import_react52 = require("react");
|
|
8232
8332
|
var import_editor_canvas4 = require("@elementor/editor-canvas");
|
|
8233
8333
|
var import_editor_styles8 = require("@elementor/editor-styles");
|
|
8234
8334
|
var import_editor_styles_repository18 = require("@elementor/editor-styles-repository");
|
|
8235
|
-
var
|
|
8335
|
+
var import_i18n84 = require("@wordpress/i18n");
|
|
8236
8336
|
var MAXIMUM_ITEMS = 2;
|
|
8237
8337
|
var useNormalizedInheritanceChainItems = (inheritanceChain, bind, resolve) => {
|
|
8238
|
-
const [items3, setItems] = (0,
|
|
8239
|
-
(0,
|
|
8338
|
+
const [items3, setItems] = (0, import_react52.useState)([]);
|
|
8339
|
+
(0, import_react52.useEffect)(() => {
|
|
8240
8340
|
(async () => {
|
|
8241
8341
|
const normalizedItems = await Promise.all(
|
|
8242
8342
|
inheritanceChain.filter(({ style }) => style).map((item, index) => normalizeInheritanceItem(item, index, bind, resolve))
|
|
8243
8343
|
);
|
|
8244
8344
|
const validItems = normalizedItems.map((item) => ({
|
|
8245
8345
|
...item,
|
|
8246
|
-
displayLabel: import_editor_styles_repository18.ELEMENTS_BASE_STYLES_PROVIDER_KEY !== item.provider ? item.displayLabel : (0,
|
|
8346
|
+
displayLabel: import_editor_styles_repository18.ELEMENTS_BASE_STYLES_PROVIDER_KEY !== item.provider ? item.displayLabel : (0, import_i18n84.__)("Base", "elementor")
|
|
8247
8347
|
})).filter((item) => !item.value || item.displayLabel !== "").slice(0, MAXIMUM_ITEMS);
|
|
8248
8348
|
setItems(validItems);
|
|
8249
8349
|
})();
|
|
@@ -8287,7 +8387,7 @@ var getTransformedValue = async (item, bind, resolve) => {
|
|
|
8287
8387
|
}
|
|
8288
8388
|
});
|
|
8289
8389
|
const value = result?.[bind] ?? result;
|
|
8290
|
-
if ((0,
|
|
8390
|
+
if ((0, import_react52.isValidElement)(value)) {
|
|
8291
8391
|
return value;
|
|
8292
8392
|
}
|
|
8293
8393
|
if (typeof value === "object") {
|
|
@@ -8300,10 +8400,10 @@ var getTransformedValue = async (item, bind, resolve) => {
|
|
|
8300
8400
|
};
|
|
8301
8401
|
|
|
8302
8402
|
// src/styles-inheritance/components/infotip/breakpoint-icon.tsx
|
|
8303
|
-
var
|
|
8403
|
+
var React108 = __toESM(require("react"));
|
|
8304
8404
|
var import_editor_responsive5 = require("@elementor/editor-responsive");
|
|
8305
8405
|
var import_icons35 = require("@elementor/icons");
|
|
8306
|
-
var
|
|
8406
|
+
var import_ui55 = require("@elementor/ui");
|
|
8307
8407
|
var SIZE4 = "tiny";
|
|
8308
8408
|
var DEFAULT_BREAKPOINT3 = "desktop";
|
|
8309
8409
|
var breakpointIconMap = {
|
|
@@ -8323,21 +8423,21 @@ var BreakpointIcon = ({ breakpoint }) => {
|
|
|
8323
8423
|
return null;
|
|
8324
8424
|
}
|
|
8325
8425
|
const breakpointLabel = breakpoints.find((breakpointItem) => breakpointItem.id === currentBreakpoint)?.label;
|
|
8326
|
-
return /* @__PURE__ */
|
|
8426
|
+
return /* @__PURE__ */ React108.createElement(import_ui55.Tooltip, { title: breakpointLabel, placement: "top" }, /* @__PURE__ */ React108.createElement(IconComponent, { fontSize: SIZE4, sx: { mt: "2px" } }));
|
|
8327
8427
|
};
|
|
8328
8428
|
|
|
8329
8429
|
// src/styles-inheritance/components/infotip/label-chip.tsx
|
|
8330
|
-
var
|
|
8430
|
+
var React109 = __toESM(require("react"));
|
|
8331
8431
|
var import_editor_styles_repository19 = require("@elementor/editor-styles-repository");
|
|
8332
8432
|
var import_icons36 = require("@elementor/icons");
|
|
8333
|
-
var
|
|
8334
|
-
var
|
|
8433
|
+
var import_ui56 = require("@elementor/ui");
|
|
8434
|
+
var import_i18n85 = require("@wordpress/i18n");
|
|
8335
8435
|
var SIZE5 = "tiny";
|
|
8336
8436
|
var LabelChip = ({ displayLabel, provider }) => {
|
|
8337
8437
|
const isBaseStyle = provider === import_editor_styles_repository19.ELEMENTS_BASE_STYLES_PROVIDER_KEY;
|
|
8338
|
-
const chipIcon = isBaseStyle ? /* @__PURE__ */
|
|
8339
|
-
return /* @__PURE__ */
|
|
8340
|
-
|
|
8438
|
+
const chipIcon = isBaseStyle ? /* @__PURE__ */ React109.createElement(import_ui56.Tooltip, { title: (0, import_i18n85.__)("Inherited from base styles", "elementor"), placement: "top" }, /* @__PURE__ */ React109.createElement(import_icons36.InfoCircleIcon, { fontSize: SIZE5 })) : void 0;
|
|
8439
|
+
return /* @__PURE__ */ React109.createElement(
|
|
8440
|
+
import_ui56.Chip,
|
|
8341
8441
|
{
|
|
8342
8442
|
label: displayLabel,
|
|
8343
8443
|
size: SIZE5,
|
|
@@ -8362,11 +8462,11 @@ var LabelChip = ({ displayLabel, provider }) => {
|
|
|
8362
8462
|
};
|
|
8363
8463
|
|
|
8364
8464
|
// src/styles-inheritance/components/infotip/value-component.tsx
|
|
8365
|
-
var
|
|
8366
|
-
var
|
|
8465
|
+
var React110 = __toESM(require("react"));
|
|
8466
|
+
var import_ui57 = require("@elementor/ui");
|
|
8367
8467
|
var ValueComponent = ({ index, value }) => {
|
|
8368
|
-
return /* @__PURE__ */
|
|
8369
|
-
|
|
8468
|
+
return /* @__PURE__ */ React110.createElement(import_ui57.Tooltip, { title: value, placement: "top" }, /* @__PURE__ */ React110.createElement(
|
|
8469
|
+
import_ui57.Typography,
|
|
8370
8470
|
{
|
|
8371
8471
|
variant: "caption",
|
|
8372
8472
|
color: "text.tertiary",
|
|
@@ -8387,9 +8487,9 @@ var ValueComponent = ({ index, value }) => {
|
|
|
8387
8487
|
};
|
|
8388
8488
|
|
|
8389
8489
|
// src/styles-inheritance/components/infotip/action-icons.tsx
|
|
8390
|
-
var
|
|
8391
|
-
var
|
|
8392
|
-
var ActionIcons = () => /* @__PURE__ */
|
|
8490
|
+
var React111 = __toESM(require("react"));
|
|
8491
|
+
var import_ui58 = require("@elementor/ui");
|
|
8492
|
+
var ActionIcons = () => /* @__PURE__ */ React111.createElement(import_ui58.Box, { display: "flex", gap: 0.5, alignItems: "center" });
|
|
8393
8493
|
|
|
8394
8494
|
// src/styles-inheritance/components/styles-inheritance-infotip.tsx
|
|
8395
8495
|
var SECTION_PADDING_INLINE = 32;
|
|
@@ -8402,8 +8502,8 @@ var StylesInheritanceInfotip = ({
|
|
|
8402
8502
|
children,
|
|
8403
8503
|
isDisabled
|
|
8404
8504
|
}) => {
|
|
8405
|
-
const [showInfotip, setShowInfotip] = (0,
|
|
8406
|
-
const triggerRef = (0,
|
|
8505
|
+
const [showInfotip, setShowInfotip] = (0, import_react53.useState)(false);
|
|
8506
|
+
const triggerRef = (0, import_react53.useRef)(null);
|
|
8407
8507
|
const toggleInfotip = () => {
|
|
8408
8508
|
if (isDisabled) {
|
|
8409
8509
|
return;
|
|
@@ -8417,16 +8517,16 @@ var StylesInheritanceInfotip = ({
|
|
|
8417
8517
|
setShowInfotip(false);
|
|
8418
8518
|
};
|
|
8419
8519
|
const key = path.join(".");
|
|
8420
|
-
const sectionWidth = (0,
|
|
8421
|
-
const resolve = (0,
|
|
8520
|
+
const sectionWidth = (0, import_editor_ui14.useSectionWidth)();
|
|
8521
|
+
const resolve = (0, import_react53.useMemo)(() => {
|
|
8422
8522
|
return (0, import_editor_canvas5.createPropsResolver)({
|
|
8423
8523
|
transformers: import_editor_canvas5.stylesInheritanceTransformersRegistry,
|
|
8424
8524
|
schema: { [key]: propType }
|
|
8425
8525
|
});
|
|
8426
8526
|
}, [key, propType]);
|
|
8427
8527
|
const items3 = useNormalizedInheritanceChainItems(inheritanceChain, key, resolve);
|
|
8428
|
-
const infotipContent = /* @__PURE__ */
|
|
8429
|
-
|
|
8528
|
+
const infotipContent = /* @__PURE__ */ React112.createElement(import_ui59.ClickAwayListener, { onClickAway: closeInfotip }, /* @__PURE__ */ React112.createElement(
|
|
8529
|
+
import_ui59.Card,
|
|
8430
8530
|
{
|
|
8431
8531
|
elevation: 0,
|
|
8432
8532
|
sx: {
|
|
@@ -8438,8 +8538,8 @@ var StylesInheritanceInfotip = ({
|
|
|
8438
8538
|
flexDirection: "column"
|
|
8439
8539
|
}
|
|
8440
8540
|
},
|
|
8441
|
-
/* @__PURE__ */
|
|
8442
|
-
|
|
8541
|
+
/* @__PURE__ */ React112.createElement(
|
|
8542
|
+
import_ui59.Box,
|
|
8443
8543
|
{
|
|
8444
8544
|
sx: {
|
|
8445
8545
|
position: "sticky",
|
|
@@ -8448,10 +8548,10 @@ var StylesInheritanceInfotip = ({
|
|
|
8448
8548
|
backgroundColor: "background.paper"
|
|
8449
8549
|
}
|
|
8450
8550
|
},
|
|
8451
|
-
/* @__PURE__ */
|
|
8551
|
+
/* @__PURE__ */ React112.createElement(import_editor_ui14.PopoverHeader, { title: (0, import_i18n86.__)("Style origin", "elementor"), onClose: closeInfotip })
|
|
8452
8552
|
),
|
|
8453
|
-
/* @__PURE__ */
|
|
8454
|
-
|
|
8553
|
+
/* @__PURE__ */ React112.createElement(
|
|
8554
|
+
import_ui59.CardContent,
|
|
8455
8555
|
{
|
|
8456
8556
|
sx: {
|
|
8457
8557
|
display: "flex",
|
|
@@ -8464,39 +8564,39 @@ var StylesInheritanceInfotip = ({
|
|
|
8464
8564
|
}
|
|
8465
8565
|
}
|
|
8466
8566
|
},
|
|
8467
|
-
/* @__PURE__ */
|
|
8468
|
-
return /* @__PURE__ */
|
|
8469
|
-
|
|
8567
|
+
/* @__PURE__ */ React112.createElement(import_ui59.Stack, { gap: 1.5, sx: { pl: 2, pr: 1, pt: 1.5, pb: 1.5 }, role: "list" }, items3.map((item, index) => {
|
|
8568
|
+
return /* @__PURE__ */ React112.createElement(
|
|
8569
|
+
import_ui59.Box,
|
|
8470
8570
|
{
|
|
8471
8571
|
key: item.id,
|
|
8472
8572
|
display: "flex",
|
|
8473
8573
|
gap: 0.5,
|
|
8474
8574
|
role: "listitem",
|
|
8475
|
-
"aria-label": (0,
|
|
8575
|
+
"aria-label": (0, import_i18n86.__)("Inheritance item: %s", "elementor").replace(
|
|
8476
8576
|
"%s",
|
|
8477
8577
|
item.displayLabel
|
|
8478
8578
|
)
|
|
8479
8579
|
},
|
|
8480
|
-
/* @__PURE__ */
|
|
8481
|
-
|
|
8580
|
+
/* @__PURE__ */ React112.createElement(
|
|
8581
|
+
import_ui59.Box,
|
|
8482
8582
|
{
|
|
8483
8583
|
display: "flex",
|
|
8484
8584
|
gap: 0.5,
|
|
8485
8585
|
sx: { flexWrap: "wrap", width: "100%", alignItems: "flex-start" }
|
|
8486
8586
|
},
|
|
8487
|
-
/* @__PURE__ */
|
|
8488
|
-
/* @__PURE__ */
|
|
8489
|
-
/* @__PURE__ */
|
|
8587
|
+
/* @__PURE__ */ React112.createElement(BreakpointIcon, { breakpoint: item.breakpoint }),
|
|
8588
|
+
/* @__PURE__ */ React112.createElement(LabelChip, { displayLabel: item.displayLabel, provider: item.provider }),
|
|
8589
|
+
/* @__PURE__ */ React112.createElement(ValueComponent, { index, value: item.value })
|
|
8490
8590
|
),
|
|
8491
|
-
/* @__PURE__ */
|
|
8591
|
+
/* @__PURE__ */ React112.createElement(ActionIcons, null)
|
|
8492
8592
|
);
|
|
8493
8593
|
}))
|
|
8494
8594
|
)
|
|
8495
8595
|
));
|
|
8496
8596
|
if (isDisabled) {
|
|
8497
|
-
return /* @__PURE__ */
|
|
8597
|
+
return /* @__PURE__ */ React112.createElement(import_ui59.Box, { sx: { display: "inline-flex" } }, children);
|
|
8498
8598
|
}
|
|
8499
|
-
return /* @__PURE__ */
|
|
8599
|
+
return /* @__PURE__ */ React112.createElement(import_ui59.Box, { ref: triggerRef, sx: { display: "inline-flex" } }, /* @__PURE__ */ React112.createElement(
|
|
8500
8600
|
TooltipOrInfotip,
|
|
8501
8601
|
{
|
|
8502
8602
|
showInfotip,
|
|
@@ -8504,8 +8604,8 @@ var StylesInheritanceInfotip = ({
|
|
|
8504
8604
|
infotipContent,
|
|
8505
8605
|
isDisabled
|
|
8506
8606
|
},
|
|
8507
|
-
/* @__PURE__ */
|
|
8508
|
-
|
|
8607
|
+
/* @__PURE__ */ React112.createElement(
|
|
8608
|
+
import_ui59.IconButton,
|
|
8509
8609
|
{
|
|
8510
8610
|
onClick: toggleInfotip,
|
|
8511
8611
|
"aria-label": label,
|
|
@@ -8524,11 +8624,11 @@ function TooltipOrInfotip({
|
|
|
8524
8624
|
isDisabled
|
|
8525
8625
|
}) {
|
|
8526
8626
|
if (isDisabled) {
|
|
8527
|
-
return /* @__PURE__ */
|
|
8627
|
+
return /* @__PURE__ */ React112.createElement(import_ui59.Box, { sx: { display: "inline-flex" } }, children);
|
|
8528
8628
|
}
|
|
8529
8629
|
if (showInfotip) {
|
|
8530
|
-
return /* @__PURE__ */
|
|
8531
|
-
|
|
8630
|
+
return /* @__PURE__ */ React112.createElement(React112.Fragment, null, /* @__PURE__ */ React112.createElement(
|
|
8631
|
+
import_ui59.Backdrop,
|
|
8532
8632
|
{
|
|
8533
8633
|
open: showInfotip,
|
|
8534
8634
|
onClick: onClose,
|
|
@@ -8537,8 +8637,8 @@ function TooltipOrInfotip({
|
|
|
8537
8637
|
zIndex: (theme) => theme.zIndex.modal - 1
|
|
8538
8638
|
}
|
|
8539
8639
|
}
|
|
8540
|
-
), /* @__PURE__ */
|
|
8541
|
-
|
|
8640
|
+
), /* @__PURE__ */ React112.createElement(
|
|
8641
|
+
import_ui59.Infotip,
|
|
8542
8642
|
{
|
|
8543
8643
|
placement: "top-end",
|
|
8544
8644
|
content: infotipContent,
|
|
@@ -8549,20 +8649,20 @@ function TooltipOrInfotip({
|
|
|
8549
8649
|
children
|
|
8550
8650
|
));
|
|
8551
8651
|
}
|
|
8552
|
-
return /* @__PURE__ */
|
|
8652
|
+
return /* @__PURE__ */ React112.createElement(import_ui59.Tooltip, { title: (0, import_i18n86.__)("Style origin", "elementor"), placement: "top" }, children);
|
|
8553
8653
|
}
|
|
8554
8654
|
|
|
8555
8655
|
// src/styles-inheritance/components/styles-inheritance-indicator.tsx
|
|
8556
8656
|
var StylesInheritanceIndicator = ({
|
|
8557
8657
|
customContext
|
|
8558
8658
|
}) => {
|
|
8559
|
-
const context = (0,
|
|
8659
|
+
const context = (0, import_editor_controls72.useBoundProp)();
|
|
8560
8660
|
const { path, propType } = customContext || context;
|
|
8561
8661
|
const inheritanceChain = useStylesInheritanceChain(path);
|
|
8562
8662
|
if (!path || !inheritanceChain.length) {
|
|
8563
8663
|
return null;
|
|
8564
8664
|
}
|
|
8565
|
-
return /* @__PURE__ */
|
|
8665
|
+
return /* @__PURE__ */ React113.createElement(Indicator, { inheritanceChain, path, propType });
|
|
8566
8666
|
};
|
|
8567
8667
|
var Indicator = ({ inheritanceChain, path, propType, isDisabled }) => {
|
|
8568
8668
|
const { id: currentStyleId, provider: currentStyleProvider, meta: currentStyleMeta } = useStyle();
|
|
@@ -8578,7 +8678,7 @@ var Indicator = ({ inheritanceChain, path, propType, isDisabled }) => {
|
|
|
8578
8678
|
getColor: isFinalValue && currentStyleProvider ? getStylesProviderThemeColor(currentStyleProvider.getKey()) : void 0,
|
|
8579
8679
|
isOverridden: hasValue && !isFinalValue ? true : void 0
|
|
8580
8680
|
};
|
|
8581
|
-
return /* @__PURE__ */
|
|
8681
|
+
return /* @__PURE__ */ React113.createElement(
|
|
8582
8682
|
StylesInheritanceInfotip,
|
|
8583
8683
|
{
|
|
8584
8684
|
inheritanceChain,
|
|
@@ -8587,17 +8687,17 @@ var Indicator = ({ inheritanceChain, path, propType, isDisabled }) => {
|
|
|
8587
8687
|
label,
|
|
8588
8688
|
isDisabled
|
|
8589
8689
|
},
|
|
8590
|
-
/* @__PURE__ */
|
|
8690
|
+
/* @__PURE__ */ React113.createElement(StyleIndicator, { ...styleIndicatorProps })
|
|
8591
8691
|
);
|
|
8592
8692
|
};
|
|
8593
8693
|
var getLabel = ({ isFinalValue, hasValue }) => {
|
|
8594
8694
|
if (isFinalValue) {
|
|
8595
|
-
return (0,
|
|
8695
|
+
return (0, import_i18n87.__)("This is the final value", "elementor");
|
|
8596
8696
|
}
|
|
8597
8697
|
if (hasValue) {
|
|
8598
|
-
return (0,
|
|
8698
|
+
return (0, import_i18n87.__)("This value is overridden by another style", "elementor");
|
|
8599
8699
|
}
|
|
8600
|
-
return (0,
|
|
8700
|
+
return (0, import_i18n87.__)("This has value from another style", "elementor");
|
|
8601
8701
|
};
|
|
8602
8702
|
|
|
8603
8703
|
// src/styles-inheritance/init-styles-inheritance-transformers.ts
|
|
@@ -8618,7 +8718,7 @@ var excludePropTypeTransformers = /* @__PURE__ */ new Set([
|
|
|
8618
8718
|
]);
|
|
8619
8719
|
|
|
8620
8720
|
// src/styles-inheritance/transformers/array-transformer.tsx
|
|
8621
|
-
var
|
|
8721
|
+
var React114 = __toESM(require("react"));
|
|
8622
8722
|
var import_editor_canvas6 = require("@elementor/editor-canvas");
|
|
8623
8723
|
var arrayTransformer = (0, import_editor_canvas6.createTransformer)((values) => {
|
|
8624
8724
|
if (!values || values.length === 0) {
|
|
@@ -8628,18 +8728,18 @@ var arrayTransformer = (0, import_editor_canvas6.createTransformer)((values) =>
|
|
|
8628
8728
|
if (allStrings) {
|
|
8629
8729
|
return values.join(" ");
|
|
8630
8730
|
}
|
|
8631
|
-
return /* @__PURE__ */
|
|
8731
|
+
return /* @__PURE__ */ React114.createElement(React114.Fragment, null, values.map((item, index) => /* @__PURE__ */ React114.createElement(React114.Fragment, { key: index }, index > 0 && " ", item)));
|
|
8632
8732
|
});
|
|
8633
8733
|
|
|
8634
8734
|
// src/styles-inheritance/transformers/background-color-overlay-transformer.tsx
|
|
8635
|
-
var
|
|
8735
|
+
var React115 = __toESM(require("react"));
|
|
8636
8736
|
var import_editor_canvas7 = require("@elementor/editor-canvas");
|
|
8637
|
-
var
|
|
8638
|
-
var backgroundColorOverlayTransformer = (0, import_editor_canvas7.createTransformer)((value) => /* @__PURE__ */
|
|
8737
|
+
var import_ui60 = require("@elementor/ui");
|
|
8738
|
+
var backgroundColorOverlayTransformer = (0, import_editor_canvas7.createTransformer)((value) => /* @__PURE__ */ React115.createElement(import_ui60.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React115.createElement(ItemLabelColor, { value })));
|
|
8639
8739
|
var ItemLabelColor = ({ value: { color } }) => {
|
|
8640
|
-
return /* @__PURE__ */
|
|
8740
|
+
return /* @__PURE__ */ React115.createElement("span", null, color);
|
|
8641
8741
|
};
|
|
8642
|
-
var StyledUnstableColorIndicator = (0,
|
|
8742
|
+
var StyledUnstableColorIndicator = (0, import_ui60.styled)(import_ui60.UnstableColorIndicator)(({ theme }) => ({
|
|
8643
8743
|
width: "1em",
|
|
8644
8744
|
height: "1em",
|
|
8645
8745
|
borderRadius: `${theme.shape.borderRadius / 2}px`,
|
|
@@ -8648,20 +8748,20 @@ var StyledUnstableColorIndicator = (0, import_ui59.styled)(import_ui59.UnstableC
|
|
|
8648
8748
|
}));
|
|
8649
8749
|
|
|
8650
8750
|
// src/styles-inheritance/transformers/background-gradient-overlay-transformer.tsx
|
|
8651
|
-
var
|
|
8751
|
+
var React116 = __toESM(require("react"));
|
|
8652
8752
|
var import_editor_canvas8 = require("@elementor/editor-canvas");
|
|
8653
|
-
var
|
|
8654
|
-
var
|
|
8655
|
-
var backgroundGradientOverlayTransformer = (0, import_editor_canvas8.createTransformer)((value) => /* @__PURE__ */
|
|
8753
|
+
var import_ui61 = require("@elementor/ui");
|
|
8754
|
+
var import_i18n88 = require("@wordpress/i18n");
|
|
8755
|
+
var backgroundGradientOverlayTransformer = (0, import_editor_canvas8.createTransformer)((value) => /* @__PURE__ */ React116.createElement(import_ui61.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React116.createElement(ItemIconGradient, { value }), /* @__PURE__ */ React116.createElement(ItemLabelGradient, { value })));
|
|
8656
8756
|
var ItemIconGradient = ({ value }) => {
|
|
8657
8757
|
const gradient = getGradientValue(value);
|
|
8658
|
-
return /* @__PURE__ */
|
|
8758
|
+
return /* @__PURE__ */ React116.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
8659
8759
|
};
|
|
8660
8760
|
var ItemLabelGradient = ({ value }) => {
|
|
8661
8761
|
if (value.type === "linear") {
|
|
8662
|
-
return /* @__PURE__ */
|
|
8762
|
+
return /* @__PURE__ */ React116.createElement("span", null, (0, import_i18n88.__)("Linear gradient", "elementor"));
|
|
8663
8763
|
}
|
|
8664
|
-
return /* @__PURE__ */
|
|
8764
|
+
return /* @__PURE__ */ React116.createElement("span", null, (0, import_i18n88.__)("Radial gradient", "elementor"));
|
|
8665
8765
|
};
|
|
8666
8766
|
var getGradientValue = (gradient) => {
|
|
8667
8767
|
const stops = gradient.stops?.map(({ color, offset }) => `${color} ${offset ?? 0}%`)?.join(",");
|
|
@@ -8675,16 +8775,16 @@ var getGradientValue = (gradient) => {
|
|
|
8675
8775
|
};
|
|
8676
8776
|
|
|
8677
8777
|
// src/styles-inheritance/transformers/background-image-overlay-transformer.tsx
|
|
8678
|
-
var
|
|
8778
|
+
var React117 = __toESM(require("react"));
|
|
8679
8779
|
var import_editor_canvas9 = require("@elementor/editor-canvas");
|
|
8680
|
-
var
|
|
8681
|
-
var
|
|
8780
|
+
var import_editor_ui15 = require("@elementor/editor-ui");
|
|
8781
|
+
var import_ui62 = require("@elementor/ui");
|
|
8682
8782
|
var import_wp_media = require("@elementor/wp-media");
|
|
8683
|
-
var backgroundImageOverlayTransformer = (0, import_editor_canvas9.createTransformer)((value) => /* @__PURE__ */
|
|
8783
|
+
var backgroundImageOverlayTransformer = (0, import_editor_canvas9.createTransformer)((value) => /* @__PURE__ */ React117.createElement(import_ui62.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React117.createElement(ItemIconImage, { value }), /* @__PURE__ */ React117.createElement(ItemLabelImage, { value })));
|
|
8684
8784
|
var ItemIconImage = ({ value }) => {
|
|
8685
8785
|
const { imageUrl } = useImage(value);
|
|
8686
|
-
return /* @__PURE__ */
|
|
8687
|
-
|
|
8786
|
+
return /* @__PURE__ */ React117.createElement(
|
|
8787
|
+
import_ui62.CardMedia,
|
|
8688
8788
|
{
|
|
8689
8789
|
image: imageUrl,
|
|
8690
8790
|
sx: (theme) => ({
|
|
@@ -8699,7 +8799,7 @@ var ItemIconImage = ({ value }) => {
|
|
|
8699
8799
|
};
|
|
8700
8800
|
var ItemLabelImage = ({ value }) => {
|
|
8701
8801
|
const { imageTitle } = useImage(value);
|
|
8702
|
-
return /* @__PURE__ */
|
|
8802
|
+
return /* @__PURE__ */ React117.createElement(import_editor_ui15.EllipsisWithTooltip, { title: imageTitle }, /* @__PURE__ */ React117.createElement("span", null, imageTitle));
|
|
8703
8803
|
};
|
|
8704
8804
|
var useImage = (image) => {
|
|
8705
8805
|
let imageTitle, imageUrl = null;
|
|
@@ -8724,7 +8824,7 @@ var getFileExtensionFromFilename = (filename) => {
|
|
|
8724
8824
|
};
|
|
8725
8825
|
|
|
8726
8826
|
// src/styles-inheritance/transformers/box-shadow-transformer.tsx
|
|
8727
|
-
var
|
|
8827
|
+
var React118 = __toESM(require("react"));
|
|
8728
8828
|
var import_editor_canvas10 = require("@elementor/editor-canvas");
|
|
8729
8829
|
var boxShadowTransformer = (0, import_editor_canvas10.createTransformer)((value) => {
|
|
8730
8830
|
if (!value) {
|
|
@@ -8734,20 +8834,20 @@ var boxShadowTransformer = (0, import_editor_canvas10.createTransformer)((value)
|
|
|
8734
8834
|
const colorValue = color || "#000000";
|
|
8735
8835
|
const sizes = [hOffset || "0px", vOffset || "0px", blur || "10px", spread || "0px"].join(" ");
|
|
8736
8836
|
const positionValue = position || "outset";
|
|
8737
|
-
return /* @__PURE__ */
|
|
8837
|
+
return /* @__PURE__ */ React118.createElement(React118.Fragment, null, colorValue, " ", positionValue, ", ", sizes);
|
|
8738
8838
|
});
|
|
8739
8839
|
|
|
8740
8840
|
// src/styles-inheritance/transformers/color-transformer.tsx
|
|
8741
|
-
var
|
|
8841
|
+
var React119 = __toESM(require("react"));
|
|
8742
8842
|
var import_editor_canvas11 = require("@elementor/editor-canvas");
|
|
8743
|
-
var
|
|
8843
|
+
var import_ui63 = require("@elementor/ui");
|
|
8744
8844
|
function isValidCSSColor(value) {
|
|
8745
8845
|
if (!value.trim()) {
|
|
8746
8846
|
return false;
|
|
8747
8847
|
}
|
|
8748
8848
|
return CSS.supports("color", value.trim());
|
|
8749
8849
|
}
|
|
8750
|
-
var StyledColorIndicator = (0,
|
|
8850
|
+
var StyledColorIndicator = (0, import_ui63.styled)(import_ui63.UnstableColorIndicator)(({ theme }) => ({
|
|
8751
8851
|
width: "1em",
|
|
8752
8852
|
height: "1em",
|
|
8753
8853
|
borderRadius: `${theme.shape.borderRadius / 2}px`,
|
|
@@ -8758,7 +8858,7 @@ var colorTransformer = (0, import_editor_canvas11.createTransformer)((value) =>
|
|
|
8758
8858
|
if (!isValidCSSColor(value)) {
|
|
8759
8859
|
return value;
|
|
8760
8860
|
}
|
|
8761
|
-
return /* @__PURE__ */
|
|
8861
|
+
return /* @__PURE__ */ React119.createElement(import_ui63.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React119.createElement(StyledColorIndicator, { size: "inherit", component: "span", value }), /* @__PURE__ */ React119.createElement("span", null, value));
|
|
8762
8862
|
});
|
|
8763
8863
|
|
|
8764
8864
|
// src/styles-inheritance/transformers/repeater-to-items-transformer.tsx
|
|
@@ -8828,7 +8928,7 @@ var init3 = () => {
|
|
|
8828
8928
|
|
|
8829
8929
|
// src/init.ts
|
|
8830
8930
|
function init4() {
|
|
8831
|
-
(0,
|
|
8931
|
+
(0, import_editor_controls73.init)();
|
|
8832
8932
|
(0, import_editor_panels3.registerPanel)(panel);
|
|
8833
8933
|
blockV1Panel();
|
|
8834
8934
|
(0, import_editor.injectIntoLogic)({
|
|
@@ -8877,6 +8977,7 @@ var blockV1Panel = () => {
|
|
|
8877
8977
|
StyleTabSection,
|
|
8878
8978
|
StyleTabSlot,
|
|
8879
8979
|
StylesProviderCannotUpdatePropsError,
|
|
8980
|
+
SubmenuToggle,
|
|
8880
8981
|
controlsRegistry,
|
|
8881
8982
|
createTopLevelObjectType,
|
|
8882
8983
|
doApplyClasses,
|
|
@@ -8904,6 +9005,7 @@ var blockV1Panel = () => {
|
|
|
8904
9005
|
registerElementPanelDefaults,
|
|
8905
9006
|
registerFieldIndicator,
|
|
8906
9007
|
registerStyleProviderToColors,
|
|
9008
|
+
registerSubmenuToggle,
|
|
8907
9009
|
setLicenseConfig,
|
|
8908
9010
|
useClassesProp,
|
|
8909
9011
|
useControlsByWidgetType,
|