@elementor/editor-editing-panel 1.30.0 → 1.32.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 +37 -0
- package/dist/index.d.mts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +966 -630
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +870 -527
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
- package/src/components/creatable-autocomplete/autocomplete-option-internal-properties.ts +21 -0
- package/src/components/creatable-autocomplete/creatable-autocomplete.tsx +175 -0
- package/src/components/creatable-autocomplete/index.ts +3 -0
- package/src/components/creatable-autocomplete/types.ts +38 -0
- package/src/components/creatable-autocomplete/use-autocomplete-change.ts +75 -0
- package/src/components/creatable-autocomplete/use-autocomplete-states.ts +42 -0
- package/src/components/creatable-autocomplete/use-create-option.ts +45 -0
- package/src/components/creatable-autocomplete/use-filter-options.ts +50 -0
- package/src/components/css-classes/css-class-item.tsx +2 -2
- package/src/components/css-classes/css-class-selector.tsx +44 -27
- package/src/components/editing-panel-tabs.tsx +19 -14
- package/src/components/style-sections/position-section/offset-field.tsx +22 -0
- package/src/components/style-sections/position-section/position-section.tsx +4 -0
- package/src/components/style-tab.tsx +26 -3
- package/src/contexts/scroll-context.tsx +60 -0
- package/src/hooks/use-normalized-inheritance-chain-items.tsx +68 -0
- package/src/index.ts +1 -0
- package/src/styles-inheritance/styles-inheritance-indicator.tsx +65 -19
- package/src/styles-inheritance/styles-inheritance-infotip.tsx +50 -0
- package/src/sync/get-experiments-config.ts +7 -0
- package/src/sync/types.ts +7 -0
- package/src/components/multi-combobox.tsx +0 -165
package/dist/index.mjs
CHANGED
|
@@ -12,13 +12,13 @@ import { classesPropTypeUtil } from "@elementor/editor-props";
|
|
|
12
12
|
import {
|
|
13
13
|
isElementsStylesProvider as isElementsStylesProvider2,
|
|
14
14
|
stylesRepository as stylesRepository4,
|
|
15
|
-
|
|
15
|
+
useGetStylesRepositoryCreateAction,
|
|
16
16
|
useProviders,
|
|
17
17
|
validateStyleLabel as validateStyleLabel2
|
|
18
18
|
} from "@elementor/editor-styles-repository";
|
|
19
19
|
import { MapPinIcon } from "@elementor/icons";
|
|
20
20
|
import { createLocation } from "@elementor/locations";
|
|
21
|
-
import { Chip as
|
|
21
|
+
import { Chip as Chip3, FormLabel, Stack as Stack3 } from "@elementor/ui";
|
|
22
22
|
import { __ as __3 } from "@wordpress/i18n";
|
|
23
23
|
|
|
24
24
|
// src/contexts/classes-prop-context.tsx
|
|
@@ -98,23 +98,200 @@ function getProviderByStyleId(styleId) {
|
|
|
98
98
|
return styleProvider ?? null;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
// src/components/
|
|
101
|
+
// src/components/creatable-autocomplete/creatable-autocomplete.tsx
|
|
102
102
|
import * as React4 from "react";
|
|
103
|
+
import { useId, useMemo } from "react";
|
|
104
|
+
import {
|
|
105
|
+
Autocomplete,
|
|
106
|
+
Box,
|
|
107
|
+
Chip,
|
|
108
|
+
styled,
|
|
109
|
+
TextField,
|
|
110
|
+
Typography
|
|
111
|
+
} from "@elementor/ui";
|
|
112
|
+
|
|
113
|
+
// src/components/creatable-autocomplete/autocomplete-option-internal-properties.ts
|
|
114
|
+
function addGroupToOptions(options12, pluralEntityName) {
|
|
115
|
+
return options12.map((option) => {
|
|
116
|
+
return {
|
|
117
|
+
...option,
|
|
118
|
+
_group: `Existing ${pluralEntityName ?? "options"}`
|
|
119
|
+
};
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function removeOptionsInternalKeys(options12) {
|
|
123
|
+
return options12.map((option) => {
|
|
124
|
+
const { _group, _action, ...rest } = option;
|
|
125
|
+
return rest;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// src/components/creatable-autocomplete/use-autocomplete-change.ts
|
|
130
|
+
function useAutocompleteChange(params) {
|
|
131
|
+
const { options: options12, onSelect, createOption, setInputValue, closeDropdown } = params;
|
|
132
|
+
const handleChange = async (_, selectedOrInputValue, reason) => {
|
|
133
|
+
const selectedOptions = selectedOrInputValue.filter((option) => typeof option !== "string");
|
|
134
|
+
const newInputValue = selectedOrInputValue.reduce((acc, option) => {
|
|
135
|
+
if (typeof option === "string") {
|
|
136
|
+
return option;
|
|
137
|
+
} else if (option._action === "create") {
|
|
138
|
+
return option.value;
|
|
139
|
+
}
|
|
140
|
+
return acc;
|
|
141
|
+
}, null);
|
|
142
|
+
const inputValueMatchesExistingOption = newInputValue && options12.find((option) => option.label === newInputValue);
|
|
143
|
+
if (newInputValue && shouldCreateNewOption(reason, selectedOptions, newInputValue, Boolean(inputValueMatchesExistingOption))) {
|
|
144
|
+
return createOption(newInputValue);
|
|
145
|
+
}
|
|
146
|
+
if (reason === "createOption" && inputValueMatchesExistingOption) {
|
|
147
|
+
selectedOptions.push(inputValueMatchesExistingOption);
|
|
148
|
+
}
|
|
149
|
+
updateSelectedOptions(selectedOptions);
|
|
150
|
+
setInputValue("");
|
|
151
|
+
closeDropdown();
|
|
152
|
+
};
|
|
153
|
+
return handleChange;
|
|
154
|
+
function shouldCreateNewOption(reason, selectedOptions, newInputValue, inputValueMatchesExistingOption) {
|
|
155
|
+
const createOptionWasClicked = reason === "selectOption" && selectedOptions.some((option) => option._action === "create");
|
|
156
|
+
const enterWasPressed = reason === "createOption" && !options12.some((option) => option.label === newInputValue);
|
|
157
|
+
const createOptionWasDisplayed = !inputValueMatchesExistingOption;
|
|
158
|
+
return createOptionWasClicked || enterWasPressed && createOptionWasDisplayed;
|
|
159
|
+
}
|
|
160
|
+
function updateSelectedOptions(selectedOptions) {
|
|
161
|
+
const fixedOptions = options12.filter((option) => !!option.fixed);
|
|
162
|
+
const updatedOptions = [...fixedOptions, ...selectedOptions.filter((option) => !option.fixed)];
|
|
163
|
+
onSelect?.(removeOptionsInternalKeys(updatedOptions));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// src/components/creatable-autocomplete/use-autocomplete-states.ts
|
|
103
168
|
import { useState } from "react";
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
169
|
+
function useInputState(validate) {
|
|
170
|
+
const [inputValue, setInputValue] = useState("");
|
|
171
|
+
const [error, setError] = useState(null);
|
|
172
|
+
const handleInputChange = (event) => {
|
|
173
|
+
const { value } = event.target;
|
|
174
|
+
setInputValue(value);
|
|
175
|
+
if (!validate) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (!value) {
|
|
179
|
+
setError(null);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const { isValid, errorMessage } = validate(value, "inputChange");
|
|
183
|
+
if (isValid) {
|
|
184
|
+
setError(null);
|
|
185
|
+
} else {
|
|
186
|
+
setError(errorMessage);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
return { inputValue, setInputValue, error, setError, handleInputChange };
|
|
190
|
+
}
|
|
191
|
+
function useOpenState(initialOpen = false) {
|
|
192
|
+
const [open, setOpen] = useState(initialOpen);
|
|
193
|
+
const openDropdown = () => setOpen(true);
|
|
194
|
+
const closeDropdown = () => setOpen(false);
|
|
195
|
+
return { open, openDropdown, closeDropdown };
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// src/components/creatable-autocomplete/use-create-option.ts
|
|
199
|
+
import { useState as useState2 } from "react";
|
|
200
|
+
function useCreateOption(params) {
|
|
201
|
+
const { onCreate, validate, setInputValue, setError, closeDropdown } = params;
|
|
202
|
+
const [loading, setLoading] = useState2(false);
|
|
203
|
+
const createOption = async (value) => {
|
|
204
|
+
if (!onCreate) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
setLoading(true);
|
|
208
|
+
if (validate) {
|
|
209
|
+
const { isValid, errorMessage } = validate(value, "create");
|
|
210
|
+
if (!isValid) {
|
|
211
|
+
setError(errorMessage);
|
|
212
|
+
setLoading(false);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
try {
|
|
217
|
+
setInputValue("");
|
|
218
|
+
closeDropdown();
|
|
219
|
+
await onCreate(value);
|
|
220
|
+
} catch {
|
|
221
|
+
} finally {
|
|
222
|
+
setLoading(false);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
return { createOption, loading };
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// src/components/creatable-autocomplete/use-filter-options.ts
|
|
229
|
+
import { createFilterOptions } from "@elementor/ui";
|
|
230
|
+
function useFilterOptions(parameters) {
|
|
231
|
+
const { options: options12, selected, onCreate, entityName } = parameters;
|
|
232
|
+
const filter = createFilterOptions();
|
|
233
|
+
const filterOptions = (optionList, params) => {
|
|
234
|
+
const selectedValues = selected.map((option) => option.value);
|
|
235
|
+
const filteredOptions = filter(
|
|
236
|
+
optionList.filter((option) => !selectedValues.includes(option.value)),
|
|
237
|
+
params
|
|
238
|
+
);
|
|
239
|
+
const isExisting = options12.some((option) => params.inputValue === option.label);
|
|
240
|
+
const allowCreate = Boolean(onCreate) && params.inputValue !== "" && !selectedValues.includes(params.inputValue) && !isExisting;
|
|
241
|
+
if (allowCreate) {
|
|
242
|
+
filteredOptions.unshift({
|
|
243
|
+
label: `Create "${params.inputValue}"`,
|
|
244
|
+
value: params.inputValue,
|
|
245
|
+
_group: `Create a new ${entityName?.singular ?? "option"}`,
|
|
246
|
+
key: `create-${params.inputValue}`,
|
|
247
|
+
_action: "create"
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
return filteredOptions;
|
|
251
|
+
};
|
|
252
|
+
return filterOptions;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// src/components/creatable-autocomplete/creatable-autocomplete.tsx
|
|
256
|
+
function CreatableAutocomplete({
|
|
107
257
|
selected,
|
|
108
258
|
options: options12,
|
|
259
|
+
entityName,
|
|
109
260
|
onSelect,
|
|
110
261
|
placeholder,
|
|
262
|
+
onCreate,
|
|
263
|
+
validate,
|
|
111
264
|
...props
|
|
112
265
|
}) {
|
|
113
|
-
const
|
|
114
|
-
const {
|
|
266
|
+
const { inputValue, setInputValue, error, setError, handleInputChange } = useInputState(validate);
|
|
267
|
+
const { open, openDropdown, closeDropdown } = useOpenState(props.open);
|
|
268
|
+
const { createOption, loading } = useCreateOption({ onCreate, validate, setInputValue, setError, closeDropdown });
|
|
269
|
+
const [internalOptions, internalSelected] = useMemo(
|
|
270
|
+
() => [options12, selected].map((optionsArr) => addGroupToOptions(optionsArr, entityName?.plural)),
|
|
271
|
+
[options12, selected, entityName?.plural]
|
|
272
|
+
);
|
|
273
|
+
const handleChange = useAutocompleteChange({
|
|
274
|
+
options: internalOptions,
|
|
275
|
+
onSelect,
|
|
276
|
+
createOption,
|
|
277
|
+
setInputValue,
|
|
278
|
+
closeDropdown
|
|
279
|
+
});
|
|
280
|
+
const filterOptions = useFilterOptions({ options: options12, selected, onCreate, entityName });
|
|
115
281
|
return /* @__PURE__ */ React4.createElement(
|
|
116
282
|
Autocomplete,
|
|
117
283
|
{
|
|
284
|
+
renderTags: (tagValue, getTagProps) => {
|
|
285
|
+
return tagValue.map((option, index) => /* @__PURE__ */ React4.createElement(
|
|
286
|
+
Chip,
|
|
287
|
+
{
|
|
288
|
+
size: "tiny",
|
|
289
|
+
...getTagProps({ index }),
|
|
290
|
+
key: option.key ?? option.value ?? option.label,
|
|
291
|
+
label: option.label
|
|
292
|
+
}
|
|
293
|
+
));
|
|
294
|
+
},
|
|
118
295
|
...props,
|
|
119
296
|
freeSolo: true,
|
|
120
297
|
multiple: true,
|
|
@@ -123,37 +300,33 @@ function MultiCombobox({
|
|
|
123
300
|
disableClearable: true,
|
|
124
301
|
handleHomeEndKeys: true,
|
|
125
302
|
disabled: loading,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
303
|
+
open,
|
|
304
|
+
onOpen: openDropdown,
|
|
305
|
+
onClose: closeDropdown,
|
|
306
|
+
disableCloseOnSelect: true,
|
|
307
|
+
value: internalSelected,
|
|
308
|
+
options: internalOptions,
|
|
309
|
+
ListboxComponent: error ? React4.forwardRef((_, ref) => /* @__PURE__ */ React4.createElement(ErrorText, { ref, error })) : void 0,
|
|
310
|
+
renderGroup: (params) => /* @__PURE__ */ React4.createElement(Group, { ...params }),
|
|
311
|
+
inputValue,
|
|
312
|
+
renderInput: (params) => {
|
|
313
|
+
return /* @__PURE__ */ React4.createElement(
|
|
314
|
+
TextField,
|
|
315
|
+
{
|
|
316
|
+
...params,
|
|
317
|
+
placeholder,
|
|
318
|
+
error: Boolean(error),
|
|
319
|
+
onChange: handleInputChange,
|
|
320
|
+
sx: (theme) => ({
|
|
321
|
+
".MuiAutocomplete-inputRoot.MuiInputBase-adornedStart": {
|
|
322
|
+
paddingLeft: theme.spacing(0.25),
|
|
323
|
+
paddingRight: theme.spacing(0.25)
|
|
324
|
+
}
|
|
325
|
+
})
|
|
148
326
|
}
|
|
149
|
-
|
|
150
|
-
const action = optionsAndActions.find((value) => isAction(value));
|
|
151
|
-
if (reason === "selectOption" && action?.value) {
|
|
152
|
-
return run(action.apply, action.value);
|
|
153
|
-
}
|
|
154
|
-
const fixedValues = options12.filter((option) => !!option.fixed);
|
|
155
|
-
onSelect?.([.../* @__PURE__ */ new Set([...optionsAndActions, ...fixedValues])]);
|
|
327
|
+
);
|
|
156
328
|
},
|
|
329
|
+
onChange: handleChange,
|
|
157
330
|
getOptionLabel: (option) => typeof option === "string" ? option : option.label,
|
|
158
331
|
getOptionKey: (option) => {
|
|
159
332
|
if (typeof option === "string") {
|
|
@@ -161,61 +334,66 @@ function MultiCombobox({
|
|
|
161
334
|
}
|
|
162
335
|
return option.key ?? option.value ?? option.label;
|
|
163
336
|
},
|
|
164
|
-
filterOptions
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
337
|
+
filterOptions,
|
|
338
|
+
groupBy: (option) => option._group ?? "",
|
|
339
|
+
renderOption: (optionProps, option) => {
|
|
340
|
+
const { _group, label } = option;
|
|
341
|
+
return /* @__PURE__ */ React4.createElement(
|
|
342
|
+
"li",
|
|
343
|
+
{
|
|
344
|
+
...optionProps,
|
|
345
|
+
style: { display: "block", textOverflow: "ellipsis" },
|
|
346
|
+
"data-group": _group
|
|
347
|
+
},
|
|
348
|
+
label
|
|
349
|
+
);
|
|
350
|
+
}
|
|
176
351
|
}
|
|
177
352
|
);
|
|
178
353
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
354
|
+
var Group = (params) => {
|
|
355
|
+
const id = `combobox-group-${useId().replace(/:/g, "_")}`;
|
|
356
|
+
return /* @__PURE__ */ React4.createElement(StyledGroup, { role: "group", "aria-labelledby": id }, /* @__PURE__ */ React4.createElement(StyledGroupHeader, { id }, " ", params.group), /* @__PURE__ */ React4.createElement(StyledGroupItems, { role: "listbox" }, params.children));
|
|
357
|
+
};
|
|
358
|
+
var ErrorText = React4.forwardRef(({ error = "error" }, ref) => {
|
|
359
|
+
return /* @__PURE__ */ React4.createElement(
|
|
360
|
+
Box,
|
|
361
|
+
{
|
|
362
|
+
ref,
|
|
363
|
+
sx: (theme) => ({
|
|
364
|
+
padding: theme.spacing(2)
|
|
365
|
+
})
|
|
366
|
+
},
|
|
367
|
+
/* @__PURE__ */ React4.createElement(Typography, { variant: "caption", sx: { color: "error.main" } }, error)
|
|
368
|
+
);
|
|
369
|
+
});
|
|
370
|
+
var StyledGroup = styled("li")`
|
|
371
|
+
&:not( :last-of-type ) {
|
|
372
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.divider};
|
|
373
|
+
}
|
|
374
|
+
`;
|
|
375
|
+
var StyledGroupHeader = styled(Box)(({ theme }) => ({
|
|
376
|
+
position: "sticky",
|
|
377
|
+
top: "-8px",
|
|
378
|
+
padding: theme.spacing(1, 2),
|
|
379
|
+
color: theme.palette.text.tertiary,
|
|
380
|
+
backgroundColor: theme.palette.primary.contrastText
|
|
381
|
+
}));
|
|
382
|
+
var StyledGroupItems = styled("ul")`
|
|
383
|
+
padding: 0;
|
|
384
|
+
`;
|
|
207
385
|
|
|
208
386
|
// src/components/css-classes/css-class-item.tsx
|
|
209
387
|
import * as React6 from "react";
|
|
210
|
-
import { useState as
|
|
388
|
+
import { useState as useState3 } from "react";
|
|
211
389
|
import { stylesRepository as stylesRepository3, validateStyleLabel } from "@elementor/editor-styles-repository";
|
|
212
390
|
import { EditableField, EllipsisWithTooltip, useEditable } from "@elementor/editor-ui";
|
|
213
391
|
import { DotsVerticalIcon } from "@elementor/icons";
|
|
214
392
|
import {
|
|
215
393
|
bindTrigger,
|
|
216
|
-
Chip,
|
|
394
|
+
Chip as Chip2,
|
|
217
395
|
Stack as Stack2,
|
|
218
|
-
Typography,
|
|
396
|
+
Typography as Typography2,
|
|
219
397
|
UnstableChipGroup,
|
|
220
398
|
usePopupState
|
|
221
399
|
} from "@elementor/ui";
|
|
@@ -251,8 +429,8 @@ var useUnapplyClass = (classId) => {
|
|
|
251
429
|
};
|
|
252
430
|
|
|
253
431
|
// src/components/style-indicator.tsx
|
|
254
|
-
import { styled } from "@elementor/ui";
|
|
255
|
-
var StyleIndicator =
|
|
432
|
+
import { styled as styled2 } from "@elementor/ui";
|
|
433
|
+
var StyleIndicator = styled2("div", {
|
|
256
434
|
shouldForwardProp: (prop) => prop !== "variant"
|
|
257
435
|
})`
|
|
258
436
|
width: 5px;
|
|
@@ -439,7 +617,7 @@ function CssClassItem({
|
|
|
439
617
|
}) {
|
|
440
618
|
const { meta, setMetaState } = useStyle();
|
|
441
619
|
const popupState = usePopupState({ variant: "popover" });
|
|
442
|
-
const [chipRef, setChipRef] =
|
|
620
|
+
const [chipRef, setChipRef] = useState3(null);
|
|
443
621
|
const { onDelete, ...chipGroupProps } = chipProps;
|
|
444
622
|
const {
|
|
445
623
|
ref,
|
|
@@ -468,7 +646,7 @@ function CssClassItem({
|
|
|
468
646
|
})
|
|
469
647
|
},
|
|
470
648
|
/* @__PURE__ */ React6.createElement(
|
|
471
|
-
|
|
649
|
+
Chip2,
|
|
472
650
|
{
|
|
473
651
|
size: CHIP_SIZE,
|
|
474
652
|
label: isEditing ? /* @__PURE__ */ React6.createElement(EditableField, { ref, error, ...getEditableProps() }) : /* @__PURE__ */ React6.createElement(EllipsisWithTooltip, { maxWidth: "10ch", title: label, as: "div" }),
|
|
@@ -499,11 +677,11 @@ function CssClassItem({
|
|
|
499
677
|
}
|
|
500
678
|
),
|
|
501
679
|
!isEditing && /* @__PURE__ */ React6.createElement(
|
|
502
|
-
|
|
680
|
+
Chip2,
|
|
503
681
|
{
|
|
504
682
|
icon: isShowingState ? void 0 : /* @__PURE__ */ React6.createElement(DotsVerticalIcon, { fontSize: "tiny" }),
|
|
505
683
|
size: CHIP_SIZE,
|
|
506
|
-
label: isShowingState ? /* @__PURE__ */ React6.createElement(Stack2, { direction: "row", gap: 0.5, alignItems: "center" }, /* @__PURE__ */ React6.createElement(
|
|
684
|
+
label: isShowingState ? /* @__PURE__ */ React6.createElement(Stack2, { direction: "row", gap: 0.5, alignItems: "center" }, /* @__PURE__ */ React6.createElement(Typography2, { variant: "inherit" }, meta.state), /* @__PURE__ */ React6.createElement(DotsVerticalIcon, { fontSize: "tiny" })) : void 0,
|
|
507
685
|
variant: "filled",
|
|
508
686
|
shape: "rounded",
|
|
509
687
|
color,
|
|
@@ -529,11 +707,11 @@ function CssClassItem({
|
|
|
529
707
|
));
|
|
530
708
|
}
|
|
531
709
|
var validateLabel = (newLabel) => {
|
|
532
|
-
const result = validateStyleLabel(newLabel);
|
|
710
|
+
const result = validateStyleLabel(newLabel, "rename");
|
|
533
711
|
if (result.isValid) {
|
|
534
712
|
return null;
|
|
535
713
|
}
|
|
536
|
-
return result.
|
|
714
|
+
return result.errorMessage;
|
|
537
715
|
};
|
|
538
716
|
|
|
539
717
|
// src/components/css-classes/css-class-selector.tsx
|
|
@@ -552,23 +730,25 @@ function CssClassSelector() {
|
|
|
552
730
|
const options12 = useOptions();
|
|
553
731
|
const { value: appliedIds, setValue: setAppliedIds, pushValue: pushAppliedId } = useAppliedClassesIds();
|
|
554
732
|
const { id: activeId, setId: setActiveId } = useStyle();
|
|
555
|
-
const actions = useCreateActions({ pushAppliedId, setActiveId });
|
|
556
733
|
const handleApply = useHandleApply(appliedIds, setAppliedIds);
|
|
734
|
+
const { create, validate, entityName } = useCreateAction({ pushAppliedId, setActiveId });
|
|
557
735
|
const applied = useAppliedOptions(options12, appliedIds);
|
|
558
736
|
const active = applied.find((option) => option.value === activeId) ?? EMPTY_OPTION;
|
|
559
737
|
const showPlaceholder = applied.every(({ fixed }) => fixed);
|
|
560
738
|
return /* @__PURE__ */ React7.createElement(Stack3, { p: 2 }, /* @__PURE__ */ React7.createElement(Stack3, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React7.createElement(FormLabel, { htmlFor: ID, size: "small" }, __3("Classes", "elementor")), /* @__PURE__ */ React7.createElement(Stack3, { direction: "row", gap: 1 }, /* @__PURE__ */ React7.createElement(ClassSelectorActionsSlot, null))), /* @__PURE__ */ React7.createElement(
|
|
561
|
-
|
|
739
|
+
CreatableAutocomplete,
|
|
562
740
|
{
|
|
563
741
|
id: ID,
|
|
564
742
|
size: "tiny",
|
|
565
743
|
placeholder: showPlaceholder ? __3("Type class name", "elementor") : void 0,
|
|
566
744
|
options: options12,
|
|
567
745
|
selected: applied,
|
|
746
|
+
entityName,
|
|
568
747
|
onSelect: handleApply,
|
|
748
|
+
onCreate: create ?? void 0,
|
|
749
|
+
validate: validate ?? void 0,
|
|
569
750
|
limitTags: TAGS_LIMIT,
|
|
570
|
-
|
|
571
|
-
getLimitTagsText: (more) => /* @__PURE__ */ React7.createElement(Chip2, { size: "tiny", variant: "standard", label: `+${more}`, clickable: true }),
|
|
751
|
+
getLimitTagsText: (more) => /* @__PURE__ */ React7.createElement(Chip3, { size: "tiny", variant: "standard", label: `+${more}`, clickable: true }),
|
|
572
752
|
renderTags: (values, getTagProps) => values.map((value, index) => {
|
|
573
753
|
const chipProps = getTagProps({ index });
|
|
574
754
|
const isActive = value.value === active?.value;
|
|
@@ -623,34 +803,38 @@ function useOptions() {
|
|
|
623
803
|
fixed: isElements,
|
|
624
804
|
color: isElements ? "accent" : "global",
|
|
625
805
|
icon: isElements ? /* @__PURE__ */ React7.createElement(MapPinIcon, null) : null,
|
|
626
|
-
provider: provider.getKey()
|
|
627
|
-
// translators: %s is the plural label of the provider (e.g "Existing classes").
|
|
628
|
-
group: __3("Existing %s", "elementor").replace("%s", provider.labels?.plural ?? "")
|
|
806
|
+
provider: provider.getKey()
|
|
629
807
|
};
|
|
630
808
|
});
|
|
631
809
|
});
|
|
632
810
|
}
|
|
633
|
-
function
|
|
811
|
+
function useCreateAction({
|
|
634
812
|
pushAppliedId,
|
|
635
813
|
setActiveId
|
|
636
814
|
}) {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
815
|
+
const [provider, createAction] = useGetStylesRepositoryCreateAction() ?? [null, null];
|
|
816
|
+
if (!provider || !createAction) {
|
|
817
|
+
return {};
|
|
818
|
+
}
|
|
819
|
+
const create = (newClassLabel) => {
|
|
820
|
+
const createdId = createAction(newClassLabel);
|
|
821
|
+
pushAppliedId(createdId);
|
|
822
|
+
setActiveId(createdId);
|
|
823
|
+
};
|
|
824
|
+
const validate = (newClassLabel, event) => {
|
|
825
|
+
if (hasReachedLimit(provider)) {
|
|
826
|
+
return {
|
|
827
|
+
isValid: false,
|
|
828
|
+
errorMessage: __3(
|
|
829
|
+
"You\u2019ve reached the limit of 50 classes. Please remove an existing one to create a new class.",
|
|
830
|
+
"elementor"
|
|
831
|
+
)
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
return validateStyleLabel2(newClassLabel, event);
|
|
835
|
+
};
|
|
836
|
+
const entityName = provider.labels.singular && provider.labels.plural ? provider.labels : void 0;
|
|
837
|
+
return { create, validate, entityName };
|
|
654
838
|
}
|
|
655
839
|
function hasReachedLimit(provider) {
|
|
656
840
|
return provider.actions.all().length >= provider.limit;
|
|
@@ -712,7 +896,7 @@ function useHandleApply(appliedIds, setAppliedIds) {
|
|
|
712
896
|
import { __createPanel as createPanel } from "@elementor/editor-panels";
|
|
713
897
|
|
|
714
898
|
// src/components/editing-panel.tsx
|
|
715
|
-
import * as
|
|
899
|
+
import * as React70 from "react";
|
|
716
900
|
import { ControlActionsProvider, ControlReplacementsProvider } from "@elementor/editor-controls";
|
|
717
901
|
import { useSelectedElement } from "@elementor/editor-elements";
|
|
718
902
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
@@ -720,16 +904,16 @@ import { ThemeProvider as ThemeProvider9 } from "@elementor/editor-ui";
|
|
|
720
904
|
import { AtomIcon } from "@elementor/icons";
|
|
721
905
|
import { SessionStorageProvider as SessionStorageProvider3 } from "@elementor/session";
|
|
722
906
|
import { ErrorBoundary } from "@elementor/ui";
|
|
723
|
-
import { __ as
|
|
907
|
+
import { __ as __46 } from "@wordpress/i18n";
|
|
724
908
|
|
|
725
909
|
// src/controls-actions.ts
|
|
726
910
|
import { createMenu } from "@elementor/menus";
|
|
727
911
|
|
|
728
912
|
// src/popover-action.tsx
|
|
729
913
|
import * as React8 from "react";
|
|
730
|
-
import { useId } from "react";
|
|
914
|
+
import { useId as useId2 } from "react";
|
|
731
915
|
import { XIcon } from "@elementor/icons";
|
|
732
|
-
import { bindPopover, bindToggle, IconButton, Popover, Stack as Stack4, Tooltip, Typography as
|
|
916
|
+
import { bindPopover, bindToggle, IconButton, Popover, Stack as Stack4, Tooltip, Typography as Typography3, usePopupState as usePopupState2 } from "@elementor/ui";
|
|
733
917
|
var SIZE = "tiny";
|
|
734
918
|
function PopoverAction({
|
|
735
919
|
title,
|
|
@@ -737,7 +921,7 @@ function PopoverAction({
|
|
|
737
921
|
icon: Icon,
|
|
738
922
|
popoverContent: PopoverContent2
|
|
739
923
|
}) {
|
|
740
|
-
const id =
|
|
924
|
+
const id = useId2();
|
|
741
925
|
const popupState = usePopupState2({
|
|
742
926
|
variant: "popover",
|
|
743
927
|
popupId: `elementor-popover-action-${id}`
|
|
@@ -756,7 +940,7 @@ function PopoverAction({
|
|
|
756
940
|
},
|
|
757
941
|
...bindPopover(popupState)
|
|
758
942
|
},
|
|
759
|
-
/* @__PURE__ */ React8.createElement(Stack4, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React8.createElement(Icon, { fontSize: SIZE, sx: { mr: 0.5 } }), /* @__PURE__ */ React8.createElement(
|
|
943
|
+
/* @__PURE__ */ React8.createElement(Stack4, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React8.createElement(Icon, { fontSize: SIZE, sx: { mr: 0.5 } }), /* @__PURE__ */ React8.createElement(Typography3, { variant: "subtitle2" }, title), /* @__PURE__ */ React8.createElement(IconButton, { sx: { ml: "auto" }, size: SIZE, onClick: popupState.close }, /* @__PURE__ */ React8.createElement(XIcon, { fontSize: SIZE }))),
|
|
760
944
|
/* @__PURE__ */ React8.createElement(PopoverContent2, { closePopover: popupState.close })
|
|
761
945
|
));
|
|
762
946
|
}
|
|
@@ -770,24 +954,63 @@ var controlActionsMenu = createMenu({
|
|
|
770
954
|
|
|
771
955
|
// src/components/editing-panel-error-fallback.tsx
|
|
772
956
|
import * as React9 from "react";
|
|
773
|
-
import { Alert, Box } from "@elementor/ui";
|
|
957
|
+
import { Alert, Box as Box2 } from "@elementor/ui";
|
|
774
958
|
function EditorPanelErrorFallback() {
|
|
775
|
-
return /* @__PURE__ */ React9.createElement(
|
|
959
|
+
return /* @__PURE__ */ React9.createElement(Box2, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React9.createElement(Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React9.createElement("strong", null, "Something went wrong")));
|
|
776
960
|
}
|
|
777
961
|
|
|
778
962
|
// src/components/editing-panel-tabs.tsx
|
|
779
|
-
import * as
|
|
963
|
+
import * as React69 from "react";
|
|
780
964
|
import { Fragment as Fragment8 } from "react";
|
|
781
|
-
import { Divider as Divider5, Stack as
|
|
782
|
-
import { __ as
|
|
965
|
+
import { Divider as Divider5, Stack as Stack17, Tab, TabPanel, Tabs, useTabs } from "@elementor/ui";
|
|
966
|
+
import { __ as __45 } from "@wordpress/i18n";
|
|
967
|
+
|
|
968
|
+
// src/contexts/scroll-context.tsx
|
|
969
|
+
import * as React10 from "react";
|
|
970
|
+
import { createContext as createContext4, useContext as useContext4, useEffect, useRef, useState as useState4 } from "react";
|
|
971
|
+
import { styled as styled3 } from "@elementor/ui";
|
|
972
|
+
var ScrollContext = createContext4(void 0);
|
|
973
|
+
var ScrollPanel = styled3("div")`
|
|
974
|
+
height: 100%;
|
|
975
|
+
overflow-y: auto;
|
|
976
|
+
`;
|
|
977
|
+
var DEFAULT_SCROLL_DIRECTION = "up";
|
|
978
|
+
function ScrollProvider({ children }) {
|
|
979
|
+
const [direction, setDirection] = useState4(DEFAULT_SCROLL_DIRECTION);
|
|
980
|
+
const ref = useRef(null);
|
|
981
|
+
const scrollPos = useRef(0);
|
|
982
|
+
useEffect(() => {
|
|
983
|
+
const scrollElement = ref.current;
|
|
984
|
+
if (!scrollElement) {
|
|
985
|
+
return;
|
|
986
|
+
}
|
|
987
|
+
const handleScroll = () => {
|
|
988
|
+
const { scrollTop } = scrollElement;
|
|
989
|
+
if (scrollTop > scrollPos.current) {
|
|
990
|
+
setDirection("down");
|
|
991
|
+
} else if (scrollTop < scrollPos.current) {
|
|
992
|
+
setDirection("up");
|
|
993
|
+
}
|
|
994
|
+
scrollPos.current = scrollTop;
|
|
995
|
+
};
|
|
996
|
+
scrollElement.addEventListener("scroll", handleScroll);
|
|
997
|
+
return () => {
|
|
998
|
+
scrollElement.removeEventListener("scroll", handleScroll);
|
|
999
|
+
};
|
|
1000
|
+
});
|
|
1001
|
+
return /* @__PURE__ */ React10.createElement(ScrollContext.Provider, { value: { direction } }, /* @__PURE__ */ React10.createElement(ScrollPanel, { ref }, children));
|
|
1002
|
+
}
|
|
1003
|
+
function useScrollDirection() {
|
|
1004
|
+
return useContext4(ScrollContext)?.direction ?? DEFAULT_SCROLL_DIRECTION;
|
|
1005
|
+
}
|
|
783
1006
|
|
|
784
1007
|
// src/components/settings-tab.tsx
|
|
785
|
-
import * as
|
|
1008
|
+
import * as React16 from "react";
|
|
786
1009
|
import { ControlFormLabel } from "@elementor/editor-controls";
|
|
787
1010
|
import { SessionStorageProvider } from "@elementor/session";
|
|
788
1011
|
|
|
789
1012
|
// src/controls-registry/control.tsx
|
|
790
|
-
import * as
|
|
1013
|
+
import * as React11 from "react";
|
|
791
1014
|
|
|
792
1015
|
// src/controls-registry/controls-registry.tsx
|
|
793
1016
|
import {
|
|
@@ -822,20 +1045,20 @@ var Control = ({ props, type }) => {
|
|
|
822
1045
|
context: { controlType: type }
|
|
823
1046
|
});
|
|
824
1047
|
}
|
|
825
|
-
return /* @__PURE__ */
|
|
1048
|
+
return /* @__PURE__ */ React11.createElement(ControlByType, { ...props, context: { elementId: element.id } });
|
|
826
1049
|
};
|
|
827
1050
|
|
|
828
1051
|
// src/controls-registry/control-type-container.tsx
|
|
829
|
-
import * as
|
|
830
|
-
import { Box as
|
|
1052
|
+
import * as React12 from "react";
|
|
1053
|
+
import { Box as Box3, styled as styled4 } from "@elementor/ui";
|
|
831
1054
|
var ControlTypeContainer = ({
|
|
832
1055
|
controlType,
|
|
833
1056
|
children
|
|
834
1057
|
}) => {
|
|
835
1058
|
const layout = getLayoutByType(controlType);
|
|
836
|
-
return /* @__PURE__ */
|
|
1059
|
+
return /* @__PURE__ */ React12.createElement(StyledContainer, { layout }, children);
|
|
837
1060
|
};
|
|
838
|
-
var StyledContainer =
|
|
1061
|
+
var StyledContainer = styled4(Box3, {
|
|
839
1062
|
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
840
1063
|
})(({ layout, theme }) => ({
|
|
841
1064
|
display: "grid",
|
|
@@ -851,7 +1074,7 @@ var getGridLayout = (layout) => ({
|
|
|
851
1074
|
});
|
|
852
1075
|
|
|
853
1076
|
// src/controls-registry/settings-field.tsx
|
|
854
|
-
import * as
|
|
1077
|
+
import * as React13 from "react";
|
|
855
1078
|
import { PropKeyProvider, PropProvider } from "@elementor/editor-controls";
|
|
856
1079
|
import { updateElementSettings as updateElementSettings3, useElementSetting as useElementSetting3 } from "@elementor/editor-elements";
|
|
857
1080
|
|
|
@@ -880,18 +1103,18 @@ var SettingsField = ({ bind, children }) => {
|
|
|
880
1103
|
props: { ...newValue }
|
|
881
1104
|
});
|
|
882
1105
|
};
|
|
883
|
-
return /* @__PURE__ */
|
|
1106
|
+
return /* @__PURE__ */ React13.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React13.createElement(PropKeyProvider, { bind }, children));
|
|
884
1107
|
};
|
|
885
1108
|
|
|
886
1109
|
// src/components/section.tsx
|
|
887
|
-
import * as
|
|
888
|
-
import { useId as
|
|
1110
|
+
import * as React14 from "react";
|
|
1111
|
+
import { useId as useId3, useState as useState5 } from "react";
|
|
889
1112
|
import { Collapse, Divider as Divider2, ListItemButton, ListItemText, Stack as Stack5 } from "@elementor/ui";
|
|
890
1113
|
|
|
891
1114
|
// src/components/collapse-icon.tsx
|
|
892
1115
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
893
|
-
import { styled as
|
|
894
|
-
var CollapseIcon =
|
|
1116
|
+
import { styled as styled5 } from "@elementor/ui";
|
|
1117
|
+
var CollapseIcon = styled5(ChevronDownIcon, {
|
|
895
1118
|
shouldForwardProp: (prop) => prop !== "open"
|
|
896
1119
|
})(({ theme, open }) => ({
|
|
897
1120
|
transform: open ? "rotate(180deg)" : "rotate(0deg)",
|
|
@@ -902,11 +1125,11 @@ var CollapseIcon = styled3(ChevronDownIcon, {
|
|
|
902
1125
|
|
|
903
1126
|
// src/components/section.tsx
|
|
904
1127
|
function Section({ title, children, defaultExpanded = false }) {
|
|
905
|
-
const [isOpen, setIsOpen] =
|
|
906
|
-
const id =
|
|
1128
|
+
const [isOpen, setIsOpen] = useState5(!!defaultExpanded);
|
|
1129
|
+
const id = useId3();
|
|
907
1130
|
const labelId = `label-${id}`;
|
|
908
1131
|
const contentId = `content-${id}`;
|
|
909
|
-
return /* @__PURE__ */
|
|
1132
|
+
return /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(
|
|
910
1133
|
ListItemButton,
|
|
911
1134
|
{
|
|
912
1135
|
id: labelId,
|
|
@@ -914,35 +1137,35 @@ function Section({ title, children, defaultExpanded = false }) {
|
|
|
914
1137
|
onClick: () => setIsOpen((prev) => !prev),
|
|
915
1138
|
sx: { "&:hover": { backgroundColor: "transparent" } }
|
|
916
1139
|
},
|
|
917
|
-
/* @__PURE__ */
|
|
1140
|
+
/* @__PURE__ */ React14.createElement(
|
|
918
1141
|
ListItemText,
|
|
919
1142
|
{
|
|
920
1143
|
secondary: title,
|
|
921
1144
|
secondaryTypographyProps: { color: "text.primary", variant: "caption", fontWeight: "bold" }
|
|
922
1145
|
}
|
|
923
1146
|
),
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
-
), /* @__PURE__ */
|
|
1147
|
+
/* @__PURE__ */ React14.createElement(CollapseIcon, { open: isOpen, color: "secondary", fontSize: "tiny" })
|
|
1148
|
+
), /* @__PURE__ */ React14.createElement(Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React14.createElement(Stack5, { gap: 2.5, p: 2 }, children)), /* @__PURE__ */ React14.createElement(Divider2, null));
|
|
926
1149
|
}
|
|
927
1150
|
|
|
928
1151
|
// src/components/sections-list.tsx
|
|
929
|
-
import * as
|
|
1152
|
+
import * as React15 from "react";
|
|
930
1153
|
import { List } from "@elementor/ui";
|
|
931
1154
|
function SectionsList(props) {
|
|
932
|
-
return /* @__PURE__ */
|
|
1155
|
+
return /* @__PURE__ */ React15.createElement(List, { disablePadding: true, component: "div", ...props });
|
|
933
1156
|
}
|
|
934
1157
|
|
|
935
1158
|
// src/components/settings-tab.tsx
|
|
936
1159
|
var SettingsTab = () => {
|
|
937
1160
|
const { elementType, element } = useElement();
|
|
938
|
-
return /* @__PURE__ */
|
|
1161
|
+
return /* @__PURE__ */ React16.createElement(SessionStorageProvider, { prefix: element.id }, /* @__PURE__ */ React16.createElement(SectionsList, null, elementType.controls.map(({ type, value }, index) => {
|
|
939
1162
|
if (type === "control") {
|
|
940
|
-
return /* @__PURE__ */
|
|
1163
|
+
return /* @__PURE__ */ React16.createElement(Control2, { key: value.bind, control: value });
|
|
941
1164
|
}
|
|
942
1165
|
if (type === "section") {
|
|
943
|
-
return /* @__PURE__ */
|
|
1166
|
+
return /* @__PURE__ */ React16.createElement(Section, { title: value.label, key: type + "." + index, defaultExpanded: true }, value.items?.map((item) => {
|
|
944
1167
|
if (item.type === "control") {
|
|
945
|
-
return /* @__PURE__ */
|
|
1168
|
+
return /* @__PURE__ */ React16.createElement(Control2, { key: item.value.bind, control: item.value });
|
|
946
1169
|
}
|
|
947
1170
|
return null;
|
|
948
1171
|
}));
|
|
@@ -954,32 +1177,32 @@ var Control2 = ({ control }) => {
|
|
|
954
1177
|
if (!getControlByType(control.type)) {
|
|
955
1178
|
return null;
|
|
956
1179
|
}
|
|
957
|
-
return /* @__PURE__ */
|
|
1180
|
+
return /* @__PURE__ */ React16.createElement(SettingsField, { bind: control.bind }, /* @__PURE__ */ React16.createElement(ControlTypeContainer, { controlType: control.type }, control.label ? /* @__PURE__ */ React16.createElement(ControlFormLabel, null, control.label) : null, /* @__PURE__ */ React16.createElement(Control, { type: control.type, props: control.props })));
|
|
958
1181
|
};
|
|
959
1182
|
|
|
960
1183
|
// src/components/style-tab.tsx
|
|
961
|
-
import * as
|
|
962
|
-
import { useState as
|
|
1184
|
+
import * as React68 from "react";
|
|
1185
|
+
import { useState as useState12 } from "react";
|
|
963
1186
|
import { CLASSES_PROP_KEY } from "@elementor/editor-props";
|
|
964
1187
|
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
965
1188
|
import { SessionStorageProvider as SessionStorageProvider2 } from "@elementor/session";
|
|
966
|
-
import { Divider as Divider4 } from "@elementor/ui";
|
|
967
|
-
import { __ as
|
|
1189
|
+
import { Divider as Divider4, Stack as Stack16 } from "@elementor/ui";
|
|
1190
|
+
import { __ as __44 } from "@wordpress/i18n";
|
|
968
1191
|
|
|
969
1192
|
// src/contexts/styles-inheritance-context.tsx
|
|
970
|
-
import * as
|
|
971
|
-
import { createContext as
|
|
1193
|
+
import * as React17 from "react";
|
|
1194
|
+
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
972
1195
|
import { getWidgetsCache, useElementSetting as useElementSetting4 } from "@elementor/editor-elements";
|
|
973
1196
|
import { classesPropTypeUtil as classesPropTypeUtil2 } from "@elementor/editor-props";
|
|
974
1197
|
import { getBreakpointsTree } from "@elementor/editor-responsive";
|
|
975
1198
|
import { stylesRepository as stylesRepository5 } from "@elementor/editor-styles-repository";
|
|
976
1199
|
|
|
977
1200
|
// src/hooks/use-styles-rerender.ts
|
|
978
|
-
import { useEffect, useReducer } from "react";
|
|
1201
|
+
import { useEffect as useEffect2, useReducer } from "react";
|
|
979
1202
|
var useStylesRerender = () => {
|
|
980
1203
|
const { provider } = useStyle();
|
|
981
1204
|
const [, reRender] = useReducer((p) => !p, false);
|
|
982
|
-
|
|
1205
|
+
useEffect2(() => provider?.subscribe(reRender), [provider]);
|
|
983
1206
|
};
|
|
984
1207
|
|
|
985
1208
|
// src/styles-inheritance/create-snapshots-manager.ts
|
|
@@ -1140,15 +1363,15 @@ function buildStyleVariantsByMetaMapping(styleDefs) {
|
|
|
1140
1363
|
}
|
|
1141
1364
|
|
|
1142
1365
|
// src/contexts/styles-inheritance-context.tsx
|
|
1143
|
-
var Context4 =
|
|
1366
|
+
var Context4 = createContext5(null);
|
|
1144
1367
|
function StyleInheritanceProvider({ children }) {
|
|
1145
1368
|
const styleDefs = useAppliedStyles();
|
|
1146
1369
|
const breakpointsTree = getBreakpointsTree();
|
|
1147
1370
|
const getSnapshot = createStylesInheritance(styleDefs, breakpointsTree);
|
|
1148
|
-
return /* @__PURE__ */
|
|
1371
|
+
return /* @__PURE__ */ React17.createElement(Context4.Provider, { value: { getSnapshot } }, children);
|
|
1149
1372
|
}
|
|
1150
1373
|
function useStylesInheritanceFields(fields) {
|
|
1151
|
-
const context =
|
|
1374
|
+
const context = useContext5(Context4);
|
|
1152
1375
|
const { meta } = useStyle();
|
|
1153
1376
|
if (!context) {
|
|
1154
1377
|
throw new Error("useStylesInheritanceFields must be used within a StyleInheritanceProvider");
|
|
@@ -1182,10 +1405,10 @@ var useBaseStyles = () => {
|
|
|
1182
1405
|
};
|
|
1183
1406
|
|
|
1184
1407
|
// src/hooks/use-active-style-def-id.ts
|
|
1185
|
-
import { useState as
|
|
1408
|
+
import { useState as useState6 } from "react";
|
|
1186
1409
|
import { getElementStyles, useElementSetting as useElementSetting5 } from "@elementor/editor-elements";
|
|
1187
1410
|
function useActiveStyleDefId(classProp) {
|
|
1188
|
-
const [activeStyledDefId, setActiveStyledDefId] =
|
|
1411
|
+
const [activeStyledDefId, setActiveStyledDefId] = useState6(null);
|
|
1189
1412
|
const appliedClassesIds = useAppliedClassesIds2(classProp)?.value || [];
|
|
1190
1413
|
const fallback = useFirstAppliedClass(appliedClassesIds);
|
|
1191
1414
|
const activeAndAppliedClassId = useActiveAndAppliedClassId(activeStyledDefId, appliedClassesIds);
|
|
@@ -1206,16 +1429,16 @@ function useActiveAndAppliedClassId(id, appliedClassesIds) {
|
|
|
1206
1429
|
}
|
|
1207
1430
|
|
|
1208
1431
|
// src/components/style-sections/background-section/background-section.tsx
|
|
1209
|
-
import * as
|
|
1432
|
+
import * as React21 from "react";
|
|
1210
1433
|
import { BackgroundControl } from "@elementor/editor-controls";
|
|
1211
1434
|
|
|
1212
1435
|
// src/controls-registry/styles-field.tsx
|
|
1213
|
-
import * as
|
|
1436
|
+
import * as React20 from "react";
|
|
1214
1437
|
import { ControlAdornmentsProvider, PropKeyProvider as PropKeyProvider2, PropProvider as PropProvider2 } from "@elementor/editor-controls";
|
|
1215
|
-
import { getStylesSchema } from "@elementor/editor-styles";
|
|
1438
|
+
import { getStylesSchema as getStylesSchema2 } from "@elementor/editor-styles";
|
|
1216
1439
|
|
|
1217
1440
|
// src/hooks/use-styles-fields.ts
|
|
1218
|
-
import { useMemo } from "react";
|
|
1441
|
+
import { useMemo as useMemo2 } from "react";
|
|
1219
1442
|
import {
|
|
1220
1443
|
createElementStyle,
|
|
1221
1444
|
deleteElementStyle,
|
|
@@ -1273,7 +1496,7 @@ function getProps({ styleId, elementId, provider, meta, propNames }) {
|
|
|
1273
1496
|
);
|
|
1274
1497
|
}
|
|
1275
1498
|
function useUndoableCreateElementStyle() {
|
|
1276
|
-
return
|
|
1499
|
+
return useMemo2(() => {
|
|
1277
1500
|
return undoable(
|
|
1278
1501
|
{
|
|
1279
1502
|
do: (payload) => {
|
|
@@ -1301,7 +1524,7 @@ function useUndoableCreateElementStyle() {
|
|
|
1301
1524
|
}, []);
|
|
1302
1525
|
}
|
|
1303
1526
|
function useUndoableUpdateStyle() {
|
|
1304
|
-
return
|
|
1527
|
+
return useMemo2(() => {
|
|
1305
1528
|
return undoable(
|
|
1306
1529
|
{
|
|
1307
1530
|
do: ({ elementId, styleId, provider, meta, props }) => {
|
|
@@ -1355,11 +1578,87 @@ function useStylesField(propName) {
|
|
|
1355
1578
|
}
|
|
1356
1579
|
|
|
1357
1580
|
// src/styles-inheritance/styles-inheritance-indicator.tsx
|
|
1358
|
-
import * as
|
|
1581
|
+
import * as React19 from "react";
|
|
1582
|
+
import { useState as useState8 } from "react";
|
|
1359
1583
|
import { useBoundProp } from "@elementor/editor-controls";
|
|
1360
1584
|
import { ELEMENTS_BASE_STYLES_PROVIDER_KEY, isElementsStylesProvider as isElementsStylesProvider3 } from "@elementor/editor-styles-repository";
|
|
1585
|
+
import { IconButton as IconButton2, Infotip } from "@elementor/ui";
|
|
1361
1586
|
import { __ as __5 } from "@wordpress/i18n";
|
|
1587
|
+
|
|
1588
|
+
// src/sync/get-experiments-config.ts
|
|
1589
|
+
var getExperimentsConfig = () => {
|
|
1590
|
+
const extendedWindow = window;
|
|
1591
|
+
return extendedWindow.elementorCommon?.config?.experimentalFeatures ?? {};
|
|
1592
|
+
};
|
|
1593
|
+
|
|
1594
|
+
// src/styles-inheritance/styles-inheritance-infotip.tsx
|
|
1595
|
+
import * as React18 from "react";
|
|
1596
|
+
import { useMemo as useMemo3 } from "react";
|
|
1597
|
+
import { createPropsResolver, styleTransformersRegistry } from "@elementor/editor-canvas";
|
|
1598
|
+
import { getStylesSchema } from "@elementor/editor-styles";
|
|
1599
|
+
import { Card, CardContent, List as List2, ListItem, ListItemText as ListItemText2 } from "@elementor/ui";
|
|
1600
|
+
|
|
1601
|
+
// src/hooks/use-normalized-inheritance-chain-items.tsx
|
|
1602
|
+
import { useEffect as useEffect3, useState as useState7 } from "react";
|
|
1603
|
+
var MAXIMUM_ITEMS = 2;
|
|
1604
|
+
var useNormalizedInheritanceChainItems = (inheritanceChain, bind, resolve) => {
|
|
1605
|
+
const [items3, setItems] = useState7([]);
|
|
1606
|
+
useEffect3(() => {
|
|
1607
|
+
(async () => {
|
|
1608
|
+
const normalizedItems = await Promise.all(
|
|
1609
|
+
inheritanceChain.filter((item) => item.style?.label).map((item, index) => normalizeInheritanceItem(item, index, bind, resolve))
|
|
1610
|
+
);
|
|
1611
|
+
const validItems = normalizedItems.filter((item) => item.value !== "").slice(0, MAXIMUM_ITEMS);
|
|
1612
|
+
setItems(validItems);
|
|
1613
|
+
})();
|
|
1614
|
+
}, [inheritanceChain, bind, resolve]);
|
|
1615
|
+
return items3;
|
|
1616
|
+
};
|
|
1617
|
+
var normalizeInheritanceItem = async (item, index, bind, resolve) => {
|
|
1618
|
+
const state = item.variant?.meta?.state || "";
|
|
1619
|
+
const label = item.style?.label || "";
|
|
1620
|
+
const displayLabel = state ? `${label}:${state}` : label;
|
|
1621
|
+
return {
|
|
1622
|
+
id: item.style?.id ? item.style?.id + state : index,
|
|
1623
|
+
breakpoint: item.variant?.meta?.breakpoint,
|
|
1624
|
+
displayLabel,
|
|
1625
|
+
value: await getTransformedValue(item, bind, resolve)
|
|
1626
|
+
};
|
|
1627
|
+
};
|
|
1628
|
+
var getTransformedValue = async (item, bind, resolve) => {
|
|
1629
|
+
try {
|
|
1630
|
+
const result = await resolve({
|
|
1631
|
+
props: {
|
|
1632
|
+
[bind]: item.value
|
|
1633
|
+
}
|
|
1634
|
+
});
|
|
1635
|
+
return Object.values(result).join(" ");
|
|
1636
|
+
} catch {
|
|
1637
|
+
return "";
|
|
1638
|
+
}
|
|
1639
|
+
};
|
|
1640
|
+
|
|
1641
|
+
// src/styles-inheritance/styles-inheritance-infotip.tsx
|
|
1642
|
+
var StyleIndicatorInfotip = ({ inheritanceChain, bind }) => {
|
|
1643
|
+
const resolve = useMemo3(() => {
|
|
1644
|
+
const stylesSchema = getStylesSchema();
|
|
1645
|
+
return createPropsResolver({
|
|
1646
|
+
transformers: styleTransformersRegistry,
|
|
1647
|
+
schema: { [bind]: stylesSchema[bind] }
|
|
1648
|
+
});
|
|
1649
|
+
}, [bind]);
|
|
1650
|
+
const items3 = useNormalizedInheritanceChainItems(inheritanceChain, bind, resolve);
|
|
1651
|
+
return /* @__PURE__ */ React18.createElement(Card, { elevation: 0, sx: { maxWidth: 320 } }, /* @__PURE__ */ React18.createElement(CardContent, { sx: { p: 1.5, pb: 2.5 } }, /* @__PURE__ */ React18.createElement(List2, null, items3.map((item) => /* @__PURE__ */ React18.createElement(ListItem, { key: item.id }, /* @__PURE__ */ React18.createElement(
|
|
1652
|
+
ListItemText2,
|
|
1653
|
+
{
|
|
1654
|
+
primary: `${item.breakpoint} | ${item.displayLabel}. ${item.value}`
|
|
1655
|
+
}
|
|
1656
|
+
))))));
|
|
1657
|
+
};
|
|
1658
|
+
|
|
1659
|
+
// src/styles-inheritance/styles-inheritance-indicator.tsx
|
|
1362
1660
|
var StylesInheritanceIndicator = () => {
|
|
1661
|
+
const [open, setOpen] = useState8(false);
|
|
1363
1662
|
const { value, path } = useBoundProp();
|
|
1364
1663
|
const { id: currentStyleId, provider: currentStyleProvider, meta: currentStyleMeta } = useStyle();
|
|
1365
1664
|
const [bind] = path;
|
|
@@ -1372,38 +1671,61 @@ var StylesInheritanceIndicator = () => {
|
|
|
1372
1671
|
return null;
|
|
1373
1672
|
}
|
|
1374
1673
|
const { breakpoint, state } = variant.meta;
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1674
|
+
const isFinalValue = style.id === currentStyleId && breakpoint === currentStyleMeta.breakpoint && state === currentStyleMeta.state;
|
|
1675
|
+
const hasValue = value !== null && value !== void 0;
|
|
1676
|
+
const label = getLabel({ isFinalValue, hasValue });
|
|
1677
|
+
const variantType = getVariant({ isFinalValue, hasValue, currentStyleProvider });
|
|
1678
|
+
const { e_indications_popover: eIndicationsPopover } = getExperimentsConfig();
|
|
1679
|
+
if (!eIndicationsPopover) {
|
|
1680
|
+
return /* @__PURE__ */ React19.createElement(StyleIndicator, { variant: variantType, "aria-label": label });
|
|
1681
|
+
}
|
|
1682
|
+
const toggleOpen = () => setOpen((prev) => !prev);
|
|
1683
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1684
|
+
Infotip,
|
|
1685
|
+
{
|
|
1686
|
+
placement: "top",
|
|
1687
|
+
content: /* @__PURE__ */ React19.createElement(StyleIndicatorInfotip, { inheritanceChain, bind }),
|
|
1688
|
+
open,
|
|
1689
|
+
onClose: () => setOpen(false),
|
|
1690
|
+
trigger: "manual"
|
|
1691
|
+
},
|
|
1692
|
+
/* @__PURE__ */ React19.createElement(IconButton2, { onClick: toggleOpen, "aria-label": label }, /* @__PURE__ */ React19.createElement(StyleIndicator, { variant: variantType }))
|
|
1693
|
+
);
|
|
1694
|
+
};
|
|
1695
|
+
var getLabel = ({ isFinalValue, hasValue }) => {
|
|
1696
|
+
if (isFinalValue) {
|
|
1697
|
+
return __5("This is the final value", "elementor");
|
|
1383
1698
|
}
|
|
1384
|
-
if (
|
|
1385
|
-
return
|
|
1386
|
-
StyleIndicator,
|
|
1387
|
-
{
|
|
1388
|
-
"aria-label": __5("This value is overridden by another style", "elementor"),
|
|
1389
|
-
variant: "overridden"
|
|
1390
|
-
}
|
|
1391
|
-
);
|
|
1699
|
+
if (hasValue) {
|
|
1700
|
+
return __5("This value is overridden by another style", "elementor");
|
|
1392
1701
|
}
|
|
1393
|
-
return
|
|
1702
|
+
return __5("This has value from another style", "elementor");
|
|
1703
|
+
};
|
|
1704
|
+
var getVariant = ({
|
|
1705
|
+
isFinalValue,
|
|
1706
|
+
hasValue,
|
|
1707
|
+
currentStyleProvider
|
|
1708
|
+
}) => {
|
|
1709
|
+
if (isFinalValue) {
|
|
1710
|
+
return isElementsStylesProvider3(currentStyleProvider?.getKey?.()) ? "local" : "global";
|
|
1711
|
+
}
|
|
1712
|
+
if (hasValue) {
|
|
1713
|
+
return "overridden";
|
|
1714
|
+
}
|
|
1715
|
+
return void 0;
|
|
1394
1716
|
};
|
|
1395
1717
|
|
|
1396
1718
|
// src/controls-registry/styles-field.tsx
|
|
1397
1719
|
var StylesField = ({ bind, placeholder, children }) => {
|
|
1398
1720
|
const [value, setValue] = useStylesField(bind);
|
|
1399
|
-
const stylesSchema =
|
|
1721
|
+
const stylesSchema = getStylesSchema2();
|
|
1400
1722
|
const propType = createTopLevelOjectType({ schema: stylesSchema });
|
|
1401
1723
|
const values = { [bind]: value };
|
|
1402
1724
|
const placeholderValues = { [bind]: placeholder };
|
|
1403
1725
|
const setValues = (newValue) => {
|
|
1404
1726
|
setValue(newValue[bind]);
|
|
1405
1727
|
};
|
|
1406
|
-
return /* @__PURE__ */
|
|
1728
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1407
1729
|
ControlAdornmentsProvider,
|
|
1408
1730
|
{
|
|
1409
1731
|
items: [
|
|
@@ -1413,7 +1735,7 @@ var StylesField = ({ bind, placeholder, children }) => {
|
|
|
1413
1735
|
}
|
|
1414
1736
|
]
|
|
1415
1737
|
},
|
|
1416
|
-
/* @__PURE__ */
|
|
1738
|
+
/* @__PURE__ */ React20.createElement(
|
|
1417
1739
|
PropProvider2,
|
|
1418
1740
|
{
|
|
1419
1741
|
propType,
|
|
@@ -1421,50 +1743,50 @@ var StylesField = ({ bind, placeholder, children }) => {
|
|
|
1421
1743
|
setValue: setValues,
|
|
1422
1744
|
placeholder: placeholderValues
|
|
1423
1745
|
},
|
|
1424
|
-
/* @__PURE__ */
|
|
1746
|
+
/* @__PURE__ */ React20.createElement(PropKeyProvider2, { bind }, children)
|
|
1425
1747
|
)
|
|
1426
1748
|
);
|
|
1427
1749
|
};
|
|
1428
1750
|
|
|
1429
1751
|
// src/components/style-sections/background-section/background-section.tsx
|
|
1430
1752
|
var BackgroundSection = () => {
|
|
1431
|
-
return /* @__PURE__ */
|
|
1753
|
+
return /* @__PURE__ */ React21.createElement(StylesField, { bind: "background" }, /* @__PURE__ */ React21.createElement(BackgroundControl, null));
|
|
1432
1754
|
};
|
|
1433
1755
|
|
|
1434
1756
|
// src/components/style-sections/border-section/border-section.tsx
|
|
1435
|
-
import * as
|
|
1757
|
+
import * as React31 from "react";
|
|
1436
1758
|
|
|
1437
1759
|
// src/components/panel-divider.tsx
|
|
1438
|
-
import * as
|
|
1760
|
+
import * as React22 from "react";
|
|
1439
1761
|
import { Divider as Divider3 } from "@elementor/ui";
|
|
1440
|
-
var PanelDivider = () => /* @__PURE__ */
|
|
1762
|
+
var PanelDivider = () => /* @__PURE__ */ React22.createElement(Divider3, { sx: { my: 0.5 } });
|
|
1441
1763
|
|
|
1442
1764
|
// src/components/section-content.tsx
|
|
1443
|
-
import * as
|
|
1765
|
+
import * as React23 from "react";
|
|
1444
1766
|
import { Stack as Stack6 } from "@elementor/ui";
|
|
1445
|
-
var SectionContent = ({ gap = 2, sx, children }) => /* @__PURE__ */
|
|
1767
|
+
var SectionContent = ({ gap = 2, sx, children }) => /* @__PURE__ */ React23.createElement(Stack6, { gap, sx: { ...sx } }, children);
|
|
1446
1768
|
|
|
1447
1769
|
// src/components/style-sections/border-section/border-field.tsx
|
|
1448
|
-
import * as
|
|
1770
|
+
import * as React29 from "react";
|
|
1449
1771
|
import { __ as __9 } from "@wordpress/i18n";
|
|
1450
1772
|
|
|
1451
1773
|
// src/components/add-or-remove-content.tsx
|
|
1452
|
-
import * as
|
|
1774
|
+
import * as React25 from "react";
|
|
1453
1775
|
import { MinusIcon, PlusIcon } from "@elementor/icons";
|
|
1454
|
-
import { Collapse as Collapse2, IconButton as
|
|
1776
|
+
import { Collapse as Collapse2, IconButton as IconButton3, Stack as Stack8 } from "@elementor/ui";
|
|
1455
1777
|
|
|
1456
1778
|
// src/components/control-label.tsx
|
|
1457
|
-
import * as
|
|
1779
|
+
import * as React24 from "react";
|
|
1458
1780
|
import { ControlAdornments, ControlFormLabel as ControlFormLabel2 } from "@elementor/editor-controls";
|
|
1459
1781
|
import { Stack as Stack7 } from "@elementor/ui";
|
|
1460
1782
|
var ControlLabel = ({ children }) => {
|
|
1461
|
-
return /* @__PURE__ */
|
|
1783
|
+
return /* @__PURE__ */ React24.createElement(Stack7, { direction: "row", alignItems: "center", justifyItems: "start", gap: 1 }, /* @__PURE__ */ React24.createElement(ControlFormLabel2, null, children), /* @__PURE__ */ React24.createElement(ControlAdornments, null));
|
|
1462
1784
|
};
|
|
1463
1785
|
|
|
1464
1786
|
// src/components/add-or-remove-content.tsx
|
|
1465
1787
|
var SIZE2 = "tiny";
|
|
1466
1788
|
var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
1467
|
-
return /* @__PURE__ */
|
|
1789
|
+
return /* @__PURE__ */ React25.createElement(SectionContent, null, /* @__PURE__ */ React25.createElement(
|
|
1468
1790
|
Stack8,
|
|
1469
1791
|
{
|
|
1470
1792
|
direction: "row",
|
|
@@ -1474,22 +1796,22 @@ var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
|
1474
1796
|
marginInlineEnd: -0.75
|
|
1475
1797
|
}
|
|
1476
1798
|
},
|
|
1477
|
-
/* @__PURE__ */
|
|
1478
|
-
isAdded ? /* @__PURE__ */
|
|
1479
|
-
), /* @__PURE__ */
|
|
1799
|
+
/* @__PURE__ */ React25.createElement(ControlLabel, null, label),
|
|
1800
|
+
isAdded ? /* @__PURE__ */ React25.createElement(IconButton3, { size: SIZE2, onClick: onRemove, "aria-label": "Remove" }, /* @__PURE__ */ React25.createElement(MinusIcon, { fontSize: SIZE2 })) : /* @__PURE__ */ React25.createElement(IconButton3, { size: SIZE2, onClick: onAdd, "aria-label": "Add" }, /* @__PURE__ */ React25.createElement(PlusIcon, { fontSize: SIZE2 }))
|
|
1801
|
+
), /* @__PURE__ */ React25.createElement(Collapse2, { in: isAdded, unmountOnExit: true }, /* @__PURE__ */ React25.createElement(SectionContent, null, children)));
|
|
1480
1802
|
};
|
|
1481
1803
|
|
|
1482
1804
|
// src/components/style-sections/border-section/border-color-field.tsx
|
|
1483
|
-
import * as
|
|
1805
|
+
import * as React26 from "react";
|
|
1484
1806
|
import { ColorControl } from "@elementor/editor-controls";
|
|
1485
1807
|
import { Grid } from "@elementor/ui";
|
|
1486
1808
|
import { __ as __6 } from "@wordpress/i18n";
|
|
1487
1809
|
var BorderColorField = () => {
|
|
1488
|
-
return /* @__PURE__ */
|
|
1810
|
+
return /* @__PURE__ */ React26.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React26.createElement(Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React26.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, __6("Border color", "elementor"))), /* @__PURE__ */ React26.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(ColorControl, null))));
|
|
1489
1811
|
};
|
|
1490
1812
|
|
|
1491
1813
|
// src/components/style-sections/border-section/border-style-field.tsx
|
|
1492
|
-
import * as
|
|
1814
|
+
import * as React27 from "react";
|
|
1493
1815
|
import { SelectControl as SelectControl2 } from "@elementor/editor-controls";
|
|
1494
1816
|
import { Grid as Grid2 } from "@elementor/ui";
|
|
1495
1817
|
import { __ as __7 } from "@wordpress/i18n";
|
|
@@ -1505,11 +1827,11 @@ var borderStyles = [
|
|
|
1505
1827
|
{ value: "outset", label: __7("Outset", "elementor") }
|
|
1506
1828
|
];
|
|
1507
1829
|
var BorderStyleField = () => {
|
|
1508
|
-
return /* @__PURE__ */
|
|
1830
|
+
return /* @__PURE__ */ React27.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React27.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, __7("Border type", "elementor"))), /* @__PURE__ */ React27.createElement(Grid2, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React27.createElement(SelectControl2, { options: borderStyles }))));
|
|
1509
1831
|
};
|
|
1510
1832
|
|
|
1511
1833
|
// src/components/style-sections/border-section/border-width-field.tsx
|
|
1512
|
-
import * as
|
|
1834
|
+
import * as React28 from "react";
|
|
1513
1835
|
import { EqualUnequalSizesControl } from "@elementor/editor-controls";
|
|
1514
1836
|
import { borderWidthPropTypeUtil } from "@elementor/editor-props";
|
|
1515
1837
|
import { SideAllIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
@@ -1530,33 +1852,33 @@ var InlineEndIcon = withDirection(SideLeftIcon);
|
|
|
1530
1852
|
var getEdges = (isSiteRtl) => [
|
|
1531
1853
|
{
|
|
1532
1854
|
label: __8("Top", "elementor"),
|
|
1533
|
-
icon: /* @__PURE__ */
|
|
1855
|
+
icon: /* @__PURE__ */ React28.createElement(SideTopIcon, { fontSize: "tiny" }),
|
|
1534
1856
|
bind: "block-start"
|
|
1535
1857
|
},
|
|
1536
1858
|
{
|
|
1537
1859
|
label: isSiteRtl ? __8("Left", "elementor") : __8("Right", "elementor"),
|
|
1538
|
-
icon: /* @__PURE__ */
|
|
1860
|
+
icon: /* @__PURE__ */ React28.createElement(InlineStartIcon, { fontSize: "tiny" }),
|
|
1539
1861
|
bind: "inline-end"
|
|
1540
1862
|
},
|
|
1541
1863
|
{
|
|
1542
1864
|
label: __8("Bottom", "elementor"),
|
|
1543
|
-
icon: /* @__PURE__ */
|
|
1865
|
+
icon: /* @__PURE__ */ React28.createElement(SideBottomIcon, { fontSize: "tiny" }),
|
|
1544
1866
|
bind: "block-end"
|
|
1545
1867
|
},
|
|
1546
1868
|
{
|
|
1547
1869
|
label: isSiteRtl ? __8("Right", "elementor") : __8("Left", "elementor"),
|
|
1548
|
-
icon: /* @__PURE__ */
|
|
1870
|
+
icon: /* @__PURE__ */ React28.createElement(InlineEndIcon, { fontSize: "tiny" }),
|
|
1549
1871
|
bind: "inline-start"
|
|
1550
1872
|
}
|
|
1551
1873
|
];
|
|
1552
1874
|
var BorderWidthField = () => {
|
|
1553
1875
|
const { isSiteRtl } = useDirection();
|
|
1554
|
-
return /* @__PURE__ */
|
|
1876
|
+
return /* @__PURE__ */ React28.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React28.createElement(
|
|
1555
1877
|
EqualUnequalSizesControl,
|
|
1556
1878
|
{
|
|
1557
1879
|
items: getEdges(isSiteRtl),
|
|
1558
1880
|
label: __8("Border width", "elementor"),
|
|
1559
|
-
icon: /* @__PURE__ */
|
|
1881
|
+
icon: /* @__PURE__ */ React28.createElement(SideAllIcon, { fontSize: "tiny" }),
|
|
1560
1882
|
tooltipLabel: __8("Adjust borders", "elementor"),
|
|
1561
1883
|
multiSizePropTypeUtil: borderWidthPropTypeUtil
|
|
1562
1884
|
}
|
|
@@ -1582,7 +1904,7 @@ var BorderField = () => {
|
|
|
1582
1904
|
});
|
|
1583
1905
|
};
|
|
1584
1906
|
const hasBorder = Object.values(border ?? {}).some(Boolean);
|
|
1585
|
-
return /* @__PURE__ */
|
|
1907
|
+
return /* @__PURE__ */ React29.createElement(
|
|
1586
1908
|
AddOrRemoveContent,
|
|
1587
1909
|
{
|
|
1588
1910
|
label: __9("Border", "elementor"),
|
|
@@ -1590,14 +1912,14 @@ var BorderField = () => {
|
|
|
1590
1912
|
onAdd: addBorder,
|
|
1591
1913
|
onRemove: removeBorder
|
|
1592
1914
|
},
|
|
1593
|
-
/* @__PURE__ */
|
|
1594
|
-
/* @__PURE__ */
|
|
1595
|
-
/* @__PURE__ */
|
|
1915
|
+
/* @__PURE__ */ React29.createElement(BorderWidthField, null),
|
|
1916
|
+
/* @__PURE__ */ React29.createElement(BorderColorField, null),
|
|
1917
|
+
/* @__PURE__ */ React29.createElement(BorderStyleField, null)
|
|
1596
1918
|
);
|
|
1597
1919
|
};
|
|
1598
1920
|
|
|
1599
1921
|
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
1600
|
-
import * as
|
|
1922
|
+
import * as React30 from "react";
|
|
1601
1923
|
import { EqualUnequalSizesControl as EqualUnequalSizesControl2 } from "@elementor/editor-controls";
|
|
1602
1924
|
import { borderRadiusPropTypeUtil } from "@elementor/editor-props";
|
|
1603
1925
|
import {
|
|
@@ -1620,33 +1942,33 @@ var getEndEndLabel = (isSiteRtl) => isSiteRtl ? __10("Bottom left", "elementor")
|
|
|
1620
1942
|
var getCorners = (isSiteRtl) => [
|
|
1621
1943
|
{
|
|
1622
1944
|
label: getStartStartLabel(isSiteRtl),
|
|
1623
|
-
icon: /* @__PURE__ */
|
|
1945
|
+
icon: /* @__PURE__ */ React30.createElement(StartStartIcon, { fontSize: "tiny" }),
|
|
1624
1946
|
bind: "start-start"
|
|
1625
1947
|
},
|
|
1626
1948
|
{
|
|
1627
1949
|
label: getStartEndLabel(isSiteRtl),
|
|
1628
|
-
icon: /* @__PURE__ */
|
|
1950
|
+
icon: /* @__PURE__ */ React30.createElement(StartEndIcon, { fontSize: "tiny" }),
|
|
1629
1951
|
bind: "start-end"
|
|
1630
1952
|
},
|
|
1631
1953
|
{
|
|
1632
1954
|
label: getEndStartLabel(isSiteRtl),
|
|
1633
|
-
icon: /* @__PURE__ */
|
|
1955
|
+
icon: /* @__PURE__ */ React30.createElement(EndStartIcon, { fontSize: "tiny" }),
|
|
1634
1956
|
bind: "end-start"
|
|
1635
1957
|
},
|
|
1636
1958
|
{
|
|
1637
1959
|
label: getEndEndLabel(isSiteRtl),
|
|
1638
|
-
icon: /* @__PURE__ */
|
|
1960
|
+
icon: /* @__PURE__ */ React30.createElement(EndEndIcon, { fontSize: "tiny" }),
|
|
1639
1961
|
bind: "end-end"
|
|
1640
1962
|
}
|
|
1641
1963
|
];
|
|
1642
1964
|
var BorderRadiusField = () => {
|
|
1643
1965
|
const { isSiteRtl } = useDirection();
|
|
1644
|
-
return /* @__PURE__ */
|
|
1966
|
+
return /* @__PURE__ */ React30.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React30.createElement(
|
|
1645
1967
|
EqualUnequalSizesControl2,
|
|
1646
1968
|
{
|
|
1647
1969
|
items: getCorners(isSiteRtl),
|
|
1648
1970
|
label: __10("Border radius", "elementor"),
|
|
1649
|
-
icon: /* @__PURE__ */
|
|
1971
|
+
icon: /* @__PURE__ */ React30.createElement(BorderCornersIcon, { fontSize: "tiny" }),
|
|
1650
1972
|
tooltipLabel: __10("Adjust corners", "elementor"),
|
|
1651
1973
|
multiSizePropTypeUtil: borderRadiusPropTypeUtil
|
|
1652
1974
|
}
|
|
@@ -1654,17 +1976,17 @@ var BorderRadiusField = () => {
|
|
|
1654
1976
|
};
|
|
1655
1977
|
|
|
1656
1978
|
// src/components/style-sections/border-section/border-section.tsx
|
|
1657
|
-
var BorderSection = () => /* @__PURE__ */
|
|
1979
|
+
var BorderSection = () => /* @__PURE__ */ React31.createElement(SectionContent, null, /* @__PURE__ */ React31.createElement(BorderRadiusField, null), /* @__PURE__ */ React31.createElement(PanelDivider, null), /* @__PURE__ */ React31.createElement(BorderField, null));
|
|
1658
1980
|
|
|
1659
1981
|
// src/components/style-sections/effects-section/effects-section.tsx
|
|
1660
|
-
import * as
|
|
1982
|
+
import * as React32 from "react";
|
|
1661
1983
|
import { BoxShadowRepeaterControl } from "@elementor/editor-controls";
|
|
1662
1984
|
var EffectsSection = () => {
|
|
1663
|
-
return /* @__PURE__ */
|
|
1985
|
+
return /* @__PURE__ */ React32.createElement(SectionContent, null, /* @__PURE__ */ React32.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React32.createElement(BoxShadowRepeaterControl, null)));
|
|
1664
1986
|
};
|
|
1665
1987
|
|
|
1666
1988
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
1667
|
-
import * as
|
|
1989
|
+
import * as React44 from "react";
|
|
1668
1990
|
import { ControlFormLabel as ControlFormLabel3 } from "@elementor/editor-controls";
|
|
1669
1991
|
import { useParentElement } from "@elementor/editor-elements";
|
|
1670
1992
|
import { __ as __21 } from "@wordpress/i18n";
|
|
@@ -1695,7 +2017,7 @@ function useComputedStyle(elementId) {
|
|
|
1695
2017
|
}
|
|
1696
2018
|
|
|
1697
2019
|
// src/components/style-sections/layout-section/align-content-field.tsx
|
|
1698
|
-
import * as
|
|
2020
|
+
import * as React34 from "react";
|
|
1699
2021
|
import { ToggleControl } from "@elementor/editor-controls";
|
|
1700
2022
|
import {
|
|
1701
2023
|
JustifyBottomIcon,
|
|
@@ -1709,8 +2031,8 @@ import { DirectionProvider, Stack as Stack9, ThemeProvider, withDirection as wit
|
|
|
1709
2031
|
import { __ as __11 } from "@wordpress/i18n";
|
|
1710
2032
|
|
|
1711
2033
|
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
1712
|
-
import * as
|
|
1713
|
-
import { useRef } from "react";
|
|
2034
|
+
import * as React33 from "react";
|
|
2035
|
+
import { useRef as useRef2 } from "react";
|
|
1714
2036
|
import { useTheme as useTheme2 } from "@elementor/ui";
|
|
1715
2037
|
var CLOCKWISE_ANGLES = {
|
|
1716
2038
|
row: 0,
|
|
@@ -1731,9 +2053,9 @@ var RotatedIcon = ({
|
|
|
1731
2053
|
offset = 0,
|
|
1732
2054
|
disableRotationForReversed = false
|
|
1733
2055
|
}) => {
|
|
1734
|
-
const rotate =
|
|
2056
|
+
const rotate = useRef2(useGetTargetAngle(isClockwise, offset, disableRotationForReversed));
|
|
1735
2057
|
rotate.current = useGetTargetAngle(isClockwise, offset, disableRotationForReversed, rotate);
|
|
1736
|
-
return /* @__PURE__ */
|
|
2058
|
+
return /* @__PURE__ */ React33.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
1737
2059
|
};
|
|
1738
2060
|
var useGetTargetAngle = (isClockwise, offset, disableRotationForReversed, existingRef) => {
|
|
1739
2061
|
const [direction] = useStylesField("flex-direction");
|
|
@@ -1763,47 +2085,47 @@ var options = [
|
|
|
1763
2085
|
{
|
|
1764
2086
|
value: "start",
|
|
1765
2087
|
label: __11("Start", "elementor"),
|
|
1766
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2088
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: StartIcon, size, ...iconProps }),
|
|
1767
2089
|
showTooltip: true
|
|
1768
2090
|
},
|
|
1769
2091
|
{
|
|
1770
2092
|
value: "center",
|
|
1771
2093
|
label: __11("Center", "elementor"),
|
|
1772
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2094
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: CenterIcon, size, ...iconProps }),
|
|
1773
2095
|
showTooltip: true
|
|
1774
2096
|
},
|
|
1775
2097
|
{
|
|
1776
2098
|
value: "end",
|
|
1777
2099
|
label: __11("End", "elementor"),
|
|
1778
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2100
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: EndIcon, size, ...iconProps }),
|
|
1779
2101
|
showTooltip: true
|
|
1780
2102
|
},
|
|
1781
2103
|
{
|
|
1782
2104
|
value: "space-between",
|
|
1783
2105
|
label: __11("Space between", "elementor"),
|
|
1784
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2106
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: BetweenIcon, size, ...iconProps }),
|
|
1785
2107
|
showTooltip: true
|
|
1786
2108
|
},
|
|
1787
2109
|
{
|
|
1788
2110
|
value: "space-around",
|
|
1789
2111
|
label: __11("Space around", "elementor"),
|
|
1790
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2112
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: AroundIcon, size, ...iconProps }),
|
|
1791
2113
|
showTooltip: true
|
|
1792
2114
|
},
|
|
1793
2115
|
{
|
|
1794
2116
|
value: "space-evenly",
|
|
1795
2117
|
label: __11("Space evenly", "elementor"),
|
|
1796
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2118
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: EvenlyIcon, size, ...iconProps }),
|
|
1797
2119
|
showTooltip: true
|
|
1798
2120
|
}
|
|
1799
2121
|
];
|
|
1800
2122
|
var AlignContentField = () => {
|
|
1801
2123
|
const { isSiteRtl } = useDirection();
|
|
1802
|
-
return /* @__PURE__ */
|
|
2124
|
+
return /* @__PURE__ */ React34.createElement(DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React34.createElement(ThemeProvider, null, /* @__PURE__ */ React34.createElement(StylesField, { bind: "align-content" }, /* @__PURE__ */ React34.createElement(Stack9, { gap: 1 }, /* @__PURE__ */ React34.createElement(ControlLabel, null, __11("Align content", "elementor")), /* @__PURE__ */ React34.createElement(ToggleControl, { options, fullWidth: true })))));
|
|
1803
2125
|
};
|
|
1804
2126
|
|
|
1805
2127
|
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
1806
|
-
import * as
|
|
2128
|
+
import * as React35 from "react";
|
|
1807
2129
|
import { ToggleControl as ToggleControl2 } from "@elementor/editor-controls";
|
|
1808
2130
|
import {
|
|
1809
2131
|
LayoutAlignCenterIcon as CenterIcon2,
|
|
@@ -1823,35 +2145,35 @@ var options2 = [
|
|
|
1823
2145
|
{
|
|
1824
2146
|
value: "start",
|
|
1825
2147
|
label: __12("Start", "elementor"),
|
|
1826
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2148
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(RotatedIcon, { icon: StartIcon2, size, ...iconProps2 }),
|
|
1827
2149
|
showTooltip: true
|
|
1828
2150
|
},
|
|
1829
2151
|
{
|
|
1830
2152
|
value: "center",
|
|
1831
2153
|
label: __12("Center", "elementor"),
|
|
1832
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2154
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(RotatedIcon, { icon: CenterIcon2, size, ...iconProps2 }),
|
|
1833
2155
|
showTooltip: true
|
|
1834
2156
|
},
|
|
1835
2157
|
{
|
|
1836
2158
|
value: "end",
|
|
1837
2159
|
label: __12("End", "elementor"),
|
|
1838
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2160
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(RotatedIcon, { icon: EndIcon2, size, ...iconProps2 }),
|
|
1839
2161
|
showTooltip: true
|
|
1840
2162
|
},
|
|
1841
2163
|
{
|
|
1842
2164
|
value: "stretch",
|
|
1843
2165
|
label: __12("Stretch", "elementor"),
|
|
1844
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2166
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(RotatedIcon, { icon: JustifyIcon, size, ...iconProps2 }),
|
|
1845
2167
|
showTooltip: true
|
|
1846
2168
|
}
|
|
1847
2169
|
];
|
|
1848
2170
|
var AlignItemsField = () => {
|
|
1849
2171
|
const { isSiteRtl } = useDirection();
|
|
1850
|
-
return /* @__PURE__ */
|
|
2172
|
+
return /* @__PURE__ */ React35.createElement(DirectionProvider2, { rtl: isSiteRtl }, /* @__PURE__ */ React35.createElement(ThemeProvider2, null, /* @__PURE__ */ React35.createElement(StylesField, { bind: "align-items" }, /* @__PURE__ */ React35.createElement(Grid3, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel, null, __12("Align items", "elementor"))), /* @__PURE__ */ React35.createElement(Grid3, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React35.createElement(ToggleControl2, { options: options2 }))))));
|
|
1851
2173
|
};
|
|
1852
2174
|
|
|
1853
2175
|
// src/components/style-sections/layout-section/align-self-child-field.tsx
|
|
1854
|
-
import * as
|
|
2176
|
+
import * as React36 from "react";
|
|
1855
2177
|
import { ToggleControl as ToggleControl3 } from "@elementor/editor-controls";
|
|
1856
2178
|
import {
|
|
1857
2179
|
LayoutAlignCenterIcon as CenterIcon3,
|
|
@@ -1876,7 +2198,7 @@ var getOptions = (parentStyleDirection) => [
|
|
|
1876
2198
|
{
|
|
1877
2199
|
value: "start",
|
|
1878
2200
|
label: __13("Start", "elementor"),
|
|
1879
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2201
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(
|
|
1880
2202
|
RotatedIcon,
|
|
1881
2203
|
{
|
|
1882
2204
|
icon: StartIcon3,
|
|
@@ -1890,7 +2212,7 @@ var getOptions = (parentStyleDirection) => [
|
|
|
1890
2212
|
{
|
|
1891
2213
|
value: "center",
|
|
1892
2214
|
label: __13("Center", "elementor"),
|
|
1893
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2215
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(
|
|
1894
2216
|
RotatedIcon,
|
|
1895
2217
|
{
|
|
1896
2218
|
icon: CenterIcon3,
|
|
@@ -1904,7 +2226,7 @@ var getOptions = (parentStyleDirection) => [
|
|
|
1904
2226
|
{
|
|
1905
2227
|
value: "end",
|
|
1906
2228
|
label: __13("End", "elementor"),
|
|
1907
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2229
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(
|
|
1908
2230
|
RotatedIcon,
|
|
1909
2231
|
{
|
|
1910
2232
|
icon: EndIcon3,
|
|
@@ -1918,7 +2240,7 @@ var getOptions = (parentStyleDirection) => [
|
|
|
1918
2240
|
{
|
|
1919
2241
|
value: "stretch",
|
|
1920
2242
|
label: __13("Stretch", "elementor"),
|
|
1921
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2243
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(
|
|
1922
2244
|
RotatedIcon,
|
|
1923
2245
|
{
|
|
1924
2246
|
icon: JustifyIcon2,
|
|
@@ -1932,11 +2254,11 @@ var getOptions = (parentStyleDirection) => [
|
|
|
1932
2254
|
];
|
|
1933
2255
|
var AlignSelfChild = ({ parentStyleDirection }) => {
|
|
1934
2256
|
const { isSiteRtl } = useDirection();
|
|
1935
|
-
return /* @__PURE__ */
|
|
2257
|
+
return /* @__PURE__ */ React36.createElement(DirectionProvider3, { rtl: isSiteRtl }, /* @__PURE__ */ React36.createElement(ThemeProvider3, null, /* @__PURE__ */ React36.createElement(StylesField, { bind: "align-self" }, /* @__PURE__ */ React36.createElement(Grid4, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel, null, __13("Align self", "elementor"))), /* @__PURE__ */ React36.createElement(Grid4, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React36.createElement(ToggleControl3, { options: getOptions(parentStyleDirection) }))))));
|
|
1936
2258
|
};
|
|
1937
2259
|
|
|
1938
2260
|
// src/components/style-sections/layout-section/display-field.tsx
|
|
1939
|
-
import * as
|
|
2261
|
+
import * as React37 from "react";
|
|
1940
2262
|
import { ToggleControl as ToggleControl4 } from "@elementor/editor-controls";
|
|
1941
2263
|
import { Stack as Stack10 } from "@elementor/ui";
|
|
1942
2264
|
import { __ as __14 } from "@wordpress/i18n";
|
|
@@ -1968,12 +2290,12 @@ var displayFieldOptions = [
|
|
|
1968
2290
|
];
|
|
1969
2291
|
var DisplayField = () => {
|
|
1970
2292
|
const placeholder = useDisplayPlaceholderValue();
|
|
1971
|
-
return /* @__PURE__ */
|
|
2293
|
+
return /* @__PURE__ */ React37.createElement(StylesField, { bind: "display", placeholder }, /* @__PURE__ */ React37.createElement(Stack10, { gap: 0.75 }, /* @__PURE__ */ React37.createElement(ControlLabel, null, __14("Display", "elementor")), /* @__PURE__ */ React37.createElement(ToggleControl4, { options: displayFieldOptions, fullWidth: true })));
|
|
1972
2294
|
};
|
|
1973
2295
|
var useDisplayPlaceholderValue = () => useStylesInheritanceField("display")[0]?.value ?? void 0;
|
|
1974
2296
|
|
|
1975
2297
|
// src/components/style-sections/layout-section/flex-direction-field.tsx
|
|
1976
|
-
import * as
|
|
2298
|
+
import * as React38 from "react";
|
|
1977
2299
|
import { ToggleControl as ToggleControl5 } from "@elementor/editor-controls";
|
|
1978
2300
|
import { ArrowDownSmallIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpSmallIcon } from "@elementor/icons";
|
|
1979
2301
|
import { DirectionProvider as DirectionProvider4, Grid as Grid5, ThemeProvider as ThemeProvider4, withDirection as withDirection6 } from "@elementor/ui";
|
|
@@ -1984,14 +2306,14 @@ var options3 = [
|
|
|
1984
2306
|
label: __15("Row", "elementor"),
|
|
1985
2307
|
renderContent: ({ size }) => {
|
|
1986
2308
|
const StartIcon5 = withDirection6(ArrowRightIcon);
|
|
1987
|
-
return /* @__PURE__ */
|
|
2309
|
+
return /* @__PURE__ */ React38.createElement(StartIcon5, { fontSize: size });
|
|
1988
2310
|
},
|
|
1989
2311
|
showTooltip: true
|
|
1990
2312
|
},
|
|
1991
2313
|
{
|
|
1992
2314
|
value: "column",
|
|
1993
2315
|
label: __15("Column", "elementor"),
|
|
1994
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2316
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(ArrowDownSmallIcon, { fontSize: size }),
|
|
1995
2317
|
showTooltip: true
|
|
1996
2318
|
},
|
|
1997
2319
|
{
|
|
@@ -1999,25 +2321,25 @@ var options3 = [
|
|
|
1999
2321
|
label: __15("Reversed row", "elementor"),
|
|
2000
2322
|
renderContent: ({ size }) => {
|
|
2001
2323
|
const EndIcon5 = withDirection6(ArrowLeftIcon);
|
|
2002
|
-
return /* @__PURE__ */
|
|
2324
|
+
return /* @__PURE__ */ React38.createElement(EndIcon5, { fontSize: size });
|
|
2003
2325
|
},
|
|
2004
2326
|
showTooltip: true
|
|
2005
2327
|
},
|
|
2006
2328
|
{
|
|
2007
2329
|
value: "column-reverse",
|
|
2008
2330
|
label: __15("Reversed column", "elementor"),
|
|
2009
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2331
|
+
renderContent: ({ size }) => /* @__PURE__ */ React38.createElement(ArrowUpSmallIcon, { fontSize: size }),
|
|
2010
2332
|
showTooltip: true
|
|
2011
2333
|
}
|
|
2012
2334
|
];
|
|
2013
2335
|
var FlexDirectionField = () => {
|
|
2014
2336
|
const { isSiteRtl } = useDirection();
|
|
2015
|
-
return /* @__PURE__ */
|
|
2337
|
+
return /* @__PURE__ */ React38.createElement(DirectionProvider4, { rtl: isSiteRtl }, /* @__PURE__ */ React38.createElement(ThemeProvider4, null, /* @__PURE__ */ React38.createElement(StylesField, { bind: "flex-direction" }, /* @__PURE__ */ React38.createElement(Grid5, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React38.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(ControlLabel, null, __15("Direction", "elementor"))), /* @__PURE__ */ React38.createElement(Grid5, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React38.createElement(ToggleControl5, { options: options3 }))))));
|
|
2016
2338
|
};
|
|
2017
2339
|
|
|
2018
2340
|
// src/components/style-sections/layout-section/flex-order-field.tsx
|
|
2019
|
-
import * as
|
|
2020
|
-
import { useState as
|
|
2341
|
+
import * as React39 from "react";
|
|
2342
|
+
import { useState as useState9 } from "react";
|
|
2021
2343
|
import { ControlToggleButtonGroup, NumberControl } from "@elementor/editor-controls";
|
|
2022
2344
|
import { ArrowDownSmallIcon as ArrowDownSmallIcon2, ArrowUpSmallIcon as ArrowUpSmallIcon2, PencilIcon } from "@elementor/icons";
|
|
2023
2345
|
import { DirectionProvider as DirectionProvider5, Grid as Grid6, ThemeProvider as ThemeProvider5 } from "@elementor/ui";
|
|
@@ -2035,25 +2357,25 @@ var items = [
|
|
|
2035
2357
|
{
|
|
2036
2358
|
value: FIRST,
|
|
2037
2359
|
label: __16("First", "elementor"),
|
|
2038
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2360
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(ArrowUpSmallIcon2, { fontSize: size }),
|
|
2039
2361
|
showTooltip: true
|
|
2040
2362
|
},
|
|
2041
2363
|
{
|
|
2042
2364
|
value: LAST,
|
|
2043
2365
|
label: __16("Last", "elementor"),
|
|
2044
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2366
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(ArrowDownSmallIcon2, { fontSize: size }),
|
|
2045
2367
|
showTooltip: true
|
|
2046
2368
|
},
|
|
2047
2369
|
{
|
|
2048
2370
|
value: CUSTOM,
|
|
2049
2371
|
label: __16("Custom", "elementor"),
|
|
2050
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2372
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(PencilIcon, { fontSize: size }),
|
|
2051
2373
|
showTooltip: true
|
|
2052
2374
|
}
|
|
2053
2375
|
];
|
|
2054
2376
|
var FlexOrderField = () => {
|
|
2055
2377
|
const { isSiteRtl } = useDirection(), [order, setOrder] = useStylesField("order");
|
|
2056
|
-
const [groupControlValue, setGroupControlValue] =
|
|
2378
|
+
const [groupControlValue, setGroupControlValue] = useState9(getGroupControlValue(order?.value || null));
|
|
2057
2379
|
const handleToggleButtonChange = (group) => {
|
|
2058
2380
|
setGroupControlValue(group);
|
|
2059
2381
|
if (!group || group === CUSTOM) {
|
|
@@ -2062,7 +2384,7 @@ var FlexOrderField = () => {
|
|
|
2062
2384
|
}
|
|
2063
2385
|
setOrder({ $$type: "number", value: orderValueMap[group] });
|
|
2064
2386
|
};
|
|
2065
|
-
return /* @__PURE__ */
|
|
2387
|
+
return /* @__PURE__ */ React39.createElement(DirectionProvider5, { rtl: isSiteRtl }, /* @__PURE__ */ React39.createElement(ThemeProvider5, null, /* @__PURE__ */ React39.createElement(StylesField, { bind: "order" }, /* @__PURE__ */ React39.createElement(SectionContent, null, /* @__PURE__ */ React39.createElement(Grid6, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, __16("Order", "elementor"))), /* @__PURE__ */ React39.createElement(Grid6, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React39.createElement(
|
|
2066
2388
|
ControlToggleButtonGroup,
|
|
2067
2389
|
{
|
|
2068
2390
|
items,
|
|
@@ -2070,7 +2392,7 @@ var FlexOrderField = () => {
|
|
|
2070
2392
|
onChange: handleToggleButtonChange,
|
|
2071
2393
|
exclusive: true
|
|
2072
2394
|
}
|
|
2073
|
-
))), CUSTOM === groupControlValue && /* @__PURE__ */
|
|
2395
|
+
))), CUSTOM === groupControlValue && /* @__PURE__ */ React39.createElement(Grid6, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, __16("Custom order", "elementor"))), /* @__PURE__ */ React39.createElement(Grid6, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React39.createElement(
|
|
2074
2396
|
NumberControl,
|
|
2075
2397
|
{
|
|
2076
2398
|
min: FIRST_DEFAULT_VALUE + 1,
|
|
@@ -2090,8 +2412,8 @@ var getGroupControlValue = (order) => {
|
|
|
2090
2412
|
};
|
|
2091
2413
|
|
|
2092
2414
|
// src/components/style-sections/layout-section/flex-size-field.tsx
|
|
2093
|
-
import * as
|
|
2094
|
-
import { useMemo as
|
|
2415
|
+
import * as React40 from "react";
|
|
2416
|
+
import { useMemo as useMemo4, useState as useState10 } from "react";
|
|
2095
2417
|
import {
|
|
2096
2418
|
ControlToggleButtonGroup as ControlToggleButtonGroup2,
|
|
2097
2419
|
NumberControl as NumberControl2,
|
|
@@ -2106,19 +2428,19 @@ var items2 = [
|
|
|
2106
2428
|
{
|
|
2107
2429
|
value: "flex-grow",
|
|
2108
2430
|
label: __17("Grow", "elementor"),
|
|
2109
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2431
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(ExpandIcon, { fontSize: size }),
|
|
2110
2432
|
showTooltip: true
|
|
2111
2433
|
},
|
|
2112
2434
|
{
|
|
2113
2435
|
value: "flex-shrink",
|
|
2114
2436
|
label: __17("Shrink", "elementor"),
|
|
2115
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2437
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(ShrinkIcon, { fontSize: size }),
|
|
2116
2438
|
showTooltip: true
|
|
2117
2439
|
},
|
|
2118
2440
|
{
|
|
2119
2441
|
value: "custom",
|
|
2120
2442
|
label: __17("Custom", "elementor"),
|
|
2121
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2443
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(PencilIcon2, { fontSize: size }),
|
|
2122
2444
|
showTooltip: true
|
|
2123
2445
|
}
|
|
2124
2446
|
];
|
|
@@ -2128,7 +2450,7 @@ var FlexSizeField = () => {
|
|
|
2128
2450
|
const grow = fields?.["flex-grow"]?.value || null;
|
|
2129
2451
|
const shrink = fields?.["flex-shrink"]?.value || null;
|
|
2130
2452
|
const basis = fields?.["flex-basis"]?.value || null;
|
|
2131
|
-
const currentGroup =
|
|
2453
|
+
const currentGroup = useMemo4(() => getActiveGroup({ grow, shrink, basis }), [grow, shrink, basis]), [activeGroup, setActiveGroup] = useState10(currentGroup);
|
|
2132
2454
|
const onChangeGroup = (group = null) => {
|
|
2133
2455
|
setActiveGroup(group);
|
|
2134
2456
|
if (!group || group === "custom") {
|
|
@@ -2153,7 +2475,7 @@ var FlexSizeField = () => {
|
|
|
2153
2475
|
"flex-shrink": numberPropTypeUtil.create(DEFAULT)
|
|
2154
2476
|
});
|
|
2155
2477
|
};
|
|
2156
|
-
return /* @__PURE__ */
|
|
2478
|
+
return /* @__PURE__ */ React40.createElement(DirectionProvider6, { rtl: isSiteRtl }, /* @__PURE__ */ React40.createElement(ThemeProvider6, null, /* @__PURE__ */ React40.createElement(SectionContent, null, /* @__PURE__ */ React40.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(StylesField, { bind: activeGroup ?? "" }, /* @__PURE__ */ React40.createElement(ControlLabel, null, __17("Size", "elementor")))), /* @__PURE__ */ React40.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React40.createElement(
|
|
2157
2479
|
ControlToggleButtonGroup2,
|
|
2158
2480
|
{
|
|
2159
2481
|
value: activeGroup,
|
|
@@ -2161,9 +2483,9 @@ var FlexSizeField = () => {
|
|
|
2161
2483
|
items: items2,
|
|
2162
2484
|
exclusive: true
|
|
2163
2485
|
}
|
|
2164
|
-
))), "custom" === activeGroup && /* @__PURE__ */
|
|
2486
|
+
))), "custom" === activeGroup && /* @__PURE__ */ React40.createElement(FlexCustomField, null))));
|
|
2165
2487
|
};
|
|
2166
|
-
var FlexCustomField = () => /* @__PURE__ */
|
|
2488
|
+
var FlexCustomField = () => /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(StylesField, { bind: "flex-grow" }, /* @__PURE__ */ React40.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlLabel, null, __17("Grow", "elementor"))), /* @__PURE__ */ React40.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React40.createElement(NumberControl2, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React40.createElement(StylesField, { bind: "flex-shrink" }, /* @__PURE__ */ React40.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlLabel, null, __17("Shrink", "elementor"))), /* @__PURE__ */ React40.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React40.createElement(NumberControl2, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React40.createElement(StylesField, { bind: "flex-basis" }, /* @__PURE__ */ React40.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlLabel, null, __17("Basis", "elementor"))), /* @__PURE__ */ React40.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React40.createElement(SizeControl2, { extendedValues: ["auto"] })))));
|
|
2167
2489
|
var getActiveGroup = ({
|
|
2168
2490
|
grow,
|
|
2169
2491
|
shrink,
|
|
@@ -2185,16 +2507,16 @@ var getActiveGroup = ({
|
|
|
2185
2507
|
};
|
|
2186
2508
|
|
|
2187
2509
|
// src/components/style-sections/layout-section/gap-control-field.tsx
|
|
2188
|
-
import * as
|
|
2510
|
+
import * as React41 from "react";
|
|
2189
2511
|
import { GapControl } from "@elementor/editor-controls";
|
|
2190
2512
|
import { Stack as Stack11 } from "@elementor/ui";
|
|
2191
2513
|
import { __ as __18 } from "@wordpress/i18n";
|
|
2192
2514
|
var GapControlField = () => {
|
|
2193
|
-
return /* @__PURE__ */
|
|
2515
|
+
return /* @__PURE__ */ React41.createElement(Stack11, { gap: 1 }, /* @__PURE__ */ React41.createElement(StylesField, { bind: "gap" }, /* @__PURE__ */ React41.createElement(GapControl, { label: __18("Gaps", "elementor") })));
|
|
2194
2516
|
};
|
|
2195
2517
|
|
|
2196
2518
|
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
2197
|
-
import * as
|
|
2519
|
+
import * as React42 from "react";
|
|
2198
2520
|
import { ToggleControl as ToggleControl6 } from "@elementor/editor-controls";
|
|
2199
2521
|
import {
|
|
2200
2522
|
JustifyBottomIcon as JustifyBottomIcon2,
|
|
@@ -2216,47 +2538,47 @@ var options4 = [
|
|
|
2216
2538
|
{
|
|
2217
2539
|
value: "flex-start",
|
|
2218
2540
|
label: __19("Start", "elementor"),
|
|
2219
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2541
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(RotatedIcon, { icon: StartIcon4, size, ...iconProps4 }),
|
|
2220
2542
|
showTooltip: true
|
|
2221
2543
|
},
|
|
2222
2544
|
{
|
|
2223
2545
|
value: "center",
|
|
2224
2546
|
label: __19("Center", "elementor"),
|
|
2225
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2547
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(RotatedIcon, { icon: CenterIcon4, size, ...iconProps4 }),
|
|
2226
2548
|
showTooltip: true
|
|
2227
2549
|
},
|
|
2228
2550
|
{
|
|
2229
2551
|
value: "flex-end",
|
|
2230
2552
|
label: __19("End", "elementor"),
|
|
2231
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2553
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(RotatedIcon, { icon: EndIcon4, size, ...iconProps4 }),
|
|
2232
2554
|
showTooltip: true
|
|
2233
2555
|
},
|
|
2234
2556
|
{
|
|
2235
2557
|
value: "space-between",
|
|
2236
2558
|
label: __19("Space between", "elementor"),
|
|
2237
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2559
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(RotatedIcon, { icon: BetweenIcon2, size, ...iconProps4 }),
|
|
2238
2560
|
showTooltip: true
|
|
2239
2561
|
},
|
|
2240
2562
|
{
|
|
2241
2563
|
value: "space-around",
|
|
2242
2564
|
label: __19("Space around", "elementor"),
|
|
2243
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2565
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(RotatedIcon, { icon: AroundIcon2, size, ...iconProps4 }),
|
|
2244
2566
|
showTooltip: true
|
|
2245
2567
|
},
|
|
2246
2568
|
{
|
|
2247
2569
|
value: "space-evenly",
|
|
2248
2570
|
label: __19("Space evenly", "elementor"),
|
|
2249
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2571
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(RotatedIcon, { icon: EvenlyIcon2, size, ...iconProps4 }),
|
|
2250
2572
|
showTooltip: true
|
|
2251
2573
|
}
|
|
2252
2574
|
];
|
|
2253
2575
|
var JustifyContentField = () => {
|
|
2254
2576
|
const { isSiteRtl } = useDirection();
|
|
2255
|
-
return /* @__PURE__ */
|
|
2577
|
+
return /* @__PURE__ */ React42.createElement(DirectionProvider7, { rtl: isSiteRtl }, /* @__PURE__ */ React42.createElement(ThemeProvider7, null, /* @__PURE__ */ React42.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React42.createElement(Stack12, { gap: 0.75 }, /* @__PURE__ */ React42.createElement(ControlLabel, null, __19("Justify content", "elementor")), /* @__PURE__ */ React42.createElement(ToggleControl6, { options: options4, fullWidth: true })))));
|
|
2256
2578
|
};
|
|
2257
2579
|
|
|
2258
2580
|
// src/components/style-sections/layout-section/wrap-field.tsx
|
|
2259
|
-
import * as
|
|
2581
|
+
import * as React43 from "react";
|
|
2260
2582
|
import { ToggleControl as ToggleControl7 } from "@elementor/editor-controls";
|
|
2261
2583
|
import { ArrowBackIcon, ArrowForwardIcon, ArrowRightIcon as ArrowRightIcon2 } from "@elementor/icons";
|
|
2262
2584
|
import { DirectionProvider as DirectionProvider8, Grid as Grid8, ThemeProvider as ThemeProvider8 } from "@elementor/ui";
|
|
@@ -2265,25 +2587,25 @@ var options5 = [
|
|
|
2265
2587
|
{
|
|
2266
2588
|
value: "nowrap",
|
|
2267
2589
|
label: __20("No wrap", "elementor"),
|
|
2268
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2590
|
+
renderContent: ({ size }) => /* @__PURE__ */ React43.createElement(ArrowRightIcon2, { fontSize: size }),
|
|
2269
2591
|
showTooltip: true
|
|
2270
2592
|
},
|
|
2271
2593
|
{
|
|
2272
2594
|
value: "wrap",
|
|
2273
2595
|
label: __20("Wrap", "elementor"),
|
|
2274
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2596
|
+
renderContent: ({ size }) => /* @__PURE__ */ React43.createElement(ArrowBackIcon, { fontSize: size }),
|
|
2275
2597
|
showTooltip: true
|
|
2276
2598
|
},
|
|
2277
2599
|
{
|
|
2278
2600
|
value: "wrap-reverse",
|
|
2279
2601
|
label: __20("Reversed wrap", "elementor"),
|
|
2280
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2602
|
+
renderContent: ({ size }) => /* @__PURE__ */ React43.createElement(ArrowForwardIcon, { fontSize: size }),
|
|
2281
2603
|
showTooltip: true
|
|
2282
2604
|
}
|
|
2283
2605
|
];
|
|
2284
2606
|
var WrapField = () => {
|
|
2285
2607
|
const { isSiteRtl } = useDirection();
|
|
2286
|
-
return /* @__PURE__ */
|
|
2608
|
+
return /* @__PURE__ */ React43.createElement(DirectionProvider8, { rtl: isSiteRtl }, /* @__PURE__ */ React43.createElement(ThemeProvider8, null, /* @__PURE__ */ React43.createElement(StylesField, { bind: "flex-wrap" }, /* @__PURE__ */ React43.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React43.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(ControlLabel, null, __20("Wrap", "elementor"))), /* @__PURE__ */ React43.createElement(Grid8, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React43.createElement(ToggleControl7, { options: options5 }))))));
|
|
2287
2609
|
};
|
|
2288
2610
|
|
|
2289
2611
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
@@ -2295,13 +2617,13 @@ var LayoutSection = () => {
|
|
|
2295
2617
|
const parent = useParentElement(element.id);
|
|
2296
2618
|
const parentStyle = useComputedStyle(parent?.id || null);
|
|
2297
2619
|
const parentStyleDirection = parentStyle?.flexDirection ?? "row";
|
|
2298
|
-
return /* @__PURE__ */
|
|
2620
|
+
return /* @__PURE__ */ React44.createElement(SectionContent, null, /* @__PURE__ */ React44.createElement(DisplayField, null), isDisplayFlex && /* @__PURE__ */ React44.createElement(FlexFields, null), "flex" === parentStyle?.display && /* @__PURE__ */ React44.createElement(FlexChildFields, { parentStyleDirection }));
|
|
2299
2621
|
};
|
|
2300
2622
|
var FlexFields = () => {
|
|
2301
2623
|
const [flexWrap] = useStylesField("flex-wrap");
|
|
2302
|
-
return /* @__PURE__ */
|
|
2624
|
+
return /* @__PURE__ */ React44.createElement(React44.Fragment, null, /* @__PURE__ */ React44.createElement(FlexDirectionField, null), /* @__PURE__ */ React44.createElement(JustifyContentField, null), /* @__PURE__ */ React44.createElement(AlignItemsField, null), /* @__PURE__ */ React44.createElement(PanelDivider, null), /* @__PURE__ */ React44.createElement(GapControlField, null), /* @__PURE__ */ React44.createElement(WrapField, null), ["wrap", "wrap-reverse"].includes(flexWrap?.value) && /* @__PURE__ */ React44.createElement(AlignContentField, null));
|
|
2303
2625
|
};
|
|
2304
|
-
var FlexChildFields = ({ parentStyleDirection }) => /* @__PURE__ */
|
|
2626
|
+
var FlexChildFields = ({ parentStyleDirection }) => /* @__PURE__ */ React44.createElement(React44.Fragment, null, /* @__PURE__ */ React44.createElement(PanelDivider, null), /* @__PURE__ */ React44.createElement(ControlFormLabel3, null, __21("Flex child", "elementor")), /* @__PURE__ */ React44.createElement(AlignSelfChild, { parentStyleDirection }), /* @__PURE__ */ React44.createElement(FlexOrderField, null), /* @__PURE__ */ React44.createElement(FlexSizeField, null));
|
|
2305
2627
|
var shouldDisplayFlexFields = (display, local) => {
|
|
2306
2628
|
const value = display?.value ?? local?.value;
|
|
2307
2629
|
if (!value) {
|
|
@@ -2311,11 +2633,11 @@ var shouldDisplayFlexFields = (display, local) => {
|
|
|
2311
2633
|
};
|
|
2312
2634
|
|
|
2313
2635
|
// src/components/style-sections/position-section/position-section.tsx
|
|
2314
|
-
import * as
|
|
2636
|
+
import * as React49 from "react";
|
|
2315
2637
|
import { useSessionStorage } from "@elementor/session";
|
|
2316
2638
|
|
|
2317
2639
|
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
2318
|
-
import * as
|
|
2640
|
+
import * as React45 from "react";
|
|
2319
2641
|
import { SizeControl as SizeControl3 } from "@elementor/editor-controls";
|
|
2320
2642
|
import { SideBottomIcon as SideBottomIcon2, SideLeftIcon as SideLeftIcon2, SideRightIcon as SideRightIcon2, SideTopIcon as SideTopIcon2 } from "@elementor/icons";
|
|
2321
2643
|
import { Grid as Grid9, Stack as Stack13, withDirection as withDirection8 } from "@elementor/ui";
|
|
@@ -2323,44 +2645,53 @@ import { __ as __22 } from "@wordpress/i18n";
|
|
|
2323
2645
|
var InlineStartIcon2 = withDirection8(SideLeftIcon2);
|
|
2324
2646
|
var InlineEndIcon2 = withDirection8(SideRightIcon2);
|
|
2325
2647
|
var sideIcons = {
|
|
2326
|
-
"inset-block-start": /* @__PURE__ */
|
|
2327
|
-
"inset-block-end": /* @__PURE__ */
|
|
2328
|
-
"inset-inline-start": /* @__PURE__ */
|
|
2329
|
-
"inset-inline-end": /* @__PURE__ */
|
|
2648
|
+
"inset-block-start": /* @__PURE__ */ React45.createElement(SideTopIcon2, { fontSize: "tiny" }),
|
|
2649
|
+
"inset-block-end": /* @__PURE__ */ React45.createElement(SideBottomIcon2, { fontSize: "tiny" }),
|
|
2650
|
+
"inset-inline-start": /* @__PURE__ */ React45.createElement(RotatedIcon, { icon: InlineStartIcon2, size: "tiny" }),
|
|
2651
|
+
"inset-inline-end": /* @__PURE__ */ React45.createElement(RotatedIcon, { icon: InlineEndIcon2, size: "tiny" })
|
|
2330
2652
|
};
|
|
2331
2653
|
var getInlineStartLabel = (isSiteRtl) => isSiteRtl ? __22("Right", "elementor") : __22("Left", "elementor");
|
|
2332
2654
|
var getInlineEndLabel = (isSiteRtl) => isSiteRtl ? __22("Left", "elementor") : __22("Right", "elementor");
|
|
2333
2655
|
var DimensionsField = () => {
|
|
2334
2656
|
const { isSiteRtl } = useDirection();
|
|
2335
|
-
return /* @__PURE__ */
|
|
2657
|
+
return /* @__PURE__ */ React45.createElement(React45.Fragment, null, /* @__PURE__ */ React45.createElement(Stack13, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(DimensionField, { side: "inset-block-start", label: __22("Top", "elementor") }), /* @__PURE__ */ React45.createElement(DimensionField, { side: "inset-inline-end", label: getInlineEndLabel(isSiteRtl) })), /* @__PURE__ */ React45.createElement(Stack13, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(DimensionField, { side: "inset-block-end", label: __22("Bottom", "elementor") }), /* @__PURE__ */ React45.createElement(DimensionField, { side: "inset-inline-start", label: getInlineStartLabel(isSiteRtl) })));
|
|
2336
2658
|
};
|
|
2337
2659
|
var DimensionField = ({ side, label }) => {
|
|
2338
|
-
return /* @__PURE__ */
|
|
2660
|
+
return /* @__PURE__ */ React45.createElement(Grid9, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React45.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React45.createElement(ControlLabel, null, label)), /* @__PURE__ */ React45.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React45.createElement(StylesField, { bind: side }, /* @__PURE__ */ React45.createElement(SizeControl3, { startIcon: sideIcons[side], extendedValues: ["auto"] }))));
|
|
2339
2661
|
};
|
|
2340
2662
|
|
|
2341
|
-
// src/components/style-sections/position-section/
|
|
2342
|
-
import * as
|
|
2343
|
-
import {
|
|
2663
|
+
// src/components/style-sections/position-section/offset-field.tsx
|
|
2664
|
+
import * as React46 from "react";
|
|
2665
|
+
import { SizeControl as SizeControl4 } from "@elementor/editor-controls";
|
|
2344
2666
|
import { Grid as Grid10 } from "@elementor/ui";
|
|
2345
2667
|
import { __ as __23 } from "@wordpress/i18n";
|
|
2668
|
+
var OffsetField = () => {
|
|
2669
|
+
return /* @__PURE__ */ React46.createElement(StylesField, { bind: "scroll-margin-top" }, /* @__PURE__ */ React46.createElement(Grid10, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlLabel, null, __23("Anchor offset", "elementor"))), /* @__PURE__ */ React46.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(SizeControl4, { units: ["px", "em", "rem", "vw", "vh"] }))));
|
|
2670
|
+
};
|
|
2671
|
+
|
|
2672
|
+
// src/components/style-sections/position-section/position-field.tsx
|
|
2673
|
+
import * as React47 from "react";
|
|
2674
|
+
import { SelectControl as SelectControl3 } from "@elementor/editor-controls";
|
|
2675
|
+
import { Grid as Grid11 } from "@elementor/ui";
|
|
2676
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
2346
2677
|
var positionOptions = [
|
|
2347
|
-
{ label:
|
|
2348
|
-
{ label:
|
|
2349
|
-
{ label:
|
|
2350
|
-
{ label:
|
|
2351
|
-
{ label:
|
|
2678
|
+
{ label: __24("Static", "elementor"), value: "static" },
|
|
2679
|
+
{ label: __24("Relative", "elementor"), value: "relative" },
|
|
2680
|
+
{ label: __24("Absolute", "elementor"), value: "absolute" },
|
|
2681
|
+
{ label: __24("Fixed", "elementor"), value: "fixed" },
|
|
2682
|
+
{ label: __24("Sticky", "elementor"), value: "sticky" }
|
|
2352
2683
|
];
|
|
2353
2684
|
var PositionField = ({ onChange }) => {
|
|
2354
|
-
return /* @__PURE__ */
|
|
2685
|
+
return /* @__PURE__ */ React47.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React47.createElement(Grid11, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React47.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(ControlLabel, null, __24("Position", "elementor"))), /* @__PURE__ */ React47.createElement(Grid11, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React47.createElement(SelectControl3, { options: positionOptions, onChange }))));
|
|
2355
2686
|
};
|
|
2356
2687
|
|
|
2357
2688
|
// src/components/style-sections/position-section/z-index-field.tsx
|
|
2358
|
-
import * as
|
|
2689
|
+
import * as React48 from "react";
|
|
2359
2690
|
import { NumberControl as NumberControl3 } from "@elementor/editor-controls";
|
|
2360
|
-
import { Grid as
|
|
2361
|
-
import { __ as
|
|
2691
|
+
import { Grid as Grid12 } from "@elementor/ui";
|
|
2692
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
2362
2693
|
var ZIndexField = () => {
|
|
2363
|
-
return /* @__PURE__ */
|
|
2694
|
+
return /* @__PURE__ */ React48.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React48.createElement(Grid12, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React48.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(ControlLabel, null, __25("Z-index", "elementor"))), /* @__PURE__ */ React48.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(NumberControl3, null))));
|
|
2364
2695
|
};
|
|
2365
2696
|
|
|
2366
2697
|
// src/components/style-sections/position-section/position-section.tsx
|
|
@@ -2392,7 +2723,7 @@ var PositionSection = () => {
|
|
|
2392
2723
|
}
|
|
2393
2724
|
};
|
|
2394
2725
|
const isNotStatic = positionValue && positionValue?.value !== "static";
|
|
2395
|
-
return /* @__PURE__ */
|
|
2726
|
+
return /* @__PURE__ */ React49.createElement(SectionContent, null, /* @__PURE__ */ React49.createElement(PositionField, { onChange: onPositionChange }), isNotStatic ? /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(DimensionsField, null), /* @__PURE__ */ React49.createElement(ZIndexField, null)) : null, /* @__PURE__ */ React49.createElement(PanelDivider, null), /* @__PURE__ */ React49.createElement(OffsetField, null));
|
|
2396
2727
|
};
|
|
2397
2728
|
var usePersistDimensions = () => {
|
|
2398
2729
|
const { id: styleDefID, meta } = useStyle();
|
|
@@ -2402,93 +2733,93 @@ var usePersistDimensions = () => {
|
|
|
2402
2733
|
};
|
|
2403
2734
|
|
|
2404
2735
|
// src/components/style-sections/size-section/size-section.tsx
|
|
2405
|
-
import * as
|
|
2406
|
-
import { SizeControl as
|
|
2407
|
-
import { Grid as
|
|
2408
|
-
import { __ as
|
|
2736
|
+
import * as React51 from "react";
|
|
2737
|
+
import { SizeControl as SizeControl5 } from "@elementor/editor-controls";
|
|
2738
|
+
import { Grid as Grid14, Stack as Stack14 } from "@elementor/ui";
|
|
2739
|
+
import { __ as __27 } from "@wordpress/i18n";
|
|
2409
2740
|
|
|
2410
2741
|
// src/components/style-sections/size-section/overflow-field.tsx
|
|
2411
|
-
import * as
|
|
2742
|
+
import * as React50 from "react";
|
|
2412
2743
|
import { ToggleControl as ToggleControl8 } from "@elementor/editor-controls";
|
|
2413
2744
|
import { EyeIcon, EyeOffIcon, LetterAIcon } from "@elementor/icons";
|
|
2414
|
-
import { Grid as
|
|
2415
|
-
import { __ as
|
|
2745
|
+
import { Grid as Grid13 } from "@elementor/ui";
|
|
2746
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
2416
2747
|
var options6 = [
|
|
2417
2748
|
{
|
|
2418
2749
|
value: "visible",
|
|
2419
|
-
label:
|
|
2420
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2750
|
+
label: __26("Visible", "elementor"),
|
|
2751
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(EyeIcon, { fontSize: size }),
|
|
2421
2752
|
showTooltip: true
|
|
2422
2753
|
},
|
|
2423
2754
|
{
|
|
2424
2755
|
value: "hidden",
|
|
2425
|
-
label:
|
|
2426
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2756
|
+
label: __26("Hidden", "elementor"),
|
|
2757
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(EyeOffIcon, { fontSize: size }),
|
|
2427
2758
|
showTooltip: true
|
|
2428
2759
|
},
|
|
2429
2760
|
{
|
|
2430
2761
|
value: "auto",
|
|
2431
|
-
label:
|
|
2432
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2762
|
+
label: __26("Auto", "elementor"),
|
|
2763
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(LetterAIcon, { fontSize: size }),
|
|
2433
2764
|
showTooltip: true
|
|
2434
2765
|
}
|
|
2435
2766
|
];
|
|
2436
2767
|
var OverflowField = () => {
|
|
2437
|
-
return /* @__PURE__ */
|
|
2768
|
+
return /* @__PURE__ */ React50.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React50.createElement(Grid13, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React50.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(ControlLabel, null, __26("Overflow", "elementor"))), /* @__PURE__ */ React50.createElement(Grid13, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React50.createElement(ToggleControl8, { options: options6 }))));
|
|
2438
2769
|
};
|
|
2439
2770
|
|
|
2440
2771
|
// src/components/style-sections/size-section/size-section.tsx
|
|
2441
2772
|
var SizeSection = () => {
|
|
2442
|
-
return /* @__PURE__ */
|
|
2773
|
+
return /* @__PURE__ */ React51.createElement(SectionContent, null, /* @__PURE__ */ React51.createElement(Grid14, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React51.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(SizeField, { bind: "width", label: __27("Width", "elementor"), extendedValues: ["auto"] })), /* @__PURE__ */ React51.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(SizeField, { bind: "height", label: __27("Height", "elementor"), extendedValues: ["auto"] }))), /* @__PURE__ */ React51.createElement(Grid14, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React51.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(
|
|
2443
2774
|
SizeField,
|
|
2444
2775
|
{
|
|
2445
2776
|
bind: "min-width",
|
|
2446
|
-
label:
|
|
2777
|
+
label: __27("Min width", "elementor"),
|
|
2447
2778
|
extendedValues: ["auto"]
|
|
2448
2779
|
}
|
|
2449
|
-
)), /* @__PURE__ */
|
|
2780
|
+
)), /* @__PURE__ */ React51.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(
|
|
2450
2781
|
SizeField,
|
|
2451
2782
|
{
|
|
2452
2783
|
bind: "min-height",
|
|
2453
|
-
label:
|
|
2784
|
+
label: __27("Min height", "elementor"),
|
|
2454
2785
|
extendedValues: ["auto"]
|
|
2455
2786
|
}
|
|
2456
|
-
))), /* @__PURE__ */
|
|
2787
|
+
))), /* @__PURE__ */ React51.createElement(Grid14, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React51.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(SizeField, { bind: "max-width", label: __27("Max width", "elementor") })), /* @__PURE__ */ React51.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(SizeField, { bind: "max-height", label: __27("Max height", "elementor") }))), /* @__PURE__ */ React51.createElement(PanelDivider, null), /* @__PURE__ */ React51.createElement(Stack14, null, /* @__PURE__ */ React51.createElement(OverflowField, null)));
|
|
2457
2788
|
};
|
|
2458
2789
|
var SizeField = ({ label, bind, extendedValues }) => {
|
|
2459
|
-
return /* @__PURE__ */
|
|
2790
|
+
return /* @__PURE__ */ React51.createElement(StylesField, { bind }, /* @__PURE__ */ React51.createElement(Grid14, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React51.createElement(Grid14, { item: true, xs: 12 }, /* @__PURE__ */ React51.createElement(ControlLabel, null, label)), /* @__PURE__ */ React51.createElement(Grid14, { item: true, xs: 12 }, /* @__PURE__ */ React51.createElement(SizeControl5, { extendedValues }))));
|
|
2460
2791
|
};
|
|
2461
2792
|
|
|
2462
2793
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
2463
|
-
import * as
|
|
2794
|
+
import * as React52 from "react";
|
|
2464
2795
|
import { LinkedDimensionsControl } from "@elementor/editor-controls";
|
|
2465
|
-
import { __ as
|
|
2796
|
+
import { __ as __28 } from "@wordpress/i18n";
|
|
2466
2797
|
var SpacingSection = () => {
|
|
2467
2798
|
const { isSiteRtl } = useDirection();
|
|
2468
|
-
return /* @__PURE__ */
|
|
2799
|
+
return /* @__PURE__ */ React52.createElement(SectionContent, null, /* @__PURE__ */ React52.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React52.createElement(
|
|
2469
2800
|
LinkedDimensionsControl,
|
|
2470
2801
|
{
|
|
2471
|
-
label:
|
|
2802
|
+
label: __28("Margin", "elementor"),
|
|
2472
2803
|
isSiteRtl,
|
|
2473
2804
|
extendedValues: ["auto"]
|
|
2474
2805
|
}
|
|
2475
|
-
)), /* @__PURE__ */
|
|
2806
|
+
)), /* @__PURE__ */ React52.createElement(PanelDivider, null), /* @__PURE__ */ React52.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React52.createElement(LinkedDimensionsControl, { label: __28("Padding", "elementor"), isSiteRtl })));
|
|
2476
2807
|
};
|
|
2477
2808
|
|
|
2478
2809
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
2479
|
-
import * as
|
|
2810
|
+
import * as React67 from "react";
|
|
2480
2811
|
|
|
2481
2812
|
// src/components/collapsible-content.tsx
|
|
2482
|
-
import * as
|
|
2483
|
-
import { useState as
|
|
2813
|
+
import * as React53 from "react";
|
|
2814
|
+
import { useState as useState11 } from "react";
|
|
2484
2815
|
import { Button, Collapse as Collapse3, Stack as Stack15 } from "@elementor/ui";
|
|
2485
|
-
import { __ as
|
|
2816
|
+
import { __ as __29 } from "@wordpress/i18n";
|
|
2486
2817
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
2487
|
-
const [open, setOpen] =
|
|
2818
|
+
const [open, setOpen] = useState11(defaultOpen);
|
|
2488
2819
|
const handleToggle = () => {
|
|
2489
2820
|
setOpen((prevOpen) => !prevOpen);
|
|
2490
2821
|
};
|
|
2491
|
-
return /* @__PURE__ */
|
|
2822
|
+
return /* @__PURE__ */ React53.createElement(Stack15, null, /* @__PURE__ */ React53.createElement(
|
|
2492
2823
|
Button,
|
|
2493
2824
|
{
|
|
2494
2825
|
fullWidth: true,
|
|
@@ -2496,22 +2827,22 @@ var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
|
2496
2827
|
color: "secondary",
|
|
2497
2828
|
variant: "outlined",
|
|
2498
2829
|
onClick: handleToggle,
|
|
2499
|
-
endIcon: /* @__PURE__ */
|
|
2830
|
+
endIcon: /* @__PURE__ */ React53.createElement(CollapseIcon, { open }),
|
|
2500
2831
|
sx: { my: 0.5 }
|
|
2501
2832
|
},
|
|
2502
|
-
open ?
|
|
2503
|
-
), /* @__PURE__ */
|
|
2833
|
+
open ? __29("Show less", "elementor") : __29("Show more", "elementor")
|
|
2834
|
+
), /* @__PURE__ */ React53.createElement(Collapse3, { in: open, timeout: "auto", unmountOnExit: true }, children));
|
|
2504
2835
|
};
|
|
2505
2836
|
|
|
2506
2837
|
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
2507
|
-
import * as
|
|
2838
|
+
import * as React54 from "react";
|
|
2508
2839
|
import { FontFamilyControl } from "@elementor/editor-controls";
|
|
2509
|
-
import { Grid as
|
|
2510
|
-
import { __ as
|
|
2840
|
+
import { Grid as Grid15 } from "@elementor/ui";
|
|
2841
|
+
import { __ as __31 } from "@wordpress/i18n";
|
|
2511
2842
|
|
|
2512
2843
|
// src/components/style-sections/typography-section/hooks/use-font-families.ts
|
|
2513
|
-
import { useMemo as
|
|
2514
|
-
import { __ as
|
|
2844
|
+
import { useMemo as useMemo5 } from "react";
|
|
2845
|
+
import { __ as __30 } from "@wordpress/i18n";
|
|
2515
2846
|
|
|
2516
2847
|
// src/sync/get-elementor-config.ts
|
|
2517
2848
|
var getElementorConfig = () => {
|
|
@@ -2521,9 +2852,9 @@ var getElementorConfig = () => {
|
|
|
2521
2852
|
|
|
2522
2853
|
// src/components/style-sections/typography-section/hooks/use-font-families.ts
|
|
2523
2854
|
var supportedCategories = {
|
|
2524
|
-
system:
|
|
2525
|
-
custom:
|
|
2526
|
-
googlefonts:
|
|
2855
|
+
system: __30("System", "elementor"),
|
|
2856
|
+
custom: __30("Custom Fonts", "elementor"),
|
|
2857
|
+
googlefonts: __30("Google Fonts", "elementor")
|
|
2527
2858
|
};
|
|
2528
2859
|
var getFontFamilies = () => {
|
|
2529
2860
|
const { controls } = getElementorConfig();
|
|
@@ -2535,7 +2866,7 @@ var getFontFamilies = () => {
|
|
|
2535
2866
|
};
|
|
2536
2867
|
var useFontFamilies = () => {
|
|
2537
2868
|
const fontFamilies = getFontFamilies();
|
|
2538
|
-
return
|
|
2869
|
+
return useMemo5(() => {
|
|
2539
2870
|
const categoriesOrder = ["system", "custom", "googlefonts"];
|
|
2540
2871
|
return Object.entries(fontFamilies || {}).reduce((acc, [font, category]) => {
|
|
2541
2872
|
if (!supportedCategories[category]) {
|
|
@@ -2560,188 +2891,188 @@ var FontFamilyField = () => {
|
|
|
2560
2891
|
if (fontFamilies.length === 0) {
|
|
2561
2892
|
return null;
|
|
2562
2893
|
}
|
|
2563
|
-
return /* @__PURE__ */
|
|
2894
|
+
return /* @__PURE__ */ React54.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React54.createElement(Grid15, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(ControlLabel, null, __31("Font family", "elementor"))), /* @__PURE__ */ React54.createElement(Grid15, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React54.createElement(FontFamilyControl, { fontFamilies }))));
|
|
2564
2895
|
};
|
|
2565
2896
|
|
|
2566
2897
|
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
2567
|
-
import * as
|
|
2568
|
-
import { SizeControl as
|
|
2569
|
-
import { Grid as
|
|
2570
|
-
import { __ as
|
|
2898
|
+
import * as React55 from "react";
|
|
2899
|
+
import { SizeControl as SizeControl6 } from "@elementor/editor-controls";
|
|
2900
|
+
import { Grid as Grid16 } from "@elementor/ui";
|
|
2901
|
+
import { __ as __32 } from "@wordpress/i18n";
|
|
2571
2902
|
var FontSizeField = () => {
|
|
2572
|
-
return /* @__PURE__ */
|
|
2903
|
+
return /* @__PURE__ */ React55.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React55.createElement(Grid16, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React55.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React55.createElement(ControlLabel, null, __32("Font size", "elementor"))), /* @__PURE__ */ React55.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React55.createElement(SizeControl6, null))));
|
|
2573
2904
|
};
|
|
2574
2905
|
|
|
2575
2906
|
// src/components/style-sections/typography-section/font-style-field.tsx
|
|
2576
|
-
import * as
|
|
2907
|
+
import * as React56 from "react";
|
|
2577
2908
|
import { ControlFormLabel as ControlFormLabel4, ToggleControl as ToggleControl9 } from "@elementor/editor-controls";
|
|
2578
2909
|
import { ItalicIcon, MinusIcon as MinusIcon2 } from "@elementor/icons";
|
|
2579
|
-
import { Grid as
|
|
2580
|
-
import { __ as
|
|
2910
|
+
import { Grid as Grid17 } from "@elementor/ui";
|
|
2911
|
+
import { __ as __33 } from "@wordpress/i18n";
|
|
2581
2912
|
var options7 = [
|
|
2582
2913
|
{
|
|
2583
2914
|
value: "normal",
|
|
2584
|
-
label:
|
|
2585
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2915
|
+
label: __33("Normal", "elementor"),
|
|
2916
|
+
renderContent: ({ size }) => /* @__PURE__ */ React56.createElement(MinusIcon2, { fontSize: size }),
|
|
2586
2917
|
showTooltip: true
|
|
2587
2918
|
},
|
|
2588
2919
|
{
|
|
2589
2920
|
value: "italic",
|
|
2590
|
-
label:
|
|
2591
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2921
|
+
label: __33("Italic", "elementor"),
|
|
2922
|
+
renderContent: ({ size }) => /* @__PURE__ */ React56.createElement(ItalicIcon, { fontSize: size }),
|
|
2592
2923
|
showTooltip: true
|
|
2593
2924
|
}
|
|
2594
2925
|
];
|
|
2595
|
-
var FontStyleField = () => /* @__PURE__ */
|
|
2926
|
+
var FontStyleField = () => /* @__PURE__ */ React56.createElement(StylesField, { bind: "font-style" }, /* @__PURE__ */ React56.createElement(Grid17, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(ControlFormLabel4, null, __33("Font style", "elementor"))), /* @__PURE__ */ React56.createElement(Grid17, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React56.createElement(ToggleControl9, { options: options7 }))));
|
|
2596
2927
|
|
|
2597
2928
|
// src/components/style-sections/typography-section/font-weight-field.tsx
|
|
2598
|
-
import * as
|
|
2929
|
+
import * as React57 from "react";
|
|
2599
2930
|
import { SelectControl as SelectControl4 } from "@elementor/editor-controls";
|
|
2600
|
-
import { Grid as
|
|
2601
|
-
import { __ as
|
|
2931
|
+
import { Grid as Grid18 } from "@elementor/ui";
|
|
2932
|
+
import { __ as __34 } from "@wordpress/i18n";
|
|
2602
2933
|
var fontWeightOptions = [
|
|
2603
|
-
{ value: "100", label:
|
|
2604
|
-
{ value: "200", label:
|
|
2605
|
-
{ value: "300", label:
|
|
2606
|
-
{ value: "400", label:
|
|
2607
|
-
{ value: "500", label:
|
|
2608
|
-
{ value: "600", label:
|
|
2609
|
-
{ value: "700", label:
|
|
2610
|
-
{ value: "800", label:
|
|
2611
|
-
{ value: "900", label:
|
|
2934
|
+
{ value: "100", label: __34("100 - Thin", "elementor") },
|
|
2935
|
+
{ value: "200", label: __34("200 - Extra light", "elementor") },
|
|
2936
|
+
{ value: "300", label: __34("300 - Light", "elementor") },
|
|
2937
|
+
{ value: "400", label: __34("400 - Normal", "elementor") },
|
|
2938
|
+
{ value: "500", label: __34("500 - Medium", "elementor") },
|
|
2939
|
+
{ value: "600", label: __34("600 - Semi bold", "elementor") },
|
|
2940
|
+
{ value: "700", label: __34("700 - Bold", "elementor") },
|
|
2941
|
+
{ value: "800", label: __34("800 - Extra bold", "elementor") },
|
|
2942
|
+
{ value: "900", label: __34("900 - Black", "elementor") }
|
|
2612
2943
|
];
|
|
2613
2944
|
var FontWeightField = () => {
|
|
2614
|
-
return /* @__PURE__ */
|
|
2945
|
+
return /* @__PURE__ */ React57.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React57.createElement(Grid18, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React57.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ControlLabel, null, __34("Font weight", "elementor"))), /* @__PURE__ */ React57.createElement(Grid18, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React57.createElement(SelectControl4, { options: fontWeightOptions }))));
|
|
2615
2946
|
};
|
|
2616
2947
|
|
|
2617
2948
|
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
2618
|
-
import * as
|
|
2619
|
-
import { SizeControl as
|
|
2620
|
-
import { Grid as
|
|
2621
|
-
import { __ as
|
|
2949
|
+
import * as React58 from "react";
|
|
2950
|
+
import { SizeControl as SizeControl7 } from "@elementor/editor-controls";
|
|
2951
|
+
import { Grid as Grid19 } from "@elementor/ui";
|
|
2952
|
+
import { __ as __35 } from "@wordpress/i18n";
|
|
2622
2953
|
var LetterSpacingField = () => {
|
|
2623
|
-
return /* @__PURE__ */
|
|
2954
|
+
return /* @__PURE__ */ React58.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React58.createElement(Grid19, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React58.createElement(ControlLabel, null, __35("Letter spacing", "elementor"))), /* @__PURE__ */ React58.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React58.createElement(SizeControl7, null))));
|
|
2624
2955
|
};
|
|
2625
2956
|
|
|
2626
2957
|
// src/components/style-sections/typography-section/line-height-field.tsx
|
|
2627
|
-
import * as
|
|
2628
|
-
import { SizeControl as
|
|
2629
|
-
import { Grid as
|
|
2630
|
-
import { __ as
|
|
2958
|
+
import * as React59 from "react";
|
|
2959
|
+
import { SizeControl as SizeControl8 } from "@elementor/editor-controls";
|
|
2960
|
+
import { Grid as Grid20 } from "@elementor/ui";
|
|
2961
|
+
import { __ as __36 } from "@wordpress/i18n";
|
|
2631
2962
|
var LineHeightField = () => {
|
|
2632
|
-
return /* @__PURE__ */
|
|
2963
|
+
return /* @__PURE__ */ React59.createElement(StylesField, { bind: "line-height" }, /* @__PURE__ */ React59.createElement(Grid20, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React59.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React59.createElement(ControlLabel, null, __36("Line height", "elementor"))), /* @__PURE__ */ React59.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React59.createElement(SizeControl8, null))));
|
|
2633
2964
|
};
|
|
2634
2965
|
|
|
2635
2966
|
// src/components/style-sections/typography-section/text-alignment-field.tsx
|
|
2636
|
-
import * as
|
|
2967
|
+
import * as React60 from "react";
|
|
2637
2968
|
import { ToggleControl as ToggleControl10 } from "@elementor/editor-controls";
|
|
2638
2969
|
import { AlignCenterIcon, AlignJustifiedIcon, AlignLeftIcon, AlignRightIcon } from "@elementor/icons";
|
|
2639
|
-
import { Grid as
|
|
2640
|
-
import { __ as
|
|
2970
|
+
import { Grid as Grid21, withDirection as withDirection9 } from "@elementor/ui";
|
|
2971
|
+
import { __ as __37 } from "@wordpress/i18n";
|
|
2641
2972
|
var AlignStartIcon = withDirection9(AlignLeftIcon);
|
|
2642
2973
|
var AlignEndIcon = withDirection9(AlignRightIcon);
|
|
2643
2974
|
var options8 = [
|
|
2644
2975
|
{
|
|
2645
2976
|
value: "start",
|
|
2646
|
-
label:
|
|
2647
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2977
|
+
label: __37("Start", "elementor"),
|
|
2978
|
+
renderContent: ({ size }) => /* @__PURE__ */ React60.createElement(AlignStartIcon, { fontSize: size }),
|
|
2648
2979
|
showTooltip: true
|
|
2649
2980
|
},
|
|
2650
2981
|
{
|
|
2651
2982
|
value: "center",
|
|
2652
|
-
label:
|
|
2653
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2983
|
+
label: __37("Center", "elementor"),
|
|
2984
|
+
renderContent: ({ size }) => /* @__PURE__ */ React60.createElement(AlignCenterIcon, { fontSize: size }),
|
|
2654
2985
|
showTooltip: true
|
|
2655
2986
|
},
|
|
2656
2987
|
{
|
|
2657
2988
|
value: "end",
|
|
2658
|
-
label:
|
|
2659
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2989
|
+
label: __37("End", "elementor"),
|
|
2990
|
+
renderContent: ({ size }) => /* @__PURE__ */ React60.createElement(AlignEndIcon, { fontSize: size }),
|
|
2660
2991
|
showTooltip: true
|
|
2661
2992
|
},
|
|
2662
2993
|
{
|
|
2663
2994
|
value: "justify",
|
|
2664
|
-
label:
|
|
2665
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2995
|
+
label: __37("Justify", "elementor"),
|
|
2996
|
+
renderContent: ({ size }) => /* @__PURE__ */ React60.createElement(AlignJustifiedIcon, { fontSize: size }),
|
|
2666
2997
|
showTooltip: true
|
|
2667
2998
|
}
|
|
2668
2999
|
];
|
|
2669
3000
|
var TextAlignmentField = () => {
|
|
2670
|
-
return /* @__PURE__ */
|
|
3001
|
+
return /* @__PURE__ */ React60.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React60.createElement(Grid21, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React60.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(ControlLabel, null, __37("Text align", "elementor"))), /* @__PURE__ */ React60.createElement(Grid21, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React60.createElement(ToggleControl10, { options: options8 }))));
|
|
2671
3002
|
};
|
|
2672
3003
|
|
|
2673
3004
|
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
2674
|
-
import * as
|
|
3005
|
+
import * as React61 from "react";
|
|
2675
3006
|
import { ColorControl as ColorControl2 } from "@elementor/editor-controls";
|
|
2676
|
-
import { Grid as
|
|
2677
|
-
import { __ as
|
|
3007
|
+
import { Grid as Grid22 } from "@elementor/ui";
|
|
3008
|
+
import { __ as __38 } from "@wordpress/i18n";
|
|
2678
3009
|
var TextColorField = () => {
|
|
2679
|
-
return /* @__PURE__ */
|
|
3010
|
+
return /* @__PURE__ */ React61.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React61.createElement(Grid22, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React61.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React61.createElement(ControlLabel, null, __38("Text color", "elementor"))), /* @__PURE__ */ React61.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React61.createElement(ColorControl2, null))));
|
|
2680
3011
|
};
|
|
2681
3012
|
|
|
2682
3013
|
// src/components/style-sections/typography-section/text-decoration-field.tsx
|
|
2683
|
-
import * as
|
|
3014
|
+
import * as React62 from "react";
|
|
2684
3015
|
import { ToggleControl as ToggleControl11 } from "@elementor/editor-controls";
|
|
2685
3016
|
import { MinusIcon as MinusIcon3, OverlineIcon, StrikethroughIcon, UnderlineIcon } from "@elementor/icons";
|
|
2686
|
-
import { Grid as
|
|
2687
|
-
import { __ as
|
|
3017
|
+
import { Grid as Grid23 } from "@elementor/ui";
|
|
3018
|
+
import { __ as __39 } from "@wordpress/i18n";
|
|
2688
3019
|
var options9 = [
|
|
2689
3020
|
{
|
|
2690
3021
|
value: "none",
|
|
2691
|
-
label:
|
|
2692
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3022
|
+
label: __39("None", "elementor"),
|
|
3023
|
+
renderContent: ({ size }) => /* @__PURE__ */ React62.createElement(MinusIcon3, { fontSize: size }),
|
|
2693
3024
|
showTooltip: true,
|
|
2694
3025
|
exclusive: true
|
|
2695
3026
|
},
|
|
2696
3027
|
{
|
|
2697
3028
|
value: "underline",
|
|
2698
|
-
label:
|
|
2699
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3029
|
+
label: __39("Underline", "elementor"),
|
|
3030
|
+
renderContent: ({ size }) => /* @__PURE__ */ React62.createElement(UnderlineIcon, { fontSize: size }),
|
|
2700
3031
|
showTooltip: true
|
|
2701
3032
|
},
|
|
2702
3033
|
{
|
|
2703
3034
|
value: "line-through",
|
|
2704
|
-
label:
|
|
2705
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3035
|
+
label: __39("Line-through", "elementor"),
|
|
3036
|
+
renderContent: ({ size }) => /* @__PURE__ */ React62.createElement(StrikethroughIcon, { fontSize: size }),
|
|
2706
3037
|
showTooltip: true
|
|
2707
3038
|
},
|
|
2708
3039
|
{
|
|
2709
3040
|
value: "overline",
|
|
2710
|
-
label:
|
|
2711
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3041
|
+
label: __39("Overline", "elementor"),
|
|
3042
|
+
renderContent: ({ size }) => /* @__PURE__ */ React62.createElement(OverlineIcon, { fontSize: size }),
|
|
2712
3043
|
showTooltip: true
|
|
2713
3044
|
}
|
|
2714
3045
|
];
|
|
2715
|
-
var TextDecorationField = () => /* @__PURE__ */
|
|
3046
|
+
var TextDecorationField = () => /* @__PURE__ */ React62.createElement(StylesField, { bind: "text-decoration" }, /* @__PURE__ */ React62.createElement(Grid23, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React62.createElement(Grid23, { item: true, xs: 6 }, /* @__PURE__ */ React62.createElement(ControlLabel, null, __39("Line decoration", "elementor"))), /* @__PURE__ */ React62.createElement(Grid23, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React62.createElement(ToggleControl11, { options: options9, exclusive: false }))));
|
|
2716
3047
|
|
|
2717
3048
|
// src/components/style-sections/typography-section/text-direction-field.tsx
|
|
2718
|
-
import * as
|
|
3049
|
+
import * as React63 from "react";
|
|
2719
3050
|
import { ToggleControl as ToggleControl12 } from "@elementor/editor-controls";
|
|
2720
3051
|
import { TextDirectionLtrIcon, TextDirectionRtlIcon } from "@elementor/icons";
|
|
2721
|
-
import { Grid as
|
|
2722
|
-
import { __ as
|
|
3052
|
+
import { Grid as Grid24 } from "@elementor/ui";
|
|
3053
|
+
import { __ as __40 } from "@wordpress/i18n";
|
|
2723
3054
|
var options10 = [
|
|
2724
3055
|
{
|
|
2725
3056
|
value: "ltr",
|
|
2726
|
-
label:
|
|
2727
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3057
|
+
label: __40("Left to right", "elementor"),
|
|
3058
|
+
renderContent: ({ size }) => /* @__PURE__ */ React63.createElement(TextDirectionLtrIcon, { fontSize: size }),
|
|
2728
3059
|
showTooltip: true
|
|
2729
3060
|
},
|
|
2730
3061
|
{
|
|
2731
3062
|
value: "rtl",
|
|
2732
|
-
label:
|
|
2733
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3063
|
+
label: __40("Right to left", "elementor"),
|
|
3064
|
+
renderContent: ({ size }) => /* @__PURE__ */ React63.createElement(TextDirectionRtlIcon, { fontSize: size }),
|
|
2734
3065
|
showTooltip: true
|
|
2735
3066
|
}
|
|
2736
3067
|
];
|
|
2737
3068
|
var TextDirectionField = () => {
|
|
2738
|
-
return /* @__PURE__ */
|
|
3069
|
+
return /* @__PURE__ */ React63.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React63.createElement(Grid24, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React63.createElement(Grid24, { item: true, xs: 6 }, /* @__PURE__ */ React63.createElement(ControlLabel, null, __40("Direction", "elementor"))), /* @__PURE__ */ React63.createElement(Grid24, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React63.createElement(ToggleControl12, { options: options10 }))));
|
|
2739
3070
|
};
|
|
2740
3071
|
|
|
2741
3072
|
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
2742
|
-
import * as
|
|
3073
|
+
import * as React64 from "react";
|
|
2743
3074
|
import { StrokeControl } from "@elementor/editor-controls";
|
|
2744
|
-
import { __ as
|
|
3075
|
+
import { __ as __41 } from "@wordpress/i18n";
|
|
2745
3076
|
var initTextStroke = {
|
|
2746
3077
|
$$type: "stroke",
|
|
2747
3078
|
value: {
|
|
@@ -2767,73 +3098,81 @@ var TextStrokeField = () => {
|
|
|
2767
3098
|
setTextStroke(null);
|
|
2768
3099
|
};
|
|
2769
3100
|
const hasTextStroke = Boolean(textStroke);
|
|
2770
|
-
return /* @__PURE__ */
|
|
3101
|
+
return /* @__PURE__ */ React64.createElement(StylesField, { bind: "stroke" }, /* @__PURE__ */ React64.createElement(
|
|
2771
3102
|
AddOrRemoveContent,
|
|
2772
3103
|
{
|
|
2773
|
-
label:
|
|
3104
|
+
label: __41("Text stroke", "elementor"),
|
|
2774
3105
|
isAdded: hasTextStroke,
|
|
2775
3106
|
onAdd: addTextStroke,
|
|
2776
3107
|
onRemove: removeTextStroke
|
|
2777
3108
|
},
|
|
2778
|
-
/* @__PURE__ */
|
|
3109
|
+
/* @__PURE__ */ React64.createElement(StrokeControl, null)
|
|
2779
3110
|
));
|
|
2780
3111
|
};
|
|
2781
3112
|
|
|
2782
3113
|
// src/components/style-sections/typography-section/transform-field.tsx
|
|
2783
|
-
import * as
|
|
3114
|
+
import * as React65 from "react";
|
|
2784
3115
|
import { ToggleControl as ToggleControl13 } from "@elementor/editor-controls";
|
|
2785
3116
|
import { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon, MinusIcon as MinusIcon4 } from "@elementor/icons";
|
|
2786
|
-
import { Grid as
|
|
2787
|
-
import { __ as
|
|
3117
|
+
import { Grid as Grid25 } from "@elementor/ui";
|
|
3118
|
+
import { __ as __42 } from "@wordpress/i18n";
|
|
2788
3119
|
var options11 = [
|
|
2789
3120
|
{
|
|
2790
3121
|
value: "none",
|
|
2791
|
-
label:
|
|
2792
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3122
|
+
label: __42("None", "elementor"),
|
|
3123
|
+
renderContent: ({ size }) => /* @__PURE__ */ React65.createElement(MinusIcon4, { fontSize: size }),
|
|
2793
3124
|
showTooltip: true
|
|
2794
3125
|
},
|
|
2795
3126
|
{
|
|
2796
3127
|
value: "capitalize",
|
|
2797
|
-
label:
|
|
2798
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3128
|
+
label: __42("Capitalize", "elementor"),
|
|
3129
|
+
renderContent: ({ size }) => /* @__PURE__ */ React65.createElement(LetterCaseIcon, { fontSize: size }),
|
|
2799
3130
|
showTooltip: true
|
|
2800
3131
|
},
|
|
2801
3132
|
{
|
|
2802
3133
|
value: "uppercase",
|
|
2803
|
-
label:
|
|
2804
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3134
|
+
label: __42("Uppercase", "elementor"),
|
|
3135
|
+
renderContent: ({ size }) => /* @__PURE__ */ React65.createElement(LetterCaseUpperIcon, { fontSize: size }),
|
|
2805
3136
|
showTooltip: true
|
|
2806
3137
|
},
|
|
2807
3138
|
{
|
|
2808
3139
|
value: "lowercase",
|
|
2809
|
-
label:
|
|
2810
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3140
|
+
label: __42("Lowercase", "elementor"),
|
|
3141
|
+
renderContent: ({ size }) => /* @__PURE__ */ React65.createElement(LetterCaseLowerIcon, { fontSize: size }),
|
|
2811
3142
|
showTooltip: true
|
|
2812
3143
|
}
|
|
2813
3144
|
];
|
|
2814
|
-
var TransformField = () => /* @__PURE__ */
|
|
3145
|
+
var TransformField = () => /* @__PURE__ */ React65.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React65.createElement(Grid25, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React65.createElement(Grid25, { item: true, xs: 6 }, /* @__PURE__ */ React65.createElement(ControlLabel, null, __42("Text transform", "elementor"))), /* @__PURE__ */ React65.createElement(Grid25, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React65.createElement(ToggleControl13, { options: options11 }))));
|
|
2815
3146
|
|
|
2816
3147
|
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
2817
|
-
import * as
|
|
2818
|
-
import { SizeControl as
|
|
2819
|
-
import { Grid as
|
|
2820
|
-
import { __ as
|
|
3148
|
+
import * as React66 from "react";
|
|
3149
|
+
import { SizeControl as SizeControl9 } from "@elementor/editor-controls";
|
|
3150
|
+
import { Grid as Grid26 } from "@elementor/ui";
|
|
3151
|
+
import { __ as __43 } from "@wordpress/i18n";
|
|
2821
3152
|
var WordSpacingField = () => {
|
|
2822
|
-
return /* @__PURE__ */
|
|
3153
|
+
return /* @__PURE__ */ React66.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React66.createElement(Grid26, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React66.createElement(Grid26, { item: true, xs: 6 }, /* @__PURE__ */ React66.createElement(ControlLabel, null, __43("Word spacing", "elementor"))), /* @__PURE__ */ React66.createElement(Grid26, { item: true, xs: 6 }, /* @__PURE__ */ React66.createElement(SizeControl9, null))));
|
|
2823
3154
|
};
|
|
2824
3155
|
|
|
2825
3156
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
2826
3157
|
var TypographySection = () => {
|
|
2827
|
-
return /* @__PURE__ */
|
|
3158
|
+
return /* @__PURE__ */ React67.createElement(SectionContent, null, /* @__PURE__ */ React67.createElement(FontFamilyField, null), /* @__PURE__ */ React67.createElement(FontWeightField, null), /* @__PURE__ */ React67.createElement(FontSizeField, null), /* @__PURE__ */ React67.createElement(PanelDivider, null), /* @__PURE__ */ React67.createElement(TextAlignmentField, null), /* @__PURE__ */ React67.createElement(TextColorField, null), /* @__PURE__ */ React67.createElement(CollapsibleContent, null, /* @__PURE__ */ React67.createElement(SectionContent, { sx: { pt: 2 } }, /* @__PURE__ */ React67.createElement(LineHeightField, null), /* @__PURE__ */ React67.createElement(LetterSpacingField, null), /* @__PURE__ */ React67.createElement(WordSpacingField, null), /* @__PURE__ */ React67.createElement(PanelDivider, null), /* @__PURE__ */ React67.createElement(TextDecorationField, null), /* @__PURE__ */ React67.createElement(TransformField, null), /* @__PURE__ */ React67.createElement(TextDirectionField, null), /* @__PURE__ */ React67.createElement(FontStyleField, null), /* @__PURE__ */ React67.createElement(TextStrokeField, null))));
|
|
2828
3159
|
};
|
|
2829
3160
|
|
|
2830
3161
|
// src/components/style-tab.tsx
|
|
3162
|
+
var TABS_HEADER_HEIGHT = "37px";
|
|
3163
|
+
var stickyHeaderStyles = {
|
|
3164
|
+
position: "sticky",
|
|
3165
|
+
zIndex: 1,
|
|
3166
|
+
opacity: 1,
|
|
3167
|
+
backgroundColor: "background.default",
|
|
3168
|
+
transition: "top 300ms ease"
|
|
3169
|
+
};
|
|
2831
3170
|
var StyleTab = () => {
|
|
2832
3171
|
const currentClassesProp = useCurrentClassesProp();
|
|
2833
3172
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
2834
|
-
const [activeStyleState, setActiveStyleState] =
|
|
3173
|
+
const [activeStyleState, setActiveStyleState] = useState12(null);
|
|
2835
3174
|
const breakpoint = useActiveBreakpoint();
|
|
2836
|
-
return /* @__PURE__ */
|
|
3175
|
+
return /* @__PURE__ */ React68.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React68.createElement(
|
|
2837
3176
|
StyleProvider,
|
|
2838
3177
|
{
|
|
2839
3178
|
meta: { breakpoint, state: activeStyleState },
|
|
@@ -2844,9 +3183,13 @@ var StyleTab = () => {
|
|
|
2844
3183
|
},
|
|
2845
3184
|
setMetaState: setActiveStyleState
|
|
2846
3185
|
},
|
|
2847
|
-
/* @__PURE__ */
|
|
3186
|
+
/* @__PURE__ */ React68.createElement(SessionStorageProvider2, { prefix: activeStyleDefId ?? "" }, /* @__PURE__ */ React68.createElement(StyleInheritanceProvider, null, /* @__PURE__ */ React68.createElement(ClassesHeader, null, /* @__PURE__ */ React68.createElement(CssClassSelector, null), /* @__PURE__ */ React68.createElement(Divider4, null)), /* @__PURE__ */ React68.createElement(SectionsList, null, /* @__PURE__ */ React68.createElement(Section, { title: __44("Layout", "elementor") }, /* @__PURE__ */ React68.createElement(LayoutSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: __44("Spacing", "elementor") }, /* @__PURE__ */ React68.createElement(SpacingSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: __44("Size", "elementor") }, /* @__PURE__ */ React68.createElement(SizeSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: __44("Position", "elementor") }, /* @__PURE__ */ React68.createElement(PositionSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: __44("Typography", "elementor") }, /* @__PURE__ */ React68.createElement(TypographySection, null)), /* @__PURE__ */ React68.createElement(Section, { title: __44("Background", "elementor") }, /* @__PURE__ */ React68.createElement(BackgroundSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: __44("Border", "elementor") }, /* @__PURE__ */ React68.createElement(BorderSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: __44("Effects", "elementor") }, /* @__PURE__ */ React68.createElement(EffectsSection, null)))))
|
|
2848
3187
|
));
|
|
2849
3188
|
};
|
|
3189
|
+
function ClassesHeader({ children }) {
|
|
3190
|
+
const scrollDirection = useScrollDirection();
|
|
3191
|
+
return /* @__PURE__ */ React68.createElement(Stack16, { sx: { ...stickyHeaderStyles, top: scrollDirection === "up" ? TABS_HEADER_HEIGHT : 0 } }, children);
|
|
3192
|
+
}
|
|
2850
3193
|
function useCurrentClassesProp() {
|
|
2851
3194
|
const { elementType } = useElement();
|
|
2852
3195
|
const prop = Object.entries(elementType.propsSchema).find(
|
|
@@ -2865,7 +3208,7 @@ var EditingPanelTabs = () => {
|
|
|
2865
3208
|
return (
|
|
2866
3209
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
2867
3210
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
2868
|
-
/* @__PURE__ */
|
|
3211
|
+
/* @__PURE__ */ React69.createElement(Fragment8, { key: element.id }, /* @__PURE__ */ React69.createElement(ScrollProvider, null, /* @__PURE__ */ React69.createElement(Stack17, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React69.createElement(Stack17, { sx: { ...stickyHeaderStyles, top: 0 } }, /* @__PURE__ */ React69.createElement(Tabs, { variant: "fullWidth", size: "small", sx: { mt: 0.5 }, ...getTabsProps() }, /* @__PURE__ */ React69.createElement(Tab, { label: __45("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React69.createElement(Tab, { label: __45("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React69.createElement(Divider5, null)), /* @__PURE__ */ React69.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React69.createElement(SettingsTab, null)), /* @__PURE__ */ React69.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React69.createElement(StyleTab, null)))))
|
|
2869
3212
|
);
|
|
2870
3213
|
};
|
|
2871
3214
|
|
|
@@ -2878,8 +3221,8 @@ var EditingPanel = () => {
|
|
|
2878
3221
|
if (!element || !elementType) {
|
|
2879
3222
|
return null;
|
|
2880
3223
|
}
|
|
2881
|
-
const panelTitle =
|
|
2882
|
-
return /* @__PURE__ */
|
|
3224
|
+
const panelTitle = __46("Edit %s", "elementor").replace("%s", elementType.title);
|
|
3225
|
+
return /* @__PURE__ */ React70.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React70.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React70.createElement(SessionStorageProvider3, { prefix: "elementor" }, /* @__PURE__ */ React70.createElement(ThemeProvider9, null, /* @__PURE__ */ React70.createElement(Panel, null, /* @__PURE__ */ React70.createElement(PanelHeader, null, /* @__PURE__ */ React70.createElement(PanelHeaderTitle, null, panelTitle), /* @__PURE__ */ React70.createElement(AtomIcon, { fontSize: "small", sx: { color: "text.tertiary" } })), /* @__PURE__ */ React70.createElement(PanelBody, null, /* @__PURE__ */ React70.createElement(ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React70.createElement(ControlReplacementsProvider, { replacements: controlReplacements }, /* @__PURE__ */ React70.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React70.createElement(EditingPanelTabs, null)))))))));
|
|
2883
3226
|
};
|
|
2884
3227
|
|
|
2885
3228
|
// src/panel.ts
|
|
@@ -2895,7 +3238,7 @@ import { __registerPanel as registerPanel } from "@elementor/editor-panels";
|
|
|
2895
3238
|
import { blockCommand } from "@elementor/editor-v1-adapters";
|
|
2896
3239
|
|
|
2897
3240
|
// src/hooks/use-open-editor-panel.ts
|
|
2898
|
-
import { useEffect as
|
|
3241
|
+
import { useEffect as useEffect4 } from "react";
|
|
2899
3242
|
import { __privateListenTo as listenTo, commandStartEvent } from "@elementor/editor-v1-adapters";
|
|
2900
3243
|
|
|
2901
3244
|
// src/sync/is-atomic-widget-selected.ts
|
|
@@ -2912,7 +3255,7 @@ var isAtomicWidgetSelected = () => {
|
|
|
2912
3255
|
// src/hooks/use-open-editor-panel.ts
|
|
2913
3256
|
var useOpenEditorPanel = () => {
|
|
2914
3257
|
const { open } = usePanelActions();
|
|
2915
|
-
|
|
3258
|
+
useEffect4(() => {
|
|
2916
3259
|
return listenTo(commandStartEvent("panel/editor/open"), () => {
|
|
2917
3260
|
if (isAtomicWidgetSelected()) {
|
|
2918
3261
|
open();
|
|
@@ -2928,36 +3271,36 @@ var EditingPanelHooks = () => {
|
|
|
2928
3271
|
};
|
|
2929
3272
|
|
|
2930
3273
|
// src/dynamics/init.ts
|
|
2931
|
-
import { settingsTransformersRegistry, styleTransformersRegistry } from "@elementor/editor-canvas";
|
|
3274
|
+
import { settingsTransformersRegistry, styleTransformersRegistry as styleTransformersRegistry2 } from "@elementor/editor-canvas";
|
|
2932
3275
|
|
|
2933
3276
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
2934
|
-
import * as
|
|
3277
|
+
import * as React74 from "react";
|
|
2935
3278
|
import { ControlFormLabel as ControlFormLabel5, useBoundProp as useBoundProp5 } from "@elementor/editor-controls";
|
|
2936
3279
|
import { DatabaseIcon as DatabaseIcon2, SettingsIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
2937
3280
|
import {
|
|
2938
3281
|
bindPopover as bindPopover2,
|
|
2939
3282
|
bindTrigger as bindTrigger2,
|
|
2940
|
-
Box as
|
|
3283
|
+
Box as Box5,
|
|
2941
3284
|
Divider as Divider7,
|
|
2942
|
-
Grid as
|
|
2943
|
-
IconButton as
|
|
3285
|
+
Grid as Grid27,
|
|
3286
|
+
IconButton as IconButton4,
|
|
2944
3287
|
Paper,
|
|
2945
3288
|
Popover as Popover2,
|
|
2946
|
-
Stack as
|
|
3289
|
+
Stack as Stack20,
|
|
2947
3290
|
Tab as Tab2,
|
|
2948
3291
|
TabPanel as TabPanel2,
|
|
2949
3292
|
Tabs as Tabs2,
|
|
2950
|
-
Typography as
|
|
3293
|
+
Typography as Typography5,
|
|
2951
3294
|
UnstableTag as Tag,
|
|
2952
3295
|
usePopupState as usePopupState3,
|
|
2953
3296
|
useTabs as useTabs2
|
|
2954
3297
|
} from "@elementor/ui";
|
|
2955
|
-
import { __ as
|
|
3298
|
+
import { __ as __48 } from "@wordpress/i18n";
|
|
2956
3299
|
|
|
2957
3300
|
// src/components/popover-content.tsx
|
|
2958
|
-
import * as
|
|
2959
|
-
import { Stack as
|
|
2960
|
-
var PopoverContent = ({ alignItems, gap = 1.5, p, children }) => /* @__PURE__ */
|
|
3301
|
+
import * as React71 from "react";
|
|
3302
|
+
import { Stack as Stack18 } from "@elementor/ui";
|
|
3303
|
+
var PopoverContent = ({ alignItems, gap = 1.5, p, children }) => /* @__PURE__ */ React71.createElement(Stack18, { alignItems, gap, p }, children);
|
|
2961
3304
|
|
|
2962
3305
|
// src/hooks/use-persist-dynamic-value.ts
|
|
2963
3306
|
import { useSessionStorage as useSessionStorage2 } from "@elementor/session";
|
|
@@ -2968,14 +3311,14 @@ var usePersistDynamicValue = (propKey) => {
|
|
|
2968
3311
|
};
|
|
2969
3312
|
|
|
2970
3313
|
// src/dynamics/dynamic-control.tsx
|
|
2971
|
-
import * as
|
|
3314
|
+
import * as React72 from "react";
|
|
2972
3315
|
import { PropKeyProvider as PropKeyProvider3, PropProvider as PropProvider3, useBoundProp as useBoundProp3 } from "@elementor/editor-controls";
|
|
2973
3316
|
|
|
2974
3317
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2975
|
-
import { useMemo as
|
|
3318
|
+
import { useMemo as useMemo7 } from "react";
|
|
2976
3319
|
|
|
2977
3320
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
2978
|
-
import { useMemo as
|
|
3321
|
+
import { useMemo as useMemo6 } from "react";
|
|
2979
3322
|
import { useBoundProp as useBoundProp2 } from "@elementor/editor-controls";
|
|
2980
3323
|
|
|
2981
3324
|
// src/dynamics/sync/get-elementor-config.ts
|
|
@@ -3030,7 +3373,7 @@ var usePropDynamicTags = () => {
|
|
|
3030
3373
|
const propDynamicType = getDynamicPropType(propType);
|
|
3031
3374
|
categories = propDynamicType?.settings.categories || [];
|
|
3032
3375
|
}
|
|
3033
|
-
return
|
|
3376
|
+
return useMemo6(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
3034
3377
|
};
|
|
3035
3378
|
var getDynamicTagsByCategories = (categories) => {
|
|
3036
3379
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -3046,7 +3389,7 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
3046
3389
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
3047
3390
|
var useDynamicTag = (tagName) => {
|
|
3048
3391
|
const dynamicTags = usePropDynamicTags();
|
|
3049
|
-
return
|
|
3392
|
+
return useMemo7(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
3050
3393
|
};
|
|
3051
3394
|
|
|
3052
3395
|
// src/dynamics/dynamic-control.tsx
|
|
@@ -3070,30 +3413,30 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
3070
3413
|
});
|
|
3071
3414
|
};
|
|
3072
3415
|
const propType = createTopLevelOjectType({ schema: dynamicTag.props_schema });
|
|
3073
|
-
return /* @__PURE__ */
|
|
3416
|
+
return /* @__PURE__ */ React72.createElement(PropProvider3, { propType, setValue: setDynamicValue, value: { [bind]: dynamicValue } }, /* @__PURE__ */ React72.createElement(PropKeyProvider3, { bind }, children));
|
|
3074
3417
|
};
|
|
3075
3418
|
|
|
3076
3419
|
// src/dynamics/components/dynamic-selection.tsx
|
|
3077
|
-
import * as
|
|
3078
|
-
import { Fragment as Fragment9, useState as
|
|
3420
|
+
import * as React73 from "react";
|
|
3421
|
+
import { Fragment as Fragment9, useState as useState13 } from "react";
|
|
3079
3422
|
import { useBoundProp as useBoundProp4 } from "@elementor/editor-controls";
|
|
3080
3423
|
import { DatabaseIcon, SearchIcon } from "@elementor/icons";
|
|
3081
3424
|
import {
|
|
3082
|
-
Box as
|
|
3425
|
+
Box as Box4,
|
|
3083
3426
|
Divider as Divider6,
|
|
3084
3427
|
InputAdornment,
|
|
3085
3428
|
Link,
|
|
3086
3429
|
MenuItem,
|
|
3087
3430
|
MenuList,
|
|
3088
3431
|
MenuSubheader as MenuSubheader2,
|
|
3089
|
-
Stack as
|
|
3432
|
+
Stack as Stack19,
|
|
3090
3433
|
TextField as TextField2,
|
|
3091
|
-
Typography as
|
|
3434
|
+
Typography as Typography4
|
|
3092
3435
|
} from "@elementor/ui";
|
|
3093
|
-
import { __ as
|
|
3436
|
+
import { __ as __47 } from "@wordpress/i18n";
|
|
3094
3437
|
var SIZE3 = "tiny";
|
|
3095
3438
|
var DynamicSelection = ({ onSelect }) => {
|
|
3096
|
-
const [searchValue, setSearchValue] =
|
|
3439
|
+
const [searchValue, setSearchValue] = useState13("");
|
|
3097
3440
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
3098
3441
|
const { value: anyValue } = useBoundProp4();
|
|
3099
3442
|
const { bind, value: dynamicValue, setValue } = useBoundProp4(dynamicPropTypeUtil);
|
|
@@ -3111,19 +3454,19 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
3111
3454
|
setValue({ name: value, settings: { label } });
|
|
3112
3455
|
onSelect?.();
|
|
3113
3456
|
};
|
|
3114
|
-
return /* @__PURE__ */
|
|
3457
|
+
return /* @__PURE__ */ React73.createElement(Stack19, null, hasNoDynamicTags ? /* @__PURE__ */ React73.createElement(NoDynamicTags, null) : /* @__PURE__ */ React73.createElement(Fragment9, null, /* @__PURE__ */ React73.createElement(Box4, { px: 1.5, pb: 1 }, /* @__PURE__ */ React73.createElement(
|
|
3115
3458
|
TextField2,
|
|
3116
3459
|
{
|
|
3117
3460
|
fullWidth: true,
|
|
3118
3461
|
size: SIZE3,
|
|
3119
3462
|
value: searchValue,
|
|
3120
3463
|
onChange: handleSearch,
|
|
3121
|
-
placeholder:
|
|
3464
|
+
placeholder: __47("Search dynamic tags\u2026", "elementor"),
|
|
3122
3465
|
InputProps: {
|
|
3123
|
-
startAdornment: /* @__PURE__ */
|
|
3466
|
+
startAdornment: /* @__PURE__ */ React73.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React73.createElement(SearchIcon, { fontSize: SIZE3 }))
|
|
3124
3467
|
}
|
|
3125
3468
|
}
|
|
3126
|
-
)), /* @__PURE__ */
|
|
3469
|
+
)), /* @__PURE__ */ React73.createElement(Divider6, null), /* @__PURE__ */ React73.createElement(Box4, { sx: { overflowY: "auto", height: 260, width: 220 } }, options12.length > 0 ? /* @__PURE__ */ React73.createElement(MenuList, { role: "listbox", tabIndex: 0 }, options12.map(([category, items3], index) => /* @__PURE__ */ React73.createElement(Fragment9, { key: index }, /* @__PURE__ */ React73.createElement(
|
|
3127
3470
|
MenuSubheader2,
|
|
3128
3471
|
{
|
|
3129
3472
|
sx: { px: 1.5, typography: "caption", color: "text.tertiary" }
|
|
@@ -3131,7 +3474,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
3131
3474
|
dynamicGroups?.[category]?.title || category
|
|
3132
3475
|
), items3.map(({ value, label: tagLabel }) => {
|
|
3133
3476
|
const isSelected = isCurrentValueDynamic && value === dynamicValue?.name;
|
|
3134
|
-
return /* @__PURE__ */
|
|
3477
|
+
return /* @__PURE__ */ React73.createElement(
|
|
3135
3478
|
MenuItem,
|
|
3136
3479
|
{
|
|
3137
3480
|
key: value,
|
|
@@ -3142,10 +3485,10 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
3142
3485
|
},
|
|
3143
3486
|
tagLabel
|
|
3144
3487
|
);
|
|
3145
|
-
})))) : /* @__PURE__ */
|
|
3488
|
+
})))) : /* @__PURE__ */ React73.createElement(NoResults, { searchValue, onClear: () => setSearchValue("") }))));
|
|
3146
3489
|
};
|
|
3147
|
-
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */
|
|
3148
|
-
|
|
3490
|
+
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React73.createElement(
|
|
3491
|
+
Stack19,
|
|
3149
3492
|
{
|
|
3150
3493
|
gap: 1,
|
|
3151
3494
|
alignItems: "center",
|
|
@@ -3155,12 +3498,12 @@ var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React70.createElem
|
|
|
3155
3498
|
color: "text.secondary",
|
|
3156
3499
|
sx: { pb: 3.5 }
|
|
3157
3500
|
},
|
|
3158
|
-
/* @__PURE__ */
|
|
3159
|
-
/* @__PURE__ */
|
|
3160
|
-
/* @__PURE__ */
|
|
3501
|
+
/* @__PURE__ */ React73.createElement(DatabaseIcon, { fontSize: "large" }),
|
|
3502
|
+
/* @__PURE__ */ React73.createElement(Typography4, { align: "center", variant: "subtitle2" }, __47("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React73.createElement("br", null), "\u201C", searchValue, "\u201D."),
|
|
3503
|
+
/* @__PURE__ */ React73.createElement(Typography4, { align: "center", variant: "caption" }, __47("Try something else.", "elementor"), "\xA0", /* @__PURE__ */ React73.createElement(Link, { color: "text.secondary", variant: "caption", component: "button", onClick: onClear }, __47("Clear & try again", "elementor")))
|
|
3161
3504
|
);
|
|
3162
|
-
var NoDynamicTags = () => /* @__PURE__ */
|
|
3163
|
-
|
|
3505
|
+
var NoDynamicTags = () => /* @__PURE__ */ React73.createElement(Box4, { sx: { overflowY: "hidden", height: 297, width: 220 } }, /* @__PURE__ */ React73.createElement(Divider6, null), /* @__PURE__ */ React73.createElement(
|
|
3506
|
+
Stack19,
|
|
3164
3507
|
{
|
|
3165
3508
|
gap: 1,
|
|
3166
3509
|
alignItems: "center",
|
|
@@ -3170,9 +3513,9 @@ var NoDynamicTags = () => /* @__PURE__ */ React70.createElement(Box3, { sx: { ov
|
|
|
3170
3513
|
color: "text.secondary",
|
|
3171
3514
|
sx: { pb: 3.5 }
|
|
3172
3515
|
},
|
|
3173
|
-
/* @__PURE__ */
|
|
3174
|
-
/* @__PURE__ */
|
|
3175
|
-
/* @__PURE__ */
|
|
3516
|
+
/* @__PURE__ */ React73.createElement(DatabaseIcon, { fontSize: "large" }),
|
|
3517
|
+
/* @__PURE__ */ React73.createElement(Typography4, { align: "center", variant: "subtitle2" }, __47("Streamline your workflow with dynamic tags", "elementor")),
|
|
3518
|
+
/* @__PURE__ */ React73.createElement(Typography4, { align: "center", variant: "caption" }, __47("You\u2019ll need Elementor Pro to use this feature.", "elementor"))
|
|
3176
3519
|
));
|
|
3177
3520
|
var useFilteredOptions = (searchValue) => {
|
|
3178
3521
|
const dynamicTags = usePropDynamicTags();
|
|
@@ -3205,25 +3548,25 @@ var DynamicSelectionControl = () => {
|
|
|
3205
3548
|
if (!dynamicTag) {
|
|
3206
3549
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
3207
3550
|
}
|
|
3208
|
-
return /* @__PURE__ */
|
|
3551
|
+
return /* @__PURE__ */ React74.createElement(Box5, null, /* @__PURE__ */ React74.createElement(
|
|
3209
3552
|
Tag,
|
|
3210
3553
|
{
|
|
3211
3554
|
fullWidth: true,
|
|
3212
3555
|
showActionsOnHover: true,
|
|
3213
3556
|
label: dynamicTag.label,
|
|
3214
|
-
startIcon: /* @__PURE__ */
|
|
3557
|
+
startIcon: /* @__PURE__ */ React74.createElement(DatabaseIcon2, { fontSize: SIZE4 }),
|
|
3215
3558
|
...bindTrigger2(selectionPopoverState),
|
|
3216
|
-
actions: /* @__PURE__ */
|
|
3217
|
-
|
|
3559
|
+
actions: /* @__PURE__ */ React74.createElement(React74.Fragment, null, /* @__PURE__ */ React74.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React74.createElement(
|
|
3560
|
+
IconButton4,
|
|
3218
3561
|
{
|
|
3219
3562
|
size: SIZE4,
|
|
3220
3563
|
onClick: removeDynamicTag,
|
|
3221
|
-
"aria-label":
|
|
3564
|
+
"aria-label": __48("Remove dynamic value", "elementor")
|
|
3222
3565
|
},
|
|
3223
|
-
/* @__PURE__ */
|
|
3566
|
+
/* @__PURE__ */ React74.createElement(XIcon2, { fontSize: SIZE4 })
|
|
3224
3567
|
))
|
|
3225
3568
|
}
|
|
3226
|
-
), /* @__PURE__ */
|
|
3569
|
+
), /* @__PURE__ */ React74.createElement(
|
|
3227
3570
|
Popover2,
|
|
3228
3571
|
{
|
|
3229
3572
|
disablePortal: true,
|
|
@@ -3231,7 +3574,7 @@ var DynamicSelectionControl = () => {
|
|
|
3231
3574
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
3232
3575
|
...bindPopover2(selectionPopoverState)
|
|
3233
3576
|
},
|
|
3234
|
-
/* @__PURE__ */
|
|
3577
|
+
/* @__PURE__ */ React74.createElement(Stack20, null, /* @__PURE__ */ React74.createElement(Stack20, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React74.createElement(DatabaseIcon2, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React74.createElement(Typography5, { variant: "subtitle2" }, __48("Dynamic tags", "elementor")), /* @__PURE__ */ React74.createElement(IconButton4, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React74.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React74.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
3235
3578
|
));
|
|
3236
3579
|
};
|
|
3237
3580
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
@@ -3240,7 +3583,7 @@ var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
|
3240
3583
|
if (!hasDynamicSettings) {
|
|
3241
3584
|
return null;
|
|
3242
3585
|
}
|
|
3243
|
-
return /* @__PURE__ */
|
|
3586
|
+
return /* @__PURE__ */ React74.createElement(React74.Fragment, null, /* @__PURE__ */ React74.createElement(IconButton4, { size: SIZE4, ...bindTrigger2(popupState), "aria-label": __48("Settings", "elementor") }, /* @__PURE__ */ React74.createElement(SettingsIcon, { fontSize: SIZE4 })), /* @__PURE__ */ React74.createElement(
|
|
3244
3587
|
Popover2,
|
|
3245
3588
|
{
|
|
3246
3589
|
disablePortal: true,
|
|
@@ -3248,7 +3591,7 @@ var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
|
3248
3591
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
3249
3592
|
...bindPopover2(popupState)
|
|
3250
3593
|
},
|
|
3251
|
-
/* @__PURE__ */
|
|
3594
|
+
/* @__PURE__ */ React74.createElement(Paper, { component: Stack20, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React74.createElement(Stack20, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React74.createElement(DatabaseIcon2, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React74.createElement(Typography5, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React74.createElement(IconButton4, { sx: { ml: "auto" }, size: SIZE4, onClick: popupState.close }, /* @__PURE__ */ React74.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React74.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
3252
3595
|
));
|
|
3253
3596
|
};
|
|
3254
3597
|
var DynamicSettings = ({ controls }) => {
|
|
@@ -3257,10 +3600,10 @@ var DynamicSettings = ({ controls }) => {
|
|
|
3257
3600
|
if (!tabs.length) {
|
|
3258
3601
|
return null;
|
|
3259
3602
|
}
|
|
3260
|
-
return /* @__PURE__ */
|
|
3261
|
-
return /* @__PURE__ */
|
|
3603
|
+
return /* @__PURE__ */ React74.createElement(React74.Fragment, null, /* @__PURE__ */ React74.createElement(Tabs2, { size: "small", variant: "fullWidth", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React74.createElement(Tab2, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React74.createElement(Divider7, null), tabs.map(({ value }, index) => {
|
|
3604
|
+
return /* @__PURE__ */ React74.createElement(TabPanel2, { key: index, sx: { flexGrow: 1, py: 0 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React74.createElement(PopoverContent, { p: 2, gap: 2 }, value.items.map((item) => {
|
|
3262
3605
|
if (item.type === "control") {
|
|
3263
|
-
return /* @__PURE__ */
|
|
3606
|
+
return /* @__PURE__ */ React74.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
3264
3607
|
}
|
|
3265
3608
|
return null;
|
|
3266
3609
|
})));
|
|
@@ -3270,7 +3613,7 @@ var Control3 = ({ control }) => {
|
|
|
3270
3613
|
if (!getControlByType(control.type)) {
|
|
3271
3614
|
return null;
|
|
3272
3615
|
}
|
|
3273
|
-
return /* @__PURE__ */
|
|
3616
|
+
return /* @__PURE__ */ React74.createElement(DynamicControl, { bind: control.bind }, /* @__PURE__ */ React74.createElement(Grid27, { container: true, gap: 0.75 }, control.label ? /* @__PURE__ */ React74.createElement(Grid27, { item: true, xs: 12 }, /* @__PURE__ */ React74.createElement(ControlFormLabel5, null, control.label)) : null, /* @__PURE__ */ React74.createElement(Grid27, { item: true, xs: 12 }, /* @__PURE__ */ React74.createElement(Control, { type: control.type, props: control.props }))));
|
|
3274
3617
|
};
|
|
3275
3618
|
|
|
3276
3619
|
// src/dynamics/dynamic-transformer.ts
|
|
@@ -3323,18 +3666,18 @@ function getDynamicValue(name, settings) {
|
|
|
3323
3666
|
}
|
|
3324
3667
|
|
|
3325
3668
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
3326
|
-
import * as
|
|
3669
|
+
import * as React75 from "react";
|
|
3327
3670
|
import { useBoundProp as useBoundProp6 } from "@elementor/editor-controls";
|
|
3328
3671
|
import { DatabaseIcon as DatabaseIcon3 } from "@elementor/icons";
|
|
3329
|
-
import { __ as
|
|
3672
|
+
import { __ as __49 } from "@wordpress/i18n";
|
|
3330
3673
|
var usePropDynamicAction = () => {
|
|
3331
3674
|
const { propType } = useBoundProp6();
|
|
3332
3675
|
const visible = !!propType && supportsDynamic(propType);
|
|
3333
3676
|
return {
|
|
3334
3677
|
visible,
|
|
3335
3678
|
icon: DatabaseIcon3,
|
|
3336
|
-
title:
|
|
3337
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
3679
|
+
title: __49("Dynamic tags", "elementor"),
|
|
3680
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React75.createElement(DynamicSelection, { onSelect: closePopover })
|
|
3338
3681
|
};
|
|
3339
3682
|
};
|
|
3340
3683
|
|
|
@@ -3349,7 +3692,7 @@ var init = () => {
|
|
|
3349
3692
|
id: "dynamic-tags",
|
|
3350
3693
|
useProps: usePropDynamicAction
|
|
3351
3694
|
});
|
|
3352
|
-
|
|
3695
|
+
styleTransformersRegistry2.register("dynamic", dynamicTransformer);
|
|
3353
3696
|
settingsTransformersRegistry.register("dynamic", dynamicTransformer);
|
|
3354
3697
|
};
|
|
3355
3698
|
|