@elementor/editor-editing-panel 1.5.1 → 1.7.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 +36 -0
- package/dist/index.d.mts +37 -3
- package/dist/index.d.ts +37 -3
- package/dist/index.js +816 -606
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +798 -570
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/components/css-class-menu.tsx +125 -0
- package/src/components/css-class-selector.tsx +156 -33
- package/src/components/multi-combobox.tsx +184 -0
- package/src/components/style-sections/border-section/border-field.tsx +1 -5
- package/src/components/style-sections/position-section/position-field.tsx +1 -0
- package/src/components/style-tab.tsx +13 -4
- package/src/contexts/css-class-item-context.tsx +31 -0
- package/src/contexts/style-context.tsx +4 -3
- package/src/controls-registry/create-top-level-object-type.ts +14 -0
- package/src/controls-registry/settings-field.tsx +12 -14
- package/src/controls-registry/styles-field.tsx +17 -5
- package/src/css-classes.ts +37 -0
- package/src/dynamics/components/dynamic-selection-control.tsx +1 -1
- package/src/dynamics/components/dynamic-selection.tsx +3 -4
- package/src/dynamics/dynamic-control.tsx +16 -11
- package/src/dynamics/hooks/use-dynamic-tag.ts +2 -3
- package/src/dynamics/hooks/use-prop-dynamic-action.tsx +1 -4
- package/src/dynamics/hooks/use-prop-dynamic-tags.ts +3 -6
- package/src/dynamics/utils.ts +1 -1
- package/src/hooks/use-styles-fields.ts +1 -0
- package/src/index.ts +1 -0
- package/src/init.ts +2 -0
- package/src/components/multi-combobox/index.ts +0 -3
- package/src/components/multi-combobox/multi-combobox.tsx +0 -122
- package/src/components/multi-combobox/types.ts +0 -29
- package/src/components/multi-combobox/use-combobox-actions.ts +0 -62
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,128 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import { useBoundProp as
|
|
2
|
+
import { useBoundProp as useBoundProp6 } from "@elementor/editor-controls";
|
|
3
3
|
|
|
4
4
|
// src/control-replacement.tsx
|
|
5
5
|
import { createControlReplacement } from "@elementor/editor-controls";
|
|
6
6
|
var { replaceControl, getControlReplacement } = createControlReplacement();
|
|
7
7
|
|
|
8
|
+
// src/components/css-class-menu.tsx
|
|
9
|
+
import * as React3 from "react";
|
|
10
|
+
import { CheckIcon } from "@elementor/icons";
|
|
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 } 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 = React.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
|
+
|
|
8
126
|
// src/init.ts
|
|
9
127
|
import { injectIntoLogic } from "@elementor/editor";
|
|
10
128
|
import { __registerPanel as registerPanel } from "@elementor/editor-panels";
|
|
@@ -19,22 +137,22 @@ import { __privateListenTo as listenTo, commandStartEvent } from "@elementor/edi
|
|
|
19
137
|
import { __createPanel as createPanel } from "@elementor/editor-panels";
|
|
20
138
|
|
|
21
139
|
// src/components/editing-panel.tsx
|
|
22
|
-
import * as
|
|
140
|
+
import * as React61 from "react";
|
|
23
141
|
import { ControlActionsProvider, ControlReplacementProvider } from "@elementor/editor-controls";
|
|
24
142
|
import { useSelectedElement } from "@elementor/editor-elements";
|
|
25
143
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
26
144
|
import { ErrorBoundary } from "@elementor/ui";
|
|
27
|
-
import { __ as
|
|
145
|
+
import { __ as __40 } from "@wordpress/i18n";
|
|
28
146
|
|
|
29
147
|
// src/contexts/element-context.tsx
|
|
30
|
-
import * as
|
|
31
|
-
import { createContext, useContext } from "react";
|
|
32
|
-
var
|
|
148
|
+
import * as React4 from "react";
|
|
149
|
+
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
150
|
+
var Context2 = createContext3(null);
|
|
33
151
|
function ElementProvider({ children, element, elementType }) {
|
|
34
|
-
return /* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ React4.createElement(Context2.Provider, { value: { element, elementType } }, children);
|
|
35
153
|
}
|
|
36
154
|
function useElement() {
|
|
37
|
-
const context =
|
|
155
|
+
const context = useContext3(Context2);
|
|
38
156
|
if (!context) {
|
|
39
157
|
throw new Error("useElement must be used within a ElementProvider");
|
|
40
158
|
}
|
|
@@ -42,10 +160,10 @@ function useElement() {
|
|
|
42
160
|
}
|
|
43
161
|
|
|
44
162
|
// src/controls-actions.ts
|
|
45
|
-
import { createMenu } from "@elementor/menus";
|
|
163
|
+
import { createMenu as createMenu2 } from "@elementor/menus";
|
|
46
164
|
|
|
47
165
|
// src/popover-action.tsx
|
|
48
|
-
import * as
|
|
166
|
+
import * as React5 from "react";
|
|
49
167
|
import { useId } from "react";
|
|
50
168
|
import { XIcon } from "@elementor/icons";
|
|
51
169
|
import { bindPopover, bindToggle, IconButton, Popover, Stack, Tooltip, Typography, usePopupState } from "@elementor/ui";
|
|
@@ -64,7 +182,7 @@ function PopoverAction({
|
|
|
64
182
|
if (!visible) {
|
|
65
183
|
return null;
|
|
66
184
|
}
|
|
67
|
-
return /* @__PURE__ */
|
|
185
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(Tooltip, { placement: "top", title }, /* @__PURE__ */ React5.createElement(IconButton, { "aria-label": title, key: id, size: SIZE, ...bindToggle(popupState) }, /* @__PURE__ */ React5.createElement(Icon, { fontSize: SIZE }))), /* @__PURE__ */ React5.createElement(
|
|
68
186
|
Popover,
|
|
69
187
|
{
|
|
70
188
|
disablePortal: true,
|
|
@@ -75,37 +193,37 @@ function PopoverAction({
|
|
|
75
193
|
},
|
|
76
194
|
...bindPopover(popupState)
|
|
77
195
|
},
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ React5.createElement(Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React5.createElement(Icon, { fontSize: SIZE, sx: { mr: 0.5 } }), /* @__PURE__ */ React5.createElement(Typography, { variant: "subtitle2" }, title), /* @__PURE__ */ React5.createElement(IconButton, { sx: { ml: "auto" }, size: SIZE, onClick: popupState.close }, /* @__PURE__ */ React5.createElement(XIcon, { fontSize: SIZE }))),
|
|
197
|
+
/* @__PURE__ */ React5.createElement(PopoverContent, { closePopover: popupState.close })
|
|
80
198
|
));
|
|
81
199
|
}
|
|
82
200
|
|
|
83
201
|
// src/controls-actions.ts
|
|
84
|
-
var controlActionsMenu =
|
|
202
|
+
var controlActionsMenu = createMenu2({
|
|
85
203
|
components: {
|
|
86
204
|
PopoverAction
|
|
87
205
|
}
|
|
88
206
|
});
|
|
89
207
|
|
|
90
208
|
// src/components/editing-panel-error-fallback.tsx
|
|
91
|
-
import * as
|
|
92
|
-
import { Alert, Box } from "@elementor/ui";
|
|
209
|
+
import * as React6 from "react";
|
|
210
|
+
import { Alert, Box as Box2 } from "@elementor/ui";
|
|
93
211
|
function EditorPanelErrorFallback() {
|
|
94
|
-
return /* @__PURE__ */
|
|
212
|
+
return /* @__PURE__ */ React6.createElement(Box2, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React6.createElement(Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React6.createElement("strong", null, "Something went wrong")));
|
|
95
213
|
}
|
|
96
214
|
|
|
97
215
|
// src/components/editing-panel-tabs.tsx
|
|
98
|
-
import * as
|
|
216
|
+
import * as React60 from "react";
|
|
99
217
|
import { Fragment as Fragment7 } from "react";
|
|
100
218
|
import { Divider as Divider8, Stack as Stack19, Tab, TabPanel, Tabs, useTabs } from "@elementor/ui";
|
|
101
|
-
import { __ as
|
|
219
|
+
import { __ as __39 } from "@wordpress/i18n";
|
|
102
220
|
|
|
103
221
|
// src/components/settings-tab.tsx
|
|
104
|
-
import * as
|
|
222
|
+
import * as React12 from "react";
|
|
105
223
|
import { ControlLabel } from "@elementor/editor-controls";
|
|
106
224
|
|
|
107
225
|
// src/controls-registry/control.tsx
|
|
108
|
-
import * as
|
|
226
|
+
import * as React7 from "react";
|
|
109
227
|
import { createError } from "@elementor/utils";
|
|
110
228
|
|
|
111
229
|
// src/controls-registry/controls-registry.tsx
|
|
@@ -142,20 +260,20 @@ var Control = ({ props, type }) => {
|
|
|
142
260
|
context: { type }
|
|
143
261
|
});
|
|
144
262
|
}
|
|
145
|
-
return /* @__PURE__ */
|
|
263
|
+
return /* @__PURE__ */ React7.createElement(ControlByType, { ...props });
|
|
146
264
|
};
|
|
147
265
|
|
|
148
266
|
// src/controls-registry/control-type-container.tsx
|
|
149
|
-
import * as
|
|
150
|
-
import { Box as
|
|
267
|
+
import * as React8 from "react";
|
|
268
|
+
import { Box as Box3, styled as styled2 } from "@elementor/ui";
|
|
151
269
|
var ControlTypeContainer = ({
|
|
152
270
|
controlType,
|
|
153
271
|
children
|
|
154
272
|
}) => {
|
|
155
273
|
const layout = getLayoutByType(controlType);
|
|
156
|
-
return /* @__PURE__ */
|
|
274
|
+
return /* @__PURE__ */ React8.createElement(StyledContainer, { layout }, children);
|
|
157
275
|
};
|
|
158
|
-
var StyledContainer =
|
|
276
|
+
var StyledContainer = styled2(Box3, {
|
|
159
277
|
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
160
278
|
})(({ layout, theme }) => ({
|
|
161
279
|
display: "grid",
|
|
@@ -171,34 +289,47 @@ var getGridLayout = (layout) => ({
|
|
|
171
289
|
});
|
|
172
290
|
|
|
173
291
|
// src/controls-registry/settings-field.tsx
|
|
174
|
-
import * as
|
|
175
|
-
import {
|
|
292
|
+
import * as React9 from "react";
|
|
293
|
+
import { PropKeyProvider, PropProvider } from "@elementor/editor-controls";
|
|
176
294
|
import { updateSettings, useElementSetting } from "@elementor/editor-elements";
|
|
295
|
+
|
|
296
|
+
// src/controls-registry/create-top-level-object-type.ts
|
|
297
|
+
var createTopLevelOjectType = ({ schema }) => {
|
|
298
|
+
const schemaPropType = {
|
|
299
|
+
key: "",
|
|
300
|
+
kind: "object",
|
|
301
|
+
meta: {},
|
|
302
|
+
settings: {},
|
|
303
|
+
default: null,
|
|
304
|
+
shape: schema
|
|
305
|
+
};
|
|
306
|
+
return schemaPropType;
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
// src/controls-registry/settings-field.tsx
|
|
177
310
|
var SettingsField = ({ bind, children }) => {
|
|
178
311
|
const { element, elementType } = useElement();
|
|
179
|
-
const defaultValue = elementType.propsSchema[bind]?.default;
|
|
180
312
|
const settingsValue = useElementSetting(element.id, bind);
|
|
181
|
-
const value =
|
|
313
|
+
const value = { [bind]: settingsValue };
|
|
314
|
+
const propType = createTopLevelOjectType({ schema: elementType.propsSchema });
|
|
182
315
|
const setValue = (newValue) => {
|
|
183
316
|
updateSettings({
|
|
184
317
|
id: element.id,
|
|
185
|
-
props: {
|
|
186
|
-
[bind]: newValue
|
|
187
|
-
}
|
|
318
|
+
props: { ...newValue }
|
|
188
319
|
});
|
|
189
320
|
};
|
|
190
|
-
return /* @__PURE__ */
|
|
321
|
+
return /* @__PURE__ */ React9.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React9.createElement(PropKeyProvider, { bind }, children));
|
|
191
322
|
};
|
|
192
323
|
|
|
193
324
|
// src/components/section.tsx
|
|
194
|
-
import * as
|
|
325
|
+
import * as React10 from "react";
|
|
195
326
|
import { useId as useId2, useState } from "react";
|
|
196
|
-
import { Collapse, Divider, ListItemButton, ListItemText, Stack as Stack2 } from "@elementor/ui";
|
|
327
|
+
import { Collapse, Divider, ListItemButton, ListItemText as ListItemText2, Stack as Stack2 } from "@elementor/ui";
|
|
197
328
|
|
|
198
329
|
// src/components/collapse-icon.tsx
|
|
199
330
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
200
|
-
import { styled as
|
|
201
|
-
var CollapseIcon =
|
|
331
|
+
import { styled as styled3 } from "@elementor/ui";
|
|
332
|
+
var CollapseIcon = styled3(ChevronDownIcon, {
|
|
202
333
|
shouldForwardProp: (prop) => prop !== "open"
|
|
203
334
|
})(({ theme, open }) => ({
|
|
204
335
|
transform: open ? "rotate(180deg)" : "rotate(0deg)",
|
|
@@ -213,36 +344,36 @@ function Section({ title, children, defaultExpanded = false }) {
|
|
|
213
344
|
const id = useId2();
|
|
214
345
|
const labelId = `label-${id}`;
|
|
215
346
|
const contentId = `content-${id}`;
|
|
216
|
-
return /* @__PURE__ */
|
|
347
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(
|
|
217
348
|
ListItemButton,
|
|
218
349
|
{
|
|
219
350
|
id: labelId,
|
|
220
351
|
"aria-controls": contentId,
|
|
221
352
|
onClick: () => setIsOpen((prev) => !prev)
|
|
222
353
|
},
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
), /* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ React10.createElement(ListItemText2, { secondary: title }),
|
|
355
|
+
/* @__PURE__ */ React10.createElement(CollapseIcon, { open: isOpen, color: "secondary" })
|
|
356
|
+
), /* @__PURE__ */ React10.createElement(Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React10.createElement(Stack2, { gap: 2.5, p: 2 }, children)), /* @__PURE__ */ React10.createElement(Divider, null));
|
|
226
357
|
}
|
|
227
358
|
|
|
228
359
|
// src/components/sections-list.tsx
|
|
229
|
-
import * as
|
|
360
|
+
import * as React11 from "react";
|
|
230
361
|
import { List } from "@elementor/ui";
|
|
231
362
|
function SectionsList(props) {
|
|
232
|
-
return /* @__PURE__ */
|
|
363
|
+
return /* @__PURE__ */ React11.createElement(List, { disablePadding: true, component: "div", ...props });
|
|
233
364
|
}
|
|
234
365
|
|
|
235
366
|
// src/components/settings-tab.tsx
|
|
236
367
|
var SettingsTab = () => {
|
|
237
368
|
const { elementType } = useElement();
|
|
238
|
-
return /* @__PURE__ */
|
|
369
|
+
return /* @__PURE__ */ React12.createElement(SectionsList, null, elementType.controls.map(({ type, value }, index) => {
|
|
239
370
|
if (type === "control") {
|
|
240
|
-
return /* @__PURE__ */
|
|
371
|
+
return /* @__PURE__ */ React12.createElement(Control2, { key: value.bind, control: value });
|
|
241
372
|
}
|
|
242
373
|
if (type === "section") {
|
|
243
|
-
return /* @__PURE__ */
|
|
374
|
+
return /* @__PURE__ */ React12.createElement(Section, { title: value.label, key: type + "." + index, defaultExpanded: true }, value.items?.map((item) => {
|
|
244
375
|
if (item.type === "control") {
|
|
245
|
-
return /* @__PURE__ */
|
|
376
|
+
return /* @__PURE__ */ React12.createElement(Control2, { key: item.value.bind, control: item.value });
|
|
246
377
|
}
|
|
247
378
|
return null;
|
|
248
379
|
}));
|
|
@@ -254,59 +385,57 @@ var Control2 = ({ control }) => {
|
|
|
254
385
|
if (!getControlByType(control.type)) {
|
|
255
386
|
return null;
|
|
256
387
|
}
|
|
257
|
-
return /* @__PURE__ */
|
|
388
|
+
return /* @__PURE__ */ React12.createElement(SettingsField, { bind: control.bind }, /* @__PURE__ */ React12.createElement(ControlTypeContainer, { controlType: control.type }, control.label ? /* @__PURE__ */ React12.createElement(ControlLabel, null, control.label) : null, /* @__PURE__ */ React12.createElement(Control, { type: control.type, props: control.props })));
|
|
258
389
|
};
|
|
259
390
|
|
|
260
391
|
// src/components/style-tab.tsx
|
|
261
|
-
import * as
|
|
262
|
-
import { useState as
|
|
392
|
+
import * as React59 from "react";
|
|
393
|
+
import { useState as useState8 } from "react";
|
|
263
394
|
import { useElementSetting as useElementSetting3, useElementStyles } from "@elementor/editor-elements";
|
|
264
395
|
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
265
396
|
import { Divider as Divider7 } from "@elementor/ui";
|
|
266
|
-
import { __ as
|
|
397
|
+
import { __ as __38 } from "@wordpress/i18n";
|
|
267
398
|
|
|
268
399
|
// src/contexts/classes-prop-context.tsx
|
|
269
|
-
import * as
|
|
270
|
-
import { createContext as
|
|
271
|
-
var
|
|
400
|
+
import * as React13 from "react";
|
|
401
|
+
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
402
|
+
var Context3 = createContext4(null);
|
|
272
403
|
function ClassesPropProvider({ children, prop }) {
|
|
273
|
-
return /* @__PURE__ */
|
|
404
|
+
return /* @__PURE__ */ React13.createElement(Context3.Provider, { value: { prop } }, children);
|
|
274
405
|
}
|
|
275
406
|
function useClassesProp() {
|
|
276
|
-
const context =
|
|
407
|
+
const context = useContext4(Context3);
|
|
277
408
|
if (!context) {
|
|
278
409
|
throw new Error("useClassesProp must be used within a ClassesPropProvider");
|
|
279
410
|
}
|
|
280
411
|
return context.prop;
|
|
281
412
|
}
|
|
282
413
|
|
|
283
|
-
// src/contexts/style-context.tsx
|
|
284
|
-
import * as React11 from "react";
|
|
285
|
-
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
286
|
-
var Context3 = createContext3(null);
|
|
287
|
-
function StyleProvider({ children, id, setId, meta }) {
|
|
288
|
-
return /* @__PURE__ */ React11.createElement(Context3.Provider, { value: { id, setId, meta } }, children);
|
|
289
|
-
}
|
|
290
|
-
function useStyle() {
|
|
291
|
-
const context = useContext3(Context3);
|
|
292
|
-
if (!context) {
|
|
293
|
-
throw new Error("useStyle must be used within a StyleProvider");
|
|
294
|
-
}
|
|
295
|
-
return context;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
414
|
// src/components/css-class-selector.tsx
|
|
299
|
-
import * as
|
|
300
|
-
import {
|
|
415
|
+
import * as React16 from "react";
|
|
416
|
+
import { useId as useId4, useRef as useRef2 } from "react";
|
|
417
|
+
import { getElementSetting, updateSettings as updateSettings2, useElementSetting as useElementSetting2 } from "@elementor/editor-elements";
|
|
301
418
|
import { classesPropTypeUtil } from "@elementor/editor-props";
|
|
302
|
-
import {
|
|
303
|
-
|
|
304
|
-
|
|
419
|
+
import {
|
|
420
|
+
ELEMENTS_STYLES_PROVIDER_KEY,
|
|
421
|
+
useAllStylesByProvider,
|
|
422
|
+
useCreateActionsByProvider
|
|
423
|
+
} from "@elementor/editor-styles-repository";
|
|
424
|
+
import { DotsVerticalIcon } from "@elementor/icons";
|
|
425
|
+
import {
|
|
426
|
+
bindTrigger,
|
|
427
|
+
Chip,
|
|
428
|
+
Stack as Stack3,
|
|
429
|
+
Typography as Typography2,
|
|
430
|
+
UnstableChipGroup,
|
|
431
|
+
usePopupState as usePopupState2
|
|
432
|
+
} from "@elementor/ui";
|
|
433
|
+
import { __ as __2 } from "@wordpress/i18n";
|
|
305
434
|
|
|
306
435
|
// src/components/conditional-tooltip-wrapper.tsx
|
|
307
436
|
import { useEffect, useRef, useState as useState2 } from "react";
|
|
308
|
-
import * as
|
|
309
|
-
import { Box as
|
|
437
|
+
import * as React14 from "react";
|
|
438
|
+
import { Box as Box4, Tooltip as Tooltip2 } from "@elementor/ui";
|
|
310
439
|
var ConditionalTooltipWrapper = ({ maxWidth, title }) => {
|
|
311
440
|
const elRef = useRef(null);
|
|
312
441
|
const [isOverflown, setIsOverflown] = useState2(false);
|
|
@@ -324,12 +453,12 @@ var ConditionalTooltipWrapper = ({ maxWidth, title }) => {
|
|
|
324
453
|
};
|
|
325
454
|
}, []);
|
|
326
455
|
if (isOverflown) {
|
|
327
|
-
return /* @__PURE__ */
|
|
456
|
+
return /* @__PURE__ */ React14.createElement(Tooltip2, { title, placement: "top" }, /* @__PURE__ */ React14.createElement(Content, { maxWidth, ref: elRef }, title));
|
|
328
457
|
}
|
|
329
|
-
return /* @__PURE__ */
|
|
458
|
+
return /* @__PURE__ */ React14.createElement(Content, { maxWidth, ref: elRef }, title);
|
|
330
459
|
};
|
|
331
|
-
var Content =
|
|
332
|
-
|
|
460
|
+
var Content = React14.forwardRef(({ maxWidth, ...tooltipProps }, ref) => /* @__PURE__ */ React14.createElement(
|
|
461
|
+
Box4,
|
|
333
462
|
{
|
|
334
463
|
ref,
|
|
335
464
|
position: "relative",
|
|
@@ -338,80 +467,26 @@ var Content = React12.forwardRef(({ maxWidth, ...tooltipProps }, ref) => /* @__P
|
|
|
338
467
|
}
|
|
339
468
|
));
|
|
340
469
|
|
|
341
|
-
// src/components/multi-combobox
|
|
342
|
-
import * as
|
|
470
|
+
// src/components/multi-combobox.tsx
|
|
471
|
+
import * as React15 from "react";
|
|
472
|
+
import { useId as useId3, useState as useState3 } from "react";
|
|
343
473
|
import {
|
|
344
474
|
Autocomplete,
|
|
345
|
-
Box as
|
|
346
|
-
|
|
347
|
-
styled as
|
|
475
|
+
Box as Box5,
|
|
476
|
+
createFilterOptions,
|
|
477
|
+
styled as styled4,
|
|
348
478
|
TextField
|
|
349
479
|
} from "@elementor/ui";
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
import { createFilterOptions } from "@elementor/ui";
|
|
353
|
-
var useComboboxActions = (applied, actions, optionsLabel, onSelect) => ({
|
|
354
|
-
action: {
|
|
355
|
-
is: (opt) => typeof opt !== "string" && "action" in opt,
|
|
356
|
-
getLabel: (option) => option.action.getLabel(option.label),
|
|
357
|
-
groupBy: (option) => option.action.groupLabel,
|
|
358
|
-
onChange: ({ action, label }) => action?.apply(label),
|
|
359
|
-
getFilteredActions: (optionList, params) => {
|
|
360
|
-
const actionGroups = Object.values(actions);
|
|
361
|
-
return actionGroups.reduce((groups, group) => {
|
|
362
|
-
const actionOptions = group.actions.reduce((groupActions, action) => {
|
|
363
|
-
const shouldShowAction = action.condition(optionList, params.inputValue);
|
|
364
|
-
if (shouldShowAction) {
|
|
365
|
-
const actionOption = createActionOption(group.label, action, params.inputValue);
|
|
366
|
-
groupActions.unshift(actionOption);
|
|
367
|
-
}
|
|
368
|
-
return groupActions;
|
|
369
|
-
}, []);
|
|
370
|
-
return [...groups, ...actionOptions];
|
|
371
|
-
}, []);
|
|
372
|
-
}
|
|
373
|
-
},
|
|
374
|
-
option: {
|
|
375
|
-
is: (opt) => typeof opt !== "string" && !("action" in opt),
|
|
376
|
-
getLabel: (option) => option.label,
|
|
377
|
-
groupBy: () => optionsLabel ?? "",
|
|
378
|
-
onChange: (optionValues) => onSelect?.(optionValues),
|
|
379
|
-
getFilteredOptions: (optionList, params) => {
|
|
380
|
-
const appliedValues = applied.map((option) => option.value);
|
|
381
|
-
const optionsWithoutApplied = optionList.filter((option) => !appliedValues.includes(option.value));
|
|
382
|
-
return filter(optionsWithoutApplied, params);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
var filter = createFilterOptions();
|
|
387
|
-
var createActionOption = (groupLabel, action, inputValue) => ({
|
|
388
|
-
value: "",
|
|
389
|
-
label: inputValue,
|
|
390
|
-
action: {
|
|
391
|
-
groupLabel,
|
|
392
|
-
apply: action.apply,
|
|
393
|
-
getLabel: action.getLabel
|
|
394
|
-
}
|
|
395
|
-
});
|
|
396
|
-
|
|
397
|
-
// src/components/multi-combobox/multi-combobox.tsx
|
|
398
|
-
var MultiCombobox = ({
|
|
399
|
-
actions = {},
|
|
480
|
+
function MultiCombobox({
|
|
481
|
+
actions = [],
|
|
400
482
|
selected,
|
|
401
483
|
options: options10,
|
|
402
|
-
optionsLabel,
|
|
403
484
|
onSelect,
|
|
404
|
-
onCreate,
|
|
405
485
|
...props
|
|
406
|
-
})
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
// TODO: make the group mechanism more generic, allow passing list of groups.
|
|
411
|
-
optionsLabel,
|
|
412
|
-
onSelect
|
|
413
|
-
);
|
|
414
|
-
return /* @__PURE__ */ React13.createElement(
|
|
486
|
+
}) {
|
|
487
|
+
const filter = useFilterOptions();
|
|
488
|
+
const { run, loading } = useActionRunner();
|
|
489
|
+
return /* @__PURE__ */ React15.createElement(
|
|
415
490
|
Autocomplete,
|
|
416
491
|
{
|
|
417
492
|
...props,
|
|
@@ -421,63 +496,100 @@ var MultiCombobox = ({
|
|
|
421
496
|
selectOnFocus: true,
|
|
422
497
|
disableClearable: true,
|
|
423
498
|
handleHomeEndKeys: true,
|
|
499
|
+
disabled: loading,
|
|
424
500
|
value: selected,
|
|
425
501
|
options: options10,
|
|
426
|
-
renderGroup,
|
|
427
|
-
renderInput: (params) => /* @__PURE__ */
|
|
428
|
-
|
|
429
|
-
|
|
502
|
+
renderGroup: (params) => /* @__PURE__ */ React15.createElement(Group, { ...params }),
|
|
503
|
+
renderInput: (params) => /* @__PURE__ */ React15.createElement(TextField, { ...params }),
|
|
504
|
+
onChange: (_, selectedOrInputValue, reason) => {
|
|
505
|
+
const inputValue = selectedOrInputValue.find((option) => typeof option === "string");
|
|
506
|
+
const optionsAndActions = selectedOrInputValue.filter((option) => typeof option !== "string");
|
|
430
507
|
if (reason === "createOption") {
|
|
431
|
-
const
|
|
432
|
-
|
|
508
|
+
const [firstAction] = filterActions(actions, { options: options10, inputValue: inputValue ?? "" });
|
|
509
|
+
if (firstAction) {
|
|
510
|
+
return run(firstAction.apply, firstAction.value);
|
|
511
|
+
}
|
|
433
512
|
}
|
|
434
|
-
const action =
|
|
513
|
+
const action = optionsAndActions.find((value) => isAction(value));
|
|
435
514
|
if (reason === "selectOption" && action) {
|
|
436
|
-
return
|
|
515
|
+
return run(action.apply, action.value);
|
|
437
516
|
}
|
|
438
|
-
const
|
|
439
|
-
|
|
440
|
-
optionProps.onChange([.../* @__PURE__ */ new Set([...fixedValues, ...selectedValues])]);
|
|
517
|
+
const fixedValues = options10.filter((option) => !!option.fixed);
|
|
518
|
+
onSelect?.([.../* @__PURE__ */ new Set([...optionsAndActions, ...fixedValues])]);
|
|
441
519
|
},
|
|
442
|
-
getOptionLabel: (option) =>
|
|
443
|
-
|
|
444
|
-
|
|
520
|
+
getOptionLabel: (option) => typeof option === "string" ? option : option.label,
|
|
521
|
+
getOptionKey: (option) => {
|
|
522
|
+
if (typeof option === "string") {
|
|
523
|
+
return option;
|
|
445
524
|
}
|
|
446
|
-
|
|
447
|
-
return actionProps.getLabel(option);
|
|
448
|
-
}
|
|
449
|
-
return "";
|
|
525
|
+
return option.key ?? option.value;
|
|
450
526
|
},
|
|
451
527
|
filterOptions: (optionList, params) => {
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
|
|
528
|
+
const selectedValues = selected.map((option) => option.value);
|
|
529
|
+
return [
|
|
530
|
+
...filterActions(actions, { options: optionList, inputValue: params.inputValue }),
|
|
531
|
+
...filter(
|
|
532
|
+
optionList.filter((option) => !selectedValues.includes(option.value)),
|
|
533
|
+
params
|
|
534
|
+
)
|
|
535
|
+
];
|
|
455
536
|
},
|
|
456
|
-
groupBy: (option) =>
|
|
537
|
+
groupBy: (option) => option.group ?? ""
|
|
457
538
|
}
|
|
458
539
|
);
|
|
540
|
+
}
|
|
541
|
+
var Group = (params) => {
|
|
542
|
+
const id = `combobox-group-${useId3().replace(/:/g, "_")}`;
|
|
543
|
+
return /* @__PURE__ */ React15.createElement(StyledGroup, { role: "group", "aria-labelledby": id }, /* @__PURE__ */ React15.createElement(StyledGroupHeader, { id }, " ", params.group), /* @__PURE__ */ React15.createElement(StyledGroupItems, { role: "listbox" }, params.children));
|
|
459
544
|
};
|
|
460
|
-
var
|
|
461
|
-
var Group = styled3("li")`
|
|
545
|
+
var StyledGroup = styled4("li")`
|
|
462
546
|
&:not( :last-of-type ) {
|
|
463
547
|
border-bottom: 1px solid ${({ theme }) => theme.palette.divider};
|
|
464
548
|
}
|
|
465
549
|
`;
|
|
466
|
-
var
|
|
550
|
+
var StyledGroupHeader = styled4(Box5)(({ theme }) => ({
|
|
467
551
|
position: "sticky",
|
|
468
552
|
top: "-8px",
|
|
469
553
|
padding: theme.spacing(1, 2),
|
|
470
554
|
color: theme.palette.text.tertiary
|
|
471
555
|
}));
|
|
472
|
-
var
|
|
556
|
+
var StyledGroupItems = styled4("ul")`
|
|
473
557
|
padding: 0;
|
|
474
558
|
`;
|
|
559
|
+
function useFilterOptions() {
|
|
560
|
+
return useState3(() => createFilterOptions())[0];
|
|
561
|
+
}
|
|
562
|
+
function useActionRunner() {
|
|
563
|
+
const [loading, setLoading] = useState3(false);
|
|
564
|
+
const run = async (apply, value) => {
|
|
565
|
+
setLoading(true);
|
|
566
|
+
try {
|
|
567
|
+
await apply(value);
|
|
568
|
+
} catch {
|
|
569
|
+
}
|
|
570
|
+
setLoading(false);
|
|
571
|
+
};
|
|
572
|
+
return { run, loading };
|
|
573
|
+
}
|
|
574
|
+
function filterActions(actions, { options: options10, inputValue }) {
|
|
575
|
+
return actions.filter((action) => action.condition(options10, inputValue)).map((action, index) => ({
|
|
576
|
+
label: action.label(inputValue),
|
|
577
|
+
value: inputValue,
|
|
578
|
+
group: action.group,
|
|
579
|
+
apply: action.apply,
|
|
580
|
+
condition: action.condition,
|
|
581
|
+
key: index.toString()
|
|
582
|
+
}));
|
|
583
|
+
}
|
|
584
|
+
function isAction(option) {
|
|
585
|
+
return "apply" in option && "condition" in option;
|
|
586
|
+
}
|
|
475
587
|
|
|
476
588
|
// src/components/css-class-selector.tsx
|
|
477
589
|
var ID = "elementor-css-class-selector";
|
|
478
590
|
var TAGS_LIMIT = 8;
|
|
479
591
|
var EMPTY_OPTION = {
|
|
480
|
-
label:
|
|
592
|
+
label: __2("local", "elementor"),
|
|
481
593
|
value: "",
|
|
482
594
|
fixed: true,
|
|
483
595
|
color: "primary",
|
|
@@ -485,13 +597,14 @@ var EMPTY_OPTION = {
|
|
|
485
597
|
};
|
|
486
598
|
function CssClassSelector() {
|
|
487
599
|
const options10 = useOptions();
|
|
488
|
-
const
|
|
600
|
+
const { value: appliedIds, setValue: setAppliedIds, pushValue: pushAppliedId } = useAppliedClassesIds();
|
|
489
601
|
const { id: activeId, setId: setActiveId } = useStyle();
|
|
602
|
+
const actions = useCreateActions({ pushAppliedId, setActiveId });
|
|
490
603
|
const handleApply = useHandleApply(appliedIds, setAppliedIds);
|
|
491
604
|
const handleActivate = ({ value }) => setActiveId(value);
|
|
492
605
|
const applied = useAppliedOptions(options10, appliedIds);
|
|
493
606
|
const active = applied.find((option) => option.value === activeId) ?? EMPTY_OPTION;
|
|
494
|
-
return /* @__PURE__ */
|
|
607
|
+
return /* @__PURE__ */ React16.createElement(Stack3, { gap: 1, p: 2 }, /* @__PURE__ */ React16.createElement(Typography2, { component: "label", variant: "caption", htmlFor: ID }, __2("CSS Classes", "elementor")), /* @__PURE__ */ React16.createElement(
|
|
495
608
|
MultiCombobox,
|
|
496
609
|
{
|
|
497
610
|
id: ID,
|
|
@@ -500,44 +613,104 @@ function CssClassSelector() {
|
|
|
500
613
|
selected: applied,
|
|
501
614
|
onSelect: handleApply,
|
|
502
615
|
limitTags: TAGS_LIMIT,
|
|
503
|
-
|
|
616
|
+
actions,
|
|
617
|
+
getLimitTagsText: (more) => /* @__PURE__ */ React16.createElement(Chip, { size: "tiny", variant: "standard", label: `+${more}`, clickable: true }),
|
|
504
618
|
renderTags: (values, getTagProps) => values.map((value, index) => {
|
|
505
619
|
const chipProps = getTagProps({ index });
|
|
506
620
|
const isActive = value.value === active?.value;
|
|
507
|
-
return /* @__PURE__ */
|
|
508
|
-
|
|
621
|
+
return /* @__PURE__ */ React16.createElement(
|
|
622
|
+
CssClassItem,
|
|
509
623
|
{
|
|
510
|
-
...chipProps,
|
|
511
624
|
key: chipProps.key,
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
625
|
+
label: value.label,
|
|
626
|
+
id: value.value,
|
|
627
|
+
isActive,
|
|
628
|
+
isGlobal: value.color === "global",
|
|
515
629
|
color: isActive && value.color ? value.color : "default",
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
"aria-pressed": isActive
|
|
630
|
+
chipProps,
|
|
631
|
+
onClickActive: () => handleActivate(value)
|
|
519
632
|
}
|
|
520
633
|
);
|
|
521
634
|
})
|
|
522
635
|
}
|
|
523
636
|
));
|
|
524
637
|
}
|
|
638
|
+
function CssClassItem({ id, label, isActive, isGlobal, color, chipProps, onClickActive }) {
|
|
639
|
+
const { meta } = useStyle();
|
|
640
|
+
const popupId = useId4().replace(/:/g, "_");
|
|
641
|
+
const popupState = usePopupState2({ variant: "popover", popupId });
|
|
642
|
+
const chipRef = useRef2(null);
|
|
643
|
+
const { onDelete, ...chipGroupProps } = chipProps;
|
|
644
|
+
return /* @__PURE__ */ React16.createElement(CssClassItemProvider, { styleId: id, isActive, isGlobal }, /* @__PURE__ */ React16.createElement(UnstableChipGroup, { ref: chipRef, ...chipGroupProps, "aria-label": `Edit ${label}`, role: "group" }, /* @__PURE__ */ React16.createElement(
|
|
645
|
+
Chip,
|
|
646
|
+
{
|
|
647
|
+
key: chipProps.key,
|
|
648
|
+
size: "tiny",
|
|
649
|
+
label: /* @__PURE__ */ React16.createElement(ConditionalTooltipWrapper, { maxWidth: "10ch", title: label }),
|
|
650
|
+
variant: isActive && !meta.state ? "filled" : "standard",
|
|
651
|
+
color,
|
|
652
|
+
onClick: () => onClickActive(id),
|
|
653
|
+
"aria-pressed": isActive
|
|
654
|
+
}
|
|
655
|
+
), /* @__PURE__ */ React16.createElement(
|
|
656
|
+
Chip,
|
|
657
|
+
{
|
|
658
|
+
key: `${chipProps.key}-menu`,
|
|
659
|
+
size: "tiny",
|
|
660
|
+
label: /* @__PURE__ */ React16.createElement(Stack3, { direction: "row", gap: 0.5, alignItems: "center" }, isActive && meta.state && /* @__PURE__ */ React16.createElement(Typography2, { variant: "inherit" }, meta.state), /* @__PURE__ */ React16.createElement(DotsVerticalIcon, { fontSize: "inherit" })),
|
|
661
|
+
variant: "filled",
|
|
662
|
+
color,
|
|
663
|
+
...bindTrigger(popupState),
|
|
664
|
+
"aria-label": __2("Open CSS Class Menu", "elementor")
|
|
665
|
+
}
|
|
666
|
+
)), /* @__PURE__ */ React16.createElement(CssClassMenu, { popupState, containerRef: chipRef }));
|
|
667
|
+
}
|
|
525
668
|
function useOptions() {
|
|
526
669
|
const { element } = useElement();
|
|
527
|
-
return useAllStylesByProvider({ elementId: element.id }).flatMap(
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
670
|
+
return useAllStylesByProvider({ elementId: element.id }).flatMap(
|
|
671
|
+
([provider, styleDefs]) => {
|
|
672
|
+
const isElements = provider.key === ELEMENTS_STYLES_PROVIDER_KEY;
|
|
673
|
+
if (isElements && styleDefs.length === 0) {
|
|
674
|
+
return [EMPTY_OPTION];
|
|
675
|
+
}
|
|
676
|
+
return styleDefs.map((styleDef) => {
|
|
677
|
+
return {
|
|
678
|
+
label: styleDef.label,
|
|
679
|
+
value: styleDef.id,
|
|
680
|
+
fixed: isElements,
|
|
681
|
+
color: isElements ? "primary" : "global",
|
|
682
|
+
provider: provider.key,
|
|
683
|
+
group: provider.labels?.plural
|
|
684
|
+
};
|
|
685
|
+
});
|
|
531
686
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
687
|
+
);
|
|
688
|
+
}
|
|
689
|
+
function useCreateActions({
|
|
690
|
+
pushAppliedId,
|
|
691
|
+
setActiveId
|
|
692
|
+
}) {
|
|
693
|
+
return useCreateActionsByProvider().map(([provider, create]) => {
|
|
694
|
+
return {
|
|
695
|
+
// translators: %s is the label of the new class.
|
|
696
|
+
label: (value) => __2('Create new "%s"', "elementor").replace("%s", value),
|
|
697
|
+
apply: async (value) => {
|
|
698
|
+
const created = await create({ label: value });
|
|
699
|
+
if (!created) {
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
pushAppliedId(created.id);
|
|
703
|
+
setActiveId(created.id);
|
|
704
|
+
},
|
|
705
|
+
condition: (options10, inputValue) => {
|
|
706
|
+
const isUniqueLabel = !options10.some(
|
|
707
|
+
(option) => option.label.toLowerCase() === inputValue.toLowerCase()
|
|
708
|
+
);
|
|
709
|
+
return !!inputValue && isUniqueLabel;
|
|
710
|
+
},
|
|
711
|
+
// translators: %s is the singular label of css class provider (e.g "Global CSS Class").
|
|
712
|
+
group: __2("Create New %s", "elementor").replace("%s", provider.labels?.singular ?? "")
|
|
713
|
+
};
|
|
541
714
|
});
|
|
542
715
|
}
|
|
543
716
|
function useAppliedOptions(options10, appliedIds) {
|
|
@@ -562,7 +735,15 @@ function useAppliedClassesIds() {
|
|
|
562
735
|
}
|
|
563
736
|
});
|
|
564
737
|
};
|
|
565
|
-
|
|
738
|
+
const pushValue = (id) => {
|
|
739
|
+
const ids = getElementSetting(element.id, currentClassesProp)?.value || [];
|
|
740
|
+
setValue([...ids, id]);
|
|
741
|
+
};
|
|
742
|
+
return {
|
|
743
|
+
value,
|
|
744
|
+
setValue,
|
|
745
|
+
pushValue
|
|
746
|
+
};
|
|
566
747
|
}
|
|
567
748
|
function useHandleApply(appliedIds, setAppliedIds) {
|
|
568
749
|
const { id: activeId, setId: setActiveId } = useStyle();
|
|
@@ -586,16 +767,17 @@ function useHandleApply(appliedIds, setAppliedIds) {
|
|
|
586
767
|
}
|
|
587
768
|
|
|
588
769
|
// src/components/style-sections/background-section/background-section.tsx
|
|
589
|
-
import * as
|
|
770
|
+
import * as React18 from "react";
|
|
590
771
|
import { BackgroundControl } from "@elementor/editor-controls";
|
|
591
772
|
|
|
592
773
|
// src/controls-registry/styles-field.tsx
|
|
593
|
-
import * as
|
|
594
|
-
import {
|
|
774
|
+
import * as React17 from "react";
|
|
775
|
+
import { PropKeyProvider as PropKeyProvider2, PropProvider as PropProvider2 } from "@elementor/editor-controls";
|
|
776
|
+
import { getStylesSchema } from "@elementor/editor-styles";
|
|
595
777
|
|
|
596
778
|
// src/hooks/use-styles-fields.ts
|
|
597
779
|
import { updateStyle, useElementStyleProps } from "@elementor/editor-elements";
|
|
598
|
-
import { __ as
|
|
780
|
+
import { __ as __3 } from "@wordpress/i18n";
|
|
599
781
|
function useStylesFields(propNames) {
|
|
600
782
|
const { element } = useElement();
|
|
601
783
|
const { id, meta } = useStyle();
|
|
@@ -613,7 +795,7 @@ function useStylesFields(propNames) {
|
|
|
613
795
|
props: newValues,
|
|
614
796
|
meta,
|
|
615
797
|
bind: classesProp,
|
|
616
|
-
label:
|
|
798
|
+
label: __3("local", "elementor")
|
|
617
799
|
});
|
|
618
800
|
};
|
|
619
801
|
return [value, setValue];
|
|
@@ -634,30 +816,36 @@ function useStylesField(propName) {
|
|
|
634
816
|
// src/controls-registry/styles-field.tsx
|
|
635
817
|
var StylesField = ({ bind, children }) => {
|
|
636
818
|
const [value, setValue] = useStylesField(bind);
|
|
637
|
-
|
|
819
|
+
const stylesSchema = getStylesSchema();
|
|
820
|
+
const propType = createTopLevelOjectType({ schema: stylesSchema });
|
|
821
|
+
const values = { [bind]: value };
|
|
822
|
+
const setValues = (newValue) => {
|
|
823
|
+
setValue(newValue[bind]);
|
|
824
|
+
};
|
|
825
|
+
return /* @__PURE__ */ React17.createElement(PropProvider2, { propType, value: values, setValue: setValues }, /* @__PURE__ */ React17.createElement(PropKeyProvider2, { bind }, children));
|
|
638
826
|
};
|
|
639
827
|
|
|
640
828
|
// src/components/style-sections/background-section/background-section.tsx
|
|
641
829
|
var BackgroundSection = () => {
|
|
642
|
-
return /* @__PURE__ */
|
|
830
|
+
return /* @__PURE__ */ React18.createElement(StylesField, { bind: "background" }, /* @__PURE__ */ React18.createElement(BackgroundControl, null));
|
|
643
831
|
};
|
|
644
832
|
|
|
645
833
|
// src/components/style-sections/border-section/border-section.tsx
|
|
646
|
-
import * as
|
|
834
|
+
import * as React25 from "react";
|
|
647
835
|
import { Divider as Divider2, Stack as Stack5 } from "@elementor/ui";
|
|
648
836
|
|
|
649
837
|
// src/components/style-sections/border-section/border-field.tsx
|
|
650
|
-
import * as
|
|
651
|
-
import { __ as
|
|
838
|
+
import * as React23 from "react";
|
|
839
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
652
840
|
|
|
653
841
|
// src/components/add-or-remove-content.tsx
|
|
654
|
-
import * as
|
|
842
|
+
import * as React19 from "react";
|
|
655
843
|
import { ControlLabel as ControlLabel2 } from "@elementor/editor-controls";
|
|
656
844
|
import { MinusIcon, PlusIcon } from "@elementor/icons";
|
|
657
845
|
import { Collapse as Collapse2, IconButton as IconButton2, Stack as Stack4 } from "@elementor/ui";
|
|
658
846
|
var SIZE2 = "tiny";
|
|
659
847
|
var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
660
|
-
return /* @__PURE__ */
|
|
848
|
+
return /* @__PURE__ */ React19.createElement(Stack4, { gap: 1.5 }, /* @__PURE__ */ React19.createElement(
|
|
661
849
|
Stack4,
|
|
662
850
|
{
|
|
663
851
|
direction: "row",
|
|
@@ -666,86 +854,82 @@ var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
|
666
854
|
alignItems: "center"
|
|
667
855
|
}
|
|
668
856
|
},
|
|
669
|
-
/* @__PURE__ */
|
|
670
|
-
isAdded ? /* @__PURE__ */
|
|
671
|
-
), /* @__PURE__ */
|
|
857
|
+
/* @__PURE__ */ React19.createElement(ControlLabel2, null, label),
|
|
858
|
+
isAdded ? /* @__PURE__ */ React19.createElement(IconButton2, { size: SIZE2, onClick: onRemove }, /* @__PURE__ */ React19.createElement(MinusIcon, { fontSize: SIZE2 })) : /* @__PURE__ */ React19.createElement(IconButton2, { size: SIZE2, onClick: onAdd }, /* @__PURE__ */ React19.createElement(PlusIcon, { fontSize: SIZE2 }))
|
|
859
|
+
), /* @__PURE__ */ React19.createElement(Collapse2, { in: isAdded, unmountOnExit: true }, /* @__PURE__ */ React19.createElement(Stack4, { gap: 1.5 }, children)));
|
|
672
860
|
};
|
|
673
861
|
|
|
674
862
|
// src/components/style-sections/border-section/border-color-field.tsx
|
|
675
|
-
import * as
|
|
863
|
+
import * as React20 from "react";
|
|
676
864
|
import { ColorControl, ControlLabel as ControlLabel3 } from "@elementor/editor-controls";
|
|
677
865
|
import { Grid } from "@elementor/ui";
|
|
678
|
-
import { __ as
|
|
866
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
679
867
|
var BorderColorField = () => {
|
|
680
|
-
return /* @__PURE__ */
|
|
868
|
+
return /* @__PURE__ */ React20.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React20.createElement(Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React20.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React20.createElement(ControlLabel3, null, __4("Border Color", "elementor"))), /* @__PURE__ */ React20.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React20.createElement(ColorControl, null))));
|
|
681
869
|
};
|
|
682
870
|
|
|
683
871
|
// src/components/style-sections/border-section/border-style-field.tsx
|
|
684
|
-
import * as
|
|
872
|
+
import * as React21 from "react";
|
|
685
873
|
import { ControlLabel as ControlLabel4, SelectControl as SelectControl2 } from "@elementor/editor-controls";
|
|
686
874
|
import { Grid as Grid2 } from "@elementor/ui";
|
|
687
|
-
import { __ as
|
|
875
|
+
import { __ as __5 } from "@wordpress/i18n";
|
|
688
876
|
var borderStyles = [
|
|
689
|
-
{ value: "none", label:
|
|
690
|
-
{ value: "solid", label:
|
|
691
|
-
{ value: "dashed", label:
|
|
692
|
-
{ value: "dotted", label:
|
|
693
|
-
{ value: "double", label:
|
|
694
|
-
{ value: "groove", label:
|
|
695
|
-
{ value: "ridge", label:
|
|
696
|
-
{ value: "inset", label:
|
|
697
|
-
{ value: "outset", label:
|
|
877
|
+
{ value: "none", label: __5("None", "elementor") },
|
|
878
|
+
{ value: "solid", label: __5("Solid", "elementor") },
|
|
879
|
+
{ value: "dashed", label: __5("Dashed", "elementor") },
|
|
880
|
+
{ value: "dotted", label: __5("Dotted", "elementor") },
|
|
881
|
+
{ value: "double", label: __5("Double", "elementor") },
|
|
882
|
+
{ value: "groove", label: __5("Groove", "elementor") },
|
|
883
|
+
{ value: "ridge", label: __5("Ridge", "elementor") },
|
|
884
|
+
{ value: "inset", label: __5("Inset", "elementor") },
|
|
885
|
+
{ value: "outset", label: __5("Outset", "elementor") }
|
|
698
886
|
];
|
|
699
887
|
var BorderStyleField = () => {
|
|
700
|
-
return /* @__PURE__ */
|
|
888
|
+
return /* @__PURE__ */ React21.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React21.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React21.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React21.createElement(ControlLabel4, null, __5("Border Type", "elementor"))), /* @__PURE__ */ React21.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React21.createElement(SelectControl2, { options: borderStyles }))));
|
|
701
889
|
};
|
|
702
890
|
|
|
703
891
|
// src/components/style-sections/border-section/border-width-field.tsx
|
|
704
|
-
import * as
|
|
892
|
+
import * as React22 from "react";
|
|
705
893
|
import { EqualUnequalSizesControl } from "@elementor/editor-controls";
|
|
706
894
|
import { borderWidthPropTypeUtil } from "@elementor/editor-props";
|
|
707
895
|
import { SideAllIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
708
|
-
import { __ as
|
|
896
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
709
897
|
var edges = [
|
|
710
898
|
{
|
|
711
|
-
label:
|
|
712
|
-
icon: /* @__PURE__ */
|
|
899
|
+
label: __6("Top", "elementor"),
|
|
900
|
+
icon: /* @__PURE__ */ React22.createElement(SideTopIcon, { fontSize: "tiny" }),
|
|
713
901
|
bind: "top"
|
|
714
902
|
},
|
|
715
903
|
{
|
|
716
|
-
label:
|
|
717
|
-
icon: /* @__PURE__ */
|
|
904
|
+
label: __6("Right", "elementor"),
|
|
905
|
+
icon: /* @__PURE__ */ React22.createElement(SideRightIcon, { fontSize: "tiny" }),
|
|
718
906
|
bind: "right"
|
|
719
907
|
},
|
|
720
908
|
{
|
|
721
|
-
label:
|
|
722
|
-
icon: /* @__PURE__ */
|
|
909
|
+
label: __6("Bottom", "elementor"),
|
|
910
|
+
icon: /* @__PURE__ */ React22.createElement(SideBottomIcon, { fontSize: "tiny" }),
|
|
723
911
|
bind: "bottom"
|
|
724
912
|
},
|
|
725
913
|
{
|
|
726
|
-
label:
|
|
727
|
-
icon: /* @__PURE__ */
|
|
914
|
+
label: __6("Left", "elementor"),
|
|
915
|
+
icon: /* @__PURE__ */ React22.createElement(SideLeftIcon, { fontSize: "tiny" }),
|
|
728
916
|
bind: "left"
|
|
729
917
|
}
|
|
730
918
|
];
|
|
731
919
|
var BorderWidthField = () => {
|
|
732
|
-
return /* @__PURE__ */
|
|
920
|
+
return /* @__PURE__ */ React22.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React22.createElement(
|
|
733
921
|
EqualUnequalSizesControl,
|
|
734
922
|
{
|
|
735
923
|
items: edges,
|
|
736
|
-
label:
|
|
737
|
-
icon: /* @__PURE__ */
|
|
924
|
+
label: __6("Border Width", "elementor"),
|
|
925
|
+
icon: /* @__PURE__ */ React22.createElement(SideAllIcon, { fontSize: "tiny" }),
|
|
738
926
|
multiSizePropTypeUtil: borderWidthPropTypeUtil
|
|
739
927
|
}
|
|
740
928
|
));
|
|
741
929
|
};
|
|
742
930
|
|
|
743
931
|
// src/components/style-sections/border-section/border-field.tsx
|
|
744
|
-
var
|
|
745
|
-
var initialBorderWidth = {
|
|
746
|
-
$$type: "border-width",
|
|
747
|
-
value: { top: initialSize, right: initialSize, bottom: initialSize, left: initialSize }
|
|
748
|
-
};
|
|
932
|
+
var initialBorderWidth = { $$type: "size", value: { size: 1, unit: "px" } };
|
|
749
933
|
var initialBorderColor = { $$type: "color", value: "#000000" };
|
|
750
934
|
var initialBorderStyle = "solid";
|
|
751
935
|
var BorderField = () => {
|
|
@@ -763,22 +947,22 @@ var BorderField = () => {
|
|
|
763
947
|
setBorderStyle(null);
|
|
764
948
|
};
|
|
765
949
|
const hasBorder = Boolean(borderWidth || borderColor || borderStyle);
|
|
766
|
-
return /* @__PURE__ */
|
|
950
|
+
return /* @__PURE__ */ React23.createElement(
|
|
767
951
|
AddOrRemoveContent,
|
|
768
952
|
{
|
|
769
|
-
label:
|
|
953
|
+
label: __7("Border", "elementor"),
|
|
770
954
|
isAdded: hasBorder,
|
|
771
955
|
onAdd: addBorder,
|
|
772
956
|
onRemove: removeBorder
|
|
773
957
|
},
|
|
774
|
-
/* @__PURE__ */
|
|
775
|
-
/* @__PURE__ */
|
|
776
|
-
/* @__PURE__ */
|
|
958
|
+
/* @__PURE__ */ React23.createElement(BorderWidthField, null),
|
|
959
|
+
/* @__PURE__ */ React23.createElement(BorderColorField, null),
|
|
960
|
+
/* @__PURE__ */ React23.createElement(BorderStyleField, null)
|
|
777
961
|
);
|
|
778
962
|
};
|
|
779
963
|
|
|
780
964
|
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
781
|
-
import * as
|
|
965
|
+
import * as React24 from "react";
|
|
782
966
|
import { EqualUnequalSizesControl as EqualUnequalSizesControl2 } from "@elementor/editor-controls";
|
|
783
967
|
import { borderRadiusPropTypeUtil } from "@elementor/editor-props";
|
|
784
968
|
import {
|
|
@@ -788,58 +972,58 @@ import {
|
|
|
788
972
|
RadiusTopLeftIcon,
|
|
789
973
|
RadiusTopRightIcon
|
|
790
974
|
} from "@elementor/icons";
|
|
791
|
-
import { __ as
|
|
975
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
792
976
|
var corners = [
|
|
793
977
|
{
|
|
794
|
-
label:
|
|
795
|
-
icon: /* @__PURE__ */
|
|
978
|
+
label: __8("Top Left", "elementor"),
|
|
979
|
+
icon: /* @__PURE__ */ React24.createElement(RadiusTopLeftIcon, { fontSize: "tiny" }),
|
|
796
980
|
bind: "top-left"
|
|
797
981
|
},
|
|
798
982
|
{
|
|
799
|
-
label:
|
|
800
|
-
icon: /* @__PURE__ */
|
|
983
|
+
label: __8("Top Right", "elementor"),
|
|
984
|
+
icon: /* @__PURE__ */ React24.createElement(RadiusTopRightIcon, { fontSize: "tiny" }),
|
|
801
985
|
bind: "top-right"
|
|
802
986
|
},
|
|
803
987
|
{
|
|
804
|
-
label:
|
|
805
|
-
icon: /* @__PURE__ */
|
|
988
|
+
label: __8("Bottom Right", "elementor"),
|
|
989
|
+
icon: /* @__PURE__ */ React24.createElement(RadiusBottomRightIcon, { fontSize: "tiny" }),
|
|
806
990
|
bind: "bottom-right"
|
|
807
991
|
},
|
|
808
992
|
{
|
|
809
|
-
label:
|
|
810
|
-
icon: /* @__PURE__ */
|
|
993
|
+
label: __8("Bottom Left", "elementor"),
|
|
994
|
+
icon: /* @__PURE__ */ React24.createElement(RadiusBottomLeftIcon, { fontSize: "tiny" }),
|
|
811
995
|
bind: "bottom-left"
|
|
812
996
|
}
|
|
813
997
|
];
|
|
814
998
|
var BorderRadiusField = () => {
|
|
815
|
-
return /* @__PURE__ */
|
|
999
|
+
return /* @__PURE__ */ React24.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React24.createElement(
|
|
816
1000
|
EqualUnequalSizesControl2,
|
|
817
1001
|
{
|
|
818
1002
|
items: corners,
|
|
819
|
-
label:
|
|
820
|
-
icon: /* @__PURE__ */
|
|
1003
|
+
label: __8("Border Radius", "elementor"),
|
|
1004
|
+
icon: /* @__PURE__ */ React24.createElement(BorderCornersIcon, { fontSize: "tiny" }),
|
|
821
1005
|
multiSizePropTypeUtil: borderRadiusPropTypeUtil
|
|
822
1006
|
}
|
|
823
1007
|
));
|
|
824
1008
|
};
|
|
825
1009
|
|
|
826
1010
|
// src/components/style-sections/border-section/border-section.tsx
|
|
827
|
-
var BorderSection = () => /* @__PURE__ */
|
|
1011
|
+
var BorderSection = () => /* @__PURE__ */ React25.createElement(Stack5, { gap: 1.5 }, /* @__PURE__ */ React25.createElement(BorderRadiusField, null), /* @__PURE__ */ React25.createElement(Divider2, null), /* @__PURE__ */ React25.createElement(BorderField, null));
|
|
828
1012
|
|
|
829
1013
|
// src/components/style-sections/effects-section/effects-section.tsx
|
|
830
|
-
import * as
|
|
1014
|
+
import * as React26 from "react";
|
|
831
1015
|
import { BoxShadowRepeaterControl } from "@elementor/editor-controls";
|
|
832
1016
|
import { Stack as Stack6 } from "@elementor/ui";
|
|
833
1017
|
var EffectsSection = () => {
|
|
834
|
-
return /* @__PURE__ */
|
|
1018
|
+
return /* @__PURE__ */ React26.createElement(Stack6, { gap: 1.5 }, /* @__PURE__ */ React26.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React26.createElement(BoxShadowRepeaterControl, null)));
|
|
835
1019
|
};
|
|
836
1020
|
|
|
837
1021
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
838
|
-
import * as
|
|
1022
|
+
import * as React37 from "react";
|
|
839
1023
|
import { ControlLabel as ControlLabel13 } from "@elementor/editor-controls";
|
|
840
1024
|
import { useParentElement } from "@elementor/editor-elements";
|
|
841
1025
|
import { Divider as Divider3, Stack as Stack12 } from "@elementor/ui";
|
|
842
|
-
import { __ as
|
|
1026
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
843
1027
|
|
|
844
1028
|
// src/hooks/use-computed-style.ts
|
|
845
1029
|
import { __privateUseListenTo as useListenTo, commandEndEvent, windowEvent } from "@elementor/editor-v1-adapters";
|
|
@@ -867,7 +1051,7 @@ function useComputedStyle(elementId) {
|
|
|
867
1051
|
}
|
|
868
1052
|
|
|
869
1053
|
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
870
|
-
import * as
|
|
1054
|
+
import * as React28 from "react";
|
|
871
1055
|
import { ControlLabel as ControlLabel5, ToggleControl } from "@elementor/editor-controls";
|
|
872
1056
|
import {
|
|
873
1057
|
LayoutAlignCenterIcon as CenterIcon,
|
|
@@ -876,7 +1060,7 @@ import {
|
|
|
876
1060
|
LayoutDistributeVerticalIcon as JustifyIcon
|
|
877
1061
|
} from "@elementor/icons";
|
|
878
1062
|
import { DirectionProvider, Grid as Grid3, ThemeProvider, withDirection } from "@elementor/ui";
|
|
879
|
-
import { __ as
|
|
1063
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
880
1064
|
|
|
881
1065
|
// src/hooks/use-direction.ts
|
|
882
1066
|
import { useTheme } from "@elementor/ui";
|
|
@@ -887,8 +1071,8 @@ function useDirection() {
|
|
|
887
1071
|
}
|
|
888
1072
|
|
|
889
1073
|
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
890
|
-
import * as
|
|
891
|
-
import { useRef as
|
|
1074
|
+
import * as React27 from "react";
|
|
1075
|
+
import { useRef as useRef3 } from "react";
|
|
892
1076
|
import { useTheme as useTheme2 } from "@elementor/ui";
|
|
893
1077
|
var CLOCKWISE_ANGLES = {
|
|
894
1078
|
row: 0,
|
|
@@ -903,9 +1087,9 @@ var COUNTER_CLOCKWISE_ANGLES = {
|
|
|
903
1087
|
"column-reverse": -270
|
|
904
1088
|
};
|
|
905
1089
|
var RotatedIcon = ({ icon: Icon, size, isClockwise = true, offset = 0 }) => {
|
|
906
|
-
const rotate =
|
|
1090
|
+
const rotate = useRef3(useGetTargetAngle(isClockwise, offset));
|
|
907
1091
|
rotate.current = useGetTargetAngle(isClockwise, offset, rotate);
|
|
908
|
-
return /* @__PURE__ */
|
|
1092
|
+
return /* @__PURE__ */ React27.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
909
1093
|
};
|
|
910
1094
|
var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
911
1095
|
const [direction] = useStylesField("flex-direction");
|
|
@@ -929,36 +1113,36 @@ var iconProps = {
|
|
|
929
1113
|
var options = [
|
|
930
1114
|
{
|
|
931
1115
|
value: "start",
|
|
932
|
-
label:
|
|
933
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1116
|
+
label: __9("Start", "elementor"),
|
|
1117
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: StartIcon, size, ...iconProps }),
|
|
934
1118
|
showTooltip: true
|
|
935
1119
|
},
|
|
936
1120
|
{
|
|
937
1121
|
value: "center",
|
|
938
|
-
label:
|
|
939
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1122
|
+
label: __9("Center", "elementor"),
|
|
1123
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: CenterIcon, size, ...iconProps }),
|
|
940
1124
|
showTooltip: true
|
|
941
1125
|
},
|
|
942
1126
|
{
|
|
943
1127
|
value: "end",
|
|
944
|
-
label:
|
|
945
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1128
|
+
label: __9("End", "elementor"),
|
|
1129
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: EndIcon, size, ...iconProps }),
|
|
946
1130
|
showTooltip: true
|
|
947
1131
|
},
|
|
948
1132
|
{
|
|
949
1133
|
value: "stretch",
|
|
950
|
-
label:
|
|
951
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1134
|
+
label: __9("Stretch", "elementor"),
|
|
1135
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: JustifyIcon, size, ...iconProps }),
|
|
952
1136
|
showTooltip: true
|
|
953
1137
|
}
|
|
954
1138
|
];
|
|
955
1139
|
var AlignItemsField = () => {
|
|
956
1140
|
const { isSiteRtl } = useDirection();
|
|
957
|
-
return /* @__PURE__ */
|
|
1141
|
+
return /* @__PURE__ */ React28.createElement(DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React28.createElement(ThemeProvider, null, /* @__PURE__ */ React28.createElement(StylesField, { bind: "align-items" }, /* @__PURE__ */ React28.createElement(Grid3, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlLabel5, null, __9("Align items", "elementor"))), /* @__PURE__ */ React28.createElement(Grid3, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React28.createElement(ToggleControl, { options }))))));
|
|
958
1142
|
};
|
|
959
1143
|
|
|
960
1144
|
// src/components/style-sections/layout-section/align-self-child-field.tsx
|
|
961
|
-
import * as
|
|
1145
|
+
import * as React29 from "react";
|
|
962
1146
|
import { ControlLabel as ControlLabel6, ToggleControl as ToggleControl2 } from "@elementor/editor-controls";
|
|
963
1147
|
import {
|
|
964
1148
|
LayoutAlignCenterIcon as CenterIcon2,
|
|
@@ -967,7 +1151,7 @@ import {
|
|
|
967
1151
|
LayoutDistributeVerticalIcon as JustifyIcon2
|
|
968
1152
|
} from "@elementor/icons";
|
|
969
1153
|
import { DirectionProvider as DirectionProvider2, Grid as Grid4, ThemeProvider as ThemeProvider2, withDirection as withDirection2 } from "@elementor/ui";
|
|
970
|
-
import { __ as
|
|
1154
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
971
1155
|
var StartIcon2 = withDirection2(LayoutAlignLeftIcon2);
|
|
972
1156
|
var EndIcon2 = withDirection2(LayoutAlignRightIcon2);
|
|
973
1157
|
var iconProps2 = {
|
|
@@ -977,101 +1161,101 @@ var iconProps2 = {
|
|
|
977
1161
|
var options2 = [
|
|
978
1162
|
{
|
|
979
1163
|
value: "start",
|
|
980
|
-
label:
|
|
981
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1164
|
+
label: __10("Start", "elementor"),
|
|
1165
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon, { icon: StartIcon2, size, ...iconProps2 }),
|
|
982
1166
|
showTooltip: true
|
|
983
1167
|
},
|
|
984
1168
|
{
|
|
985
1169
|
value: "center",
|
|
986
|
-
label:
|
|
987
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1170
|
+
label: __10("Center", "elementor"),
|
|
1171
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon, { icon: CenterIcon2, size, ...iconProps2 }),
|
|
988
1172
|
showTooltip: true
|
|
989
1173
|
},
|
|
990
1174
|
{
|
|
991
1175
|
value: "end",
|
|
992
|
-
label:
|
|
993
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1176
|
+
label: __10("End", "elementor"),
|
|
1177
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon, { icon: EndIcon2, size, ...iconProps2 }),
|
|
994
1178
|
showTooltip: true
|
|
995
1179
|
},
|
|
996
1180
|
{
|
|
997
1181
|
value: "stretch",
|
|
998
|
-
label:
|
|
999
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1182
|
+
label: __10("Stretch", "elementor"),
|
|
1183
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon, { icon: JustifyIcon2, size, ...iconProps2 }),
|
|
1000
1184
|
showTooltip: true
|
|
1001
1185
|
}
|
|
1002
1186
|
];
|
|
1003
1187
|
var AlignSelfChild = () => {
|
|
1004
1188
|
const { isSiteRtl } = useDirection();
|
|
1005
|
-
return /* @__PURE__ */
|
|
1189
|
+
return /* @__PURE__ */ React29.createElement(DirectionProvider2, { rtl: isSiteRtl }, /* @__PURE__ */ React29.createElement(ThemeProvider2, null, /* @__PURE__ */ React29.createElement(StylesField, { bind: "align-self" }, /* @__PURE__ */ React29.createElement(Grid4, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React29.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React29.createElement(ControlLabel6, null, __10("Align self", "elementor"))), /* @__PURE__ */ React29.createElement(Grid4, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React29.createElement(ToggleControl2, { options: options2 }))))));
|
|
1006
1190
|
};
|
|
1007
1191
|
|
|
1008
1192
|
// src/components/style-sections/layout-section/display-field.tsx
|
|
1009
|
-
import * as
|
|
1193
|
+
import * as React30 from "react";
|
|
1010
1194
|
import { ControlLabel as ControlLabel7, ToggleControl as ToggleControl3 } from "@elementor/editor-controls";
|
|
1011
1195
|
import { Stack as Stack7 } from "@elementor/ui";
|
|
1012
|
-
import { __ as
|
|
1196
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
1013
1197
|
var DisplayField = () => {
|
|
1014
1198
|
const options10 = [
|
|
1015
1199
|
{
|
|
1016
1200
|
value: "block",
|
|
1017
|
-
renderContent: () =>
|
|
1018
|
-
label:
|
|
1201
|
+
renderContent: () => __11("Block", "elementor"),
|
|
1202
|
+
label: __11("Block", "elementor")
|
|
1019
1203
|
},
|
|
1020
1204
|
{
|
|
1021
1205
|
value: "flex",
|
|
1022
|
-
renderContent: () =>
|
|
1023
|
-
label:
|
|
1206
|
+
renderContent: () => __11("Flex", "elementor"),
|
|
1207
|
+
label: __11("Flex", "elementor")
|
|
1024
1208
|
}
|
|
1025
1209
|
];
|
|
1026
|
-
return /* @__PURE__ */
|
|
1210
|
+
return /* @__PURE__ */ React30.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React30.createElement(Stack7, { gap: 1 }, /* @__PURE__ */ React30.createElement(ControlLabel7, null, __11("Display", "elementor")), /* @__PURE__ */ React30.createElement(ToggleControl3, { options: options10, fullWidth: true })));
|
|
1027
1211
|
};
|
|
1028
1212
|
|
|
1029
1213
|
// src/components/style-sections/layout-section/flex-direction-field.tsx
|
|
1030
|
-
import * as
|
|
1214
|
+
import * as React31 from "react";
|
|
1031
1215
|
import { ControlLabel as ControlLabel8, ToggleControl as ToggleControl4 } from "@elementor/editor-controls";
|
|
1032
1216
|
import { ArrowDownSmallIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpSmallIcon } from "@elementor/icons";
|
|
1033
1217
|
import { DirectionProvider as DirectionProvider3, Grid as Grid5, ThemeProvider as ThemeProvider3, withDirection as withDirection3 } from "@elementor/ui";
|
|
1034
|
-
import { __ as
|
|
1218
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
1035
1219
|
var options3 = [
|
|
1036
1220
|
{
|
|
1037
1221
|
value: "row",
|
|
1038
|
-
label:
|
|
1222
|
+
label: __12("Row", "elementor"),
|
|
1039
1223
|
renderContent: ({ size }) => {
|
|
1040
1224
|
const StartIcon4 = withDirection3(ArrowRightIcon);
|
|
1041
|
-
return /* @__PURE__ */
|
|
1225
|
+
return /* @__PURE__ */ React31.createElement(StartIcon4, { fontSize: size });
|
|
1042
1226
|
},
|
|
1043
1227
|
showTooltip: true
|
|
1044
1228
|
},
|
|
1045
1229
|
{
|
|
1046
1230
|
value: "column",
|
|
1047
|
-
label:
|
|
1048
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1231
|
+
label: __12("Column", "elementor"),
|
|
1232
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(ArrowDownSmallIcon, { fontSize: size }),
|
|
1049
1233
|
showTooltip: true
|
|
1050
1234
|
},
|
|
1051
1235
|
{
|
|
1052
1236
|
value: "row-reverse",
|
|
1053
|
-
label:
|
|
1237
|
+
label: __12("Reversed row", "elementor"),
|
|
1054
1238
|
renderContent: ({ size }) => {
|
|
1055
1239
|
const EndIcon4 = withDirection3(ArrowLeftIcon);
|
|
1056
|
-
return /* @__PURE__ */
|
|
1240
|
+
return /* @__PURE__ */ React31.createElement(EndIcon4, { fontSize: size });
|
|
1057
1241
|
},
|
|
1058
1242
|
showTooltip: true
|
|
1059
1243
|
},
|
|
1060
1244
|
{
|
|
1061
1245
|
value: "column-reverse",
|
|
1062
|
-
label:
|
|
1063
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1246
|
+
label: __12("Reversed column", "elementor"),
|
|
1247
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(ArrowUpSmallIcon, { fontSize: size }),
|
|
1064
1248
|
showTooltip: true
|
|
1065
1249
|
}
|
|
1066
1250
|
];
|
|
1067
1251
|
var FlexDirectionField = () => {
|
|
1068
1252
|
const { isSiteRtl } = useDirection();
|
|
1069
|
-
return /* @__PURE__ */
|
|
1253
|
+
return /* @__PURE__ */ React31.createElement(DirectionProvider3, { rtl: isSiteRtl }, /* @__PURE__ */ React31.createElement(ThemeProvider3, null, /* @__PURE__ */ React31.createElement(StylesField, { bind: "flex-direction" }, /* @__PURE__ */ React31.createElement(Grid5, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlLabel8, null, __12("Direction", "elementor"))), /* @__PURE__ */ React31.createElement(Grid5, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(ToggleControl4, { options: options3 }))))));
|
|
1070
1254
|
};
|
|
1071
1255
|
|
|
1072
1256
|
// src/components/style-sections/layout-section/flex-order-field.tsx
|
|
1073
|
-
import * as
|
|
1074
|
-
import { useState as
|
|
1257
|
+
import * as React32 from "react";
|
|
1258
|
+
import { useState as useState4 } from "react";
|
|
1075
1259
|
import {
|
|
1076
1260
|
ControlLabel as ControlLabel9,
|
|
1077
1261
|
ControlToggleButtonGroup,
|
|
@@ -1079,7 +1263,7 @@ import {
|
|
|
1079
1263
|
} from "@elementor/editor-controls";
|
|
1080
1264
|
import { ArrowDownSmallIcon as ArrowDownSmallIcon2, ArrowUpSmallIcon as ArrowUpSmallIcon2, PencilIcon } from "@elementor/icons";
|
|
1081
1265
|
import { DirectionProvider as DirectionProvider4, Grid as Grid6, Stack as Stack8, ThemeProvider as ThemeProvider4 } from "@elementor/ui";
|
|
1082
|
-
import { __ as
|
|
1266
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
1083
1267
|
var FIRST_DEFAULT_VALUE = -99999;
|
|
1084
1268
|
var LAST_DEFAULT_VALUE = 99999;
|
|
1085
1269
|
var FIRST = "first";
|
|
@@ -1092,26 +1276,26 @@ var orderValueMap = {
|
|
|
1092
1276
|
var items = [
|
|
1093
1277
|
{
|
|
1094
1278
|
value: FIRST,
|
|
1095
|
-
label:
|
|
1096
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1279
|
+
label: __13("First", "elementor"),
|
|
1280
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(ArrowUpSmallIcon2, { fontSize: size }),
|
|
1097
1281
|
showTooltip: true
|
|
1098
1282
|
},
|
|
1099
1283
|
{
|
|
1100
1284
|
value: LAST,
|
|
1101
|
-
label:
|
|
1102
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1285
|
+
label: __13("Last", "elementor"),
|
|
1286
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(ArrowDownSmallIcon2, { fontSize: size }),
|
|
1103
1287
|
showTooltip: true
|
|
1104
1288
|
},
|
|
1105
1289
|
{
|
|
1106
1290
|
value: CUSTOM,
|
|
1107
|
-
label:
|
|
1108
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1291
|
+
label: __13("Custom", "elementor"),
|
|
1292
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(PencilIcon, { fontSize: size }),
|
|
1109
1293
|
showTooltip: true
|
|
1110
1294
|
}
|
|
1111
1295
|
];
|
|
1112
1296
|
var FlexOrderField = () => {
|
|
1113
1297
|
const { isSiteRtl } = useDirection(), [order, setOrder] = useStylesField("order");
|
|
1114
|
-
const [groupControlValue, setGroupControlValue] =
|
|
1298
|
+
const [groupControlValue, setGroupControlValue] = useState4(getGroupControlValue(order?.value || null));
|
|
1115
1299
|
const handleToggleButtonChange = (group) => {
|
|
1116
1300
|
setGroupControlValue(group);
|
|
1117
1301
|
if (!group || group === CUSTOM) {
|
|
@@ -1120,7 +1304,7 @@ var FlexOrderField = () => {
|
|
|
1120
1304
|
}
|
|
1121
1305
|
setOrder({ $$type: "number", value: orderValueMap[group] });
|
|
1122
1306
|
};
|
|
1123
|
-
return /* @__PURE__ */
|
|
1307
|
+
return /* @__PURE__ */ React32.createElement(DirectionProvider4, { rtl: isSiteRtl }, /* @__PURE__ */ React32.createElement(ThemeProvider4, null, /* @__PURE__ */ React32.createElement(Stack8, { gap: 2 }, /* @__PURE__ */ React32.createElement(Grid6, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel9, null, __13("Order", "elementor"))), /* @__PURE__ */ React32.createElement(Grid6, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(
|
|
1124
1308
|
ControlToggleButtonGroup,
|
|
1125
1309
|
{
|
|
1126
1310
|
items,
|
|
@@ -1128,7 +1312,7 @@ var FlexOrderField = () => {
|
|
|
1128
1312
|
onChange: handleToggleButtonChange,
|
|
1129
1313
|
exclusive: true
|
|
1130
1314
|
}
|
|
1131
|
-
))), CUSTOM === groupControlValue && /* @__PURE__ */
|
|
1315
|
+
))), CUSTOM === groupControlValue && /* @__PURE__ */ React32.createElement(StylesField, { bind: "order" }, /* @__PURE__ */ React32.createElement(Grid6, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel9, null, __13("Custom order", "elementor"))), /* @__PURE__ */ React32.createElement(Grid6, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(
|
|
1132
1316
|
NumberControl,
|
|
1133
1317
|
{
|
|
1134
1318
|
min: FIRST_DEFAULT_VALUE + 1,
|
|
@@ -1148,7 +1332,7 @@ var getGroupControlValue = (order) => {
|
|
|
1148
1332
|
};
|
|
1149
1333
|
|
|
1150
1334
|
// src/components/style-sections/layout-section/flex-size-field.tsx
|
|
1151
|
-
import * as
|
|
1335
|
+
import * as React33 from "react";
|
|
1152
1336
|
import {
|
|
1153
1337
|
ControlLabel as ControlLabel10,
|
|
1154
1338
|
ControlToggleButtonGroup as ControlToggleButtonGroup2,
|
|
@@ -1157,32 +1341,32 @@ import {
|
|
|
1157
1341
|
} from "@elementor/editor-controls";
|
|
1158
1342
|
import { ExpandIcon, PencilIcon as PencilIcon2, ShrinkIcon } from "@elementor/icons";
|
|
1159
1343
|
import { DirectionProvider as DirectionProvider5, Grid as Grid7, Stack as Stack9, ThemeProvider as ThemeProvider5 } from "@elementor/ui";
|
|
1160
|
-
import { __ as
|
|
1344
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
1161
1345
|
var DEFAULT = 1;
|
|
1162
1346
|
var items2 = [
|
|
1163
1347
|
{
|
|
1164
1348
|
value: "flex-grow",
|
|
1165
|
-
label:
|
|
1166
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1349
|
+
label: __14("Grow", "elementor"),
|
|
1350
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(ExpandIcon, { fontSize: size }),
|
|
1167
1351
|
showTooltip: true
|
|
1168
1352
|
},
|
|
1169
1353
|
{
|
|
1170
1354
|
value: "flex-shrink",
|
|
1171
|
-
label:
|
|
1172
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1355
|
+
label: __14("Shrink", "elementor"),
|
|
1356
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(ShrinkIcon, { fontSize: size }),
|
|
1173
1357
|
showTooltip: true
|
|
1174
1358
|
},
|
|
1175
1359
|
{
|
|
1176
1360
|
value: "custom",
|
|
1177
|
-
label:
|
|
1178
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1361
|
+
label: __14("Custom", "elementor"),
|
|
1362
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(PencilIcon2, { fontSize: size }),
|
|
1179
1363
|
showTooltip: true
|
|
1180
1364
|
}
|
|
1181
1365
|
];
|
|
1182
1366
|
var FlexSizeField = () => {
|
|
1183
1367
|
const { isSiteRtl } = useDirection(), [growField, setGrowField] = useStylesField("flex-grow"), [shrinkField, setShrinkField] = useStylesField("flex-shrink"), [basisField, setBasisField] = useStylesField("flex-basis");
|
|
1184
1368
|
const grow = growField?.value || null, shrink = shrinkField?.value || null, basis = basisField?.value || null;
|
|
1185
|
-
const currentGroup =
|
|
1369
|
+
const currentGroup = React33.useMemo(() => getActiveGroup({ grow, shrink, basis }), [grow, shrink, basis]), [activeGroup, setActiveGroup] = React33.useState(currentGroup);
|
|
1186
1370
|
const onChangeGroup = (group = null) => {
|
|
1187
1371
|
setActiveGroup(group);
|
|
1188
1372
|
setBasisField(null);
|
|
@@ -1199,7 +1383,7 @@ var FlexSizeField = () => {
|
|
|
1199
1383
|
setGrowField(null);
|
|
1200
1384
|
setShrinkField({ $$type: "number", value: DEFAULT });
|
|
1201
1385
|
};
|
|
1202
|
-
return /* @__PURE__ */
|
|
1386
|
+
return /* @__PURE__ */ React33.createElement(DirectionProvider5, { rtl: isSiteRtl }, /* @__PURE__ */ React33.createElement(ThemeProvider5, null, /* @__PURE__ */ React33.createElement(Stack9, { gap: 2 }, /* @__PURE__ */ React33.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(ControlLabel10, null, __14("Size", "elementor"))), /* @__PURE__ */ React33.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React33.createElement(
|
|
1203
1387
|
ControlToggleButtonGroup2,
|
|
1204
1388
|
{
|
|
1205
1389
|
value: activeGroup,
|
|
@@ -1207,9 +1391,9 @@ var FlexSizeField = () => {
|
|
|
1207
1391
|
items: items2,
|
|
1208
1392
|
exclusive: true
|
|
1209
1393
|
}
|
|
1210
|
-
))), "custom" === activeGroup && /* @__PURE__ */
|
|
1394
|
+
))), "custom" === activeGroup && /* @__PURE__ */ React33.createElement(FlexCustomField, null))));
|
|
1211
1395
|
};
|
|
1212
|
-
var FlexCustomField = () => /* @__PURE__ */
|
|
1396
|
+
var FlexCustomField = () => /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(StylesField, { bind: "flex-grow" }, /* @__PURE__ */ React33.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(ControlLabel10, null, __14("Grow", "elementor"))), /* @__PURE__ */ React33.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React33.createElement(NumberControl2, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React33.createElement(StylesField, { bind: "flex-shrink" }, /* @__PURE__ */ React33.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(ControlLabel10, null, __14("Shrink", "elementor"))), /* @__PURE__ */ React33.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React33.createElement(NumberControl2, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React33.createElement(StylesField, { bind: "flex-basis" }, /* @__PURE__ */ React33.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(ControlLabel10, null, __14("Basis", "elementor"))), /* @__PURE__ */ React33.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React33.createElement(SizeControl2, null)))));
|
|
1213
1397
|
var getActiveGroup = ({
|
|
1214
1398
|
grow,
|
|
1215
1399
|
shrink,
|
|
@@ -1231,16 +1415,16 @@ var getActiveGroup = ({
|
|
|
1231
1415
|
};
|
|
1232
1416
|
|
|
1233
1417
|
// src/components/style-sections/layout-section/gap-control-field.tsx
|
|
1234
|
-
import * as
|
|
1418
|
+
import * as React34 from "react";
|
|
1235
1419
|
import { GapControl } from "@elementor/editor-controls";
|
|
1236
1420
|
import { Stack as Stack10 } from "@elementor/ui";
|
|
1237
|
-
import { __ as
|
|
1421
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
1238
1422
|
var GapControlField = () => {
|
|
1239
|
-
return /* @__PURE__ */
|
|
1423
|
+
return /* @__PURE__ */ React34.createElement(Stack10, { gap: 1 }, /* @__PURE__ */ React34.createElement(StylesField, { bind: "gap" }, /* @__PURE__ */ React34.createElement(GapControl, { label: __15("Gaps", "elementor") })));
|
|
1240
1424
|
};
|
|
1241
1425
|
|
|
1242
1426
|
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
1243
|
-
import * as
|
|
1427
|
+
import * as React35 from "react";
|
|
1244
1428
|
import { ControlLabel as ControlLabel11, ToggleControl as ToggleControl5 } from "@elementor/editor-controls";
|
|
1245
1429
|
import {
|
|
1246
1430
|
JustifyBottomIcon,
|
|
@@ -1251,7 +1435,7 @@ import {
|
|
|
1251
1435
|
JustifyTopIcon
|
|
1252
1436
|
} from "@elementor/icons";
|
|
1253
1437
|
import { DirectionProvider as DirectionProvider6, Stack as Stack11, ThemeProvider as ThemeProvider6, withDirection as withDirection4 } from "@elementor/ui";
|
|
1254
|
-
import { __ as
|
|
1438
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
1255
1439
|
var StartIcon3 = withDirection4(JustifyTopIcon);
|
|
1256
1440
|
var EndIcon3 = withDirection4(JustifyBottomIcon);
|
|
1257
1441
|
var iconProps3 = {
|
|
@@ -1261,75 +1445,75 @@ var iconProps3 = {
|
|
|
1261
1445
|
var options4 = [
|
|
1262
1446
|
{
|
|
1263
1447
|
value: "start",
|
|
1264
|
-
label:
|
|
1265
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1448
|
+
label: __16("Start", "elementor"),
|
|
1449
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(RotatedIcon, { icon: StartIcon3, size, ...iconProps3 }),
|
|
1266
1450
|
showTooltip: true
|
|
1267
1451
|
},
|
|
1268
1452
|
{
|
|
1269
1453
|
value: "center",
|
|
1270
|
-
label:
|
|
1271
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1454
|
+
label: __16("Center", "elementor"),
|
|
1455
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(RotatedIcon, { icon: CenterIcon3, size, ...iconProps3 }),
|
|
1272
1456
|
showTooltip: true
|
|
1273
1457
|
},
|
|
1274
1458
|
{
|
|
1275
1459
|
value: "end",
|
|
1276
|
-
label:
|
|
1277
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1460
|
+
label: __16("End", "elementor"),
|
|
1461
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(RotatedIcon, { icon: EndIcon3, size, ...iconProps3 }),
|
|
1278
1462
|
showTooltip: true
|
|
1279
1463
|
},
|
|
1280
1464
|
{
|
|
1281
1465
|
value: "space-between",
|
|
1282
|
-
label:
|
|
1283
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1466
|
+
label: __16("Space between", "elementor"),
|
|
1467
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(RotatedIcon, { icon: BetweenIcon, size, ...iconProps3 }),
|
|
1284
1468
|
showTooltip: true
|
|
1285
1469
|
},
|
|
1286
1470
|
{
|
|
1287
1471
|
value: "space-around",
|
|
1288
|
-
label:
|
|
1289
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1472
|
+
label: __16("Space around", "elementor"),
|
|
1473
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(RotatedIcon, { icon: AroundIcon, size, ...iconProps3 }),
|
|
1290
1474
|
showTooltip: true
|
|
1291
1475
|
},
|
|
1292
1476
|
{
|
|
1293
1477
|
value: "space-evenly",
|
|
1294
|
-
label:
|
|
1295
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1478
|
+
label: __16("Space evenly", "elementor"),
|
|
1479
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(RotatedIcon, { icon: EvenlyIcon, size, ...iconProps3 }),
|
|
1296
1480
|
showTooltip: true
|
|
1297
1481
|
}
|
|
1298
1482
|
];
|
|
1299
1483
|
var JustifyContentField = () => {
|
|
1300
1484
|
const { isSiteRtl } = useDirection();
|
|
1301
|
-
return /* @__PURE__ */
|
|
1485
|
+
return /* @__PURE__ */ React35.createElement(DirectionProvider6, { rtl: isSiteRtl }, /* @__PURE__ */ React35.createElement(ThemeProvider6, null, /* @__PURE__ */ React35.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React35.createElement(Stack11, { gap: 1 }, /* @__PURE__ */ React35.createElement(ControlLabel11, null, __16("Justify content", "elementor")), /* @__PURE__ */ React35.createElement(ToggleControl5, { options: options4, fullWidth: true })))));
|
|
1302
1486
|
};
|
|
1303
1487
|
|
|
1304
1488
|
// src/components/style-sections/layout-section/wrap-field.tsx
|
|
1305
|
-
import * as
|
|
1489
|
+
import * as React36 from "react";
|
|
1306
1490
|
import { ControlLabel as ControlLabel12, ToggleControl as ToggleControl6 } from "@elementor/editor-controls";
|
|
1307
1491
|
import { ArrowBackIcon, ArrowForwardIcon, ArrowRightIcon as ArrowRightIcon2 } from "@elementor/icons";
|
|
1308
1492
|
import { DirectionProvider as DirectionProvider7, Grid as Grid8, ThemeProvider as ThemeProvider7 } from "@elementor/ui";
|
|
1309
|
-
import { __ as
|
|
1493
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
1310
1494
|
var options5 = [
|
|
1311
1495
|
{
|
|
1312
1496
|
value: "nowrap",
|
|
1313
|
-
label:
|
|
1314
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1497
|
+
label: __17("No wrap", "elementor"),
|
|
1498
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(ArrowRightIcon2, { fontSize: size }),
|
|
1315
1499
|
showTooltip: true
|
|
1316
1500
|
},
|
|
1317
1501
|
{
|
|
1318
1502
|
value: "wrap",
|
|
1319
|
-
label:
|
|
1320
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1503
|
+
label: __17("Wrap", "elementor"),
|
|
1504
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(ArrowBackIcon, { fontSize: size }),
|
|
1321
1505
|
showTooltip: true
|
|
1322
1506
|
},
|
|
1323
1507
|
{
|
|
1324
1508
|
value: "wrap-reverse",
|
|
1325
|
-
label:
|
|
1326
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1509
|
+
label: __17("Reversed wrap", "elementor"),
|
|
1510
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(ArrowForwardIcon, { fontSize: size }),
|
|
1327
1511
|
showTooltip: true
|
|
1328
1512
|
}
|
|
1329
1513
|
];
|
|
1330
1514
|
var WrapField = () => {
|
|
1331
1515
|
const { isSiteRtl } = useDirection();
|
|
1332
|
-
return /* @__PURE__ */
|
|
1516
|
+
return /* @__PURE__ */ React36.createElement(DirectionProvider7, { rtl: isSiteRtl }, /* @__PURE__ */ React36.createElement(ThemeProvider7, null, /* @__PURE__ */ React36.createElement(StylesField, { bind: "flex-wrap" }, /* @__PURE__ */ React36.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel12, null, __17("Wrap", "elementor"))), /* @__PURE__ */ React36.createElement(Grid8, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React36.createElement(ToggleControl6, { options: options5 }))))));
|
|
1333
1517
|
};
|
|
1334
1518
|
|
|
1335
1519
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
@@ -1338,21 +1522,21 @@ var LayoutSection = () => {
|
|
|
1338
1522
|
const { element } = useElement();
|
|
1339
1523
|
const parent = useParentElement(element.id);
|
|
1340
1524
|
const parentStyle = useComputedStyle(parent?.id || null);
|
|
1341
|
-
return /* @__PURE__ */
|
|
1525
|
+
return /* @__PURE__ */ React37.createElement(Stack12, { gap: 2 }, /* @__PURE__ */ React37.createElement(DisplayField, null), "flex" === display?.value && /* @__PURE__ */ React37.createElement(FlexFields, null), "flex" === parentStyle?.display && /* @__PURE__ */ React37.createElement(FlexChildFields, null));
|
|
1342
1526
|
};
|
|
1343
|
-
var FlexFields = () => /* @__PURE__ */
|
|
1344
|
-
var FlexChildFields = () => /* @__PURE__ */
|
|
1527
|
+
var FlexFields = () => /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(FlexDirectionField, null), /* @__PURE__ */ React37.createElement(JustifyContentField, null), /* @__PURE__ */ React37.createElement(AlignItemsField, null), /* @__PURE__ */ React37.createElement(Divider3, null), /* @__PURE__ */ React37.createElement(GapControlField, null), /* @__PURE__ */ React37.createElement(WrapField, null));
|
|
1528
|
+
var FlexChildFields = () => /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(Divider3, null), /* @__PURE__ */ React37.createElement(ControlLabel13, null, __18("Flex child", "elementor")), /* @__PURE__ */ React37.createElement(AlignSelfChild, null), /* @__PURE__ */ React37.createElement(FlexOrderField, null), /* @__PURE__ */ React37.createElement(FlexSizeField, null));
|
|
1345
1529
|
|
|
1346
1530
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1347
|
-
import * as
|
|
1531
|
+
import * as React41 from "react";
|
|
1348
1532
|
import { Stack as Stack14 } from "@elementor/ui";
|
|
1349
1533
|
|
|
1350
1534
|
// src/hooks/use-session-storage.ts
|
|
1351
|
-
import { useEffect as useEffect2, useState as
|
|
1535
|
+
import { useEffect as useEffect2, useState as useState6 } from "react";
|
|
1352
1536
|
import { getSessionStorageItem, removeSessionStorageItem, setSessionStorageItem } from "@elementor/utils";
|
|
1353
1537
|
var useSessionStorage = (key) => {
|
|
1354
1538
|
const prefixedKey = `elementor/${key}`;
|
|
1355
|
-
const [value, setValue] =
|
|
1539
|
+
const [value, setValue] = useState6();
|
|
1356
1540
|
useEffect2(() => {
|
|
1357
1541
|
return subscribeToSessionStorage(prefixedKey, (newValue) => {
|
|
1358
1542
|
setValue(newValue ?? null);
|
|
@@ -1385,46 +1569,47 @@ var subscribeToSessionStorage = (key, subscriber) => {
|
|
|
1385
1569
|
};
|
|
1386
1570
|
|
|
1387
1571
|
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
1388
|
-
import * as
|
|
1572
|
+
import * as React38 from "react";
|
|
1389
1573
|
import { ControlLabel as ControlLabel14, SizeControl as SizeControl3 } from "@elementor/editor-controls";
|
|
1390
1574
|
import { SideBottomIcon as SideBottomIcon2, SideLeftIcon as SideLeftIcon2, SideRightIcon as SideRightIcon2, SideTopIcon as SideTopIcon2 } from "@elementor/icons";
|
|
1391
1575
|
import { Grid as Grid9, Stack as Stack13 } from "@elementor/ui";
|
|
1392
|
-
import { __ as
|
|
1576
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
1393
1577
|
var sideIcons = {
|
|
1394
|
-
left: /* @__PURE__ */
|
|
1395
|
-
right: /* @__PURE__ */
|
|
1396
|
-
top: /* @__PURE__ */
|
|
1397
|
-
bottom: /* @__PURE__ */
|
|
1578
|
+
left: /* @__PURE__ */ React38.createElement(SideLeftIcon2, { fontSize: "tiny" }),
|
|
1579
|
+
right: /* @__PURE__ */ React38.createElement(SideRightIcon2, { fontSize: "tiny" }),
|
|
1580
|
+
top: /* @__PURE__ */ React38.createElement(SideTopIcon2, { fontSize: "tiny" }),
|
|
1581
|
+
bottom: /* @__PURE__ */ React38.createElement(SideBottomIcon2, { fontSize: "tiny" })
|
|
1398
1582
|
};
|
|
1399
1583
|
var DimensionsField = () => {
|
|
1400
|
-
return /* @__PURE__ */
|
|
1584
|
+
return /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement(Stack13, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React38.createElement(DimensionField, { side: "top", label: __19("Top", "elementor") }), /* @__PURE__ */ React38.createElement(DimensionField, { side: "right", label: __19("Right", "elementor") })), /* @__PURE__ */ React38.createElement(Stack13, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React38.createElement(DimensionField, { side: "bottom", label: __19("Bottom", "elementor") }), /* @__PURE__ */ React38.createElement(DimensionField, { side: "left", label: __19("Left", "elementor") })));
|
|
1401
1585
|
};
|
|
1402
1586
|
var DimensionField = ({ side, label }) => {
|
|
1403
|
-
return /* @__PURE__ */
|
|
1587
|
+
return /* @__PURE__ */ React38.createElement(Grid9, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React38.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(ControlLabel14, null, label)), /* @__PURE__ */ React38.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(StylesField, { bind: side }, /* @__PURE__ */ React38.createElement(SizeControl3, { startIcon: sideIcons[side] }))));
|
|
1404
1588
|
};
|
|
1405
1589
|
|
|
1406
1590
|
// src/components/style-sections/position-section/position-field.tsx
|
|
1407
|
-
import * as
|
|
1591
|
+
import * as React39 from "react";
|
|
1408
1592
|
import { ControlLabel as ControlLabel15, SelectControl as SelectControl3 } from "@elementor/editor-controls";
|
|
1409
1593
|
import { Grid as Grid10 } from "@elementor/ui";
|
|
1410
|
-
import { __ as
|
|
1594
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
1411
1595
|
var positionOptions = [
|
|
1412
|
-
{ label:
|
|
1413
|
-
{ label:
|
|
1414
|
-
{ label:
|
|
1415
|
-
{ label:
|
|
1596
|
+
{ label: __20("Static", "elementor"), value: "static" },
|
|
1597
|
+
{ label: __20("Relative", "elementor"), value: "relative" },
|
|
1598
|
+
{ label: __20("Absolute", "elementor"), value: "absolute" },
|
|
1599
|
+
{ label: __20("Fixed", "elementor"), value: "fixed" },
|
|
1600
|
+
{ label: __20("Sticky", "elementor"), value: "sticky" }
|
|
1416
1601
|
];
|
|
1417
1602
|
var PositionField = ({ onChange }) => {
|
|
1418
|
-
return /* @__PURE__ */
|
|
1603
|
+
return /* @__PURE__ */ React39.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React39.createElement(Grid10, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel15, null, __20("Position", "elementor"))), /* @__PURE__ */ React39.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(SelectControl3, { options: positionOptions, onChange }))));
|
|
1419
1604
|
};
|
|
1420
1605
|
|
|
1421
1606
|
// src/components/style-sections/position-section/z-index-field.tsx
|
|
1422
|
-
import * as
|
|
1607
|
+
import * as React40 from "react";
|
|
1423
1608
|
import { ControlLabel as ControlLabel16, NumberControl as NumberControl3 } from "@elementor/editor-controls";
|
|
1424
1609
|
import { Grid as Grid11 } from "@elementor/ui";
|
|
1425
|
-
import { __ as
|
|
1610
|
+
import { __ as __21 } from "@wordpress/i18n";
|
|
1426
1611
|
var ZIndexField = () => {
|
|
1427
|
-
return /* @__PURE__ */
|
|
1612
|
+
return /* @__PURE__ */ React40.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React40.createElement(Grid11, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlLabel16, null, __21("Z-Index", "elementor"))), /* @__PURE__ */ React40.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(NumberControl3, null))));
|
|
1428
1613
|
};
|
|
1429
1614
|
|
|
1430
1615
|
// src/components/style-sections/position-section/position-section.tsx
|
|
@@ -1456,7 +1641,7 @@ var PositionSection = () => {
|
|
|
1456
1641
|
}
|
|
1457
1642
|
};
|
|
1458
1643
|
const isNotStatic = positionValue && positionValue?.value !== "static";
|
|
1459
|
-
return /* @__PURE__ */
|
|
1644
|
+
return /* @__PURE__ */ React41.createElement(Stack14, { gap: 1.5 }, /* @__PURE__ */ React41.createElement(PositionField, { onChange: onPositionChange }), isNotStatic ? /* @__PURE__ */ React41.createElement(React41.Fragment, null, /* @__PURE__ */ React41.createElement(DimensionsField, null), /* @__PURE__ */ React41.createElement(ZIndexField, null)) : null);
|
|
1460
1645
|
};
|
|
1461
1646
|
var usePersistDimensions = () => {
|
|
1462
1647
|
const { id: styleDefID, meta } = useStyle();
|
|
@@ -1466,73 +1651,73 @@ var usePersistDimensions = () => {
|
|
|
1466
1651
|
};
|
|
1467
1652
|
|
|
1468
1653
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1469
|
-
import * as
|
|
1654
|
+
import * as React43 from "react";
|
|
1470
1655
|
import { ControlLabel as ControlLabel18, SizeControl as SizeControl4 } from "@elementor/editor-controls";
|
|
1471
1656
|
import { Divider as Divider4, Grid as Grid13, Stack as Stack15 } from "@elementor/ui";
|
|
1472
|
-
import { __ as
|
|
1657
|
+
import { __ as __23 } from "@wordpress/i18n";
|
|
1473
1658
|
|
|
1474
1659
|
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1475
|
-
import * as
|
|
1660
|
+
import * as React42 from "react";
|
|
1476
1661
|
import { ControlLabel as ControlLabel17, ToggleControl as ToggleControl7 } from "@elementor/editor-controls";
|
|
1477
1662
|
import { ExpandBottomIcon, EyeIcon, EyeOffIcon } from "@elementor/icons";
|
|
1478
1663
|
import { Grid as Grid12 } from "@elementor/ui";
|
|
1479
|
-
import { __ as
|
|
1664
|
+
import { __ as __22 } from "@wordpress/i18n";
|
|
1480
1665
|
var options6 = [
|
|
1481
1666
|
{
|
|
1482
1667
|
value: "visible",
|
|
1483
|
-
label:
|
|
1484
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1668
|
+
label: __22("Visible", "elementor"),
|
|
1669
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(EyeIcon, { fontSize: size }),
|
|
1485
1670
|
showTooltip: true
|
|
1486
1671
|
},
|
|
1487
1672
|
{
|
|
1488
1673
|
value: "hidden",
|
|
1489
|
-
label:
|
|
1490
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1674
|
+
label: __22("Hidden", "elementor"),
|
|
1675
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(EyeOffIcon, { fontSize: size }),
|
|
1491
1676
|
showTooltip: true
|
|
1492
1677
|
},
|
|
1493
1678
|
{
|
|
1494
1679
|
value: "auto",
|
|
1495
|
-
label:
|
|
1496
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1680
|
+
label: __22("Auto", "elementor"),
|
|
1681
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(ExpandBottomIcon, { fontSize: size }),
|
|
1497
1682
|
showTooltip: true
|
|
1498
1683
|
}
|
|
1499
1684
|
];
|
|
1500
1685
|
var OverflowField = () => {
|
|
1501
|
-
return /* @__PURE__ */
|
|
1686
|
+
return /* @__PURE__ */ React42.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React42.createElement(Grid12, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(ControlLabel17, null, __22("Overflow", "elementor"))), /* @__PURE__ */ React42.createElement(Grid12, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React42.createElement(ToggleControl7, { options: options6 }))));
|
|
1502
1687
|
};
|
|
1503
1688
|
|
|
1504
1689
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1505
1690
|
var SizeSection = () => {
|
|
1506
|
-
return /* @__PURE__ */
|
|
1691
|
+
return /* @__PURE__ */ React43.createElement(Stack15, { gap: 1.5 }, /* @__PURE__ */ React43.createElement(Grid13, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React43.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(SizeField, { bind: "width", label: __23("Width", "elementor") })), /* @__PURE__ */ React43.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(SizeField, { bind: "height", label: __23("Height", "elementor") }))), /* @__PURE__ */ React43.createElement(Grid13, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React43.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(SizeField, { bind: "min-width", label: __23("Min. Width", "elementor") })), /* @__PURE__ */ React43.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(SizeField, { bind: "min-height", label: __23("Min. Height", "elementor") }))), /* @__PURE__ */ React43.createElement(Grid13, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React43.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(SizeField, { bind: "max-width", label: __23("Max. Width", "elementor") })), /* @__PURE__ */ React43.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(SizeField, { bind: "max-height", label: __23("Max. Height", "elementor") }))), /* @__PURE__ */ React43.createElement(Divider4, null), /* @__PURE__ */ React43.createElement(Stack15, null, /* @__PURE__ */ React43.createElement(OverflowField, null)));
|
|
1507
1692
|
};
|
|
1508
1693
|
var SizeField = ({ label, bind }) => {
|
|
1509
|
-
return /* @__PURE__ */
|
|
1694
|
+
return /* @__PURE__ */ React43.createElement(StylesField, { bind }, /* @__PURE__ */ React43.createElement(Grid13, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React43.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(ControlLabel18, null, label)), /* @__PURE__ */ React43.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(SizeControl4, null))));
|
|
1510
1695
|
};
|
|
1511
1696
|
|
|
1512
1697
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1513
|
-
import * as
|
|
1698
|
+
import * as React44 from "react";
|
|
1514
1699
|
import { LinkedDimensionsControl } from "@elementor/editor-controls";
|
|
1515
1700
|
import { Divider as Divider5, Stack as Stack16 } from "@elementor/ui";
|
|
1516
|
-
import { __ as
|
|
1701
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
1517
1702
|
var SpacingSection = () => {
|
|
1518
|
-
return /* @__PURE__ */
|
|
1703
|
+
return /* @__PURE__ */ React44.createElement(Stack16, { gap: 1.5 }, /* @__PURE__ */ React44.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React44.createElement(LinkedDimensionsControl, { label: __24("Padding", "elementor") })), /* @__PURE__ */ React44.createElement(Divider5, null), /* @__PURE__ */ React44.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React44.createElement(LinkedDimensionsControl, { label: __24("Margin", "elementor") })));
|
|
1519
1704
|
};
|
|
1520
1705
|
|
|
1521
1706
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1522
|
-
import * as
|
|
1707
|
+
import * as React58 from "react";
|
|
1523
1708
|
import { Divider as Divider6, Stack as Stack18 } from "@elementor/ui";
|
|
1524
1709
|
|
|
1525
1710
|
// src/components/collapsible-content.tsx
|
|
1526
|
-
import * as
|
|
1527
|
-
import { useState as
|
|
1711
|
+
import * as React45 from "react";
|
|
1712
|
+
import { useState as useState7 } from "react";
|
|
1528
1713
|
import { Button, Collapse as Collapse3, Stack as Stack17 } from "@elementor/ui";
|
|
1529
|
-
import { __ as
|
|
1714
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
1530
1715
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
1531
|
-
const [open, setOpen] =
|
|
1716
|
+
const [open, setOpen] = useState7(defaultOpen);
|
|
1532
1717
|
const handleToggle = () => {
|
|
1533
1718
|
setOpen((prevOpen) => !prevOpen);
|
|
1534
1719
|
};
|
|
1535
|
-
return /* @__PURE__ */
|
|
1720
|
+
return /* @__PURE__ */ React45.createElement(Stack17, { sx: { py: 0.5 } }, /* @__PURE__ */ React45.createElement(
|
|
1536
1721
|
Button,
|
|
1537
1722
|
{
|
|
1538
1723
|
fullWidth: true,
|
|
@@ -1540,17 +1725,17 @@ var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
|
1540
1725
|
color: "secondary",
|
|
1541
1726
|
variant: "outlined",
|
|
1542
1727
|
onClick: handleToggle,
|
|
1543
|
-
endIcon: /* @__PURE__ */
|
|
1728
|
+
endIcon: /* @__PURE__ */ React45.createElement(CollapseIcon, { open })
|
|
1544
1729
|
},
|
|
1545
|
-
open ?
|
|
1546
|
-
), /* @__PURE__ */
|
|
1730
|
+
open ? __25("Show less", "elementor") : __25("Show more", "elementor")
|
|
1731
|
+
), /* @__PURE__ */ React45.createElement(Collapse3, { in: open, timeout: "auto", unmountOnExit: true }, children));
|
|
1547
1732
|
};
|
|
1548
1733
|
|
|
1549
1734
|
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1550
|
-
import * as
|
|
1735
|
+
import * as React46 from "react";
|
|
1551
1736
|
import { ControlLabel as ControlLabel19, FontFamilyControl } from "@elementor/editor-controls";
|
|
1552
1737
|
import { Grid as Grid14 } from "@elementor/ui";
|
|
1553
|
-
import { __ as
|
|
1738
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
1554
1739
|
|
|
1555
1740
|
// src/sync/get-elementor-config.ts
|
|
1556
1741
|
var getElementorConfig = () => {
|
|
@@ -1564,7 +1749,7 @@ var FontFamilyField = () => {
|
|
|
1564
1749
|
if (!fontFamilies) {
|
|
1565
1750
|
return null;
|
|
1566
1751
|
}
|
|
1567
|
-
return /* @__PURE__ */
|
|
1752
|
+
return /* @__PURE__ */ React46.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React46.createElement(Grid14, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlLabel19, null, __26("Font Family", "elementor"))), /* @__PURE__ */ React46.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(FontFamilyControl, { fontFamilies }))));
|
|
1568
1753
|
};
|
|
1569
1754
|
var getFontFamilies = () => {
|
|
1570
1755
|
const { controls } = getElementorConfig();
|
|
@@ -1576,115 +1761,115 @@ var getFontFamilies = () => {
|
|
|
1576
1761
|
};
|
|
1577
1762
|
|
|
1578
1763
|
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1579
|
-
import * as
|
|
1764
|
+
import * as React47 from "react";
|
|
1580
1765
|
import { ControlLabel as ControlLabel20, SizeControl as SizeControl5 } from "@elementor/editor-controls";
|
|
1581
1766
|
import { Grid as Grid15 } from "@elementor/ui";
|
|
1582
|
-
import { __ as
|
|
1767
|
+
import { __ as __27 } from "@wordpress/i18n";
|
|
1583
1768
|
var FontSizeField = () => {
|
|
1584
|
-
return /* @__PURE__ */
|
|
1769
|
+
return /* @__PURE__ */ React47.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React47.createElement(Grid15, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React47.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(ControlLabel20, null, __27("Font Size", "elementor"))), /* @__PURE__ */ React47.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(SizeControl5, null))));
|
|
1585
1770
|
};
|
|
1586
1771
|
|
|
1587
1772
|
// src/components/style-sections/typography-section/font-weight-field.tsx
|
|
1588
|
-
import * as
|
|
1773
|
+
import * as React48 from "react";
|
|
1589
1774
|
import { ControlLabel as ControlLabel21, SelectControl as SelectControl4 } from "@elementor/editor-controls";
|
|
1590
1775
|
import { Grid as Grid16 } from "@elementor/ui";
|
|
1591
|
-
import { __ as
|
|
1776
|
+
import { __ as __28 } from "@wordpress/i18n";
|
|
1592
1777
|
var fontWeightOptions = [
|
|
1593
|
-
{ label:
|
|
1594
|
-
{ label:
|
|
1595
|
-
{ label:
|
|
1596
|
-
{ label:
|
|
1597
|
-
{ label:
|
|
1778
|
+
{ label: __28("Light - 400", "elementor"), value: "400" },
|
|
1779
|
+
{ label: __28("Regular - 500", "elementor"), value: "500" },
|
|
1780
|
+
{ label: __28("Semi Bold - 600", "elementor"), value: "600" },
|
|
1781
|
+
{ label: __28("Bold - 700", "elementor"), value: "700" },
|
|
1782
|
+
{ label: __28("Black - 900", "elementor"), value: "900" }
|
|
1598
1783
|
];
|
|
1599
1784
|
var FontWeightField = () => {
|
|
1600
|
-
return /* @__PURE__ */
|
|
1785
|
+
return /* @__PURE__ */ React48.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React48.createElement(Grid16, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React48.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(ControlLabel21, null, __28("Font Weight", "elementor"))), /* @__PURE__ */ React48.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(SelectControl4, { options: fontWeightOptions }))));
|
|
1601
1786
|
};
|
|
1602
1787
|
|
|
1603
1788
|
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
1604
|
-
import * as
|
|
1789
|
+
import * as React49 from "react";
|
|
1605
1790
|
import { ControlLabel as ControlLabel22, SizeControl as SizeControl6 } from "@elementor/editor-controls";
|
|
1606
1791
|
import { Grid as Grid17 } from "@elementor/ui";
|
|
1607
|
-
import { __ as
|
|
1792
|
+
import { __ as __29 } from "@wordpress/i18n";
|
|
1608
1793
|
var LetterSpacingField = () => {
|
|
1609
|
-
return /* @__PURE__ */
|
|
1794
|
+
return /* @__PURE__ */ React49.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React49.createElement(Grid17, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React49.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(ControlLabel22, null, __29("Letter Spacing", "elementor"))), /* @__PURE__ */ React49.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(SizeControl6, null))));
|
|
1610
1795
|
};
|
|
1611
1796
|
|
|
1612
1797
|
// src/components/style-sections/typography-section/line-height-field.tsx
|
|
1613
|
-
import * as
|
|
1798
|
+
import * as React50 from "react";
|
|
1614
1799
|
import { ControlLabel as ControlLabel23, SizeControl as SizeControl7 } from "@elementor/editor-controls";
|
|
1615
1800
|
import { Grid as Grid18 } from "@elementor/ui";
|
|
1616
|
-
import { __ as
|
|
1801
|
+
import { __ as __30 } from "@wordpress/i18n";
|
|
1617
1802
|
var LineHeightField = () => {
|
|
1618
|
-
return /* @__PURE__ */
|
|
1803
|
+
return /* @__PURE__ */ React50.createElement(StylesField, { bind: "line-height" }, /* @__PURE__ */ React50.createElement(Grid18, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React50.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(ControlLabel23, null, __30("Line Height", "elementor"))), /* @__PURE__ */ React50.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(SizeControl7, null))));
|
|
1619
1804
|
};
|
|
1620
1805
|
|
|
1621
1806
|
// src/components/style-sections/typography-section/text-alignment-field.tsx
|
|
1622
|
-
import * as
|
|
1807
|
+
import * as React51 from "react";
|
|
1623
1808
|
import { ControlLabel as ControlLabel24, ToggleControl as ToggleControl8 } from "@elementor/editor-controls";
|
|
1624
1809
|
import { AlignCenterIcon, AlignJustifiedIcon, AlignLeftIcon, AlignRightIcon } from "@elementor/icons";
|
|
1625
1810
|
import { Grid as Grid19 } from "@elementor/ui";
|
|
1626
|
-
import { __ as
|
|
1811
|
+
import { __ as __31 } from "@wordpress/i18n";
|
|
1627
1812
|
var options7 = [
|
|
1628
1813
|
{
|
|
1629
1814
|
value: "left",
|
|
1630
|
-
label:
|
|
1631
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1815
|
+
label: __31("Left", "elementor"),
|
|
1816
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(AlignLeftIcon, { fontSize: size })
|
|
1632
1817
|
},
|
|
1633
1818
|
{
|
|
1634
1819
|
value: "center",
|
|
1635
|
-
label:
|
|
1636
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1820
|
+
label: __31("Center", "elementor"),
|
|
1821
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(AlignCenterIcon, { fontSize: size })
|
|
1637
1822
|
},
|
|
1638
1823
|
{
|
|
1639
1824
|
value: "right",
|
|
1640
|
-
label:
|
|
1641
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1825
|
+
label: __31("Right", "elementor"),
|
|
1826
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(AlignRightIcon, { fontSize: size })
|
|
1642
1827
|
},
|
|
1643
1828
|
{
|
|
1644
1829
|
value: "justify",
|
|
1645
|
-
label:
|
|
1646
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1830
|
+
label: __31("Justify", "elementor"),
|
|
1831
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(AlignJustifiedIcon, { fontSize: size })
|
|
1647
1832
|
}
|
|
1648
1833
|
];
|
|
1649
1834
|
var TextAlignmentField = () => {
|
|
1650
|
-
return /* @__PURE__ */
|
|
1835
|
+
return /* @__PURE__ */ React51.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React51.createElement(Grid19, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React51.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(ControlLabel24, null, __31("Alignment", "elementor"))), /* @__PURE__ */ React51.createElement(Grid19, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React51.createElement(ToggleControl8, { options: options7 }))));
|
|
1651
1836
|
};
|
|
1652
1837
|
|
|
1653
1838
|
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
1654
|
-
import * as
|
|
1839
|
+
import * as React52 from "react";
|
|
1655
1840
|
import { ColorControl as ColorControl2, ControlLabel as ControlLabel25 } from "@elementor/editor-controls";
|
|
1656
1841
|
import { Grid as Grid20 } from "@elementor/ui";
|
|
1657
|
-
import { __ as
|
|
1842
|
+
import { __ as __32 } from "@wordpress/i18n";
|
|
1658
1843
|
var TextColorField = () => {
|
|
1659
|
-
return /* @__PURE__ */
|
|
1844
|
+
return /* @__PURE__ */ React52.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React52.createElement(Grid20, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React52.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(ControlLabel25, null, __32("Text Color", "elementor"))), /* @__PURE__ */ React52.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(ColorControl2, null))));
|
|
1660
1845
|
};
|
|
1661
1846
|
|
|
1662
1847
|
// src/components/style-sections/typography-section/text-direction-field.tsx
|
|
1663
|
-
import * as
|
|
1848
|
+
import * as React53 from "react";
|
|
1664
1849
|
import { ControlLabel as ControlLabel26, ToggleControl as ToggleControl9 } from "@elementor/editor-controls";
|
|
1665
1850
|
import { TextDirectionLtrIcon, TextDirectionRtlIcon } from "@elementor/icons";
|
|
1666
1851
|
import { Grid as Grid21 } from "@elementor/ui";
|
|
1667
|
-
import { __ as
|
|
1852
|
+
import { __ as __33 } from "@wordpress/i18n";
|
|
1668
1853
|
var options8 = [
|
|
1669
1854
|
{
|
|
1670
1855
|
value: "ltr",
|
|
1671
|
-
label:
|
|
1672
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1856
|
+
label: __33("Left to Right", "elementor"),
|
|
1857
|
+
renderContent: ({ size }) => /* @__PURE__ */ React53.createElement(TextDirectionLtrIcon, { fontSize: size })
|
|
1673
1858
|
},
|
|
1674
1859
|
{
|
|
1675
1860
|
value: "rtl",
|
|
1676
|
-
label:
|
|
1677
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1861
|
+
label: __33("Right to Left", "elementor"),
|
|
1862
|
+
renderContent: ({ size }) => /* @__PURE__ */ React53.createElement(TextDirectionRtlIcon, { fontSize: size })
|
|
1678
1863
|
}
|
|
1679
1864
|
];
|
|
1680
1865
|
var TextDirectionField = () => {
|
|
1681
|
-
return /* @__PURE__ */
|
|
1866
|
+
return /* @__PURE__ */ React53.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React53.createElement(Grid21, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React53.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React53.createElement(ControlLabel26, null, __33("Direction", "elementor"))), /* @__PURE__ */ React53.createElement(Grid21, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React53.createElement(ToggleControl9, { options: options8 }))));
|
|
1682
1867
|
};
|
|
1683
1868
|
|
|
1684
1869
|
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1685
|
-
import * as
|
|
1870
|
+
import * as React54 from "react";
|
|
1686
1871
|
import { StrokeControl } from "@elementor/editor-controls";
|
|
1687
|
-
import { __ as
|
|
1872
|
+
import { __ as __34 } from "@wordpress/i18n";
|
|
1688
1873
|
var initTextStroke = {
|
|
1689
1874
|
$$type: "stroke",
|
|
1690
1875
|
value: {
|
|
@@ -1710,24 +1895,24 @@ var TextStrokeField = () => {
|
|
|
1710
1895
|
setTextStroke(null);
|
|
1711
1896
|
};
|
|
1712
1897
|
const hasTextStroke = Boolean(textStroke);
|
|
1713
|
-
return /* @__PURE__ */
|
|
1898
|
+
return /* @__PURE__ */ React54.createElement(
|
|
1714
1899
|
AddOrRemoveContent,
|
|
1715
1900
|
{
|
|
1716
|
-
label:
|
|
1901
|
+
label: __34("Text Stroke", "elementor"),
|
|
1717
1902
|
isAdded: hasTextStroke,
|
|
1718
1903
|
onAdd: addTextStroke,
|
|
1719
1904
|
onRemove: removeTextStroke
|
|
1720
1905
|
},
|
|
1721
|
-
/* @__PURE__ */
|
|
1906
|
+
/* @__PURE__ */ React54.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React54.createElement(StrokeControl, null))
|
|
1722
1907
|
);
|
|
1723
1908
|
};
|
|
1724
1909
|
|
|
1725
1910
|
// src/components/style-sections/typography-section/text-style-field.tsx
|
|
1726
|
-
import * as
|
|
1911
|
+
import * as React55 from "react";
|
|
1727
1912
|
import { ControlLabel as ControlLabel27 } from "@elementor/editor-controls";
|
|
1728
1913
|
import { ItalicIcon, StrikethroughIcon, UnderlineIcon } from "@elementor/icons";
|
|
1729
1914
|
import { Grid as Grid22, ToggleButton as ToggleButtonBase, ToggleButtonGroup } from "@elementor/ui";
|
|
1730
|
-
import { __ as
|
|
1915
|
+
import { __ as __35 } from "@wordpress/i18n";
|
|
1731
1916
|
var buttonSize = "tiny";
|
|
1732
1917
|
var TextStyleField = () => {
|
|
1733
1918
|
const [fontStyle, setFontStyle] = useStylesField("font-style");
|
|
@@ -1751,7 +1936,7 @@ var TextStyleField = () => {
|
|
|
1751
1936
|
value: newValue
|
|
1752
1937
|
});
|
|
1753
1938
|
};
|
|
1754
|
-
return /* @__PURE__ */
|
|
1939
|
+
return /* @__PURE__ */ React55.createElement(Grid22, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React55.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React55.createElement(ControlLabel27, null, __35("Style", "elementor"))), /* @__PURE__ */ React55.createElement(Grid22, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React55.createElement(ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React55.createElement(
|
|
1755
1940
|
ToggleButton,
|
|
1756
1941
|
{
|
|
1757
1942
|
value: "italic",
|
|
@@ -1759,8 +1944,8 @@ var TextStyleField = () => {
|
|
|
1759
1944
|
"aria-label": "italic",
|
|
1760
1945
|
sx: { marginLeft: "auto" }
|
|
1761
1946
|
},
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
), /* @__PURE__ */
|
|
1947
|
+
/* @__PURE__ */ React55.createElement(ItalicIcon, { fontSize: buttonSize })
|
|
1948
|
+
), /* @__PURE__ */ React55.createElement(
|
|
1764
1949
|
ShorthandControl,
|
|
1765
1950
|
{
|
|
1766
1951
|
value: "line-through",
|
|
@@ -1768,8 +1953,8 @@ var TextStyleField = () => {
|
|
|
1768
1953
|
updateValues: handleSetTextDecoration,
|
|
1769
1954
|
"aria-label": "line-through"
|
|
1770
1955
|
},
|
|
1771
|
-
/* @__PURE__ */
|
|
1772
|
-
), /* @__PURE__ */
|
|
1956
|
+
/* @__PURE__ */ React55.createElement(StrikethroughIcon, { fontSize: buttonSize })
|
|
1957
|
+
), /* @__PURE__ */ React55.createElement(
|
|
1773
1958
|
ShorthandControl,
|
|
1774
1959
|
{
|
|
1775
1960
|
value: "underline",
|
|
@@ -1777,7 +1962,7 @@ var TextStyleField = () => {
|
|
|
1777
1962
|
updateValues: handleSetTextDecoration,
|
|
1778
1963
|
"aria-label": "underline"
|
|
1779
1964
|
},
|
|
1780
|
-
/* @__PURE__ */
|
|
1965
|
+
/* @__PURE__ */ React55.createElement(UnderlineIcon, { fontSize: buttonSize })
|
|
1781
1966
|
))));
|
|
1782
1967
|
};
|
|
1783
1968
|
var ShorthandControl = ({
|
|
@@ -1796,52 +1981,52 @@ var ShorthandControl = ({
|
|
|
1796
1981
|
updateValues([...valuesArr, newValue].join(" "));
|
|
1797
1982
|
}
|
|
1798
1983
|
};
|
|
1799
|
-
return /* @__PURE__ */
|
|
1984
|
+
return /* @__PURE__ */ React55.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
1800
1985
|
};
|
|
1801
1986
|
var ToggleButton = ({ onChange, ...props }) => {
|
|
1802
1987
|
const handleChange = (_e, newValue) => {
|
|
1803
1988
|
onChange(newValue);
|
|
1804
1989
|
};
|
|
1805
|
-
return /* @__PURE__ */
|
|
1990
|
+
return /* @__PURE__ */ React55.createElement(ToggleButtonBase, { ...props, onChange: handleChange, size: buttonSize });
|
|
1806
1991
|
};
|
|
1807
1992
|
|
|
1808
1993
|
// src/components/style-sections/typography-section/transform-field.tsx
|
|
1809
|
-
import * as
|
|
1994
|
+
import * as React56 from "react";
|
|
1810
1995
|
import { ControlLabel as ControlLabel28, ToggleControl as ToggleControl10 } from "@elementor/editor-controls";
|
|
1811
1996
|
import { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon } from "@elementor/icons";
|
|
1812
1997
|
import { Grid as Grid23 } from "@elementor/ui";
|
|
1813
|
-
import { __ as
|
|
1998
|
+
import { __ as __36 } from "@wordpress/i18n";
|
|
1814
1999
|
var options9 = [
|
|
1815
2000
|
{
|
|
1816
2001
|
value: "capitalize",
|
|
1817
|
-
label:
|
|
1818
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2002
|
+
label: __36("Capitalize", "elementor"),
|
|
2003
|
+
renderContent: ({ size }) => /* @__PURE__ */ React56.createElement(LetterCaseIcon, { fontSize: size })
|
|
1819
2004
|
},
|
|
1820
2005
|
{
|
|
1821
2006
|
value: "uppercase",
|
|
1822
|
-
label:
|
|
1823
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2007
|
+
label: __36("Uppercase", "elementor"),
|
|
2008
|
+
renderContent: ({ size }) => /* @__PURE__ */ React56.createElement(LetterCaseUpperIcon, { fontSize: size })
|
|
1824
2009
|
},
|
|
1825
2010
|
{
|
|
1826
2011
|
value: "lowercase",
|
|
1827
|
-
label:
|
|
1828
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2012
|
+
label: __36("Lowercase", "elementor"),
|
|
2013
|
+
renderContent: ({ size }) => /* @__PURE__ */ React56.createElement(LetterCaseLowerIcon, { fontSize: size })
|
|
1829
2014
|
}
|
|
1830
2015
|
];
|
|
1831
|
-
var TransformField = () => /* @__PURE__ */
|
|
2016
|
+
var TransformField = () => /* @__PURE__ */ React56.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React56.createElement(Grid23, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(Grid23, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(ControlLabel28, null, __36("Transform", "elementor"))), /* @__PURE__ */ React56.createElement(Grid23, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React56.createElement(ToggleControl10, { options: options9 }))));
|
|
1832
2017
|
|
|
1833
2018
|
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
1834
|
-
import * as
|
|
2019
|
+
import * as React57 from "react";
|
|
1835
2020
|
import { ControlLabel as ControlLabel29, SizeControl as SizeControl8 } from "@elementor/editor-controls";
|
|
1836
2021
|
import { Grid as Grid24 } from "@elementor/ui";
|
|
1837
|
-
import { __ as
|
|
2022
|
+
import { __ as __37 } from "@wordpress/i18n";
|
|
1838
2023
|
var WordSpacingField = () => {
|
|
1839
|
-
return /* @__PURE__ */
|
|
2024
|
+
return /* @__PURE__ */ React57.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React57.createElement(Grid24, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React57.createElement(Grid24, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ControlLabel29, null, __37("Word Spacing", "elementor"))), /* @__PURE__ */ React57.createElement(Grid24, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(SizeControl8, null))));
|
|
1840
2025
|
};
|
|
1841
2026
|
|
|
1842
2027
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1843
2028
|
var TypographySection = () => {
|
|
1844
|
-
return /* @__PURE__ */
|
|
2029
|
+
return /* @__PURE__ */ React58.createElement(Stack18, { gap: 1.5 }, /* @__PURE__ */ React58.createElement(FontFamilyField, null), /* @__PURE__ */ React58.createElement(FontWeightField, null), /* @__PURE__ */ React58.createElement(FontSizeField, null), /* @__PURE__ */ React58.createElement(Divider6, null), /* @__PURE__ */ React58.createElement(TextAlignmentField, null), /* @__PURE__ */ React58.createElement(TextColorField, null), /* @__PURE__ */ React58.createElement(CollapsibleContent, null, /* @__PURE__ */ React58.createElement(Stack18, { gap: 1.5, sx: { pt: 1.5 } }, /* @__PURE__ */ React58.createElement(LineHeightField, null), /* @__PURE__ */ React58.createElement(LetterSpacingField, null), /* @__PURE__ */ React58.createElement(WordSpacingField, null), /* @__PURE__ */ React58.createElement(Divider6, null), /* @__PURE__ */ React58.createElement(TextStyleField, null), /* @__PURE__ */ React58.createElement(TransformField, null), /* @__PURE__ */ React58.createElement(TextDirectionField, null), /* @__PURE__ */ React58.createElement(TextStrokeField, null))));
|
|
1845
2030
|
};
|
|
1846
2031
|
|
|
1847
2032
|
// src/components/style-tab.tsx
|
|
@@ -1849,11 +2034,26 @@ var CLASSES_PROP_KEY = "classes";
|
|
|
1849
2034
|
var StyleTab = () => {
|
|
1850
2035
|
const currentClassesProp = useCurrentClassesProp();
|
|
1851
2036
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
2037
|
+
const [activeStyleState, setActiveStyleState] = useState8(null);
|
|
1852
2038
|
const breakpoint = useActiveBreakpoint();
|
|
1853
|
-
return /* @__PURE__ */
|
|
2039
|
+
return /* @__PURE__ */ React59.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React59.createElement(
|
|
2040
|
+
StyleProvider,
|
|
2041
|
+
{
|
|
2042
|
+
meta: { breakpoint, state: activeStyleState },
|
|
2043
|
+
id: activeStyleDefId,
|
|
2044
|
+
setId: (id) => {
|
|
2045
|
+
setActiveStyleDefId(id);
|
|
2046
|
+
setActiveStyleState(null);
|
|
2047
|
+
},
|
|
2048
|
+
setMetaState: setActiveStyleState
|
|
2049
|
+
},
|
|
2050
|
+
/* @__PURE__ */ React59.createElement(CssClassSelector, null),
|
|
2051
|
+
/* @__PURE__ */ React59.createElement(Divider7, null),
|
|
2052
|
+
/* @__PURE__ */ React59.createElement(SectionsList, null, /* @__PURE__ */ React59.createElement(Section, { title: __38("Layout", "elementor") }, /* @__PURE__ */ React59.createElement(LayoutSection, null)), /* @__PURE__ */ React59.createElement(Section, { title: __38("Spacing", "elementor") }, /* @__PURE__ */ React59.createElement(SpacingSection, null)), /* @__PURE__ */ React59.createElement(Section, { title: __38("Size", "elementor") }, /* @__PURE__ */ React59.createElement(SizeSection, null)), /* @__PURE__ */ React59.createElement(Section, { title: __38("Position", "elementor") }, /* @__PURE__ */ React59.createElement(PositionSection, null)), /* @__PURE__ */ React59.createElement(Section, { title: __38("Typography", "elementor") }, /* @__PURE__ */ React59.createElement(TypographySection, null)), /* @__PURE__ */ React59.createElement(Section, { title: __38("Background", "elementor") }, /* @__PURE__ */ React59.createElement(BackgroundSection, null)), /* @__PURE__ */ React59.createElement(Section, { title: __38("Border", "elementor") }, /* @__PURE__ */ React59.createElement(BorderSection, null)), /* @__PURE__ */ React59.createElement(Section, { title: __38("Effects", "elementor") }, /* @__PURE__ */ React59.createElement(EffectsSection, null)))
|
|
2053
|
+
));
|
|
1854
2054
|
};
|
|
1855
2055
|
function useActiveStyleDefId(currentClassesProp) {
|
|
1856
|
-
const [activeStyledDefId, setActiveStyledDefId] =
|
|
2056
|
+
const [activeStyledDefId, setActiveStyledDefId] = useState8(null);
|
|
1857
2057
|
const fallback = useFirstElementStyleDef(currentClassesProp);
|
|
1858
2058
|
return [activeStyledDefId || fallback?.id || null, setActiveStyledDefId];
|
|
1859
2059
|
}
|
|
@@ -1866,7 +2066,7 @@ function useFirstElementStyleDef(currentClassesProp) {
|
|
|
1866
2066
|
function useCurrentClassesProp() {
|
|
1867
2067
|
const { elementType } = useElement();
|
|
1868
2068
|
const prop = Object.entries(elementType.propsSchema).find(
|
|
1869
|
-
([, propType]) => propType.kind === "
|
|
2069
|
+
([, propType]) => propType.kind === "plain" && propType.key === CLASSES_PROP_KEY
|
|
1870
2070
|
);
|
|
1871
2071
|
if (!prop) {
|
|
1872
2072
|
throw new Error("Element does not have a classes prop");
|
|
@@ -1881,7 +2081,7 @@ var EditingPanelTabs = () => {
|
|
|
1881
2081
|
return (
|
|
1882
2082
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
1883
2083
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
1884
|
-
/* @__PURE__ */
|
|
2084
|
+
/* @__PURE__ */ React60.createElement(Fragment7, { key: element.id }, /* @__PURE__ */ React60.createElement(Stack19, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React60.createElement(Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React60.createElement(Tab, { label: __39("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React60.createElement(Tab, { label: __39("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React60.createElement(Divider8, null), /* @__PURE__ */ React60.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React60.createElement(SettingsTab, null)), /* @__PURE__ */ React60.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React60.createElement(StyleTab, null))))
|
|
1885
2085
|
);
|
|
1886
2086
|
};
|
|
1887
2087
|
|
|
@@ -1894,8 +2094,8 @@ var EditingPanel = () => {
|
|
|
1894
2094
|
if (!element || !elementType) {
|
|
1895
2095
|
return null;
|
|
1896
2096
|
}
|
|
1897
|
-
const panelTitle =
|
|
1898
|
-
return /* @__PURE__ */
|
|
2097
|
+
const panelTitle = __40("Edit %s", "elementor").replace("%s", elementType.title);
|
|
2098
|
+
return /* @__PURE__ */ React61.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React61.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React61.createElement(Panel, null, /* @__PURE__ */ React61.createElement(PanelHeader, null, /* @__PURE__ */ React61.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React61.createElement(PanelBody, null, /* @__PURE__ */ React61.createElement(ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React61.createElement(ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React61.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React61.createElement(EditingPanelTabs, null)))))));
|
|
1899
2099
|
};
|
|
1900
2100
|
|
|
1901
2101
|
// src/panel.ts
|
|
@@ -1951,15 +2151,40 @@ var EditingPanelHooks = () => {
|
|
|
1951
2151
|
return null;
|
|
1952
2152
|
};
|
|
1953
2153
|
|
|
2154
|
+
// src/css-classes.ts
|
|
2155
|
+
var STATES = ["hover", "focus", "active"];
|
|
2156
|
+
function initCssClasses() {
|
|
2157
|
+
registerStateItems();
|
|
2158
|
+
registerGlobalClassItems();
|
|
2159
|
+
}
|
|
2160
|
+
function registerStateItems() {
|
|
2161
|
+
registerStateMenuItem({
|
|
2162
|
+
id: "normal",
|
|
2163
|
+
props: {
|
|
2164
|
+
state: null
|
|
2165
|
+
}
|
|
2166
|
+
});
|
|
2167
|
+
STATES.forEach((state) => {
|
|
2168
|
+
registerStateMenuItem({
|
|
2169
|
+
id: state,
|
|
2170
|
+
props: {
|
|
2171
|
+
state
|
|
2172
|
+
}
|
|
2173
|
+
});
|
|
2174
|
+
});
|
|
2175
|
+
}
|
|
2176
|
+
function registerGlobalClassItems() {
|
|
2177
|
+
}
|
|
2178
|
+
|
|
1954
2179
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1955
|
-
import * as
|
|
1956
|
-
import { useId as
|
|
1957
|
-
import { ControlLabel as ControlLabel30, useBoundProp as
|
|
2180
|
+
import * as React64 from "react";
|
|
2181
|
+
import { useId as useId5 } from "react";
|
|
2182
|
+
import { ControlLabel as ControlLabel30, useBoundProp as useBoundProp4 } from "@elementor/editor-controls";
|
|
1958
2183
|
import { DatabaseIcon, SettingsIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
1959
2184
|
import {
|
|
1960
2185
|
bindPopover as bindPopover2,
|
|
1961
|
-
bindTrigger,
|
|
1962
|
-
Box as
|
|
2186
|
+
bindTrigger as bindTrigger2,
|
|
2187
|
+
Box as Box7,
|
|
1963
2188
|
Divider as Divider10,
|
|
1964
2189
|
IconButton as IconButton3,
|
|
1965
2190
|
Paper,
|
|
@@ -1970,10 +2195,10 @@ import {
|
|
|
1970
2195
|
Tabs as Tabs2,
|
|
1971
2196
|
Typography as Typography4,
|
|
1972
2197
|
UnstableTag as Tag,
|
|
1973
|
-
usePopupState as
|
|
2198
|
+
usePopupState as usePopupState3,
|
|
1974
2199
|
useTabs as useTabs2
|
|
1975
2200
|
} from "@elementor/ui";
|
|
1976
|
-
import { __ as
|
|
2201
|
+
import { __ as __42 } from "@wordpress/i18n";
|
|
1977
2202
|
|
|
1978
2203
|
// src/hooks/use-persist-dynamic-value.ts
|
|
1979
2204
|
var usePersistDynamicValue = (propKey) => {
|
|
@@ -1983,14 +2208,15 @@ var usePersistDynamicValue = (propKey) => {
|
|
|
1983
2208
|
};
|
|
1984
2209
|
|
|
1985
2210
|
// src/dynamics/dynamic-control.tsx
|
|
1986
|
-
import * as
|
|
1987
|
-
import {
|
|
2211
|
+
import * as React62 from "react";
|
|
2212
|
+
import { PropKeyProvider as PropKeyProvider3, PropProvider as PropProvider3, useBoundProp as useBoundProp2 } from "@elementor/editor-controls";
|
|
1988
2213
|
|
|
1989
2214
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
1990
2215
|
import { useMemo as useMemo3 } from "react";
|
|
1991
2216
|
|
|
1992
2217
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1993
2218
|
import { useMemo as useMemo2 } from "react";
|
|
2219
|
+
import { useBoundProp } from "@elementor/editor-controls";
|
|
1994
2220
|
|
|
1995
2221
|
// src/dynamics/sync/get-elementor-config.ts
|
|
1996
2222
|
var getElementorConfig2 = () => {
|
|
@@ -2032,15 +2258,14 @@ var dynamicPropTypeUtil = createPropUtils(
|
|
|
2032
2258
|
DYNAMIC_PROP_TYPE_KEY,
|
|
2033
2259
|
z.strictObject({
|
|
2034
2260
|
name: z.string(),
|
|
2035
|
-
settings: z.
|
|
2261
|
+
settings: z.any().optional()
|
|
2036
2262
|
})
|
|
2037
2263
|
);
|
|
2038
2264
|
|
|
2039
2265
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
2040
|
-
var usePropDynamicTags = (
|
|
2266
|
+
var usePropDynamicTags = () => {
|
|
2041
2267
|
let categories = [];
|
|
2042
|
-
const {
|
|
2043
|
-
const propType = elementType.propsSchema?.[propName];
|
|
2268
|
+
const { propType } = useBoundProp();
|
|
2044
2269
|
if (propType) {
|
|
2045
2270
|
const propDynamicType = getDynamicPropType(propType);
|
|
2046
2271
|
categories = propDynamicType?.settings.categories || [];
|
|
@@ -2059,60 +2284,62 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
2059
2284
|
};
|
|
2060
2285
|
|
|
2061
2286
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2062
|
-
var useDynamicTag = (
|
|
2063
|
-
const dynamicTags = usePropDynamicTags(
|
|
2287
|
+
var useDynamicTag = (tagName) => {
|
|
2288
|
+
const dynamicTags = usePropDynamicTags();
|
|
2064
2289
|
return useMemo3(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
2065
2290
|
};
|
|
2066
2291
|
|
|
2067
2292
|
// src/dynamics/dynamic-control.tsx
|
|
2068
2293
|
var DynamicControl = ({ bind, children }) => {
|
|
2069
|
-
const { value, setValue
|
|
2294
|
+
const { value, setValue } = useBoundProp2(dynamicPropTypeUtil);
|
|
2070
2295
|
const { name = "", settings } = value ?? {};
|
|
2071
|
-
const dynamicTag = useDynamicTag(
|
|
2296
|
+
const dynamicTag = useDynamicTag(name);
|
|
2072
2297
|
if (!dynamicTag) {
|
|
2073
2298
|
throw new Error(`Dynamic tag ${name} not found`);
|
|
2074
2299
|
}
|
|
2075
|
-
const
|
|
2300
|
+
const dynamicPropType = dynamicTag.props_schema[bind];
|
|
2301
|
+
const defaultValue = dynamicPropType?.default;
|
|
2076
2302
|
const dynamicValue = settings?.[bind] ?? defaultValue;
|
|
2077
|
-
const setDynamicValue = (
|
|
2303
|
+
const setDynamicValue = (newValues) => {
|
|
2078
2304
|
setValue({
|
|
2079
2305
|
name,
|
|
2080
2306
|
settings: {
|
|
2081
2307
|
...settings,
|
|
2082
|
-
|
|
2308
|
+
...newValues
|
|
2083
2309
|
}
|
|
2084
2310
|
});
|
|
2085
2311
|
};
|
|
2086
|
-
|
|
2312
|
+
const propType = createTopLevelOjectType({ schema: dynamicTag.props_schema });
|
|
2313
|
+
return /* @__PURE__ */ React62.createElement(PropProvider3, { propType, setValue: setDynamicValue, value: { [bind]: dynamicValue } }, /* @__PURE__ */ React62.createElement(PropKeyProvider3, { bind }, children));
|
|
2087
2314
|
};
|
|
2088
2315
|
|
|
2089
2316
|
// src/dynamics/components/dynamic-selection.tsx
|
|
2090
|
-
import * as
|
|
2091
|
-
import { Fragment as Fragment8, useState as
|
|
2092
|
-
import { useBoundProp as
|
|
2317
|
+
import * as React63 from "react";
|
|
2318
|
+
import { Fragment as Fragment8, useState as useState9 } from "react";
|
|
2319
|
+
import { useBoundProp as useBoundProp3 } from "@elementor/editor-controls";
|
|
2093
2320
|
import { PhotoIcon, SearchIcon } from "@elementor/icons";
|
|
2094
2321
|
import {
|
|
2095
|
-
Box as
|
|
2322
|
+
Box as Box6,
|
|
2096
2323
|
Divider as Divider9,
|
|
2097
2324
|
InputAdornment,
|
|
2098
2325
|
Link,
|
|
2099
|
-
ListSubheader,
|
|
2100
|
-
MenuItem,
|
|
2326
|
+
ListSubheader as ListSubheader2,
|
|
2327
|
+
MenuItem as MenuItem2,
|
|
2101
2328
|
MenuList,
|
|
2102
2329
|
Stack as Stack20,
|
|
2103
2330
|
TextField as TextField2,
|
|
2104
2331
|
Typography as Typography3
|
|
2105
2332
|
} from "@elementor/ui";
|
|
2106
|
-
import { __ as
|
|
2333
|
+
import { __ as __41 } from "@wordpress/i18n";
|
|
2107
2334
|
var SIZE3 = "tiny";
|
|
2108
2335
|
var DynamicSelection = ({ onSelect }) => {
|
|
2109
|
-
const [searchValue, setSearchValue] =
|
|
2336
|
+
const [searchValue, setSearchValue] = useState9("");
|
|
2110
2337
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
2111
|
-
const { value: anyValue } =
|
|
2112
|
-
const { bind, value: dynamicValue, setValue } =
|
|
2338
|
+
const { value: anyValue } = useBoundProp3();
|
|
2339
|
+
const { bind, value: dynamicValue, setValue } = useBoundProp3(dynamicPropTypeUtil);
|
|
2113
2340
|
const [, updatePropValueHistory] = usePersistDynamicValue(bind);
|
|
2114
2341
|
const isCurrentValueDynamic = !!dynamicValue;
|
|
2115
|
-
const options10 = useFilteredOptions(
|
|
2342
|
+
const options10 = useFilteredOptions(searchValue);
|
|
2116
2343
|
const handleSearch = (event) => {
|
|
2117
2344
|
setSearchValue(event.target.value);
|
|
2118
2345
|
};
|
|
@@ -2123,22 +2350,22 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2123
2350
|
setValue({ name: value, settings: {} });
|
|
2124
2351
|
onSelect?.();
|
|
2125
2352
|
};
|
|
2126
|
-
return /* @__PURE__ */
|
|
2353
|
+
return /* @__PURE__ */ React63.createElement(Stack20, null, /* @__PURE__ */ React63.createElement(Box6, { px: 1.5, pb: 1 }, /* @__PURE__ */ React63.createElement(
|
|
2127
2354
|
TextField2,
|
|
2128
2355
|
{
|
|
2129
2356
|
fullWidth: true,
|
|
2130
2357
|
size: SIZE3,
|
|
2131
2358
|
value: searchValue,
|
|
2132
2359
|
onChange: handleSearch,
|
|
2133
|
-
placeholder:
|
|
2360
|
+
placeholder: __41("Search dynamic tag", "elementor"),
|
|
2134
2361
|
InputProps: {
|
|
2135
|
-
startAdornment: /* @__PURE__ */
|
|
2362
|
+
startAdornment: /* @__PURE__ */ React63.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React63.createElement(SearchIcon, { fontSize: SIZE3 }))
|
|
2136
2363
|
}
|
|
2137
2364
|
}
|
|
2138
|
-
)), /* @__PURE__ */
|
|
2365
|
+
)), /* @__PURE__ */ React63.createElement(Divider9, null), /* @__PURE__ */ React63.createElement(Box6, { sx: { overflowY: "auto", height: 260, width: 220 } }, options10.length > 0 ? /* @__PURE__ */ React63.createElement(MenuList, { role: "listbox", tabIndex: 0 }, options10.map(([category, items3], index) => /* @__PURE__ */ React63.createElement(Fragment8, { key: index }, /* @__PURE__ */ React63.createElement(ListSubheader2, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items3.map(({ value, label: tagLabel }) => {
|
|
2139
2366
|
const isSelected = isCurrentValueDynamic && value === dynamicValue?.name;
|
|
2140
|
-
return /* @__PURE__ */
|
|
2141
|
-
|
|
2367
|
+
return /* @__PURE__ */ React63.createElement(
|
|
2368
|
+
MenuItem2,
|
|
2142
2369
|
{
|
|
2143
2370
|
key: value,
|
|
2144
2371
|
selected: isSelected,
|
|
@@ -2148,7 +2375,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2148
2375
|
},
|
|
2149
2376
|
tagLabel
|
|
2150
2377
|
);
|
|
2151
|
-
})))) : /* @__PURE__ */
|
|
2378
|
+
})))) : /* @__PURE__ */ React63.createElement(Stack20, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React63.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React63.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, __41("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React63.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React63.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React63.createElement(
|
|
2152
2379
|
Link,
|
|
2153
2380
|
{
|
|
2154
2381
|
color: "secondary",
|
|
@@ -2156,11 +2383,11 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2156
2383
|
component: "button",
|
|
2157
2384
|
onClick: () => setSearchValue("")
|
|
2158
2385
|
},
|
|
2159
|
-
|
|
2160
|
-
), "\xA0",
|
|
2386
|
+
__41("Clear the filters", "elementor")
|
|
2387
|
+
), "\xA0", __41("and try again.", "elementor")))));
|
|
2161
2388
|
};
|
|
2162
|
-
var useFilteredOptions = (
|
|
2163
|
-
const dynamicTags = usePropDynamicTags(
|
|
2389
|
+
var useFilteredOptions = (searchValue) => {
|
|
2390
|
+
const dynamicTags = usePropDynamicTags();
|
|
2164
2391
|
const options10 = dynamicTags.reduce((categories, { name, label, group }) => {
|
|
2165
2392
|
const isVisible = label.toLowerCase().includes(searchValue.trim().toLowerCase());
|
|
2166
2393
|
if (!isVisible) {
|
|
@@ -2178,38 +2405,38 @@ var useFilteredOptions = (bind, searchValue) => {
|
|
|
2178
2405
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
2179
2406
|
var SIZE4 = "tiny";
|
|
2180
2407
|
var DynamicSelectionControl = () => {
|
|
2181
|
-
const { setValue: setAnyValue } =
|
|
2182
|
-
const { bind, value } =
|
|
2408
|
+
const { setValue: setAnyValue } = useBoundProp4();
|
|
2409
|
+
const { bind, value } = useBoundProp4(dynamicPropTypeUtil);
|
|
2183
2410
|
const [propValueFromHistory] = usePersistDynamicValue(bind);
|
|
2184
2411
|
const { name: tagName = "" } = value;
|
|
2185
|
-
const selectionPopoverId =
|
|
2186
|
-
const selectionPopoverState =
|
|
2187
|
-
const dynamicTag = useDynamicTag(
|
|
2412
|
+
const selectionPopoverId = useId5();
|
|
2413
|
+
const selectionPopoverState = usePopupState3({ variant: "popover", popupId: selectionPopoverId });
|
|
2414
|
+
const dynamicTag = useDynamicTag(tagName);
|
|
2188
2415
|
const removeDynamicTag = () => {
|
|
2189
2416
|
setAnyValue(propValueFromHistory ?? null);
|
|
2190
2417
|
};
|
|
2191
2418
|
if (!dynamicTag) {
|
|
2192
2419
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
2193
2420
|
}
|
|
2194
|
-
return /* @__PURE__ */
|
|
2421
|
+
return /* @__PURE__ */ React64.createElement(Box7, null, /* @__PURE__ */ React64.createElement(
|
|
2195
2422
|
Tag,
|
|
2196
2423
|
{
|
|
2197
2424
|
fullWidth: true,
|
|
2198
2425
|
showActionsOnHover: true,
|
|
2199
2426
|
label: dynamicTag.label,
|
|
2200
|
-
startIcon: /* @__PURE__ */
|
|
2201
|
-
...
|
|
2202
|
-
actions: /* @__PURE__ */
|
|
2427
|
+
startIcon: /* @__PURE__ */ React64.createElement(DatabaseIcon, { fontSize: SIZE4 }),
|
|
2428
|
+
...bindTrigger2(selectionPopoverState),
|
|
2429
|
+
actions: /* @__PURE__ */ React64.createElement(React64.Fragment, null, /* @__PURE__ */ React64.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React64.createElement(
|
|
2203
2430
|
IconButton3,
|
|
2204
2431
|
{
|
|
2205
2432
|
size: SIZE4,
|
|
2206
2433
|
onClick: removeDynamicTag,
|
|
2207
|
-
"aria-label":
|
|
2434
|
+
"aria-label": __42("Remove dynamic value", "elementor")
|
|
2208
2435
|
},
|
|
2209
|
-
/* @__PURE__ */
|
|
2436
|
+
/* @__PURE__ */ React64.createElement(XIcon2, { fontSize: SIZE4 })
|
|
2210
2437
|
))
|
|
2211
2438
|
}
|
|
2212
|
-
), /* @__PURE__ */
|
|
2439
|
+
), /* @__PURE__ */ React64.createElement(
|
|
2213
2440
|
Popover2,
|
|
2214
2441
|
{
|
|
2215
2442
|
disablePortal: true,
|
|
@@ -2217,32 +2444,32 @@ var DynamicSelectionControl = () => {
|
|
|
2217
2444
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
2218
2445
|
...bindPopover2(selectionPopoverState)
|
|
2219
2446
|
},
|
|
2220
|
-
/* @__PURE__ */
|
|
2447
|
+
/* @__PURE__ */ React64.createElement(Stack21, null, /* @__PURE__ */ React64.createElement(Stack21, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React64.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React64.createElement(Typography4, { variant: "subtitle2" }, __42("Dynamic Tags", "elementor")), /* @__PURE__ */ React64.createElement(IconButton3, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React64.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React64.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
2221
2448
|
));
|
|
2222
2449
|
};
|
|
2223
2450
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
2224
|
-
const popupId =
|
|
2225
|
-
const settingsPopupState =
|
|
2451
|
+
const popupId = useId5();
|
|
2452
|
+
const settingsPopupState = usePopupState3({ variant: "popover", popupId });
|
|
2226
2453
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
2227
2454
|
if (!hasDynamicSettings) {
|
|
2228
2455
|
return null;
|
|
2229
2456
|
}
|
|
2230
|
-
return /* @__PURE__ */
|
|
2457
|
+
return /* @__PURE__ */ React64.createElement(React64.Fragment, null, /* @__PURE__ */ React64.createElement(
|
|
2231
2458
|
IconButton3,
|
|
2232
2459
|
{
|
|
2233
2460
|
size: SIZE4,
|
|
2234
|
-
...
|
|
2235
|
-
"aria-label":
|
|
2461
|
+
...bindTrigger2(settingsPopupState),
|
|
2462
|
+
"aria-label": __42("Settings", "elementor")
|
|
2236
2463
|
},
|
|
2237
|
-
/* @__PURE__ */
|
|
2238
|
-
), /* @__PURE__ */
|
|
2464
|
+
/* @__PURE__ */ React64.createElement(SettingsIcon, { fontSize: SIZE4 })
|
|
2465
|
+
), /* @__PURE__ */ React64.createElement(
|
|
2239
2466
|
Popover2,
|
|
2240
2467
|
{
|
|
2241
2468
|
disableScrollLock: true,
|
|
2242
2469
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
2243
2470
|
...bindPopover2(settingsPopupState)
|
|
2244
2471
|
},
|
|
2245
|
-
/* @__PURE__ */
|
|
2472
|
+
/* @__PURE__ */ React64.createElement(Paper, { component: Stack21, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React64.createElement(Stack21, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React64.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React64.createElement(Typography4, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React64.createElement(IconButton3, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React64.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React64.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
2246
2473
|
));
|
|
2247
2474
|
};
|
|
2248
2475
|
var DynamicSettings = ({ controls }) => {
|
|
@@ -2251,10 +2478,10 @@ var DynamicSettings = ({ controls }) => {
|
|
|
2251
2478
|
if (!tabs.length) {
|
|
2252
2479
|
return null;
|
|
2253
2480
|
}
|
|
2254
|
-
return /* @__PURE__ */
|
|
2255
|
-
return /* @__PURE__ */
|
|
2481
|
+
return /* @__PURE__ */ React64.createElement(React64.Fragment, null, /* @__PURE__ */ React64.createElement(Tabs2, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React64.createElement(Tab2, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React64.createElement(Divider10, null), tabs.map(({ value }, index) => {
|
|
2482
|
+
return /* @__PURE__ */ React64.createElement(TabPanel2, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React64.createElement(Stack21, { gap: 1, px: 2 }, value.items.map((item) => {
|
|
2256
2483
|
if (item.type === "control") {
|
|
2257
|
-
return /* @__PURE__ */
|
|
2484
|
+
return /* @__PURE__ */ React64.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
2258
2485
|
}
|
|
2259
2486
|
return null;
|
|
2260
2487
|
})));
|
|
@@ -2264,24 +2491,22 @@ var Control3 = ({ control }) => {
|
|
|
2264
2491
|
if (!getControlByType(control.type)) {
|
|
2265
2492
|
return null;
|
|
2266
2493
|
}
|
|
2267
|
-
return /* @__PURE__ */
|
|
2494
|
+
return /* @__PURE__ */ React64.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React64.createElement(ControlLabel30, null, control.label) : null, /* @__PURE__ */ React64.createElement(Control, { type: control.type, props: control.props }));
|
|
2268
2495
|
};
|
|
2269
2496
|
|
|
2270
2497
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
2271
|
-
import * as
|
|
2272
|
-
import { useBoundProp as
|
|
2498
|
+
import * as React65 from "react";
|
|
2499
|
+
import { useBoundProp as useBoundProp5 } from "@elementor/editor-controls";
|
|
2273
2500
|
import { DatabaseIcon as DatabaseIcon2 } from "@elementor/icons";
|
|
2274
|
-
import { __ as
|
|
2501
|
+
import { __ as __43 } from "@wordpress/i18n";
|
|
2275
2502
|
var usePropDynamicAction = () => {
|
|
2276
|
-
const {
|
|
2277
|
-
const { elementType } = useElement();
|
|
2278
|
-
const propType = elementType.propsSchema[bind];
|
|
2503
|
+
const { propType } = useBoundProp5();
|
|
2279
2504
|
const visible = !!propType && supportsDynamic(propType);
|
|
2280
2505
|
return {
|
|
2281
2506
|
visible,
|
|
2282
2507
|
icon: DatabaseIcon2,
|
|
2283
|
-
title:
|
|
2284
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
2508
|
+
title: __43("Dynamic Tags", "elementor"),
|
|
2509
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React65.createElement(DynamicSelection, { onSelect: closePopover })
|
|
2285
2510
|
};
|
|
2286
2511
|
};
|
|
2287
2512
|
|
|
@@ -2307,6 +2532,7 @@ function init2() {
|
|
|
2307
2532
|
component: EditingPanelHooks
|
|
2308
2533
|
});
|
|
2309
2534
|
init();
|
|
2535
|
+
initCssClasses();
|
|
2310
2536
|
}
|
|
2311
2537
|
var blockV1Panel = () => {
|
|
2312
2538
|
blockDataCommand({
|
|
@@ -2318,7 +2544,9 @@ var blockV1Panel = () => {
|
|
|
2318
2544
|
// src/index.ts
|
|
2319
2545
|
init2();
|
|
2320
2546
|
export {
|
|
2547
|
+
registerGlobalClassMenuItem,
|
|
2548
|
+
registerStateMenuItem,
|
|
2321
2549
|
replaceControl,
|
|
2322
|
-
|
|
2550
|
+
useBoundProp6 as useBoundProp
|
|
2323
2551
|
};
|
|
2324
2552
|
//# sourceMappingURL=index.mjs.map
|