@elementor/editor-editing-panel 0.18.0 → 1.0.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 +64 -0
- package/dist/index.d.mts +8 -24
- package/dist/index.d.ts +8 -24
- package/dist/index.js +1452 -1122
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1436 -1099
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -14
- package/src/components/accordion-section.tsx +3 -2
- package/src/components/add-or-remove-content.tsx +42 -0
- package/src/components/collapsible-field.tsx +34 -0
- package/src/components/editing-panel-error-fallback.tsx +12 -0
- package/src/components/editing-panel.tsx +27 -19
- package/src/components/settings-tab.tsx +12 -11
- package/src/components/style-sections/background-section/background-color-field.tsx +21 -0
- package/src/components/style-sections/background-section/background-section.tsx +15 -0
- package/src/components/style-sections/border-section/border-color-field.tsx +21 -0
- package/src/components/style-sections/border-section/border-field.tsx +47 -0
- package/src/components/style-sections/border-section/border-radius-field.tsx +48 -0
- package/src/components/style-sections/border-section/border-section.tsx +16 -0
- package/src/components/style-sections/border-section/border-style-field.tsx +32 -0
- package/src/components/style-sections/border-section/border-width-field.tsx +42 -0
- package/src/components/style-sections/effects-section/effects-section.tsx +5 -5
- package/src/components/style-sections/position-section/dimensions-field.tsx +46 -0
- package/src/components/style-sections/position-section/position-field.tsx +28 -0
- package/src/components/style-sections/position-section/position-section.tsx +15 -2
- package/src/components/style-sections/position-section/z-index-field.tsx +21 -0
- package/src/components/style-sections/size-section/overflow-field.tsx +45 -0
- package/src/components/style-sections/size-section/size-section.tsx +55 -0
- package/src/components/style-sections/spacing-section/spacing-section.tsx +6 -6
- package/src/components/style-sections/typography-section/font-size-field.tsx +21 -0
- package/src/components/style-sections/typography-section/{font-weight-control.tsx → font-weight-field.tsx} +7 -6
- package/src/components/style-sections/typography-section/letter-spacing-field.tsx +21 -0
- package/src/components/style-sections/typography-section/{text-alignment-control.tsx → text-alignment-field.tsx} +8 -8
- package/src/components/style-sections/typography-section/text-color-field.tsx +21 -0
- package/src/components/style-sections/typography-section/{text-direction-control.tsx → text-direction-field.tsx} +8 -8
- package/src/components/style-sections/typography-section/text-stroke-field.tsx +16 -0
- package/src/components/style-sections/typography-section/{text-style-control.tsx → text-style-field.tsx} +5 -5
- package/src/components/style-sections/typography-section/{transform-control.tsx → transform-field.tsx} +8 -7
- package/src/components/style-sections/typography-section/typography-section.tsx +20 -18
- package/src/components/style-sections/typography-section/word-spacing-field.tsx +21 -0
- package/src/components/style-tab.tsx +44 -25
- package/src/contexts/classes-prop-context.tsx +24 -0
- package/src/contexts/element-context.tsx +6 -10
- package/src/contexts/style-context.tsx +8 -22
- package/src/control-replacement.tsx +3 -0
- package/src/controls/bound-prop-context.tsx +30 -0
- package/src/controls/components/control-toggle-button-group.tsx +15 -6
- package/src/controls/components/repeater.tsx +1 -1
- package/src/controls/components/text-field-inner-selection.tsx +20 -24
- package/src/controls/control-actions/control-actions-context.tsx +27 -0
- package/src/controls/control-actions/control-actions-menu.ts +6 -7
- package/src/controls/control-actions/control-actions.tsx +14 -26
- package/src/{components/style-sections/effects-section/box-shadow-repeater.tsx → controls/controls/box-shadow-repeater-control.tsx} +51 -65
- package/src/controls/controls/color-control.tsx +25 -0
- package/src/controls/controls/equal-unequal-sizes-control.tsx +196 -0
- package/src/controls/{control-types → controls}/image-control.tsx +15 -23
- package/src/controls/{control-types → controls}/image-media-control.tsx +5 -14
- package/src/{components/style-sections/spacing-section → controls/controls}/linked-dimensions-control.tsx +10 -26
- package/src/controls/{control-types → controls}/number-control.tsx +2 -2
- package/src/controls/{control-types → controls}/select-control.tsx +4 -4
- package/src/controls/{control-types → controls}/size-control.tsx +8 -8
- package/src/controls/controls/stroke-control.tsx +105 -0
- package/src/controls/{control-types → controls}/text-area-control.tsx +3 -3
- package/src/controls/{control-types → controls}/text-control.tsx +3 -3
- package/src/controls/{control-types → controls}/toggle-control.tsx +4 -4
- package/src/controls/create-control-replacement.tsx +53 -0
- package/src/controls/create-control.tsx +12 -3
- package/src/controls/index.ts +24 -0
- package/src/controls-actions.ts +8 -0
- package/src/{controls/components → controls-registry}/control-type-container.tsx +1 -1
- package/src/{controls → controls-registry}/controls-registry.tsx +1 -6
- package/src/controls-registry/settings-field.tsx +35 -0
- package/src/controls-registry/styles-field.tsx +19 -0
- package/src/dynamics/components/dynamic-selection-control.tsx +11 -11
- package/src/dynamics/components/dynamic-selection.tsx +6 -6
- package/src/dynamics/dynamic-control.tsx +6 -5
- package/src/dynamics/hooks/use-dynamic-tag.ts +2 -2
- package/src/dynamics/hooks/use-prop-dynamic-action.tsx +7 -7
- package/src/dynamics/hooks/use-prop-dynamic-tags.ts +3 -3
- package/src/dynamics/hooks/use-prop-value-history.ts +3 -3
- package/src/dynamics/init.ts +2 -4
- package/src/dynamics/types.ts +2 -1
- package/src/dynamics/utils.ts +1 -2
- package/src/hooks/use-styles-field.ts +30 -0
- package/src/index.ts +3 -4
- package/src/sync/should-use-v2-panel.ts +1 -2
- package/src/sync/types.ts +3 -2
- package/src/components/style-sections/position-section/z-index-control.tsx +0 -20
- package/src/components/style-sections/size-section.tsx +0 -49
- package/src/components/style-sections/typography-section/font-size-control.tsx +0 -20
- package/src/components/style-sections/typography-section/letter-spacing-control.tsx +0 -20
- package/src/components/style-sections/typography-section/text-color-control.tsx +0 -20
- package/src/components/style-sections/typography-section/word-spacing-control.tsx +0 -20
- package/src/controls/control-context.tsx +0 -22
- package/src/controls/control-replacement.ts +0 -34
- package/src/controls/control-types/color-control.tsx +0 -27
- package/src/controls/hooks/use-style-control.ts +0 -29
- package/src/controls/settings-control.tsx +0 -37
- package/src/controls/style-control.tsx +0 -20
- package/src/hooks/use-element-style-prop.ts +0 -45
- package/src/hooks/use-element-styles.ts +0 -13
- package/src/hooks/use-element-type.ts +0 -33
- package/src/hooks/use-selected-elements.ts +0 -9
- package/src/hooks/use-widget-settings.ts +0 -16
- package/src/props/is-transformable.ts +0 -14
- package/src/sync/get-container.ts +0 -8
- package/src/sync/get-element-styles.ts +0 -9
- package/src/sync/get-selected-elements.ts +0 -21
- package/src/sync/get-widgets-cache.ts +0 -7
- package/src/sync/update-settings.ts +0 -14
- package/src/sync/update-style.ts +0 -24
- package/src/types.ts +0 -89
- package/src/{controls → controls-registry}/control.tsx +0 -0
- package/src/{controls/control-actions/actions/popover-action.tsx → popover-action.tsx} +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,309 +1,117 @@
|
|
|
1
|
-
// src/controls/control
|
|
2
|
-
import
|
|
3
|
-
|
|
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
|
-
|
|
12
|
-
// src/controls/control-replacement.ts
|
|
13
|
-
var controlReplacement;
|
|
14
|
-
var getControlReplacement = ({ value }) => {
|
|
15
|
-
let shouldReplace = false;
|
|
16
|
-
try {
|
|
17
|
-
shouldReplace = !!controlReplacement?.condition({ value }) && !!controlReplacement?.component;
|
|
18
|
-
} catch {
|
|
19
|
-
}
|
|
20
|
-
return shouldReplace ? controlReplacement?.component : void 0;
|
|
21
|
-
};
|
|
22
|
-
function replaceControl({ component, condition }) {
|
|
23
|
-
controlReplacement = { component, condition };
|
|
24
|
-
}
|
|
25
|
-
function useControlReplacement() {
|
|
26
|
-
const { value } = useControl();
|
|
27
|
-
return getControlReplacement({ value });
|
|
28
|
-
}
|
|
1
|
+
// src/controls/controls/image-control.tsx
|
|
2
|
+
import * as React9 from "react";
|
|
3
|
+
import { __ as __2 } from "@wordpress/i18n";
|
|
29
4
|
|
|
30
|
-
// src/controls/
|
|
5
|
+
// src/controls/bound-prop-context.tsx
|
|
31
6
|
import * as React from "react";
|
|
32
|
-
import {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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;
|
|
49
|
-
}
|
|
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
|
-
));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// src/controls/control-actions/control-actions-menu.ts
|
|
67
|
-
import { createMenu } from "@elementor/menus";
|
|
68
|
-
var controlActionsMenu = createMenu({
|
|
69
|
-
components: {
|
|
70
|
-
PopoverAction
|
|
7
|
+
import { createContext, useContext } from "react";
|
|
8
|
+
var BoundPropContext = createContext(null);
|
|
9
|
+
var BoundPropProvider = ({ children, value, setValue, bind }) => {
|
|
10
|
+
return /* @__PURE__ */ React.createElement(BoundPropContext.Provider, { value: { value, setValue, bind } }, children);
|
|
11
|
+
};
|
|
12
|
+
function useBoundProp(defaultValue) {
|
|
13
|
+
const boundPropContext = useContext(BoundPropContext);
|
|
14
|
+
if (!boundPropContext) {
|
|
15
|
+
throw new Error("useBoundProp must be used within a BoundPropContext");
|
|
71
16
|
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// src/panel.ts
|
|
75
|
-
import { __createPanel as createPanel } from "@elementor/editor-panels";
|
|
76
|
-
|
|
77
|
-
// src/components/editing-panel.tsx
|
|
78
|
-
import * as React45 from "react";
|
|
79
|
-
import { __ as __23 } from "@wordpress/i18n";
|
|
80
|
-
|
|
81
|
-
// src/hooks/use-selected-elements.ts
|
|
82
|
-
import { __privateUseListenTo as useListenTo, commandEndEvent } from "@elementor/editor-v1-adapters";
|
|
83
|
-
|
|
84
|
-
// src/sync/get-selected-elements.ts
|
|
85
|
-
function getSelectedElements() {
|
|
86
|
-
const extendedWindow = window;
|
|
87
|
-
const selectedElements = extendedWindow.elementor?.selection?.getElements?.() ?? [];
|
|
88
|
-
return selectedElements.reduce((acc, el) => {
|
|
89
|
-
const type = el.model.get("widgetType") || el.model.get("elType");
|
|
90
|
-
if (type) {
|
|
91
|
-
acc.push({
|
|
92
|
-
id: el.model.get("id"),
|
|
93
|
-
type
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
return acc;
|
|
97
|
-
}, []);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// src/hooks/use-selected-elements.ts
|
|
101
|
-
function useSelectedElements() {
|
|
102
|
-
return useListenTo(
|
|
103
|
-
[commandEndEvent("document/elements/select"), commandEndEvent("document/elements/deselect")],
|
|
104
|
-
() => getSelectedElements()
|
|
105
|
-
);
|
|
17
|
+
return { ...boundPropContext, value: boundPropContext.value ?? defaultValue };
|
|
106
18
|
}
|
|
107
19
|
|
|
108
|
-
// src/
|
|
109
|
-
import {
|
|
110
|
-
|
|
111
|
-
// src/sync/get-widgets-cache.ts
|
|
112
|
-
function getWidgetsCache() {
|
|
113
|
-
const extendedWindow = window;
|
|
114
|
-
return extendedWindow?.elementor?.widgetsCache || null;
|
|
115
|
-
}
|
|
20
|
+
// src/controls/controls/image-control.tsx
|
|
21
|
+
import { Grid, Stack as Stack2 } from "@elementor/ui";
|
|
116
22
|
|
|
117
|
-
// src/
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
const widgetsCache = getWidgetsCache();
|
|
126
|
-
const elementType = widgetsCache?.[type];
|
|
127
|
-
if (!elementType?.atomic_controls) {
|
|
128
|
-
return null;
|
|
129
|
-
}
|
|
130
|
-
if (!elementType?.atomic_props_schema) {
|
|
131
|
-
return null;
|
|
132
|
-
}
|
|
133
|
-
return {
|
|
134
|
-
key: type,
|
|
135
|
-
controls: elementType.atomic_controls,
|
|
136
|
-
propsSchema: elementType.atomic_props_schema,
|
|
137
|
-
title: elementType.title
|
|
138
|
-
};
|
|
139
|
-
},
|
|
140
|
-
[type]
|
|
141
|
-
);
|
|
142
|
-
}
|
|
23
|
+
// src/controls/controls/image-media-control.tsx
|
|
24
|
+
import * as React6 from "react";
|
|
25
|
+
import { __ } from "@wordpress/i18n";
|
|
26
|
+
import { UploadIcon } from "@elementor/icons";
|
|
27
|
+
import { Button, Card, CardMedia, CardOverlay, Stack } from "@elementor/ui";
|
|
28
|
+
import { useWpMediaAttachment, useWpMediaFrame } from "@elementor/wp-media";
|
|
143
29
|
|
|
144
|
-
// src/
|
|
145
|
-
import
|
|
30
|
+
// src/controls/control-actions/control-actions.tsx
|
|
31
|
+
import * as React3 from "react";
|
|
32
|
+
import { styled, UnstableFloatingActionBar } from "@elementor/ui";
|
|
146
33
|
|
|
147
|
-
// src/
|
|
34
|
+
// src/controls/control-actions/control-actions-context.tsx
|
|
148
35
|
import * as React2 from "react";
|
|
149
36
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
150
37
|
var Context = createContext2(null);
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
function useElementContext() {
|
|
38
|
+
var ControlActionsProvider = ({ children, items }) => /* @__PURE__ */ React2.createElement(Context.Provider, { value: { items } }, children);
|
|
39
|
+
var useControlActions = () => {
|
|
155
40
|
const context = useContext2(Context);
|
|
156
41
|
if (!context) {
|
|
157
|
-
throw new Error("
|
|
42
|
+
throw new Error("useControlActions must be used within a ControlActionsProvider");
|
|
158
43
|
}
|
|
159
44
|
return context;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// src/components/editing-panel-tabs.tsx
|
|
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";
|
|
166
|
-
|
|
167
|
-
// src/components/settings-tab.tsx
|
|
168
|
-
import * as React17 from "react";
|
|
169
|
-
import { Stack as Stack5 } from "@elementor/ui";
|
|
170
|
-
|
|
171
|
-
// src/controls/settings-control.tsx
|
|
172
|
-
import * as React4 from "react";
|
|
173
|
-
|
|
174
|
-
// src/hooks/use-widget-settings.ts
|
|
175
|
-
import { commandEndEvent as commandEndEvent3, __privateUseListenTo as useListenTo3 } from "@elementor/editor-v1-adapters";
|
|
176
|
-
|
|
177
|
-
// src/sync/get-container.ts
|
|
178
|
-
function getContainer(id) {
|
|
179
|
-
const extendedWindow = window;
|
|
180
|
-
const container = extendedWindow.elementor?.getContainer?.(id);
|
|
181
|
-
return container ?? null;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// src/hooks/use-widget-settings.ts
|
|
185
|
-
var useWidgetSettings = ({ id, bind }) => {
|
|
186
|
-
return useListenTo3(
|
|
187
|
-
commandEndEvent3("document/elements/settings"),
|
|
188
|
-
() => {
|
|
189
|
-
const container = getContainer(id);
|
|
190
|
-
const value = container?.settings?.get(bind) ?? null;
|
|
191
|
-
return value;
|
|
192
|
-
},
|
|
193
|
-
[id, bind]
|
|
194
|
-
);
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
// src/sync/update-settings.ts
|
|
198
|
-
import { __privateRunCommand as runCommand } from "@elementor/editor-v1-adapters";
|
|
199
|
-
var updateSettings = ({ id, props }) => {
|
|
200
|
-
const container = getContainer(id);
|
|
201
|
-
runCommand("document/elements/settings", {
|
|
202
|
-
container,
|
|
203
|
-
settings: {
|
|
204
|
-
...props
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
// src/components/control-label.tsx
|
|
210
|
-
import * as React3 from "react";
|
|
211
|
-
import { Typography as Typography2 } from "@elementor/ui";
|
|
212
|
-
var ControlLabel = ({ children }) => {
|
|
213
|
-
return /* @__PURE__ */ React3.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary" }, children);
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
// src/controls/settings-control.tsx
|
|
217
|
-
var SettingsControl = ({ bind, children }) => {
|
|
218
|
-
const { element, elementType } = useElementContext();
|
|
219
|
-
const defaultValue = elementType.propsSchema[bind]?.default;
|
|
220
|
-
const settingsValue = useWidgetSettings({ id: element.id, bind });
|
|
221
|
-
const value = settingsValue ?? defaultValue ?? null;
|
|
222
|
-
const setValue = (newValue) => {
|
|
223
|
-
updateSettings({
|
|
224
|
-
id: element.id,
|
|
225
|
-
props: {
|
|
226
|
-
[bind]: newValue
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
};
|
|
230
|
-
return /* @__PURE__ */ React4.createElement(ControlContext.Provider, { value: { setValue, value, bind } }, children);
|
|
231
|
-
};
|
|
232
|
-
SettingsControl.Label = ControlLabel;
|
|
233
|
-
|
|
234
|
-
// src/components/accordion-section.tsx
|
|
235
|
-
import * as React5 from "react";
|
|
236
|
-
import { useId as useId2 } from "react";
|
|
237
|
-
import { Accordion, AccordionSummary, AccordionDetails, AccordionSummaryText, Stack as Stack2 } from "@elementor/ui";
|
|
238
|
-
var AccordionSection = ({ title, children }) => {
|
|
239
|
-
const uid = useId2();
|
|
240
|
-
const labelId = `label-${uid}`;
|
|
241
|
-
const contentId = `content-${uid}`;
|
|
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)));
|
|
243
45
|
};
|
|
244
46
|
|
|
245
|
-
// src/controls/control.tsx
|
|
246
|
-
import * as React15 from "react";
|
|
247
|
-
import { createError } from "@elementor/utils";
|
|
248
|
-
|
|
249
|
-
// src/controls/control-types/image-control.tsx
|
|
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";
|
|
257
|
-
import { UploadIcon } from "@elementor/icons";
|
|
258
|
-
import { useWpMediaAttachment, useWpMediaFrame } from "@elementor/wp-media";
|
|
259
|
-
import { __ } from "@wordpress/i18n";
|
|
260
|
-
|
|
261
47
|
// src/controls/control-actions/control-actions.tsx
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
var { useMenuItems } = controlActionsMenu;
|
|
265
|
-
var FloatingBar = styled(UnstableFloatingActionBar)`
|
|
266
|
-
& .MuiPaper-root:empty {
|
|
267
|
-
display: none;
|
|
268
|
-
}
|
|
48
|
+
var FloatingBarContainer = styled("span")`
|
|
49
|
+
display: contents;
|
|
269
50
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
& > :first-of-type {
|
|
273
|
-
width: 100%;
|
|
51
|
+
.MuiFloatingActionBar-popper:has( .MuiFloatingActionBar-actions:empty ) {
|
|
52
|
+
display: none;
|
|
274
53
|
}
|
|
275
54
|
`;
|
|
276
|
-
function ControlActions({
|
|
277
|
-
const items =
|
|
55
|
+
function ControlActions({ children }) {
|
|
56
|
+
const { items } = useControlActions();
|
|
278
57
|
if (items.length === 0) {
|
|
279
58
|
return children;
|
|
280
59
|
}
|
|
281
|
-
|
|
282
|
-
|
|
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
|
-
);
|
|
60
|
+
const menuItems = items.map(({ MenuItem: MenuItem4, id }) => /* @__PURE__ */ React3.createElement(MenuItem4, { key: id }));
|
|
61
|
+
return /* @__PURE__ */ React3.createElement(FloatingBarContainer, null, /* @__PURE__ */ React3.createElement(UnstableFloatingActionBar, { actions: menuItems }, children));
|
|
289
62
|
}
|
|
290
63
|
|
|
291
64
|
// src/controls/create-control.tsx
|
|
292
|
-
import * as
|
|
65
|
+
import * as React5 from "react";
|
|
66
|
+
|
|
67
|
+
// src/controls/create-control-replacement.tsx
|
|
68
|
+
import * as React4 from "react";
|
|
69
|
+
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
70
|
+
var ControlReplacementContext = createContext3(void 0);
|
|
71
|
+
var ControlReplacementProvider = ({
|
|
72
|
+
component,
|
|
73
|
+
condition,
|
|
74
|
+
children
|
|
75
|
+
}) => {
|
|
76
|
+
return /* @__PURE__ */ React4.createElement(ControlReplacementContext.Provider, { value: { component, condition } }, children);
|
|
77
|
+
};
|
|
78
|
+
var useControlReplacement = () => {
|
|
79
|
+
const { value } = useBoundProp();
|
|
80
|
+
const controlReplacement = useContext3(ControlReplacementContext);
|
|
81
|
+
let shouldReplace = false;
|
|
82
|
+
try {
|
|
83
|
+
shouldReplace = !!controlReplacement?.condition({ value }) && !!controlReplacement.component;
|
|
84
|
+
} catch {
|
|
85
|
+
}
|
|
86
|
+
return shouldReplace ? controlReplacement?.component : void 0;
|
|
87
|
+
};
|
|
88
|
+
var createControlReplacement = () => {
|
|
89
|
+
let controlReplacement;
|
|
90
|
+
function replaceControl2({ component, condition }) {
|
|
91
|
+
controlReplacement = { component, condition };
|
|
92
|
+
}
|
|
93
|
+
function getControlReplacement2() {
|
|
94
|
+
return controlReplacement;
|
|
95
|
+
}
|
|
96
|
+
return { replaceControl: replaceControl2, getControlReplacement: getControlReplacement2 };
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
// src/controls/create-control.tsx
|
|
100
|
+
import { ErrorBoundary } from "@elementor/ui";
|
|
293
101
|
var brandSymbol = Symbol("control");
|
|
294
102
|
function createControl(Component, { supportsReplacements = true } = {}) {
|
|
295
103
|
return (props) => {
|
|
296
104
|
const ControlReplacement = useControlReplacement();
|
|
297
105
|
if (ControlReplacement && supportsReplacements) {
|
|
298
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ React5.createElement(ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(ControlReplacement, { ...props }));
|
|
299
107
|
}
|
|
300
|
-
return /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ React5.createElement(ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(Component, { ...props }));
|
|
301
109
|
};
|
|
302
110
|
}
|
|
303
111
|
|
|
304
|
-
// src/controls/
|
|
112
|
+
// src/controls/controls/image-media-control.tsx
|
|
305
113
|
var ImageMediaControl = createControl(() => {
|
|
306
|
-
const { value, setValue } =
|
|
114
|
+
const { value, setValue } = useBoundProp();
|
|
307
115
|
const { id, url } = value?.value ?? {};
|
|
308
116
|
const { data: attachment } = useWpMediaAttachment(id?.value || null);
|
|
309
117
|
const src = attachment?.url ?? url;
|
|
@@ -324,7 +132,7 @@ var ImageMediaControl = createControl(() => {
|
|
|
324
132
|
});
|
|
325
133
|
}
|
|
326
134
|
});
|
|
327
|
-
return /* @__PURE__ */
|
|
135
|
+
return /* @__PURE__ */ React6.createElement(Card, { variant: "outlined" }, /* @__PURE__ */ React6.createElement(CardMedia, { image: src, sx: { height: 150 } }), /* @__PURE__ */ React6.createElement(CardOverlay, null, /* @__PURE__ */ React6.createElement(ControlActions, null, /* @__PURE__ */ React6.createElement(Stack, { gap: 0.5 }, /* @__PURE__ */ React6.createElement(
|
|
328
136
|
Button,
|
|
329
137
|
{
|
|
330
138
|
size: "tiny",
|
|
@@ -333,33 +141,40 @@ var ImageMediaControl = createControl(() => {
|
|
|
333
141
|
onClick: () => open({ mode: "browse" })
|
|
334
142
|
},
|
|
335
143
|
__("Select Image", "elementor")
|
|
336
|
-
), /* @__PURE__ */
|
|
144
|
+
), /* @__PURE__ */ React6.createElement(
|
|
337
145
|
Button,
|
|
338
146
|
{
|
|
339
147
|
size: "tiny",
|
|
340
148
|
variant: "text",
|
|
341
149
|
color: "inherit",
|
|
342
|
-
startIcon: /* @__PURE__ */
|
|
150
|
+
startIcon: /* @__PURE__ */ React6.createElement(UploadIcon, null),
|
|
343
151
|
onClick: () => open({ mode: "upload" })
|
|
344
152
|
},
|
|
345
153
|
__("Upload Image", "elementor")
|
|
346
154
|
)))));
|
|
347
155
|
});
|
|
348
156
|
|
|
349
|
-
// src/controls/
|
|
350
|
-
import * as
|
|
157
|
+
// src/controls/controls/select-control.tsx
|
|
158
|
+
import * as React7 from "react";
|
|
351
159
|
import { MenuItem, Select } from "@elementor/ui";
|
|
352
|
-
var SelectControl = createControl(({ options:
|
|
353
|
-
const { value, setValue } =
|
|
160
|
+
var SelectControl = createControl(({ options: options5 }) => {
|
|
161
|
+
const { value, setValue } = useBoundProp();
|
|
354
162
|
const handleChange = (event) => {
|
|
355
163
|
setValue(event.target.value);
|
|
356
164
|
};
|
|
357
|
-
return /* @__PURE__ */
|
|
165
|
+
return /* @__PURE__ */ React7.createElement(ControlActions, null, /* @__PURE__ */ React7.createElement(Select, { displayEmpty: true, size: "tiny", value: value ?? "", onChange: handleChange, fullWidth: true }, options5.map(({ label, ...props }) => /* @__PURE__ */ React7.createElement(MenuItem, { key: props.value, ...props }, label))));
|
|
358
166
|
});
|
|
359
167
|
|
|
360
|
-
// src/
|
|
168
|
+
// src/components/control-label.tsx
|
|
169
|
+
import * as React8 from "react";
|
|
170
|
+
import { Typography } from "@elementor/ui";
|
|
171
|
+
var ControlLabel = ({ children }) => {
|
|
172
|
+
return /* @__PURE__ */ React8.createElement(Typography, { component: "label", variant: "caption", color: "text.secondary" }, children);
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
// src/controls/controls/image-control.tsx
|
|
361
176
|
var ImageControl = createControl((props) => {
|
|
362
|
-
const { value, setValue } =
|
|
177
|
+
const { value, setValue } = useBoundProp();
|
|
363
178
|
const { src, size } = value?.value || {};
|
|
364
179
|
const setImageSrc = (newValue) => {
|
|
365
180
|
setValue({
|
|
@@ -379,27 +194,27 @@ var ImageControl = createControl((props) => {
|
|
|
379
194
|
}
|
|
380
195
|
});
|
|
381
196
|
};
|
|
382
|
-
return /* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ React9.createElement(Stack2, { gap: 2 }, /* @__PURE__ */ React9.createElement(BoundPropProvider, { value: src, setValue: setImageSrc, bind: "src" }, /* @__PURE__ */ React9.createElement(ImageMediaControl, null)), /* @__PURE__ */ React9.createElement(BoundPropProvider, { value: size, setValue: setImageSize, bind: "size" }, /* @__PURE__ */ React9.createElement(Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React9.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React9.createElement(ControlLabel, null, " ", __2("Image Resolution", "elementor"))), /* @__PURE__ */ React9.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React9.createElement(SelectControl, { options: props.sizes })))));
|
|
383
198
|
});
|
|
384
199
|
|
|
385
|
-
// src/controls/
|
|
386
|
-
import * as
|
|
200
|
+
// src/controls/controls/text-control.tsx
|
|
201
|
+
import * as React10 from "react";
|
|
387
202
|
import { TextField } from "@elementor/ui";
|
|
388
203
|
var TextControl = createControl(({ placeholder }) => {
|
|
389
|
-
const { value, setValue } =
|
|
204
|
+
const { value, setValue } = useBoundProp("");
|
|
390
205
|
const handleChange = (event) => setValue(event.target.value);
|
|
391
|
-
return /* @__PURE__ */
|
|
206
|
+
return /* @__PURE__ */ React10.createElement(ControlActions, null, /* @__PURE__ */ React10.createElement(TextField, { type: "text", size: "tiny", value, onChange: handleChange, placeholder }));
|
|
392
207
|
});
|
|
393
208
|
|
|
394
|
-
// src/controls/
|
|
395
|
-
import * as
|
|
209
|
+
// src/controls/controls/text-area-control.tsx
|
|
210
|
+
import * as React11 from "react";
|
|
396
211
|
import { TextField as TextField2 } from "@elementor/ui";
|
|
397
212
|
var TextAreaControl = createControl(({ placeholder }) => {
|
|
398
|
-
const { value, setValue } =
|
|
213
|
+
const { value, setValue } = useBoundProp();
|
|
399
214
|
const handleChange = (event) => {
|
|
400
215
|
setValue(event.target.value);
|
|
401
216
|
};
|
|
402
|
-
return /* @__PURE__ */
|
|
217
|
+
return /* @__PURE__ */ React11.createElement(ControlActions, null, /* @__PURE__ */ React11.createElement(
|
|
403
218
|
TextField2,
|
|
404
219
|
{
|
|
405
220
|
size: "tiny",
|
|
@@ -413,8 +228,8 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
413
228
|
));
|
|
414
229
|
});
|
|
415
230
|
|
|
416
|
-
// src/controls/
|
|
417
|
-
import * as
|
|
231
|
+
// src/controls/controls/size-control.tsx
|
|
232
|
+
import * as React13 from "react";
|
|
418
233
|
import { InputAdornment as InputAdornment2 } from "@elementor/ui";
|
|
419
234
|
|
|
420
235
|
// src/controls/hooks/use-sync-external-state.tsx
|
|
@@ -451,46 +266,42 @@ var useSyncExternalState = ({
|
|
|
451
266
|
};
|
|
452
267
|
|
|
453
268
|
// src/controls/components/text-field-inner-selection.tsx
|
|
454
|
-
import * as
|
|
455
|
-
import {
|
|
456
|
-
import {
|
|
457
|
-
var TextFieldInnerSelection = (
|
|
458
|
-
placeholder,
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
placeholder,
|
|
473
|
-
InputProps: {
|
|
474
|
-
endAdornment,
|
|
475
|
-
startAdornment
|
|
269
|
+
import * as React12 from "react";
|
|
270
|
+
import { forwardRef, useId } from "react";
|
|
271
|
+
import { bindMenu, bindTrigger, Button as Button2, InputAdornment, Menu, MenuItem as MenuItem2, TextField as TextField3, usePopupState } from "@elementor/ui";
|
|
272
|
+
var TextFieldInnerSelection = forwardRef(
|
|
273
|
+
({ placeholder, type, value, onChange, endAdornment, startAdornment }, ref) => {
|
|
274
|
+
return /* @__PURE__ */ React12.createElement(
|
|
275
|
+
TextField3,
|
|
276
|
+
{
|
|
277
|
+
size: "tiny",
|
|
278
|
+
type,
|
|
279
|
+
value,
|
|
280
|
+
onChange,
|
|
281
|
+
placeholder,
|
|
282
|
+
InputProps: {
|
|
283
|
+
endAdornment,
|
|
284
|
+
startAdornment
|
|
285
|
+
},
|
|
286
|
+
ref
|
|
476
287
|
}
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
);
|
|
480
291
|
var SelectionEndAdornment = ({
|
|
481
|
-
options:
|
|
292
|
+
options: options5,
|
|
482
293
|
onClick,
|
|
483
294
|
value
|
|
484
295
|
}) => {
|
|
485
|
-
const popupState =
|
|
296
|
+
const popupState = usePopupState({
|
|
486
297
|
variant: "popover",
|
|
487
|
-
popupId:
|
|
298
|
+
popupId: useId()
|
|
488
299
|
});
|
|
489
300
|
const handleMenuItemClick = (index) => {
|
|
490
|
-
onClick(
|
|
301
|
+
onClick(options5[index]);
|
|
491
302
|
popupState.close();
|
|
492
303
|
};
|
|
493
|
-
return /* @__PURE__ */
|
|
304
|
+
return /* @__PURE__ */ React12.createElement(InputAdornment, { position: "end" }, /* @__PURE__ */ React12.createElement(
|
|
494
305
|
Button2,
|
|
495
306
|
{
|
|
496
307
|
size: "small",
|
|
@@ -499,13 +310,13 @@ var SelectionEndAdornment = ({
|
|
|
499
310
|
...bindTrigger(popupState)
|
|
500
311
|
},
|
|
501
312
|
value.toUpperCase()
|
|
502
|
-
), /* @__PURE__ */
|
|
313
|
+
), /* @__PURE__ */ React12.createElement(Menu, { MenuListProps: { dense: true }, ...bindMenu(popupState) }, options5.map((option, index) => /* @__PURE__ */ React12.createElement(MenuItem2, { key: option, onClick: () => handleMenuItemClick(index) }, option.toUpperCase()))));
|
|
503
314
|
};
|
|
504
315
|
|
|
505
|
-
// src/controls/
|
|
506
|
-
var defaultUnits = ["px", "%", "em", "rem", "vw"];
|
|
507
|
-
var SizeControl = createControl(({ units = defaultUnits, placeholder, startIcon }) => {
|
|
508
|
-
const { value, setValue } =
|
|
316
|
+
// src/controls/controls/size-control.tsx
|
|
317
|
+
var defaultUnits = ["px", "%", "em", "rem", "vw", "vh"];
|
|
318
|
+
var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, startIcon }) => {
|
|
319
|
+
const { value, setValue } = useBoundProp();
|
|
509
320
|
const [state, setState] = useSyncExternalState({
|
|
510
321
|
external: value,
|
|
511
322
|
setExternal: setValue,
|
|
@@ -534,12 +345,12 @@ var SizeControl = createControl(({ units = defaultUnits, placeholder, startIcon
|
|
|
534
345
|
}
|
|
535
346
|
}));
|
|
536
347
|
};
|
|
537
|
-
return /* @__PURE__ */
|
|
348
|
+
return /* @__PURE__ */ React13.createElement(ControlActions, null, /* @__PURE__ */ React13.createElement(
|
|
538
349
|
TextFieldInnerSelection,
|
|
539
350
|
{
|
|
540
|
-
endAdornment: /* @__PURE__ */
|
|
351
|
+
endAdornment: /* @__PURE__ */ React13.createElement(SelectionEndAdornment, { options: units2, onClick: handleUnitChange, value: state.value.unit }),
|
|
541
352
|
placeholder,
|
|
542
|
-
startAdornment: startIcon ?? /* @__PURE__ */
|
|
353
|
+
startAdornment: startIcon ?? /* @__PURE__ */ React13.createElement(InputAdornment2, { position: "start" }, startIcon),
|
|
543
354
|
type: "number",
|
|
544
355
|
value: Number.isNaN(state.value.size) ? "" : state.value.size,
|
|
545
356
|
onChange: handleSizeChange
|
|
@@ -547,50 +358,571 @@ var SizeControl = createControl(({ units = defaultUnits, placeholder, startIcon
|
|
|
547
358
|
));
|
|
548
359
|
});
|
|
549
360
|
|
|
550
|
-
// src/controls/controls-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
textarea: { component: TextAreaControl, layout: "full" },
|
|
555
|
-
size: { component: SizeControl, layout: "two-columns" },
|
|
556
|
-
select: { component: SelectControl, layout: "two-columns" }
|
|
557
|
-
};
|
|
558
|
-
var getControlByType = (type) => controlTypes[type]?.component;
|
|
559
|
-
var getLayoutByType = (type) => controlTypes[type].layout;
|
|
361
|
+
// src/controls/controls/stroke-control.tsx
|
|
362
|
+
import * as React15 from "react";
|
|
363
|
+
import { __ as __3 } from "@wordpress/i18n";
|
|
364
|
+
import { Grid as Grid2, Stack as Stack3 } from "@elementor/ui";
|
|
560
365
|
|
|
561
|
-
// src/controls/control.tsx
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
366
|
+
// src/controls/controls/color-control.tsx
|
|
367
|
+
import * as React14 from "react";
|
|
368
|
+
import { UnstableColorField } from "@elementor/ui";
|
|
369
|
+
var ColorControl = createControl(
|
|
370
|
+
(props) => {
|
|
371
|
+
const { value, setValue } = useBoundProp();
|
|
372
|
+
const handleChange = (selectedColor) => {
|
|
373
|
+
setValue({
|
|
374
|
+
$$type: "color",
|
|
375
|
+
value: selectedColor
|
|
376
|
+
});
|
|
377
|
+
};
|
|
378
|
+
return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(UnstableColorField, { size: "tiny", ...props, value: value?.value, onChange: handleChange }));
|
|
572
379
|
}
|
|
573
|
-
|
|
574
|
-
};
|
|
380
|
+
);
|
|
575
381
|
|
|
576
|
-
// src/controls/
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
382
|
+
// src/controls/controls/stroke-control.tsx
|
|
383
|
+
var defaultStrokeControlValue = {
|
|
384
|
+
$$type: "stroke",
|
|
385
|
+
value: {
|
|
386
|
+
color: {
|
|
387
|
+
$$type: "color",
|
|
388
|
+
value: "#000000"
|
|
389
|
+
},
|
|
390
|
+
width: {
|
|
391
|
+
$$type: "size",
|
|
392
|
+
value: {
|
|
393
|
+
unit: "px",
|
|
394
|
+
size: NaN
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
585
398
|
};
|
|
586
|
-
var
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
399
|
+
var units = ["px", "em", "rem"];
|
|
400
|
+
var StrokeControl = createControl(() => {
|
|
401
|
+
const { value, setValue } = useBoundProp(defaultStrokeControlValue);
|
|
402
|
+
const setStrokeWidth = (newValue) => {
|
|
403
|
+
const updatedValue = {
|
|
404
|
+
...value?.value ?? defaultStrokeControlValue.value,
|
|
405
|
+
width: newValue
|
|
406
|
+
};
|
|
407
|
+
setValue({
|
|
408
|
+
$$type: "stroke",
|
|
409
|
+
value: updatedValue
|
|
410
|
+
});
|
|
411
|
+
};
|
|
412
|
+
const setStrokeColor = (newValue) => {
|
|
413
|
+
const updatedValue = {
|
|
414
|
+
...value?.value ?? defaultStrokeControlValue.value,
|
|
415
|
+
color: newValue
|
|
416
|
+
};
|
|
417
|
+
setValue({
|
|
418
|
+
$$type: "stroke",
|
|
419
|
+
value: updatedValue
|
|
420
|
+
});
|
|
421
|
+
};
|
|
422
|
+
return /* @__PURE__ */ React15.createElement(Stack3, { gap: 1.5 }, /* @__PURE__ */ React15.createElement(
|
|
423
|
+
Control,
|
|
424
|
+
{
|
|
425
|
+
bind: "width",
|
|
426
|
+
label: __3("Stroke Width", "elementor"),
|
|
427
|
+
value: value?.value.width ?? defaultStrokeControlValue.value.width,
|
|
428
|
+
setValue: setStrokeWidth
|
|
429
|
+
},
|
|
430
|
+
/* @__PURE__ */ React15.createElement(SizeControl, { units })
|
|
431
|
+
), /* @__PURE__ */ React15.createElement(
|
|
432
|
+
Control,
|
|
433
|
+
{
|
|
434
|
+
bind: "color",
|
|
435
|
+
label: __3("Stroke Color", "elementor"),
|
|
436
|
+
value: value?.value.color ?? defaultStrokeControlValue.value.color,
|
|
437
|
+
setValue: setStrokeColor
|
|
438
|
+
},
|
|
439
|
+
/* @__PURE__ */ React15.createElement(ColorControl, null)
|
|
440
|
+
));
|
|
441
|
+
});
|
|
442
|
+
var Control = ({
|
|
443
|
+
bind,
|
|
444
|
+
value,
|
|
445
|
+
setValue,
|
|
446
|
+
label,
|
|
447
|
+
children
|
|
448
|
+
}) => /* @__PURE__ */ React15.createElement(BoundPropProvider, { bind, value, setValue }, /* @__PURE__ */ React15.createElement(Grid2, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React15.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React15.createElement(ControlLabel, null, label)), /* @__PURE__ */ React15.createElement(Grid2, { item: true, xs: 6 }, children)));
|
|
449
|
+
|
|
450
|
+
// src/controls/controls/box-shadow-repeater-control.tsx
|
|
451
|
+
import * as React17 from "react";
|
|
452
|
+
import { __ as __5 } from "@wordpress/i18n";
|
|
453
|
+
import { Grid as Grid3, Stack as Stack5, Typography as Typography3, UnstableColorIndicator } from "@elementor/ui";
|
|
454
|
+
|
|
455
|
+
// src/controls/components/repeater.tsx
|
|
456
|
+
import * as React16 from "react";
|
|
457
|
+
import { useId as useId2, useRef, useState as useState2 } from "react";
|
|
458
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
459
|
+
import { PlusIcon, XIcon, CopyIcon, EyeIcon, EyeOffIcon } from "@elementor/icons";
|
|
460
|
+
import {
|
|
461
|
+
Box,
|
|
462
|
+
Stack as Stack4,
|
|
463
|
+
Popover,
|
|
464
|
+
IconButton,
|
|
465
|
+
bindTrigger as bindTrigger2,
|
|
466
|
+
bindPopover,
|
|
467
|
+
usePopupState as usePopupState2,
|
|
468
|
+
UnstableTag,
|
|
469
|
+
Typography as Typography2
|
|
470
|
+
} from "@elementor/ui";
|
|
471
|
+
var SIZE = "tiny";
|
|
472
|
+
var Repeater = ({
|
|
473
|
+
label,
|
|
474
|
+
itemSettings,
|
|
475
|
+
values: repeaterValues = [],
|
|
476
|
+
setValues: setRepeaterValues
|
|
477
|
+
}) => {
|
|
478
|
+
const addRepeaterItem = () => {
|
|
479
|
+
const newItem = structuredClone(itemSettings.initialValues);
|
|
480
|
+
setRepeaterValues([...repeaterValues, newItem]);
|
|
481
|
+
};
|
|
482
|
+
const duplicateRepeaterItem = (index) => {
|
|
483
|
+
setRepeaterValues([
|
|
484
|
+
...repeaterValues.slice(0, index),
|
|
485
|
+
structuredClone(repeaterValues[index]),
|
|
486
|
+
...repeaterValues.slice(index)
|
|
487
|
+
]);
|
|
488
|
+
};
|
|
489
|
+
const removeRepeaterItem = (index) => {
|
|
490
|
+
setRepeaterValues(repeaterValues.filter((_, i) => i !== index));
|
|
491
|
+
};
|
|
492
|
+
const toggleDisableRepeaterItem = (index) => {
|
|
493
|
+
setRepeaterValues(
|
|
494
|
+
repeaterValues.map((value, i) => {
|
|
495
|
+
if (i === index) {
|
|
496
|
+
const { disabled, ...rest } = value;
|
|
497
|
+
return { ...rest, ...disabled ? {} : { disabled: true } };
|
|
498
|
+
}
|
|
499
|
+
return value;
|
|
500
|
+
})
|
|
501
|
+
);
|
|
502
|
+
};
|
|
503
|
+
return /* @__PURE__ */ React16.createElement(Stack4, null, /* @__PURE__ */ React16.createElement(Stack4, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pb: 1 } }, /* @__PURE__ */ React16.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary" }, label), /* @__PURE__ */ React16.createElement(IconButton, { size: SIZE, onClick: addRepeaterItem, "aria-label": __4("Add item", "elementor") }, /* @__PURE__ */ React16.createElement(PlusIcon, { fontSize: SIZE }))), /* @__PURE__ */ React16.createElement(Stack4, { gap: 1 }, repeaterValues.map((value, index) => /* @__PURE__ */ React16.createElement(
|
|
504
|
+
RepeaterItem,
|
|
505
|
+
{
|
|
506
|
+
key: index,
|
|
507
|
+
disabled: value.disabled,
|
|
508
|
+
label: /* @__PURE__ */ React16.createElement(itemSettings.Label, { value }),
|
|
509
|
+
startIcon: /* @__PURE__ */ React16.createElement(itemSettings.Icon, { value }),
|
|
510
|
+
removeItem: () => removeRepeaterItem(index),
|
|
511
|
+
duplicateItem: () => duplicateRepeaterItem(index),
|
|
512
|
+
toggleDisableItem: () => toggleDisableRepeaterItem(index)
|
|
513
|
+
},
|
|
514
|
+
(props) => /* @__PURE__ */ React16.createElement(
|
|
515
|
+
itemSettings.Content,
|
|
516
|
+
{
|
|
517
|
+
...props,
|
|
518
|
+
value,
|
|
519
|
+
setValue: (newValue) => setRepeaterValues(
|
|
520
|
+
repeaterValues.map((item, i) => i === index ? newValue : item)
|
|
521
|
+
)
|
|
522
|
+
}
|
|
523
|
+
)
|
|
524
|
+
))));
|
|
525
|
+
};
|
|
526
|
+
var RepeaterItem = ({
|
|
527
|
+
label,
|
|
528
|
+
disabled,
|
|
529
|
+
startIcon,
|
|
530
|
+
children,
|
|
531
|
+
removeItem,
|
|
532
|
+
duplicateItem,
|
|
533
|
+
toggleDisableItem
|
|
534
|
+
}) => {
|
|
535
|
+
const popupId = useId2();
|
|
536
|
+
const tagRef = useRef(null);
|
|
537
|
+
const [anchorEl, setAnchorEl] = useState2(null);
|
|
538
|
+
const popoverState = usePopupState2({ popupId, variant: "popover" });
|
|
539
|
+
const popoverProps = bindPopover(popoverState);
|
|
540
|
+
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
|
|
541
|
+
UnstableTag,
|
|
542
|
+
{
|
|
543
|
+
ref: tagRef,
|
|
544
|
+
label,
|
|
545
|
+
showActionsOnHover: true,
|
|
546
|
+
variant: "outlined",
|
|
547
|
+
"aria-label": __4("Open item", "elementor"),
|
|
548
|
+
...bindTrigger2(popoverState),
|
|
549
|
+
startIcon,
|
|
550
|
+
actions: /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
|
|
551
|
+
IconButton,
|
|
552
|
+
{
|
|
553
|
+
size: SIZE,
|
|
554
|
+
onClick: duplicateItem,
|
|
555
|
+
"aria-label": __4("Duplicate item", "elementor")
|
|
556
|
+
},
|
|
557
|
+
/* @__PURE__ */ React16.createElement(CopyIcon, { fontSize: SIZE })
|
|
558
|
+
), /* @__PURE__ */ React16.createElement(
|
|
559
|
+
IconButton,
|
|
560
|
+
{
|
|
561
|
+
size: SIZE,
|
|
562
|
+
onClick: toggleDisableItem,
|
|
563
|
+
"aria-label": disabled ? __4("Enable item", "elementor") : __4("Disable item", "elementor")
|
|
564
|
+
},
|
|
565
|
+
disabled ? /* @__PURE__ */ React16.createElement(EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React16.createElement(EyeIcon, { fontSize: SIZE })
|
|
566
|
+
), /* @__PURE__ */ React16.createElement(
|
|
567
|
+
IconButton,
|
|
568
|
+
{
|
|
569
|
+
size: SIZE,
|
|
570
|
+
onClick: removeItem,
|
|
571
|
+
"aria-label": __4("Remove item", "elementor")
|
|
572
|
+
},
|
|
573
|
+
/* @__PURE__ */ React16.createElement(XIcon, { fontSize: SIZE })
|
|
574
|
+
))
|
|
575
|
+
}
|
|
576
|
+
), /* @__PURE__ */ React16.createElement(
|
|
577
|
+
Popover,
|
|
578
|
+
{
|
|
579
|
+
disablePortal: true,
|
|
580
|
+
slotProps: {
|
|
581
|
+
paper: { ref: setAnchorEl, sx: { width: tagRef.current?.getBoundingClientRect().width } }
|
|
582
|
+
},
|
|
583
|
+
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
584
|
+
...popoverProps
|
|
585
|
+
},
|
|
586
|
+
/* @__PURE__ */ React16.createElement(Box, { p: 2 }, children({ anchorEl }))
|
|
587
|
+
));
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
// src/controls/controls/box-shadow-repeater-control.tsx
|
|
591
|
+
var BoxShadowRepeaterControl = createControl(() => {
|
|
592
|
+
const { value, setValue } = useBoundProp();
|
|
593
|
+
const boxShadowValues = value?.value;
|
|
594
|
+
const setBoxShadow = (newValue) => {
|
|
595
|
+
setValue({
|
|
596
|
+
$$type: "box-shadow",
|
|
597
|
+
value: newValue
|
|
598
|
+
});
|
|
599
|
+
};
|
|
600
|
+
return /* @__PURE__ */ React17.createElement(
|
|
601
|
+
Repeater,
|
|
602
|
+
{
|
|
603
|
+
values: boxShadowValues,
|
|
604
|
+
setValues: setBoxShadow,
|
|
605
|
+
label: __5("Box shadow", "elementor"),
|
|
606
|
+
itemSettings: {
|
|
607
|
+
Icon: ItemIcon,
|
|
608
|
+
Label: ItemLabel,
|
|
609
|
+
Content: ItemContent,
|
|
610
|
+
initialValues: initialShadow
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
);
|
|
614
|
+
});
|
|
615
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React17.createElement(UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color.value });
|
|
616
|
+
var ItemContent = ({
|
|
617
|
+
value,
|
|
618
|
+
setValue
|
|
619
|
+
}) => {
|
|
620
|
+
const setShadow = (newValue) => {
|
|
621
|
+
setValue({
|
|
622
|
+
$$type: "shadow",
|
|
623
|
+
value: newValue
|
|
624
|
+
});
|
|
625
|
+
};
|
|
626
|
+
return /* @__PURE__ */ React17.createElement(Stack5, { gap: 1.5 }, /* @__PURE__ */ React17.createElement(Grid3, { container: true, spacing: 1 }, /* @__PURE__ */ React17.createElement(
|
|
627
|
+
Control2,
|
|
628
|
+
{
|
|
629
|
+
bind: "color",
|
|
630
|
+
value: value.value.color,
|
|
631
|
+
label: __5("Color", "elementor"),
|
|
632
|
+
setValue: (v) => setShadow({ ...value.value, color: v })
|
|
633
|
+
},
|
|
634
|
+
/* @__PURE__ */ React17.createElement(ColorControl, null)
|
|
635
|
+
), /* @__PURE__ */ React17.createElement(
|
|
636
|
+
Control2,
|
|
637
|
+
{
|
|
638
|
+
bind: "position",
|
|
639
|
+
value: value.value.position,
|
|
640
|
+
label: __5("Position", "elementor"),
|
|
641
|
+
setValue: (v) => setShadow({ ...value.value, position: v || null })
|
|
642
|
+
},
|
|
643
|
+
/* @__PURE__ */ React17.createElement(
|
|
644
|
+
SelectControl,
|
|
645
|
+
{
|
|
646
|
+
options: [
|
|
647
|
+
{ label: __5("Inset", "elementor"), value: "inset" },
|
|
648
|
+
{ label: __5("Outset", "elementor"), value: "" }
|
|
649
|
+
]
|
|
650
|
+
}
|
|
651
|
+
)
|
|
652
|
+
)), /* @__PURE__ */ React17.createElement(Grid3, { container: true, spacing: 1 }, /* @__PURE__ */ React17.createElement(
|
|
653
|
+
Control2,
|
|
654
|
+
{
|
|
655
|
+
bind: "hOffset",
|
|
656
|
+
label: __5("Horizontal", "elementor"),
|
|
657
|
+
value: value.value.hOffset,
|
|
658
|
+
setValue: (v) => setShadow({ ...value.value, hOffset: v })
|
|
659
|
+
},
|
|
660
|
+
/* @__PURE__ */ React17.createElement(SizeControl, null)
|
|
661
|
+
), /* @__PURE__ */ React17.createElement(
|
|
662
|
+
Control2,
|
|
663
|
+
{
|
|
664
|
+
bind: "vOffset",
|
|
665
|
+
label: __5("Vertical", "elementor"),
|
|
666
|
+
value: value.value.vOffset,
|
|
667
|
+
setValue: (v) => setShadow({ ...value.value, vOffset: v })
|
|
668
|
+
},
|
|
669
|
+
/* @__PURE__ */ React17.createElement(SizeControl, null)
|
|
670
|
+
)), /* @__PURE__ */ React17.createElement(Grid3, { container: true, spacing: 1 }, /* @__PURE__ */ React17.createElement(
|
|
671
|
+
Control2,
|
|
672
|
+
{
|
|
673
|
+
bind: "blur",
|
|
674
|
+
value: value.value.blur,
|
|
675
|
+
label: __5("Blur", "elementor"),
|
|
676
|
+
setValue: (v) => setShadow({ ...value.value, blur: v })
|
|
677
|
+
},
|
|
678
|
+
/* @__PURE__ */ React17.createElement(SizeControl, null)
|
|
679
|
+
), /* @__PURE__ */ React17.createElement(
|
|
680
|
+
Control2,
|
|
681
|
+
{
|
|
682
|
+
bind: "spread",
|
|
683
|
+
label: __5("Spread", "elementor"),
|
|
684
|
+
value: value.value.spread,
|
|
685
|
+
setValue: (v) => setShadow({ ...value.value, spread: v })
|
|
686
|
+
},
|
|
687
|
+
/* @__PURE__ */ React17.createElement(SizeControl, null)
|
|
688
|
+
)));
|
|
689
|
+
};
|
|
690
|
+
var Control2 = ({
|
|
691
|
+
value,
|
|
692
|
+
setValue,
|
|
693
|
+
label,
|
|
694
|
+
bind,
|
|
695
|
+
children
|
|
696
|
+
}) => /* @__PURE__ */ React17.createElement(BoundPropProvider, { value, setValue, bind }, /* @__PURE__ */ React17.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React17.createElement(Grid3, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React17.createElement(Grid3, { item: true, xs: 12 }, /* @__PURE__ */ React17.createElement(Typography3, { component: "label", variant: "caption", color: "text.secondary" }, label)), /* @__PURE__ */ React17.createElement(Grid3, { item: true, xs: 12 }, children))));
|
|
697
|
+
var ItemLabel = ({ value }) => {
|
|
698
|
+
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
699
|
+
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
700
|
+
const { size: spreadSize = "", unit: spreadUnit = "" } = spread?.value || {};
|
|
701
|
+
const { size: hOffsetSize = "unset", unit: hOffsetUnit = "" } = hOffset?.value || {};
|
|
702
|
+
const { size: vOffsetSize = "unset", unit: vOffsetUnit = "" } = vOffset?.value || {};
|
|
703
|
+
const sizes = [
|
|
704
|
+
hOffsetSize + hOffsetUnit,
|
|
705
|
+
vOffsetSize + vOffsetUnit,
|
|
706
|
+
blurSize + blurUnit,
|
|
707
|
+
spreadSize + spreadUnit
|
|
708
|
+
].join(" ");
|
|
709
|
+
return /* @__PURE__ */ React17.createElement("span", { style: { textTransform: "capitalize" } }, position ?? "outset", ": ", sizes);
|
|
710
|
+
};
|
|
711
|
+
var initialShadow = {
|
|
712
|
+
$$type: "shadow",
|
|
713
|
+
value: {
|
|
714
|
+
hOffset: {
|
|
715
|
+
$$type: "size",
|
|
716
|
+
value: { unit: "px", size: 0 }
|
|
717
|
+
},
|
|
718
|
+
vOffset: {
|
|
719
|
+
$$type: "size",
|
|
720
|
+
value: { unit: "px", size: 0 }
|
|
721
|
+
},
|
|
722
|
+
blur: {
|
|
723
|
+
$$type: "size",
|
|
724
|
+
value: { unit: "px", size: 10 }
|
|
725
|
+
},
|
|
726
|
+
spread: {
|
|
727
|
+
$$type: "size",
|
|
728
|
+
value: { unit: "px", size: 0 }
|
|
729
|
+
},
|
|
730
|
+
color: {
|
|
731
|
+
$$type: "color",
|
|
732
|
+
value: "rgba(0, 0, 0, 1)"
|
|
733
|
+
},
|
|
734
|
+
position: null
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
|
|
738
|
+
// src/controls/controls/toggle-control.tsx
|
|
739
|
+
import * as React19 from "react";
|
|
740
|
+
|
|
741
|
+
// src/controls/components/control-toggle-button-group.tsx
|
|
742
|
+
import * as React18 from "react";
|
|
743
|
+
import { styled as styled2, ToggleButton, ToggleButtonGroup, Tooltip } from "@elementor/ui";
|
|
744
|
+
var StyledToggleButtonGroup = styled2(ToggleButtonGroup)`
|
|
745
|
+
${({ justify }) => `justify-content: ${justify};`}
|
|
746
|
+
`;
|
|
747
|
+
var ControlToggleButtonGroup = ({
|
|
748
|
+
justify = "end",
|
|
749
|
+
size = "tiny",
|
|
750
|
+
value,
|
|
751
|
+
onChange,
|
|
752
|
+
items,
|
|
753
|
+
exclusive = false
|
|
754
|
+
}) => {
|
|
755
|
+
const handleChange = (_, newValue) => {
|
|
756
|
+
onChange(newValue);
|
|
757
|
+
};
|
|
758
|
+
return /* @__PURE__ */ React18.createElement(StyledToggleButtonGroup, { justify, value, onChange: handleChange, exclusive }, items.map(
|
|
759
|
+
({ label, value: buttonValue, icon: Icon, showTooltip }) => showTooltip ? /* @__PURE__ */ React18.createElement(Tooltip, { title: label, disableFocusListener: true, placement: "top", key: buttonValue }, /* @__PURE__ */ React18.createElement(ToggleButton, { value: buttonValue, "aria-label": label, size }, /* @__PURE__ */ React18.createElement(Icon, { fontSize: size }))) : /* @__PURE__ */ React18.createElement(ToggleButton, { key: buttonValue, value: buttonValue, "aria-label": label, size }, /* @__PURE__ */ React18.createElement(Icon, { fontSize: size }))
|
|
760
|
+
));
|
|
761
|
+
};
|
|
762
|
+
|
|
763
|
+
// src/controls/controls/toggle-control.tsx
|
|
764
|
+
var ToggleControl = createControl(({ options: options5 }) => {
|
|
765
|
+
const { value, setValue } = useBoundProp();
|
|
766
|
+
const handleToggle = (option) => {
|
|
767
|
+
setValue(option);
|
|
768
|
+
};
|
|
769
|
+
return /* @__PURE__ */ React19.createElement(
|
|
770
|
+
ControlToggleButtonGroup,
|
|
771
|
+
{
|
|
772
|
+
items: options5,
|
|
773
|
+
value: value || null,
|
|
774
|
+
onChange: handleToggle,
|
|
775
|
+
exclusive: true
|
|
776
|
+
}
|
|
777
|
+
);
|
|
778
|
+
});
|
|
779
|
+
|
|
780
|
+
// src/controls/controls/number-control.tsx
|
|
781
|
+
import * as React20 from "react";
|
|
782
|
+
import { TextField as TextField4 } from "@elementor/ui";
|
|
783
|
+
var isEmptyOrNaN = (value) => value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
784
|
+
var NumberControl = createControl(({ placeholder }) => {
|
|
785
|
+
const { value, setValue } = useBoundProp();
|
|
786
|
+
const handleChange = (event) => {
|
|
787
|
+
const eventValue = event.target.value;
|
|
788
|
+
setValue(isEmptyOrNaN(eventValue) ? void 0 : Number(eventValue));
|
|
789
|
+
};
|
|
790
|
+
return /* @__PURE__ */ React20.createElement(ControlActions, null, /* @__PURE__ */ React20.createElement(
|
|
791
|
+
TextField4,
|
|
792
|
+
{
|
|
793
|
+
size: "tiny",
|
|
794
|
+
type: "number",
|
|
795
|
+
value: isEmptyOrNaN(value) ? "" : value,
|
|
796
|
+
onChange: handleChange,
|
|
797
|
+
placeholder
|
|
798
|
+
}
|
|
799
|
+
));
|
|
800
|
+
});
|
|
801
|
+
|
|
802
|
+
// src/controls/control-actions/control-actions-menu.ts
|
|
803
|
+
import { createMenu } from "@elementor/menus";
|
|
804
|
+
var createControlActionsMenu = ({ components }) => {
|
|
805
|
+
return createMenu({
|
|
806
|
+
components
|
|
807
|
+
});
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
// src/control-replacement.tsx
|
|
811
|
+
var { replaceControl, getControlReplacement } = createControlReplacement();
|
|
812
|
+
|
|
813
|
+
// src/panel.ts
|
|
814
|
+
import { __createPanel as createPanel } from "@elementor/editor-panels";
|
|
815
|
+
|
|
816
|
+
// src/components/editing-panel.tsx
|
|
817
|
+
import * as React66 from "react";
|
|
818
|
+
import { __ as __38 } from "@wordpress/i18n";
|
|
819
|
+
import { useSelectedElement } from "@elementor/editor-elements";
|
|
820
|
+
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
821
|
+
|
|
822
|
+
// src/components/editing-panel-tabs.tsx
|
|
823
|
+
import { Stack as Stack22, Tabs, Tab, TabPanel, useTabs } from "@elementor/ui";
|
|
824
|
+
import * as React63 from "react";
|
|
825
|
+
import { __ as __37 } from "@wordpress/i18n";
|
|
826
|
+
|
|
827
|
+
// src/components/settings-tab.tsx
|
|
828
|
+
import * as React26 from "react";
|
|
829
|
+
import { Stack as Stack7 } from "@elementor/ui";
|
|
830
|
+
|
|
831
|
+
// src/controls-registry/settings-field.tsx
|
|
832
|
+
import * as React22 from "react";
|
|
833
|
+
import { useElementSetting, updateSettings } from "@elementor/editor-elements";
|
|
834
|
+
|
|
835
|
+
// src/contexts/element-context.tsx
|
|
836
|
+
import * as React21 from "react";
|
|
837
|
+
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
838
|
+
var Context2 = createContext4(null);
|
|
839
|
+
function ElementProvider({ children, element, elementType }) {
|
|
840
|
+
return /* @__PURE__ */ React21.createElement(Context2.Provider, { value: { element, elementType } }, children);
|
|
841
|
+
}
|
|
842
|
+
function useElement() {
|
|
843
|
+
const context = useContext4(Context2);
|
|
844
|
+
if (!context) {
|
|
845
|
+
throw new Error("useElement must be used within a ElementProvider");
|
|
846
|
+
}
|
|
847
|
+
return context;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
// src/controls-registry/settings-field.tsx
|
|
851
|
+
var SettingsField = ({ bind, children }) => {
|
|
852
|
+
const { element, elementType } = useElement();
|
|
853
|
+
const defaultValue = elementType.propsSchema[bind]?.default;
|
|
854
|
+
const settingsValue = useElementSetting({ id: element.id, bind });
|
|
855
|
+
const value = settingsValue ?? defaultValue ?? null;
|
|
856
|
+
const setValue = (newValue) => {
|
|
857
|
+
updateSettings({
|
|
858
|
+
id: element.id,
|
|
859
|
+
props: {
|
|
860
|
+
[bind]: newValue
|
|
861
|
+
}
|
|
862
|
+
});
|
|
863
|
+
};
|
|
864
|
+
return /* @__PURE__ */ React22.createElement(BoundPropProvider, { setValue, value, bind }, children);
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
// src/components/accordion-section.tsx
|
|
868
|
+
import * as React23 from "react";
|
|
869
|
+
import { useId as useId3 } from "react";
|
|
870
|
+
import { Accordion, AccordionSummary, AccordionDetails, AccordionSummaryText, Stack as Stack6 } from "@elementor/ui";
|
|
871
|
+
var AccordionSection = ({ title, children, defaultExpanded = false }) => {
|
|
872
|
+
const uid = useId3();
|
|
873
|
+
const labelId = `label-${uid}`;
|
|
874
|
+
const contentId = `content-${uid}`;
|
|
875
|
+
return /* @__PURE__ */ React23.createElement(Accordion, { disableGutters: true, defaultExpanded }, /* @__PURE__ */ React23.createElement(AccordionSummary, { "aria-controls": contentId, id: labelId }, /* @__PURE__ */ React23.createElement(AccordionSummaryText, { primaryTypographyProps: { variant: "caption" } }, title)), /* @__PURE__ */ React23.createElement(AccordionDetails, { id: contentId, "aria-labelledby": labelId }, /* @__PURE__ */ React23.createElement(Stack6, { gap: 2.5 }, children)));
|
|
876
|
+
};
|
|
877
|
+
|
|
878
|
+
// src/controls-registry/control.tsx
|
|
879
|
+
import * as React24 from "react";
|
|
880
|
+
import { createError } from "@elementor/utils";
|
|
881
|
+
|
|
882
|
+
// src/controls-registry/controls-registry.tsx
|
|
883
|
+
var controlTypes = {
|
|
884
|
+
image: { component: ImageControl, layout: "full" },
|
|
885
|
+
text: { component: TextControl, layout: "two-columns" },
|
|
886
|
+
textarea: { component: TextAreaControl, layout: "full" },
|
|
887
|
+
size: { component: SizeControl, layout: "two-columns" },
|
|
888
|
+
select: { component: SelectControl, layout: "two-columns" }
|
|
889
|
+
};
|
|
890
|
+
var getControlByType = (type) => controlTypes[type]?.component;
|
|
891
|
+
var getLayoutByType = (type) => controlTypes[type].layout;
|
|
892
|
+
|
|
893
|
+
// src/controls-registry/control.tsx
|
|
894
|
+
var ControlTypeError = createError({
|
|
895
|
+
code: "CONTROL_TYPE_NOT_FOUND",
|
|
896
|
+
message: `Control type not found.`
|
|
897
|
+
});
|
|
898
|
+
var Control3 = ({ props, type }) => {
|
|
899
|
+
const ControlByType = getControlByType(type);
|
|
900
|
+
if (!ControlByType) {
|
|
901
|
+
throw new ControlTypeError({
|
|
902
|
+
context: { type }
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
return /* @__PURE__ */ React24.createElement(ControlByType, { ...props });
|
|
906
|
+
};
|
|
907
|
+
|
|
908
|
+
// src/controls-registry/control-type-container.tsx
|
|
909
|
+
import * as React25 from "react";
|
|
910
|
+
import { styled as styled3, Box as Box2 } from "@elementor/ui";
|
|
911
|
+
var ControlTypeContainer = ({
|
|
912
|
+
controlType,
|
|
913
|
+
children
|
|
914
|
+
}) => {
|
|
915
|
+
const layout = getLayoutByType(controlType);
|
|
916
|
+
return /* @__PURE__ */ React25.createElement(StyledContainer, { layout }, children);
|
|
917
|
+
};
|
|
918
|
+
var StyledContainer = styled3(Box2, {
|
|
919
|
+
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
920
|
+
})(({ layout, theme }) => ({
|
|
921
|
+
display: "grid",
|
|
922
|
+
gridGap: theme.spacing(1),
|
|
923
|
+
...getGridLayout(layout)
|
|
924
|
+
}));
|
|
925
|
+
var getGridLayout = (layout) => ({
|
|
594
926
|
justifyContent: "space-between",
|
|
595
927
|
gridTemplateColumns: {
|
|
596
928
|
full: "1fr",
|
|
@@ -600,15 +932,15 @@ var getGridLayout = (layout) => ({
|
|
|
600
932
|
|
|
601
933
|
// src/components/settings-tab.tsx
|
|
602
934
|
var SettingsTab = () => {
|
|
603
|
-
const { elementType } =
|
|
604
|
-
return /* @__PURE__ */
|
|
935
|
+
const { elementType } = useElement();
|
|
936
|
+
return /* @__PURE__ */ React26.createElement(Stack7, null, elementType.controls.map(({ type, value }, index) => {
|
|
605
937
|
if (type === "control") {
|
|
606
|
-
return /* @__PURE__ */
|
|
938
|
+
return /* @__PURE__ */ React26.createElement(Control4, { key: value.bind, control: value });
|
|
607
939
|
}
|
|
608
940
|
if (type === "section") {
|
|
609
|
-
return /* @__PURE__ */
|
|
941
|
+
return /* @__PURE__ */ React26.createElement(AccordionSection, { key: type + "." + index, title: value.label, defaultExpanded: true }, value.items?.map((item) => {
|
|
610
942
|
if (item.type === "control") {
|
|
611
|
-
return /* @__PURE__ */
|
|
943
|
+
return /* @__PURE__ */ React26.createElement(Control4, { key: item.value.bind, control: item.value });
|
|
612
944
|
}
|
|
613
945
|
return null;
|
|
614
946
|
}));
|
|
@@ -616,169 +948,154 @@ var SettingsTab = () => {
|
|
|
616
948
|
return null;
|
|
617
949
|
}));
|
|
618
950
|
};
|
|
619
|
-
var
|
|
951
|
+
var Control4 = ({ control }) => {
|
|
620
952
|
if (!getControlByType(control.type)) {
|
|
621
953
|
return null;
|
|
622
954
|
}
|
|
623
|
-
return /* @__PURE__ */
|
|
955
|
+
return /* @__PURE__ */ React26.createElement(SettingsField, { bind: control.bind }, /* @__PURE__ */ React26.createElement(ControlTypeContainer, { controlType: control.type }, control.label ? /* @__PURE__ */ React26.createElement(ControlLabel, null, control.label) : null, /* @__PURE__ */ React26.createElement(Control3, { type: control.type, props: control.props })));
|
|
624
956
|
};
|
|
625
957
|
|
|
626
958
|
// src/components/style-tab.tsx
|
|
627
|
-
import * as
|
|
959
|
+
import * as React62 from "react";
|
|
960
|
+
import { useState as useState5 } from "react";
|
|
961
|
+
import { Stack as Stack21 } from "@elementor/ui";
|
|
962
|
+
import { generateId } from "@elementor/editor-styles";
|
|
963
|
+
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
964
|
+
import { getElementStyles, getElementSetting } from "@elementor/editor-elements";
|
|
628
965
|
|
|
629
966
|
// src/contexts/style-context.tsx
|
|
630
|
-
import * as
|
|
631
|
-
import { createContext as
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
const breakpoint = useActiveBreakpoint();
|
|
636
|
-
const selectedMeta = { breakpoint, state: null };
|
|
637
|
-
return /* @__PURE__ */ React18.createElement(Context2.Provider, { value: { selectedStyleDef, selectedMeta, selectedClassesProp } }, children);
|
|
967
|
+
import * as React27 from "react";
|
|
968
|
+
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
969
|
+
var Context3 = createContext5(null);
|
|
970
|
+
function StyleProvider({ children, id, meta }) {
|
|
971
|
+
return /* @__PURE__ */ React27.createElement(Context3.Provider, { value: { id, meta } }, children);
|
|
638
972
|
}
|
|
639
|
-
function
|
|
640
|
-
const context =
|
|
973
|
+
function useStyle() {
|
|
974
|
+
const context = useContext5(Context3);
|
|
641
975
|
if (!context) {
|
|
642
976
|
throw new Error("UseStyleContext must be used within a StyleContextProvider");
|
|
643
977
|
}
|
|
644
978
|
return context;
|
|
645
979
|
}
|
|
646
980
|
|
|
647
|
-
// src/
|
|
648
|
-
import
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
var getElementStyles = (elementID) => {
|
|
652
|
-
const container = getContainer(elementID);
|
|
653
|
-
return container?.model.get("styles") || null;
|
|
654
|
-
};
|
|
655
|
-
|
|
656
|
-
// src/hooks/use-element-styles.ts
|
|
657
|
-
var useElementStyles = (elementID) => {
|
|
658
|
-
return useListenTo4(
|
|
659
|
-
commandEndEvent4("document/atomic-widgets/styles"),
|
|
660
|
-
() => {
|
|
661
|
-
return getElementStyles(elementID);
|
|
662
|
-
},
|
|
663
|
-
[elementID]
|
|
664
|
-
);
|
|
665
|
-
};
|
|
981
|
+
// src/components/style-sections/size-section/size-section.tsx
|
|
982
|
+
import * as React31 from "react";
|
|
983
|
+
import { Divider, Grid as Grid5, Stack as Stack8 } from "@elementor/ui";
|
|
984
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
666
985
|
|
|
667
|
-
// src/components/style-
|
|
668
|
-
import
|
|
986
|
+
// src/components/style-sections/size-section/overflow-field.tsx
|
|
987
|
+
import * as React30 from "react";
|
|
988
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
989
|
+
import { Grid as Grid4 } from "@elementor/ui";
|
|
990
|
+
import { EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2, ExpandBottomIcon } from "@elementor/icons";
|
|
669
991
|
|
|
670
|
-
// src/
|
|
671
|
-
import * as
|
|
992
|
+
// src/controls-registry/styles-field.tsx
|
|
993
|
+
import * as React29 from "react";
|
|
672
994
|
|
|
673
|
-
// src/
|
|
674
|
-
import
|
|
995
|
+
// src/hooks/use-styles-field.ts
|
|
996
|
+
import { useElementStyleProp, updateStyle } from "@elementor/editor-elements";
|
|
675
997
|
|
|
676
|
-
// src/
|
|
677
|
-
import
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
(
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
}
|
|
690
|
-
const styleDef = getElementStyles(elementID)?.[styleDefID];
|
|
691
|
-
if (!styleDef) {
|
|
692
|
-
return null;
|
|
693
|
-
}
|
|
694
|
-
const variant = getVariantByMeta(styleDef, meta);
|
|
695
|
-
return variant?.props[propName] ?? null;
|
|
696
|
-
},
|
|
697
|
-
[elementID, styleDefID, propName, meta]
|
|
698
|
-
);
|
|
699
|
-
};
|
|
700
|
-
function getVariantByMeta(styleDef, meta) {
|
|
701
|
-
return styleDef.variants.find((variant) => {
|
|
702
|
-
return variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state;
|
|
703
|
-
});
|
|
998
|
+
// src/contexts/classes-prop-context.tsx
|
|
999
|
+
import * as React28 from "react";
|
|
1000
|
+
import { createContext as createContext6, useContext as useContext6 } from "react";
|
|
1001
|
+
var Context4 = createContext6(null);
|
|
1002
|
+
function ClassesPropProvider({ children, prop }) {
|
|
1003
|
+
return /* @__PURE__ */ React28.createElement(Context4.Provider, { value: { prop } }, children);
|
|
1004
|
+
}
|
|
1005
|
+
function useClassesProp() {
|
|
1006
|
+
const context = useContext6(Context4);
|
|
1007
|
+
if (!context) {
|
|
1008
|
+
throw new Error("useClassesProp must be used within a ClassesPropProvider");
|
|
1009
|
+
}
|
|
1010
|
+
return context.prop;
|
|
704
1011
|
}
|
|
705
1012
|
|
|
706
|
-
// src/
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
const
|
|
710
|
-
|
|
711
|
-
container,
|
|
712
|
-
styleDefID,
|
|
713
|
-
bind,
|
|
714
|
-
meta,
|
|
715
|
-
props
|
|
716
|
-
});
|
|
717
|
-
};
|
|
718
|
-
|
|
719
|
-
// src/controls/hooks/use-style-control.ts
|
|
720
|
-
var useStyleControl = (propName) => {
|
|
721
|
-
const { element } = useElementContext();
|
|
722
|
-
const { selectedStyleDef, selectedMeta, selectedClassesProp } = useStyleContext();
|
|
1013
|
+
// src/hooks/use-styles-field.ts
|
|
1014
|
+
var useStylesField = (propName) => {
|
|
1015
|
+
const { element } = useElement();
|
|
1016
|
+
const { id, meta } = useStyle();
|
|
1017
|
+
const classesProp = useClassesProp();
|
|
723
1018
|
const value = useElementStyleProp({
|
|
724
1019
|
elementID: element.id,
|
|
725
|
-
styleDefID:
|
|
726
|
-
meta
|
|
1020
|
+
styleDefID: id,
|
|
1021
|
+
meta,
|
|
727
1022
|
propName
|
|
728
1023
|
});
|
|
729
1024
|
const setValue = (newValue) => {
|
|
730
1025
|
updateStyle({
|
|
731
1026
|
elementID: element.id,
|
|
732
|
-
styleDefID:
|
|
1027
|
+
styleDefID: id,
|
|
733
1028
|
props: { [propName]: newValue },
|
|
734
|
-
meta
|
|
735
|
-
bind:
|
|
1029
|
+
meta,
|
|
1030
|
+
bind: classesProp
|
|
736
1031
|
});
|
|
737
1032
|
};
|
|
738
1033
|
return [value, setValue];
|
|
739
1034
|
};
|
|
740
1035
|
|
|
741
|
-
// src/controls/
|
|
742
|
-
var
|
|
743
|
-
const [value, setValue] =
|
|
744
|
-
return /* @__PURE__ */
|
|
1036
|
+
// src/controls-registry/styles-field.tsx
|
|
1037
|
+
var StylesField = ({ bind, children }) => {
|
|
1038
|
+
const [value, setValue] = useStylesField(bind);
|
|
1039
|
+
return /* @__PURE__ */ React29.createElement(BoundPropProvider, { setValue, value, bind }, children);
|
|
745
1040
|
};
|
|
746
|
-
StyleControl.Label = ControlLabel;
|
|
747
1041
|
|
|
748
|
-
// src/components/style-sections/size-section.tsx
|
|
749
|
-
|
|
750
|
-
|
|
1042
|
+
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1043
|
+
var options = [
|
|
1044
|
+
{
|
|
1045
|
+
value: "visible",
|
|
1046
|
+
label: __6("Visible", "elementor"),
|
|
1047
|
+
icon: EyeIcon2,
|
|
1048
|
+
showTooltip: true
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
value: "hidden",
|
|
1052
|
+
label: __6("Hidden", "elementor"),
|
|
1053
|
+
icon: EyeOffIcon2,
|
|
1054
|
+
showTooltip: true
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
value: "auto",
|
|
1058
|
+
label: __6("Auto", "elementor"),
|
|
1059
|
+
icon: ExpandBottomIcon,
|
|
1060
|
+
showTooltip: true
|
|
1061
|
+
}
|
|
1062
|
+
];
|
|
1063
|
+
var OverflowField = () => {
|
|
1064
|
+
return /* @__PURE__ */ React30.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React30.createElement(Grid4, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React30.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, __6("Overflow", "elementor"))), /* @__PURE__ */ React30.createElement(Grid4, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React30.createElement(ToggleControl, { options }))));
|
|
1065
|
+
};
|
|
1066
|
+
|
|
1067
|
+
// src/components/style-sections/size-section/size-section.tsx
|
|
751
1068
|
var SizeSection = () => {
|
|
752
|
-
return /* @__PURE__ */
|
|
1069
|
+
return /* @__PURE__ */ React31.createElement(AccordionSection, { title: __7("Size", "elementor") }, /* @__PURE__ */ React31.createElement(Stack8, { gap: 1.5 }, /* @__PURE__ */ React31.createElement(Grid5, { container: true, spacing: 2 }, /* @__PURE__ */ React31.createElement(SizeField, { bind: "width", label: __7("Width", "elementor") }), /* @__PURE__ */ React31.createElement(SizeField, { bind: "height", label: __7("Height", "elementor") })), /* @__PURE__ */ React31.createElement(Grid5, { container: true, spacing: 2 }, /* @__PURE__ */ React31.createElement(SizeField, { bind: "min-width", label: __7("Min. Width", "elementor") }), /* @__PURE__ */ React31.createElement(SizeField, { bind: "min-height", label: __7("Min. Height", "elementor") })), /* @__PURE__ */ React31.createElement(Grid5, { container: true, spacing: 2 }, /* @__PURE__ */ React31.createElement(SizeField, { bind: "max-width", label: __7("Max. Width", "elementor") }), /* @__PURE__ */ React31.createElement(SizeField, { bind: "max-height", label: __7("Max. Height", "elementor") })), /* @__PURE__ */ React31.createElement(Divider, null), /* @__PURE__ */ React31.createElement(Stack8, null, /* @__PURE__ */ React31.createElement(OverflowField, null))));
|
|
753
1070
|
};
|
|
754
|
-
var
|
|
755
|
-
return /* @__PURE__ */
|
|
1071
|
+
var SizeField = ({ label, bind }) => {
|
|
1072
|
+
return /* @__PURE__ */ React31.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(StylesField, { bind }, /* @__PURE__ */ React31.createElement(Grid5, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React31.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(ControlLabel, null, label)), /* @__PURE__ */ React31.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(SizeControl, null)))));
|
|
756
1073
|
};
|
|
757
1074
|
|
|
758
1075
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
759
|
-
import * as
|
|
760
|
-
import { Divider, Stack as
|
|
1076
|
+
import * as React44 from "react";
|
|
1077
|
+
import { Divider as Divider2, Stack as Stack11 } from "@elementor/ui";
|
|
761
1078
|
|
|
762
|
-
// src/components/style-sections/typography-section/text-style-
|
|
763
|
-
import * as
|
|
764
|
-
import { __ as
|
|
765
|
-
import { Grid as
|
|
1079
|
+
// src/components/style-sections/typography-section/text-style-field.tsx
|
|
1080
|
+
import * as React32 from "react";
|
|
1081
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
1082
|
+
import { Grid as Grid6, ToggleButton as ToggleButtonBase, ToggleButtonGroup as ToggleButtonGroup2 } from "@elementor/ui";
|
|
766
1083
|
import { ItalicIcon, StrikethroughIcon, UnderlineIcon } from "@elementor/icons";
|
|
767
1084
|
var buttonSize = "tiny";
|
|
768
|
-
var
|
|
769
|
-
const [fontStyle, setFontStyle] =
|
|
770
|
-
const [textDecoration, setTextDecoration] =
|
|
1085
|
+
var TextStyleField = () => {
|
|
1086
|
+
const [fontStyle, setFontStyle] = useStylesField("font-style");
|
|
1087
|
+
const [textDecoration, setTextDecoration] = useStylesField("text-decoration");
|
|
771
1088
|
const formats = [fontStyle, ...(textDecoration || "").split(" ")];
|
|
772
|
-
return /* @__PURE__ */
|
|
773
|
-
|
|
1089
|
+
return /* @__PURE__ */ React32.createElement(Grid6, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React32.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel, null, __8("Style", "elementor"))), /* @__PURE__ */ React32.createElement(Grid6, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React32.createElement(ToggleButtonGroup2, { value: formats }, /* @__PURE__ */ React32.createElement(
|
|
1090
|
+
ToggleButton2,
|
|
774
1091
|
{
|
|
775
1092
|
value: "italic",
|
|
776
1093
|
onChange: (v) => setFontStyle(fontStyle === v ? null : v),
|
|
777
1094
|
"aria-label": "italic",
|
|
778
1095
|
sx: { marginLeft: "auto" }
|
|
779
1096
|
},
|
|
780
|
-
/* @__PURE__ */
|
|
781
|
-
), /* @__PURE__ */
|
|
1097
|
+
/* @__PURE__ */ React32.createElement(ItalicIcon, { fontSize: buttonSize })
|
|
1098
|
+
), /* @__PURE__ */ React32.createElement(
|
|
782
1099
|
ShorthandControl,
|
|
783
1100
|
{
|
|
784
1101
|
value: "line-through",
|
|
@@ -786,8 +1103,8 @@ var TextStyleControl = () => {
|
|
|
786
1103
|
updateValues: setTextDecoration,
|
|
787
1104
|
"aria-label": "line-through"
|
|
788
1105
|
},
|
|
789
|
-
/* @__PURE__ */
|
|
790
|
-
), /* @__PURE__ */
|
|
1106
|
+
/* @__PURE__ */ React32.createElement(StrikethroughIcon, { fontSize: buttonSize })
|
|
1107
|
+
), /* @__PURE__ */ React32.createElement(
|
|
791
1108
|
ShorthandControl,
|
|
792
1109
|
{
|
|
793
1110
|
value: "underline",
|
|
@@ -795,7 +1112,7 @@ var TextStyleControl = () => {
|
|
|
795
1112
|
updateValues: setTextDecoration,
|
|
796
1113
|
"aria-label": "underline"
|
|
797
1114
|
},
|
|
798
|
-
/* @__PURE__ */
|
|
1115
|
+
/* @__PURE__ */ React32.createElement(UnderlineIcon, { fontSize: buttonSize })
|
|
799
1116
|
))));
|
|
800
1117
|
};
|
|
801
1118
|
var ShorthandControl = ({
|
|
@@ -814,95 +1131,77 @@ var ShorthandControl = ({
|
|
|
814
1131
|
updateValues([...valuesArr, newValue].join(" "));
|
|
815
1132
|
}
|
|
816
1133
|
};
|
|
817
|
-
return /* @__PURE__ */
|
|
1134
|
+
return /* @__PURE__ */ React32.createElement(ToggleButton2, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
818
1135
|
};
|
|
819
|
-
var
|
|
1136
|
+
var ToggleButton2 = ({ onChange, ...props }) => {
|
|
820
1137
|
const handleChange = (_e, newValue) => {
|
|
821
1138
|
onChange(newValue);
|
|
822
1139
|
};
|
|
823
|
-
return /* @__PURE__ */
|
|
1140
|
+
return /* @__PURE__ */ React32.createElement(ToggleButtonBase, { ...props, onChange: handleChange, size: buttonSize });
|
|
824
1141
|
};
|
|
825
1142
|
|
|
826
1143
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
827
|
-
import { __ as
|
|
1144
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
828
1145
|
|
|
829
|
-
// src/components/style-sections/typography-section/font-size-
|
|
830
|
-
import * as
|
|
831
|
-
import { __ as
|
|
832
|
-
import { Grid as
|
|
833
|
-
var
|
|
834
|
-
return /* @__PURE__ */
|
|
1146
|
+
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1147
|
+
import * as React33 from "react";
|
|
1148
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
1149
|
+
import { Grid as Grid7 } from "@elementor/ui";
|
|
1150
|
+
var FontSizeField = () => {
|
|
1151
|
+
return /* @__PURE__ */ React33.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React33.createElement(Grid7, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React33.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(ControlLabel, null, __9("Font Size", "elementor"))), /* @__PURE__ */ React33.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeControl, null))));
|
|
835
1152
|
};
|
|
836
1153
|
|
|
837
|
-
// src/components/style-sections/typography-section/font-weight-
|
|
838
|
-
import * as
|
|
839
|
-
import { __ as
|
|
840
|
-
import { Grid as
|
|
1154
|
+
// src/components/style-sections/typography-section/font-weight-field.tsx
|
|
1155
|
+
import * as React34 from "react";
|
|
1156
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
1157
|
+
import { Grid as Grid8 } from "@elementor/ui";
|
|
841
1158
|
var fontWeightOptions = [
|
|
842
|
-
{ label:
|
|
843
|
-
{ label:
|
|
844
|
-
{ label:
|
|
845
|
-
{ label:
|
|
846
|
-
{ label:
|
|
1159
|
+
{ label: __10("Light - 400", "elementor"), value: "400" },
|
|
1160
|
+
{ label: __10("Regular - 500", "elementor"), value: "500" },
|
|
1161
|
+
{ label: __10("Semi Bold - 600", "elementor"), value: "600" },
|
|
1162
|
+
{ label: __10("Bold - 700", "elementor"), value: "700" },
|
|
1163
|
+
{ label: __10("Black - 900", "elementor"), value: "900" }
|
|
847
1164
|
];
|
|
848
|
-
var
|
|
849
|
-
return /* @__PURE__ */
|
|
1165
|
+
var FontWeightField = () => {
|
|
1166
|
+
return /* @__PURE__ */ React34.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React34.createElement(Grid8, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React34.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(ControlLabel, null, __10("Font Weight", "elementor"))), /* @__PURE__ */ React34.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(SelectControl, { options: fontWeightOptions }))));
|
|
850
1167
|
};
|
|
851
1168
|
|
|
852
|
-
// src/components/style-sections/typography-section/text-color-
|
|
853
|
-
import * as
|
|
854
|
-
import { __ as
|
|
855
|
-
import { Grid as
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
import * as React24 from "react";
|
|
859
|
-
import { UnstableColorPicker } from "@elementor/ui";
|
|
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
|
-
);
|
|
872
|
-
|
|
873
|
-
// src/components/style-sections/typography-section/text-color-control.tsx
|
|
874
|
-
var TextColorControl = () => {
|
|
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))));
|
|
1169
|
+
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
1170
|
+
import * as React35 from "react";
|
|
1171
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
1172
|
+
import { Grid as Grid9 } from "@elementor/ui";
|
|
1173
|
+
var TextColorField = () => {
|
|
1174
|
+
return /* @__PURE__ */ React35.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React35.createElement(Grid9, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React35.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel, null, __11("Text Color", "elementor"))), /* @__PURE__ */ React35.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ColorControl, null))));
|
|
876
1175
|
};
|
|
877
1176
|
|
|
878
|
-
// src/components/style-sections/typography-section/letter-spacing-
|
|
879
|
-
import * as
|
|
880
|
-
import { __ as
|
|
881
|
-
import { Grid as
|
|
882
|
-
var
|
|
883
|
-
return /* @__PURE__ */
|
|
1177
|
+
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
1178
|
+
import * as React36 from "react";
|
|
1179
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
1180
|
+
import { Grid as Grid10 } from "@elementor/ui";
|
|
1181
|
+
var LetterSpacingField = () => {
|
|
1182
|
+
return /* @__PURE__ */ React36.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React36.createElement(Grid10, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React36.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel, null, __12("Letter Spacing", "elementor"))), /* @__PURE__ */ React36.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(SizeControl, null))));
|
|
884
1183
|
};
|
|
885
1184
|
|
|
886
|
-
// src/components/style-sections/typography-section/word-spacing-
|
|
887
|
-
import * as
|
|
888
|
-
import { __ as
|
|
889
|
-
import { Grid as
|
|
890
|
-
var
|
|
891
|
-
return /* @__PURE__ */
|
|
1185
|
+
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
1186
|
+
import * as React37 from "react";
|
|
1187
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
1188
|
+
import { Grid as Grid11 } from "@elementor/ui";
|
|
1189
|
+
var WordSpacingField = () => {
|
|
1190
|
+
return /* @__PURE__ */ React37.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React37.createElement(Grid11, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React37.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel, null, __13("Word Spacing", "elementor"))), /* @__PURE__ */ React37.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(SizeControl, null))));
|
|
892
1191
|
};
|
|
893
1192
|
|
|
894
1193
|
// src/components/collapsible-content.tsx
|
|
895
|
-
import * as
|
|
896
|
-
import { useState as
|
|
1194
|
+
import * as React38 from "react";
|
|
1195
|
+
import { useState as useState3 } from "react";
|
|
897
1196
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
898
|
-
import { Button as Button3, Collapse, Stack as
|
|
899
|
-
import { __ as
|
|
1197
|
+
import { Button as Button3, Collapse, Stack as Stack9, styled as styled4 } from "@elementor/ui";
|
|
1198
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
900
1199
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
901
|
-
const [open, setOpen] =
|
|
1200
|
+
const [open, setOpen] = useState3(defaultOpen);
|
|
902
1201
|
const handleToggle = () => {
|
|
903
1202
|
setOpen((prevOpen) => !prevOpen);
|
|
904
1203
|
};
|
|
905
|
-
return /* @__PURE__ */
|
|
1204
|
+
return /* @__PURE__ */ React38.createElement(Stack9, { sx: { py: 0.5 } }, /* @__PURE__ */ React38.createElement(
|
|
906
1205
|
Button3,
|
|
907
1206
|
{
|
|
908
1207
|
fullWidth: true,
|
|
@@ -910,12 +1209,12 @@ var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
|
910
1209
|
color: "secondary",
|
|
911
1210
|
variant: "outlined",
|
|
912
1211
|
onClick: handleToggle,
|
|
913
|
-
endIcon: /* @__PURE__ */
|
|
1212
|
+
endIcon: /* @__PURE__ */ React38.createElement(ChevronIcon, { open })
|
|
914
1213
|
},
|
|
915
|
-
open ?
|
|
916
|
-
), /* @__PURE__ */
|
|
1214
|
+
open ? __14("Show less", "elementor") : __14("Show more", "elementor")
|
|
1215
|
+
), /* @__PURE__ */ React38.createElement(Collapse, { in: open, timeout: "auto" }, children));
|
|
917
1216
|
};
|
|
918
|
-
var ChevronIcon =
|
|
1217
|
+
var ChevronIcon = styled4(ChevronDownIcon, {
|
|
919
1218
|
shouldForwardProp: (prop) => prop !== "open"
|
|
920
1219
|
})(({ theme, open }) => ({
|
|
921
1220
|
transform: open ? "rotate(180deg)" : "rotate(0)",
|
|
@@ -924,171 +1223,172 @@ var ChevronIcon = styled3(ChevronDownIcon, {
|
|
|
924
1223
|
})
|
|
925
1224
|
}));
|
|
926
1225
|
|
|
927
|
-
// src/components/style-sections/typography-section/transform-
|
|
928
|
-
import * as
|
|
929
|
-
import { __ as
|
|
930
|
-
import { Grid as
|
|
1226
|
+
// src/components/style-sections/typography-section/transform-field.tsx
|
|
1227
|
+
import * as React39 from "react";
|
|
1228
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
1229
|
+
import { Grid as Grid12 } from "@elementor/ui";
|
|
931
1230
|
import { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon } from "@elementor/icons";
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
// src/controls/components/control-toggle-button-group.tsx
|
|
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)`
|
|
940
|
-
${({ justify }) => `justify-content: ${justify};`}
|
|
941
|
-
`;
|
|
942
|
-
var ControlToggleButtonGroup = ({
|
|
943
|
-
justify = "end",
|
|
944
|
-
size = "tiny",
|
|
945
|
-
value,
|
|
946
|
-
onChange,
|
|
947
|
-
items,
|
|
948
|
-
exclusive = false
|
|
949
|
-
}) => {
|
|
950
|
-
const handleChange = (_, newValue) => {
|
|
951
|
-
onChange(newValue);
|
|
952
|
-
};
|
|
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 }))));
|
|
954
|
-
};
|
|
955
|
-
|
|
956
|
-
// src/controls/control-types/toggle-control.tsx
|
|
957
|
-
var ToggleControl = createControl(({ options: options4 }) => {
|
|
958
|
-
const { value, setValue } = useControl();
|
|
959
|
-
const handleToggle = (option) => {
|
|
960
|
-
setValue(option || void 0);
|
|
961
|
-
};
|
|
962
|
-
return /* @__PURE__ */ React30.createElement(
|
|
963
|
-
ControlToggleButtonGroup,
|
|
964
|
-
{
|
|
965
|
-
items: options4,
|
|
966
|
-
value: value || null,
|
|
967
|
-
onChange: handleToggle,
|
|
968
|
-
exclusive: true
|
|
969
|
-
}
|
|
970
|
-
);
|
|
971
|
-
});
|
|
972
|
-
|
|
973
|
-
// src/components/style-sections/typography-section/transform-control.tsx
|
|
974
|
-
var options = [
|
|
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 }
|
|
1231
|
+
var options2 = [
|
|
1232
|
+
{ value: "capitalize", label: __15("Capitalize", "elementor"), icon: LetterCaseIcon },
|
|
1233
|
+
{ value: "uppercase", label: __15("Uppercase", "elementor"), icon: LetterCaseUpperIcon },
|
|
1234
|
+
{ value: "lowercase", label: __15("Lowercase", "elementor"), icon: LetterCaseLowerIcon }
|
|
978
1235
|
];
|
|
979
|
-
var
|
|
1236
|
+
var TransformField = () => /* @__PURE__ */ React39.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React39.createElement(Grid12, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, __15("Transform", "elementor"))), /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React39.createElement(ToggleControl, { options: options2 }))));
|
|
980
1237
|
|
|
981
|
-
// src/components/style-sections/typography-section/text-alignment-
|
|
982
|
-
import * as
|
|
983
|
-
import { __ as
|
|
984
|
-
import { Grid as
|
|
1238
|
+
// src/components/style-sections/typography-section/text-alignment-field.tsx
|
|
1239
|
+
import * as React40 from "react";
|
|
1240
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
1241
|
+
import { Grid as Grid13 } from "@elementor/ui";
|
|
985
1242
|
import { AlignLeftIcon, AlignCenterIcon, AlignRightIcon, AlignJustifiedIcon } from "@elementor/icons";
|
|
986
|
-
var
|
|
1243
|
+
var options3 = [
|
|
987
1244
|
{
|
|
988
1245
|
value: "left",
|
|
989
|
-
label:
|
|
1246
|
+
label: __16("Left", "elementor"),
|
|
990
1247
|
icon: AlignLeftIcon
|
|
991
1248
|
},
|
|
992
1249
|
{
|
|
993
1250
|
value: "center",
|
|
994
|
-
label:
|
|
1251
|
+
label: __16("Center", "elementor"),
|
|
995
1252
|
icon: AlignCenterIcon
|
|
996
1253
|
},
|
|
997
1254
|
{
|
|
998
1255
|
value: "right",
|
|
999
|
-
label:
|
|
1256
|
+
label: __16("Right", "elementor"),
|
|
1000
1257
|
icon: AlignRightIcon
|
|
1001
1258
|
},
|
|
1002
1259
|
{
|
|
1003
1260
|
value: "justify",
|
|
1004
|
-
label:
|
|
1261
|
+
label: __16("Justify", "elementor"),
|
|
1005
1262
|
icon: AlignJustifiedIcon
|
|
1006
1263
|
}
|
|
1007
1264
|
];
|
|
1008
|
-
var
|
|
1009
|
-
return /* @__PURE__ */
|
|
1265
|
+
var TextAlignmentField = () => {
|
|
1266
|
+
return /* @__PURE__ */ React40.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React40.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React40.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlLabel, null, __16("Alignment", "elementor"))), /* @__PURE__ */ React40.createElement(Grid13, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React40.createElement(ToggleControl, { options: options3 }))));
|
|
1010
1267
|
};
|
|
1011
1268
|
|
|
1012
|
-
// src/components/style-sections/typography-section/text-direction-
|
|
1013
|
-
import * as
|
|
1014
|
-
import { __ as
|
|
1015
|
-
import { Grid as
|
|
1269
|
+
// src/components/style-sections/typography-section/text-direction-field.tsx
|
|
1270
|
+
import * as React41 from "react";
|
|
1271
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
1272
|
+
import { Grid as Grid14 } from "@elementor/ui";
|
|
1016
1273
|
import { TextDirectionLtrIcon, TextDirectionRtlIcon } from "@elementor/icons";
|
|
1017
|
-
var
|
|
1274
|
+
var options4 = [
|
|
1018
1275
|
{
|
|
1019
1276
|
value: "ltr",
|
|
1020
|
-
label:
|
|
1277
|
+
label: __17("Left to Right", "elementor"),
|
|
1021
1278
|
icon: TextDirectionLtrIcon
|
|
1022
1279
|
},
|
|
1023
1280
|
{
|
|
1024
1281
|
value: "rtl",
|
|
1025
|
-
label:
|
|
1282
|
+
label: __17("Right to Left", "elementor"),
|
|
1026
1283
|
icon: TextDirectionRtlIcon
|
|
1027
1284
|
}
|
|
1028
1285
|
];
|
|
1029
|
-
var
|
|
1030
|
-
return /* @__PURE__ */
|
|
1286
|
+
var TextDirectionField = () => {
|
|
1287
|
+
return /* @__PURE__ */ React41.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React41.createElement(Grid14, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React41.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlLabel, null, __17("Direction", "elementor"))), /* @__PURE__ */ React41.createElement(Grid14, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React41.createElement(ToggleControl, { options: options4 }))));
|
|
1288
|
+
};
|
|
1289
|
+
|
|
1290
|
+
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1291
|
+
import * as React43 from "react";
|
|
1292
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
1293
|
+
|
|
1294
|
+
// src/components/collapsible-field.tsx
|
|
1295
|
+
import * as React42 from "react";
|
|
1296
|
+
import { useState as useState4 } from "react";
|
|
1297
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
1298
|
+
import { Collapse as Collapse2, IconButton as IconButton2, Stack as Stack10 } from "@elementor/ui";
|
|
1299
|
+
import { MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
1300
|
+
var CollapsibleField = ({ label, children, defaultOpen = false }) => {
|
|
1301
|
+
const [open, setOpen] = useState4(defaultOpen);
|
|
1302
|
+
const handleToggle = () => {
|
|
1303
|
+
setOpen((prevOpen) => !prevOpen);
|
|
1304
|
+
};
|
|
1305
|
+
return /* @__PURE__ */ React42.createElement(Stack10, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(Stack10, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { py: 0.5 } }, label, /* @__PURE__ */ React42.createElement(
|
|
1306
|
+
IconButton2,
|
|
1307
|
+
{
|
|
1308
|
+
onClick: handleToggle,
|
|
1309
|
+
size: "tiny",
|
|
1310
|
+
"aria-label": open ? __18("Close", "elementor") : __18("Expand", "elementor")
|
|
1311
|
+
},
|
|
1312
|
+
open ? /* @__PURE__ */ React42.createElement(MinusIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React42.createElement(PlusIcon2, { fontSize: "tiny" })
|
|
1313
|
+
)), /* @__PURE__ */ React42.createElement(Collapse2, { in: open }, children));
|
|
1314
|
+
};
|
|
1315
|
+
|
|
1316
|
+
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1317
|
+
var TextStrokeField = () => {
|
|
1318
|
+
return /* @__PURE__ */ React43.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React43.createElement(CollapsibleField, { label: /* @__PURE__ */ React43.createElement(ControlLabel, null, __19("Text Stroke", "elementor")) }, /* @__PURE__ */ React43.createElement(StrokeControl, null)));
|
|
1031
1319
|
};
|
|
1032
1320
|
|
|
1033
1321
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1034
1322
|
var TypographySection = () => {
|
|
1035
|
-
return /* @__PURE__ */
|
|
1323
|
+
return /* @__PURE__ */ React44.createElement(AccordionSection, { title: __20("Typography", "elementor") }, /* @__PURE__ */ React44.createElement(Stack11, { gap: 1.5 }, /* @__PURE__ */ React44.createElement(FontWeightField, null), /* @__PURE__ */ React44.createElement(FontSizeField, null), /* @__PURE__ */ React44.createElement(Divider2, null), /* @__PURE__ */ React44.createElement(TextColorField, null), /* @__PURE__ */ React44.createElement(CollapsibleContent, null, /* @__PURE__ */ React44.createElement(Stack11, { gap: 1.5, sx: { pt: 1.5 } }, /* @__PURE__ */ React44.createElement(LetterSpacingField, null), /* @__PURE__ */ React44.createElement(WordSpacingField, null), /* @__PURE__ */ React44.createElement(Divider2, null), /* @__PURE__ */ React44.createElement(TextAlignmentField, null), /* @__PURE__ */ React44.createElement(TextStyleField, null), /* @__PURE__ */ React44.createElement(TransformField, null), /* @__PURE__ */ React44.createElement(TextDirectionField, null), /* @__PURE__ */ React44.createElement(TextStrokeField, null)))));
|
|
1036
1324
|
};
|
|
1037
1325
|
|
|
1038
1326
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1039
|
-
import * as
|
|
1040
|
-
import { Stack as
|
|
1327
|
+
import * as React48 from "react";
|
|
1328
|
+
import { Stack as Stack13 } from "@elementor/ui";
|
|
1041
1329
|
|
|
1042
|
-
// src/components/style-sections/position-section/z-index-
|
|
1043
|
-
import * as
|
|
1044
|
-
import { __ as
|
|
1045
|
-
import { Grid as
|
|
1330
|
+
// src/components/style-sections/position-section/z-index-field.tsx
|
|
1331
|
+
import * as React45 from "react";
|
|
1332
|
+
import { __ as __21 } from "@wordpress/i18n";
|
|
1333
|
+
import { Grid as Grid15 } from "@elementor/ui";
|
|
1334
|
+
var ZIndexField = () => {
|
|
1335
|
+
return /* @__PURE__ */ React45.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React45.createElement(Grid15, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React45.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(ControlLabel, null, __21("Z-Index", "elementor"))), /* @__PURE__ */ React45.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(NumberControl, null))));
|
|
1336
|
+
};
|
|
1046
1337
|
|
|
1047
|
-
// src/
|
|
1048
|
-
import * as
|
|
1049
|
-
import {
|
|
1050
|
-
|
|
1051
|
-
var
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
size: "tiny",
|
|
1061
|
-
type: "number",
|
|
1062
|
-
value: isEmptyOrNaN(value) ? "" : value,
|
|
1063
|
-
onChange: handleChange,
|
|
1064
|
-
placeholder
|
|
1065
|
-
}
|
|
1066
|
-
));
|
|
1067
|
-
});
|
|
1338
|
+
// src/components/style-sections/position-section/position-field.tsx
|
|
1339
|
+
import * as React46 from "react";
|
|
1340
|
+
import { __ as __22 } from "@wordpress/i18n";
|
|
1341
|
+
import { Grid as Grid16 } from "@elementor/ui";
|
|
1342
|
+
var positionOptions = [
|
|
1343
|
+
{ label: __22("Static", "elementor"), value: "static" },
|
|
1344
|
+
{ label: __22("Relative", "elementor"), value: "relative" },
|
|
1345
|
+
{ label: __22("Absolute", "elementor"), value: "absolute" },
|
|
1346
|
+
{ label: __22("Fixed", "elementor"), value: "fixed" }
|
|
1347
|
+
];
|
|
1348
|
+
var PositionField = () => {
|
|
1349
|
+
return /* @__PURE__ */ React46.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React46.createElement(Grid16, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React46.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlLabel, null, __22("Position", "elementor"))), /* @__PURE__ */ React46.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(SelectControl, { options: positionOptions }))));
|
|
1350
|
+
};
|
|
1068
1351
|
|
|
1069
|
-
// src/components/style-sections/position-section/
|
|
1070
|
-
|
|
1071
|
-
|
|
1352
|
+
// src/components/style-sections/position-section/position-section.tsx
|
|
1353
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
1354
|
+
|
|
1355
|
+
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
1356
|
+
import * as React47 from "react";
|
|
1357
|
+
import { Grid as Grid17, Stack as Stack12 } from "@elementor/ui";
|
|
1358
|
+
import { __ as __23 } from "@wordpress/i18n";
|
|
1359
|
+
import { SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
1360
|
+
var sideIcons = {
|
|
1361
|
+
left: /* @__PURE__ */ React47.createElement(SideLeftIcon, { fontSize: "tiny" }),
|
|
1362
|
+
right: /* @__PURE__ */ React47.createElement(SideRightIcon, { fontSize: "tiny" }),
|
|
1363
|
+
top: /* @__PURE__ */ React47.createElement(SideTopIcon, { fontSize: "tiny" }),
|
|
1364
|
+
bottom: /* @__PURE__ */ React47.createElement(SideBottomIcon, { fontSize: "tiny" })
|
|
1365
|
+
};
|
|
1366
|
+
var DimensionsField = () => {
|
|
1367
|
+
return /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(Stack12, { direction: "row", gap: 2 }, /* @__PURE__ */ React47.createElement(DimensionField, { side: "top", label: __23("Top", "elementor") }), /* @__PURE__ */ React47.createElement(DimensionField, { side: "right", label: __23("Right", "elementor") })), /* @__PURE__ */ React47.createElement(Stack12, { direction: "row", gap: 2 }, /* @__PURE__ */ React47.createElement(DimensionField, { side: "bottom", label: __23("Bottom", "elementor") }), /* @__PURE__ */ React47.createElement(DimensionField, { side: "left", label: __23("Left", "elementor") })));
|
|
1368
|
+
};
|
|
1369
|
+
var DimensionField = ({ side, label }) => {
|
|
1370
|
+
return /* @__PURE__ */ React47.createElement(Grid17, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React47.createElement(Grid17, { item: true, xs: 12 }, /* @__PURE__ */ React47.createElement(ControlLabel, null, label)), /* @__PURE__ */ React47.createElement(Grid17, { item: true, xs: 12 }, /* @__PURE__ */ React47.createElement(StylesField, { bind: side }, /* @__PURE__ */ React47.createElement(SizeControl, { startIcon: sideIcons[side] }))));
|
|
1072
1371
|
};
|
|
1073
1372
|
|
|
1074
1373
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1075
|
-
import { __ as __16 } from "@wordpress/i18n";
|
|
1076
1374
|
var PositionSection = () => {
|
|
1077
|
-
|
|
1375
|
+
const [positionValue] = useStylesField("position");
|
|
1376
|
+
const isNotStatic = positionValue && positionValue !== "static";
|
|
1377
|
+
return /* @__PURE__ */ React48.createElement(AccordionSection, { title: __24("Position", "elementor") }, /* @__PURE__ */ React48.createElement(Stack13, { gap: 1.5 }, /* @__PURE__ */ React48.createElement(PositionField, null), isNotStatic ? /* @__PURE__ */ React48.createElement(React48.Fragment, null, /* @__PURE__ */ React48.createElement(DimensionsField, null), /* @__PURE__ */ React48.createElement(ZIndexField, null)) : null));
|
|
1078
1378
|
};
|
|
1079
1379
|
|
|
1080
1380
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1081
|
-
import * as
|
|
1082
|
-
import { Divider as
|
|
1083
|
-
import { __ as
|
|
1381
|
+
import * as React50 from "react";
|
|
1382
|
+
import { Divider as Divider3, Stack as Stack15 } from "@elementor/ui";
|
|
1383
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
1084
1384
|
|
|
1085
|
-
// src/
|
|
1086
|
-
import * as
|
|
1087
|
-
import { __ as
|
|
1088
|
-
import { Grid as
|
|
1089
|
-
import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
1090
|
-
var LinkedDimensionsControl = ({ label }) => {
|
|
1091
|
-
const { value, setValue } =
|
|
1385
|
+
// src/controls/controls/linked-dimensions-control.tsx
|
|
1386
|
+
import * as React49 from "react";
|
|
1387
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
1388
|
+
import { Grid as Grid18, Stack as Stack14, ToggleButton as ToggleButton3 } from "@elementor/ui";
|
|
1389
|
+
import { DetachIcon, LinkIcon, SideBottomIcon as SideBottomIcon2, SideLeftIcon as SideLeftIcon2, SideRightIcon as SideRightIcon2, SideTopIcon as SideTopIcon2 } from "@elementor/icons";
|
|
1390
|
+
var LinkedDimensionsControl = createControl(({ label }) => {
|
|
1391
|
+
const { value, setValue } = useBoundProp();
|
|
1092
1392
|
const { top, right, bottom, left, isLinked = true } = value?.value || {};
|
|
1093
1393
|
const setLinkedValue = (position, newValue) => {
|
|
1094
1394
|
const updatedValue = {
|
|
@@ -1118,394 +1418,393 @@ var LinkedDimensionsControl = ({ label }) => {
|
|
|
1118
1418
|
});
|
|
1119
1419
|
};
|
|
1120
1420
|
const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
|
|
1121
|
-
return /* @__PURE__ */
|
|
1421
|
+
return /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(Stack14, { direction: "row", gap: 2 }, /* @__PURE__ */ React49.createElement(ControlLabel, null, label), /* @__PURE__ */ React49.createElement(
|
|
1122
1422
|
ToggleButton3,
|
|
1123
1423
|
{
|
|
1124
|
-
"aria-label":
|
|
1424
|
+
"aria-label": __25("Link Inputs", "elementor"),
|
|
1125
1425
|
size: "tiny",
|
|
1126
1426
|
value: "check",
|
|
1127
1427
|
selected: isLinked,
|
|
1128
1428
|
sx: { marginLeft: "auto" },
|
|
1129
1429
|
onChange: toggleLinked
|
|
1130
1430
|
},
|
|
1131
|
-
/* @__PURE__ */
|
|
1132
|
-
)), /* @__PURE__ */
|
|
1133
|
-
|
|
1431
|
+
/* @__PURE__ */ React49.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1432
|
+
)), /* @__PURE__ */ React49.createElement(Stack14, { direction: "row", gap: 2 }, /* @__PURE__ */ React49.createElement(Grid18, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(ControlLabel, null, __25("Top", "elementor"))), /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(
|
|
1433
|
+
Control5,
|
|
1134
1434
|
{
|
|
1135
1435
|
bind: "top",
|
|
1136
1436
|
value: top,
|
|
1137
1437
|
setValue: setLinkedValue,
|
|
1138
|
-
startIcon: /* @__PURE__ */
|
|
1438
|
+
startIcon: /* @__PURE__ */ React49.createElement(SideTopIcon2, { fontSize: "tiny" })
|
|
1139
1439
|
}
|
|
1140
|
-
))), /* @__PURE__ */
|
|
1141
|
-
|
|
1440
|
+
))), /* @__PURE__ */ React49.createElement(Grid18, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(ControlLabel, null, __25("Right", "elementor"))), /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(
|
|
1441
|
+
Control5,
|
|
1142
1442
|
{
|
|
1143
1443
|
bind: "right",
|
|
1144
1444
|
value: right,
|
|
1145
1445
|
setValue: setLinkedValue,
|
|
1146
|
-
startIcon: /* @__PURE__ */
|
|
1446
|
+
startIcon: /* @__PURE__ */ React49.createElement(SideRightIcon2, { fontSize: "tiny" })
|
|
1147
1447
|
}
|
|
1148
|
-
)))), /* @__PURE__ */
|
|
1149
|
-
|
|
1448
|
+
)))), /* @__PURE__ */ React49.createElement(Stack14, { direction: "row", gap: 2 }, /* @__PURE__ */ React49.createElement(Grid18, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(ControlLabel, null, __25("Bottom", "elementor"))), /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(
|
|
1449
|
+
Control5,
|
|
1150
1450
|
{
|
|
1151
1451
|
bind: "bottom",
|
|
1152
1452
|
value: bottom,
|
|
1153
1453
|
setValue: setLinkedValue,
|
|
1154
|
-
startIcon: /* @__PURE__ */
|
|
1454
|
+
startIcon: /* @__PURE__ */ React49.createElement(SideBottomIcon2, { fontSize: "tiny" })
|
|
1155
1455
|
}
|
|
1156
|
-
))), /* @__PURE__ */
|
|
1157
|
-
|
|
1456
|
+
))), /* @__PURE__ */ React49.createElement(Grid18, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(ControlLabel, null, __25("Left", "elementor"))), /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(
|
|
1457
|
+
Control5,
|
|
1158
1458
|
{
|
|
1159
1459
|
bind: "left",
|
|
1160
1460
|
value: left,
|
|
1161
1461
|
setValue: setLinkedValue,
|
|
1162
|
-
startIcon: /* @__PURE__ */
|
|
1462
|
+
startIcon: /* @__PURE__ */ React49.createElement(SideLeftIcon2, { fontSize: "tiny" })
|
|
1163
1463
|
}
|
|
1164
1464
|
)))));
|
|
1165
|
-
};
|
|
1166
|
-
var
|
|
1465
|
+
});
|
|
1466
|
+
var Control5 = ({
|
|
1167
1467
|
bind,
|
|
1168
1468
|
startIcon,
|
|
1169
1469
|
value,
|
|
1170
1470
|
setValue
|
|
1171
|
-
}) => /* @__PURE__ */
|
|
1172
|
-
ControlContext.Provider,
|
|
1173
|
-
{
|
|
1174
|
-
value: {
|
|
1175
|
-
bind,
|
|
1176
|
-
setValue: (newValue) => setValue(bind, newValue),
|
|
1177
|
-
value
|
|
1178
|
-
}
|
|
1179
|
-
},
|
|
1180
|
-
/* @__PURE__ */ React38.createElement(SizeControl, { startIcon })
|
|
1181
|
-
);
|
|
1471
|
+
}) => /* @__PURE__ */ React49.createElement(BoundPropProvider, { setValue: (newValue) => setValue(bind, newValue), value, bind }, /* @__PURE__ */ React49.createElement(SizeControl, { startIcon }));
|
|
1182
1472
|
|
|
1183
1473
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1184
1474
|
var SpacingSection = () => {
|
|
1185
|
-
return /* @__PURE__ */
|
|
1475
|
+
return /* @__PURE__ */ React50.createElement(AccordionSection, { title: __26("Spacing", "elementor") }, /* @__PURE__ */ React50.createElement(Stack15, { gap: 1.5 }, /* @__PURE__ */ React50.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React50.createElement(LinkedDimensionsControl, { label: __26("Padding", "elementor") })), /* @__PURE__ */ React50.createElement(Divider3, null), /* @__PURE__ */ React50.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React50.createElement(LinkedDimensionsControl, { label: __26("Margin", "elementor") }))));
|
|
1186
1476
|
};
|
|
1187
1477
|
|
|
1188
1478
|
// src/components/style-sections/effects-section/effects-section.tsx
|
|
1189
|
-
import * as
|
|
1190
|
-
import { __ as
|
|
1191
|
-
import { Stack as
|
|
1479
|
+
import * as React51 from "react";
|
|
1480
|
+
import { __ as __27 } from "@wordpress/i18n";
|
|
1481
|
+
import { Stack as Stack16 } from "@elementor/ui";
|
|
1482
|
+
var EffectsSection = () => {
|
|
1483
|
+
return /* @__PURE__ */ React51.createElement(AccordionSection, { title: __27("Effects", "elementor") }, /* @__PURE__ */ React51.createElement(Stack16, { gap: 1.5 }, /* @__PURE__ */ React51.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React51.createElement(BoxShadowRepeaterControl, null))));
|
|
1484
|
+
};
|
|
1192
1485
|
|
|
1193
|
-
// src/components/style-sections/
|
|
1194
|
-
import * as
|
|
1195
|
-
import { __ as
|
|
1196
|
-
import {
|
|
1486
|
+
// src/components/style-sections/background-section/background-section.tsx
|
|
1487
|
+
import * as React53 from "react";
|
|
1488
|
+
import { __ as __29 } from "@wordpress/i18n";
|
|
1489
|
+
import { Stack as Stack17 } from "@elementor/ui";
|
|
1197
1490
|
|
|
1198
|
-
// src/
|
|
1199
|
-
import * as
|
|
1200
|
-
import {
|
|
1201
|
-
import {
|
|
1202
|
-
|
|
1491
|
+
// src/components/style-sections/background-section/background-color-field.tsx
|
|
1492
|
+
import * as React52 from "react";
|
|
1493
|
+
import { __ as __28 } from "@wordpress/i18n";
|
|
1494
|
+
import { Grid as Grid19 } from "@elementor/ui";
|
|
1495
|
+
var BackgroundColorField = () => {
|
|
1496
|
+
return /* @__PURE__ */ React52.createElement(StylesField, { bind: "background-color" }, /* @__PURE__ */ React52.createElement(Grid19, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React52.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(ControlLabel, null, __28("Color", "elementor"))), /* @__PURE__ */ React52.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(ColorControl, null))));
|
|
1497
|
+
};
|
|
1498
|
+
|
|
1499
|
+
// src/components/style-sections/background-section/background-section.tsx
|
|
1500
|
+
var BackgroundSection = () => {
|
|
1501
|
+
return /* @__PURE__ */ React53.createElement(AccordionSection, { title: __29("Background", "elementor") }, /* @__PURE__ */ React53.createElement(Stack17, { gap: 1.5 }, /* @__PURE__ */ React53.createElement(BackgroundColorField, null)));
|
|
1502
|
+
};
|
|
1503
|
+
|
|
1504
|
+
// src/components/style-sections/border-section/border-section.tsx
|
|
1505
|
+
import * as React61 from "react";
|
|
1506
|
+
import { Divider as Divider4, Stack as Stack20 } from "@elementor/ui";
|
|
1507
|
+
import { __ as __36 } from "@wordpress/i18n";
|
|
1508
|
+
|
|
1509
|
+
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
1510
|
+
import * as React55 from "react";
|
|
1511
|
+
import { __ as __31 } from "@wordpress/i18n";
|
|
1203
1512
|
import {
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
} from "
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
...repeaterValues.slice(index)
|
|
1230
|
-
]);
|
|
1231
|
-
};
|
|
1232
|
-
const removeRepeaterItem = (index) => {
|
|
1233
|
-
setRepeaterValues(repeaterValues.filter((_, i) => i !== index));
|
|
1513
|
+
BorderCornersIcon,
|
|
1514
|
+
RadiusBottomLeftIcon,
|
|
1515
|
+
RadiusBottomRightIcon,
|
|
1516
|
+
RadiusTopLeftIcon,
|
|
1517
|
+
RadiusTopRightIcon
|
|
1518
|
+
} from "@elementor/icons";
|
|
1519
|
+
|
|
1520
|
+
// src/controls/controls/equal-unequal-sizes-control.tsx
|
|
1521
|
+
import * as React54 from "react";
|
|
1522
|
+
import { useId as useId4, useRef as useRef2 } from "react";
|
|
1523
|
+
import { bindPopover as bindPopover2, bindToggle, Grid as Grid20, Popover as Popover2, Stack as Stack18, ToggleButton as ToggleButton4, usePopupState as usePopupState3 } from "@elementor/ui";
|
|
1524
|
+
import { __ as __30 } from "@wordpress/i18n";
|
|
1525
|
+
function hasMixedSizes(values) {
|
|
1526
|
+
const [firstValue, ...restValues] = values;
|
|
1527
|
+
return restValues.some(
|
|
1528
|
+
(value) => value?.value?.size !== firstValue?.value?.size || value?.value?.unit !== firstValue?.value?.unit
|
|
1529
|
+
);
|
|
1530
|
+
}
|
|
1531
|
+
function EqualUnequalSizesControl({ label, icon, items, multiSizeType }) {
|
|
1532
|
+
const popupId = useId4();
|
|
1533
|
+
const controlRef = useRef2(null);
|
|
1534
|
+
const { value: controlValue, setValue: setControlValue } = useBoundProp();
|
|
1535
|
+
const actualValue = controlValue?.value ?? {};
|
|
1536
|
+
const setActualValue = (newValue) => {
|
|
1537
|
+
setControlValue({ $$type: multiSizeType, value: newValue });
|
|
1234
1538
|
};
|
|
1235
|
-
const
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
return value;
|
|
1243
|
-
})
|
|
1244
|
-
);
|
|
1539
|
+
const setNestedProp = (item, newValue) => {
|
|
1540
|
+
const { bind } = item;
|
|
1541
|
+
const newValues = {
|
|
1542
|
+
...actualValue,
|
|
1543
|
+
[bind]: newValue
|
|
1544
|
+
};
|
|
1545
|
+
setActualValue(newValues);
|
|
1245
1546
|
};
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
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,
|
|
1547
|
+
const setEqualValues = (newValue) => {
|
|
1548
|
+
const equalValues = items.reduce((values, item) => {
|
|
1549
|
+
return {
|
|
1550
|
+
...values,
|
|
1551
|
+
[item.bind]: newValue
|
|
1552
|
+
};
|
|
1553
|
+
}, {});
|
|
1554
|
+
setActualValue(equalValues);
|
|
1555
|
+
};
|
|
1556
|
+
const popupState = usePopupState3({
|
|
1557
|
+
variant: "popover",
|
|
1558
|
+
popupId
|
|
1559
|
+
});
|
|
1560
|
+
return /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(Grid20, { container: true, alignItems: "center", ref: controlRef }, /* @__PURE__ */ React54.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(ControlLabel, null, label)), /* @__PURE__ */ React54.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(
|
|
1561
|
+
EqualValuesControl,
|
|
1562
|
+
{
|
|
1563
|
+
value: actualValue,
|
|
1564
|
+
setValue: setEqualValues,
|
|
1565
|
+
iconButton: /* @__PURE__ */ React54.createElement(
|
|
1566
|
+
ToggleButton4,
|
|
1311
1567
|
{
|
|
1312
|
-
size:
|
|
1313
|
-
|
|
1314
|
-
|
|
1568
|
+
size: "tiny",
|
|
1569
|
+
value: "check",
|
|
1570
|
+
sx: { marginLeft: "auto" },
|
|
1571
|
+
...bindToggle(popupState),
|
|
1572
|
+
selected: popupState.isOpen
|
|
1315
1573
|
},
|
|
1316
|
-
|
|
1317
|
-
)
|
|
1574
|
+
icon
|
|
1575
|
+
)
|
|
1318
1576
|
}
|
|
1319
|
-
), /* @__PURE__ */
|
|
1577
|
+
))), /* @__PURE__ */ React54.createElement(
|
|
1320
1578
|
Popover2,
|
|
1321
1579
|
{
|
|
1322
1580
|
disablePortal: true,
|
|
1323
|
-
|
|
1324
|
-
|
|
1581
|
+
disableScrollLock: true,
|
|
1582
|
+
anchorOrigin: {
|
|
1583
|
+
vertical: "bottom",
|
|
1584
|
+
horizontal: "right"
|
|
1325
1585
|
},
|
|
1326
|
-
|
|
1327
|
-
|
|
1586
|
+
transformOrigin: {
|
|
1587
|
+
vertical: "top",
|
|
1588
|
+
horizontal: "right"
|
|
1589
|
+
},
|
|
1590
|
+
...bindPopover2(popupState),
|
|
1591
|
+
slotProps: {
|
|
1592
|
+
paper: { sx: { mt: 0.5, p: 2, pt: 1, width: controlRef.current?.getBoundingClientRect().width } }
|
|
1593
|
+
}
|
|
1328
1594
|
},
|
|
1329
|
-
/* @__PURE__ */
|
|
1595
|
+
/* @__PURE__ */ React54.createElement(Stack18, { gap: 1.5 }, /* @__PURE__ */ React54.createElement(Grid20, { container: true, spacing: 2, alignItems: "center" }, /* @__PURE__ */ React54.createElement(NestedValueControl, { item: items[0], value: actualValue, setNestedProp }), /* @__PURE__ */ React54.createElement(NestedValueControl, { item: items[1], value: actualValue, setNestedProp })), /* @__PURE__ */ React54.createElement(Grid20, { container: true, spacing: 2, alignItems: "center" }, /* @__PURE__ */ React54.createElement(NestedValueControl, { item: items[3], value: actualValue, setNestedProp }), /* @__PURE__ */ React54.createElement(NestedValueControl, { item: items[2], value: actualValue, setNestedProp })))
|
|
1330
1596
|
));
|
|
1597
|
+
}
|
|
1598
|
+
var NestedValueControl = ({
|
|
1599
|
+
item,
|
|
1600
|
+
value,
|
|
1601
|
+
setNestedProp
|
|
1602
|
+
}) => {
|
|
1603
|
+
const { bind } = item;
|
|
1604
|
+
const nestedValue = value?.[bind] ? value[bind] : void 0;
|
|
1605
|
+
return /* @__PURE__ */ React54.createElement(BoundPropProvider, { bind: "", setValue: (val) => setNestedProp(item, val), value: nestedValue }, /* @__PURE__ */ React54.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(Grid20, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React54.createElement(Grid20, { item: true, xs: 12 }, /* @__PURE__ */ React54.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React54.createElement(Grid20, { item: true, xs: 12 }, /* @__PURE__ */ React54.createElement(SizeControl, { startIcon: item.icon })))));
|
|
1331
1606
|
};
|
|
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,
|
|
1607
|
+
var EqualValuesControl = ({
|
|
1361
1608
|
value,
|
|
1362
|
-
setValue
|
|
1609
|
+
setValue,
|
|
1610
|
+
iconButton
|
|
1363
1611
|
}) => {
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
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,
|
|
1612
|
+
const values = Object.values(value ?? {});
|
|
1613
|
+
const isMixed = hasMixedSizes(values);
|
|
1614
|
+
return /* @__PURE__ */ React54.createElement(
|
|
1615
|
+
BoundPropProvider,
|
|
1411
1616
|
{
|
|
1412
|
-
bind: "
|
|
1413
|
-
|
|
1414
|
-
value:
|
|
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 })
|
|
1617
|
+
bind: "",
|
|
1618
|
+
setValue: (val) => setValue(val),
|
|
1619
|
+
value: isMixed ? void 0 : values[0]
|
|
1425
1620
|
},
|
|
1426
|
-
/* @__PURE__ */
|
|
1427
|
-
)
|
|
1428
|
-
|
|
1621
|
+
/* @__PURE__ */ React54.createElement(Stack18, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React54.createElement(SizeControl, { placeholder: __30("MIXED", "elementor") }), iconButton)
|
|
1622
|
+
);
|
|
1623
|
+
};
|
|
1624
|
+
|
|
1625
|
+
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
1626
|
+
var corners = [
|
|
1627
|
+
{
|
|
1628
|
+
label: __31("Top Left", "elementor"),
|
|
1629
|
+
icon: /* @__PURE__ */ React55.createElement(RadiusTopLeftIcon, { fontSize: "tiny" }),
|
|
1630
|
+
bind: "top-left"
|
|
1631
|
+
},
|
|
1632
|
+
{
|
|
1633
|
+
label: __31("Top Right", "elementor"),
|
|
1634
|
+
icon: /* @__PURE__ */ React55.createElement(RadiusTopRightIcon, { fontSize: "tiny" }),
|
|
1635
|
+
bind: "top-right"
|
|
1636
|
+
},
|
|
1637
|
+
{
|
|
1638
|
+
label: __31("Bottom Right", "elementor"),
|
|
1639
|
+
icon: /* @__PURE__ */ React55.createElement(RadiusBottomRightIcon, { fontSize: "tiny" }),
|
|
1640
|
+
bind: "bottom-right"
|
|
1641
|
+
},
|
|
1642
|
+
{
|
|
1643
|
+
label: __31("Bottom Left", "elementor"),
|
|
1644
|
+
icon: /* @__PURE__ */ React55.createElement(RadiusBottomLeftIcon, { fontSize: "tiny" }),
|
|
1645
|
+
bind: "bottom-left"
|
|
1646
|
+
}
|
|
1647
|
+
];
|
|
1648
|
+
var BorderRadiusField = () => {
|
|
1649
|
+
return /* @__PURE__ */ React55.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React55.createElement(
|
|
1650
|
+
EqualUnequalSizesControl,
|
|
1429
1651
|
{
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1652
|
+
label: __31("Border Radius", "elementor"),
|
|
1653
|
+
icon: /* @__PURE__ */ React55.createElement(BorderCornersIcon, { fontSize: "tiny" }),
|
|
1654
|
+
items: corners,
|
|
1655
|
+
multiSizeType: "border-radius"
|
|
1656
|
+
}
|
|
1657
|
+
));
|
|
1658
|
+
};
|
|
1659
|
+
|
|
1660
|
+
// src/components/style-sections/border-section/border-field.tsx
|
|
1661
|
+
import * as React60 from "react";
|
|
1662
|
+
import { __ as __35 } from "@wordpress/i18n";
|
|
1663
|
+
|
|
1664
|
+
// src/components/style-sections/border-section/border-width-field.tsx
|
|
1665
|
+
import * as React56 from "react";
|
|
1666
|
+
import { SideBottomIcon as SideBottomIcon3, SideLeftIcon as SideLeftIcon3, SideRightIcon as SideRightIcon3, SideTopIcon as SideTopIcon3, SideAllIcon } from "@elementor/icons";
|
|
1667
|
+
import { __ as __32 } from "@wordpress/i18n";
|
|
1668
|
+
var edges = [
|
|
1669
|
+
{
|
|
1670
|
+
label: __32("Top", "elementor"),
|
|
1671
|
+
icon: /* @__PURE__ */ React56.createElement(SideTopIcon3, { fontSize: "tiny" }),
|
|
1672
|
+
bind: "top"
|
|
1673
|
+
},
|
|
1674
|
+
{
|
|
1675
|
+
label: __32("Right", "elementor"),
|
|
1676
|
+
icon: /* @__PURE__ */ React56.createElement(SideRightIcon3, { fontSize: "tiny" }),
|
|
1677
|
+
bind: "right"
|
|
1678
|
+
},
|
|
1679
|
+
{
|
|
1680
|
+
label: __32("Bottom", "elementor"),
|
|
1681
|
+
icon: /* @__PURE__ */ React56.createElement(SideBottomIcon3, { fontSize: "tiny" }),
|
|
1682
|
+
bind: "bottom"
|
|
1683
|
+
},
|
|
1684
|
+
{
|
|
1685
|
+
label: __32("Left", "elementor"),
|
|
1686
|
+
icon: /* @__PURE__ */ React56.createElement(SideLeftIcon3, { fontSize: "tiny" }),
|
|
1687
|
+
bind: "left"
|
|
1688
|
+
}
|
|
1689
|
+
];
|
|
1690
|
+
var BorderWidthField = () => {
|
|
1691
|
+
return /* @__PURE__ */ React56.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React56.createElement(
|
|
1692
|
+
EqualUnequalSizesControl,
|
|
1438
1693
|
{
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
}
|
|
1444
|
-
|
|
1445
|
-
)));
|
|
1694
|
+
label: __32("Border Width", "elementor"),
|
|
1695
|
+
icon: /* @__PURE__ */ React56.createElement(SideAllIcon, { fontSize: "tiny" }),
|
|
1696
|
+
items: edges,
|
|
1697
|
+
multiSizeType: "border-width"
|
|
1698
|
+
}
|
|
1699
|
+
));
|
|
1446
1700
|
};
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1701
|
+
|
|
1702
|
+
// src/components/style-sections/border-section/border-color-field.tsx
|
|
1703
|
+
import * as React57 from "react";
|
|
1704
|
+
import { __ as __33 } from "@wordpress/i18n";
|
|
1705
|
+
import { Grid as Grid21 } from "@elementor/ui";
|
|
1706
|
+
var BorderColorField = () => {
|
|
1707
|
+
return /* @__PURE__ */ React57.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React57.createElement(Grid21, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React57.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ControlLabel, null, __33("Border Color", "elementor"))), /* @__PURE__ */ React57.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ColorControl, null))));
|
|
1708
|
+
};
|
|
1709
|
+
|
|
1710
|
+
// src/components/style-sections/border-section/border-style-field.tsx
|
|
1711
|
+
import * as React58 from "react";
|
|
1712
|
+
import { __ as __34 } from "@wordpress/i18n";
|
|
1713
|
+
import { Grid as Grid22 } from "@elementor/ui";
|
|
1714
|
+
var borderStyles = [
|
|
1715
|
+
{ value: "none", label: __34("None", "elementor") },
|
|
1716
|
+
{ value: "solid", label: __34("Solid", "elementor") },
|
|
1717
|
+
{ value: "dashed", label: __34("Dashed", "elementor") },
|
|
1718
|
+
{ value: "dotted", label: __34("Dotted", "elementor") },
|
|
1719
|
+
{ value: "double", label: __34("Double", "elementor") },
|
|
1720
|
+
{ value: "groove", label: __34("Groove", "elementor") },
|
|
1721
|
+
{ value: "ridge", label: __34("Ridge", "elementor") },
|
|
1722
|
+
{ value: "inset", label: __34("Inset", "elementor") },
|
|
1723
|
+
{ value: "outset", label: __34("Outset", "elementor") }
|
|
1724
|
+
];
|
|
1725
|
+
var BorderStyleField = () => {
|
|
1726
|
+
return /* @__PURE__ */ React58.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React58.createElement(Grid22, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React58.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React58.createElement(ControlLabel, null, __34("Border Type", "elementor"))), /* @__PURE__ */ React58.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React58.createElement(SelectControl, { options: borderStyles }))));
|
|
1467
1727
|
};
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
spread: {
|
|
1484
|
-
$$type: "size",
|
|
1485
|
-
value: { unit: "px", size: 0 }
|
|
1728
|
+
|
|
1729
|
+
// src/components/add-or-remove-content.tsx
|
|
1730
|
+
import * as React59 from "react";
|
|
1731
|
+
import { MinusIcon as MinusIcon2, PlusIcon as PlusIcon3 } from "@elementor/icons";
|
|
1732
|
+
import { Collapse as Collapse3, IconButton as IconButton3, Stack as Stack19 } from "@elementor/ui";
|
|
1733
|
+
var SIZE2 = "tiny";
|
|
1734
|
+
var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
1735
|
+
return /* @__PURE__ */ React59.createElement(Stack19, { gap: 1.5 }, /* @__PURE__ */ React59.createElement(
|
|
1736
|
+
Stack19,
|
|
1737
|
+
{
|
|
1738
|
+
direction: "row",
|
|
1739
|
+
sx: {
|
|
1740
|
+
justifyContent: "space-between",
|
|
1741
|
+
alignItems: "center"
|
|
1742
|
+
}
|
|
1486
1743
|
},
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1744
|
+
/* @__PURE__ */ React59.createElement(ControlLabel, null, label),
|
|
1745
|
+
isAdded ? /* @__PURE__ */ React59.createElement(IconButton3, { size: SIZE2, onClick: onRemove }, /* @__PURE__ */ React59.createElement(MinusIcon2, { fontSize: SIZE2 })) : /* @__PURE__ */ React59.createElement(IconButton3, { size: SIZE2, onClick: onAdd }, /* @__PURE__ */ React59.createElement(PlusIcon3, { fontSize: SIZE2 }))
|
|
1746
|
+
), /* @__PURE__ */ React59.createElement(Collapse3, { in: isAdded }, /* @__PURE__ */ React59.createElement(Stack19, { gap: 1.5 }, children)));
|
|
1747
|
+
};
|
|
1748
|
+
|
|
1749
|
+
// src/components/style-sections/border-section/border-field.tsx
|
|
1750
|
+
var initialSize = { $$type: "size", value: { size: 1, unit: "px" } };
|
|
1751
|
+
var initialBorderWidth = {
|
|
1752
|
+
$$type: "border-width",
|
|
1753
|
+
value: { top: initialSize, right: initialSize, bottom: initialSize, left: initialSize }
|
|
1754
|
+
};
|
|
1755
|
+
var initialBorderColor = { $$type: "color", value: "#000000" };
|
|
1756
|
+
var initialBorderStyle = "solid";
|
|
1757
|
+
var BorderField = () => {
|
|
1758
|
+
const [borderWidth, setBorderWidth] = useStylesField("border-width");
|
|
1759
|
+
const [borderColor, setBorderColor] = useStylesField("border-color");
|
|
1760
|
+
const [borderStyle, setBorderStyle] = useStylesField("border-style");
|
|
1761
|
+
const addBorder = () => {
|
|
1762
|
+
setBorderWidth(initialBorderWidth);
|
|
1763
|
+
setBorderColor(initialBorderColor);
|
|
1764
|
+
setBorderStyle(initialBorderStyle);
|
|
1765
|
+
};
|
|
1766
|
+
const removeBorder = () => {
|
|
1767
|
+
setBorderWidth(null);
|
|
1768
|
+
setBorderColor(null);
|
|
1769
|
+
setBorderStyle(null);
|
|
1770
|
+
};
|
|
1771
|
+
const hasBorder = Boolean(borderWidth || borderColor || borderStyle);
|
|
1772
|
+
return /* @__PURE__ */ React60.createElement(
|
|
1773
|
+
AddOrRemoveContent,
|
|
1774
|
+
{
|
|
1775
|
+
label: __35("Border", "elementor"),
|
|
1776
|
+
isAdded: hasBorder,
|
|
1777
|
+
onAdd: addBorder,
|
|
1778
|
+
onRemove: removeBorder
|
|
1490
1779
|
},
|
|
1491
|
-
|
|
1492
|
-
|
|
1780
|
+
/* @__PURE__ */ React60.createElement(BorderWidthField, null),
|
|
1781
|
+
/* @__PURE__ */ React60.createElement(BorderColorField, null),
|
|
1782
|
+
/* @__PURE__ */ React60.createElement(BorderStyleField, null)
|
|
1783
|
+
);
|
|
1493
1784
|
};
|
|
1494
1785
|
|
|
1495
|
-
// src/components/style-sections/
|
|
1496
|
-
var
|
|
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))));
|
|
1498
|
-
};
|
|
1786
|
+
// src/components/style-sections/border-section/border-section.tsx
|
|
1787
|
+
var BorderSection = () => /* @__PURE__ */ React61.createElement(AccordionSection, { title: __36("Border", "elementor") }, /* @__PURE__ */ React61.createElement(Stack20, { gap: 1.5 }, /* @__PURE__ */ React61.createElement(BorderRadiusField, null), /* @__PURE__ */ React61.createElement(Divider4, null), /* @__PURE__ */ React61.createElement(BorderField, null)));
|
|
1499
1788
|
|
|
1500
1789
|
// src/components/style-tab.tsx
|
|
1501
1790
|
var CLASSES_PROP_KEY = "classes";
|
|
1502
1791
|
var StyleTab = () => {
|
|
1503
|
-
const
|
|
1504
|
-
const
|
|
1505
|
-
|
|
1506
|
-
};
|
|
1507
|
-
|
|
1508
|
-
|
|
1792
|
+
const currentClassesProp = useCurrentClassesProp();
|
|
1793
|
+
const [selectedStyleDefId] = useSelectedStyleDefId(currentClassesProp);
|
|
1794
|
+
const breakpoint = useActiveBreakpoint();
|
|
1795
|
+
return /* @__PURE__ */ React62.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React62.createElement(StyleProvider, { meta: { breakpoint, state: null }, id: selectedStyleDefId }, /* @__PURE__ */ React62.createElement(Stack21, null, /* @__PURE__ */ React62.createElement(SpacingSection, null), /* @__PURE__ */ React62.createElement(SizeSection, null), /* @__PURE__ */ React62.createElement(PositionSection, null), /* @__PURE__ */ React62.createElement(TypographySection, null), /* @__PURE__ */ React62.createElement(BackgroundSection, null), /* @__PURE__ */ React62.createElement(BorderSection, null), /* @__PURE__ */ React62.createElement(EffectsSection, null))));
|
|
1796
|
+
};
|
|
1797
|
+
function useSelectedStyleDefId(currentClassesProp) {
|
|
1798
|
+
const { element } = useElement();
|
|
1799
|
+
const [selectedStyleDefId, setSelectedStyleDefId] = useState5(() => {
|
|
1800
|
+
const styleIds = getElementSetting(element.id, currentClassesProp)?.value ?? [];
|
|
1801
|
+
const stylesDefs = getElementStyles(element.id) ?? {};
|
|
1802
|
+
return styleIds.find((id) => id in stylesDefs) ?? generateId(`e-${element.id}-`, Object.keys(stylesDefs));
|
|
1803
|
+
});
|
|
1804
|
+
return [selectedStyleDefId, setSelectedStyleDefId];
|
|
1805
|
+
}
|
|
1806
|
+
function useCurrentClassesProp() {
|
|
1807
|
+
const { elementType } = useElement();
|
|
1509
1808
|
const prop = Object.entries(elementType.propsSchema).find(
|
|
1510
1809
|
([, propType]) => propType.kind === "array" && propType.key === CLASSES_PROP_KEY
|
|
1511
1810
|
);
|
|
@@ -1514,28 +1813,76 @@ function useClassesProp() {
|
|
|
1514
1813
|
}
|
|
1515
1814
|
return prop[0];
|
|
1516
1815
|
}
|
|
1517
|
-
function useStyleDefinition() {
|
|
1518
|
-
const { element } = useElementContext();
|
|
1519
|
-
const elementStyles = useElementStyles(element.id);
|
|
1520
|
-
return Object.values(elementStyles || {})[0] ?? null;
|
|
1521
|
-
}
|
|
1522
1816
|
|
|
1523
1817
|
// src/components/editing-panel-tabs.tsx
|
|
1524
1818
|
var EditingPanelTabs = () => {
|
|
1525
1819
|
const { getTabProps, getTabPanelProps, getTabsProps } = useTabs("settings");
|
|
1526
|
-
return /* @__PURE__ */
|
|
1820
|
+
return /* @__PURE__ */ React63.createElement(Stack22, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React63.createElement(Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React63.createElement(Tab, { label: __37("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React63.createElement(Tab, { label: __37("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React63.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React63.createElement(SettingsTab, null)), /* @__PURE__ */ React63.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React63.createElement(StyleTab, null)));
|
|
1527
1821
|
};
|
|
1528
1822
|
|
|
1823
|
+
// src/components/editing-panel.tsx
|
|
1824
|
+
import { ErrorBoundary as ErrorBoundary2 } from "@elementor/ui";
|
|
1825
|
+
|
|
1826
|
+
// src/components/editing-panel-error-fallback.tsx
|
|
1827
|
+
import * as React64 from "react";
|
|
1828
|
+
import { Alert, Box as Box3 } from "@elementor/ui";
|
|
1829
|
+
function EditorPanelErrorFallback() {
|
|
1830
|
+
return /* @__PURE__ */ React64.createElement(Box3, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React64.createElement(Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React64.createElement("strong", null, "Something went wrong")));
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
// src/popover-action.tsx
|
|
1834
|
+
import * as React65 from "react";
|
|
1835
|
+
import { useId as useId5 } from "react";
|
|
1836
|
+
import { XIcon as XIcon2 } from "@elementor/icons";
|
|
1837
|
+
import { bindPopover as bindPopover3, bindToggle as bindToggle2, IconButton as IconButton4, Popover as Popover3, Stack as Stack23, Tooltip as Tooltip2, Typography as Typography4, usePopupState as usePopupState4 } from "@elementor/ui";
|
|
1838
|
+
var SIZE3 = "tiny";
|
|
1839
|
+
function PopoverAction({
|
|
1840
|
+
title,
|
|
1841
|
+
visible = true,
|
|
1842
|
+
icon: Icon,
|
|
1843
|
+
popoverContent: PopoverContent
|
|
1844
|
+
}) {
|
|
1845
|
+
const id = useId5();
|
|
1846
|
+
const popupState = usePopupState4({
|
|
1847
|
+
variant: "popover",
|
|
1848
|
+
popupId: `elementor-popover-action-${id}`
|
|
1849
|
+
});
|
|
1850
|
+
if (!visible) {
|
|
1851
|
+
return null;
|
|
1852
|
+
}
|
|
1853
|
+
return /* @__PURE__ */ React65.createElement(React65.Fragment, null, /* @__PURE__ */ React65.createElement(Tooltip2, { placement: "top", title }, /* @__PURE__ */ React65.createElement(IconButton4, { "aria-label": title, key: id, size: SIZE3, ...bindToggle2(popupState) }, /* @__PURE__ */ React65.createElement(Icon, { fontSize: SIZE3 }))), /* @__PURE__ */ React65.createElement(
|
|
1854
|
+
Popover3,
|
|
1855
|
+
{
|
|
1856
|
+
disablePortal: true,
|
|
1857
|
+
disableScrollLock: true,
|
|
1858
|
+
anchorOrigin: {
|
|
1859
|
+
vertical: "bottom",
|
|
1860
|
+
horizontal: "center"
|
|
1861
|
+
},
|
|
1862
|
+
...bindPopover3(popupState)
|
|
1863
|
+
},
|
|
1864
|
+
/* @__PURE__ */ React65.createElement(Stack23, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React65.createElement(Icon, { fontSize: SIZE3, sx: { mr: 0.5 } }), /* @__PURE__ */ React65.createElement(Typography4, { variant: "subtitle2" }, title), /* @__PURE__ */ React65.createElement(IconButton4, { sx: { ml: "auto" }, size: SIZE3, onClick: popupState.close }, /* @__PURE__ */ React65.createElement(XIcon2, { fontSize: SIZE3 }))),
|
|
1865
|
+
/* @__PURE__ */ React65.createElement(PopoverContent, { closePopover: popupState.close })
|
|
1866
|
+
));
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
// src/controls-actions.ts
|
|
1870
|
+
var { useMenuItems, registerPopoverAction } = createControlActionsMenu({
|
|
1871
|
+
components: {
|
|
1872
|
+
PopoverAction
|
|
1873
|
+
}
|
|
1874
|
+
});
|
|
1875
|
+
|
|
1529
1876
|
// src/components/editing-panel.tsx
|
|
1530
1877
|
var EditingPanel = () => {
|
|
1531
|
-
const
|
|
1532
|
-
const
|
|
1533
|
-
const
|
|
1534
|
-
if (
|
|
1878
|
+
const { element, elementType } = useSelectedElement();
|
|
1879
|
+
const controlReplacement = getControlReplacement();
|
|
1880
|
+
const menuItems = useMenuItems().default;
|
|
1881
|
+
if (!element || !elementType) {
|
|
1535
1882
|
return null;
|
|
1536
1883
|
}
|
|
1537
|
-
const panelTitle =
|
|
1538
|
-
return /* @__PURE__ */
|
|
1884
|
+
const panelTitle = __38("Edit %s", "elementor").replace("%s", elementType.title);
|
|
1885
|
+
return /* @__PURE__ */ React66.createElement(ErrorBoundary2, { fallback: /* @__PURE__ */ React66.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React66.createElement(Panel, null, /* @__PURE__ */ React66.createElement(PanelHeader, null, /* @__PURE__ */ React66.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React66.createElement(PanelBody, null, /* @__PURE__ */ React66.createElement(ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React66.createElement(ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React66.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React66.createElement(EditingPanelTabs, null)))))));
|
|
1539
1886
|
};
|
|
1540
1887
|
|
|
1541
1888
|
// src/panel.ts
|
|
@@ -1548,6 +1895,7 @@ var { panel, usePanelActions, usePanelStatus } = createPanel({
|
|
|
1548
1895
|
import { injectIntoLogic } from "@elementor/editor";
|
|
1549
1896
|
|
|
1550
1897
|
// src/sync/should-use-v2-panel.ts
|
|
1898
|
+
import { getSelectedElements, getWidgetsCache } from "@elementor/editor-elements";
|
|
1551
1899
|
var shouldUseV2Panel = () => {
|
|
1552
1900
|
const selectedElements = getSelectedElements();
|
|
1553
1901
|
const widgetCache = getWidgetsCache();
|
|
@@ -1582,11 +1930,33 @@ import { __registerPanel as registerPanel } from "@elementor/editor-panels";
|
|
|
1582
1930
|
import { __privateBlockDataCommand as blockDataCommand } from "@elementor/editor-v1-adapters";
|
|
1583
1931
|
|
|
1584
1932
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1585
|
-
import * as
|
|
1586
|
-
import { useId as
|
|
1933
|
+
import * as React69 from "react";
|
|
1934
|
+
import { useId as useId6 } from "react";
|
|
1935
|
+
import { __ as __40 } from "@wordpress/i18n";
|
|
1936
|
+
import { DatabaseIcon, SettingsIcon, XIcon as XIcon3 } from "@elementor/icons";
|
|
1937
|
+
import {
|
|
1938
|
+
bindPopover as bindPopover4,
|
|
1939
|
+
bindTrigger as bindTrigger3,
|
|
1940
|
+
Box as Box5,
|
|
1941
|
+
IconButton as IconButton5,
|
|
1942
|
+
Paper,
|
|
1943
|
+
Popover as Popover4,
|
|
1944
|
+
Stack as Stack25,
|
|
1945
|
+
Typography as Typography6,
|
|
1946
|
+
UnstableTag as Tag,
|
|
1947
|
+
usePopupState as usePopupState5,
|
|
1948
|
+
Tabs as Tabs2,
|
|
1949
|
+
Divider as Divider6,
|
|
1950
|
+
useTabs as useTabs2,
|
|
1951
|
+
Tab as Tab2,
|
|
1952
|
+
TabPanel as TabPanel2
|
|
1953
|
+
} from "@elementor/ui";
|
|
1587
1954
|
|
|
1588
1955
|
// src/dynamics/dynamic-control.tsx
|
|
1589
|
-
import * as
|
|
1956
|
+
import * as React67 from "react";
|
|
1957
|
+
|
|
1958
|
+
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
1959
|
+
import { useMemo as useMemo2 } from "react";
|
|
1590
1960
|
|
|
1591
1961
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1592
1962
|
import { useMemo } from "react";
|
|
@@ -1609,17 +1979,8 @@ var getAtomicDynamicTags = () => {
|
|
|
1609
1979
|
};
|
|
1610
1980
|
};
|
|
1611
1981
|
|
|
1612
|
-
// src/props/is-transformable.ts
|
|
1613
|
-
import { z } from "@elementor/schema";
|
|
1614
|
-
var transformableSchema = z.object({
|
|
1615
|
-
$$type: z.string(),
|
|
1616
|
-
value: z.any()
|
|
1617
|
-
});
|
|
1618
|
-
var isTransformable = (value) => {
|
|
1619
|
-
return transformableSchema.safeParse(value).success;
|
|
1620
|
-
};
|
|
1621
|
-
|
|
1622
1982
|
// src/dynamics/utils.ts
|
|
1983
|
+
import { isTransformable } from "@elementor/editor-props";
|
|
1623
1984
|
var DYNAMIC_PROP_TYPE_KEY = "dynamic";
|
|
1624
1985
|
var isDynamicPropType = (prop) => prop.key === DYNAMIC_PROP_TYPE_KEY;
|
|
1625
1986
|
var getDynamicPropType = (propType) => {
|
|
@@ -1636,7 +1997,7 @@ var supportsDynamic = (propType) => {
|
|
|
1636
1997
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1637
1998
|
var usePropDynamicTags = (propName) => {
|
|
1638
1999
|
let categories = [];
|
|
1639
|
-
const { elementType } =
|
|
2000
|
+
const { elementType } = useElement();
|
|
1640
2001
|
const propType = elementType.propsSchema?.[propName];
|
|
1641
2002
|
if (propType) {
|
|
1642
2003
|
const propDynamicType = getDynamicPropType(propType);
|
|
@@ -1656,7 +2017,6 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
1656
2017
|
};
|
|
1657
2018
|
|
|
1658
2019
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
1659
|
-
import { useMemo as useMemo2 } from "react";
|
|
1660
2020
|
var useDynamicTag = (propName, tagName) => {
|
|
1661
2021
|
const dynamicTags = usePropDynamicTags(propName);
|
|
1662
2022
|
return useMemo2(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
@@ -1664,7 +2024,7 @@ var useDynamicTag = (propName, tagName) => {
|
|
|
1664
2024
|
|
|
1665
2025
|
// src/dynamics/dynamic-control.tsx
|
|
1666
2026
|
var DynamicControl = ({ bind, children }) => {
|
|
1667
|
-
const { value, setValue, bind: propName } =
|
|
2027
|
+
const { value, setValue, bind: propName } = useBoundProp();
|
|
1668
2028
|
const { name = "", settings } = value?.value ?? {};
|
|
1669
2029
|
const dynamicTag = useDynamicTag(propName, name);
|
|
1670
2030
|
if (!dynamicTag) {
|
|
@@ -1684,35 +2044,32 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
1684
2044
|
}
|
|
1685
2045
|
});
|
|
1686
2046
|
};
|
|
1687
|
-
return /* @__PURE__ */
|
|
2047
|
+
return /* @__PURE__ */ React67.createElement(BoundPropProvider, { setValue: setDynamicValue, value: dynamicValue, bind }, children);
|
|
1688
2048
|
};
|
|
1689
2049
|
|
|
1690
|
-
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1691
|
-
import { DatabaseIcon, SettingsIcon, XIcon as XIcon3 } from "@elementor/icons";
|
|
1692
|
-
|
|
1693
2050
|
// src/dynamics/components/dynamic-selection.tsx
|
|
1694
|
-
import * as
|
|
1695
|
-
import { useState as
|
|
2051
|
+
import * as React68 from "react";
|
|
2052
|
+
import { useState as useState6, Fragment as Fragment7 } from "react";
|
|
1696
2053
|
import { SearchIcon, PhotoIcon } from "@elementor/icons";
|
|
1697
2054
|
import {
|
|
1698
|
-
Box as
|
|
1699
|
-
Divider as
|
|
2055
|
+
Box as Box4,
|
|
2056
|
+
Divider as Divider5,
|
|
1700
2057
|
InputAdornment as InputAdornment3,
|
|
1701
2058
|
Link,
|
|
1702
2059
|
ListSubheader,
|
|
1703
2060
|
MenuItem as MenuItem3,
|
|
1704
2061
|
MenuList,
|
|
1705
|
-
Stack as
|
|
2062
|
+
Stack as Stack24,
|
|
1706
2063
|
TextField as TextField5,
|
|
1707
|
-
Typography as
|
|
2064
|
+
Typography as Typography5
|
|
1708
2065
|
} from "@elementor/ui";
|
|
1709
|
-
import { __ as
|
|
2066
|
+
import { __ as __39 } from "@wordpress/i18n";
|
|
1710
2067
|
|
|
1711
2068
|
// src/dynamics/hooks/use-prop-value-history.ts
|
|
1712
2069
|
var PROPS_VALUES_HISTORY_KEY = "elementor/dynamic/non-dynamic-values-history";
|
|
1713
2070
|
var usePropValueHistory = (path) => {
|
|
1714
2071
|
const valuesHistory = getValues();
|
|
1715
|
-
const { element } =
|
|
2072
|
+
const { element } = useElement();
|
|
1716
2073
|
const key = `${element.id}-${path}`;
|
|
1717
2074
|
const value = valuesHistory[key] ?? null;
|
|
1718
2075
|
const setValue = (newValue) => {
|
|
@@ -1728,14 +2085,14 @@ var setValues = (values) => {
|
|
|
1728
2085
|
};
|
|
1729
2086
|
|
|
1730
2087
|
// src/dynamics/components/dynamic-selection.tsx
|
|
1731
|
-
var
|
|
2088
|
+
var SIZE4 = "tiny";
|
|
1732
2089
|
var DynamicSelection = ({ onSelect }) => {
|
|
1733
|
-
const [searchValue, setSearchValue] =
|
|
2090
|
+
const [searchValue, setSearchValue] = useState6("");
|
|
1734
2091
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
1735
|
-
const { bind, value: currentValue, setValue } =
|
|
2092
|
+
const { bind, value: currentValue, setValue } = useBoundProp();
|
|
1736
2093
|
const [, updatePropValueHistory] = usePropValueHistory(bind);
|
|
1737
2094
|
const isCurrentValueDynamic = isDynamicPropValue(currentValue);
|
|
1738
|
-
const
|
|
2095
|
+
const options5 = useFilteredOptions(bind, searchValue);
|
|
1739
2096
|
const handleSearch = (event) => {
|
|
1740
2097
|
setSearchValue(event.target.value);
|
|
1741
2098
|
};
|
|
@@ -1746,21 +2103,21 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
1746
2103
|
setValue({ $$type: "dynamic", value: { name: value, settings: {} } });
|
|
1747
2104
|
onSelect?.();
|
|
1748
2105
|
};
|
|
1749
|
-
return /* @__PURE__ */
|
|
2106
|
+
return /* @__PURE__ */ React68.createElement(Stack24, null, /* @__PURE__ */ React68.createElement(Box4, { px: 1.5, pb: 1 }, /* @__PURE__ */ React68.createElement(
|
|
1750
2107
|
TextField5,
|
|
1751
2108
|
{
|
|
1752
2109
|
fullWidth: true,
|
|
1753
|
-
size:
|
|
2110
|
+
size: SIZE4,
|
|
1754
2111
|
value: searchValue,
|
|
1755
2112
|
onChange: handleSearch,
|
|
1756
|
-
placeholder:
|
|
2113
|
+
placeholder: __39("Search dynamic tag", "elementor"),
|
|
1757
2114
|
InputProps: {
|
|
1758
|
-
startAdornment: /* @__PURE__ */
|
|
2115
|
+
startAdornment: /* @__PURE__ */ React68.createElement(InputAdornment3, { position: "start" }, /* @__PURE__ */ React68.createElement(SearchIcon, { fontSize: SIZE4 }))
|
|
1759
2116
|
}
|
|
1760
2117
|
}
|
|
1761
|
-
)), /* @__PURE__ */
|
|
2118
|
+
)), /* @__PURE__ */ React68.createElement(Divider5, null), /* @__PURE__ */ React68.createElement(Box4, { sx: { overflowY: "auto", height: 260, width: 220 } }, options5.length > 0 ? /* @__PURE__ */ React68.createElement(MenuList, { role: "listbox", tabIndex: 0 }, options5.map(([category, items], index) => /* @__PURE__ */ React68.createElement(Fragment7, { key: index }, /* @__PURE__ */ React68.createElement(ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items.map(({ value, label: tagLabel }) => {
|
|
1762
2119
|
const isSelected = isCurrentValueDynamic && value === currentValue?.value?.name;
|
|
1763
|
-
return /* @__PURE__ */
|
|
2120
|
+
return /* @__PURE__ */ React68.createElement(
|
|
1764
2121
|
MenuItem3,
|
|
1765
2122
|
{
|
|
1766
2123
|
key: value,
|
|
@@ -1771,7 +2128,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
1771
2128
|
},
|
|
1772
2129
|
tagLabel
|
|
1773
2130
|
);
|
|
1774
|
-
})))) : /* @__PURE__ */
|
|
2131
|
+
})))) : /* @__PURE__ */ React68.createElement(Stack24, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React68.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React68.createElement(Typography5, { align: "center", variant: "caption", color: "text.secondary" }, __39("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React68.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React68.createElement(Typography5, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React68.createElement(
|
|
1775
2132
|
Link,
|
|
1776
2133
|
{
|
|
1777
2134
|
color: "secondary",
|
|
@@ -1779,12 +2136,12 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
1779
2136
|
component: "button",
|
|
1780
2137
|
onClick: () => setSearchValue("")
|
|
1781
2138
|
},
|
|
1782
|
-
|
|
1783
|
-
), "\xA0",
|
|
2139
|
+
__39("Clear the filters", "elementor")
|
|
2140
|
+
), "\xA0", __39("and try again.", "elementor")))));
|
|
1784
2141
|
};
|
|
1785
2142
|
var useFilteredOptions = (bind, searchValue) => {
|
|
1786
2143
|
const dynamicTags = usePropDynamicTags(bind);
|
|
1787
|
-
const
|
|
2144
|
+
const options5 = dynamicTags.reduce((categories, { name, label, group }) => {
|
|
1788
2145
|
const isVisible = label.toLowerCase().includes(searchValue.trim().toLowerCase());
|
|
1789
2146
|
if (!isVisible) {
|
|
1790
2147
|
return categories;
|
|
@@ -1795,35 +2152,17 @@ var useFilteredOptions = (bind, searchValue) => {
|
|
|
1795
2152
|
categories.get(group)?.push({ label, value: name });
|
|
1796
2153
|
return categories;
|
|
1797
2154
|
}, /* @__PURE__ */ new Map());
|
|
1798
|
-
return [...
|
|
2155
|
+
return [...options5];
|
|
1799
2156
|
};
|
|
1800
2157
|
|
|
1801
2158
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1802
|
-
|
|
1803
|
-
bindPopover as bindPopover3,
|
|
1804
|
-
bindTrigger as bindTrigger3,
|
|
1805
|
-
Box as Box4,
|
|
1806
|
-
IconButton as IconButton3,
|
|
1807
|
-
Paper,
|
|
1808
|
-
Popover as Popover3,
|
|
1809
|
-
Stack as Stack18,
|
|
1810
|
-
Typography as Typography5,
|
|
1811
|
-
UnstableTag as Tag,
|
|
1812
|
-
usePopupState as usePopupState4,
|
|
1813
|
-
Tabs as Tabs2,
|
|
1814
|
-
Divider as Divider4,
|
|
1815
|
-
useTabs as useTabs2,
|
|
1816
|
-
Tab as Tab2,
|
|
1817
|
-
TabPanel as TabPanel2
|
|
1818
|
-
} from "@elementor/ui";
|
|
1819
|
-
import { __ as __25 } from "@wordpress/i18n";
|
|
1820
|
-
var SIZE4 = "tiny";
|
|
2159
|
+
var SIZE5 = "tiny";
|
|
1821
2160
|
var DynamicSelectionControl = () => {
|
|
1822
|
-
const { bind, value, setValue } =
|
|
2161
|
+
const { bind, value, setValue } = useBoundProp();
|
|
1823
2162
|
const [propValueFromHistory] = usePropValueHistory(bind);
|
|
1824
2163
|
const { name: tagName = "" } = value?.value || {};
|
|
1825
|
-
const selectionPopoverId =
|
|
1826
|
-
const selectionPopoverState =
|
|
2164
|
+
const selectionPopoverId = useId6();
|
|
2165
|
+
const selectionPopoverState = usePopupState5({ variant: "popover", popupId: selectionPopoverId });
|
|
1827
2166
|
const dynamicTag = useDynamicTag(bind, tagName);
|
|
1828
2167
|
const removeDynamicTag = () => {
|
|
1829
2168
|
setValue(propValueFromHistory ?? null);
|
|
@@ -1831,58 +2170,58 @@ var DynamicSelectionControl = () => {
|
|
|
1831
2170
|
if (!dynamicTag) {
|
|
1832
2171
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
1833
2172
|
}
|
|
1834
|
-
return /* @__PURE__ */
|
|
2173
|
+
return /* @__PURE__ */ React69.createElement(Box5, null, /* @__PURE__ */ React69.createElement(
|
|
1835
2174
|
Tag,
|
|
1836
2175
|
{
|
|
1837
2176
|
fullWidth: true,
|
|
1838
2177
|
showActionsOnHover: true,
|
|
1839
2178
|
label: dynamicTag.label,
|
|
1840
|
-
startIcon: /* @__PURE__ */
|
|
2179
|
+
startIcon: /* @__PURE__ */ React69.createElement(DatabaseIcon, { fontSize: SIZE5 }),
|
|
1841
2180
|
...bindTrigger3(selectionPopoverState),
|
|
1842
|
-
actions: /* @__PURE__ */
|
|
1843
|
-
|
|
2181
|
+
actions: /* @__PURE__ */ React69.createElement(React69.Fragment, null, /* @__PURE__ */ React69.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React69.createElement(
|
|
2182
|
+
IconButton5,
|
|
1844
2183
|
{
|
|
1845
|
-
size:
|
|
2184
|
+
size: SIZE5,
|
|
1846
2185
|
onClick: removeDynamicTag,
|
|
1847
|
-
"aria-label":
|
|
2186
|
+
"aria-label": __40("Remove dynamic value", "elementor")
|
|
1848
2187
|
},
|
|
1849
|
-
/* @__PURE__ */
|
|
2188
|
+
/* @__PURE__ */ React69.createElement(XIcon3, { fontSize: SIZE5 })
|
|
1850
2189
|
))
|
|
1851
2190
|
}
|
|
1852
|
-
), /* @__PURE__ */
|
|
1853
|
-
|
|
2191
|
+
), /* @__PURE__ */ React69.createElement(
|
|
2192
|
+
Popover4,
|
|
1854
2193
|
{
|
|
1855
2194
|
disablePortal: true,
|
|
1856
2195
|
disableScrollLock: true,
|
|
1857
2196
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1858
|
-
...
|
|
2197
|
+
...bindPopover4(selectionPopoverState)
|
|
1859
2198
|
},
|
|
1860
|
-
/* @__PURE__ */
|
|
2199
|
+
/* @__PURE__ */ React69.createElement(Stack25, null, /* @__PURE__ */ React69.createElement(Stack25, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React69.createElement(DatabaseIcon, { fontSize: SIZE5, sx: { mr: 0.5 } }), /* @__PURE__ */ React69.createElement(Typography6, { variant: "subtitle2" }, __40("Dynamic Tags", "elementor")), /* @__PURE__ */ React69.createElement(IconButton5, { size: SIZE5, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React69.createElement(XIcon3, { fontSize: SIZE5 }))), /* @__PURE__ */ React69.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
1861
2200
|
));
|
|
1862
2201
|
};
|
|
1863
2202
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
1864
|
-
const popupId =
|
|
1865
|
-
const settingsPopupState =
|
|
2203
|
+
const popupId = useId6();
|
|
2204
|
+
const settingsPopupState = usePopupState5({ variant: "popover", popupId });
|
|
1866
2205
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
1867
2206
|
if (!hasDynamicSettings) {
|
|
1868
2207
|
return null;
|
|
1869
2208
|
}
|
|
1870
|
-
return /* @__PURE__ */
|
|
1871
|
-
|
|
2209
|
+
return /* @__PURE__ */ React69.createElement(React69.Fragment, null, /* @__PURE__ */ React69.createElement(
|
|
2210
|
+
IconButton5,
|
|
1872
2211
|
{
|
|
1873
|
-
size:
|
|
2212
|
+
size: SIZE5,
|
|
1874
2213
|
...bindTrigger3(settingsPopupState),
|
|
1875
|
-
"aria-label":
|
|
2214
|
+
"aria-label": __40("Settings", "elementor")
|
|
1876
2215
|
},
|
|
1877
|
-
/* @__PURE__ */
|
|
1878
|
-
), /* @__PURE__ */
|
|
1879
|
-
|
|
2216
|
+
/* @__PURE__ */ React69.createElement(SettingsIcon, { fontSize: SIZE5 })
|
|
2217
|
+
), /* @__PURE__ */ React69.createElement(
|
|
2218
|
+
Popover4,
|
|
1880
2219
|
{
|
|
1881
2220
|
disableScrollLock: true,
|
|
1882
2221
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
1883
|
-
...
|
|
2222
|
+
...bindPopover4(settingsPopupState)
|
|
1884
2223
|
},
|
|
1885
|
-
/* @__PURE__ */
|
|
2224
|
+
/* @__PURE__ */ React69.createElement(Paper, { component: Stack25, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React69.createElement(Stack25, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React69.createElement(DatabaseIcon, { fontSize: SIZE5, sx: { mr: 0.5 } }), /* @__PURE__ */ React69.createElement(Typography6, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React69.createElement(IconButton5, { sx: { ml: "auto" }, size: SIZE5, onClick: settingsPopupState.close }, /* @__PURE__ */ React69.createElement(XIcon3, { fontSize: SIZE5 }))), /* @__PURE__ */ React69.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
1886
2225
|
));
|
|
1887
2226
|
};
|
|
1888
2227
|
var DynamicSettings = ({ controls }) => {
|
|
@@ -1891,10 +2230,10 @@ var DynamicSettings = ({ controls }) => {
|
|
|
1891
2230
|
if (!tabs.length) {
|
|
1892
2231
|
return null;
|
|
1893
2232
|
}
|
|
1894
|
-
return /* @__PURE__ */
|
|
1895
|
-
return /* @__PURE__ */
|
|
2233
|
+
return /* @__PURE__ */ React69.createElement(React69.Fragment, null, /* @__PURE__ */ React69.createElement(Tabs2, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React69.createElement(Tab2, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React69.createElement(Divider6, null), tabs.map(({ value }, index) => {
|
|
2234
|
+
return /* @__PURE__ */ React69.createElement(TabPanel2, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React69.createElement(Stack25, { gap: 1, px: 2 }, value.items.map((item) => {
|
|
1896
2235
|
if (item.type === "control") {
|
|
1897
|
-
return /* @__PURE__ */
|
|
2236
|
+
return /* @__PURE__ */ React69.createElement(Control6, { key: item.value.bind, control: item.value });
|
|
1898
2237
|
}
|
|
1899
2238
|
return null;
|
|
1900
2239
|
})));
|
|
@@ -1904,28 +2243,27 @@ var Control6 = ({ control }) => {
|
|
|
1904
2243
|
if (!getControlByType(control.type)) {
|
|
1905
2244
|
return null;
|
|
1906
2245
|
}
|
|
1907
|
-
return /* @__PURE__ */
|
|
2246
|
+
return /* @__PURE__ */ React69.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React69.createElement(ControlLabel, null, control.label) : null, /* @__PURE__ */ React69.createElement(Control3, { type: control.type, props: control.props }));
|
|
1908
2247
|
};
|
|
1909
2248
|
|
|
1910
2249
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
1911
|
-
import * as
|
|
2250
|
+
import * as React70 from "react";
|
|
2251
|
+
import { __ as __41 } from "@wordpress/i18n";
|
|
1912
2252
|
import { DatabaseIcon as DatabaseIcon2 } from "@elementor/icons";
|
|
1913
|
-
import { __ as __26 } from "@wordpress/i18n";
|
|
1914
2253
|
var usePropDynamicAction = () => {
|
|
1915
|
-
const { bind } =
|
|
1916
|
-
const { elementType } =
|
|
2254
|
+
const { bind } = useBoundProp();
|
|
2255
|
+
const { elementType } = useElement();
|
|
1917
2256
|
const propType = elementType.propsSchema[bind];
|
|
1918
2257
|
const visible = !!propType && supportsDynamic(propType);
|
|
1919
2258
|
return {
|
|
1920
2259
|
visible,
|
|
1921
2260
|
icon: DatabaseIcon2,
|
|
1922
|
-
title:
|
|
1923
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
2261
|
+
title: __41("Dynamic Tags", "elementor"),
|
|
2262
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React70.createElement(DynamicSelection, { onSelect: closePopover })
|
|
1924
2263
|
};
|
|
1925
2264
|
};
|
|
1926
2265
|
|
|
1927
2266
|
// src/dynamics/init.ts
|
|
1928
|
-
var { registerPopoverAction } = controlActionsMenu;
|
|
1929
2267
|
var init = () => {
|
|
1930
2268
|
replaceControl({
|
|
1931
2269
|
component: DynamicSelectionControl,
|
|
@@ -1957,8 +2295,7 @@ var blockV1Panel = () => {
|
|
|
1957
2295
|
// src/index.ts
|
|
1958
2296
|
init2();
|
|
1959
2297
|
export {
|
|
1960
|
-
controlActionsMenu,
|
|
1961
2298
|
replaceControl,
|
|
1962
|
-
|
|
2299
|
+
useBoundProp
|
|
1963
2300
|
};
|
|
1964
2301
|
//# sourceMappingURL=index.mjs.map
|