@elementor/editor-editing-panel 1.0.0 → 1.1.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 +46 -0
- package/dist/index.d.mts +10 -19
- package/dist/index.d.ts +10 -19
- package/dist/index.js +1283 -1751
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1305 -1762
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
- package/src/components/add-or-remove-content.tsx +3 -3
- package/src/components/collapse-icon.tsx +12 -0
- package/src/components/collapsible-content.tsx +5 -14
- package/src/components/collapsible-field.tsx +5 -3
- package/src/components/css-class-selector-section.tsx +76 -0
- package/src/components/editing-panel-hooks.tsx +2 -0
- package/src/components/editing-panel-tabs.tsx +23 -13
- package/src/components/editing-panel.tsx +9 -6
- package/src/components/multi-combobox/index.ts +3 -0
- package/src/components/multi-combobox/multi-combobox.tsx +120 -0
- package/src/components/multi-combobox/types.ts +26 -0
- package/src/components/multi-combobox/use-combobox-actions.ts +62 -0
- package/src/components/section.tsx +37 -0
- package/src/components/sections-list.tsx +6 -0
- package/src/components/settings-tab.tsx +11 -11
- package/src/components/style-sections/background-section/background-color-field.tsx +4 -4
- package/src/components/style-sections/background-section/background-section.tsx +9 -7
- package/src/components/style-sections/border-section/border-color-field.tsx +4 -4
- package/src/components/style-sections/border-section/border-field.tsx +4 -3
- package/src/components/style-sections/border-section/border-radius-field.tsx +4 -3
- package/src/components/style-sections/border-section/border-section.tsx +7 -10
- package/src/components/style-sections/border-section/border-style-field.tsx +4 -4
- package/src/components/style-sections/border-section/border-width-field.tsx +4 -3
- package/src/components/style-sections/effects-section/effects-section.tsx +7 -10
- package/src/components/style-sections/layout-section/display-field.tsx +32 -0
- package/src/components/style-sections/layout-section/justify-content-field.tsx +82 -0
- package/src/components/style-sections/layout-section/layout-section.tsx +17 -0
- package/src/components/style-sections/layout-section/utils/rotate-flex-icon.ts +12 -0
- package/src/components/style-sections/position-section/dimensions-field.tsx +6 -6
- package/src/components/style-sections/position-section/position-field.tsx +4 -4
- package/src/components/style-sections/position-section/position-section.tsx +45 -15
- package/src/components/style-sections/position-section/z-index-field.tsx +4 -4
- package/src/components/style-sections/size-section/overflow-field.tsx +8 -8
- package/src/components/style-sections/size-section/size-section.tsx +33 -26
- package/src/components/style-sections/spacing-section/spacing-section.tsx +11 -13
- package/src/components/style-sections/typography-section/font-family-field.tsx +40 -0
- package/src/components/style-sections/typography-section/font-size-field.tsx +4 -4
- package/src/components/style-sections/typography-section/font-weight-field.tsx +4 -4
- package/src/components/style-sections/typography-section/letter-spacing-field.tsx +4 -4
- package/src/components/style-sections/typography-section/text-alignment-field.tsx +9 -9
- package/src/components/style-sections/typography-section/text-color-field.tsx +4 -4
- package/src/components/style-sections/typography-section/text-direction-field.tsx +7 -7
- package/src/components/style-sections/typography-section/text-stroke-field.tsx +3 -3
- package/src/components/style-sections/typography-section/text-style-field.tsx +5 -4
- package/src/components/style-sections/typography-section/transform-field.tsx +23 -9
- package/src/components/style-sections/typography-section/typography-section.tsx +26 -27
- package/src/components/style-sections/typography-section/word-spacing-field.tsx +4 -4
- package/src/components/style-tab.tsx +67 -31
- package/src/contexts/classes-prop-context.tsx +1 -1
- package/src/contexts/element-context.tsx +2 -2
- package/src/contexts/style-context.tsx +6 -5
- package/src/control-replacement.tsx +1 -1
- package/src/controls-actions.ts +3 -2
- package/src/controls-registry/control-type-container.tsx +3 -2
- package/src/controls-registry/control.tsx +2 -1
- package/src/controls-registry/controls-registry.tsx +8 -1
- package/src/controls-registry/settings-field.tsx +5 -4
- package/src/controls-registry/styles-field.tsx +3 -2
- package/src/dynamics/components/dynamic-selection-control.tsx +15 -14
- package/src/dynamics/components/dynamic-selection.tsx +9 -8
- package/src/dynamics/dynamic-control.tsx +4 -4
- package/src/dynamics/hooks/use-dynamic-tag.ts +3 -2
- package/src/dynamics/hooks/use-prop-dynamic-action.tsx +6 -5
- package/src/dynamics/hooks/use-prop-dynamic-tags.ts +3 -2
- package/src/dynamics/init.ts +5 -3
- package/src/dynamics/sync/get-elementor-config.ts +1 -1
- package/src/dynamics/types.ts +2 -2
- package/src/dynamics/utils.ts +3 -2
- package/src/hooks/use-close-editor-panel.ts +23 -0
- package/src/hooks/use-direction.ts +13 -0
- package/src/hooks/use-open-editor-panel.ts +4 -3
- package/src/hooks/use-prop-value-history.ts +45 -0
- package/src/hooks/use-style-prop-history.ts +75 -0
- package/src/hooks/use-styles-field.ts +25 -4
- package/src/index.ts +1 -1
- package/src/init.ts +5 -4
- package/src/panel.ts +1 -0
- package/src/popover-action.tsx +1 -1
- package/src/sync/enqueue-font.ts +7 -0
- package/src/sync/get-elementor-config.ts +7 -0
- package/src/sync/{should-use-v2-panel.ts → is-atomic-widget-selected.ts} +1 -1
- package/src/sync/types.ts +20 -21
- package/src/components/accordion-section.tsx +0 -26
- package/src/components/control-label.tsx +0 -10
- package/src/controls/bound-prop-context.tsx +0 -30
- package/src/controls/components/control-toggle-button-group.tsx +0 -68
- package/src/controls/components/repeater.tsx +0 -197
- package/src/controls/components/text-field-inner-selection.tsx +0 -75
- package/src/controls/control-actions/control-actions-context.tsx +0 -27
- package/src/controls/control-actions/control-actions-menu.ts +0 -7
- package/src/controls/control-actions/control-actions.tsx +0 -31
- package/src/controls/controls/box-shadow-repeater-control.tsx +0 -210
- package/src/controls/controls/color-control.tsx +0 -25
- package/src/controls/controls/equal-unequal-sizes-control.tsx +0 -196
- package/src/controls/controls/image-control.tsx +0 -58
- package/src/controls/controls/image-media-control.tsx +0 -64
- package/src/controls/controls/linked-dimensions-control.tsx +0 -139
- package/src/controls/controls/number-control.tsx +0 -29
- package/src/controls/controls/select-control.tsx +0 -30
- package/src/controls/controls/size-control.tsx +0 -71
- package/src/controls/controls/stroke-control.tsx +0 -105
- package/src/controls/controls/text-area-control.tsx +0 -31
- package/src/controls/controls/text-control.tsx +0 -17
- package/src/controls/controls/toggle-control.tsx +0 -26
- package/src/controls/create-control-replacement.tsx +0 -53
- package/src/controls/create-control.tsx +0 -40
- package/src/controls/hooks/use-sync-external-state.tsx +0 -51
- package/src/controls/index.ts +0 -24
- package/src/dynamics/hooks/use-prop-value-history.ts +0 -26
package/dist/index.mjs
CHANGED
|
@@ -1,885 +1,121 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import
|
|
3
|
-
import { __ as __2 } from "@wordpress/i18n";
|
|
4
|
-
|
|
5
|
-
// src/controls/bound-prop-context.tsx
|
|
6
|
-
import * as React from "react";
|
|
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");
|
|
16
|
-
}
|
|
17
|
-
return { ...boundPropContext, value: boundPropContext.value ?? defaultValue };
|
|
18
|
-
}
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { useBoundProp as useBoundProp5 } from "@elementor/editor-controls";
|
|
19
3
|
|
|
20
|
-
// src/
|
|
21
|
-
import {
|
|
4
|
+
// src/control-replacement.tsx
|
|
5
|
+
import { createControlReplacement } from "@elementor/editor-controls";
|
|
6
|
+
var { replaceControl, getControlReplacement } = createControlReplacement();
|
|
22
7
|
|
|
23
|
-
// src/
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { Button, Card, CardMedia, CardOverlay, Stack } from "@elementor/ui";
|
|
28
|
-
import { useWpMediaAttachment, useWpMediaFrame } from "@elementor/wp-media";
|
|
8
|
+
// src/init.ts
|
|
9
|
+
import { injectIntoLogic } from "@elementor/editor";
|
|
10
|
+
import { __registerPanel as registerPanel } from "@elementor/editor-panels";
|
|
11
|
+
import { __privateBlockDataCommand as blockDataCommand } from "@elementor/editor-v1-adapters";
|
|
29
12
|
|
|
30
|
-
// src/
|
|
31
|
-
import
|
|
32
|
-
import {
|
|
13
|
+
// src/hooks/use-close-editor-panel.ts
|
|
14
|
+
import { useEffect as useEffect2 } from "react";
|
|
15
|
+
import { getSelectedElements as getSelectedElements2, isElementInContainer } from "@elementor/editor-elements";
|
|
16
|
+
import { __privateListenTo as listenTo, commandStartEvent } from "@elementor/editor-v1-adapters";
|
|
33
17
|
|
|
34
|
-
// src/
|
|
35
|
-
import
|
|
36
|
-
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
37
|
-
var Context = createContext2(null);
|
|
38
|
-
var ControlActionsProvider = ({ children, items }) => /* @__PURE__ */ React2.createElement(Context.Provider, { value: { items } }, children);
|
|
39
|
-
var useControlActions = () => {
|
|
40
|
-
const context = useContext2(Context);
|
|
41
|
-
if (!context) {
|
|
42
|
-
throw new Error("useControlActions must be used within a ControlActionsProvider");
|
|
43
|
-
}
|
|
44
|
-
return context;
|
|
45
|
-
};
|
|
18
|
+
// src/panel.ts
|
|
19
|
+
import { __createPanel as createPanel } from "@elementor/editor-panels";
|
|
46
20
|
|
|
47
|
-
// src/
|
|
48
|
-
|
|
49
|
-
|
|
21
|
+
// src/components/editing-panel.tsx
|
|
22
|
+
import * as React51 from "react";
|
|
23
|
+
import { ControlActionsProvider, ControlReplacementProvider } from "@elementor/editor-controls";
|
|
24
|
+
import { useSelectedElement } from "@elementor/editor-elements";
|
|
25
|
+
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
26
|
+
import { ErrorBoundary } from "@elementor/ui";
|
|
27
|
+
import { __ as __31 } from "@wordpress/i18n";
|
|
50
28
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
function
|
|
56
|
-
|
|
57
|
-
if (items.length === 0) {
|
|
58
|
-
return children;
|
|
59
|
-
}
|
|
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));
|
|
29
|
+
// src/contexts/element-context.tsx
|
|
30
|
+
import * as React from "react";
|
|
31
|
+
import { createContext, useContext } from "react";
|
|
32
|
+
var Context = createContext(null);
|
|
33
|
+
function ElementProvider({ children, element, elementType }) {
|
|
34
|
+
return /* @__PURE__ */ React.createElement(Context.Provider, { value: { element, elementType } }, children);
|
|
62
35
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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;
|
|
36
|
+
function useElement() {
|
|
37
|
+
const context = useContext(Context);
|
|
38
|
+
if (!context) {
|
|
39
|
+
throw new Error("useElement must be used within a ElementProvider");
|
|
95
40
|
}
|
|
96
|
-
return
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
// src/controls/create-control.tsx
|
|
100
|
-
import { ErrorBoundary } from "@elementor/ui";
|
|
101
|
-
var brandSymbol = Symbol("control");
|
|
102
|
-
function createControl(Component, { supportsReplacements = true } = {}) {
|
|
103
|
-
return (props) => {
|
|
104
|
-
const ControlReplacement = useControlReplacement();
|
|
105
|
-
if (ControlReplacement && supportsReplacements) {
|
|
106
|
-
return /* @__PURE__ */ React5.createElement(ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(ControlReplacement, { ...props }));
|
|
107
|
-
}
|
|
108
|
-
return /* @__PURE__ */ React5.createElement(ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(Component, { ...props }));
|
|
109
|
-
};
|
|
41
|
+
return context;
|
|
110
42
|
}
|
|
111
43
|
|
|
112
|
-
// src/controls
|
|
113
|
-
|
|
114
|
-
const { value, setValue } = useBoundProp();
|
|
115
|
-
const { id, url } = value?.value ?? {};
|
|
116
|
-
const { data: attachment } = useWpMediaAttachment(id?.value || null);
|
|
117
|
-
const src = attachment?.url ?? url;
|
|
118
|
-
const { open } = useWpMediaFrame({
|
|
119
|
-
types: ["image"],
|
|
120
|
-
multiple: false,
|
|
121
|
-
selected: id?.value || null,
|
|
122
|
-
onSelect: (selectedAttachment) => {
|
|
123
|
-
setValue({
|
|
124
|
-
$$type: "image-src",
|
|
125
|
-
value: {
|
|
126
|
-
id: {
|
|
127
|
-
$$type: "image-attachment-id",
|
|
128
|
-
value: selectedAttachment.id
|
|
129
|
-
},
|
|
130
|
-
url: null
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
});
|
|
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(
|
|
136
|
-
Button,
|
|
137
|
-
{
|
|
138
|
-
size: "tiny",
|
|
139
|
-
color: "inherit",
|
|
140
|
-
variant: "outlined",
|
|
141
|
-
onClick: () => open({ mode: "browse" })
|
|
142
|
-
},
|
|
143
|
-
__("Select Image", "elementor")
|
|
144
|
-
), /* @__PURE__ */ React6.createElement(
|
|
145
|
-
Button,
|
|
146
|
-
{
|
|
147
|
-
size: "tiny",
|
|
148
|
-
variant: "text",
|
|
149
|
-
color: "inherit",
|
|
150
|
-
startIcon: /* @__PURE__ */ React6.createElement(UploadIcon, null),
|
|
151
|
-
onClick: () => open({ mode: "upload" })
|
|
152
|
-
},
|
|
153
|
-
__("Upload Image", "elementor")
|
|
154
|
-
)))));
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
// src/controls/controls/select-control.tsx
|
|
158
|
-
import * as React7 from "react";
|
|
159
|
-
import { MenuItem, Select } from "@elementor/ui";
|
|
160
|
-
var SelectControl = createControl(({ options: options5 }) => {
|
|
161
|
-
const { value, setValue } = useBoundProp();
|
|
162
|
-
const handleChange = (event) => {
|
|
163
|
-
setValue(event.target.value);
|
|
164
|
-
};
|
|
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))));
|
|
166
|
-
});
|
|
167
|
-
|
|
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
|
|
176
|
-
var ImageControl = createControl((props) => {
|
|
177
|
-
const { value, setValue } = useBoundProp();
|
|
178
|
-
const { src, size } = value?.value || {};
|
|
179
|
-
const setImageSrc = (newValue) => {
|
|
180
|
-
setValue({
|
|
181
|
-
$$type: "image",
|
|
182
|
-
value: {
|
|
183
|
-
src: newValue,
|
|
184
|
-
size
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
};
|
|
188
|
-
const setImageSize = (newValue) => {
|
|
189
|
-
setValue({
|
|
190
|
-
$$type: "image",
|
|
191
|
-
value: {
|
|
192
|
-
src,
|
|
193
|
-
size: newValue
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
};
|
|
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 })))));
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
// src/controls/controls/text-control.tsx
|
|
201
|
-
import * as React10 from "react";
|
|
202
|
-
import { TextField } from "@elementor/ui";
|
|
203
|
-
var TextControl = createControl(({ placeholder }) => {
|
|
204
|
-
const { value, setValue } = useBoundProp("");
|
|
205
|
-
const handleChange = (event) => setValue(event.target.value);
|
|
206
|
-
return /* @__PURE__ */ React10.createElement(ControlActions, null, /* @__PURE__ */ React10.createElement(TextField, { type: "text", size: "tiny", value, onChange: handleChange, placeholder }));
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
// src/controls/controls/text-area-control.tsx
|
|
210
|
-
import * as React11 from "react";
|
|
211
|
-
import { TextField as TextField2 } from "@elementor/ui";
|
|
212
|
-
var TextAreaControl = createControl(({ placeholder }) => {
|
|
213
|
-
const { value, setValue } = useBoundProp();
|
|
214
|
-
const handleChange = (event) => {
|
|
215
|
-
setValue(event.target.value);
|
|
216
|
-
};
|
|
217
|
-
return /* @__PURE__ */ React11.createElement(ControlActions, null, /* @__PURE__ */ React11.createElement(
|
|
218
|
-
TextField2,
|
|
219
|
-
{
|
|
220
|
-
size: "tiny",
|
|
221
|
-
multiline: true,
|
|
222
|
-
fullWidth: true,
|
|
223
|
-
rows: 5,
|
|
224
|
-
value,
|
|
225
|
-
onChange: handleChange,
|
|
226
|
-
placeholder
|
|
227
|
-
}
|
|
228
|
-
));
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
// src/controls/controls/size-control.tsx
|
|
232
|
-
import * as React13 from "react";
|
|
233
|
-
import { InputAdornment as InputAdornment2 } from "@elementor/ui";
|
|
234
|
-
|
|
235
|
-
// src/controls/hooks/use-sync-external-state.tsx
|
|
236
|
-
import { useEffect, useState } from "react";
|
|
237
|
-
var useSyncExternalState = ({
|
|
238
|
-
external,
|
|
239
|
-
setExternal,
|
|
240
|
-
persistWhen,
|
|
241
|
-
fallback
|
|
242
|
-
}) => {
|
|
243
|
-
function toExternal(internalValue) {
|
|
244
|
-
if (persistWhen(internalValue)) {
|
|
245
|
-
return internalValue;
|
|
246
|
-
}
|
|
247
|
-
return void 0;
|
|
248
|
-
}
|
|
249
|
-
function toInternal(externalValue, internalValue) {
|
|
250
|
-
if (!externalValue) {
|
|
251
|
-
return fallback(internalValue);
|
|
252
|
-
}
|
|
253
|
-
return externalValue;
|
|
254
|
-
}
|
|
255
|
-
const [internal, setInternal] = useState(toInternal(external, void 0));
|
|
256
|
-
useEffect(() => {
|
|
257
|
-
setInternal((prevInternal) => toInternal(external, prevInternal));
|
|
258
|
-
}, [external]);
|
|
259
|
-
const setInternalValue = (setter) => {
|
|
260
|
-
const setterFn = typeof setter === "function" ? setter : () => setter;
|
|
261
|
-
const updated = setterFn(internal);
|
|
262
|
-
setInternal(updated);
|
|
263
|
-
setExternal(toExternal(updated));
|
|
264
|
-
};
|
|
265
|
-
return [internal, setInternalValue];
|
|
266
|
-
};
|
|
44
|
+
// src/controls-actions.ts
|
|
45
|
+
import { createMenu } from "@elementor/menus";
|
|
267
46
|
|
|
268
|
-
// src/
|
|
269
|
-
import * as
|
|
270
|
-
import {
|
|
271
|
-
import {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
placeholder,
|
|
282
|
-
InputProps: {
|
|
283
|
-
endAdornment,
|
|
284
|
-
startAdornment
|
|
285
|
-
},
|
|
286
|
-
ref
|
|
287
|
-
}
|
|
288
|
-
);
|
|
289
|
-
}
|
|
290
|
-
);
|
|
291
|
-
var SelectionEndAdornment = ({
|
|
292
|
-
options: options5,
|
|
293
|
-
onClick,
|
|
294
|
-
value
|
|
295
|
-
}) => {
|
|
47
|
+
// src/popover-action.tsx
|
|
48
|
+
import * as React2 from "react";
|
|
49
|
+
import { useId } from "react";
|
|
50
|
+
import { XIcon } from "@elementor/icons";
|
|
51
|
+
import { bindPopover, bindToggle, IconButton, Popover, Stack, Tooltip, Typography, usePopupState } from "@elementor/ui";
|
|
52
|
+
var SIZE = "tiny";
|
|
53
|
+
function PopoverAction({
|
|
54
|
+
title,
|
|
55
|
+
visible = true,
|
|
56
|
+
icon: Icon,
|
|
57
|
+
popoverContent: PopoverContent
|
|
58
|
+
}) {
|
|
59
|
+
const id = useId();
|
|
296
60
|
const popupState = usePopupState({
|
|
297
61
|
variant: "popover",
|
|
298
|
-
popupId:
|
|
299
|
-
});
|
|
300
|
-
const handleMenuItemClick = (index) => {
|
|
301
|
-
onClick(options5[index]);
|
|
302
|
-
popupState.close();
|
|
303
|
-
};
|
|
304
|
-
return /* @__PURE__ */ React12.createElement(InputAdornment, { position: "end" }, /* @__PURE__ */ React12.createElement(
|
|
305
|
-
Button2,
|
|
306
|
-
{
|
|
307
|
-
size: "small",
|
|
308
|
-
color: "inherit",
|
|
309
|
-
sx: { font: "inherit", minWidth: "initial" },
|
|
310
|
-
...bindTrigger(popupState)
|
|
311
|
-
},
|
|
312
|
-
value.toUpperCase()
|
|
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()))));
|
|
314
|
-
};
|
|
315
|
-
|
|
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();
|
|
320
|
-
const [state, setState] = useSyncExternalState({
|
|
321
|
-
external: value,
|
|
322
|
-
setExternal: setValue,
|
|
323
|
-
persistWhen: (controlValue) => !!controlValue?.value.size || controlValue?.value.size === 0,
|
|
324
|
-
fallback: (controlValue) => ({
|
|
325
|
-
$$type: "size",
|
|
326
|
-
value: { unit: controlValue?.value.unit || "px", size: NaN }
|
|
327
|
-
})
|
|
328
|
-
});
|
|
329
|
-
const handleUnitChange = (unit) => {
|
|
330
|
-
setState((prev) => ({
|
|
331
|
-
...prev,
|
|
332
|
-
value: {
|
|
333
|
-
...prev.value,
|
|
334
|
-
unit
|
|
335
|
-
}
|
|
336
|
-
}));
|
|
337
|
-
};
|
|
338
|
-
const handleSizeChange = (event) => {
|
|
339
|
-
const { value: size } = event.target;
|
|
340
|
-
setState((prev) => ({
|
|
341
|
-
...prev,
|
|
342
|
-
value: {
|
|
343
|
-
...prev.value,
|
|
344
|
-
size: size || size === "0" ? parseFloat(size) : NaN
|
|
345
|
-
}
|
|
346
|
-
}));
|
|
347
|
-
};
|
|
348
|
-
return /* @__PURE__ */ React13.createElement(ControlActions, null, /* @__PURE__ */ React13.createElement(
|
|
349
|
-
TextFieldInnerSelection,
|
|
350
|
-
{
|
|
351
|
-
endAdornment: /* @__PURE__ */ React13.createElement(SelectionEndAdornment, { options: units2, onClick: handleUnitChange, value: state.value.unit }),
|
|
352
|
-
placeholder,
|
|
353
|
-
startAdornment: startIcon ?? /* @__PURE__ */ React13.createElement(InputAdornment2, { position: "start" }, startIcon),
|
|
354
|
-
type: "number",
|
|
355
|
-
value: Number.isNaN(state.value.size) ? "" : state.value.size,
|
|
356
|
-
onChange: handleSizeChange
|
|
357
|
-
}
|
|
358
|
-
));
|
|
359
|
-
});
|
|
360
|
-
|
|
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";
|
|
365
|
-
|
|
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 }));
|
|
379
|
-
}
|
|
380
|
-
);
|
|
381
|
-
|
|
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
|
-
}
|
|
398
|
-
};
|
|
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
|
|
62
|
+
popupId: `elementor-popover-action-${id}`
|
|
807
63
|
});
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
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);
|
|
64
|
+
if (!visible) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(Tooltip, { placement: "top", title }, /* @__PURE__ */ React2.createElement(IconButton, { "aria-label": title, key: id, size: SIZE, ...bindToggle(popupState) }, /* @__PURE__ */ React2.createElement(Icon, { fontSize: SIZE }))), /* @__PURE__ */ React2.createElement(
|
|
68
|
+
Popover,
|
|
69
|
+
{
|
|
70
|
+
disablePortal: true,
|
|
71
|
+
disableScrollLock: true,
|
|
72
|
+
anchorOrigin: {
|
|
73
|
+
vertical: "bottom",
|
|
74
|
+
horizontal: "center"
|
|
75
|
+
},
|
|
76
|
+
...bindPopover(popupState)
|
|
77
|
+
},
|
|
78
|
+
/* @__PURE__ */ React2.createElement(Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React2.createElement(Icon, { fontSize: SIZE, sx: { mr: 0.5 } }), /* @__PURE__ */ React2.createElement(Typography, { variant: "subtitle2" }, title), /* @__PURE__ */ React2.createElement(IconButton, { sx: { ml: "auto" }, size: SIZE, onClick: popupState.close }, /* @__PURE__ */ React2.createElement(XIcon, { fontSize: SIZE }))),
|
|
79
|
+
/* @__PURE__ */ React2.createElement(PopoverContent, { closePopover: popupState.close })
|
|
80
|
+
));
|
|
841
81
|
}
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
82
|
+
|
|
83
|
+
// src/controls-actions.ts
|
|
84
|
+
var controlActionsMenu = createMenu({
|
|
85
|
+
components: {
|
|
86
|
+
PopoverAction
|
|
846
87
|
}
|
|
847
|
-
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// src/components/editing-panel-error-fallback.tsx
|
|
91
|
+
import * as React3 from "react";
|
|
92
|
+
import { Alert, Box } from "@elementor/ui";
|
|
93
|
+
function EditorPanelErrorFallback() {
|
|
94
|
+
return /* @__PURE__ */ React3.createElement(Box, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React3.createElement(Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React3.createElement("strong", null, "Something went wrong")));
|
|
848
95
|
}
|
|
849
96
|
|
|
850
|
-
// src/
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
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
|
-
};
|
|
97
|
+
// src/components/editing-panel-tabs.tsx
|
|
98
|
+
import * as React50 from "react";
|
|
99
|
+
import { Fragment as Fragment5 } from "react";
|
|
100
|
+
import { Divider as Divider7, Stack as Stack18, Tab, TabPanel, Tabs, useTabs } from "@elementor/ui";
|
|
101
|
+
import { __ as __30 } from "@wordpress/i18n";
|
|
866
102
|
|
|
867
|
-
// src/components/
|
|
868
|
-
import * as
|
|
869
|
-
import {
|
|
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
|
-
};
|
|
103
|
+
// src/components/settings-tab.tsx
|
|
104
|
+
import * as React9 from "react";
|
|
105
|
+
import { ControlLabel } from "@elementor/editor-controls";
|
|
877
106
|
|
|
878
107
|
// src/controls-registry/control.tsx
|
|
879
|
-
import * as
|
|
108
|
+
import * as React4 from "react";
|
|
880
109
|
import { createError } from "@elementor/utils";
|
|
881
110
|
|
|
882
111
|
// src/controls-registry/controls-registry.tsx
|
|
112
|
+
import {
|
|
113
|
+
ImageControl,
|
|
114
|
+
SelectControl,
|
|
115
|
+
SizeControl,
|
|
116
|
+
TextAreaControl,
|
|
117
|
+
TextControl
|
|
118
|
+
} from "@elementor/editor-controls";
|
|
883
119
|
var controlTypes = {
|
|
884
120
|
image: { component: ImageControl, layout: "full" },
|
|
885
121
|
text: { component: TextControl, layout: "two-columns" },
|
|
@@ -895,27 +131,27 @@ var ControlTypeError = createError({
|
|
|
895
131
|
code: "CONTROL_TYPE_NOT_FOUND",
|
|
896
132
|
message: `Control type not found.`
|
|
897
133
|
});
|
|
898
|
-
var
|
|
134
|
+
var Control = ({ props, type }) => {
|
|
899
135
|
const ControlByType = getControlByType(type);
|
|
900
136
|
if (!ControlByType) {
|
|
901
137
|
throw new ControlTypeError({
|
|
902
138
|
context: { type }
|
|
903
139
|
});
|
|
904
140
|
}
|
|
905
|
-
return /* @__PURE__ */
|
|
141
|
+
return /* @__PURE__ */ React4.createElement(ControlByType, { ...props });
|
|
906
142
|
};
|
|
907
143
|
|
|
908
144
|
// src/controls-registry/control-type-container.tsx
|
|
909
|
-
import * as
|
|
910
|
-
import {
|
|
145
|
+
import * as React5 from "react";
|
|
146
|
+
import { Box as Box2, styled } from "@elementor/ui";
|
|
911
147
|
var ControlTypeContainer = ({
|
|
912
148
|
controlType,
|
|
913
149
|
children
|
|
914
150
|
}) => {
|
|
915
151
|
const layout = getLayoutByType(controlType);
|
|
916
|
-
return /* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ React5.createElement(StyledContainer, { layout }, children);
|
|
917
153
|
};
|
|
918
|
-
var StyledContainer =
|
|
154
|
+
var StyledContainer = styled(Box2, {
|
|
919
155
|
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
920
156
|
})(({ layout, theme }) => ({
|
|
921
157
|
display: "grid",
|
|
@@ -930,17 +166,79 @@ var getGridLayout = (layout) => ({
|
|
|
930
166
|
}[layout]
|
|
931
167
|
});
|
|
932
168
|
|
|
169
|
+
// src/controls-registry/settings-field.tsx
|
|
170
|
+
import * as React6 from "react";
|
|
171
|
+
import { BoundPropProvider } from "@elementor/editor-controls";
|
|
172
|
+
import { updateSettings, useElementSetting } from "@elementor/editor-elements";
|
|
173
|
+
var SettingsField = ({ bind, children }) => {
|
|
174
|
+
const { element, elementType } = useElement();
|
|
175
|
+
const defaultValue = elementType.propsSchema[bind]?.default;
|
|
176
|
+
const settingsValue = useElementSetting(element.id, bind);
|
|
177
|
+
const value = settingsValue ?? defaultValue ?? null;
|
|
178
|
+
const setValue = (newValue) => {
|
|
179
|
+
updateSettings({
|
|
180
|
+
id: element.id,
|
|
181
|
+
props: {
|
|
182
|
+
[bind]: newValue
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
return /* @__PURE__ */ React6.createElement(BoundPropProvider, { setValue, value, bind }, children);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
// src/components/section.tsx
|
|
190
|
+
import * as React7 from "react";
|
|
191
|
+
import { useId as useId2, useState } from "react";
|
|
192
|
+
import { Collapse, Divider, ListItemButton, ListItemText, Stack as Stack2 } from "@elementor/ui";
|
|
193
|
+
|
|
194
|
+
// src/components/collapse-icon.tsx
|
|
195
|
+
import { ChevronDownIcon } from "@elementor/icons";
|
|
196
|
+
import { styled as styled2 } from "@elementor/ui";
|
|
197
|
+
var CollapseIcon = styled2(ChevronDownIcon, {
|
|
198
|
+
shouldForwardProp: (prop) => prop !== "open"
|
|
199
|
+
})(({ theme, open }) => ({
|
|
200
|
+
transform: open ? "rotate(180deg)" : "rotate(0deg)",
|
|
201
|
+
transition: theme.transitions.create("transform", {
|
|
202
|
+
duration: theme.transitions.duration.standard
|
|
203
|
+
})
|
|
204
|
+
}));
|
|
205
|
+
|
|
206
|
+
// src/components/section.tsx
|
|
207
|
+
function Section({ title, children, defaultExpanded = false }) {
|
|
208
|
+
const [isOpen, setIsOpen] = useState(!!defaultExpanded);
|
|
209
|
+
const id = useId2();
|
|
210
|
+
const labelId = `label-${id}`;
|
|
211
|
+
const contentId = `content-${id}`;
|
|
212
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(
|
|
213
|
+
ListItemButton,
|
|
214
|
+
{
|
|
215
|
+
id: labelId,
|
|
216
|
+
"aria-controls": contentId,
|
|
217
|
+
onClick: () => setIsOpen((prev) => !prev)
|
|
218
|
+
},
|
|
219
|
+
/* @__PURE__ */ React7.createElement(ListItemText, { secondary: title }),
|
|
220
|
+
/* @__PURE__ */ React7.createElement(CollapseIcon, { open: isOpen, color: "secondary" })
|
|
221
|
+
), /* @__PURE__ */ React7.createElement(Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React7.createElement(Stack2, { gap: 2.5, p: 2 }, children)), /* @__PURE__ */ React7.createElement(Divider, null));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// src/components/sections-list.tsx
|
|
225
|
+
import * as React8 from "react";
|
|
226
|
+
import { List } from "@elementor/ui";
|
|
227
|
+
function SectionsList(props) {
|
|
228
|
+
return /* @__PURE__ */ React8.createElement(List, { disablePadding: true, component: "div", ...props });
|
|
229
|
+
}
|
|
230
|
+
|
|
933
231
|
// src/components/settings-tab.tsx
|
|
934
232
|
var SettingsTab = () => {
|
|
935
233
|
const { elementType } = useElement();
|
|
936
|
-
return /* @__PURE__ */
|
|
234
|
+
return /* @__PURE__ */ React9.createElement(SectionsList, null, elementType.controls.map(({ type, value }, index) => {
|
|
937
235
|
if (type === "control") {
|
|
938
|
-
return /* @__PURE__ */
|
|
236
|
+
return /* @__PURE__ */ React9.createElement(Control2, { key: value.bind, control: value });
|
|
939
237
|
}
|
|
940
238
|
if (type === "section") {
|
|
941
|
-
return /* @__PURE__ */
|
|
239
|
+
return /* @__PURE__ */ React9.createElement(Section, { title: value.label, key: type + "." + index, defaultExpanded: true }, value.items?.map((item) => {
|
|
942
240
|
if (item.type === "control") {
|
|
943
|
-
return /* @__PURE__ */
|
|
241
|
+
return /* @__PURE__ */ React9.createElement(Control2, { key: item.value.bind, control: item.value });
|
|
944
242
|
}
|
|
945
243
|
return null;
|
|
946
244
|
}));
|
|
@@ -948,860 +246,1158 @@ var SettingsTab = () => {
|
|
|
948
246
|
return null;
|
|
949
247
|
}));
|
|
950
248
|
};
|
|
951
|
-
var
|
|
249
|
+
var Control2 = ({ control }) => {
|
|
952
250
|
if (!getControlByType(control.type)) {
|
|
953
251
|
return null;
|
|
954
252
|
}
|
|
955
|
-
return /* @__PURE__ */
|
|
253
|
+
return /* @__PURE__ */ React9.createElement(SettingsField, { bind: control.bind }, /* @__PURE__ */ React9.createElement(ControlTypeContainer, { controlType: control.type }, control.label ? /* @__PURE__ */ React9.createElement(ControlLabel, null, control.label) : null, /* @__PURE__ */ React9.createElement(Control, { type: control.type, props: control.props })));
|
|
956
254
|
};
|
|
957
255
|
|
|
958
256
|
// src/components/style-tab.tsx
|
|
959
|
-
import * as
|
|
960
|
-
import { useState as
|
|
961
|
-
import {
|
|
962
|
-
import { generateId } from "@elementor/editor-styles";
|
|
257
|
+
import * as React49 from "react";
|
|
258
|
+
import { useState as useState4 } from "react";
|
|
259
|
+
import { useElementSetting as useElementSetting3, useElementStyles as useElementStyles2 } from "@elementor/editor-elements";
|
|
963
260
|
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
964
|
-
import {
|
|
965
|
-
|
|
966
|
-
|
|
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);
|
|
972
|
-
}
|
|
973
|
-
function useStyle() {
|
|
974
|
-
const context = useContext5(Context3);
|
|
975
|
-
if (!context) {
|
|
976
|
-
throw new Error("UseStyleContext must be used within a StyleContextProvider");
|
|
977
|
-
}
|
|
978
|
-
return context;
|
|
979
|
-
}
|
|
980
|
-
|
|
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";
|
|
985
|
-
|
|
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";
|
|
991
|
-
|
|
992
|
-
// src/controls-registry/styles-field.tsx
|
|
993
|
-
import * as React29 from "react";
|
|
994
|
-
|
|
995
|
-
// src/hooks/use-styles-field.ts
|
|
996
|
-
import { useElementStyleProp, updateStyle } from "@elementor/editor-elements";
|
|
261
|
+
import { generateId } from "@elementor/editor-styles";
|
|
262
|
+
import { Divider as Divider6 } from "@elementor/ui";
|
|
263
|
+
import { __ as __29 } from "@wordpress/i18n";
|
|
997
264
|
|
|
998
265
|
// src/contexts/classes-prop-context.tsx
|
|
999
|
-
import * as
|
|
1000
|
-
import { createContext as
|
|
1001
|
-
var
|
|
266
|
+
import * as React10 from "react";
|
|
267
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
268
|
+
var Context2 = createContext2(null);
|
|
1002
269
|
function ClassesPropProvider({ children, prop }) {
|
|
1003
|
-
return /* @__PURE__ */
|
|
270
|
+
return /* @__PURE__ */ React10.createElement(Context2.Provider, { value: { prop } }, children);
|
|
1004
271
|
}
|
|
1005
272
|
function useClassesProp() {
|
|
1006
|
-
const context =
|
|
273
|
+
const context = useContext2(Context2);
|
|
1007
274
|
if (!context) {
|
|
1008
275
|
throw new Error("useClassesProp must be used within a ClassesPropProvider");
|
|
1009
276
|
}
|
|
1010
277
|
return context.prop;
|
|
1011
278
|
}
|
|
1012
279
|
|
|
1013
|
-
// src/
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
styleDefID: id,
|
|
1028
|
-
props: { [propName]: newValue },
|
|
1029
|
-
meta,
|
|
1030
|
-
bind: classesProp
|
|
1031
|
-
});
|
|
1032
|
-
};
|
|
1033
|
-
return [value, setValue];
|
|
1034
|
-
};
|
|
280
|
+
// src/contexts/style-context.tsx
|
|
281
|
+
import * as React11 from "react";
|
|
282
|
+
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
283
|
+
var Context3 = createContext3(null);
|
|
284
|
+
function StyleProvider({ children, id, setId, meta }) {
|
|
285
|
+
return /* @__PURE__ */ React11.createElement(Context3.Provider, { value: { id, setId, meta } }, children);
|
|
286
|
+
}
|
|
287
|
+
function useStyle() {
|
|
288
|
+
const context = useContext3(Context3);
|
|
289
|
+
if (!context) {
|
|
290
|
+
throw new Error("useStyle must be used within a StyleProvider");
|
|
291
|
+
}
|
|
292
|
+
return context;
|
|
293
|
+
}
|
|
1035
294
|
|
|
1036
|
-
// src/
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
};
|
|
295
|
+
// src/components/css-class-selector-section.tsx
|
|
296
|
+
import * as React13 from "react";
|
|
297
|
+
import { useElementSetting as useElementSetting2, useElementStyles } from "@elementor/editor-elements";
|
|
298
|
+
import { Chip as Chip2, Stack as Stack3, Typography as Typography2 } from "@elementor/ui";
|
|
299
|
+
import { __ } from "@wordpress/i18n";
|
|
1041
300
|
|
|
1042
|
-
// src/components/
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
301
|
+
// src/components/multi-combobox/multi-combobox.tsx
|
|
302
|
+
import * as React12 from "react";
|
|
303
|
+
import {
|
|
304
|
+
Autocomplete,
|
|
305
|
+
Box as Box3,
|
|
306
|
+
Chip,
|
|
307
|
+
styled as styled3,
|
|
308
|
+
TextField
|
|
309
|
+
} from "@elementor/ui";
|
|
310
|
+
|
|
311
|
+
// src/components/multi-combobox/use-combobox-actions.ts
|
|
312
|
+
import { createFilterOptions } from "@elementor/ui";
|
|
313
|
+
var useComboboxActions = (applied, actions, optionsLabel, onApply) => ({
|
|
314
|
+
action: {
|
|
315
|
+
is: (opt) => !!opt.action,
|
|
316
|
+
getLabel: (option) => option.action.getLabel(option.label),
|
|
317
|
+
groupBy: (option) => option.action.groupLabel,
|
|
318
|
+
onChange: ({ action, label }) => action?.apply(label),
|
|
319
|
+
getFilteredActions: (optionList, params) => {
|
|
320
|
+
const actionGroups = Object.values(actions);
|
|
321
|
+
return actionGroups.reduce((groups, group) => {
|
|
322
|
+
const actionOptions = group.actions.reduce((groupActions, action) => {
|
|
323
|
+
const shouldShowAction = action.condition(optionList, params.inputValue);
|
|
324
|
+
if (shouldShowAction) {
|
|
325
|
+
const actionOption = createActionOption(group.label, action, params.inputValue);
|
|
326
|
+
groupActions.unshift(actionOption);
|
|
327
|
+
}
|
|
328
|
+
return groupActions;
|
|
329
|
+
}, []);
|
|
330
|
+
return [...groups, ...actionOptions];
|
|
331
|
+
}, []);
|
|
332
|
+
}
|
|
1055
333
|
},
|
|
1056
|
-
{
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
334
|
+
option: {
|
|
335
|
+
is: (opt) => !("action" in opt),
|
|
336
|
+
getLabel: (option) => option.label,
|
|
337
|
+
groupBy: () => optionsLabel ?? "",
|
|
338
|
+
onChange: (optionValues) => onApply?.(optionValues),
|
|
339
|
+
getFilteredOptions: (optionList, params) => {
|
|
340
|
+
const appliedValues = applied.map((option) => option.value);
|
|
341
|
+
const optionsWithoutApplied = optionList.filter((option) => !appliedValues.includes(option.value));
|
|
342
|
+
return filter(optionsWithoutApplied, params);
|
|
343
|
+
}
|
|
1061
344
|
}
|
|
1062
|
-
|
|
1063
|
-
var
|
|
1064
|
-
|
|
1065
|
-
|
|
345
|
+
});
|
|
346
|
+
var filter = createFilterOptions();
|
|
347
|
+
var createActionOption = (groupLabel, action, inputValue) => ({
|
|
348
|
+
value: "",
|
|
349
|
+
label: inputValue,
|
|
350
|
+
action: {
|
|
351
|
+
groupLabel,
|
|
352
|
+
apply: action.apply,
|
|
353
|
+
getLabel: action.getLabel
|
|
354
|
+
}
|
|
355
|
+
});
|
|
1066
356
|
|
|
1067
|
-
// src/components/
|
|
1068
|
-
var
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
357
|
+
// src/components/multi-combobox/multi-combobox.tsx
|
|
358
|
+
var MultiCombobox = ({
|
|
359
|
+
actions = {},
|
|
360
|
+
selected,
|
|
361
|
+
options: options5,
|
|
362
|
+
optionsLabel,
|
|
363
|
+
onApply,
|
|
364
|
+
onCreate,
|
|
365
|
+
...props
|
|
366
|
+
}) => {
|
|
367
|
+
const { action: actionProps, option: optionProps } = useComboboxActions(selected, actions, optionsLabel, onApply);
|
|
368
|
+
const handleSelectOption = (values) => {
|
|
369
|
+
const action = values.find((value) => actionProps.is(value));
|
|
370
|
+
if (action) {
|
|
371
|
+
return actionProps.onChange(action);
|
|
372
|
+
}
|
|
373
|
+
return optionProps.onChange(values);
|
|
374
|
+
};
|
|
375
|
+
const handleCreateOption = (values) => {
|
|
376
|
+
const value = values.find((option) => typeof option === "string");
|
|
377
|
+
onCreate?.(value);
|
|
378
|
+
};
|
|
379
|
+
return /* @__PURE__ */ React12.createElement(
|
|
380
|
+
Autocomplete,
|
|
381
|
+
{
|
|
382
|
+
...props,
|
|
383
|
+
freeSolo: true,
|
|
384
|
+
multiple: true,
|
|
385
|
+
clearOnBlur: true,
|
|
386
|
+
selectOnFocus: true,
|
|
387
|
+
disableClearable: true,
|
|
388
|
+
handleHomeEndKeys: true,
|
|
389
|
+
value: selected,
|
|
390
|
+
options: options5,
|
|
391
|
+
renderGroup,
|
|
392
|
+
renderInput: (params) => /* @__PURE__ */ React12.createElement(TextField, { ...params }),
|
|
393
|
+
getLimitTagsText: (more) => /* @__PURE__ */ React12.createElement(Chip, { size: "tiny", variant: "standard", label: `+${more}`, clickable: true }),
|
|
394
|
+
onChange: (_, values, reason) => {
|
|
395
|
+
if (reason === "selectOption") {
|
|
396
|
+
return handleSelectOption(values);
|
|
397
|
+
}
|
|
398
|
+
if (reason === "createOption") {
|
|
399
|
+
return handleCreateOption(values);
|
|
400
|
+
}
|
|
401
|
+
onApply?.(values);
|
|
402
|
+
},
|
|
403
|
+
getOptionLabel: (option) => {
|
|
404
|
+
if (optionProps.is(option)) {
|
|
405
|
+
return optionProps.getLabel(option);
|
|
406
|
+
}
|
|
407
|
+
return actionProps.getLabel(option) ?? "";
|
|
408
|
+
},
|
|
409
|
+
filterOptions: (optionList, params) => {
|
|
410
|
+
const filteredoptions = optionProps.getFilteredOptions(optionList, params);
|
|
411
|
+
const actionOptions = actionProps.getFilteredActions(optionList, params);
|
|
412
|
+
return [...actionOptions, ...filteredoptions];
|
|
413
|
+
},
|
|
414
|
+
groupBy: (option) => (optionProps.is(option) ? optionProps.groupBy() : actionProps.groupBy(option)) ?? ""
|
|
415
|
+
}
|
|
416
|
+
);
|
|
1073
417
|
};
|
|
418
|
+
var renderGroup = (params) => /* @__PURE__ */ React12.createElement(Group, { key: params.key }, /* @__PURE__ */ React12.createElement(GroupHeader, null, params.group), /* @__PURE__ */ React12.createElement(GroupItems, null, params.children));
|
|
419
|
+
var Group = styled3("li")`
|
|
420
|
+
&:not( :last-of-type ) {
|
|
421
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.divider};
|
|
422
|
+
}
|
|
423
|
+
`;
|
|
424
|
+
var GroupHeader = styled3(Box3)(({ theme }) => ({
|
|
425
|
+
position: "sticky",
|
|
426
|
+
top: "-8px",
|
|
427
|
+
padding: theme.spacing(1, 2),
|
|
428
|
+
color: theme.palette.text.tertiary
|
|
429
|
+
}));
|
|
430
|
+
var GroupItems = styled3("ul")`
|
|
431
|
+
padding: 0;
|
|
432
|
+
`;
|
|
1074
433
|
|
|
1075
|
-
// src/components/
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
const [fontStyle, setFontStyle] = useStylesField("font-style");
|
|
1087
|
-
const [textDecoration, setTextDecoration] = useStylesField("text-decoration");
|
|
1088
|
-
const formats = [fontStyle, ...(textDecoration || "").split(" ")];
|
|
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,
|
|
1091
|
-
{
|
|
1092
|
-
value: "italic",
|
|
1093
|
-
onChange: (v) => setFontStyle(fontStyle === v ? null : v),
|
|
1094
|
-
"aria-label": "italic",
|
|
1095
|
-
sx: { marginLeft: "auto" }
|
|
1096
|
-
},
|
|
1097
|
-
/* @__PURE__ */ React32.createElement(ItalicIcon, { fontSize: buttonSize })
|
|
1098
|
-
), /* @__PURE__ */ React32.createElement(
|
|
1099
|
-
ShorthandControl,
|
|
1100
|
-
{
|
|
1101
|
-
value: "line-through",
|
|
1102
|
-
currentValues: textDecoration || "",
|
|
1103
|
-
updateValues: setTextDecoration,
|
|
1104
|
-
"aria-label": "line-through"
|
|
1105
|
-
},
|
|
1106
|
-
/* @__PURE__ */ React32.createElement(StrikethroughIcon, { fontSize: buttonSize })
|
|
1107
|
-
), /* @__PURE__ */ React32.createElement(
|
|
1108
|
-
ShorthandControl,
|
|
434
|
+
// src/components/css-class-selector-section.tsx
|
|
435
|
+
var ID = "elementor-css-class-selector";
|
|
436
|
+
var TAGS_LIMIT = 8;
|
|
437
|
+
function CssClassSelectorSection() {
|
|
438
|
+
const options5 = useOptions();
|
|
439
|
+
const { id: activeId, setId: setActiveId } = useStyle();
|
|
440
|
+
const appliedIds = useAppliedClassesIds();
|
|
441
|
+
const applied = options5.filter((option) => appliedIds.includes(option.value));
|
|
442
|
+
const active = options5.find((option) => option.value === activeId) || null;
|
|
443
|
+
return /* @__PURE__ */ React13.createElement(Stack3, { gap: 1, p: 2 }, /* @__PURE__ */ React13.createElement(Typography2, { component: "label", variant: "caption", htmlFor: ID }, __("CSS Classes", "elementor")), /* @__PURE__ */ React13.createElement(
|
|
444
|
+
MultiCombobox,
|
|
1109
445
|
{
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
};
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
446
|
+
id: ID,
|
|
447
|
+
size: "tiny",
|
|
448
|
+
options: options5,
|
|
449
|
+
selected: applied,
|
|
450
|
+
limitTags: TAGS_LIMIT,
|
|
451
|
+
optionsLabel: __("Global CSS Classes", "elementor"),
|
|
452
|
+
renderTags: (tagValue, getTagProps) => tagValue.map((option, index) => {
|
|
453
|
+
const chipProps = getTagProps({ index });
|
|
454
|
+
return /* @__PURE__ */ React13.createElement(
|
|
455
|
+
Chip2,
|
|
456
|
+
{
|
|
457
|
+
...chipProps,
|
|
458
|
+
key: chipProps.key,
|
|
459
|
+
size: "small",
|
|
460
|
+
label: option.label,
|
|
461
|
+
variant: option.value === active?.value ? "filled" : "standard",
|
|
462
|
+
color: option.color ?? "default",
|
|
463
|
+
onClick: () => setActiveId(option.value),
|
|
464
|
+
onDelete: null
|
|
465
|
+
}
|
|
466
|
+
);
|
|
467
|
+
})
|
|
1132
468
|
}
|
|
469
|
+
));
|
|
470
|
+
}
|
|
471
|
+
function useAppliedClassesIds() {
|
|
472
|
+
const { element } = useElement();
|
|
473
|
+
const currentClassesProp = useClassesProp();
|
|
474
|
+
return useElementSetting2(element.id, currentClassesProp)?.value || [];
|
|
475
|
+
}
|
|
476
|
+
function useOptions() {
|
|
477
|
+
const { element } = useElement();
|
|
478
|
+
const styleDefs = useElementStyles(element.id);
|
|
479
|
+
return Object.values(styleDefs).map((styleDef) => ({
|
|
480
|
+
label: styleDef.label,
|
|
481
|
+
value: styleDef.id,
|
|
482
|
+
color: "primary"
|
|
483
|
+
}));
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// src/components/style-sections/background-section/background-section.tsx
|
|
487
|
+
import * as React16 from "react";
|
|
488
|
+
import { BackgroundOverlayRepeaterControl } from "@elementor/editor-controls";
|
|
489
|
+
import { Stack as Stack4 } from "@elementor/ui";
|
|
490
|
+
|
|
491
|
+
// src/controls-registry/styles-field.tsx
|
|
492
|
+
import * as React14 from "react";
|
|
493
|
+
import { BoundPropProvider as BoundPropProvider2 } from "@elementor/editor-controls";
|
|
494
|
+
|
|
495
|
+
// src/hooks/use-styles-field.ts
|
|
496
|
+
import { useEffect, useRef } from "react";
|
|
497
|
+
import { updateStyle, useElementStyleProp } from "@elementor/editor-elements";
|
|
498
|
+
var useStylesField = (propName) => {
|
|
499
|
+
const { element } = useElement();
|
|
500
|
+
const { id, meta } = useStyle();
|
|
501
|
+
const classesProp = useClassesProp();
|
|
502
|
+
const previousValue = useRef(null);
|
|
503
|
+
const onChangeCallbacks = useRef(/* @__PURE__ */ new Set());
|
|
504
|
+
const value = useElementStyleProp({
|
|
505
|
+
elementID: element.id,
|
|
506
|
+
styleDefID: id,
|
|
507
|
+
meta,
|
|
508
|
+
propName
|
|
509
|
+
});
|
|
510
|
+
const setValue = (newValue) => {
|
|
511
|
+
updateStyle({
|
|
512
|
+
elementID: element.id,
|
|
513
|
+
styleDefID: id,
|
|
514
|
+
props: { [propName]: newValue },
|
|
515
|
+
meta,
|
|
516
|
+
bind: classesProp
|
|
517
|
+
});
|
|
1133
518
|
};
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
var ToggleButton2 = ({ onChange, ...props }) => {
|
|
1137
|
-
const handleChange = (_e, newValue) => {
|
|
1138
|
-
onChange(newValue);
|
|
519
|
+
const registerChangeListener = (callback) => {
|
|
520
|
+
onChangeCallbacks.current.add(callback);
|
|
1139
521
|
};
|
|
1140
|
-
|
|
522
|
+
useEffect(() => {
|
|
523
|
+
onChangeCallbacks.current.forEach((cb) => {
|
|
524
|
+
cb(value, previousValue.current);
|
|
525
|
+
});
|
|
526
|
+
previousValue.current = value;
|
|
527
|
+
}, [value]);
|
|
528
|
+
return [value, setValue, registerChangeListener];
|
|
1141
529
|
};
|
|
1142
530
|
|
|
1143
|
-
// src/
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
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))));
|
|
531
|
+
// src/controls-registry/styles-field.tsx
|
|
532
|
+
var StylesField = ({ bind, children }) => {
|
|
533
|
+
const [value, setValue] = useStylesField(bind);
|
|
534
|
+
return /* @__PURE__ */ React14.createElement(BoundPropProvider2, { setValue, value, bind }, children);
|
|
1152
535
|
};
|
|
1153
536
|
|
|
1154
|
-
// src/components/style-sections/
|
|
1155
|
-
import * as
|
|
1156
|
-
import {
|
|
1157
|
-
import { Grid
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
{
|
|
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" }
|
|
1164
|
-
];
|
|
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 }))));
|
|
537
|
+
// src/components/style-sections/background-section/background-color-field.tsx
|
|
538
|
+
import * as React15 from "react";
|
|
539
|
+
import { ColorControl, ControlLabel as ControlLabel2 } from "@elementor/editor-controls";
|
|
540
|
+
import { Grid } from "@elementor/ui";
|
|
541
|
+
import { __ as __2 } from "@wordpress/i18n";
|
|
542
|
+
var BackgroundColorField = () => {
|
|
543
|
+
return /* @__PURE__ */ React15.createElement(StylesField, { bind: "background-color" }, /* @__PURE__ */ React15.createElement(Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React15.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React15.createElement(ControlLabel2, null, __2("Color", "elementor"))), /* @__PURE__ */ React15.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React15.createElement(ColorControl, null))));
|
|
1167
544
|
};
|
|
1168
545
|
|
|
1169
|
-
// src/components/style-sections/
|
|
1170
|
-
|
|
1171
|
-
|
|
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))));
|
|
546
|
+
// src/components/style-sections/background-section/background-section.tsx
|
|
547
|
+
var BackgroundSection = () => {
|
|
548
|
+
return /* @__PURE__ */ React16.createElement(Stack4, { gap: 1.5 }, /* @__PURE__ */ React16.createElement(StylesField, { bind: "background-image" }, /* @__PURE__ */ React16.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React16.createElement(BackgroundColorField, null));
|
|
1175
549
|
};
|
|
1176
550
|
|
|
1177
|
-
// src/components/style-sections/
|
|
1178
|
-
import * as
|
|
1179
|
-
import {
|
|
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))));
|
|
1183
|
-
};
|
|
551
|
+
// src/components/style-sections/border-section/border-section.tsx
|
|
552
|
+
import * as React23 from "react";
|
|
553
|
+
import { Divider as Divider2, Stack as Stack6 } from "@elementor/ui";
|
|
1184
554
|
|
|
1185
|
-
// src/components/style-sections/
|
|
1186
|
-
import * as
|
|
1187
|
-
import { __ as
|
|
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))));
|
|
1191
|
-
};
|
|
555
|
+
// src/components/style-sections/border-section/border-field.tsx
|
|
556
|
+
import * as React21 from "react";
|
|
557
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
1192
558
|
|
|
1193
|
-
// src/components/
|
|
1194
|
-
import * as
|
|
1195
|
-
import {
|
|
1196
|
-
import {
|
|
1197
|
-
import {
|
|
1198
|
-
|
|
1199
|
-
var
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
setOpen((prevOpen) => !prevOpen);
|
|
1203
|
-
};
|
|
1204
|
-
return /* @__PURE__ */ React38.createElement(Stack9, { sx: { py: 0.5 } }, /* @__PURE__ */ React38.createElement(
|
|
1205
|
-
Button3,
|
|
559
|
+
// src/components/add-or-remove-content.tsx
|
|
560
|
+
import * as React17 from "react";
|
|
561
|
+
import { ControlLabel as ControlLabel3 } from "@elementor/editor-controls";
|
|
562
|
+
import { MinusIcon, PlusIcon } from "@elementor/icons";
|
|
563
|
+
import { Collapse as Collapse2, IconButton as IconButton2, Stack as Stack5 } from "@elementor/ui";
|
|
564
|
+
var SIZE2 = "tiny";
|
|
565
|
+
var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
566
|
+
return /* @__PURE__ */ React17.createElement(Stack5, { gap: 1.5 }, /* @__PURE__ */ React17.createElement(
|
|
567
|
+
Stack5,
|
|
1206
568
|
{
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
endIcon: /* @__PURE__ */ React38.createElement(ChevronIcon, { open })
|
|
569
|
+
direction: "row",
|
|
570
|
+
sx: {
|
|
571
|
+
justifyContent: "space-between",
|
|
572
|
+
alignItems: "center"
|
|
573
|
+
}
|
|
1213
574
|
},
|
|
1214
|
-
|
|
1215
|
-
|
|
575
|
+
/* @__PURE__ */ React17.createElement(ControlLabel3, null, label),
|
|
576
|
+
isAdded ? /* @__PURE__ */ React17.createElement(IconButton2, { size: SIZE2, onClick: onRemove }, /* @__PURE__ */ React17.createElement(MinusIcon, { fontSize: SIZE2 })) : /* @__PURE__ */ React17.createElement(IconButton2, { size: SIZE2, onClick: onAdd }, /* @__PURE__ */ React17.createElement(PlusIcon, { fontSize: SIZE2 }))
|
|
577
|
+
), /* @__PURE__ */ React17.createElement(Collapse2, { in: isAdded, unmountOnExit: true }, /* @__PURE__ */ React17.createElement(Stack5, { gap: 1.5 }, children)));
|
|
1216
578
|
};
|
|
1217
|
-
var ChevronIcon = styled4(ChevronDownIcon, {
|
|
1218
|
-
shouldForwardProp: (prop) => prop !== "open"
|
|
1219
|
-
})(({ theme, open }) => ({
|
|
1220
|
-
transform: open ? "rotate(180deg)" : "rotate(0)",
|
|
1221
|
-
transition: theme.transitions.create("transform", {
|
|
1222
|
-
duration: theme.transitions.duration.standard
|
|
1223
|
-
})
|
|
1224
|
-
}));
|
|
1225
579
|
|
|
1226
|
-
// src/components/style-sections/
|
|
1227
|
-
import * as
|
|
1228
|
-
import {
|
|
1229
|
-
import { Grid as
|
|
1230
|
-
import {
|
|
1231
|
-
var
|
|
1232
|
-
{
|
|
1233
|
-
|
|
1234
|
-
|
|
580
|
+
// src/components/style-sections/border-section/border-color-field.tsx
|
|
581
|
+
import * as React18 from "react";
|
|
582
|
+
import { ColorControl as ColorControl2, ControlLabel as ControlLabel4 } from "@elementor/editor-controls";
|
|
583
|
+
import { Grid as Grid2 } from "@elementor/ui";
|
|
584
|
+
import { __ as __3 } from "@wordpress/i18n";
|
|
585
|
+
var BorderColorField = () => {
|
|
586
|
+
return /* @__PURE__ */ React18.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React18.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React18.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React18.createElement(ControlLabel4, null, __3("Border Color", "elementor"))), /* @__PURE__ */ React18.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React18.createElement(ColorControl2, null))));
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
// src/components/style-sections/border-section/border-style-field.tsx
|
|
590
|
+
import * as React19 from "react";
|
|
591
|
+
import { ControlLabel as ControlLabel5, SelectControl as SelectControl2 } from "@elementor/editor-controls";
|
|
592
|
+
import { Grid as Grid3 } from "@elementor/ui";
|
|
593
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
594
|
+
var borderStyles = [
|
|
595
|
+
{ value: "none", label: __4("None", "elementor") },
|
|
596
|
+
{ value: "solid", label: __4("Solid", "elementor") },
|
|
597
|
+
{ value: "dashed", label: __4("Dashed", "elementor") },
|
|
598
|
+
{ value: "dotted", label: __4("Dotted", "elementor") },
|
|
599
|
+
{ value: "double", label: __4("Double", "elementor") },
|
|
600
|
+
{ value: "groove", label: __4("Groove", "elementor") },
|
|
601
|
+
{ value: "ridge", label: __4("Ridge", "elementor") },
|
|
602
|
+
{ value: "inset", label: __4("Inset", "elementor") },
|
|
603
|
+
{ value: "outset", label: __4("Outset", "elementor") }
|
|
1235
604
|
];
|
|
1236
|
-
var
|
|
605
|
+
var BorderStyleField = () => {
|
|
606
|
+
return /* @__PURE__ */ React19.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React19.createElement(Grid3, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React19.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(ControlLabel5, null, __4("Border Type", "elementor"))), /* @__PURE__ */ React19.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(SelectControl2, { options: borderStyles }))));
|
|
607
|
+
};
|
|
1237
608
|
|
|
1238
|
-
// src/components/style-sections/
|
|
1239
|
-
import * as
|
|
1240
|
-
import {
|
|
1241
|
-
import {
|
|
1242
|
-
import {
|
|
1243
|
-
var
|
|
609
|
+
// src/components/style-sections/border-section/border-width-field.tsx
|
|
610
|
+
import * as React20 from "react";
|
|
611
|
+
import { EqualUnequalSizesControl } from "@elementor/editor-controls";
|
|
612
|
+
import { SideAllIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
613
|
+
import { __ as __5 } from "@wordpress/i18n";
|
|
614
|
+
var edges = [
|
|
1244
615
|
{
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
616
|
+
label: __5("Top", "elementor"),
|
|
617
|
+
icon: /* @__PURE__ */ React20.createElement(SideTopIcon, { fontSize: "tiny" }),
|
|
618
|
+
bind: "top"
|
|
1248
619
|
},
|
|
1249
620
|
{
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
621
|
+
label: __5("Right", "elementor"),
|
|
622
|
+
icon: /* @__PURE__ */ React20.createElement(SideRightIcon, { fontSize: "tiny" }),
|
|
623
|
+
bind: "right"
|
|
1253
624
|
},
|
|
1254
625
|
{
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
626
|
+
label: __5("Bottom", "elementor"),
|
|
627
|
+
icon: /* @__PURE__ */ React20.createElement(SideBottomIcon, { fontSize: "tiny" }),
|
|
628
|
+
bind: "bottom"
|
|
1258
629
|
},
|
|
1259
630
|
{
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
631
|
+
label: __5("Left", "elementor"),
|
|
632
|
+
icon: /* @__PURE__ */ React20.createElement(SideLeftIcon, { fontSize: "tiny" }),
|
|
633
|
+
bind: "left"
|
|
1263
634
|
}
|
|
1264
635
|
];
|
|
1265
|
-
var
|
|
1266
|
-
return /* @__PURE__ */
|
|
636
|
+
var BorderWidthField = () => {
|
|
637
|
+
return /* @__PURE__ */ React20.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React20.createElement(
|
|
638
|
+
EqualUnequalSizesControl,
|
|
639
|
+
{
|
|
640
|
+
label: __5("Border Width", "elementor"),
|
|
641
|
+
icon: /* @__PURE__ */ React20.createElement(SideAllIcon, { fontSize: "tiny" }),
|
|
642
|
+
items: edges,
|
|
643
|
+
multiSizeType: "border-width"
|
|
644
|
+
}
|
|
645
|
+
));
|
|
1267
646
|
};
|
|
1268
647
|
|
|
1269
|
-
// src/components/style-sections/
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
648
|
+
// src/components/style-sections/border-section/border-field.tsx
|
|
649
|
+
var initialSize = { $$type: "size", value: { size: 1, unit: "px" } };
|
|
650
|
+
var initialBorderWidth = {
|
|
651
|
+
$$type: "border-width",
|
|
652
|
+
value: { top: initialSize, right: initialSize, bottom: initialSize, left: initialSize }
|
|
653
|
+
};
|
|
654
|
+
var initialBorderColor = { $$type: "color", value: "#000000" };
|
|
655
|
+
var initialBorderStyle = "solid";
|
|
656
|
+
var BorderField = () => {
|
|
657
|
+
const [borderWidth, setBorderWidth] = useStylesField("border-width");
|
|
658
|
+
const [borderColor, setBorderColor] = useStylesField("border-color");
|
|
659
|
+
const [borderStyle, setBorderStyle] = useStylesField("border-style");
|
|
660
|
+
const addBorder = () => {
|
|
661
|
+
setBorderWidth(initialBorderWidth);
|
|
662
|
+
setBorderColor(initialBorderColor);
|
|
663
|
+
setBorderStyle(initialBorderStyle);
|
|
664
|
+
};
|
|
665
|
+
const removeBorder = () => {
|
|
666
|
+
setBorderWidth(null);
|
|
667
|
+
setBorderColor(null);
|
|
668
|
+
setBorderStyle(null);
|
|
669
|
+
};
|
|
670
|
+
const hasBorder = Boolean(borderWidth || borderColor || borderStyle);
|
|
671
|
+
return /* @__PURE__ */ React21.createElement(
|
|
672
|
+
AddOrRemoveContent,
|
|
673
|
+
{
|
|
674
|
+
label: __6("Border", "elementor"),
|
|
675
|
+
isAdded: hasBorder,
|
|
676
|
+
onAdd: addBorder,
|
|
677
|
+
onRemove: removeBorder
|
|
678
|
+
},
|
|
679
|
+
/* @__PURE__ */ React21.createElement(BorderWidthField, null),
|
|
680
|
+
/* @__PURE__ */ React21.createElement(BorderColorField, null),
|
|
681
|
+
/* @__PURE__ */ React21.createElement(BorderStyleField, null)
|
|
682
|
+
);
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
686
|
+
import * as React22 from "react";
|
|
687
|
+
import { EqualUnequalSizesControl as EqualUnequalSizesControl2 } from "@elementor/editor-controls";
|
|
688
|
+
import {
|
|
689
|
+
BorderCornersIcon,
|
|
690
|
+
RadiusBottomLeftIcon,
|
|
691
|
+
RadiusBottomRightIcon,
|
|
692
|
+
RadiusTopLeftIcon,
|
|
693
|
+
RadiusTopRightIcon
|
|
694
|
+
} from "@elementor/icons";
|
|
695
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
696
|
+
var corners = [
|
|
1275
697
|
{
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
698
|
+
label: __7("Top Left", "elementor"),
|
|
699
|
+
icon: /* @__PURE__ */ React22.createElement(RadiusTopLeftIcon, { fontSize: "tiny" }),
|
|
700
|
+
bind: "top-left"
|
|
1279
701
|
},
|
|
1280
702
|
{
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
703
|
+
label: __7("Top Right", "elementor"),
|
|
704
|
+
icon: /* @__PURE__ */ React22.createElement(RadiusTopRightIcon, { fontSize: "tiny" }),
|
|
705
|
+
bind: "top-right"
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
label: __7("Bottom Right", "elementor"),
|
|
709
|
+
icon: /* @__PURE__ */ React22.createElement(RadiusBottomRightIcon, { fontSize: "tiny" }),
|
|
710
|
+
bind: "bottom-right"
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
label: __7("Bottom Left", "elementor"),
|
|
714
|
+
icon: /* @__PURE__ */ React22.createElement(RadiusBottomLeftIcon, { fontSize: "tiny" }),
|
|
715
|
+
bind: "bottom-left"
|
|
1284
716
|
}
|
|
1285
717
|
];
|
|
1286
|
-
var
|
|
1287
|
-
return /* @__PURE__ */
|
|
718
|
+
var BorderRadiusField = () => {
|
|
719
|
+
return /* @__PURE__ */ React22.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React22.createElement(
|
|
720
|
+
EqualUnequalSizesControl2,
|
|
721
|
+
{
|
|
722
|
+
label: __7("Border Radius", "elementor"),
|
|
723
|
+
icon: /* @__PURE__ */ React22.createElement(BorderCornersIcon, { fontSize: "tiny" }),
|
|
724
|
+
items: corners,
|
|
725
|
+
multiSizeType: "border-radius"
|
|
726
|
+
}
|
|
727
|
+
));
|
|
1288
728
|
};
|
|
1289
729
|
|
|
1290
|
-
// src/components/style-sections/
|
|
1291
|
-
|
|
1292
|
-
import { __ as __19 } from "@wordpress/i18n";
|
|
730
|
+
// src/components/style-sections/border-section/border-section.tsx
|
|
731
|
+
var BorderSection = () => /* @__PURE__ */ React23.createElement(Stack6, { gap: 1.5 }, /* @__PURE__ */ React23.createElement(BorderRadiusField, null), /* @__PURE__ */ React23.createElement(Divider2, null), /* @__PURE__ */ React23.createElement(BorderField, null));
|
|
1293
732
|
|
|
1294
|
-
// src/components/
|
|
1295
|
-
import * as
|
|
1296
|
-
import {
|
|
1297
|
-
import {
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
733
|
+
// src/components/style-sections/effects-section/effects-section.tsx
|
|
734
|
+
import * as React24 from "react";
|
|
735
|
+
import { BoxShadowRepeaterControl } from "@elementor/editor-controls";
|
|
736
|
+
import { Stack as Stack7 } from "@elementor/ui";
|
|
737
|
+
var EffectsSection = () => {
|
|
738
|
+
return /* @__PURE__ */ React24.createElement(Stack7, { gap: 1.5 }, /* @__PURE__ */ React24.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React24.createElement(BoxShadowRepeaterControl, null)));
|
|
739
|
+
};
|
|
740
|
+
|
|
741
|
+
// src/components/style-sections/layout-section/layout-section.tsx
|
|
742
|
+
import * as React27 from "react";
|
|
743
|
+
import { Stack as Stack10 } from "@elementor/ui";
|
|
744
|
+
|
|
745
|
+
// src/components/style-sections/layout-section/display-field.tsx
|
|
746
|
+
import * as React25 from "react";
|
|
747
|
+
import { ControlLabel as ControlLabel6, ToggleControl } from "@elementor/editor-controls";
|
|
748
|
+
import { Stack as Stack8 } from "@elementor/ui";
|
|
749
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
750
|
+
var DisplayField = () => {
|
|
751
|
+
const options5 = [
|
|
752
|
+
{
|
|
753
|
+
value: "block",
|
|
754
|
+
renderContent: () => __8("Block", "elementor"),
|
|
755
|
+
label: __8("Block", "elementor")
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
value: "flex",
|
|
759
|
+
renderContent: () => __8("Flex", "elementor"),
|
|
760
|
+
label: __8("Flex", "elementor")
|
|
761
|
+
}
|
|
762
|
+
];
|
|
763
|
+
return /* @__PURE__ */ React25.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React25.createElement(Stack8, { gap: 1 }, /* @__PURE__ */ React25.createElement(ControlLabel6, null, __8("Display", "elementor")), /* @__PURE__ */ React25.createElement(ToggleControl, { options: options5, fullWidth: true })));
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
767
|
+
import * as React26 from "react";
|
|
768
|
+
import { ControlLabel as ControlLabel7, ToggleControl as ToggleControl2 } from "@elementor/editor-controls";
|
|
769
|
+
import {
|
|
770
|
+
JustifyBottomIcon,
|
|
771
|
+
JustifyCenterIcon,
|
|
772
|
+
JustifyDistributeVerticalIcon,
|
|
773
|
+
JustifySpaceAroundVerticalIcon,
|
|
774
|
+
JustifySpaceBetweenVerticalIcon,
|
|
775
|
+
JustifyTopIcon
|
|
776
|
+
} from "@elementor/icons";
|
|
777
|
+
import { Stack as Stack9 } from "@elementor/ui";
|
|
778
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
779
|
+
|
|
780
|
+
// src/hooks/use-direction.ts
|
|
781
|
+
import { useTheme } from "@elementor/ui";
|
|
782
|
+
function useDirection() {
|
|
783
|
+
const theme = useTheme(), extendedWindow = window;
|
|
784
|
+
const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!extendedWindow.elementorFrontend?.config?.is_rtl;
|
|
785
|
+
return { isSiteRtl, isUiRtl };
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// src/components/style-sections/layout-section/utils/rotate-flex-icon.ts
|
|
789
|
+
function rotateFlexIcon(direction = "row", initValue) {
|
|
790
|
+
const rotationIndexMap = {
|
|
791
|
+
row: 0,
|
|
792
|
+
column: 1,
|
|
793
|
+
"row-reverse": 2,
|
|
794
|
+
"column-reverse": 3
|
|
1304
795
|
};
|
|
1305
|
-
|
|
1306
|
-
|
|
796
|
+
const rotationIndex = initValue + (rotationIndexMap[direction || "row"] ?? 0);
|
|
797
|
+
return `rotate(calc(90deg * ${rotationIndex}))`;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
801
|
+
var JustifyContentField = () => {
|
|
802
|
+
const [direction] = useStylesField("flex-direction");
|
|
803
|
+
const { isUiRtl, isSiteRtl } = useDirection(), sx = { transform: rotateFlexIcon(direction, -1) }, shouldReverseOrder = isSiteRtl !== isUiRtl;
|
|
804
|
+
const StartIcon = isSiteRtl ? JustifyBottomIcon : JustifyTopIcon, EndIcon = isSiteRtl ? JustifyTopIcon : JustifyBottomIcon;
|
|
805
|
+
const options5 = [
|
|
806
|
+
{
|
|
807
|
+
value: "start",
|
|
808
|
+
label: __9("Start", "elementor"),
|
|
809
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(StartIcon, { fontSize: size, sx }),
|
|
810
|
+
showTooltip: true
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
value: "center",
|
|
814
|
+
label: __9("Center", "elementor"),
|
|
815
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(JustifyCenterIcon, { fontSize: size, sx }),
|
|
816
|
+
showTooltip: true
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
value: "end",
|
|
820
|
+
label: __9("End", "elementor"),
|
|
821
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(EndIcon, { fontSize: size, sx }),
|
|
822
|
+
showTooltip: true
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
value: "space-between",
|
|
826
|
+
label: __9("Space Between", "elementor"),
|
|
827
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(JustifySpaceBetweenVerticalIcon, { fontSize: size, sx }),
|
|
828
|
+
showTooltip: true
|
|
829
|
+
},
|
|
1307
830
|
{
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
831
|
+
value: "space-around",
|
|
832
|
+
label: __9("Space Around", "elementor"),
|
|
833
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(JustifySpaceAroundVerticalIcon, { fontSize: size, sx }),
|
|
834
|
+
showTooltip: true
|
|
1311
835
|
},
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
836
|
+
{
|
|
837
|
+
value: "space-evenly",
|
|
838
|
+
label: __9("Space Evenly", "elementor"),
|
|
839
|
+
renderContent: ({ size }) => /* @__PURE__ */ React26.createElement(JustifyDistributeVerticalIcon, { fontSize: size, sx }),
|
|
840
|
+
showTooltip: true
|
|
841
|
+
}
|
|
842
|
+
];
|
|
843
|
+
if (shouldReverseOrder) {
|
|
844
|
+
options5.reverse();
|
|
845
|
+
}
|
|
846
|
+
return /* @__PURE__ */ React26.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React26.createElement(Stack9, { gap: 1 }, /* @__PURE__ */ React26.createElement(ControlLabel7, null, __9("Justify Content", "elementor")), /* @__PURE__ */ React26.createElement(ToggleControl2, { options: options5, fullWidth: true })));
|
|
1319
847
|
};
|
|
1320
848
|
|
|
1321
|
-
// src/components/style-sections/
|
|
1322
|
-
var
|
|
1323
|
-
|
|
849
|
+
// src/components/style-sections/layout-section/layout-section.tsx
|
|
850
|
+
var LayoutSection = () => {
|
|
851
|
+
const [display] = useStylesField("display");
|
|
852
|
+
return /* @__PURE__ */ React27.createElement(Stack10, { gap: 2 }, /* @__PURE__ */ React27.createElement(DisplayField, null), "flex" === display && /* @__PURE__ */ React27.createElement(JustifyContentField, null));
|
|
1324
853
|
};
|
|
1325
854
|
|
|
1326
855
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1327
|
-
import * as
|
|
1328
|
-
import {
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
import {
|
|
1333
|
-
import {
|
|
1334
|
-
|
|
1335
|
-
|
|
856
|
+
import * as React31 from "react";
|
|
857
|
+
import { useCallback as useCallback3 } from "react";
|
|
858
|
+
import { Stack as Stack12 } from "@elementor/ui";
|
|
859
|
+
|
|
860
|
+
// src/hooks/use-style-prop-history.ts
|
|
861
|
+
import { useCallback as useCallback2, useMemo as useMemo2 } from "react";
|
|
862
|
+
import { getElementStyles, getVariantByMeta, updateStyle as updateStyle2 } from "@elementor/editor-elements";
|
|
863
|
+
|
|
864
|
+
// src/hooks/use-prop-value-history.ts
|
|
865
|
+
import { useCallback, useMemo } from "react";
|
|
866
|
+
import { getSessionStorageItem, setSessionStorageItem } from "@elementor/utils";
|
|
867
|
+
var PROPS_VALUES_HISTORY_PREFIX = "elementor/editor-editing-panel/prop-value-history";
|
|
868
|
+
var usePropValueHistory = () => {
|
|
869
|
+
const { element } = useElement();
|
|
870
|
+
const elementKey = `${PROPS_VALUES_HISTORY_PREFIX}/${element.id}`;
|
|
871
|
+
const getElementPropsHistory = useCallback(() => {
|
|
872
|
+
return getSessionStorageItem(elementKey);
|
|
873
|
+
}, [elementKey]);
|
|
874
|
+
const getPropValue = useCallback(
|
|
875
|
+
(propKey) => {
|
|
876
|
+
const elementPropValues = getElementPropsHistory();
|
|
877
|
+
return elementPropValues?.[propKey] ?? null;
|
|
878
|
+
},
|
|
879
|
+
[getElementPropsHistory]
|
|
880
|
+
);
|
|
881
|
+
const setPropValue = useCallback(
|
|
882
|
+
(propKey, propValue) => {
|
|
883
|
+
const elementPropValues = getElementPropsHistory();
|
|
884
|
+
const updatedElementPropValues = { ...elementPropValues, [propKey]: propValue };
|
|
885
|
+
setSessionStorageItem(elementKey, updatedElementPropValues);
|
|
886
|
+
},
|
|
887
|
+
[getElementPropsHistory, elementKey]
|
|
888
|
+
);
|
|
889
|
+
const removeProp = useCallback(
|
|
890
|
+
(propKey) => {
|
|
891
|
+
const elementPropValues = getElementPropsHistory();
|
|
892
|
+
const updatedElementPropValues = Object.fromEntries(
|
|
893
|
+
Object.entries(elementPropValues || {}).filter(([key]) => key !== propKey)
|
|
894
|
+
);
|
|
895
|
+
setSessionStorageItem(elementKey, updatedElementPropValues);
|
|
896
|
+
},
|
|
897
|
+
[getElementPropsHistory, elementKey]
|
|
898
|
+
);
|
|
899
|
+
return useMemo(() => ({ getPropValue, setPropValue, removeProp }), [getPropValue, removeProp, setPropValue]);
|
|
1336
900
|
};
|
|
1337
901
|
|
|
1338
|
-
// src/
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
902
|
+
// src/hooks/use-style-prop-history.ts
|
|
903
|
+
var useStylePropsHistory = (props) => {
|
|
904
|
+
const { element } = useElement();
|
|
905
|
+
const { id: styleDefID, meta } = useStyle();
|
|
906
|
+
const { getPropValue, setPropValue, removeProp } = usePropValueHistory();
|
|
907
|
+
const styleDef = getElementStyles(element.id)?.[styleDefID];
|
|
908
|
+
const styleVariant = styleDef ? getVariantByMeta(styleDef, meta) : null;
|
|
909
|
+
const styleVariantPath = `${styleDefID}-${styleVariant?.meta.breakpoint}-${styleVariant?.meta.state}`;
|
|
910
|
+
const saveStylePropsHistory = useCallback2(() => {
|
|
911
|
+
props.forEach((propKey) => {
|
|
912
|
+
const propValue = styleVariant?.props[propKey];
|
|
913
|
+
if (propValue) {
|
|
914
|
+
const propPath = `${styleVariantPath}-${propKey}`;
|
|
915
|
+
setPropValue(propPath, propValue);
|
|
916
|
+
}
|
|
917
|
+
});
|
|
918
|
+
}, [props, setPropValue, styleVariant?.props, styleVariantPath]);
|
|
919
|
+
const updateStylePropsFromHistory = useCallback2(() => {
|
|
920
|
+
const propValuesFromHistory = props.reduce((allProps, currentPropKey) => {
|
|
921
|
+
const propPath = `${styleVariantPath}-${currentPropKey}`;
|
|
922
|
+
const propHistory = getPropValue(propPath);
|
|
923
|
+
if (propHistory) {
|
|
924
|
+
removeProp(propPath);
|
|
925
|
+
return { ...allProps, [currentPropKey]: propHistory };
|
|
926
|
+
}
|
|
927
|
+
return allProps;
|
|
928
|
+
}, {});
|
|
929
|
+
if (Object.keys(propValuesFromHistory).length) {
|
|
930
|
+
updateStyle2({
|
|
931
|
+
elementID: element.id,
|
|
932
|
+
styleDefID,
|
|
933
|
+
meta,
|
|
934
|
+
props: propValuesFromHistory,
|
|
935
|
+
bind: "classes"
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
}, [element.id, getPropValue, meta, props, removeProp, styleDefID, styleVariantPath]);
|
|
939
|
+
const clearCurrentStyleProps = useCallback2(() => {
|
|
940
|
+
const resetValues = props.reduce(
|
|
941
|
+
(allProps, currentPropKey) => ({
|
|
942
|
+
...allProps,
|
|
943
|
+
[currentPropKey]: void 0
|
|
944
|
+
}),
|
|
945
|
+
{}
|
|
946
|
+
);
|
|
947
|
+
updateStyle2({
|
|
948
|
+
elementID: element.id,
|
|
949
|
+
styleDefID,
|
|
950
|
+
meta,
|
|
951
|
+
props: resetValues,
|
|
952
|
+
bind: "classes"
|
|
953
|
+
});
|
|
954
|
+
}, [element.id, meta, props, styleDefID]);
|
|
955
|
+
return useMemo2(
|
|
956
|
+
() => ({ saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps }),
|
|
957
|
+
[saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps]
|
|
958
|
+
);
|
|
1350
959
|
};
|
|
1351
960
|
|
|
1352
|
-
// src/components/style-sections/position-section/position-section.tsx
|
|
1353
|
-
import { __ as __24 } from "@wordpress/i18n";
|
|
1354
|
-
|
|
1355
961
|
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
1356
|
-
import * as
|
|
1357
|
-
import {
|
|
1358
|
-
import {
|
|
1359
|
-
import {
|
|
962
|
+
import * as React28 from "react";
|
|
963
|
+
import { ControlLabel as ControlLabel8, SizeControl as SizeControl2 } from "@elementor/editor-controls";
|
|
964
|
+
import { SideBottomIcon as SideBottomIcon2, SideLeftIcon as SideLeftIcon2, SideRightIcon as SideRightIcon2, SideTopIcon as SideTopIcon2 } from "@elementor/icons";
|
|
965
|
+
import { Grid as Grid4, Stack as Stack11 } from "@elementor/ui";
|
|
966
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
1360
967
|
var sideIcons = {
|
|
1361
|
-
left: /* @__PURE__ */
|
|
1362
|
-
right: /* @__PURE__ */
|
|
1363
|
-
top: /* @__PURE__ */
|
|
1364
|
-
bottom: /* @__PURE__ */
|
|
968
|
+
left: /* @__PURE__ */ React28.createElement(SideLeftIcon2, { fontSize: "tiny" }),
|
|
969
|
+
right: /* @__PURE__ */ React28.createElement(SideRightIcon2, { fontSize: "tiny" }),
|
|
970
|
+
top: /* @__PURE__ */ React28.createElement(SideTopIcon2, { fontSize: "tiny" }),
|
|
971
|
+
bottom: /* @__PURE__ */ React28.createElement(SideBottomIcon2, { fontSize: "tiny" })
|
|
1365
972
|
};
|
|
1366
973
|
var DimensionsField = () => {
|
|
1367
|
-
return /* @__PURE__ */
|
|
974
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(DimensionField, { side: "top", label: __10("Top", "elementor") }), /* @__PURE__ */ React28.createElement(DimensionField, { side: "right", label: __10("Right", "elementor") })), /* @__PURE__ */ React28.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(DimensionField, { side: "bottom", label: __10("Bottom", "elementor") }), /* @__PURE__ */ React28.createElement(DimensionField, { side: "left", label: __10("Left", "elementor") })));
|
|
1368
975
|
};
|
|
1369
976
|
var DimensionField = ({ side, label }) => {
|
|
1370
|
-
return /* @__PURE__ */
|
|
977
|
+
return /* @__PURE__ */ React28.createElement(Grid4, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React28.createElement(Grid4, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(ControlLabel8, null, label)), /* @__PURE__ */ React28.createElement(Grid4, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(StylesField, { bind: side }, /* @__PURE__ */ React28.createElement(SizeControl2, { startIcon: sideIcons[side] }))));
|
|
978
|
+
};
|
|
979
|
+
|
|
980
|
+
// src/components/style-sections/position-section/position-field.tsx
|
|
981
|
+
import * as React29 from "react";
|
|
982
|
+
import { ControlLabel as ControlLabel9, SelectControl as SelectControl3 } from "@elementor/editor-controls";
|
|
983
|
+
import { Grid as Grid5 } from "@elementor/ui";
|
|
984
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
985
|
+
var positionOptions = [
|
|
986
|
+
{ label: __11("Static", "elementor"), value: "static" },
|
|
987
|
+
{ label: __11("Relative", "elementor"), value: "relative" },
|
|
988
|
+
{ label: __11("Absolute", "elementor"), value: "absolute" },
|
|
989
|
+
{ label: __11("Fixed", "elementor"), value: "fixed" }
|
|
990
|
+
];
|
|
991
|
+
var PositionField = () => {
|
|
992
|
+
return /* @__PURE__ */ React29.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React29.createElement(Grid5, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React29.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React29.createElement(ControlLabel9, null, __11("Position", "elementor"))), /* @__PURE__ */ React29.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React29.createElement(SelectControl3, { options: positionOptions }))));
|
|
993
|
+
};
|
|
994
|
+
|
|
995
|
+
// src/components/style-sections/position-section/z-index-field.tsx
|
|
996
|
+
import * as React30 from "react";
|
|
997
|
+
import { ControlLabel as ControlLabel10, NumberControl } from "@elementor/editor-controls";
|
|
998
|
+
import { Grid as Grid6 } from "@elementor/ui";
|
|
999
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
1000
|
+
var ZIndexField = () => {
|
|
1001
|
+
return /* @__PURE__ */ React30.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React30.createElement(Grid6, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel10, null, __12("Z-Index", "elementor"))), /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(NumberControl, null))));
|
|
1371
1002
|
};
|
|
1372
1003
|
|
|
1373
1004
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1005
|
+
var dimensionsPropKeys = ["top", "bottom", "left", "right"];
|
|
1374
1006
|
var PositionSection = () => {
|
|
1375
1007
|
const [positionValue] = useStylesField("position");
|
|
1008
|
+
usePositionChangeHandler();
|
|
1376
1009
|
const isNotStatic = positionValue && positionValue !== "static";
|
|
1377
|
-
return /* @__PURE__ */
|
|
1010
|
+
return /* @__PURE__ */ React31.createElement(Stack12, { gap: 1.5 }, /* @__PURE__ */ React31.createElement(PositionField, null), isNotStatic ? /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(DimensionsField, null), /* @__PURE__ */ React31.createElement(ZIndexField, null)) : null);
|
|
1011
|
+
};
|
|
1012
|
+
var usePositionChangeHandler = () => {
|
|
1013
|
+
const dimensionsHistory = useStylePropsHistory(dimensionsPropKeys);
|
|
1014
|
+
const onPositionChange = useCallback3(
|
|
1015
|
+
(newPositionValue, previousPosition) => {
|
|
1016
|
+
if (!dimensionsHistory) {
|
|
1017
|
+
return;
|
|
1018
|
+
}
|
|
1019
|
+
const { saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps } = dimensionsHistory;
|
|
1020
|
+
if (newPositionValue === "static") {
|
|
1021
|
+
saveStylePropsHistory();
|
|
1022
|
+
clearCurrentStyleProps();
|
|
1023
|
+
} else if (previousPosition === "static") {
|
|
1024
|
+
updateStylePropsFromHistory();
|
|
1025
|
+
}
|
|
1026
|
+
previousPosition = newPositionValue;
|
|
1027
|
+
},
|
|
1028
|
+
[dimensionsHistory]
|
|
1029
|
+
);
|
|
1030
|
+
const [, , registerChangeListener] = useStylesField("position");
|
|
1031
|
+
registerChangeListener?.(onPositionChange);
|
|
1378
1032
|
};
|
|
1379
1033
|
|
|
1380
|
-
// src/components/style-sections/
|
|
1381
|
-
import * as
|
|
1382
|
-
import {
|
|
1383
|
-
import {
|
|
1384
|
-
|
|
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();
|
|
1392
|
-
const { top, right, bottom, left, isLinked = true } = value?.value || {};
|
|
1393
|
-
const setLinkedValue = (position, newValue) => {
|
|
1394
|
-
const updatedValue = {
|
|
1395
|
-
isLinked,
|
|
1396
|
-
top: isLinked ? newValue : top,
|
|
1397
|
-
right: isLinked ? newValue : right,
|
|
1398
|
-
bottom: isLinked ? newValue : bottom,
|
|
1399
|
-
left: isLinked ? newValue : left,
|
|
1400
|
-
[position]: newValue
|
|
1401
|
-
};
|
|
1402
|
-
setValue({
|
|
1403
|
-
$$type: "linked-dimensions",
|
|
1404
|
-
value: updatedValue
|
|
1405
|
-
});
|
|
1406
|
-
};
|
|
1407
|
-
const toggleLinked = () => {
|
|
1408
|
-
const updatedValue = {
|
|
1409
|
-
isLinked: !isLinked,
|
|
1410
|
-
top,
|
|
1411
|
-
right: !isLinked ? top : right,
|
|
1412
|
-
bottom: !isLinked ? top : bottom,
|
|
1413
|
-
left: !isLinked ? top : left
|
|
1414
|
-
};
|
|
1415
|
-
setValue({
|
|
1416
|
-
$$type: "linked-dimensions",
|
|
1417
|
-
value: updatedValue
|
|
1418
|
-
});
|
|
1419
|
-
};
|
|
1420
|
-
const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
|
|
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(
|
|
1422
|
-
ToggleButton3,
|
|
1423
|
-
{
|
|
1424
|
-
"aria-label": __25("Link Inputs", "elementor"),
|
|
1425
|
-
size: "tiny",
|
|
1426
|
-
value: "check",
|
|
1427
|
-
selected: isLinked,
|
|
1428
|
-
sx: { marginLeft: "auto" },
|
|
1429
|
-
onChange: toggleLinked
|
|
1430
|
-
},
|
|
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,
|
|
1434
|
-
{
|
|
1435
|
-
bind: "top",
|
|
1436
|
-
value: top,
|
|
1437
|
-
setValue: setLinkedValue,
|
|
1438
|
-
startIcon: /* @__PURE__ */ React49.createElement(SideTopIcon2, { fontSize: "tiny" })
|
|
1439
|
-
}
|
|
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,
|
|
1442
|
-
{
|
|
1443
|
-
bind: "right",
|
|
1444
|
-
value: right,
|
|
1445
|
-
setValue: setLinkedValue,
|
|
1446
|
-
startIcon: /* @__PURE__ */ React49.createElement(SideRightIcon2, { fontSize: "tiny" })
|
|
1447
|
-
}
|
|
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,
|
|
1450
|
-
{
|
|
1451
|
-
bind: "bottom",
|
|
1452
|
-
value: bottom,
|
|
1453
|
-
setValue: setLinkedValue,
|
|
1454
|
-
startIcon: /* @__PURE__ */ React49.createElement(SideBottomIcon2, { fontSize: "tiny" })
|
|
1455
|
-
}
|
|
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,
|
|
1458
|
-
{
|
|
1459
|
-
bind: "left",
|
|
1460
|
-
value: left,
|
|
1461
|
-
setValue: setLinkedValue,
|
|
1462
|
-
startIcon: /* @__PURE__ */ React49.createElement(SideLeftIcon2, { fontSize: "tiny" })
|
|
1463
|
-
}
|
|
1464
|
-
)))));
|
|
1465
|
-
});
|
|
1466
|
-
var Control5 = ({
|
|
1467
|
-
bind,
|
|
1468
|
-
startIcon,
|
|
1469
|
-
value,
|
|
1470
|
-
setValue
|
|
1471
|
-
}) => /* @__PURE__ */ React49.createElement(BoundPropProvider, { setValue: (newValue) => setValue(bind, newValue), value, bind }, /* @__PURE__ */ React49.createElement(SizeControl, { startIcon }));
|
|
1034
|
+
// src/components/style-sections/size-section/size-section.tsx
|
|
1035
|
+
import * as React33 from "react";
|
|
1036
|
+
import { ControlLabel as ControlLabel12, SizeControl as SizeControl3 } from "@elementor/editor-controls";
|
|
1037
|
+
import { Divider as Divider3, Grid as Grid8, Stack as Stack13 } from "@elementor/ui";
|
|
1038
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
1472
1039
|
|
|
1473
|
-
// src/components/style-sections/
|
|
1474
|
-
|
|
1475
|
-
|
|
1040
|
+
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1041
|
+
import * as React32 from "react";
|
|
1042
|
+
import { ControlLabel as ControlLabel11, ToggleControl as ToggleControl3 } from "@elementor/editor-controls";
|
|
1043
|
+
import { ExpandBottomIcon, EyeIcon, EyeOffIcon } from "@elementor/icons";
|
|
1044
|
+
import { Grid as Grid7 } from "@elementor/ui";
|
|
1045
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
1046
|
+
var options = [
|
|
1047
|
+
{
|
|
1048
|
+
value: "visible",
|
|
1049
|
+
label: __13("Visible", "elementor"),
|
|
1050
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(EyeIcon, { fontSize: size }),
|
|
1051
|
+
showTooltip: true
|
|
1052
|
+
},
|
|
1053
|
+
{
|
|
1054
|
+
value: "hidden",
|
|
1055
|
+
label: __13("Hidden", "elementor"),
|
|
1056
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(EyeOffIcon, { fontSize: size }),
|
|
1057
|
+
showTooltip: true
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
value: "auto",
|
|
1061
|
+
label: __13("Auto", "elementor"),
|
|
1062
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(ExpandBottomIcon, { fontSize: size }),
|
|
1063
|
+
showTooltip: true
|
|
1064
|
+
}
|
|
1065
|
+
];
|
|
1066
|
+
var OverflowField = () => {
|
|
1067
|
+
return /* @__PURE__ */ React32.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React32.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel11, null, __13("Overflow", "elementor"))), /* @__PURE__ */ React32.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React32.createElement(ToggleControl3, { options }))));
|
|
1476
1068
|
};
|
|
1477
1069
|
|
|
1478
|
-
// src/components/style-sections/
|
|
1479
|
-
|
|
1480
|
-
|
|
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))));
|
|
1070
|
+
// src/components/style-sections/size-section/size-section.tsx
|
|
1071
|
+
var SizeSection = () => {
|
|
1072
|
+
return /* @__PURE__ */ React33.createElement(Stack13, { gap: 1.5 }, /* @__PURE__ */ React33.createElement(Grid8, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "width", label: __14("Width", "elementor") })), /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "height", label: __14("Height", "elementor") }))), /* @__PURE__ */ React33.createElement(Grid8, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "min-width", label: __14("Min. Width", "elementor") })), /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "min-height", label: __14("Min. Height", "elementor") }))), /* @__PURE__ */ React33.createElement(Grid8, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "max-width", label: __14("Max. Width", "elementor") })), /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeField, { bind: "max-height", label: __14("Max. Height", "elementor") }))), /* @__PURE__ */ React33.createElement(Divider3, null), /* @__PURE__ */ React33.createElement(Stack13, null, /* @__PURE__ */ React33.createElement(OverflowField, null)));
|
|
1484
1073
|
};
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
import * as React53 from "react";
|
|
1488
|
-
import { __ as __29 } from "@wordpress/i18n";
|
|
1489
|
-
import { Stack as Stack17 } from "@elementor/ui";
|
|
1490
|
-
|
|
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))));
|
|
1074
|
+
var SizeField = ({ label, bind }) => {
|
|
1075
|
+
return /* @__PURE__ */ React33.createElement(StylesField, { bind }, /* @__PURE__ */ React33.createElement(Grid8, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React33.createElement(ControlLabel12, null, label)), /* @__PURE__ */ React33.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React33.createElement(SizeControl3, null))));
|
|
1497
1076
|
};
|
|
1498
1077
|
|
|
1499
|
-
// src/components/style-sections/
|
|
1500
|
-
|
|
1501
|
-
|
|
1078
|
+
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1079
|
+
import * as React34 from "react";
|
|
1080
|
+
import { LinkedDimensionsControl } from "@elementor/editor-controls";
|
|
1081
|
+
import { Divider as Divider4, Stack as Stack14 } from "@elementor/ui";
|
|
1082
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
1083
|
+
var SpacingSection = () => {
|
|
1084
|
+
return /* @__PURE__ */ React34.createElement(Stack14, { gap: 1.5 }, /* @__PURE__ */ React34.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React34.createElement(LinkedDimensionsControl, { label: __15("Padding", "elementor") })), /* @__PURE__ */ React34.createElement(Divider4, null), /* @__PURE__ */ React34.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React34.createElement(LinkedDimensionsControl, { label: __15("Margin", "elementor") })));
|
|
1502
1085
|
};
|
|
1503
1086
|
|
|
1504
|
-
// src/components/style-sections/
|
|
1505
|
-
import * as
|
|
1506
|
-
import { Divider as
|
|
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";
|
|
1512
|
-
import {
|
|
1513
|
-
BorderCornersIcon,
|
|
1514
|
-
RadiusBottomLeftIcon,
|
|
1515
|
-
RadiusBottomRightIcon,
|
|
1516
|
-
RadiusTopLeftIcon,
|
|
1517
|
-
RadiusTopRightIcon
|
|
1518
|
-
} from "@elementor/icons";
|
|
1087
|
+
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1088
|
+
import * as React48 from "react";
|
|
1089
|
+
import { Divider as Divider5, Stack as Stack17 } from "@elementor/ui";
|
|
1519
1090
|
|
|
1520
|
-
// src/
|
|
1521
|
-
import * as
|
|
1522
|
-
import {
|
|
1523
|
-
import {
|
|
1524
|
-
import { __ as
|
|
1525
|
-
|
|
1526
|
-
const [
|
|
1527
|
-
|
|
1528
|
-
(
|
|
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 });
|
|
1538
|
-
};
|
|
1539
|
-
const setNestedProp = (item, newValue) => {
|
|
1540
|
-
const { bind } = item;
|
|
1541
|
-
const newValues = {
|
|
1542
|
-
...actualValue,
|
|
1543
|
-
[bind]: newValue
|
|
1544
|
-
};
|
|
1545
|
-
setActualValue(newValues);
|
|
1546
|
-
};
|
|
1547
|
-
const setEqualValues = (newValue) => {
|
|
1548
|
-
const equalValues = items.reduce((values, item) => {
|
|
1549
|
-
return {
|
|
1550
|
-
...values,
|
|
1551
|
-
[item.bind]: newValue
|
|
1552
|
-
};
|
|
1553
|
-
}, {});
|
|
1554
|
-
setActualValue(equalValues);
|
|
1091
|
+
// src/components/collapsible-content.tsx
|
|
1092
|
+
import * as React35 from "react";
|
|
1093
|
+
import { useState as useState2 } from "react";
|
|
1094
|
+
import { Button, Collapse as Collapse3, Stack as Stack15 } from "@elementor/ui";
|
|
1095
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
1096
|
+
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
1097
|
+
const [open, setOpen] = useState2(defaultOpen);
|
|
1098
|
+
const handleToggle = () => {
|
|
1099
|
+
setOpen((prevOpen) => !prevOpen);
|
|
1555
1100
|
};
|
|
1556
|
-
|
|
1557
|
-
|
|
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,
|
|
1567
|
-
{
|
|
1568
|
-
size: "tiny",
|
|
1569
|
-
value: "check",
|
|
1570
|
-
sx: { marginLeft: "auto" },
|
|
1571
|
-
...bindToggle(popupState),
|
|
1572
|
-
selected: popupState.isOpen
|
|
1573
|
-
},
|
|
1574
|
-
icon
|
|
1575
|
-
)
|
|
1576
|
-
}
|
|
1577
|
-
))), /* @__PURE__ */ React54.createElement(
|
|
1578
|
-
Popover2,
|
|
1101
|
+
return /* @__PURE__ */ React35.createElement(Stack15, { sx: { py: 0.5 } }, /* @__PURE__ */ React35.createElement(
|
|
1102
|
+
Button,
|
|
1579
1103
|
{
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
}
|
|
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
|
-
}
|
|
1104
|
+
fullWidth: true,
|
|
1105
|
+
size: "small",
|
|
1106
|
+
color: "secondary",
|
|
1107
|
+
variant: "outlined",
|
|
1108
|
+
onClick: handleToggle,
|
|
1109
|
+
endIcon: /* @__PURE__ */ React35.createElement(CollapseIcon, { open })
|
|
1594
1110
|
},
|
|
1595
|
-
|
|
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 })))));
|
|
1111
|
+
open ? __16("Show less", "elementor") : __16("Show more", "elementor")
|
|
1112
|
+
), /* @__PURE__ */ React35.createElement(Collapse3, { in: open, timeout: "auto", unmountOnExit: true }, children));
|
|
1606
1113
|
};
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
}
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
setValue: (val) => setValue(val),
|
|
1619
|
-
value: isMixed ? void 0 : values[0]
|
|
1620
|
-
},
|
|
1621
|
-
/* @__PURE__ */ React54.createElement(Stack18, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React54.createElement(SizeControl, { placeholder: __30("MIXED", "elementor") }), iconButton)
|
|
1622
|
-
);
|
|
1114
|
+
|
|
1115
|
+
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1116
|
+
import * as React36 from "react";
|
|
1117
|
+
import { ControlLabel as ControlLabel13, FontFamilyControl } from "@elementor/editor-controls";
|
|
1118
|
+
import { Grid as Grid9 } from "@elementor/ui";
|
|
1119
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
1120
|
+
|
|
1121
|
+
// src/sync/get-elementor-config.ts
|
|
1122
|
+
var getElementorConfig = () => {
|
|
1123
|
+
const extendedWindow = window;
|
|
1124
|
+
return extendedWindow.elementor?.config ?? {};
|
|
1623
1125
|
};
|
|
1624
1126
|
|
|
1625
|
-
// src/components/style-sections/
|
|
1626
|
-
var
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
},
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
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"
|
|
1127
|
+
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1128
|
+
var FontFamilyField = () => {
|
|
1129
|
+
const fontFamilies = getFontFamilies();
|
|
1130
|
+
if (!fontFamilies) {
|
|
1131
|
+
return null;
|
|
1132
|
+
}
|
|
1133
|
+
return /* @__PURE__ */ React36.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React36.createElement(Grid9, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel13, null, __17("Font Family", "elementor"))), /* @__PURE__ */ React36.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(FontFamilyControl, { fontFamilies }))));
|
|
1134
|
+
};
|
|
1135
|
+
var getFontFamilies = () => {
|
|
1136
|
+
const { controls } = getElementorConfig();
|
|
1137
|
+
const options5 = controls?.font?.options;
|
|
1138
|
+
if (!options5) {
|
|
1139
|
+
return null;
|
|
1646
1140
|
}
|
|
1141
|
+
return options5;
|
|
1142
|
+
};
|
|
1143
|
+
|
|
1144
|
+
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1145
|
+
import * as React37 from "react";
|
|
1146
|
+
import { ControlLabel as ControlLabel14, SizeControl as SizeControl4 } from "@elementor/editor-controls";
|
|
1147
|
+
import { Grid as Grid10 } from "@elementor/ui";
|
|
1148
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
1149
|
+
var FontSizeField = () => {
|
|
1150
|
+
return /* @__PURE__ */ React37.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React37.createElement(Grid10, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel14, null, __18("Font Size", "elementor"))), /* @__PURE__ */ React37.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(SizeControl4, null))));
|
|
1151
|
+
};
|
|
1152
|
+
|
|
1153
|
+
// src/components/style-sections/typography-section/font-weight-field.tsx
|
|
1154
|
+
import * as React38 from "react";
|
|
1155
|
+
import { ControlLabel as ControlLabel15, SelectControl as SelectControl4 } from "@elementor/editor-controls";
|
|
1156
|
+
import { Grid as Grid11 } from "@elementor/ui";
|
|
1157
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
1158
|
+
var fontWeightOptions = [
|
|
1159
|
+
{ label: __19("Light - 400", "elementor"), value: "400" },
|
|
1160
|
+
{ label: __19("Regular - 500", "elementor"), value: "500" },
|
|
1161
|
+
{ label: __19("Semi Bold - 600", "elementor"), value: "600" },
|
|
1162
|
+
{ label: __19("Bold - 700", "elementor"), value: "700" },
|
|
1163
|
+
{ label: __19("Black - 900", "elementor"), value: "900" }
|
|
1647
1164
|
];
|
|
1648
|
-
var
|
|
1649
|
-
return /* @__PURE__ */
|
|
1650
|
-
EqualUnequalSizesControl,
|
|
1651
|
-
{
|
|
1652
|
-
label: __31("Border Radius", "elementor"),
|
|
1653
|
-
icon: /* @__PURE__ */ React55.createElement(BorderCornersIcon, { fontSize: "tiny" }),
|
|
1654
|
-
items: corners,
|
|
1655
|
-
multiSizeType: "border-radius"
|
|
1656
|
-
}
|
|
1657
|
-
));
|
|
1165
|
+
var FontWeightField = () => {
|
|
1166
|
+
return /* @__PURE__ */ React38.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React38.createElement(Grid11, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React38.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(ControlLabel15, null, __19("Font Weight", "elementor"))), /* @__PURE__ */ React38.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(SelectControl4, { options: fontWeightOptions }))));
|
|
1658
1167
|
};
|
|
1659
1168
|
|
|
1660
|
-
// src/components/style-sections/
|
|
1661
|
-
import * as
|
|
1662
|
-
import {
|
|
1169
|
+
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
1170
|
+
import * as React39 from "react";
|
|
1171
|
+
import { ControlLabel as ControlLabel16, SizeControl as SizeControl5 } from "@elementor/editor-controls";
|
|
1172
|
+
import { Grid as Grid12 } from "@elementor/ui";
|
|
1173
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
1174
|
+
var LetterSpacingField = () => {
|
|
1175
|
+
return /* @__PURE__ */ React39.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React39.createElement(Grid12, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel16, null, __20("Letter Spacing", "elementor"))), /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(SizeControl5, null))));
|
|
1176
|
+
};
|
|
1663
1177
|
|
|
1664
|
-
// src/components/style-sections/
|
|
1665
|
-
import * as
|
|
1666
|
-
import {
|
|
1667
|
-
import {
|
|
1668
|
-
|
|
1178
|
+
// src/components/style-sections/typography-section/text-alignment-field.tsx
|
|
1179
|
+
import * as React40 from "react";
|
|
1180
|
+
import { ControlLabel as ControlLabel17, ToggleControl as ToggleControl4 } from "@elementor/editor-controls";
|
|
1181
|
+
import { AlignCenterIcon, AlignJustifiedIcon, AlignLeftIcon, AlignRightIcon } from "@elementor/icons";
|
|
1182
|
+
import { Grid as Grid13 } from "@elementor/ui";
|
|
1183
|
+
import { __ as __21 } from "@wordpress/i18n";
|
|
1184
|
+
var options2 = [
|
|
1669
1185
|
{
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1186
|
+
value: "left",
|
|
1187
|
+
label: __21("Left", "elementor"),
|
|
1188
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(AlignLeftIcon, { fontSize: size })
|
|
1673
1189
|
},
|
|
1674
1190
|
{
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1191
|
+
value: "center",
|
|
1192
|
+
label: __21("Center", "elementor"),
|
|
1193
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(AlignCenterIcon, { fontSize: size })
|
|
1678
1194
|
},
|
|
1679
1195
|
{
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1196
|
+
value: "right",
|
|
1197
|
+
label: __21("Right", "elementor"),
|
|
1198
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(AlignRightIcon, { fontSize: size })
|
|
1683
1199
|
},
|
|
1684
1200
|
{
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1201
|
+
value: "justify",
|
|
1202
|
+
label: __21("Justify", "elementor"),
|
|
1203
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(AlignJustifiedIcon, { fontSize: size })
|
|
1688
1204
|
}
|
|
1689
1205
|
];
|
|
1690
|
-
var
|
|
1691
|
-
return /* @__PURE__ */
|
|
1692
|
-
EqualUnequalSizesControl,
|
|
1693
|
-
{
|
|
1694
|
-
label: __32("Border Width", "elementor"),
|
|
1695
|
-
icon: /* @__PURE__ */ React56.createElement(SideAllIcon, { fontSize: "tiny" }),
|
|
1696
|
-
items: edges,
|
|
1697
|
-
multiSizeType: "border-width"
|
|
1698
|
-
}
|
|
1699
|
-
));
|
|
1206
|
+
var TextAlignmentField = () => {
|
|
1207
|
+
return /* @__PURE__ */ React40.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React40.createElement(Grid13, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlLabel17, null, __21("Alignment", "elementor"))), /* @__PURE__ */ React40.createElement(Grid13, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React40.createElement(ToggleControl4, { options: options2 }))));
|
|
1700
1208
|
};
|
|
1701
1209
|
|
|
1702
|
-
// src/components/style-sections/
|
|
1703
|
-
import * as
|
|
1704
|
-
import {
|
|
1705
|
-
import { Grid as
|
|
1706
|
-
|
|
1707
|
-
|
|
1210
|
+
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
1211
|
+
import * as React41 from "react";
|
|
1212
|
+
import { ColorControl as ColorControl3, ControlLabel as ControlLabel18 } from "@elementor/editor-controls";
|
|
1213
|
+
import { Grid as Grid14 } from "@elementor/ui";
|
|
1214
|
+
import { __ as __22 } from "@wordpress/i18n";
|
|
1215
|
+
var TextColorField = () => {
|
|
1216
|
+
return /* @__PURE__ */ React41.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React41.createElement(Grid14, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlLabel18, null, __22("Text Color", "elementor"))), /* @__PURE__ */ React41.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ColorControl3, null))));
|
|
1708
1217
|
};
|
|
1709
1218
|
|
|
1710
|
-
// src/components/style-sections/
|
|
1711
|
-
import * as
|
|
1712
|
-
import {
|
|
1713
|
-
import {
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
{
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
{
|
|
1723
|
-
|
|
1219
|
+
// src/components/style-sections/typography-section/text-direction-field.tsx
|
|
1220
|
+
import * as React42 from "react";
|
|
1221
|
+
import { ControlLabel as ControlLabel19, ToggleControl as ToggleControl5 } from "@elementor/editor-controls";
|
|
1222
|
+
import { TextDirectionLtrIcon, TextDirectionRtlIcon } from "@elementor/icons";
|
|
1223
|
+
import { Grid as Grid15 } from "@elementor/ui";
|
|
1224
|
+
import { __ as __23 } from "@wordpress/i18n";
|
|
1225
|
+
var options3 = [
|
|
1226
|
+
{
|
|
1227
|
+
value: "ltr",
|
|
1228
|
+
label: __23("Left to Right", "elementor"),
|
|
1229
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(TextDirectionLtrIcon, { fontSize: size })
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
value: "rtl",
|
|
1233
|
+
label: __23("Right to Left", "elementor"),
|
|
1234
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(TextDirectionRtlIcon, { fontSize: size })
|
|
1235
|
+
}
|
|
1724
1236
|
];
|
|
1725
|
-
var
|
|
1726
|
-
return /* @__PURE__ */
|
|
1237
|
+
var TextDirectionField = () => {
|
|
1238
|
+
return /* @__PURE__ */ React42.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React42.createElement(Grid15, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(ControlLabel19, null, __23("Direction", "elementor"))), /* @__PURE__ */ React42.createElement(Grid15, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React42.createElement(ToggleControl5, { options: options3 }))));
|
|
1727
1239
|
};
|
|
1728
1240
|
|
|
1729
|
-
// src/components/
|
|
1730
|
-
import * as
|
|
1731
|
-
import {
|
|
1732
|
-
import {
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1241
|
+
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1242
|
+
import * as React44 from "react";
|
|
1243
|
+
import { ControlLabel as ControlLabel20, StrokeControl } from "@elementor/editor-controls";
|
|
1244
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
1245
|
+
|
|
1246
|
+
// src/components/collapsible-field.tsx
|
|
1247
|
+
import * as React43 from "react";
|
|
1248
|
+
import { useState as useState3 } from "react";
|
|
1249
|
+
import { MinusIcon as MinusIcon2, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
1250
|
+
import { Collapse as Collapse4, IconButton as IconButton3, Stack as Stack16 } from "@elementor/ui";
|
|
1251
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
1252
|
+
var CollapsibleField = ({ label, children, defaultOpen = false }) => {
|
|
1253
|
+
const [open, setOpen] = useState3(defaultOpen);
|
|
1254
|
+
const handleToggle = () => {
|
|
1255
|
+
setOpen((prevOpen) => !prevOpen);
|
|
1256
|
+
};
|
|
1257
|
+
return /* @__PURE__ */ React43.createElement(Stack16, { gap: 1.5 }, /* @__PURE__ */ React43.createElement(Stack16, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { py: 0.5 } }, label, /* @__PURE__ */ React43.createElement(
|
|
1258
|
+
IconButton3,
|
|
1737
1259
|
{
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
alignItems: "center"
|
|
1742
|
-
}
|
|
1260
|
+
onClick: handleToggle,
|
|
1261
|
+
size: "tiny",
|
|
1262
|
+
"aria-label": open ? __24("Close", "elementor") : __24("Expand", "elementor")
|
|
1743
1263
|
},
|
|
1744
|
-
/* @__PURE__ */
|
|
1745
|
-
|
|
1746
|
-
), /* @__PURE__ */ React59.createElement(Collapse3, { in: isAdded }, /* @__PURE__ */ React59.createElement(Stack19, { gap: 1.5 }, children)));
|
|
1264
|
+
open ? /* @__PURE__ */ React43.createElement(MinusIcon2, { fontSize: "tiny" }) : /* @__PURE__ */ React43.createElement(PlusIcon2, { fontSize: "tiny" })
|
|
1265
|
+
)), /* @__PURE__ */ React43.createElement(Collapse4, { in: open, unmountOnExit: true }, children));
|
|
1747
1266
|
};
|
|
1748
1267
|
|
|
1749
|
-
// src/components/style-sections/
|
|
1750
|
-
var
|
|
1751
|
-
|
|
1752
|
-
$$type: "border-width",
|
|
1753
|
-
value: { top: initialSize, right: initialSize, bottom: initialSize, left: initialSize }
|
|
1268
|
+
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1269
|
+
var TextStrokeField = () => {
|
|
1270
|
+
return /* @__PURE__ */ React44.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React44.createElement(CollapsibleField, { label: /* @__PURE__ */ React44.createElement(ControlLabel20, null, __25("Text Stroke", "elementor")) }, /* @__PURE__ */ React44.createElement(StrokeControl, null)));
|
|
1754
1271
|
};
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
const
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
setBorderStyle(null);
|
|
1770
|
-
};
|
|
1771
|
-
const hasBorder = Boolean(borderWidth || borderColor || borderStyle);
|
|
1772
|
-
return /* @__PURE__ */ React60.createElement(
|
|
1773
|
-
AddOrRemoveContent,
|
|
1272
|
+
|
|
1273
|
+
// src/components/style-sections/typography-section/text-style-field.tsx
|
|
1274
|
+
import * as React45 from "react";
|
|
1275
|
+
import { ControlLabel as ControlLabel21 } from "@elementor/editor-controls";
|
|
1276
|
+
import { ItalicIcon, StrikethroughIcon, UnderlineIcon } from "@elementor/icons";
|
|
1277
|
+
import { Grid as Grid16, ToggleButton as ToggleButtonBase, ToggleButtonGroup } from "@elementor/ui";
|
|
1278
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
1279
|
+
var buttonSize = "tiny";
|
|
1280
|
+
var TextStyleField = () => {
|
|
1281
|
+
const [fontStyle, setFontStyle] = useStylesField("font-style");
|
|
1282
|
+
const [textDecoration, setTextDecoration] = useStylesField("text-decoration");
|
|
1283
|
+
const formats = [fontStyle, ...(textDecoration || "").split(" ")];
|
|
1284
|
+
return /* @__PURE__ */ React45.createElement(Grid16, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(ControlLabel21, null, __26("Style", "elementor"))), /* @__PURE__ */ React45.createElement(Grid16, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React45.createElement(ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React45.createElement(
|
|
1285
|
+
ToggleButton,
|
|
1774
1286
|
{
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1287
|
+
value: "italic",
|
|
1288
|
+
onChange: (v) => setFontStyle(fontStyle === v ? null : v),
|
|
1289
|
+
"aria-label": "italic",
|
|
1290
|
+
sx: { marginLeft: "auto" }
|
|
1779
1291
|
},
|
|
1780
|
-
/* @__PURE__ */
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1292
|
+
/* @__PURE__ */ React45.createElement(ItalicIcon, { fontSize: buttonSize })
|
|
1293
|
+
), /* @__PURE__ */ React45.createElement(
|
|
1294
|
+
ShorthandControl,
|
|
1295
|
+
{
|
|
1296
|
+
value: "line-through",
|
|
1297
|
+
currentValues: textDecoration || "",
|
|
1298
|
+
updateValues: setTextDecoration,
|
|
1299
|
+
"aria-label": "line-through"
|
|
1300
|
+
},
|
|
1301
|
+
/* @__PURE__ */ React45.createElement(StrikethroughIcon, { fontSize: buttonSize })
|
|
1302
|
+
), /* @__PURE__ */ React45.createElement(
|
|
1303
|
+
ShorthandControl,
|
|
1304
|
+
{
|
|
1305
|
+
value: "underline",
|
|
1306
|
+
currentValues: textDecoration || "",
|
|
1307
|
+
updateValues: setTextDecoration,
|
|
1308
|
+
"aria-label": "underline"
|
|
1309
|
+
},
|
|
1310
|
+
/* @__PURE__ */ React45.createElement(UnderlineIcon, { fontSize: buttonSize })
|
|
1311
|
+
))));
|
|
1312
|
+
};
|
|
1313
|
+
var ShorthandControl = ({
|
|
1314
|
+
children,
|
|
1315
|
+
value,
|
|
1316
|
+
currentValues,
|
|
1317
|
+
updateValues,
|
|
1318
|
+
"aria-label": ariaLabel
|
|
1319
|
+
}) => {
|
|
1320
|
+
const valuesArr = currentValues.split(" ").filter(Boolean);
|
|
1321
|
+
const selected = valuesArr.includes(value);
|
|
1322
|
+
const toggleValue = (newValue) => {
|
|
1323
|
+
if (selected) {
|
|
1324
|
+
updateValues(valuesArr.filter((v) => v !== newValue).join(" ") || null);
|
|
1325
|
+
} else {
|
|
1326
|
+
updateValues([...valuesArr, newValue].join(" "));
|
|
1327
|
+
}
|
|
1328
|
+
};
|
|
1329
|
+
return /* @__PURE__ */ React45.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
1330
|
+
};
|
|
1331
|
+
var ToggleButton = ({ onChange, ...props }) => {
|
|
1332
|
+
const handleChange = (_e, newValue) => {
|
|
1333
|
+
onChange(newValue);
|
|
1334
|
+
};
|
|
1335
|
+
return /* @__PURE__ */ React45.createElement(ToggleButtonBase, { ...props, onChange: handleChange, size: buttonSize });
|
|
1784
1336
|
};
|
|
1785
1337
|
|
|
1786
|
-
// src/components/style-sections/
|
|
1787
|
-
|
|
1338
|
+
// src/components/style-sections/typography-section/transform-field.tsx
|
|
1339
|
+
import * as React46 from "react";
|
|
1340
|
+
import { ControlLabel as ControlLabel22, ToggleControl as ToggleControl6 } from "@elementor/editor-controls";
|
|
1341
|
+
import { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon } from "@elementor/icons";
|
|
1342
|
+
import { Grid as Grid17 } from "@elementor/ui";
|
|
1343
|
+
import { __ as __27 } from "@wordpress/i18n";
|
|
1344
|
+
var options4 = [
|
|
1345
|
+
{
|
|
1346
|
+
value: "capitalize",
|
|
1347
|
+
label: __27("Capitalize", "elementor"),
|
|
1348
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(LetterCaseIcon, { fontSize: size })
|
|
1349
|
+
},
|
|
1350
|
+
{
|
|
1351
|
+
value: "uppercase",
|
|
1352
|
+
label: __27("Uppercase", "elementor"),
|
|
1353
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(LetterCaseUpperIcon, { fontSize: size })
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
value: "lowercase",
|
|
1357
|
+
label: __27("Lowercase", "elementor"),
|
|
1358
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(LetterCaseLowerIcon, { fontSize: size })
|
|
1359
|
+
}
|
|
1360
|
+
];
|
|
1361
|
+
var TransformField = () => /* @__PURE__ */ React46.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React46.createElement(Grid17, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlLabel22, null, __27("Transform", "elementor"))), /* @__PURE__ */ React46.createElement(Grid17, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React46.createElement(ToggleControl6, { options: options4 }))));
|
|
1362
|
+
|
|
1363
|
+
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
1364
|
+
import * as React47 from "react";
|
|
1365
|
+
import { ControlLabel as ControlLabel23, SizeControl as SizeControl6 } from "@elementor/editor-controls";
|
|
1366
|
+
import { Grid as Grid18 } from "@elementor/ui";
|
|
1367
|
+
import { __ as __28 } from "@wordpress/i18n";
|
|
1368
|
+
var WordSpacingField = () => {
|
|
1369
|
+
return /* @__PURE__ */ React47.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React47.createElement(Grid18, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React47.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(ControlLabel23, null, __28("Word Spacing", "elementor"))), /* @__PURE__ */ React47.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(SizeControl6, null))));
|
|
1370
|
+
};
|
|
1371
|
+
|
|
1372
|
+
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1373
|
+
var TypographySection = () => {
|
|
1374
|
+
return /* @__PURE__ */ React48.createElement(Stack17, { gap: 1.5 }, /* @__PURE__ */ React48.createElement(FontFamilyField, null), /* @__PURE__ */ React48.createElement(FontWeightField, null), /* @__PURE__ */ React48.createElement(FontSizeField, null), /* @__PURE__ */ React48.createElement(Divider5, null), /* @__PURE__ */ React48.createElement(TextColorField, null), /* @__PURE__ */ React48.createElement(CollapsibleContent, null, /* @__PURE__ */ React48.createElement(Stack17, { gap: 1.5, sx: { pt: 1.5 } }, /* @__PURE__ */ React48.createElement(LetterSpacingField, null), /* @__PURE__ */ React48.createElement(WordSpacingField, null), /* @__PURE__ */ React48.createElement(Divider5, null), /* @__PURE__ */ React48.createElement(TextAlignmentField, null), /* @__PURE__ */ React48.createElement(TextStyleField, null), /* @__PURE__ */ React48.createElement(TransformField, null), /* @__PURE__ */ React48.createElement(TextDirectionField, null), /* @__PURE__ */ React48.createElement(TextStrokeField, null))));
|
|
1375
|
+
};
|
|
1788
1376
|
|
|
1789
1377
|
// src/components/style-tab.tsx
|
|
1790
1378
|
var CLASSES_PROP_KEY = "classes";
|
|
1791
1379
|
var StyleTab = () => {
|
|
1792
1380
|
const currentClassesProp = useCurrentClassesProp();
|
|
1793
|
-
const [
|
|
1381
|
+
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
1794
1382
|
const breakpoint = useActiveBreakpoint();
|
|
1795
|
-
return /* @__PURE__ */
|
|
1383
|
+
return /* @__PURE__ */ React49.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React49.createElement(StyleProvider, { meta: { breakpoint, state: null }, id: activeStyleDefId, setId: setActiveStyleDefId }, /* @__PURE__ */ React49.createElement(CssClassSelectorSection, null), /* @__PURE__ */ React49.createElement(Divider6, null), /* @__PURE__ */ React49.createElement(SectionsList, null, /* @__PURE__ */ React49.createElement(Section, { title: __29("Layout", "elementor") }, /* @__PURE__ */ React49.createElement(LayoutSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: __29("Spacing", "elementor") }, /* @__PURE__ */ React49.createElement(SpacingSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: __29("Size", "elementor") }, /* @__PURE__ */ React49.createElement(SizeSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: __29("Position", "elementor") }, /* @__PURE__ */ React49.createElement(PositionSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: __29("Typography", "elementor") }, /* @__PURE__ */ React49.createElement(TypographySection, null)), /* @__PURE__ */ React49.createElement(Section, { title: __29("Background", "elementor") }, /* @__PURE__ */ React49.createElement(BackgroundSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: __29("Border", "elementor") }, /* @__PURE__ */ React49.createElement(BorderSection, null)), /* @__PURE__ */ React49.createElement(Section, { title: __29("Effects", "elementor") }, /* @__PURE__ */ React49.createElement(EffectsSection, null)))));
|
|
1796
1384
|
};
|
|
1797
|
-
function
|
|
1385
|
+
function useActiveStyleDefId(currentClassesProp) {
|
|
1386
|
+
const [activeStyledDefId, setActiveStyledDefId] = useState4(null);
|
|
1387
|
+
const fallback = useFirstElementStyleDef(currentClassesProp);
|
|
1388
|
+
const newId = useGeneratedId();
|
|
1389
|
+
return [activeStyledDefId || fallback?.id || newId, setActiveStyledDefId];
|
|
1390
|
+
}
|
|
1391
|
+
function useFirstElementStyleDef(currentClassesProp) {
|
|
1798
1392
|
const { element } = useElement();
|
|
1799
|
-
const
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1393
|
+
const classesIds = useElementSetting3(element.id, currentClassesProp)?.value || [];
|
|
1394
|
+
const stylesDefs = useElementStyles2(element.id);
|
|
1395
|
+
return Object.values(stylesDefs).find((styleDef) => classesIds.includes(styleDef.id));
|
|
1396
|
+
}
|
|
1397
|
+
function useGeneratedId() {
|
|
1398
|
+
const { element } = useElement();
|
|
1399
|
+
const stylesDefs = useElementStyles2(element.id);
|
|
1400
|
+
return generateId(`e-${element.id}-`, Object.keys(stylesDefs));
|
|
1805
1401
|
}
|
|
1806
1402
|
function useCurrentClassesProp() {
|
|
1807
1403
|
const { elementType } = useElement();
|
|
@@ -1816,64 +1412,17 @@ function useCurrentClassesProp() {
|
|
|
1816
1412
|
|
|
1817
1413
|
// src/components/editing-panel-tabs.tsx
|
|
1818
1414
|
var EditingPanelTabs = () => {
|
|
1415
|
+
const { element } = useElement();
|
|
1819
1416
|
const { getTabProps, getTabPanelProps, getTabsProps } = useTabs("settings");
|
|
1820
|
-
return
|
|
1417
|
+
return (
|
|
1418
|
+
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
1419
|
+
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
1420
|
+
/* @__PURE__ */ React50.createElement(Fragment5, { key: element.id }, /* @__PURE__ */ React50.createElement(Stack18, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React50.createElement(Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React50.createElement(Tab, { label: __30("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React50.createElement(Tab, { label: __30("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React50.createElement(Divider7, null), /* @__PURE__ */ React50.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React50.createElement(SettingsTab, null)), /* @__PURE__ */ React50.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React50.createElement(StyleTab, null))))
|
|
1421
|
+
);
|
|
1821
1422
|
};
|
|
1822
1423
|
|
|
1823
1424
|
// src/components/editing-panel.tsx
|
|
1824
|
-
|
|
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
|
-
|
|
1876
|
-
// src/components/editing-panel.tsx
|
|
1425
|
+
var { useMenuItems } = controlActionsMenu;
|
|
1877
1426
|
var EditingPanel = () => {
|
|
1878
1427
|
const { element, elementType } = useSelectedElement();
|
|
1879
1428
|
const controlReplacement = getControlReplacement();
|
|
@@ -1881,8 +1430,8 @@ var EditingPanel = () => {
|
|
|
1881
1430
|
if (!element || !elementType) {
|
|
1882
1431
|
return null;
|
|
1883
1432
|
}
|
|
1884
|
-
const panelTitle =
|
|
1885
|
-
return /* @__PURE__ */
|
|
1433
|
+
const panelTitle = __31("Edit %s", "elementor").replace("%s", elementType.title);
|
|
1434
|
+
return /* @__PURE__ */ React51.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React51.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React51.createElement(Panel, null, /* @__PURE__ */ React51.createElement(PanelHeader, null, /* @__PURE__ */ React51.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React51.createElement(PanelBody, null, /* @__PURE__ */ React51.createElement(ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React51.createElement(ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React51.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React51.createElement(EditingPanelTabs, null)))))));
|
|
1886
1435
|
};
|
|
1887
1436
|
|
|
1888
1437
|
// src/panel.ts
|
|
@@ -1891,12 +1440,9 @@ var { panel, usePanelActions, usePanelStatus } = createPanel({
|
|
|
1891
1440
|
component: EditingPanel
|
|
1892
1441
|
});
|
|
1893
1442
|
|
|
1894
|
-
// src/
|
|
1895
|
-
import { injectIntoLogic } from "@elementor/editor";
|
|
1896
|
-
|
|
1897
|
-
// src/sync/should-use-v2-panel.ts
|
|
1443
|
+
// src/sync/is-atomic-widget-selected.ts
|
|
1898
1444
|
import { getSelectedElements, getWidgetsCache } from "@elementor/editor-elements";
|
|
1899
|
-
var
|
|
1445
|
+
var isAtomicWidgetSelected = () => {
|
|
1900
1446
|
const selectedElements = getSelectedElements();
|
|
1901
1447
|
const widgetCache = getWidgetsCache();
|
|
1902
1448
|
if (selectedElements.length !== 1) {
|
|
@@ -1905,14 +1451,29 @@ var shouldUseV2Panel = () => {
|
|
|
1905
1451
|
return !!widgetCache?.[selectedElements[0].type]?.atomic_controls;
|
|
1906
1452
|
};
|
|
1907
1453
|
|
|
1454
|
+
// src/hooks/use-close-editor-panel.ts
|
|
1455
|
+
var useCloseEditorPanel = () => {
|
|
1456
|
+
const { close } = usePanelActions();
|
|
1457
|
+
return useEffect2(() => {
|
|
1458
|
+
return listenTo(commandStartEvent("document/elements/delete"), (e) => {
|
|
1459
|
+
const selectedElement = getSelectedElements2()[0];
|
|
1460
|
+
const { container: deletedContainer } = e?.args;
|
|
1461
|
+
const isSelectedElementInDeletedContainer = deletedContainer && selectedElement && isElementInContainer(selectedElement, deletedContainer);
|
|
1462
|
+
if (isSelectedElementInDeletedContainer && isAtomicWidgetSelected()) {
|
|
1463
|
+
close();
|
|
1464
|
+
}
|
|
1465
|
+
});
|
|
1466
|
+
}, []);
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1908
1469
|
// src/hooks/use-open-editor-panel.ts
|
|
1909
|
-
import { useEffect as
|
|
1910
|
-
import {
|
|
1470
|
+
import { useEffect as useEffect3 } from "react";
|
|
1471
|
+
import { __privateListenTo as listenTo2, commandStartEvent as commandStartEvent2 } from "@elementor/editor-v1-adapters";
|
|
1911
1472
|
var useOpenEditorPanel = () => {
|
|
1912
1473
|
const { open } = usePanelActions();
|
|
1913
|
-
|
|
1914
|
-
return
|
|
1915
|
-
if (
|
|
1474
|
+
useEffect3(() => {
|
|
1475
|
+
return listenTo2(commandStartEvent2("panel/editor/open"), () => {
|
|
1476
|
+
if (isAtomicWidgetSelected()) {
|
|
1916
1477
|
open();
|
|
1917
1478
|
}
|
|
1918
1479
|
});
|
|
@@ -1922,54 +1483,53 @@ var useOpenEditorPanel = () => {
|
|
|
1922
1483
|
// src/components/editing-panel-hooks.tsx
|
|
1923
1484
|
var EditingPanelHooks = () => {
|
|
1924
1485
|
useOpenEditorPanel();
|
|
1486
|
+
useCloseEditorPanel();
|
|
1925
1487
|
return null;
|
|
1926
1488
|
};
|
|
1927
1489
|
|
|
1928
|
-
// src/init.ts
|
|
1929
|
-
import { __registerPanel as registerPanel } from "@elementor/editor-panels";
|
|
1930
|
-
import { __privateBlockDataCommand as blockDataCommand } from "@elementor/editor-v1-adapters";
|
|
1931
|
-
|
|
1932
1490
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1933
|
-
import * as
|
|
1934
|
-
import { useId as
|
|
1935
|
-
import {
|
|
1936
|
-
import { DatabaseIcon, SettingsIcon, XIcon as
|
|
1491
|
+
import * as React54 from "react";
|
|
1492
|
+
import { useId as useId3 } from "react";
|
|
1493
|
+
import { ControlLabel as ControlLabel24, useBoundProp as useBoundProp3 } from "@elementor/editor-controls";
|
|
1494
|
+
import { DatabaseIcon, SettingsIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
1937
1495
|
import {
|
|
1938
|
-
bindPopover as
|
|
1939
|
-
bindTrigger
|
|
1496
|
+
bindPopover as bindPopover2,
|
|
1497
|
+
bindTrigger,
|
|
1940
1498
|
Box as Box5,
|
|
1941
|
-
|
|
1499
|
+
Divider as Divider9,
|
|
1500
|
+
IconButton as IconButton4,
|
|
1942
1501
|
Paper,
|
|
1943
|
-
Popover as
|
|
1944
|
-
Stack as
|
|
1945
|
-
Typography as Typography6,
|
|
1946
|
-
UnstableTag as Tag,
|
|
1947
|
-
usePopupState as usePopupState5,
|
|
1948
|
-
Tabs as Tabs2,
|
|
1949
|
-
Divider as Divider6,
|
|
1950
|
-
useTabs as useTabs2,
|
|
1502
|
+
Popover as Popover2,
|
|
1503
|
+
Stack as Stack20,
|
|
1951
1504
|
Tab as Tab2,
|
|
1952
|
-
TabPanel as TabPanel2
|
|
1505
|
+
TabPanel as TabPanel2,
|
|
1506
|
+
Tabs as Tabs2,
|
|
1507
|
+
Typography as Typography4,
|
|
1508
|
+
UnstableTag as Tag,
|
|
1509
|
+
usePopupState as usePopupState2,
|
|
1510
|
+
useTabs as useTabs2
|
|
1953
1511
|
} from "@elementor/ui";
|
|
1512
|
+
import { __ as __33 } from "@wordpress/i18n";
|
|
1954
1513
|
|
|
1955
1514
|
// src/dynamics/dynamic-control.tsx
|
|
1956
|
-
import * as
|
|
1515
|
+
import * as React52 from "react";
|
|
1516
|
+
import { BoundPropProvider as BoundPropProvider3, useBoundProp } from "@elementor/editor-controls";
|
|
1957
1517
|
|
|
1958
1518
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
1959
|
-
import { useMemo as
|
|
1519
|
+
import { useMemo as useMemo4 } from "react";
|
|
1960
1520
|
|
|
1961
1521
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1962
|
-
import { useMemo } from "react";
|
|
1522
|
+
import { useMemo as useMemo3 } from "react";
|
|
1963
1523
|
|
|
1964
1524
|
// src/dynamics/sync/get-elementor-config.ts
|
|
1965
|
-
var
|
|
1525
|
+
var getElementorConfig2 = () => {
|
|
1966
1526
|
const extendedWindow = window;
|
|
1967
1527
|
return extendedWindow.elementor?.config ?? {};
|
|
1968
1528
|
};
|
|
1969
1529
|
|
|
1970
1530
|
// src/dynamics/sync/get-atomic-dynamic-tags.ts
|
|
1971
1531
|
var getAtomicDynamicTags = () => {
|
|
1972
|
-
const { atomicDynamicTags } =
|
|
1532
|
+
const { atomicDynamicTags } = getElementorConfig2();
|
|
1973
1533
|
if (!atomicDynamicTags) {
|
|
1974
1534
|
return null;
|
|
1975
1535
|
}
|
|
@@ -2003,7 +1563,7 @@ var usePropDynamicTags = (propName) => {
|
|
|
2003
1563
|
const propDynamicType = getDynamicPropType(propType);
|
|
2004
1564
|
categories = propDynamicType?.settings.categories || [];
|
|
2005
1565
|
}
|
|
2006
|
-
return
|
|
1566
|
+
return useMemo3(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
2007
1567
|
};
|
|
2008
1568
|
var getDynamicTagsByCategories = (categories) => {
|
|
2009
1569
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -2019,7 +1579,7 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
2019
1579
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2020
1580
|
var useDynamicTag = (propName, tagName) => {
|
|
2021
1581
|
const dynamicTags = usePropDynamicTags(propName);
|
|
2022
|
-
return
|
|
1582
|
+
return useMemo4(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
2023
1583
|
};
|
|
2024
1584
|
|
|
2025
1585
|
// src/dynamics/dynamic-control.tsx
|
|
@@ -2044,53 +1604,33 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
2044
1604
|
}
|
|
2045
1605
|
});
|
|
2046
1606
|
};
|
|
2047
|
-
return /* @__PURE__ */
|
|
1607
|
+
return /* @__PURE__ */ React52.createElement(BoundPropProvider3, { setValue: setDynamicValue, value: dynamicValue, bind }, children);
|
|
2048
1608
|
};
|
|
2049
1609
|
|
|
2050
1610
|
// src/dynamics/components/dynamic-selection.tsx
|
|
2051
|
-
import * as
|
|
2052
|
-
import {
|
|
2053
|
-
import {
|
|
1611
|
+
import * as React53 from "react";
|
|
1612
|
+
import { Fragment as Fragment6, useState as useState5 } from "react";
|
|
1613
|
+
import { useBoundProp as useBoundProp2 } from "@elementor/editor-controls";
|
|
1614
|
+
import { PhotoIcon, SearchIcon } from "@elementor/icons";
|
|
2054
1615
|
import {
|
|
2055
1616
|
Box as Box4,
|
|
2056
|
-
Divider as
|
|
2057
|
-
InputAdornment
|
|
1617
|
+
Divider as Divider8,
|
|
1618
|
+
InputAdornment,
|
|
2058
1619
|
Link,
|
|
2059
1620
|
ListSubheader,
|
|
2060
|
-
MenuItem
|
|
1621
|
+
MenuItem,
|
|
2061
1622
|
MenuList,
|
|
2062
|
-
Stack as
|
|
2063
|
-
TextField as
|
|
2064
|
-
Typography as
|
|
1623
|
+
Stack as Stack19,
|
|
1624
|
+
TextField as TextField2,
|
|
1625
|
+
Typography as Typography3
|
|
2065
1626
|
} from "@elementor/ui";
|
|
2066
|
-
import { __ as
|
|
2067
|
-
|
|
2068
|
-
// src/dynamics/hooks/use-prop-value-history.ts
|
|
2069
|
-
var PROPS_VALUES_HISTORY_KEY = "elementor/dynamic/non-dynamic-values-history";
|
|
2070
|
-
var usePropValueHistory = (path) => {
|
|
2071
|
-
const valuesHistory = getValues();
|
|
2072
|
-
const { element } = useElement();
|
|
2073
|
-
const key = `${element.id}-${path}`;
|
|
2074
|
-
const value = valuesHistory[key] ?? null;
|
|
2075
|
-
const setValue = (newValue) => {
|
|
2076
|
-
setValues({ ...valuesHistory, [key]: newValue });
|
|
2077
|
-
};
|
|
2078
|
-
return [value, setValue];
|
|
2079
|
-
};
|
|
2080
|
-
var getValues = () => {
|
|
2081
|
-
return JSON.parse(sessionStorage.getItem(PROPS_VALUES_HISTORY_KEY) || "{}");
|
|
2082
|
-
};
|
|
2083
|
-
var setValues = (values) => {
|
|
2084
|
-
sessionStorage.setItem(PROPS_VALUES_HISTORY_KEY, JSON.stringify(values));
|
|
2085
|
-
};
|
|
2086
|
-
|
|
2087
|
-
// src/dynamics/components/dynamic-selection.tsx
|
|
2088
|
-
var SIZE4 = "tiny";
|
|
1627
|
+
import { __ as __32 } from "@wordpress/i18n";
|
|
1628
|
+
var SIZE3 = "tiny";
|
|
2089
1629
|
var DynamicSelection = ({ onSelect }) => {
|
|
2090
|
-
const [searchValue, setSearchValue] =
|
|
1630
|
+
const [searchValue, setSearchValue] = useState5("");
|
|
2091
1631
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
2092
|
-
const { bind, value: currentValue, setValue } =
|
|
2093
|
-
const
|
|
1632
|
+
const { bind, value: currentValue, setValue } = useBoundProp2();
|
|
1633
|
+
const { setPropValue: updatePropValueHistory } = usePropValueHistory();
|
|
2094
1634
|
const isCurrentValueDynamic = isDynamicPropValue(currentValue);
|
|
2095
1635
|
const options5 = useFilteredOptions(bind, searchValue);
|
|
2096
1636
|
const handleSearch = (event) => {
|
|
@@ -2098,27 +1638,27 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2098
1638
|
};
|
|
2099
1639
|
const handleSetDynamicTag = (value) => {
|
|
2100
1640
|
if (!isCurrentValueDynamic) {
|
|
2101
|
-
updatePropValueHistory(currentValue);
|
|
1641
|
+
updatePropValueHistory(bind, currentValue);
|
|
2102
1642
|
}
|
|
2103
1643
|
setValue({ $$type: "dynamic", value: { name: value, settings: {} } });
|
|
2104
1644
|
onSelect?.();
|
|
2105
1645
|
};
|
|
2106
|
-
return /* @__PURE__ */
|
|
2107
|
-
|
|
1646
|
+
return /* @__PURE__ */ React53.createElement(Stack19, null, /* @__PURE__ */ React53.createElement(Box4, { px: 1.5, pb: 1 }, /* @__PURE__ */ React53.createElement(
|
|
1647
|
+
TextField2,
|
|
2108
1648
|
{
|
|
2109
1649
|
fullWidth: true,
|
|
2110
|
-
size:
|
|
1650
|
+
size: SIZE3,
|
|
2111
1651
|
value: searchValue,
|
|
2112
1652
|
onChange: handleSearch,
|
|
2113
|
-
placeholder:
|
|
1653
|
+
placeholder: __32("Search dynamic tag", "elementor"),
|
|
2114
1654
|
InputProps: {
|
|
2115
|
-
startAdornment: /* @__PURE__ */
|
|
1655
|
+
startAdornment: /* @__PURE__ */ React53.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React53.createElement(SearchIcon, { fontSize: SIZE3 }))
|
|
2116
1656
|
}
|
|
2117
1657
|
}
|
|
2118
|
-
)), /* @__PURE__ */
|
|
1658
|
+
)), /* @__PURE__ */ React53.createElement(Divider8, null), /* @__PURE__ */ React53.createElement(Box4, { sx: { overflowY: "auto", height: 260, width: 220 } }, options5.length > 0 ? /* @__PURE__ */ React53.createElement(MenuList, { role: "listbox", tabIndex: 0 }, options5.map(([category, items], index) => /* @__PURE__ */ React53.createElement(Fragment6, { key: index }, /* @__PURE__ */ React53.createElement(ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items.map(({ value, label: tagLabel }) => {
|
|
2119
1659
|
const isSelected = isCurrentValueDynamic && value === currentValue?.value?.name;
|
|
2120
|
-
return /* @__PURE__ */
|
|
2121
|
-
|
|
1660
|
+
return /* @__PURE__ */ React53.createElement(
|
|
1661
|
+
MenuItem,
|
|
2122
1662
|
{
|
|
2123
1663
|
key: value,
|
|
2124
1664
|
selected: isSelected,
|
|
@@ -2128,7 +1668,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2128
1668
|
},
|
|
2129
1669
|
tagLabel
|
|
2130
1670
|
);
|
|
2131
|
-
})))) : /* @__PURE__ */
|
|
1671
|
+
})))) : /* @__PURE__ */ React53.createElement(Stack19, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React53.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React53.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, __32("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React53.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React53.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React53.createElement(
|
|
2132
1672
|
Link,
|
|
2133
1673
|
{
|
|
2134
1674
|
color: "secondary",
|
|
@@ -2136,8 +1676,8 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2136
1676
|
component: "button",
|
|
2137
1677
|
onClick: () => setSearchValue("")
|
|
2138
1678
|
},
|
|
2139
|
-
|
|
2140
|
-
), "\xA0",
|
|
1679
|
+
__32("Clear the filters", "elementor")
|
|
1680
|
+
), "\xA0", __32("and try again.", "elementor")))));
|
|
2141
1681
|
};
|
|
2142
1682
|
var useFilteredOptions = (bind, searchValue) => {
|
|
2143
1683
|
const dynamicTags = usePropDynamicTags(bind);
|
|
@@ -2156,72 +1696,73 @@ var useFilteredOptions = (bind, searchValue) => {
|
|
|
2156
1696
|
};
|
|
2157
1697
|
|
|
2158
1698
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
2159
|
-
var
|
|
1699
|
+
var SIZE4 = "tiny";
|
|
2160
1700
|
var DynamicSelectionControl = () => {
|
|
2161
|
-
const { bind, value, setValue } =
|
|
2162
|
-
const
|
|
1701
|
+
const { bind, value, setValue } = useBoundProp3();
|
|
1702
|
+
const { getPropValue: getPropValueFromHistory } = usePropValueHistory();
|
|
2163
1703
|
const { name: tagName = "" } = value?.value || {};
|
|
2164
|
-
const selectionPopoverId =
|
|
2165
|
-
const selectionPopoverState =
|
|
1704
|
+
const selectionPopoverId = useId3();
|
|
1705
|
+
const selectionPopoverState = usePopupState2({ variant: "popover", popupId: selectionPopoverId });
|
|
2166
1706
|
const dynamicTag = useDynamicTag(bind, tagName);
|
|
2167
1707
|
const removeDynamicTag = () => {
|
|
2168
|
-
|
|
1708
|
+
const propValue = getPropValueFromHistory(bind);
|
|
1709
|
+
setValue(propValue ?? null);
|
|
2169
1710
|
};
|
|
2170
1711
|
if (!dynamicTag) {
|
|
2171
1712
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
2172
1713
|
}
|
|
2173
|
-
return /* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ React54.createElement(Box5, null, /* @__PURE__ */ React54.createElement(
|
|
2174
1715
|
Tag,
|
|
2175
1716
|
{
|
|
2176
1717
|
fullWidth: true,
|
|
2177
1718
|
showActionsOnHover: true,
|
|
2178
1719
|
label: dynamicTag.label,
|
|
2179
|
-
startIcon: /* @__PURE__ */
|
|
2180
|
-
...
|
|
2181
|
-
actions: /* @__PURE__ */
|
|
2182
|
-
|
|
1720
|
+
startIcon: /* @__PURE__ */ React54.createElement(DatabaseIcon, { fontSize: SIZE4 }),
|
|
1721
|
+
...bindTrigger(selectionPopoverState),
|
|
1722
|
+
actions: /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React54.createElement(
|
|
1723
|
+
IconButton4,
|
|
2183
1724
|
{
|
|
2184
|
-
size:
|
|
1725
|
+
size: SIZE4,
|
|
2185
1726
|
onClick: removeDynamicTag,
|
|
2186
|
-
"aria-label":
|
|
1727
|
+
"aria-label": __33("Remove dynamic value", "elementor")
|
|
2187
1728
|
},
|
|
2188
|
-
/* @__PURE__ */
|
|
1729
|
+
/* @__PURE__ */ React54.createElement(XIcon2, { fontSize: SIZE4 })
|
|
2189
1730
|
))
|
|
2190
1731
|
}
|
|
2191
|
-
), /* @__PURE__ */
|
|
2192
|
-
|
|
1732
|
+
), /* @__PURE__ */ React54.createElement(
|
|
1733
|
+
Popover2,
|
|
2193
1734
|
{
|
|
2194
1735
|
disablePortal: true,
|
|
2195
1736
|
disableScrollLock: true,
|
|
2196
1737
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
2197
|
-
...
|
|
1738
|
+
...bindPopover2(selectionPopoverState)
|
|
2198
1739
|
},
|
|
2199
|
-
/* @__PURE__ */
|
|
1740
|
+
/* @__PURE__ */ React54.createElement(Stack20, null, /* @__PURE__ */ React54.createElement(Stack20, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React54.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React54.createElement(Typography4, { variant: "subtitle2" }, __33("Dynamic Tags", "elementor")), /* @__PURE__ */ React54.createElement(IconButton4, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React54.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React54.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
2200
1741
|
));
|
|
2201
1742
|
};
|
|
2202
1743
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
2203
|
-
const popupId =
|
|
2204
|
-
const settingsPopupState =
|
|
1744
|
+
const popupId = useId3();
|
|
1745
|
+
const settingsPopupState = usePopupState2({ variant: "popover", popupId });
|
|
2205
1746
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
2206
1747
|
if (!hasDynamicSettings) {
|
|
2207
1748
|
return null;
|
|
2208
1749
|
}
|
|
2209
|
-
return /* @__PURE__ */
|
|
2210
|
-
|
|
1750
|
+
return /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(
|
|
1751
|
+
IconButton4,
|
|
2211
1752
|
{
|
|
2212
|
-
size:
|
|
2213
|
-
...
|
|
2214
|
-
"aria-label":
|
|
1753
|
+
size: SIZE4,
|
|
1754
|
+
...bindTrigger(settingsPopupState),
|
|
1755
|
+
"aria-label": __33("Settings", "elementor")
|
|
2215
1756
|
},
|
|
2216
|
-
/* @__PURE__ */
|
|
2217
|
-
), /* @__PURE__ */
|
|
2218
|
-
|
|
1757
|
+
/* @__PURE__ */ React54.createElement(SettingsIcon, { fontSize: SIZE4 })
|
|
1758
|
+
), /* @__PURE__ */ React54.createElement(
|
|
1759
|
+
Popover2,
|
|
2219
1760
|
{
|
|
2220
1761
|
disableScrollLock: true,
|
|
2221
1762
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
2222
|
-
...
|
|
1763
|
+
...bindPopover2(settingsPopupState)
|
|
2223
1764
|
},
|
|
2224
|
-
/* @__PURE__ */
|
|
1765
|
+
/* @__PURE__ */ React54.createElement(Paper, { component: Stack20, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React54.createElement(Stack20, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React54.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React54.createElement(Typography4, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React54.createElement(IconButton4, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React54.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React54.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
2225
1766
|
));
|
|
2226
1767
|
};
|
|
2227
1768
|
var DynamicSettings = ({ controls }) => {
|
|
@@ -2230,40 +1771,42 @@ var DynamicSettings = ({ controls }) => {
|
|
|
2230
1771
|
if (!tabs.length) {
|
|
2231
1772
|
return null;
|
|
2232
1773
|
}
|
|
2233
|
-
return /* @__PURE__ */
|
|
2234
|
-
return /* @__PURE__ */
|
|
1774
|
+
return /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(Tabs2, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React54.createElement(Tab2, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React54.createElement(Divider9, null), tabs.map(({ value }, index) => {
|
|
1775
|
+
return /* @__PURE__ */ React54.createElement(TabPanel2, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React54.createElement(Stack20, { gap: 1, px: 2 }, value.items.map((item) => {
|
|
2235
1776
|
if (item.type === "control") {
|
|
2236
|
-
return /* @__PURE__ */
|
|
1777
|
+
return /* @__PURE__ */ React54.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
2237
1778
|
}
|
|
2238
1779
|
return null;
|
|
2239
1780
|
})));
|
|
2240
1781
|
}));
|
|
2241
1782
|
};
|
|
2242
|
-
var
|
|
1783
|
+
var Control3 = ({ control }) => {
|
|
2243
1784
|
if (!getControlByType(control.type)) {
|
|
2244
1785
|
return null;
|
|
2245
1786
|
}
|
|
2246
|
-
return /* @__PURE__ */
|
|
1787
|
+
return /* @__PURE__ */ React54.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React54.createElement(ControlLabel24, null, control.label) : null, /* @__PURE__ */ React54.createElement(Control, { type: control.type, props: control.props }));
|
|
2247
1788
|
};
|
|
2248
1789
|
|
|
2249
1790
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
2250
|
-
import * as
|
|
2251
|
-
import {
|
|
1791
|
+
import * as React55 from "react";
|
|
1792
|
+
import { useBoundProp as useBoundProp4 } from "@elementor/editor-controls";
|
|
2252
1793
|
import { DatabaseIcon as DatabaseIcon2 } from "@elementor/icons";
|
|
1794
|
+
import { __ as __34 } from "@wordpress/i18n";
|
|
2253
1795
|
var usePropDynamicAction = () => {
|
|
2254
|
-
const { bind } =
|
|
1796
|
+
const { bind } = useBoundProp4();
|
|
2255
1797
|
const { elementType } = useElement();
|
|
2256
1798
|
const propType = elementType.propsSchema[bind];
|
|
2257
1799
|
const visible = !!propType && supportsDynamic(propType);
|
|
2258
1800
|
return {
|
|
2259
1801
|
visible,
|
|
2260
1802
|
icon: DatabaseIcon2,
|
|
2261
|
-
title:
|
|
2262
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
1803
|
+
title: __34("Dynamic Tags", "elementor"),
|
|
1804
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React55.createElement(DynamicSelection, { onSelect: closePopover })
|
|
2263
1805
|
};
|
|
2264
1806
|
};
|
|
2265
1807
|
|
|
2266
1808
|
// src/dynamics/init.ts
|
|
1809
|
+
var { registerPopoverAction } = controlActionsMenu;
|
|
2267
1810
|
var init = () => {
|
|
2268
1811
|
replaceControl({
|
|
2269
1812
|
component: DynamicSelectionControl,
|
|
@@ -2288,7 +1831,7 @@ function init2() {
|
|
|
2288
1831
|
var blockV1Panel = () => {
|
|
2289
1832
|
blockDataCommand({
|
|
2290
1833
|
command: "panel/editor/open",
|
|
2291
|
-
condition:
|
|
1834
|
+
condition: isAtomicWidgetSelected
|
|
2292
1835
|
});
|
|
2293
1836
|
};
|
|
2294
1837
|
|
|
@@ -2296,6 +1839,6 @@ var blockV1Panel = () => {
|
|
|
2296
1839
|
init2();
|
|
2297
1840
|
export {
|
|
2298
1841
|
replaceControl,
|
|
2299
|
-
useBoundProp
|
|
1842
|
+
useBoundProp5 as useBoundProp
|
|
2300
1843
|
};
|
|
2301
1844
|
//# sourceMappingURL=index.mjs.map
|