@elementor/editor-editing-panel 1.9.0 → 1.10.0
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/CHANGELOG.md +32 -0
- package/dist/index.d.mts +1 -35
- package/dist/index.d.ts +1 -35
- package/dist/index.js +577 -635
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +490 -546
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -11
- package/src/components/css-class-menu.tsx +28 -52
- package/src/components/css-class-selector.tsx +23 -18
- package/src/contexts/style-context.tsx +36 -5
- package/src/controls-registry/control.tsx +3 -12
- package/src/errors.ts +22 -0
- package/src/hooks/use-styles-fields.ts +49 -11
- package/src/hooks/use-unapply-class.ts +4 -0
- package/src/index.ts +0 -1
- package/src/init.ts +0 -2
- package/src/components/conditional-tooltip-wrapper.tsx +0 -58
- package/src/contexts/css-class-item-context.tsx +0 -31
- package/src/css-classes.ts +0 -45
package/dist/index.js
CHANGED
|
@@ -31,8 +31,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
injectIntoClassSelectorActions: () => injectIntoClassSelectorActions,
|
|
34
|
-
registerGlobalClassMenuItem: () => registerGlobalClassMenuItem,
|
|
35
|
-
registerStateMenuItem: () => registerStateMenuItem,
|
|
36
34
|
replaceControl: () => replaceControl,
|
|
37
35
|
useBoundProp: () => import_editor_controls47.useBoundProp,
|
|
38
36
|
usePanelActions: () => usePanelActions,
|
|
@@ -45,66 +43,130 @@ var import_editor_controls47 = require("@elementor/editor-controls");
|
|
|
45
43
|
var import_editor_controls = require("@elementor/editor-controls");
|
|
46
44
|
var { replaceControl, getControlReplacement } = (0, import_editor_controls.createControlReplacement)();
|
|
47
45
|
|
|
48
|
-
// src/components/css-class-
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
46
|
+
// src/components/css-class-selector.tsx
|
|
47
|
+
var React7 = __toESM(require("react"));
|
|
48
|
+
var import_react6 = require("react");
|
|
49
|
+
var import_editor_elements2 = require("@elementor/editor-elements");
|
|
50
|
+
var import_editor_props = require("@elementor/editor-props");
|
|
51
|
+
var import_editor_styles_repository2 = require("@elementor/editor-styles-repository");
|
|
52
|
+
var import_editor_ui = require("@elementor/editor-ui");
|
|
53
|
+
var import_icons2 = require("@elementor/icons");
|
|
54
|
+
var import_locations = require("@elementor/locations");
|
|
55
|
+
var import_ui4 = require("@elementor/ui");
|
|
56
|
+
var import_i18n2 = require("@wordpress/i18n");
|
|
54
57
|
|
|
55
|
-
// src/contexts/
|
|
58
|
+
// src/contexts/classes-prop-context.tsx
|
|
56
59
|
var React = __toESM(require("react"));
|
|
57
60
|
var import_react = require("react");
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
isActive: false
|
|
62
|
-
});
|
|
63
|
-
function CssClassItemProvider({ styleId, isGlobal, isActive, children }) {
|
|
64
|
-
return /* @__PURE__ */ React.createElement(ClassItemContext.Provider, { value: { styleId, isGlobal, isActive } }, children);
|
|
61
|
+
var Context = (0, import_react.createContext)(null);
|
|
62
|
+
function ClassesPropProvider({ children, prop }) {
|
|
63
|
+
return /* @__PURE__ */ React.createElement(Context.Provider, { value: { prop } }, children);
|
|
65
64
|
}
|
|
66
|
-
function
|
|
67
|
-
const context = (0, import_react.useContext)(
|
|
65
|
+
function useClassesProp() {
|
|
66
|
+
const context = (0, import_react.useContext)(Context);
|
|
68
67
|
if (!context) {
|
|
69
|
-
throw new Error("
|
|
68
|
+
throw new Error("useClassesProp must be used within a ClassesPropProvider");
|
|
70
69
|
}
|
|
71
|
-
return context;
|
|
70
|
+
return context.prop;
|
|
72
71
|
}
|
|
73
72
|
|
|
74
|
-
// src/contexts/
|
|
73
|
+
// src/contexts/element-context.tsx
|
|
75
74
|
var React2 = __toESM(require("react"));
|
|
76
75
|
var import_react2 = require("react");
|
|
77
|
-
var
|
|
78
|
-
function
|
|
79
|
-
return /* @__PURE__ */ React2.createElement(
|
|
76
|
+
var Context2 = (0, import_react2.createContext)(null);
|
|
77
|
+
function ElementProvider({ children, element, elementType }) {
|
|
78
|
+
return /* @__PURE__ */ React2.createElement(Context2.Provider, { value: { element, elementType } }, children);
|
|
79
|
+
}
|
|
80
|
+
function useElement() {
|
|
81
|
+
const context = (0, import_react2.useContext)(Context2);
|
|
82
|
+
if (!context) {
|
|
83
|
+
throw new Error("useElement must be used within a ElementProvider");
|
|
84
|
+
}
|
|
85
|
+
return context;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// src/contexts/style-context.tsx
|
|
89
|
+
var React3 = __toESM(require("react"));
|
|
90
|
+
var import_react3 = require("react");
|
|
91
|
+
var import_editor_styles_repository = require("@elementor/editor-styles-repository");
|
|
92
|
+
|
|
93
|
+
// src/errors.ts
|
|
94
|
+
var import_utils = require("@elementor/utils");
|
|
95
|
+
var ControlTypeNotFoundError = (0, import_utils.createError)({
|
|
96
|
+
code: "control_type_not_found",
|
|
97
|
+
message: "Control type not found."
|
|
98
|
+
});
|
|
99
|
+
var StylesProviderNotFoundError = (0, import_utils.createError)({
|
|
100
|
+
code: "provider_not_found",
|
|
101
|
+
message: "Styles provider not found."
|
|
102
|
+
});
|
|
103
|
+
var StylesProviderCannotUpdatePropsError = (0, import_utils.createError)({
|
|
104
|
+
code: "provider_cannot_update_props",
|
|
105
|
+
message: "Styles provider doesn't support updating props."
|
|
106
|
+
});
|
|
107
|
+
var StyleNotFoundUnderProviderError = (0, import_utils.createError)({
|
|
108
|
+
code: "style_not_found_under_provider",
|
|
109
|
+
message: "Style not found under the provider."
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
// src/contexts/style-context.tsx
|
|
113
|
+
var Context3 = (0, import_react3.createContext)(null);
|
|
114
|
+
function StyleProvider({ children, ...props }) {
|
|
115
|
+
const provider = props.id === null ? null : getProviderByStyleId(props.id);
|
|
116
|
+
if (props.id && !provider) {
|
|
117
|
+
throw new StylesProviderNotFoundError({ context: { styleId: props.id } });
|
|
118
|
+
}
|
|
119
|
+
return /* @__PURE__ */ React3.createElement(Context3.Provider, { value: { ...props, provider } }, children);
|
|
80
120
|
}
|
|
81
121
|
function useStyle() {
|
|
82
|
-
const context = (0,
|
|
122
|
+
const context = (0, import_react3.useContext)(Context3);
|
|
83
123
|
if (!context) {
|
|
84
124
|
throw new Error("useStyle must be used within a StyleProvider");
|
|
85
125
|
}
|
|
86
126
|
return context;
|
|
87
127
|
}
|
|
128
|
+
function getProviderByStyleId(styleId) {
|
|
129
|
+
const styleProvider = import_editor_styles_repository.stylesRepository.getProviders().find((provider) => {
|
|
130
|
+
return provider.actions.get().find((style) => style.id === styleId);
|
|
131
|
+
});
|
|
132
|
+
return styleProvider ?? null;
|
|
133
|
+
}
|
|
88
134
|
|
|
89
135
|
// src/components/css-class-menu.tsx
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
136
|
+
var React4 = __toESM(require("react"));
|
|
137
|
+
var import_icons = require("@elementor/icons");
|
|
138
|
+
var import_ui = require("@elementor/ui");
|
|
139
|
+
var import_i18n = require("@wordpress/i18n");
|
|
140
|
+
|
|
141
|
+
// src/hooks/use-unapply-class.ts
|
|
142
|
+
var import_editor_elements = require("@elementor/editor-elements");
|
|
143
|
+
var useUnapplyClass = (classId) => {
|
|
144
|
+
const { element } = useElement();
|
|
145
|
+
const { setId: setStyleId } = useStyle();
|
|
146
|
+
const classesProp = useClassesProp();
|
|
147
|
+
const classes = (0, import_editor_elements.useElementSetting)(element.id, classesProp);
|
|
148
|
+
const filteredClasses = classes?.value.filter((className) => className !== classId) ?? [];
|
|
149
|
+
return () => {
|
|
150
|
+
(0, import_editor_elements.updateElementSettings)({
|
|
151
|
+
id: element.id,
|
|
152
|
+
props: {
|
|
153
|
+
[classesProp]: {
|
|
154
|
+
$$type: "classes",
|
|
155
|
+
value: filteredClasses
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
setStyleId(null);
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
// src/components/css-class-menu.tsx
|
|
164
|
+
var STATES = ["hover", "focus", "active"];
|
|
165
|
+
function CssClassMenu({ styleId, isFixed = false, popupState }) {
|
|
166
|
+
const handleKeyDown = (e) => {
|
|
167
|
+
e.stopPropagation();
|
|
168
|
+
};
|
|
169
|
+
return /* @__PURE__ */ React4.createElement(
|
|
108
170
|
import_ui.Menu,
|
|
109
171
|
{
|
|
110
172
|
MenuListProps: { dense: true },
|
|
@@ -113,23 +175,29 @@ function CssClassMenu({
|
|
|
113
175
|
vertical: "top",
|
|
114
176
|
horizontal: "right"
|
|
115
177
|
},
|
|
116
|
-
|
|
178
|
+
onKeyDown: handleKeyDown
|
|
117
179
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
180
|
+
!isFixed && [
|
|
181
|
+
/* @__PURE__ */ React4.createElement(UnapplyClassMenuItem, { key: "unapply-class", styleId }),
|
|
182
|
+
/* @__PURE__ */ React4.createElement(import_ui.Divider, { key: "global-class-items-divider" })
|
|
183
|
+
],
|
|
184
|
+
/* @__PURE__ */ React4.createElement(import_ui.ListSubheader, null, (0, import_i18n.__)("Add a pseudo selector", "elementor")),
|
|
185
|
+
/* @__PURE__ */ React4.createElement(StateMenuItem, { key: "normal", state: null, styleId }),
|
|
186
|
+
STATES.map((state) => {
|
|
187
|
+
return /* @__PURE__ */ React4.createElement(StateMenuItem, { key: state, state, styleId });
|
|
188
|
+
})
|
|
121
189
|
);
|
|
122
190
|
}
|
|
123
|
-
function StateMenuItem({ state,
|
|
124
|
-
const {
|
|
125
|
-
const { setId: setActiveId, setMetaState: setActiveMetaState, meta } = useStyle();
|
|
191
|
+
function StateMenuItem({ state, styleId, ...props }) {
|
|
192
|
+
const { id: activeId, setId: setActiveId, setMetaState: setActiveMetaState, meta } = useStyle();
|
|
126
193
|
const { state: activeState } = meta;
|
|
194
|
+
const isActive = styleId === activeId;
|
|
127
195
|
const isSelected = state === activeState && isActive;
|
|
128
|
-
return /* @__PURE__ */
|
|
196
|
+
return /* @__PURE__ */ React4.createElement(
|
|
129
197
|
StyledMenuItem,
|
|
130
198
|
{
|
|
131
|
-
|
|
132
|
-
|
|
199
|
+
...props,
|
|
200
|
+
selected: isSelected,
|
|
133
201
|
onClick: () => {
|
|
134
202
|
if (!isActive) {
|
|
135
203
|
setActiveId(styleId);
|
|
@@ -137,16 +205,14 @@ function StateMenuItem({ state, disabled }) {
|
|
|
137
205
|
setActiveMetaState(state);
|
|
138
206
|
}
|
|
139
207
|
},
|
|
140
|
-
isSelected && /* @__PURE__ */
|
|
141
|
-
/* @__PURE__ */
|
|
208
|
+
isSelected && /* @__PURE__ */ React4.createElement(import_ui.ListItemIcon, null, /* @__PURE__ */ React4.createElement(import_icons.CheckIcon, null)),
|
|
209
|
+
/* @__PURE__ */ React4.createElement(import_ui.ListItemText, { primary: state ? `:${state}` : "Normal" })
|
|
142
210
|
);
|
|
143
211
|
}
|
|
144
|
-
function
|
|
145
|
-
|
|
212
|
+
function UnapplyClassMenuItem({ styleId, ...props }) {
|
|
213
|
+
const unapplyClass = useUnapplyClass(styleId);
|
|
214
|
+
return /* @__PURE__ */ React4.createElement(StyledMenuItem, { ...props, onClick: unapplyClass }, /* @__PURE__ */ React4.createElement(import_ui.ListItemText, { primary: "Remove" }));
|
|
146
215
|
}
|
|
147
|
-
var GlobalClassMenuSection = (0, import_ui.styled)(import_ui.Box)(({ theme }) => ({
|
|
148
|
-
borderBottom: `1px solid ${theme?.palette.divider}`
|
|
149
|
-
}));
|
|
150
216
|
var StyledMenuItem = (0, import_ui.styled)(import_ui.MenuItem)({
|
|
151
217
|
"&:hover": {
|
|
152
218
|
color: "text.primary"
|
|
@@ -154,87 +220,11 @@ var StyledMenuItem = (0, import_ui.styled)(import_ui.MenuItem)({
|
|
|
154
220
|
}
|
|
155
221
|
});
|
|
156
222
|
|
|
157
|
-
// src/components/
|
|
158
|
-
var React9 = __toESM(require("react"));
|
|
159
|
-
var import_react8 = require("react");
|
|
160
|
-
var import_editor_elements = require("@elementor/editor-elements");
|
|
161
|
-
var import_editor_props = require("@elementor/editor-props");
|
|
162
|
-
var import_editor_styles_repository = require("@elementor/editor-styles-repository");
|
|
163
|
-
var import_icons2 = require("@elementor/icons");
|
|
164
|
-
var import_locations = require("@elementor/locations");
|
|
165
|
-
var import_ui5 = require("@elementor/ui");
|
|
166
|
-
var import_i18n2 = require("@wordpress/i18n");
|
|
167
|
-
|
|
168
|
-
// src/contexts/classes-prop-context.tsx
|
|
169
|
-
var React4 = __toESM(require("react"));
|
|
170
|
-
var import_react3 = require("react");
|
|
171
|
-
var Context2 = (0, import_react3.createContext)(null);
|
|
172
|
-
function ClassesPropProvider({ children, prop }) {
|
|
173
|
-
return /* @__PURE__ */ React4.createElement(Context2.Provider, { value: { prop } }, children);
|
|
174
|
-
}
|
|
175
|
-
function useClassesProp() {
|
|
176
|
-
const context = (0, import_react3.useContext)(Context2);
|
|
177
|
-
if (!context) {
|
|
178
|
-
throw new Error("useClassesProp must be used within a ClassesPropProvider");
|
|
179
|
-
}
|
|
180
|
-
return context.prop;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// src/contexts/element-context.tsx
|
|
223
|
+
// src/components/editable-field.tsx
|
|
184
224
|
var React5 = __toESM(require("react"));
|
|
185
225
|
var import_react4 = require("react");
|
|
186
|
-
var Context3 = (0, import_react4.createContext)(null);
|
|
187
|
-
function ElementProvider({ children, element, elementType }) {
|
|
188
|
-
return /* @__PURE__ */ React5.createElement(Context3.Provider, { value: { element, elementType } }, children);
|
|
189
|
-
}
|
|
190
|
-
function useElement() {
|
|
191
|
-
const context = (0, import_react4.useContext)(Context3);
|
|
192
|
-
if (!context) {
|
|
193
|
-
throw new Error("useElement must be used within a ElementProvider");
|
|
194
|
-
}
|
|
195
|
-
return context;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
// src/components/conditional-tooltip-wrapper.tsx
|
|
199
|
-
var import_react5 = require("react");
|
|
200
|
-
var React6 = __toESM(require("react"));
|
|
201
226
|
var import_ui2 = require("@elementor/ui");
|
|
202
|
-
var
|
|
203
|
-
const elRef = (0, import_react5.useRef)(null);
|
|
204
|
-
const [isOverflown, setIsOverflown] = (0, import_react5.useState)(false);
|
|
205
|
-
(0, import_react5.useEffect)(() => {
|
|
206
|
-
const onResize = () => {
|
|
207
|
-
const element = elRef.current;
|
|
208
|
-
if (element) {
|
|
209
|
-
setIsOverflown(element.scrollWidth > element.clientWidth);
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
onResize();
|
|
213
|
-
window.addEventListener("resize", onResize);
|
|
214
|
-
return () => {
|
|
215
|
-
window.removeEventListener("resize", onResize);
|
|
216
|
-
};
|
|
217
|
-
}, []);
|
|
218
|
-
if (isOverflown) {
|
|
219
|
-
return /* @__PURE__ */ React6.createElement(import_ui2.Tooltip, { title, placement: "top" }, /* @__PURE__ */ React6.createElement(Content, { maxWidth, ref: elRef }, title));
|
|
220
|
-
}
|
|
221
|
-
return /* @__PURE__ */ React6.createElement(Content, { maxWidth, ref: elRef }, title);
|
|
222
|
-
};
|
|
223
|
-
var Content = React6.forwardRef(({ maxWidth, ...tooltipProps }, ref) => /* @__PURE__ */ React6.createElement(
|
|
224
|
-
import_ui2.Box,
|
|
225
|
-
{
|
|
226
|
-
ref,
|
|
227
|
-
position: "relative",
|
|
228
|
-
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", maxWidth },
|
|
229
|
-
...tooltipProps
|
|
230
|
-
}
|
|
231
|
-
));
|
|
232
|
-
|
|
233
|
-
// src/components/editable-field.tsx
|
|
234
|
-
var React7 = __toESM(require("react"));
|
|
235
|
-
var import_react6 = require("react");
|
|
236
|
-
var import_ui3 = require("@elementor/ui");
|
|
237
|
-
var Context4 = (0, import_react6.createContext)(null);
|
|
227
|
+
var Context4 = (0, import_react4.createContext)(null);
|
|
238
228
|
var EditableFieldProvider = ({
|
|
239
229
|
children,
|
|
240
230
|
value,
|
|
@@ -242,9 +232,9 @@ var EditableFieldProvider = ({
|
|
|
242
232
|
validation,
|
|
243
233
|
editable
|
|
244
234
|
}) => {
|
|
245
|
-
const [isEditing, setIsEditing] = (0,
|
|
246
|
-
const [submitting, setSubmitting] = (0,
|
|
247
|
-
const [error, setError] = (0,
|
|
235
|
+
const [isEditing, setIsEditing] = (0, import_react4.useState)(false);
|
|
236
|
+
const [submitting, setSubmitting] = (0, import_react4.useState)(false);
|
|
237
|
+
const [error, setError] = (0, import_react4.useState)(null);
|
|
248
238
|
const openEditMode = () => {
|
|
249
239
|
setIsEditing(true);
|
|
250
240
|
};
|
|
@@ -269,7 +259,7 @@ var EditableFieldProvider = ({
|
|
|
269
259
|
setError(validation(newValue));
|
|
270
260
|
}
|
|
271
261
|
};
|
|
272
|
-
return /* @__PURE__ */
|
|
262
|
+
return /* @__PURE__ */ React5.createElement(
|
|
273
263
|
Context4.Provider,
|
|
274
264
|
{
|
|
275
265
|
value: {
|
|
@@ -288,9 +278,9 @@ var EditableFieldProvider = ({
|
|
|
288
278
|
);
|
|
289
279
|
};
|
|
290
280
|
var EditableField = ({ children, onClick, ...props }) => {
|
|
291
|
-
const ref = (0,
|
|
281
|
+
const ref = (0, import_react4.useRef)(null);
|
|
292
282
|
const { isEditing, closeEditMode, value, onChange, error, submit, editable } = useEditableField();
|
|
293
|
-
(0,
|
|
283
|
+
(0, import_react4.useEffect)(() => {
|
|
294
284
|
if (isEditing) {
|
|
295
285
|
ref.current?.focus();
|
|
296
286
|
selectAll();
|
|
@@ -325,7 +315,7 @@ var EditableField = ({ children, onClick, ...props }) => {
|
|
|
325
315
|
if (!editable) {
|
|
326
316
|
return children;
|
|
327
317
|
}
|
|
328
|
-
return /* @__PURE__ */
|
|
318
|
+
return /* @__PURE__ */ React5.createElement(import_ui2.Tooltip, { open: !!error, title: error, placement: "top" }, /* @__PURE__ */ React5.createElement("div", { onKeyDown: handleKeyDown, onClick: handleClick, ...props }, /* @__PURE__ */ React5.createElement(
|
|
329
319
|
"span",
|
|
330
320
|
{
|
|
331
321
|
ref,
|
|
@@ -339,7 +329,7 @@ var EditableField = ({ children, onClick, ...props }) => {
|
|
|
339
329
|
)));
|
|
340
330
|
};
|
|
341
331
|
var useEditableField = () => {
|
|
342
|
-
const contextValue = (0,
|
|
332
|
+
const contextValue = (0, import_react4.useContext)(Context4);
|
|
343
333
|
if (!contextValue) {
|
|
344
334
|
throw new Error("useEditableField must be used within a EditableFieldProvider");
|
|
345
335
|
}
|
|
@@ -347,9 +337,9 @@ var useEditableField = () => {
|
|
|
347
337
|
};
|
|
348
338
|
|
|
349
339
|
// src/components/multi-combobox.tsx
|
|
350
|
-
var
|
|
351
|
-
var
|
|
352
|
-
var
|
|
340
|
+
var React6 = __toESM(require("react"));
|
|
341
|
+
var import_react5 = require("react");
|
|
342
|
+
var import_ui3 = require("@elementor/ui");
|
|
353
343
|
function MultiCombobox({
|
|
354
344
|
actions = [],
|
|
355
345
|
selected,
|
|
@@ -359,8 +349,8 @@ function MultiCombobox({
|
|
|
359
349
|
}) {
|
|
360
350
|
const filter = useFilterOptions();
|
|
361
351
|
const { run, loading } = useActionRunner();
|
|
362
|
-
return /* @__PURE__ */
|
|
363
|
-
|
|
352
|
+
return /* @__PURE__ */ React6.createElement(
|
|
353
|
+
import_ui3.Autocomplete,
|
|
364
354
|
{
|
|
365
355
|
...props,
|
|
366
356
|
freeSolo: true,
|
|
@@ -372,8 +362,8 @@ function MultiCombobox({
|
|
|
372
362
|
disabled: loading,
|
|
373
363
|
value: selected,
|
|
374
364
|
options: options10,
|
|
375
|
-
renderGroup: (params) => /* @__PURE__ */
|
|
376
|
-
renderInput: (params) => /* @__PURE__ */
|
|
365
|
+
renderGroup: (params) => /* @__PURE__ */ React6.createElement(Group, { ...params }),
|
|
366
|
+
renderInput: (params) => /* @__PURE__ */ React6.createElement(import_ui3.TextField, { ...params }),
|
|
377
367
|
onChange: (_, selectedOrInputValue, reason) => {
|
|
378
368
|
const inputValue = selectedOrInputValue.find((option) => typeof option === "string");
|
|
379
369
|
const optionsAndActions = selectedOrInputValue.filter((option) => typeof option !== "string");
|
|
@@ -412,28 +402,28 @@ function MultiCombobox({
|
|
|
412
402
|
);
|
|
413
403
|
}
|
|
414
404
|
var Group = (params) => {
|
|
415
|
-
const id = `combobox-group-${(0,
|
|
416
|
-
return /* @__PURE__ */
|
|
405
|
+
const id = `combobox-group-${(0, import_react5.useId)().replace(/:/g, "_")}`;
|
|
406
|
+
return /* @__PURE__ */ React6.createElement(StyledGroup, { role: "group", "aria-labelledby": id }, /* @__PURE__ */ React6.createElement(StyledGroupHeader, { id }, " ", params.group), /* @__PURE__ */ React6.createElement(StyledGroupItems, { role: "listbox" }, params.children));
|
|
417
407
|
};
|
|
418
|
-
var StyledGroup = (0,
|
|
408
|
+
var StyledGroup = (0, import_ui3.styled)("li")`
|
|
419
409
|
&:not( :last-of-type ) {
|
|
420
410
|
border-bottom: 1px solid ${({ theme }) => theme.palette.divider};
|
|
421
411
|
}
|
|
422
412
|
`;
|
|
423
|
-
var StyledGroupHeader = (0,
|
|
413
|
+
var StyledGroupHeader = (0, import_ui3.styled)(import_ui3.Box)(({ theme }) => ({
|
|
424
414
|
position: "sticky",
|
|
425
415
|
top: "-8px",
|
|
426
416
|
padding: theme.spacing(1, 2),
|
|
427
417
|
color: theme.palette.text.tertiary
|
|
428
418
|
}));
|
|
429
|
-
var StyledGroupItems = (0,
|
|
419
|
+
var StyledGroupItems = (0, import_ui3.styled)("ul")`
|
|
430
420
|
padding: 0;
|
|
431
421
|
`;
|
|
432
422
|
function useFilterOptions() {
|
|
433
|
-
return (0,
|
|
423
|
+
return (0, import_react5.useState)(() => (0, import_ui3.createFilterOptions)())[0];
|
|
434
424
|
}
|
|
435
425
|
function useActionRunner() {
|
|
436
|
-
const [loading, setLoading] = (0,
|
|
426
|
+
const [loading, setLoading] = (0, import_react5.useState)(false);
|
|
437
427
|
const run = async (apply, value) => {
|
|
438
428
|
setLoading(true);
|
|
439
429
|
try {
|
|
@@ -466,7 +456,7 @@ var EMPTY_OPTION = {
|
|
|
466
456
|
value: "",
|
|
467
457
|
fixed: true,
|
|
468
458
|
color: "primary",
|
|
469
|
-
provider:
|
|
459
|
+
provider: import_editor_styles_repository2.ELEMENTS_STYLES_PROVIDER_KEY
|
|
470
460
|
};
|
|
471
461
|
var { Slot: ClassSelectorActionsSlot, inject: injectIntoClassSelectorActions } = (0, import_locations.createLocation)();
|
|
472
462
|
function CssClassSelector() {
|
|
@@ -475,10 +465,9 @@ function CssClassSelector() {
|
|
|
475
465
|
const { id: activeId, setId: setActiveId } = useStyle();
|
|
476
466
|
const actions = useCreateActions({ pushAppliedId, setActiveId });
|
|
477
467
|
const handleApply = useHandleApply(appliedIds, setAppliedIds);
|
|
478
|
-
const handleActivate = ({ value }) => setActiveId(value);
|
|
479
468
|
const applied = useAppliedOptions(options10, appliedIds);
|
|
480
469
|
const active = applied.find((option) => option.value === activeId) ?? EMPTY_OPTION;
|
|
481
|
-
return /* @__PURE__ */
|
|
470
|
+
return /* @__PURE__ */ React7.createElement(import_ui4.Stack, { gap: 1, p: 2 }, /* @__PURE__ */ React7.createElement(import_ui4.Stack, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React7.createElement(import_ui4.Typography, { component: "label", variant: "caption", htmlFor: ID }, (0, import_i18n2.__)("CSS Classes", "elementor")), /* @__PURE__ */ React7.createElement(import_ui4.Stack, { direction: "row", gap: 1 }, /* @__PURE__ */ React7.createElement(ClassSelectorActionsSlot, null))), /* @__PURE__ */ React7.createElement(
|
|
482
471
|
MultiCombobox,
|
|
483
472
|
{
|
|
484
473
|
id: ID,
|
|
@@ -488,35 +477,36 @@ function CssClassSelector() {
|
|
|
488
477
|
onSelect: handleApply,
|
|
489
478
|
limitTags: TAGS_LIMIT,
|
|
490
479
|
actions,
|
|
491
|
-
getLimitTagsText: (more) => /* @__PURE__ */
|
|
480
|
+
getLimitTagsText: (more) => /* @__PURE__ */ React7.createElement(import_ui4.Chip, { size: "tiny", variant: "standard", label: `+${more}`, clickable: true }),
|
|
492
481
|
renderTags: (values, getTagProps) => values.map((value, index) => {
|
|
493
482
|
const chipProps = getTagProps({ index });
|
|
494
483
|
const isActive = value.value === active?.value;
|
|
484
|
+
const isElementsProvider = value.provider === import_editor_styles_repository2.ELEMENTS_STYLES_PROVIDER_KEY;
|
|
495
485
|
const renameLabel = (newLabel) => {
|
|
496
486
|
return updateClassByProvider(value.provider, { label: newLabel, id: value.value });
|
|
497
487
|
};
|
|
498
|
-
return /* @__PURE__ */
|
|
488
|
+
return /* @__PURE__ */ React7.createElement(
|
|
499
489
|
EditableFieldProvider,
|
|
500
490
|
{
|
|
501
491
|
key: chipProps.key,
|
|
502
492
|
value: value.label,
|
|
503
493
|
onSubmit: renameLabel,
|
|
504
|
-
editable: value.
|
|
494
|
+
editable: !value.fixed,
|
|
505
495
|
validation: (newLabel) => renameValidation(
|
|
506
496
|
newLabel,
|
|
507
497
|
options10.filter((option) => option.value !== value.value)
|
|
508
498
|
)
|
|
509
499
|
},
|
|
510
|
-
/* @__PURE__ */
|
|
500
|
+
/* @__PURE__ */ React7.createElement(
|
|
511
501
|
CssClassItem,
|
|
512
502
|
{
|
|
513
503
|
label: value.label,
|
|
514
504
|
id: value.value,
|
|
515
505
|
isActive,
|
|
516
|
-
|
|
506
|
+
isFixed: value.fixed,
|
|
517
507
|
color: isActive && value.color ? value.color : "default",
|
|
518
508
|
chipProps,
|
|
519
|
-
onClickActive: () =>
|
|
509
|
+
onClickActive: () => setActiveId(isElementsProvider ? null : value.value)
|
|
520
510
|
}
|
|
521
511
|
)
|
|
522
512
|
);
|
|
@@ -529,24 +519,24 @@ function CssClassItem({
|
|
|
529
519
|
id,
|
|
530
520
|
label,
|
|
531
521
|
isActive,
|
|
532
|
-
|
|
522
|
+
isFixed = false,
|
|
533
523
|
color: colorProp,
|
|
534
524
|
chipProps,
|
|
535
525
|
onClickActive
|
|
536
526
|
}) {
|
|
537
527
|
const { meta } = useStyle();
|
|
538
|
-
const popupId = (0,
|
|
539
|
-
const popupState = (0,
|
|
540
|
-
const chipRef = (0,
|
|
528
|
+
const popupId = (0, import_react6.useId)().replace(/:/g, "_");
|
|
529
|
+
const popupState = (0, import_ui4.usePopupState)({ variant: "popover", popupId });
|
|
530
|
+
const chipRef = (0, import_react6.useRef)(null);
|
|
541
531
|
const { onDelete, ...chipGroupProps } = chipProps;
|
|
542
532
|
const { isEditing, openEditMode, error, submitting } = useEditableField();
|
|
543
533
|
const color = error ? "error" : colorProp;
|
|
544
|
-
return /* @__PURE__ */
|
|
545
|
-
|
|
534
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(import_ui4.UnstableChipGroup, { ref: chipRef, ...chipGroupProps, "aria-label": `Edit ${label}`, role: "group" }, /* @__PURE__ */ React7.createElement(
|
|
535
|
+
import_ui4.Chip,
|
|
546
536
|
{
|
|
547
537
|
disabled: submitting,
|
|
548
538
|
size: CHIP_SIZE,
|
|
549
|
-
label: /* @__PURE__ */
|
|
539
|
+
label: /* @__PURE__ */ React7.createElement(
|
|
550
540
|
EditableField,
|
|
551
541
|
{
|
|
552
542
|
onDoubleClick: () => {
|
|
@@ -560,7 +550,7 @@ function CssClassItem({
|
|
|
560
550
|
}
|
|
561
551
|
}
|
|
562
552
|
},
|
|
563
|
-
/* @__PURE__ */
|
|
553
|
+
/* @__PURE__ */ React7.createElement(import_editor_ui.EllipsisWithTooltip, { maxWidth: "10ch", title: label })
|
|
564
554
|
),
|
|
565
555
|
variant: isActive && !meta.state ? "filled" : "standard",
|
|
566
556
|
color,
|
|
@@ -572,21 +562,21 @@ function CssClassItem({
|
|
|
572
562
|
}
|
|
573
563
|
}
|
|
574
564
|
}
|
|
575
|
-
), !isEditing && /* @__PURE__ */
|
|
576
|
-
|
|
565
|
+
), !isEditing && /* @__PURE__ */ React7.createElement(
|
|
566
|
+
import_ui4.Chip,
|
|
577
567
|
{
|
|
578
568
|
disabled: submitting,
|
|
579
569
|
size: CHIP_SIZE,
|
|
580
|
-
label: /* @__PURE__ */
|
|
570
|
+
label: /* @__PURE__ */ React7.createElement(import_ui4.Stack, { direction: "row", gap: 0.5, alignItems: "center" }, isActive && meta.state && /* @__PURE__ */ React7.createElement(import_ui4.Typography, { variant: "inherit" }, meta.state), /* @__PURE__ */ React7.createElement(import_icons2.DotsVerticalIcon, { fontSize: "inherit" })),
|
|
581
571
|
variant: "filled",
|
|
582
572
|
color,
|
|
583
|
-
...(0,
|
|
573
|
+
...(0, import_ui4.bindTrigger)(popupState),
|
|
584
574
|
"aria-label": (0, import_i18n2.__)("Open CSS Class Menu", "elementor")
|
|
585
575
|
}
|
|
586
|
-
)), /* @__PURE__ */
|
|
576
|
+
)), /* @__PURE__ */ React7.createElement(CssClassMenu, { styleId: id, popupState, isFixed }));
|
|
587
577
|
}
|
|
588
578
|
var updateClassByProvider = (provider, data) => {
|
|
589
|
-
const providerInstance =
|
|
579
|
+
const providerInstance = import_editor_styles_repository2.stylesRepository.getProviderByKey(provider);
|
|
590
580
|
if (!providerInstance) {
|
|
591
581
|
return;
|
|
592
582
|
}
|
|
@@ -610,30 +600,30 @@ var isNameExist = (newLabel, options10) => {
|
|
|
610
600
|
var isCharactersNotSupported = (newLabel) => !VALID_SELECTOR_REGEX.test(newLabel);
|
|
611
601
|
function useOptions() {
|
|
612
602
|
const { element } = useElement();
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
return styleDefs.map((styleDef) => {
|
|
620
|
-
return {
|
|
621
|
-
label: styleDef.label,
|
|
622
|
-
value: styleDef.id,
|
|
623
|
-
fixed: isElements,
|
|
624
|
-
color: isElements ? "primary" : "global",
|
|
625
|
-
provider: provider.key,
|
|
626
|
-
group: provider.labels?.plural
|
|
627
|
-
};
|
|
628
|
-
});
|
|
603
|
+
const isProviderEditable = (provider) => !!provider.actions.updateProps;
|
|
604
|
+
return (0, import_editor_styles_repository2.useProviders)().filter(isProviderEditable).flatMap((provider) => {
|
|
605
|
+
const isElements = provider.key === import_editor_styles_repository2.ELEMENTS_STYLES_PROVIDER_KEY;
|
|
606
|
+
const styleDefs = provider.actions.get({ elementId: element.id });
|
|
607
|
+
if (isElements && styleDefs.length === 0) {
|
|
608
|
+
return [EMPTY_OPTION];
|
|
629
609
|
}
|
|
630
|
-
|
|
610
|
+
return styleDefs.map((styleDef) => {
|
|
611
|
+
return {
|
|
612
|
+
label: styleDef.label,
|
|
613
|
+
value: styleDef.id,
|
|
614
|
+
fixed: isElements,
|
|
615
|
+
color: isElements ? "primary" : "global",
|
|
616
|
+
provider: provider.key,
|
|
617
|
+
group: provider.labels?.plural
|
|
618
|
+
};
|
|
619
|
+
});
|
|
620
|
+
});
|
|
631
621
|
}
|
|
632
622
|
function useCreateActions({
|
|
633
623
|
pushAppliedId,
|
|
634
624
|
setActiveId
|
|
635
625
|
}) {
|
|
636
|
-
return (0,
|
|
626
|
+
return (0, import_editor_styles_repository2.useCreateActionsByProvider)().map(([provider, create]) => {
|
|
637
627
|
return {
|
|
638
628
|
// translators: %s is the label of the new class.
|
|
639
629
|
label: (value) => (0, import_i18n2.__)('Create new "%s"', "elementor").replace("%s", value),
|
|
@@ -659,7 +649,7 @@ function useCreateActions({
|
|
|
659
649
|
function useAppliedOptions(options10, appliedIds) {
|
|
660
650
|
const applied = options10.filter((option) => appliedIds.includes(option.value));
|
|
661
651
|
const hasElementsProviderStyleApplied = applied.some(
|
|
662
|
-
(option) => option.provider ===
|
|
652
|
+
(option) => option.provider === import_editor_styles_repository2.ELEMENTS_STYLES_PROVIDER_KEY
|
|
663
653
|
);
|
|
664
654
|
if (!hasElementsProviderStyleApplied) {
|
|
665
655
|
applied.unshift(EMPTY_OPTION);
|
|
@@ -669,9 +659,9 @@ function useAppliedOptions(options10, appliedIds) {
|
|
|
669
659
|
function useAppliedClassesIds() {
|
|
670
660
|
const { element } = useElement();
|
|
671
661
|
const currentClassesProp = useClassesProp();
|
|
672
|
-
const value = (0,
|
|
662
|
+
const value = (0, import_editor_elements2.useElementSetting)(element.id, currentClassesProp)?.value || [];
|
|
673
663
|
const setValue = (ids) => {
|
|
674
|
-
(0,
|
|
664
|
+
(0, import_editor_elements2.updateElementSettings)({
|
|
675
665
|
id: element.id,
|
|
676
666
|
props: {
|
|
677
667
|
[currentClassesProp]: import_editor_props.classesPropTypeUtil.create(ids)
|
|
@@ -679,7 +669,7 @@ function useAppliedClassesIds() {
|
|
|
679
669
|
});
|
|
680
670
|
};
|
|
681
671
|
const pushValue = (id) => {
|
|
682
|
-
const ids = (0,
|
|
672
|
+
const ids = (0, import_editor_elements2.getElementSetting)(element.id, currentClassesProp)?.value || [];
|
|
683
673
|
setValue([...ids, id]);
|
|
684
674
|
};
|
|
685
675
|
return {
|
|
@@ -713,22 +703,22 @@ function useHandleApply(appliedIds, setAppliedIds) {
|
|
|
713
703
|
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
714
704
|
|
|
715
705
|
// src/components/editing-panel.tsx
|
|
716
|
-
var
|
|
706
|
+
var React60 = __toESM(require("react"));
|
|
717
707
|
var import_editor_controls41 = require("@elementor/editor-controls");
|
|
718
|
-
var
|
|
708
|
+
var import_editor_elements7 = require("@elementor/editor-elements");
|
|
719
709
|
var import_editor_panels = require("@elementor/editor-panels");
|
|
720
710
|
var import_session3 = require("@elementor/session");
|
|
721
|
-
var
|
|
711
|
+
var import_ui50 = require("@elementor/ui");
|
|
722
712
|
var import_i18n40 = require("@wordpress/i18n");
|
|
723
713
|
|
|
724
714
|
// src/controls-actions.ts
|
|
725
|
-
var
|
|
715
|
+
var import_menus = require("@elementor/menus");
|
|
726
716
|
|
|
727
717
|
// src/popover-action.tsx
|
|
728
|
-
var
|
|
729
|
-
var
|
|
718
|
+
var React8 = __toESM(require("react"));
|
|
719
|
+
var import_react7 = require("react");
|
|
730
720
|
var import_icons3 = require("@elementor/icons");
|
|
731
|
-
var
|
|
721
|
+
var import_ui5 = require("@elementor/ui");
|
|
732
722
|
var SIZE = "tiny";
|
|
733
723
|
function PopoverAction({
|
|
734
724
|
title,
|
|
@@ -736,16 +726,16 @@ function PopoverAction({
|
|
|
736
726
|
icon: Icon,
|
|
737
727
|
popoverContent: PopoverContent
|
|
738
728
|
}) {
|
|
739
|
-
const id = (0,
|
|
740
|
-
const popupState = (0,
|
|
729
|
+
const id = (0, import_react7.useId)();
|
|
730
|
+
const popupState = (0, import_ui5.usePopupState)({
|
|
741
731
|
variant: "popover",
|
|
742
732
|
popupId: `elementor-popover-action-${id}`
|
|
743
733
|
});
|
|
744
734
|
if (!visible) {
|
|
745
735
|
return null;
|
|
746
736
|
}
|
|
747
|
-
return /* @__PURE__ */
|
|
748
|
-
|
|
737
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(import_ui5.Tooltip, { placement: "top", title }, /* @__PURE__ */ React8.createElement(import_ui5.IconButton, { "aria-label": title, key: id, size: SIZE, ...(0, import_ui5.bindToggle)(popupState) }, /* @__PURE__ */ React8.createElement(Icon, { fontSize: SIZE }))), /* @__PURE__ */ React8.createElement(
|
|
738
|
+
import_ui5.Popover,
|
|
749
739
|
{
|
|
750
740
|
disablePortal: true,
|
|
751
741
|
disableScrollLock: true,
|
|
@@ -753,41 +743,40 @@ function PopoverAction({
|
|
|
753
743
|
vertical: "bottom",
|
|
754
744
|
horizontal: "center"
|
|
755
745
|
},
|
|
756
|
-
...(0,
|
|
746
|
+
...(0, import_ui5.bindPopover)(popupState)
|
|
757
747
|
},
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
/* @__PURE__ */
|
|
748
|
+
/* @__PURE__ */ React8.createElement(import_ui5.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React8.createElement(Icon, { fontSize: SIZE, sx: { mr: 0.5 } }), /* @__PURE__ */ React8.createElement(import_ui5.Typography, { variant: "subtitle2" }, title), /* @__PURE__ */ React8.createElement(import_ui5.IconButton, { sx: { ml: "auto" }, size: SIZE, onClick: popupState.close }, /* @__PURE__ */ React8.createElement(import_icons3.XIcon, { fontSize: SIZE }))),
|
|
749
|
+
/* @__PURE__ */ React8.createElement(PopoverContent, { closePopover: popupState.close })
|
|
760
750
|
));
|
|
761
751
|
}
|
|
762
752
|
|
|
763
753
|
// src/controls-actions.ts
|
|
764
|
-
var controlActionsMenu = (0,
|
|
754
|
+
var controlActionsMenu = (0, import_menus.createMenu)({
|
|
765
755
|
components: {
|
|
766
756
|
PopoverAction
|
|
767
757
|
}
|
|
768
758
|
});
|
|
769
759
|
|
|
770
760
|
// src/components/editing-panel-error-fallback.tsx
|
|
771
|
-
var
|
|
772
|
-
var
|
|
761
|
+
var React9 = __toESM(require("react"));
|
|
762
|
+
var import_ui6 = require("@elementor/ui");
|
|
773
763
|
function EditorPanelErrorFallback() {
|
|
774
|
-
return /* @__PURE__ */
|
|
764
|
+
return /* @__PURE__ */ React9.createElement(import_ui6.Box, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React9.createElement(import_ui6.Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React9.createElement("strong", null, "Something went wrong")));
|
|
775
765
|
}
|
|
776
766
|
|
|
777
767
|
// src/components/editing-panel-tabs.tsx
|
|
778
|
-
var
|
|
779
|
-
var
|
|
780
|
-
var
|
|
768
|
+
var React59 = __toESM(require("react"));
|
|
769
|
+
var import_react16 = require("react");
|
|
770
|
+
var import_ui49 = require("@elementor/ui");
|
|
781
771
|
var import_i18n39 = require("@wordpress/i18n");
|
|
782
772
|
|
|
783
773
|
// src/components/settings-tab.tsx
|
|
784
|
-
var
|
|
774
|
+
var React15 = __toESM(require("react"));
|
|
785
775
|
var import_editor_controls4 = require("@elementor/editor-controls");
|
|
786
776
|
var import_session = require("@elementor/session");
|
|
787
777
|
|
|
788
778
|
// src/controls-registry/control.tsx
|
|
789
|
-
var
|
|
790
|
-
var import_utils = require("@elementor/utils");
|
|
779
|
+
var React10 = __toESM(require("react"));
|
|
791
780
|
|
|
792
781
|
// src/controls-registry/controls-registry.tsx
|
|
793
782
|
var import_editor_controls2 = require("@elementor/editor-controls");
|
|
@@ -804,31 +793,27 @@ var getControlByType = (type) => controlTypes[type]?.component;
|
|
|
804
793
|
var getLayoutByType = (type) => controlTypes[type].layout;
|
|
805
794
|
|
|
806
795
|
// src/controls-registry/control.tsx
|
|
807
|
-
var ControlTypeError = (0, import_utils.createError)({
|
|
808
|
-
code: "CONTROL_TYPE_NOT_FOUND",
|
|
809
|
-
message: `Control type not found.`
|
|
810
|
-
});
|
|
811
796
|
var Control = ({ props, type }) => {
|
|
812
797
|
const ControlByType = getControlByType(type);
|
|
813
798
|
if (!ControlByType) {
|
|
814
|
-
throw new
|
|
815
|
-
context: { type }
|
|
799
|
+
throw new ControlTypeNotFoundError({
|
|
800
|
+
context: { controlType: type }
|
|
816
801
|
});
|
|
817
802
|
}
|
|
818
|
-
return /* @__PURE__ */
|
|
803
|
+
return /* @__PURE__ */ React10.createElement(ControlByType, { ...props });
|
|
819
804
|
};
|
|
820
805
|
|
|
821
806
|
// src/controls-registry/control-type-container.tsx
|
|
822
|
-
var
|
|
823
|
-
var
|
|
807
|
+
var React11 = __toESM(require("react"));
|
|
808
|
+
var import_ui7 = require("@elementor/ui");
|
|
824
809
|
var ControlTypeContainer = ({
|
|
825
810
|
controlType,
|
|
826
811
|
children
|
|
827
812
|
}) => {
|
|
828
813
|
const layout = getLayoutByType(controlType);
|
|
829
|
-
return /* @__PURE__ */
|
|
814
|
+
return /* @__PURE__ */ React11.createElement(StyledContainer, { layout }, children);
|
|
830
815
|
};
|
|
831
|
-
var StyledContainer = (0,
|
|
816
|
+
var StyledContainer = (0, import_ui7.styled)(import_ui7.Box, {
|
|
832
817
|
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
833
818
|
})(({ layout, theme }) => ({
|
|
834
819
|
display: "grid",
|
|
@@ -844,9 +829,9 @@ var getGridLayout = (layout) => ({
|
|
|
844
829
|
});
|
|
845
830
|
|
|
846
831
|
// src/controls-registry/settings-field.tsx
|
|
847
|
-
var
|
|
832
|
+
var React12 = __toESM(require("react"));
|
|
848
833
|
var import_editor_controls3 = require("@elementor/editor-controls");
|
|
849
|
-
var
|
|
834
|
+
var import_editor_elements3 = require("@elementor/editor-elements");
|
|
850
835
|
|
|
851
836
|
// src/controls-registry/create-top-level-object-type.ts
|
|
852
837
|
var createTopLevelOjectType = ({ schema }) => {
|
|
@@ -864,27 +849,27 @@ var createTopLevelOjectType = ({ schema }) => {
|
|
|
864
849
|
// src/controls-registry/settings-field.tsx
|
|
865
850
|
var SettingsField = ({ bind, children }) => {
|
|
866
851
|
const { element, elementType } = useElement();
|
|
867
|
-
const settingsValue = (0,
|
|
852
|
+
const settingsValue = (0, import_editor_elements3.useElementSetting)(element.id, bind);
|
|
868
853
|
const value = { [bind]: settingsValue };
|
|
869
854
|
const propType = createTopLevelOjectType({ schema: elementType.propsSchema });
|
|
870
855
|
const setValue = (newValue) => {
|
|
871
|
-
(0,
|
|
856
|
+
(0, import_editor_elements3.updateElementSettings)({
|
|
872
857
|
id: element.id,
|
|
873
858
|
props: { ...newValue }
|
|
874
859
|
});
|
|
875
860
|
};
|
|
876
|
-
return /* @__PURE__ */
|
|
861
|
+
return /* @__PURE__ */ React12.createElement(import_editor_controls3.PropProvider, { propType, value, setValue }, /* @__PURE__ */ React12.createElement(import_editor_controls3.PropKeyProvider, { bind }, children));
|
|
877
862
|
};
|
|
878
863
|
|
|
879
864
|
// src/components/section.tsx
|
|
880
|
-
var
|
|
881
|
-
var
|
|
882
|
-
var
|
|
865
|
+
var React13 = __toESM(require("react"));
|
|
866
|
+
var import_react8 = require("react");
|
|
867
|
+
var import_ui9 = require("@elementor/ui");
|
|
883
868
|
|
|
884
869
|
// src/components/collapse-icon.tsx
|
|
885
870
|
var import_icons4 = require("@elementor/icons");
|
|
886
|
-
var
|
|
887
|
-
var CollapseIcon = (0,
|
|
871
|
+
var import_ui8 = require("@elementor/ui");
|
|
872
|
+
var CollapseIcon = (0, import_ui8.styled)(import_icons4.ChevronDownIcon, {
|
|
888
873
|
shouldForwardProp: (prop) => prop !== "open"
|
|
889
874
|
})(({ theme, open }) => ({
|
|
890
875
|
transform: open ? "rotate(180deg)" : "rotate(0deg)",
|
|
@@ -895,40 +880,40 @@ var CollapseIcon = (0, import_ui9.styled)(import_icons4.ChevronDownIcon, {
|
|
|
895
880
|
|
|
896
881
|
// src/components/section.tsx
|
|
897
882
|
function Section({ title, children, defaultExpanded = false }) {
|
|
898
|
-
const [isOpen, setIsOpen] = (0,
|
|
899
|
-
const id = (0,
|
|
883
|
+
const [isOpen, setIsOpen] = (0, import_react8.useState)(!!defaultExpanded);
|
|
884
|
+
const id = (0, import_react8.useId)();
|
|
900
885
|
const labelId = `label-${id}`;
|
|
901
886
|
const contentId = `content-${id}`;
|
|
902
|
-
return /* @__PURE__ */
|
|
903
|
-
|
|
887
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(
|
|
888
|
+
import_ui9.ListItemButton,
|
|
904
889
|
{
|
|
905
890
|
id: labelId,
|
|
906
891
|
"aria-controls": contentId,
|
|
907
892
|
onClick: () => setIsOpen((prev) => !prev)
|
|
908
893
|
},
|
|
909
|
-
/* @__PURE__ */
|
|
910
|
-
/* @__PURE__ */
|
|
911
|
-
), /* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ React13.createElement(import_ui9.ListItemText, { secondary: title }),
|
|
895
|
+
/* @__PURE__ */ React13.createElement(CollapseIcon, { open: isOpen, color: "secondary" })
|
|
896
|
+
), /* @__PURE__ */ React13.createElement(import_ui9.Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React13.createElement(import_ui9.Stack, { gap: 2.5, p: 2 }, children)), /* @__PURE__ */ React13.createElement(import_ui9.Divider, null));
|
|
912
897
|
}
|
|
913
898
|
|
|
914
899
|
// src/components/sections-list.tsx
|
|
915
|
-
var
|
|
916
|
-
var
|
|
900
|
+
var React14 = __toESM(require("react"));
|
|
901
|
+
var import_ui10 = require("@elementor/ui");
|
|
917
902
|
function SectionsList(props) {
|
|
918
|
-
return /* @__PURE__ */
|
|
903
|
+
return /* @__PURE__ */ React14.createElement(import_ui10.List, { disablePadding: true, component: "div", ...props });
|
|
919
904
|
}
|
|
920
905
|
|
|
921
906
|
// src/components/settings-tab.tsx
|
|
922
907
|
var SettingsTab = () => {
|
|
923
908
|
const { elementType, element } = useElement();
|
|
924
|
-
return /* @__PURE__ */
|
|
909
|
+
return /* @__PURE__ */ React15.createElement(import_session.SessionStorageProvider, { prefix: element.id }, /* @__PURE__ */ React15.createElement(SectionsList, null, elementType.controls.map(({ type, value }, index) => {
|
|
925
910
|
if (type === "control") {
|
|
926
|
-
return /* @__PURE__ */
|
|
911
|
+
return /* @__PURE__ */ React15.createElement(Control2, { key: value.bind, control: value });
|
|
927
912
|
}
|
|
928
913
|
if (type === "section") {
|
|
929
|
-
return /* @__PURE__ */
|
|
914
|
+
return /* @__PURE__ */ React15.createElement(Section, { title: value.label, key: type + "." + index, defaultExpanded: true }, value.items?.map((item) => {
|
|
930
915
|
if (item.type === "control") {
|
|
931
|
-
return /* @__PURE__ */
|
|
916
|
+
return /* @__PURE__ */ React15.createElement(Control2, { key: item.value.bind, control: item.value });
|
|
932
917
|
}
|
|
933
918
|
return null;
|
|
934
919
|
}));
|
|
@@ -940,43 +925,48 @@ var Control2 = ({ control }) => {
|
|
|
940
925
|
if (!getControlByType(control.type)) {
|
|
941
926
|
return null;
|
|
942
927
|
}
|
|
943
|
-
return /* @__PURE__ */
|
|
928
|
+
return /* @__PURE__ */ React15.createElement(SettingsField, { bind: control.bind }, /* @__PURE__ */ React15.createElement(ControlTypeContainer, { controlType: control.type }, control.label ? /* @__PURE__ */ React15.createElement(import_editor_controls4.ControlLabel, null, control.label) : null, /* @__PURE__ */ React15.createElement(Control, { type: control.type, props: control.props })));
|
|
944
929
|
};
|
|
945
930
|
|
|
946
931
|
// src/components/style-tab.tsx
|
|
947
|
-
var
|
|
948
|
-
var
|
|
949
|
-
var
|
|
932
|
+
var React58 = __toESM(require("react"));
|
|
933
|
+
var import_react15 = require("react");
|
|
934
|
+
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
950
935
|
var import_editor_responsive = require("@elementor/editor-responsive");
|
|
951
936
|
var import_session2 = require("@elementor/session");
|
|
952
|
-
var
|
|
937
|
+
var import_ui48 = require("@elementor/ui");
|
|
953
938
|
var import_i18n38 = require("@wordpress/i18n");
|
|
954
939
|
|
|
955
940
|
// src/components/style-sections/background-section/background-section.tsx
|
|
956
|
-
var
|
|
941
|
+
var React17 = __toESM(require("react"));
|
|
957
942
|
var import_editor_controls6 = require("@elementor/editor-controls");
|
|
958
943
|
|
|
959
944
|
// src/controls-registry/styles-field.tsx
|
|
960
|
-
var
|
|
945
|
+
var React16 = __toESM(require("react"));
|
|
961
946
|
var import_editor_controls5 = require("@elementor/editor-controls");
|
|
962
|
-
var
|
|
947
|
+
var import_editor_styles2 = require("@elementor/editor-styles");
|
|
963
948
|
|
|
964
949
|
// src/hooks/use-styles-fields.ts
|
|
965
|
-
var
|
|
950
|
+
var import_react9 = require("react");
|
|
951
|
+
var import_editor_elements4 = require("@elementor/editor-elements");
|
|
952
|
+
var import_editor_styles = require("@elementor/editor-styles");
|
|
966
953
|
var import_i18n3 = require("@wordpress/i18n");
|
|
967
954
|
function useStylesFields(propNames) {
|
|
968
955
|
const { element } = useElement();
|
|
969
|
-
const { id, meta } = useStyle();
|
|
956
|
+
const { id, meta, provider } = useStyle();
|
|
970
957
|
const classesProp = useClassesProp();
|
|
971
|
-
const
|
|
972
|
-
|
|
973
|
-
|
|
958
|
+
const [, reRender] = (0, import_react9.useReducer)((p) => !p, false);
|
|
959
|
+
(0, import_react9.useEffect)(() => provider?.subscribe(reRender), [provider]);
|
|
960
|
+
const value = getProps({
|
|
961
|
+
elementId: element.id,
|
|
962
|
+
styleId: id,
|
|
963
|
+
provider,
|
|
974
964
|
meta,
|
|
975
965
|
propNames
|
|
976
966
|
});
|
|
977
967
|
const setValue = (props) => {
|
|
978
968
|
if (id === null) {
|
|
979
|
-
(0,
|
|
969
|
+
(0, import_editor_elements4.createElementStyle)({
|
|
980
970
|
elementId: element.id,
|
|
981
971
|
classesProp,
|
|
982
972
|
meta,
|
|
@@ -985,15 +975,26 @@ function useStylesFields(propNames) {
|
|
|
985
975
|
});
|
|
986
976
|
return;
|
|
987
977
|
}
|
|
988
|
-
(
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
meta
|
|
993
|
-
});
|
|
978
|
+
if (!provider.actions.updateProps) {
|
|
979
|
+
throw new StylesProviderCannotUpdatePropsError({ context: { providerKey: provider.key } });
|
|
980
|
+
}
|
|
981
|
+
provider.actions.updateProps({ id, meta, props }, { elementId: element.id });
|
|
994
982
|
};
|
|
995
983
|
return [value, setValue];
|
|
996
984
|
}
|
|
985
|
+
function getProps({ styleId, elementId, provider, meta, propNames }) {
|
|
986
|
+
if (!provider || !styleId) {
|
|
987
|
+
return null;
|
|
988
|
+
}
|
|
989
|
+
const style = provider.actions.getById?.(styleId, { elementId });
|
|
990
|
+
if (!style) {
|
|
991
|
+
throw new StyleNotFoundUnderProviderError({ context: { styleId, providerKey: provider.key } });
|
|
992
|
+
}
|
|
993
|
+
const variant = (0, import_editor_styles.getVariantByMeta)(style, meta);
|
|
994
|
+
return Object.fromEntries(
|
|
995
|
+
propNames.map((key) => [key, variant?.props[key] ?? null])
|
|
996
|
+
);
|
|
997
|
+
}
|
|
997
998
|
|
|
998
999
|
// src/hooks/use-styles-field.ts
|
|
999
1000
|
function useStylesField(propName) {
|
|
@@ -1010,37 +1011,37 @@ function useStylesField(propName) {
|
|
|
1010
1011
|
// src/controls-registry/styles-field.tsx
|
|
1011
1012
|
var StylesField = ({ bind, children }) => {
|
|
1012
1013
|
const [value, setValue] = useStylesField(bind);
|
|
1013
|
-
const stylesSchema = (0,
|
|
1014
|
+
const stylesSchema = (0, import_editor_styles2.getStylesSchema)();
|
|
1014
1015
|
const propType = createTopLevelOjectType({ schema: stylesSchema });
|
|
1015
1016
|
const values = { [bind]: value };
|
|
1016
1017
|
const setValues = (newValue) => {
|
|
1017
1018
|
setValue(newValue[bind]);
|
|
1018
1019
|
};
|
|
1019
|
-
return /* @__PURE__ */
|
|
1020
|
+
return /* @__PURE__ */ React16.createElement(import_editor_controls5.PropProvider, { propType, value: values, setValue: setValues }, /* @__PURE__ */ React16.createElement(import_editor_controls5.PropKeyProvider, { bind }, children));
|
|
1020
1021
|
};
|
|
1021
1022
|
|
|
1022
1023
|
// src/components/style-sections/background-section/background-section.tsx
|
|
1023
1024
|
var BackgroundSection = () => {
|
|
1024
|
-
return /* @__PURE__ */
|
|
1025
|
+
return /* @__PURE__ */ React17.createElement(StylesField, { bind: "background" }, /* @__PURE__ */ React17.createElement(import_editor_controls6.BackgroundControl, null));
|
|
1025
1026
|
};
|
|
1026
1027
|
|
|
1027
1028
|
// src/components/style-sections/border-section/border-section.tsx
|
|
1028
|
-
var
|
|
1029
|
-
var
|
|
1029
|
+
var React24 = __toESM(require("react"));
|
|
1030
|
+
var import_ui14 = require("@elementor/ui");
|
|
1030
1031
|
|
|
1031
1032
|
// src/components/style-sections/border-section/border-field.tsx
|
|
1032
|
-
var
|
|
1033
|
+
var React22 = __toESM(require("react"));
|
|
1033
1034
|
var import_i18n7 = require("@wordpress/i18n");
|
|
1034
1035
|
|
|
1035
1036
|
// src/components/add-or-remove-content.tsx
|
|
1036
|
-
var
|
|
1037
|
+
var React18 = __toESM(require("react"));
|
|
1037
1038
|
var import_editor_controls7 = require("@elementor/editor-controls");
|
|
1038
1039
|
var import_icons5 = require("@elementor/icons");
|
|
1039
|
-
var
|
|
1040
|
+
var import_ui11 = require("@elementor/ui");
|
|
1040
1041
|
var SIZE2 = "tiny";
|
|
1041
1042
|
var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
1042
|
-
return /* @__PURE__ */
|
|
1043
|
-
|
|
1043
|
+
return /* @__PURE__ */ React18.createElement(import_ui11.Stack, { gap: 1.5 }, /* @__PURE__ */ React18.createElement(
|
|
1044
|
+
import_ui11.Stack,
|
|
1044
1045
|
{
|
|
1045
1046
|
direction: "row",
|
|
1046
1047
|
sx: {
|
|
@@ -1048,24 +1049,24 @@ var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
|
1048
1049
|
alignItems: "center"
|
|
1049
1050
|
}
|
|
1050
1051
|
},
|
|
1051
|
-
/* @__PURE__ */
|
|
1052
|
-
isAdded ? /* @__PURE__ */
|
|
1053
|
-
), /* @__PURE__ */
|
|
1052
|
+
/* @__PURE__ */ React18.createElement(import_editor_controls7.ControlLabel, null, label),
|
|
1053
|
+
isAdded ? /* @__PURE__ */ React18.createElement(import_ui11.IconButton, { size: SIZE2, onClick: onRemove, "aria-label": "Remove" }, /* @__PURE__ */ React18.createElement(import_icons5.MinusIcon, { fontSize: SIZE2 })) : /* @__PURE__ */ React18.createElement(import_ui11.IconButton, { size: SIZE2, onClick: onAdd, "aria-label": "Add" }, /* @__PURE__ */ React18.createElement(import_icons5.PlusIcon, { fontSize: SIZE2 }))
|
|
1054
|
+
), /* @__PURE__ */ React18.createElement(import_ui11.Collapse, { in: isAdded, unmountOnExit: true }, /* @__PURE__ */ React18.createElement(import_ui11.Stack, { gap: 1.5 }, children)));
|
|
1054
1055
|
};
|
|
1055
1056
|
|
|
1056
1057
|
// src/components/style-sections/border-section/border-color-field.tsx
|
|
1057
|
-
var
|
|
1058
|
+
var React19 = __toESM(require("react"));
|
|
1058
1059
|
var import_editor_controls8 = require("@elementor/editor-controls");
|
|
1059
|
-
var
|
|
1060
|
+
var import_ui12 = require("@elementor/ui");
|
|
1060
1061
|
var import_i18n4 = require("@wordpress/i18n");
|
|
1061
1062
|
var BorderColorField = () => {
|
|
1062
|
-
return /* @__PURE__ */
|
|
1063
|
+
return /* @__PURE__ */ React19.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React19.createElement(import_ui12.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React19.createElement(import_ui12.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(import_editor_controls8.ControlLabel, null, (0, import_i18n4.__)("Border Color", "elementor"))), /* @__PURE__ */ React19.createElement(import_ui12.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(import_editor_controls8.ColorControl, null))));
|
|
1063
1064
|
};
|
|
1064
1065
|
|
|
1065
1066
|
// src/components/style-sections/border-section/border-style-field.tsx
|
|
1066
|
-
var
|
|
1067
|
+
var React20 = __toESM(require("react"));
|
|
1067
1068
|
var import_editor_controls9 = require("@elementor/editor-controls");
|
|
1068
|
-
var
|
|
1069
|
+
var import_ui13 = require("@elementor/ui");
|
|
1069
1070
|
var import_i18n5 = require("@wordpress/i18n");
|
|
1070
1071
|
var borderStyles = [
|
|
1071
1072
|
{ value: "none", label: (0, import_i18n5.__)("None", "elementor") },
|
|
@@ -1079,11 +1080,11 @@ var borderStyles = [
|
|
|
1079
1080
|
{ value: "outset", label: (0, import_i18n5.__)("Outset", "elementor") }
|
|
1080
1081
|
];
|
|
1081
1082
|
var BorderStyleField = () => {
|
|
1082
|
-
return /* @__PURE__ */
|
|
1083
|
+
return /* @__PURE__ */ React20.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React20.createElement(import_ui13.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React20.createElement(import_ui13.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React20.createElement(import_editor_controls9.ControlLabel, null, (0, import_i18n5.__)("Border Type", "elementor"))), /* @__PURE__ */ React20.createElement(import_ui13.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React20.createElement(import_editor_controls9.SelectControl, { options: borderStyles }))));
|
|
1083
1084
|
};
|
|
1084
1085
|
|
|
1085
1086
|
// src/components/style-sections/border-section/border-width-field.tsx
|
|
1086
|
-
var
|
|
1087
|
+
var React21 = __toESM(require("react"));
|
|
1087
1088
|
var import_editor_controls10 = require("@elementor/editor-controls");
|
|
1088
1089
|
var import_editor_props2 = require("@elementor/editor-props");
|
|
1089
1090
|
var import_icons6 = require("@elementor/icons");
|
|
@@ -1091,32 +1092,32 @@ var import_i18n6 = require("@wordpress/i18n");
|
|
|
1091
1092
|
var edges = [
|
|
1092
1093
|
{
|
|
1093
1094
|
label: (0, import_i18n6.__)("Top", "elementor"),
|
|
1094
|
-
icon: /* @__PURE__ */
|
|
1095
|
+
icon: /* @__PURE__ */ React21.createElement(import_icons6.SideTopIcon, { fontSize: "tiny" }),
|
|
1095
1096
|
bind: "top"
|
|
1096
1097
|
},
|
|
1097
1098
|
{
|
|
1098
1099
|
label: (0, import_i18n6.__)("Right", "elementor"),
|
|
1099
|
-
icon: /* @__PURE__ */
|
|
1100
|
+
icon: /* @__PURE__ */ React21.createElement(import_icons6.SideRightIcon, { fontSize: "tiny" }),
|
|
1100
1101
|
bind: "right"
|
|
1101
1102
|
},
|
|
1102
1103
|
{
|
|
1103
1104
|
label: (0, import_i18n6.__)("Bottom", "elementor"),
|
|
1104
|
-
icon: /* @__PURE__ */
|
|
1105
|
+
icon: /* @__PURE__ */ React21.createElement(import_icons6.SideBottomIcon, { fontSize: "tiny" }),
|
|
1105
1106
|
bind: "bottom"
|
|
1106
1107
|
},
|
|
1107
1108
|
{
|
|
1108
1109
|
label: (0, import_i18n6.__)("Left", "elementor"),
|
|
1109
|
-
icon: /* @__PURE__ */
|
|
1110
|
+
icon: /* @__PURE__ */ React21.createElement(import_icons6.SideLeftIcon, { fontSize: "tiny" }),
|
|
1110
1111
|
bind: "left"
|
|
1111
1112
|
}
|
|
1112
1113
|
];
|
|
1113
1114
|
var BorderWidthField = () => {
|
|
1114
|
-
return /* @__PURE__ */
|
|
1115
|
+
return /* @__PURE__ */ React21.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React21.createElement(
|
|
1115
1116
|
import_editor_controls10.EqualUnequalSizesControl,
|
|
1116
1117
|
{
|
|
1117
1118
|
items: edges,
|
|
1118
1119
|
label: (0, import_i18n6.__)("Border Width", "elementor"),
|
|
1119
|
-
icon: /* @__PURE__ */
|
|
1120
|
+
icon: /* @__PURE__ */ React21.createElement(import_icons6.SideAllIcon, { fontSize: "tiny" }),
|
|
1120
1121
|
multiSizePropTypeUtil: import_editor_props2.borderWidthPropTypeUtil
|
|
1121
1122
|
}
|
|
1122
1123
|
));
|
|
@@ -1141,7 +1142,7 @@ var BorderField = () => {
|
|
|
1141
1142
|
});
|
|
1142
1143
|
};
|
|
1143
1144
|
const hasBorder = Object.values(border ?? {}).some(Boolean);
|
|
1144
|
-
return /* @__PURE__ */
|
|
1145
|
+
return /* @__PURE__ */ React22.createElement(
|
|
1145
1146
|
AddOrRemoveContent,
|
|
1146
1147
|
{
|
|
1147
1148
|
label: (0, import_i18n7.__)("Border", "elementor"),
|
|
@@ -1149,14 +1150,14 @@ var BorderField = () => {
|
|
|
1149
1150
|
onAdd: addBorder,
|
|
1150
1151
|
onRemove: removeBorder
|
|
1151
1152
|
},
|
|
1152
|
-
/* @__PURE__ */
|
|
1153
|
-
/* @__PURE__ */
|
|
1154
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ React22.createElement(BorderWidthField, null),
|
|
1154
|
+
/* @__PURE__ */ React22.createElement(BorderColorField, null),
|
|
1155
|
+
/* @__PURE__ */ React22.createElement(BorderStyleField, null)
|
|
1155
1156
|
);
|
|
1156
1157
|
};
|
|
1157
1158
|
|
|
1158
1159
|
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
1159
|
-
var
|
|
1160
|
+
var React23 = __toESM(require("react"));
|
|
1160
1161
|
var import_editor_controls11 = require("@elementor/editor-controls");
|
|
1161
1162
|
var import_editor_props3 = require("@elementor/editor-props");
|
|
1162
1163
|
var import_icons7 = require("@elementor/icons");
|
|
@@ -1164,53 +1165,53 @@ var import_i18n8 = require("@wordpress/i18n");
|
|
|
1164
1165
|
var corners = [
|
|
1165
1166
|
{
|
|
1166
1167
|
label: (0, import_i18n8.__)("Top Left", "elementor"),
|
|
1167
|
-
icon: /* @__PURE__ */
|
|
1168
|
+
icon: /* @__PURE__ */ React23.createElement(import_icons7.RadiusTopLeftIcon, { fontSize: "tiny" }),
|
|
1168
1169
|
bind: "top-left"
|
|
1169
1170
|
},
|
|
1170
1171
|
{
|
|
1171
1172
|
label: (0, import_i18n8.__)("Top Right", "elementor"),
|
|
1172
|
-
icon: /* @__PURE__ */
|
|
1173
|
+
icon: /* @__PURE__ */ React23.createElement(import_icons7.RadiusTopRightIcon, { fontSize: "tiny" }),
|
|
1173
1174
|
bind: "top-right"
|
|
1174
1175
|
},
|
|
1175
1176
|
{
|
|
1176
1177
|
label: (0, import_i18n8.__)("Bottom Right", "elementor"),
|
|
1177
|
-
icon: /* @__PURE__ */
|
|
1178
|
+
icon: /* @__PURE__ */ React23.createElement(import_icons7.RadiusBottomRightIcon, { fontSize: "tiny" }),
|
|
1178
1179
|
bind: "bottom-right"
|
|
1179
1180
|
},
|
|
1180
1181
|
{
|
|
1181
1182
|
label: (0, import_i18n8.__)("Bottom Left", "elementor"),
|
|
1182
|
-
icon: /* @__PURE__ */
|
|
1183
|
+
icon: /* @__PURE__ */ React23.createElement(import_icons7.RadiusBottomLeftIcon, { fontSize: "tiny" }),
|
|
1183
1184
|
bind: "bottom-left"
|
|
1184
1185
|
}
|
|
1185
1186
|
];
|
|
1186
1187
|
var BorderRadiusField = () => {
|
|
1187
|
-
return /* @__PURE__ */
|
|
1188
|
+
return /* @__PURE__ */ React23.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React23.createElement(
|
|
1188
1189
|
import_editor_controls11.EqualUnequalSizesControl,
|
|
1189
1190
|
{
|
|
1190
1191
|
items: corners,
|
|
1191
1192
|
label: (0, import_i18n8.__)("Border Radius", "elementor"),
|
|
1192
|
-
icon: /* @__PURE__ */
|
|
1193
|
+
icon: /* @__PURE__ */ React23.createElement(import_icons7.BorderCornersIcon, { fontSize: "tiny" }),
|
|
1193
1194
|
multiSizePropTypeUtil: import_editor_props3.borderRadiusPropTypeUtil
|
|
1194
1195
|
}
|
|
1195
1196
|
));
|
|
1196
1197
|
};
|
|
1197
1198
|
|
|
1198
1199
|
// src/components/style-sections/border-section/border-section.tsx
|
|
1199
|
-
var BorderSection = () => /* @__PURE__ */
|
|
1200
|
+
var BorderSection = () => /* @__PURE__ */ React24.createElement(import_ui14.Stack, { gap: 1.5 }, /* @__PURE__ */ React24.createElement(BorderRadiusField, null), /* @__PURE__ */ React24.createElement(import_ui14.Divider, null), /* @__PURE__ */ React24.createElement(BorderField, null));
|
|
1200
1201
|
|
|
1201
1202
|
// src/components/style-sections/effects-section/effects-section.tsx
|
|
1202
|
-
var
|
|
1203
|
+
var React25 = __toESM(require("react"));
|
|
1203
1204
|
var import_editor_controls12 = require("@elementor/editor-controls");
|
|
1204
|
-
var
|
|
1205
|
+
var import_ui15 = require("@elementor/ui");
|
|
1205
1206
|
var EffectsSection = () => {
|
|
1206
|
-
return /* @__PURE__ */
|
|
1207
|
+
return /* @__PURE__ */ React25.createElement(import_ui15.Stack, { gap: 1.5 }, /* @__PURE__ */ React25.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React25.createElement(import_editor_controls12.BoxShadowRepeaterControl, null)));
|
|
1207
1208
|
};
|
|
1208
1209
|
|
|
1209
1210
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
1210
|
-
var
|
|
1211
|
+
var React36 = __toESM(require("react"));
|
|
1211
1212
|
var import_editor_controls22 = require("@elementor/editor-controls");
|
|
1212
|
-
var
|
|
1213
|
-
var
|
|
1213
|
+
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
1214
|
+
var import_ui27 = require("@elementor/ui");
|
|
1214
1215
|
var import_i18n18 = require("@wordpress/i18n");
|
|
1215
1216
|
|
|
1216
1217
|
// src/hooks/use-computed-style.ts
|
|
@@ -1239,24 +1240,24 @@ function useComputedStyle(elementId) {
|
|
|
1239
1240
|
}
|
|
1240
1241
|
|
|
1241
1242
|
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
1242
|
-
var
|
|
1243
|
+
var React27 = __toESM(require("react"));
|
|
1243
1244
|
var import_editor_controls13 = require("@elementor/editor-controls");
|
|
1244
1245
|
var import_icons8 = require("@elementor/icons");
|
|
1245
|
-
var
|
|
1246
|
+
var import_ui18 = require("@elementor/ui");
|
|
1246
1247
|
var import_i18n9 = require("@wordpress/i18n");
|
|
1247
1248
|
|
|
1248
1249
|
// src/hooks/use-direction.ts
|
|
1249
|
-
var
|
|
1250
|
+
var import_ui16 = require("@elementor/ui");
|
|
1250
1251
|
function useDirection() {
|
|
1251
|
-
const theme = (0,
|
|
1252
|
+
const theme = (0, import_ui16.useTheme)(), extendedWindow = window;
|
|
1252
1253
|
const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!extendedWindow.elementorFrontend?.config?.is_rtl;
|
|
1253
1254
|
return { isSiteRtl, isUiRtl };
|
|
1254
1255
|
}
|
|
1255
1256
|
|
|
1256
1257
|
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
1257
|
-
var
|
|
1258
|
-
var
|
|
1259
|
-
var
|
|
1258
|
+
var React26 = __toESM(require("react"));
|
|
1259
|
+
var import_react10 = require("react");
|
|
1260
|
+
var import_ui17 = require("@elementor/ui");
|
|
1260
1261
|
var CLOCKWISE_ANGLES = {
|
|
1261
1262
|
row: 0,
|
|
1262
1263
|
column: 90,
|
|
@@ -1270,13 +1271,13 @@ var COUNTER_CLOCKWISE_ANGLES = {
|
|
|
1270
1271
|
"column-reverse": -270
|
|
1271
1272
|
};
|
|
1272
1273
|
var RotatedIcon = ({ icon: Icon, size, isClockwise = true, offset = 0 }) => {
|
|
1273
|
-
const rotate = (0,
|
|
1274
|
+
const rotate = (0, import_react10.useRef)(useGetTargetAngle(isClockwise, offset));
|
|
1274
1275
|
rotate.current = useGetTargetAngle(isClockwise, offset, rotate);
|
|
1275
|
-
return /* @__PURE__ */
|
|
1276
|
+
return /* @__PURE__ */ React26.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
1276
1277
|
};
|
|
1277
1278
|
var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
1278
1279
|
const [direction] = useStylesField("flex-direction");
|
|
1279
|
-
const isRtl = "rtl" === (0,
|
|
1280
|
+
const isRtl = "rtl" === (0, import_ui17.useTheme)().direction;
|
|
1280
1281
|
const rotationMultiplier = isRtl ? -1 : 1;
|
|
1281
1282
|
const angleMap = isClockwise ? CLOCKWISE_ANGLES : COUNTER_CLOCKWISE_ANGLES;
|
|
1282
1283
|
const currentAngle = existingRef ? existingRef.current * rotationMultiplier : angleMap[direction?.value || "row"] + offset;
|
|
@@ -1287,8 +1288,8 @@ var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
|
1287
1288
|
};
|
|
1288
1289
|
|
|
1289
1290
|
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
1290
|
-
var StartIcon = (0,
|
|
1291
|
-
var EndIcon = (0,
|
|
1291
|
+
var StartIcon = (0, import_ui18.withDirection)(import_icons8.LayoutAlignLeftIcon);
|
|
1292
|
+
var EndIcon = (0, import_ui18.withDirection)(import_icons8.LayoutAlignRightIcon);
|
|
1292
1293
|
var iconProps = {
|
|
1293
1294
|
isClockwise: false,
|
|
1294
1295
|
offset: 90
|
|
@@ -1297,41 +1298,41 @@ var options = [
|
|
|
1297
1298
|
{
|
|
1298
1299
|
value: "start",
|
|
1299
1300
|
label: (0, import_i18n9.__)("Start", "elementor"),
|
|
1300
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1301
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: StartIcon, size, ...iconProps }),
|
|
1301
1302
|
showTooltip: true
|
|
1302
1303
|
},
|
|
1303
1304
|
{
|
|
1304
1305
|
value: "center",
|
|
1305
1306
|
label: (0, import_i18n9.__)("Center", "elementor"),
|
|
1306
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1307
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: import_icons8.LayoutAlignCenterIcon, size, ...iconProps }),
|
|
1307
1308
|
showTooltip: true
|
|
1308
1309
|
},
|
|
1309
1310
|
{
|
|
1310
1311
|
value: "end",
|
|
1311
1312
|
label: (0, import_i18n9.__)("End", "elementor"),
|
|
1312
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1313
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: EndIcon, size, ...iconProps }),
|
|
1313
1314
|
showTooltip: true
|
|
1314
1315
|
},
|
|
1315
1316
|
{
|
|
1316
1317
|
value: "stretch",
|
|
1317
1318
|
label: (0, import_i18n9.__)("Stretch", "elementor"),
|
|
1318
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1319
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: import_icons8.LayoutDistributeVerticalIcon, size, ...iconProps }),
|
|
1319
1320
|
showTooltip: true
|
|
1320
1321
|
}
|
|
1321
1322
|
];
|
|
1322
1323
|
var AlignItemsField = () => {
|
|
1323
1324
|
const { isSiteRtl } = useDirection();
|
|
1324
|
-
return /* @__PURE__ */
|
|
1325
|
+
return /* @__PURE__ */ React27.createElement(import_ui18.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React27.createElement(import_ui18.ThemeProvider, null, /* @__PURE__ */ React27.createElement(StylesField, { bind: "align-items" }, /* @__PURE__ */ React27.createElement(import_ui18.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(import_ui18.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React27.createElement(import_editor_controls13.ControlLabel, null, (0, import_i18n9.__)("Align items", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui18.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React27.createElement(import_editor_controls13.ToggleControl, { options }))))));
|
|
1325
1326
|
};
|
|
1326
1327
|
|
|
1327
1328
|
// src/components/style-sections/layout-section/align-self-child-field.tsx
|
|
1328
|
-
var
|
|
1329
|
+
var React28 = __toESM(require("react"));
|
|
1329
1330
|
var import_editor_controls14 = require("@elementor/editor-controls");
|
|
1330
1331
|
var import_icons9 = require("@elementor/icons");
|
|
1331
|
-
var
|
|
1332
|
+
var import_ui19 = require("@elementor/ui");
|
|
1332
1333
|
var import_i18n10 = require("@wordpress/i18n");
|
|
1333
|
-
var StartIcon2 = (0,
|
|
1334
|
-
var EndIcon2 = (0,
|
|
1334
|
+
var StartIcon2 = (0, import_ui19.withDirection)(import_icons9.LayoutAlignLeftIcon);
|
|
1335
|
+
var EndIcon2 = (0, import_ui19.withDirection)(import_icons9.LayoutAlignRightIcon);
|
|
1335
1336
|
var iconProps2 = {
|
|
1336
1337
|
isClockwise: false,
|
|
1337
1338
|
offset: 90
|
|
@@ -1340,37 +1341,37 @@ var options2 = [
|
|
|
1340
1341
|
{
|
|
1341
1342
|
value: "start",
|
|
1342
1343
|
label: (0, import_i18n10.__)("Start", "elementor"),
|
|
1343
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1344
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: StartIcon2, size, ...iconProps2 }),
|
|
1344
1345
|
showTooltip: true
|
|
1345
1346
|
},
|
|
1346
1347
|
{
|
|
1347
1348
|
value: "center",
|
|
1348
1349
|
label: (0, import_i18n10.__)("Center", "elementor"),
|
|
1349
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1350
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: import_icons9.LayoutAlignCenterIcon, size, ...iconProps2 }),
|
|
1350
1351
|
showTooltip: true
|
|
1351
1352
|
},
|
|
1352
1353
|
{
|
|
1353
1354
|
value: "end",
|
|
1354
1355
|
label: (0, import_i18n10.__)("End", "elementor"),
|
|
1355
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1356
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: EndIcon2, size, ...iconProps2 }),
|
|
1356
1357
|
showTooltip: true
|
|
1357
1358
|
},
|
|
1358
1359
|
{
|
|
1359
1360
|
value: "stretch",
|
|
1360
1361
|
label: (0, import_i18n10.__)("Stretch", "elementor"),
|
|
1361
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1362
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: import_icons9.LayoutDistributeVerticalIcon, size, ...iconProps2 }),
|
|
1362
1363
|
showTooltip: true
|
|
1363
1364
|
}
|
|
1364
1365
|
];
|
|
1365
1366
|
var AlignSelfChild = () => {
|
|
1366
1367
|
const { isSiteRtl } = useDirection();
|
|
1367
|
-
return /* @__PURE__ */
|
|
1368
|
+
return /* @__PURE__ */ React28.createElement(import_ui19.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React28.createElement(import_ui19.ThemeProvider, null, /* @__PURE__ */ React28.createElement(StylesField, { bind: "align-self" }, /* @__PURE__ */ React28.createElement(import_ui19.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(import_ui19.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(import_editor_controls14.ControlLabel, null, (0, import_i18n10.__)("Align self", "elementor"))), /* @__PURE__ */ React28.createElement(import_ui19.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React28.createElement(import_editor_controls14.ToggleControl, { options: options2 }))))));
|
|
1368
1369
|
};
|
|
1369
1370
|
|
|
1370
1371
|
// src/components/style-sections/layout-section/display-field.tsx
|
|
1371
|
-
var
|
|
1372
|
+
var React29 = __toESM(require("react"));
|
|
1372
1373
|
var import_editor_controls15 = require("@elementor/editor-controls");
|
|
1373
|
-
var
|
|
1374
|
+
var import_ui20 = require("@elementor/ui");
|
|
1374
1375
|
var import_i18n11 = require("@wordpress/i18n");
|
|
1375
1376
|
var DisplayField = () => {
|
|
1376
1377
|
const options10 = [
|
|
@@ -1385,58 +1386,58 @@ var DisplayField = () => {
|
|
|
1385
1386
|
label: (0, import_i18n11.__)("Flex", "elementor")
|
|
1386
1387
|
}
|
|
1387
1388
|
];
|
|
1388
|
-
return /* @__PURE__ */
|
|
1389
|
+
return /* @__PURE__ */ React29.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React29.createElement(import_ui20.Stack, { gap: 1 }, /* @__PURE__ */ React29.createElement(import_editor_controls15.ControlLabel, null, (0, import_i18n11.__)("Display", "elementor")), /* @__PURE__ */ React29.createElement(import_editor_controls15.ToggleControl, { options: options10, fullWidth: true })));
|
|
1389
1390
|
};
|
|
1390
1391
|
|
|
1391
1392
|
// src/components/style-sections/layout-section/flex-direction-field.tsx
|
|
1392
|
-
var
|
|
1393
|
+
var React30 = __toESM(require("react"));
|
|
1393
1394
|
var import_editor_controls16 = require("@elementor/editor-controls");
|
|
1394
1395
|
var import_icons10 = require("@elementor/icons");
|
|
1395
|
-
var
|
|
1396
|
+
var import_ui21 = require("@elementor/ui");
|
|
1396
1397
|
var import_i18n12 = require("@wordpress/i18n");
|
|
1397
1398
|
var options3 = [
|
|
1398
1399
|
{
|
|
1399
1400
|
value: "row",
|
|
1400
1401
|
label: (0, import_i18n12.__)("Row", "elementor"),
|
|
1401
1402
|
renderContent: ({ size }) => {
|
|
1402
|
-
const StartIcon4 = (0,
|
|
1403
|
-
return /* @__PURE__ */
|
|
1403
|
+
const StartIcon4 = (0, import_ui21.withDirection)(import_icons10.ArrowRightIcon);
|
|
1404
|
+
return /* @__PURE__ */ React30.createElement(StartIcon4, { fontSize: size });
|
|
1404
1405
|
},
|
|
1405
1406
|
showTooltip: true
|
|
1406
1407
|
},
|
|
1407
1408
|
{
|
|
1408
1409
|
value: "column",
|
|
1409
1410
|
label: (0, import_i18n12.__)("Column", "elementor"),
|
|
1410
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1411
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(import_icons10.ArrowDownSmallIcon, { fontSize: size }),
|
|
1411
1412
|
showTooltip: true
|
|
1412
1413
|
},
|
|
1413
1414
|
{
|
|
1414
1415
|
value: "row-reverse",
|
|
1415
1416
|
label: (0, import_i18n12.__)("Reversed row", "elementor"),
|
|
1416
1417
|
renderContent: ({ size }) => {
|
|
1417
|
-
const EndIcon4 = (0,
|
|
1418
|
-
return /* @__PURE__ */
|
|
1418
|
+
const EndIcon4 = (0, import_ui21.withDirection)(import_icons10.ArrowLeftIcon);
|
|
1419
|
+
return /* @__PURE__ */ React30.createElement(EndIcon4, { fontSize: size });
|
|
1419
1420
|
},
|
|
1420
1421
|
showTooltip: true
|
|
1421
1422
|
},
|
|
1422
1423
|
{
|
|
1423
1424
|
value: "column-reverse",
|
|
1424
1425
|
label: (0, import_i18n12.__)("Reversed column", "elementor"),
|
|
1425
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1426
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(import_icons10.ArrowUpSmallIcon, { fontSize: size }),
|
|
1426
1427
|
showTooltip: true
|
|
1427
1428
|
}
|
|
1428
1429
|
];
|
|
1429
1430
|
var FlexDirectionField = () => {
|
|
1430
1431
|
const { isSiteRtl } = useDirection();
|
|
1431
|
-
return /* @__PURE__ */
|
|
1432
|
+
return /* @__PURE__ */ React30.createElement(import_ui21.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React30.createElement(import_ui21.ThemeProvider, null, /* @__PURE__ */ React30.createElement(StylesField, { bind: "flex-direction" }, /* @__PURE__ */ React30.createElement(import_ui21.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(import_ui21.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(import_editor_controls16.ControlLabel, null, (0, import_i18n12.__)("Direction", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui21.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React30.createElement(import_editor_controls16.ToggleControl, { options: options3 }))))));
|
|
1432
1433
|
};
|
|
1433
1434
|
|
|
1434
1435
|
// src/components/style-sections/layout-section/flex-order-field.tsx
|
|
1435
|
-
var
|
|
1436
|
-
var
|
|
1436
|
+
var React31 = __toESM(require("react"));
|
|
1437
|
+
var import_react11 = require("react");
|
|
1437
1438
|
var import_editor_controls17 = require("@elementor/editor-controls");
|
|
1438
1439
|
var import_icons11 = require("@elementor/icons");
|
|
1439
|
-
var
|
|
1440
|
+
var import_ui22 = require("@elementor/ui");
|
|
1440
1441
|
var import_i18n13 = require("@wordpress/i18n");
|
|
1441
1442
|
var FIRST_DEFAULT_VALUE = -99999;
|
|
1442
1443
|
var LAST_DEFAULT_VALUE = 99999;
|
|
@@ -1451,25 +1452,25 @@ var items = [
|
|
|
1451
1452
|
{
|
|
1452
1453
|
value: FIRST,
|
|
1453
1454
|
label: (0, import_i18n13.__)("First", "elementor"),
|
|
1454
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1455
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(import_icons11.ArrowUpSmallIcon, { fontSize: size }),
|
|
1455
1456
|
showTooltip: true
|
|
1456
1457
|
},
|
|
1457
1458
|
{
|
|
1458
1459
|
value: LAST,
|
|
1459
1460
|
label: (0, import_i18n13.__)("Last", "elementor"),
|
|
1460
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1461
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(import_icons11.ArrowDownSmallIcon, { fontSize: size }),
|
|
1461
1462
|
showTooltip: true
|
|
1462
1463
|
},
|
|
1463
1464
|
{
|
|
1464
1465
|
value: CUSTOM,
|
|
1465
1466
|
label: (0, import_i18n13.__)("Custom", "elementor"),
|
|
1466
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1467
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(import_icons11.PencilIcon, { fontSize: size }),
|
|
1467
1468
|
showTooltip: true
|
|
1468
1469
|
}
|
|
1469
1470
|
];
|
|
1470
1471
|
var FlexOrderField = () => {
|
|
1471
1472
|
const { isSiteRtl } = useDirection(), [order, setOrder] = useStylesField("order");
|
|
1472
|
-
const [groupControlValue, setGroupControlValue] = (0,
|
|
1473
|
+
const [groupControlValue, setGroupControlValue] = (0, import_react11.useState)(getGroupControlValue(order?.value || null));
|
|
1473
1474
|
const handleToggleButtonChange = (group) => {
|
|
1474
1475
|
setGroupControlValue(group);
|
|
1475
1476
|
if (!group || group === CUSTOM) {
|
|
@@ -1478,7 +1479,7 @@ var FlexOrderField = () => {
|
|
|
1478
1479
|
}
|
|
1479
1480
|
setOrder({ $$type: "number", value: orderValueMap[group] });
|
|
1480
1481
|
};
|
|
1481
|
-
return /* @__PURE__ */
|
|
1482
|
+
return /* @__PURE__ */ React31.createElement(import_ui22.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React31.createElement(import_ui22.ThemeProvider, null, /* @__PURE__ */ React31.createElement(import_ui22.Stack, { gap: 2 }, /* @__PURE__ */ React31.createElement(import_ui22.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(import_editor_controls17.ControlLabel, null, (0, import_i18n13.__)("Order", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui22.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(
|
|
1482
1483
|
import_editor_controls17.ControlToggleButtonGroup,
|
|
1483
1484
|
{
|
|
1484
1485
|
items,
|
|
@@ -1486,7 +1487,7 @@ var FlexOrderField = () => {
|
|
|
1486
1487
|
onChange: handleToggleButtonChange,
|
|
1487
1488
|
exclusive: true
|
|
1488
1489
|
}
|
|
1489
|
-
))), CUSTOM === groupControlValue && /* @__PURE__ */
|
|
1490
|
+
))), CUSTOM === groupControlValue && /* @__PURE__ */ React31.createElement(StylesField, { bind: "order" }, /* @__PURE__ */ React31.createElement(import_ui22.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(import_editor_controls17.ControlLabel, null, (0, import_i18n13.__)("Custom order", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui22.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(
|
|
1490
1491
|
import_editor_controls17.NumberControl,
|
|
1491
1492
|
{
|
|
1492
1493
|
min: FIRST_DEFAULT_VALUE + 1,
|
|
@@ -1506,37 +1507,37 @@ var getGroupControlValue = (order) => {
|
|
|
1506
1507
|
};
|
|
1507
1508
|
|
|
1508
1509
|
// src/components/style-sections/layout-section/flex-size-field.tsx
|
|
1509
|
-
var
|
|
1510
|
-
var
|
|
1510
|
+
var React32 = __toESM(require("react"));
|
|
1511
|
+
var import_react12 = require("react");
|
|
1511
1512
|
var import_editor_controls18 = require("@elementor/editor-controls");
|
|
1512
1513
|
var import_icons12 = require("@elementor/icons");
|
|
1513
|
-
var
|
|
1514
|
+
var import_ui23 = require("@elementor/ui");
|
|
1514
1515
|
var import_i18n14 = require("@wordpress/i18n");
|
|
1515
1516
|
var DEFAULT = 1;
|
|
1516
1517
|
var items2 = [
|
|
1517
1518
|
{
|
|
1518
1519
|
value: "flex-grow",
|
|
1519
1520
|
label: (0, import_i18n14.__)("Grow", "elementor"),
|
|
1520
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1521
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(import_icons12.ExpandIcon, { fontSize: size }),
|
|
1521
1522
|
showTooltip: true
|
|
1522
1523
|
},
|
|
1523
1524
|
{
|
|
1524
1525
|
value: "flex-shrink",
|
|
1525
1526
|
label: (0, import_i18n14.__)("Shrink", "elementor"),
|
|
1526
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1527
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(import_icons12.ShrinkIcon, { fontSize: size }),
|
|
1527
1528
|
showTooltip: true
|
|
1528
1529
|
},
|
|
1529
1530
|
{
|
|
1530
1531
|
value: "custom",
|
|
1531
1532
|
label: (0, import_i18n14.__)("Custom", "elementor"),
|
|
1532
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1533
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(import_icons12.PencilIcon, { fontSize: size }),
|
|
1533
1534
|
showTooltip: true
|
|
1534
1535
|
}
|
|
1535
1536
|
];
|
|
1536
1537
|
var FlexSizeField = () => {
|
|
1537
1538
|
const { isSiteRtl } = useDirection(), [growField, setGrowField] = useStylesField("flex-grow"), [shrinkField, setShrinkField] = useStylesField("flex-shrink"), [basisField, setBasisField] = useStylesField("flex-basis");
|
|
1538
1539
|
const grow = growField?.value || null, shrink = shrinkField?.value || null, basis = basisField?.value || null;
|
|
1539
|
-
const currentGroup = (0,
|
|
1540
|
+
const currentGroup = (0, import_react12.useMemo)(() => getActiveGroup({ grow, shrink, basis }), [grow, shrink, basis]), [activeGroup, setActiveGroup] = (0, import_react12.useState)(currentGroup);
|
|
1540
1541
|
const onChangeGroup = (group = null) => {
|
|
1541
1542
|
setActiveGroup(group);
|
|
1542
1543
|
setBasisField(null);
|
|
@@ -1553,7 +1554,7 @@ var FlexSizeField = () => {
|
|
|
1553
1554
|
setGrowField(null);
|
|
1554
1555
|
setShrinkField({ $$type: "number", value: DEFAULT });
|
|
1555
1556
|
};
|
|
1556
|
-
return /* @__PURE__ */
|
|
1557
|
+
return /* @__PURE__ */ React32.createElement(import_ui23.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React32.createElement(import_ui23.ThemeProvider, null, /* @__PURE__ */ React32.createElement(import_ui23.Stack, { gap: 2 }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n14.__)("Size", "elementor"))), /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(
|
|
1557
1558
|
import_editor_controls18.ControlToggleButtonGroup,
|
|
1558
1559
|
{
|
|
1559
1560
|
value: activeGroup,
|
|
@@ -1561,9 +1562,9 @@ var FlexSizeField = () => {
|
|
|
1561
1562
|
items: items2,
|
|
1562
1563
|
exclusive: true
|
|
1563
1564
|
}
|
|
1564
|
-
))), "custom" === activeGroup && /* @__PURE__ */
|
|
1565
|
+
))), "custom" === activeGroup && /* @__PURE__ */ React32.createElement(FlexCustomField, null))));
|
|
1565
1566
|
};
|
|
1566
|
-
var FlexCustomField = () => /* @__PURE__ */
|
|
1567
|
+
var FlexCustomField = () => /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(StylesField, { bind: "flex-grow" }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n14.__)("Grow", "elementor"))), /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(import_editor_controls18.NumberControl, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React32.createElement(StylesField, { bind: "flex-shrink" }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n14.__)("Shrink", "elementor"))), /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(import_editor_controls18.NumberControl, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React32.createElement(StylesField, { bind: "flex-basis" }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n14.__)("Basis", "elementor"))), /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(import_editor_controls18.SizeControl, null)))));
|
|
1567
1568
|
var getActiveGroup = ({
|
|
1568
1569
|
grow,
|
|
1569
1570
|
shrink,
|
|
@@ -1585,22 +1586,22 @@ var getActiveGroup = ({
|
|
|
1585
1586
|
};
|
|
1586
1587
|
|
|
1587
1588
|
// src/components/style-sections/layout-section/gap-control-field.tsx
|
|
1588
|
-
var
|
|
1589
|
+
var React33 = __toESM(require("react"));
|
|
1589
1590
|
var import_editor_controls19 = require("@elementor/editor-controls");
|
|
1590
|
-
var
|
|
1591
|
+
var import_ui24 = require("@elementor/ui");
|
|
1591
1592
|
var import_i18n15 = require("@wordpress/i18n");
|
|
1592
1593
|
var GapControlField = () => {
|
|
1593
|
-
return /* @__PURE__ */
|
|
1594
|
+
return /* @__PURE__ */ React33.createElement(import_ui24.Stack, { gap: 1 }, /* @__PURE__ */ React33.createElement(StylesField, { bind: "gap" }, /* @__PURE__ */ React33.createElement(import_editor_controls19.GapControl, { label: (0, import_i18n15.__)("Gaps", "elementor") })));
|
|
1594
1595
|
};
|
|
1595
1596
|
|
|
1596
1597
|
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
1597
|
-
var
|
|
1598
|
+
var React34 = __toESM(require("react"));
|
|
1598
1599
|
var import_editor_controls20 = require("@elementor/editor-controls");
|
|
1599
1600
|
var import_icons13 = require("@elementor/icons");
|
|
1600
|
-
var
|
|
1601
|
+
var import_ui25 = require("@elementor/ui");
|
|
1601
1602
|
var import_i18n16 = require("@wordpress/i18n");
|
|
1602
|
-
var StartIcon3 = (0,
|
|
1603
|
-
var EndIcon3 = (0,
|
|
1603
|
+
var StartIcon3 = (0, import_ui25.withDirection)(import_icons13.JustifyTopIcon);
|
|
1604
|
+
var EndIcon3 = (0, import_ui25.withDirection)(import_icons13.JustifyBottomIcon);
|
|
1604
1605
|
var iconProps3 = {
|
|
1605
1606
|
isClockwise: true,
|
|
1606
1607
|
offset: -90
|
|
@@ -1609,98 +1610,98 @@ var options4 = [
|
|
|
1609
1610
|
{
|
|
1610
1611
|
value: "start",
|
|
1611
1612
|
label: (0, import_i18n16.__)("Start", "elementor"),
|
|
1612
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1613
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: StartIcon3, size, ...iconProps3 }),
|
|
1613
1614
|
showTooltip: true
|
|
1614
1615
|
},
|
|
1615
1616
|
{
|
|
1616
1617
|
value: "center",
|
|
1617
1618
|
label: (0, import_i18n16.__)("Center", "elementor"),
|
|
1618
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1619
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: import_icons13.JustifyCenterIcon, size, ...iconProps3 }),
|
|
1619
1620
|
showTooltip: true
|
|
1620
1621
|
},
|
|
1621
1622
|
{
|
|
1622
1623
|
value: "end",
|
|
1623
1624
|
label: (0, import_i18n16.__)("End", "elementor"),
|
|
1624
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1625
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: EndIcon3, size, ...iconProps3 }),
|
|
1625
1626
|
showTooltip: true
|
|
1626
1627
|
},
|
|
1627
1628
|
{
|
|
1628
1629
|
value: "space-between",
|
|
1629
1630
|
label: (0, import_i18n16.__)("Space between", "elementor"),
|
|
1630
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1631
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: import_icons13.JustifySpaceBetweenVerticalIcon, size, ...iconProps3 }),
|
|
1631
1632
|
showTooltip: true
|
|
1632
1633
|
},
|
|
1633
1634
|
{
|
|
1634
1635
|
value: "space-around",
|
|
1635
1636
|
label: (0, import_i18n16.__)("Space around", "elementor"),
|
|
1636
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1637
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: import_icons13.JustifySpaceAroundVerticalIcon, size, ...iconProps3 }),
|
|
1637
1638
|
showTooltip: true
|
|
1638
1639
|
},
|
|
1639
1640
|
{
|
|
1640
1641
|
value: "space-evenly",
|
|
1641
1642
|
label: (0, import_i18n16.__)("Space evenly", "elementor"),
|
|
1642
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1643
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: import_icons13.JustifyDistributeVerticalIcon, size, ...iconProps3 }),
|
|
1643
1644
|
showTooltip: true
|
|
1644
1645
|
}
|
|
1645
1646
|
];
|
|
1646
1647
|
var JustifyContentField = () => {
|
|
1647
1648
|
const { isSiteRtl } = useDirection();
|
|
1648
|
-
return /* @__PURE__ */
|
|
1649
|
+
return /* @__PURE__ */ React34.createElement(import_ui25.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React34.createElement(import_ui25.ThemeProvider, null, /* @__PURE__ */ React34.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React34.createElement(import_ui25.Stack, { gap: 1 }, /* @__PURE__ */ React34.createElement(import_editor_controls20.ControlLabel, null, (0, import_i18n16.__)("Justify content", "elementor")), /* @__PURE__ */ React34.createElement(import_editor_controls20.ToggleControl, { options: options4, fullWidth: true })))));
|
|
1649
1650
|
};
|
|
1650
1651
|
|
|
1651
1652
|
// src/components/style-sections/layout-section/wrap-field.tsx
|
|
1652
|
-
var
|
|
1653
|
+
var React35 = __toESM(require("react"));
|
|
1653
1654
|
var import_editor_controls21 = require("@elementor/editor-controls");
|
|
1654
1655
|
var import_icons14 = require("@elementor/icons");
|
|
1655
|
-
var
|
|
1656
|
+
var import_ui26 = require("@elementor/ui");
|
|
1656
1657
|
var import_i18n17 = require("@wordpress/i18n");
|
|
1657
1658
|
var options5 = [
|
|
1658
1659
|
{
|
|
1659
1660
|
value: "nowrap",
|
|
1660
1661
|
label: (0, import_i18n17.__)("No wrap", "elementor"),
|
|
1661
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1662
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(import_icons14.ArrowRightIcon, { fontSize: size }),
|
|
1662
1663
|
showTooltip: true
|
|
1663
1664
|
},
|
|
1664
1665
|
{
|
|
1665
1666
|
value: "wrap",
|
|
1666
1667
|
label: (0, import_i18n17.__)("Wrap", "elementor"),
|
|
1667
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1668
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(import_icons14.ArrowBackIcon, { fontSize: size }),
|
|
1668
1669
|
showTooltip: true
|
|
1669
1670
|
},
|
|
1670
1671
|
{
|
|
1671
1672
|
value: "wrap-reverse",
|
|
1672
1673
|
label: (0, import_i18n17.__)("Reversed wrap", "elementor"),
|
|
1673
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1674
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(import_icons14.ArrowForwardIcon, { fontSize: size }),
|
|
1674
1675
|
showTooltip: true
|
|
1675
1676
|
}
|
|
1676
1677
|
];
|
|
1677
1678
|
var WrapField = () => {
|
|
1678
1679
|
const { isSiteRtl } = useDirection();
|
|
1679
|
-
return /* @__PURE__ */
|
|
1680
|
+
return /* @__PURE__ */ React35.createElement(import_ui26.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React35.createElement(import_ui26.ThemeProvider, null, /* @__PURE__ */ React35.createElement(StylesField, { bind: "flex-wrap" }, /* @__PURE__ */ React35.createElement(import_ui26.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(import_editor_controls21.ControlLabel, null, (0, import_i18n17.__)("Wrap", "elementor"))), /* @__PURE__ */ React35.createElement(import_ui26.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React35.createElement(import_editor_controls21.ToggleControl, { options: options5 }))))));
|
|
1680
1681
|
};
|
|
1681
1682
|
|
|
1682
1683
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
1683
1684
|
var LayoutSection = () => {
|
|
1684
1685
|
const [display] = useStylesField("display");
|
|
1685
1686
|
const { element } = useElement();
|
|
1686
|
-
const parent = (0,
|
|
1687
|
+
const parent = (0, import_editor_elements5.useParentElement)(element.id);
|
|
1687
1688
|
const parentStyle = useComputedStyle(parent?.id || null);
|
|
1688
|
-
return /* @__PURE__ */
|
|
1689
|
+
return /* @__PURE__ */ React36.createElement(import_ui27.Stack, { gap: 2 }, /* @__PURE__ */ React36.createElement(DisplayField, null), "flex" === display?.value && /* @__PURE__ */ React36.createElement(FlexFields, null), "flex" === parentStyle?.display && /* @__PURE__ */ React36.createElement(FlexChildFields, null));
|
|
1689
1690
|
};
|
|
1690
|
-
var FlexFields = () => /* @__PURE__ */
|
|
1691
|
-
var FlexChildFields = () => /* @__PURE__ */
|
|
1691
|
+
var FlexFields = () => /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(FlexDirectionField, null), /* @__PURE__ */ React36.createElement(JustifyContentField, null), /* @__PURE__ */ React36.createElement(AlignItemsField, null), /* @__PURE__ */ React36.createElement(import_ui27.Divider, null), /* @__PURE__ */ React36.createElement(GapControlField, null), /* @__PURE__ */ React36.createElement(WrapField, null));
|
|
1692
|
+
var FlexChildFields = () => /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(import_ui27.Divider, null), /* @__PURE__ */ React36.createElement(import_editor_controls22.ControlLabel, null, (0, import_i18n18.__)("Flex child", "elementor")), /* @__PURE__ */ React36.createElement(AlignSelfChild, null), /* @__PURE__ */ React36.createElement(FlexOrderField, null), /* @__PURE__ */ React36.createElement(FlexSizeField, null));
|
|
1692
1693
|
|
|
1693
1694
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1694
|
-
var
|
|
1695
|
-
var
|
|
1695
|
+
var React40 = __toESM(require("react"));
|
|
1696
|
+
var import_ui31 = require("@elementor/ui");
|
|
1696
1697
|
|
|
1697
1698
|
// src/hooks/use-session-storage.ts
|
|
1698
|
-
var
|
|
1699
|
+
var import_react13 = require("react");
|
|
1699
1700
|
var import_utils2 = require("@elementor/utils");
|
|
1700
1701
|
var useSessionStorage = (key) => {
|
|
1701
1702
|
const prefixedKey = `elementor/${key}`;
|
|
1702
|
-
const [value, setValue] = (0,
|
|
1703
|
-
(0,
|
|
1703
|
+
const [value, setValue] = (0, import_react13.useState)();
|
|
1704
|
+
(0, import_react13.useEffect)(() => {
|
|
1704
1705
|
return subscribeToSessionStorage(prefixedKey, (newValue) => {
|
|
1705
1706
|
setValue(newValue ?? null);
|
|
1706
1707
|
});
|
|
@@ -1732,28 +1733,28 @@ var subscribeToSessionStorage = (key, subscriber) => {
|
|
|
1732
1733
|
};
|
|
1733
1734
|
|
|
1734
1735
|
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
1735
|
-
var
|
|
1736
|
+
var React37 = __toESM(require("react"));
|
|
1736
1737
|
var import_editor_controls23 = require("@elementor/editor-controls");
|
|
1737
1738
|
var import_icons15 = require("@elementor/icons");
|
|
1738
|
-
var
|
|
1739
|
+
var import_ui28 = require("@elementor/ui");
|
|
1739
1740
|
var import_i18n19 = require("@wordpress/i18n");
|
|
1740
1741
|
var sideIcons = {
|
|
1741
|
-
left: /* @__PURE__ */
|
|
1742
|
-
right: /* @__PURE__ */
|
|
1743
|
-
top: /* @__PURE__ */
|
|
1744
|
-
bottom: /* @__PURE__ */
|
|
1742
|
+
left: /* @__PURE__ */ React37.createElement(import_icons15.SideLeftIcon, { fontSize: "tiny" }),
|
|
1743
|
+
right: /* @__PURE__ */ React37.createElement(import_icons15.SideRightIcon, { fontSize: "tiny" }),
|
|
1744
|
+
top: /* @__PURE__ */ React37.createElement(import_icons15.SideTopIcon, { fontSize: "tiny" }),
|
|
1745
|
+
bottom: /* @__PURE__ */ React37.createElement(import_icons15.SideBottomIcon, { fontSize: "tiny" })
|
|
1745
1746
|
};
|
|
1746
1747
|
var DimensionsField = () => {
|
|
1747
|
-
return /* @__PURE__ */
|
|
1748
|
+
return /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(import_ui28.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(DimensionField, { side: "top", label: (0, import_i18n19.__)("Top", "elementor") }), /* @__PURE__ */ React37.createElement(DimensionField, { side: "right", label: (0, import_i18n19.__)("Right", "elementor") })), /* @__PURE__ */ React37.createElement(import_ui28.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(DimensionField, { side: "bottom", label: (0, import_i18n19.__)("Bottom", "elementor") }), /* @__PURE__ */ React37.createElement(DimensionField, { side: "left", label: (0, import_i18n19.__)("Left", "elementor") })));
|
|
1748
1749
|
};
|
|
1749
1750
|
var DimensionField = ({ side, label }) => {
|
|
1750
|
-
return /* @__PURE__ */
|
|
1751
|
+
return /* @__PURE__ */ React37.createElement(import_ui28.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React37.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(import_editor_controls23.ControlLabel, null, label)), /* @__PURE__ */ React37.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(StylesField, { bind: side }, /* @__PURE__ */ React37.createElement(import_editor_controls23.SizeControl, { startIcon: sideIcons[side] }))));
|
|
1751
1752
|
};
|
|
1752
1753
|
|
|
1753
1754
|
// src/components/style-sections/position-section/position-field.tsx
|
|
1754
|
-
var
|
|
1755
|
+
var React38 = __toESM(require("react"));
|
|
1755
1756
|
var import_editor_controls24 = require("@elementor/editor-controls");
|
|
1756
|
-
var
|
|
1757
|
+
var import_ui29 = require("@elementor/ui");
|
|
1757
1758
|
var import_i18n20 = require("@wordpress/i18n");
|
|
1758
1759
|
var positionOptions = [
|
|
1759
1760
|
{ label: (0, import_i18n20.__)("Static", "elementor"), value: "static" },
|
|
@@ -1763,16 +1764,16 @@ var positionOptions = [
|
|
|
1763
1764
|
{ label: (0, import_i18n20.__)("Sticky", "elementor"), value: "sticky" }
|
|
1764
1765
|
];
|
|
1765
1766
|
var PositionField = ({ onChange }) => {
|
|
1766
|
-
return /* @__PURE__ */
|
|
1767
|
+
return /* @__PURE__ */ React38.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React38.createElement(import_ui29.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React38.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(import_editor_controls24.ControlLabel, null, (0, import_i18n20.__)("Position", "elementor"))), /* @__PURE__ */ React38.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(import_editor_controls24.SelectControl, { options: positionOptions, onChange }))));
|
|
1767
1768
|
};
|
|
1768
1769
|
|
|
1769
1770
|
// src/components/style-sections/position-section/z-index-field.tsx
|
|
1770
|
-
var
|
|
1771
|
+
var React39 = __toESM(require("react"));
|
|
1771
1772
|
var import_editor_controls25 = require("@elementor/editor-controls");
|
|
1772
|
-
var
|
|
1773
|
+
var import_ui30 = require("@elementor/ui");
|
|
1773
1774
|
var import_i18n21 = require("@wordpress/i18n");
|
|
1774
1775
|
var ZIndexField = () => {
|
|
1775
|
-
return /* @__PURE__ */
|
|
1776
|
+
return /* @__PURE__ */ React39.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React39.createElement(import_ui30.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(import_editor_controls25.ControlLabel, null, (0, import_i18n21.__)("Z-Index", "elementor"))), /* @__PURE__ */ React39.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(import_editor_controls25.NumberControl, null))));
|
|
1776
1777
|
};
|
|
1777
1778
|
|
|
1778
1779
|
// src/components/style-sections/position-section/position-section.tsx
|
|
@@ -1804,7 +1805,7 @@ var PositionSection = () => {
|
|
|
1804
1805
|
}
|
|
1805
1806
|
};
|
|
1806
1807
|
const isNotStatic = positionValue && positionValue?.value !== "static";
|
|
1807
|
-
return /* @__PURE__ */
|
|
1808
|
+
return /* @__PURE__ */ React40.createElement(import_ui31.Stack, { gap: 1.5 }, /* @__PURE__ */ React40.createElement(PositionField, { onChange: onPositionChange }), isNotStatic ? /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(DimensionsField, null), /* @__PURE__ */ React40.createElement(ZIndexField, null)) : null);
|
|
1808
1809
|
};
|
|
1809
1810
|
var usePersistDimensions = () => {
|
|
1810
1811
|
const { id: styleDefID, meta } = useStyle();
|
|
@@ -1814,90 +1815,90 @@ var usePersistDimensions = () => {
|
|
|
1814
1815
|
};
|
|
1815
1816
|
|
|
1816
1817
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1817
|
-
var
|
|
1818
|
+
var React42 = __toESM(require("react"));
|
|
1818
1819
|
var import_editor_controls27 = require("@elementor/editor-controls");
|
|
1819
|
-
var
|
|
1820
|
+
var import_ui33 = require("@elementor/ui");
|
|
1820
1821
|
var import_i18n23 = require("@wordpress/i18n");
|
|
1821
1822
|
|
|
1822
1823
|
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1823
|
-
var
|
|
1824
|
+
var React41 = __toESM(require("react"));
|
|
1824
1825
|
var import_editor_controls26 = require("@elementor/editor-controls");
|
|
1825
1826
|
var import_icons16 = require("@elementor/icons");
|
|
1826
|
-
var
|
|
1827
|
+
var import_ui32 = require("@elementor/ui");
|
|
1827
1828
|
var import_i18n22 = require("@wordpress/i18n");
|
|
1828
1829
|
var options6 = [
|
|
1829
1830
|
{
|
|
1830
1831
|
value: "visible",
|
|
1831
1832
|
label: (0, import_i18n22.__)("Visible", "elementor"),
|
|
1832
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1833
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(import_icons16.EyeIcon, { fontSize: size }),
|
|
1833
1834
|
showTooltip: true
|
|
1834
1835
|
},
|
|
1835
1836
|
{
|
|
1836
1837
|
value: "hidden",
|
|
1837
1838
|
label: (0, import_i18n22.__)("Hidden", "elementor"),
|
|
1838
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1839
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(import_icons16.EyeOffIcon, { fontSize: size }),
|
|
1839
1840
|
showTooltip: true
|
|
1840
1841
|
},
|
|
1841
1842
|
{
|
|
1842
1843
|
value: "auto",
|
|
1843
1844
|
label: (0, import_i18n22.__)("Auto", "elementor"),
|
|
1844
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1845
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(import_icons16.ExpandBottomIcon, { fontSize: size }),
|
|
1845
1846
|
showTooltip: true
|
|
1846
1847
|
}
|
|
1847
1848
|
];
|
|
1848
1849
|
var OverflowField = () => {
|
|
1849
|
-
return /* @__PURE__ */
|
|
1850
|
+
return /* @__PURE__ */ React41.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React41.createElement(import_ui32.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(import_editor_controls26.ControlLabel, null, (0, import_i18n22.__)("Overflow", "elementor"))), /* @__PURE__ */ React41.createElement(import_ui32.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React41.createElement(import_editor_controls26.ToggleControl, { options: options6 }))));
|
|
1850
1851
|
};
|
|
1851
1852
|
|
|
1852
1853
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1853
1854
|
var SizeSection = () => {
|
|
1854
|
-
return /* @__PURE__ */
|
|
1855
|
+
return /* @__PURE__ */ React42.createElement(import_ui33.Stack, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(import_ui33.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "width", label: (0, import_i18n23.__)("Width", "elementor") })), /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "height", label: (0, import_i18n23.__)("Height", "elementor") }))), /* @__PURE__ */ React42.createElement(import_ui33.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "min-width", label: (0, import_i18n23.__)("Min. Width", "elementor") })), /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "min-height", label: (0, import_i18n23.__)("Min. Height", "elementor") }))), /* @__PURE__ */ React42.createElement(import_ui33.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "max-width", label: (0, import_i18n23.__)("Max. Width", "elementor") })), /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "max-height", label: (0, import_i18n23.__)("Max. Height", "elementor") }))), /* @__PURE__ */ React42.createElement(import_ui33.Divider, null), /* @__PURE__ */ React42.createElement(import_ui33.Stack, null, /* @__PURE__ */ React42.createElement(OverflowField, null)));
|
|
1855
1856
|
};
|
|
1856
1857
|
var SizeField = ({ label, bind }) => {
|
|
1857
|
-
return /* @__PURE__ */
|
|
1858
|
+
return /* @__PURE__ */ React42.createElement(StylesField, { bind }, /* @__PURE__ */ React42.createElement(import_ui33.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React42.createElement(import_editor_controls27.ControlLabel, null, label)), /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React42.createElement(import_editor_controls27.SizeControl, null))));
|
|
1858
1859
|
};
|
|
1859
1860
|
|
|
1860
1861
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1861
|
-
var
|
|
1862
|
+
var React43 = __toESM(require("react"));
|
|
1862
1863
|
var import_editor_controls28 = require("@elementor/editor-controls");
|
|
1863
|
-
var
|
|
1864
|
+
var import_ui34 = require("@elementor/ui");
|
|
1864
1865
|
var import_i18n24 = require("@wordpress/i18n");
|
|
1865
1866
|
var SpacingSection = () => {
|
|
1866
|
-
return /* @__PURE__ */
|
|
1867
|
+
return /* @__PURE__ */ React43.createElement(import_ui34.Stack, { gap: 1.5 }, /* @__PURE__ */ React43.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React43.createElement(import_editor_controls28.LinkedDimensionsControl, { label: (0, import_i18n24.__)("Padding", "elementor") })), /* @__PURE__ */ React43.createElement(import_ui34.Divider, null), /* @__PURE__ */ React43.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React43.createElement(import_editor_controls28.LinkedDimensionsControl, { label: (0, import_i18n24.__)("Margin", "elementor") })));
|
|
1867
1868
|
};
|
|
1868
1869
|
|
|
1869
1870
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1870
|
-
var
|
|
1871
|
-
var
|
|
1871
|
+
var React57 = __toESM(require("react"));
|
|
1872
|
+
var import_ui47 = require("@elementor/ui");
|
|
1872
1873
|
|
|
1873
1874
|
// src/components/collapsible-content.tsx
|
|
1874
|
-
var
|
|
1875
|
-
var
|
|
1876
|
-
var
|
|
1875
|
+
var React44 = __toESM(require("react"));
|
|
1876
|
+
var import_react14 = require("react");
|
|
1877
|
+
var import_ui35 = require("@elementor/ui");
|
|
1877
1878
|
var import_i18n25 = require("@wordpress/i18n");
|
|
1878
1879
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
1879
|
-
const [open, setOpen] = (0,
|
|
1880
|
+
const [open, setOpen] = (0, import_react14.useState)(defaultOpen);
|
|
1880
1881
|
const handleToggle = () => {
|
|
1881
1882
|
setOpen((prevOpen) => !prevOpen);
|
|
1882
1883
|
};
|
|
1883
|
-
return /* @__PURE__ */
|
|
1884
|
-
|
|
1884
|
+
return /* @__PURE__ */ React44.createElement(import_ui35.Stack, { sx: { py: 0.5 } }, /* @__PURE__ */ React44.createElement(
|
|
1885
|
+
import_ui35.Button,
|
|
1885
1886
|
{
|
|
1886
1887
|
fullWidth: true,
|
|
1887
1888
|
size: "small",
|
|
1888
1889
|
color: "secondary",
|
|
1889
1890
|
variant: "outlined",
|
|
1890
1891
|
onClick: handleToggle,
|
|
1891
|
-
endIcon: /* @__PURE__ */
|
|
1892
|
+
endIcon: /* @__PURE__ */ React44.createElement(CollapseIcon, { open })
|
|
1892
1893
|
},
|
|
1893
1894
|
open ? (0, import_i18n25.__)("Show less", "elementor") : (0, import_i18n25.__)("Show more", "elementor")
|
|
1894
|
-
), /* @__PURE__ */
|
|
1895
|
+
), /* @__PURE__ */ React44.createElement(import_ui35.Collapse, { in: open, timeout: "auto", unmountOnExit: true }, children));
|
|
1895
1896
|
};
|
|
1896
1897
|
|
|
1897
1898
|
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1898
|
-
var
|
|
1899
|
+
var React45 = __toESM(require("react"));
|
|
1899
1900
|
var import_editor_controls29 = require("@elementor/editor-controls");
|
|
1900
|
-
var
|
|
1901
|
+
var import_ui36 = require("@elementor/ui");
|
|
1901
1902
|
var import_i18n26 = require("@wordpress/i18n");
|
|
1902
1903
|
|
|
1903
1904
|
// src/sync/get-elementor-config.ts
|
|
@@ -1912,7 +1913,7 @@ var FontFamilyField = () => {
|
|
|
1912
1913
|
if (!fontFamilies) {
|
|
1913
1914
|
return null;
|
|
1914
1915
|
}
|
|
1915
|
-
return /* @__PURE__ */
|
|
1916
|
+
return /* @__PURE__ */ React45.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React45.createElement(import_ui36.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(import_ui36.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(import_editor_controls29.ControlLabel, null, (0, import_i18n26.__)("Font Family", "elementor"))), /* @__PURE__ */ React45.createElement(import_ui36.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(import_editor_controls29.FontFamilyControl, { fontFamilies }))));
|
|
1916
1917
|
};
|
|
1917
1918
|
var getFontFamilies = () => {
|
|
1918
1919
|
const { controls } = getElementorConfig();
|
|
@@ -1924,18 +1925,18 @@ var getFontFamilies = () => {
|
|
|
1924
1925
|
};
|
|
1925
1926
|
|
|
1926
1927
|
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1927
|
-
var
|
|
1928
|
+
var React46 = __toESM(require("react"));
|
|
1928
1929
|
var import_editor_controls30 = require("@elementor/editor-controls");
|
|
1929
|
-
var
|
|
1930
|
+
var import_ui37 = require("@elementor/ui");
|
|
1930
1931
|
var import_i18n27 = require("@wordpress/i18n");
|
|
1931
1932
|
var FontSizeField = () => {
|
|
1932
|
-
return /* @__PURE__ */
|
|
1933
|
+
return /* @__PURE__ */ React46.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React46.createElement(import_ui37.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(import_editor_controls30.ControlLabel, null, (0, import_i18n27.__)("Font Size", "elementor"))), /* @__PURE__ */ React46.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(import_editor_controls30.SizeControl, null))));
|
|
1933
1934
|
};
|
|
1934
1935
|
|
|
1935
1936
|
// src/components/style-sections/typography-section/font-weight-field.tsx
|
|
1936
|
-
var
|
|
1937
|
+
var React47 = __toESM(require("react"));
|
|
1937
1938
|
var import_editor_controls31 = require("@elementor/editor-controls");
|
|
1938
|
-
var
|
|
1939
|
+
var import_ui38 = require("@elementor/ui");
|
|
1939
1940
|
var import_i18n28 = require("@wordpress/i18n");
|
|
1940
1941
|
var fontWeightOptions = [
|
|
1941
1942
|
{ label: (0, import_i18n28.__)("Light - 400", "elementor"), value: "400" },
|
|
@@ -1945,92 +1946,92 @@ var fontWeightOptions = [
|
|
|
1945
1946
|
{ label: (0, import_i18n28.__)("Black - 900", "elementor"), value: "900" }
|
|
1946
1947
|
];
|
|
1947
1948
|
var FontWeightField = () => {
|
|
1948
|
-
return /* @__PURE__ */
|
|
1949
|
+
return /* @__PURE__ */ React47.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React47.createElement(import_ui38.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React47.createElement(import_ui38.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(import_editor_controls31.ControlLabel, null, (0, import_i18n28.__)("Font Weight", "elementor"))), /* @__PURE__ */ React47.createElement(import_ui38.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(import_editor_controls31.SelectControl, { options: fontWeightOptions }))));
|
|
1949
1950
|
};
|
|
1950
1951
|
|
|
1951
1952
|
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
1952
|
-
var
|
|
1953
|
+
var React48 = __toESM(require("react"));
|
|
1953
1954
|
var import_editor_controls32 = require("@elementor/editor-controls");
|
|
1954
|
-
var
|
|
1955
|
+
var import_ui39 = require("@elementor/ui");
|
|
1955
1956
|
var import_i18n29 = require("@wordpress/i18n");
|
|
1956
1957
|
var LetterSpacingField = () => {
|
|
1957
|
-
return /* @__PURE__ */
|
|
1958
|
+
return /* @__PURE__ */ React48.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React48.createElement(import_ui39.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React48.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(import_editor_controls32.ControlLabel, null, (0, import_i18n29.__)("Letter Spacing", "elementor"))), /* @__PURE__ */ React48.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(import_editor_controls32.SizeControl, null))));
|
|
1958
1959
|
};
|
|
1959
1960
|
|
|
1960
1961
|
// src/components/style-sections/typography-section/line-height-field.tsx
|
|
1961
|
-
var
|
|
1962
|
+
var React49 = __toESM(require("react"));
|
|
1962
1963
|
var import_editor_controls33 = require("@elementor/editor-controls");
|
|
1963
|
-
var
|
|
1964
|
+
var import_ui40 = require("@elementor/ui");
|
|
1964
1965
|
var import_i18n30 = require("@wordpress/i18n");
|
|
1965
1966
|
var LineHeightField = () => {
|
|
1966
|
-
return /* @__PURE__ */
|
|
1967
|
+
return /* @__PURE__ */ React49.createElement(StylesField, { bind: "line-height" }, /* @__PURE__ */ React49.createElement(import_ui40.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React49.createElement(import_ui40.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(import_editor_controls33.ControlLabel, null, (0, import_i18n30.__)("Line Height", "elementor"))), /* @__PURE__ */ React49.createElement(import_ui40.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(import_editor_controls33.SizeControl, null))));
|
|
1967
1968
|
};
|
|
1968
1969
|
|
|
1969
1970
|
// src/components/style-sections/typography-section/text-alignment-field.tsx
|
|
1970
|
-
var
|
|
1971
|
+
var React50 = __toESM(require("react"));
|
|
1971
1972
|
var import_editor_controls34 = require("@elementor/editor-controls");
|
|
1972
1973
|
var import_icons17 = require("@elementor/icons");
|
|
1973
|
-
var
|
|
1974
|
+
var import_ui41 = require("@elementor/ui");
|
|
1974
1975
|
var import_i18n31 = require("@wordpress/i18n");
|
|
1975
1976
|
var options7 = [
|
|
1976
1977
|
{
|
|
1977
1978
|
value: "left",
|
|
1978
1979
|
label: (0, import_i18n31.__)("Left", "elementor"),
|
|
1979
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1980
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons17.AlignLeftIcon, { fontSize: size })
|
|
1980
1981
|
},
|
|
1981
1982
|
{
|
|
1982
1983
|
value: "center",
|
|
1983
1984
|
label: (0, import_i18n31.__)("Center", "elementor"),
|
|
1984
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1985
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons17.AlignCenterIcon, { fontSize: size })
|
|
1985
1986
|
},
|
|
1986
1987
|
{
|
|
1987
1988
|
value: "right",
|
|
1988
1989
|
label: (0, import_i18n31.__)("Right", "elementor"),
|
|
1989
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1990
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons17.AlignRightIcon, { fontSize: size })
|
|
1990
1991
|
},
|
|
1991
1992
|
{
|
|
1992
1993
|
value: "justify",
|
|
1993
1994
|
label: (0, import_i18n31.__)("Justify", "elementor"),
|
|
1994
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1995
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons17.AlignJustifiedIcon, { fontSize: size })
|
|
1995
1996
|
}
|
|
1996
1997
|
];
|
|
1997
1998
|
var TextAlignmentField = () => {
|
|
1998
|
-
return /* @__PURE__ */
|
|
1999
|
+
return /* @__PURE__ */ React50.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React50.createElement(import_ui41.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React50.createElement(import_ui41.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(import_editor_controls34.ControlLabel, null, (0, import_i18n31.__)("Alignment", "elementor"))), /* @__PURE__ */ React50.createElement(import_ui41.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React50.createElement(import_editor_controls34.ToggleControl, { options: options7 }))));
|
|
1999
2000
|
};
|
|
2000
2001
|
|
|
2001
2002
|
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
2002
|
-
var
|
|
2003
|
+
var React51 = __toESM(require("react"));
|
|
2003
2004
|
var import_editor_controls35 = require("@elementor/editor-controls");
|
|
2004
|
-
var
|
|
2005
|
+
var import_ui42 = require("@elementor/ui");
|
|
2005
2006
|
var import_i18n32 = require("@wordpress/i18n");
|
|
2006
2007
|
var TextColorField = () => {
|
|
2007
|
-
return /* @__PURE__ */
|
|
2008
|
+
return /* @__PURE__ */ React51.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React51.createElement(import_ui42.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React51.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(import_editor_controls35.ControlLabel, null, (0, import_i18n32.__)("Text Color", "elementor"))), /* @__PURE__ */ React51.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(import_editor_controls35.ColorControl, null))));
|
|
2008
2009
|
};
|
|
2009
2010
|
|
|
2010
2011
|
// src/components/style-sections/typography-section/text-direction-field.tsx
|
|
2011
|
-
var
|
|
2012
|
+
var React52 = __toESM(require("react"));
|
|
2012
2013
|
var import_editor_controls36 = require("@elementor/editor-controls");
|
|
2013
2014
|
var import_icons18 = require("@elementor/icons");
|
|
2014
|
-
var
|
|
2015
|
+
var import_ui43 = require("@elementor/ui");
|
|
2015
2016
|
var import_i18n33 = require("@wordpress/i18n");
|
|
2016
2017
|
var options8 = [
|
|
2017
2018
|
{
|
|
2018
2019
|
value: "ltr",
|
|
2019
2020
|
label: (0, import_i18n33.__)("Left to Right", "elementor"),
|
|
2020
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2021
|
+
renderContent: ({ size }) => /* @__PURE__ */ React52.createElement(import_icons18.TextDirectionLtrIcon, { fontSize: size })
|
|
2021
2022
|
},
|
|
2022
2023
|
{
|
|
2023
2024
|
value: "rtl",
|
|
2024
2025
|
label: (0, import_i18n33.__)("Right to Left", "elementor"),
|
|
2025
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2026
|
+
renderContent: ({ size }) => /* @__PURE__ */ React52.createElement(import_icons18.TextDirectionRtlIcon, { fontSize: size })
|
|
2026
2027
|
}
|
|
2027
2028
|
];
|
|
2028
2029
|
var TextDirectionField = () => {
|
|
2029
|
-
return /* @__PURE__ */
|
|
2030
|
+
return /* @__PURE__ */ React52.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React52.createElement(import_ui43.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React52.createElement(import_ui43.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(import_editor_controls36.ControlLabel, null, (0, import_i18n33.__)("Direction", "elementor"))), /* @__PURE__ */ React52.createElement(import_ui43.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React52.createElement(import_editor_controls36.ToggleControl, { options: options8 }))));
|
|
2030
2031
|
};
|
|
2031
2032
|
|
|
2032
2033
|
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
2033
|
-
var
|
|
2034
|
+
var React53 = __toESM(require("react"));
|
|
2034
2035
|
var import_editor_controls37 = require("@elementor/editor-controls");
|
|
2035
2036
|
var import_i18n34 = require("@wordpress/i18n");
|
|
2036
2037
|
var initTextStroke = {
|
|
@@ -2058,7 +2059,7 @@ var TextStrokeField = () => {
|
|
|
2058
2059
|
setTextStroke(null);
|
|
2059
2060
|
};
|
|
2060
2061
|
const hasTextStroke = Boolean(textStroke);
|
|
2061
|
-
return /* @__PURE__ */
|
|
2062
|
+
return /* @__PURE__ */ React53.createElement(
|
|
2062
2063
|
AddOrRemoveContent,
|
|
2063
2064
|
{
|
|
2064
2065
|
label: (0, import_i18n34.__)("Text Stroke", "elementor"),
|
|
@@ -2066,15 +2067,15 @@ var TextStrokeField = () => {
|
|
|
2066
2067
|
onAdd: addTextStroke,
|
|
2067
2068
|
onRemove: removeTextStroke
|
|
2068
2069
|
},
|
|
2069
|
-
/* @__PURE__ */
|
|
2070
|
+
/* @__PURE__ */ React53.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React53.createElement(import_editor_controls37.StrokeControl, null))
|
|
2070
2071
|
);
|
|
2071
2072
|
};
|
|
2072
2073
|
|
|
2073
2074
|
// src/components/style-sections/typography-section/text-style-field.tsx
|
|
2074
|
-
var
|
|
2075
|
+
var React54 = __toESM(require("react"));
|
|
2075
2076
|
var import_editor_controls38 = require("@elementor/editor-controls");
|
|
2076
2077
|
var import_icons19 = require("@elementor/icons");
|
|
2077
|
-
var
|
|
2078
|
+
var import_ui44 = require("@elementor/ui");
|
|
2078
2079
|
var import_i18n35 = require("@wordpress/i18n");
|
|
2079
2080
|
var buttonSize = "tiny";
|
|
2080
2081
|
var TextStyleField = () => {
|
|
@@ -2099,7 +2100,7 @@ var TextStyleField = () => {
|
|
|
2099
2100
|
value: newValue
|
|
2100
2101
|
});
|
|
2101
2102
|
};
|
|
2102
|
-
return /* @__PURE__ */
|
|
2103
|
+
return /* @__PURE__ */ React54.createElement(import_ui44.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(import_editor_controls38.ControlLabel, null, (0, import_i18n35.__)("Style", "elementor"))), /* @__PURE__ */ React54.createElement(import_ui44.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React54.createElement(import_ui44.ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React54.createElement(
|
|
2103
2104
|
ToggleButton,
|
|
2104
2105
|
{
|
|
2105
2106
|
value: "italic",
|
|
@@ -2107,8 +2108,8 @@ var TextStyleField = () => {
|
|
|
2107
2108
|
"aria-label": "italic",
|
|
2108
2109
|
sx: { marginLeft: "auto" }
|
|
2109
2110
|
},
|
|
2110
|
-
/* @__PURE__ */
|
|
2111
|
-
), /* @__PURE__ */
|
|
2111
|
+
/* @__PURE__ */ React54.createElement(import_icons19.ItalicIcon, { fontSize: buttonSize })
|
|
2112
|
+
), /* @__PURE__ */ React54.createElement(
|
|
2112
2113
|
ShorthandControl,
|
|
2113
2114
|
{
|
|
2114
2115
|
value: "line-through",
|
|
@@ -2116,8 +2117,8 @@ var TextStyleField = () => {
|
|
|
2116
2117
|
updateValues: handleSetTextDecoration,
|
|
2117
2118
|
"aria-label": "line-through"
|
|
2118
2119
|
},
|
|
2119
|
-
/* @__PURE__ */
|
|
2120
|
-
), /* @__PURE__ */
|
|
2120
|
+
/* @__PURE__ */ React54.createElement(import_icons19.StrikethroughIcon, { fontSize: buttonSize })
|
|
2121
|
+
), /* @__PURE__ */ React54.createElement(
|
|
2121
2122
|
ShorthandControl,
|
|
2122
2123
|
{
|
|
2123
2124
|
value: "underline",
|
|
@@ -2125,7 +2126,7 @@ var TextStyleField = () => {
|
|
|
2125
2126
|
updateValues: handleSetTextDecoration,
|
|
2126
2127
|
"aria-label": "underline"
|
|
2127
2128
|
},
|
|
2128
|
-
/* @__PURE__ */
|
|
2129
|
+
/* @__PURE__ */ React54.createElement(import_icons19.UnderlineIcon, { fontSize: buttonSize })
|
|
2129
2130
|
))));
|
|
2130
2131
|
};
|
|
2131
2132
|
var ShorthandControl = ({
|
|
@@ -2144,52 +2145,52 @@ var ShorthandControl = ({
|
|
|
2144
2145
|
updateValues([...valuesArr, newValue].join(" "));
|
|
2145
2146
|
}
|
|
2146
2147
|
};
|
|
2147
|
-
return /* @__PURE__ */
|
|
2148
|
+
return /* @__PURE__ */ React54.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
2148
2149
|
};
|
|
2149
2150
|
var ToggleButton = ({ onChange, ...props }) => {
|
|
2150
2151
|
const handleChange = (_e, newValue) => {
|
|
2151
2152
|
onChange(newValue);
|
|
2152
2153
|
};
|
|
2153
|
-
return /* @__PURE__ */
|
|
2154
|
+
return /* @__PURE__ */ React54.createElement(import_ui44.ToggleButton, { ...props, onChange: handleChange, size: buttonSize });
|
|
2154
2155
|
};
|
|
2155
2156
|
|
|
2156
2157
|
// src/components/style-sections/typography-section/transform-field.tsx
|
|
2157
|
-
var
|
|
2158
|
+
var React55 = __toESM(require("react"));
|
|
2158
2159
|
var import_editor_controls39 = require("@elementor/editor-controls");
|
|
2159
2160
|
var import_icons20 = require("@elementor/icons");
|
|
2160
|
-
var
|
|
2161
|
+
var import_ui45 = require("@elementor/ui");
|
|
2161
2162
|
var import_i18n36 = require("@wordpress/i18n");
|
|
2162
2163
|
var options9 = [
|
|
2163
2164
|
{
|
|
2164
2165
|
value: "capitalize",
|
|
2165
2166
|
label: (0, import_i18n36.__)("Capitalize", "elementor"),
|
|
2166
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2167
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(import_icons20.LetterCaseIcon, { fontSize: size })
|
|
2167
2168
|
},
|
|
2168
2169
|
{
|
|
2169
2170
|
value: "uppercase",
|
|
2170
2171
|
label: (0, import_i18n36.__)("Uppercase", "elementor"),
|
|
2171
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2172
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(import_icons20.LetterCaseUpperIcon, { fontSize: size })
|
|
2172
2173
|
},
|
|
2173
2174
|
{
|
|
2174
2175
|
value: "lowercase",
|
|
2175
2176
|
label: (0, import_i18n36.__)("Lowercase", "elementor"),
|
|
2176
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2177
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(import_icons20.LetterCaseLowerIcon, { fontSize: size })
|
|
2177
2178
|
}
|
|
2178
2179
|
];
|
|
2179
|
-
var TransformField = () => /* @__PURE__ */
|
|
2180
|
+
var TransformField = () => /* @__PURE__ */ React55.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React55.createElement(import_ui45.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React55.createElement(import_ui45.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React55.createElement(import_editor_controls39.ControlLabel, null, (0, import_i18n36.__)("Transform", "elementor"))), /* @__PURE__ */ React55.createElement(import_ui45.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React55.createElement(import_editor_controls39.ToggleControl, { options: options9 }))));
|
|
2180
2181
|
|
|
2181
2182
|
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
2182
|
-
var
|
|
2183
|
+
var React56 = __toESM(require("react"));
|
|
2183
2184
|
var import_editor_controls40 = require("@elementor/editor-controls");
|
|
2184
|
-
var
|
|
2185
|
+
var import_ui46 = require("@elementor/ui");
|
|
2185
2186
|
var import_i18n37 = require("@wordpress/i18n");
|
|
2186
2187
|
var WordSpacingField = () => {
|
|
2187
|
-
return /* @__PURE__ */
|
|
2188
|
+
return /* @__PURE__ */ React56.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React56.createElement(import_ui46.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(import_ui46.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(import_editor_controls40.ControlLabel, null, (0, import_i18n37.__)("Word Spacing", "elementor"))), /* @__PURE__ */ React56.createElement(import_ui46.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(import_editor_controls40.SizeControl, null))));
|
|
2188
2189
|
};
|
|
2189
2190
|
|
|
2190
2191
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
2191
2192
|
var TypographySection = () => {
|
|
2192
|
-
return /* @__PURE__ */
|
|
2193
|
+
return /* @__PURE__ */ React57.createElement(import_ui47.Stack, { gap: 1.5 }, /* @__PURE__ */ React57.createElement(FontFamilyField, null), /* @__PURE__ */ React57.createElement(FontWeightField, null), /* @__PURE__ */ React57.createElement(FontSizeField, null), /* @__PURE__ */ React57.createElement(import_ui47.Divider, null), /* @__PURE__ */ React57.createElement(TextAlignmentField, null), /* @__PURE__ */ React57.createElement(TextColorField, null), /* @__PURE__ */ React57.createElement(CollapsibleContent, null, /* @__PURE__ */ React57.createElement(import_ui47.Stack, { gap: 1.5, sx: { pt: 1.5 } }, /* @__PURE__ */ React57.createElement(LineHeightField, null), /* @__PURE__ */ React57.createElement(LetterSpacingField, null), /* @__PURE__ */ React57.createElement(WordSpacingField, null), /* @__PURE__ */ React57.createElement(import_ui47.Divider, null), /* @__PURE__ */ React57.createElement(TextStyleField, null), /* @__PURE__ */ React57.createElement(TransformField, null), /* @__PURE__ */ React57.createElement(TextDirectionField, null), /* @__PURE__ */ React57.createElement(TextStrokeField, null))));
|
|
2193
2194
|
};
|
|
2194
2195
|
|
|
2195
2196
|
// src/components/style-tab.tsx
|
|
@@ -2197,9 +2198,9 @@ var CLASSES_PROP_KEY = "classes";
|
|
|
2197
2198
|
var StyleTab = () => {
|
|
2198
2199
|
const currentClassesProp = useCurrentClassesProp();
|
|
2199
2200
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
2200
|
-
const [activeStyleState, setActiveStyleState] = (0,
|
|
2201
|
+
const [activeStyleState, setActiveStyleState] = (0, import_react15.useState)(null);
|
|
2201
2202
|
const breakpoint = (0, import_editor_responsive.useActiveBreakpoint)();
|
|
2202
|
-
return /* @__PURE__ */
|
|
2203
|
+
return /* @__PURE__ */ React58.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React58.createElement(
|
|
2203
2204
|
StyleProvider,
|
|
2204
2205
|
{
|
|
2205
2206
|
meta: { breakpoint, state: activeStyleState },
|
|
@@ -2210,18 +2211,18 @@ var StyleTab = () => {
|
|
|
2210
2211
|
},
|
|
2211
2212
|
setMetaState: setActiveStyleState
|
|
2212
2213
|
},
|
|
2213
|
-
/* @__PURE__ */
|
|
2214
|
+
/* @__PURE__ */ React58.createElement(import_session2.SessionStorageProvider, { prefix: activeStyleDefId ?? "" }, /* @__PURE__ */ React58.createElement(CssClassSelector, null), /* @__PURE__ */ React58.createElement(import_ui48.Divider, null), /* @__PURE__ */ React58.createElement(SectionsList, null, /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n38.__)("Layout", "elementor") }, /* @__PURE__ */ React58.createElement(LayoutSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n38.__)("Spacing", "elementor") }, /* @__PURE__ */ React58.createElement(SpacingSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n38.__)("Size", "elementor") }, /* @__PURE__ */ React58.createElement(SizeSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n38.__)("Position", "elementor") }, /* @__PURE__ */ React58.createElement(PositionSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n38.__)("Typography", "elementor") }, /* @__PURE__ */ React58.createElement(TypographySection, null)), /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n38.__)("Background", "elementor") }, /* @__PURE__ */ React58.createElement(BackgroundSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n38.__)("Border", "elementor") }, /* @__PURE__ */ React58.createElement(BorderSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n38.__)("Effects", "elementor") }, /* @__PURE__ */ React58.createElement(EffectsSection, null))))
|
|
2214
2215
|
));
|
|
2215
2216
|
};
|
|
2216
2217
|
function useActiveStyleDefId(currentClassesProp) {
|
|
2217
|
-
const [activeStyledDefId, setActiveStyledDefId] = (0,
|
|
2218
|
+
const [activeStyledDefId, setActiveStyledDefId] = (0, import_react15.useState)(null);
|
|
2218
2219
|
const fallback = useFirstElementStyleDef(currentClassesProp);
|
|
2219
2220
|
return [activeStyledDefId || fallback?.id || null, setActiveStyledDefId];
|
|
2220
2221
|
}
|
|
2221
2222
|
function useFirstElementStyleDef(currentClassesProp) {
|
|
2222
2223
|
const { element } = useElement();
|
|
2223
|
-
const classesIds = (0,
|
|
2224
|
-
const stylesDefs = (0,
|
|
2224
|
+
const classesIds = (0, import_editor_elements6.useElementSetting)(element.id, currentClassesProp)?.value || [];
|
|
2225
|
+
const stylesDefs = (0, import_editor_elements6.useElementStyles)(element.id);
|
|
2225
2226
|
return Object.values(stylesDefs).find((styleDef) => classesIds.includes(styleDef.id));
|
|
2226
2227
|
}
|
|
2227
2228
|
function useCurrentClassesProp() {
|
|
@@ -2238,25 +2239,25 @@ function useCurrentClassesProp() {
|
|
|
2238
2239
|
// src/components/editing-panel-tabs.tsx
|
|
2239
2240
|
var EditingPanelTabs = () => {
|
|
2240
2241
|
const { element } = useElement();
|
|
2241
|
-
const { getTabProps, getTabPanelProps, getTabsProps } = (0,
|
|
2242
|
+
const { getTabProps, getTabPanelProps, getTabsProps } = (0, import_ui49.useTabs)("settings");
|
|
2242
2243
|
return (
|
|
2243
2244
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
2244
2245
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
2245
|
-
/* @__PURE__ */
|
|
2246
|
+
/* @__PURE__ */ React59.createElement(import_react16.Fragment, { key: element.id }, /* @__PURE__ */ React59.createElement(import_ui49.Stack, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React59.createElement(import_ui49.Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React59.createElement(import_ui49.Tab, { label: (0, import_i18n39.__)("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React59.createElement(import_ui49.Tab, { label: (0, import_i18n39.__)("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React59.createElement(import_ui49.Divider, null), /* @__PURE__ */ React59.createElement(import_ui49.TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React59.createElement(SettingsTab, null)), /* @__PURE__ */ React59.createElement(import_ui49.TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React59.createElement(StyleTab, null))))
|
|
2246
2247
|
);
|
|
2247
2248
|
};
|
|
2248
2249
|
|
|
2249
2250
|
// src/components/editing-panel.tsx
|
|
2250
2251
|
var { useMenuItems } = controlActionsMenu;
|
|
2251
2252
|
var EditingPanel = () => {
|
|
2252
|
-
const { element, elementType } = (0,
|
|
2253
|
+
const { element, elementType } = (0, import_editor_elements7.useSelectedElement)();
|
|
2253
2254
|
const controlReplacement = getControlReplacement();
|
|
2254
2255
|
const menuItems = useMenuItems().default;
|
|
2255
2256
|
if (!element || !elementType) {
|
|
2256
2257
|
return null;
|
|
2257
2258
|
}
|
|
2258
2259
|
const panelTitle = (0, import_i18n40.__)("Edit %s", "elementor").replace("%s", elementType.title);
|
|
2259
|
-
return /* @__PURE__ */
|
|
2260
|
+
return /* @__PURE__ */ React60.createElement(import_ui50.ErrorBoundary, { fallback: /* @__PURE__ */ React60.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React60.createElement(import_session3.SessionStorageProvider, { prefix: "elementor" }, /* @__PURE__ */ React60.createElement(import_editor_panels.Panel, null, /* @__PURE__ */ React60.createElement(import_editor_panels.PanelHeader, null, /* @__PURE__ */ React60.createElement(import_editor_panels.PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React60.createElement(import_editor_panels.PanelBody, null, /* @__PURE__ */ React60.createElement(import_editor_controls41.ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React60.createElement(import_editor_controls41.ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React60.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React60.createElement(EditingPanelTabs, null))))))));
|
|
2260
2261
|
};
|
|
2261
2262
|
|
|
2262
2263
|
// src/panel.ts
|
|
@@ -2271,15 +2272,15 @@ var import_editor_panels3 = require("@elementor/editor-panels");
|
|
|
2271
2272
|
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
2272
2273
|
|
|
2273
2274
|
// src/hooks/use-close-editor-panel.ts
|
|
2274
|
-
var
|
|
2275
|
-
var
|
|
2275
|
+
var import_react17 = require("react");
|
|
2276
|
+
var import_editor_elements9 = require("@elementor/editor-elements");
|
|
2276
2277
|
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
2277
2278
|
|
|
2278
2279
|
// src/sync/is-atomic-widget-selected.ts
|
|
2279
|
-
var
|
|
2280
|
+
var import_editor_elements8 = require("@elementor/editor-elements");
|
|
2280
2281
|
var isAtomicWidgetSelected = () => {
|
|
2281
|
-
const selectedElements = (0,
|
|
2282
|
-
const widgetCache = (0,
|
|
2282
|
+
const selectedElements = (0, import_editor_elements8.getSelectedElements)();
|
|
2283
|
+
const widgetCache = (0, import_editor_elements8.getWidgetsCache)();
|
|
2283
2284
|
if (selectedElements.length !== 1) {
|
|
2284
2285
|
return false;
|
|
2285
2286
|
}
|
|
@@ -2289,11 +2290,11 @@ var isAtomicWidgetSelected = () => {
|
|
|
2289
2290
|
// src/hooks/use-close-editor-panel.ts
|
|
2290
2291
|
var useCloseEditorPanel = () => {
|
|
2291
2292
|
const { close } = usePanelActions();
|
|
2292
|
-
return (0,
|
|
2293
|
+
return (0, import_react17.useEffect)(() => {
|
|
2293
2294
|
return (0, import_editor_v1_adapters2.__privateListenTo)((0, import_editor_v1_adapters2.commandStartEvent)("document/elements/delete"), (e) => {
|
|
2294
|
-
const selectedElement = (0,
|
|
2295
|
+
const selectedElement = (0, import_editor_elements9.getSelectedElements)()[0];
|
|
2295
2296
|
const { container: deletedContainer } = e?.args;
|
|
2296
|
-
const isSelectedElementInDeletedContainer = deletedContainer && selectedElement && (0,
|
|
2297
|
+
const isSelectedElementInDeletedContainer = deletedContainer && selectedElement && (0, import_editor_elements9.isElementInContainer)(selectedElement, deletedContainer);
|
|
2297
2298
|
if (isSelectedElementInDeletedContainer && isAtomicWidgetSelected()) {
|
|
2298
2299
|
close();
|
|
2299
2300
|
}
|
|
@@ -2302,11 +2303,11 @@ var useCloseEditorPanel = () => {
|
|
|
2302
2303
|
};
|
|
2303
2304
|
|
|
2304
2305
|
// src/hooks/use-open-editor-panel.ts
|
|
2305
|
-
var
|
|
2306
|
+
var import_react18 = require("react");
|
|
2306
2307
|
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
2307
2308
|
var useOpenEditorPanel = () => {
|
|
2308
2309
|
const { open } = usePanelActions();
|
|
2309
|
-
(0,
|
|
2310
|
+
(0, import_react18.useEffect)(() => {
|
|
2310
2311
|
return (0, import_editor_v1_adapters3.__privateListenTo)((0, import_editor_v1_adapters3.commandStartEvent)("panel/editor/open"), () => {
|
|
2311
2312
|
if (isAtomicWidgetSelected()) {
|
|
2312
2313
|
open();
|
|
@@ -2322,68 +2323,12 @@ var EditingPanelHooks = () => {
|
|
|
2322
2323
|
return null;
|
|
2323
2324
|
};
|
|
2324
2325
|
|
|
2325
|
-
// src/hooks/use-unapply-class.ts
|
|
2326
|
-
var import_editor_elements9 = require("@elementor/editor-elements");
|
|
2327
|
-
var useUnapplyClass = (classId) => {
|
|
2328
|
-
const { element } = useElement();
|
|
2329
|
-
const classesProp = useClassesProp();
|
|
2330
|
-
const classes = (0, import_editor_elements9.useElementSetting)(element.id, classesProp);
|
|
2331
|
-
const filteredClasses = classes?.value.filter((className) => className !== classId) ?? [];
|
|
2332
|
-
return () => {
|
|
2333
|
-
(0, import_editor_elements9.updateElementSettings)({
|
|
2334
|
-
id: element.id,
|
|
2335
|
-
props: {
|
|
2336
|
-
[classesProp]: {
|
|
2337
|
-
$$type: "classes",
|
|
2338
|
-
value: filteredClasses
|
|
2339
|
-
}
|
|
2340
|
-
}
|
|
2341
|
-
});
|
|
2342
|
-
};
|
|
2343
|
-
};
|
|
2344
|
-
|
|
2345
|
-
// src/css-classes.ts
|
|
2346
|
-
var STATES = ["hover", "focus", "active"];
|
|
2347
|
-
function initCssClasses() {
|
|
2348
|
-
registerStateItems();
|
|
2349
|
-
registerGlobalClassItems();
|
|
2350
|
-
}
|
|
2351
|
-
function registerStateItems() {
|
|
2352
|
-
registerStateMenuItem({
|
|
2353
|
-
id: "normal",
|
|
2354
|
-
props: {
|
|
2355
|
-
state: null
|
|
2356
|
-
}
|
|
2357
|
-
});
|
|
2358
|
-
STATES.forEach((state) => {
|
|
2359
|
-
registerStateMenuItem({
|
|
2360
|
-
id: state,
|
|
2361
|
-
props: {
|
|
2362
|
-
state
|
|
2363
|
-
}
|
|
2364
|
-
});
|
|
2365
|
-
});
|
|
2366
|
-
}
|
|
2367
|
-
function registerGlobalClassItems() {
|
|
2368
|
-
registerGlobalClassMenuItem({
|
|
2369
|
-
id: "unapply-class",
|
|
2370
|
-
useProps: () => {
|
|
2371
|
-
const { styleId: currentClass } = useCssClassItem();
|
|
2372
|
-
const unapplyClass = useUnapplyClass(currentClass);
|
|
2373
|
-
return {
|
|
2374
|
-
text: "Remove",
|
|
2375
|
-
onClick: unapplyClass
|
|
2376
|
-
};
|
|
2377
|
-
}
|
|
2378
|
-
});
|
|
2379
|
-
}
|
|
2380
|
-
|
|
2381
2326
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
2382
|
-
var
|
|
2383
|
-
var
|
|
2327
|
+
var React63 = __toESM(require("react"));
|
|
2328
|
+
var import_react22 = require("react");
|
|
2384
2329
|
var import_editor_controls45 = require("@elementor/editor-controls");
|
|
2385
2330
|
var import_icons22 = require("@elementor/icons");
|
|
2386
|
-
var
|
|
2331
|
+
var import_ui52 = require("@elementor/ui");
|
|
2387
2332
|
var import_i18n42 = require("@wordpress/i18n");
|
|
2388
2333
|
|
|
2389
2334
|
// src/hooks/use-persist-dynamic-value.ts
|
|
@@ -2394,14 +2339,14 @@ var usePersistDynamicValue = (propKey) => {
|
|
|
2394
2339
|
};
|
|
2395
2340
|
|
|
2396
2341
|
// src/dynamics/dynamic-control.tsx
|
|
2397
|
-
var
|
|
2342
|
+
var React61 = __toESM(require("react"));
|
|
2398
2343
|
var import_editor_controls43 = require("@elementor/editor-controls");
|
|
2399
2344
|
|
|
2400
2345
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2401
|
-
var
|
|
2346
|
+
var import_react20 = require("react");
|
|
2402
2347
|
|
|
2403
2348
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
2404
|
-
var
|
|
2349
|
+
var import_react19 = require("react");
|
|
2405
2350
|
var import_editor_controls42 = require("@elementor/editor-controls");
|
|
2406
2351
|
|
|
2407
2352
|
// src/dynamics/sync/get-elementor-config.ts
|
|
@@ -2453,7 +2398,7 @@ var usePropDynamicTags = () => {
|
|
|
2453
2398
|
const propDynamicType = getDynamicPropType(propType);
|
|
2454
2399
|
categories = propDynamicType?.settings.categories || [];
|
|
2455
2400
|
}
|
|
2456
|
-
return (0,
|
|
2401
|
+
return (0, import_react19.useMemo)(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
2457
2402
|
};
|
|
2458
2403
|
var getDynamicTagsByCategories = (categories) => {
|
|
2459
2404
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -2469,7 +2414,7 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
2469
2414
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2470
2415
|
var useDynamicTag = (tagName) => {
|
|
2471
2416
|
const dynamicTags = usePropDynamicTags();
|
|
2472
|
-
return (0,
|
|
2417
|
+
return (0, import_react20.useMemo)(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
2473
2418
|
};
|
|
2474
2419
|
|
|
2475
2420
|
// src/dynamics/dynamic-control.tsx
|
|
@@ -2493,19 +2438,19 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
2493
2438
|
});
|
|
2494
2439
|
};
|
|
2495
2440
|
const propType = createTopLevelOjectType({ schema: dynamicTag.props_schema });
|
|
2496
|
-
return /* @__PURE__ */
|
|
2441
|
+
return /* @__PURE__ */ React61.createElement(import_editor_controls43.PropProvider, { propType, setValue: setDynamicValue, value: { [bind]: dynamicValue } }, /* @__PURE__ */ React61.createElement(import_editor_controls43.PropKeyProvider, { bind }, children));
|
|
2497
2442
|
};
|
|
2498
2443
|
|
|
2499
2444
|
// src/dynamics/components/dynamic-selection.tsx
|
|
2500
|
-
var
|
|
2501
|
-
var
|
|
2445
|
+
var React62 = __toESM(require("react"));
|
|
2446
|
+
var import_react21 = require("react");
|
|
2502
2447
|
var import_editor_controls44 = require("@elementor/editor-controls");
|
|
2503
2448
|
var import_icons21 = require("@elementor/icons");
|
|
2504
|
-
var
|
|
2449
|
+
var import_ui51 = require("@elementor/ui");
|
|
2505
2450
|
var import_i18n41 = require("@wordpress/i18n");
|
|
2506
2451
|
var SIZE3 = "tiny";
|
|
2507
2452
|
var DynamicSelection = ({ onSelect }) => {
|
|
2508
|
-
const [searchValue, setSearchValue] = (0,
|
|
2453
|
+
const [searchValue, setSearchValue] = (0, import_react21.useState)("");
|
|
2509
2454
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
2510
2455
|
const { value: anyValue } = (0, import_editor_controls44.useBoundProp)();
|
|
2511
2456
|
const { bind, value: dynamicValue, setValue } = (0, import_editor_controls44.useBoundProp)(dynamicPropTypeUtil);
|
|
@@ -2522,8 +2467,8 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2522
2467
|
setValue({ name: value, settings: {} });
|
|
2523
2468
|
onSelect?.();
|
|
2524
2469
|
};
|
|
2525
|
-
return /* @__PURE__ */
|
|
2526
|
-
|
|
2470
|
+
return /* @__PURE__ */ React62.createElement(import_ui51.Stack, null, /* @__PURE__ */ React62.createElement(import_ui51.Box, { px: 1.5, pb: 1 }, /* @__PURE__ */ React62.createElement(
|
|
2471
|
+
import_ui51.TextField,
|
|
2527
2472
|
{
|
|
2528
2473
|
fullWidth: true,
|
|
2529
2474
|
size: SIZE3,
|
|
@@ -2531,13 +2476,13 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2531
2476
|
onChange: handleSearch,
|
|
2532
2477
|
placeholder: (0, import_i18n41.__)("Search dynamic tag", "elementor"),
|
|
2533
2478
|
InputProps: {
|
|
2534
|
-
startAdornment: /* @__PURE__ */
|
|
2479
|
+
startAdornment: /* @__PURE__ */ React62.createElement(import_ui51.InputAdornment, { position: "start" }, /* @__PURE__ */ React62.createElement(import_icons21.SearchIcon, { fontSize: SIZE3 }))
|
|
2535
2480
|
}
|
|
2536
2481
|
}
|
|
2537
|
-
)), /* @__PURE__ */
|
|
2482
|
+
)), /* @__PURE__ */ React62.createElement(import_ui51.Divider, null), /* @__PURE__ */ React62.createElement(import_ui51.Box, { sx: { overflowY: "auto", height: 260, width: 220 } }, options10.length > 0 ? /* @__PURE__ */ React62.createElement(import_ui51.MenuList, { role: "listbox", tabIndex: 0 }, options10.map(([category, items3], index) => /* @__PURE__ */ React62.createElement(import_react21.Fragment, { key: index }, /* @__PURE__ */ React62.createElement(import_ui51.ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items3.map(({ value, label: tagLabel }) => {
|
|
2538
2483
|
const isSelected = isCurrentValueDynamic && value === dynamicValue?.name;
|
|
2539
|
-
return /* @__PURE__ */
|
|
2540
|
-
|
|
2484
|
+
return /* @__PURE__ */ React62.createElement(
|
|
2485
|
+
import_ui51.MenuItem,
|
|
2541
2486
|
{
|
|
2542
2487
|
key: value,
|
|
2543
2488
|
selected: isSelected,
|
|
@@ -2547,8 +2492,8 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2547
2492
|
},
|
|
2548
2493
|
tagLabel
|
|
2549
2494
|
);
|
|
2550
|
-
})))) : /* @__PURE__ */
|
|
2551
|
-
|
|
2495
|
+
})))) : /* @__PURE__ */ React62.createElement(import_ui51.Stack, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React62.createElement(import_icons21.PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React62.createElement(import_ui51.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n41.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React62.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React62.createElement(import_ui51.Typography, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React62.createElement(
|
|
2496
|
+
import_ui51.Link,
|
|
2552
2497
|
{
|
|
2553
2498
|
color: "secondary",
|
|
2554
2499
|
variant: "caption",
|
|
@@ -2581,8 +2526,8 @@ var DynamicSelectionControl = () => {
|
|
|
2581
2526
|
const { bind, value } = (0, import_editor_controls45.useBoundProp)(dynamicPropTypeUtil);
|
|
2582
2527
|
const [propValueFromHistory] = usePersistDynamicValue(bind);
|
|
2583
2528
|
const { name: tagName = "" } = value;
|
|
2584
|
-
const selectionPopoverId = (0,
|
|
2585
|
-
const selectionPopoverState = (0,
|
|
2529
|
+
const selectionPopoverId = (0, import_react22.useId)();
|
|
2530
|
+
const selectionPopoverState = (0, import_ui52.usePopupState)({ variant: "popover", popupId: selectionPopoverId });
|
|
2586
2531
|
const dynamicTag = useDynamicTag(tagName);
|
|
2587
2532
|
const removeDynamicTag = () => {
|
|
2588
2533
|
setAnyValue(propValueFromHistory ?? null);
|
|
@@ -2590,70 +2535,70 @@ var DynamicSelectionControl = () => {
|
|
|
2590
2535
|
if (!dynamicTag) {
|
|
2591
2536
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
2592
2537
|
}
|
|
2593
|
-
return /* @__PURE__ */
|
|
2594
|
-
|
|
2538
|
+
return /* @__PURE__ */ React63.createElement(import_ui52.Box, null, /* @__PURE__ */ React63.createElement(
|
|
2539
|
+
import_ui52.UnstableTag,
|
|
2595
2540
|
{
|
|
2596
2541
|
fullWidth: true,
|
|
2597
2542
|
showActionsOnHover: true,
|
|
2598
2543
|
label: dynamicTag.label,
|
|
2599
|
-
startIcon: /* @__PURE__ */
|
|
2600
|
-
...(0,
|
|
2601
|
-
actions: /* @__PURE__ */
|
|
2602
|
-
|
|
2544
|
+
startIcon: /* @__PURE__ */ React63.createElement(import_icons22.DatabaseIcon, { fontSize: SIZE4 }),
|
|
2545
|
+
...(0, import_ui52.bindTrigger)(selectionPopoverState),
|
|
2546
|
+
actions: /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React63.createElement(
|
|
2547
|
+
import_ui52.IconButton,
|
|
2603
2548
|
{
|
|
2604
2549
|
size: SIZE4,
|
|
2605
2550
|
onClick: removeDynamicTag,
|
|
2606
2551
|
"aria-label": (0, import_i18n42.__)("Remove dynamic value", "elementor")
|
|
2607
2552
|
},
|
|
2608
|
-
/* @__PURE__ */
|
|
2553
|
+
/* @__PURE__ */ React63.createElement(import_icons22.XIcon, { fontSize: SIZE4 })
|
|
2609
2554
|
))
|
|
2610
2555
|
}
|
|
2611
|
-
), /* @__PURE__ */
|
|
2612
|
-
|
|
2556
|
+
), /* @__PURE__ */ React63.createElement(
|
|
2557
|
+
import_ui52.Popover,
|
|
2613
2558
|
{
|
|
2614
2559
|
disablePortal: true,
|
|
2615
2560
|
disableScrollLock: true,
|
|
2616
2561
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
2617
|
-
...(0,
|
|
2562
|
+
...(0, import_ui52.bindPopover)(selectionPopoverState)
|
|
2618
2563
|
},
|
|
2619
|
-
/* @__PURE__ */
|
|
2564
|
+
/* @__PURE__ */ React63.createElement(import_ui52.Stack, null, /* @__PURE__ */ React63.createElement(import_ui52.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React63.createElement(import_icons22.DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React63.createElement(import_ui52.Typography, { variant: "subtitle2" }, (0, import_i18n42.__)("Dynamic Tags", "elementor")), /* @__PURE__ */ React63.createElement(import_ui52.IconButton, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React63.createElement(import_icons22.XIcon, { fontSize: SIZE4 }))), /* @__PURE__ */ React63.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
2620
2565
|
));
|
|
2621
2566
|
};
|
|
2622
2567
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
2623
|
-
const popupId = (0,
|
|
2624
|
-
const settingsPopupState = (0,
|
|
2568
|
+
const popupId = (0, import_react22.useId)();
|
|
2569
|
+
const settingsPopupState = (0, import_ui52.usePopupState)({ variant: "popover", popupId });
|
|
2625
2570
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
2626
2571
|
if (!hasDynamicSettings) {
|
|
2627
2572
|
return null;
|
|
2628
2573
|
}
|
|
2629
|
-
return /* @__PURE__ */
|
|
2630
|
-
|
|
2574
|
+
return /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(
|
|
2575
|
+
import_ui52.IconButton,
|
|
2631
2576
|
{
|
|
2632
2577
|
size: SIZE4,
|
|
2633
|
-
...(0,
|
|
2578
|
+
...(0, import_ui52.bindTrigger)(settingsPopupState),
|
|
2634
2579
|
"aria-label": (0, import_i18n42.__)("Settings", "elementor")
|
|
2635
2580
|
},
|
|
2636
|
-
/* @__PURE__ */
|
|
2637
|
-
), /* @__PURE__ */
|
|
2638
|
-
|
|
2581
|
+
/* @__PURE__ */ React63.createElement(import_icons22.SettingsIcon, { fontSize: SIZE4 })
|
|
2582
|
+
), /* @__PURE__ */ React63.createElement(
|
|
2583
|
+
import_ui52.Popover,
|
|
2639
2584
|
{
|
|
2640
2585
|
disableScrollLock: true,
|
|
2641
2586
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
2642
|
-
...(0,
|
|
2587
|
+
...(0, import_ui52.bindPopover)(settingsPopupState)
|
|
2643
2588
|
},
|
|
2644
|
-
/* @__PURE__ */
|
|
2589
|
+
/* @__PURE__ */ React63.createElement(import_ui52.Paper, { component: import_ui52.Stack, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React63.createElement(import_ui52.Stack, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React63.createElement(import_icons22.DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React63.createElement(import_ui52.Typography, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React63.createElement(import_ui52.IconButton, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React63.createElement(import_icons22.XIcon, { fontSize: SIZE4 }))), /* @__PURE__ */ React63.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
2645
2590
|
));
|
|
2646
2591
|
};
|
|
2647
2592
|
var DynamicSettings = ({ controls }) => {
|
|
2648
2593
|
const tabs = controls.filter(({ type }) => type === "section");
|
|
2649
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
2594
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui52.useTabs)(0);
|
|
2650
2595
|
if (!tabs.length) {
|
|
2651
2596
|
return null;
|
|
2652
2597
|
}
|
|
2653
|
-
return /* @__PURE__ */
|
|
2654
|
-
return /* @__PURE__ */
|
|
2598
|
+
return /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(import_ui52.Tabs, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React63.createElement(import_ui52.Tab, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React63.createElement(import_ui52.Divider, null), tabs.map(({ value }, index) => {
|
|
2599
|
+
return /* @__PURE__ */ React63.createElement(import_ui52.TabPanel, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React63.createElement(import_ui52.Stack, { gap: 1, px: 2 }, value.items.map((item) => {
|
|
2655
2600
|
if (item.type === "control") {
|
|
2656
|
-
return /* @__PURE__ */
|
|
2601
|
+
return /* @__PURE__ */ React63.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
2657
2602
|
}
|
|
2658
2603
|
return null;
|
|
2659
2604
|
})));
|
|
@@ -2663,11 +2608,11 @@ var Control3 = ({ control }) => {
|
|
|
2663
2608
|
if (!getControlByType(control.type)) {
|
|
2664
2609
|
return null;
|
|
2665
2610
|
}
|
|
2666
|
-
return /* @__PURE__ */
|
|
2611
|
+
return /* @__PURE__ */ React63.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React63.createElement(import_editor_controls45.ControlLabel, null, control.label) : null, /* @__PURE__ */ React63.createElement(Control, { type: control.type, props: control.props }));
|
|
2667
2612
|
};
|
|
2668
2613
|
|
|
2669
2614
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
2670
|
-
var
|
|
2615
|
+
var React64 = __toESM(require("react"));
|
|
2671
2616
|
var import_editor_controls46 = require("@elementor/editor-controls");
|
|
2672
2617
|
var import_icons23 = require("@elementor/icons");
|
|
2673
2618
|
var import_i18n43 = require("@wordpress/i18n");
|
|
@@ -2678,7 +2623,7 @@ var usePropDynamicAction = () => {
|
|
|
2678
2623
|
visible,
|
|
2679
2624
|
icon: import_icons23.DatabaseIcon,
|
|
2680
2625
|
title: (0, import_i18n43.__)("Dynamic Tags", "elementor"),
|
|
2681
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
2626
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React64.createElement(DynamicSelection, { onSelect: closePopover })
|
|
2682
2627
|
};
|
|
2683
2628
|
};
|
|
2684
2629
|
|
|
@@ -2704,7 +2649,6 @@ function init2() {
|
|
|
2704
2649
|
component: EditingPanelHooks
|
|
2705
2650
|
});
|
|
2706
2651
|
init();
|
|
2707
|
-
initCssClasses();
|
|
2708
2652
|
}
|
|
2709
2653
|
var blockV1Panel = () => {
|
|
2710
2654
|
(0, import_editor_v1_adapters4.__privateBlockDataCommand)({
|
|
@@ -2718,8 +2662,6 @@ init2();
|
|
|
2718
2662
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2719
2663
|
0 && (module.exports = {
|
|
2720
2664
|
injectIntoClassSelectorActions,
|
|
2721
|
-
registerGlobalClassMenuItem,
|
|
2722
|
-
registerStateMenuItem,
|
|
2723
2665
|
replaceControl,
|
|
2724
2666
|
useBoundProp,
|
|
2725
2667
|
usePanelActions,
|