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