@elementor/editor-editing-panel 0.16.0 → 0.18.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 +44 -0
- package/dist/index.d.mts +26 -9
- package/dist/index.d.ts +26 -9
- package/dist/index.js +910 -360
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +886 -327
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -7
- package/src/components/settings-tab.tsx +5 -2
- package/src/components/style-sections/effects-section/box-shadow-repeater.tsx +224 -0
- package/src/components/style-sections/effects-section/effects-section.tsx +18 -0
- package/src/components/style-sections/position-section/z-index-control.tsx +11 -7
- package/src/components/style-sections/size-section.tsx +23 -20
- package/src/components/style-sections/spacing-section/linked-dimensions-control.tsx +62 -47
- package/src/components/style-sections/typography-section/font-size-control.tsx +10 -6
- package/src/components/style-sections/typography-section/font-weight-control.tsx +16 -12
- package/src/components/style-sections/typography-section/letter-spacing-control.tsx +10 -6
- package/src/components/style-sections/typography-section/text-alignment-control.tsx +47 -0
- package/src/components/style-sections/typography-section/text-color-control.tsx +10 -6
- package/src/components/style-sections/typography-section/text-direction-control.tsx +37 -0
- package/src/components/style-sections/typography-section/text-style-control.tsx +37 -34
- package/src/components/style-sections/typography-section/transform-control.tsx +14 -12
- package/src/components/style-sections/typography-section/typography-section.tsx +4 -0
- package/src/components/style-sections/typography-section/word-spacing-control.tsx +10 -6
- package/src/components/style-tab.tsx +5 -1
- package/src/controls/components/control-type-container.tsx +28 -0
- package/src/controls/components/repeater.tsx +197 -0
- package/src/controls/control-actions/actions/popover-action.tsx +58 -0
- package/src/controls/control-actions/control-actions-menu.ts +8 -0
- package/src/controls/control-actions/control-actions.tsx +43 -0
- package/src/controls/control-replacement.ts +15 -7
- package/src/controls/control-types/color-control.tsx +21 -18
- package/src/controls/control-types/image-control.tsx +56 -59
- package/src/controls/control-types/image-media-control.tsx +73 -0
- package/src/controls/control-types/number-control.tsx +13 -9
- package/src/controls/control-types/select-control.tsx +13 -9
- package/src/controls/control-types/size-control.tsx +17 -13
- package/src/controls/control-types/text-area-control.tsx +15 -11
- package/src/controls/control-types/text-control.tsx +9 -3
- package/src/controls/control-types/toggle-control.tsx +3 -2
- package/src/controls/control.tsx +1 -7
- package/src/controls/controls-registry.tsx +19 -10
- package/src/controls/create-control.tsx +31 -0
- package/src/controls/settings-control.tsx +2 -9
- package/src/dynamics/components/dynamic-selection-control.tsx +4 -3
- package/src/dynamics/components/dynamic-selection.tsx +19 -8
- package/src/dynamics/dynamic-control.tsx +1 -1
- package/src/dynamics/hooks/use-prop-dynamic-action.tsx +23 -0
- package/src/dynamics/hooks/use-prop-dynamic-tags.ts +4 -4
- package/src/dynamics/hooks/use-prop-value-history.ts +26 -0
- package/src/dynamics/init.ts +9 -0
- package/src/dynamics/types.ts +6 -3
- package/src/dynamics/utils.ts +18 -5
- package/src/index.ts +2 -0
- package/src/types.ts +35 -14
- package/src/controls/components/control-container.tsx +0 -18
package/dist/index.mjs
CHANGED
|
@@ -1,34 +1,82 @@
|
|
|
1
|
+
// src/controls/control-context.tsx
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
var ControlContext = createContext(null);
|
|
4
|
+
function useControl(defaultValue) {
|
|
5
|
+
const controlContext = useContext(ControlContext);
|
|
6
|
+
if (!controlContext) {
|
|
7
|
+
throw new Error("useControl must be used within a ControlContext");
|
|
8
|
+
}
|
|
9
|
+
return { ...controlContext, value: controlContext.value ?? defaultValue };
|
|
10
|
+
}
|
|
11
|
+
|
|
1
12
|
// src/controls/control-replacement.ts
|
|
2
13
|
var controlReplacement;
|
|
3
|
-
var replaceControl = ({ component, condition }) => {
|
|
4
|
-
controlReplacement = { component, condition };
|
|
5
|
-
};
|
|
6
14
|
var getControlReplacement = ({ value }) => {
|
|
7
15
|
let shouldReplace = false;
|
|
8
16
|
try {
|
|
9
|
-
shouldReplace = !!controlReplacement?.condition({ value });
|
|
17
|
+
shouldReplace = !!controlReplacement?.condition({ value }) && !!controlReplacement?.component;
|
|
10
18
|
} catch {
|
|
11
19
|
}
|
|
12
20
|
return shouldReplace ? controlReplacement?.component : void 0;
|
|
13
21
|
};
|
|
22
|
+
function replaceControl({ component, condition }) {
|
|
23
|
+
controlReplacement = { component, condition };
|
|
24
|
+
}
|
|
25
|
+
function useControlReplacement() {
|
|
26
|
+
const { value } = useControl();
|
|
27
|
+
return getControlReplacement({ value });
|
|
28
|
+
}
|
|
14
29
|
|
|
15
|
-
// src/controls/control-
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
30
|
+
// src/controls/control-actions/actions/popover-action.tsx
|
|
31
|
+
import * as React from "react";
|
|
32
|
+
import { bindPopover, bindToggle, IconButton, Popover, Stack, Tooltip, Typography, usePopupState } from "@elementor/ui";
|
|
33
|
+
import { useId } from "react";
|
|
34
|
+
import { XIcon } from "@elementor/icons";
|
|
35
|
+
var SIZE = "tiny";
|
|
36
|
+
function PopoverAction({
|
|
37
|
+
title,
|
|
38
|
+
visible = true,
|
|
39
|
+
icon: Icon,
|
|
40
|
+
popoverContent: PopoverContent
|
|
41
|
+
}) {
|
|
42
|
+
const id = useId();
|
|
43
|
+
const popupState = usePopupState({
|
|
44
|
+
variant: "popover",
|
|
45
|
+
popupId: `elementor-popover-action-${id}`
|
|
46
|
+
});
|
|
47
|
+
if (!visible) {
|
|
48
|
+
return null;
|
|
22
49
|
}
|
|
23
|
-
return {
|
|
50
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Tooltip, { placement: "top", title }, /* @__PURE__ */ React.createElement(IconButton, { "aria-label": title, key: id, size: SIZE, ...bindToggle(popupState) }, /* @__PURE__ */ React.createElement(Icon, { fontSize: SIZE }))), /* @__PURE__ */ React.createElement(
|
|
51
|
+
Popover,
|
|
52
|
+
{
|
|
53
|
+
disablePortal: true,
|
|
54
|
+
disableScrollLock: true,
|
|
55
|
+
anchorOrigin: {
|
|
56
|
+
vertical: "bottom",
|
|
57
|
+
horizontal: "center"
|
|
58
|
+
},
|
|
59
|
+
...bindPopover(popupState)
|
|
60
|
+
},
|
|
61
|
+
/* @__PURE__ */ React.createElement(Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React.createElement(Icon, { fontSize: SIZE, sx: { mr: 0.5 } }), /* @__PURE__ */ React.createElement(Typography, { variant: "subtitle2" }, title), /* @__PURE__ */ React.createElement(IconButton, { sx: { ml: "auto" }, size: SIZE, onClick: popupState.close }, /* @__PURE__ */ React.createElement(XIcon, { fontSize: SIZE }))),
|
|
62
|
+
/* @__PURE__ */ React.createElement(PopoverContent, { closePopover: popupState.close })
|
|
63
|
+
));
|
|
24
64
|
}
|
|
25
65
|
|
|
66
|
+
// src/controls/control-actions/control-actions-menu.ts
|
|
67
|
+
import { createMenu } from "@elementor/menus";
|
|
68
|
+
var controlActionsMenu = createMenu({
|
|
69
|
+
components: {
|
|
70
|
+
PopoverAction
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
26
74
|
// src/panel.ts
|
|
27
75
|
import { __createPanel as createPanel } from "@elementor/editor-panels";
|
|
28
76
|
|
|
29
77
|
// src/components/editing-panel.tsx
|
|
30
|
-
import * as
|
|
31
|
-
import { __ as
|
|
78
|
+
import * as React45 from "react";
|
|
79
|
+
import { __ as __23 } from "@wordpress/i18n";
|
|
32
80
|
|
|
33
81
|
// src/hooks/use-selected-elements.ts
|
|
34
82
|
import { __privateUseListenTo as useListenTo, commandEndEvent } from "@elementor/editor-v1-adapters";
|
|
@@ -97,11 +145,11 @@ function useElementType(type) {
|
|
|
97
145
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
98
146
|
|
|
99
147
|
// src/contexts/element-context.tsx
|
|
100
|
-
import * as
|
|
148
|
+
import * as React2 from "react";
|
|
101
149
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
102
150
|
var Context = createContext2(null);
|
|
103
151
|
function ElementContext({ children, element, elementType }) {
|
|
104
|
-
return /* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ React2.createElement(Context.Provider, { value: { element, elementType } }, children);
|
|
105
153
|
}
|
|
106
154
|
function useElementContext() {
|
|
107
155
|
const context = useContext2(Context);
|
|
@@ -112,13 +160,13 @@ function useElementContext() {
|
|
|
112
160
|
}
|
|
113
161
|
|
|
114
162
|
// src/components/editing-panel-tabs.tsx
|
|
115
|
-
import { Stack as
|
|
116
|
-
import * as
|
|
117
|
-
import { __ as
|
|
163
|
+
import { Stack as Stack16, Tabs, Tab, TabPanel, useTabs } from "@elementor/ui";
|
|
164
|
+
import * as React44 from "react";
|
|
165
|
+
import { __ as __22 } from "@wordpress/i18n";
|
|
118
166
|
|
|
119
167
|
// src/components/settings-tab.tsx
|
|
120
|
-
import * as
|
|
121
|
-
import { Stack as
|
|
168
|
+
import * as React17 from "react";
|
|
169
|
+
import { Stack as Stack5 } from "@elementor/ui";
|
|
122
170
|
|
|
123
171
|
// src/controls/settings-control.tsx
|
|
124
172
|
import * as React4 from "react";
|
|
@@ -159,32 +207,16 @@ var updateSettings = ({ id, props }) => {
|
|
|
159
207
|
};
|
|
160
208
|
|
|
161
209
|
// src/components/control-label.tsx
|
|
162
|
-
import * as
|
|
163
|
-
import { Typography } from "@elementor/ui";
|
|
210
|
+
import * as React3 from "react";
|
|
211
|
+
import { Typography as Typography2 } from "@elementor/ui";
|
|
164
212
|
var ControlLabel = ({ children }) => {
|
|
165
|
-
return /* @__PURE__ */
|
|
213
|
+
return /* @__PURE__ */ React3.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary" }, children);
|
|
166
214
|
};
|
|
167
215
|
|
|
168
|
-
// src/controls/components/control-container.tsx
|
|
169
|
-
import * as React3 from "react";
|
|
170
|
-
import { Stack, styled } from "@elementor/ui";
|
|
171
|
-
var StyledStack = styled(Stack)(({ theme, gap, direction }) => ({
|
|
172
|
-
"> :only-child": {
|
|
173
|
-
width: "100%"
|
|
174
|
-
},
|
|
175
|
-
"&:where( :has( > :nth-child( 2 ):last-child ) ) > :where( * )": {
|
|
176
|
-
width: direction === "column" ? "100%" : `calc( 50% - ${theme.spacing(gap / 2)})`
|
|
177
|
-
},
|
|
178
|
-
"&:where( :has( > :nth-child( 3 ):last-child ) ) > :where( * )": {
|
|
179
|
-
width: direction === "column" ? "100%" : `calc( 33.3333% - ${theme.spacing(gap * 2)} / 3)`
|
|
180
|
-
}
|
|
181
|
-
}));
|
|
182
|
-
var ControlContainer = (props) => /* @__PURE__ */ React3.createElement(StyledStack, { gap: 1, direction: "row", alignItems: "center", justifyContent: "space-between", ...props });
|
|
183
|
-
|
|
184
216
|
// src/controls/settings-control.tsx
|
|
185
|
-
var
|
|
217
|
+
var SettingsControl = ({ bind, children }) => {
|
|
186
218
|
const { element, elementType } = useElementContext();
|
|
187
|
-
const defaultValue = elementType.propsSchema[bind]?.
|
|
219
|
+
const defaultValue = elementType.propsSchema[bind]?.default;
|
|
188
220
|
const settingsValue = useWidgetSettings({ id: element.id, bind });
|
|
189
221
|
const value = settingsValue ?? defaultValue ?? null;
|
|
190
222
|
const setValue = (newValue) => {
|
|
@@ -197,91 +229,177 @@ var SettingsControlProvider = ({ bind, children }) => {
|
|
|
197
229
|
};
|
|
198
230
|
return /* @__PURE__ */ React4.createElement(ControlContext.Provider, { value: { setValue, value, bind } }, children);
|
|
199
231
|
};
|
|
200
|
-
var SettingsControl = ({ children, bind }) => /* @__PURE__ */ React4.createElement(SettingsControlProvider, { bind }, /* @__PURE__ */ React4.createElement(ControlContainer, { flexWrap: "wrap" }, children));
|
|
201
232
|
SettingsControl.Label = ControlLabel;
|
|
202
233
|
|
|
203
234
|
// src/components/accordion-section.tsx
|
|
204
235
|
import * as React5 from "react";
|
|
205
|
-
import { useId } from "react";
|
|
236
|
+
import { useId as useId2 } from "react";
|
|
206
237
|
import { Accordion, AccordionSummary, AccordionDetails, AccordionSummaryText, Stack as Stack2 } from "@elementor/ui";
|
|
207
238
|
var AccordionSection = ({ title, children }) => {
|
|
208
|
-
const uid =
|
|
239
|
+
const uid = useId2();
|
|
209
240
|
const labelId = `label-${uid}`;
|
|
210
241
|
const contentId = `content-${uid}`;
|
|
211
242
|
return /* @__PURE__ */ React5.createElement(Accordion, { disableGutters: true, defaultExpanded: true }, /* @__PURE__ */ React5.createElement(AccordionSummary, { "aria-controls": contentId, id: labelId }, /* @__PURE__ */ React5.createElement(AccordionSummaryText, { primaryTypographyProps: { variant: "caption" } }, title)), /* @__PURE__ */ React5.createElement(AccordionDetails, { id: contentId, "aria-labelledby": labelId }, /* @__PURE__ */ React5.createElement(Stack2, { gap: 2.5 }, children)));
|
|
212
243
|
};
|
|
213
244
|
|
|
214
245
|
// src/controls/control.tsx
|
|
215
|
-
import * as
|
|
246
|
+
import * as React15 from "react";
|
|
216
247
|
import { createError } from "@elementor/utils";
|
|
217
248
|
|
|
218
249
|
// src/controls/control-types/image-control.tsx
|
|
219
|
-
import * as
|
|
220
|
-
import {
|
|
250
|
+
import * as React10 from "react";
|
|
251
|
+
import { Grid, Stack as Stack4 } from "@elementor/ui";
|
|
252
|
+
import { __ as __2 } from "@wordpress/i18n";
|
|
253
|
+
|
|
254
|
+
// src/controls/control-types/image-media-control.tsx
|
|
255
|
+
import * as React8 from "react";
|
|
256
|
+
import { Button, Card, CardMedia, CardOverlay, Stack as Stack3 } from "@elementor/ui";
|
|
221
257
|
import { UploadIcon } from "@elementor/icons";
|
|
222
|
-
import { __ } from "@wordpress/i18n";
|
|
223
258
|
import { useWpMediaAttachment, useWpMediaFrame } from "@elementor/wp-media";
|
|
224
|
-
|
|
259
|
+
import { __ } from "@wordpress/i18n";
|
|
260
|
+
|
|
261
|
+
// src/controls/control-actions/control-actions.tsx
|
|
262
|
+
import * as React6 from "react";
|
|
263
|
+
import { styled, UnstableFloatingActionBar } from "@elementor/ui";
|
|
264
|
+
var { useMenuItems } = controlActionsMenu;
|
|
265
|
+
var FloatingBar = styled(UnstableFloatingActionBar)`
|
|
266
|
+
& .MuiPaper-root:empty {
|
|
267
|
+
display: none;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// this is for a fix which would be added later on - to force the width externally
|
|
271
|
+
width: 100%;
|
|
272
|
+
& > :first-of-type {
|
|
273
|
+
width: 100%;
|
|
274
|
+
}
|
|
275
|
+
`;
|
|
276
|
+
function ControlActions({ fullWidth = false, children }) {
|
|
277
|
+
const items = useMenuItems().default;
|
|
278
|
+
if (items.length === 0) {
|
|
279
|
+
return children;
|
|
280
|
+
}
|
|
281
|
+
return /* @__PURE__ */ React6.createElement(
|
|
282
|
+
FloatingBar,
|
|
283
|
+
{
|
|
284
|
+
actions: items.map(({ MenuItem: MenuItem4, id }) => /* @__PURE__ */ React6.createElement(MenuItem4, { key: id })),
|
|
285
|
+
sx: fullWidth ? { width: "100%" } : void 0
|
|
286
|
+
},
|
|
287
|
+
children
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// src/controls/create-control.tsx
|
|
292
|
+
import * as React7 from "react";
|
|
293
|
+
var brandSymbol = Symbol("control");
|
|
294
|
+
function createControl(Component, { supportsReplacements = true } = {}) {
|
|
295
|
+
return (props) => {
|
|
296
|
+
const ControlReplacement = useControlReplacement();
|
|
297
|
+
if (ControlReplacement && supportsReplacements) {
|
|
298
|
+
return /* @__PURE__ */ React7.createElement(ControlReplacement, { ...props });
|
|
299
|
+
}
|
|
300
|
+
return /* @__PURE__ */ React7.createElement(Component, { ...props });
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// src/controls/control-types/image-media-control.tsx
|
|
305
|
+
var ImageMediaControl = createControl(() => {
|
|
225
306
|
const { value, setValue } = useControl();
|
|
226
|
-
const {
|
|
227
|
-
const
|
|
307
|
+
const { id, url } = value?.value ?? {};
|
|
308
|
+
const { data: attachment } = useWpMediaAttachment(id?.value || null);
|
|
309
|
+
const src = attachment?.url ?? url;
|
|
228
310
|
const { open } = useWpMediaFrame({
|
|
229
311
|
types: ["image"],
|
|
230
312
|
multiple: false,
|
|
231
|
-
selected:
|
|
313
|
+
selected: id?.value || null,
|
|
232
314
|
onSelect: (selectedAttachment) => {
|
|
233
315
|
setValue({
|
|
234
|
-
$$type: "image",
|
|
316
|
+
$$type: "image-src",
|
|
235
317
|
value: {
|
|
236
|
-
|
|
318
|
+
id: {
|
|
319
|
+
$$type: "image-attachment-id",
|
|
320
|
+
value: selectedAttachment.id
|
|
321
|
+
},
|
|
322
|
+
url: null
|
|
237
323
|
}
|
|
238
324
|
});
|
|
239
325
|
}
|
|
240
326
|
});
|
|
241
|
-
return /* @__PURE__ */
|
|
327
|
+
return /* @__PURE__ */ React8.createElement(Card, { variant: "outlined" }, /* @__PURE__ */ React8.createElement(CardMedia, { image: src, sx: { height: 150 } }), /* @__PURE__ */ React8.createElement(CardOverlay, null, /* @__PURE__ */ React8.createElement(ControlActions, null, /* @__PURE__ */ React8.createElement(Stack3, { gap: 0.5 }, /* @__PURE__ */ React8.createElement(
|
|
242
328
|
Button,
|
|
243
329
|
{
|
|
330
|
+
size: "tiny",
|
|
244
331
|
color: "inherit",
|
|
245
|
-
size: "small",
|
|
246
332
|
variant: "outlined",
|
|
247
|
-
onClick: () => {
|
|
248
|
-
open({ mode: "browse" });
|
|
249
|
-
}
|
|
333
|
+
onClick: () => open({ mode: "browse" })
|
|
250
334
|
},
|
|
251
335
|
__("Select Image", "elementor")
|
|
252
|
-
), /* @__PURE__ */
|
|
336
|
+
), /* @__PURE__ */ React8.createElement(
|
|
253
337
|
Button,
|
|
254
338
|
{
|
|
255
|
-
|
|
256
|
-
size: "small",
|
|
339
|
+
size: "tiny",
|
|
257
340
|
variant: "text",
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
341
|
+
color: "inherit",
|
|
342
|
+
startIcon: /* @__PURE__ */ React8.createElement(UploadIcon, null),
|
|
343
|
+
onClick: () => open({ mode: "upload" })
|
|
262
344
|
},
|
|
263
345
|
__("Upload Image", "elementor")
|
|
264
|
-
)));
|
|
265
|
-
};
|
|
346
|
+
)))));
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
// src/controls/control-types/select-control.tsx
|
|
350
|
+
import * as React9 from "react";
|
|
351
|
+
import { MenuItem, Select } from "@elementor/ui";
|
|
352
|
+
var SelectControl = createControl(({ options: options4 }) => {
|
|
353
|
+
const { value, setValue } = useControl();
|
|
354
|
+
const handleChange = (event) => {
|
|
355
|
+
setValue(event.target.value);
|
|
356
|
+
};
|
|
357
|
+
return /* @__PURE__ */ React9.createElement(ControlActions, null, /* @__PURE__ */ React9.createElement(Select, { size: "tiny", value: value ?? "", onChange: handleChange }, options4.map(({ label, ...props }) => /* @__PURE__ */ React9.createElement(MenuItem, { key: props.value, ...props }, label))));
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
// src/controls/control-types/image-control.tsx
|
|
361
|
+
var ImageControl = createControl((props) => {
|
|
362
|
+
const { value, setValue } = useControl();
|
|
363
|
+
const { src, size } = value?.value || {};
|
|
364
|
+
const setImageSrc = (newValue) => {
|
|
365
|
+
setValue({
|
|
366
|
+
$$type: "image",
|
|
367
|
+
value: {
|
|
368
|
+
src: newValue,
|
|
369
|
+
size
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
};
|
|
373
|
+
const setImageSize = (newValue) => {
|
|
374
|
+
setValue({
|
|
375
|
+
$$type: "image",
|
|
376
|
+
value: {
|
|
377
|
+
src,
|
|
378
|
+
size: newValue
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
};
|
|
382
|
+
return /* @__PURE__ */ React10.createElement(Stack4, { gap: 2 }, /* @__PURE__ */ React10.createElement(ControlContext.Provider, { value: { setValue: setImageSrc, value: src, bind: "src" } }, /* @__PURE__ */ React10.createElement(ImageMediaControl, null)), /* @__PURE__ */ React10.createElement(ControlContext.Provider, { value: { setValue: setImageSize, value: size, bind: "size" } }, /* @__PURE__ */ React10.createElement(Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React10.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React10.createElement(SettingsControl.Label, null, " ", __2("Image Resolution", "elementor"))), /* @__PURE__ */ React10.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React10.createElement(SelectControl, { options: props.sizes })))));
|
|
383
|
+
});
|
|
266
384
|
|
|
267
385
|
// src/controls/control-types/text-control.tsx
|
|
268
|
-
import * as
|
|
386
|
+
import * as React11 from "react";
|
|
269
387
|
import { TextField } from "@elementor/ui";
|
|
270
|
-
var TextControl = ({ placeholder }) => {
|
|
388
|
+
var TextControl = createControl(({ placeholder }) => {
|
|
271
389
|
const { value, setValue } = useControl("");
|
|
272
390
|
const handleChange = (event) => setValue(event.target.value);
|
|
273
|
-
return /* @__PURE__ */
|
|
274
|
-
};
|
|
391
|
+
return /* @__PURE__ */ React11.createElement(ControlActions, { fullWidth: true }, /* @__PURE__ */ React11.createElement(TextField, { type: "text", size: "tiny", value, onChange: handleChange, placeholder }));
|
|
392
|
+
});
|
|
275
393
|
|
|
276
394
|
// src/controls/control-types/text-area-control.tsx
|
|
277
|
-
import * as
|
|
395
|
+
import * as React12 from "react";
|
|
278
396
|
import { TextField as TextField2 } from "@elementor/ui";
|
|
279
|
-
var TextAreaControl = ({ placeholder }) => {
|
|
397
|
+
var TextAreaControl = createControl(({ placeholder }) => {
|
|
280
398
|
const { value, setValue } = useControl();
|
|
281
399
|
const handleChange = (event) => {
|
|
282
400
|
setValue(event.target.value);
|
|
283
401
|
};
|
|
284
|
-
return /* @__PURE__ */
|
|
402
|
+
return /* @__PURE__ */ React12.createElement(ControlActions, { fullWidth: true }, /* @__PURE__ */ React12.createElement(
|
|
285
403
|
TextField2,
|
|
286
404
|
{
|
|
287
405
|
size: "tiny",
|
|
@@ -292,11 +410,11 @@ var TextAreaControl = ({ placeholder }) => {
|
|
|
292
410
|
onChange: handleChange,
|
|
293
411
|
placeholder
|
|
294
412
|
}
|
|
295
|
-
);
|
|
296
|
-
};
|
|
413
|
+
));
|
|
414
|
+
});
|
|
297
415
|
|
|
298
416
|
// src/controls/control-types/size-control.tsx
|
|
299
|
-
import * as
|
|
417
|
+
import * as React14 from "react";
|
|
300
418
|
import { InputAdornment as InputAdornment2 } from "@elementor/ui";
|
|
301
419
|
|
|
302
420
|
// src/controls/hooks/use-sync-external-state.tsx
|
|
@@ -333,9 +451,9 @@ var useSyncExternalState = ({
|
|
|
333
451
|
};
|
|
334
452
|
|
|
335
453
|
// src/controls/components/text-field-inner-selection.tsx
|
|
336
|
-
import * as
|
|
337
|
-
import { bindMenu, bindTrigger, Button as Button2, InputAdornment, Menu, MenuItem, TextField as TextField3, usePopupState } from "@elementor/ui";
|
|
338
|
-
import { useId as
|
|
454
|
+
import * as React13 from "react";
|
|
455
|
+
import { bindMenu, bindTrigger, Button as Button2, InputAdornment, Menu, MenuItem as MenuItem2, TextField as TextField3, usePopupState as usePopupState2 } from "@elementor/ui";
|
|
456
|
+
import { useId as useId3 } from "react";
|
|
339
457
|
var TextFieldInnerSelection = ({
|
|
340
458
|
placeholder,
|
|
341
459
|
type,
|
|
@@ -344,7 +462,7 @@ var TextFieldInnerSelection = ({
|
|
|
344
462
|
endAdornment,
|
|
345
463
|
startAdornment
|
|
346
464
|
}) => {
|
|
347
|
-
return /* @__PURE__ */
|
|
465
|
+
return /* @__PURE__ */ React13.createElement(
|
|
348
466
|
TextField3,
|
|
349
467
|
{
|
|
350
468
|
size: "tiny",
|
|
@@ -360,19 +478,19 @@ var TextFieldInnerSelection = ({
|
|
|
360
478
|
);
|
|
361
479
|
};
|
|
362
480
|
var SelectionEndAdornment = ({
|
|
363
|
-
options:
|
|
481
|
+
options: options4,
|
|
364
482
|
onClick,
|
|
365
483
|
value
|
|
366
484
|
}) => {
|
|
367
|
-
const popupState =
|
|
485
|
+
const popupState = usePopupState2({
|
|
368
486
|
variant: "popover",
|
|
369
|
-
popupId:
|
|
487
|
+
popupId: useId3()
|
|
370
488
|
});
|
|
371
489
|
const handleMenuItemClick = (index) => {
|
|
372
|
-
onClick(
|
|
490
|
+
onClick(options4[index]);
|
|
373
491
|
popupState.close();
|
|
374
492
|
};
|
|
375
|
-
return /* @__PURE__ */
|
|
493
|
+
return /* @__PURE__ */ React13.createElement(InputAdornment, { position: "end" }, /* @__PURE__ */ React13.createElement(
|
|
376
494
|
Button2,
|
|
377
495
|
{
|
|
378
496
|
size: "small",
|
|
@@ -381,12 +499,12 @@ var SelectionEndAdornment = ({
|
|
|
381
499
|
...bindTrigger(popupState)
|
|
382
500
|
},
|
|
383
501
|
value.toUpperCase()
|
|
384
|
-
), /* @__PURE__ */
|
|
502
|
+
), /* @__PURE__ */ React13.createElement(Menu, { MenuListProps: { dense: true }, ...bindMenu(popupState) }, options4.map((option, index) => /* @__PURE__ */ React13.createElement(MenuItem2, { key: option, onClick: () => handleMenuItemClick(index) }, option.toUpperCase()))));
|
|
385
503
|
};
|
|
386
504
|
|
|
387
505
|
// src/controls/control-types/size-control.tsx
|
|
388
506
|
var defaultUnits = ["px", "%", "em", "rem", "vw"];
|
|
389
|
-
var SizeControl = ({ units = defaultUnits, placeholder, startIcon }) => {
|
|
507
|
+
var SizeControl = createControl(({ units = defaultUnits, placeholder, startIcon }) => {
|
|
390
508
|
const { value, setValue } = useControl();
|
|
391
509
|
const [state, setState] = useSyncExternalState({
|
|
392
510
|
external: value,
|
|
@@ -416,39 +534,29 @@ var SizeControl = ({ units = defaultUnits, placeholder, startIcon }) => {
|
|
|
416
534
|
}
|
|
417
535
|
}));
|
|
418
536
|
};
|
|
419
|
-
return /* @__PURE__ */
|
|
537
|
+
return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(
|
|
420
538
|
TextFieldInnerSelection,
|
|
421
539
|
{
|
|
422
|
-
endAdornment: /* @__PURE__ */
|
|
540
|
+
endAdornment: /* @__PURE__ */ React14.createElement(SelectionEndAdornment, { options: units, onClick: handleUnitChange, value: state.value.unit }),
|
|
423
541
|
placeholder,
|
|
424
|
-
startAdornment: startIcon ?? /* @__PURE__ */
|
|
542
|
+
startAdornment: startIcon ?? /* @__PURE__ */ React14.createElement(InputAdornment2, { position: "start" }, startIcon),
|
|
425
543
|
type: "number",
|
|
426
544
|
value: Number.isNaN(state.value.size) ? "" : state.value.size,
|
|
427
545
|
onChange: handleSizeChange
|
|
428
546
|
}
|
|
429
|
-
);
|
|
430
|
-
};
|
|
431
|
-
|
|
432
|
-
// src/controls/control-types/select-control.tsx
|
|
433
|
-
import * as React11 from "react";
|
|
434
|
-
import { MenuItem as MenuItem2, Select } from "@elementor/ui";
|
|
435
|
-
var SelectControl = ({ options: options2 }) => {
|
|
436
|
-
const { value, setValue } = useControl();
|
|
437
|
-
const handleChange = (event) => {
|
|
438
|
-
setValue(event.target.value);
|
|
439
|
-
};
|
|
440
|
-
return /* @__PURE__ */ React11.createElement(Select, { size: "tiny", value: value ?? "", onChange: handleChange }, options2.map(({ label, ...props }) => /* @__PURE__ */ React11.createElement(MenuItem2, { key: props.value, ...props }, label)));
|
|
441
|
-
};
|
|
547
|
+
));
|
|
548
|
+
});
|
|
442
549
|
|
|
443
550
|
// src/controls/controls-registry.tsx
|
|
444
551
|
var controlTypes = {
|
|
445
|
-
image: ImageControl,
|
|
446
|
-
text: TextControl,
|
|
447
|
-
textarea: TextAreaControl,
|
|
448
|
-
size: SizeControl,
|
|
449
|
-
select: SelectControl
|
|
552
|
+
image: { component: ImageControl, layout: "full" },
|
|
553
|
+
text: { component: TextControl, layout: "two-columns" },
|
|
554
|
+
textarea: { component: TextAreaControl, layout: "full" },
|
|
555
|
+
size: { component: SizeControl, layout: "two-columns" },
|
|
556
|
+
select: { component: SelectControl, layout: "two-columns" }
|
|
450
557
|
};
|
|
451
|
-
var getControlByType = (type) => controlTypes[type];
|
|
558
|
+
var getControlByType = (type) => controlTypes[type]?.component;
|
|
559
|
+
var getLayoutByType = (type) => controlTypes[type].layout;
|
|
452
560
|
|
|
453
561
|
// src/controls/control.tsx
|
|
454
562
|
var ControlTypeError = createError({
|
|
@@ -456,28 +564,51 @@ var ControlTypeError = createError({
|
|
|
456
564
|
message: `Control type not found.`
|
|
457
565
|
});
|
|
458
566
|
var Control = ({ props, type }) => {
|
|
459
|
-
const { value } = useControl();
|
|
460
567
|
const ControlByType = getControlByType(type);
|
|
461
568
|
if (!ControlByType) {
|
|
462
569
|
throw new ControlTypeError({
|
|
463
570
|
context: { type }
|
|
464
571
|
});
|
|
465
572
|
}
|
|
466
|
-
|
|
467
|
-
return /* @__PURE__ */ React12.createElement(ControlComponent, { ...props });
|
|
573
|
+
return /* @__PURE__ */ React15.createElement(ControlByType, { ...props });
|
|
468
574
|
};
|
|
469
575
|
|
|
576
|
+
// src/controls/components/control-type-container.tsx
|
|
577
|
+
import * as React16 from "react";
|
|
578
|
+
import { styled as styled2, Box } from "@elementor/ui";
|
|
579
|
+
var ControlTypeContainer = ({
|
|
580
|
+
controlType,
|
|
581
|
+
children
|
|
582
|
+
}) => {
|
|
583
|
+
const layout = getLayoutByType(controlType);
|
|
584
|
+
return /* @__PURE__ */ React16.createElement(StyledContainer, { layout }, children);
|
|
585
|
+
};
|
|
586
|
+
var StyledContainer = styled2(Box, {
|
|
587
|
+
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
588
|
+
})(({ layout, theme }) => ({
|
|
589
|
+
display: "grid",
|
|
590
|
+
gridGap: theme.spacing(1),
|
|
591
|
+
...getGridLayout(layout)
|
|
592
|
+
}));
|
|
593
|
+
var getGridLayout = (layout) => ({
|
|
594
|
+
justifyContent: "space-between",
|
|
595
|
+
gridTemplateColumns: {
|
|
596
|
+
full: "1fr",
|
|
597
|
+
"two-columns": "repeat(2, 1fr)"
|
|
598
|
+
}[layout]
|
|
599
|
+
});
|
|
600
|
+
|
|
470
601
|
// src/components/settings-tab.tsx
|
|
471
602
|
var SettingsTab = () => {
|
|
472
603
|
const { elementType } = useElementContext();
|
|
473
|
-
return /* @__PURE__ */
|
|
604
|
+
return /* @__PURE__ */ React17.createElement(Stack5, null, elementType.controls.map(({ type, value }, index) => {
|
|
474
605
|
if (type === "control") {
|
|
475
|
-
return /* @__PURE__ */
|
|
606
|
+
return /* @__PURE__ */ React17.createElement(Control2, { key: value.bind, control: value });
|
|
476
607
|
}
|
|
477
608
|
if (type === "section") {
|
|
478
|
-
return /* @__PURE__ */
|
|
609
|
+
return /* @__PURE__ */ React17.createElement(AccordionSection, { key: type + "." + index, title: value.label }, value.items?.map((item) => {
|
|
479
610
|
if (item.type === "control") {
|
|
480
|
-
return /* @__PURE__ */
|
|
611
|
+
return /* @__PURE__ */ React17.createElement(Control2, { key: item.value.bind, control: item.value });
|
|
481
612
|
}
|
|
482
613
|
return null;
|
|
483
614
|
}));
|
|
@@ -489,21 +620,21 @@ var Control2 = ({ control }) => {
|
|
|
489
620
|
if (!getControlByType(control.type)) {
|
|
490
621
|
return null;
|
|
491
622
|
}
|
|
492
|
-
return /* @__PURE__ */
|
|
623
|
+
return /* @__PURE__ */ React17.createElement(SettingsControl, { bind: control.bind }, /* @__PURE__ */ React17.createElement(ControlTypeContainer, { controlType: control.type }, control.label ? /* @__PURE__ */ React17.createElement(SettingsControl.Label, null, control.label) : null, /* @__PURE__ */ React17.createElement(Control, { type: control.type, props: control.props })));
|
|
493
624
|
};
|
|
494
625
|
|
|
495
626
|
// src/components/style-tab.tsx
|
|
496
|
-
import * as
|
|
627
|
+
import * as React43 from "react";
|
|
497
628
|
|
|
498
629
|
// src/contexts/style-context.tsx
|
|
499
|
-
import * as
|
|
630
|
+
import * as React18 from "react";
|
|
500
631
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
501
632
|
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
502
633
|
var Context2 = createContext3(null);
|
|
503
634
|
function StyleContext({ children, selectedStyleDef, selectedClassesProp }) {
|
|
504
635
|
const breakpoint = useActiveBreakpoint();
|
|
505
636
|
const selectedMeta = { breakpoint, state: null };
|
|
506
|
-
return /* @__PURE__ */
|
|
637
|
+
return /* @__PURE__ */ React18.createElement(Context2.Provider, { value: { selectedStyleDef, selectedMeta, selectedClassesProp } }, children);
|
|
507
638
|
}
|
|
508
639
|
function useStyleContext() {
|
|
509
640
|
const context = useContext3(Context2);
|
|
@@ -534,13 +665,13 @@ var useElementStyles = (elementID) => {
|
|
|
534
665
|
};
|
|
535
666
|
|
|
536
667
|
// src/components/style-tab.tsx
|
|
537
|
-
import { Stack as
|
|
668
|
+
import { Stack as Stack15 } from "@elementor/ui";
|
|
538
669
|
|
|
539
670
|
// src/components/style-sections/size-section.tsx
|
|
540
|
-
import * as
|
|
671
|
+
import * as React20 from "react";
|
|
541
672
|
|
|
542
673
|
// src/controls/style-control.tsx
|
|
543
|
-
import * as
|
|
674
|
+
import * as React19 from "react";
|
|
544
675
|
|
|
545
676
|
// src/hooks/use-element-style-prop.ts
|
|
546
677
|
import { commandEndEvent as commandEndEvent5, __privateUseListenTo as useListenTo5 } from "@elementor/editor-v1-adapters";
|
|
@@ -610,35 +741,35 @@ var useStyleControl = (propName) => {
|
|
|
610
741
|
// src/controls/style-control.tsx
|
|
611
742
|
var StyleControl = ({ bind, children }) => {
|
|
612
743
|
const [value, setValue] = useStyleControl(bind);
|
|
613
|
-
return /* @__PURE__ */
|
|
744
|
+
return /* @__PURE__ */ React19.createElement(ControlContext.Provider, { value: { bind, value, setValue } }, children);
|
|
614
745
|
};
|
|
615
746
|
StyleControl.Label = ControlLabel;
|
|
616
747
|
|
|
617
748
|
// src/components/style-sections/size-section.tsx
|
|
618
|
-
import { Stack as
|
|
619
|
-
import { __ as
|
|
749
|
+
import { Grid as Grid2, Stack as Stack6 } from "@elementor/ui";
|
|
750
|
+
import { __ as __3 } from "@wordpress/i18n";
|
|
620
751
|
var SizeSection = () => {
|
|
621
|
-
return /* @__PURE__ */
|
|
752
|
+
return /* @__PURE__ */ React20.createElement(AccordionSection, { title: __3("Size", "elementor") }, /* @__PURE__ */ React20.createElement(Stack6, { gap: 1.5 }, /* @__PURE__ */ React20.createElement(Grid2, { container: true, spacing: 2 }, /* @__PURE__ */ React20.createElement(Control3, { bind: "width", label: __3("Width", "elementor") }), /* @__PURE__ */ React20.createElement(Control3, { bind: "height", label: __3("Height", "elementor") })), /* @__PURE__ */ React20.createElement(Grid2, { container: true, spacing: 2 }, /* @__PURE__ */ React20.createElement(Control3, { bind: "min-width", label: __3("Min. Width", "elementor") }), /* @__PURE__ */ React20.createElement(Control3, { bind: "min-height", label: __3("Min. Height", "elementor") })), /* @__PURE__ */ React20.createElement(Grid2, { container: true, spacing: 2 }, /* @__PURE__ */ React20.createElement(Control3, { bind: "max-width", label: __3("Max. Width", "elementor") }), /* @__PURE__ */ React20.createElement(Control3, { bind: "max-height", label: __3("Max. Height", "elementor") }))));
|
|
622
753
|
};
|
|
623
754
|
var Control3 = ({ label, bind }) => {
|
|
624
|
-
return /* @__PURE__ */
|
|
755
|
+
return /* @__PURE__ */ React20.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React20.createElement(StyleControl, { bind }, /* @__PURE__ */ React20.createElement(Grid2, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React20.createElement(Grid2, { item: true, xs: 12 }, /* @__PURE__ */ React20.createElement(StyleControl.Label, null, label)), /* @__PURE__ */ React20.createElement(Grid2, { item: true, xs: 12 }, /* @__PURE__ */ React20.createElement(Control, { type: "size" })))));
|
|
625
756
|
};
|
|
626
757
|
|
|
627
758
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
628
|
-
import * as
|
|
629
|
-
import { Divider, Stack as
|
|
759
|
+
import * as React34 from "react";
|
|
760
|
+
import { Divider, Stack as Stack8 } from "@elementor/ui";
|
|
630
761
|
|
|
631
762
|
// src/components/style-sections/typography-section/text-style-control.tsx
|
|
632
|
-
import * as
|
|
633
|
-
import {
|
|
763
|
+
import * as React21 from "react";
|
|
764
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
765
|
+
import { Grid as Grid3, ToggleButton as ToggleButtonBase, ToggleButtonGroup } from "@elementor/ui";
|
|
634
766
|
import { ItalicIcon, StrikethroughIcon, UnderlineIcon } from "@elementor/icons";
|
|
635
|
-
import { __ as __3 } from "@wordpress/i18n";
|
|
636
767
|
var buttonSize = "tiny";
|
|
637
768
|
var TextStyleControl = () => {
|
|
638
|
-
const [fontStyle, setFontStyle] = useStyleControl("
|
|
639
|
-
const [textDecoration, setTextDecoration] = useStyleControl("
|
|
769
|
+
const [fontStyle, setFontStyle] = useStyleControl("font-style");
|
|
770
|
+
const [textDecoration, setTextDecoration] = useStyleControl("text-decoration");
|
|
640
771
|
const formats = [fontStyle, ...(textDecoration || "").split(" ")];
|
|
641
|
-
return /* @__PURE__ */
|
|
772
|
+
return /* @__PURE__ */ React21.createElement(Grid3, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React21.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React21.createElement(ControlLabel, null, __4("Style", "elementor"))), /* @__PURE__ */ React21.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React21.createElement(ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React21.createElement(
|
|
642
773
|
ToggleButton,
|
|
643
774
|
{
|
|
644
775
|
value: "italic",
|
|
@@ -646,8 +777,8 @@ var TextStyleControl = () => {
|
|
|
646
777
|
"aria-label": "italic",
|
|
647
778
|
sx: { marginLeft: "auto" }
|
|
648
779
|
},
|
|
649
|
-
/* @__PURE__ */
|
|
650
|
-
), /* @__PURE__ */
|
|
780
|
+
/* @__PURE__ */ React21.createElement(ItalicIcon, { fontSize: buttonSize })
|
|
781
|
+
), /* @__PURE__ */ React21.createElement(
|
|
651
782
|
ShorthandControl,
|
|
652
783
|
{
|
|
653
784
|
value: "line-through",
|
|
@@ -655,8 +786,8 @@ var TextStyleControl = () => {
|
|
|
655
786
|
updateValues: setTextDecoration,
|
|
656
787
|
"aria-label": "line-through"
|
|
657
788
|
},
|
|
658
|
-
/* @__PURE__ */
|
|
659
|
-
), /* @__PURE__ */
|
|
789
|
+
/* @__PURE__ */ React21.createElement(StrikethroughIcon, { fontSize: buttonSize })
|
|
790
|
+
), /* @__PURE__ */ React21.createElement(
|
|
660
791
|
ShorthandControl,
|
|
661
792
|
{
|
|
662
793
|
value: "underline",
|
|
@@ -664,8 +795,8 @@ var TextStyleControl = () => {
|
|
|
664
795
|
updateValues: setTextDecoration,
|
|
665
796
|
"aria-label": "underline"
|
|
666
797
|
},
|
|
667
|
-
/* @__PURE__ */
|
|
668
|
-
)));
|
|
798
|
+
/* @__PURE__ */ React21.createElement(UnderlineIcon, { fontSize: buttonSize })
|
|
799
|
+
))));
|
|
669
800
|
};
|
|
670
801
|
var ShorthandControl = ({
|
|
671
802
|
children,
|
|
@@ -683,92 +814,95 @@ var ShorthandControl = ({
|
|
|
683
814
|
updateValues([...valuesArr, newValue].join(" "));
|
|
684
815
|
}
|
|
685
816
|
};
|
|
686
|
-
return /* @__PURE__ */
|
|
817
|
+
return /* @__PURE__ */ React21.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
687
818
|
};
|
|
688
819
|
var ToggleButton = ({ onChange, ...props }) => {
|
|
689
820
|
const handleChange = (_e, newValue) => {
|
|
690
821
|
onChange(newValue);
|
|
691
822
|
};
|
|
692
|
-
return /* @__PURE__ */
|
|
823
|
+
return /* @__PURE__ */ React21.createElement(ToggleButtonBase, { ...props, onChange: handleChange, size: buttonSize });
|
|
693
824
|
};
|
|
694
825
|
|
|
695
826
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
696
|
-
import { __ as
|
|
827
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
697
828
|
|
|
698
829
|
// src/components/style-sections/typography-section/font-size-control.tsx
|
|
699
|
-
import * as
|
|
700
|
-
import { __ as
|
|
830
|
+
import * as React22 from "react";
|
|
831
|
+
import { __ as __5 } from "@wordpress/i18n";
|
|
832
|
+
import { Grid as Grid4 } from "@elementor/ui";
|
|
701
833
|
var FontSizeControl = () => {
|
|
702
|
-
return /* @__PURE__ */
|
|
834
|
+
return /* @__PURE__ */ React22.createElement(StyleControl, { bind: "font-size" }, /* @__PURE__ */ React22.createElement(Grid4, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React22.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React22.createElement(StyleControl.Label, null, __5("Font Size", "elementor"))), /* @__PURE__ */ React22.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React22.createElement(SizeControl, null))));
|
|
703
835
|
};
|
|
704
836
|
|
|
705
837
|
// src/components/style-sections/typography-section/font-weight-control.tsx
|
|
706
|
-
import * as
|
|
707
|
-
import { __ as
|
|
838
|
+
import * as React23 from "react";
|
|
839
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
840
|
+
import { Grid as Grid5 } from "@elementor/ui";
|
|
708
841
|
var fontWeightOptions = [
|
|
709
|
-
{ label:
|
|
710
|
-
{ label:
|
|
711
|
-
{ label:
|
|
712
|
-
{ label:
|
|
713
|
-
{ label:
|
|
842
|
+
{ label: __6("Light - 400", "elementor"), value: "400" },
|
|
843
|
+
{ label: __6("Regular - 500", "elementor"), value: "500" },
|
|
844
|
+
{ label: __6("Semi Bold - 600", "elementor"), value: "600" },
|
|
845
|
+
{ label: __6("Bold - 700", "elementor"), value: "700" },
|
|
846
|
+
{ label: __6("Black - 900", "elementor"), value: "900" }
|
|
714
847
|
];
|
|
715
848
|
var FontWeightControl = () => {
|
|
716
|
-
return /* @__PURE__ */
|
|
849
|
+
return /* @__PURE__ */ React23.createElement(StyleControl, { bind: "font-weight" }, /* @__PURE__ */ React23.createElement(Grid5, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React23.createElement(StyleControl.Label, null, __6("Font Weight", "elementor"))), /* @__PURE__ */ React23.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React23.createElement(SelectControl, { options: fontWeightOptions }))));
|
|
717
850
|
};
|
|
718
851
|
|
|
719
852
|
// src/components/style-sections/typography-section/text-color-control.tsx
|
|
720
|
-
import * as
|
|
721
|
-
import { __ as
|
|
853
|
+
import * as React25 from "react";
|
|
854
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
855
|
+
import { Grid as Grid6 } from "@elementor/ui";
|
|
722
856
|
|
|
723
857
|
// src/controls/control-types/color-control.tsx
|
|
724
|
-
import * as
|
|
858
|
+
import * as React24 from "react";
|
|
725
859
|
import { UnstableColorPicker } from "@elementor/ui";
|
|
726
|
-
var ColorControl = (
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
};
|
|
739
|
-
};
|
|
860
|
+
var ColorControl = createControl(
|
|
861
|
+
(props) => {
|
|
862
|
+
const { value, setValue } = useControl();
|
|
863
|
+
const handleChange = (selectedColor) => {
|
|
864
|
+
setValue({
|
|
865
|
+
$$type: "color",
|
|
866
|
+
value: selectedColor
|
|
867
|
+
});
|
|
868
|
+
};
|
|
869
|
+
return /* @__PURE__ */ React24.createElement(ControlActions, null, /* @__PURE__ */ React24.createElement(UnstableColorPicker, { size: "tiny", ...props, value: value?.value, onChange: handleChange }));
|
|
870
|
+
}
|
|
871
|
+
);
|
|
740
872
|
|
|
741
873
|
// src/components/style-sections/typography-section/text-color-control.tsx
|
|
742
874
|
var TextColorControl = () => {
|
|
743
|
-
return /* @__PURE__ */
|
|
875
|
+
return /* @__PURE__ */ React25.createElement(StyleControl, { bind: "color" }, /* @__PURE__ */ React25.createElement(Grid6, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React25.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React25.createElement(StyleControl.Label, null, __7("Text Color", "elementor"))), /* @__PURE__ */ React25.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React25.createElement(ColorControl, null))));
|
|
744
876
|
};
|
|
745
877
|
|
|
746
878
|
// src/components/style-sections/typography-section/letter-spacing-control.tsx
|
|
747
|
-
import * as
|
|
748
|
-
import { __ as
|
|
879
|
+
import * as React26 from "react";
|
|
880
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
881
|
+
import { Grid as Grid7 } from "@elementor/ui";
|
|
749
882
|
var LetterSpacingControl = () => {
|
|
750
|
-
return /* @__PURE__ */
|
|
883
|
+
return /* @__PURE__ */ React26.createElement(StyleControl, { bind: "letter-spacing" }, /* @__PURE__ */ React26.createElement(Grid7, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React26.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(StyleControl.Label, null, __8("Letter Spacing", "elementor"))), /* @__PURE__ */ React26.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(SizeControl, null))));
|
|
751
884
|
};
|
|
752
885
|
|
|
753
886
|
// src/components/style-sections/typography-section/word-spacing-control.tsx
|
|
754
|
-
import * as
|
|
755
|
-
import { __ as
|
|
887
|
+
import * as React27 from "react";
|
|
888
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
889
|
+
import { Grid as Grid8 } from "@elementor/ui";
|
|
756
890
|
var WordSpacingControl = () => {
|
|
757
|
-
return /* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ React27.createElement(StyleControl, { bind: "word-spacing" }, /* @__PURE__ */ React27.createElement(Grid8, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React27.createElement(StyleControl.Label, null, __9("Word Spacing", "elementor"))), /* @__PURE__ */ React27.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React27.createElement(SizeControl, null))));
|
|
758
892
|
};
|
|
759
893
|
|
|
760
894
|
// src/components/collapsible-content.tsx
|
|
761
|
-
import * as
|
|
895
|
+
import * as React28 from "react";
|
|
762
896
|
import { useState as useState2 } from "react";
|
|
763
897
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
764
|
-
import { Button as Button3, Collapse, Stack as
|
|
765
|
-
import { __ as
|
|
898
|
+
import { Button as Button3, Collapse, Stack as Stack7, styled as styled3 } from "@elementor/ui";
|
|
899
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
766
900
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
767
901
|
const [open, setOpen] = useState2(defaultOpen);
|
|
768
902
|
const handleToggle = () => {
|
|
769
903
|
setOpen((prevOpen) => !prevOpen);
|
|
770
904
|
};
|
|
771
|
-
return /* @__PURE__ */
|
|
905
|
+
return /* @__PURE__ */ React28.createElement(Stack7, { sx: { py: 0.5 } }, /* @__PURE__ */ React28.createElement(
|
|
772
906
|
Button3,
|
|
773
907
|
{
|
|
774
908
|
fullWidth: true,
|
|
@@ -776,12 +910,12 @@ var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
|
776
910
|
color: "secondary",
|
|
777
911
|
variant: "outlined",
|
|
778
912
|
onClick: handleToggle,
|
|
779
|
-
endIcon: /* @__PURE__ */
|
|
913
|
+
endIcon: /* @__PURE__ */ React28.createElement(ChevronIcon, { open })
|
|
780
914
|
},
|
|
781
|
-
open ?
|
|
782
|
-
), /* @__PURE__ */
|
|
915
|
+
open ? __10("Show less", "elementor") : __10("Show more", "elementor")
|
|
916
|
+
), /* @__PURE__ */ React28.createElement(Collapse, { in: open, timeout: "auto" }, children));
|
|
783
917
|
};
|
|
784
|
-
var ChevronIcon =
|
|
918
|
+
var ChevronIcon = styled3(ChevronDownIcon, {
|
|
785
919
|
shouldForwardProp: (prop) => prop !== "open"
|
|
786
920
|
})(({ theme, open }) => ({
|
|
787
921
|
transform: open ? "rotate(180deg)" : "rotate(0)",
|
|
@@ -791,16 +925,18 @@ var ChevronIcon = styled2(ChevronDownIcon, {
|
|
|
791
925
|
}));
|
|
792
926
|
|
|
793
927
|
// src/components/style-sections/typography-section/transform-control.tsx
|
|
794
|
-
import * as
|
|
795
|
-
import { __ as
|
|
928
|
+
import * as React31 from "react";
|
|
929
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
930
|
+
import { Grid as Grid9 } from "@elementor/ui";
|
|
931
|
+
import { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon } from "@elementor/icons";
|
|
796
932
|
|
|
797
933
|
// src/controls/control-types/toggle-control.tsx
|
|
798
|
-
import * as
|
|
934
|
+
import * as React30 from "react";
|
|
799
935
|
|
|
800
936
|
// src/controls/components/control-toggle-button-group.tsx
|
|
801
|
-
import * as
|
|
802
|
-
import { styled as
|
|
803
|
-
var StyledToggleButtonGroup =
|
|
937
|
+
import * as React29 from "react";
|
|
938
|
+
import { styled as styled4, ToggleButton as ToggleButton2, ToggleButtonGroup as ToggleButtonGroup2 } from "@elementor/ui";
|
|
939
|
+
var StyledToggleButtonGroup = styled4(ToggleButtonGroup2)`
|
|
804
940
|
${({ justify }) => `justify-content: ${justify};`}
|
|
805
941
|
`;
|
|
806
942
|
var ControlToggleButtonGroup = ({
|
|
@@ -814,61 +950,111 @@ var ControlToggleButtonGroup = ({
|
|
|
814
950
|
const handleChange = (_, newValue) => {
|
|
815
951
|
onChange(newValue);
|
|
816
952
|
};
|
|
817
|
-
return /* @__PURE__ */
|
|
953
|
+
return /* @__PURE__ */ React29.createElement(StyledToggleButtonGroup, { justify, value, onChange: handleChange, exclusive }, items.map(({ label, value: buttonValue, icon: Icon }) => /* @__PURE__ */ React29.createElement(ToggleButton2, { key: buttonValue, value: buttonValue, "aria-label": label, size }, /* @__PURE__ */ React29.createElement(Icon, { fontSize: size }))));
|
|
818
954
|
};
|
|
819
955
|
|
|
820
956
|
// src/controls/control-types/toggle-control.tsx
|
|
821
|
-
var ToggleControl = ({ options:
|
|
957
|
+
var ToggleControl = createControl(({ options: options4 }) => {
|
|
822
958
|
const { value, setValue } = useControl();
|
|
823
959
|
const handleToggle = (option) => {
|
|
824
960
|
setValue(option || void 0);
|
|
825
961
|
};
|
|
826
|
-
return /* @__PURE__ */
|
|
962
|
+
return /* @__PURE__ */ React30.createElement(
|
|
827
963
|
ControlToggleButtonGroup,
|
|
828
964
|
{
|
|
829
|
-
items:
|
|
965
|
+
items: options4,
|
|
830
966
|
value: value || null,
|
|
831
967
|
onChange: handleToggle,
|
|
832
968
|
exclusive: true
|
|
833
969
|
}
|
|
834
970
|
);
|
|
835
|
-
};
|
|
971
|
+
});
|
|
836
972
|
|
|
837
973
|
// src/components/style-sections/typography-section/transform-control.tsx
|
|
838
|
-
import { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon } from "@elementor/icons";
|
|
839
974
|
var options = [
|
|
840
|
-
{ value: "capitalize", label:
|
|
841
|
-
{ value: "uppercase", label:
|
|
842
|
-
{ value: "lowercase", label:
|
|
975
|
+
{ value: "capitalize", label: __11("Capitalize", "elementor"), icon: LetterCaseIcon },
|
|
976
|
+
{ value: "uppercase", label: __11("Uppercase", "elementor"), icon: LetterCaseUpperIcon },
|
|
977
|
+
{ value: "lowercase", label: __11("Lowercase", "elementor"), icon: LetterCaseLowerIcon }
|
|
978
|
+
];
|
|
979
|
+
var TransformControl = () => /* @__PURE__ */ React31.createElement(StyleControl, { bind: "text-transform" }, /* @__PURE__ */ React31.createElement(Grid9, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React31.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(StyleControl.Label, null, __11("Transform", "elementor"))), /* @__PURE__ */ React31.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ToggleControl, { options }))));
|
|
980
|
+
|
|
981
|
+
// src/components/style-sections/typography-section/text-alignment-control.tsx
|
|
982
|
+
import * as React32 from "react";
|
|
983
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
984
|
+
import { Grid as Grid10 } from "@elementor/ui";
|
|
985
|
+
import { AlignLeftIcon, AlignCenterIcon, AlignRightIcon, AlignJustifiedIcon } from "@elementor/icons";
|
|
986
|
+
var options2 = [
|
|
987
|
+
{
|
|
988
|
+
value: "left",
|
|
989
|
+
label: __12("Left", "elementor"),
|
|
990
|
+
icon: AlignLeftIcon
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
value: "center",
|
|
994
|
+
label: __12("Center", "elementor"),
|
|
995
|
+
icon: AlignCenterIcon
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
value: "right",
|
|
999
|
+
label: __12("Right", "elementor"),
|
|
1000
|
+
icon: AlignRightIcon
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
value: "justify",
|
|
1004
|
+
label: __12("Justify", "elementor"),
|
|
1005
|
+
icon: AlignJustifiedIcon
|
|
1006
|
+
}
|
|
843
1007
|
];
|
|
844
|
-
var
|
|
845
|
-
return /* @__PURE__ */
|
|
1008
|
+
var TextAlignmentControl = () => {
|
|
1009
|
+
return /* @__PURE__ */ React32.createElement(StyleControl, { bind: "text-align" }, /* @__PURE__ */ React32.createElement(Grid10, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React32.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(StyleControl.Label, null, __12("Alignment", "elementor"))), /* @__PURE__ */ React32.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ToggleControl, { options: options2 }))));
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
// src/components/style-sections/typography-section/text-direction-control.tsx
|
|
1013
|
+
import * as React33 from "react";
|
|
1014
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
1015
|
+
import { Grid as Grid11 } from "@elementor/ui";
|
|
1016
|
+
import { TextDirectionLtrIcon, TextDirectionRtlIcon } from "@elementor/icons";
|
|
1017
|
+
var options3 = [
|
|
1018
|
+
{
|
|
1019
|
+
value: "ltr",
|
|
1020
|
+
label: __13("Left to Right", "elementor"),
|
|
1021
|
+
icon: TextDirectionLtrIcon
|
|
1022
|
+
},
|
|
1023
|
+
{
|
|
1024
|
+
value: "rtl",
|
|
1025
|
+
label: __13("Right to Left", "elementor"),
|
|
1026
|
+
icon: TextDirectionRtlIcon
|
|
1027
|
+
}
|
|
1028
|
+
];
|
|
1029
|
+
var TextDirectionControl = () => {
|
|
1030
|
+
return /* @__PURE__ */ React33.createElement(StyleControl, { bind: "direction" }, /* @__PURE__ */ React33.createElement(Grid11, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React33.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(StyleControl.Label, null, __13("Direction", "elementor"))), /* @__PURE__ */ React33.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(ToggleControl, { options: options3 }))));
|
|
846
1031
|
};
|
|
847
1032
|
|
|
848
1033
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
849
1034
|
var TypographySection = () => {
|
|
850
|
-
return /* @__PURE__ */
|
|
1035
|
+
return /* @__PURE__ */ React34.createElement(AccordionSection, { title: __14("Typography", "elementor") }, /* @__PURE__ */ React34.createElement(Stack8, { gap: 1.5 }, /* @__PURE__ */ React34.createElement(FontWeightControl, null), /* @__PURE__ */ React34.createElement(FontSizeControl, null), /* @__PURE__ */ React34.createElement(Divider, null), /* @__PURE__ */ React34.createElement(TextColorControl, null), /* @__PURE__ */ React34.createElement(CollapsibleContent, null, /* @__PURE__ */ React34.createElement(Stack8, { gap: 1.5, sx: { pt: 1.5 } }, /* @__PURE__ */ React34.createElement(LetterSpacingControl, null), /* @__PURE__ */ React34.createElement(WordSpacingControl, null), /* @__PURE__ */ React34.createElement(Divider, null), /* @__PURE__ */ React34.createElement(TextAlignmentControl, null), /* @__PURE__ */ React34.createElement(TextStyleControl, null), /* @__PURE__ */ React34.createElement(TransformControl, null), /* @__PURE__ */ React34.createElement(TextDirectionControl, null)))));
|
|
851
1036
|
};
|
|
852
1037
|
|
|
853
1038
|
// src/components/style-sections/position-section/position-section.tsx
|
|
854
|
-
import * as
|
|
855
|
-
import { Stack as
|
|
1039
|
+
import * as React37 from "react";
|
|
1040
|
+
import { Stack as Stack9 } from "@elementor/ui";
|
|
856
1041
|
|
|
857
1042
|
// src/components/style-sections/position-section/z-index-control.tsx
|
|
858
|
-
import * as
|
|
859
|
-
import { __ as
|
|
1043
|
+
import * as React36 from "react";
|
|
1044
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
1045
|
+
import { Grid as Grid12 } from "@elementor/ui";
|
|
860
1046
|
|
|
861
1047
|
// src/controls/control-types/number-control.tsx
|
|
862
|
-
import * as
|
|
1048
|
+
import * as React35 from "react";
|
|
863
1049
|
import { TextField as TextField4 } from "@elementor/ui";
|
|
864
1050
|
var isEmptyOrNaN = (value) => value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
865
|
-
var NumberControl = ({ placeholder }) => {
|
|
1051
|
+
var NumberControl = createControl(({ placeholder }) => {
|
|
866
1052
|
const { value, setValue } = useControl();
|
|
867
1053
|
const handleChange = (event) => {
|
|
868
1054
|
const eventValue = event.target.value;
|
|
869
1055
|
setValue(isEmptyOrNaN(eventValue) ? void 0 : Number(eventValue));
|
|
870
1056
|
};
|
|
871
|
-
return /* @__PURE__ */
|
|
1057
|
+
return /* @__PURE__ */ React35.createElement(ControlActions, null, /* @__PURE__ */ React35.createElement(
|
|
872
1058
|
TextField4,
|
|
873
1059
|
{
|
|
874
1060
|
size: "tiny",
|
|
@@ -877,33 +1063,33 @@ var NumberControl = ({ placeholder }) => {
|
|
|
877
1063
|
onChange: handleChange,
|
|
878
1064
|
placeholder
|
|
879
1065
|
}
|
|
880
|
-
);
|
|
881
|
-
};
|
|
1066
|
+
));
|
|
1067
|
+
});
|
|
882
1068
|
|
|
883
1069
|
// src/components/style-sections/position-section/z-index-control.tsx
|
|
884
1070
|
var ZIndexControl = () => {
|
|
885
|
-
return /* @__PURE__ */
|
|
1071
|
+
return /* @__PURE__ */ React36.createElement(StyleControl, { bind: "z-index" }, /* @__PURE__ */ React36.createElement(Grid12, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React36.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(StyleControl.Label, null, __15("Z-Index", "elementor"))), /* @__PURE__ */ React36.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(NumberControl, null))));
|
|
886
1072
|
};
|
|
887
1073
|
|
|
888
1074
|
// src/components/style-sections/position-section/position-section.tsx
|
|
889
|
-
import { __ as
|
|
1075
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
890
1076
|
var PositionSection = () => {
|
|
891
|
-
return /* @__PURE__ */
|
|
1077
|
+
return /* @__PURE__ */ React37.createElement(AccordionSection, { title: __16("Position", "elementor") }, /* @__PURE__ */ React37.createElement(Stack9, { gap: 1.5 }, /* @__PURE__ */ React37.createElement(ZIndexControl, null)));
|
|
892
1078
|
};
|
|
893
1079
|
|
|
894
1080
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
895
|
-
import * as
|
|
896
|
-
import { Divider as Divider2, Stack as
|
|
897
|
-
import { __ as
|
|
1081
|
+
import * as React39 from "react";
|
|
1082
|
+
import { Divider as Divider2, Stack as Stack11 } from "@elementor/ui";
|
|
1083
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
898
1084
|
|
|
899
1085
|
// src/components/style-sections/spacing-section/linked-dimensions-control.tsx
|
|
900
|
-
import * as
|
|
901
|
-
import {
|
|
1086
|
+
import * as React38 from "react";
|
|
1087
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
1088
|
+
import { Grid as Grid13, Stack as Stack10, ToggleButton as ToggleButton3 } from "@elementor/ui";
|
|
902
1089
|
import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
903
|
-
import { __ as __14 } from "@wordpress/i18n";
|
|
904
1090
|
var LinkedDimensionsControl = ({ label }) => {
|
|
905
1091
|
const { value, setValue } = useControl();
|
|
906
|
-
const { top, right, bottom, left, isLinked =
|
|
1092
|
+
const { top, right, bottom, left, isLinked = true } = value?.value || {};
|
|
907
1093
|
const setLinkedValue = (position, newValue) => {
|
|
908
1094
|
const updatedValue = {
|
|
909
1095
|
isLinked,
|
|
@@ -932,57 +1118,57 @@ var LinkedDimensionsControl = ({ label }) => {
|
|
|
932
1118
|
});
|
|
933
1119
|
};
|
|
934
1120
|
const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
|
|
935
|
-
return /* @__PURE__ */
|
|
1121
|
+
return /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement(Stack10, { direction: "row", gap: 2 }, /* @__PURE__ */ React38.createElement(ControlLabel, null, label), /* @__PURE__ */ React38.createElement(
|
|
936
1122
|
ToggleButton3,
|
|
937
1123
|
{
|
|
938
|
-
"aria-label":
|
|
1124
|
+
"aria-label": __17("Link Inputs", "elementor"),
|
|
939
1125
|
size: "tiny",
|
|
940
1126
|
value: "check",
|
|
941
1127
|
selected: isLinked,
|
|
942
1128
|
sx: { marginLeft: "auto" },
|
|
943
1129
|
onChange: toggleLinked
|
|
944
1130
|
},
|
|
945
|
-
/* @__PURE__ */
|
|
946
|
-
)), /* @__PURE__ */
|
|
1131
|
+
/* @__PURE__ */ React38.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1132
|
+
)), /* @__PURE__ */ React38.createElement(Stack10, { direction: "row", gap: 2 }, /* @__PURE__ */ React38.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React38.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(ControlLabel, null, __17("Top", "elementor"))), /* @__PURE__ */ React38.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(
|
|
947
1133
|
Control4,
|
|
948
1134
|
{
|
|
949
1135
|
bind: "top",
|
|
950
1136
|
value: top,
|
|
951
1137
|
setValue: setLinkedValue,
|
|
952
|
-
startIcon: /* @__PURE__ */
|
|
1138
|
+
startIcon: /* @__PURE__ */ React38.createElement(SideTopIcon, { fontSize: "tiny" })
|
|
953
1139
|
}
|
|
954
|
-
)), /* @__PURE__ */
|
|
1140
|
+
))), /* @__PURE__ */ React38.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React38.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(ControlLabel, null, __17("Right", "elementor"))), /* @__PURE__ */ React38.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(
|
|
955
1141
|
Control4,
|
|
956
1142
|
{
|
|
957
1143
|
bind: "right",
|
|
958
1144
|
value: right,
|
|
959
1145
|
setValue: setLinkedValue,
|
|
960
|
-
startIcon: /* @__PURE__ */
|
|
1146
|
+
startIcon: /* @__PURE__ */ React38.createElement(SideRightIcon, { fontSize: "tiny" })
|
|
961
1147
|
}
|
|
962
|
-
))), /* @__PURE__ */
|
|
1148
|
+
)))), /* @__PURE__ */ React38.createElement(Stack10, { direction: "row", gap: 2 }, /* @__PURE__ */ React38.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React38.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(ControlLabel, null, __17("Bottom", "elementor"))), /* @__PURE__ */ React38.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(
|
|
963
1149
|
Control4,
|
|
964
1150
|
{
|
|
965
1151
|
bind: "bottom",
|
|
966
1152
|
value: bottom,
|
|
967
1153
|
setValue: setLinkedValue,
|
|
968
|
-
startIcon: /* @__PURE__ */
|
|
1154
|
+
startIcon: /* @__PURE__ */ React38.createElement(SideBottomIcon, { fontSize: "tiny" })
|
|
969
1155
|
}
|
|
970
|
-
)), /* @__PURE__ */
|
|
1156
|
+
))), /* @__PURE__ */ React38.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React38.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(ControlLabel, null, __17("Left", "elementor"))), /* @__PURE__ */ React38.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(
|
|
971
1157
|
Control4,
|
|
972
1158
|
{
|
|
973
1159
|
bind: "left",
|
|
974
1160
|
value: left,
|
|
975
1161
|
setValue: setLinkedValue,
|
|
976
|
-
startIcon: /* @__PURE__ */
|
|
1162
|
+
startIcon: /* @__PURE__ */ React38.createElement(SideLeftIcon, { fontSize: "tiny" })
|
|
977
1163
|
}
|
|
978
|
-
))));
|
|
1164
|
+
)))));
|
|
979
1165
|
};
|
|
980
1166
|
var Control4 = ({
|
|
981
1167
|
bind,
|
|
982
1168
|
startIcon,
|
|
983
1169
|
value,
|
|
984
1170
|
setValue
|
|
985
|
-
}) => /* @__PURE__ */
|
|
1171
|
+
}) => /* @__PURE__ */ React38.createElement(
|
|
986
1172
|
ControlContext.Provider,
|
|
987
1173
|
{
|
|
988
1174
|
value: {
|
|
@@ -991,12 +1177,324 @@ var Control4 = ({
|
|
|
991
1177
|
value
|
|
992
1178
|
}
|
|
993
1179
|
},
|
|
994
|
-
/* @__PURE__ */
|
|
1180
|
+
/* @__PURE__ */ React38.createElement(SizeControl, { startIcon })
|
|
995
1181
|
);
|
|
996
1182
|
|
|
997
1183
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
998
1184
|
var SpacingSection = () => {
|
|
999
|
-
return /* @__PURE__ */
|
|
1185
|
+
return /* @__PURE__ */ React39.createElement(AccordionSection, { title: __18("Spacing", "elementor") }, /* @__PURE__ */ React39.createElement(Stack11, { gap: 1.5 }, /* @__PURE__ */ React39.createElement(StyleControl, { bind: "padding" }, /* @__PURE__ */ React39.createElement(LinkedDimensionsControl, { label: __18("Padding", "elementor") })), /* @__PURE__ */ React39.createElement(Divider2, null), /* @__PURE__ */ React39.createElement(StyleControl, { bind: "margin" }, /* @__PURE__ */ React39.createElement(LinkedDimensionsControl, { label: __18("Margin", "elementor") }))));
|
|
1186
|
+
};
|
|
1187
|
+
|
|
1188
|
+
// src/components/style-sections/effects-section/effects-section.tsx
|
|
1189
|
+
import * as React42 from "react";
|
|
1190
|
+
import { __ as __21 } from "@wordpress/i18n";
|
|
1191
|
+
import { Stack as Stack14 } from "@elementor/ui";
|
|
1192
|
+
|
|
1193
|
+
// src/components/style-sections/effects-section/box-shadow-repeater.tsx
|
|
1194
|
+
import * as React41 from "react";
|
|
1195
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
1196
|
+
import { Grid as Grid14, Stack as Stack13, UnstableColorIndicator } from "@elementor/ui";
|
|
1197
|
+
|
|
1198
|
+
// src/controls/components/repeater.tsx
|
|
1199
|
+
import * as React40 from "react";
|
|
1200
|
+
import { useId as useId4, useRef, useState as useState3 } from "react";
|
|
1201
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
1202
|
+
import { PlusIcon, XIcon as XIcon2, CopyIcon, EyeIcon, EyeOffIcon } from "@elementor/icons";
|
|
1203
|
+
import {
|
|
1204
|
+
Box as Box2,
|
|
1205
|
+
Stack as Stack12,
|
|
1206
|
+
Popover as Popover2,
|
|
1207
|
+
IconButton as IconButton2,
|
|
1208
|
+
bindTrigger as bindTrigger2,
|
|
1209
|
+
bindPopover as bindPopover2,
|
|
1210
|
+
usePopupState as usePopupState3,
|
|
1211
|
+
UnstableTag,
|
|
1212
|
+
Typography as Typography3
|
|
1213
|
+
} from "@elementor/ui";
|
|
1214
|
+
var SIZE2 = "tiny";
|
|
1215
|
+
var Repeater = ({
|
|
1216
|
+
label,
|
|
1217
|
+
itemSettings,
|
|
1218
|
+
values: repeaterValues = [],
|
|
1219
|
+
setValues: setRepeaterValues
|
|
1220
|
+
}) => {
|
|
1221
|
+
const addRepeaterItem = () => {
|
|
1222
|
+
const newItem = structuredClone(itemSettings.initialValues);
|
|
1223
|
+
setRepeaterValues([...repeaterValues, newItem]);
|
|
1224
|
+
};
|
|
1225
|
+
const duplicateRepeaterItem = (index) => {
|
|
1226
|
+
setRepeaterValues([
|
|
1227
|
+
...repeaterValues.slice(0, index),
|
|
1228
|
+
structuredClone(repeaterValues[index]),
|
|
1229
|
+
...repeaterValues.slice(index)
|
|
1230
|
+
]);
|
|
1231
|
+
};
|
|
1232
|
+
const removeRepeaterItem = (index) => {
|
|
1233
|
+
setRepeaterValues(repeaterValues.filter((_, i) => i !== index));
|
|
1234
|
+
};
|
|
1235
|
+
const toggleDisableRepeaterItem = (index) => {
|
|
1236
|
+
setRepeaterValues(
|
|
1237
|
+
repeaterValues.map((value, i) => {
|
|
1238
|
+
if (i === index) {
|
|
1239
|
+
const { disabled, ...rest } = value;
|
|
1240
|
+
return { ...rest, ...disabled ? {} : { disabled: true } };
|
|
1241
|
+
}
|
|
1242
|
+
return value;
|
|
1243
|
+
})
|
|
1244
|
+
);
|
|
1245
|
+
};
|
|
1246
|
+
return /* @__PURE__ */ React40.createElement(Stack12, null, /* @__PURE__ */ React40.createElement(Stack12, { direction: "row", justifyContent: "space-between", sx: { py: 0.5 } }, /* @__PURE__ */ React40.createElement(Typography3, { component: "label", variant: "caption", color: "text.secondary" }, label), /* @__PURE__ */ React40.createElement(IconButton2, { size: SIZE2, onClick: addRepeaterItem, "aria-label": __19("Add item", "elementor") }, /* @__PURE__ */ React40.createElement(PlusIcon, { fontSize: SIZE2 }))), /* @__PURE__ */ React40.createElement(Stack12, { gap: 1 }, repeaterValues.map((value, index) => /* @__PURE__ */ React40.createElement(
|
|
1247
|
+
RepeaterItem,
|
|
1248
|
+
{
|
|
1249
|
+
key: index,
|
|
1250
|
+
disabled: value.disabled,
|
|
1251
|
+
label: /* @__PURE__ */ React40.createElement(itemSettings.Label, { value }),
|
|
1252
|
+
startIcon: /* @__PURE__ */ React40.createElement(itemSettings.Icon, { value }),
|
|
1253
|
+
removeItem: () => removeRepeaterItem(index),
|
|
1254
|
+
duplicateItem: () => duplicateRepeaterItem(index),
|
|
1255
|
+
toggleDisableItem: () => toggleDisableRepeaterItem(index)
|
|
1256
|
+
},
|
|
1257
|
+
(props) => /* @__PURE__ */ React40.createElement(
|
|
1258
|
+
itemSettings.Content,
|
|
1259
|
+
{
|
|
1260
|
+
...props,
|
|
1261
|
+
value,
|
|
1262
|
+
setValue: (newValue) => setRepeaterValues(
|
|
1263
|
+
repeaterValues.map((item, i) => i === index ? newValue : item)
|
|
1264
|
+
)
|
|
1265
|
+
}
|
|
1266
|
+
)
|
|
1267
|
+
))));
|
|
1268
|
+
};
|
|
1269
|
+
var RepeaterItem = ({
|
|
1270
|
+
label,
|
|
1271
|
+
disabled,
|
|
1272
|
+
startIcon,
|
|
1273
|
+
children,
|
|
1274
|
+
removeItem,
|
|
1275
|
+
duplicateItem,
|
|
1276
|
+
toggleDisableItem
|
|
1277
|
+
}) => {
|
|
1278
|
+
const popupId = useId4();
|
|
1279
|
+
const tagRef = useRef(null);
|
|
1280
|
+
const [anchorEl, setAnchorEl] = useState3(null);
|
|
1281
|
+
const popoverState = usePopupState3({ popupId, variant: "popover" });
|
|
1282
|
+
const popoverProps = bindPopover2(popoverState);
|
|
1283
|
+
return /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(
|
|
1284
|
+
UnstableTag,
|
|
1285
|
+
{
|
|
1286
|
+
ref: tagRef,
|
|
1287
|
+
label,
|
|
1288
|
+
showActionsOnHover: true,
|
|
1289
|
+
variant: "outlined",
|
|
1290
|
+
"aria-label": __19("Open item", "elementor"),
|
|
1291
|
+
...bindTrigger2(popoverState),
|
|
1292
|
+
startIcon,
|
|
1293
|
+
actions: /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(
|
|
1294
|
+
IconButton2,
|
|
1295
|
+
{
|
|
1296
|
+
size: SIZE2,
|
|
1297
|
+
onClick: duplicateItem,
|
|
1298
|
+
"aria-label": __19("Duplicate item", "elementor")
|
|
1299
|
+
},
|
|
1300
|
+
/* @__PURE__ */ React40.createElement(CopyIcon, { fontSize: SIZE2 })
|
|
1301
|
+
), /* @__PURE__ */ React40.createElement(
|
|
1302
|
+
IconButton2,
|
|
1303
|
+
{
|
|
1304
|
+
size: SIZE2,
|
|
1305
|
+
onClick: toggleDisableItem,
|
|
1306
|
+
"aria-label": disabled ? __19("Enable item", "elementor") : __19("Disable item", "elementor")
|
|
1307
|
+
},
|
|
1308
|
+
disabled ? /* @__PURE__ */ React40.createElement(EyeOffIcon, { fontSize: SIZE2 }) : /* @__PURE__ */ React40.createElement(EyeIcon, { fontSize: SIZE2 })
|
|
1309
|
+
), /* @__PURE__ */ React40.createElement(
|
|
1310
|
+
IconButton2,
|
|
1311
|
+
{
|
|
1312
|
+
size: SIZE2,
|
|
1313
|
+
onClick: removeItem,
|
|
1314
|
+
"aria-label": __19("Remove item", "elementor")
|
|
1315
|
+
},
|
|
1316
|
+
/* @__PURE__ */ React40.createElement(XIcon2, { fontSize: SIZE2 })
|
|
1317
|
+
))
|
|
1318
|
+
}
|
|
1319
|
+
), /* @__PURE__ */ React40.createElement(
|
|
1320
|
+
Popover2,
|
|
1321
|
+
{
|
|
1322
|
+
disablePortal: true,
|
|
1323
|
+
slotProps: {
|
|
1324
|
+
paper: { ref: setAnchorEl, sx: { width: tagRef.current?.getBoundingClientRect().width } }
|
|
1325
|
+
},
|
|
1326
|
+
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1327
|
+
...popoverProps
|
|
1328
|
+
},
|
|
1329
|
+
/* @__PURE__ */ React40.createElement(Box2, { p: 2 }, children({ anchorEl }))
|
|
1330
|
+
));
|
|
1331
|
+
};
|
|
1332
|
+
|
|
1333
|
+
// src/components/style-sections/effects-section/box-shadow-repeater.tsx
|
|
1334
|
+
var BoxShadowRepeater = () => {
|
|
1335
|
+
const { value, setValue } = useControl();
|
|
1336
|
+
const boxShadowValues = value?.value;
|
|
1337
|
+
const setBoxShadow = (newValue) => {
|
|
1338
|
+
setValue({
|
|
1339
|
+
$$type: "box-shadow",
|
|
1340
|
+
value: newValue
|
|
1341
|
+
});
|
|
1342
|
+
};
|
|
1343
|
+
return /* @__PURE__ */ React41.createElement(
|
|
1344
|
+
Repeater,
|
|
1345
|
+
{
|
|
1346
|
+
values: boxShadowValues,
|
|
1347
|
+
setValues: setBoxShadow,
|
|
1348
|
+
label: __20("Box shadow", "elementor"),
|
|
1349
|
+
itemSettings: {
|
|
1350
|
+
Icon: ItemIcon,
|
|
1351
|
+
Label: ItemLabel,
|
|
1352
|
+
Content: ItemContent,
|
|
1353
|
+
initialValues: initialShadow
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
);
|
|
1357
|
+
};
|
|
1358
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React41.createElement(UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color.value });
|
|
1359
|
+
var ItemContent = ({
|
|
1360
|
+
anchorEl,
|
|
1361
|
+
value,
|
|
1362
|
+
setValue
|
|
1363
|
+
}) => {
|
|
1364
|
+
const setShadow = (newValue) => {
|
|
1365
|
+
setValue({
|
|
1366
|
+
$$type: "shadow",
|
|
1367
|
+
value: newValue
|
|
1368
|
+
});
|
|
1369
|
+
};
|
|
1370
|
+
return /* @__PURE__ */ React41.createElement(Stack13, { gap: 1.5 }, /* @__PURE__ */ React41.createElement(Grid14, { container: true, spacing: 1 }, /* @__PURE__ */ React41.createElement(
|
|
1371
|
+
Control5,
|
|
1372
|
+
{
|
|
1373
|
+
bind: "color",
|
|
1374
|
+
value: value.value.color,
|
|
1375
|
+
label: __20("Color", "elementor"),
|
|
1376
|
+
setValue: (v) => setShadow({ ...value.value, color: v })
|
|
1377
|
+
},
|
|
1378
|
+
/* @__PURE__ */ React41.createElement(
|
|
1379
|
+
ColorControl,
|
|
1380
|
+
{
|
|
1381
|
+
anchorEl,
|
|
1382
|
+
anchorOrigin: {
|
|
1383
|
+
vertical: "top",
|
|
1384
|
+
horizontal: "right"
|
|
1385
|
+
},
|
|
1386
|
+
transformOrigin: {
|
|
1387
|
+
vertical: "top",
|
|
1388
|
+
horizontal: -10
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
)
|
|
1392
|
+
), /* @__PURE__ */ React41.createElement(
|
|
1393
|
+
Control5,
|
|
1394
|
+
{
|
|
1395
|
+
bind: "position",
|
|
1396
|
+
value: value.value.position,
|
|
1397
|
+
label: __20("Position", "elementor"),
|
|
1398
|
+
setValue: (v) => setShadow({ ...value.value, position: v })
|
|
1399
|
+
},
|
|
1400
|
+
/* @__PURE__ */ React41.createElement(
|
|
1401
|
+
SelectControl,
|
|
1402
|
+
{
|
|
1403
|
+
options: [
|
|
1404
|
+
{ label: "Inset", value: "inset" },
|
|
1405
|
+
{ label: "Outset", value: "outset" }
|
|
1406
|
+
]
|
|
1407
|
+
}
|
|
1408
|
+
)
|
|
1409
|
+
)), /* @__PURE__ */ React41.createElement(Grid14, { container: true, spacing: 1 }, /* @__PURE__ */ React41.createElement(
|
|
1410
|
+
Control5,
|
|
1411
|
+
{
|
|
1412
|
+
bind: "hOffset",
|
|
1413
|
+
label: __20("Horizontal", "elementor"),
|
|
1414
|
+
value: value.value.hOffset,
|
|
1415
|
+
setValue: (v) => setShadow({ ...value.value, hOffset: v })
|
|
1416
|
+
},
|
|
1417
|
+
/* @__PURE__ */ React41.createElement(SizeControl, null)
|
|
1418
|
+
), /* @__PURE__ */ React41.createElement(
|
|
1419
|
+
Control5,
|
|
1420
|
+
{
|
|
1421
|
+
label: __20("Vertical", "elementor"),
|
|
1422
|
+
bind: "vOffset",
|
|
1423
|
+
value: value.value.vOffset,
|
|
1424
|
+
setValue: (v) => setShadow({ ...value.value, vOffset: v })
|
|
1425
|
+
},
|
|
1426
|
+
/* @__PURE__ */ React41.createElement(SizeControl, null)
|
|
1427
|
+
)), /* @__PURE__ */ React41.createElement(Grid14, { container: true, spacing: 1 }, /* @__PURE__ */ React41.createElement(
|
|
1428
|
+
Control5,
|
|
1429
|
+
{
|
|
1430
|
+
bind: "blur",
|
|
1431
|
+
value: value.value.blur,
|
|
1432
|
+
label: __20("Blur", "elementor"),
|
|
1433
|
+
setValue: (v) => setShadow({ ...value.value, blur: v })
|
|
1434
|
+
},
|
|
1435
|
+
/* @__PURE__ */ React41.createElement(SizeControl, null)
|
|
1436
|
+
), /* @__PURE__ */ React41.createElement(
|
|
1437
|
+
Control5,
|
|
1438
|
+
{
|
|
1439
|
+
bind: "spread",
|
|
1440
|
+
label: __20("Spread", "elementor"),
|
|
1441
|
+
value: value.value.spread,
|
|
1442
|
+
setValue: (v) => setShadow({ ...value.value, spread: v })
|
|
1443
|
+
},
|
|
1444
|
+
/* @__PURE__ */ React41.createElement(SizeControl, null)
|
|
1445
|
+
)));
|
|
1446
|
+
};
|
|
1447
|
+
var Control5 = ({
|
|
1448
|
+
value,
|
|
1449
|
+
setValue,
|
|
1450
|
+
label,
|
|
1451
|
+
bind,
|
|
1452
|
+
children
|
|
1453
|
+
}) => /* @__PURE__ */ React41.createElement(ControlContext.Provider, { value: { value, setValue, bind } }, /* @__PURE__ */ React41.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(Grid14, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React41.createElement(Grid14, { item: true, xs: 12 }, /* @__PURE__ */ React41.createElement(ControlLabel, null, label)), /* @__PURE__ */ React41.createElement(Grid14, { item: true, xs: 12 }, children))));
|
|
1454
|
+
var ItemLabel = ({ value }) => {
|
|
1455
|
+
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
1456
|
+
const { size: hOffsetSize, unit: hOffsetUnit } = hOffset.value;
|
|
1457
|
+
const { size: vOffsetSize, unit: vOffsetUnit } = vOffset.value;
|
|
1458
|
+
const { size: blurSize, unit: blurUnit } = blur.value;
|
|
1459
|
+
const { size: spreadSize, unit: spreadUnit } = spread.value;
|
|
1460
|
+
const sizes = [
|
|
1461
|
+
hOffsetSize + hOffsetUnit,
|
|
1462
|
+
vOffsetSize + vOffsetUnit,
|
|
1463
|
+
blurSize + blurUnit,
|
|
1464
|
+
spreadSize + spreadUnit
|
|
1465
|
+
].join(" ");
|
|
1466
|
+
return /* @__PURE__ */ React41.createElement("span", { style: { textTransform: "capitalize" } }, position, ": ", sizes);
|
|
1467
|
+
};
|
|
1468
|
+
var initialShadow = {
|
|
1469
|
+
$$type: "shadow",
|
|
1470
|
+
value: {
|
|
1471
|
+
hOffset: {
|
|
1472
|
+
$$type: "size",
|
|
1473
|
+
value: { unit: "px", size: 0 }
|
|
1474
|
+
},
|
|
1475
|
+
vOffset: {
|
|
1476
|
+
$$type: "size",
|
|
1477
|
+
value: { unit: "px", size: 0 }
|
|
1478
|
+
},
|
|
1479
|
+
blur: {
|
|
1480
|
+
$$type: "size",
|
|
1481
|
+
value: { unit: "px", size: 0 }
|
|
1482
|
+
},
|
|
1483
|
+
spread: {
|
|
1484
|
+
$$type: "size",
|
|
1485
|
+
value: { unit: "px", size: 0 }
|
|
1486
|
+
},
|
|
1487
|
+
color: {
|
|
1488
|
+
$$type: "color",
|
|
1489
|
+
value: "rgba(0, 0, 0, 0)"
|
|
1490
|
+
},
|
|
1491
|
+
position: "inset"
|
|
1492
|
+
}
|
|
1493
|
+
};
|
|
1494
|
+
|
|
1495
|
+
// src/components/style-sections/effects-section/effects-section.tsx
|
|
1496
|
+
var EffectsSection = () => {
|
|
1497
|
+
return /* @__PURE__ */ React42.createElement(AccordionSection, { title: __21("Effects", "elementor") }, /* @__PURE__ */ React42.createElement(Stack14, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(StyleControl, { bind: "box-shadow" }, /* @__PURE__ */ React42.createElement(BoxShadowRepeater, null))));
|
|
1000
1498
|
};
|
|
1001
1499
|
|
|
1002
1500
|
// src/components/style-tab.tsx
|
|
@@ -1004,11 +1502,13 @@ var CLASSES_PROP_KEY = "classes";
|
|
|
1004
1502
|
var StyleTab = () => {
|
|
1005
1503
|
const styleDefinition = useStyleDefinition();
|
|
1006
1504
|
const classesProp = useClassesProp();
|
|
1007
|
-
return /* @__PURE__ */
|
|
1505
|
+
return /* @__PURE__ */ React43.createElement(StyleContext, { selectedStyleDef: styleDefinition, selectedClassesProp: classesProp }, /* @__PURE__ */ React43.createElement(Stack15, null, /* @__PURE__ */ React43.createElement(SizeSection, null), /* @__PURE__ */ React43.createElement(PositionSection, null), /* @__PURE__ */ React43.createElement(TypographySection, null), /* @__PURE__ */ React43.createElement(SpacingSection, null), /* @__PURE__ */ React43.createElement(EffectsSection, null)));
|
|
1008
1506
|
};
|
|
1009
1507
|
function useClassesProp() {
|
|
1010
1508
|
const { elementType } = useElementContext();
|
|
1011
|
-
const prop = Object.entries(elementType.propsSchema).find(
|
|
1509
|
+
const prop = Object.entries(elementType.propsSchema).find(
|
|
1510
|
+
([, propType]) => propType.kind === "array" && propType.key === CLASSES_PROP_KEY
|
|
1511
|
+
);
|
|
1012
1512
|
if (!prop) {
|
|
1013
1513
|
throw new Error("Element does not have a classes prop");
|
|
1014
1514
|
}
|
|
@@ -1023,7 +1523,7 @@ function useStyleDefinition() {
|
|
|
1023
1523
|
// src/components/editing-panel-tabs.tsx
|
|
1024
1524
|
var EditingPanelTabs = () => {
|
|
1025
1525
|
const { getTabProps, getTabPanelProps, getTabsProps } = useTabs("settings");
|
|
1026
|
-
return /* @__PURE__ */
|
|
1526
|
+
return /* @__PURE__ */ React44.createElement(Stack16, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React44.createElement(Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React44.createElement(Tab, { label: __22("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React44.createElement(Tab, { label: __22("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React44.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React44.createElement(SettingsTab, null)), /* @__PURE__ */ React44.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React44.createElement(StyleTab, null)));
|
|
1027
1527
|
};
|
|
1028
1528
|
|
|
1029
1529
|
// src/components/editing-panel.tsx
|
|
@@ -1034,8 +1534,8 @@ var EditingPanel = () => {
|
|
|
1034
1534
|
if (elements.length !== 1 || !elementType) {
|
|
1035
1535
|
return null;
|
|
1036
1536
|
}
|
|
1037
|
-
const panelTitle =
|
|
1038
|
-
return /* @__PURE__ */
|
|
1537
|
+
const panelTitle = __23("Edit %s", "elementor").replace("%s", elementType.title);
|
|
1538
|
+
return /* @__PURE__ */ React45.createElement(Panel, null, /* @__PURE__ */ React45.createElement(PanelHeader, null, /* @__PURE__ */ React45.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React45.createElement(PanelBody, null, /* @__PURE__ */ React45.createElement(ElementContext, { element: selectedElement, elementType }, /* @__PURE__ */ React45.createElement(EditingPanelTabs, null))));
|
|
1039
1539
|
};
|
|
1040
1540
|
|
|
1041
1541
|
// src/panel.ts
|
|
@@ -1082,11 +1582,11 @@ import { __registerPanel as registerPanel } from "@elementor/editor-panels";
|
|
|
1082
1582
|
import { __privateBlockDataCommand as blockDataCommand } from "@elementor/editor-v1-adapters";
|
|
1083
1583
|
|
|
1084
1584
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1085
|
-
import * as
|
|
1086
|
-
import { useId as
|
|
1585
|
+
import * as React48 from "react";
|
|
1586
|
+
import { useId as useId5 } from "react";
|
|
1087
1587
|
|
|
1088
1588
|
// src/dynamics/dynamic-control.tsx
|
|
1089
|
-
import * as
|
|
1589
|
+
import * as React46 from "react";
|
|
1090
1590
|
|
|
1091
1591
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1092
1592
|
import { useMemo } from "react";
|
|
@@ -1120,18 +1620,26 @@ var isTransformable = (value) => {
|
|
|
1120
1620
|
};
|
|
1121
1621
|
|
|
1122
1622
|
// src/dynamics/utils.ts
|
|
1123
|
-
var
|
|
1623
|
+
var DYNAMIC_PROP_TYPE_KEY = "dynamic";
|
|
1624
|
+
var isDynamicPropType = (prop) => prop.key === DYNAMIC_PROP_TYPE_KEY;
|
|
1625
|
+
var getDynamicPropType = (propType) => {
|
|
1626
|
+
const dynamicPropType = propType.kind === "union" && propType.prop_types[DYNAMIC_PROP_TYPE_KEY];
|
|
1627
|
+
return dynamicPropType && isDynamicPropType(dynamicPropType) ? dynamicPropType : null;
|
|
1628
|
+
};
|
|
1124
1629
|
var isDynamicPropValue = (prop) => {
|
|
1125
|
-
return isTransformable(prop) && prop.$$type ===
|
|
1630
|
+
return isTransformable(prop) && prop.$$type === DYNAMIC_PROP_TYPE_KEY;
|
|
1631
|
+
};
|
|
1632
|
+
var supportsDynamic = (propType) => {
|
|
1633
|
+
return !!getDynamicPropType(propType);
|
|
1126
1634
|
};
|
|
1127
1635
|
|
|
1128
1636
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1129
1637
|
var usePropDynamicTags = (propName) => {
|
|
1130
1638
|
let categories = [];
|
|
1131
1639
|
const { elementType } = useElementContext();
|
|
1132
|
-
const
|
|
1133
|
-
if (
|
|
1134
|
-
const propDynamicType =
|
|
1640
|
+
const propType = elementType.propsSchema?.[propName];
|
|
1641
|
+
if (propType) {
|
|
1642
|
+
const propDynamicType = getDynamicPropType(propType);
|
|
1135
1643
|
categories = propDynamicType?.settings.categories || [];
|
|
1136
1644
|
}
|
|
1137
1645
|
return useMemo(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
@@ -1162,7 +1670,7 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
1162
1670
|
if (!dynamicTag) {
|
|
1163
1671
|
throw new Error(`Dynamic tag ${name} not found`);
|
|
1164
1672
|
}
|
|
1165
|
-
const defaultValue = dynamicTag.props_schema[bind]?.
|
|
1673
|
+
const defaultValue = dynamicTag.props_schema[bind]?.default;
|
|
1166
1674
|
const dynamicValue = settings?.[bind] ?? defaultValue;
|
|
1167
1675
|
const setDynamicValue = (newValue) => {
|
|
1168
1676
|
setValue({
|
|
@@ -1176,67 +1684,94 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
1176
1684
|
}
|
|
1177
1685
|
});
|
|
1178
1686
|
};
|
|
1179
|
-
return /* @__PURE__ */
|
|
1687
|
+
return /* @__PURE__ */ React46.createElement(ControlContext.Provider, { value: { setValue: setDynamicValue, value: dynamicValue, bind } }, children);
|
|
1180
1688
|
};
|
|
1181
1689
|
|
|
1182
1690
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1183
|
-
import { DatabaseIcon, SettingsIcon, XIcon } from "@elementor/icons";
|
|
1691
|
+
import { DatabaseIcon, SettingsIcon, XIcon as XIcon3 } from "@elementor/icons";
|
|
1184
1692
|
|
|
1185
1693
|
// src/dynamics/components/dynamic-selection.tsx
|
|
1186
|
-
import * as
|
|
1187
|
-
import { useState as
|
|
1694
|
+
import * as React47 from "react";
|
|
1695
|
+
import { useState as useState4, Fragment as Fragment4 } from "react";
|
|
1188
1696
|
import { SearchIcon, PhotoIcon } from "@elementor/icons";
|
|
1189
1697
|
import {
|
|
1190
|
-
Box,
|
|
1698
|
+
Box as Box3,
|
|
1191
1699
|
Divider as Divider3,
|
|
1192
1700
|
InputAdornment as InputAdornment3,
|
|
1193
1701
|
Link,
|
|
1194
1702
|
ListSubheader,
|
|
1195
1703
|
MenuItem as MenuItem3,
|
|
1196
1704
|
MenuList,
|
|
1197
|
-
Stack as
|
|
1705
|
+
Stack as Stack17,
|
|
1198
1706
|
TextField as TextField5,
|
|
1199
|
-
Typography as
|
|
1707
|
+
Typography as Typography4
|
|
1200
1708
|
} from "@elementor/ui";
|
|
1201
|
-
import { __ as
|
|
1202
|
-
|
|
1709
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
1710
|
+
|
|
1711
|
+
// src/dynamics/hooks/use-prop-value-history.ts
|
|
1712
|
+
var PROPS_VALUES_HISTORY_KEY = "elementor/dynamic/non-dynamic-values-history";
|
|
1713
|
+
var usePropValueHistory = (path) => {
|
|
1714
|
+
const valuesHistory = getValues();
|
|
1715
|
+
const { element } = useElementContext();
|
|
1716
|
+
const key = `${element.id}-${path}`;
|
|
1717
|
+
const value = valuesHistory[key] ?? null;
|
|
1718
|
+
const setValue = (newValue) => {
|
|
1719
|
+
setValues({ ...valuesHistory, [key]: newValue });
|
|
1720
|
+
};
|
|
1721
|
+
return [value, setValue];
|
|
1722
|
+
};
|
|
1723
|
+
var getValues = () => {
|
|
1724
|
+
return JSON.parse(sessionStorage.getItem(PROPS_VALUES_HISTORY_KEY) || "{}");
|
|
1725
|
+
};
|
|
1726
|
+
var setValues = (values) => {
|
|
1727
|
+
sessionStorage.setItem(PROPS_VALUES_HISTORY_KEY, JSON.stringify(values));
|
|
1728
|
+
};
|
|
1729
|
+
|
|
1730
|
+
// src/dynamics/components/dynamic-selection.tsx
|
|
1731
|
+
var SIZE3 = "tiny";
|
|
1203
1732
|
var DynamicSelection = ({ onSelect }) => {
|
|
1204
|
-
const [searchValue, setSearchValue] =
|
|
1733
|
+
const [searchValue, setSearchValue] = useState4("");
|
|
1205
1734
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
1206
|
-
const { bind, value:
|
|
1207
|
-
const
|
|
1735
|
+
const { bind, value: currentValue, setValue } = useControl();
|
|
1736
|
+
const [, updatePropValueHistory] = usePropValueHistory(bind);
|
|
1737
|
+
const isCurrentValueDynamic = isDynamicPropValue(currentValue);
|
|
1738
|
+
const options4 = useFilteredOptions(bind, searchValue);
|
|
1208
1739
|
const handleSearch = (event) => {
|
|
1209
1740
|
setSearchValue(event.target.value);
|
|
1210
1741
|
};
|
|
1211
|
-
|
|
1742
|
+
const handleSetDynamicTag = (value) => {
|
|
1743
|
+
if (!isCurrentValueDynamic) {
|
|
1744
|
+
updatePropValueHistory(currentValue);
|
|
1745
|
+
}
|
|
1746
|
+
setValue({ $$type: "dynamic", value: { name: value, settings: {} } });
|
|
1747
|
+
onSelect?.();
|
|
1748
|
+
};
|
|
1749
|
+
return /* @__PURE__ */ React47.createElement(Stack17, null, /* @__PURE__ */ React47.createElement(Box3, { px: 1.5, pb: 1 }, /* @__PURE__ */ React47.createElement(
|
|
1212
1750
|
TextField5,
|
|
1213
1751
|
{
|
|
1214
1752
|
fullWidth: true,
|
|
1215
|
-
size:
|
|
1753
|
+
size: SIZE3,
|
|
1216
1754
|
value: searchValue,
|
|
1217
1755
|
onChange: handleSearch,
|
|
1218
|
-
placeholder:
|
|
1756
|
+
placeholder: __24("Search dynamic tag", "elementor"),
|
|
1219
1757
|
InputProps: {
|
|
1220
|
-
startAdornment: /* @__PURE__ */
|
|
1758
|
+
startAdornment: /* @__PURE__ */ React47.createElement(InputAdornment3, { position: "start" }, /* @__PURE__ */ React47.createElement(SearchIcon, { fontSize: SIZE3 }))
|
|
1221
1759
|
}
|
|
1222
1760
|
}
|
|
1223
|
-
)), /* @__PURE__ */
|
|
1224
|
-
const isSelected = value ===
|
|
1225
|
-
return /* @__PURE__ */
|
|
1761
|
+
)), /* @__PURE__ */ React47.createElement(Divider3, null), /* @__PURE__ */ React47.createElement(Box3, { sx: { overflowY: "auto", height: 260, width: 220 } }, options4.length > 0 ? /* @__PURE__ */ React47.createElement(MenuList, { role: "listbox", tabIndex: 0 }, options4.map(([category, items], index) => /* @__PURE__ */ React47.createElement(Fragment4, { key: index }, /* @__PURE__ */ React47.createElement(ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items.map(({ value, label: tagLabel }) => {
|
|
1762
|
+
const isSelected = isCurrentValueDynamic && value === currentValue?.value?.name;
|
|
1763
|
+
return /* @__PURE__ */ React47.createElement(
|
|
1226
1764
|
MenuItem3,
|
|
1227
1765
|
{
|
|
1228
1766
|
key: value,
|
|
1229
1767
|
selected: isSelected,
|
|
1230
1768
|
autoFocus: isSelected,
|
|
1231
1769
|
sx: { typography: "caption" },
|
|
1232
|
-
onClick: () =>
|
|
1233
|
-
setValue({ $$type: "dynamic", value: { name: value } });
|
|
1234
|
-
onSelect?.();
|
|
1235
|
-
}
|
|
1770
|
+
onClick: () => handleSetDynamicTag(value)
|
|
1236
1771
|
},
|
|
1237
1772
|
tagLabel
|
|
1238
1773
|
);
|
|
1239
|
-
})))) : /* @__PURE__ */
|
|
1774
|
+
})))) : /* @__PURE__ */ React47.createElement(Stack17, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React47.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React47.createElement(Typography4, { align: "center", variant: "caption", color: "text.secondary" }, __24("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React47.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React47.createElement(Typography4, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React47.createElement(
|
|
1240
1775
|
Link,
|
|
1241
1776
|
{
|
|
1242
1777
|
color: "secondary",
|
|
@@ -1244,12 +1779,12 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
1244
1779
|
component: "button",
|
|
1245
1780
|
onClick: () => setSearchValue("")
|
|
1246
1781
|
},
|
|
1247
|
-
|
|
1248
|
-
), "\xA0",
|
|
1782
|
+
__24("Clear the filters", "elementor")
|
|
1783
|
+
), "\xA0", __24("and try again.", "elementor")))));
|
|
1249
1784
|
};
|
|
1250
1785
|
var useFilteredOptions = (bind, searchValue) => {
|
|
1251
1786
|
const dynamicTags = usePropDynamicTags(bind);
|
|
1252
|
-
const
|
|
1787
|
+
const options4 = dynamicTags.reduce((categories, { name, label, group }) => {
|
|
1253
1788
|
const isVisible = label.toLowerCase().includes(searchValue.trim().toLowerCase());
|
|
1254
1789
|
if (!isVisible) {
|
|
1255
1790
|
return categories;
|
|
@@ -1260,93 +1795,94 @@ var useFilteredOptions = (bind, searchValue) => {
|
|
|
1260
1795
|
categories.get(group)?.push({ label, value: name });
|
|
1261
1796
|
return categories;
|
|
1262
1797
|
}, /* @__PURE__ */ new Map());
|
|
1263
|
-
return [...
|
|
1798
|
+
return [...options4];
|
|
1264
1799
|
};
|
|
1265
1800
|
|
|
1266
1801
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1267
1802
|
import {
|
|
1268
|
-
bindPopover,
|
|
1269
|
-
bindTrigger as
|
|
1270
|
-
Box as
|
|
1271
|
-
IconButton,
|
|
1803
|
+
bindPopover as bindPopover3,
|
|
1804
|
+
bindTrigger as bindTrigger3,
|
|
1805
|
+
Box as Box4,
|
|
1806
|
+
IconButton as IconButton3,
|
|
1272
1807
|
Paper,
|
|
1273
|
-
Popover,
|
|
1274
|
-
Stack as
|
|
1275
|
-
Typography as
|
|
1808
|
+
Popover as Popover3,
|
|
1809
|
+
Stack as Stack18,
|
|
1810
|
+
Typography as Typography5,
|
|
1276
1811
|
UnstableTag as Tag,
|
|
1277
|
-
usePopupState as
|
|
1812
|
+
usePopupState as usePopupState4,
|
|
1278
1813
|
Tabs as Tabs2,
|
|
1279
1814
|
Divider as Divider4,
|
|
1280
1815
|
useTabs as useTabs2,
|
|
1281
1816
|
Tab as Tab2,
|
|
1282
1817
|
TabPanel as TabPanel2
|
|
1283
1818
|
} from "@elementor/ui";
|
|
1284
|
-
import { __ as
|
|
1285
|
-
var
|
|
1819
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
1820
|
+
var SIZE4 = "tiny";
|
|
1286
1821
|
var DynamicSelectionControl = () => {
|
|
1287
1822
|
const { bind, value, setValue } = useControl();
|
|
1823
|
+
const [propValueFromHistory] = usePropValueHistory(bind);
|
|
1288
1824
|
const { name: tagName = "" } = value?.value || {};
|
|
1289
|
-
const selectionPopoverId =
|
|
1290
|
-
const selectionPopoverState =
|
|
1825
|
+
const selectionPopoverId = useId5();
|
|
1826
|
+
const selectionPopoverState = usePopupState4({ variant: "popover", popupId: selectionPopoverId });
|
|
1291
1827
|
const dynamicTag = useDynamicTag(bind, tagName);
|
|
1292
1828
|
const removeDynamicTag = () => {
|
|
1293
|
-
setValue(null);
|
|
1829
|
+
setValue(propValueFromHistory ?? null);
|
|
1294
1830
|
};
|
|
1295
1831
|
if (!dynamicTag) {
|
|
1296
1832
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
1297
1833
|
}
|
|
1298
|
-
return /* @__PURE__ */
|
|
1834
|
+
return /* @__PURE__ */ React48.createElement(Box4, null, /* @__PURE__ */ React48.createElement(
|
|
1299
1835
|
Tag,
|
|
1300
1836
|
{
|
|
1301
1837
|
fullWidth: true,
|
|
1302
1838
|
showActionsOnHover: true,
|
|
1303
1839
|
label: dynamicTag.label,
|
|
1304
|
-
startIcon: /* @__PURE__ */
|
|
1305
|
-
...
|
|
1306
|
-
actions: /* @__PURE__ */
|
|
1307
|
-
|
|
1840
|
+
startIcon: /* @__PURE__ */ React48.createElement(DatabaseIcon, { fontSize: SIZE4 }),
|
|
1841
|
+
...bindTrigger3(selectionPopoverState),
|
|
1842
|
+
actions: /* @__PURE__ */ React48.createElement(React48.Fragment, null, /* @__PURE__ */ React48.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React48.createElement(
|
|
1843
|
+
IconButton3,
|
|
1308
1844
|
{
|
|
1309
|
-
size:
|
|
1845
|
+
size: SIZE4,
|
|
1310
1846
|
onClick: removeDynamicTag,
|
|
1311
|
-
"aria-label":
|
|
1847
|
+
"aria-label": __25("Remove dynamic value", "elementor")
|
|
1312
1848
|
},
|
|
1313
|
-
/* @__PURE__ */
|
|
1849
|
+
/* @__PURE__ */ React48.createElement(XIcon3, { fontSize: SIZE4 })
|
|
1314
1850
|
))
|
|
1315
1851
|
}
|
|
1316
|
-
), /* @__PURE__ */
|
|
1317
|
-
|
|
1852
|
+
), /* @__PURE__ */ React48.createElement(
|
|
1853
|
+
Popover3,
|
|
1318
1854
|
{
|
|
1319
1855
|
disablePortal: true,
|
|
1320
1856
|
disableScrollLock: true,
|
|
1321
1857
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1322
|
-
...
|
|
1858
|
+
...bindPopover3(selectionPopoverState)
|
|
1323
1859
|
},
|
|
1324
|
-
/* @__PURE__ */
|
|
1860
|
+
/* @__PURE__ */ React48.createElement(Stack18, null, /* @__PURE__ */ React48.createElement(Stack18, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React48.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React48.createElement(Typography5, { variant: "subtitle2" }, __25("Dynamic Tags", "elementor")), /* @__PURE__ */ React48.createElement(IconButton3, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React48.createElement(XIcon3, { fontSize: SIZE4 }))), /* @__PURE__ */ React48.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
1325
1861
|
));
|
|
1326
1862
|
};
|
|
1327
1863
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
1328
|
-
const popupId =
|
|
1329
|
-
const settingsPopupState =
|
|
1864
|
+
const popupId = useId5();
|
|
1865
|
+
const settingsPopupState = usePopupState4({ variant: "popover", popupId });
|
|
1330
1866
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
1331
1867
|
if (!hasDynamicSettings) {
|
|
1332
1868
|
return null;
|
|
1333
1869
|
}
|
|
1334
|
-
return /* @__PURE__ */
|
|
1335
|
-
|
|
1870
|
+
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, /* @__PURE__ */ React48.createElement(
|
|
1871
|
+
IconButton3,
|
|
1336
1872
|
{
|
|
1337
|
-
size:
|
|
1338
|
-
...
|
|
1339
|
-
"aria-label":
|
|
1873
|
+
size: SIZE4,
|
|
1874
|
+
...bindTrigger3(settingsPopupState),
|
|
1875
|
+
"aria-label": __25("Settings", "elementor")
|
|
1340
1876
|
},
|
|
1341
|
-
/* @__PURE__ */
|
|
1342
|
-
), /* @__PURE__ */
|
|
1343
|
-
|
|
1877
|
+
/* @__PURE__ */ React48.createElement(SettingsIcon, { fontSize: SIZE4 })
|
|
1878
|
+
), /* @__PURE__ */ React48.createElement(
|
|
1879
|
+
Popover3,
|
|
1344
1880
|
{
|
|
1345
1881
|
disableScrollLock: true,
|
|
1346
1882
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
1347
|
-
...
|
|
1883
|
+
...bindPopover3(settingsPopupState)
|
|
1348
1884
|
},
|
|
1349
|
-
/* @__PURE__ */
|
|
1885
|
+
/* @__PURE__ */ React48.createElement(Paper, { component: Stack18, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React48.createElement(Stack18, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React48.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React48.createElement(Typography5, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React48.createElement(IconButton3, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React48.createElement(XIcon3, { fontSize: SIZE4 }))), /* @__PURE__ */ React48.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
1350
1886
|
));
|
|
1351
1887
|
};
|
|
1352
1888
|
var DynamicSettings = ({ controls }) => {
|
|
@@ -1355,28 +1891,50 @@ var DynamicSettings = ({ controls }) => {
|
|
|
1355
1891
|
if (!tabs.length) {
|
|
1356
1892
|
return null;
|
|
1357
1893
|
}
|
|
1358
|
-
return /* @__PURE__ */
|
|
1359
|
-
return /* @__PURE__ */
|
|
1894
|
+
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, /* @__PURE__ */ React48.createElement(Tabs2, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React48.createElement(Tab2, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React48.createElement(Divider4, null), tabs.map(({ value }, index) => {
|
|
1895
|
+
return /* @__PURE__ */ React48.createElement(TabPanel2, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React48.createElement(Stack18, { gap: 1, px: 2 }, value.items.map((item) => {
|
|
1360
1896
|
if (item.type === "control") {
|
|
1361
|
-
return /* @__PURE__ */
|
|
1897
|
+
return /* @__PURE__ */ React48.createElement(Control6, { key: item.value.bind, control: item.value });
|
|
1362
1898
|
}
|
|
1363
1899
|
return null;
|
|
1364
1900
|
})));
|
|
1365
1901
|
}));
|
|
1366
1902
|
};
|
|
1367
|
-
var
|
|
1903
|
+
var Control6 = ({ control }) => {
|
|
1368
1904
|
if (!getControlByType(control.type)) {
|
|
1369
1905
|
return null;
|
|
1370
1906
|
}
|
|
1371
|
-
return /* @__PURE__ */
|
|
1907
|
+
return /* @__PURE__ */ React48.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React48.createElement(ControlLabel, null, control.label) : null, /* @__PURE__ */ React48.createElement(Control, { type: control.type, props: control.props }));
|
|
1908
|
+
};
|
|
1909
|
+
|
|
1910
|
+
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
1911
|
+
import * as React49 from "react";
|
|
1912
|
+
import { DatabaseIcon as DatabaseIcon2 } from "@elementor/icons";
|
|
1913
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
1914
|
+
var usePropDynamicAction = () => {
|
|
1915
|
+
const { bind } = useControl();
|
|
1916
|
+
const { elementType } = useElementContext();
|
|
1917
|
+
const propType = elementType.propsSchema[bind];
|
|
1918
|
+
const visible = !!propType && supportsDynamic(propType);
|
|
1919
|
+
return {
|
|
1920
|
+
visible,
|
|
1921
|
+
icon: DatabaseIcon2,
|
|
1922
|
+
title: __26("Dynamic Tags", "elementor"),
|
|
1923
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React49.createElement(DynamicSelection, { onSelect: closePopover })
|
|
1924
|
+
};
|
|
1372
1925
|
};
|
|
1373
1926
|
|
|
1374
1927
|
// src/dynamics/init.ts
|
|
1928
|
+
var { registerPopoverAction } = controlActionsMenu;
|
|
1375
1929
|
var init = () => {
|
|
1376
1930
|
replaceControl({
|
|
1377
1931
|
component: DynamicSelectionControl,
|
|
1378
1932
|
condition: ({ value }) => isDynamicPropValue(value)
|
|
1379
1933
|
});
|
|
1934
|
+
registerPopoverAction({
|
|
1935
|
+
id: "dynamic-tags",
|
|
1936
|
+
useProps: usePropDynamicAction
|
|
1937
|
+
});
|
|
1380
1938
|
};
|
|
1381
1939
|
|
|
1382
1940
|
// src/init.ts
|
|
@@ -1399,6 +1957,7 @@ var blockV1Panel = () => {
|
|
|
1399
1957
|
// src/index.ts
|
|
1400
1958
|
init2();
|
|
1401
1959
|
export {
|
|
1960
|
+
controlActionsMenu,
|
|
1402
1961
|
replaceControl,
|
|
1403
1962
|
useControl
|
|
1404
1963
|
};
|