@elementor/editor-controls 0.4.0 → 0.5.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 +20 -0
- package/dist/index.d.mts +35 -18
- package/dist/index.d.ts +35 -18
- package/dist/index.js +363 -575
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +347 -565
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/src/bound-prop-context/errors.ts +16 -0
- package/src/bound-prop-context/index.ts +3 -0
- package/src/bound-prop-context/prop-context.tsx +48 -0
- package/src/bound-prop-context/prop-key-context.tsx +103 -0
- package/src/bound-prop-context/use-bound-prop.ts +69 -0
- package/src/components/repeater.tsx +3 -13
- package/src/controls/background-control/background-control.tsx +19 -42
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +32 -48
- package/src/controls/box-shadow-repeater-control.tsx +75 -139
- package/src/controls/color-control.tsx +16 -20
- package/src/controls/equal-unequal-sizes-control.tsx +65 -139
- package/src/controls/gap-control.tsx +20 -25
- package/src/controls/image-control.tsx +19 -34
- package/src/controls/image-media-control.tsx +1 -1
- package/src/controls/link-control.tsx +57 -58
- package/src/controls/linked-dimensions-control.tsx +25 -54
- package/src/controls/number-control.tsx +1 -1
- package/src/controls/stroke-control.tsx +18 -48
- package/src/controls/url-control.tsx +4 -14
- package/src/index.ts +3 -2
- package/src/bound-prop-context.tsx +0 -67
package/dist/index.js
CHANGED
|
@@ -31,7 +31,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
BackgroundControl: () => BackgroundControl,
|
|
34
|
-
BoundPropProvider: () => BoundPropProvider,
|
|
35
34
|
BoxShadowRepeaterControl: () => BoxShadowRepeaterControl,
|
|
36
35
|
ColorControl: () => ColorControl,
|
|
37
36
|
ControlActionsProvider: () => ControlActionsProvider,
|
|
@@ -45,6 +44,8 @@ __export(index_exports, {
|
|
|
45
44
|
LinkControl: () => LinkControl,
|
|
46
45
|
LinkedDimensionsControl: () => LinkedDimensionsControl,
|
|
47
46
|
NumberControl: () => NumberControl,
|
|
47
|
+
PropKeyProvider: () => PropKeyProvider,
|
|
48
|
+
PropProvider: () => PropProvider,
|
|
48
49
|
SelectControl: () => SelectControl,
|
|
49
50
|
SizeControl: () => SizeControl,
|
|
50
51
|
StrokeControl: () => StrokeControl,
|
|
@@ -60,65 +61,161 @@ __export(index_exports, {
|
|
|
60
61
|
module.exports = __toCommonJS(index_exports);
|
|
61
62
|
|
|
62
63
|
// src/controls/image-control.tsx
|
|
63
|
-
var
|
|
64
|
+
var React10 = __toESM(require("react"));
|
|
64
65
|
var import_editor_props3 = require("@elementor/editor-props");
|
|
65
66
|
var import_ui6 = require("@elementor/ui");
|
|
66
67
|
var import_i18n2 = require("@wordpress/i18n");
|
|
67
68
|
|
|
68
|
-
// src/bound-prop-context.tsx
|
|
69
|
+
// src/bound-prop-context/prop-context.tsx
|
|
69
70
|
var React = __toESM(require("react"));
|
|
70
71
|
var import_react = require("react");
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
|
|
73
|
+
// src/bound-prop-context/errors.ts
|
|
74
|
+
var import_utils = require("@elementor/utils");
|
|
75
|
+
var MissingPropTypeError = (0, import_utils.createError)({
|
|
76
|
+
code: "missing_prop_provider_prop_type",
|
|
77
|
+
message: "Prop type is missing"
|
|
78
|
+
});
|
|
79
|
+
var UnsupportedParentError = (0, import_utils.createError)({
|
|
80
|
+
code: "unsupported_prop_provider_prop_type",
|
|
81
|
+
message: "Parent prop type is not supported"
|
|
82
|
+
});
|
|
83
|
+
var HookOutsideProviderError = (0, import_utils.createError)({
|
|
84
|
+
code: "hook_outside_provider",
|
|
85
|
+
message: "Hook used outside of provider"
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// src/bound-prop-context/prop-context.tsx
|
|
89
|
+
var PropContext = (0, import_react.createContext)(null);
|
|
90
|
+
var PropProvider = ({
|
|
91
|
+
children,
|
|
92
|
+
value,
|
|
93
|
+
setValue,
|
|
94
|
+
propType
|
|
95
|
+
}) => {
|
|
96
|
+
return /* @__PURE__ */ React.createElement(PropContext.Provider, { value: { value, setValue, propType } }, children);
|
|
74
97
|
};
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
if (!
|
|
78
|
-
throw new
|
|
98
|
+
var usePropContext = () => {
|
|
99
|
+
const context = (0, import_react.useContext)(PropContext);
|
|
100
|
+
if (!context) {
|
|
101
|
+
throw new HookOutsideProviderError({
|
|
102
|
+
context: {
|
|
103
|
+
hook: "usePropContext",
|
|
104
|
+
provider: "PropProvider"
|
|
105
|
+
}
|
|
106
|
+
});
|
|
79
107
|
}
|
|
108
|
+
return context;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
// src/bound-prop-context/prop-key-context.tsx
|
|
112
|
+
var React2 = __toESM(require("react"));
|
|
113
|
+
var import_react2 = require("react");
|
|
114
|
+
var PropKeyContext = (0, import_react2.createContext)(null);
|
|
115
|
+
var PropKeyProvider = ({ children, bind }) => {
|
|
116
|
+
const { propType } = usePropContext();
|
|
117
|
+
if (!propType) {
|
|
118
|
+
throw new MissingPropTypeError({ context: { bind } });
|
|
119
|
+
}
|
|
120
|
+
if (propType.kind === "array") {
|
|
121
|
+
return /* @__PURE__ */ React2.createElement(ArrayPropKeyProvider, { bind }, children);
|
|
122
|
+
}
|
|
123
|
+
if (propType.kind === "object") {
|
|
124
|
+
return /* @__PURE__ */ React2.createElement(ObjectPropKeyProvider, { bind }, children);
|
|
125
|
+
}
|
|
126
|
+
throw new UnsupportedParentError({ context: { propType } });
|
|
127
|
+
};
|
|
128
|
+
var ObjectPropKeyProvider = ({ children, bind }) => {
|
|
129
|
+
const context = usePropContext();
|
|
130
|
+
const setValue = (value2, options, meta) => {
|
|
131
|
+
const newValue = {
|
|
132
|
+
...context.value,
|
|
133
|
+
[bind]: value2
|
|
134
|
+
};
|
|
135
|
+
return context?.setValue(newValue, options, { ...meta, bind });
|
|
136
|
+
};
|
|
137
|
+
const value = context.value?.[bind];
|
|
138
|
+
const propType = context.propType.shape[bind];
|
|
139
|
+
return /* @__PURE__ */ React2.createElement(PropKeyContext.Provider, { value: { ...context, value, setValue, bind, propType } }, children);
|
|
140
|
+
};
|
|
141
|
+
var ArrayPropKeyProvider = ({ children, bind }) => {
|
|
142
|
+
const context = usePropContext();
|
|
143
|
+
const setValue = (value2, options) => {
|
|
144
|
+
const newValue = [...context.value ?? []];
|
|
145
|
+
newValue[Number(bind)] = value2;
|
|
146
|
+
return context?.setValue(newValue, options, { bind });
|
|
147
|
+
};
|
|
148
|
+
const value = context.value?.[Number(bind)];
|
|
149
|
+
const propType = context.propType.item_prop_type;
|
|
150
|
+
return /* @__PURE__ */ React2.createElement(PropKeyContext.Provider, { value: { ...context, value, setValue, bind, propType } }, children);
|
|
151
|
+
};
|
|
152
|
+
var usePropKeyContext = () => {
|
|
153
|
+
const context = (0, import_react2.useContext)(PropKeyContext);
|
|
154
|
+
if (!context) {
|
|
155
|
+
throw new HookOutsideProviderError({
|
|
156
|
+
context: { hook: "usePropKeyContext", provider: "PropKeyProvider" }
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
return context;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// src/bound-prop-context/use-bound-prop.ts
|
|
163
|
+
function useBoundProp(propTypeUtil) {
|
|
164
|
+
const propKeyContext = usePropKeyContext();
|
|
80
165
|
if (!propTypeUtil) {
|
|
81
|
-
return
|
|
166
|
+
return propKeyContext;
|
|
82
167
|
}
|
|
83
|
-
function setValue(value2, options) {
|
|
168
|
+
function setValue(value2, options, meta) {
|
|
84
169
|
if (value2 === null) {
|
|
85
|
-
return
|
|
170
|
+
return propKeyContext?.setValue(null, options, meta);
|
|
86
171
|
}
|
|
87
|
-
return
|
|
172
|
+
return propKeyContext?.setValue(propTypeUtil?.create(value2, options), {}, meta);
|
|
88
173
|
}
|
|
89
|
-
const
|
|
174
|
+
const propType = resolveUnionPropType(propKeyContext.propType, propTypeUtil.key);
|
|
175
|
+
const value = propTypeUtil.extract(propKeyContext.value ?? propType.default ?? null);
|
|
90
176
|
return {
|
|
91
|
-
...
|
|
177
|
+
...propKeyContext,
|
|
92
178
|
setValue,
|
|
93
|
-
value
|
|
179
|
+
value,
|
|
180
|
+
propType
|
|
94
181
|
};
|
|
95
182
|
}
|
|
183
|
+
var resolveUnionPropType = (propType, key) => {
|
|
184
|
+
let resolvedPropType = propType;
|
|
185
|
+
if (propType.kind === "union") {
|
|
186
|
+
resolvedPropType = propType.prop_types[key];
|
|
187
|
+
}
|
|
188
|
+
if (!resolvedPropType) {
|
|
189
|
+
throw new MissingPropTypeError({ context: { key } });
|
|
190
|
+
}
|
|
191
|
+
return resolvedPropType;
|
|
192
|
+
};
|
|
96
193
|
|
|
97
194
|
// src/components/control-label.tsx
|
|
98
|
-
var
|
|
195
|
+
var React3 = __toESM(require("react"));
|
|
99
196
|
var import_ui = require("@elementor/ui");
|
|
100
197
|
var ControlLabel = ({ children }) => {
|
|
101
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ React3.createElement(import_ui.Typography, { component: "label", variant: "caption", color: "text.secondary" }, children);
|
|
102
199
|
};
|
|
103
200
|
|
|
104
201
|
// src/create-control.tsx
|
|
105
|
-
var
|
|
202
|
+
var React5 = __toESM(require("react"));
|
|
106
203
|
var import_ui2 = require("@elementor/ui");
|
|
107
204
|
|
|
108
205
|
// src/create-control-replacement.tsx
|
|
109
|
-
var
|
|
110
|
-
var
|
|
111
|
-
var ControlReplacementContext = (0,
|
|
206
|
+
var React4 = __toESM(require("react"));
|
|
207
|
+
var import_react3 = require("react");
|
|
208
|
+
var ControlReplacementContext = (0, import_react3.createContext)(void 0);
|
|
112
209
|
var ControlReplacementProvider = ({
|
|
113
210
|
component,
|
|
114
211
|
condition,
|
|
115
212
|
children
|
|
116
213
|
}) => {
|
|
117
|
-
return /* @__PURE__ */
|
|
214
|
+
return /* @__PURE__ */ React4.createElement(ControlReplacementContext.Provider, { value: { component, condition } }, children);
|
|
118
215
|
};
|
|
119
216
|
var useControlReplacement = () => {
|
|
120
217
|
const { value } = useBoundProp();
|
|
121
|
-
const controlReplacement = (0,
|
|
218
|
+
const controlReplacement = (0, import_react3.useContext)(ControlReplacementContext);
|
|
122
219
|
let shouldReplace = false;
|
|
123
220
|
try {
|
|
124
221
|
shouldReplace = !!controlReplacement?.condition({ value }) && !!controlReplacement.component;
|
|
@@ -143,14 +240,14 @@ function createControl(Component, { supportsReplacements = true } = {}) {
|
|
|
143
240
|
return (props) => {
|
|
144
241
|
const ControlReplacement = useControlReplacement();
|
|
145
242
|
if (ControlReplacement && supportsReplacements) {
|
|
146
|
-
return /* @__PURE__ */
|
|
243
|
+
return /* @__PURE__ */ React5.createElement(import_ui2.ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(ControlReplacement, { ...props }));
|
|
147
244
|
}
|
|
148
|
-
return /* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */ React5.createElement(import_ui2.ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(Component, { ...props }));
|
|
149
246
|
};
|
|
150
247
|
}
|
|
151
248
|
|
|
152
249
|
// src/controls/image-media-control.tsx
|
|
153
|
-
var
|
|
250
|
+
var React8 = __toESM(require("react"));
|
|
154
251
|
var import_editor_props = require("@elementor/editor-props");
|
|
155
252
|
var import_icons = require("@elementor/icons");
|
|
156
253
|
var import_ui4 = require("@elementor/ui");
|
|
@@ -158,16 +255,16 @@ var import_wp_media = require("@elementor/wp-media");
|
|
|
158
255
|
var import_i18n = require("@wordpress/i18n");
|
|
159
256
|
|
|
160
257
|
// src/control-actions/control-actions.tsx
|
|
161
|
-
var
|
|
258
|
+
var React7 = __toESM(require("react"));
|
|
162
259
|
var import_ui3 = require("@elementor/ui");
|
|
163
260
|
|
|
164
261
|
// src/control-actions/control-actions-context.tsx
|
|
165
|
-
var
|
|
166
|
-
var
|
|
167
|
-
var Context = (0,
|
|
168
|
-
var ControlActionsProvider = ({ children, items }) => /* @__PURE__ */
|
|
262
|
+
var React6 = __toESM(require("react"));
|
|
263
|
+
var import_react4 = require("react");
|
|
264
|
+
var Context = (0, import_react4.createContext)(null);
|
|
265
|
+
var ControlActionsProvider = ({ children, items }) => /* @__PURE__ */ React6.createElement(Context.Provider, { value: { items } }, children);
|
|
169
266
|
var useControlActions = () => {
|
|
170
|
-
const context = (0,
|
|
267
|
+
const context = (0, import_react4.useContext)(Context);
|
|
171
268
|
if (!context) {
|
|
172
269
|
throw new Error("useControlActions must be used within a ControlActionsProvider");
|
|
173
270
|
}
|
|
@@ -187,8 +284,8 @@ function ControlActions({ children }) {
|
|
|
187
284
|
if (items.length === 0) {
|
|
188
285
|
return children;
|
|
189
286
|
}
|
|
190
|
-
const menuItems = items.map(({ MenuItem: MenuItem4, id }) => /* @__PURE__ */
|
|
191
|
-
return /* @__PURE__ */
|
|
287
|
+
const menuItems = items.map(({ MenuItem: MenuItem4, id }) => /* @__PURE__ */ React7.createElement(MenuItem4, { key: id }));
|
|
288
|
+
return /* @__PURE__ */ React7.createElement(FloatingBarContainer, null, /* @__PURE__ */ React7.createElement(import_ui3.UnstableFloatingActionBar, { actions: menuItems }, children));
|
|
192
289
|
}
|
|
193
290
|
|
|
194
291
|
// src/controls/image-media-control.tsx
|
|
@@ -196,7 +293,7 @@ var ImageMediaControl = createControl(() => {
|
|
|
196
293
|
const { value, setValue } = useBoundProp(import_editor_props.imageSrcPropTypeUtil);
|
|
197
294
|
const { id, url } = value ?? {};
|
|
198
295
|
const { data: attachment, isFetching } = (0, import_wp_media.useWpMediaAttachment)(id?.value || null);
|
|
199
|
-
const src = attachment?.url ?? url;
|
|
296
|
+
const src = attachment?.url ?? url?.value ?? null;
|
|
200
297
|
const { open } = (0, import_wp_media.useWpMediaFrame)({
|
|
201
298
|
types: ["image"],
|
|
202
299
|
multiple: false,
|
|
@@ -211,7 +308,7 @@ var ImageMediaControl = createControl(() => {
|
|
|
211
308
|
});
|
|
212
309
|
}
|
|
213
310
|
});
|
|
214
|
-
return /* @__PURE__ */
|
|
311
|
+
return /* @__PURE__ */ React8.createElement(import_ui4.Card, { variant: "outlined" }, /* @__PURE__ */ React8.createElement(import_ui4.CardMedia, { image: src, sx: { height: 150 } }, isFetching ? /* @__PURE__ */ React8.createElement(import_ui4.Stack, { justifyContent: "center", alignItems: "center", width: "100%", height: "100%" }, /* @__PURE__ */ React8.createElement(import_ui4.CircularProgress, null)) : null), /* @__PURE__ */ React8.createElement(import_ui4.CardOverlay, null, /* @__PURE__ */ React8.createElement(ControlActions, null, /* @__PURE__ */ React8.createElement(import_ui4.Stack, { gap: 1 }, /* @__PURE__ */ React8.createElement(
|
|
215
312
|
import_ui4.Button,
|
|
216
313
|
{
|
|
217
314
|
size: "tiny",
|
|
@@ -220,13 +317,13 @@ var ImageMediaControl = createControl(() => {
|
|
|
220
317
|
onClick: () => open({ mode: "browse" })
|
|
221
318
|
},
|
|
222
319
|
(0, import_i18n.__)("Select Image", "elementor")
|
|
223
|
-
), /* @__PURE__ */
|
|
320
|
+
), /* @__PURE__ */ React8.createElement(
|
|
224
321
|
import_ui4.Button,
|
|
225
322
|
{
|
|
226
323
|
size: "tiny",
|
|
227
324
|
variant: "text",
|
|
228
325
|
color: "inherit",
|
|
229
|
-
startIcon: /* @__PURE__ */
|
|
326
|
+
startIcon: /* @__PURE__ */ React8.createElement(import_icons.UploadIcon, null),
|
|
230
327
|
onClick: () => open({ mode: "upload" })
|
|
231
328
|
},
|
|
232
329
|
(0, import_i18n.__)("Upload Image", "elementor")
|
|
@@ -234,7 +331,7 @@ var ImageMediaControl = createControl(() => {
|
|
|
234
331
|
});
|
|
235
332
|
|
|
236
333
|
// src/controls/select-control.tsx
|
|
237
|
-
var
|
|
334
|
+
var React9 = __toESM(require("react"));
|
|
238
335
|
var import_editor_props2 = require("@elementor/editor-props");
|
|
239
336
|
var import_ui5 = require("@elementor/ui");
|
|
240
337
|
var SelectControl = createControl(({ options, onChange }) => {
|
|
@@ -243,36 +340,23 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
243
340
|
onChange?.(event.target.value, value);
|
|
244
341
|
setValue(event.target.value);
|
|
245
342
|
};
|
|
246
|
-
return /* @__PURE__ */
|
|
343
|
+
return /* @__PURE__ */ React9.createElement(ControlActions, null, /* @__PURE__ */ React9.createElement(import_ui5.Select, { displayEmpty: true, size: "tiny", value: value ?? "", onChange: handleChange, fullWidth: true }, options.map(({ label, ...props }) => /* @__PURE__ */ React9.createElement(import_ui5.MenuItem, { key: props.value, ...props }, label))));
|
|
247
344
|
});
|
|
248
345
|
|
|
249
346
|
// src/controls/image-control.tsx
|
|
250
347
|
var ImageControl = createControl((props) => {
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
const setImageSrc = (newValue) => {
|
|
254
|
-
setValue({
|
|
255
|
-
src: newValue,
|
|
256
|
-
size
|
|
257
|
-
});
|
|
258
|
-
};
|
|
259
|
-
const setImageSize = (newValue) => {
|
|
260
|
-
setValue({
|
|
261
|
-
src,
|
|
262
|
-
size: newValue
|
|
263
|
-
});
|
|
264
|
-
};
|
|
265
|
-
return /* @__PURE__ */ React9.createElement(import_ui6.Stack, { gap: 1.5 }, /* @__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(import_ui6.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React9.createElement(import_ui6.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React9.createElement(ControlLabel, null, " ", (0, import_i18n2.__)("Image Resolution", "elementor"))), /* @__PURE__ */ React9.createElement(import_ui6.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React9.createElement(SelectControl, { options: props.sizes })))));
|
|
348
|
+
const propContext = useBoundProp(import_editor_props3.imagePropTypeUtil);
|
|
349
|
+
return /* @__PURE__ */ React10.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React10.createElement(import_ui6.Stack, { gap: 1.5 }, /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React10.createElement(ImageMediaControl, null)), /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React10.createElement(import_ui6.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React10.createElement(import_ui6.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React10.createElement(ControlLabel, null, " ", (0, import_i18n2.__)("Image Resolution", "elementor"))), /* @__PURE__ */ React10.createElement(import_ui6.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React10.createElement(SelectControl, { options: props.sizes }))))));
|
|
266
350
|
});
|
|
267
351
|
|
|
268
352
|
// src/controls/text-control.tsx
|
|
269
|
-
var
|
|
353
|
+
var React11 = __toESM(require("react"));
|
|
270
354
|
var import_editor_props4 = require("@elementor/editor-props");
|
|
271
355
|
var import_ui7 = require("@elementor/ui");
|
|
272
356
|
var TextControl = createControl(({ placeholder }) => {
|
|
273
357
|
const { value, setValue } = useBoundProp(import_editor_props4.stringPropTypeUtil);
|
|
274
358
|
const handleChange = (event) => setValue(event.target.value);
|
|
275
|
-
return /* @__PURE__ */
|
|
359
|
+
return /* @__PURE__ */ React11.createElement(ControlActions, null, /* @__PURE__ */ React11.createElement(
|
|
276
360
|
import_ui7.TextField,
|
|
277
361
|
{
|
|
278
362
|
size: "tiny",
|
|
@@ -285,7 +369,7 @@ var TextControl = createControl(({ placeholder }) => {
|
|
|
285
369
|
});
|
|
286
370
|
|
|
287
371
|
// src/controls/text-area-control.tsx
|
|
288
|
-
var
|
|
372
|
+
var React12 = __toESM(require("react"));
|
|
289
373
|
var import_editor_props5 = require("@elementor/editor-props");
|
|
290
374
|
var import_ui8 = require("@elementor/ui");
|
|
291
375
|
var TextAreaControl = createControl(({ placeholder }) => {
|
|
@@ -293,7 +377,7 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
293
377
|
const handleChange = (event) => {
|
|
294
378
|
setValue(event.target.value);
|
|
295
379
|
};
|
|
296
|
-
return /* @__PURE__ */
|
|
380
|
+
return /* @__PURE__ */ React12.createElement(ControlActions, null, /* @__PURE__ */ React12.createElement(
|
|
297
381
|
import_ui8.TextField,
|
|
298
382
|
{
|
|
299
383
|
size: "tiny",
|
|
@@ -308,17 +392,17 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
308
392
|
});
|
|
309
393
|
|
|
310
394
|
// src/controls/size-control.tsx
|
|
311
|
-
var
|
|
395
|
+
var React14 = __toESM(require("react"));
|
|
312
396
|
var import_editor_props6 = require("@elementor/editor-props");
|
|
313
397
|
var import_ui10 = require("@elementor/ui");
|
|
314
398
|
|
|
315
399
|
// src/components/text-field-inner-selection.tsx
|
|
316
|
-
var
|
|
317
|
-
var
|
|
400
|
+
var React13 = __toESM(require("react"));
|
|
401
|
+
var import_react5 = require("react");
|
|
318
402
|
var import_ui9 = require("@elementor/ui");
|
|
319
|
-
var TextFieldInnerSelection = (0,
|
|
403
|
+
var TextFieldInnerSelection = (0, import_react5.forwardRef)(
|
|
320
404
|
({ placeholder, type, value, onChange, endAdornment, startAdornment }, ref) => {
|
|
321
|
-
return /* @__PURE__ */
|
|
405
|
+
return /* @__PURE__ */ React13.createElement(
|
|
322
406
|
import_ui9.TextField,
|
|
323
407
|
{
|
|
324
408
|
size: "tiny",
|
|
@@ -343,13 +427,13 @@ var SelectionEndAdornment = ({
|
|
|
343
427
|
}) => {
|
|
344
428
|
const popupState = (0, import_ui9.usePopupState)({
|
|
345
429
|
variant: "popover",
|
|
346
|
-
popupId: (0,
|
|
430
|
+
popupId: (0, import_react5.useId)()
|
|
347
431
|
});
|
|
348
432
|
const handleMenuItemClick = (index) => {
|
|
349
433
|
onClick(options[index]);
|
|
350
434
|
popupState.close();
|
|
351
435
|
};
|
|
352
|
-
return /* @__PURE__ */
|
|
436
|
+
return /* @__PURE__ */ React13.createElement(import_ui9.InputAdornment, { position: "end" }, /* @__PURE__ */ React13.createElement(
|
|
353
437
|
import_ui9.Button,
|
|
354
438
|
{
|
|
355
439
|
size: "small",
|
|
@@ -358,11 +442,11 @@ var SelectionEndAdornment = ({
|
|
|
358
442
|
...(0, import_ui9.bindTrigger)(popupState)
|
|
359
443
|
},
|
|
360
444
|
value.toUpperCase()
|
|
361
|
-
), /* @__PURE__ */
|
|
445
|
+
), /* @__PURE__ */ React13.createElement(import_ui9.Menu, { MenuListProps: { dense: true }, ...(0, import_ui9.bindMenu)(popupState) }, options.map((option, index) => /* @__PURE__ */ React13.createElement(import_ui9.MenuItem, { key: option, onClick: () => handleMenuItemClick(index) }, option.toUpperCase()))));
|
|
362
446
|
};
|
|
363
447
|
|
|
364
448
|
// src/hooks/use-sync-external-state.tsx
|
|
365
|
-
var
|
|
449
|
+
var import_react6 = require("react");
|
|
366
450
|
var useSyncExternalState = ({
|
|
367
451
|
external,
|
|
368
452
|
setExternal,
|
|
@@ -381,8 +465,8 @@ var useSyncExternalState = ({
|
|
|
381
465
|
}
|
|
382
466
|
return externalValue;
|
|
383
467
|
}
|
|
384
|
-
const [internal, setInternal] = (0,
|
|
385
|
-
(0,
|
|
468
|
+
const [internal, setInternal] = (0, import_react6.useState)(toInternal(external, null));
|
|
469
|
+
(0, import_react6.useEffect)(() => {
|
|
386
470
|
setInternal((prevInternal) => toInternal(external, prevInternal));
|
|
387
471
|
}, [external]);
|
|
388
472
|
const setInternalValue = (setter) => {
|
|
@@ -419,10 +503,10 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
|
|
|
419
503
|
size: size || size === "0" ? parseFloat(size) : defaultSize
|
|
420
504
|
}));
|
|
421
505
|
};
|
|
422
|
-
return /* @__PURE__ */
|
|
506
|
+
return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(
|
|
423
507
|
TextFieldInnerSelection,
|
|
424
508
|
{
|
|
425
|
-
endAdornment: /* @__PURE__ */
|
|
509
|
+
endAdornment: /* @__PURE__ */ React14.createElement(
|
|
426
510
|
SelectionEndAdornment,
|
|
427
511
|
{
|
|
428
512
|
options: units2,
|
|
@@ -431,7 +515,7 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
|
|
|
431
515
|
}
|
|
432
516
|
),
|
|
433
517
|
placeholder,
|
|
434
|
-
startAdornment: startIcon ?? /* @__PURE__ */
|
|
518
|
+
startAdornment: startIcon ?? /* @__PURE__ */ React14.createElement(import_ui10.InputAdornment, { position: "start" }, startIcon),
|
|
435
519
|
type: "number",
|
|
436
520
|
value: Number.isNaN(state?.size) ? "" : state?.size,
|
|
437
521
|
onChange: handleSizeChange
|
|
@@ -440,83 +524,40 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
|
|
|
440
524
|
});
|
|
441
525
|
|
|
442
526
|
// src/controls/stroke-control.tsx
|
|
443
|
-
var
|
|
527
|
+
var React16 = __toESM(require("react"));
|
|
444
528
|
var import_editor_props8 = require("@elementor/editor-props");
|
|
445
529
|
var import_ui12 = require("@elementor/ui");
|
|
446
530
|
var import_i18n3 = require("@wordpress/i18n");
|
|
447
531
|
|
|
448
532
|
// src/controls/color-control.tsx
|
|
449
|
-
var
|
|
533
|
+
var React15 = __toESM(require("react"));
|
|
450
534
|
var import_editor_props7 = require("@elementor/editor-props");
|
|
451
535
|
var import_ui11 = require("@elementor/ui");
|
|
452
|
-
var ColorControl = createControl(
|
|
453
|
-
(
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
import_ui11.UnstableColorField,
|
|
460
|
-
{
|
|
461
|
-
size: "tiny",
|
|
462
|
-
...props,
|
|
463
|
-
value: value ?? "",
|
|
464
|
-
onChange: handleChange,
|
|
465
|
-
fullWidth: true
|
|
466
|
-
}
|
|
467
|
-
));
|
|
468
|
-
}
|
|
469
|
-
);
|
|
536
|
+
var ColorControl = createControl(({ propTypeUtil = import_editor_props7.colorPropTypeUtil, ...props }) => {
|
|
537
|
+
const { value, setValue } = useBoundProp(propTypeUtil);
|
|
538
|
+
const handleChange = (selectedColor) => {
|
|
539
|
+
setValue(selectedColor);
|
|
540
|
+
};
|
|
541
|
+
return /* @__PURE__ */ React15.createElement(ControlActions, null, /* @__PURE__ */ React15.createElement(import_ui11.UnstableColorField, { size: "tiny", ...props, value: value ?? "", onChange: handleChange, fullWidth: true }));
|
|
542
|
+
});
|
|
470
543
|
|
|
471
544
|
// src/controls/stroke-control.tsx
|
|
472
545
|
var units = ["px", "em", "rem"];
|
|
473
546
|
var StrokeControl = createControl(() => {
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
const updatedValue = {
|
|
477
|
-
...value,
|
|
478
|
-
width: newValue
|
|
479
|
-
};
|
|
480
|
-
setValue(updatedValue);
|
|
481
|
-
};
|
|
482
|
-
const setStrokeColor = (newValue) => {
|
|
483
|
-
const updatedValue = {
|
|
484
|
-
...value,
|
|
485
|
-
color: newValue
|
|
486
|
-
};
|
|
487
|
-
setValue(updatedValue);
|
|
488
|
-
};
|
|
489
|
-
return /* @__PURE__ */ React15.createElement(import_ui12.Stack, { gap: 1.5 }, /* @__PURE__ */ React15.createElement(
|
|
490
|
-
Control,
|
|
491
|
-
{
|
|
492
|
-
bind: "width",
|
|
493
|
-
label: (0, import_i18n3.__)("Stroke Width", "elementor"),
|
|
494
|
-
value: value?.width,
|
|
495
|
-
setValue: setStrokeWidth
|
|
496
|
-
},
|
|
497
|
-
/* @__PURE__ */ React15.createElement(SizeControl, { units })
|
|
498
|
-
), /* @__PURE__ */ React15.createElement(
|
|
499
|
-
Control,
|
|
500
|
-
{
|
|
501
|
-
bind: "color",
|
|
502
|
-
label: (0, import_i18n3.__)("Stroke Color", "elementor"),
|
|
503
|
-
value: value?.color,
|
|
504
|
-
setValue: setStrokeColor
|
|
505
|
-
},
|
|
506
|
-
/* @__PURE__ */ React15.createElement(ColorControl, null)
|
|
507
|
-
));
|
|
547
|
+
const propContext = useBoundProp(import_editor_props8.strokePropTypeUtil);
|
|
548
|
+
return /* @__PURE__ */ React16.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React16.createElement(import_ui12.Stack, { gap: 1.5 }, /* @__PURE__ */ React16.createElement(Control, { bind: "width", label: (0, import_i18n3.__)("Stroke Width", "elementor") }, /* @__PURE__ */ React16.createElement(SizeControl, { units })), /* @__PURE__ */ React16.createElement(Control, { bind: "color", label: (0, import_i18n3.__)("Stroke Color", "elementor") }, /* @__PURE__ */ React16.createElement(ColorControl, null))));
|
|
508
549
|
});
|
|
509
|
-
var Control = ({ bind,
|
|
550
|
+
var Control = ({ bind, label, children }) => /* @__PURE__ */ React16.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React16.createElement(import_ui12.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React16.createElement(import_ui12.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React16.createElement(ControlLabel, null, label)), /* @__PURE__ */ React16.createElement(import_ui12.Grid, { item: true, xs: 6 }, children)));
|
|
510
551
|
|
|
511
552
|
// src/controls/box-shadow-repeater-control.tsx
|
|
512
|
-
var
|
|
553
|
+
var React18 = __toESM(require("react"));
|
|
513
554
|
var import_editor_props9 = require("@elementor/editor-props");
|
|
514
555
|
var import_ui14 = require("@elementor/ui");
|
|
515
556
|
var import_i18n5 = require("@wordpress/i18n");
|
|
516
557
|
|
|
517
558
|
// src/components/repeater.tsx
|
|
518
|
-
var
|
|
519
|
-
var
|
|
559
|
+
var React17 = __toESM(require("react"));
|
|
560
|
+
var import_react7 = require("react");
|
|
520
561
|
var import_icons2 = require("@elementor/icons");
|
|
521
562
|
var import_ui13 = require("@elementor/ui");
|
|
522
563
|
var import_i18n4 = require("@wordpress/i18n");
|
|
@@ -552,27 +593,18 @@ var Repeater = ({
|
|
|
552
593
|
})
|
|
553
594
|
);
|
|
554
595
|
};
|
|
555
|
-
return /* @__PURE__ */
|
|
596
|
+
return /* @__PURE__ */ React17.createElement(import_ui13.Stack, null, /* @__PURE__ */ React17.createElement(import_ui13.Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pb: 1 } }, /* @__PURE__ */ React17.createElement(import_ui13.Typography, { component: "label", variant: "caption", color: "text.secondary" }, label), /* @__PURE__ */ React17.createElement(import_ui13.IconButton, { size: SIZE, onClick: addRepeaterItem, "aria-label": (0, import_i18n4.__)("Add item", "elementor") }, /* @__PURE__ */ React17.createElement(import_icons2.PlusIcon, { fontSize: SIZE }))), /* @__PURE__ */ React17.createElement(import_ui13.Stack, { gap: 1 }, repeaterValues.map((value, index) => /* @__PURE__ */ React17.createElement(
|
|
556
597
|
RepeaterItem,
|
|
557
598
|
{
|
|
558
599
|
key: index,
|
|
559
600
|
disabled: value.disabled,
|
|
560
|
-
label: /* @__PURE__ */
|
|
561
|
-
startIcon: /* @__PURE__ */
|
|
601
|
+
label: /* @__PURE__ */ React17.createElement(itemSettings.Label, { value }),
|
|
602
|
+
startIcon: /* @__PURE__ */ React17.createElement(itemSettings.Icon, { value }),
|
|
562
603
|
removeItem: () => removeRepeaterItem(index),
|
|
563
604
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
564
605
|
toggleDisableItem: () => toggleDisableRepeaterItem(index)
|
|
565
606
|
},
|
|
566
|
-
(props) => /* @__PURE__ */
|
|
567
|
-
itemSettings.Content,
|
|
568
|
-
{
|
|
569
|
-
...props,
|
|
570
|
-
value,
|
|
571
|
-
setValue: (newValue) => setRepeaterValues(
|
|
572
|
-
repeaterValues.map((item, i) => i === index ? newValue : item)
|
|
573
|
-
)
|
|
574
|
-
}
|
|
575
|
-
)
|
|
607
|
+
(props) => /* @__PURE__ */ React17.createElement(itemSettings.Content, { ...props, bind: String(index) })
|
|
576
608
|
))));
|
|
577
609
|
};
|
|
578
610
|
var RepeaterItem = ({
|
|
@@ -584,12 +616,12 @@ var RepeaterItem = ({
|
|
|
584
616
|
duplicateItem,
|
|
585
617
|
toggleDisableItem
|
|
586
618
|
}) => {
|
|
587
|
-
const popupId = (0,
|
|
588
|
-
const controlRef = (0,
|
|
589
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
619
|
+
const popupId = (0, import_react7.useId)();
|
|
620
|
+
const controlRef = (0, import_react7.useRef)(null);
|
|
621
|
+
const [anchorEl, setAnchorEl] = (0, import_react7.useState)(null);
|
|
590
622
|
const popoverState = (0, import_ui13.usePopupState)({ popupId, variant: "popover" });
|
|
591
623
|
const popoverProps = (0, import_ui13.bindPopover)(popoverState);
|
|
592
|
-
return /* @__PURE__ */
|
|
624
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
593
625
|
import_ui13.UnstableTag,
|
|
594
626
|
{
|
|
595
627
|
label,
|
|
@@ -599,33 +631,33 @@ var RepeaterItem = ({
|
|
|
599
631
|
"aria-label": (0, import_i18n4.__)("Open item", "elementor"),
|
|
600
632
|
...(0, import_ui13.bindTrigger)(popoverState),
|
|
601
633
|
startIcon,
|
|
602
|
-
actions: /* @__PURE__ */
|
|
634
|
+
actions: /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
603
635
|
import_ui13.IconButton,
|
|
604
636
|
{
|
|
605
637
|
size: SIZE,
|
|
606
638
|
onClick: duplicateItem,
|
|
607
639
|
"aria-label": (0, import_i18n4.__)("Duplicate item", "elementor")
|
|
608
640
|
},
|
|
609
|
-
/* @__PURE__ */
|
|
610
|
-
), /* @__PURE__ */
|
|
641
|
+
/* @__PURE__ */ React17.createElement(import_icons2.CopyIcon, { fontSize: SIZE })
|
|
642
|
+
), /* @__PURE__ */ React17.createElement(
|
|
611
643
|
import_ui13.IconButton,
|
|
612
644
|
{
|
|
613
645
|
size: SIZE,
|
|
614
646
|
onClick: toggleDisableItem,
|
|
615
647
|
"aria-label": disabled ? (0, import_i18n4.__)("Enable item", "elementor") : (0, import_i18n4.__)("Disable item", "elementor")
|
|
616
648
|
},
|
|
617
|
-
disabled ? /* @__PURE__ */
|
|
618
|
-
), /* @__PURE__ */
|
|
649
|
+
disabled ? /* @__PURE__ */ React17.createElement(import_icons2.EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React17.createElement(import_icons2.EyeIcon, { fontSize: SIZE })
|
|
650
|
+
), /* @__PURE__ */ React17.createElement(
|
|
619
651
|
import_ui13.IconButton,
|
|
620
652
|
{
|
|
621
653
|
size: SIZE,
|
|
622
654
|
onClick: removeItem,
|
|
623
655
|
"aria-label": (0, import_i18n4.__)("Remove item", "elementor")
|
|
624
656
|
},
|
|
625
|
-
/* @__PURE__ */
|
|
657
|
+
/* @__PURE__ */ React17.createElement(import_icons2.XIcon, { fontSize: SIZE })
|
|
626
658
|
))
|
|
627
659
|
}
|
|
628
|
-
), /* @__PURE__ */
|
|
660
|
+
), /* @__PURE__ */ React17.createElement(
|
|
629
661
|
import_ui13.Popover,
|
|
630
662
|
{
|
|
631
663
|
disablePortal: true,
|
|
@@ -638,21 +670,18 @@ var RepeaterItem = ({
|
|
|
638
670
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
639
671
|
...popoverProps
|
|
640
672
|
},
|
|
641
|
-
/* @__PURE__ */
|
|
673
|
+
/* @__PURE__ */ React17.createElement(import_ui13.Box, { p: 0.5 }, children({ anchorEl }))
|
|
642
674
|
));
|
|
643
675
|
};
|
|
644
676
|
|
|
645
677
|
// src/controls/box-shadow-repeater-control.tsx
|
|
646
678
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
647
|
-
const { value
|
|
648
|
-
|
|
649
|
-
setValue(newValue);
|
|
650
|
-
};
|
|
651
|
-
return /* @__PURE__ */ React17.createElement(
|
|
679
|
+
const { propType, value, setValue } = useBoundProp(import_editor_props9.boxShadowPropTypeUtil);
|
|
680
|
+
return /* @__PURE__ */ React18.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React18.createElement(
|
|
652
681
|
Repeater,
|
|
653
682
|
{
|
|
654
|
-
values:
|
|
655
|
-
setValues:
|
|
683
|
+
values: value ?? [],
|
|
684
|
+
setValues: setValue,
|
|
656
685
|
label: (0, import_i18n5.__)("Box shadow", "elementor"),
|
|
657
686
|
itemSettings: {
|
|
658
687
|
Icon: ItemIcon,
|
|
@@ -661,108 +690,42 @@ var BoxShadowRepeaterControl = createControl(() => {
|
|
|
661
690
|
initialValues: initialShadow
|
|
662
691
|
}
|
|
663
692
|
}
|
|
664
|
-
);
|
|
693
|
+
));
|
|
665
694
|
});
|
|
666
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */
|
|
667
|
-
var ItemContent = ({
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
$$type: "shadow",
|
|
675
|
-
value: newValue
|
|
676
|
-
});
|
|
677
|
-
};
|
|
678
|
-
return /* @__PURE__ */ React17.createElement(import_ui14.Stack, { gap: 1.5 }, /* @__PURE__ */ React17.createElement(import_ui14.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React17.createElement(
|
|
679
|
-
Control2,
|
|
695
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React18.createElement(import_ui14.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color.value });
|
|
696
|
+
var ItemContent = ({ anchorEl, bind }) => {
|
|
697
|
+
return /* @__PURE__ */ React18.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React18.createElement(Content, { anchorEl }));
|
|
698
|
+
};
|
|
699
|
+
var Content = ({ anchorEl }) => {
|
|
700
|
+
const { propType, value, setValue } = useBoundProp(import_editor_props9.shadowPropTypeUtil);
|
|
701
|
+
return /* @__PURE__ */ React18.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React18.createElement(import_ui14.Stack, { gap: 1.5 }, /* @__PURE__ */ React18.createElement(import_ui14.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React18.createElement(Control2, { bind: "color", label: (0, import_i18n5.__)("Color", "elementor") }, /* @__PURE__ */ React18.createElement(
|
|
702
|
+
ColorControl,
|
|
680
703
|
{
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
anchorEl,
|
|
692
|
-
anchorOrigin: {
|
|
693
|
-
vertical: "top",
|
|
694
|
-
horizontal: "right"
|
|
695
|
-
},
|
|
696
|
-
transformOrigin: {
|
|
697
|
-
vertical: "top",
|
|
698
|
-
horizontal: -10
|
|
699
|
-
}
|
|
704
|
+
slotProps: {
|
|
705
|
+
colorPicker: {
|
|
706
|
+
anchorEl,
|
|
707
|
+
anchorOrigin: {
|
|
708
|
+
vertical: "top",
|
|
709
|
+
horizontal: "right"
|
|
710
|
+
},
|
|
711
|
+
transformOrigin: {
|
|
712
|
+
vertical: "top",
|
|
713
|
+
horizontal: -10
|
|
700
714
|
}
|
|
701
715
|
}
|
|
702
716
|
}
|
|
703
|
-
|
|
704
|
-
), /* @__PURE__ */
|
|
705
|
-
|
|
706
|
-
{
|
|
707
|
-
bind: "position",
|
|
708
|
-
value: value.value.position,
|
|
709
|
-
label: (0, import_i18n5.__)("Position", "elementor"),
|
|
710
|
-
setValue: (v) => setShadow({ ...value.value, position: v || null })
|
|
711
|
-
},
|
|
712
|
-
/* @__PURE__ */ React17.createElement(
|
|
713
|
-
SelectControl,
|
|
714
|
-
{
|
|
715
|
-
options: [
|
|
716
|
-
{ label: (0, import_i18n5.__)("Inset", "elementor"), value: "inset" },
|
|
717
|
-
{ label: (0, import_i18n5.__)("Outset", "elementor"), value: "" }
|
|
718
|
-
]
|
|
719
|
-
}
|
|
720
|
-
)
|
|
721
|
-
)), /* @__PURE__ */ React17.createElement(import_ui14.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React17.createElement(
|
|
722
|
-
Control2,
|
|
723
|
-
{
|
|
724
|
-
bind: "hOffset",
|
|
725
|
-
label: (0, import_i18n5.__)("Horizontal", "elementor"),
|
|
726
|
-
value: value.value.hOffset,
|
|
727
|
-
setValue: (v) => setShadow({ ...value.value, hOffset: v })
|
|
728
|
-
},
|
|
729
|
-
/* @__PURE__ */ React17.createElement(SizeControl, null)
|
|
730
|
-
), /* @__PURE__ */ React17.createElement(
|
|
731
|
-
Control2,
|
|
732
|
-
{
|
|
733
|
-
bind: "vOffset",
|
|
734
|
-
label: (0, import_i18n5.__)("Vertical", "elementor"),
|
|
735
|
-
value: value.value.vOffset,
|
|
736
|
-
setValue: (v) => setShadow({ ...value.value, vOffset: v })
|
|
737
|
-
},
|
|
738
|
-
/* @__PURE__ */ React17.createElement(SizeControl, null)
|
|
739
|
-
)), /* @__PURE__ */ React17.createElement(import_ui14.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React17.createElement(
|
|
740
|
-
Control2,
|
|
741
|
-
{
|
|
742
|
-
bind: "blur",
|
|
743
|
-
value: value.value.blur,
|
|
744
|
-
label: (0, import_i18n5.__)("Blur", "elementor"),
|
|
745
|
-
setValue: (v) => setShadow({ ...value.value, blur: v })
|
|
746
|
-
},
|
|
747
|
-
/* @__PURE__ */ React17.createElement(SizeControl, null)
|
|
748
|
-
), /* @__PURE__ */ React17.createElement(
|
|
749
|
-
Control2,
|
|
717
|
+
}
|
|
718
|
+
)), /* @__PURE__ */ React18.createElement(Control2, { bind: "position", label: (0, import_i18n5.__)("Position", "elementor") }, /* @__PURE__ */ React18.createElement(
|
|
719
|
+
SelectControl,
|
|
750
720
|
{
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
)));
|
|
721
|
+
options: [
|
|
722
|
+
{ label: (0, import_i18n5.__)("Inset", "elementor"), value: "inset" },
|
|
723
|
+
{ label: (0, import_i18n5.__)("Outset", "elementor"), value: "" }
|
|
724
|
+
]
|
|
725
|
+
}
|
|
726
|
+
))), /* @__PURE__ */ React18.createElement(import_ui14.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React18.createElement(Control2, { bind: "hOffset", label: (0, import_i18n5.__)("Horizontal", "elementor") }, /* @__PURE__ */ React18.createElement(SizeControl, null)), /* @__PURE__ */ React18.createElement(Control2, { bind: "vOffset", label: (0, import_i18n5.__)("Vertical", "elementor") }, /* @__PURE__ */ React18.createElement(SizeControl, null))), /* @__PURE__ */ React18.createElement(import_ui14.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React18.createElement(Control2, { bind: "blur", label: (0, import_i18n5.__)("Blur", "elementor") }, /* @__PURE__ */ React18.createElement(SizeControl, null)), /* @__PURE__ */ React18.createElement(Control2, { bind: "spread", label: (0, import_i18n5.__)("Spread", "elementor") }, /* @__PURE__ */ React18.createElement(SizeControl, null)))));
|
|
758
727
|
};
|
|
759
|
-
var Control2 = ({
|
|
760
|
-
value,
|
|
761
|
-
setValue,
|
|
762
|
-
label,
|
|
763
|
-
bind,
|
|
764
|
-
children
|
|
765
|
-
}) => /* @__PURE__ */ React17.createElement(BoundPropProvider, { value, setValue, bind }, /* @__PURE__ */ React17.createElement(import_ui14.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React17.createElement(import_ui14.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React17.createElement(import_ui14.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React17.createElement(import_ui14.Typography, { component: "label", variant: "caption", color: "text.secondary" }, label)), /* @__PURE__ */ React17.createElement(import_ui14.Grid, { item: true, xs: 12 }, children))));
|
|
728
|
+
var Control2 = ({ label, bind, children }) => /* @__PURE__ */ React18.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React18.createElement(import_ui14.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React18.createElement(import_ui14.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React18.createElement(import_ui14.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React18.createElement(import_ui14.Typography, { component: "label", variant: "caption", color: "text.secondary" }, label)), /* @__PURE__ */ React18.createElement(import_ui14.Grid, { item: true, xs: 12 }, children))));
|
|
766
729
|
var ItemLabel = ({ value }) => {
|
|
767
730
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
768
731
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -775,7 +738,7 @@ var ItemLabel = ({ value }) => {
|
|
|
775
738
|
blurSize + blurUnit,
|
|
776
739
|
spreadSize + spreadUnit
|
|
777
740
|
].join(" ");
|
|
778
|
-
return /* @__PURE__ */
|
|
741
|
+
return /* @__PURE__ */ React18.createElement("span", { style: { textTransform: "capitalize" } }, position ?? "outset", ": ", sizes);
|
|
779
742
|
};
|
|
780
743
|
var initialShadow = {
|
|
781
744
|
$$type: "shadow",
|
|
@@ -805,11 +768,11 @@ var initialShadow = {
|
|
|
805
768
|
};
|
|
806
769
|
|
|
807
770
|
// src/controls/toggle-control.tsx
|
|
808
|
-
var
|
|
771
|
+
var React20 = __toESM(require("react"));
|
|
809
772
|
var import_editor_props10 = require("@elementor/editor-props");
|
|
810
773
|
|
|
811
774
|
// src/components/control-toggle-button-group.tsx
|
|
812
|
-
var
|
|
775
|
+
var React19 = __toESM(require("react"));
|
|
813
776
|
var import_ui15 = require("@elementor/ui");
|
|
814
777
|
var StyledToggleButtonGroup = (0, import_ui15.styled)(import_ui15.ToggleButtonGroup)`
|
|
815
778
|
${({ justify }) => `justify-content: ${justify};`}
|
|
@@ -827,7 +790,7 @@ var ControlToggleButtonGroup = ({
|
|
|
827
790
|
const handleChange = (_, newValue) => {
|
|
828
791
|
onChange(newValue);
|
|
829
792
|
};
|
|
830
|
-
return /* @__PURE__ */
|
|
793
|
+
return /* @__PURE__ */ React19.createElement(
|
|
831
794
|
StyledToggleButtonGroup,
|
|
832
795
|
{
|
|
833
796
|
justify,
|
|
@@ -839,7 +802,7 @@ var ControlToggleButtonGroup = ({
|
|
|
839
802
|
}
|
|
840
803
|
},
|
|
841
804
|
items.map(
|
|
842
|
-
({ label, value: buttonValue, renderContent:
|
|
805
|
+
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */ React19.createElement(import_ui15.Tooltip, { key: buttonValue, title: label, disableFocusListener: true, placement: "top" }, /* @__PURE__ */ React19.createElement(import_ui15.ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React19.createElement(Content3, { size }))) : /* @__PURE__ */ React19.createElement(
|
|
843
806
|
import_ui15.ToggleButton,
|
|
844
807
|
{
|
|
845
808
|
key: buttonValue,
|
|
@@ -848,7 +811,7 @@ var ControlToggleButtonGroup = ({
|
|
|
848
811
|
size,
|
|
849
812
|
fullWidth
|
|
850
813
|
},
|
|
851
|
-
/* @__PURE__ */
|
|
814
|
+
/* @__PURE__ */ React19.createElement(Content3, { size })
|
|
852
815
|
)
|
|
853
816
|
)
|
|
854
817
|
);
|
|
@@ -861,7 +824,7 @@ var ToggleControl = createControl(
|
|
|
861
824
|
const handleToggle = (option) => {
|
|
862
825
|
setValue(option);
|
|
863
826
|
};
|
|
864
|
-
return /* @__PURE__ */
|
|
827
|
+
return /* @__PURE__ */ React20.createElement(
|
|
865
828
|
ControlToggleButtonGroup,
|
|
866
829
|
{
|
|
867
830
|
items: options,
|
|
@@ -876,7 +839,7 @@ var ToggleControl = createControl(
|
|
|
876
839
|
);
|
|
877
840
|
|
|
878
841
|
// src/controls/number-control.tsx
|
|
879
|
-
var
|
|
842
|
+
var React21 = __toESM(require("react"));
|
|
880
843
|
var import_editor_props11 = require("@elementor/editor-props");
|
|
881
844
|
var import_ui16 = require("@elementor/ui");
|
|
882
845
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
@@ -898,7 +861,7 @@ var NumberControl = createControl(
|
|
|
898
861
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
899
862
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
900
863
|
};
|
|
901
|
-
return /* @__PURE__ */
|
|
864
|
+
return /* @__PURE__ */ React21.createElement(ControlActions, null, /* @__PURE__ */ React21.createElement(
|
|
902
865
|
import_ui16.TextField,
|
|
903
866
|
{
|
|
904
867
|
size: "tiny",
|
|
@@ -914,18 +877,19 @@ var NumberControl = createControl(
|
|
|
914
877
|
);
|
|
915
878
|
|
|
916
879
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
917
|
-
var
|
|
918
|
-
var
|
|
880
|
+
var React22 = __toESM(require("react"));
|
|
881
|
+
var import_react8 = require("react");
|
|
919
882
|
var import_editor_props12 = require("@elementor/editor-props");
|
|
920
883
|
var import_ui17 = require("@elementor/ui");
|
|
921
884
|
var import_i18n6 = require("@wordpress/i18n");
|
|
922
|
-
var isEqualSizes = (
|
|
885
|
+
var isEqualSizes = (propValue, items) => {
|
|
886
|
+
const values = Object.values(propValue);
|
|
923
887
|
if (values.length !== items.length) {
|
|
924
888
|
return false;
|
|
925
889
|
}
|
|
926
890
|
const [firstValue, ...restValues] = values;
|
|
927
891
|
return restValues.every(
|
|
928
|
-
(value) => value
|
|
892
|
+
(value) => value?.value?.size === firstValue?.value?.size && value?.value?.unit === firstValue?.value?.unit
|
|
929
893
|
);
|
|
930
894
|
};
|
|
931
895
|
function EqualUnequalSizesControl({
|
|
@@ -934,48 +898,52 @@ function EqualUnequalSizesControl({
|
|
|
934
898
|
items,
|
|
935
899
|
multiSizePropTypeUtil
|
|
936
900
|
}) {
|
|
937
|
-
const popupId = (0,
|
|
938
|
-
const controlRef = (0,
|
|
901
|
+
const popupId = (0, import_react8.useId)();
|
|
902
|
+
const controlRef = (0, import_react8.useRef)(null);
|
|
939
903
|
const popupState = (0, import_ui17.usePopupState)({ variant: "popover", popupId });
|
|
904
|
+
const {
|
|
905
|
+
propType: multiSizePropType,
|
|
906
|
+
value: multiSizeValue,
|
|
907
|
+
setValue: setMultiSizeValue
|
|
908
|
+
} = useBoundProp(multiSizePropTypeUtil);
|
|
940
909
|
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(import_editor_props12.sizePropTypeUtil);
|
|
941
|
-
const { value: multiSizeValue, setValue: setMultiSizeValue } = useBoundProp(multiSizePropTypeUtil);
|
|
942
910
|
const splitEqualValue = () => {
|
|
943
911
|
if (!sizeValue) {
|
|
944
|
-
return
|
|
912
|
+
return null;
|
|
945
913
|
}
|
|
946
|
-
return items.reduce(
|
|
914
|
+
return items.reduce(
|
|
915
|
+
(acc, { bind }) => ({ ...acc, [bind]: import_editor_props12.sizePropTypeUtil.create(sizeValue) }),
|
|
916
|
+
{}
|
|
917
|
+
);
|
|
947
918
|
};
|
|
948
|
-
const setNestedProp = (
|
|
919
|
+
const setNestedProp = (newValue) => {
|
|
949
920
|
const newMappedValues = {
|
|
950
921
|
...multiSizeValue ?? splitEqualValue(),
|
|
951
|
-
|
|
922
|
+
...newValue
|
|
952
923
|
};
|
|
953
|
-
const isEqual = isEqualSizes(
|
|
924
|
+
const isEqual = isEqualSizes(newMappedValues, items);
|
|
954
925
|
if (isEqual) {
|
|
955
|
-
return setSizeValue(
|
|
926
|
+
return setSizeValue(Object.values(newMappedValues)[0].value);
|
|
956
927
|
}
|
|
957
928
|
setMultiSizeValue(newMappedValues);
|
|
958
929
|
};
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
items,
|
|
963
|
-
value: sizeValue,
|
|
964
|
-
multiSizeValue,
|
|
965
|
-
setValue: setSizeValue,
|
|
966
|
-
iconButton: /* @__PURE__ */ React21.createElement(
|
|
967
|
-
import_ui17.ToggleButton,
|
|
968
|
-
{
|
|
969
|
-
size: "tiny",
|
|
970
|
-
value: "check",
|
|
971
|
-
sx: { marginLeft: "auto" },
|
|
972
|
-
...(0, import_ui17.bindToggle)(popupState),
|
|
973
|
-
selected: popupState.isOpen
|
|
974
|
-
},
|
|
975
|
-
icon
|
|
976
|
-
)
|
|
930
|
+
const getMultiSizeValues = () => {
|
|
931
|
+
if (multiSizeValue) {
|
|
932
|
+
return multiSizeValue;
|
|
977
933
|
}
|
|
978
|
-
|
|
934
|
+
return splitEqualValue() ?? null;
|
|
935
|
+
};
|
|
936
|
+
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(import_ui17.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: controlRef }, /* @__PURE__ */ React22.createElement(import_ui17.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React22.createElement(ControlLabel, null, label)), /* @__PURE__ */ React22.createElement(import_ui17.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React22.createElement(import_ui17.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React22.createElement(SizeControl, { placeholder: (0, import_i18n6.__)("MIXED", "elementor") }), /* @__PURE__ */ React22.createElement(
|
|
937
|
+
import_ui17.ToggleButton,
|
|
938
|
+
{
|
|
939
|
+
size: "tiny",
|
|
940
|
+
value: "check",
|
|
941
|
+
sx: { marginLeft: "auto" },
|
|
942
|
+
...(0, import_ui17.bindToggle)(popupState),
|
|
943
|
+
selected: popupState.isOpen
|
|
944
|
+
},
|
|
945
|
+
icon
|
|
946
|
+
)))), /* @__PURE__ */ React22.createElement(
|
|
979
947
|
import_ui17.Popover,
|
|
980
948
|
{
|
|
981
949
|
disablePortal: true,
|
|
@@ -993,97 +961,32 @@ function EqualUnequalSizesControl({
|
|
|
993
961
|
paper: { sx: { mt: 0.5, p: 2, pt: 1, width: controlRef.current?.getBoundingClientRect().width } }
|
|
994
962
|
}
|
|
995
963
|
},
|
|
996
|
-
/* @__PURE__ */
|
|
997
|
-
MultiSizeValueControl,
|
|
998
|
-
{
|
|
999
|
-
item: items[0],
|
|
1000
|
-
value: multiSizeValue,
|
|
1001
|
-
setNestedProp,
|
|
1002
|
-
splitEqualValue
|
|
1003
|
-
}
|
|
1004
|
-
), /* @__PURE__ */ React21.createElement(
|
|
1005
|
-
MultiSizeValueControl,
|
|
1006
|
-
{
|
|
1007
|
-
item: items[1],
|
|
1008
|
-
value: multiSizeValue,
|
|
1009
|
-
setNestedProp,
|
|
1010
|
-
splitEqualValue
|
|
1011
|
-
}
|
|
1012
|
-
)), /* @__PURE__ */ React21.createElement(import_ui17.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React21.createElement(
|
|
1013
|
-
MultiSizeValueControl,
|
|
1014
|
-
{
|
|
1015
|
-
item: items[3],
|
|
1016
|
-
value: multiSizeValue,
|
|
1017
|
-
setNestedProp,
|
|
1018
|
-
splitEqualValue
|
|
1019
|
-
}
|
|
1020
|
-
), /* @__PURE__ */ React21.createElement(
|
|
1021
|
-
MultiSizeValueControl,
|
|
1022
|
-
{
|
|
1023
|
-
item: items[2],
|
|
1024
|
-
value: multiSizeValue,
|
|
1025
|
-
setNestedProp,
|
|
1026
|
-
splitEqualValue
|
|
1027
|
-
}
|
|
1028
|
-
)))
|
|
964
|
+
/* @__PURE__ */ React22.createElement(PropProvider, { propType: multiSizePropType, value: getMultiSizeValues(), setValue: setNestedProp }, /* @__PURE__ */ React22.createElement(import_ui17.Stack, { gap: 1.5 }, /* @__PURE__ */ React22.createElement(import_ui17.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React22.createElement(MultiSizeValueControl, { item: items[0] }), /* @__PURE__ */ React22.createElement(MultiSizeValueControl, { item: items[1] })), /* @__PURE__ */ React22.createElement(import_ui17.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React22.createElement(MultiSizeValueControl, { item: items[3] }), /* @__PURE__ */ React22.createElement(MultiSizeValueControl, { item: items[2] }))))
|
|
1029
965
|
));
|
|
1030
966
|
}
|
|
1031
|
-
var MultiSizeValueControl = ({
|
|
1032
|
-
item,
|
|
1033
|
-
value,
|
|
1034
|
-
setNestedProp,
|
|
1035
|
-
splitEqualValue
|
|
1036
|
-
}) => {
|
|
1037
|
-
const handleChange = (val) => setNestedProp(item, val);
|
|
1038
|
-
const getMultiSizeValues = () => {
|
|
1039
|
-
if (value) {
|
|
1040
|
-
return value?.[item.bind] ?? null;
|
|
1041
|
-
}
|
|
1042
|
-
return splitEqualValue()?.[item.bind] ?? null;
|
|
1043
|
-
};
|
|
1044
|
-
return /* @__PURE__ */ React21.createElement(BoundPropProvider, { bind: "", setValue: handleChange, value: getMultiSizeValues() }, /* @__PURE__ */ React21.createElement(import_ui17.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React21.createElement(import_ui17.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React21.createElement(import_ui17.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React21.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React21.createElement(import_ui17.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React21.createElement(SizeControl, { startIcon: item.icon })))));
|
|
1045
|
-
};
|
|
1046
|
-
var EqualSizeControl = ({
|
|
1047
|
-
value,
|
|
1048
|
-
items,
|
|
1049
|
-
setValue,
|
|
1050
|
-
iconButton,
|
|
1051
|
-
multiSizeValue
|
|
1052
|
-
}) => {
|
|
1053
|
-
const handleChange = (newValue) => {
|
|
1054
|
-
setValue(newValue.value);
|
|
1055
|
-
};
|
|
1056
|
-
const getDisplayValue = () => {
|
|
1057
|
-
if (value) {
|
|
1058
|
-
return import_editor_props12.sizePropTypeUtil.create(value);
|
|
1059
|
-
}
|
|
1060
|
-
const multiValues = Object.values(multiSizeValue ?? {});
|
|
1061
|
-
if (isEqualSizes(multiValues, items)) {
|
|
1062
|
-
return import_editor_props12.sizePropTypeUtil.create(multiValues[0].value);
|
|
1063
|
-
}
|
|
1064
|
-
};
|
|
1065
|
-
return /* @__PURE__ */ React21.createElement(BoundPropProvider, { bind: "", setValue: handleChange, value: getDisplayValue() ?? null }, /* @__PURE__ */ React21.createElement(import_ui17.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React21.createElement(SizeControl, { placeholder: (0, import_i18n6.__)("MIXED", "elementor") }), iconButton));
|
|
1066
|
-
};
|
|
967
|
+
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */ React22.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React22.createElement(import_ui17.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React22.createElement(import_ui17.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React22.createElement(import_ui17.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React22.createElement(import_ui17.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(SizeControl, { startIcon: item.icon })))));
|
|
1067
968
|
|
|
1068
969
|
// src/controls/linked-dimensions-control.tsx
|
|
1069
|
-
var
|
|
970
|
+
var React23 = __toESM(require("react"));
|
|
1070
971
|
var import_editor_props13 = require("@elementor/editor-props");
|
|
1071
972
|
var import_icons3 = require("@elementor/icons");
|
|
1072
973
|
var import_ui18 = require("@elementor/ui");
|
|
1073
974
|
var import_i18n7 = require("@wordpress/i18n");
|
|
1074
975
|
var LinkedDimensionsControl = createControl(({ label }) => {
|
|
1075
|
-
const { value, setValue } = useBoundProp(import_editor_props13.linkedDimensionsPropTypeUtil);
|
|
976
|
+
const { value, setValue, propType } = useBoundProp(import_editor_props13.linkedDimensionsPropTypeUtil);
|
|
1076
977
|
const { top, right, bottom, left, isLinked = true } = value || {};
|
|
1077
|
-
const setLinkedValue = (
|
|
1078
|
-
|
|
978
|
+
const setLinkedValue = (newValue, _, meta) => {
|
|
979
|
+
if (!isLinked) {
|
|
980
|
+
return setValue(newValue);
|
|
981
|
+
}
|
|
982
|
+
const newDimension = newValue[meta?.bind];
|
|
983
|
+
setValue({
|
|
1079
984
|
isLinked,
|
|
1080
|
-
top:
|
|
1081
|
-
right:
|
|
1082
|
-
bottom:
|
|
1083
|
-
left:
|
|
1084
|
-
|
|
1085
|
-
};
|
|
1086
|
-
setValue(updatedValue);
|
|
985
|
+
top: newDimension,
|
|
986
|
+
right: newDimension,
|
|
987
|
+
bottom: newDimension,
|
|
988
|
+
left: newDimension
|
|
989
|
+
});
|
|
1087
990
|
};
|
|
1088
991
|
const toggleLinked = () => {
|
|
1089
992
|
const updatedValue = {
|
|
@@ -1096,7 +999,7 @@ var LinkedDimensionsControl = createControl(({ label }) => {
|
|
|
1096
999
|
setValue(updatedValue);
|
|
1097
1000
|
};
|
|
1098
1001
|
const LinkedIcon = isLinked ? import_icons3.LinkIcon : import_icons3.DetachIcon;
|
|
1099
|
-
return /* @__PURE__ */
|
|
1002
|
+
return /* @__PURE__ */ React23.createElement(PropProvider, { propType, value, setValue: setLinkedValue }, /* @__PURE__ */ React23.createElement(import_ui18.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React23.createElement(ControlLabel, null, label), /* @__PURE__ */ React23.createElement(
|
|
1100
1003
|
import_ui18.ToggleButton,
|
|
1101
1004
|
{
|
|
1102
1005
|
"aria-label": (0, import_i18n7.__)("Link Inputs", "elementor"),
|
|
@@ -1106,51 +1009,14 @@ var LinkedDimensionsControl = createControl(({ label }) => {
|
|
|
1106
1009
|
sx: { marginLeft: "auto" },
|
|
1107
1010
|
onChange: toggleLinked
|
|
1108
1011
|
},
|
|
1109
|
-
/* @__PURE__ */
|
|
1110
|
-
)), /* @__PURE__ */
|
|
1111
|
-
Control3,
|
|
1112
|
-
{
|
|
1113
|
-
bind: "top",
|
|
1114
|
-
value: top,
|
|
1115
|
-
setValue: setLinkedValue,
|
|
1116
|
-
startIcon: /* @__PURE__ */ React22.createElement(import_icons3.SideTopIcon, { fontSize: "tiny" })
|
|
1117
|
-
}
|
|
1118
|
-
))), /* @__PURE__ */ React22.createElement(import_ui18.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React22.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(ControlLabel, null, (0, import_i18n7.__)("Right", "elementor"))), /* @__PURE__ */ React22.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(
|
|
1119
|
-
Control3,
|
|
1120
|
-
{
|
|
1121
|
-
bind: "right",
|
|
1122
|
-
value: right,
|
|
1123
|
-
setValue: setLinkedValue,
|
|
1124
|
-
startIcon: /* @__PURE__ */ React22.createElement(import_icons3.SideRightIcon, { fontSize: "tiny" })
|
|
1125
|
-
}
|
|
1126
|
-
)))), /* @__PURE__ */ React22.createElement(import_ui18.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React22.createElement(import_ui18.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React22.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(ControlLabel, null, (0, import_i18n7.__)("Bottom", "elementor"))), /* @__PURE__ */ React22.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(
|
|
1127
|
-
Control3,
|
|
1128
|
-
{
|
|
1129
|
-
bind: "bottom",
|
|
1130
|
-
value: bottom,
|
|
1131
|
-
setValue: setLinkedValue,
|
|
1132
|
-
startIcon: /* @__PURE__ */ React22.createElement(import_icons3.SideBottomIcon, { fontSize: "tiny" })
|
|
1133
|
-
}
|
|
1134
|
-
))), /* @__PURE__ */ React22.createElement(import_ui18.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React22.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(ControlLabel, null, (0, import_i18n7.__)("Left", "elementor"))), /* @__PURE__ */ React22.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(
|
|
1135
|
-
Control3,
|
|
1136
|
-
{
|
|
1137
|
-
bind: "left",
|
|
1138
|
-
value: left,
|
|
1139
|
-
setValue: setLinkedValue,
|
|
1140
|
-
startIcon: /* @__PURE__ */ React22.createElement(import_icons3.SideLeftIcon, { fontSize: "tiny" })
|
|
1141
|
-
}
|
|
1142
|
-
)))));
|
|
1012
|
+
/* @__PURE__ */ React23.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1013
|
+
)), /* @__PURE__ */ React23.createElement(import_ui18.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React23.createElement(import_ui18.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(ControlLabel, null, (0, import_i18n7.__)("Top", "elementor"))), /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(Control3, { bind: "top", startIcon: /* @__PURE__ */ React23.createElement(import_icons3.SideTopIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React23.createElement(import_ui18.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(ControlLabel, null, (0, import_i18n7.__)("Right", "elementor"))), /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(Control3, { bind: "right", startIcon: /* @__PURE__ */ React23.createElement(import_icons3.SideRightIcon, { fontSize: "tiny" }) })))), /* @__PURE__ */ React23.createElement(import_ui18.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React23.createElement(import_ui18.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(ControlLabel, null, (0, import_i18n7.__)("Bottom", "elementor"))), /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(Control3, { bind: "bottom", startIcon: /* @__PURE__ */ React23.createElement(import_icons3.SideBottomIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React23.createElement(import_ui18.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(ControlLabel, null, (0, import_i18n7.__)("Left", "elementor"))), /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(Control3, { bind: "left", startIcon: /* @__PURE__ */ React23.createElement(import_icons3.SideLeftIcon, { fontSize: "tiny" }) })))));
|
|
1143
1014
|
});
|
|
1144
|
-
var Control3 = ({
|
|
1145
|
-
bind,
|
|
1146
|
-
startIcon,
|
|
1147
|
-
value,
|
|
1148
|
-
setValue
|
|
1149
|
-
}) => /* @__PURE__ */ React22.createElement(BoundPropProvider, { setValue: (newValue) => setValue(bind, newValue), value, bind }, /* @__PURE__ */ React22.createElement(SizeControl, { startIcon }));
|
|
1015
|
+
var Control3 = ({ bind, startIcon }) => /* @__PURE__ */ React23.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React23.createElement(SizeControl, { startIcon }));
|
|
1150
1016
|
|
|
1151
1017
|
// src/controls/font-family-control.tsx
|
|
1152
|
-
var
|
|
1153
|
-
var
|
|
1018
|
+
var import_react9 = require("react");
|
|
1019
|
+
var React24 = __toESM(require("react"));
|
|
1154
1020
|
var import_editor_props14 = require("@elementor/editor-props");
|
|
1155
1021
|
var import_icons4 = require("@elementor/icons");
|
|
1156
1022
|
var import_ui19 = require("@elementor/ui");
|
|
@@ -1189,9 +1055,9 @@ var useFilteredFontFamilies = (fontFamilies, searchValue) => {
|
|
|
1189
1055
|
// src/controls/font-family-control.tsx
|
|
1190
1056
|
var SIZE2 = "tiny";
|
|
1191
1057
|
var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
1192
|
-
const [searchValue, setSearchValue] = (0,
|
|
1058
|
+
const [searchValue, setSearchValue] = (0, import_react9.useState)("");
|
|
1193
1059
|
const { value: fontFamily, setValue: setFontFamily } = useBoundProp(import_editor_props14.stringPropTypeUtil);
|
|
1194
|
-
const popupId = (0,
|
|
1060
|
+
const popupId = (0, import_react9.useId)();
|
|
1195
1061
|
const popoverState = (0, import_ui19.usePopupState)({ variant: "popover", popupId });
|
|
1196
1062
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
1197
1063
|
if (!filteredFontFamilies) {
|
|
@@ -1204,16 +1070,16 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1204
1070
|
setSearchValue("");
|
|
1205
1071
|
popoverState.close();
|
|
1206
1072
|
};
|
|
1207
|
-
return /* @__PURE__ */
|
|
1073
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(
|
|
1208
1074
|
import_ui19.UnstableTag,
|
|
1209
1075
|
{
|
|
1210
1076
|
variant: "outlined",
|
|
1211
1077
|
label: fontFamily,
|
|
1212
|
-
endIcon: /* @__PURE__ */
|
|
1078
|
+
endIcon: /* @__PURE__ */ React24.createElement(import_icons4.ChevronDownIcon, { fontSize: "tiny" }),
|
|
1213
1079
|
...(0, import_ui19.bindTrigger)(popoverState),
|
|
1214
1080
|
fullWidth: true
|
|
1215
1081
|
}
|
|
1216
|
-
), /* @__PURE__ */
|
|
1082
|
+
), /* @__PURE__ */ React24.createElement(
|
|
1217
1083
|
import_ui19.Popover,
|
|
1218
1084
|
{
|
|
1219
1085
|
disablePortal: true,
|
|
@@ -1222,7 +1088,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1222
1088
|
...(0, import_ui19.bindPopover)(popoverState),
|
|
1223
1089
|
onClose: handleClose
|
|
1224
1090
|
},
|
|
1225
|
-
/* @__PURE__ */
|
|
1091
|
+
/* @__PURE__ */ React24.createElement(import_ui19.Stack, null, /* @__PURE__ */ React24.createElement(import_ui19.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React24.createElement(import_icons4.EditIcon, { fontSize: SIZE2, sx: { mr: 0.5 } }), /* @__PURE__ */ React24.createElement(import_ui19.Typography, { variant: "subtitle2" }, (0, import_i18n9.__)("Font Family", "elementor")), /* @__PURE__ */ React24.createElement(import_ui19.IconButton, { size: SIZE2, sx: { ml: "auto" }, onClick: handleClose }, /* @__PURE__ */ React24.createElement(import_icons4.XIcon, { fontSize: SIZE2 }))), /* @__PURE__ */ React24.createElement(import_ui19.Box, { px: 1.5, pb: 1 }, /* @__PURE__ */ React24.createElement(
|
|
1226
1092
|
import_ui19.TextField,
|
|
1227
1093
|
{
|
|
1228
1094
|
fullWidth: true,
|
|
@@ -1231,12 +1097,12 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1231
1097
|
placeholder: (0, import_i18n9.__)("Search", "elementor"),
|
|
1232
1098
|
onChange: handleSearch,
|
|
1233
1099
|
InputProps: {
|
|
1234
|
-
startAdornment: /* @__PURE__ */
|
|
1100
|
+
startAdornment: /* @__PURE__ */ React24.createElement(import_ui19.InputAdornment, { position: "start" }, /* @__PURE__ */ React24.createElement(import_icons4.SearchIcon, { fontSize: SIZE2 }))
|
|
1235
1101
|
}
|
|
1236
1102
|
}
|
|
1237
|
-
)), /* @__PURE__ */
|
|
1103
|
+
)), /* @__PURE__ */ React24.createElement(import_ui19.Divider, null), /* @__PURE__ */ React24.createElement(import_ui19.Box, { sx: { overflowY: "auto", height: 260, width: 220 } }, filteredFontFamilies.length > 0 ? /* @__PURE__ */ React24.createElement(import_ui19.MenuList, { role: "listbox", tabIndex: 0 }, filteredFontFamilies.map(([category, items], index) => /* @__PURE__ */ React24.createElement(import_react9.Fragment, { key: index }, /* @__PURE__ */ React24.createElement(import_ui19.ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, category), items.map((item) => {
|
|
1238
1104
|
const isSelected = item === fontFamily;
|
|
1239
|
-
return /* @__PURE__ */
|
|
1105
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1240
1106
|
import_ui19.MenuItem,
|
|
1241
1107
|
{
|
|
1242
1108
|
key: item,
|
|
@@ -1251,7 +1117,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1251
1117
|
},
|
|
1252
1118
|
item
|
|
1253
1119
|
);
|
|
1254
|
-
})))) : /* @__PURE__ */
|
|
1120
|
+
})))) : /* @__PURE__ */ React24.createElement(import_ui19.Stack, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React24.createElement(import_icons4.PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React24.createElement(import_ui19.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n9.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React24.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React24.createElement(import_ui19.Typography, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React24.createElement(
|
|
1255
1121
|
import_ui19.Link,
|
|
1256
1122
|
{
|
|
1257
1123
|
color: "secondary",
|
|
@@ -1265,56 +1131,33 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1265
1131
|
});
|
|
1266
1132
|
|
|
1267
1133
|
// src/controls/url-control.tsx
|
|
1268
|
-
var
|
|
1134
|
+
var React25 = __toESM(require("react"));
|
|
1135
|
+
var import_editor_props15 = require("@elementor/editor-props");
|
|
1269
1136
|
var import_ui20 = require("@elementor/ui");
|
|
1270
1137
|
var UrlControl = createControl(({ placeholder }) => {
|
|
1271
|
-
const { value, setValue } = useBoundProp();
|
|
1272
|
-
const handleChange = (event) => setValue(
|
|
1273
|
-
|
|
1274
|
-
value: event.target.value
|
|
1275
|
-
});
|
|
1276
|
-
return /* @__PURE__ */ React24.createElement(ControlActions, null, /* @__PURE__ */ React24.createElement(
|
|
1277
|
-
import_ui20.TextField,
|
|
1278
|
-
{
|
|
1279
|
-
size: "tiny",
|
|
1280
|
-
fullWidth: true,
|
|
1281
|
-
value: value?.value,
|
|
1282
|
-
onChange: handleChange,
|
|
1283
|
-
placeholder
|
|
1284
|
-
}
|
|
1285
|
-
));
|
|
1138
|
+
const { value, setValue } = useBoundProp(import_editor_props15.urlPropTypeUtil);
|
|
1139
|
+
const handleChange = (event) => setValue(event.target.value);
|
|
1140
|
+
return /* @__PURE__ */ React25.createElement(ControlActions, null, /* @__PURE__ */ React25.createElement(import_ui20.TextField, { size: "tiny", fullWidth: true, value, onChange: handleChange, placeholder }));
|
|
1286
1141
|
});
|
|
1287
1142
|
|
|
1288
1143
|
// src/controls/link-control.tsx
|
|
1289
|
-
var
|
|
1144
|
+
var React26 = __toESM(require("react"));
|
|
1145
|
+
var import_editor_props16 = require("@elementor/editor-props");
|
|
1290
1146
|
var import_icons5 = require("@elementor/icons");
|
|
1291
1147
|
var import_ui21 = require("@elementor/ui");
|
|
1292
1148
|
var import_i18n10 = require("@wordpress/i18n");
|
|
1293
1149
|
var SIZE3 = "tiny";
|
|
1294
1150
|
var DEFAULT_LINK_CONTROL_VALUE = {
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
},
|
|
1302
|
-
isTargetBlank: false
|
|
1303
|
-
}
|
|
1151
|
+
enabled: false,
|
|
1152
|
+
href: {
|
|
1153
|
+
$$type: "url",
|
|
1154
|
+
value: ""
|
|
1155
|
+
},
|
|
1156
|
+
isTargetBlank: false
|
|
1304
1157
|
};
|
|
1305
1158
|
var LinkControl = createControl(() => {
|
|
1306
|
-
const { value = DEFAULT_LINK_CONTROL_VALUE,
|
|
1307
|
-
|
|
1308
|
-
const handleOnChange = (key, newValue) => {
|
|
1309
|
-
setValue({
|
|
1310
|
-
$$type: "link",
|
|
1311
|
-
value: {
|
|
1312
|
-
...value?.value ?? DEFAULT_LINK_CONTROL_VALUE.value,
|
|
1313
|
-
[key]: newValue
|
|
1314
|
-
}
|
|
1315
|
-
});
|
|
1316
|
-
};
|
|
1317
|
-
return /* @__PURE__ */ React25.createElement(import_ui21.Stack, { gap: 1.5 }, /* @__PURE__ */ React25.createElement(import_ui21.Divider, null), /* @__PURE__ */ React25.createElement(
|
|
1159
|
+
const { value = DEFAULT_LINK_CONTROL_VALUE, ...propContext } = useBoundProp(import_editor_props16.linkPropTypeUtil);
|
|
1160
|
+
return /* @__PURE__ */ React26.createElement(PropProvider, { ...propContext, value }, /* @__PURE__ */ React26.createElement(import_ui21.Stack, { gap: 1.5 }, /* @__PURE__ */ React26.createElement(import_ui21.Divider, null), /* @__PURE__ */ React26.createElement(
|
|
1318
1161
|
import_ui21.Stack,
|
|
1319
1162
|
{
|
|
1320
1163
|
direction: "row",
|
|
@@ -1323,45 +1166,42 @@ var LinkControl = createControl(() => {
|
|
|
1323
1166
|
alignItems: "center"
|
|
1324
1167
|
}
|
|
1325
1168
|
},
|
|
1326
|
-
/* @__PURE__ */
|
|
1327
|
-
/* @__PURE__ */
|
|
1328
|
-
), /* @__PURE__ */
|
|
1329
|
-
BoundPropProvider,
|
|
1330
|
-
{
|
|
1331
|
-
value: href,
|
|
1332
|
-
setValue: (newHref) => handleOnChange("href", newHref),
|
|
1333
|
-
bind: "href"
|
|
1334
|
-
},
|
|
1335
|
-
/* @__PURE__ */ React25.createElement(UrlControl, { placeholder: (0, import_i18n10.__)("Paste URL or type", "elementor") })
|
|
1336
|
-
), /* @__PURE__ */ React25.createElement(
|
|
1337
|
-
SwitchControl,
|
|
1338
|
-
{
|
|
1339
|
-
value: isTargetBlank,
|
|
1340
|
-
onSwitch: () => handleOnChange("isTargetBlank", !isTargetBlank)
|
|
1341
|
-
}
|
|
1342
|
-
))));
|
|
1169
|
+
/* @__PURE__ */ React26.createElement(ControlLabel, null, (0, import_i18n10.__)("Link", "elementor")),
|
|
1170
|
+
/* @__PURE__ */ React26.createElement(PropKeyProvider, { bind: "enabled" }, /* @__PURE__ */ React26.createElement(ToggleIconControl, null))
|
|
1171
|
+
), /* @__PURE__ */ React26.createElement(import_ui21.Collapse, { in: value?.enabled, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React26.createElement(import_ui21.Stack, { gap: 1.5 }, /* @__PURE__ */ React26.createElement(PropKeyProvider, { bind: "href" }, /* @__PURE__ */ React26.createElement(UrlControl, { placeholder: (0, import_i18n10.__)("Paste URL or type", "elementor") })), /* @__PURE__ */ React26.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React26.createElement(SwitchControl, null))))));
|
|
1343
1172
|
});
|
|
1344
|
-
var
|
|
1345
|
-
|
|
1173
|
+
var ToggleIconControl = () => {
|
|
1174
|
+
const { value = false, setValue } = useBoundProp();
|
|
1175
|
+
const handleOnChange = () => setValue(!value);
|
|
1176
|
+
return /* @__PURE__ */ React26.createElement(import_ui21.IconButton, { size: SIZE3, onClick: handleOnChange }, value ? /* @__PURE__ */ React26.createElement(import_icons5.MinusIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React26.createElement(import_icons5.PlusIcon, { fontSize: SIZE3 }));
|
|
1177
|
+
};
|
|
1178
|
+
var SwitchControl = () => {
|
|
1179
|
+
const { value = false, setValue } = useBoundProp();
|
|
1180
|
+
const onChange = () => {
|
|
1181
|
+
setValue(!value);
|
|
1182
|
+
};
|
|
1183
|
+
return /* @__PURE__ */ React26.createElement(import_ui21.Grid, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true }, /* @__PURE__ */ React26.createElement(ControlLabel, null, (0, import_i18n10.__)("Open in new tab", "elementor"))), /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true }, /* @__PURE__ */ React26.createElement(import_ui21.Switch, { checked: value, onChange })));
|
|
1346
1184
|
};
|
|
1347
1185
|
|
|
1348
1186
|
// src/controls/gap-control.tsx
|
|
1349
|
-
var
|
|
1350
|
-
var
|
|
1187
|
+
var React27 = __toESM(require("react"));
|
|
1188
|
+
var import_editor_props17 = require("@elementor/editor-props");
|
|
1351
1189
|
var import_icons6 = require("@elementor/icons");
|
|
1352
1190
|
var import_ui22 = require("@elementor/ui");
|
|
1353
1191
|
var import_i18n11 = require("@wordpress/i18n");
|
|
1354
1192
|
var GapControl = createControl(({ label }) => {
|
|
1355
|
-
const { value, setValue } = useBoundProp(
|
|
1193
|
+
const { propType, value, setValue } = useBoundProp(import_editor_props17.gapPropTypeUtil);
|
|
1356
1194
|
const { column, row, isLinked = true } = value || {};
|
|
1357
|
-
const setLinkedValue = (
|
|
1358
|
-
|
|
1195
|
+
const setLinkedValue = (newValue, _, meta) => {
|
|
1196
|
+
if (!isLinked) {
|
|
1197
|
+
return setValue(newValue);
|
|
1198
|
+
}
|
|
1199
|
+
const newDimension = newValue[meta?.bind];
|
|
1200
|
+
setValue({
|
|
1359
1201
|
isLinked,
|
|
1360
|
-
column:
|
|
1361
|
-
row:
|
|
1362
|
-
|
|
1363
|
-
};
|
|
1364
|
-
setValue(updatedValue);
|
|
1202
|
+
column: newDimension,
|
|
1203
|
+
row: newDimension
|
|
1204
|
+
});
|
|
1365
1205
|
};
|
|
1366
1206
|
const toggleLinked = () => {
|
|
1367
1207
|
const updatedValue = {
|
|
@@ -1372,7 +1212,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
1372
1212
|
setValue(updatedValue);
|
|
1373
1213
|
};
|
|
1374
1214
|
const LinkedIcon = isLinked ? import_icons6.LinkIcon : import_icons6.DetachIcon;
|
|
1375
|
-
return /* @__PURE__ */
|
|
1215
|
+
return /* @__PURE__ */ React27.createElement(PropProvider, { propType, value, setValue: setLinkedValue }, /* @__PURE__ */ React27.createElement(import_ui22.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(ControlLabel, null, label), /* @__PURE__ */ React27.createElement(
|
|
1376
1216
|
import_ui22.ToggleButton,
|
|
1377
1217
|
{
|
|
1378
1218
|
"aria-label": (0, import_i18n11.__)("Link Inputs", "elementor"),
|
|
@@ -1382,35 +1222,19 @@ var GapControl = createControl(({ label }) => {
|
|
|
1382
1222
|
sx: { marginLeft: "auto" },
|
|
1383
1223
|
onChange: toggleLinked
|
|
1384
1224
|
},
|
|
1385
|
-
/* @__PURE__ */
|
|
1386
|
-
)), /* @__PURE__ */
|
|
1387
|
-
BoundPropProvider,
|
|
1388
|
-
{
|
|
1389
|
-
setValue: (newValue) => setLinkedValue("column", newValue),
|
|
1390
|
-
value: column,
|
|
1391
|
-
bind: "column"
|
|
1392
|
-
},
|
|
1393
|
-
/* @__PURE__ */ React26.createElement(SizeControl, null)
|
|
1394
|
-
))), /* @__PURE__ */ React26.createElement(import_ui22.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React26.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, (0, import_i18n11.__)("Row", "elementor"))), /* @__PURE__ */ React26.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(
|
|
1395
|
-
BoundPropProvider,
|
|
1396
|
-
{
|
|
1397
|
-
setValue: (newValue) => setLinkedValue("row", newValue),
|
|
1398
|
-
value: row,
|
|
1399
|
-
bind: "row"
|
|
1400
|
-
},
|
|
1401
|
-
/* @__PURE__ */ React26.createElement(SizeControl, null)
|
|
1402
|
-
)))));
|
|
1225
|
+
/* @__PURE__ */ React27.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1226
|
+
)), /* @__PURE__ */ React27.createElement(import_ui22.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(import_ui22.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, (0, import_i18n11.__)("Column", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind: "column" }, /* @__PURE__ */ React27.createElement(SizeControl, null)))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, (0, import_i18n11.__)("Row", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind: "row" }, /* @__PURE__ */ React27.createElement(SizeControl, null))))));
|
|
1403
1227
|
});
|
|
1404
1228
|
|
|
1405
1229
|
// src/controls/background-control/background-control.tsx
|
|
1406
|
-
var
|
|
1407
|
-
var
|
|
1230
|
+
var React29 = __toESM(require("react"));
|
|
1231
|
+
var import_editor_props19 = require("@elementor/editor-props");
|
|
1408
1232
|
var import_ui24 = require("@elementor/ui");
|
|
1409
1233
|
var import_i18n13 = require("@wordpress/i18n");
|
|
1410
1234
|
|
|
1411
1235
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1412
|
-
var
|
|
1413
|
-
var
|
|
1236
|
+
var React28 = __toESM(require("react"));
|
|
1237
|
+
var import_editor_props18 = require("@elementor/editor-props");
|
|
1414
1238
|
var import_ui23 = require("@elementor/ui");
|
|
1415
1239
|
var import_i18n12 = require("@wordpress/i18n");
|
|
1416
1240
|
var initialBackgroundOverlay = {
|
|
@@ -1418,15 +1242,12 @@ var initialBackgroundOverlay = {
|
|
|
1418
1242
|
value: "rgba(0, 0, 0, 0.2)"
|
|
1419
1243
|
};
|
|
1420
1244
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
1421
|
-
const { value: overlayValues, setValue } = useBoundProp(
|
|
1422
|
-
|
|
1423
|
-
setValue(newValue);
|
|
1424
|
-
};
|
|
1425
|
-
return /* @__PURE__ */ React27.createElement(
|
|
1245
|
+
const { propType, value: overlayValues, setValue } = useBoundProp(import_editor_props18.backgroundOverlayPropTypeUtil);
|
|
1246
|
+
return /* @__PURE__ */ React28.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React28.createElement(
|
|
1426
1247
|
Repeater,
|
|
1427
1248
|
{
|
|
1428
1249
|
values: overlayValues ?? [],
|
|
1429
|
-
setValues:
|
|
1250
|
+
setValues: setValue,
|
|
1430
1251
|
label: (0, import_i18n12.__)("Overlay", "elementor"),
|
|
1431
1252
|
itemSettings: {
|
|
1432
1253
|
Icon: ItemIcon2,
|
|
@@ -1435,63 +1256,28 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
1435
1256
|
initialValues: initialBackgroundOverlay
|
|
1436
1257
|
}
|
|
1437
1258
|
}
|
|
1438
|
-
);
|
|
1439
|
-
});
|
|
1440
|
-
var ItemIcon2 = ({ value }) => /* @__PURE__ */ React27.createElement(import_ui23.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value });
|
|
1441
|
-
var ItemContent2 = ({
|
|
1442
|
-
value,
|
|
1443
|
-
setValue
|
|
1444
|
-
}) => {
|
|
1445
|
-
const setBackgroundColorOverlay = (newValue) => {
|
|
1446
|
-
setValue({
|
|
1447
|
-
$$type: "background-color-overlay",
|
|
1448
|
-
value: newValue.value
|
|
1449
|
-
});
|
|
1450
|
-
};
|
|
1451
|
-
return /* @__PURE__ */ React27.createElement(import_ui23.Stack, { gap: 1.5 }, /* @__PURE__ */ React27.createElement(
|
|
1452
|
-
BoundPropProvider,
|
|
1453
|
-
{
|
|
1454
|
-
bind: "background-color-overlay",
|
|
1455
|
-
value,
|
|
1456
|
-
setValue: setBackgroundColorOverlay
|
|
1457
|
-
},
|
|
1458
|
-
/* @__PURE__ */ React27.createElement(import_ui23.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(import_ui23.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, (0, import_i18n12.__)("Color", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui23.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ColorControl, null)))
|
|
1459
1259
|
));
|
|
1260
|
+
});
|
|
1261
|
+
var ItemIcon2 = ({ value }) => /* @__PURE__ */ React28.createElement(import_ui23.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value });
|
|
1262
|
+
var ItemContent2 = ({ bind }) => {
|
|
1263
|
+
return /* @__PURE__ */ React28.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React28.createElement(Content2, null));
|
|
1264
|
+
};
|
|
1265
|
+
var Content2 = () => {
|
|
1266
|
+
return /* @__PURE__ */ React28.createElement(import_ui23.Stack, { gap: 1.5 }, /* @__PURE__ */ React28.createElement(import_ui23.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React28.createElement(import_ui23.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(ControlLabel, null, (0, import_i18n12.__)("Color", "elementor"))), /* @__PURE__ */ React28.createElement(import_ui23.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(ColorControl, { propTypeUtil: import_editor_props18.backgroundColorOverlayPropTypeUtil }))));
|
|
1460
1267
|
};
|
|
1461
1268
|
var ItemLabel2 = ({ value }) => {
|
|
1462
1269
|
const color = value.value;
|
|
1463
|
-
return /* @__PURE__ */
|
|
1270
|
+
return /* @__PURE__ */ React28.createElement("span", null, color);
|
|
1464
1271
|
};
|
|
1465
1272
|
|
|
1466
1273
|
// src/controls/background-control/background-control.tsx
|
|
1467
1274
|
var BackgroundControl = createControl(() => {
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1470
|
-
setValue({
|
|
1471
|
-
...value,
|
|
1472
|
-
color: newValue
|
|
1473
|
-
});
|
|
1474
|
-
};
|
|
1475
|
-
const setBackgroundColorOverlay = (newValue) => {
|
|
1476
|
-
setValue({
|
|
1477
|
-
...value,
|
|
1478
|
-
"background-overlay": newValue
|
|
1479
|
-
});
|
|
1480
|
-
};
|
|
1481
|
-
return /* @__PURE__ */ React28.createElement(import_ui24.Stack, { gap: 1.5 }, /* @__PURE__ */ React28.createElement(
|
|
1482
|
-
BoundPropProvider,
|
|
1483
|
-
{
|
|
1484
|
-
bind: "background-overlay",
|
|
1485
|
-
value: value?.["background-overlay"],
|
|
1486
|
-
setValue: setBackgroundColorOverlay
|
|
1487
|
-
},
|
|
1488
|
-
/* @__PURE__ */ React28.createElement(BackgroundOverlayRepeaterControl, null)
|
|
1489
|
-
), /* @__PURE__ */ React28.createElement(BoundPropProvider, { bind: "color", value: value?.color, setValue: setColor }, /* @__PURE__ */ React28.createElement(import_ui24.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlLabel, null, (0, import_i18n13.__)("Color", "elementor"))), /* @__PURE__ */ React28.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ColorControl, null)))));
|
|
1275
|
+
const propContext = useBoundProp(import_editor_props19.backgroundPropTypeUtil);
|
|
1276
|
+
return /* @__PURE__ */ React29.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React29.createElement(import_ui24.Stack, { gap: 1.5 }, /* @__PURE__ */ React29.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React29.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React29.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React29.createElement(import_ui24.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React29.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React29.createElement(ControlLabel, null, (0, import_i18n13.__)("Color", "elementor"))), /* @__PURE__ */ React29.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React29.createElement(ColorControl, null))))));
|
|
1490
1277
|
});
|
|
1491
1278
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1492
1279
|
0 && (module.exports = {
|
|
1493
1280
|
BackgroundControl,
|
|
1494
|
-
BoundPropProvider,
|
|
1495
1281
|
BoxShadowRepeaterControl,
|
|
1496
1282
|
ColorControl,
|
|
1497
1283
|
ControlActionsProvider,
|
|
@@ -1505,6 +1291,8 @@ var BackgroundControl = createControl(() => {
|
|
|
1505
1291
|
LinkControl,
|
|
1506
1292
|
LinkedDimensionsControl,
|
|
1507
1293
|
NumberControl,
|
|
1294
|
+
PropKeyProvider,
|
|
1295
|
+
PropProvider,
|
|
1508
1296
|
SelectControl,
|
|
1509
1297
|
SizeControl,
|
|
1510
1298
|
StrokeControl,
|