@elementor/editor-editing-panel 3.33.0-222 → 3.33.0-223
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 +591 -414
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +556 -392
- package/dist/index.mjs.map +1 -1
- package/package.json +19 -19
- package/src/components/editing-panel-tabs.tsx +4 -1
- package/src/components/interactions-tab.tsx +57 -51
- package/src/contexts/popup-state-contex.tsx +36 -0
- package/src/interactions/components/controls/direction.tsx +43 -0
- package/src/interactions/components/controls/effect-type.tsx +40 -0
- package/src/interactions/components/controls/effect.tsx +40 -0
- package/src/interactions/components/controls/time-frame-indicator.tsx +43 -0
- package/src/interactions/components/controls/trigger.tsx +44 -0
- package/src/interactions/components/empty-state.tsx +34 -0
- package/src/interactions/components/header.tsx +22 -0
- package/src/interactions/components/interaction-details.tsx +71 -0
- package/src/interactions/components/interactions-list.tsx +113 -0
- package/src/{types/interactions.ts → interactions/types.ts} +12 -6
- package/src/interactions/utils/format-interaction-label.ts +32 -0
- package/src/interactions/utils/get-interactions-config.ts +16 -0
- package/src/sync/types.ts +0 -3
- package/src/components/interactions-sections/interactions-input.tsx +0 -249
- package/src/components/interactions-sections/interactions-section.tsx +0 -15
package/dist/index.js
CHANGED
|
@@ -4838,22 +4838,22 @@ var import_editor_panels3 = require("@elementor/editor-panels");
|
|
|
4838
4838
|
var import_editor_v1_adapters8 = require("@elementor/editor-v1-adapters");
|
|
4839
4839
|
|
|
4840
4840
|
// src/hooks/use-open-editor-panel.ts
|
|
4841
|
-
var
|
|
4841
|
+
var import_react44 = require("react");
|
|
4842
4842
|
var import_editor_v1_adapters7 = require("@elementor/editor-v1-adapters");
|
|
4843
4843
|
|
|
4844
4844
|
// src/panel.ts
|
|
4845
4845
|
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
4846
4846
|
|
|
4847
4847
|
// src/components/editing-panel.tsx
|
|
4848
|
-
var
|
|
4848
|
+
var React102 = __toESM(require("react"));
|
|
4849
4849
|
var import_editor_controls53 = require("@elementor/editor-controls");
|
|
4850
4850
|
var import_editor_elements15 = require("@elementor/editor-elements");
|
|
4851
4851
|
var import_editor_panels = require("@elementor/editor-panels");
|
|
4852
|
-
var
|
|
4853
|
-
var
|
|
4852
|
+
var import_editor_ui9 = require("@elementor/editor-ui");
|
|
4853
|
+
var import_icons28 = require("@elementor/icons");
|
|
4854
4854
|
var import_session9 = require("@elementor/session");
|
|
4855
|
-
var
|
|
4856
|
-
var
|
|
4855
|
+
var import_ui54 = require("@elementor/ui");
|
|
4856
|
+
var import_i18n70 = require("@wordpress/i18n");
|
|
4857
4857
|
|
|
4858
4858
|
// src/components/editing-panel-error-fallback.tsx
|
|
4859
4859
|
var React84 = __toESM(require("react"));
|
|
@@ -4863,28 +4863,45 @@ function EditorPanelErrorFallback() {
|
|
|
4863
4863
|
}
|
|
4864
4864
|
|
|
4865
4865
|
// src/components/editing-panel-tabs.tsx
|
|
4866
|
-
var
|
|
4867
|
-
var
|
|
4866
|
+
var import_react43 = require("react");
|
|
4867
|
+
var React101 = __toESM(require("react"));
|
|
4868
4868
|
var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
4869
|
-
var
|
|
4870
|
-
var
|
|
4869
|
+
var import_ui53 = require("@elementor/ui");
|
|
4870
|
+
var import_i18n69 = require("@wordpress/i18n");
|
|
4871
|
+
|
|
4872
|
+
// src/contexts/popup-state-contex.tsx
|
|
4873
|
+
var React85 = __toESM(require("react"));
|
|
4874
|
+
var import_react37 = require("react");
|
|
4875
|
+
var PopupStateContext = (0, import_react37.createContext)(void 0);
|
|
4876
|
+
var PopupStateProvider = ({ children }) => {
|
|
4877
|
+
const [openByDefault, setOpenByDefault] = (0, import_react37.useState)(false);
|
|
4878
|
+
const triggerDefaultOpen = (0, import_react37.useCallback)(() => {
|
|
4879
|
+
setOpenByDefault(true);
|
|
4880
|
+
}, []);
|
|
4881
|
+
const resetDefaultOpen = (0, import_react37.useCallback)(() => {
|
|
4882
|
+
setOpenByDefault(false);
|
|
4883
|
+
}, []);
|
|
4884
|
+
return /* @__PURE__ */ React85.createElement(PopupStateContext.Provider, { value: { openByDefault, triggerDefaultOpen, resetDefaultOpen } }, children);
|
|
4885
|
+
};
|
|
4886
|
+
var usePopupStateContext = () => {
|
|
4887
|
+
const context = (0, import_react37.useContext)(PopupStateContext);
|
|
4888
|
+
if (!context) {
|
|
4889
|
+
throw new Error("usePopupStateContext must be used within PopupStateProvider");
|
|
4890
|
+
}
|
|
4891
|
+
return context;
|
|
4892
|
+
};
|
|
4871
4893
|
|
|
4872
4894
|
// src/components/interactions-tab.tsx
|
|
4873
|
-
var
|
|
4895
|
+
var React96 = __toESM(require("react"));
|
|
4896
|
+
var import_react41 = require("react");
|
|
4874
4897
|
var import_editor_elements13 = require("@elementor/editor-elements");
|
|
4875
|
-
var import_icons25 = require("@elementor/icons");
|
|
4876
4898
|
var import_session6 = require("@elementor/session");
|
|
4877
|
-
var import_ui43 = require("@elementor/ui");
|
|
4878
|
-
var import_i18n61 = require("@wordpress/i18n");
|
|
4879
|
-
|
|
4880
|
-
// src/components/interactions-sections/interactions-section.tsx
|
|
4881
|
-
var React87 = __toESM(require("react"));
|
|
4882
4899
|
|
|
4883
4900
|
// src/contexts/interaction-context.tsx
|
|
4884
|
-
var
|
|
4885
|
-
var
|
|
4901
|
+
var React86 = __toESM(require("react"));
|
|
4902
|
+
var import_react38 = require("react");
|
|
4886
4903
|
var import_editor_elements12 = require("@elementor/editor-elements");
|
|
4887
|
-
var InteractionsContext = (0,
|
|
4904
|
+
var InteractionsContext = (0, import_react38.createContext)(null);
|
|
4888
4905
|
var InteractionsProvider = ({ children }) => {
|
|
4889
4906
|
const { element } = useElement();
|
|
4890
4907
|
const interactions = (0, import_editor_elements12.useElementInteractions)(element.id);
|
|
@@ -4898,262 +4915,422 @@ var InteractionsProvider = ({ children }) => {
|
|
|
4898
4915
|
interactions: interactions || "",
|
|
4899
4916
|
setInteractions
|
|
4900
4917
|
};
|
|
4901
|
-
return /* @__PURE__ */
|
|
4918
|
+
return /* @__PURE__ */ React86.createElement(InteractionsContext.Provider, { value: contextValue }, children);
|
|
4902
4919
|
};
|
|
4903
4920
|
var useInteractionsContext = () => {
|
|
4904
|
-
const context = (0,
|
|
4921
|
+
const context = (0, import_react38.useContext)(InteractionsContext);
|
|
4905
4922
|
if (!context) {
|
|
4906
4923
|
throw new Error("useInteractionsContext must be used within InteractionsProvider");
|
|
4907
4924
|
}
|
|
4908
4925
|
return context;
|
|
4909
4926
|
};
|
|
4910
4927
|
|
|
4911
|
-
// src/components/
|
|
4912
|
-
var
|
|
4928
|
+
// src/interactions/components/empty-state.tsx
|
|
4929
|
+
var React87 = __toESM(require("react"));
|
|
4913
4930
|
var import_icons24 = require("@elementor/icons");
|
|
4914
4931
|
var import_ui42 = require("@elementor/ui");
|
|
4915
4932
|
var import_i18n60 = require("@wordpress/i18n");
|
|
4916
|
-
var
|
|
4917
|
-
|
|
4918
|
-
|
|
4933
|
+
var EmptyState2 = ({ onCreateInteraction }) => {
|
|
4934
|
+
return /* @__PURE__ */ React87.createElement(
|
|
4935
|
+
import_ui42.Stack,
|
|
4936
|
+
{
|
|
4937
|
+
alignItems: "center",
|
|
4938
|
+
justifyContent: "center",
|
|
4939
|
+
height: "100%",
|
|
4940
|
+
color: "text.secondary",
|
|
4941
|
+
sx: { p: 2.5, pt: 8, pb: 5.5 },
|
|
4942
|
+
gap: 1.5
|
|
4943
|
+
},
|
|
4944
|
+
/* @__PURE__ */ React87.createElement(import_icons24.SwipeIcon, { fontSize: "large" }),
|
|
4945
|
+
/* @__PURE__ */ React87.createElement(import_ui42.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n60.__)("Animate elements with Interactions", "elementor")),
|
|
4946
|
+
/* @__PURE__ */ React87.createElement(import_ui42.Typography, { align: "center", variant: "caption", maxWidth: "170px" }, (0, import_i18n60.__)(
|
|
4947
|
+
"Add entrance animations and effects triggered by user interactions such as click, hover, or scroll.",
|
|
4948
|
+
"elementor"
|
|
4949
|
+
)),
|
|
4950
|
+
/* @__PURE__ */ React87.createElement(import_ui42.Button, { variant: "outlined", color: "secondary", size: "small", sx: { mt: 1 }, onClick: onCreateInteraction }, (0, import_i18n60.__)("Create an interaction", "elementor"))
|
|
4951
|
+
);
|
|
4919
4952
|
};
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4953
|
+
|
|
4954
|
+
// src/interactions/components/interactions-list.tsx
|
|
4955
|
+
var React95 = __toESM(require("react"));
|
|
4956
|
+
var import_react40 = require("react");
|
|
4957
|
+
var import_icons27 = require("@elementor/icons");
|
|
4958
|
+
var import_ui50 = require("@elementor/ui");
|
|
4959
|
+
var import_i18n67 = require("@wordpress/i18n");
|
|
4960
|
+
|
|
4961
|
+
// src/interactions/utils/get-interactions-config.ts
|
|
4962
|
+
var DEFAULT_CONFIG = {
|
|
4963
|
+
constants: {
|
|
4964
|
+
defaultDuration: 300,
|
|
4965
|
+
defaultDelay: 0,
|
|
4966
|
+
slideDistance: 100,
|
|
4967
|
+
scaleStart: 0.5,
|
|
4968
|
+
easing: "linear"
|
|
4969
|
+
},
|
|
4970
|
+
animationOptions: []
|
|
4971
|
+
};
|
|
4972
|
+
function getInteractionsConfig() {
|
|
4973
|
+
return window.ElementorInteractionsConfig || DEFAULT_CONFIG;
|
|
4974
|
+
}
|
|
4975
|
+
|
|
4976
|
+
// src/interactions/utils/format-interaction-label.ts
|
|
4977
|
+
function formatInteractionLabel(animationId) {
|
|
4978
|
+
if (!animationId) {
|
|
4979
|
+
return "";
|
|
4980
|
+
}
|
|
4981
|
+
const [trigger, effect, type, direction, duration, delay] = animationId.split("-");
|
|
4982
|
+
const baseValue = `${trigger}-${effect}-${type}-${direction || ""}`;
|
|
4983
|
+
const animationOptions = getInteractionsConfig()?.animationOptions;
|
|
4984
|
+
const option = animationOptions.find((opt) => opt.value === baseValue);
|
|
4985
|
+
let label = option?.label || animationId;
|
|
4986
|
+
if (duration || delay) {
|
|
4987
|
+
const constants = getInteractionsConfig()?.constants;
|
|
4988
|
+
const durationValue = duration || String(constants.defaultDuration);
|
|
4989
|
+
const delayValue = delay || String(constants.defaultDelay);
|
|
4990
|
+
label += ` (${durationValue}ms`;
|
|
4991
|
+
if (delayValue !== "0") {
|
|
4992
|
+
label += `, ${delayValue}ms delay`;
|
|
4934
4993
|
}
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
}
|
|
4953
|
-
}
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
return /* @__PURE__ */ React86.createElement(import_ui42.Stack, { spacing: 1 }, /* @__PURE__ */ React86.createElement(import_ui42.Stack, { direction: "row", alignItems: "center", gap: 1, sx: { marginInlineEnd: -0.75, py: 0.25 } }, /* @__PURE__ */ React86.createElement(import_ui42.Box, { display: "flex", alignItems: "center", gap: 1, sx: { flexGrow: 1 } }, /* @__PURE__ */ React86.createElement(import_ui42.Typography, { component: "label", variant: "caption", color: "text.secondary", sx: { lineHeight: 1 } }, (0, import_i18n60.__)("Interactions", "elementor"))), /* @__PURE__ */ React86.createElement(import_ui42.Tooltip, { title: (0, import_i18n60.__)("Add interaction", "elementor"), placement: "top" }, /* @__PURE__ */ React86.createElement(
|
|
4980
|
-
import_ui42.IconButton,
|
|
4994
|
+
label += ")";
|
|
4995
|
+
}
|
|
4996
|
+
return label;
|
|
4997
|
+
}
|
|
4998
|
+
|
|
4999
|
+
// src/interactions/components/header.tsx
|
|
5000
|
+
var React88 = __toESM(require("react"));
|
|
5001
|
+
var import_icons25 = require("@elementor/icons");
|
|
5002
|
+
var import_ui43 = require("@elementor/ui");
|
|
5003
|
+
var Header = ({ label }) => {
|
|
5004
|
+
return /* @__PURE__ */ React88.createElement(
|
|
5005
|
+
import_ui43.Stack,
|
|
5006
|
+
{
|
|
5007
|
+
direction: "row",
|
|
5008
|
+
alignItems: "center",
|
|
5009
|
+
justifyContent: "space-between",
|
|
5010
|
+
gap: 1,
|
|
5011
|
+
sx: { marginInlineEnd: -0.75, py: 0.25 }
|
|
5012
|
+
},
|
|
5013
|
+
/* @__PURE__ */ React88.createElement(import_ui43.Typography, { component: "label", variant: "caption", color: "text.secondary", sx: { lineHeight: 1 } }, label),
|
|
5014
|
+
/* @__PURE__ */ React88.createElement(import_ui43.IconButton, { size: "tiny", disabled: true }, /* @__PURE__ */ React88.createElement(import_icons25.PlusIcon, { fontSize: "tiny" }))
|
|
5015
|
+
);
|
|
5016
|
+
};
|
|
5017
|
+
|
|
5018
|
+
// src/interactions/components/interaction-details.tsx
|
|
5019
|
+
var React94 = __toESM(require("react"));
|
|
5020
|
+
var import_react39 = require("react");
|
|
5021
|
+
var import_ui49 = require("@elementor/ui");
|
|
5022
|
+
var import_i18n66 = require("@wordpress/i18n");
|
|
5023
|
+
|
|
5024
|
+
// src/interactions/components/controls/direction.tsx
|
|
5025
|
+
var React89 = __toESM(require("react"));
|
|
5026
|
+
var import_icons26 = require("@elementor/icons");
|
|
5027
|
+
var import_ui44 = require("@elementor/ui");
|
|
5028
|
+
var import_i18n61 = require("@wordpress/i18n");
|
|
5029
|
+
function Direction({ value, onChange }) {
|
|
5030
|
+
const availableDirections = [
|
|
5031
|
+
{ key: "top", label: (0, import_i18n61.__)("Up", "elementor"), icon: /* @__PURE__ */ React89.createElement(import_icons26.ArrowUpSmallIcon, { fontSize: "tiny" }) },
|
|
5032
|
+
{ key: "bottom", label: (0, import_i18n61.__)("Down", "elementor"), icon: /* @__PURE__ */ React89.createElement(import_icons26.ArrowDownSmallIcon, { fontSize: "tiny" }) },
|
|
5033
|
+
{ key: "left", label: (0, import_i18n61.__)("Left", "elementor"), icon: /* @__PURE__ */ React89.createElement(import_icons26.ArrowLeftIcon, { fontSize: "tiny" }) },
|
|
5034
|
+
{ key: "right", label: (0, import_i18n61.__)("Right", "elementor"), icon: /* @__PURE__ */ React89.createElement(import_icons26.ArrowRightIcon, { fontSize: "tiny" }) }
|
|
5035
|
+
];
|
|
5036
|
+
return /* @__PURE__ */ React89.createElement(React89.Fragment, null, /* @__PURE__ */ React89.createElement(import_ui44.Grid, { item: true, xs: 12, md: 6 }, /* @__PURE__ */ React89.createElement(import_ui44.Typography, { variant: "caption", color: "text.secondary" }, (0, import_i18n61.__)("Direction", "elementor"))), /* @__PURE__ */ React89.createElement(import_ui44.Grid, { item: true, xs: 12, md: 6 }, /* @__PURE__ */ React89.createElement(
|
|
5037
|
+
import_ui44.ToggleButtonGroup,
|
|
4981
5038
|
{
|
|
4982
5039
|
size: "tiny",
|
|
4983
|
-
|
|
4984
|
-
|
|
5040
|
+
exclusive: true,
|
|
5041
|
+
onChange: (event, newValue) => onChange(newValue),
|
|
5042
|
+
value
|
|
4985
5043
|
},
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
5044
|
+
availableDirections.map((direction) => {
|
|
5045
|
+
return /* @__PURE__ */ React89.createElement(import_ui44.Tooltip, { key: direction.key, title: direction.label, placement: "top" }, /* @__PURE__ */ React89.createElement(import_ui44.ToggleButton, { key: direction.key, value: direction.key }, direction.icon));
|
|
5046
|
+
})
|
|
5047
|
+
)));
|
|
5048
|
+
}
|
|
5049
|
+
|
|
5050
|
+
// src/interactions/components/controls/effect.tsx
|
|
5051
|
+
var React90 = __toESM(require("react"));
|
|
5052
|
+
var import_editor_ui6 = require("@elementor/editor-ui");
|
|
5053
|
+
var import_ui45 = require("@elementor/ui");
|
|
5054
|
+
var import_i18n62 = require("@wordpress/i18n");
|
|
5055
|
+
function Effect({ value, onChange }) {
|
|
5056
|
+
const availableEffects = [
|
|
5057
|
+
{ key: "fade", label: (0, import_i18n62.__)("Fade", "elementor") },
|
|
5058
|
+
{ key: "slide", label: (0, import_i18n62.__)("Slide", "elementor") },
|
|
5059
|
+
{ key: "scale", label: (0, import_i18n62.__)("Scale", "elementor") }
|
|
5060
|
+
];
|
|
5061
|
+
return /* @__PURE__ */ React90.createElement(React90.Fragment, null, /* @__PURE__ */ React90.createElement(import_ui45.Grid, { item: true, xs: 12, md: 6 }, /* @__PURE__ */ React90.createElement(import_ui45.Typography, { variant: "caption", color: "text.secondary" }, (0, import_i18n62.__)("Effect", "elementor"))), /* @__PURE__ */ React90.createElement(import_ui45.Grid, { item: true, xs: 12, md: 6 }, /* @__PURE__ */ React90.createElement(
|
|
5062
|
+
import_ui45.Select,
|
|
4989
5063
|
{
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
5064
|
+
fullWidth: true,
|
|
5065
|
+
displayEmpty: true,
|
|
5066
|
+
size: "tiny",
|
|
5067
|
+
value,
|
|
5068
|
+
onChange: (event) => onChange(event.target.value)
|
|
5069
|
+
},
|
|
5070
|
+
availableEffects.map((effect) => {
|
|
5071
|
+
return /* @__PURE__ */ React90.createElement(import_editor_ui6.MenuListItem, { key: effect.key, value: effect.key }, effect.label);
|
|
5072
|
+
})
|
|
5073
|
+
)));
|
|
5074
|
+
}
|
|
5075
|
+
|
|
5076
|
+
// src/interactions/components/controls/effect-type.tsx
|
|
5077
|
+
var React91 = __toESM(require("react"));
|
|
5078
|
+
var import_ui46 = require("@elementor/ui");
|
|
5079
|
+
var import_i18n63 = require("@wordpress/i18n");
|
|
5080
|
+
function EffectType({ value, onChange }) {
|
|
5081
|
+
const availableEffectTypes = [
|
|
5082
|
+
{ key: "in", label: (0, import_i18n63.__)("In", "elementor") },
|
|
5083
|
+
{ key: "out", label: (0, import_i18n63.__)("Out", "elementor") }
|
|
5084
|
+
];
|
|
5085
|
+
return /* @__PURE__ */ React91.createElement(React91.Fragment, null, /* @__PURE__ */ React91.createElement(import_ui46.Grid, { item: true, xs: 12, md: 6 }, /* @__PURE__ */ React91.createElement(import_ui46.Typography, { variant: "caption", color: "text.secondary" }, (0, import_i18n63.__)("Type", "elementor"))), /* @__PURE__ */ React91.createElement(import_ui46.Grid, { item: true, xs: 12, md: 6 }, /* @__PURE__ */ React91.createElement(
|
|
5086
|
+
import_ui46.ToggleButtonGroup,
|
|
5087
|
+
{
|
|
5088
|
+
size: "tiny",
|
|
5089
|
+
exclusive: true,
|
|
5090
|
+
onChange: (event, newValue) => onChange(newValue),
|
|
5091
|
+
value
|
|
5092
|
+
},
|
|
5093
|
+
availableEffectTypes.map((effectType) => {
|
|
5094
|
+
return /* @__PURE__ */ React91.createElement(import_ui46.Tooltip, { key: effectType.key, title: effectType.label, placement: "top" }, /* @__PURE__ */ React91.createElement(import_ui46.ToggleButton, { key: effectType.key, value: effectType.key }, effectType.label));
|
|
5095
|
+
})
|
|
5096
|
+
)));
|
|
5097
|
+
}
|
|
5098
|
+
|
|
5099
|
+
// src/interactions/components/controls/time-frame-indicator.tsx
|
|
5100
|
+
var React92 = __toESM(require("react"));
|
|
5101
|
+
var import_editor_ui7 = require("@elementor/editor-ui");
|
|
5102
|
+
var import_ui47 = require("@elementor/ui");
|
|
5103
|
+
var import_i18n64 = require("@wordpress/i18n");
|
|
5104
|
+
function TimeFrameIndicator({ value, onChange, label }) {
|
|
5105
|
+
const availableTimeFrames = ["0", "100", "200", "300", "400", "500", "750", "1000", "1250", "1500"].map(
|
|
5106
|
+
(key) => ({
|
|
5107
|
+
key,
|
|
5108
|
+
// translators: %s: time in milliseconds
|
|
5109
|
+
label: (0, import_i18n64.__)("%s MS", "elementor").replace("%s", key)
|
|
5110
|
+
})
|
|
5111
|
+
);
|
|
5112
|
+
return /* @__PURE__ */ React92.createElement(React92.Fragment, null, /* @__PURE__ */ React92.createElement(import_ui47.Grid, { item: true, xs: 12, md: 6 }, /* @__PURE__ */ React92.createElement(import_ui47.Typography, { variant: "caption", color: "text.secondary" }, label)), /* @__PURE__ */ React92.createElement(import_ui47.Grid, { item: true, xs: 12, md: 6 }, /* @__PURE__ */ React92.createElement(
|
|
5113
|
+
import_ui47.Select,
|
|
5114
|
+
{
|
|
5115
|
+
fullWidth: true,
|
|
5116
|
+
displayEmpty: true,
|
|
5117
|
+
size: "tiny",
|
|
5118
|
+
value,
|
|
5119
|
+
onChange: (event) => onChange(event.target.value)
|
|
5120
|
+
},
|
|
5121
|
+
availableTimeFrames.map((timeFrame) => {
|
|
5122
|
+
return /* @__PURE__ */ React92.createElement(import_editor_ui7.MenuListItem, { key: timeFrame.key, value: timeFrame.key }, timeFrame.label);
|
|
5123
|
+
})
|
|
5124
|
+
)));
|
|
5125
|
+
}
|
|
5126
|
+
|
|
5127
|
+
// src/interactions/components/controls/trigger.tsx
|
|
5128
|
+
var React93 = __toESM(require("react"));
|
|
5129
|
+
var import_editor_ui8 = require("@elementor/editor-ui");
|
|
5130
|
+
var import_ui48 = require("@elementor/ui");
|
|
5131
|
+
var import_i18n65 = require("@wordpress/i18n");
|
|
5132
|
+
function Trigger({ value, onChange }) {
|
|
5133
|
+
const availableTriggers = Object.entries({
|
|
5134
|
+
load: (0, import_i18n65.__)("Page load", "elementor"),
|
|
5135
|
+
scrollIn: (0, import_i18n65.__)("Scroll into view", "elementor"),
|
|
5136
|
+
scrollOut: (0, import_i18n65.__)("Scroll out of view", "elementor")
|
|
5137
|
+
}).map(([key, label]) => ({
|
|
5138
|
+
key,
|
|
5139
|
+
label
|
|
5140
|
+
}));
|
|
5141
|
+
return /* @__PURE__ */ React93.createElement(React93.Fragment, null, /* @__PURE__ */ React93.createElement(import_ui48.Grid, { item: true, xs: 12, md: 6 }, /* @__PURE__ */ React93.createElement(import_ui48.Typography, { variant: "caption", color: "text.secondary" }, (0, import_i18n65.__)("Trigger", "elementor"))), /* @__PURE__ */ React93.createElement(import_ui48.Grid, { item: true, xs: 12, md: 6 }, /* @__PURE__ */ React93.createElement(
|
|
5142
|
+
import_ui48.Select,
|
|
5143
|
+
{
|
|
5144
|
+
fullWidth: true,
|
|
5145
|
+
displayEmpty: true,
|
|
5146
|
+
size: "tiny",
|
|
5147
|
+
onChange: (event) => onChange(event.target.value),
|
|
5148
|
+
value
|
|
5149
|
+
},
|
|
5150
|
+
availableTriggers.map((trigger) => {
|
|
5151
|
+
return /* @__PURE__ */ React93.createElement(import_editor_ui8.MenuListItem, { key: trigger.key, value: trigger.key }, trigger.label);
|
|
5152
|
+
})
|
|
5153
|
+
)));
|
|
5154
|
+
}
|
|
5155
|
+
|
|
5156
|
+
// src/interactions/components/interaction-details.tsx
|
|
5157
|
+
var DELIMITER = "-";
|
|
5158
|
+
var InteractionDetails = ({ interaction, onChange }) => {
|
|
5159
|
+
const [interactionDetails, setInteractionDetails] = (0, import_react39.useState)(() => {
|
|
5160
|
+
const [trigger, effect, type, direction, duration, delay] = interaction.split(DELIMITER);
|
|
5161
|
+
return {
|
|
5162
|
+
trigger: trigger || "load",
|
|
5163
|
+
effect: effect || "fade",
|
|
5164
|
+
type: type || "in",
|
|
5165
|
+
direction: direction || "",
|
|
5166
|
+
duration: duration || "300",
|
|
5167
|
+
delay: delay || "0"
|
|
5168
|
+
};
|
|
5169
|
+
});
|
|
5170
|
+
(0, import_react39.useEffect)(() => {
|
|
5171
|
+
const newValue = Object.values(interactionDetails).join(DELIMITER);
|
|
5172
|
+
onChange(newValue);
|
|
5173
|
+
}, [interactionDetails, onChange]);
|
|
5174
|
+
const handleChange = (key, value) => {
|
|
5175
|
+
setInteractionDetails((prev) => ({ ...prev, [key]: value }));
|
|
5176
|
+
};
|
|
5177
|
+
return /* @__PURE__ */ React94.createElement(React94.Fragment, null, /* @__PURE__ */ React94.createElement(import_ui49.Grid, { container: true, spacing: 2, sx: { width: "300px", p: 1 } }, /* @__PURE__ */ React94.createElement(Trigger, { value: interactionDetails.trigger, onChange: (v) => handleChange("trigger", v) })), /* @__PURE__ */ React94.createElement(import_ui49.Divider, null), /* @__PURE__ */ React94.createElement(import_ui49.Grid, { container: true, spacing: 2, sx: { width: "300px", p: 1 } }, /* @__PURE__ */ React94.createElement(Effect, { value: interactionDetails.effect, onChange: (v) => handleChange("effect", v) }), /* @__PURE__ */ React94.createElement(EffectType, { value: interactionDetails.type, onChange: (v) => handleChange("type", v) }), /* @__PURE__ */ React94.createElement(
|
|
5178
|
+
Direction,
|
|
5179
|
+
{
|
|
5180
|
+
value: interactionDetails.direction ?? "",
|
|
5181
|
+
onChange: (v) => handleChange("direction", v)
|
|
4997
5182
|
}
|
|
4998
|
-
)
|
|
5183
|
+
), /* @__PURE__ */ React94.createElement(
|
|
5184
|
+
TimeFrameIndicator,
|
|
5185
|
+
{
|
|
5186
|
+
value: interactionDetails.duration,
|
|
5187
|
+
onChange: (v) => handleChange("duration", v),
|
|
5188
|
+
label: (0, import_i18n66.__)("Duration", "elementor")
|
|
5189
|
+
}
|
|
5190
|
+
), /* @__PURE__ */ React94.createElement(
|
|
5191
|
+
TimeFrameIndicator,
|
|
5192
|
+
{
|
|
5193
|
+
value: interactionDetails.delay,
|
|
5194
|
+
onChange: (v) => handleChange("delay", v),
|
|
5195
|
+
label: (0, import_i18n66.__)("Delay", "elementor")
|
|
5196
|
+
}
|
|
5197
|
+
)));
|
|
4999
5198
|
};
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
canRemove
|
|
5199
|
+
|
|
5200
|
+
// src/interactions/components/interactions-list.tsx
|
|
5201
|
+
var PredefinedInteractionsList = ({
|
|
5202
|
+
onSelectInteraction,
|
|
5203
|
+
selectedInteraction,
|
|
5204
|
+
onDelete
|
|
5007
5205
|
}) => {
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5206
|
+
return /* @__PURE__ */ React95.createElement(import_ui50.Stack, { sx: { m: 1, p: 1.5 }, gap: 2 }, /* @__PURE__ */ React95.createElement(Header, { label: (0, import_i18n67.__)("Interactions", "elementor") }), /* @__PURE__ */ React95.createElement(
|
|
5207
|
+
InteractionsList,
|
|
5208
|
+
{
|
|
5209
|
+
onDelete: () => onDelete?.(),
|
|
5210
|
+
selectedInteraction,
|
|
5211
|
+
onSelectInteraction
|
|
5212
|
+
}
|
|
5213
|
+
));
|
|
5214
|
+
};
|
|
5215
|
+
function InteractionsList({ onSelectInteraction, selectedInteraction, defaultStateRef }) {
|
|
5216
|
+
const [interactionId, setInteractionId] = (0, import_react40.useState)(selectedInteraction);
|
|
5217
|
+
const anchorEl = (0, import_react40.useRef)(null);
|
|
5218
|
+
const popupId = (0, import_react40.useId)();
|
|
5219
|
+
const popupState = (0, import_ui50.usePopupState)({
|
|
5220
|
+
variant: "popover",
|
|
5221
|
+
popupId: `elementor-interactions-list-${popupId}`
|
|
5222
|
+
});
|
|
5223
|
+
const { openByDefault, resetDefaultOpen } = usePopupStateContext();
|
|
5224
|
+
(0, import_react40.useEffect)(() => {
|
|
5225
|
+
if (interactionId) {
|
|
5226
|
+
onSelectInteraction(interactionId);
|
|
5227
|
+
}
|
|
5228
|
+
}, [interactionId, onSelectInteraction]);
|
|
5229
|
+
(0, import_react40.useEffect)(() => {
|
|
5230
|
+
if (openByDefault && anchorEl.current) {
|
|
5231
|
+
popupState.open();
|
|
5232
|
+
resetDefaultOpen();
|
|
5233
|
+
}
|
|
5234
|
+
}, [defaultStateRef, openByDefault, popupState, resetDefaultOpen]);
|
|
5235
|
+
const displayLabel = (0, import_react40.useMemo)(() => {
|
|
5236
|
+
return formatInteractionLabel(interactionId);
|
|
5237
|
+
}, [interactionId]);
|
|
5238
|
+
return /* @__PURE__ */ React95.createElement(import_ui50.Stack, { gap: 1.5, ref: anchorEl }, /* @__PURE__ */ React95.createElement(
|
|
5239
|
+
import_ui50.UnstableTag,
|
|
5018
5240
|
{
|
|
5241
|
+
...(0, import_ui50.bindTrigger)(popupState),
|
|
5242
|
+
fullWidth: true,
|
|
5019
5243
|
variant: "outlined",
|
|
5020
5244
|
label: displayLabel,
|
|
5021
|
-
endIcon: /* @__PURE__ */ React86.createElement(import_icons24.ChevronDownIcon, { fontSize: "tiny" }),
|
|
5022
|
-
...(0, import_ui42.bindTrigger)(popoverState),
|
|
5023
|
-
fullWidth: true,
|
|
5024
5245
|
showActionsOnHover: true,
|
|
5025
|
-
|
|
5026
|
-
minHeight: (theme) => theme.spacing(3.5),
|
|
5027
|
-
...isShowingPlaceholder && {
|
|
5028
|
-
"& .MuiTag-label": {
|
|
5029
|
-
color: (theme) => theme.palette.text.tertiary
|
|
5030
|
-
}
|
|
5031
|
-
}
|
|
5032
|
-
},
|
|
5033
|
-
actions: /* @__PURE__ */ React86.createElement(React86.Fragment, null, /* @__PURE__ */ React86.createElement(import_ui42.Tooltip, { title: (0, import_i18n60.__)("Duplicate", "elementor"), placement: "top" }, /* @__PURE__ */ React86.createElement(
|
|
5034
|
-
import_ui42.IconButton,
|
|
5035
|
-
{
|
|
5036
|
-
size: "tiny",
|
|
5037
|
-
onClick: (e) => {
|
|
5038
|
-
e.stopPropagation();
|
|
5039
|
-
onDuplicate(index);
|
|
5040
|
-
},
|
|
5041
|
-
"aria-label": (0, import_i18n60.__)("Duplicate", "elementor")
|
|
5042
|
-
},
|
|
5043
|
-
/* @__PURE__ */ React86.createElement(import_icons24.CopyIcon, { fontSize: "tiny" })
|
|
5044
|
-
)), canRemove && /* @__PURE__ */ React86.createElement(import_ui42.Tooltip, { title: (0, import_i18n60.__)("Remove", "elementor"), placement: "top" }, /* @__PURE__ */ React86.createElement(
|
|
5045
|
-
import_ui42.IconButton,
|
|
5046
|
-
{
|
|
5047
|
-
size: "tiny",
|
|
5048
|
-
onClick: (e) => {
|
|
5049
|
-
e.stopPropagation();
|
|
5050
|
-
onRemove(index);
|
|
5051
|
-
},
|
|
5052
|
-
"aria-label": (0, import_i18n60.__)("Remove", "elementor"),
|
|
5053
|
-
color: "error"
|
|
5054
|
-
},
|
|
5055
|
-
/* @__PURE__ */ React86.createElement(import_icons24.CircleXIcon, { fontSize: "tiny" })
|
|
5056
|
-
)))
|
|
5246
|
+
actions: /* @__PURE__ */ React95.createElement(React95.Fragment, null, /* @__PURE__ */ React95.createElement(import_ui50.IconButton, { size: "tiny", disabled: true }, /* @__PURE__ */ React95.createElement(import_icons27.EyeIcon, { fontSize: "tiny" })), /* @__PURE__ */ React95.createElement(import_ui50.IconButton, { size: "tiny" }, /* @__PURE__ */ React95.createElement(import_icons27.XIcon, { fontSize: "tiny" })))
|
|
5057
5247
|
}
|
|
5058
|
-
), /* @__PURE__ */
|
|
5059
|
-
|
|
5248
|
+
), /* @__PURE__ */ React95.createElement(
|
|
5249
|
+
import_ui50.Popover,
|
|
5060
5250
|
{
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
sx: {
|
|
5065
|
-
mt: 0.5,
|
|
5066
|
-
minWidth: 200,
|
|
5067
|
-
maxHeight: 300,
|
|
5068
|
-
overflow: "auto"
|
|
5069
|
-
}
|
|
5070
|
-
}
|
|
5071
|
-
},
|
|
5251
|
+
...(0, import_ui50.bindPopover)(popupState),
|
|
5252
|
+
disableScrollLock: true,
|
|
5253
|
+
anchorEl: anchorEl.current,
|
|
5072
5254
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
5073
|
-
|
|
5255
|
+
transformOrigin: { vertical: "top", horizontal: "left" },
|
|
5256
|
+
PaperProps: {
|
|
5257
|
+
sx: { my: 1 }
|
|
5258
|
+
},
|
|
5259
|
+
onClose: () => {
|
|
5260
|
+
popupState.close();
|
|
5261
|
+
}
|
|
5074
5262
|
},
|
|
5075
|
-
/* @__PURE__ */
|
|
5076
|
-
|
|
5263
|
+
/* @__PURE__ */ React95.createElement(
|
|
5264
|
+
InteractionDetails,
|
|
5077
5265
|
{
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
selected: option.value === animationId,
|
|
5082
|
-
sx: {
|
|
5083
|
-
minHeight: 32,
|
|
5084
|
-
fontSize: "0.75rem",
|
|
5085
|
-
"&.Mui-selected": {
|
|
5086
|
-
backgroundColor: "action.selected"
|
|
5087
|
-
}
|
|
5088
|
-
}
|
|
5089
|
-
},
|
|
5090
|
-
/* @__PURE__ */ React86.createElement(
|
|
5091
|
-
import_ui42.ListItemText,
|
|
5092
|
-
{
|
|
5093
|
-
primary: option.label,
|
|
5094
|
-
primaryTypographyProps: {
|
|
5095
|
-
variant: "caption",
|
|
5096
|
-
color: option.value === animationId ? "primary" : "text.primary"
|
|
5097
|
-
}
|
|
5266
|
+
interaction: selectedInteraction,
|
|
5267
|
+
onChange: (newValue) => {
|
|
5268
|
+
setInteractionId(newValue);
|
|
5098
5269
|
}
|
|
5099
|
-
|
|
5100
|
-
)
|
|
5270
|
+
}
|
|
5271
|
+
)
|
|
5101
5272
|
));
|
|
5102
|
-
}
|
|
5103
|
-
|
|
5104
|
-
// src/components/interactions-sections/interactions-section.tsx
|
|
5105
|
-
var InteractionsSection = () => {
|
|
5106
|
-
return /* @__PURE__ */ React87.createElement(SectionContent, null, /* @__PURE__ */ React87.createElement(InteractionsProvider, null, /* @__PURE__ */ React87.createElement(InteractionsInput, null)));
|
|
5107
|
-
};
|
|
5273
|
+
}
|
|
5108
5274
|
|
|
5109
5275
|
// src/components/interactions-tab.tsx
|
|
5110
|
-
var EmptyState2 = ({ onCreateInteraction }) => {
|
|
5111
|
-
return /* @__PURE__ */ React88.createElement(
|
|
5112
|
-
import_ui43.Stack,
|
|
5113
|
-
{
|
|
5114
|
-
alignItems: "center",
|
|
5115
|
-
justifyContent: "center",
|
|
5116
|
-
height: "100%",
|
|
5117
|
-
color: "text.secondary",
|
|
5118
|
-
sx: { p: 2.5, pt: 8, pb: 5.5 },
|
|
5119
|
-
gap: 1.5
|
|
5120
|
-
},
|
|
5121
|
-
/* @__PURE__ */ React88.createElement(import_icons25.SwipeIcon, { fontSize: "large" }),
|
|
5122
|
-
/* @__PURE__ */ React88.createElement(import_ui43.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n61.__)("Animate elements with Interactions", "elementor")),
|
|
5123
|
-
/* @__PURE__ */ React88.createElement(import_ui43.Typography, { align: "center", variant: "caption", maxWidth: "170px" }, (0, import_i18n61.__)(
|
|
5124
|
-
"Add entrance animations and effects triggered by user interactions such as click, hover, or scroll.",
|
|
5125
|
-
"elementor"
|
|
5126
|
-
)),
|
|
5127
|
-
/* @__PURE__ */ React88.createElement(import_ui43.Button, { variant: "outlined", color: "secondary", size: "small", sx: { mt: 1 }, onClick: onCreateInteraction }, (0, import_i18n61.__)("Create an interaction", "elementor"))
|
|
5128
|
-
);
|
|
5129
|
-
};
|
|
5130
5276
|
var InteractionsTab = () => {
|
|
5131
5277
|
const { element } = useElement();
|
|
5132
|
-
const
|
|
5133
|
-
const
|
|
5134
|
-
const
|
|
5135
|
-
|
|
5136
|
-
|
|
5278
|
+
const existingInteractions = (0, import_editor_elements13.useElementInteractions)(element.id);
|
|
5279
|
+
const { triggerDefaultOpen } = usePopupStateContext();
|
|
5280
|
+
const [showInteractions, setShowInteractions] = (0, import_react41.useState)(() => {
|
|
5281
|
+
return !!JSON.parse(existingInteractions || "[]").length;
|
|
5282
|
+
});
|
|
5283
|
+
return /* @__PURE__ */ React96.createElement(import_session6.SessionStorageProvider, { prefix: element.id }, showInteractions ? /* @__PURE__ */ React96.createElement(SectionsList, null, /* @__PURE__ */ React96.createElement(InteractionsProvider, null, /* @__PURE__ */ React96.createElement(InteractionsContent, null))) : /* @__PURE__ */ React96.createElement(
|
|
5284
|
+
EmptyState2,
|
|
5285
|
+
{
|
|
5286
|
+
onCreateInteraction: () => {
|
|
5287
|
+
setShowInteractions(true);
|
|
5288
|
+
triggerDefaultOpen();
|
|
5289
|
+
}
|
|
5137
5290
|
}
|
|
5291
|
+
));
|
|
5292
|
+
};
|
|
5293
|
+
function InteractionsContent() {
|
|
5294
|
+
const { interactions, setInteractions } = useInteractionsContext();
|
|
5295
|
+
const applyInteraction = (0, import_react41.useCallback)(
|
|
5296
|
+
(interaction) => {
|
|
5297
|
+
const newInteractions = [
|
|
5298
|
+
{
|
|
5299
|
+
animation: {
|
|
5300
|
+
animation_type: "full-preset",
|
|
5301
|
+
animation_id: interaction
|
|
5302
|
+
}
|
|
5303
|
+
}
|
|
5304
|
+
];
|
|
5305
|
+
setInteractions(JSON.stringify(newInteractions));
|
|
5306
|
+
},
|
|
5307
|
+
[setInteractions]
|
|
5308
|
+
);
|
|
5309
|
+
const selectedInteraction = (0, import_react41.useMemo)(() => {
|
|
5138
5310
|
try {
|
|
5139
|
-
const parsed = JSON.parse(interactions);
|
|
5140
|
-
return
|
|
5311
|
+
const parsed = JSON.parse(interactions || "[]");
|
|
5312
|
+
return parsed[0]?.animation?.animation_id || "";
|
|
5141
5313
|
} catch {
|
|
5142
|
-
return
|
|
5314
|
+
return "";
|
|
5143
5315
|
}
|
|
5144
|
-
})
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5316
|
+
}, [interactions]);
|
|
5317
|
+
return /* @__PURE__ */ React96.createElement(SectionsList, null, /* @__PURE__ */ React96.createElement(
|
|
5318
|
+
PredefinedInteractionsList,
|
|
5319
|
+
{
|
|
5320
|
+
selectedInteraction,
|
|
5321
|
+
onSelectInteraction: applyInteraction
|
|
5322
|
+
}
|
|
5323
|
+
));
|
|
5324
|
+
}
|
|
5148
5325
|
|
|
5149
5326
|
// src/components/settings-tab.tsx
|
|
5150
|
-
var
|
|
5327
|
+
var React100 = __toESM(require("react"));
|
|
5151
5328
|
var import_editor_controls52 = require("@elementor/editor-controls");
|
|
5152
5329
|
var import_session8 = require("@elementor/session");
|
|
5153
|
-
var
|
|
5330
|
+
var import_ui52 = require("@elementor/ui");
|
|
5154
5331
|
|
|
5155
5332
|
// src/controls-registry/control.tsx
|
|
5156
|
-
var
|
|
5333
|
+
var React97 = __toESM(require("react"));
|
|
5157
5334
|
var Control = ({ props, type }) => {
|
|
5158
5335
|
const ControlByType = controlsRegistry.get(type);
|
|
5159
5336
|
const { element } = useElement();
|
|
@@ -5162,19 +5339,19 @@ var Control = ({ props, type }) => {
|
|
|
5162
5339
|
context: { controlType: type }
|
|
5163
5340
|
});
|
|
5164
5341
|
}
|
|
5165
|
-
return /* @__PURE__ */
|
|
5342
|
+
return /* @__PURE__ */ React97.createElement(ControlByType, { ...props, context: { elementId: element.id } });
|
|
5166
5343
|
};
|
|
5167
5344
|
|
|
5168
5345
|
// src/controls-registry/control-type-container.tsx
|
|
5169
|
-
var
|
|
5170
|
-
var
|
|
5346
|
+
var React98 = __toESM(require("react"));
|
|
5347
|
+
var import_ui51 = require("@elementor/ui");
|
|
5171
5348
|
var ControlTypeContainer = ({ children, layout }) => {
|
|
5172
5349
|
if (layout === "custom") {
|
|
5173
5350
|
return children;
|
|
5174
5351
|
}
|
|
5175
|
-
return /* @__PURE__ */
|
|
5352
|
+
return /* @__PURE__ */ React98.createElement(StyledContainer, { layout }, children);
|
|
5176
5353
|
};
|
|
5177
|
-
var StyledContainer = (0,
|
|
5354
|
+
var StyledContainer = (0, import_ui51.styled)(import_ui51.Box, {
|
|
5178
5355
|
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
5179
5356
|
})(({ layout, theme }) => ({
|
|
5180
5357
|
display: "grid",
|
|
@@ -5200,14 +5377,14 @@ var getStyleByLayout = (layout) => {
|
|
|
5200
5377
|
};
|
|
5201
5378
|
|
|
5202
5379
|
// src/controls-registry/settings-field.tsx
|
|
5203
|
-
var
|
|
5204
|
-
var
|
|
5380
|
+
var React99 = __toESM(require("react"));
|
|
5381
|
+
var import_react42 = require("react");
|
|
5205
5382
|
var import_editor_controls51 = require("@elementor/editor-controls");
|
|
5206
5383
|
var import_editor_documents2 = require("@elementor/editor-documents");
|
|
5207
5384
|
var import_editor_elements14 = require("@elementor/editor-elements");
|
|
5208
5385
|
var import_editor_props15 = require("@elementor/editor-props");
|
|
5209
5386
|
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
5210
|
-
var
|
|
5387
|
+
var import_i18n68 = require("@wordpress/i18n");
|
|
5211
5388
|
|
|
5212
5389
|
// src/utils/prop-dependency-utils.ts
|
|
5213
5390
|
var import_editor_props14 = require("@elementor/editor-props");
|
|
@@ -5395,13 +5572,13 @@ var SettingsField = ({ bind, children, propDisplayName }) => {
|
|
|
5395
5572
|
undoableUpdateElementProp(settings);
|
|
5396
5573
|
};
|
|
5397
5574
|
const isDisabled = (prop) => !(0, import_editor_props15.isDependencyMet)(prop?.dependencies, elementSettingValues).isMet;
|
|
5398
|
-
return /* @__PURE__ */
|
|
5575
|
+
return /* @__PURE__ */ React99.createElement(import_editor_controls51.PropProvider, { propType, value, setValue, isDisabled }, /* @__PURE__ */ React99.createElement(import_editor_controls51.PropKeyProvider, { bind }, children));
|
|
5399
5576
|
};
|
|
5400
5577
|
function useUndoableUpdateElementProp({
|
|
5401
5578
|
elementId,
|
|
5402
5579
|
propDisplayName
|
|
5403
5580
|
}) {
|
|
5404
|
-
return (0,
|
|
5581
|
+
return (0, import_react42.useMemo)(() => {
|
|
5405
5582
|
return (0, import_editor_v1_adapters5.undoable)(
|
|
5406
5583
|
{
|
|
5407
5584
|
do: (newSettings) => {
|
|
@@ -5417,7 +5594,7 @@ function useUndoableUpdateElementProp({
|
|
|
5417
5594
|
{
|
|
5418
5595
|
title: (0, import_editor_elements14.getElementLabel)(elementId),
|
|
5419
5596
|
// translators: %s is the name of the property that was edited.
|
|
5420
|
-
subtitle: (0,
|
|
5597
|
+
subtitle: (0, import_i18n68.__)("%s edited", "elementor").replace("%s", propDisplayName),
|
|
5421
5598
|
debounce: { wait: HISTORY_DEBOUNCE_WAIT2 }
|
|
5422
5599
|
}
|
|
5423
5600
|
);
|
|
@@ -5429,13 +5606,13 @@ var SettingsTab = () => {
|
|
|
5429
5606
|
const { elementType, element } = useElement();
|
|
5430
5607
|
const settingsDefault = useDefaultPanelSettings();
|
|
5431
5608
|
const isDefaultExpanded = (sectionId) => settingsDefault.defaultSectionsExpanded.settings?.includes(sectionId);
|
|
5432
|
-
return /* @__PURE__ */
|
|
5609
|
+
return /* @__PURE__ */ React100.createElement(import_session8.SessionStorageProvider, { prefix: element.id }, /* @__PURE__ */ React100.createElement(SectionsList, null, elementType.controls.map((control, index) => {
|
|
5433
5610
|
if (isControl(control)) {
|
|
5434
|
-
return /* @__PURE__ */
|
|
5611
|
+
return /* @__PURE__ */ React100.createElement(Control2, { key: getKey(control, element), control });
|
|
5435
5612
|
}
|
|
5436
5613
|
const { type, value } = control;
|
|
5437
5614
|
if (type === "section") {
|
|
5438
|
-
return /* @__PURE__ */
|
|
5615
|
+
return /* @__PURE__ */ React100.createElement(
|
|
5439
5616
|
Section,
|
|
5440
5617
|
{
|
|
5441
5618
|
title: value.label,
|
|
@@ -5444,7 +5621,7 @@ var SettingsTab = () => {
|
|
|
5444
5621
|
},
|
|
5445
5622
|
value.items?.map((item) => {
|
|
5446
5623
|
if (isControl(item)) {
|
|
5447
|
-
return /* @__PURE__ */
|
|
5624
|
+
return /* @__PURE__ */ React100.createElement(Control2, { key: getKey(item, element), control: item });
|
|
5448
5625
|
}
|
|
5449
5626
|
return null;
|
|
5450
5627
|
})
|
|
@@ -5463,16 +5640,16 @@ var Control2 = ({ control: { value, type } }) => {
|
|
|
5463
5640
|
controlProps.label = value.label;
|
|
5464
5641
|
}
|
|
5465
5642
|
if (type === "element-control") {
|
|
5466
|
-
return /* @__PURE__ */
|
|
5643
|
+
return /* @__PURE__ */ React100.createElement(ControlLayout, { control: value, layout, controlProps });
|
|
5467
5644
|
}
|
|
5468
|
-
return /* @__PURE__ */
|
|
5645
|
+
return /* @__PURE__ */ React100.createElement(SettingsField, { bind: value.bind, propDisplayName: value.label || value.bind }, /* @__PURE__ */ React100.createElement(ControlLayout, { control: value, layout, controlProps }));
|
|
5469
5646
|
};
|
|
5470
5647
|
var ControlLayout = ({
|
|
5471
5648
|
control,
|
|
5472
5649
|
layout,
|
|
5473
5650
|
controlProps
|
|
5474
5651
|
}) => {
|
|
5475
|
-
return /* @__PURE__ */
|
|
5652
|
+
return /* @__PURE__ */ React100.createElement(React100.Fragment, null, control.meta?.topDivider && /* @__PURE__ */ React100.createElement(import_ui52.Divider, null), /* @__PURE__ */ React100.createElement(ControlTypeContainer, { layout }, control.label && layout !== "custom" ? /* @__PURE__ */ React100.createElement(import_editor_controls52.ControlFormLabel, null, control.label) : null, /* @__PURE__ */ React100.createElement(Control, { type: control.type, props: controlProps })));
|
|
5476
5653
|
};
|
|
5477
5654
|
function populateChildControlProps(props) {
|
|
5478
5655
|
if (props.childControlType) {
|
|
@@ -5505,7 +5682,7 @@ var EditingPanelTabs = () => {
|
|
|
5505
5682
|
return (
|
|
5506
5683
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
5507
5684
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
5508
|
-
/* @__PURE__ */
|
|
5685
|
+
/* @__PURE__ */ React101.createElement(import_react43.Fragment, { key: element.id }, /* @__PURE__ */ React101.createElement(PanelTabContent, null))
|
|
5509
5686
|
);
|
|
5510
5687
|
};
|
|
5511
5688
|
var PanelTabContent = () => {
|
|
@@ -5513,9 +5690,9 @@ var PanelTabContent = () => {
|
|
|
5513
5690
|
const defaultComponentTab = editorDefaults.defaultTab;
|
|
5514
5691
|
const isInteractionsActive = (0, import_editor_v1_adapters6.isExperimentActive)("e_interactions");
|
|
5515
5692
|
const [currentTab, setCurrentTab] = useStateByElement("tab", defaultComponentTab);
|
|
5516
|
-
const { getTabProps, getTabPanelProps, getTabsProps } = (0,
|
|
5517
|
-
return /* @__PURE__ */
|
|
5518
|
-
|
|
5693
|
+
const { getTabProps, getTabPanelProps, getTabsProps } = (0, import_ui53.useTabs)(currentTab);
|
|
5694
|
+
return /* @__PURE__ */ React101.createElement(ScrollProvider, null, /* @__PURE__ */ React101.createElement(import_ui53.Stack, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React101.createElement(import_ui53.Stack, { sx: { ...stickyHeaderStyles, top: 0 } }, /* @__PURE__ */ React101.createElement(
|
|
5695
|
+
import_ui53.Tabs,
|
|
5519
5696
|
{
|
|
5520
5697
|
variant: "fullWidth",
|
|
5521
5698
|
size: "small",
|
|
@@ -5526,10 +5703,10 @@ var PanelTabContent = () => {
|
|
|
5526
5703
|
setCurrentTab(newValue);
|
|
5527
5704
|
}
|
|
5528
5705
|
},
|
|
5529
|
-
/* @__PURE__ */
|
|
5530
|
-
/* @__PURE__ */
|
|
5531
|
-
isInteractionsActive && /* @__PURE__ */
|
|
5532
|
-
), /* @__PURE__ */
|
|
5706
|
+
/* @__PURE__ */ React101.createElement(import_ui53.Tab, { label: (0, import_i18n69.__)("General", "elementor"), ...getTabProps("settings") }),
|
|
5707
|
+
/* @__PURE__ */ React101.createElement(import_ui53.Tab, { label: (0, import_i18n69.__)("Style", "elementor"), ...getTabProps("style") }),
|
|
5708
|
+
isInteractionsActive && /* @__PURE__ */ React101.createElement(import_ui53.Tab, { label: (0, import_i18n69.__)("Interactions", "elementor"), ...getTabProps("interactions") })
|
|
5709
|
+
), /* @__PURE__ */ React101.createElement(import_ui53.Divider, null)), /* @__PURE__ */ React101.createElement(import_ui53.TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React101.createElement(SettingsTab, null)), /* @__PURE__ */ React101.createElement(import_ui53.TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React101.createElement(StyleTab, null)), isInteractionsActive && /* @__PURE__ */ React101.createElement(import_ui53.TabPanel, { ...getTabPanelProps("interactions"), disablePadding: true }, /* @__PURE__ */ React101.createElement(PopupStateProvider, null, /* @__PURE__ */ React101.createElement(InteractionsTab, null)))));
|
|
5533
5710
|
};
|
|
5534
5711
|
|
|
5535
5712
|
// src/components/editing-panel.tsx
|
|
@@ -5541,8 +5718,8 @@ var EditingPanel = () => {
|
|
|
5541
5718
|
if (!element || !elementType) {
|
|
5542
5719
|
return null;
|
|
5543
5720
|
}
|
|
5544
|
-
const panelTitle = (0,
|
|
5545
|
-
return /* @__PURE__ */
|
|
5721
|
+
const panelTitle = (0, import_i18n70.__)("Edit %s", "elementor").replace("%s", elementType.title);
|
|
5722
|
+
return /* @__PURE__ */ React102.createElement(import_ui54.ErrorBoundary, { fallback: /* @__PURE__ */ React102.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React102.createElement(import_session9.SessionStorageProvider, { prefix: "elementor" }, /* @__PURE__ */ React102.createElement(import_editor_ui9.ThemeProvider, null, /* @__PURE__ */ React102.createElement(import_editor_panels.Panel, null, /* @__PURE__ */ React102.createElement(import_editor_panels.PanelHeader, null, /* @__PURE__ */ React102.createElement(import_editor_panels.PanelHeaderTitle, null, panelTitle), /* @__PURE__ */ React102.createElement(import_icons28.AtomIcon, { fontSize: "small", sx: { color: "text.tertiary" } })), /* @__PURE__ */ React102.createElement(import_editor_panels.PanelBody, null, /* @__PURE__ */ React102.createElement(import_editor_controls53.ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React102.createElement(import_editor_controls53.ControlReplacementsProvider, { replacements: controlReplacements }, /* @__PURE__ */ React102.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React102.createElement(EditingPanelTabs, null)))))))));
|
|
5546
5723
|
};
|
|
5547
5724
|
|
|
5548
5725
|
// src/panel.ts
|
|
@@ -5565,7 +5742,7 @@ var isAtomicWidgetSelected = () => {
|
|
|
5565
5742
|
// src/hooks/use-open-editor-panel.ts
|
|
5566
5743
|
var useOpenEditorPanel = () => {
|
|
5567
5744
|
const { open } = usePanelActions();
|
|
5568
|
-
(0,
|
|
5745
|
+
(0, import_react44.useEffect)(() => {
|
|
5569
5746
|
return (0, import_editor_v1_adapters7.__privateListenTo)((0, import_editor_v1_adapters7.commandStartEvent)("panel/editor/open"), () => {
|
|
5570
5747
|
if (isAtomicWidgetSelected()) {
|
|
5571
5748
|
open();
|
|
@@ -5581,13 +5758,13 @@ var EditingPanelHooks = () => {
|
|
|
5581
5758
|
};
|
|
5582
5759
|
|
|
5583
5760
|
// src/controls-registry/element-controls/tabs-control/tabs-control.tsx
|
|
5584
|
-
var
|
|
5761
|
+
var React103 = __toESM(require("react"));
|
|
5585
5762
|
var import_editor_controls54 = require("@elementor/editor-controls");
|
|
5586
5763
|
var import_editor_elements19 = require("@elementor/editor-elements");
|
|
5587
5764
|
var import_editor_props17 = require("@elementor/editor-props");
|
|
5588
|
-
var
|
|
5589
|
-
var
|
|
5590
|
-
var
|
|
5765
|
+
var import_icons29 = require("@elementor/icons");
|
|
5766
|
+
var import_ui55 = require("@elementor/ui");
|
|
5767
|
+
var import_i18n72 = require("@wordpress/i18n");
|
|
5591
5768
|
|
|
5592
5769
|
// src/controls-registry/element-controls/get-element-by-type.ts
|
|
5593
5770
|
var import_editor_elements17 = require("@elementor/editor-elements");
|
|
@@ -5609,7 +5786,7 @@ var getElementByType = (elementId, type) => {
|
|
|
5609
5786
|
// src/controls-registry/element-controls/tabs-control/actions.ts
|
|
5610
5787
|
var import_editor_elements18 = require("@elementor/editor-elements");
|
|
5611
5788
|
var import_editor_props16 = require("@elementor/editor-props");
|
|
5612
|
-
var
|
|
5789
|
+
var import_i18n71 = require("@wordpress/i18n");
|
|
5613
5790
|
var TAB_ELEMENT_TYPE = "e-tab";
|
|
5614
5791
|
var TAB_CONTENT_ELEMENT_TYPE = "e-tab-content";
|
|
5615
5792
|
var duplicateItem = ({ items: items3 }) => {
|
|
@@ -5621,7 +5798,7 @@ var duplicateItem = ({ items: items3 }) => {
|
|
|
5621
5798
|
}
|
|
5622
5799
|
(0, import_editor_elements18.duplicateElements)({
|
|
5623
5800
|
elementIds: [tabId, tabContentId],
|
|
5624
|
-
title: (0,
|
|
5801
|
+
title: (0, import_i18n71.__)("Duplicate Tab", "elementor"),
|
|
5625
5802
|
onCreate: (duplicatedElements) => {
|
|
5626
5803
|
const tab = duplicatedElements.find((element) => element.originalElementId === tabId);
|
|
5627
5804
|
const tabContent = duplicatedElements.find((element) => element.originalElementId === tabContentId);
|
|
@@ -5656,7 +5833,7 @@ var moveItem = ({
|
|
|
5656
5833
|
throw new Error("Required tab elements not found for reordering");
|
|
5657
5834
|
}
|
|
5658
5835
|
(0, import_editor_elements18.moveElements)({
|
|
5659
|
-
title: (0,
|
|
5836
|
+
title: (0, import_i18n71.__)("Reorder Tabs", "elementor"),
|
|
5660
5837
|
moves: [
|
|
5661
5838
|
{
|
|
5662
5839
|
elementId: movedElementId,
|
|
@@ -5673,7 +5850,7 @@ var moveItem = ({
|
|
|
5673
5850
|
};
|
|
5674
5851
|
var removeItem = ({ items: items3 }) => {
|
|
5675
5852
|
(0, import_editor_elements18.removeElements)({
|
|
5676
|
-
title: (0,
|
|
5853
|
+
title: (0, import_i18n71.__)("Tabs", "elementor"),
|
|
5677
5854
|
elementIds: items3.flatMap(({ item }) => {
|
|
5678
5855
|
const tabId = item.id;
|
|
5679
5856
|
const { value: tabContentId } = (0, import_editor_elements18.getElementSetting)(tabId, "tab-content-id") ?? {};
|
|
@@ -5693,7 +5870,7 @@ var addItem = ({
|
|
|
5693
5870
|
const newTabContentId = (0, import_editor_elements18.generateElementId)();
|
|
5694
5871
|
const newTabId = (0, import_editor_elements18.generateElementId)();
|
|
5695
5872
|
(0, import_editor_elements18.createElements)({
|
|
5696
|
-
title: (0,
|
|
5873
|
+
title: (0, import_i18n71.__)("Tabs", "elementor"),
|
|
5697
5874
|
elements: [
|
|
5698
5875
|
{
|
|
5699
5876
|
containerId: tabContentAreaId,
|
|
@@ -5764,7 +5941,7 @@ var TabsControl = ({ label }) => {
|
|
|
5764
5941
|
});
|
|
5765
5942
|
}
|
|
5766
5943
|
};
|
|
5767
|
-
return /* @__PURE__ */
|
|
5944
|
+
return /* @__PURE__ */ React103.createElement(
|
|
5768
5945
|
import_editor_controls54.Repeater,
|
|
5769
5946
|
{
|
|
5770
5947
|
addToBottom: true,
|
|
@@ -5786,7 +5963,7 @@ var ItemLabel = ({ value }) => {
|
|
|
5786
5963
|
const id = value.id ?? "";
|
|
5787
5964
|
const editorSettings = (0, import_editor_elements19.useElementEditorSettings)(id);
|
|
5788
5965
|
const elementTitle = editorSettings?.title;
|
|
5789
|
-
return /* @__PURE__ */
|
|
5966
|
+
return /* @__PURE__ */ React103.createElement(import_ui55.Stack, { sx: { minHeight: 20 }, direction: "row", alignItems: "center", gap: 1.5 }, /* @__PURE__ */ React103.createElement("span", null, elementTitle), /* @__PURE__ */ React103.createElement(SettingsField, { bind: "default-active-tab", propDisplayName: (0, import_i18n72.__)("Tabs", "elementor") }, /* @__PURE__ */ React103.createElement(ItemDefaultTab, { value })));
|
|
5790
5967
|
};
|
|
5791
5968
|
var ItemDefaultTab = ({ value }) => {
|
|
5792
5969
|
const id = value.id ?? "";
|
|
@@ -5795,19 +5972,19 @@ var ItemDefaultTab = ({ value }) => {
|
|
|
5795
5972
|
if (!isDefault) {
|
|
5796
5973
|
return null;
|
|
5797
5974
|
}
|
|
5798
|
-
return /* @__PURE__ */
|
|
5975
|
+
return /* @__PURE__ */ React103.createElement(import_ui55.Chip, { size: "tiny", shape: "rounded", label: (0, import_i18n72.__)("Default", "elementor") });
|
|
5799
5976
|
};
|
|
5800
5977
|
var ItemContent = ({ value }) => {
|
|
5801
5978
|
if (!value.id) {
|
|
5802
5979
|
return null;
|
|
5803
5980
|
}
|
|
5804
|
-
return /* @__PURE__ */
|
|
5981
|
+
return /* @__PURE__ */ React103.createElement(import_ui55.Stack, { p: 2, gap: 1.5 }, /* @__PURE__ */ React103.createElement(TabLabelControl, { elementId: value.id }), /* @__PURE__ */ React103.createElement(SettingsField, { bind: "default-active-tab", propDisplayName: (0, import_i18n72.__)("Tabs", "elementor") }, /* @__PURE__ */ React103.createElement(DefaultTabControl, { elementId: value.id })));
|
|
5805
5982
|
};
|
|
5806
5983
|
var DefaultTabControl = ({ elementId }) => {
|
|
5807
5984
|
const { value, setValue } = (0, import_editor_controls54.useBoundProp)(import_editor_props17.stringPropTypeUtil);
|
|
5808
5985
|
const isDefault = value === elementId;
|
|
5809
|
-
return /* @__PURE__ */
|
|
5810
|
-
|
|
5986
|
+
return /* @__PURE__ */ React103.createElement(import_ui55.Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 2 }, /* @__PURE__ */ React103.createElement(import_editor_controls54.ControlFormLabel, null, (0, import_i18n72.__)("Set as default tab", "elementor")), /* @__PURE__ */ React103.createElement(ConditionalTooltip, { showTooltip: isDefault, placement: "right" }, /* @__PURE__ */ React103.createElement(
|
|
5987
|
+
import_ui55.Switch,
|
|
5811
5988
|
{
|
|
5812
5989
|
size: "small",
|
|
5813
5990
|
checked: isDefault,
|
|
@@ -5824,8 +6001,8 @@ var DefaultTabControl = ({ elementId }) => {
|
|
|
5824
6001
|
var TabLabelControl = ({ elementId }) => {
|
|
5825
6002
|
const editorSettings = (0, import_editor_elements19.useElementEditorSettings)(elementId);
|
|
5826
6003
|
const label = editorSettings?.title ?? "";
|
|
5827
|
-
return /* @__PURE__ */
|
|
5828
|
-
|
|
6004
|
+
return /* @__PURE__ */ React103.createElement(import_ui55.Stack, { gap: 1 }, /* @__PURE__ */ React103.createElement(import_editor_controls54.ControlFormLabel, null, (0, import_i18n72.__)("Tab name", "elementor")), /* @__PURE__ */ React103.createElement(
|
|
6005
|
+
import_ui55.TextField,
|
|
5829
6006
|
{
|
|
5830
6007
|
size: "tiny",
|
|
5831
6008
|
value: label,
|
|
@@ -5845,22 +6022,22 @@ var ConditionalTooltip = ({
|
|
|
5845
6022
|
if (!showTooltip) {
|
|
5846
6023
|
return children;
|
|
5847
6024
|
}
|
|
5848
|
-
return /* @__PURE__ */
|
|
5849
|
-
|
|
6025
|
+
return /* @__PURE__ */ React103.createElement(
|
|
6026
|
+
import_ui55.Infotip,
|
|
5850
6027
|
{
|
|
5851
6028
|
arrow: false,
|
|
5852
|
-
content: /* @__PURE__ */
|
|
5853
|
-
|
|
6029
|
+
content: /* @__PURE__ */ React103.createElement(
|
|
6030
|
+
import_ui55.Alert,
|
|
5854
6031
|
{
|
|
5855
6032
|
color: "secondary",
|
|
5856
|
-
icon: /* @__PURE__ */
|
|
6033
|
+
icon: /* @__PURE__ */ React103.createElement(import_icons29.InfoCircleFilledIcon, { fontSize: "tiny" }),
|
|
5857
6034
|
size: "small",
|
|
5858
6035
|
sx: { width: 288 }
|
|
5859
6036
|
},
|
|
5860
|
-
/* @__PURE__ */
|
|
6037
|
+
/* @__PURE__ */ React103.createElement(import_ui55.Typography, { variant: "body2" }, (0, import_i18n72.__)("To change the default tab, simply set another tab as default.", "elementor"))
|
|
5861
6038
|
)
|
|
5862
6039
|
},
|
|
5863
|
-
/* @__PURE__ */
|
|
6040
|
+
/* @__PURE__ */ React103.createElement("span", null, children)
|
|
5864
6041
|
);
|
|
5865
6042
|
};
|
|
5866
6043
|
|
|
@@ -5881,16 +6058,16 @@ var import_editor_canvas5 = require("@elementor/editor-canvas");
|
|
|
5881
6058
|
var import_editor_controls61 = require("@elementor/editor-controls");
|
|
5882
6059
|
|
|
5883
6060
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
5884
|
-
var
|
|
6061
|
+
var React104 = __toESM(require("react"));
|
|
5885
6062
|
var import_editor_controls56 = require("@elementor/editor-controls");
|
|
5886
6063
|
var import_editor_props19 = require("@elementor/editor-props");
|
|
5887
|
-
var
|
|
6064
|
+
var import_icons30 = require("@elementor/icons");
|
|
5888
6065
|
|
|
5889
6066
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
5890
|
-
var
|
|
6067
|
+
var import_react46 = require("react");
|
|
5891
6068
|
|
|
5892
6069
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
5893
|
-
var
|
|
6070
|
+
var import_react45 = require("react");
|
|
5894
6071
|
var import_editor_controls55 = require("@elementor/editor-controls");
|
|
5895
6072
|
|
|
5896
6073
|
// src/dynamics/sync/get-elementor-config.ts
|
|
@@ -5942,7 +6119,7 @@ var usePropDynamicTags = () => {
|
|
|
5942
6119
|
const propDynamicType = getDynamicPropType(propType);
|
|
5943
6120
|
categories = propDynamicType?.settings.categories || [];
|
|
5944
6121
|
}
|
|
5945
|
-
return (0,
|
|
6122
|
+
return (0, import_react45.useMemo)(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
5946
6123
|
};
|
|
5947
6124
|
var getDynamicTagsByCategories = (categories) => {
|
|
5948
6125
|
const { tags, groups } = getAtomicDynamicTags() || {};
|
|
@@ -5972,33 +6149,33 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
5972
6149
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
5973
6150
|
var useDynamicTag = (tagName) => {
|
|
5974
6151
|
const dynamicTags = usePropDynamicTags();
|
|
5975
|
-
return (0,
|
|
6152
|
+
return (0, import_react46.useMemo)(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
5976
6153
|
};
|
|
5977
6154
|
|
|
5978
6155
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
5979
|
-
var BackgroundControlDynamicTagIcon = () => /* @__PURE__ */
|
|
6156
|
+
var BackgroundControlDynamicTagIcon = () => /* @__PURE__ */ React104.createElement(import_icons30.DatabaseIcon, { fontSize: "tiny" });
|
|
5980
6157
|
var BackgroundControlDynamicTagLabel = ({ value }) => {
|
|
5981
6158
|
const context = (0, import_editor_controls56.useBoundProp)(import_editor_props19.backgroundImageOverlayPropTypeUtil);
|
|
5982
|
-
return /* @__PURE__ */
|
|
6159
|
+
return /* @__PURE__ */ React104.createElement(import_editor_controls56.PropProvider, { ...context, value: value.value }, /* @__PURE__ */ React104.createElement(import_editor_controls56.PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React104.createElement(Wrapper, { rawValue: value.value })));
|
|
5983
6160
|
};
|
|
5984
6161
|
var Wrapper = ({ rawValue }) => {
|
|
5985
6162
|
const { propType } = (0, import_editor_controls56.useBoundProp)();
|
|
5986
6163
|
const imageOverlayPropType = propType.prop_types["background-image-overlay"];
|
|
5987
|
-
return /* @__PURE__ */
|
|
6164
|
+
return /* @__PURE__ */ React104.createElement(import_editor_controls56.PropProvider, { propType: imageOverlayPropType.shape.image, value: rawValue, setValue: () => void 0 }, /* @__PURE__ */ React104.createElement(import_editor_controls56.PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React104.createElement(Content, { rawValue: rawValue.image })));
|
|
5988
6165
|
};
|
|
5989
6166
|
var Content = ({ rawValue }) => {
|
|
5990
6167
|
const src = rawValue.value.src;
|
|
5991
6168
|
const dynamicTag = useDynamicTag(src.value.name || "");
|
|
5992
|
-
return /* @__PURE__ */
|
|
6169
|
+
return /* @__PURE__ */ React104.createElement(React104.Fragment, null, dynamicTag?.label);
|
|
5993
6170
|
};
|
|
5994
6171
|
|
|
5995
6172
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
5996
|
-
var
|
|
6173
|
+
var React108 = __toESM(require("react"));
|
|
5997
6174
|
var import_editor_controls59 = require("@elementor/editor-controls");
|
|
5998
|
-
var
|
|
5999
|
-
var
|
|
6000
|
-
var
|
|
6001
|
-
var
|
|
6175
|
+
var import_editor_ui11 = require("@elementor/editor-ui");
|
|
6176
|
+
var import_icons32 = require("@elementor/icons");
|
|
6177
|
+
var import_ui57 = require("@elementor/ui");
|
|
6178
|
+
var import_i18n74 = require("@wordpress/i18n");
|
|
6002
6179
|
|
|
6003
6180
|
// src/hooks/use-persist-dynamic-value.ts
|
|
6004
6181
|
var import_session10 = require("@elementor/session");
|
|
@@ -6009,11 +6186,11 @@ var usePersistDynamicValue = (propKey) => {
|
|
|
6009
6186
|
};
|
|
6010
6187
|
|
|
6011
6188
|
// src/dynamics/dynamic-control.tsx
|
|
6012
|
-
var
|
|
6189
|
+
var React106 = __toESM(require("react"));
|
|
6013
6190
|
var import_editor_controls57 = require("@elementor/editor-controls");
|
|
6014
6191
|
|
|
6015
6192
|
// src/dynamics/components/dynamic-conditional-control.tsx
|
|
6016
|
-
var
|
|
6193
|
+
var React105 = __toESM(require("react"));
|
|
6017
6194
|
var import_editor_props20 = require("@elementor/editor-props");
|
|
6018
6195
|
var DynamicConditionalControl = ({
|
|
6019
6196
|
children,
|
|
@@ -6021,7 +6198,7 @@ var DynamicConditionalControl = ({
|
|
|
6021
6198
|
propsSchema,
|
|
6022
6199
|
dynamicSettings
|
|
6023
6200
|
}) => {
|
|
6024
|
-
const defaults =
|
|
6201
|
+
const defaults = React105.useMemo(() => {
|
|
6025
6202
|
if (!propsSchema) {
|
|
6026
6203
|
return {};
|
|
6027
6204
|
}
|
|
@@ -6031,7 +6208,7 @@ var DynamicConditionalControl = ({
|
|
|
6031
6208
|
return result;
|
|
6032
6209
|
}, {});
|
|
6033
6210
|
}, [propsSchema]);
|
|
6034
|
-
const convertedSettings =
|
|
6211
|
+
const convertedSettings = React105.useMemo(() => {
|
|
6035
6212
|
if (!dynamicSettings) {
|
|
6036
6213
|
return {};
|
|
6037
6214
|
}
|
|
@@ -6050,14 +6227,14 @@ var DynamicConditionalControl = ({
|
|
|
6050
6227
|
{}
|
|
6051
6228
|
);
|
|
6052
6229
|
}, [dynamicSettings]);
|
|
6053
|
-
const effectiveSettings =
|
|
6230
|
+
const effectiveSettings = React105.useMemo(() => {
|
|
6054
6231
|
return { ...defaults, ...convertedSettings };
|
|
6055
6232
|
}, [defaults, convertedSettings]);
|
|
6056
6233
|
if (!propType?.dependencies?.terms.length) {
|
|
6057
|
-
return /* @__PURE__ */
|
|
6234
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, children);
|
|
6058
6235
|
}
|
|
6059
6236
|
const isHidden = !(0, import_editor_props20.isDependencyMet)(propType?.dependencies, effectiveSettings).isMet;
|
|
6060
|
-
return isHidden ? null : /* @__PURE__ */
|
|
6237
|
+
return isHidden ? null : /* @__PURE__ */ React105.createElement(React105.Fragment, null, children);
|
|
6061
6238
|
};
|
|
6062
6239
|
|
|
6063
6240
|
// src/dynamics/dynamic-control.tsx
|
|
@@ -6081,7 +6258,7 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
6081
6258
|
});
|
|
6082
6259
|
};
|
|
6083
6260
|
const propType = createTopLevelObjectType({ schema: dynamicTag.props_schema });
|
|
6084
|
-
return /* @__PURE__ */
|
|
6261
|
+
return /* @__PURE__ */ React106.createElement(import_editor_controls57.PropProvider, { propType, setValue: setDynamicValue, value: { [bind]: dynamicValue } }, /* @__PURE__ */ React106.createElement(import_editor_controls57.PropKeyProvider, { bind }, /* @__PURE__ */ React106.createElement(
|
|
6085
6262
|
DynamicConditionalControl,
|
|
6086
6263
|
{
|
|
6087
6264
|
propType: dynamicPropType,
|
|
@@ -6093,18 +6270,18 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
6093
6270
|
};
|
|
6094
6271
|
|
|
6095
6272
|
// src/dynamics/components/dynamic-selection.tsx
|
|
6096
|
-
var
|
|
6097
|
-
var
|
|
6273
|
+
var import_react47 = require("react");
|
|
6274
|
+
var React107 = __toESM(require("react"));
|
|
6098
6275
|
var import_editor_controls58 = require("@elementor/editor-controls");
|
|
6099
|
-
var
|
|
6100
|
-
var
|
|
6101
|
-
var
|
|
6102
|
-
var
|
|
6276
|
+
var import_editor_ui10 = require("@elementor/editor-ui");
|
|
6277
|
+
var import_icons31 = require("@elementor/icons");
|
|
6278
|
+
var import_ui56 = require("@elementor/ui");
|
|
6279
|
+
var import_i18n73 = require("@wordpress/i18n");
|
|
6103
6280
|
var SIZE6 = "tiny";
|
|
6104
6281
|
var DynamicSelection = ({ close: closePopover }) => {
|
|
6105
|
-
const [searchValue, setSearchValue] = (0,
|
|
6282
|
+
const [searchValue, setSearchValue] = (0, import_react47.useState)("");
|
|
6106
6283
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
6107
|
-
const theme = (0,
|
|
6284
|
+
const theme = (0, import_ui56.useTheme)();
|
|
6108
6285
|
const { value: anyValue } = (0, import_editor_controls58.useBoundProp)();
|
|
6109
6286
|
const { bind, value: dynamicValue, setValue } = (0, import_editor_controls58.useBoundProp)(dynamicPropTypeUtil);
|
|
6110
6287
|
const [, updatePropValueHistory] = usePersistDynamicValue(bind);
|
|
@@ -6134,34 +6311,34 @@ var DynamicSelection = ({ close: closePopover }) => {
|
|
|
6134
6311
|
label: item.label
|
|
6135
6312
|
}))
|
|
6136
6313
|
]);
|
|
6137
|
-
return /* @__PURE__ */
|
|
6138
|
-
|
|
6314
|
+
return /* @__PURE__ */ React107.createElement(PopoverBody, { "aria-label": (0, import_i18n73.__)("Dynamic tags", "elementor") }, /* @__PURE__ */ React107.createElement(
|
|
6315
|
+
import_editor_ui10.PopoverHeader,
|
|
6139
6316
|
{
|
|
6140
|
-
title: (0,
|
|
6317
|
+
title: (0, import_i18n73.__)("Dynamic tags", "elementor"),
|
|
6141
6318
|
onClose: closePopover,
|
|
6142
|
-
icon: /* @__PURE__ */
|
|
6319
|
+
icon: /* @__PURE__ */ React107.createElement(import_icons31.DatabaseIcon, { fontSize: SIZE6 })
|
|
6143
6320
|
}
|
|
6144
|
-
), hasNoDynamicTags ? /* @__PURE__ */
|
|
6145
|
-
|
|
6321
|
+
), hasNoDynamicTags ? /* @__PURE__ */ React107.createElement(NoDynamicTags, null) : /* @__PURE__ */ React107.createElement(import_react47.Fragment, null, /* @__PURE__ */ React107.createElement(
|
|
6322
|
+
import_editor_ui10.SearchField,
|
|
6146
6323
|
{
|
|
6147
6324
|
value: searchValue,
|
|
6148
6325
|
onSearch: handleSearch,
|
|
6149
|
-
placeholder: (0,
|
|
6326
|
+
placeholder: (0, import_i18n73.__)("Search dynamic tags\u2026", "elementor")
|
|
6150
6327
|
}
|
|
6151
|
-
), /* @__PURE__ */
|
|
6152
|
-
|
|
6328
|
+
), /* @__PURE__ */ React107.createElement(import_ui56.Divider, null), /* @__PURE__ */ React107.createElement(
|
|
6329
|
+
import_editor_ui10.PopoverMenuList,
|
|
6153
6330
|
{
|
|
6154
6331
|
items: virtualizedItems,
|
|
6155
6332
|
onSelect: handleSetDynamicTag,
|
|
6156
6333
|
onClose: closePopover,
|
|
6157
6334
|
selectedValue: dynamicValue?.name,
|
|
6158
6335
|
itemStyle: (item) => item.type === "item" ? { paddingInlineStart: theme.spacing(3.5) } : {},
|
|
6159
|
-
noResultsComponent: /* @__PURE__ */
|
|
6336
|
+
noResultsComponent: /* @__PURE__ */ React107.createElement(NoResults, { searchValue, onClear: () => setSearchValue("") })
|
|
6160
6337
|
}
|
|
6161
6338
|
)));
|
|
6162
6339
|
};
|
|
6163
|
-
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */
|
|
6164
|
-
|
|
6340
|
+
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React107.createElement(
|
|
6341
|
+
import_ui56.Stack,
|
|
6165
6342
|
{
|
|
6166
6343
|
gap: 1,
|
|
6167
6344
|
alignItems: "center",
|
|
@@ -6171,12 +6348,12 @@ var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React99.createElem
|
|
|
6171
6348
|
color: "text.secondary",
|
|
6172
6349
|
sx: { pb: 3.5 }
|
|
6173
6350
|
},
|
|
6174
|
-
/* @__PURE__ */
|
|
6175
|
-
/* @__PURE__ */
|
|
6176
|
-
/* @__PURE__ */
|
|
6351
|
+
/* @__PURE__ */ React107.createElement(import_icons31.DatabaseIcon, { fontSize: "large" }),
|
|
6352
|
+
/* @__PURE__ */ React107.createElement(import_ui56.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n73.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React107.createElement("br", null), "\u201C", searchValue, "\u201D."),
|
|
6353
|
+
/* @__PURE__ */ React107.createElement(import_ui56.Typography, { align: "center", variant: "caption", sx: { display: "flex", flexDirection: "column" } }, (0, import_i18n73.__)("Try something else.", "elementor"), /* @__PURE__ */ React107.createElement(import_ui56.Link, { color: "text.secondary", variant: "caption", component: "button", onClick: onClear }, (0, import_i18n73.__)("Clear & try again", "elementor")))
|
|
6177
6354
|
);
|
|
6178
|
-
var NoDynamicTags = () => /* @__PURE__ */
|
|
6179
|
-
|
|
6355
|
+
var NoDynamicTags = () => /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(import_ui56.Divider, null), /* @__PURE__ */ React107.createElement(
|
|
6356
|
+
import_ui56.Stack,
|
|
6180
6357
|
{
|
|
6181
6358
|
gap: 1,
|
|
6182
6359
|
alignItems: "center",
|
|
@@ -6186,9 +6363,9 @@ var NoDynamicTags = () => /* @__PURE__ */ React99.createElement(React99.Fragment
|
|
|
6186
6363
|
color: "text.secondary",
|
|
6187
6364
|
sx: { pb: 3.5 }
|
|
6188
6365
|
},
|
|
6189
|
-
/* @__PURE__ */
|
|
6190
|
-
/* @__PURE__ */
|
|
6191
|
-
/* @__PURE__ */
|
|
6366
|
+
/* @__PURE__ */ React107.createElement(import_icons31.DatabaseIcon, { fontSize: "large" }),
|
|
6367
|
+
/* @__PURE__ */ React107.createElement(import_ui56.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n73.__)("Streamline your workflow with dynamic tags", "elementor")),
|
|
6368
|
+
/* @__PURE__ */ React107.createElement(import_ui56.Typography, { align: "center", variant: "caption" }, (0, import_i18n73.__)("You'll need Elementor Pro to use this feature.", "elementor"))
|
|
6192
6369
|
));
|
|
6193
6370
|
var useFilteredOptions = (searchValue) => {
|
|
6194
6371
|
const dynamicTags = usePropDynamicTags();
|
|
@@ -6213,7 +6390,7 @@ var DynamicSelectionControl = () => {
|
|
|
6213
6390
|
const { setValue: setAnyValue } = (0, import_editor_controls59.useBoundProp)();
|
|
6214
6391
|
const { bind, value } = (0, import_editor_controls59.useBoundProp)(dynamicPropTypeUtil);
|
|
6215
6392
|
const [propValueFromHistory] = usePersistDynamicValue(bind);
|
|
6216
|
-
const selectionPopoverState = (0,
|
|
6393
|
+
const selectionPopoverState = (0, import_ui57.usePopupState)({ variant: "popover" });
|
|
6217
6394
|
const { name: tagName = "" } = value;
|
|
6218
6395
|
const dynamicTag = useDynamicTag(tagName);
|
|
6219
6396
|
const removeDynamicTag = () => {
|
|
@@ -6222,26 +6399,26 @@ var DynamicSelectionControl = () => {
|
|
|
6222
6399
|
if (!dynamicTag) {
|
|
6223
6400
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
6224
6401
|
}
|
|
6225
|
-
return /* @__PURE__ */
|
|
6226
|
-
|
|
6402
|
+
return /* @__PURE__ */ React108.createElement(import_ui57.Box, null, /* @__PURE__ */ React108.createElement(
|
|
6403
|
+
import_ui57.UnstableTag,
|
|
6227
6404
|
{
|
|
6228
6405
|
fullWidth: true,
|
|
6229
6406
|
showActionsOnHover: true,
|
|
6230
6407
|
label: dynamicTag.label,
|
|
6231
|
-
startIcon: /* @__PURE__ */
|
|
6232
|
-
...(0,
|
|
6233
|
-
actions: /* @__PURE__ */
|
|
6234
|
-
|
|
6408
|
+
startIcon: /* @__PURE__ */ React108.createElement(import_icons32.DatabaseIcon, { fontSize: SIZE7 }),
|
|
6409
|
+
...(0, import_ui57.bindTrigger)(selectionPopoverState),
|
|
6410
|
+
actions: /* @__PURE__ */ React108.createElement(React108.Fragment, null, /* @__PURE__ */ React108.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React108.createElement(
|
|
6411
|
+
import_ui57.IconButton,
|
|
6235
6412
|
{
|
|
6236
6413
|
size: SIZE7,
|
|
6237
6414
|
onClick: removeDynamicTag,
|
|
6238
|
-
"aria-label": (0,
|
|
6415
|
+
"aria-label": (0, import_i18n74.__)("Remove dynamic value", "elementor")
|
|
6239
6416
|
},
|
|
6240
|
-
/* @__PURE__ */
|
|
6417
|
+
/* @__PURE__ */ React108.createElement(import_icons32.XIcon, { fontSize: SIZE7 })
|
|
6241
6418
|
))
|
|
6242
6419
|
}
|
|
6243
|
-
), /* @__PURE__ */
|
|
6244
|
-
|
|
6420
|
+
), /* @__PURE__ */ React108.createElement(
|
|
6421
|
+
import_ui57.Popover,
|
|
6245
6422
|
{
|
|
6246
6423
|
disablePortal: true,
|
|
6247
6424
|
disableScrollLock: true,
|
|
@@ -6250,27 +6427,27 @@ var DynamicSelectionControl = () => {
|
|
|
6250
6427
|
PaperProps: {
|
|
6251
6428
|
sx: { my: 1 }
|
|
6252
6429
|
},
|
|
6253
|
-
...(0,
|
|
6430
|
+
...(0, import_ui57.bindPopover)(selectionPopoverState)
|
|
6254
6431
|
},
|
|
6255
|
-
/* @__PURE__ */
|
|
6432
|
+
/* @__PURE__ */ React108.createElement(PopoverBody, { "aria-label": (0, import_i18n74.__)("Dynamic tags", "elementor") }, /* @__PURE__ */ React108.createElement(DynamicSelection, { close: selectionPopoverState.close }))
|
|
6256
6433
|
));
|
|
6257
6434
|
};
|
|
6258
6435
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
6259
|
-
const popupState = (0,
|
|
6436
|
+
const popupState = (0, import_ui57.usePopupState)({ variant: "popover" });
|
|
6260
6437
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
6261
6438
|
if (!hasDynamicSettings) {
|
|
6262
6439
|
return null;
|
|
6263
6440
|
}
|
|
6264
|
-
return /* @__PURE__ */
|
|
6265
|
-
|
|
6441
|
+
return /* @__PURE__ */ React108.createElement(React108.Fragment, null, /* @__PURE__ */ React108.createElement(
|
|
6442
|
+
import_ui57.IconButton,
|
|
6266
6443
|
{
|
|
6267
6444
|
size: SIZE7,
|
|
6268
|
-
...(0,
|
|
6269
|
-
"aria-label": (0,
|
|
6445
|
+
...(0, import_ui57.bindTrigger)(popupState),
|
|
6446
|
+
"aria-label": (0, import_i18n74.__)("Dynamic settings", "elementor")
|
|
6270
6447
|
},
|
|
6271
|
-
/* @__PURE__ */
|
|
6272
|
-
), /* @__PURE__ */
|
|
6273
|
-
|
|
6448
|
+
/* @__PURE__ */ React108.createElement(import_icons32.SettingsIcon, { fontSize: SIZE7 })
|
|
6449
|
+
), /* @__PURE__ */ React108.createElement(
|
|
6450
|
+
import_ui57.Popover,
|
|
6274
6451
|
{
|
|
6275
6452
|
disablePortal: true,
|
|
6276
6453
|
disableScrollLock: true,
|
|
@@ -6279,45 +6456,45 @@ var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
|
6279
6456
|
PaperProps: {
|
|
6280
6457
|
sx: { my: 1 }
|
|
6281
6458
|
},
|
|
6282
|
-
...(0,
|
|
6459
|
+
...(0, import_ui57.bindPopover)(popupState)
|
|
6283
6460
|
},
|
|
6284
|
-
/* @__PURE__ */
|
|
6285
|
-
|
|
6461
|
+
/* @__PURE__ */ React108.createElement(PopoverBody, { "aria-label": (0, import_i18n74.__)("Dynamic settings", "elementor") }, /* @__PURE__ */ React108.createElement(
|
|
6462
|
+
import_editor_ui11.PopoverHeader,
|
|
6286
6463
|
{
|
|
6287
6464
|
title: dynamicTag.label,
|
|
6288
6465
|
onClose: popupState.close,
|
|
6289
|
-
icon: /* @__PURE__ */
|
|
6466
|
+
icon: /* @__PURE__ */ React108.createElement(import_icons32.DatabaseIcon, { fontSize: SIZE7 })
|
|
6290
6467
|
}
|
|
6291
|
-
), /* @__PURE__ */
|
|
6468
|
+
), /* @__PURE__ */ React108.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls, tagName: dynamicTag.name }))
|
|
6292
6469
|
));
|
|
6293
6470
|
};
|
|
6294
6471
|
var DynamicSettings = ({ controls, tagName }) => {
|
|
6295
6472
|
const tabs = controls.filter(({ type }) => type === "section");
|
|
6296
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
6473
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui57.useTabs)(0);
|
|
6297
6474
|
if (!tabs.length) {
|
|
6298
6475
|
return null;
|
|
6299
6476
|
}
|
|
6300
6477
|
if (tagsWithoutTabs.includes(tagName)) {
|
|
6301
6478
|
const singleTab = tabs[0];
|
|
6302
|
-
return /* @__PURE__ */
|
|
6479
|
+
return /* @__PURE__ */ React108.createElement(React108.Fragment, null, /* @__PURE__ */ React108.createElement(import_ui57.Divider, null), /* @__PURE__ */ React108.createElement(ControlsItemsStack, { items: singleTab.value.items }));
|
|
6303
6480
|
}
|
|
6304
|
-
return /* @__PURE__ */
|
|
6305
|
-
|
|
6481
|
+
return /* @__PURE__ */ React108.createElement(React108.Fragment, null, tabs.length > 1 && /* @__PURE__ */ React108.createElement(import_ui57.Tabs, { size: "small", variant: "fullWidth", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React108.createElement(
|
|
6482
|
+
import_ui57.Tab,
|
|
6306
6483
|
{
|
|
6307
6484
|
key: index,
|
|
6308
6485
|
label: value.label,
|
|
6309
6486
|
sx: { px: 1, py: 0.5 },
|
|
6310
6487
|
...getTabProps(index)
|
|
6311
6488
|
}
|
|
6312
|
-
))), /* @__PURE__ */
|
|
6313
|
-
return /* @__PURE__ */
|
|
6314
|
-
|
|
6489
|
+
))), /* @__PURE__ */ React108.createElement(import_ui57.Divider, null), tabs.map(({ value }, index) => {
|
|
6490
|
+
return /* @__PURE__ */ React108.createElement(
|
|
6491
|
+
import_ui57.TabPanel,
|
|
6315
6492
|
{
|
|
6316
6493
|
key: index,
|
|
6317
6494
|
sx: { flexGrow: 1, py: 0, overflowY: "auto" },
|
|
6318
6495
|
...getTabPanelProps(index)
|
|
6319
6496
|
},
|
|
6320
|
-
/* @__PURE__ */
|
|
6497
|
+
/* @__PURE__ */ React108.createElement(ControlsItemsStack, { items: value.items })
|
|
6321
6498
|
);
|
|
6322
6499
|
}));
|
|
6323
6500
|
};
|
|
@@ -6359,11 +6536,11 @@ var Control3 = ({ control }) => {
|
|
|
6359
6536
|
display: "grid",
|
|
6360
6537
|
gridTemplateColumns: isSwitchControl ? "minmax(0, 1fr) max-content" : "1fr 1fr"
|
|
6361
6538
|
} : {};
|
|
6362
|
-
return /* @__PURE__ */
|
|
6539
|
+
return /* @__PURE__ */ React108.createElement(DynamicControl, { bind: control.bind }, /* @__PURE__ */ React108.createElement(import_ui57.Grid, { container: true, gap: 0.75, sx: layoutStyleProps }, control.label ? /* @__PURE__ */ React108.createElement(import_ui57.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React108.createElement(import_editor_controls59.ControlFormLabel, null, control.label)) : null, /* @__PURE__ */ React108.createElement(import_ui57.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React108.createElement(Control, { type: control.type, props: controlProps }))));
|
|
6363
6540
|
};
|
|
6364
6541
|
function ControlsItemsStack({ items: items3 }) {
|
|
6365
|
-
return /* @__PURE__ */
|
|
6366
|
-
(item) => item.type === "control" ? /* @__PURE__ */
|
|
6542
|
+
return /* @__PURE__ */ React108.createElement(import_ui57.Stack, { p: 2, gap: 2, sx: { overflowY: "auto" } }, items3.map(
|
|
6543
|
+
(item) => item.type === "control" ? /* @__PURE__ */ React108.createElement(Control3, { key: item.value.bind, control: item.value }) : null
|
|
6367
6544
|
));
|
|
6368
6545
|
}
|
|
6369
6546
|
|
|
@@ -6417,18 +6594,18 @@ function getDynamicValue(name, settings) {
|
|
|
6417
6594
|
}
|
|
6418
6595
|
|
|
6419
6596
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
6420
|
-
var
|
|
6597
|
+
var React109 = __toESM(require("react"));
|
|
6421
6598
|
var import_editor_controls60 = require("@elementor/editor-controls");
|
|
6422
|
-
var
|
|
6423
|
-
var
|
|
6599
|
+
var import_icons33 = require("@elementor/icons");
|
|
6600
|
+
var import_i18n75 = require("@wordpress/i18n");
|
|
6424
6601
|
var usePropDynamicAction = () => {
|
|
6425
6602
|
const { propType } = (0, import_editor_controls60.useBoundProp)();
|
|
6426
6603
|
const visible = !!propType && supportsDynamic(propType);
|
|
6427
6604
|
return {
|
|
6428
6605
|
visible,
|
|
6429
|
-
icon:
|
|
6430
|
-
title: (0,
|
|
6431
|
-
content: ({ close }) => /* @__PURE__ */
|
|
6606
|
+
icon: import_icons33.DatabaseIcon,
|
|
6607
|
+
title: (0, import_i18n75.__)("Dynamic tags", "elementor"),
|
|
6608
|
+
content: ({ close }) => /* @__PURE__ */ React109.createElement(DynamicSelection, { close })
|
|
6432
6609
|
};
|
|
6433
6610
|
};
|
|
6434
6611
|
|
|
@@ -6459,8 +6636,8 @@ var init = () => {
|
|
|
6459
6636
|
|
|
6460
6637
|
// src/reset-style-props.tsx
|
|
6461
6638
|
var import_editor_controls62 = require("@elementor/editor-controls");
|
|
6462
|
-
var
|
|
6463
|
-
var
|
|
6639
|
+
var import_icons34 = require("@elementor/icons");
|
|
6640
|
+
var import_i18n76 = require("@wordpress/i18n");
|
|
6464
6641
|
var { registerAction } = controlActionsMenu;
|
|
6465
6642
|
var REPEATERS_SUPPORTED_FOR_RESET = ["background"];
|
|
6466
6643
|
function initResetStyleProps() {
|
|
@@ -6478,8 +6655,8 @@ function useResetStyleValueProps() {
|
|
|
6478
6655
|
const shouldShowResetForRepeater = !isRequired && (!isInRepeater || isRepeaterTypeSupported);
|
|
6479
6656
|
return {
|
|
6480
6657
|
visible: isStyle && value !== null && value !== void 0 && shouldShowResetForRepeater,
|
|
6481
|
-
title: (0,
|
|
6482
|
-
icon:
|
|
6658
|
+
title: (0, import_i18n76.__)("Clear", "elementor"),
|
|
6659
|
+
icon: import_icons34.BrushBigIcon,
|
|
6483
6660
|
onClick: () => resetValue()
|
|
6484
6661
|
};
|
|
6485
6662
|
}
|
|
@@ -6502,25 +6679,25 @@ var excludePropTypeTransformers = /* @__PURE__ */ new Set([
|
|
|
6502
6679
|
]);
|
|
6503
6680
|
|
|
6504
6681
|
// src/styles-inheritance/transformers/array-transformer.tsx
|
|
6505
|
-
var
|
|
6682
|
+
var React110 = __toESM(require("react"));
|
|
6506
6683
|
var import_editor_canvas6 = require("@elementor/editor-canvas");
|
|
6507
|
-
var
|
|
6684
|
+
var import_ui58 = require("@elementor/ui");
|
|
6508
6685
|
var arrayTransformer = (0, import_editor_canvas6.createTransformer)((values) => {
|
|
6509
6686
|
if (!values || values.length === 0) {
|
|
6510
6687
|
return null;
|
|
6511
6688
|
}
|
|
6512
|
-
return /* @__PURE__ */
|
|
6689
|
+
return /* @__PURE__ */ React110.createElement(import_ui58.Stack, { direction: "column" }, values.map((item, index) => /* @__PURE__ */ React110.createElement(import_ui58.Stack, { key: index }, item)));
|
|
6513
6690
|
});
|
|
6514
6691
|
|
|
6515
6692
|
// src/styles-inheritance/transformers/background-color-overlay-transformer.tsx
|
|
6516
|
-
var
|
|
6693
|
+
var React111 = __toESM(require("react"));
|
|
6517
6694
|
var import_editor_canvas7 = require("@elementor/editor-canvas");
|
|
6518
|
-
var
|
|
6519
|
-
var backgroundColorOverlayTransformer = (0, import_editor_canvas7.createTransformer)((value) => /* @__PURE__ */
|
|
6695
|
+
var import_ui59 = require("@elementor/ui");
|
|
6696
|
+
var backgroundColorOverlayTransformer = (0, import_editor_canvas7.createTransformer)((value) => /* @__PURE__ */ React111.createElement(import_ui59.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React111.createElement(ItemLabelColor, { value })));
|
|
6520
6697
|
var ItemLabelColor = ({ value: { color } }) => {
|
|
6521
|
-
return /* @__PURE__ */
|
|
6698
|
+
return /* @__PURE__ */ React111.createElement("span", null, color);
|
|
6522
6699
|
};
|
|
6523
|
-
var StyledUnstableColorIndicator = (0,
|
|
6700
|
+
var StyledUnstableColorIndicator = (0, import_ui59.styled)(import_ui59.UnstableColorIndicator)(({ theme }) => ({
|
|
6524
6701
|
width: "1em",
|
|
6525
6702
|
height: "1em",
|
|
6526
6703
|
borderRadius: `${theme.shape.borderRadius / 2}px`,
|
|
@@ -6529,20 +6706,20 @@ var StyledUnstableColorIndicator = (0, import_ui52.styled)(import_ui52.UnstableC
|
|
|
6529
6706
|
}));
|
|
6530
6707
|
|
|
6531
6708
|
// src/styles-inheritance/transformers/background-gradient-overlay-transformer.tsx
|
|
6532
|
-
var
|
|
6709
|
+
var React112 = __toESM(require("react"));
|
|
6533
6710
|
var import_editor_canvas8 = require("@elementor/editor-canvas");
|
|
6534
|
-
var
|
|
6535
|
-
var
|
|
6536
|
-
var backgroundGradientOverlayTransformer = (0, import_editor_canvas8.createTransformer)((value) => /* @__PURE__ */
|
|
6711
|
+
var import_ui60 = require("@elementor/ui");
|
|
6712
|
+
var import_i18n77 = require("@wordpress/i18n");
|
|
6713
|
+
var backgroundGradientOverlayTransformer = (0, import_editor_canvas8.createTransformer)((value) => /* @__PURE__ */ React112.createElement(import_ui60.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React112.createElement(ItemIconGradient, { value }), /* @__PURE__ */ React112.createElement(ItemLabelGradient, { value })));
|
|
6537
6714
|
var ItemIconGradient = ({ value }) => {
|
|
6538
6715
|
const gradient = getGradientValue(value);
|
|
6539
|
-
return /* @__PURE__ */
|
|
6716
|
+
return /* @__PURE__ */ React112.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
6540
6717
|
};
|
|
6541
6718
|
var ItemLabelGradient = ({ value }) => {
|
|
6542
6719
|
if (value.type === "linear") {
|
|
6543
|
-
return /* @__PURE__ */
|
|
6720
|
+
return /* @__PURE__ */ React112.createElement("span", null, (0, import_i18n77.__)("Linear gradient", "elementor"));
|
|
6544
6721
|
}
|
|
6545
|
-
return /* @__PURE__ */
|
|
6722
|
+
return /* @__PURE__ */ React112.createElement("span", null, (0, import_i18n77.__)("Radial gradient", "elementor"));
|
|
6546
6723
|
};
|
|
6547
6724
|
var getGradientValue = (gradient) => {
|
|
6548
6725
|
const stops = gradient.stops?.map(({ color, offset }) => `${color} ${offset ?? 0}%`)?.join(",");
|
|
@@ -6553,16 +6730,16 @@ var getGradientValue = (gradient) => {
|
|
|
6553
6730
|
};
|
|
6554
6731
|
|
|
6555
6732
|
// src/styles-inheritance/transformers/background-image-overlay-transformer.tsx
|
|
6556
|
-
var
|
|
6733
|
+
var React113 = __toESM(require("react"));
|
|
6557
6734
|
var import_editor_canvas9 = require("@elementor/editor-canvas");
|
|
6558
|
-
var
|
|
6559
|
-
var
|
|
6735
|
+
var import_editor_ui12 = require("@elementor/editor-ui");
|
|
6736
|
+
var import_ui61 = require("@elementor/ui");
|
|
6560
6737
|
var import_wp_media = require("@elementor/wp-media");
|
|
6561
|
-
var backgroundImageOverlayTransformer = (0, import_editor_canvas9.createTransformer)((value) => /* @__PURE__ */
|
|
6738
|
+
var backgroundImageOverlayTransformer = (0, import_editor_canvas9.createTransformer)((value) => /* @__PURE__ */ React113.createElement(import_ui61.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React113.createElement(ItemIconImage, { value }), /* @__PURE__ */ React113.createElement(ItemLabelImage, { value })));
|
|
6562
6739
|
var ItemIconImage = ({ value }) => {
|
|
6563
6740
|
const { imageUrl } = useImage(value);
|
|
6564
|
-
return /* @__PURE__ */
|
|
6565
|
-
|
|
6741
|
+
return /* @__PURE__ */ React113.createElement(
|
|
6742
|
+
import_ui61.CardMedia,
|
|
6566
6743
|
{
|
|
6567
6744
|
image: imageUrl,
|
|
6568
6745
|
sx: (theme) => ({
|
|
@@ -6577,7 +6754,7 @@ var ItemIconImage = ({ value }) => {
|
|
|
6577
6754
|
};
|
|
6578
6755
|
var ItemLabelImage = ({ value }) => {
|
|
6579
6756
|
const { imageTitle } = useImage(value);
|
|
6580
|
-
return /* @__PURE__ */
|
|
6757
|
+
return /* @__PURE__ */ React113.createElement(import_editor_ui12.EllipsisWithTooltip, { title: imageTitle }, /* @__PURE__ */ React113.createElement("span", null, imageTitle));
|
|
6581
6758
|
};
|
|
6582
6759
|
var useImage = (image) => {
|
|
6583
6760
|
let imageTitle, imageUrl = null;
|
|
@@ -6602,9 +6779,9 @@ var getFileExtensionFromFilename = (filename) => {
|
|
|
6602
6779
|
};
|
|
6603
6780
|
|
|
6604
6781
|
// src/styles-inheritance/transformers/box-shadow-transformer.tsx
|
|
6605
|
-
var
|
|
6782
|
+
var React114 = __toESM(require("react"));
|
|
6606
6783
|
var import_editor_canvas10 = require("@elementor/editor-canvas");
|
|
6607
|
-
var
|
|
6784
|
+
var import_ui62 = require("@elementor/ui");
|
|
6608
6785
|
var boxShadowTransformer = (0, import_editor_canvas10.createTransformer)((value) => {
|
|
6609
6786
|
if (!value) {
|
|
6610
6787
|
return null;
|
|
@@ -6613,20 +6790,20 @@ var boxShadowTransformer = (0, import_editor_canvas10.createTransformer)((value)
|
|
|
6613
6790
|
const colorValue = color || "#000000";
|
|
6614
6791
|
const sizes = [hOffset || "0px", vOffset || "0px", blur || "10px", spread || "0px"].join(" ");
|
|
6615
6792
|
const positionValue = position || "outset";
|
|
6616
|
-
return /* @__PURE__ */
|
|
6793
|
+
return /* @__PURE__ */ React114.createElement(import_ui62.Stack, { direction: "column", gap: 0.5, pb: 1 }, /* @__PURE__ */ React114.createElement("span", null, colorValue, " ", positionValue, ", ", sizes));
|
|
6617
6794
|
});
|
|
6618
6795
|
|
|
6619
6796
|
// src/styles-inheritance/transformers/color-transformer.tsx
|
|
6620
|
-
var
|
|
6797
|
+
var React115 = __toESM(require("react"));
|
|
6621
6798
|
var import_editor_canvas11 = require("@elementor/editor-canvas");
|
|
6622
|
-
var
|
|
6799
|
+
var import_ui63 = require("@elementor/ui");
|
|
6623
6800
|
function isValidCSSColor(value) {
|
|
6624
6801
|
if (!value.trim()) {
|
|
6625
6802
|
return false;
|
|
6626
6803
|
}
|
|
6627
6804
|
return CSS.supports("color", value.trim());
|
|
6628
6805
|
}
|
|
6629
|
-
var StyledColorIndicator = (0,
|
|
6806
|
+
var StyledColorIndicator = (0, import_ui63.styled)(import_ui63.UnstableColorIndicator)(({ theme }) => ({
|
|
6630
6807
|
width: "1em",
|
|
6631
6808
|
height: "1em",
|
|
6632
6809
|
borderRadius: `${theme.shape.borderRadius / 2}px`,
|
|
@@ -6637,13 +6814,13 @@ var colorTransformer = (0, import_editor_canvas11.createTransformer)((value) =>
|
|
|
6637
6814
|
if (!isValidCSSColor(value)) {
|
|
6638
6815
|
return value;
|
|
6639
6816
|
}
|
|
6640
|
-
return /* @__PURE__ */
|
|
6817
|
+
return /* @__PURE__ */ React115.createElement(import_ui63.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React115.createElement(StyledColorIndicator, { size: "inherit", component: "span", value }), /* @__PURE__ */ React115.createElement("span", null, value));
|
|
6641
6818
|
});
|
|
6642
6819
|
|
|
6643
6820
|
// src/styles-inheritance/transformers/repeater-to-items-transformer.tsx
|
|
6644
|
-
var
|
|
6821
|
+
var React116 = __toESM(require("react"));
|
|
6645
6822
|
var import_editor_canvas12 = require("@elementor/editor-canvas");
|
|
6646
|
-
var
|
|
6823
|
+
var import_ui64 = require("@elementor/ui");
|
|
6647
6824
|
var createRepeaterToItemsTransformer = (originalTransformer, separator = " ") => {
|
|
6648
6825
|
return (0, import_editor_canvas12.createTransformer)((value, options12) => {
|
|
6649
6826
|
const stringResult = originalTransformer(value, options12);
|
|
@@ -6654,7 +6831,7 @@ var createRepeaterToItemsTransformer = (originalTransformer, separator = " ") =>
|
|
|
6654
6831
|
if (parts.length <= 1) {
|
|
6655
6832
|
return stringResult;
|
|
6656
6833
|
}
|
|
6657
|
-
return /* @__PURE__ */
|
|
6834
|
+
return /* @__PURE__ */ React116.createElement(import_ui64.Stack, { direction: "column", gap: 0.5 }, parts.map((part, index) => /* @__PURE__ */ React116.createElement(import_ui64.Stack, { key: index }, part.trim())));
|
|
6658
6835
|
});
|
|
6659
6836
|
};
|
|
6660
6837
|
|