@elementor/editor-editing-panel 1.9.0 → 1.11.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 +105 -0
- package/dist/index.d.mts +1 -35
- package/dist/index.d.ts +1 -35
- package/dist/index.js +996 -1059
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +905 -970
- package/dist/index.mjs.map +1 -1
- package/package.json +18 -14
- package/src/components/css-classes/css-class-item.tsx +130 -0
- package/src/components/css-classes/css-class-menu.tsx +151 -0
- package/src/components/{css-class-selector.tsx → css-classes/css-class-selector.tsx} +34 -160
- package/src/components/style-sections/layout-section/display-field.tsx +9 -1
- package/src/components/style-sections/layout-section/flex-order-field.tsx +5 -5
- package/src/components/style-sections/layout-section/flex-size-field.tsx +1 -1
- package/src/components/style-sections/layout-section/gap-control-field.tsx +0 -2
- package/src/components/style-sections/position-section/dimensions-field.tsx +1 -1
- package/src/components/style-sections/position-section/position-section.tsx +1 -1
- package/src/components/style-sections/typography-section/font-weight-field.tsx +9 -5
- package/src/components/style-sections/typography-section/text-alignment-field.tsx +16 -8
- package/src/components/style-sections/typography-section/transform-field.tsx +12 -3
- package/src/components/style-tab.tsx +1 -1
- package/src/contexts/style-context.tsx +36 -5
- package/src/controls-registry/control.tsx +3 -12
- package/src/controls-registry/controls-registry.tsx +3 -1
- package/src/controls-registry/settings-field.tsx +8 -1
- package/src/dynamics/components/dynamic-selection.tsx +1 -1
- package/src/dynamics/dynamic-control.tsx +1 -1
- package/src/dynamics/types.ts +2 -2
- package/src/dynamics/utils.ts +2 -2
- package/src/errors.ts +22 -0
- package/src/hooks/use-persist-dynamic-value.ts +1 -1
- package/src/hooks/use-styles-fields.ts +151 -9
- package/src/hooks/use-unapply-class.ts +4 -0
- package/src/index.ts +1 -2
- package/src/init.ts +2 -4
- package/src/sync/types.ts +4 -3
- package/src/components/collapsible-field.tsx +0 -36
- package/src/components/conditional-tooltip-wrapper.tsx +0 -58
- package/src/components/css-class-menu.tsx +0 -125
- package/src/components/editable-field.tsx +0 -166
- package/src/contexts/css-class-item-context.tsx +0 -31
- package/src/css-classes.ts +0 -45
- package/src/hooks/use-session-storage.ts +0 -46
- package/src/sync/enqueue-font.ts +0 -7
package/dist/index.mjs
CHANGED
|
@@ -5,156 +5,29 @@ import { useBoundProp as useBoundProp6 } from "@elementor/editor-controls";
|
|
|
5
5
|
import { createControlReplacement } from "@elementor/editor-controls";
|
|
6
6
|
var { replaceControl, getControlReplacement } = createControlReplacement();
|
|
7
7
|
|
|
8
|
-
// src/components/css-class-
|
|
9
|
-
import * as
|
|
10
|
-
import {
|
|
11
|
-
import { createMenu } from "@elementor/menus";
|
|
12
|
-
import {
|
|
13
|
-
bindMenu,
|
|
14
|
-
Box,
|
|
15
|
-
ListItemIcon,
|
|
16
|
-
ListItemText,
|
|
17
|
-
ListSubheader,
|
|
18
|
-
Menu,
|
|
19
|
-
MenuItem,
|
|
20
|
-
styled
|
|
21
|
-
} from "@elementor/ui";
|
|
22
|
-
import { __ } from "@wordpress/i18n";
|
|
23
|
-
|
|
24
|
-
// src/contexts/css-class-item-context.tsx
|
|
25
|
-
import * as React from "react";
|
|
26
|
-
import { createContext, useContext } from "react";
|
|
27
|
-
var ClassItemContext = createContext({
|
|
28
|
-
styleId: "",
|
|
29
|
-
isGlobal: false,
|
|
30
|
-
isActive: false
|
|
31
|
-
});
|
|
32
|
-
function CssClassItemProvider({ styleId, isGlobal, isActive, children }) {
|
|
33
|
-
return /* @__PURE__ */ React.createElement(ClassItemContext.Provider, { value: { styleId, isGlobal, isActive } }, children);
|
|
34
|
-
}
|
|
35
|
-
function useCssClassItem() {
|
|
36
|
-
const context = useContext(ClassItemContext);
|
|
37
|
-
if (!context) {
|
|
38
|
-
throw new Error("useCssClassItem must be used within a CssClassItemProvider");
|
|
39
|
-
}
|
|
40
|
-
return context;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// src/contexts/style-context.tsx
|
|
44
|
-
import * as React2 from "react";
|
|
45
|
-
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
46
|
-
var Context = createContext2(null);
|
|
47
|
-
function StyleProvider({ children, id, setId, meta, setMetaState }) {
|
|
48
|
-
return /* @__PURE__ */ React2.createElement(Context.Provider, { value: { id, setId, meta, setMetaState } }, children);
|
|
49
|
-
}
|
|
50
|
-
function useStyle() {
|
|
51
|
-
const context = useContext2(Context);
|
|
52
|
-
if (!context) {
|
|
53
|
-
throw new Error("useStyle must be used within a StyleProvider");
|
|
54
|
-
}
|
|
55
|
-
return context;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// src/components/css-class-menu.tsx
|
|
59
|
-
var { useMenuItems: useStateMenuItems, registerStateMenuItem } = createMenu({
|
|
60
|
-
components: {
|
|
61
|
-
StateMenuItem
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
var { useMenuItems: useGlobalClassMenuItems, registerGlobalClassMenuItem } = createMenu({
|
|
65
|
-
components: {
|
|
66
|
-
GlobalClassMenuItem
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
function CssClassMenu({
|
|
70
|
-
popupState,
|
|
71
|
-
containerRef
|
|
72
|
-
}) {
|
|
73
|
-
const { isGlobal } = useCssClassItem();
|
|
74
|
-
const { default: globalClassMenuItems } = useGlobalClassMenuItems();
|
|
75
|
-
const { default: stateMenuItems } = useStateMenuItems();
|
|
76
|
-
return /* @__PURE__ */ React3.createElement(
|
|
77
|
-
Menu,
|
|
78
|
-
{
|
|
79
|
-
MenuListProps: { dense: true },
|
|
80
|
-
...bindMenu(popupState),
|
|
81
|
-
anchorOrigin: {
|
|
82
|
-
vertical: "top",
|
|
83
|
-
horizontal: "right"
|
|
84
|
-
},
|
|
85
|
-
anchorEl: containerRef.current
|
|
86
|
-
},
|
|
87
|
-
isGlobal && /* @__PURE__ */ React3.createElement(GlobalClassMenuSection, null, globalClassMenuItems.map(({ id, MenuItem: MenuItemComponent }) => /* @__PURE__ */ React3.createElement(MenuItemComponent, { key: id }))),
|
|
88
|
-
/* @__PURE__ */ React3.createElement(ListSubheader, null, __("Add a pseudo selector", "elementor")),
|
|
89
|
-
stateMenuItems.map(({ id, MenuItem: MenuItemComponent }) => /* @__PURE__ */ React3.createElement(MenuItemComponent, { key: id }))
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
function StateMenuItem({ state, disabled }) {
|
|
93
|
-
const { isActive, styleId } = useCssClassItem();
|
|
94
|
-
const { setId: setActiveId, setMetaState: setActiveMetaState, meta } = useStyle();
|
|
95
|
-
const { state: activeState } = meta;
|
|
96
|
-
const isSelected = state === activeState && isActive;
|
|
97
|
-
return /* @__PURE__ */ React3.createElement(
|
|
98
|
-
StyledMenuItem,
|
|
99
|
-
{
|
|
100
|
-
selected: state === activeState && isActive,
|
|
101
|
-
disabled,
|
|
102
|
-
onClick: () => {
|
|
103
|
-
if (!isActive) {
|
|
104
|
-
setActiveId(styleId);
|
|
105
|
-
}
|
|
106
|
-
setActiveMetaState(state);
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
isSelected && /* @__PURE__ */ React3.createElement(ListItemIcon, null, /* @__PURE__ */ React3.createElement(CheckIcon, null)),
|
|
110
|
-
/* @__PURE__ */ React3.createElement(ListItemText, { primary: state ? `:${state}` : "Normal" })
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
function GlobalClassMenuItem({ text, onClick }) {
|
|
114
|
-
return /* @__PURE__ */ React3.createElement(StyledMenuItem, { onClick }, /* @__PURE__ */ React3.createElement(ListItemText, { primary: text }));
|
|
115
|
-
}
|
|
116
|
-
var GlobalClassMenuSection = styled(Box)(({ theme }) => ({
|
|
117
|
-
borderBottom: `1px solid ${theme?.palette.divider}`
|
|
118
|
-
}));
|
|
119
|
-
var StyledMenuItem = styled(MenuItem)({
|
|
120
|
-
"&:hover": {
|
|
121
|
-
color: "text.primary"
|
|
122
|
-
// Overriding global CSS from the editor.
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
// src/components/css-class-selector.tsx
|
|
127
|
-
import * as React9 from "react";
|
|
128
|
-
import { useId as useId2, useRef as useRef3 } from "react";
|
|
129
|
-
import { getElementSetting, updateElementSettings, useElementSetting } from "@elementor/editor-elements";
|
|
8
|
+
// src/components/css-classes/css-class-selector.tsx
|
|
9
|
+
import * as React7 from "react";
|
|
10
|
+
import { getElementSetting, updateElementSettings as updateElementSettings2, useElementSetting as useElementSetting2 } from "@elementor/editor-elements";
|
|
130
11
|
import { classesPropTypeUtil } from "@elementor/editor-props";
|
|
131
12
|
import {
|
|
132
13
|
ELEMENTS_STYLES_PROVIDER_KEY,
|
|
133
|
-
stylesRepository,
|
|
134
|
-
|
|
135
|
-
|
|
14
|
+
stylesRepository as stylesRepository4,
|
|
15
|
+
useCreateActionsByProvider,
|
|
16
|
+
useProviders
|
|
136
17
|
} from "@elementor/editor-styles-repository";
|
|
137
|
-
import { DotsVerticalIcon } from "@elementor/icons";
|
|
138
18
|
import { createLocation } from "@elementor/locations";
|
|
139
|
-
import {
|
|
140
|
-
|
|
141
|
-
Chip,
|
|
142
|
-
Stack,
|
|
143
|
-
Typography,
|
|
144
|
-
UnstableChipGroup,
|
|
145
|
-
usePopupState
|
|
146
|
-
} from "@elementor/ui";
|
|
147
|
-
import { __ as __2 } from "@wordpress/i18n";
|
|
19
|
+
import { Chip as Chip2, Stack as Stack2, Typography as Typography2 } from "@elementor/ui";
|
|
20
|
+
import { __ as __3 } from "@wordpress/i18n";
|
|
148
21
|
|
|
149
22
|
// src/contexts/classes-prop-context.tsx
|
|
150
|
-
import * as
|
|
151
|
-
import { createContext
|
|
152
|
-
var
|
|
23
|
+
import * as React from "react";
|
|
24
|
+
import { createContext, useContext } from "react";
|
|
25
|
+
var Context = createContext(null);
|
|
153
26
|
function ClassesPropProvider({ children, prop }) {
|
|
154
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ React.createElement(Context.Provider, { value: { prop } }, children);
|
|
155
28
|
}
|
|
156
29
|
function useClassesProp() {
|
|
157
|
-
const context =
|
|
30
|
+
const context = useContext(Context);
|
|
158
31
|
if (!context) {
|
|
159
32
|
throw new Error("useClassesProp must be used within a ClassesPropProvider");
|
|
160
33
|
}
|
|
@@ -162,179 +35,75 @@ function useClassesProp() {
|
|
|
162
35
|
}
|
|
163
36
|
|
|
164
37
|
// src/contexts/element-context.tsx
|
|
165
|
-
import * as
|
|
166
|
-
import { createContext as
|
|
167
|
-
var
|
|
38
|
+
import * as React2 from "react";
|
|
39
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
40
|
+
var Context2 = createContext2(null);
|
|
168
41
|
function ElementProvider({ children, element, elementType }) {
|
|
169
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ React2.createElement(Context2.Provider, { value: { element, elementType } }, children);
|
|
170
43
|
}
|
|
171
44
|
function useElement() {
|
|
172
|
-
const context =
|
|
45
|
+
const context = useContext2(Context2);
|
|
173
46
|
if (!context) {
|
|
174
47
|
throw new Error("useElement must be used within a ElementProvider");
|
|
175
48
|
}
|
|
176
49
|
return context;
|
|
177
50
|
}
|
|
178
51
|
|
|
179
|
-
// src/
|
|
180
|
-
import
|
|
181
|
-
import
|
|
182
|
-
import {
|
|
183
|
-
var ConditionalTooltipWrapper = ({ maxWidth, title }) => {
|
|
184
|
-
const elRef = useRef(null);
|
|
185
|
-
const [isOverflown, setIsOverflown] = useState(false);
|
|
186
|
-
useEffect(() => {
|
|
187
|
-
const onResize = () => {
|
|
188
|
-
const element = elRef.current;
|
|
189
|
-
if (element) {
|
|
190
|
-
setIsOverflown(element.scrollWidth > element.clientWidth);
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
onResize();
|
|
194
|
-
window.addEventListener("resize", onResize);
|
|
195
|
-
return () => {
|
|
196
|
-
window.removeEventListener("resize", onResize);
|
|
197
|
-
};
|
|
198
|
-
}, []);
|
|
199
|
-
if (isOverflown) {
|
|
200
|
-
return /* @__PURE__ */ React6.createElement(Tooltip, { title, placement: "top" }, /* @__PURE__ */ React6.createElement(Content, { maxWidth, ref: elRef }, title));
|
|
201
|
-
}
|
|
202
|
-
return /* @__PURE__ */ React6.createElement(Content, { maxWidth, ref: elRef }, title);
|
|
203
|
-
};
|
|
204
|
-
var Content = React6.forwardRef(({ maxWidth, ...tooltipProps }, ref) => /* @__PURE__ */ React6.createElement(
|
|
205
|
-
Box2,
|
|
206
|
-
{
|
|
207
|
-
ref,
|
|
208
|
-
position: "relative",
|
|
209
|
-
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", maxWidth },
|
|
210
|
-
...tooltipProps
|
|
211
|
-
}
|
|
212
|
-
));
|
|
52
|
+
// src/contexts/style-context.tsx
|
|
53
|
+
import * as React3 from "react";
|
|
54
|
+
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
55
|
+
import { stylesRepository } from "@elementor/editor-styles-repository";
|
|
213
56
|
|
|
214
|
-
// src/
|
|
215
|
-
import
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
try {
|
|
240
|
-
await onSubmit(newValue);
|
|
241
|
-
} finally {
|
|
242
|
-
setSubmitting(false);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
closeEditMode();
|
|
246
|
-
};
|
|
247
|
-
const onChange = (event) => {
|
|
248
|
-
const { innerText: newValue } = event.target;
|
|
249
|
-
if (validation) {
|
|
250
|
-
setError(validation(newValue));
|
|
251
|
-
}
|
|
252
|
-
};
|
|
253
|
-
return /* @__PURE__ */ React7.createElement(
|
|
254
|
-
Context4.Provider,
|
|
255
|
-
{
|
|
256
|
-
value: {
|
|
257
|
-
isEditing,
|
|
258
|
-
openEditMode,
|
|
259
|
-
closeEditMode,
|
|
260
|
-
onChange,
|
|
261
|
-
value,
|
|
262
|
-
error,
|
|
263
|
-
submit,
|
|
264
|
-
editable,
|
|
265
|
-
submitting
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
children
|
|
269
|
-
);
|
|
270
|
-
};
|
|
271
|
-
var EditableField = ({ children, onClick, ...props }) => {
|
|
272
|
-
const ref = useRef2(null);
|
|
273
|
-
const { isEditing, closeEditMode, value, onChange, error, submit, editable } = useEditableField();
|
|
274
|
-
useEffect2(() => {
|
|
275
|
-
if (isEditing) {
|
|
276
|
-
ref.current?.focus();
|
|
277
|
-
selectAll();
|
|
278
|
-
}
|
|
279
|
-
}, [isEditing]);
|
|
280
|
-
const handleKeyDown = (event) => {
|
|
281
|
-
event.stopPropagation();
|
|
282
|
-
if (["Escape"].includes(event.key)) {
|
|
283
|
-
return closeEditMode();
|
|
284
|
-
}
|
|
285
|
-
if (["Enter"].includes(event.key)) {
|
|
286
|
-
event.preventDefault();
|
|
287
|
-
return submit(event.target.innerText);
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
const handleClick = (event) => {
|
|
291
|
-
if (isEditing) {
|
|
292
|
-
event.stopPropagation();
|
|
293
|
-
}
|
|
294
|
-
onClick?.(event);
|
|
295
|
-
};
|
|
296
|
-
const selectAll = () => {
|
|
297
|
-
const selection = getSelection();
|
|
298
|
-
if (!selection || !ref.current) {
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
const range = document.createRange();
|
|
302
|
-
range.selectNodeContents(ref.current);
|
|
303
|
-
selection.removeAllRanges();
|
|
304
|
-
selection.addRange(range);
|
|
305
|
-
};
|
|
306
|
-
if (!editable) {
|
|
307
|
-
return children;
|
|
57
|
+
// src/errors.ts
|
|
58
|
+
import { createError } from "@elementor/utils";
|
|
59
|
+
var ControlTypeNotFoundError = createError({
|
|
60
|
+
code: "control_type_not_found",
|
|
61
|
+
message: "Control type not found."
|
|
62
|
+
});
|
|
63
|
+
var StylesProviderNotFoundError = createError({
|
|
64
|
+
code: "provider_not_found",
|
|
65
|
+
message: "Styles provider not found."
|
|
66
|
+
});
|
|
67
|
+
var StylesProviderCannotUpdatePropsError = createError({
|
|
68
|
+
code: "provider_cannot_update_props",
|
|
69
|
+
message: "Styles provider doesn't support updating props."
|
|
70
|
+
});
|
|
71
|
+
var StyleNotFoundUnderProviderError = createError({
|
|
72
|
+
code: "style_not_found_under_provider",
|
|
73
|
+
message: "Style not found under the provider."
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// src/contexts/style-context.tsx
|
|
77
|
+
var Context3 = createContext3(null);
|
|
78
|
+
function StyleProvider({ children, ...props }) {
|
|
79
|
+
const provider = props.id === null ? null : getProviderByStyleId(props.id);
|
|
80
|
+
if (props.id && !provider) {
|
|
81
|
+
throw new StylesProviderNotFoundError({ context: { styleId: props.id } });
|
|
308
82
|
}
|
|
309
|
-
return /* @__PURE__ */
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
contentEditable: isEditing,
|
|
316
|
-
suppressContentEditableWarning: true,
|
|
317
|
-
onBlur: closeEditMode
|
|
318
|
-
},
|
|
319
|
-
isEditing ? value : children
|
|
320
|
-
)));
|
|
321
|
-
};
|
|
322
|
-
var useEditableField = () => {
|
|
323
|
-
const contextValue = useContext5(Context4);
|
|
324
|
-
if (!contextValue) {
|
|
325
|
-
throw new Error("useEditableField must be used within a EditableFieldProvider");
|
|
83
|
+
return /* @__PURE__ */ React3.createElement(Context3.Provider, { value: { ...props, provider } }, children);
|
|
84
|
+
}
|
|
85
|
+
function useStyle() {
|
|
86
|
+
const context = useContext3(Context3);
|
|
87
|
+
if (!context) {
|
|
88
|
+
throw new Error("useStyle must be used within a StyleProvider");
|
|
326
89
|
}
|
|
327
|
-
return
|
|
328
|
-
}
|
|
90
|
+
return context;
|
|
91
|
+
}
|
|
92
|
+
function getProviderByStyleId(styleId) {
|
|
93
|
+
const styleProvider = stylesRepository.getProviders().find((provider) => {
|
|
94
|
+
return provider.actions.get().find((style) => style.id === styleId);
|
|
95
|
+
});
|
|
96
|
+
return styleProvider ?? null;
|
|
97
|
+
}
|
|
329
98
|
|
|
330
99
|
// src/components/multi-combobox.tsx
|
|
331
|
-
import * as
|
|
332
|
-
import { useId, useState
|
|
100
|
+
import * as React4 from "react";
|
|
101
|
+
import { useId, useState } from "react";
|
|
333
102
|
import {
|
|
334
103
|
Autocomplete,
|
|
335
|
-
Box
|
|
104
|
+
Box,
|
|
336
105
|
createFilterOptions,
|
|
337
|
-
styled
|
|
106
|
+
styled,
|
|
338
107
|
TextField
|
|
339
108
|
} from "@elementor/ui";
|
|
340
109
|
function MultiCombobox({
|
|
@@ -346,7 +115,7 @@ function MultiCombobox({
|
|
|
346
115
|
}) {
|
|
347
116
|
const filter = useFilterOptions();
|
|
348
117
|
const { run, loading } = useActionRunner();
|
|
349
|
-
return /* @__PURE__ */
|
|
118
|
+
return /* @__PURE__ */ React4.createElement(
|
|
350
119
|
Autocomplete,
|
|
351
120
|
{
|
|
352
121
|
...props,
|
|
@@ -359,8 +128,8 @@ function MultiCombobox({
|
|
|
359
128
|
disabled: loading,
|
|
360
129
|
value: selected,
|
|
361
130
|
options: options10,
|
|
362
|
-
renderGroup: (params) => /* @__PURE__ */
|
|
363
|
-
renderInput: (params) => /* @__PURE__ */
|
|
131
|
+
renderGroup: (params) => /* @__PURE__ */ React4.createElement(Group, { ...params }),
|
|
132
|
+
renderInput: (params) => /* @__PURE__ */ React4.createElement(TextField, { ...params }),
|
|
364
133
|
onChange: (_, selectedOrInputValue, reason) => {
|
|
365
134
|
const inputValue = selectedOrInputValue.find((option) => typeof option === "string");
|
|
366
135
|
const optionsAndActions = selectedOrInputValue.filter((option) => typeof option !== "string");
|
|
@@ -400,27 +169,27 @@ function MultiCombobox({
|
|
|
400
169
|
}
|
|
401
170
|
var Group = (params) => {
|
|
402
171
|
const id = `combobox-group-${useId().replace(/:/g, "_")}`;
|
|
403
|
-
return /* @__PURE__ */
|
|
172
|
+
return /* @__PURE__ */ React4.createElement(StyledGroup, { role: "group", "aria-labelledby": id }, /* @__PURE__ */ React4.createElement(StyledGroupHeader, { id }, " ", params.group), /* @__PURE__ */ React4.createElement(StyledGroupItems, { role: "listbox" }, params.children));
|
|
404
173
|
};
|
|
405
|
-
var StyledGroup =
|
|
174
|
+
var StyledGroup = styled("li")`
|
|
406
175
|
&:not( :last-of-type ) {
|
|
407
176
|
border-bottom: 1px solid ${({ theme }) => theme.palette.divider};
|
|
408
177
|
}
|
|
409
178
|
`;
|
|
410
|
-
var StyledGroupHeader =
|
|
179
|
+
var StyledGroupHeader = styled(Box)(({ theme }) => ({
|
|
411
180
|
position: "sticky",
|
|
412
181
|
top: "-8px",
|
|
413
182
|
padding: theme.spacing(1, 2),
|
|
414
183
|
color: theme.palette.text.tertiary
|
|
415
184
|
}));
|
|
416
|
-
var StyledGroupItems =
|
|
185
|
+
var StyledGroupItems = styled("ul")`
|
|
417
186
|
padding: 0;
|
|
418
187
|
`;
|
|
419
188
|
function useFilterOptions() {
|
|
420
|
-
return
|
|
189
|
+
return useState(() => createFilterOptions())[0];
|
|
421
190
|
}
|
|
422
191
|
function useActionRunner() {
|
|
423
|
-
const [loading, setLoading] =
|
|
192
|
+
const [loading, setLoading] = useState(false);
|
|
424
193
|
const run = async (apply, value) => {
|
|
425
194
|
setLoading(true);
|
|
426
195
|
try {
|
|
@@ -445,11 +214,236 @@ function isAction(option) {
|
|
|
445
214
|
return "apply" in option && "condition" in option;
|
|
446
215
|
}
|
|
447
216
|
|
|
448
|
-
// src/components/css-class-
|
|
217
|
+
// src/components/css-classes/css-class-item.tsx
|
|
218
|
+
import * as React6 from "react";
|
|
219
|
+
import { useState as useState2 } from "react";
|
|
220
|
+
import { stylesRepository as stylesRepository3 } from "@elementor/editor-styles-repository";
|
|
221
|
+
import { EditableField, EllipsisWithTooltip, useEditable } from "@elementor/editor-ui";
|
|
222
|
+
import { DotsVerticalIcon } from "@elementor/icons";
|
|
223
|
+
import {
|
|
224
|
+
bindTrigger,
|
|
225
|
+
Chip,
|
|
226
|
+
Stack,
|
|
227
|
+
Typography,
|
|
228
|
+
UnstableChipGroup,
|
|
229
|
+
usePopupState
|
|
230
|
+
} from "@elementor/ui";
|
|
231
|
+
import { __ as __2 } from "@wordpress/i18n";
|
|
232
|
+
|
|
233
|
+
// src/components/css-classes/css-class-menu.tsx
|
|
234
|
+
import * as React5 from "react";
|
|
235
|
+
import { stylesRepository as stylesRepository2 } from "@elementor/editor-styles-repository";
|
|
236
|
+
import { bindMenu, Divider, ListSubheader, Menu, MenuItem } from "@elementor/ui";
|
|
237
|
+
import { __ } from "@wordpress/i18n";
|
|
238
|
+
|
|
239
|
+
// src/hooks/use-unapply-class.ts
|
|
240
|
+
import { updateElementSettings, useElementSetting } from "@elementor/editor-elements";
|
|
241
|
+
var useUnapplyClass = (classId) => {
|
|
242
|
+
const { element } = useElement();
|
|
243
|
+
const { setId: setStyleId } = useStyle();
|
|
244
|
+
const classesProp = useClassesProp();
|
|
245
|
+
const classes = useElementSetting(element.id, classesProp);
|
|
246
|
+
const filteredClasses = classes?.value.filter((className) => className !== classId) ?? [];
|
|
247
|
+
return () => {
|
|
248
|
+
updateElementSettings({
|
|
249
|
+
id: element.id,
|
|
250
|
+
props: {
|
|
251
|
+
[classesProp]: {
|
|
252
|
+
$$type: "classes",
|
|
253
|
+
value: filteredClasses
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
setStyleId(null);
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
// src/components/css-classes/css-class-menu.tsx
|
|
262
|
+
var STATES = ["hover", "focus", "active"];
|
|
263
|
+
function CssClassMenu({ styleId, provider, popupState, handleRename, anchorEl }) {
|
|
264
|
+
const handleKeyDown = (e) => {
|
|
265
|
+
e.stopPropagation();
|
|
266
|
+
};
|
|
267
|
+
return /* @__PURE__ */ React5.createElement(
|
|
268
|
+
Menu,
|
|
269
|
+
{
|
|
270
|
+
MenuListProps: { dense: true },
|
|
271
|
+
...bindMenu(popupState),
|
|
272
|
+
anchorEl,
|
|
273
|
+
anchorOrigin: {
|
|
274
|
+
vertical: "bottom",
|
|
275
|
+
horizontal: "left"
|
|
276
|
+
},
|
|
277
|
+
transformOrigin: {
|
|
278
|
+
horizontal: "left",
|
|
279
|
+
vertical: -4
|
|
280
|
+
},
|
|
281
|
+
onKeyDown: handleKeyDown
|
|
282
|
+
},
|
|
283
|
+
getMenuItemsByProvider({ provider, styleId, handleRename, closeMenu: popupState.close }),
|
|
284
|
+
/* @__PURE__ */ React5.createElement(ListSubheader, { sx: { typography: "caption", color: "text.secondary", pb: 0.5, pt: 1 } }, __("Pseudo selector", "elementor")),
|
|
285
|
+
STATES.map((state) => {
|
|
286
|
+
return /* @__PURE__ */ React5.createElement(StateMenuItem, { key: state, state, styleId });
|
|
287
|
+
})
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
function getMenuItemsByProvider({
|
|
291
|
+
provider,
|
|
292
|
+
styleId,
|
|
293
|
+
handleRename,
|
|
294
|
+
closeMenu
|
|
295
|
+
}) {
|
|
296
|
+
const providerInstance = stylesRepository2.getProviderByKey(provider);
|
|
297
|
+
const providerActions = providerInstance?.actions;
|
|
298
|
+
const [canUpdate, canDelete] = [providerActions?.update, providerActions?.delete];
|
|
299
|
+
const actions = [
|
|
300
|
+
canUpdate && /* @__PURE__ */ React5.createElement(RenameClassMenuItem, { key: "rename-class", handleRename, closeMenu }),
|
|
301
|
+
canDelete && /* @__PURE__ */ React5.createElement(UnapplyClassMenuItem, { key: "unapply-class", styleId })
|
|
302
|
+
].filter(Boolean);
|
|
303
|
+
if (actions.length) {
|
|
304
|
+
actions.unshift(
|
|
305
|
+
/* @__PURE__ */ React5.createElement(
|
|
306
|
+
ListSubheader,
|
|
307
|
+
{
|
|
308
|
+
key: "provider-label",
|
|
309
|
+
sx: { typography: "caption", color: "text.secondary", pb: 0.5, pt: 1 }
|
|
310
|
+
},
|
|
311
|
+
providerInstance?.labels?.singular
|
|
312
|
+
)
|
|
313
|
+
);
|
|
314
|
+
actions.push(/* @__PURE__ */ React5.createElement(Divider, { key: "provider-actions-divider" }));
|
|
315
|
+
}
|
|
316
|
+
return actions;
|
|
317
|
+
}
|
|
318
|
+
function StateMenuItem({ state, styleId, ...props }) {
|
|
319
|
+
const { id: activeId, setId: setActiveId, setMetaState: setActiveMetaState, meta } = useStyle();
|
|
320
|
+
const { state: activeState } = meta;
|
|
321
|
+
const isActive = styleId === activeId;
|
|
322
|
+
const isSelected = state === activeState && isActive;
|
|
323
|
+
return /* @__PURE__ */ React5.createElement(
|
|
324
|
+
StyledMenuItem,
|
|
325
|
+
{
|
|
326
|
+
...props,
|
|
327
|
+
selected: isSelected,
|
|
328
|
+
sx: { textTransform: "capitalize" },
|
|
329
|
+
onClick: () => {
|
|
330
|
+
if (!isActive) {
|
|
331
|
+
setActiveId(styleId);
|
|
332
|
+
}
|
|
333
|
+
setActiveMetaState(state);
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
state
|
|
337
|
+
);
|
|
338
|
+
}
|
|
339
|
+
function UnapplyClassMenuItem({ styleId, ...props }) {
|
|
340
|
+
const unapplyClass = useUnapplyClass(styleId);
|
|
341
|
+
return /* @__PURE__ */ React5.createElement(StyledMenuItem, { ...props, onClick: unapplyClass }, __("Remove", "elementor"));
|
|
342
|
+
}
|
|
343
|
+
function RenameClassMenuItem({
|
|
344
|
+
handleRename,
|
|
345
|
+
closeMenu,
|
|
346
|
+
...props
|
|
347
|
+
}) {
|
|
348
|
+
return /* @__PURE__ */ React5.createElement(
|
|
349
|
+
StyledMenuItem,
|
|
350
|
+
{
|
|
351
|
+
...props,
|
|
352
|
+
onClick: () => {
|
|
353
|
+
closeMenu();
|
|
354
|
+
handleRename();
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
__("Rename", "elementor")
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
var StyledMenuItem = ({ ...props }) => /* @__PURE__ */ React5.createElement(MenuItem, { ...props, sx: { ...props.sx ?? {}, typography: "caption", color: "text.primary" } });
|
|
361
|
+
|
|
362
|
+
// src/components/css-classes/css-class-item.tsx
|
|
363
|
+
var CHIP_SIZE = "tiny";
|
|
364
|
+
function CssClassItem({
|
|
365
|
+
id,
|
|
366
|
+
label,
|
|
367
|
+
provider,
|
|
368
|
+
isActive,
|
|
369
|
+
color: colorProp,
|
|
370
|
+
chipProps,
|
|
371
|
+
onClickActive,
|
|
372
|
+
renameLabel
|
|
373
|
+
}) {
|
|
374
|
+
const { meta } = useStyle();
|
|
375
|
+
const popupState = usePopupState({ variant: "popover" });
|
|
376
|
+
const [chipRef, setChipRef] = useState2(null);
|
|
377
|
+
const { onDelete, ...chipGroupProps } = chipProps;
|
|
378
|
+
const {
|
|
379
|
+
ref,
|
|
380
|
+
isEditing,
|
|
381
|
+
openEditMode,
|
|
382
|
+
error,
|
|
383
|
+
getProps: getEditableProps
|
|
384
|
+
} = useEditable({
|
|
385
|
+
value: label,
|
|
386
|
+
onSubmit: renameLabel,
|
|
387
|
+
validation: validateLabel
|
|
388
|
+
});
|
|
389
|
+
const color = error ? "error" : colorProp;
|
|
390
|
+
const providerActions = stylesRepository3.getProviderByKey(provider)?.actions;
|
|
391
|
+
const allowRename = Boolean(providerActions?.update);
|
|
392
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(UnstableChipGroup, { ref: setChipRef, ...chipGroupProps, "aria-label": `Edit ${label}`, role: "group" }, /* @__PURE__ */ React6.createElement(
|
|
393
|
+
Chip,
|
|
394
|
+
{
|
|
395
|
+
size: CHIP_SIZE,
|
|
396
|
+
label: isEditing ? /* @__PURE__ */ React6.createElement(EditableField, { ref, error, ...getEditableProps() }) : /* @__PURE__ */ React6.createElement(EllipsisWithTooltip, { maxWidth: "10ch", title: label, as: "div" }),
|
|
397
|
+
variant: isActive && !meta.state ? "filled" : "standard",
|
|
398
|
+
color,
|
|
399
|
+
onClick: () => {
|
|
400
|
+
if (isActive && allowRename) {
|
|
401
|
+
openEditMode();
|
|
402
|
+
}
|
|
403
|
+
onClickActive(id);
|
|
404
|
+
},
|
|
405
|
+
"aria-pressed": isActive,
|
|
406
|
+
sx: {
|
|
407
|
+
"&.Mui-focusVisible": {
|
|
408
|
+
boxShadow: "none !important"
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
), !isEditing && /* @__PURE__ */ React6.createElement(
|
|
413
|
+
Chip,
|
|
414
|
+
{
|
|
415
|
+
size: CHIP_SIZE,
|
|
416
|
+
label: /* @__PURE__ */ React6.createElement(Stack, { direction: "row", gap: 0.5, alignItems: "center" }, isActive && meta.state && /* @__PURE__ */ React6.createElement(Typography, { variant: "inherit" }, meta.state), /* @__PURE__ */ React6.createElement(DotsVerticalIcon, { fontSize: "inherit" })),
|
|
417
|
+
variant: "filled",
|
|
418
|
+
color,
|
|
419
|
+
...bindTrigger(popupState),
|
|
420
|
+
"aria-label": __2("Open CSS Class Menu", "elementor")
|
|
421
|
+
}
|
|
422
|
+
)), /* @__PURE__ */ React6.createElement(
|
|
423
|
+
CssClassMenu,
|
|
424
|
+
{
|
|
425
|
+
styleId: id,
|
|
426
|
+
popupState,
|
|
427
|
+
provider,
|
|
428
|
+
handleRename: openEditMode,
|
|
429
|
+
anchorEl: chipRef
|
|
430
|
+
}
|
|
431
|
+
));
|
|
432
|
+
}
|
|
433
|
+
var validateLabel = (newLabel) => {
|
|
434
|
+
if (!stylesRepository3.isLabelValid(newLabel)) {
|
|
435
|
+
return __2("Format is not valid", "elementor");
|
|
436
|
+
}
|
|
437
|
+
if (stylesRepository3.isLabelExist(newLabel)) {
|
|
438
|
+
return __2("Existing name", "elementor");
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
// src/components/css-classes/css-class-selector.tsx
|
|
449
443
|
var ID = "elementor-css-class-selector";
|
|
450
444
|
var TAGS_LIMIT = 8;
|
|
451
445
|
var EMPTY_OPTION = {
|
|
452
|
-
label:
|
|
446
|
+
label: __3("local", "elementor"),
|
|
453
447
|
value: "",
|
|
454
448
|
fixed: true,
|
|
455
449
|
color: "primary",
|
|
@@ -462,10 +456,9 @@ function CssClassSelector() {
|
|
|
462
456
|
const { id: activeId, setId: setActiveId } = useStyle();
|
|
463
457
|
const actions = useCreateActions({ pushAppliedId, setActiveId });
|
|
464
458
|
const handleApply = useHandleApply(appliedIds, setAppliedIds);
|
|
465
|
-
const handleActivate = ({ value }) => setActiveId(value);
|
|
466
459
|
const applied = useAppliedOptions(options10, appliedIds);
|
|
467
460
|
const active = applied.find((option) => option.value === activeId) ?? EMPTY_OPTION;
|
|
468
|
-
return /* @__PURE__ */
|
|
461
|
+
return /* @__PURE__ */ React7.createElement(Stack2, { gap: 1, p: 2 }, /* @__PURE__ */ React7.createElement(Stack2, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React7.createElement(Typography2, { component: "label", variant: "caption", htmlFor: ID }, __3("CSS Classes", "elementor")), /* @__PURE__ */ React7.createElement(Stack2, { direction: "row", gap: 1 }, /* @__PURE__ */ React7.createElement(ClassSelectorActionsSlot, null))), /* @__PURE__ */ React7.createElement(
|
|
469
462
|
MultiCombobox,
|
|
470
463
|
{
|
|
471
464
|
id: ID,
|
|
@@ -475,146 +468,59 @@ function CssClassSelector() {
|
|
|
475
468
|
onSelect: handleApply,
|
|
476
469
|
limitTags: TAGS_LIMIT,
|
|
477
470
|
actions,
|
|
478
|
-
getLimitTagsText: (more) => /* @__PURE__ */
|
|
471
|
+
getLimitTagsText: (more) => /* @__PURE__ */ React7.createElement(Chip2, { size: "tiny", variant: "standard", label: `+${more}`, clickable: true }),
|
|
479
472
|
renderTags: (values, getTagProps) => values.map((value, index) => {
|
|
480
473
|
const chipProps = getTagProps({ index });
|
|
481
474
|
const isActive = value.value === active?.value;
|
|
475
|
+
const isElementsProvider = value.provider === ELEMENTS_STYLES_PROVIDER_KEY;
|
|
482
476
|
const renameLabel = (newLabel) => {
|
|
483
477
|
return updateClassByProvider(value.provider, { label: newLabel, id: value.value });
|
|
484
478
|
};
|
|
485
|
-
return /* @__PURE__ */
|
|
486
|
-
|
|
479
|
+
return /* @__PURE__ */ React7.createElement(
|
|
480
|
+
CssClassItem,
|
|
487
481
|
{
|
|
488
482
|
key: chipProps.key,
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
)
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
CssClassItem,
|
|
499
|
-
{
|
|
500
|
-
label: value.label,
|
|
501
|
-
id: value.value,
|
|
502
|
-
isActive,
|
|
503
|
-
isGlobal: value.color === "global",
|
|
504
|
-
color: isActive && value.color ? value.color : "default",
|
|
505
|
-
chipProps,
|
|
506
|
-
onClickActive: () => handleActivate(value)
|
|
507
|
-
}
|
|
508
|
-
)
|
|
483
|
+
label: value.label,
|
|
484
|
+
provider: value.provider,
|
|
485
|
+
id: value.value,
|
|
486
|
+
isActive,
|
|
487
|
+
color: isActive && value.color ? value.color : "default",
|
|
488
|
+
chipProps,
|
|
489
|
+
onClickActive: () => setActiveId(isElementsProvider ? null : value.value),
|
|
490
|
+
renameLabel
|
|
491
|
+
}
|
|
509
492
|
);
|
|
510
493
|
})
|
|
511
494
|
}
|
|
512
495
|
));
|
|
513
496
|
}
|
|
514
|
-
var CHIP_SIZE = "tiny";
|
|
515
|
-
function CssClassItem({
|
|
516
|
-
id,
|
|
517
|
-
label,
|
|
518
|
-
isActive,
|
|
519
|
-
isGlobal,
|
|
520
|
-
color: colorProp,
|
|
521
|
-
chipProps,
|
|
522
|
-
onClickActive
|
|
523
|
-
}) {
|
|
524
|
-
const { meta } = useStyle();
|
|
525
|
-
const popupId = useId2().replace(/:/g, "_");
|
|
526
|
-
const popupState = usePopupState({ variant: "popover", popupId });
|
|
527
|
-
const chipRef = useRef3(null);
|
|
528
|
-
const { onDelete, ...chipGroupProps } = chipProps;
|
|
529
|
-
const { isEditing, openEditMode, error, submitting } = useEditableField();
|
|
530
|
-
const color = error ? "error" : colorProp;
|
|
531
|
-
return /* @__PURE__ */ React9.createElement(CssClassItemProvider, { styleId: id, isActive, isGlobal }, /* @__PURE__ */ React9.createElement(UnstableChipGroup, { ref: chipRef, ...chipGroupProps, "aria-label": `Edit ${label}`, role: "group" }, /* @__PURE__ */ React9.createElement(
|
|
532
|
-
Chip,
|
|
533
|
-
{
|
|
534
|
-
disabled: submitting,
|
|
535
|
-
size: CHIP_SIZE,
|
|
536
|
-
label: /* @__PURE__ */ React9.createElement(
|
|
537
|
-
EditableField,
|
|
538
|
-
{
|
|
539
|
-
onDoubleClick: () => {
|
|
540
|
-
if (!isActive) {
|
|
541
|
-
openEditMode();
|
|
542
|
-
}
|
|
543
|
-
},
|
|
544
|
-
onClick: () => {
|
|
545
|
-
if (isActive) {
|
|
546
|
-
openEditMode();
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
},
|
|
550
|
-
/* @__PURE__ */ React9.createElement(ConditionalTooltipWrapper, { maxWidth: "10ch", title: label })
|
|
551
|
-
),
|
|
552
|
-
variant: isActive && !meta.state ? "filled" : "standard",
|
|
553
|
-
color,
|
|
554
|
-
onClick: () => onClickActive(id),
|
|
555
|
-
"aria-pressed": isActive,
|
|
556
|
-
sx: {
|
|
557
|
-
"&.Mui-focusVisible": {
|
|
558
|
-
boxShadow: "none !important"
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
), !isEditing && /* @__PURE__ */ React9.createElement(
|
|
563
|
-
Chip,
|
|
564
|
-
{
|
|
565
|
-
disabled: submitting,
|
|
566
|
-
size: CHIP_SIZE,
|
|
567
|
-
label: /* @__PURE__ */ React9.createElement(Stack, { direction: "row", gap: 0.5, alignItems: "center" }, isActive && meta.state && /* @__PURE__ */ React9.createElement(Typography, { variant: "inherit" }, meta.state), /* @__PURE__ */ React9.createElement(DotsVerticalIcon, { fontSize: "inherit" })),
|
|
568
|
-
variant: "filled",
|
|
569
|
-
color,
|
|
570
|
-
...bindTrigger(popupState),
|
|
571
|
-
"aria-label": __2("Open CSS Class Menu", "elementor")
|
|
572
|
-
}
|
|
573
|
-
)), /* @__PURE__ */ React9.createElement(CssClassMenu, { popupState, containerRef: chipRef }));
|
|
574
|
-
}
|
|
575
497
|
var updateClassByProvider = (provider, data) => {
|
|
576
|
-
const providerInstance =
|
|
498
|
+
const providerInstance = stylesRepository4.getProviderByKey(provider);
|
|
577
499
|
if (!providerInstance) {
|
|
578
500
|
return;
|
|
579
501
|
}
|
|
580
502
|
return providerInstance.actions.update?.(data);
|
|
581
503
|
};
|
|
582
|
-
var VALID_SELECTOR_REGEX = /^[a-zA-Z0-9_-]+$/;
|
|
583
|
-
var renameValidation = (newLabel, options10) => {
|
|
584
|
-
if (isNameExist(newLabel, options10)) {
|
|
585
|
-
return __2("Existing name", "elementor");
|
|
586
|
-
}
|
|
587
|
-
if (isCharactersNotSupported(newLabel)) {
|
|
588
|
-
return __2("Format is not valid", "elementor");
|
|
589
|
-
}
|
|
590
|
-
};
|
|
591
|
-
var isNameExist = (newLabel, options10) => {
|
|
592
|
-
if (!options10?.length) {
|
|
593
|
-
return false;
|
|
594
|
-
}
|
|
595
|
-
return options10.some((option) => option.label.toLowerCase() === newLabel.toLowerCase());
|
|
596
|
-
};
|
|
597
|
-
var isCharactersNotSupported = (newLabel) => !VALID_SELECTOR_REGEX.test(newLabel);
|
|
598
504
|
function useOptions() {
|
|
599
505
|
const { element } = useElement();
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
return styleDefs.map((styleDef) => {
|
|
607
|
-
return {
|
|
608
|
-
label: styleDef.label,
|
|
609
|
-
value: styleDef.id,
|
|
610
|
-
fixed: isElements,
|
|
611
|
-
color: isElements ? "primary" : "global",
|
|
612
|
-
provider: provider.key,
|
|
613
|
-
group: provider.labels?.plural
|
|
614
|
-
};
|
|
615
|
-
});
|
|
506
|
+
const isProviderEditable = (provider) => !!provider.actions.updateProps;
|
|
507
|
+
return useProviders().filter(isProviderEditable).flatMap((provider) => {
|
|
508
|
+
const isElements = provider.key === ELEMENTS_STYLES_PROVIDER_KEY;
|
|
509
|
+
const styleDefs = provider.actions.get({ elementId: element.id });
|
|
510
|
+
if (isElements && styleDefs.length === 0) {
|
|
511
|
+
return [EMPTY_OPTION];
|
|
616
512
|
}
|
|
617
|
-
|
|
513
|
+
return styleDefs.map((styleDef) => {
|
|
514
|
+
return {
|
|
515
|
+
label: styleDef.label,
|
|
516
|
+
value: styleDef.id,
|
|
517
|
+
fixed: isElements,
|
|
518
|
+
color: isElements ? "primary" : "global",
|
|
519
|
+
provider: provider.key,
|
|
520
|
+
group: provider.labels?.plural
|
|
521
|
+
};
|
|
522
|
+
});
|
|
523
|
+
});
|
|
618
524
|
}
|
|
619
525
|
function useCreateActions({
|
|
620
526
|
pushAppliedId,
|
|
@@ -623,14 +529,14 @@ function useCreateActions({
|
|
|
623
529
|
return useCreateActionsByProvider().map(([provider, create]) => {
|
|
624
530
|
return {
|
|
625
531
|
// translators: %s is the label of the new class.
|
|
626
|
-
label: (value) =>
|
|
627
|
-
apply:
|
|
628
|
-
const
|
|
629
|
-
if (!
|
|
532
|
+
label: (value) => __3('Create new "%s"', "elementor").replace("%s", value),
|
|
533
|
+
apply: (label) => {
|
|
534
|
+
const createdId = create(label);
|
|
535
|
+
if (!createdId) {
|
|
630
536
|
return;
|
|
631
537
|
}
|
|
632
|
-
pushAppliedId(
|
|
633
|
-
setActiveId(
|
|
538
|
+
pushAppliedId(createdId);
|
|
539
|
+
setActiveId(createdId);
|
|
634
540
|
},
|
|
635
541
|
condition: (options10, inputValue) => {
|
|
636
542
|
const isUniqueLabel = !options10.some(
|
|
@@ -639,7 +545,7 @@ function useCreateActions({
|
|
|
639
545
|
return !!inputValue && isUniqueLabel;
|
|
640
546
|
},
|
|
641
547
|
// translators: %s is the singular label of css class provider (e.g "Global CSS Class").
|
|
642
|
-
group:
|
|
548
|
+
group: __3("Create New %s", "elementor").replace("%s", provider.labels?.singular ?? "")
|
|
643
549
|
};
|
|
644
550
|
});
|
|
645
551
|
}
|
|
@@ -656,9 +562,9 @@ function useAppliedOptions(options10, appliedIds) {
|
|
|
656
562
|
function useAppliedClassesIds() {
|
|
657
563
|
const { element } = useElement();
|
|
658
564
|
const currentClassesProp = useClassesProp();
|
|
659
|
-
const value =
|
|
565
|
+
const value = useElementSetting2(element.id, currentClassesProp)?.value || [];
|
|
660
566
|
const setValue = (ids) => {
|
|
661
|
-
|
|
567
|
+
updateElementSettings2({
|
|
662
568
|
id: element.id,
|
|
663
569
|
props: {
|
|
664
570
|
[currentClassesProp]: classesPropTypeUtil.create(ids)
|
|
@@ -700,22 +606,22 @@ function useHandleApply(appliedIds, setAppliedIds) {
|
|
|
700
606
|
import { __createPanel as createPanel } from "@elementor/editor-panels";
|
|
701
607
|
|
|
702
608
|
// src/components/editing-panel.tsx
|
|
703
|
-
import * as
|
|
609
|
+
import * as React60 from "react";
|
|
704
610
|
import { ControlActionsProvider, ControlReplacementProvider } from "@elementor/editor-controls";
|
|
705
611
|
import { useSelectedElement } from "@elementor/editor-elements";
|
|
706
612
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
707
613
|
import { SessionStorageProvider as SessionStorageProvider3 } from "@elementor/session";
|
|
708
614
|
import { ErrorBoundary } from "@elementor/ui";
|
|
709
|
-
import { __ as
|
|
615
|
+
import { __ as __41 } from "@wordpress/i18n";
|
|
710
616
|
|
|
711
617
|
// src/controls-actions.ts
|
|
712
|
-
import { createMenu
|
|
618
|
+
import { createMenu } from "@elementor/menus";
|
|
713
619
|
|
|
714
620
|
// src/popover-action.tsx
|
|
715
|
-
import * as
|
|
716
|
-
import { useId as
|
|
621
|
+
import * as React8 from "react";
|
|
622
|
+
import { useId as useId2 } from "react";
|
|
717
623
|
import { XIcon } from "@elementor/icons";
|
|
718
|
-
import { bindPopover, bindToggle, IconButton, Popover, Stack as
|
|
624
|
+
import { bindPopover, bindToggle, IconButton, Popover, Stack as Stack3, Tooltip, Typography as Typography3, usePopupState as usePopupState2 } from "@elementor/ui";
|
|
719
625
|
var SIZE = "tiny";
|
|
720
626
|
function PopoverAction({
|
|
721
627
|
title,
|
|
@@ -723,7 +629,7 @@ function PopoverAction({
|
|
|
723
629
|
icon: Icon,
|
|
724
630
|
popoverContent: PopoverContent
|
|
725
631
|
}) {
|
|
726
|
-
const id =
|
|
632
|
+
const id = useId2();
|
|
727
633
|
const popupState = usePopupState2({
|
|
728
634
|
variant: "popover",
|
|
729
635
|
popupId: `elementor-popover-action-${id}`
|
|
@@ -731,7 +637,7 @@ function PopoverAction({
|
|
|
731
637
|
if (!visible) {
|
|
732
638
|
return null;
|
|
733
639
|
}
|
|
734
|
-
return /* @__PURE__ */
|
|
640
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(Tooltip, { placement: "top", title }, /* @__PURE__ */ React8.createElement(IconButton, { "aria-label": title, key: id, size: SIZE, ...bindToggle(popupState) }, /* @__PURE__ */ React8.createElement(Icon, { fontSize: SIZE }))), /* @__PURE__ */ React8.createElement(
|
|
735
641
|
Popover,
|
|
736
642
|
{
|
|
737
643
|
disablePortal: true,
|
|
@@ -742,39 +648,38 @@ function PopoverAction({
|
|
|
742
648
|
},
|
|
743
649
|
...bindPopover(popupState)
|
|
744
650
|
},
|
|
745
|
-
/* @__PURE__ */
|
|
746
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ React8.createElement(Stack3, { 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(Typography3, { variant: "subtitle2" }, title), /* @__PURE__ */ React8.createElement(IconButton, { sx: { ml: "auto" }, size: SIZE, onClick: popupState.close }, /* @__PURE__ */ React8.createElement(XIcon, { fontSize: SIZE }))),
|
|
652
|
+
/* @__PURE__ */ React8.createElement(PopoverContent, { closePopover: popupState.close })
|
|
747
653
|
));
|
|
748
654
|
}
|
|
749
655
|
|
|
750
656
|
// src/controls-actions.ts
|
|
751
|
-
var controlActionsMenu =
|
|
657
|
+
var controlActionsMenu = createMenu({
|
|
752
658
|
components: {
|
|
753
659
|
PopoverAction
|
|
754
660
|
}
|
|
755
661
|
});
|
|
756
662
|
|
|
757
663
|
// src/components/editing-panel-error-fallback.tsx
|
|
758
|
-
import * as
|
|
759
|
-
import { Alert, Box as
|
|
664
|
+
import * as React9 from "react";
|
|
665
|
+
import { Alert, Box as Box2 } from "@elementor/ui";
|
|
760
666
|
function EditorPanelErrorFallback() {
|
|
761
|
-
return /* @__PURE__ */
|
|
667
|
+
return /* @__PURE__ */ React9.createElement(Box2, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React9.createElement(Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React9.createElement("strong", null, "Something went wrong")));
|
|
762
668
|
}
|
|
763
669
|
|
|
764
670
|
// src/components/editing-panel-tabs.tsx
|
|
765
|
-
import * as
|
|
766
|
-
import { Fragment as
|
|
767
|
-
import { Divider as
|
|
768
|
-
import { __ as
|
|
671
|
+
import * as React59 from "react";
|
|
672
|
+
import { Fragment as Fragment8 } from "react";
|
|
673
|
+
import { Divider as Divider9, Stack as Stack20, Tab, TabPanel, Tabs, useTabs } from "@elementor/ui";
|
|
674
|
+
import { __ as __40 } from "@wordpress/i18n";
|
|
769
675
|
|
|
770
676
|
// src/components/settings-tab.tsx
|
|
771
|
-
import * as
|
|
677
|
+
import * as React15 from "react";
|
|
772
678
|
import { ControlLabel } from "@elementor/editor-controls";
|
|
773
679
|
import { SessionStorageProvider } from "@elementor/session";
|
|
774
680
|
|
|
775
681
|
// src/controls-registry/control.tsx
|
|
776
|
-
import * as
|
|
777
|
-
import { createError } from "@elementor/utils";
|
|
682
|
+
import * as React10 from "react";
|
|
778
683
|
|
|
779
684
|
// src/controls-registry/controls-registry.tsx
|
|
780
685
|
import {
|
|
@@ -782,13 +687,15 @@ import {
|
|
|
782
687
|
LinkControl,
|
|
783
688
|
SelectControl,
|
|
784
689
|
SizeControl,
|
|
690
|
+
SvgMediaControl,
|
|
785
691
|
TextAreaControl,
|
|
786
692
|
TextControl,
|
|
787
693
|
UrlControl
|
|
788
694
|
} from "@elementor/editor-controls";
|
|
789
695
|
var controlTypes = {
|
|
790
696
|
image: { component: ImageControl, layout: "full" },
|
|
791
|
-
|
|
697
|
+
"svg-media": { component: SvgMediaControl, layout: "full" },
|
|
698
|
+
text: { component: TextControl, layout: "full" },
|
|
792
699
|
textarea: { component: TextAreaControl, layout: "full" },
|
|
793
700
|
size: { component: SizeControl, layout: "two-columns" },
|
|
794
701
|
select: { component: SelectControl, layout: "two-columns" },
|
|
@@ -799,31 +706,27 @@ var getControlByType = (type) => controlTypes[type]?.component;
|
|
|
799
706
|
var getLayoutByType = (type) => controlTypes[type].layout;
|
|
800
707
|
|
|
801
708
|
// src/controls-registry/control.tsx
|
|
802
|
-
var ControlTypeError = createError({
|
|
803
|
-
code: "CONTROL_TYPE_NOT_FOUND",
|
|
804
|
-
message: `Control type not found.`
|
|
805
|
-
});
|
|
806
709
|
var Control = ({ props, type }) => {
|
|
807
710
|
const ControlByType = getControlByType(type);
|
|
808
711
|
if (!ControlByType) {
|
|
809
|
-
throw new
|
|
810
|
-
context: { type }
|
|
712
|
+
throw new ControlTypeNotFoundError({
|
|
713
|
+
context: { controlType: type }
|
|
811
714
|
});
|
|
812
715
|
}
|
|
813
|
-
return /* @__PURE__ */
|
|
716
|
+
return /* @__PURE__ */ React10.createElement(ControlByType, { ...props });
|
|
814
717
|
};
|
|
815
718
|
|
|
816
719
|
// src/controls-registry/control-type-container.tsx
|
|
817
|
-
import * as
|
|
818
|
-
import { Box as
|
|
720
|
+
import * as React11 from "react";
|
|
721
|
+
import { Box as Box3, styled as styled2 } from "@elementor/ui";
|
|
819
722
|
var ControlTypeContainer = ({
|
|
820
723
|
controlType,
|
|
821
724
|
children
|
|
822
725
|
}) => {
|
|
823
726
|
const layout = getLayoutByType(controlType);
|
|
824
|
-
return /* @__PURE__ */
|
|
727
|
+
return /* @__PURE__ */ React11.createElement(StyledContainer, { layout }, children);
|
|
825
728
|
};
|
|
826
|
-
var StyledContainer =
|
|
729
|
+
var StyledContainer = styled2(Box3, {
|
|
827
730
|
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
828
731
|
})(({ layout, theme }) => ({
|
|
829
732
|
display: "grid",
|
|
@@ -839,9 +742,9 @@ var getGridLayout = (layout) => ({
|
|
|
839
742
|
});
|
|
840
743
|
|
|
841
744
|
// src/controls-registry/settings-field.tsx
|
|
842
|
-
import * as
|
|
745
|
+
import * as React12 from "react";
|
|
843
746
|
import { PropKeyProvider, PropProvider } from "@elementor/editor-controls";
|
|
844
|
-
import { updateElementSettings as
|
|
747
|
+
import { updateElementSettings as updateElementSettings3, useElementSetting as useElementSetting3 } from "@elementor/editor-elements";
|
|
845
748
|
|
|
846
749
|
// src/controls-registry/create-top-level-object-type.ts
|
|
847
750
|
var createTopLevelOjectType = ({ schema }) => {
|
|
@@ -859,27 +762,31 @@ var createTopLevelOjectType = ({ schema }) => {
|
|
|
859
762
|
// src/controls-registry/settings-field.tsx
|
|
860
763
|
var SettingsField = ({ bind, children }) => {
|
|
861
764
|
const { element, elementType } = useElement();
|
|
862
|
-
const settingsValue =
|
|
765
|
+
const settingsValue = useElementSetting3(element.id, bind);
|
|
766
|
+
const linkValue = useElementSetting3(element.id, "link");
|
|
863
767
|
const value = { [bind]: settingsValue };
|
|
864
768
|
const propType = createTopLevelOjectType({ schema: elementType.propsSchema });
|
|
769
|
+
if (bind === "tag" && linkValue?.value && "div-block" === elementType.key) {
|
|
770
|
+
return null;
|
|
771
|
+
}
|
|
865
772
|
const setValue = (newValue) => {
|
|
866
|
-
|
|
773
|
+
updateElementSettings3({
|
|
867
774
|
id: element.id,
|
|
868
775
|
props: { ...newValue }
|
|
869
776
|
});
|
|
870
777
|
};
|
|
871
|
-
return /* @__PURE__ */
|
|
778
|
+
return /* @__PURE__ */ React12.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React12.createElement(PropKeyProvider, { bind }, children));
|
|
872
779
|
};
|
|
873
780
|
|
|
874
781
|
// src/components/section.tsx
|
|
875
|
-
import * as
|
|
876
|
-
import { useId as
|
|
877
|
-
import { Collapse, Divider, ListItemButton, ListItemText
|
|
782
|
+
import * as React13 from "react";
|
|
783
|
+
import { useId as useId3, useState as useState3 } from "react";
|
|
784
|
+
import { Collapse, Divider as Divider2, ListItemButton, ListItemText, Stack as Stack4 } from "@elementor/ui";
|
|
878
785
|
|
|
879
786
|
// src/components/collapse-icon.tsx
|
|
880
787
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
881
|
-
import { styled as
|
|
882
|
-
var CollapseIcon =
|
|
788
|
+
import { styled as styled3 } from "@elementor/ui";
|
|
789
|
+
var CollapseIcon = styled3(ChevronDownIcon, {
|
|
883
790
|
shouldForwardProp: (prop) => prop !== "open"
|
|
884
791
|
})(({ theme, open }) => ({
|
|
885
792
|
transform: open ? "rotate(180deg)" : "rotate(0deg)",
|
|
@@ -890,40 +797,40 @@ var CollapseIcon = styled4(ChevronDownIcon, {
|
|
|
890
797
|
|
|
891
798
|
// src/components/section.tsx
|
|
892
799
|
function Section({ title, children, defaultExpanded = false }) {
|
|
893
|
-
const [isOpen, setIsOpen] =
|
|
894
|
-
const id =
|
|
800
|
+
const [isOpen, setIsOpen] = useState3(!!defaultExpanded);
|
|
801
|
+
const id = useId3();
|
|
895
802
|
const labelId = `label-${id}`;
|
|
896
803
|
const contentId = `content-${id}`;
|
|
897
|
-
return /* @__PURE__ */
|
|
804
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(
|
|
898
805
|
ListItemButton,
|
|
899
806
|
{
|
|
900
807
|
id: labelId,
|
|
901
808
|
"aria-controls": contentId,
|
|
902
809
|
onClick: () => setIsOpen((prev) => !prev)
|
|
903
810
|
},
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
-
/* @__PURE__ */
|
|
906
|
-
), /* @__PURE__ */
|
|
811
|
+
/* @__PURE__ */ React13.createElement(ListItemText, { secondary: title }),
|
|
812
|
+
/* @__PURE__ */ React13.createElement(CollapseIcon, { open: isOpen, color: "secondary" })
|
|
813
|
+
), /* @__PURE__ */ React13.createElement(Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React13.createElement(Stack4, { gap: 2.5, p: 2 }, children)), /* @__PURE__ */ React13.createElement(Divider2, null));
|
|
907
814
|
}
|
|
908
815
|
|
|
909
816
|
// src/components/sections-list.tsx
|
|
910
|
-
import * as
|
|
817
|
+
import * as React14 from "react";
|
|
911
818
|
import { List } from "@elementor/ui";
|
|
912
819
|
function SectionsList(props) {
|
|
913
|
-
return /* @__PURE__ */
|
|
820
|
+
return /* @__PURE__ */ React14.createElement(List, { disablePadding: true, component: "div", ...props });
|
|
914
821
|
}
|
|
915
822
|
|
|
916
823
|
// src/components/settings-tab.tsx
|
|
917
824
|
var SettingsTab = () => {
|
|
918
825
|
const { elementType, element } = useElement();
|
|
919
|
-
return /* @__PURE__ */
|
|
826
|
+
return /* @__PURE__ */ React15.createElement(SessionStorageProvider, { prefix: element.id }, /* @__PURE__ */ React15.createElement(SectionsList, null, elementType.controls.map(({ type, value }, index) => {
|
|
920
827
|
if (type === "control") {
|
|
921
|
-
return /* @__PURE__ */
|
|
828
|
+
return /* @__PURE__ */ React15.createElement(Control2, { key: value.bind, control: value });
|
|
922
829
|
}
|
|
923
830
|
if (type === "section") {
|
|
924
|
-
return /* @__PURE__ */
|
|
831
|
+
return /* @__PURE__ */ React15.createElement(Section, { title: value.label, key: type + "." + index, defaultExpanded: true }, value.items?.map((item) => {
|
|
925
832
|
if (item.type === "control") {
|
|
926
|
-
return /* @__PURE__ */
|
|
833
|
+
return /* @__PURE__ */ React15.createElement(Control2, { key: item.value.bind, control: item.value });
|
|
927
834
|
}
|
|
928
835
|
return null;
|
|
929
836
|
}));
|
|
@@ -935,60 +842,155 @@ var Control2 = ({ control }) => {
|
|
|
935
842
|
if (!getControlByType(control.type)) {
|
|
936
843
|
return null;
|
|
937
844
|
}
|
|
938
|
-
return /* @__PURE__ */
|
|
845
|
+
return /* @__PURE__ */ React15.createElement(SettingsField, { bind: control.bind }, /* @__PURE__ */ React15.createElement(ControlTypeContainer, { controlType: control.type }, control.label ? /* @__PURE__ */ React15.createElement(ControlLabel, null, control.label) : null, /* @__PURE__ */ React15.createElement(Control, { type: control.type, props: control.props })));
|
|
939
846
|
};
|
|
940
847
|
|
|
941
848
|
// src/components/style-tab.tsx
|
|
942
|
-
import * as
|
|
943
|
-
import { useState as
|
|
944
|
-
import { useElementSetting as
|
|
849
|
+
import * as React58 from "react";
|
|
850
|
+
import { useState as useState7 } from "react";
|
|
851
|
+
import { useElementSetting as useElementSetting4, useElementStyles } from "@elementor/editor-elements";
|
|
945
852
|
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
946
853
|
import { SessionStorageProvider as SessionStorageProvider2 } from "@elementor/session";
|
|
947
|
-
import { Divider as
|
|
948
|
-
import { __ as
|
|
854
|
+
import { Divider as Divider8 } from "@elementor/ui";
|
|
855
|
+
import { __ as __39 } from "@wordpress/i18n";
|
|
949
856
|
|
|
950
857
|
// src/components/style-sections/background-section/background-section.tsx
|
|
951
|
-
import * as
|
|
858
|
+
import * as React17 from "react";
|
|
952
859
|
import { BackgroundControl } from "@elementor/editor-controls";
|
|
953
860
|
|
|
954
861
|
// src/controls-registry/styles-field.tsx
|
|
955
|
-
import * as
|
|
862
|
+
import * as React16 from "react";
|
|
956
863
|
import { PropKeyProvider as PropKeyProvider2, PropProvider as PropProvider2 } from "@elementor/editor-controls";
|
|
957
864
|
import { getStylesSchema } from "@elementor/editor-styles";
|
|
958
865
|
|
|
959
866
|
// src/hooks/use-styles-fields.ts
|
|
960
|
-
import {
|
|
961
|
-
import {
|
|
867
|
+
import { useEffect, useMemo, useReducer } from "react";
|
|
868
|
+
import {
|
|
869
|
+
createElementStyle,
|
|
870
|
+
deleteElementStyle,
|
|
871
|
+
getElementLabel
|
|
872
|
+
} from "@elementor/editor-elements";
|
|
873
|
+
import { getVariantByMeta } from "@elementor/editor-styles";
|
|
874
|
+
import { LOCAL_STYLES_RESERVED_LABEL } from "@elementor/editor-styles-repository";
|
|
875
|
+
import { undoable } from "@elementor/editor-v1-adapters";
|
|
876
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
962
877
|
function useStylesFields(propNames) {
|
|
963
878
|
const { element } = useElement();
|
|
964
|
-
const { id, meta } = useStyle();
|
|
879
|
+
const { id, meta, provider } = useStyle();
|
|
965
880
|
const classesProp = useClassesProp();
|
|
966
|
-
const
|
|
967
|
-
|
|
968
|
-
|
|
881
|
+
const undoableUpdateStyle = useUndoableUpdateStyle();
|
|
882
|
+
const undoableCreateElementStyle = useUndoableCreateElementStyle();
|
|
883
|
+
const [, reRender] = useReducer((p) => !p, false);
|
|
884
|
+
useEffect(() => provider?.subscribe(reRender), [provider]);
|
|
885
|
+
const value = getProps({
|
|
886
|
+
elementId: element.id,
|
|
887
|
+
styleId: id,
|
|
888
|
+
provider,
|
|
969
889
|
meta,
|
|
970
890
|
propNames
|
|
971
891
|
});
|
|
972
892
|
const setValue = (props) => {
|
|
973
893
|
if (id === null) {
|
|
974
|
-
|
|
894
|
+
undoableCreateElementStyle({
|
|
975
895
|
elementId: element.id,
|
|
976
896
|
classesProp,
|
|
977
897
|
meta,
|
|
978
|
-
props
|
|
979
|
-
label: __3("local", "elementor")
|
|
898
|
+
props
|
|
980
899
|
});
|
|
981
900
|
return;
|
|
982
901
|
}
|
|
983
|
-
|
|
902
|
+
undoableUpdateStyle({
|
|
984
903
|
elementId: element.id,
|
|
985
904
|
styleId: id,
|
|
986
|
-
|
|
987
|
-
meta
|
|
905
|
+
provider,
|
|
906
|
+
meta,
|
|
907
|
+
props
|
|
988
908
|
});
|
|
989
909
|
};
|
|
990
910
|
return [value, setValue];
|
|
991
911
|
}
|
|
912
|
+
function getProps({ styleId, elementId, provider, meta, propNames }) {
|
|
913
|
+
if (!provider || !styleId) {
|
|
914
|
+
return null;
|
|
915
|
+
}
|
|
916
|
+
const style = provider.actions.getById?.(styleId, { elementId });
|
|
917
|
+
if (!style) {
|
|
918
|
+
throw new StyleNotFoundUnderProviderError({ context: { styleId, providerKey: provider.key } });
|
|
919
|
+
}
|
|
920
|
+
const variant = getVariantByMeta(style, meta);
|
|
921
|
+
return Object.fromEntries(
|
|
922
|
+
propNames.map((key) => [key, variant?.props[key] ?? null])
|
|
923
|
+
);
|
|
924
|
+
}
|
|
925
|
+
function useUndoableCreateElementStyle() {
|
|
926
|
+
return useMemo(() => {
|
|
927
|
+
return undoable(
|
|
928
|
+
{
|
|
929
|
+
do: (payload) => {
|
|
930
|
+
return createElementStyle({
|
|
931
|
+
...payload,
|
|
932
|
+
label: LOCAL_STYLES_RESERVED_LABEL
|
|
933
|
+
});
|
|
934
|
+
},
|
|
935
|
+
undo: ({ elementId }, styleId) => {
|
|
936
|
+
deleteElementStyle(elementId, styleId);
|
|
937
|
+
},
|
|
938
|
+
redo: (payload, styleId) => {
|
|
939
|
+
return createElementStyle({
|
|
940
|
+
...payload,
|
|
941
|
+
styleId,
|
|
942
|
+
label: LOCAL_STYLES_RESERVED_LABEL
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
title: ({ elementId }) => getElementLabel(elementId),
|
|
948
|
+
subtitle: __4("Style edited", "elementor")
|
|
949
|
+
}
|
|
950
|
+
);
|
|
951
|
+
}, []);
|
|
952
|
+
}
|
|
953
|
+
function useUndoableUpdateStyle() {
|
|
954
|
+
return useMemo(() => {
|
|
955
|
+
return undoable(
|
|
956
|
+
{
|
|
957
|
+
do: ({ elementId, styleId, provider, meta, props }) => {
|
|
958
|
+
if (!provider.actions.updateProps) {
|
|
959
|
+
throw new StylesProviderCannotUpdatePropsError({
|
|
960
|
+
context: { providerKey: provider.key }
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
const style = provider.actions.getById(styleId, { elementId });
|
|
964
|
+
const prevProps = getCurrentProps(style, meta);
|
|
965
|
+
provider.actions.updateProps(
|
|
966
|
+
{
|
|
967
|
+
id: styleId,
|
|
968
|
+
meta,
|
|
969
|
+
props
|
|
970
|
+
},
|
|
971
|
+
{ elementId }
|
|
972
|
+
);
|
|
973
|
+
return prevProps;
|
|
974
|
+
},
|
|
975
|
+
undo: ({ elementId, styleId, meta, provider }, prevProps) => {
|
|
976
|
+
provider.actions.updateProps?.({ id: styleId, meta, props: prevProps }, { elementId });
|
|
977
|
+
}
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
title: ({ elementId }) => getElementLabel(elementId),
|
|
981
|
+
subtitle: __4("Style edited", "elementor")
|
|
982
|
+
}
|
|
983
|
+
);
|
|
984
|
+
}, []);
|
|
985
|
+
}
|
|
986
|
+
function getCurrentProps(style, meta) {
|
|
987
|
+
if (!style) {
|
|
988
|
+
return {};
|
|
989
|
+
}
|
|
990
|
+
const variant = getVariantByMeta(style, meta);
|
|
991
|
+
const props = variant?.props ?? {};
|
|
992
|
+
return structuredClone(props);
|
|
993
|
+
}
|
|
992
994
|
|
|
993
995
|
// src/hooks/use-styles-field.ts
|
|
994
996
|
function useStylesField(propName) {
|
|
@@ -1011,31 +1013,31 @@ var StylesField = ({ bind, children }) => {
|
|
|
1011
1013
|
const setValues = (newValue) => {
|
|
1012
1014
|
setValue(newValue[bind]);
|
|
1013
1015
|
};
|
|
1014
|
-
return /* @__PURE__ */
|
|
1016
|
+
return /* @__PURE__ */ React16.createElement(PropProvider2, { propType, value: values, setValue: setValues }, /* @__PURE__ */ React16.createElement(PropKeyProvider2, { bind }, children));
|
|
1015
1017
|
};
|
|
1016
1018
|
|
|
1017
1019
|
// src/components/style-sections/background-section/background-section.tsx
|
|
1018
1020
|
var BackgroundSection = () => {
|
|
1019
|
-
return /* @__PURE__ */
|
|
1021
|
+
return /* @__PURE__ */ React17.createElement(StylesField, { bind: "background" }, /* @__PURE__ */ React17.createElement(BackgroundControl, null));
|
|
1020
1022
|
};
|
|
1021
1023
|
|
|
1022
1024
|
// src/components/style-sections/border-section/border-section.tsx
|
|
1023
|
-
import * as
|
|
1024
|
-
import { Divider as
|
|
1025
|
+
import * as React24 from "react";
|
|
1026
|
+
import { Divider as Divider3, Stack as Stack6 } from "@elementor/ui";
|
|
1025
1027
|
|
|
1026
1028
|
// src/components/style-sections/border-section/border-field.tsx
|
|
1027
|
-
import * as
|
|
1028
|
-
import { __ as
|
|
1029
|
+
import * as React22 from "react";
|
|
1030
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
1029
1031
|
|
|
1030
1032
|
// src/components/add-or-remove-content.tsx
|
|
1031
|
-
import * as
|
|
1033
|
+
import * as React18 from "react";
|
|
1032
1034
|
import { ControlLabel as ControlLabel2 } from "@elementor/editor-controls";
|
|
1033
1035
|
import { MinusIcon, PlusIcon } from "@elementor/icons";
|
|
1034
|
-
import { Collapse as Collapse2, IconButton as IconButton2, Stack as
|
|
1036
|
+
import { Collapse as Collapse2, IconButton as IconButton2, Stack as Stack5 } from "@elementor/ui";
|
|
1035
1037
|
var SIZE2 = "tiny";
|
|
1036
1038
|
var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
1037
|
-
return /* @__PURE__ */
|
|
1038
|
-
|
|
1039
|
+
return /* @__PURE__ */ React18.createElement(Stack5, { gap: 1.5 }, /* @__PURE__ */ React18.createElement(
|
|
1040
|
+
Stack5,
|
|
1039
1041
|
{
|
|
1040
1042
|
direction: "row",
|
|
1041
1043
|
sx: {
|
|
@@ -1043,75 +1045,75 @@ var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
|
1043
1045
|
alignItems: "center"
|
|
1044
1046
|
}
|
|
1045
1047
|
},
|
|
1046
|
-
/* @__PURE__ */
|
|
1047
|
-
isAdded ? /* @__PURE__ */
|
|
1048
|
-
), /* @__PURE__ */
|
|
1048
|
+
/* @__PURE__ */ React18.createElement(ControlLabel2, null, label),
|
|
1049
|
+
isAdded ? /* @__PURE__ */ React18.createElement(IconButton2, { size: SIZE2, onClick: onRemove, "aria-label": "Remove" }, /* @__PURE__ */ React18.createElement(MinusIcon, { fontSize: SIZE2 })) : /* @__PURE__ */ React18.createElement(IconButton2, { size: SIZE2, onClick: onAdd, "aria-label": "Add" }, /* @__PURE__ */ React18.createElement(PlusIcon, { fontSize: SIZE2 }))
|
|
1050
|
+
), /* @__PURE__ */ React18.createElement(Collapse2, { in: isAdded, unmountOnExit: true }, /* @__PURE__ */ React18.createElement(Stack5, { gap: 1.5 }, children)));
|
|
1049
1051
|
};
|
|
1050
1052
|
|
|
1051
1053
|
// src/components/style-sections/border-section/border-color-field.tsx
|
|
1052
|
-
import * as
|
|
1054
|
+
import * as React19 from "react";
|
|
1053
1055
|
import { ColorControl, ControlLabel as ControlLabel3 } from "@elementor/editor-controls";
|
|
1054
1056
|
import { Grid } from "@elementor/ui";
|
|
1055
|
-
import { __ as
|
|
1057
|
+
import { __ as __5 } from "@wordpress/i18n";
|
|
1056
1058
|
var BorderColorField = () => {
|
|
1057
|
-
return /* @__PURE__ */
|
|
1059
|
+
return /* @__PURE__ */ React19.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React19.createElement(Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React19.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(ControlLabel3, null, __5("Border Color", "elementor"))), /* @__PURE__ */ React19.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(ColorControl, null))));
|
|
1058
1060
|
};
|
|
1059
1061
|
|
|
1060
1062
|
// src/components/style-sections/border-section/border-style-field.tsx
|
|
1061
|
-
import * as
|
|
1063
|
+
import * as React20 from "react";
|
|
1062
1064
|
import { ControlLabel as ControlLabel4, SelectControl as SelectControl2 } from "@elementor/editor-controls";
|
|
1063
1065
|
import { Grid as Grid2 } from "@elementor/ui";
|
|
1064
|
-
import { __ as
|
|
1066
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
1065
1067
|
var borderStyles = [
|
|
1066
|
-
{ value: "none", label:
|
|
1067
|
-
{ value: "solid", label:
|
|
1068
|
-
{ value: "dashed", label:
|
|
1069
|
-
{ value: "dotted", label:
|
|
1070
|
-
{ value: "double", label:
|
|
1071
|
-
{ value: "groove", label:
|
|
1072
|
-
{ value: "ridge", label:
|
|
1073
|
-
{ value: "inset", label:
|
|
1074
|
-
{ value: "outset", label:
|
|
1068
|
+
{ value: "none", label: __6("None", "elementor") },
|
|
1069
|
+
{ value: "solid", label: __6("Solid", "elementor") },
|
|
1070
|
+
{ value: "dashed", label: __6("Dashed", "elementor") },
|
|
1071
|
+
{ value: "dotted", label: __6("Dotted", "elementor") },
|
|
1072
|
+
{ value: "double", label: __6("Double", "elementor") },
|
|
1073
|
+
{ value: "groove", label: __6("Groove", "elementor") },
|
|
1074
|
+
{ value: "ridge", label: __6("Ridge", "elementor") },
|
|
1075
|
+
{ value: "inset", label: __6("Inset", "elementor") },
|
|
1076
|
+
{ value: "outset", label: __6("Outset", "elementor") }
|
|
1075
1077
|
];
|
|
1076
1078
|
var BorderStyleField = () => {
|
|
1077
|
-
return /* @__PURE__ */
|
|
1079
|
+
return /* @__PURE__ */ React20.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React20.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React20.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React20.createElement(ControlLabel4, null, __6("Border Type", "elementor"))), /* @__PURE__ */ React20.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React20.createElement(SelectControl2, { options: borderStyles }))));
|
|
1078
1080
|
};
|
|
1079
1081
|
|
|
1080
1082
|
// src/components/style-sections/border-section/border-width-field.tsx
|
|
1081
|
-
import * as
|
|
1083
|
+
import * as React21 from "react";
|
|
1082
1084
|
import { EqualUnequalSizesControl } from "@elementor/editor-controls";
|
|
1083
1085
|
import { borderWidthPropTypeUtil } from "@elementor/editor-props";
|
|
1084
1086
|
import { SideAllIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
1085
|
-
import { __ as
|
|
1087
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
1086
1088
|
var edges = [
|
|
1087
1089
|
{
|
|
1088
|
-
label:
|
|
1089
|
-
icon: /* @__PURE__ */
|
|
1090
|
+
label: __7("Top", "elementor"),
|
|
1091
|
+
icon: /* @__PURE__ */ React21.createElement(SideTopIcon, { fontSize: "tiny" }),
|
|
1090
1092
|
bind: "top"
|
|
1091
1093
|
},
|
|
1092
1094
|
{
|
|
1093
|
-
label:
|
|
1094
|
-
icon: /* @__PURE__ */
|
|
1095
|
+
label: __7("Right", "elementor"),
|
|
1096
|
+
icon: /* @__PURE__ */ React21.createElement(SideRightIcon, { fontSize: "tiny" }),
|
|
1095
1097
|
bind: "right"
|
|
1096
1098
|
},
|
|
1097
1099
|
{
|
|
1098
|
-
label:
|
|
1099
|
-
icon: /* @__PURE__ */
|
|
1100
|
+
label: __7("Bottom", "elementor"),
|
|
1101
|
+
icon: /* @__PURE__ */ React21.createElement(SideBottomIcon, { fontSize: "tiny" }),
|
|
1100
1102
|
bind: "bottom"
|
|
1101
1103
|
},
|
|
1102
1104
|
{
|
|
1103
|
-
label:
|
|
1104
|
-
icon: /* @__PURE__ */
|
|
1105
|
+
label: __7("Left", "elementor"),
|
|
1106
|
+
icon: /* @__PURE__ */ React21.createElement(SideLeftIcon, { fontSize: "tiny" }),
|
|
1105
1107
|
bind: "left"
|
|
1106
1108
|
}
|
|
1107
1109
|
];
|
|
1108
1110
|
var BorderWidthField = () => {
|
|
1109
|
-
return /* @__PURE__ */
|
|
1111
|
+
return /* @__PURE__ */ React21.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React21.createElement(
|
|
1110
1112
|
EqualUnequalSizesControl,
|
|
1111
1113
|
{
|
|
1112
1114
|
items: edges,
|
|
1113
|
-
label:
|
|
1114
|
-
icon: /* @__PURE__ */
|
|
1115
|
+
label: __7("Border Width", "elementor"),
|
|
1116
|
+
icon: /* @__PURE__ */ React21.createElement(SideAllIcon, { fontSize: "tiny" }),
|
|
1115
1117
|
multiSizePropTypeUtil: borderWidthPropTypeUtil
|
|
1116
1118
|
}
|
|
1117
1119
|
));
|
|
@@ -1136,22 +1138,22 @@ var BorderField = () => {
|
|
|
1136
1138
|
});
|
|
1137
1139
|
};
|
|
1138
1140
|
const hasBorder = Object.values(border ?? {}).some(Boolean);
|
|
1139
|
-
return /* @__PURE__ */
|
|
1141
|
+
return /* @__PURE__ */ React22.createElement(
|
|
1140
1142
|
AddOrRemoveContent,
|
|
1141
1143
|
{
|
|
1142
|
-
label:
|
|
1144
|
+
label: __8("Border", "elementor"),
|
|
1143
1145
|
isAdded: hasBorder,
|
|
1144
1146
|
onAdd: addBorder,
|
|
1145
1147
|
onRemove: removeBorder
|
|
1146
1148
|
},
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
-
/* @__PURE__ */
|
|
1149
|
-
/* @__PURE__ */
|
|
1149
|
+
/* @__PURE__ */ React22.createElement(BorderWidthField, null),
|
|
1150
|
+
/* @__PURE__ */ React22.createElement(BorderColorField, null),
|
|
1151
|
+
/* @__PURE__ */ React22.createElement(BorderStyleField, null)
|
|
1150
1152
|
);
|
|
1151
1153
|
};
|
|
1152
1154
|
|
|
1153
1155
|
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
1154
|
-
import * as
|
|
1156
|
+
import * as React23 from "react";
|
|
1155
1157
|
import { EqualUnequalSizesControl as EqualUnequalSizesControl2 } from "@elementor/editor-controls";
|
|
1156
1158
|
import { borderRadiusPropTypeUtil } from "@elementor/editor-props";
|
|
1157
1159
|
import {
|
|
@@ -1161,58 +1163,58 @@ import {
|
|
|
1161
1163
|
RadiusTopLeftIcon,
|
|
1162
1164
|
RadiusTopRightIcon
|
|
1163
1165
|
} from "@elementor/icons";
|
|
1164
|
-
import { __ as
|
|
1166
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
1165
1167
|
var corners = [
|
|
1166
1168
|
{
|
|
1167
|
-
label:
|
|
1168
|
-
icon: /* @__PURE__ */
|
|
1169
|
+
label: __9("Top Left", "elementor"),
|
|
1170
|
+
icon: /* @__PURE__ */ React23.createElement(RadiusTopLeftIcon, { fontSize: "tiny" }),
|
|
1169
1171
|
bind: "top-left"
|
|
1170
1172
|
},
|
|
1171
1173
|
{
|
|
1172
|
-
label:
|
|
1173
|
-
icon: /* @__PURE__ */
|
|
1174
|
+
label: __9("Top Right", "elementor"),
|
|
1175
|
+
icon: /* @__PURE__ */ React23.createElement(RadiusTopRightIcon, { fontSize: "tiny" }),
|
|
1174
1176
|
bind: "top-right"
|
|
1175
1177
|
},
|
|
1176
1178
|
{
|
|
1177
|
-
label:
|
|
1178
|
-
icon: /* @__PURE__ */
|
|
1179
|
+
label: __9("Bottom Right", "elementor"),
|
|
1180
|
+
icon: /* @__PURE__ */ React23.createElement(RadiusBottomRightIcon, { fontSize: "tiny" }),
|
|
1179
1181
|
bind: "bottom-right"
|
|
1180
1182
|
},
|
|
1181
1183
|
{
|
|
1182
|
-
label:
|
|
1183
|
-
icon: /* @__PURE__ */
|
|
1184
|
+
label: __9("Bottom Left", "elementor"),
|
|
1185
|
+
icon: /* @__PURE__ */ React23.createElement(RadiusBottomLeftIcon, { fontSize: "tiny" }),
|
|
1184
1186
|
bind: "bottom-left"
|
|
1185
1187
|
}
|
|
1186
1188
|
];
|
|
1187
1189
|
var BorderRadiusField = () => {
|
|
1188
|
-
return /* @__PURE__ */
|
|
1190
|
+
return /* @__PURE__ */ React23.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React23.createElement(
|
|
1189
1191
|
EqualUnequalSizesControl2,
|
|
1190
1192
|
{
|
|
1191
1193
|
items: corners,
|
|
1192
|
-
label:
|
|
1193
|
-
icon: /* @__PURE__ */
|
|
1194
|
+
label: __9("Border Radius", "elementor"),
|
|
1195
|
+
icon: /* @__PURE__ */ React23.createElement(BorderCornersIcon, { fontSize: "tiny" }),
|
|
1194
1196
|
multiSizePropTypeUtil: borderRadiusPropTypeUtil
|
|
1195
1197
|
}
|
|
1196
1198
|
));
|
|
1197
1199
|
};
|
|
1198
1200
|
|
|
1199
1201
|
// src/components/style-sections/border-section/border-section.tsx
|
|
1200
|
-
var BorderSection = () => /* @__PURE__ */
|
|
1202
|
+
var BorderSection = () => /* @__PURE__ */ React24.createElement(Stack6, { gap: 1.5 }, /* @__PURE__ */ React24.createElement(BorderRadiusField, null), /* @__PURE__ */ React24.createElement(Divider3, null), /* @__PURE__ */ React24.createElement(BorderField, null));
|
|
1201
1203
|
|
|
1202
1204
|
// src/components/style-sections/effects-section/effects-section.tsx
|
|
1203
|
-
import * as
|
|
1205
|
+
import * as React25 from "react";
|
|
1204
1206
|
import { BoxShadowRepeaterControl } from "@elementor/editor-controls";
|
|
1205
|
-
import { Stack as
|
|
1207
|
+
import { Stack as Stack7 } from "@elementor/ui";
|
|
1206
1208
|
var EffectsSection = () => {
|
|
1207
|
-
return /* @__PURE__ */
|
|
1209
|
+
return /* @__PURE__ */ React25.createElement(Stack7, { gap: 1.5 }, /* @__PURE__ */ React25.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React25.createElement(BoxShadowRepeaterControl, null)));
|
|
1208
1210
|
};
|
|
1209
1211
|
|
|
1210
1212
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
1211
|
-
import * as
|
|
1213
|
+
import * as React36 from "react";
|
|
1212
1214
|
import { ControlLabel as ControlLabel13 } from "@elementor/editor-controls";
|
|
1213
1215
|
import { useParentElement } from "@elementor/editor-elements";
|
|
1214
|
-
import { Divider as
|
|
1215
|
-
import { __ as
|
|
1216
|
+
import { Divider as Divider4, Stack as Stack13 } from "@elementor/ui";
|
|
1217
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
1216
1218
|
|
|
1217
1219
|
// src/hooks/use-computed-style.ts
|
|
1218
1220
|
import { __privateUseListenTo as useListenTo, commandEndEvent, windowEvent } from "@elementor/editor-v1-adapters";
|
|
@@ -1240,7 +1242,7 @@ function useComputedStyle(elementId) {
|
|
|
1240
1242
|
}
|
|
1241
1243
|
|
|
1242
1244
|
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
1243
|
-
import * as
|
|
1245
|
+
import * as React27 from "react";
|
|
1244
1246
|
import { ControlLabel as ControlLabel5, ToggleControl } from "@elementor/editor-controls";
|
|
1245
1247
|
import {
|
|
1246
1248
|
LayoutAlignCenterIcon as CenterIcon,
|
|
@@ -1249,7 +1251,7 @@ import {
|
|
|
1249
1251
|
LayoutDistributeVerticalIcon as JustifyIcon
|
|
1250
1252
|
} from "@elementor/icons";
|
|
1251
1253
|
import { DirectionProvider, Grid as Grid3, ThemeProvider, withDirection } from "@elementor/ui";
|
|
1252
|
-
import { __ as
|
|
1254
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
1253
1255
|
|
|
1254
1256
|
// src/hooks/use-direction.ts
|
|
1255
1257
|
import { useTheme } from "@elementor/ui";
|
|
@@ -1260,8 +1262,8 @@ function useDirection() {
|
|
|
1260
1262
|
}
|
|
1261
1263
|
|
|
1262
1264
|
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
1263
|
-
import * as
|
|
1264
|
-
import { useRef
|
|
1265
|
+
import * as React26 from "react";
|
|
1266
|
+
import { useRef } from "react";
|
|
1265
1267
|
import { useTheme as useTheme2 } from "@elementor/ui";
|
|
1266
1268
|
var CLOCKWISE_ANGLES = {
|
|
1267
1269
|
row: 0,
|
|
@@ -1276,9 +1278,9 @@ var COUNTER_CLOCKWISE_ANGLES = {
|
|
|
1276
1278
|
"column-reverse": -270
|
|
1277
1279
|
};
|
|
1278
1280
|
var RotatedIcon = ({ icon: Icon, size, isClockwise = true, offset = 0 }) => {
|
|
1279
|
-
const rotate =
|
|
1281
|
+
const rotate = useRef(useGetTargetAngle(isClockwise, offset));
|
|
1280
1282
|
rotate.current = useGetTargetAngle(isClockwise, offset, rotate);
|
|
1281
|
-
return /* @__PURE__ */
|
|
1283
|
+
return /* @__PURE__ */ React26.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
1282
1284
|
};
|
|
1283
1285
|
var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
1284
1286
|
const [direction] = useStylesField("flex-direction");
|
|
@@ -1302,36 +1304,36 @@ var iconProps = {
|
|
|
1302
1304
|
var options = [
|
|
1303
1305
|
{
|
|
1304
1306
|
value: "start",
|
|
1305
|
-
label:
|
|
1306
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1307
|
+
label: __10("Start", "elementor"),
|
|
1308
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: StartIcon, size, ...iconProps }),
|
|
1307
1309
|
showTooltip: true
|
|
1308
1310
|
},
|
|
1309
1311
|
{
|
|
1310
1312
|
value: "center",
|
|
1311
|
-
label:
|
|
1312
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1313
|
+
label: __10("Center", "elementor"),
|
|
1314
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: CenterIcon, size, ...iconProps }),
|
|
1313
1315
|
showTooltip: true
|
|
1314
1316
|
},
|
|
1315
1317
|
{
|
|
1316
1318
|
value: "end",
|
|
1317
|
-
label:
|
|
1318
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1319
|
+
label: __10("End", "elementor"),
|
|
1320
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: EndIcon, size, ...iconProps }),
|
|
1319
1321
|
showTooltip: true
|
|
1320
1322
|
},
|
|
1321
1323
|
{
|
|
1322
1324
|
value: "stretch",
|
|
1323
|
-
label:
|
|
1324
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1325
|
+
label: __10("Stretch", "elementor"),
|
|
1326
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: JustifyIcon, size, ...iconProps }),
|
|
1325
1327
|
showTooltip: true
|
|
1326
1328
|
}
|
|
1327
1329
|
];
|
|
1328
1330
|
var AlignItemsField = () => {
|
|
1329
1331
|
const { isSiteRtl } = useDirection();
|
|
1330
|
-
return /* @__PURE__ */
|
|
1332
|
+
return /* @__PURE__ */ React27.createElement(DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React27.createElement(ThemeProvider, null, /* @__PURE__ */ React27.createElement(StylesField, { bind: "align-items" }, /* @__PURE__ */ React27.createElement(Grid3, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React27.createElement(ControlLabel5, null, __10("Align items", "elementor"))), /* @__PURE__ */ React27.createElement(Grid3, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React27.createElement(ToggleControl, { options }))))));
|
|
1331
1333
|
};
|
|
1332
1334
|
|
|
1333
1335
|
// src/components/style-sections/layout-section/align-self-child-field.tsx
|
|
1334
|
-
import * as
|
|
1336
|
+
import * as React28 from "react";
|
|
1335
1337
|
import { ControlLabel as ControlLabel6, ToggleControl as ToggleControl2 } from "@elementor/editor-controls";
|
|
1336
1338
|
import {
|
|
1337
1339
|
LayoutAlignCenterIcon as CenterIcon2,
|
|
@@ -1340,7 +1342,7 @@ import {
|
|
|
1340
1342
|
LayoutDistributeVerticalIcon as JustifyIcon2
|
|
1341
1343
|
} from "@elementor/icons";
|
|
1342
1344
|
import { DirectionProvider as DirectionProvider2, Grid as Grid4, ThemeProvider as ThemeProvider2, withDirection as withDirection2 } from "@elementor/ui";
|
|
1343
|
-
import { __ as
|
|
1345
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
1344
1346
|
var StartIcon2 = withDirection2(LayoutAlignLeftIcon2);
|
|
1345
1347
|
var EndIcon2 = withDirection2(LayoutAlignRightIcon2);
|
|
1346
1348
|
var iconProps2 = {
|
|
@@ -1350,109 +1352,117 @@ var iconProps2 = {
|
|
|
1350
1352
|
var options2 = [
|
|
1351
1353
|
{
|
|
1352
1354
|
value: "start",
|
|
1353
|
-
label:
|
|
1354
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1355
|
+
label: __11("Start", "elementor"),
|
|
1356
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: StartIcon2, size, ...iconProps2 }),
|
|
1355
1357
|
showTooltip: true
|
|
1356
1358
|
},
|
|
1357
1359
|
{
|
|
1358
1360
|
value: "center",
|
|
1359
|
-
label:
|
|
1360
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1361
|
+
label: __11("Center", "elementor"),
|
|
1362
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: CenterIcon2, size, ...iconProps2 }),
|
|
1361
1363
|
showTooltip: true
|
|
1362
1364
|
},
|
|
1363
1365
|
{
|
|
1364
1366
|
value: "end",
|
|
1365
|
-
label:
|
|
1366
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1367
|
+
label: __11("End", "elementor"),
|
|
1368
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: EndIcon2, size, ...iconProps2 }),
|
|
1367
1369
|
showTooltip: true
|
|
1368
1370
|
},
|
|
1369
1371
|
{
|
|
1370
1372
|
value: "stretch",
|
|
1371
|
-
label:
|
|
1372
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1373
|
+
label: __11("Stretch", "elementor"),
|
|
1374
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: JustifyIcon2, size, ...iconProps2 }),
|
|
1373
1375
|
showTooltip: true
|
|
1374
1376
|
}
|
|
1375
1377
|
];
|
|
1376
1378
|
var AlignSelfChild = () => {
|
|
1377
1379
|
const { isSiteRtl } = useDirection();
|
|
1378
|
-
return /* @__PURE__ */
|
|
1380
|
+
return /* @__PURE__ */ React28.createElement(DirectionProvider2, { rtl: isSiteRtl }, /* @__PURE__ */ React28.createElement(ThemeProvider2, null, /* @__PURE__ */ React28.createElement(StylesField, { bind: "align-self" }, /* @__PURE__ */ React28.createElement(Grid4, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlLabel6, null, __11("Align self", "elementor"))), /* @__PURE__ */ React28.createElement(Grid4, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React28.createElement(ToggleControl2, { options: options2 }))))));
|
|
1379
1381
|
};
|
|
1380
1382
|
|
|
1381
1383
|
// src/components/style-sections/layout-section/display-field.tsx
|
|
1382
|
-
import * as
|
|
1384
|
+
import * as React29 from "react";
|
|
1383
1385
|
import { ControlLabel as ControlLabel7, ToggleControl as ToggleControl3 } from "@elementor/editor-controls";
|
|
1384
|
-
import { Stack as
|
|
1385
|
-
import { __ as
|
|
1386
|
+
import { Stack as Stack8 } from "@elementor/ui";
|
|
1387
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
1386
1388
|
var DisplayField = () => {
|
|
1387
1389
|
const options10 = [
|
|
1388
1390
|
{
|
|
1389
1391
|
value: "block",
|
|
1390
|
-
renderContent: () =>
|
|
1391
|
-
label:
|
|
1392
|
+
renderContent: () => __12("Block", "elementor"),
|
|
1393
|
+
label: __12("Block", "elementor"),
|
|
1394
|
+
showTooltip: true
|
|
1392
1395
|
},
|
|
1393
1396
|
{
|
|
1394
1397
|
value: "flex",
|
|
1395
|
-
renderContent: () =>
|
|
1396
|
-
label:
|
|
1398
|
+
renderContent: () => __12("Flex", "elementor"),
|
|
1399
|
+
label: __12("Flex", "elementor"),
|
|
1400
|
+
showTooltip: true
|
|
1401
|
+
},
|
|
1402
|
+
{
|
|
1403
|
+
value: "inline-block",
|
|
1404
|
+
renderContent: () => __12("In-blk", "elementor"),
|
|
1405
|
+
label: __12("Inline-block", "elementor"),
|
|
1406
|
+
showTooltip: true
|
|
1397
1407
|
}
|
|
1398
1408
|
];
|
|
1399
|
-
return /* @__PURE__ */
|
|
1409
|
+
return /* @__PURE__ */ React29.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React29.createElement(Stack8, { gap: 1 }, /* @__PURE__ */ React29.createElement(ControlLabel7, null, __12("Display", "elementor")), /* @__PURE__ */ React29.createElement(ToggleControl3, { options: options10, fullWidth: true })));
|
|
1400
1410
|
};
|
|
1401
1411
|
|
|
1402
1412
|
// src/components/style-sections/layout-section/flex-direction-field.tsx
|
|
1403
|
-
import * as
|
|
1413
|
+
import * as React30 from "react";
|
|
1404
1414
|
import { ControlLabel as ControlLabel8, ToggleControl as ToggleControl4 } from "@elementor/editor-controls";
|
|
1405
1415
|
import { ArrowDownSmallIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpSmallIcon } from "@elementor/icons";
|
|
1406
1416
|
import { DirectionProvider as DirectionProvider3, Grid as Grid5, ThemeProvider as ThemeProvider3, withDirection as withDirection3 } from "@elementor/ui";
|
|
1407
|
-
import { __ as
|
|
1417
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
1408
1418
|
var options3 = [
|
|
1409
1419
|
{
|
|
1410
1420
|
value: "row",
|
|
1411
|
-
label:
|
|
1421
|
+
label: __13("Row", "elementor"),
|
|
1412
1422
|
renderContent: ({ size }) => {
|
|
1413
|
-
const
|
|
1414
|
-
return /* @__PURE__ */
|
|
1423
|
+
const StartIcon5 = withDirection3(ArrowRightIcon);
|
|
1424
|
+
return /* @__PURE__ */ React30.createElement(StartIcon5, { fontSize: size });
|
|
1415
1425
|
},
|
|
1416
1426
|
showTooltip: true
|
|
1417
1427
|
},
|
|
1418
1428
|
{
|
|
1419
1429
|
value: "column",
|
|
1420
|
-
label:
|
|
1421
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1430
|
+
label: __13("Column", "elementor"),
|
|
1431
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(ArrowDownSmallIcon, { fontSize: size }),
|
|
1422
1432
|
showTooltip: true
|
|
1423
1433
|
},
|
|
1424
1434
|
{
|
|
1425
1435
|
value: "row-reverse",
|
|
1426
|
-
label:
|
|
1436
|
+
label: __13("Reversed row", "elementor"),
|
|
1427
1437
|
renderContent: ({ size }) => {
|
|
1428
|
-
const
|
|
1429
|
-
return /* @__PURE__ */
|
|
1438
|
+
const EndIcon5 = withDirection3(ArrowLeftIcon);
|
|
1439
|
+
return /* @__PURE__ */ React30.createElement(EndIcon5, { fontSize: size });
|
|
1430
1440
|
},
|
|
1431
1441
|
showTooltip: true
|
|
1432
1442
|
},
|
|
1433
1443
|
{
|
|
1434
1444
|
value: "column-reverse",
|
|
1435
|
-
label:
|
|
1436
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1445
|
+
label: __13("Reversed column", "elementor"),
|
|
1446
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(ArrowUpSmallIcon, { fontSize: size }),
|
|
1437
1447
|
showTooltip: true
|
|
1438
1448
|
}
|
|
1439
1449
|
];
|
|
1440
1450
|
var FlexDirectionField = () => {
|
|
1441
1451
|
const { isSiteRtl } = useDirection();
|
|
1442
|
-
return /* @__PURE__ */
|
|
1452
|
+
return /* @__PURE__ */ React30.createElement(DirectionProvider3, { rtl: isSiteRtl }, /* @__PURE__ */ React30.createElement(ThemeProvider3, null, /* @__PURE__ */ React30.createElement(StylesField, { bind: "flex-direction" }, /* @__PURE__ */ React30.createElement(Grid5, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel8, null, __13("Direction", "elementor"))), /* @__PURE__ */ React30.createElement(Grid5, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React30.createElement(ToggleControl4, { options: options3 }))))));
|
|
1443
1453
|
};
|
|
1444
1454
|
|
|
1445
1455
|
// src/components/style-sections/layout-section/flex-order-field.tsx
|
|
1446
|
-
import * as
|
|
1447
|
-
import { useState as
|
|
1456
|
+
import * as React31 from "react";
|
|
1457
|
+
import { useState as useState4 } from "react";
|
|
1448
1458
|
import {
|
|
1449
1459
|
ControlLabel as ControlLabel9,
|
|
1450
1460
|
ControlToggleButtonGroup,
|
|
1451
1461
|
NumberControl
|
|
1452
1462
|
} from "@elementor/editor-controls";
|
|
1453
1463
|
import { ArrowDownSmallIcon as ArrowDownSmallIcon2, ArrowUpSmallIcon as ArrowUpSmallIcon2, PencilIcon } from "@elementor/icons";
|
|
1454
|
-
import { DirectionProvider as DirectionProvider4, Grid as Grid6, Stack as
|
|
1455
|
-
import { __ as
|
|
1464
|
+
import { DirectionProvider as DirectionProvider4, Grid as Grid6, Stack as Stack9, ThemeProvider as ThemeProvider4 } from "@elementor/ui";
|
|
1465
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
1456
1466
|
var FIRST_DEFAULT_VALUE = -99999;
|
|
1457
1467
|
var LAST_DEFAULT_VALUE = 99999;
|
|
1458
1468
|
var FIRST = "first";
|
|
@@ -1465,26 +1475,26 @@ var orderValueMap = {
|
|
|
1465
1475
|
var items = [
|
|
1466
1476
|
{
|
|
1467
1477
|
value: FIRST,
|
|
1468
|
-
label:
|
|
1469
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1478
|
+
label: __14("First", "elementor"),
|
|
1479
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(ArrowUpSmallIcon2, { fontSize: size }),
|
|
1470
1480
|
showTooltip: true
|
|
1471
1481
|
},
|
|
1472
1482
|
{
|
|
1473
1483
|
value: LAST,
|
|
1474
|
-
label:
|
|
1475
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1484
|
+
label: __14("Last", "elementor"),
|
|
1485
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(ArrowDownSmallIcon2, { fontSize: size }),
|
|
1476
1486
|
showTooltip: true
|
|
1477
1487
|
},
|
|
1478
1488
|
{
|
|
1479
1489
|
value: CUSTOM,
|
|
1480
|
-
label:
|
|
1481
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1490
|
+
label: __14("Custom", "elementor"),
|
|
1491
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(PencilIcon, { fontSize: size }),
|
|
1482
1492
|
showTooltip: true
|
|
1483
1493
|
}
|
|
1484
1494
|
];
|
|
1485
1495
|
var FlexOrderField = () => {
|
|
1486
1496
|
const { isSiteRtl } = useDirection(), [order, setOrder] = useStylesField("order");
|
|
1487
|
-
const [groupControlValue, setGroupControlValue] =
|
|
1497
|
+
const [groupControlValue, setGroupControlValue] = useState4(getGroupControlValue(order?.value || null));
|
|
1488
1498
|
const handleToggleButtonChange = (group) => {
|
|
1489
1499
|
setGroupControlValue(group);
|
|
1490
1500
|
if (!group || group === CUSTOM) {
|
|
@@ -1493,7 +1503,7 @@ var FlexOrderField = () => {
|
|
|
1493
1503
|
}
|
|
1494
1504
|
setOrder({ $$type: "number", value: orderValueMap[group] });
|
|
1495
1505
|
};
|
|
1496
|
-
return /* @__PURE__ */
|
|
1506
|
+
return /* @__PURE__ */ React31.createElement(DirectionProvider4, { rtl: isSiteRtl }, /* @__PURE__ */ React31.createElement(ThemeProvider4, null, /* @__PURE__ */ React31.createElement(Stack9, { gap: 2 }, /* @__PURE__ */ React31.createElement(Grid6, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlLabel9, null, __14("Order", "elementor"))), /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(
|
|
1497
1507
|
ControlToggleButtonGroup,
|
|
1498
1508
|
{
|
|
1499
1509
|
items,
|
|
@@ -1501,7 +1511,7 @@ var FlexOrderField = () => {
|
|
|
1501
1511
|
onChange: handleToggleButtonChange,
|
|
1502
1512
|
exclusive: true
|
|
1503
1513
|
}
|
|
1504
|
-
))), CUSTOM === groupControlValue && /* @__PURE__ */
|
|
1514
|
+
))), CUSTOM === groupControlValue && /* @__PURE__ */ React31.createElement(StylesField, { bind: "order" }, /* @__PURE__ */ React31.createElement(Grid6, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlLabel9, null, __14("Custom order", "elementor"))), /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(
|
|
1505
1515
|
NumberControl,
|
|
1506
1516
|
{
|
|
1507
1517
|
min: FIRST_DEFAULT_VALUE + 1,
|
|
@@ -1521,8 +1531,8 @@ var getGroupControlValue = (order) => {
|
|
|
1521
1531
|
};
|
|
1522
1532
|
|
|
1523
1533
|
// src/components/style-sections/layout-section/flex-size-field.tsx
|
|
1524
|
-
import * as
|
|
1525
|
-
import { useMemo, useState as
|
|
1534
|
+
import * as React32 from "react";
|
|
1535
|
+
import { useMemo as useMemo2, useState as useState5 } from "react";
|
|
1526
1536
|
import {
|
|
1527
1537
|
ControlLabel as ControlLabel10,
|
|
1528
1538
|
ControlToggleButtonGroup as ControlToggleButtonGroup2,
|
|
@@ -1530,33 +1540,33 @@ import {
|
|
|
1530
1540
|
SizeControl as SizeControl2
|
|
1531
1541
|
} from "@elementor/editor-controls";
|
|
1532
1542
|
import { ExpandIcon, PencilIcon as PencilIcon2, ShrinkIcon } from "@elementor/icons";
|
|
1533
|
-
import { DirectionProvider as DirectionProvider5, Grid as Grid7, Stack as
|
|
1534
|
-
import { __ as
|
|
1543
|
+
import { DirectionProvider as DirectionProvider5, Grid as Grid7, Stack as Stack10, ThemeProvider as ThemeProvider5 } from "@elementor/ui";
|
|
1544
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
1535
1545
|
var DEFAULT = 1;
|
|
1536
1546
|
var items2 = [
|
|
1537
1547
|
{
|
|
1538
1548
|
value: "flex-grow",
|
|
1539
|
-
label:
|
|
1540
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1549
|
+
label: __15("Grow", "elementor"),
|
|
1550
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(ExpandIcon, { fontSize: size }),
|
|
1541
1551
|
showTooltip: true
|
|
1542
1552
|
},
|
|
1543
1553
|
{
|
|
1544
1554
|
value: "flex-shrink",
|
|
1545
|
-
label:
|
|
1546
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1555
|
+
label: __15("Shrink", "elementor"),
|
|
1556
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(ShrinkIcon, { fontSize: size }),
|
|
1547
1557
|
showTooltip: true
|
|
1548
1558
|
},
|
|
1549
1559
|
{
|
|
1550
1560
|
value: "custom",
|
|
1551
|
-
label:
|
|
1552
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1561
|
+
label: __15("Custom", "elementor"),
|
|
1562
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(PencilIcon2, { fontSize: size }),
|
|
1553
1563
|
showTooltip: true
|
|
1554
1564
|
}
|
|
1555
1565
|
];
|
|
1556
1566
|
var FlexSizeField = () => {
|
|
1557
1567
|
const { isSiteRtl } = useDirection(), [growField, setGrowField] = useStylesField("flex-grow"), [shrinkField, setShrinkField] = useStylesField("flex-shrink"), [basisField, setBasisField] = useStylesField("flex-basis");
|
|
1558
1568
|
const grow = growField?.value || null, shrink = shrinkField?.value || null, basis = basisField?.value || null;
|
|
1559
|
-
const currentGroup =
|
|
1569
|
+
const currentGroup = useMemo2(() => getActiveGroup({ grow, shrink, basis }), [grow, shrink, basis]), [activeGroup, setActiveGroup] = useState5(currentGroup);
|
|
1560
1570
|
const onChangeGroup = (group = null) => {
|
|
1561
1571
|
setActiveGroup(group);
|
|
1562
1572
|
setBasisField(null);
|
|
@@ -1573,7 +1583,7 @@ var FlexSizeField = () => {
|
|
|
1573
1583
|
setGrowField(null);
|
|
1574
1584
|
setShrinkField({ $$type: "number", value: DEFAULT });
|
|
1575
1585
|
};
|
|
1576
|
-
return /* @__PURE__ */
|
|
1586
|
+
return /* @__PURE__ */ React32.createElement(DirectionProvider5, { rtl: isSiteRtl }, /* @__PURE__ */ React32.createElement(ThemeProvider5, null, /* @__PURE__ */ React32.createElement(Stack10, { gap: 2 }, /* @__PURE__ */ React32.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel10, null, __15("Size", "elementor"))), /* @__PURE__ */ React32.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(
|
|
1577
1587
|
ControlToggleButtonGroup2,
|
|
1578
1588
|
{
|
|
1579
1589
|
value: activeGroup,
|
|
@@ -1581,9 +1591,9 @@ var FlexSizeField = () => {
|
|
|
1581
1591
|
items: items2,
|
|
1582
1592
|
exclusive: true
|
|
1583
1593
|
}
|
|
1584
|
-
))), "custom" === activeGroup && /* @__PURE__ */
|
|
1594
|
+
))), "custom" === activeGroup && /* @__PURE__ */ React32.createElement(FlexCustomField, null))));
|
|
1585
1595
|
};
|
|
1586
|
-
var FlexCustomField = () => /* @__PURE__ */
|
|
1596
|
+
var FlexCustomField = () => /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(StylesField, { bind: "flex-grow" }, /* @__PURE__ */ React32.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel10, null, __15("Grow", "elementor"))), /* @__PURE__ */ React32.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(NumberControl2, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React32.createElement(StylesField, { bind: "flex-shrink" }, /* @__PURE__ */ React32.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel10, null, __15("Shrink", "elementor"))), /* @__PURE__ */ React32.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(NumberControl2, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React32.createElement(StylesField, { bind: "flex-basis" }, /* @__PURE__ */ React32.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel10, null, __15("Basis", "elementor"))), /* @__PURE__ */ React32.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(SizeControl2, null)))));
|
|
1587
1597
|
var getActiveGroup = ({
|
|
1588
1598
|
grow,
|
|
1589
1599
|
shrink,
|
|
@@ -1605,16 +1615,16 @@ var getActiveGroup = ({
|
|
|
1605
1615
|
};
|
|
1606
1616
|
|
|
1607
1617
|
// src/components/style-sections/layout-section/gap-control-field.tsx
|
|
1608
|
-
import * as
|
|
1618
|
+
import * as React33 from "react";
|
|
1609
1619
|
import { GapControl } from "@elementor/editor-controls";
|
|
1610
|
-
import { Stack as
|
|
1611
|
-
import { __ as
|
|
1620
|
+
import { Stack as Stack11 } from "@elementor/ui";
|
|
1621
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
1612
1622
|
var GapControlField = () => {
|
|
1613
|
-
return /* @__PURE__ */
|
|
1623
|
+
return /* @__PURE__ */ React33.createElement(Stack11, { gap: 1 }, /* @__PURE__ */ React33.createElement(StylesField, { bind: "gap" }, /* @__PURE__ */ React33.createElement(GapControl, { label: __16("Gaps", "elementor") })));
|
|
1614
1624
|
};
|
|
1615
1625
|
|
|
1616
1626
|
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
1617
|
-
import * as
|
|
1627
|
+
import * as React34 from "react";
|
|
1618
1628
|
import { ControlLabel as ControlLabel11, ToggleControl as ToggleControl5 } from "@elementor/editor-controls";
|
|
1619
1629
|
import {
|
|
1620
1630
|
JustifyBottomIcon,
|
|
@@ -1624,8 +1634,8 @@ import {
|
|
|
1624
1634
|
JustifySpaceBetweenVerticalIcon as BetweenIcon,
|
|
1625
1635
|
JustifyTopIcon
|
|
1626
1636
|
} from "@elementor/icons";
|
|
1627
|
-
import { DirectionProvider as DirectionProvider6, Stack as
|
|
1628
|
-
import { __ as
|
|
1637
|
+
import { DirectionProvider as DirectionProvider6, Stack as Stack12, ThemeProvider as ThemeProvider6, withDirection as withDirection4 } from "@elementor/ui";
|
|
1638
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
1629
1639
|
var StartIcon3 = withDirection4(JustifyTopIcon);
|
|
1630
1640
|
var EndIcon3 = withDirection4(JustifyBottomIcon);
|
|
1631
1641
|
var iconProps3 = {
|
|
@@ -1635,75 +1645,75 @@ var iconProps3 = {
|
|
|
1635
1645
|
var options4 = [
|
|
1636
1646
|
{
|
|
1637
1647
|
value: "start",
|
|
1638
|
-
label:
|
|
1639
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1648
|
+
label: __17("Start", "elementor"),
|
|
1649
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: StartIcon3, size, ...iconProps3 }),
|
|
1640
1650
|
showTooltip: true
|
|
1641
1651
|
},
|
|
1642
1652
|
{
|
|
1643
1653
|
value: "center",
|
|
1644
|
-
label:
|
|
1645
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1654
|
+
label: __17("Center", "elementor"),
|
|
1655
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: CenterIcon3, size, ...iconProps3 }),
|
|
1646
1656
|
showTooltip: true
|
|
1647
1657
|
},
|
|
1648
1658
|
{
|
|
1649
1659
|
value: "end",
|
|
1650
|
-
label:
|
|
1651
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1660
|
+
label: __17("End", "elementor"),
|
|
1661
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: EndIcon3, size, ...iconProps3 }),
|
|
1652
1662
|
showTooltip: true
|
|
1653
1663
|
},
|
|
1654
1664
|
{
|
|
1655
1665
|
value: "space-between",
|
|
1656
|
-
label:
|
|
1657
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1666
|
+
label: __17("Space between", "elementor"),
|
|
1667
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: BetweenIcon, size, ...iconProps3 }),
|
|
1658
1668
|
showTooltip: true
|
|
1659
1669
|
},
|
|
1660
1670
|
{
|
|
1661
1671
|
value: "space-around",
|
|
1662
|
-
label:
|
|
1663
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1672
|
+
label: __17("Space around", "elementor"),
|
|
1673
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: AroundIcon, size, ...iconProps3 }),
|
|
1664
1674
|
showTooltip: true
|
|
1665
1675
|
},
|
|
1666
1676
|
{
|
|
1667
1677
|
value: "space-evenly",
|
|
1668
|
-
label:
|
|
1669
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1678
|
+
label: __17("Space evenly", "elementor"),
|
|
1679
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: EvenlyIcon, size, ...iconProps3 }),
|
|
1670
1680
|
showTooltip: true
|
|
1671
1681
|
}
|
|
1672
1682
|
];
|
|
1673
1683
|
var JustifyContentField = () => {
|
|
1674
1684
|
const { isSiteRtl } = useDirection();
|
|
1675
|
-
return /* @__PURE__ */
|
|
1685
|
+
return /* @__PURE__ */ React34.createElement(DirectionProvider6, { rtl: isSiteRtl }, /* @__PURE__ */ React34.createElement(ThemeProvider6, null, /* @__PURE__ */ React34.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React34.createElement(Stack12, { gap: 1 }, /* @__PURE__ */ React34.createElement(ControlLabel11, null, __17("Justify content", "elementor")), /* @__PURE__ */ React34.createElement(ToggleControl5, { options: options4, fullWidth: true })))));
|
|
1676
1686
|
};
|
|
1677
1687
|
|
|
1678
1688
|
// src/components/style-sections/layout-section/wrap-field.tsx
|
|
1679
|
-
import * as
|
|
1689
|
+
import * as React35 from "react";
|
|
1680
1690
|
import { ControlLabel as ControlLabel12, ToggleControl as ToggleControl6 } from "@elementor/editor-controls";
|
|
1681
1691
|
import { ArrowBackIcon, ArrowForwardIcon, ArrowRightIcon as ArrowRightIcon2 } from "@elementor/icons";
|
|
1682
1692
|
import { DirectionProvider as DirectionProvider7, Grid as Grid8, ThemeProvider as ThemeProvider7 } from "@elementor/ui";
|
|
1683
|
-
import { __ as
|
|
1693
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
1684
1694
|
var options5 = [
|
|
1685
1695
|
{
|
|
1686
1696
|
value: "nowrap",
|
|
1687
|
-
label:
|
|
1688
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1697
|
+
label: __18("No wrap", "elementor"),
|
|
1698
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(ArrowRightIcon2, { fontSize: size }),
|
|
1689
1699
|
showTooltip: true
|
|
1690
1700
|
},
|
|
1691
1701
|
{
|
|
1692
1702
|
value: "wrap",
|
|
1693
|
-
label:
|
|
1694
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1703
|
+
label: __18("Wrap", "elementor"),
|
|
1704
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(ArrowBackIcon, { fontSize: size }),
|
|
1695
1705
|
showTooltip: true
|
|
1696
1706
|
},
|
|
1697
1707
|
{
|
|
1698
1708
|
value: "wrap-reverse",
|
|
1699
|
-
label:
|
|
1700
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1709
|
+
label: __18("Reversed wrap", "elementor"),
|
|
1710
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(ArrowForwardIcon, { fontSize: size }),
|
|
1701
1711
|
showTooltip: true
|
|
1702
1712
|
}
|
|
1703
1713
|
];
|
|
1704
1714
|
var WrapField = () => {
|
|
1705
1715
|
const { isSiteRtl } = useDirection();
|
|
1706
|
-
return /* @__PURE__ */
|
|
1716
|
+
return /* @__PURE__ */ React35.createElement(DirectionProvider7, { rtl: isSiteRtl }, /* @__PURE__ */ React35.createElement(ThemeProvider7, null, /* @__PURE__ */ React35.createElement(StylesField, { bind: "flex-wrap" }, /* @__PURE__ */ React35.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel12, null, __18("Wrap", "elementor"))), /* @__PURE__ */ React35.createElement(Grid8, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React35.createElement(ToggleControl6, { options: options5 }))))));
|
|
1707
1717
|
};
|
|
1708
1718
|
|
|
1709
1719
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
@@ -1712,94 +1722,58 @@ var LayoutSection = () => {
|
|
|
1712
1722
|
const { element } = useElement();
|
|
1713
1723
|
const parent = useParentElement(element.id);
|
|
1714
1724
|
const parentStyle = useComputedStyle(parent?.id || null);
|
|
1715
|
-
return /* @__PURE__ */
|
|
1725
|
+
return /* @__PURE__ */ React36.createElement(Stack13, { gap: 2 }, /* @__PURE__ */ React36.createElement(DisplayField, null), "flex" === display?.value && /* @__PURE__ */ React36.createElement(FlexFields, null), "flex" === parentStyle?.display && /* @__PURE__ */ React36.createElement(FlexChildFields, null));
|
|
1716
1726
|
};
|
|
1717
|
-
var FlexFields = () => /* @__PURE__ */
|
|
1718
|
-
var FlexChildFields = () => /* @__PURE__ */
|
|
1727
|
+
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(Divider4, null), /* @__PURE__ */ React36.createElement(GapControlField, null), /* @__PURE__ */ React36.createElement(WrapField, null));
|
|
1728
|
+
var FlexChildFields = () => /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(Divider4, null), /* @__PURE__ */ React36.createElement(ControlLabel13, null, __19("Flex child", "elementor")), /* @__PURE__ */ React36.createElement(AlignSelfChild, null), /* @__PURE__ */ React36.createElement(FlexOrderField, null), /* @__PURE__ */ React36.createElement(FlexSizeField, null));
|
|
1719
1729
|
|
|
1720
1730
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1721
|
-
import * as
|
|
1722
|
-
import {
|
|
1723
|
-
|
|
1724
|
-
// src/hooks/use-session-storage.ts
|
|
1725
|
-
import { useEffect as useEffect3, useState as useState7 } from "react";
|
|
1726
|
-
import { getSessionStorageItem, removeSessionStorageItem, setSessionStorageItem } from "@elementor/utils";
|
|
1727
|
-
var useSessionStorage = (key) => {
|
|
1728
|
-
const prefixedKey = `elementor/${key}`;
|
|
1729
|
-
const [value, setValue] = useState7();
|
|
1730
|
-
useEffect3(() => {
|
|
1731
|
-
return subscribeToSessionStorage(prefixedKey, (newValue) => {
|
|
1732
|
-
setValue(newValue ?? null);
|
|
1733
|
-
});
|
|
1734
|
-
}, [prefixedKey]);
|
|
1735
|
-
const saveValue = (newValue) => {
|
|
1736
|
-
setSessionStorageItem(prefixedKey, newValue);
|
|
1737
|
-
};
|
|
1738
|
-
const removeValue = () => {
|
|
1739
|
-
removeSessionStorageItem(prefixedKey);
|
|
1740
|
-
};
|
|
1741
|
-
return [value, saveValue, removeValue];
|
|
1742
|
-
};
|
|
1743
|
-
var subscribeToSessionStorage = (key, subscriber) => {
|
|
1744
|
-
subscriber(getSessionStorageItem(key));
|
|
1745
|
-
const abortController = new AbortController();
|
|
1746
|
-
window.addEventListener(
|
|
1747
|
-
"storage",
|
|
1748
|
-
(e) => {
|
|
1749
|
-
if (e.key !== key || e.storageArea !== sessionStorage) {
|
|
1750
|
-
return;
|
|
1751
|
-
}
|
|
1752
|
-
subscriber(getSessionStorageItem(key));
|
|
1753
|
-
},
|
|
1754
|
-
{ signal: abortController.signal }
|
|
1755
|
-
);
|
|
1756
|
-
return () => {
|
|
1757
|
-
abortController.abort();
|
|
1758
|
-
};
|
|
1759
|
-
};
|
|
1731
|
+
import * as React40 from "react";
|
|
1732
|
+
import { useSessionStorage } from "@elementor/session";
|
|
1733
|
+
import { Stack as Stack15 } from "@elementor/ui";
|
|
1760
1734
|
|
|
1761
1735
|
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
1762
|
-
import * as
|
|
1736
|
+
import * as React37 from "react";
|
|
1763
1737
|
import { ControlLabel as ControlLabel14, SizeControl as SizeControl3 } from "@elementor/editor-controls";
|
|
1764
1738
|
import { SideBottomIcon as SideBottomIcon2, SideLeftIcon as SideLeftIcon2, SideRightIcon as SideRightIcon2, SideTopIcon as SideTopIcon2 } from "@elementor/icons";
|
|
1765
|
-
import { Grid as Grid9, Stack as
|
|
1766
|
-
import { __ as
|
|
1739
|
+
import { Grid as Grid9, Stack as Stack14 } from "@elementor/ui";
|
|
1740
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
1767
1741
|
var sideIcons = {
|
|
1768
|
-
left: /* @__PURE__ */
|
|
1769
|
-
right: /* @__PURE__ */
|
|
1770
|
-
top: /* @__PURE__ */
|
|
1771
|
-
bottom: /* @__PURE__ */
|
|
1742
|
+
left: /* @__PURE__ */ React37.createElement(SideLeftIcon2, { fontSize: "tiny" }),
|
|
1743
|
+
right: /* @__PURE__ */ React37.createElement(SideRightIcon2, { fontSize: "tiny" }),
|
|
1744
|
+
top: /* @__PURE__ */ React37.createElement(SideTopIcon2, { fontSize: "tiny" }),
|
|
1745
|
+
bottom: /* @__PURE__ */ React37.createElement(SideBottomIcon2, { fontSize: "tiny" })
|
|
1772
1746
|
};
|
|
1773
1747
|
var DimensionsField = () => {
|
|
1774
|
-
return /* @__PURE__ */
|
|
1748
|
+
return /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(Stack14, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(DimensionField, { side: "top", label: __20("Top", "elementor") }), /* @__PURE__ */ React37.createElement(DimensionField, { side: "right", label: __20("Right", "elementor") })), /* @__PURE__ */ React37.createElement(Stack14, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(DimensionField, { side: "bottom", label: __20("Bottom", "elementor") }), /* @__PURE__ */ React37.createElement(DimensionField, { side: "left", label: __20("Left", "elementor") })));
|
|
1775
1749
|
};
|
|
1776
1750
|
var DimensionField = ({ side, label }) => {
|
|
1777
|
-
return /* @__PURE__ */
|
|
1751
|
+
return /* @__PURE__ */ React37.createElement(Grid9, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React37.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(ControlLabel14, null, label)), /* @__PURE__ */ React37.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(StylesField, { bind: side }, /* @__PURE__ */ React37.createElement(SizeControl3, { startIcon: sideIcons[side] }))));
|
|
1778
1752
|
};
|
|
1779
1753
|
|
|
1780
1754
|
// src/components/style-sections/position-section/position-field.tsx
|
|
1781
|
-
import * as
|
|
1755
|
+
import * as React38 from "react";
|
|
1782
1756
|
import { ControlLabel as ControlLabel15, SelectControl as SelectControl3 } from "@elementor/editor-controls";
|
|
1783
1757
|
import { Grid as Grid10 } from "@elementor/ui";
|
|
1784
|
-
import { __ as
|
|
1758
|
+
import { __ as __21 } from "@wordpress/i18n";
|
|
1785
1759
|
var positionOptions = [
|
|
1786
|
-
{ label:
|
|
1787
|
-
{ label:
|
|
1788
|
-
{ label:
|
|
1789
|
-
{ label:
|
|
1790
|
-
{ label:
|
|
1760
|
+
{ label: __21("Static", "elementor"), value: "static" },
|
|
1761
|
+
{ label: __21("Relative", "elementor"), value: "relative" },
|
|
1762
|
+
{ label: __21("Absolute", "elementor"), value: "absolute" },
|
|
1763
|
+
{ label: __21("Fixed", "elementor"), value: "fixed" },
|
|
1764
|
+
{ label: __21("Sticky", "elementor"), value: "sticky" }
|
|
1791
1765
|
];
|
|
1792
1766
|
var PositionField = ({ onChange }) => {
|
|
1793
|
-
return /* @__PURE__ */
|
|
1767
|
+
return /* @__PURE__ */ React38.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React38.createElement(Grid10, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React38.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(ControlLabel15, null, __21("Position", "elementor"))), /* @__PURE__ */ React38.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(SelectControl3, { options: positionOptions, onChange }))));
|
|
1794
1768
|
};
|
|
1795
1769
|
|
|
1796
1770
|
// src/components/style-sections/position-section/z-index-field.tsx
|
|
1797
|
-
import * as
|
|
1771
|
+
import * as React39 from "react";
|
|
1798
1772
|
import { ControlLabel as ControlLabel16, NumberControl as NumberControl3 } from "@elementor/editor-controls";
|
|
1799
1773
|
import { Grid as Grid11 } from "@elementor/ui";
|
|
1800
|
-
import { __ as
|
|
1774
|
+
import { __ as __22 } from "@wordpress/i18n";
|
|
1801
1775
|
var ZIndexField = () => {
|
|
1802
|
-
return /* @__PURE__ */
|
|
1776
|
+
return /* @__PURE__ */ React39.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React39.createElement(Grid11, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel16, null, __22("Z-Index", "elementor"))), /* @__PURE__ */ React39.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(NumberControl3, null))));
|
|
1803
1777
|
};
|
|
1804
1778
|
|
|
1805
1779
|
// src/components/style-sections/position-section/position-section.tsx
|
|
@@ -1831,7 +1805,7 @@ var PositionSection = () => {
|
|
|
1831
1805
|
}
|
|
1832
1806
|
};
|
|
1833
1807
|
const isNotStatic = positionValue && positionValue?.value !== "static";
|
|
1834
|
-
return /* @__PURE__ */
|
|
1808
|
+
return /* @__PURE__ */ React40.createElement(Stack15, { 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);
|
|
1835
1809
|
};
|
|
1836
1810
|
var usePersistDimensions = () => {
|
|
1837
1811
|
const { id: styleDefID, meta } = useStyle();
|
|
@@ -1841,73 +1815,73 @@ var usePersistDimensions = () => {
|
|
|
1841
1815
|
};
|
|
1842
1816
|
|
|
1843
1817
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1844
|
-
import * as
|
|
1818
|
+
import * as React42 from "react";
|
|
1845
1819
|
import { ControlLabel as ControlLabel18, SizeControl as SizeControl4 } from "@elementor/editor-controls";
|
|
1846
|
-
import { Divider as
|
|
1847
|
-
import { __ as
|
|
1820
|
+
import { Divider as Divider5, Grid as Grid13, Stack as Stack16 } from "@elementor/ui";
|
|
1821
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
1848
1822
|
|
|
1849
1823
|
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1850
|
-
import * as
|
|
1824
|
+
import * as React41 from "react";
|
|
1851
1825
|
import { ControlLabel as ControlLabel17, ToggleControl as ToggleControl7 } from "@elementor/editor-controls";
|
|
1852
1826
|
import { ExpandBottomIcon, EyeIcon, EyeOffIcon } from "@elementor/icons";
|
|
1853
1827
|
import { Grid as Grid12 } from "@elementor/ui";
|
|
1854
|
-
import { __ as
|
|
1828
|
+
import { __ as __23 } from "@wordpress/i18n";
|
|
1855
1829
|
var options6 = [
|
|
1856
1830
|
{
|
|
1857
1831
|
value: "visible",
|
|
1858
|
-
label:
|
|
1859
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1832
|
+
label: __23("Visible", "elementor"),
|
|
1833
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(EyeIcon, { fontSize: size }),
|
|
1860
1834
|
showTooltip: true
|
|
1861
1835
|
},
|
|
1862
1836
|
{
|
|
1863
1837
|
value: "hidden",
|
|
1864
|
-
label:
|
|
1865
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1838
|
+
label: __23("Hidden", "elementor"),
|
|
1839
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(EyeOffIcon, { fontSize: size }),
|
|
1866
1840
|
showTooltip: true
|
|
1867
1841
|
},
|
|
1868
1842
|
{
|
|
1869
1843
|
value: "auto",
|
|
1870
|
-
label:
|
|
1871
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1844
|
+
label: __23("Auto", "elementor"),
|
|
1845
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(ExpandBottomIcon, { fontSize: size }),
|
|
1872
1846
|
showTooltip: true
|
|
1873
1847
|
}
|
|
1874
1848
|
];
|
|
1875
1849
|
var OverflowField = () => {
|
|
1876
|
-
return /* @__PURE__ */
|
|
1850
|
+
return /* @__PURE__ */ React41.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React41.createElement(Grid12, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlLabel17, null, __23("Overflow", "elementor"))), /* @__PURE__ */ React41.createElement(Grid12, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React41.createElement(ToggleControl7, { options: options6 }))));
|
|
1877
1851
|
};
|
|
1878
1852
|
|
|
1879
1853
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1880
1854
|
var SizeSection = () => {
|
|
1881
|
-
return /* @__PURE__ */
|
|
1855
|
+
return /* @__PURE__ */ React42.createElement(Stack16, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(Grid13, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "width", label: __24("Width", "elementor") })), /* @__PURE__ */ React42.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "height", label: __24("Height", "elementor") }))), /* @__PURE__ */ React42.createElement(Grid13, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "min-width", label: __24("Min. Width", "elementor") })), /* @__PURE__ */ React42.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "min-height", label: __24("Min. Height", "elementor") }))), /* @__PURE__ */ React42.createElement(Grid13, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "max-width", label: __24("Max. Width", "elementor") })), /* @__PURE__ */ React42.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "max-height", label: __24("Max. Height", "elementor") }))), /* @__PURE__ */ React42.createElement(Divider5, null), /* @__PURE__ */ React42.createElement(Stack16, null, /* @__PURE__ */ React42.createElement(OverflowField, null)));
|
|
1882
1856
|
};
|
|
1883
1857
|
var SizeField = ({ label, bind }) => {
|
|
1884
|
-
return /* @__PURE__ */
|
|
1858
|
+
return /* @__PURE__ */ React42.createElement(StylesField, { bind }, /* @__PURE__ */ React42.createElement(Grid13, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React42.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React42.createElement(ControlLabel18, null, label)), /* @__PURE__ */ React42.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React42.createElement(SizeControl4, null))));
|
|
1885
1859
|
};
|
|
1886
1860
|
|
|
1887
1861
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1888
|
-
import * as
|
|
1862
|
+
import * as React43 from "react";
|
|
1889
1863
|
import { LinkedDimensionsControl } from "@elementor/editor-controls";
|
|
1890
|
-
import { Divider as
|
|
1891
|
-
import { __ as
|
|
1864
|
+
import { Divider as Divider6, Stack as Stack17 } from "@elementor/ui";
|
|
1865
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
1892
1866
|
var SpacingSection = () => {
|
|
1893
|
-
return /* @__PURE__ */
|
|
1867
|
+
return /* @__PURE__ */ React43.createElement(Stack17, { gap: 1.5 }, /* @__PURE__ */ React43.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React43.createElement(LinkedDimensionsControl, { label: __25("Padding", "elementor") })), /* @__PURE__ */ React43.createElement(Divider6, null), /* @__PURE__ */ React43.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React43.createElement(LinkedDimensionsControl, { label: __25("Margin", "elementor") })));
|
|
1894
1868
|
};
|
|
1895
1869
|
|
|
1896
1870
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1897
|
-
import * as
|
|
1898
|
-
import { Divider as
|
|
1871
|
+
import * as React57 from "react";
|
|
1872
|
+
import { Divider as Divider7, Stack as Stack19 } from "@elementor/ui";
|
|
1899
1873
|
|
|
1900
1874
|
// src/components/collapsible-content.tsx
|
|
1901
|
-
import * as
|
|
1902
|
-
import { useState as
|
|
1903
|
-
import { Button, Collapse as Collapse3, Stack as
|
|
1904
|
-
import { __ as
|
|
1875
|
+
import * as React44 from "react";
|
|
1876
|
+
import { useState as useState6 } from "react";
|
|
1877
|
+
import { Button, Collapse as Collapse3, Stack as Stack18 } from "@elementor/ui";
|
|
1878
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
1905
1879
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
1906
|
-
const [open, setOpen] =
|
|
1880
|
+
const [open, setOpen] = useState6(defaultOpen);
|
|
1907
1881
|
const handleToggle = () => {
|
|
1908
1882
|
setOpen((prevOpen) => !prevOpen);
|
|
1909
1883
|
};
|
|
1910
|
-
return /* @__PURE__ */
|
|
1884
|
+
return /* @__PURE__ */ React44.createElement(Stack18, { sx: { py: 0.5 } }, /* @__PURE__ */ React44.createElement(
|
|
1911
1885
|
Button,
|
|
1912
1886
|
{
|
|
1913
1887
|
fullWidth: true,
|
|
@@ -1915,17 +1889,17 @@ var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
|
1915
1889
|
color: "secondary",
|
|
1916
1890
|
variant: "outlined",
|
|
1917
1891
|
onClick: handleToggle,
|
|
1918
|
-
endIcon: /* @__PURE__ */
|
|
1892
|
+
endIcon: /* @__PURE__ */ React44.createElement(CollapseIcon, { open })
|
|
1919
1893
|
},
|
|
1920
|
-
open ?
|
|
1921
|
-
), /* @__PURE__ */
|
|
1894
|
+
open ? __26("Show less", "elementor") : __26("Show more", "elementor")
|
|
1895
|
+
), /* @__PURE__ */ React44.createElement(Collapse3, { in: open, timeout: "auto", unmountOnExit: true }, children));
|
|
1922
1896
|
};
|
|
1923
1897
|
|
|
1924
1898
|
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1925
|
-
import * as
|
|
1899
|
+
import * as React45 from "react";
|
|
1926
1900
|
import { ControlLabel as ControlLabel19, FontFamilyControl } from "@elementor/editor-controls";
|
|
1927
1901
|
import { Grid as Grid14 } from "@elementor/ui";
|
|
1928
|
-
import { __ as
|
|
1902
|
+
import { __ as __27 } from "@wordpress/i18n";
|
|
1929
1903
|
|
|
1930
1904
|
// src/sync/get-elementor-config.ts
|
|
1931
1905
|
var getElementorConfig = () => {
|
|
@@ -1939,7 +1913,7 @@ var FontFamilyField = () => {
|
|
|
1939
1913
|
if (!fontFamilies) {
|
|
1940
1914
|
return null;
|
|
1941
1915
|
}
|
|
1942
|
-
return /* @__PURE__ */
|
|
1916
|
+
return /* @__PURE__ */ React45.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React45.createElement(Grid14, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(ControlLabel19, null, __27("Font Family", "elementor"))), /* @__PURE__ */ React45.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(FontFamilyControl, { fontFamilies }))));
|
|
1943
1917
|
};
|
|
1944
1918
|
var getFontFamilies = () => {
|
|
1945
1919
|
const { controls } = getElementorConfig();
|
|
@@ -1951,115 +1925,125 @@ var getFontFamilies = () => {
|
|
|
1951
1925
|
};
|
|
1952
1926
|
|
|
1953
1927
|
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1954
|
-
import * as
|
|
1928
|
+
import * as React46 from "react";
|
|
1955
1929
|
import { ControlLabel as ControlLabel20, SizeControl as SizeControl5 } from "@elementor/editor-controls";
|
|
1956
1930
|
import { Grid as Grid15 } from "@elementor/ui";
|
|
1957
|
-
import { __ as
|
|
1931
|
+
import { __ as __28 } from "@wordpress/i18n";
|
|
1958
1932
|
var FontSizeField = () => {
|
|
1959
|
-
return /* @__PURE__ */
|
|
1933
|
+
return /* @__PURE__ */ React46.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React46.createElement(Grid15, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlLabel20, null, __28("Font Size", "elementor"))), /* @__PURE__ */ React46.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(SizeControl5, null))));
|
|
1960
1934
|
};
|
|
1961
1935
|
|
|
1962
1936
|
// src/components/style-sections/typography-section/font-weight-field.tsx
|
|
1963
|
-
import * as
|
|
1937
|
+
import * as React47 from "react";
|
|
1964
1938
|
import { ControlLabel as ControlLabel21, SelectControl as SelectControl4 } from "@elementor/editor-controls";
|
|
1965
1939
|
import { Grid as Grid16 } from "@elementor/ui";
|
|
1966
|
-
import { __ as
|
|
1940
|
+
import { __ as __29 } from "@wordpress/i18n";
|
|
1967
1941
|
var fontWeightOptions = [
|
|
1968
|
-
{ label:
|
|
1969
|
-
{ label:
|
|
1970
|
-
{ label:
|
|
1971
|
-
{ label:
|
|
1972
|
-
{ label:
|
|
1942
|
+
{ value: "100", label: __29("100 - Thin", "elementor") },
|
|
1943
|
+
{ value: "200", label: __29("200 - Extra Light", "elementor") },
|
|
1944
|
+
{ value: "300", label: __29("300 - Light", "elementor") },
|
|
1945
|
+
{ value: "400", label: __29("400 - Normal", "elementor") },
|
|
1946
|
+
{ value: "500", label: __29("500 - Medium", "elementor") },
|
|
1947
|
+
{ value: "600", label: __29("600 - Semi Bold", "elementor") },
|
|
1948
|
+
{ value: "700", label: __29("700 - Bold", "elementor") },
|
|
1949
|
+
{ value: "800", label: __29("800 - Extra Bold", "elementor") },
|
|
1950
|
+
{ value: "900", label: __29("900 - Black", "elementor") }
|
|
1973
1951
|
];
|
|
1974
1952
|
var FontWeightField = () => {
|
|
1975
|
-
return /* @__PURE__ */
|
|
1953
|
+
return /* @__PURE__ */ React47.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React47.createElement(Grid16, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React47.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(ControlLabel21, null, __29("Font Weight", "elementor"))), /* @__PURE__ */ React47.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(SelectControl4, { options: fontWeightOptions }))));
|
|
1976
1954
|
};
|
|
1977
1955
|
|
|
1978
1956
|
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
1979
|
-
import * as
|
|
1957
|
+
import * as React48 from "react";
|
|
1980
1958
|
import { ControlLabel as ControlLabel22, SizeControl as SizeControl6 } from "@elementor/editor-controls";
|
|
1981
1959
|
import { Grid as Grid17 } from "@elementor/ui";
|
|
1982
|
-
import { __ as
|
|
1960
|
+
import { __ as __30 } from "@wordpress/i18n";
|
|
1983
1961
|
var LetterSpacingField = () => {
|
|
1984
|
-
return /* @__PURE__ */
|
|
1962
|
+
return /* @__PURE__ */ React48.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React48.createElement(Grid17, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React48.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(ControlLabel22, null, __30("Letter Spacing", "elementor"))), /* @__PURE__ */ React48.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(SizeControl6, null))));
|
|
1985
1963
|
};
|
|
1986
1964
|
|
|
1987
1965
|
// src/components/style-sections/typography-section/line-height-field.tsx
|
|
1988
|
-
import * as
|
|
1966
|
+
import * as React49 from "react";
|
|
1989
1967
|
import { ControlLabel as ControlLabel23, SizeControl as SizeControl7 } from "@elementor/editor-controls";
|
|
1990
1968
|
import { Grid as Grid18 } from "@elementor/ui";
|
|
1991
|
-
import { __ as
|
|
1969
|
+
import { __ as __31 } from "@wordpress/i18n";
|
|
1992
1970
|
var LineHeightField = () => {
|
|
1993
|
-
return /* @__PURE__ */
|
|
1971
|
+
return /* @__PURE__ */ React49.createElement(StylesField, { bind: "line-height" }, /* @__PURE__ */ React49.createElement(Grid18, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(ControlLabel23, null, __31("Line Height", "elementor"))), /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(SizeControl7, null))));
|
|
1994
1972
|
};
|
|
1995
1973
|
|
|
1996
1974
|
// src/components/style-sections/typography-section/text-alignment-field.tsx
|
|
1997
|
-
import * as
|
|
1975
|
+
import * as React50 from "react";
|
|
1998
1976
|
import { ControlLabel as ControlLabel24, ToggleControl as ToggleControl8 } from "@elementor/editor-controls";
|
|
1999
1977
|
import { AlignCenterIcon, AlignJustifiedIcon, AlignLeftIcon, AlignRightIcon } from "@elementor/icons";
|
|
2000
|
-
import { Grid as Grid19 } from "@elementor/ui";
|
|
2001
|
-
import { __ as
|
|
1978
|
+
import { Grid as Grid19, withDirection as withDirection5 } from "@elementor/ui";
|
|
1979
|
+
import { __ as __32 } from "@wordpress/i18n";
|
|
1980
|
+
var StartIcon4 = withDirection5(AlignLeftIcon);
|
|
1981
|
+
var EndIcon4 = withDirection5(AlignRightIcon);
|
|
2002
1982
|
var options7 = [
|
|
2003
1983
|
{
|
|
2004
|
-
value: "
|
|
2005
|
-
label:
|
|
2006
|
-
renderContent: (
|
|
1984
|
+
value: "start",
|
|
1985
|
+
label: __32("Start", "elementor"),
|
|
1986
|
+
renderContent: () => /* @__PURE__ */ React50.createElement(RotatedIcon, { icon: StartIcon4, size: "tiny" }),
|
|
1987
|
+
showTooltip: true
|
|
2007
1988
|
},
|
|
2008
1989
|
{
|
|
2009
1990
|
value: "center",
|
|
2010
|
-
label:
|
|
2011
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1991
|
+
label: __32("Center", "elementor"),
|
|
1992
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(AlignCenterIcon, { fontSize: size }),
|
|
1993
|
+
showTooltip: true
|
|
2012
1994
|
},
|
|
2013
1995
|
{
|
|
2014
|
-
value: "
|
|
2015
|
-
label:
|
|
2016
|
-
renderContent: (
|
|
1996
|
+
value: "end",
|
|
1997
|
+
label: __32("End", "elementor"),
|
|
1998
|
+
renderContent: () => /* @__PURE__ */ React50.createElement(RotatedIcon, { icon: EndIcon4, size: "tiny" }),
|
|
1999
|
+
showTooltip: true
|
|
2017
2000
|
},
|
|
2018
2001
|
{
|
|
2019
2002
|
value: "justify",
|
|
2020
|
-
label:
|
|
2021
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2003
|
+
label: __32("Justify", "elementor"),
|
|
2004
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(AlignJustifiedIcon, { fontSize: size }),
|
|
2005
|
+
showTooltip: true
|
|
2022
2006
|
}
|
|
2023
2007
|
];
|
|
2024
2008
|
var TextAlignmentField = () => {
|
|
2025
|
-
return /* @__PURE__ */
|
|
2009
|
+
return /* @__PURE__ */ React50.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React50.createElement(Grid19, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React50.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(ControlLabel24, null, __32("Alignment", "elementor"))), /* @__PURE__ */ React50.createElement(Grid19, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React50.createElement(ToggleControl8, { options: options7 }))));
|
|
2026
2010
|
};
|
|
2027
2011
|
|
|
2028
2012
|
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
2029
|
-
import * as
|
|
2013
|
+
import * as React51 from "react";
|
|
2030
2014
|
import { ColorControl as ColorControl2, ControlLabel as ControlLabel25 } from "@elementor/editor-controls";
|
|
2031
2015
|
import { Grid as Grid20 } from "@elementor/ui";
|
|
2032
|
-
import { __ as
|
|
2016
|
+
import { __ as __33 } from "@wordpress/i18n";
|
|
2033
2017
|
var TextColorField = () => {
|
|
2034
|
-
return /* @__PURE__ */
|
|
2018
|
+
return /* @__PURE__ */ React51.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React51.createElement(Grid20, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React51.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(ControlLabel25, null, __33("Text Color", "elementor"))), /* @__PURE__ */ React51.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(ColorControl2, null))));
|
|
2035
2019
|
};
|
|
2036
2020
|
|
|
2037
2021
|
// src/components/style-sections/typography-section/text-direction-field.tsx
|
|
2038
|
-
import * as
|
|
2022
|
+
import * as React52 from "react";
|
|
2039
2023
|
import { ControlLabel as ControlLabel26, ToggleControl as ToggleControl9 } from "@elementor/editor-controls";
|
|
2040
2024
|
import { TextDirectionLtrIcon, TextDirectionRtlIcon } from "@elementor/icons";
|
|
2041
2025
|
import { Grid as Grid21 } from "@elementor/ui";
|
|
2042
|
-
import { __ as
|
|
2026
|
+
import { __ as __34 } from "@wordpress/i18n";
|
|
2043
2027
|
var options8 = [
|
|
2044
2028
|
{
|
|
2045
2029
|
value: "ltr",
|
|
2046
|
-
label:
|
|
2047
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2030
|
+
label: __34("Left to Right", "elementor"),
|
|
2031
|
+
renderContent: ({ size }) => /* @__PURE__ */ React52.createElement(TextDirectionLtrIcon, { fontSize: size })
|
|
2048
2032
|
},
|
|
2049
2033
|
{
|
|
2050
2034
|
value: "rtl",
|
|
2051
|
-
label:
|
|
2052
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2035
|
+
label: __34("Right to Left", "elementor"),
|
|
2036
|
+
renderContent: ({ size }) => /* @__PURE__ */ React52.createElement(TextDirectionRtlIcon, { fontSize: size })
|
|
2053
2037
|
}
|
|
2054
2038
|
];
|
|
2055
2039
|
var TextDirectionField = () => {
|
|
2056
|
-
return /* @__PURE__ */
|
|
2040
|
+
return /* @__PURE__ */ React52.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React52.createElement(Grid21, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React52.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(ControlLabel26, null, __34("Direction", "elementor"))), /* @__PURE__ */ React52.createElement(Grid21, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React52.createElement(ToggleControl9, { options: options8 }))));
|
|
2057
2041
|
};
|
|
2058
2042
|
|
|
2059
2043
|
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
2060
|
-
import * as
|
|
2044
|
+
import * as React53 from "react";
|
|
2061
2045
|
import { StrokeControl } from "@elementor/editor-controls";
|
|
2062
|
-
import { __ as
|
|
2046
|
+
import { __ as __35 } from "@wordpress/i18n";
|
|
2063
2047
|
var initTextStroke = {
|
|
2064
2048
|
$$type: "stroke",
|
|
2065
2049
|
value: {
|
|
@@ -2085,24 +2069,24 @@ var TextStrokeField = () => {
|
|
|
2085
2069
|
setTextStroke(null);
|
|
2086
2070
|
};
|
|
2087
2071
|
const hasTextStroke = Boolean(textStroke);
|
|
2088
|
-
return /* @__PURE__ */
|
|
2072
|
+
return /* @__PURE__ */ React53.createElement(
|
|
2089
2073
|
AddOrRemoveContent,
|
|
2090
2074
|
{
|
|
2091
|
-
label:
|
|
2075
|
+
label: __35("Text Stroke", "elementor"),
|
|
2092
2076
|
isAdded: hasTextStroke,
|
|
2093
2077
|
onAdd: addTextStroke,
|
|
2094
2078
|
onRemove: removeTextStroke
|
|
2095
2079
|
},
|
|
2096
|
-
/* @__PURE__ */
|
|
2080
|
+
/* @__PURE__ */ React53.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React53.createElement(StrokeControl, null))
|
|
2097
2081
|
);
|
|
2098
2082
|
};
|
|
2099
2083
|
|
|
2100
2084
|
// src/components/style-sections/typography-section/text-style-field.tsx
|
|
2101
|
-
import * as
|
|
2085
|
+
import * as React54 from "react";
|
|
2102
2086
|
import { ControlLabel as ControlLabel27 } from "@elementor/editor-controls";
|
|
2103
2087
|
import { ItalicIcon, StrikethroughIcon, UnderlineIcon } from "@elementor/icons";
|
|
2104
2088
|
import { Grid as Grid22, ToggleButton as ToggleButtonBase, ToggleButtonGroup } from "@elementor/ui";
|
|
2105
|
-
import { __ as
|
|
2089
|
+
import { __ as __36 } from "@wordpress/i18n";
|
|
2106
2090
|
var buttonSize = "tiny";
|
|
2107
2091
|
var TextStyleField = () => {
|
|
2108
2092
|
const [fontStyle, setFontStyle] = useStylesField("font-style");
|
|
@@ -2126,7 +2110,7 @@ var TextStyleField = () => {
|
|
|
2126
2110
|
value: newValue
|
|
2127
2111
|
});
|
|
2128
2112
|
};
|
|
2129
|
-
return /* @__PURE__ */
|
|
2113
|
+
return /* @__PURE__ */ React54.createElement(Grid22, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(ControlLabel27, null, __36("Style", "elementor"))), /* @__PURE__ */ React54.createElement(Grid22, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React54.createElement(ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React54.createElement(
|
|
2130
2114
|
ToggleButton,
|
|
2131
2115
|
{
|
|
2132
2116
|
value: "italic",
|
|
@@ -2134,8 +2118,8 @@ var TextStyleField = () => {
|
|
|
2134
2118
|
"aria-label": "italic",
|
|
2135
2119
|
sx: { marginLeft: "auto" }
|
|
2136
2120
|
},
|
|
2137
|
-
/* @__PURE__ */
|
|
2138
|
-
), /* @__PURE__ */
|
|
2121
|
+
/* @__PURE__ */ React54.createElement(ItalicIcon, { fontSize: buttonSize })
|
|
2122
|
+
), /* @__PURE__ */ React54.createElement(
|
|
2139
2123
|
ShorthandControl,
|
|
2140
2124
|
{
|
|
2141
2125
|
value: "line-through",
|
|
@@ -2143,8 +2127,8 @@ var TextStyleField = () => {
|
|
|
2143
2127
|
updateValues: handleSetTextDecoration,
|
|
2144
2128
|
"aria-label": "line-through"
|
|
2145
2129
|
},
|
|
2146
|
-
/* @__PURE__ */
|
|
2147
|
-
), /* @__PURE__ */
|
|
2130
|
+
/* @__PURE__ */ React54.createElement(StrikethroughIcon, { fontSize: buttonSize })
|
|
2131
|
+
), /* @__PURE__ */ React54.createElement(
|
|
2148
2132
|
ShorthandControl,
|
|
2149
2133
|
{
|
|
2150
2134
|
value: "underline",
|
|
@@ -2152,7 +2136,7 @@ var TextStyleField = () => {
|
|
|
2152
2136
|
updateValues: handleSetTextDecoration,
|
|
2153
2137
|
"aria-label": "underline"
|
|
2154
2138
|
},
|
|
2155
|
-
/* @__PURE__ */
|
|
2139
|
+
/* @__PURE__ */ React54.createElement(UnderlineIcon, { fontSize: buttonSize })
|
|
2156
2140
|
))));
|
|
2157
2141
|
};
|
|
2158
2142
|
var ShorthandControl = ({
|
|
@@ -2171,52 +2155,61 @@ var ShorthandControl = ({
|
|
|
2171
2155
|
updateValues([...valuesArr, newValue].join(" "));
|
|
2172
2156
|
}
|
|
2173
2157
|
};
|
|
2174
|
-
return /* @__PURE__ */
|
|
2158
|
+
return /* @__PURE__ */ React54.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
2175
2159
|
};
|
|
2176
2160
|
var ToggleButton = ({ onChange, ...props }) => {
|
|
2177
2161
|
const handleChange = (_e, newValue) => {
|
|
2178
2162
|
onChange(newValue);
|
|
2179
2163
|
};
|
|
2180
|
-
return /* @__PURE__ */
|
|
2164
|
+
return /* @__PURE__ */ React54.createElement(ToggleButtonBase, { ...props, onChange: handleChange, size: buttonSize });
|
|
2181
2165
|
};
|
|
2182
2166
|
|
|
2183
2167
|
// src/components/style-sections/typography-section/transform-field.tsx
|
|
2184
|
-
import * as
|
|
2168
|
+
import * as React55 from "react";
|
|
2185
2169
|
import { ControlLabel as ControlLabel28, ToggleControl as ToggleControl10 } from "@elementor/editor-controls";
|
|
2186
|
-
import { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon } from "@elementor/icons";
|
|
2170
|
+
import { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon, MinusIcon as MinusIcon2 } from "@elementor/icons";
|
|
2187
2171
|
import { Grid as Grid23 } from "@elementor/ui";
|
|
2188
|
-
import { __ as
|
|
2172
|
+
import { __ as __37 } from "@wordpress/i18n";
|
|
2189
2173
|
var options9 = [
|
|
2174
|
+
{
|
|
2175
|
+
value: "none",
|
|
2176
|
+
label: __37("None", "elementor"),
|
|
2177
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(MinusIcon2, { fontSize: size }),
|
|
2178
|
+
showTooltip: true
|
|
2179
|
+
},
|
|
2190
2180
|
{
|
|
2191
2181
|
value: "capitalize",
|
|
2192
|
-
label:
|
|
2193
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2182
|
+
label: __37("Capitalize", "elementor"),
|
|
2183
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(LetterCaseIcon, { fontSize: size }),
|
|
2184
|
+
showTooltip: true
|
|
2194
2185
|
},
|
|
2195
2186
|
{
|
|
2196
2187
|
value: "uppercase",
|
|
2197
|
-
label:
|
|
2198
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2188
|
+
label: __37("Uppercase", "elementor"),
|
|
2189
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(LetterCaseUpperIcon, { fontSize: size }),
|
|
2190
|
+
showTooltip: true
|
|
2199
2191
|
},
|
|
2200
2192
|
{
|
|
2201
2193
|
value: "lowercase",
|
|
2202
|
-
label:
|
|
2203
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2194
|
+
label: __37("Lowercase", "elementor"),
|
|
2195
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(LetterCaseLowerIcon, { fontSize: size }),
|
|
2196
|
+
showTooltip: true
|
|
2204
2197
|
}
|
|
2205
2198
|
];
|
|
2206
|
-
var TransformField = () => /* @__PURE__ */
|
|
2199
|
+
var TransformField = () => /* @__PURE__ */ React55.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React55.createElement(Grid23, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React55.createElement(Grid23, { item: true, xs: 6 }, /* @__PURE__ */ React55.createElement(ControlLabel28, null, __37("Text Transform", "elementor"))), /* @__PURE__ */ React55.createElement(Grid23, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React55.createElement(ToggleControl10, { options: options9 }))));
|
|
2207
2200
|
|
|
2208
2201
|
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
2209
|
-
import * as
|
|
2202
|
+
import * as React56 from "react";
|
|
2210
2203
|
import { ControlLabel as ControlLabel29, SizeControl as SizeControl8 } from "@elementor/editor-controls";
|
|
2211
2204
|
import { Grid as Grid24 } from "@elementor/ui";
|
|
2212
|
-
import { __ as
|
|
2205
|
+
import { __ as __38 } from "@wordpress/i18n";
|
|
2213
2206
|
var WordSpacingField = () => {
|
|
2214
|
-
return /* @__PURE__ */
|
|
2207
|
+
return /* @__PURE__ */ React56.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React56.createElement(Grid24, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(Grid24, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(ControlLabel29, null, __38("Word Spacing", "elementor"))), /* @__PURE__ */ React56.createElement(Grid24, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(SizeControl8, null))));
|
|
2215
2208
|
};
|
|
2216
2209
|
|
|
2217
2210
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
2218
2211
|
var TypographySection = () => {
|
|
2219
|
-
return /* @__PURE__ */
|
|
2212
|
+
return /* @__PURE__ */ React57.createElement(Stack19, { gap: 1.5 }, /* @__PURE__ */ React57.createElement(FontFamilyField, null), /* @__PURE__ */ React57.createElement(FontWeightField, null), /* @__PURE__ */ React57.createElement(FontSizeField, null), /* @__PURE__ */ React57.createElement(Divider7, null), /* @__PURE__ */ React57.createElement(TextAlignmentField, null), /* @__PURE__ */ React57.createElement(TextColorField, null), /* @__PURE__ */ React57.createElement(CollapsibleContent, null, /* @__PURE__ */ React57.createElement(Stack19, { 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(Divider7, null), /* @__PURE__ */ React57.createElement(TextStyleField, null), /* @__PURE__ */ React57.createElement(TransformField, null), /* @__PURE__ */ React57.createElement(TextDirectionField, null), /* @__PURE__ */ React57.createElement(TextStrokeField, null))));
|
|
2220
2213
|
};
|
|
2221
2214
|
|
|
2222
2215
|
// src/components/style-tab.tsx
|
|
@@ -2224,9 +2217,9 @@ var CLASSES_PROP_KEY = "classes";
|
|
|
2224
2217
|
var StyleTab = () => {
|
|
2225
2218
|
const currentClassesProp = useCurrentClassesProp();
|
|
2226
2219
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
2227
|
-
const [activeStyleState, setActiveStyleState] =
|
|
2220
|
+
const [activeStyleState, setActiveStyleState] = useState7(null);
|
|
2228
2221
|
const breakpoint = useActiveBreakpoint();
|
|
2229
|
-
return /* @__PURE__ */
|
|
2222
|
+
return /* @__PURE__ */ React58.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React58.createElement(
|
|
2230
2223
|
StyleProvider,
|
|
2231
2224
|
{
|
|
2232
2225
|
meta: { breakpoint, state: activeStyleState },
|
|
@@ -2237,17 +2230,17 @@ var StyleTab = () => {
|
|
|
2237
2230
|
},
|
|
2238
2231
|
setMetaState: setActiveStyleState
|
|
2239
2232
|
},
|
|
2240
|
-
/* @__PURE__ */
|
|
2233
|
+
/* @__PURE__ */ React58.createElement(SessionStorageProvider2, { prefix: activeStyleDefId ?? "" }, /* @__PURE__ */ React58.createElement(CssClassSelector, null), /* @__PURE__ */ React58.createElement(Divider8, null), /* @__PURE__ */ React58.createElement(SectionsList, null, /* @__PURE__ */ React58.createElement(Section, { title: __39("Layout", "elementor") }, /* @__PURE__ */ React58.createElement(LayoutSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: __39("Spacing", "elementor") }, /* @__PURE__ */ React58.createElement(SpacingSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: __39("Size", "elementor") }, /* @__PURE__ */ React58.createElement(SizeSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: __39("Position", "elementor") }, /* @__PURE__ */ React58.createElement(PositionSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: __39("Typography", "elementor") }, /* @__PURE__ */ React58.createElement(TypographySection, null)), /* @__PURE__ */ React58.createElement(Section, { title: __39("Background", "elementor") }, /* @__PURE__ */ React58.createElement(BackgroundSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: __39("Border", "elementor") }, /* @__PURE__ */ React58.createElement(BorderSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: __39("Effects", "elementor") }, /* @__PURE__ */ React58.createElement(EffectsSection, null))))
|
|
2241
2234
|
));
|
|
2242
2235
|
};
|
|
2243
2236
|
function useActiveStyleDefId(currentClassesProp) {
|
|
2244
|
-
const [activeStyledDefId, setActiveStyledDefId] =
|
|
2237
|
+
const [activeStyledDefId, setActiveStyledDefId] = useState7(null);
|
|
2245
2238
|
const fallback = useFirstElementStyleDef(currentClassesProp);
|
|
2246
2239
|
return [activeStyledDefId || fallback?.id || null, setActiveStyledDefId];
|
|
2247
2240
|
}
|
|
2248
2241
|
function useFirstElementStyleDef(currentClassesProp) {
|
|
2249
2242
|
const { element } = useElement();
|
|
2250
|
-
const classesIds =
|
|
2243
|
+
const classesIds = useElementSetting4(element.id, currentClassesProp)?.value || [];
|
|
2251
2244
|
const stylesDefs = useElementStyles(element.id);
|
|
2252
2245
|
return Object.values(stylesDefs).find((styleDef) => classesIds.includes(styleDef.id));
|
|
2253
2246
|
}
|
|
@@ -2269,7 +2262,7 @@ var EditingPanelTabs = () => {
|
|
|
2269
2262
|
return (
|
|
2270
2263
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
2271
2264
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
2272
|
-
/* @__PURE__ */
|
|
2265
|
+
/* @__PURE__ */ React59.createElement(Fragment8, { key: element.id }, /* @__PURE__ */ React59.createElement(Stack20, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React59.createElement(Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React59.createElement(Tab, { label: __40("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React59.createElement(Tab, { label: __40("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React59.createElement(Divider9, null), /* @__PURE__ */ React59.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React59.createElement(SettingsTab, null)), /* @__PURE__ */ React59.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React59.createElement(StyleTab, null))))
|
|
2273
2266
|
);
|
|
2274
2267
|
};
|
|
2275
2268
|
|
|
@@ -2282,8 +2275,8 @@ var EditingPanel = () => {
|
|
|
2282
2275
|
if (!element || !elementType) {
|
|
2283
2276
|
return null;
|
|
2284
2277
|
}
|
|
2285
|
-
const panelTitle =
|
|
2286
|
-
return /* @__PURE__ */
|
|
2278
|
+
const panelTitle = __41("Edit %s", "elementor").replace("%s", elementType.title);
|
|
2279
|
+
return /* @__PURE__ */ React60.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React60.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React60.createElement(SessionStorageProvider3, { prefix: "elementor" }, /* @__PURE__ */ React60.createElement(Panel, null, /* @__PURE__ */ React60.createElement(PanelHeader, null, /* @__PURE__ */ React60.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React60.createElement(PanelBody, null, /* @__PURE__ */ React60.createElement(ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React60.createElement(ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React60.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React60.createElement(EditingPanelTabs, null))))))));
|
|
2287
2280
|
};
|
|
2288
2281
|
|
|
2289
2282
|
// src/panel.ts
|
|
@@ -2295,10 +2288,10 @@ var { panel, usePanelActions, usePanelStatus } = createPanel({
|
|
|
2295
2288
|
// src/init.ts
|
|
2296
2289
|
import { injectIntoLogic } from "@elementor/editor";
|
|
2297
2290
|
import { __registerPanel as registerPanel } from "@elementor/editor-panels";
|
|
2298
|
-
import {
|
|
2291
|
+
import { blockCommand } from "@elementor/editor-v1-adapters";
|
|
2299
2292
|
|
|
2300
2293
|
// src/hooks/use-close-editor-panel.ts
|
|
2301
|
-
import { useEffect as
|
|
2294
|
+
import { useEffect as useEffect2 } from "react";
|
|
2302
2295
|
import { getSelectedElements as getSelectedElements2, isElementInContainer } from "@elementor/editor-elements";
|
|
2303
2296
|
import { __privateListenTo as listenTo, commandStartEvent } from "@elementor/editor-v1-adapters";
|
|
2304
2297
|
|
|
@@ -2316,7 +2309,7 @@ var isAtomicWidgetSelected = () => {
|
|
|
2316
2309
|
// src/hooks/use-close-editor-panel.ts
|
|
2317
2310
|
var useCloseEditorPanel = () => {
|
|
2318
2311
|
const { close } = usePanelActions();
|
|
2319
|
-
return
|
|
2312
|
+
return useEffect2(() => {
|
|
2320
2313
|
return listenTo(commandStartEvent("document/elements/delete"), (e) => {
|
|
2321
2314
|
const selectedElement = getSelectedElements2()[0];
|
|
2322
2315
|
const { container: deletedContainer } = e?.args;
|
|
@@ -2329,11 +2322,11 @@ var useCloseEditorPanel = () => {
|
|
|
2329
2322
|
};
|
|
2330
2323
|
|
|
2331
2324
|
// src/hooks/use-open-editor-panel.ts
|
|
2332
|
-
import { useEffect as
|
|
2325
|
+
import { useEffect as useEffect3 } from "react";
|
|
2333
2326
|
import { __privateListenTo as listenTo2, commandStartEvent as commandStartEvent2 } from "@elementor/editor-v1-adapters";
|
|
2334
2327
|
var useOpenEditorPanel = () => {
|
|
2335
2328
|
const { open } = usePanelActions();
|
|
2336
|
-
|
|
2329
|
+
useEffect3(() => {
|
|
2337
2330
|
return listenTo2(commandStartEvent2("panel/editor/open"), () => {
|
|
2338
2331
|
if (isAtomicWidgetSelected()) {
|
|
2339
2332
|
open();
|
|
@@ -2349,102 +2342,47 @@ var EditingPanelHooks = () => {
|
|
|
2349
2342
|
return null;
|
|
2350
2343
|
};
|
|
2351
2344
|
|
|
2352
|
-
// src/hooks/use-unapply-class.ts
|
|
2353
|
-
import { updateElementSettings as updateElementSettings3, useElementSetting as useElementSetting4 } from "@elementor/editor-elements";
|
|
2354
|
-
var useUnapplyClass = (classId) => {
|
|
2355
|
-
const { element } = useElement();
|
|
2356
|
-
const classesProp = useClassesProp();
|
|
2357
|
-
const classes = useElementSetting4(element.id, classesProp);
|
|
2358
|
-
const filteredClasses = classes?.value.filter((className) => className !== classId) ?? [];
|
|
2359
|
-
return () => {
|
|
2360
|
-
updateElementSettings3({
|
|
2361
|
-
id: element.id,
|
|
2362
|
-
props: {
|
|
2363
|
-
[classesProp]: {
|
|
2364
|
-
$$type: "classes",
|
|
2365
|
-
value: filteredClasses
|
|
2366
|
-
}
|
|
2367
|
-
}
|
|
2368
|
-
});
|
|
2369
|
-
};
|
|
2370
|
-
};
|
|
2371
|
-
|
|
2372
|
-
// src/css-classes.ts
|
|
2373
|
-
var STATES = ["hover", "focus", "active"];
|
|
2374
|
-
function initCssClasses() {
|
|
2375
|
-
registerStateItems();
|
|
2376
|
-
registerGlobalClassItems();
|
|
2377
|
-
}
|
|
2378
|
-
function registerStateItems() {
|
|
2379
|
-
registerStateMenuItem({
|
|
2380
|
-
id: "normal",
|
|
2381
|
-
props: {
|
|
2382
|
-
state: null
|
|
2383
|
-
}
|
|
2384
|
-
});
|
|
2385
|
-
STATES.forEach((state) => {
|
|
2386
|
-
registerStateMenuItem({
|
|
2387
|
-
id: state,
|
|
2388
|
-
props: {
|
|
2389
|
-
state
|
|
2390
|
-
}
|
|
2391
|
-
});
|
|
2392
|
-
});
|
|
2393
|
-
}
|
|
2394
|
-
function registerGlobalClassItems() {
|
|
2395
|
-
registerGlobalClassMenuItem({
|
|
2396
|
-
id: "unapply-class",
|
|
2397
|
-
useProps: () => {
|
|
2398
|
-
const { styleId: currentClass } = useCssClassItem();
|
|
2399
|
-
const unapplyClass = useUnapplyClass(currentClass);
|
|
2400
|
-
return {
|
|
2401
|
-
text: "Remove",
|
|
2402
|
-
onClick: unapplyClass
|
|
2403
|
-
};
|
|
2404
|
-
}
|
|
2405
|
-
});
|
|
2406
|
-
}
|
|
2407
|
-
|
|
2408
2345
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
2409
|
-
import * as
|
|
2410
|
-
import { useId as
|
|
2346
|
+
import * as React63 from "react";
|
|
2347
|
+
import { useId as useId4 } from "react";
|
|
2411
2348
|
import { ControlLabel as ControlLabel30, useBoundProp as useBoundProp4 } from "@elementor/editor-controls";
|
|
2412
2349
|
import { DatabaseIcon, SettingsIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
2413
2350
|
import {
|
|
2414
2351
|
bindPopover as bindPopover2,
|
|
2415
2352
|
bindTrigger as bindTrigger2,
|
|
2416
|
-
Box as
|
|
2417
|
-
Divider as
|
|
2353
|
+
Box as Box5,
|
|
2354
|
+
Divider as Divider11,
|
|
2418
2355
|
IconButton as IconButton3,
|
|
2419
2356
|
Paper,
|
|
2420
2357
|
Popover as Popover2,
|
|
2421
|
-
Stack as
|
|
2358
|
+
Stack as Stack22,
|
|
2422
2359
|
Tab as Tab2,
|
|
2423
2360
|
TabPanel as TabPanel2,
|
|
2424
2361
|
Tabs as Tabs2,
|
|
2425
|
-
Typography as
|
|
2362
|
+
Typography as Typography5,
|
|
2426
2363
|
UnstableTag as Tag,
|
|
2427
2364
|
usePopupState as usePopupState3,
|
|
2428
2365
|
useTabs as useTabs2
|
|
2429
2366
|
} from "@elementor/ui";
|
|
2430
|
-
import { __ as
|
|
2367
|
+
import { __ as __43 } from "@wordpress/i18n";
|
|
2431
2368
|
|
|
2432
2369
|
// src/hooks/use-persist-dynamic-value.ts
|
|
2370
|
+
import { useSessionStorage as useSessionStorage2 } from "@elementor/session";
|
|
2433
2371
|
var usePersistDynamicValue = (propKey) => {
|
|
2434
2372
|
const { element } = useElement();
|
|
2435
2373
|
const prefixedKey = `dynamic/non-dynamic-values-history/${element.id}/${propKey}`;
|
|
2436
|
-
return
|
|
2374
|
+
return useSessionStorage2(prefixedKey);
|
|
2437
2375
|
};
|
|
2438
2376
|
|
|
2439
2377
|
// src/dynamics/dynamic-control.tsx
|
|
2440
|
-
import * as
|
|
2378
|
+
import * as React61 from "react";
|
|
2441
2379
|
import { PropKeyProvider as PropKeyProvider3, PropProvider as PropProvider3, useBoundProp as useBoundProp2 } from "@elementor/editor-controls";
|
|
2442
2380
|
|
|
2443
2381
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2444
|
-
import { useMemo as
|
|
2382
|
+
import { useMemo as useMemo4 } from "react";
|
|
2445
2383
|
|
|
2446
2384
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
2447
|
-
import { useMemo as
|
|
2385
|
+
import { useMemo as useMemo3 } from "react";
|
|
2448
2386
|
import { useBoundProp } from "@elementor/editor-controls";
|
|
2449
2387
|
|
|
2450
2388
|
// src/dynamics/sync/get-elementor-config.ts
|
|
@@ -2499,7 +2437,7 @@ var usePropDynamicTags = () => {
|
|
|
2499
2437
|
const propDynamicType = getDynamicPropType(propType);
|
|
2500
2438
|
categories = propDynamicType?.settings.categories || [];
|
|
2501
2439
|
}
|
|
2502
|
-
return
|
|
2440
|
+
return useMemo3(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
2503
2441
|
};
|
|
2504
2442
|
var getDynamicTagsByCategories = (categories) => {
|
|
2505
2443
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -2515,7 +2453,7 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
2515
2453
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2516
2454
|
var useDynamicTag = (tagName) => {
|
|
2517
2455
|
const dynamicTags = usePropDynamicTags();
|
|
2518
|
-
return
|
|
2456
|
+
return useMemo4(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
2519
2457
|
};
|
|
2520
2458
|
|
|
2521
2459
|
// src/dynamics/dynamic-control.tsx
|
|
@@ -2539,30 +2477,30 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
2539
2477
|
});
|
|
2540
2478
|
};
|
|
2541
2479
|
const propType = createTopLevelOjectType({ schema: dynamicTag.props_schema });
|
|
2542
|
-
return /* @__PURE__ */
|
|
2480
|
+
return /* @__PURE__ */ React61.createElement(PropProvider3, { propType, setValue: setDynamicValue, value: { [bind]: dynamicValue } }, /* @__PURE__ */ React61.createElement(PropKeyProvider3, { bind }, children));
|
|
2543
2481
|
};
|
|
2544
2482
|
|
|
2545
2483
|
// src/dynamics/components/dynamic-selection.tsx
|
|
2546
|
-
import * as
|
|
2547
|
-
import { Fragment as
|
|
2484
|
+
import * as React62 from "react";
|
|
2485
|
+
import { Fragment as Fragment9, useState as useState8 } from "react";
|
|
2548
2486
|
import { useBoundProp as useBoundProp3 } from "@elementor/editor-controls";
|
|
2549
2487
|
import { PhotoIcon, SearchIcon } from "@elementor/icons";
|
|
2550
2488
|
import {
|
|
2551
|
-
Box as
|
|
2552
|
-
Divider as
|
|
2489
|
+
Box as Box4,
|
|
2490
|
+
Divider as Divider10,
|
|
2553
2491
|
InputAdornment,
|
|
2554
2492
|
Link,
|
|
2555
2493
|
ListSubheader as ListSubheader2,
|
|
2556
2494
|
MenuItem as MenuItem2,
|
|
2557
2495
|
MenuList,
|
|
2558
|
-
Stack as
|
|
2496
|
+
Stack as Stack21,
|
|
2559
2497
|
TextField as TextField2,
|
|
2560
|
-
Typography as
|
|
2498
|
+
Typography as Typography4
|
|
2561
2499
|
} from "@elementor/ui";
|
|
2562
|
-
import { __ as
|
|
2500
|
+
import { __ as __42 } from "@wordpress/i18n";
|
|
2563
2501
|
var SIZE3 = "tiny";
|
|
2564
2502
|
var DynamicSelection = ({ onSelect }) => {
|
|
2565
|
-
const [searchValue, setSearchValue] =
|
|
2503
|
+
const [searchValue, setSearchValue] = useState8("");
|
|
2566
2504
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
2567
2505
|
const { value: anyValue } = useBoundProp3();
|
|
2568
2506
|
const { bind, value: dynamicValue, setValue } = useBoundProp3(dynamicPropTypeUtil);
|
|
@@ -2579,21 +2517,21 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2579
2517
|
setValue({ name: value, settings: {} });
|
|
2580
2518
|
onSelect?.();
|
|
2581
2519
|
};
|
|
2582
|
-
return /* @__PURE__ */
|
|
2520
|
+
return /* @__PURE__ */ React62.createElement(Stack21, null, /* @__PURE__ */ React62.createElement(Box4, { px: 1.5, pb: 1 }, /* @__PURE__ */ React62.createElement(
|
|
2583
2521
|
TextField2,
|
|
2584
2522
|
{
|
|
2585
2523
|
fullWidth: true,
|
|
2586
2524
|
size: SIZE3,
|
|
2587
2525
|
value: searchValue,
|
|
2588
2526
|
onChange: handleSearch,
|
|
2589
|
-
placeholder:
|
|
2527
|
+
placeholder: __42("Search dynamic tag", "elementor"),
|
|
2590
2528
|
InputProps: {
|
|
2591
|
-
startAdornment: /* @__PURE__ */
|
|
2529
|
+
startAdornment: /* @__PURE__ */ React62.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React62.createElement(SearchIcon, { fontSize: SIZE3 }))
|
|
2592
2530
|
}
|
|
2593
2531
|
}
|
|
2594
|
-
)), /* @__PURE__ */
|
|
2532
|
+
)), /* @__PURE__ */ React62.createElement(Divider10, null), /* @__PURE__ */ React62.createElement(Box4, { sx: { overflowY: "auto", height: 260, width: 220 } }, options10.length > 0 ? /* @__PURE__ */ React62.createElement(MenuList, { role: "listbox", tabIndex: 0 }, options10.map(([category, items3], index) => /* @__PURE__ */ React62.createElement(Fragment9, { key: index }, /* @__PURE__ */ React62.createElement(ListSubheader2, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items3.map(({ value, label: tagLabel }) => {
|
|
2595
2533
|
const isSelected = isCurrentValueDynamic && value === dynamicValue?.name;
|
|
2596
|
-
return /* @__PURE__ */
|
|
2534
|
+
return /* @__PURE__ */ React62.createElement(
|
|
2597
2535
|
MenuItem2,
|
|
2598
2536
|
{
|
|
2599
2537
|
key: value,
|
|
@@ -2604,7 +2542,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2604
2542
|
},
|
|
2605
2543
|
tagLabel
|
|
2606
2544
|
);
|
|
2607
|
-
})))) : /* @__PURE__ */
|
|
2545
|
+
})))) : /* @__PURE__ */ React62.createElement(Stack21, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React62.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React62.createElement(Typography4, { align: "center", variant: "caption", color: "text.secondary" }, __42("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React62.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React62.createElement(Typography4, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React62.createElement(
|
|
2608
2546
|
Link,
|
|
2609
2547
|
{
|
|
2610
2548
|
color: "secondary",
|
|
@@ -2612,8 +2550,8 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2612
2550
|
component: "button",
|
|
2613
2551
|
onClick: () => setSearchValue("")
|
|
2614
2552
|
},
|
|
2615
|
-
|
|
2616
|
-
), "\xA0",
|
|
2553
|
+
__42("Clear the filters", "elementor")
|
|
2554
|
+
), "\xA0", __42("and try again.", "elementor")))));
|
|
2617
2555
|
};
|
|
2618
2556
|
var useFilteredOptions = (searchValue) => {
|
|
2619
2557
|
const dynamicTags = usePropDynamicTags();
|
|
@@ -2638,7 +2576,7 @@ var DynamicSelectionControl = () => {
|
|
|
2638
2576
|
const { bind, value } = useBoundProp4(dynamicPropTypeUtil);
|
|
2639
2577
|
const [propValueFromHistory] = usePersistDynamicValue(bind);
|
|
2640
2578
|
const { name: tagName = "" } = value;
|
|
2641
|
-
const selectionPopoverId =
|
|
2579
|
+
const selectionPopoverId = useId4();
|
|
2642
2580
|
const selectionPopoverState = usePopupState3({ variant: "popover", popupId: selectionPopoverId });
|
|
2643
2581
|
const dynamicTag = useDynamicTag(tagName);
|
|
2644
2582
|
const removeDynamicTag = () => {
|
|
@@ -2647,25 +2585,25 @@ var DynamicSelectionControl = () => {
|
|
|
2647
2585
|
if (!dynamicTag) {
|
|
2648
2586
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
2649
2587
|
}
|
|
2650
|
-
return /* @__PURE__ */
|
|
2588
|
+
return /* @__PURE__ */ React63.createElement(Box5, null, /* @__PURE__ */ React63.createElement(
|
|
2651
2589
|
Tag,
|
|
2652
2590
|
{
|
|
2653
2591
|
fullWidth: true,
|
|
2654
2592
|
showActionsOnHover: true,
|
|
2655
2593
|
label: dynamicTag.label,
|
|
2656
|
-
startIcon: /* @__PURE__ */
|
|
2594
|
+
startIcon: /* @__PURE__ */ React63.createElement(DatabaseIcon, { fontSize: SIZE4 }),
|
|
2657
2595
|
...bindTrigger2(selectionPopoverState),
|
|
2658
|
-
actions: /* @__PURE__ */
|
|
2596
|
+
actions: /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React63.createElement(
|
|
2659
2597
|
IconButton3,
|
|
2660
2598
|
{
|
|
2661
2599
|
size: SIZE4,
|
|
2662
2600
|
onClick: removeDynamicTag,
|
|
2663
|
-
"aria-label":
|
|
2601
|
+
"aria-label": __43("Remove dynamic value", "elementor")
|
|
2664
2602
|
},
|
|
2665
|
-
/* @__PURE__ */
|
|
2603
|
+
/* @__PURE__ */ React63.createElement(XIcon2, { fontSize: SIZE4 })
|
|
2666
2604
|
))
|
|
2667
2605
|
}
|
|
2668
|
-
), /* @__PURE__ */
|
|
2606
|
+
), /* @__PURE__ */ React63.createElement(
|
|
2669
2607
|
Popover2,
|
|
2670
2608
|
{
|
|
2671
2609
|
disablePortal: true,
|
|
@@ -2673,32 +2611,32 @@ var DynamicSelectionControl = () => {
|
|
|
2673
2611
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
2674
2612
|
...bindPopover2(selectionPopoverState)
|
|
2675
2613
|
},
|
|
2676
|
-
/* @__PURE__ */
|
|
2614
|
+
/* @__PURE__ */ React63.createElement(Stack22, null, /* @__PURE__ */ React63.createElement(Stack22, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React63.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React63.createElement(Typography5, { variant: "subtitle2" }, __43("Dynamic Tags", "elementor")), /* @__PURE__ */ React63.createElement(IconButton3, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React63.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React63.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
2677
2615
|
));
|
|
2678
2616
|
};
|
|
2679
2617
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
2680
|
-
const popupId =
|
|
2618
|
+
const popupId = useId4();
|
|
2681
2619
|
const settingsPopupState = usePopupState3({ variant: "popover", popupId });
|
|
2682
2620
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
2683
2621
|
if (!hasDynamicSettings) {
|
|
2684
2622
|
return null;
|
|
2685
2623
|
}
|
|
2686
|
-
return /* @__PURE__ */
|
|
2624
|
+
return /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(
|
|
2687
2625
|
IconButton3,
|
|
2688
2626
|
{
|
|
2689
2627
|
size: SIZE4,
|
|
2690
2628
|
...bindTrigger2(settingsPopupState),
|
|
2691
|
-
"aria-label":
|
|
2629
|
+
"aria-label": __43("Settings", "elementor")
|
|
2692
2630
|
},
|
|
2693
|
-
/* @__PURE__ */
|
|
2694
|
-
), /* @__PURE__ */
|
|
2631
|
+
/* @__PURE__ */ React63.createElement(SettingsIcon, { fontSize: SIZE4 })
|
|
2632
|
+
), /* @__PURE__ */ React63.createElement(
|
|
2695
2633
|
Popover2,
|
|
2696
2634
|
{
|
|
2697
2635
|
disableScrollLock: true,
|
|
2698
2636
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
2699
2637
|
...bindPopover2(settingsPopupState)
|
|
2700
2638
|
},
|
|
2701
|
-
/* @__PURE__ */
|
|
2639
|
+
/* @__PURE__ */ React63.createElement(Paper, { component: Stack22, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React63.createElement(Stack22, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React63.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React63.createElement(Typography5, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React63.createElement(IconButton3, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React63.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React63.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
2702
2640
|
));
|
|
2703
2641
|
};
|
|
2704
2642
|
var DynamicSettings = ({ controls }) => {
|
|
@@ -2707,10 +2645,10 @@ var DynamicSettings = ({ controls }) => {
|
|
|
2707
2645
|
if (!tabs.length) {
|
|
2708
2646
|
return null;
|
|
2709
2647
|
}
|
|
2710
|
-
return /* @__PURE__ */
|
|
2711
|
-
return /* @__PURE__ */
|
|
2648
|
+
return /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(Tabs2, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React63.createElement(Tab2, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React63.createElement(Divider11, null), tabs.map(({ value }, index) => {
|
|
2649
|
+
return /* @__PURE__ */ React63.createElement(TabPanel2, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React63.createElement(Stack22, { gap: 1, px: 2 }, value.items.map((item) => {
|
|
2712
2650
|
if (item.type === "control") {
|
|
2713
|
-
return /* @__PURE__ */
|
|
2651
|
+
return /* @__PURE__ */ React63.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
2714
2652
|
}
|
|
2715
2653
|
return null;
|
|
2716
2654
|
})));
|
|
@@ -2720,22 +2658,22 @@ var Control3 = ({ control }) => {
|
|
|
2720
2658
|
if (!getControlByType(control.type)) {
|
|
2721
2659
|
return null;
|
|
2722
2660
|
}
|
|
2723
|
-
return /* @__PURE__ */
|
|
2661
|
+
return /* @__PURE__ */ React63.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React63.createElement(ControlLabel30, null, control.label) : null, /* @__PURE__ */ React63.createElement(Control, { type: control.type, props: control.props }));
|
|
2724
2662
|
};
|
|
2725
2663
|
|
|
2726
2664
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
2727
|
-
import * as
|
|
2665
|
+
import * as React64 from "react";
|
|
2728
2666
|
import { useBoundProp as useBoundProp5 } from "@elementor/editor-controls";
|
|
2729
2667
|
import { DatabaseIcon as DatabaseIcon2 } from "@elementor/icons";
|
|
2730
|
-
import { __ as
|
|
2668
|
+
import { __ as __44 } from "@wordpress/i18n";
|
|
2731
2669
|
var usePropDynamicAction = () => {
|
|
2732
2670
|
const { propType } = useBoundProp5();
|
|
2733
2671
|
const visible = !!propType && supportsDynamic(propType);
|
|
2734
2672
|
return {
|
|
2735
2673
|
visible,
|
|
2736
2674
|
icon: DatabaseIcon2,
|
|
2737
|
-
title:
|
|
2738
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
2675
|
+
title: __44("Dynamic Tags", "elementor"),
|
|
2676
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React64.createElement(DynamicSelection, { onSelect: closePopover })
|
|
2739
2677
|
};
|
|
2740
2678
|
};
|
|
2741
2679
|
|
|
@@ -2761,10 +2699,9 @@ function init2() {
|
|
|
2761
2699
|
component: EditingPanelHooks
|
|
2762
2700
|
});
|
|
2763
2701
|
init();
|
|
2764
|
-
initCssClasses();
|
|
2765
2702
|
}
|
|
2766
2703
|
var blockV1Panel = () => {
|
|
2767
|
-
|
|
2704
|
+
blockCommand({
|
|
2768
2705
|
command: "panel/editor/open",
|
|
2769
2706
|
condition: isAtomicWidgetSelected
|
|
2770
2707
|
});
|
|
@@ -2774,8 +2711,6 @@ var blockV1Panel = () => {
|
|
|
2774
2711
|
init2();
|
|
2775
2712
|
export {
|
|
2776
2713
|
injectIntoClassSelectorActions,
|
|
2777
|
-
registerGlobalClassMenuItem,
|
|
2778
|
-
registerStateMenuItem,
|
|
2779
2714
|
replaceControl,
|
|
2780
2715
|
useBoundProp6 as useBoundProp,
|
|
2781
2716
|
usePanelActions,
|