@elementor/editor-editing-panel 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/dist/index.js +652 -401
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +665 -409
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -6
- package/src/components/add-or-remove-content.tsx +2 -2
- package/src/components/css-class-selector.tsx +198 -51
- package/src/components/editable-field.tsx +158 -0
- package/src/components/editing-panel.tsx +17 -14
- package/src/components/multi-combobox.tsx +184 -0
- package/src/components/settings-tab.tsx +28 -25
- package/src/components/style-sections/border-section/border-field.tsx +14 -17
- package/src/components/style-sections/position-section/position-field.tsx +1 -0
- package/src/components/style-tab.tsx +32 -29
- package/src/controls-registry/create-top-level-object-type.ts +14 -0
- package/src/controls-registry/settings-field.tsx +12 -14
- package/src/controls-registry/styles-field.tsx +17 -5
- package/src/css-classes.ts +15 -7
- package/src/dynamics/components/dynamic-selection-control.tsx +1 -1
- package/src/dynamics/components/dynamic-selection.tsx +3 -4
- package/src/dynamics/dynamic-control.tsx +16 -11
- package/src/dynamics/hooks/use-dynamic-tag.ts +2 -3
- package/src/dynamics/hooks/use-prop-dynamic-action.tsx +1 -4
- package/src/dynamics/hooks/use-prop-dynamic-tags.ts +3 -6
- package/src/dynamics/utils.ts +1 -1
- package/src/hooks/use-styles-fields.ts +1 -0
- package/src/hooks/use-unapply-class.ts +25 -0
- package/src/components/multi-combobox/index.ts +0 -3
- package/src/components/multi-combobox/multi-combobox.tsx +0 -122
- package/src/components/multi-combobox/types.ts +0 -29
- package/src/components/multi-combobox/use-combobox-actions.ts +0 -62
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import { useBoundProp as
|
|
2
|
+
import { useBoundProp as useBoundProp6 } from "@elementor/editor-controls";
|
|
3
3
|
|
|
4
4
|
// src/control-replacement.tsx
|
|
5
5
|
import { createControlReplacement } from "@elementor/editor-controls";
|
|
@@ -129,7 +129,7 @@ import { __registerPanel as registerPanel } from "@elementor/editor-panels";
|
|
|
129
129
|
import { __privateBlockDataCommand as blockDataCommand } from "@elementor/editor-v1-adapters";
|
|
130
130
|
|
|
131
131
|
// src/hooks/use-close-editor-panel.ts
|
|
132
|
-
import { useEffect as
|
|
132
|
+
import { useEffect as useEffect4 } from "react";
|
|
133
133
|
import { getSelectedElements as getSelectedElements2, isElementInContainer } from "@elementor/editor-elements";
|
|
134
134
|
import { __privateListenTo as listenTo, commandStartEvent } from "@elementor/editor-v1-adapters";
|
|
135
135
|
|
|
@@ -137,10 +137,11 @@ import { __privateListenTo as listenTo, commandStartEvent } from "@elementor/edi
|
|
|
137
137
|
import { __createPanel as createPanel } from "@elementor/editor-panels";
|
|
138
138
|
|
|
139
139
|
// src/components/editing-panel.tsx
|
|
140
|
-
import * as
|
|
140
|
+
import * as React62 from "react";
|
|
141
141
|
import { ControlActionsProvider, ControlReplacementProvider } from "@elementor/editor-controls";
|
|
142
142
|
import { useSelectedElement } from "@elementor/editor-elements";
|
|
143
143
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
144
|
+
import { SessionStorageProvider as SessionStorageProvider3 } from "@elementor/session";
|
|
144
145
|
import { ErrorBoundary } from "@elementor/ui";
|
|
145
146
|
import { __ as __40 } from "@wordpress/i18n";
|
|
146
147
|
|
|
@@ -213,7 +214,7 @@ function EditorPanelErrorFallback() {
|
|
|
213
214
|
}
|
|
214
215
|
|
|
215
216
|
// src/components/editing-panel-tabs.tsx
|
|
216
|
-
import * as
|
|
217
|
+
import * as React61 from "react";
|
|
217
218
|
import { Fragment as Fragment7 } from "react";
|
|
218
219
|
import { Divider as Divider8, Stack as Stack19, Tab, TabPanel, Tabs, useTabs } from "@elementor/ui";
|
|
219
220
|
import { __ as __39 } from "@wordpress/i18n";
|
|
@@ -221,6 +222,7 @@ import { __ as __39 } from "@wordpress/i18n";
|
|
|
221
222
|
// src/components/settings-tab.tsx
|
|
222
223
|
import * as React12 from "react";
|
|
223
224
|
import { ControlLabel } from "@elementor/editor-controls";
|
|
225
|
+
import { SessionStorageProvider } from "@elementor/session";
|
|
224
226
|
|
|
225
227
|
// src/controls-registry/control.tsx
|
|
226
228
|
import * as React7 from "react";
|
|
@@ -290,22 +292,35 @@ var getGridLayout = (layout) => ({
|
|
|
290
292
|
|
|
291
293
|
// src/controls-registry/settings-field.tsx
|
|
292
294
|
import * as React9 from "react";
|
|
293
|
-
import {
|
|
295
|
+
import { PropKeyProvider, PropProvider } from "@elementor/editor-controls";
|
|
294
296
|
import { updateSettings, useElementSetting } from "@elementor/editor-elements";
|
|
297
|
+
|
|
298
|
+
// src/controls-registry/create-top-level-object-type.ts
|
|
299
|
+
var createTopLevelOjectType = ({ schema }) => {
|
|
300
|
+
const schemaPropType = {
|
|
301
|
+
key: "",
|
|
302
|
+
kind: "object",
|
|
303
|
+
meta: {},
|
|
304
|
+
settings: {},
|
|
305
|
+
default: null,
|
|
306
|
+
shape: schema
|
|
307
|
+
};
|
|
308
|
+
return schemaPropType;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
// src/controls-registry/settings-field.tsx
|
|
295
312
|
var SettingsField = ({ bind, children }) => {
|
|
296
313
|
const { element, elementType } = useElement();
|
|
297
|
-
const defaultValue = elementType.propsSchema[bind]?.default;
|
|
298
314
|
const settingsValue = useElementSetting(element.id, bind);
|
|
299
|
-
const value =
|
|
315
|
+
const value = { [bind]: settingsValue };
|
|
316
|
+
const propType = createTopLevelOjectType({ schema: elementType.propsSchema });
|
|
300
317
|
const setValue = (newValue) => {
|
|
301
318
|
updateSettings({
|
|
302
319
|
id: element.id,
|
|
303
|
-
props: {
|
|
304
|
-
[bind]: newValue
|
|
305
|
-
}
|
|
320
|
+
props: { ...newValue }
|
|
306
321
|
});
|
|
307
322
|
};
|
|
308
|
-
return /* @__PURE__ */ React9.createElement(
|
|
323
|
+
return /* @__PURE__ */ React9.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React9.createElement(PropKeyProvider, { bind }, children));
|
|
309
324
|
};
|
|
310
325
|
|
|
311
326
|
// src/components/section.tsx
|
|
@@ -352,8 +367,8 @@ function SectionsList(props) {
|
|
|
352
367
|
|
|
353
368
|
// src/components/settings-tab.tsx
|
|
354
369
|
var SettingsTab = () => {
|
|
355
|
-
const { elementType } = useElement();
|
|
356
|
-
return /* @__PURE__ */ React12.createElement(SectionsList, null, elementType.controls.map(({ type, value }, index) => {
|
|
370
|
+
const { elementType, element } = useElement();
|
|
371
|
+
return /* @__PURE__ */ React12.createElement(SessionStorageProvider, { prefix: element.id }, /* @__PURE__ */ React12.createElement(SectionsList, null, elementType.controls.map(({ type, value }, index) => {
|
|
357
372
|
if (type === "control") {
|
|
358
373
|
return /* @__PURE__ */ React12.createElement(Control2, { key: value.bind, control: value });
|
|
359
374
|
}
|
|
@@ -366,7 +381,7 @@ var SettingsTab = () => {
|
|
|
366
381
|
}));
|
|
367
382
|
}
|
|
368
383
|
return null;
|
|
369
|
-
}));
|
|
384
|
+
})));
|
|
370
385
|
};
|
|
371
386
|
var Control2 = ({ control }) => {
|
|
372
387
|
if (!getControlByType(control.type)) {
|
|
@@ -376,10 +391,11 @@ var Control2 = ({ control }) => {
|
|
|
376
391
|
};
|
|
377
392
|
|
|
378
393
|
// src/components/style-tab.tsx
|
|
379
|
-
import * as
|
|
380
|
-
import { useState as
|
|
394
|
+
import * as React60 from "react";
|
|
395
|
+
import { useState as useState9 } from "react";
|
|
381
396
|
import { useElementSetting as useElementSetting3, useElementStyles } from "@elementor/editor-elements";
|
|
382
397
|
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
398
|
+
import { SessionStorageProvider as SessionStorageProvider2 } from "@elementor/session";
|
|
383
399
|
import { Divider as Divider7 } from "@elementor/ui";
|
|
384
400
|
import { __ as __38 } from "@wordpress/i18n";
|
|
385
401
|
|
|
@@ -399,15 +415,20 @@ function useClassesProp() {
|
|
|
399
415
|
}
|
|
400
416
|
|
|
401
417
|
// src/components/css-class-selector.tsx
|
|
402
|
-
import * as
|
|
403
|
-
import { useId as
|
|
404
|
-
import { updateSettings as updateSettings2, useElementSetting as useElementSetting2 } from "@elementor/editor-elements";
|
|
418
|
+
import * as React17 from "react";
|
|
419
|
+
import { useId as useId4, useRef as useRef3 } from "react";
|
|
420
|
+
import { getElementSetting, updateSettings as updateSettings2, useElementSetting as useElementSetting2 } from "@elementor/editor-elements";
|
|
405
421
|
import { classesPropTypeUtil } from "@elementor/editor-props";
|
|
406
|
-
import {
|
|
422
|
+
import {
|
|
423
|
+
ELEMENTS_STYLES_PROVIDER_KEY,
|
|
424
|
+
stylesRepository,
|
|
425
|
+
useAllStylesByProvider,
|
|
426
|
+
useCreateActionsByProvider
|
|
427
|
+
} from "@elementor/editor-styles-repository";
|
|
407
428
|
import { DotsVerticalIcon } from "@elementor/icons";
|
|
408
429
|
import {
|
|
409
430
|
bindTrigger,
|
|
410
|
-
Chip
|
|
431
|
+
Chip,
|
|
411
432
|
Stack as Stack3,
|
|
412
433
|
Typography as Typography2,
|
|
413
434
|
UnstableChipGroup,
|
|
@@ -450,80 +471,136 @@ var Content = React14.forwardRef(({ maxWidth, ...tooltipProps }, ref) => /* @__P
|
|
|
450
471
|
}
|
|
451
472
|
));
|
|
452
473
|
|
|
453
|
-
// src/components/
|
|
474
|
+
// src/components/editable-field.tsx
|
|
454
475
|
import * as React15 from "react";
|
|
476
|
+
import { createContext as createContext5, useContext as useContext5, useEffect as useEffect2, useRef as useRef2, useState as useState3 } from "react";
|
|
477
|
+
import { Tooltip as Tooltip3 } from "@elementor/ui";
|
|
478
|
+
var Context4 = createContext5(null);
|
|
479
|
+
var EditableFieldProvider = ({
|
|
480
|
+
children,
|
|
481
|
+
value,
|
|
482
|
+
onSubmit,
|
|
483
|
+
validation,
|
|
484
|
+
editable
|
|
485
|
+
}) => {
|
|
486
|
+
const [isEditing, setIsEditing] = useState3(false);
|
|
487
|
+
const [submitting, setSubmitting] = useState3(false);
|
|
488
|
+
const [error, setError] = useState3(null);
|
|
489
|
+
const openEditMode = () => {
|
|
490
|
+
setIsEditing(true);
|
|
491
|
+
};
|
|
492
|
+
const closeEditMode = () => {
|
|
493
|
+
setError(null);
|
|
494
|
+
setIsEditing(false);
|
|
495
|
+
};
|
|
496
|
+
const submit = async (newValue) => {
|
|
497
|
+
if (!error) {
|
|
498
|
+
setSubmitting(true);
|
|
499
|
+
try {
|
|
500
|
+
await onSubmit(newValue);
|
|
501
|
+
} finally {
|
|
502
|
+
setSubmitting(false);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
closeEditMode();
|
|
506
|
+
};
|
|
507
|
+
const onChange = (event) => {
|
|
508
|
+
const { innerText: newValue } = event.target;
|
|
509
|
+
if (validation) {
|
|
510
|
+
setError(validation(newValue));
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
return /* @__PURE__ */ React15.createElement(
|
|
514
|
+
Context4.Provider,
|
|
515
|
+
{
|
|
516
|
+
value: {
|
|
517
|
+
isEditing,
|
|
518
|
+
openEditMode,
|
|
519
|
+
closeEditMode,
|
|
520
|
+
onChange,
|
|
521
|
+
value,
|
|
522
|
+
error,
|
|
523
|
+
submit,
|
|
524
|
+
editable,
|
|
525
|
+
submitting
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
children
|
|
529
|
+
);
|
|
530
|
+
};
|
|
531
|
+
var EditableField = ({ children, ...props }) => {
|
|
532
|
+
const ref = useRef2(null);
|
|
533
|
+
const { isEditing, closeEditMode, value, onChange, error, submit, editable } = useEditableField();
|
|
534
|
+
useEffect2(() => {
|
|
535
|
+
if (isEditing) {
|
|
536
|
+
ref.current?.focus();
|
|
537
|
+
selectAll();
|
|
538
|
+
}
|
|
539
|
+
}, [isEditing]);
|
|
540
|
+
const handleKeyDown = (event) => {
|
|
541
|
+
event.stopPropagation();
|
|
542
|
+
if (["Escape"].includes(event.key)) {
|
|
543
|
+
return closeEditMode();
|
|
544
|
+
}
|
|
545
|
+
if (["Enter"].includes(event.key)) {
|
|
546
|
+
event.preventDefault();
|
|
547
|
+
return submit(event.target.innerText);
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
const selectAll = () => {
|
|
551
|
+
const selection = getSelection();
|
|
552
|
+
if (!selection || !ref.current) {
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
const range = document.createRange();
|
|
556
|
+
range.selectNodeContents(ref.current);
|
|
557
|
+
selection.removeAllRanges();
|
|
558
|
+
selection.addRange(range);
|
|
559
|
+
};
|
|
560
|
+
if (!editable) {
|
|
561
|
+
return children;
|
|
562
|
+
}
|
|
563
|
+
return /* @__PURE__ */ React15.createElement(Tooltip3, { open: !!error, title: error, placement: "top" }, /* @__PURE__ */ React15.createElement("div", { onKeyDown: handleKeyDown, ...props }, /* @__PURE__ */ React15.createElement(
|
|
564
|
+
"span",
|
|
565
|
+
{
|
|
566
|
+
ref,
|
|
567
|
+
role: "textbox",
|
|
568
|
+
onInput: onChange,
|
|
569
|
+
contentEditable: isEditing,
|
|
570
|
+
suppressContentEditableWarning: true,
|
|
571
|
+
onBlur: closeEditMode
|
|
572
|
+
},
|
|
573
|
+
isEditing ? value : children
|
|
574
|
+
)));
|
|
575
|
+
};
|
|
576
|
+
var useEditableField = () => {
|
|
577
|
+
const contextValue = useContext5(Context4);
|
|
578
|
+
if (!contextValue) {
|
|
579
|
+
throw new Error("useEditableField must be used within a EditableFieldProvider");
|
|
580
|
+
}
|
|
581
|
+
return contextValue;
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
// src/components/multi-combobox.tsx
|
|
585
|
+
import * as React16 from "react";
|
|
586
|
+
import { useId as useId3, useState as useState4 } from "react";
|
|
455
587
|
import {
|
|
456
588
|
Autocomplete,
|
|
457
589
|
Box as Box5,
|
|
458
|
-
|
|
590
|
+
createFilterOptions,
|
|
459
591
|
styled as styled4,
|
|
460
592
|
TextField
|
|
461
593
|
} from "@elementor/ui";
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
import { createFilterOptions } from "@elementor/ui";
|
|
465
|
-
var useComboboxActions = (applied, actions, optionsLabel, onSelect) => ({
|
|
466
|
-
action: {
|
|
467
|
-
is: (opt) => typeof opt !== "string" && "action" in opt,
|
|
468
|
-
getLabel: (option) => option.action.getLabel(option.label),
|
|
469
|
-
groupBy: (option) => option.action.groupLabel,
|
|
470
|
-
onChange: ({ action, label }) => action?.apply(label),
|
|
471
|
-
getFilteredActions: (optionList, params) => {
|
|
472
|
-
const actionGroups = Object.values(actions);
|
|
473
|
-
return actionGroups.reduce((groups, group) => {
|
|
474
|
-
const actionOptions = group.actions.reduce((groupActions, action) => {
|
|
475
|
-
const shouldShowAction = action.condition(optionList, params.inputValue);
|
|
476
|
-
if (shouldShowAction) {
|
|
477
|
-
const actionOption = createActionOption(group.label, action, params.inputValue);
|
|
478
|
-
groupActions.unshift(actionOption);
|
|
479
|
-
}
|
|
480
|
-
return groupActions;
|
|
481
|
-
}, []);
|
|
482
|
-
return [...groups, ...actionOptions];
|
|
483
|
-
}, []);
|
|
484
|
-
}
|
|
485
|
-
},
|
|
486
|
-
option: {
|
|
487
|
-
is: (opt) => typeof opt !== "string" && !("action" in opt),
|
|
488
|
-
getLabel: (option) => option.label,
|
|
489
|
-
groupBy: () => optionsLabel ?? "",
|
|
490
|
-
onChange: (optionValues) => onSelect?.(optionValues),
|
|
491
|
-
getFilteredOptions: (optionList, params) => {
|
|
492
|
-
const appliedValues = applied.map((option) => option.value);
|
|
493
|
-
const optionsWithoutApplied = optionList.filter((option) => !appliedValues.includes(option.value));
|
|
494
|
-
return filter(optionsWithoutApplied, params);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
});
|
|
498
|
-
var filter = createFilterOptions();
|
|
499
|
-
var createActionOption = (groupLabel, action, inputValue) => ({
|
|
500
|
-
value: "",
|
|
501
|
-
label: inputValue,
|
|
502
|
-
action: {
|
|
503
|
-
groupLabel,
|
|
504
|
-
apply: action.apply,
|
|
505
|
-
getLabel: action.getLabel
|
|
506
|
-
}
|
|
507
|
-
});
|
|
508
|
-
|
|
509
|
-
// src/components/multi-combobox/multi-combobox.tsx
|
|
510
|
-
var MultiCombobox = ({
|
|
511
|
-
actions = {},
|
|
594
|
+
function MultiCombobox({
|
|
595
|
+
actions = [],
|
|
512
596
|
selected,
|
|
513
597
|
options: options10,
|
|
514
|
-
optionsLabel,
|
|
515
598
|
onSelect,
|
|
516
|
-
onCreate,
|
|
517
599
|
...props
|
|
518
|
-
})
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
// TODO: make the group mechanism more generic, allow passing list of groups.
|
|
523
|
-
optionsLabel,
|
|
524
|
-
onSelect
|
|
525
|
-
);
|
|
526
|
-
return /* @__PURE__ */ React15.createElement(
|
|
600
|
+
}) {
|
|
601
|
+
const filter = useFilterOptions();
|
|
602
|
+
const { run, loading } = useActionRunner();
|
|
603
|
+
return /* @__PURE__ */ React16.createElement(
|
|
527
604
|
Autocomplete,
|
|
528
605
|
{
|
|
529
606
|
...props,
|
|
@@ -533,57 +610,94 @@ var MultiCombobox = ({
|
|
|
533
610
|
selectOnFocus: true,
|
|
534
611
|
disableClearable: true,
|
|
535
612
|
handleHomeEndKeys: true,
|
|
613
|
+
disabled: loading,
|
|
536
614
|
value: selected,
|
|
537
615
|
options: options10,
|
|
538
|
-
renderGroup,
|
|
539
|
-
renderInput: (params) => /* @__PURE__ */
|
|
540
|
-
|
|
541
|
-
|
|
616
|
+
renderGroup: (params) => /* @__PURE__ */ React16.createElement(Group, { ...params }),
|
|
617
|
+
renderInput: (params) => /* @__PURE__ */ React16.createElement(TextField, { ...params }),
|
|
618
|
+
onChange: (_, selectedOrInputValue, reason) => {
|
|
619
|
+
const inputValue = selectedOrInputValue.find((option) => typeof option === "string");
|
|
620
|
+
const optionsAndActions = selectedOrInputValue.filter((option) => typeof option !== "string");
|
|
542
621
|
if (reason === "createOption") {
|
|
543
|
-
const
|
|
544
|
-
|
|
622
|
+
const [firstAction] = filterActions(actions, { options: options10, inputValue: inputValue ?? "" });
|
|
623
|
+
if (firstAction) {
|
|
624
|
+
return run(firstAction.apply, firstAction.value);
|
|
625
|
+
}
|
|
545
626
|
}
|
|
546
|
-
const action =
|
|
627
|
+
const action = optionsAndActions.find((value) => isAction(value));
|
|
547
628
|
if (reason === "selectOption" && action) {
|
|
548
|
-
return
|
|
629
|
+
return run(action.apply, action.value);
|
|
549
630
|
}
|
|
550
|
-
const
|
|
551
|
-
|
|
552
|
-
optionProps.onChange([.../* @__PURE__ */ new Set([...fixedValues, ...selectedValues])]);
|
|
631
|
+
const fixedValues = options10.filter((option) => !!option.fixed);
|
|
632
|
+
onSelect?.([.../* @__PURE__ */ new Set([...optionsAndActions, ...fixedValues])]);
|
|
553
633
|
},
|
|
554
|
-
getOptionLabel: (option) =>
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
if (actionProps.is(option)) {
|
|
559
|
-
return actionProps.getLabel(option);
|
|
634
|
+
getOptionLabel: (option) => typeof option === "string" ? option : option.label,
|
|
635
|
+
getOptionKey: (option) => {
|
|
636
|
+
if (typeof option === "string") {
|
|
637
|
+
return option;
|
|
560
638
|
}
|
|
561
|
-
return
|
|
639
|
+
return option.key ?? option.value;
|
|
562
640
|
},
|
|
563
641
|
filterOptions: (optionList, params) => {
|
|
564
|
-
const
|
|
565
|
-
|
|
566
|
-
|
|
642
|
+
const selectedValues = selected.map((option) => option.value);
|
|
643
|
+
return [
|
|
644
|
+
...filterActions(actions, { options: optionList, inputValue: params.inputValue }),
|
|
645
|
+
...filter(
|
|
646
|
+
optionList.filter((option) => !selectedValues.includes(option.value)),
|
|
647
|
+
params
|
|
648
|
+
)
|
|
649
|
+
];
|
|
567
650
|
},
|
|
568
|
-
groupBy: (option) =>
|
|
651
|
+
groupBy: (option) => option.group ?? ""
|
|
569
652
|
}
|
|
570
653
|
);
|
|
654
|
+
}
|
|
655
|
+
var Group = (params) => {
|
|
656
|
+
const id = `combobox-group-${useId3().replace(/:/g, "_")}`;
|
|
657
|
+
return /* @__PURE__ */ React16.createElement(StyledGroup, { role: "group", "aria-labelledby": id }, /* @__PURE__ */ React16.createElement(StyledGroupHeader, { id }, " ", params.group), /* @__PURE__ */ React16.createElement(StyledGroupItems, { role: "listbox" }, params.children));
|
|
571
658
|
};
|
|
572
|
-
var
|
|
573
|
-
var Group = styled4("li")`
|
|
659
|
+
var StyledGroup = styled4("li")`
|
|
574
660
|
&:not( :last-of-type ) {
|
|
575
661
|
border-bottom: 1px solid ${({ theme }) => theme.palette.divider};
|
|
576
662
|
}
|
|
577
663
|
`;
|
|
578
|
-
var
|
|
664
|
+
var StyledGroupHeader = styled4(Box5)(({ theme }) => ({
|
|
579
665
|
position: "sticky",
|
|
580
666
|
top: "-8px",
|
|
581
667
|
padding: theme.spacing(1, 2),
|
|
582
668
|
color: theme.palette.text.tertiary
|
|
583
669
|
}));
|
|
584
|
-
var
|
|
670
|
+
var StyledGroupItems = styled4("ul")`
|
|
585
671
|
padding: 0;
|
|
586
672
|
`;
|
|
673
|
+
function useFilterOptions() {
|
|
674
|
+
return useState4(() => createFilterOptions())[0];
|
|
675
|
+
}
|
|
676
|
+
function useActionRunner() {
|
|
677
|
+
const [loading, setLoading] = useState4(false);
|
|
678
|
+
const run = async (apply, value) => {
|
|
679
|
+
setLoading(true);
|
|
680
|
+
try {
|
|
681
|
+
await apply(value);
|
|
682
|
+
} catch {
|
|
683
|
+
}
|
|
684
|
+
setLoading(false);
|
|
685
|
+
};
|
|
686
|
+
return { run, loading };
|
|
687
|
+
}
|
|
688
|
+
function filterActions(actions, { options: options10, inputValue }) {
|
|
689
|
+
return actions.filter((action) => action.condition(options10, inputValue)).map((action, index) => ({
|
|
690
|
+
label: action.label(inputValue),
|
|
691
|
+
value: inputValue,
|
|
692
|
+
group: action.group,
|
|
693
|
+
apply: action.apply,
|
|
694
|
+
condition: action.condition,
|
|
695
|
+
key: index.toString()
|
|
696
|
+
}));
|
|
697
|
+
}
|
|
698
|
+
function isAction(option) {
|
|
699
|
+
return "apply" in option && "condition" in option;
|
|
700
|
+
}
|
|
587
701
|
|
|
588
702
|
// src/components/css-class-selector.tsx
|
|
589
703
|
var ID = "elementor-css-class-selector";
|
|
@@ -597,13 +711,14 @@ var EMPTY_OPTION = {
|
|
|
597
711
|
};
|
|
598
712
|
function CssClassSelector() {
|
|
599
713
|
const options10 = useOptions();
|
|
600
|
-
const
|
|
714
|
+
const { value: appliedIds, setValue: setAppliedIds, pushValue: pushAppliedId } = useAppliedClassesIds();
|
|
601
715
|
const { id: activeId, setId: setActiveId } = useStyle();
|
|
716
|
+
const actions = useCreateActions({ pushAppliedId, setActiveId });
|
|
602
717
|
const handleApply = useHandleApply(appliedIds, setAppliedIds);
|
|
603
718
|
const handleActivate = ({ value }) => setActiveId(value);
|
|
604
719
|
const applied = useAppliedOptions(options10, appliedIds);
|
|
605
720
|
const active = applied.find((option) => option.value === activeId) ?? EMPTY_OPTION;
|
|
606
|
-
return /* @__PURE__ */
|
|
721
|
+
return /* @__PURE__ */ React17.createElement(Stack3, { gap: 1, p: 2 }, /* @__PURE__ */ React17.createElement(Typography2, { component: "label", variant: "caption", htmlFor: ID }, __2("CSS Classes", "elementor")), /* @__PURE__ */ React17.createElement(
|
|
607
722
|
MultiCombobox,
|
|
608
723
|
{
|
|
609
724
|
id: ID,
|
|
@@ -612,73 +727,173 @@ function CssClassSelector() {
|
|
|
612
727
|
selected: applied,
|
|
613
728
|
onSelect: handleApply,
|
|
614
729
|
limitTags: TAGS_LIMIT,
|
|
615
|
-
|
|
730
|
+
actions,
|
|
731
|
+
getLimitTagsText: (more) => /* @__PURE__ */ React17.createElement(Chip, { size: "tiny", variant: "standard", label: `+${more}`, clickable: true }),
|
|
616
732
|
renderTags: (values, getTagProps) => values.map((value, index) => {
|
|
617
733
|
const chipProps = getTagProps({ index });
|
|
618
734
|
const isActive = value.value === active?.value;
|
|
619
|
-
|
|
620
|
-
|
|
735
|
+
const renameLabel = (newLabel) => {
|
|
736
|
+
return updateClassByProvider(value.provider, { label: newLabel, id: value.value });
|
|
737
|
+
};
|
|
738
|
+
return /* @__PURE__ */ React17.createElement(
|
|
739
|
+
EditableFieldProvider,
|
|
621
740
|
{
|
|
622
741
|
key: chipProps.key,
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
}
|
|
742
|
+
value: value.label,
|
|
743
|
+
onSubmit: renameLabel,
|
|
744
|
+
editable: value.provider !== ELEMENTS_STYLES_PROVIDER_KEY,
|
|
745
|
+
validation: (newLabel) => renameValidation(
|
|
746
|
+
newLabel,
|
|
747
|
+
options10.filter((option) => option.value !== value.value)
|
|
748
|
+
)
|
|
749
|
+
},
|
|
750
|
+
/* @__PURE__ */ React17.createElement(
|
|
751
|
+
CssClassItem,
|
|
752
|
+
{
|
|
753
|
+
label: value.label,
|
|
754
|
+
id: value.value,
|
|
755
|
+
isActive,
|
|
756
|
+
isGlobal: value.color === "global",
|
|
757
|
+
color: isActive && value.color ? value.color : "default",
|
|
758
|
+
chipProps,
|
|
759
|
+
onClickActive: () => handleActivate(value)
|
|
760
|
+
}
|
|
761
|
+
)
|
|
631
762
|
);
|
|
632
763
|
})
|
|
633
764
|
}
|
|
634
765
|
));
|
|
635
766
|
}
|
|
636
|
-
|
|
767
|
+
var CHIP_SIZE = "tiny";
|
|
768
|
+
function CssClassItem({
|
|
769
|
+
id,
|
|
770
|
+
label,
|
|
771
|
+
isActive,
|
|
772
|
+
isGlobal,
|
|
773
|
+
color: colorProp,
|
|
774
|
+
chipProps,
|
|
775
|
+
onClickActive
|
|
776
|
+
}) {
|
|
637
777
|
const { meta } = useStyle();
|
|
638
|
-
const popupId =
|
|
778
|
+
const popupId = useId4().replace(/:/g, "_");
|
|
639
779
|
const popupState = usePopupState2({ variant: "popover", popupId });
|
|
640
|
-
const chipRef =
|
|
780
|
+
const chipRef = useRef3(null);
|
|
641
781
|
const { onDelete, ...chipGroupProps } = chipProps;
|
|
642
|
-
|
|
643
|
-
|
|
782
|
+
const { isEditing, openEditMode, error, submitting } = useEditableField();
|
|
783
|
+
const color = error ? "error" : colorProp;
|
|
784
|
+
return /* @__PURE__ */ React17.createElement(CssClassItemProvider, { styleId: id, isActive, isGlobal }, /* @__PURE__ */ React17.createElement(UnstableChipGroup, { ref: chipRef, ...chipGroupProps, "aria-label": `Edit ${label}`, role: "group" }, /* @__PURE__ */ React17.createElement(
|
|
785
|
+
Chip,
|
|
644
786
|
{
|
|
645
|
-
|
|
646
|
-
size:
|
|
647
|
-
label: /* @__PURE__ */
|
|
787
|
+
disabled: submitting,
|
|
788
|
+
size: CHIP_SIZE,
|
|
789
|
+
label: /* @__PURE__ */ React17.createElement(
|
|
790
|
+
EditableField,
|
|
791
|
+
{
|
|
792
|
+
onDoubleClick: () => {
|
|
793
|
+
if (!isActive) {
|
|
794
|
+
openEditMode();
|
|
795
|
+
}
|
|
796
|
+
},
|
|
797
|
+
onClick: () => {
|
|
798
|
+
if (isActive) {
|
|
799
|
+
openEditMode();
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
},
|
|
803
|
+
/* @__PURE__ */ React17.createElement(ConditionalTooltipWrapper, { maxWidth: "10ch", title: label })
|
|
804
|
+
),
|
|
648
805
|
variant: isActive && !meta.state ? "filled" : "standard",
|
|
649
806
|
color,
|
|
650
807
|
onClick: () => onClickActive(id),
|
|
651
|
-
"aria-pressed": isActive
|
|
808
|
+
"aria-pressed": isActive,
|
|
809
|
+
sx: {
|
|
810
|
+
"&.Mui-focusVisible": {
|
|
811
|
+
boxShadow: "none !important"
|
|
812
|
+
}
|
|
813
|
+
}
|
|
652
814
|
}
|
|
653
|
-
), /* @__PURE__ */
|
|
654
|
-
|
|
815
|
+
), !isEditing && /* @__PURE__ */ React17.createElement(
|
|
816
|
+
Chip,
|
|
655
817
|
{
|
|
656
|
-
|
|
657
|
-
size:
|
|
658
|
-
label: /* @__PURE__ */
|
|
818
|
+
disabled: submitting,
|
|
819
|
+
size: CHIP_SIZE,
|
|
820
|
+
label: /* @__PURE__ */ React17.createElement(Stack3, { direction: "row", gap: 0.5, alignItems: "center" }, isActive && meta.state && /* @__PURE__ */ React17.createElement(Typography2, { variant: "inherit" }, meta.state), /* @__PURE__ */ React17.createElement(DotsVerticalIcon, { fontSize: "inherit" })),
|
|
659
821
|
variant: "filled",
|
|
660
822
|
color,
|
|
661
823
|
...bindTrigger(popupState),
|
|
662
824
|
"aria-label": __2("Open CSS Class Menu", "elementor")
|
|
663
825
|
}
|
|
664
|
-
)), /* @__PURE__ */
|
|
826
|
+
)), /* @__PURE__ */ React17.createElement(CssClassMenu, { popupState, containerRef: chipRef }));
|
|
665
827
|
}
|
|
828
|
+
var updateClassByProvider = (provider, data) => {
|
|
829
|
+
const providerInstance = stylesRepository.getProviderByKey(provider);
|
|
830
|
+
if (!providerInstance) {
|
|
831
|
+
return;
|
|
832
|
+
}
|
|
833
|
+
return providerInstance.actions.update?.(data);
|
|
834
|
+
};
|
|
835
|
+
var VALID_SELECTOR_REGEX = /^[a-zA-Z0-9_-]+$/;
|
|
836
|
+
var renameValidation = (newLabel, options10) => {
|
|
837
|
+
if (isNameExist(newLabel, options10)) {
|
|
838
|
+
return __2("Existing name", "elementor");
|
|
839
|
+
}
|
|
840
|
+
if (isCharactersNotSupported(newLabel)) {
|
|
841
|
+
return __2("Format is not valid", "elementor");
|
|
842
|
+
}
|
|
843
|
+
};
|
|
844
|
+
var isNameExist = (newLabel, options10) => {
|
|
845
|
+
if (!options10?.length) {
|
|
846
|
+
return false;
|
|
847
|
+
}
|
|
848
|
+
return options10.some((option) => option.label.toLowerCase() === newLabel.toLowerCase());
|
|
849
|
+
};
|
|
850
|
+
var isCharactersNotSupported = (newLabel) => !VALID_SELECTOR_REGEX.test(newLabel);
|
|
666
851
|
function useOptions() {
|
|
667
852
|
const { element } = useElement();
|
|
668
|
-
return useAllStylesByProvider({ elementId: element.id }).flatMap(
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
853
|
+
return useAllStylesByProvider({ elementId: element.id }).flatMap(
|
|
854
|
+
([provider, styleDefs]) => {
|
|
855
|
+
const isElements = provider.key === ELEMENTS_STYLES_PROVIDER_KEY;
|
|
856
|
+
if (isElements && styleDefs.length === 0) {
|
|
857
|
+
return [EMPTY_OPTION];
|
|
858
|
+
}
|
|
859
|
+
return styleDefs.map((styleDef) => {
|
|
860
|
+
return {
|
|
861
|
+
label: styleDef.label,
|
|
862
|
+
value: styleDef.id,
|
|
863
|
+
fixed: isElements,
|
|
864
|
+
color: isElements ? "primary" : "global",
|
|
865
|
+
provider: provider.key,
|
|
866
|
+
group: provider.labels?.plural
|
|
867
|
+
};
|
|
868
|
+
});
|
|
672
869
|
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
870
|
+
);
|
|
871
|
+
}
|
|
872
|
+
function useCreateActions({
|
|
873
|
+
pushAppliedId,
|
|
874
|
+
setActiveId
|
|
875
|
+
}) {
|
|
876
|
+
return useCreateActionsByProvider().map(([provider, create]) => {
|
|
877
|
+
return {
|
|
878
|
+
// translators: %s is the label of the new class.
|
|
879
|
+
label: (value) => __2('Create new "%s"', "elementor").replace("%s", value),
|
|
880
|
+
apply: async (value) => {
|
|
881
|
+
const created = await create({ label: value });
|
|
882
|
+
if (!created) {
|
|
883
|
+
return;
|
|
884
|
+
}
|
|
885
|
+
pushAppliedId(created.id);
|
|
886
|
+
setActiveId(created.id);
|
|
887
|
+
},
|
|
888
|
+
condition: (options10, inputValue) => {
|
|
889
|
+
const isUniqueLabel = !options10.some(
|
|
890
|
+
(option) => option.label.toLowerCase() === inputValue.toLowerCase()
|
|
891
|
+
);
|
|
892
|
+
return !!inputValue && isUniqueLabel;
|
|
893
|
+
},
|
|
894
|
+
// translators: %s is the singular label of css class provider (e.g "Global CSS Class").
|
|
895
|
+
group: __2("Create New %s", "elementor").replace("%s", provider.labels?.singular ?? "")
|
|
896
|
+
};
|
|
682
897
|
});
|
|
683
898
|
}
|
|
684
899
|
function useAppliedOptions(options10, appliedIds) {
|
|
@@ -703,7 +918,15 @@ function useAppliedClassesIds() {
|
|
|
703
918
|
}
|
|
704
919
|
});
|
|
705
920
|
};
|
|
706
|
-
|
|
921
|
+
const pushValue = (id) => {
|
|
922
|
+
const ids = getElementSetting(element.id, currentClassesProp)?.value || [];
|
|
923
|
+
setValue([...ids, id]);
|
|
924
|
+
};
|
|
925
|
+
return {
|
|
926
|
+
value,
|
|
927
|
+
setValue,
|
|
928
|
+
pushValue
|
|
929
|
+
};
|
|
707
930
|
}
|
|
708
931
|
function useHandleApply(appliedIds, setAppliedIds) {
|
|
709
932
|
const { id: activeId, setId: setActiveId } = useStyle();
|
|
@@ -727,12 +950,13 @@ function useHandleApply(appliedIds, setAppliedIds) {
|
|
|
727
950
|
}
|
|
728
951
|
|
|
729
952
|
// src/components/style-sections/background-section/background-section.tsx
|
|
730
|
-
import * as
|
|
953
|
+
import * as React19 from "react";
|
|
731
954
|
import { BackgroundControl } from "@elementor/editor-controls";
|
|
732
955
|
|
|
733
956
|
// src/controls-registry/styles-field.tsx
|
|
734
|
-
import * as
|
|
735
|
-
import {
|
|
957
|
+
import * as React18 from "react";
|
|
958
|
+
import { PropKeyProvider as PropKeyProvider2, PropProvider as PropProvider2 } from "@elementor/editor-controls";
|
|
959
|
+
import { getStylesSchema } from "@elementor/editor-styles";
|
|
736
960
|
|
|
737
961
|
// src/hooks/use-styles-fields.ts
|
|
738
962
|
import { updateStyle, useElementStyleProps } from "@elementor/editor-elements";
|
|
@@ -775,30 +999,36 @@ function useStylesField(propName) {
|
|
|
775
999
|
// src/controls-registry/styles-field.tsx
|
|
776
1000
|
var StylesField = ({ bind, children }) => {
|
|
777
1001
|
const [value, setValue] = useStylesField(bind);
|
|
778
|
-
|
|
1002
|
+
const stylesSchema = getStylesSchema();
|
|
1003
|
+
const propType = createTopLevelOjectType({ schema: stylesSchema });
|
|
1004
|
+
const values = { [bind]: value };
|
|
1005
|
+
const setValues = (newValue) => {
|
|
1006
|
+
setValue(newValue[bind]);
|
|
1007
|
+
};
|
|
1008
|
+
return /* @__PURE__ */ React18.createElement(PropProvider2, { propType, value: values, setValue: setValues }, /* @__PURE__ */ React18.createElement(PropKeyProvider2, { bind }, children));
|
|
779
1009
|
};
|
|
780
1010
|
|
|
781
1011
|
// src/components/style-sections/background-section/background-section.tsx
|
|
782
1012
|
var BackgroundSection = () => {
|
|
783
|
-
return /* @__PURE__ */
|
|
1013
|
+
return /* @__PURE__ */ React19.createElement(StylesField, { bind: "background" }, /* @__PURE__ */ React19.createElement(BackgroundControl, null));
|
|
784
1014
|
};
|
|
785
1015
|
|
|
786
1016
|
// src/components/style-sections/border-section/border-section.tsx
|
|
787
|
-
import * as
|
|
1017
|
+
import * as React26 from "react";
|
|
788
1018
|
import { Divider as Divider2, Stack as Stack5 } from "@elementor/ui";
|
|
789
1019
|
|
|
790
1020
|
// src/components/style-sections/border-section/border-field.tsx
|
|
791
|
-
import * as
|
|
1021
|
+
import * as React24 from "react";
|
|
792
1022
|
import { __ as __7 } from "@wordpress/i18n";
|
|
793
1023
|
|
|
794
1024
|
// src/components/add-or-remove-content.tsx
|
|
795
|
-
import * as
|
|
1025
|
+
import * as React20 from "react";
|
|
796
1026
|
import { ControlLabel as ControlLabel2 } from "@elementor/editor-controls";
|
|
797
1027
|
import { MinusIcon, PlusIcon } from "@elementor/icons";
|
|
798
1028
|
import { Collapse as Collapse2, IconButton as IconButton2, Stack as Stack4 } from "@elementor/ui";
|
|
799
1029
|
var SIZE2 = "tiny";
|
|
800
1030
|
var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
801
|
-
return /* @__PURE__ */
|
|
1031
|
+
return /* @__PURE__ */ React20.createElement(Stack4, { gap: 1.5 }, /* @__PURE__ */ React20.createElement(
|
|
802
1032
|
Stack4,
|
|
803
1033
|
{
|
|
804
1034
|
direction: "row",
|
|
@@ -807,22 +1037,22 @@ var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
|
807
1037
|
alignItems: "center"
|
|
808
1038
|
}
|
|
809
1039
|
},
|
|
810
|
-
/* @__PURE__ */
|
|
811
|
-
isAdded ? /* @__PURE__ */
|
|
812
|
-
), /* @__PURE__ */
|
|
1040
|
+
/* @__PURE__ */ React20.createElement(ControlLabel2, null, label),
|
|
1041
|
+
isAdded ? /* @__PURE__ */ React20.createElement(IconButton2, { size: SIZE2, onClick: onRemove, "aria-label": "Remove" }, /* @__PURE__ */ React20.createElement(MinusIcon, { fontSize: SIZE2 })) : /* @__PURE__ */ React20.createElement(IconButton2, { size: SIZE2, onClick: onAdd, "aria-label": "Add" }, /* @__PURE__ */ React20.createElement(PlusIcon, { fontSize: SIZE2 }))
|
|
1042
|
+
), /* @__PURE__ */ React20.createElement(Collapse2, { in: isAdded, unmountOnExit: true }, /* @__PURE__ */ React20.createElement(Stack4, { gap: 1.5 }, children)));
|
|
813
1043
|
};
|
|
814
1044
|
|
|
815
1045
|
// src/components/style-sections/border-section/border-color-field.tsx
|
|
816
|
-
import * as
|
|
1046
|
+
import * as React21 from "react";
|
|
817
1047
|
import { ColorControl, ControlLabel as ControlLabel3 } from "@elementor/editor-controls";
|
|
818
1048
|
import { Grid } from "@elementor/ui";
|
|
819
1049
|
import { __ as __4 } from "@wordpress/i18n";
|
|
820
1050
|
var BorderColorField = () => {
|
|
821
|
-
return /* @__PURE__ */
|
|
1051
|
+
return /* @__PURE__ */ React21.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React21.createElement(Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React21.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React21.createElement(ControlLabel3, null, __4("Border Color", "elementor"))), /* @__PURE__ */ React21.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React21.createElement(ColorControl, null))));
|
|
822
1052
|
};
|
|
823
1053
|
|
|
824
1054
|
// src/components/style-sections/border-section/border-style-field.tsx
|
|
825
|
-
import * as
|
|
1055
|
+
import * as React22 from "react";
|
|
826
1056
|
import { ControlLabel as ControlLabel4, SelectControl as SelectControl2 } from "@elementor/editor-controls";
|
|
827
1057
|
import { Grid as Grid2 } from "@elementor/ui";
|
|
828
1058
|
import { __ as __5 } from "@wordpress/i18n";
|
|
@@ -838,11 +1068,11 @@ var borderStyles = [
|
|
|
838
1068
|
{ value: "outset", label: __5("Outset", "elementor") }
|
|
839
1069
|
];
|
|
840
1070
|
var BorderStyleField = () => {
|
|
841
|
-
return /* @__PURE__ */
|
|
1071
|
+
return /* @__PURE__ */ React22.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React22.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React22.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React22.createElement(ControlLabel4, null, __5("Border Type", "elementor"))), /* @__PURE__ */ React22.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React22.createElement(SelectControl2, { options: borderStyles }))));
|
|
842
1072
|
};
|
|
843
1073
|
|
|
844
1074
|
// src/components/style-sections/border-section/border-width-field.tsx
|
|
845
|
-
import * as
|
|
1075
|
+
import * as React23 from "react";
|
|
846
1076
|
import { EqualUnequalSizesControl } from "@elementor/editor-controls";
|
|
847
1077
|
import { borderWidthPropTypeUtil } from "@elementor/editor-props";
|
|
848
1078
|
import { SideAllIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
@@ -850,61 +1080,57 @@ import { __ as __6 } from "@wordpress/i18n";
|
|
|
850
1080
|
var edges = [
|
|
851
1081
|
{
|
|
852
1082
|
label: __6("Top", "elementor"),
|
|
853
|
-
icon: /* @__PURE__ */
|
|
1083
|
+
icon: /* @__PURE__ */ React23.createElement(SideTopIcon, { fontSize: "tiny" }),
|
|
854
1084
|
bind: "top"
|
|
855
1085
|
},
|
|
856
1086
|
{
|
|
857
1087
|
label: __6("Right", "elementor"),
|
|
858
|
-
icon: /* @__PURE__ */
|
|
1088
|
+
icon: /* @__PURE__ */ React23.createElement(SideRightIcon, { fontSize: "tiny" }),
|
|
859
1089
|
bind: "right"
|
|
860
1090
|
},
|
|
861
1091
|
{
|
|
862
1092
|
label: __6("Bottom", "elementor"),
|
|
863
|
-
icon: /* @__PURE__ */
|
|
1093
|
+
icon: /* @__PURE__ */ React23.createElement(SideBottomIcon, { fontSize: "tiny" }),
|
|
864
1094
|
bind: "bottom"
|
|
865
1095
|
},
|
|
866
1096
|
{
|
|
867
1097
|
label: __6("Left", "elementor"),
|
|
868
|
-
icon: /* @__PURE__ */
|
|
1098
|
+
icon: /* @__PURE__ */ React23.createElement(SideLeftIcon, { fontSize: "tiny" }),
|
|
869
1099
|
bind: "left"
|
|
870
1100
|
}
|
|
871
1101
|
];
|
|
872
1102
|
var BorderWidthField = () => {
|
|
873
|
-
return /* @__PURE__ */
|
|
1103
|
+
return /* @__PURE__ */ React23.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React23.createElement(
|
|
874
1104
|
EqualUnequalSizesControl,
|
|
875
1105
|
{
|
|
876
1106
|
items: edges,
|
|
877
1107
|
label: __6("Border Width", "elementor"),
|
|
878
|
-
icon: /* @__PURE__ */
|
|
1108
|
+
icon: /* @__PURE__ */ React23.createElement(SideAllIcon, { fontSize: "tiny" }),
|
|
879
1109
|
multiSizePropTypeUtil: borderWidthPropTypeUtil
|
|
880
1110
|
}
|
|
881
1111
|
));
|
|
882
1112
|
};
|
|
883
1113
|
|
|
884
1114
|
// src/components/style-sections/border-section/border-field.tsx
|
|
885
|
-
var
|
|
886
|
-
|
|
887
|
-
$$type: "
|
|
888
|
-
|
|
1115
|
+
var initialBorder = {
|
|
1116
|
+
"border-width": { $$type: "size", value: { size: 1, unit: "px" } },
|
|
1117
|
+
"border-color": { $$type: "color", value: "#000000" },
|
|
1118
|
+
"border-style": { $$type: "string", value: "solid" }
|
|
889
1119
|
};
|
|
890
|
-
var initialBorderColor = { $$type: "color", value: "#000000" };
|
|
891
|
-
var initialBorderStyle = "solid";
|
|
892
1120
|
var BorderField = () => {
|
|
893
|
-
const [
|
|
894
|
-
const [borderColor, setBorderColor] = useStylesField("border-color");
|
|
895
|
-
const [borderStyle, setBorderStyle] = useStylesField("border-style");
|
|
1121
|
+
const [border, setBorder] = useStylesFields(Object.keys(initialBorder));
|
|
896
1122
|
const addBorder = () => {
|
|
897
|
-
|
|
898
|
-
setBorderColor(initialBorderColor);
|
|
899
|
-
setBorderStyle(initialBorderStyle);
|
|
1123
|
+
setBorder(initialBorder);
|
|
900
1124
|
};
|
|
901
1125
|
const removeBorder = () => {
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
1126
|
+
setBorder({
|
|
1127
|
+
"border-width": null,
|
|
1128
|
+
"border-color": null,
|
|
1129
|
+
"border-style": null
|
|
1130
|
+
});
|
|
905
1131
|
};
|
|
906
|
-
const hasBorder =
|
|
907
|
-
return /* @__PURE__ */
|
|
1132
|
+
const hasBorder = Object.values(border ?? {}).some(Boolean);
|
|
1133
|
+
return /* @__PURE__ */ React24.createElement(
|
|
908
1134
|
AddOrRemoveContent,
|
|
909
1135
|
{
|
|
910
1136
|
label: __7("Border", "elementor"),
|
|
@@ -912,14 +1138,14 @@ var BorderField = () => {
|
|
|
912
1138
|
onAdd: addBorder,
|
|
913
1139
|
onRemove: removeBorder
|
|
914
1140
|
},
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
1141
|
+
/* @__PURE__ */ React24.createElement(BorderWidthField, null),
|
|
1142
|
+
/* @__PURE__ */ React24.createElement(BorderColorField, null),
|
|
1143
|
+
/* @__PURE__ */ React24.createElement(BorderStyleField, null)
|
|
918
1144
|
);
|
|
919
1145
|
};
|
|
920
1146
|
|
|
921
1147
|
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
922
|
-
import * as
|
|
1148
|
+
import * as React25 from "react";
|
|
923
1149
|
import { EqualUnequalSizesControl as EqualUnequalSizesControl2 } from "@elementor/editor-controls";
|
|
924
1150
|
import { borderRadiusPropTypeUtil } from "@elementor/editor-props";
|
|
925
1151
|
import {
|
|
@@ -933,50 +1159,50 @@ import { __ as __8 } from "@wordpress/i18n";
|
|
|
933
1159
|
var corners = [
|
|
934
1160
|
{
|
|
935
1161
|
label: __8("Top Left", "elementor"),
|
|
936
|
-
icon: /* @__PURE__ */
|
|
1162
|
+
icon: /* @__PURE__ */ React25.createElement(RadiusTopLeftIcon, { fontSize: "tiny" }),
|
|
937
1163
|
bind: "top-left"
|
|
938
1164
|
},
|
|
939
1165
|
{
|
|
940
1166
|
label: __8("Top Right", "elementor"),
|
|
941
|
-
icon: /* @__PURE__ */
|
|
1167
|
+
icon: /* @__PURE__ */ React25.createElement(RadiusTopRightIcon, { fontSize: "tiny" }),
|
|
942
1168
|
bind: "top-right"
|
|
943
1169
|
},
|
|
944
1170
|
{
|
|
945
1171
|
label: __8("Bottom Right", "elementor"),
|
|
946
|
-
icon: /* @__PURE__ */
|
|
1172
|
+
icon: /* @__PURE__ */ React25.createElement(RadiusBottomRightIcon, { fontSize: "tiny" }),
|
|
947
1173
|
bind: "bottom-right"
|
|
948
1174
|
},
|
|
949
1175
|
{
|
|
950
1176
|
label: __8("Bottom Left", "elementor"),
|
|
951
|
-
icon: /* @__PURE__ */
|
|
1177
|
+
icon: /* @__PURE__ */ React25.createElement(RadiusBottomLeftIcon, { fontSize: "tiny" }),
|
|
952
1178
|
bind: "bottom-left"
|
|
953
1179
|
}
|
|
954
1180
|
];
|
|
955
1181
|
var BorderRadiusField = () => {
|
|
956
|
-
return /* @__PURE__ */
|
|
1182
|
+
return /* @__PURE__ */ React25.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React25.createElement(
|
|
957
1183
|
EqualUnequalSizesControl2,
|
|
958
1184
|
{
|
|
959
1185
|
items: corners,
|
|
960
1186
|
label: __8("Border Radius", "elementor"),
|
|
961
|
-
icon: /* @__PURE__ */
|
|
1187
|
+
icon: /* @__PURE__ */ React25.createElement(BorderCornersIcon, { fontSize: "tiny" }),
|
|
962
1188
|
multiSizePropTypeUtil: borderRadiusPropTypeUtil
|
|
963
1189
|
}
|
|
964
1190
|
));
|
|
965
1191
|
};
|
|
966
1192
|
|
|
967
1193
|
// src/components/style-sections/border-section/border-section.tsx
|
|
968
|
-
var BorderSection = () => /* @__PURE__ */
|
|
1194
|
+
var BorderSection = () => /* @__PURE__ */ React26.createElement(Stack5, { gap: 1.5 }, /* @__PURE__ */ React26.createElement(BorderRadiusField, null), /* @__PURE__ */ React26.createElement(Divider2, null), /* @__PURE__ */ React26.createElement(BorderField, null));
|
|
969
1195
|
|
|
970
1196
|
// src/components/style-sections/effects-section/effects-section.tsx
|
|
971
|
-
import * as
|
|
1197
|
+
import * as React27 from "react";
|
|
972
1198
|
import { BoxShadowRepeaterControl } from "@elementor/editor-controls";
|
|
973
1199
|
import { Stack as Stack6 } from "@elementor/ui";
|
|
974
1200
|
var EffectsSection = () => {
|
|
975
|
-
return /* @__PURE__ */
|
|
1201
|
+
return /* @__PURE__ */ React27.createElement(Stack6, { gap: 1.5 }, /* @__PURE__ */ React27.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React27.createElement(BoxShadowRepeaterControl, null)));
|
|
976
1202
|
};
|
|
977
1203
|
|
|
978
1204
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
979
|
-
import * as
|
|
1205
|
+
import * as React38 from "react";
|
|
980
1206
|
import { ControlLabel as ControlLabel13 } from "@elementor/editor-controls";
|
|
981
1207
|
import { useParentElement } from "@elementor/editor-elements";
|
|
982
1208
|
import { Divider as Divider3, Stack as Stack12 } from "@elementor/ui";
|
|
@@ -1008,7 +1234,7 @@ function useComputedStyle(elementId) {
|
|
|
1008
1234
|
}
|
|
1009
1235
|
|
|
1010
1236
|
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
1011
|
-
import * as
|
|
1237
|
+
import * as React29 from "react";
|
|
1012
1238
|
import { ControlLabel as ControlLabel5, ToggleControl } from "@elementor/editor-controls";
|
|
1013
1239
|
import {
|
|
1014
1240
|
LayoutAlignCenterIcon as CenterIcon,
|
|
@@ -1028,8 +1254,8 @@ function useDirection() {
|
|
|
1028
1254
|
}
|
|
1029
1255
|
|
|
1030
1256
|
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
1031
|
-
import * as
|
|
1032
|
-
import { useRef as
|
|
1257
|
+
import * as React28 from "react";
|
|
1258
|
+
import { useRef as useRef4 } from "react";
|
|
1033
1259
|
import { useTheme as useTheme2 } from "@elementor/ui";
|
|
1034
1260
|
var CLOCKWISE_ANGLES = {
|
|
1035
1261
|
row: 0,
|
|
@@ -1044,9 +1270,9 @@ var COUNTER_CLOCKWISE_ANGLES = {
|
|
|
1044
1270
|
"column-reverse": -270
|
|
1045
1271
|
};
|
|
1046
1272
|
var RotatedIcon = ({ icon: Icon, size, isClockwise = true, offset = 0 }) => {
|
|
1047
|
-
const rotate =
|
|
1273
|
+
const rotate = useRef4(useGetTargetAngle(isClockwise, offset));
|
|
1048
1274
|
rotate.current = useGetTargetAngle(isClockwise, offset, rotate);
|
|
1049
|
-
return /* @__PURE__ */
|
|
1275
|
+
return /* @__PURE__ */ React28.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
1050
1276
|
};
|
|
1051
1277
|
var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
1052
1278
|
const [direction] = useStylesField("flex-direction");
|
|
@@ -1071,35 +1297,35 @@ var options = [
|
|
|
1071
1297
|
{
|
|
1072
1298
|
value: "start",
|
|
1073
1299
|
label: __9("Start", "elementor"),
|
|
1074
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1300
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon, { icon: StartIcon, size, ...iconProps }),
|
|
1075
1301
|
showTooltip: true
|
|
1076
1302
|
},
|
|
1077
1303
|
{
|
|
1078
1304
|
value: "center",
|
|
1079
1305
|
label: __9("Center", "elementor"),
|
|
1080
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1306
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon, { icon: CenterIcon, size, ...iconProps }),
|
|
1081
1307
|
showTooltip: true
|
|
1082
1308
|
},
|
|
1083
1309
|
{
|
|
1084
1310
|
value: "end",
|
|
1085
1311
|
label: __9("End", "elementor"),
|
|
1086
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1312
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon, { icon: EndIcon, size, ...iconProps }),
|
|
1087
1313
|
showTooltip: true
|
|
1088
1314
|
},
|
|
1089
1315
|
{
|
|
1090
1316
|
value: "stretch",
|
|
1091
1317
|
label: __9("Stretch", "elementor"),
|
|
1092
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1318
|
+
renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon, { icon: JustifyIcon, size, ...iconProps }),
|
|
1093
1319
|
showTooltip: true
|
|
1094
1320
|
}
|
|
1095
1321
|
];
|
|
1096
1322
|
var AlignItemsField = () => {
|
|
1097
1323
|
const { isSiteRtl } = useDirection();
|
|
1098
|
-
return /* @__PURE__ */
|
|
1324
|
+
return /* @__PURE__ */ React29.createElement(DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React29.createElement(ThemeProvider, null, /* @__PURE__ */ React29.createElement(StylesField, { bind: "align-items" }, /* @__PURE__ */ React29.createElement(Grid3, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React29.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React29.createElement(ControlLabel5, null, __9("Align items", "elementor"))), /* @__PURE__ */ React29.createElement(Grid3, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React29.createElement(ToggleControl, { options }))))));
|
|
1099
1325
|
};
|
|
1100
1326
|
|
|
1101
1327
|
// src/components/style-sections/layout-section/align-self-child-field.tsx
|
|
1102
|
-
import * as
|
|
1328
|
+
import * as React30 from "react";
|
|
1103
1329
|
import { ControlLabel as ControlLabel6, ToggleControl as ToggleControl2 } from "@elementor/editor-controls";
|
|
1104
1330
|
import {
|
|
1105
1331
|
LayoutAlignCenterIcon as CenterIcon2,
|
|
@@ -1119,35 +1345,35 @@ var options2 = [
|
|
|
1119
1345
|
{
|
|
1120
1346
|
value: "start",
|
|
1121
1347
|
label: __10("Start", "elementor"),
|
|
1122
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1348
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(RotatedIcon, { icon: StartIcon2, size, ...iconProps2 }),
|
|
1123
1349
|
showTooltip: true
|
|
1124
1350
|
},
|
|
1125
1351
|
{
|
|
1126
1352
|
value: "center",
|
|
1127
1353
|
label: __10("Center", "elementor"),
|
|
1128
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1354
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(RotatedIcon, { icon: CenterIcon2, size, ...iconProps2 }),
|
|
1129
1355
|
showTooltip: true
|
|
1130
1356
|
},
|
|
1131
1357
|
{
|
|
1132
1358
|
value: "end",
|
|
1133
1359
|
label: __10("End", "elementor"),
|
|
1134
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1360
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(RotatedIcon, { icon: EndIcon2, size, ...iconProps2 }),
|
|
1135
1361
|
showTooltip: true
|
|
1136
1362
|
},
|
|
1137
1363
|
{
|
|
1138
1364
|
value: "stretch",
|
|
1139
1365
|
label: __10("Stretch", "elementor"),
|
|
1140
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1366
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(RotatedIcon, { icon: JustifyIcon2, size, ...iconProps2 }),
|
|
1141
1367
|
showTooltip: true
|
|
1142
1368
|
}
|
|
1143
1369
|
];
|
|
1144
1370
|
var AlignSelfChild = () => {
|
|
1145
1371
|
const { isSiteRtl } = useDirection();
|
|
1146
|
-
return /* @__PURE__ */
|
|
1372
|
+
return /* @__PURE__ */ React30.createElement(DirectionProvider2, { rtl: isSiteRtl }, /* @__PURE__ */ React30.createElement(ThemeProvider2, null, /* @__PURE__ */ React30.createElement(StylesField, { bind: "align-self" }, /* @__PURE__ */ React30.createElement(Grid4, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel6, null, __10("Align self", "elementor"))), /* @__PURE__ */ React30.createElement(Grid4, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React30.createElement(ToggleControl2, { options: options2 }))))));
|
|
1147
1373
|
};
|
|
1148
1374
|
|
|
1149
1375
|
// src/components/style-sections/layout-section/display-field.tsx
|
|
1150
|
-
import * as
|
|
1376
|
+
import * as React31 from "react";
|
|
1151
1377
|
import { ControlLabel as ControlLabel7, ToggleControl as ToggleControl3 } from "@elementor/editor-controls";
|
|
1152
1378
|
import { Stack as Stack7 } from "@elementor/ui";
|
|
1153
1379
|
import { __ as __11 } from "@wordpress/i18n";
|
|
@@ -1164,11 +1390,11 @@ var DisplayField = () => {
|
|
|
1164
1390
|
label: __11("Flex", "elementor")
|
|
1165
1391
|
}
|
|
1166
1392
|
];
|
|
1167
|
-
return /* @__PURE__ */
|
|
1393
|
+
return /* @__PURE__ */ React31.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React31.createElement(Stack7, { gap: 1 }, /* @__PURE__ */ React31.createElement(ControlLabel7, null, __11("Display", "elementor")), /* @__PURE__ */ React31.createElement(ToggleControl3, { options: options10, fullWidth: true })));
|
|
1168
1394
|
};
|
|
1169
1395
|
|
|
1170
1396
|
// src/components/style-sections/layout-section/flex-direction-field.tsx
|
|
1171
|
-
import * as
|
|
1397
|
+
import * as React32 from "react";
|
|
1172
1398
|
import { ControlLabel as ControlLabel8, ToggleControl as ToggleControl4 } from "@elementor/editor-controls";
|
|
1173
1399
|
import { ArrowDownSmallIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpSmallIcon } from "@elementor/icons";
|
|
1174
1400
|
import { DirectionProvider as DirectionProvider3, Grid as Grid5, ThemeProvider as ThemeProvider3, withDirection as withDirection3 } from "@elementor/ui";
|
|
@@ -1179,14 +1405,14 @@ var options3 = [
|
|
|
1179
1405
|
label: __12("Row", "elementor"),
|
|
1180
1406
|
renderContent: ({ size }) => {
|
|
1181
1407
|
const StartIcon4 = withDirection3(ArrowRightIcon);
|
|
1182
|
-
return /* @__PURE__ */
|
|
1408
|
+
return /* @__PURE__ */ React32.createElement(StartIcon4, { fontSize: size });
|
|
1183
1409
|
},
|
|
1184
1410
|
showTooltip: true
|
|
1185
1411
|
},
|
|
1186
1412
|
{
|
|
1187
1413
|
value: "column",
|
|
1188
1414
|
label: __12("Column", "elementor"),
|
|
1189
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1415
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(ArrowDownSmallIcon, { fontSize: size }),
|
|
1190
1416
|
showTooltip: true
|
|
1191
1417
|
},
|
|
1192
1418
|
{
|
|
@@ -1194,25 +1420,25 @@ var options3 = [
|
|
|
1194
1420
|
label: __12("Reversed row", "elementor"),
|
|
1195
1421
|
renderContent: ({ size }) => {
|
|
1196
1422
|
const EndIcon4 = withDirection3(ArrowLeftIcon);
|
|
1197
|
-
return /* @__PURE__ */
|
|
1423
|
+
return /* @__PURE__ */ React32.createElement(EndIcon4, { fontSize: size });
|
|
1198
1424
|
},
|
|
1199
1425
|
showTooltip: true
|
|
1200
1426
|
},
|
|
1201
1427
|
{
|
|
1202
1428
|
value: "column-reverse",
|
|
1203
1429
|
label: __12("Reversed column", "elementor"),
|
|
1204
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1430
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(ArrowUpSmallIcon, { fontSize: size }),
|
|
1205
1431
|
showTooltip: true
|
|
1206
1432
|
}
|
|
1207
1433
|
];
|
|
1208
1434
|
var FlexDirectionField = () => {
|
|
1209
1435
|
const { isSiteRtl } = useDirection();
|
|
1210
|
-
return /* @__PURE__ */
|
|
1436
|
+
return /* @__PURE__ */ React32.createElement(DirectionProvider3, { rtl: isSiteRtl }, /* @__PURE__ */ React32.createElement(ThemeProvider3, null, /* @__PURE__ */ React32.createElement(StylesField, { bind: "flex-direction" }, /* @__PURE__ */ React32.createElement(Grid5, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel8, null, __12("Direction", "elementor"))), /* @__PURE__ */ React32.createElement(Grid5, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(ToggleControl4, { options: options3 }))))));
|
|
1211
1437
|
};
|
|
1212
1438
|
|
|
1213
1439
|
// src/components/style-sections/layout-section/flex-order-field.tsx
|
|
1214
|
-
import * as
|
|
1215
|
-
import { useState as
|
|
1440
|
+
import * as React33 from "react";
|
|
1441
|
+
import { useState as useState5 } from "react";
|
|
1216
1442
|
import {
|
|
1217
1443
|
ControlLabel as ControlLabel9,
|
|
1218
1444
|
ControlToggleButtonGroup,
|
|
@@ -1234,25 +1460,25 @@ var items = [
|
|
|
1234
1460
|
{
|
|
1235
1461
|
value: FIRST,
|
|
1236
1462
|
label: __13("First", "elementor"),
|
|
1237
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1463
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(ArrowUpSmallIcon2, { fontSize: size }),
|
|
1238
1464
|
showTooltip: true
|
|
1239
1465
|
},
|
|
1240
1466
|
{
|
|
1241
1467
|
value: LAST,
|
|
1242
1468
|
label: __13("Last", "elementor"),
|
|
1243
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1469
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(ArrowDownSmallIcon2, { fontSize: size }),
|
|
1244
1470
|
showTooltip: true
|
|
1245
1471
|
},
|
|
1246
1472
|
{
|
|
1247
1473
|
value: CUSTOM,
|
|
1248
1474
|
label: __13("Custom", "elementor"),
|
|
1249
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1475
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(PencilIcon, { fontSize: size }),
|
|
1250
1476
|
showTooltip: true
|
|
1251
1477
|
}
|
|
1252
1478
|
];
|
|
1253
1479
|
var FlexOrderField = () => {
|
|
1254
1480
|
const { isSiteRtl } = useDirection(), [order, setOrder] = useStylesField("order");
|
|
1255
|
-
const [groupControlValue, setGroupControlValue] =
|
|
1481
|
+
const [groupControlValue, setGroupControlValue] = useState5(getGroupControlValue(order?.value || null));
|
|
1256
1482
|
const handleToggleButtonChange = (group) => {
|
|
1257
1483
|
setGroupControlValue(group);
|
|
1258
1484
|
if (!group || group === CUSTOM) {
|
|
@@ -1261,7 +1487,7 @@ var FlexOrderField = () => {
|
|
|
1261
1487
|
}
|
|
1262
1488
|
setOrder({ $$type: "number", value: orderValueMap[group] });
|
|
1263
1489
|
};
|
|
1264
|
-
return /* @__PURE__ */
|
|
1490
|
+
return /* @__PURE__ */ React33.createElement(DirectionProvider4, { rtl: isSiteRtl }, /* @__PURE__ */ React33.createElement(ThemeProvider4, null, /* @__PURE__ */ React33.createElement(Stack8, { gap: 2 }, /* @__PURE__ */ React33.createElement(Grid6, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(ControlLabel9, null, __13("Order", "elementor"))), /* @__PURE__ */ React33.createElement(Grid6, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React33.createElement(
|
|
1265
1491
|
ControlToggleButtonGroup,
|
|
1266
1492
|
{
|
|
1267
1493
|
items,
|
|
@@ -1269,7 +1495,7 @@ var FlexOrderField = () => {
|
|
|
1269
1495
|
onChange: handleToggleButtonChange,
|
|
1270
1496
|
exclusive: true
|
|
1271
1497
|
}
|
|
1272
|
-
))), CUSTOM === groupControlValue && /* @__PURE__ */
|
|
1498
|
+
))), CUSTOM === groupControlValue && /* @__PURE__ */ React33.createElement(StylesField, { bind: "order" }, /* @__PURE__ */ React33.createElement(Grid6, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(ControlLabel9, null, __13("Custom order", "elementor"))), /* @__PURE__ */ React33.createElement(Grid6, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React33.createElement(
|
|
1273
1499
|
NumberControl,
|
|
1274
1500
|
{
|
|
1275
1501
|
min: FIRST_DEFAULT_VALUE + 1,
|
|
@@ -1289,7 +1515,7 @@ var getGroupControlValue = (order) => {
|
|
|
1289
1515
|
};
|
|
1290
1516
|
|
|
1291
1517
|
// src/components/style-sections/layout-section/flex-size-field.tsx
|
|
1292
|
-
import * as
|
|
1518
|
+
import * as React34 from "react";
|
|
1293
1519
|
import {
|
|
1294
1520
|
ControlLabel as ControlLabel10,
|
|
1295
1521
|
ControlToggleButtonGroup as ControlToggleButtonGroup2,
|
|
@@ -1304,26 +1530,26 @@ var items2 = [
|
|
|
1304
1530
|
{
|
|
1305
1531
|
value: "flex-grow",
|
|
1306
1532
|
label: __14("Grow", "elementor"),
|
|
1307
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1533
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(ExpandIcon, { fontSize: size }),
|
|
1308
1534
|
showTooltip: true
|
|
1309
1535
|
},
|
|
1310
1536
|
{
|
|
1311
1537
|
value: "flex-shrink",
|
|
1312
1538
|
label: __14("Shrink", "elementor"),
|
|
1313
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1539
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(ShrinkIcon, { fontSize: size }),
|
|
1314
1540
|
showTooltip: true
|
|
1315
1541
|
},
|
|
1316
1542
|
{
|
|
1317
1543
|
value: "custom",
|
|
1318
1544
|
label: __14("Custom", "elementor"),
|
|
1319
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1545
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(PencilIcon2, { fontSize: size }),
|
|
1320
1546
|
showTooltip: true
|
|
1321
1547
|
}
|
|
1322
1548
|
];
|
|
1323
1549
|
var FlexSizeField = () => {
|
|
1324
1550
|
const { isSiteRtl } = useDirection(), [growField, setGrowField] = useStylesField("flex-grow"), [shrinkField, setShrinkField] = useStylesField("flex-shrink"), [basisField, setBasisField] = useStylesField("flex-basis");
|
|
1325
1551
|
const grow = growField?.value || null, shrink = shrinkField?.value || null, basis = basisField?.value || null;
|
|
1326
|
-
const currentGroup =
|
|
1552
|
+
const currentGroup = React34.useMemo(() => getActiveGroup({ grow, shrink, basis }), [grow, shrink, basis]), [activeGroup, setActiveGroup] = React34.useState(currentGroup);
|
|
1327
1553
|
const onChangeGroup = (group = null) => {
|
|
1328
1554
|
setActiveGroup(group);
|
|
1329
1555
|
setBasisField(null);
|
|
@@ -1340,7 +1566,7 @@ var FlexSizeField = () => {
|
|
|
1340
1566
|
setGrowField(null);
|
|
1341
1567
|
setShrinkField({ $$type: "number", value: DEFAULT });
|
|
1342
1568
|
};
|
|
1343
|
-
return /* @__PURE__ */
|
|
1569
|
+
return /* @__PURE__ */ React34.createElement(DirectionProvider5, { rtl: isSiteRtl }, /* @__PURE__ */ React34.createElement(ThemeProvider5, null, /* @__PURE__ */ React34.createElement(Stack9, { gap: 2 }, /* @__PURE__ */ React34.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React34.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(ControlLabel10, null, __14("Size", "elementor"))), /* @__PURE__ */ React34.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React34.createElement(
|
|
1344
1570
|
ControlToggleButtonGroup2,
|
|
1345
1571
|
{
|
|
1346
1572
|
value: activeGroup,
|
|
@@ -1348,9 +1574,9 @@ var FlexSizeField = () => {
|
|
|
1348
1574
|
items: items2,
|
|
1349
1575
|
exclusive: true
|
|
1350
1576
|
}
|
|
1351
|
-
))), "custom" === activeGroup && /* @__PURE__ */
|
|
1577
|
+
))), "custom" === activeGroup && /* @__PURE__ */ React34.createElement(FlexCustomField, null))));
|
|
1352
1578
|
};
|
|
1353
|
-
var FlexCustomField = () => /* @__PURE__ */
|
|
1579
|
+
var FlexCustomField = () => /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(StylesField, { bind: "flex-grow" }, /* @__PURE__ */ React34.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React34.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(ControlLabel10, null, __14("Grow", "elementor"))), /* @__PURE__ */ React34.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React34.createElement(NumberControl2, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React34.createElement(StylesField, { bind: "flex-shrink" }, /* @__PURE__ */ React34.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React34.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(ControlLabel10, null, __14("Shrink", "elementor"))), /* @__PURE__ */ React34.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React34.createElement(NumberControl2, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React34.createElement(StylesField, { bind: "flex-basis" }, /* @__PURE__ */ React34.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React34.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(ControlLabel10, null, __14("Basis", "elementor"))), /* @__PURE__ */ React34.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React34.createElement(SizeControl2, null)))));
|
|
1354
1580
|
var getActiveGroup = ({
|
|
1355
1581
|
grow,
|
|
1356
1582
|
shrink,
|
|
@@ -1372,16 +1598,16 @@ var getActiveGroup = ({
|
|
|
1372
1598
|
};
|
|
1373
1599
|
|
|
1374
1600
|
// src/components/style-sections/layout-section/gap-control-field.tsx
|
|
1375
|
-
import * as
|
|
1601
|
+
import * as React35 from "react";
|
|
1376
1602
|
import { GapControl } from "@elementor/editor-controls";
|
|
1377
1603
|
import { Stack as Stack10 } from "@elementor/ui";
|
|
1378
1604
|
import { __ as __15 } from "@wordpress/i18n";
|
|
1379
1605
|
var GapControlField = () => {
|
|
1380
|
-
return /* @__PURE__ */
|
|
1606
|
+
return /* @__PURE__ */ React35.createElement(Stack10, { gap: 1 }, /* @__PURE__ */ React35.createElement(StylesField, { bind: "gap" }, /* @__PURE__ */ React35.createElement(GapControl, { label: __15("Gaps", "elementor") })));
|
|
1381
1607
|
};
|
|
1382
1608
|
|
|
1383
1609
|
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
1384
|
-
import * as
|
|
1610
|
+
import * as React36 from "react";
|
|
1385
1611
|
import { ControlLabel as ControlLabel11, ToggleControl as ToggleControl5 } from "@elementor/editor-controls";
|
|
1386
1612
|
import {
|
|
1387
1613
|
JustifyBottomIcon,
|
|
@@ -1403,47 +1629,47 @@ var options4 = [
|
|
|
1403
1629
|
{
|
|
1404
1630
|
value: "start",
|
|
1405
1631
|
label: __16("Start", "elementor"),
|
|
1406
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1632
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(RotatedIcon, { icon: StartIcon3, size, ...iconProps3 }),
|
|
1407
1633
|
showTooltip: true
|
|
1408
1634
|
},
|
|
1409
1635
|
{
|
|
1410
1636
|
value: "center",
|
|
1411
1637
|
label: __16("Center", "elementor"),
|
|
1412
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1638
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(RotatedIcon, { icon: CenterIcon3, size, ...iconProps3 }),
|
|
1413
1639
|
showTooltip: true
|
|
1414
1640
|
},
|
|
1415
1641
|
{
|
|
1416
1642
|
value: "end",
|
|
1417
1643
|
label: __16("End", "elementor"),
|
|
1418
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1644
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(RotatedIcon, { icon: EndIcon3, size, ...iconProps3 }),
|
|
1419
1645
|
showTooltip: true
|
|
1420
1646
|
},
|
|
1421
1647
|
{
|
|
1422
1648
|
value: "space-between",
|
|
1423
1649
|
label: __16("Space between", "elementor"),
|
|
1424
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1650
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(RotatedIcon, { icon: BetweenIcon, size, ...iconProps3 }),
|
|
1425
1651
|
showTooltip: true
|
|
1426
1652
|
},
|
|
1427
1653
|
{
|
|
1428
1654
|
value: "space-around",
|
|
1429
1655
|
label: __16("Space around", "elementor"),
|
|
1430
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1656
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(RotatedIcon, { icon: AroundIcon, size, ...iconProps3 }),
|
|
1431
1657
|
showTooltip: true
|
|
1432
1658
|
},
|
|
1433
1659
|
{
|
|
1434
1660
|
value: "space-evenly",
|
|
1435
1661
|
label: __16("Space evenly", "elementor"),
|
|
1436
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1662
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(RotatedIcon, { icon: EvenlyIcon, size, ...iconProps3 }),
|
|
1437
1663
|
showTooltip: true
|
|
1438
1664
|
}
|
|
1439
1665
|
];
|
|
1440
1666
|
var JustifyContentField = () => {
|
|
1441
1667
|
const { isSiteRtl } = useDirection();
|
|
1442
|
-
return /* @__PURE__ */
|
|
1668
|
+
return /* @__PURE__ */ React36.createElement(DirectionProvider6, { rtl: isSiteRtl }, /* @__PURE__ */ React36.createElement(ThemeProvider6, null, /* @__PURE__ */ React36.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React36.createElement(Stack11, { gap: 1 }, /* @__PURE__ */ React36.createElement(ControlLabel11, null, __16("Justify content", "elementor")), /* @__PURE__ */ React36.createElement(ToggleControl5, { options: options4, fullWidth: true })))));
|
|
1443
1669
|
};
|
|
1444
1670
|
|
|
1445
1671
|
// src/components/style-sections/layout-section/wrap-field.tsx
|
|
1446
|
-
import * as
|
|
1672
|
+
import * as React37 from "react";
|
|
1447
1673
|
import { ControlLabel as ControlLabel12, ToggleControl as ToggleControl6 } from "@elementor/editor-controls";
|
|
1448
1674
|
import { ArrowBackIcon, ArrowForwardIcon, ArrowRightIcon as ArrowRightIcon2 } from "@elementor/icons";
|
|
1449
1675
|
import { DirectionProvider as DirectionProvider7, Grid as Grid8, ThemeProvider as ThemeProvider7 } from "@elementor/ui";
|
|
@@ -1452,25 +1678,25 @@ var options5 = [
|
|
|
1452
1678
|
{
|
|
1453
1679
|
value: "nowrap",
|
|
1454
1680
|
label: __17("No wrap", "elementor"),
|
|
1455
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1681
|
+
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(ArrowRightIcon2, { fontSize: size }),
|
|
1456
1682
|
showTooltip: true
|
|
1457
1683
|
},
|
|
1458
1684
|
{
|
|
1459
1685
|
value: "wrap",
|
|
1460
1686
|
label: __17("Wrap", "elementor"),
|
|
1461
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1687
|
+
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(ArrowBackIcon, { fontSize: size }),
|
|
1462
1688
|
showTooltip: true
|
|
1463
1689
|
},
|
|
1464
1690
|
{
|
|
1465
1691
|
value: "wrap-reverse",
|
|
1466
1692
|
label: __17("Reversed wrap", "elementor"),
|
|
1467
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1693
|
+
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(ArrowForwardIcon, { fontSize: size }),
|
|
1468
1694
|
showTooltip: true
|
|
1469
1695
|
}
|
|
1470
1696
|
];
|
|
1471
1697
|
var WrapField = () => {
|
|
1472
1698
|
const { isSiteRtl } = useDirection();
|
|
1473
|
-
return /* @__PURE__ */
|
|
1699
|
+
return /* @__PURE__ */ React37.createElement(DirectionProvider7, { rtl: isSiteRtl }, /* @__PURE__ */ React37.createElement(ThemeProvider7, null, /* @__PURE__ */ React37.createElement(StylesField, { bind: "flex-wrap" }, /* @__PURE__ */ React37.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel12, null, __17("Wrap", "elementor"))), /* @__PURE__ */ React37.createElement(Grid8, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React37.createElement(ToggleControl6, { options: options5 }))))));
|
|
1474
1700
|
};
|
|
1475
1701
|
|
|
1476
1702
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
@@ -1479,22 +1705,22 @@ var LayoutSection = () => {
|
|
|
1479
1705
|
const { element } = useElement();
|
|
1480
1706
|
const parent = useParentElement(element.id);
|
|
1481
1707
|
const parentStyle = useComputedStyle(parent?.id || null);
|
|
1482
|
-
return /* @__PURE__ */
|
|
1708
|
+
return /* @__PURE__ */ React38.createElement(Stack12, { gap: 2 }, /* @__PURE__ */ React38.createElement(DisplayField, null), "flex" === display?.value && /* @__PURE__ */ React38.createElement(FlexFields, null), "flex" === parentStyle?.display && /* @__PURE__ */ React38.createElement(FlexChildFields, null));
|
|
1483
1709
|
};
|
|
1484
|
-
var FlexFields = () => /* @__PURE__ */
|
|
1485
|
-
var FlexChildFields = () => /* @__PURE__ */
|
|
1710
|
+
var FlexFields = () => /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement(FlexDirectionField, null), /* @__PURE__ */ React38.createElement(JustifyContentField, null), /* @__PURE__ */ React38.createElement(AlignItemsField, null), /* @__PURE__ */ React38.createElement(Divider3, null), /* @__PURE__ */ React38.createElement(GapControlField, null), /* @__PURE__ */ React38.createElement(WrapField, null));
|
|
1711
|
+
var FlexChildFields = () => /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement(Divider3, null), /* @__PURE__ */ React38.createElement(ControlLabel13, null, __18("Flex child", "elementor")), /* @__PURE__ */ React38.createElement(AlignSelfChild, null), /* @__PURE__ */ React38.createElement(FlexOrderField, null), /* @__PURE__ */ React38.createElement(FlexSizeField, null));
|
|
1486
1712
|
|
|
1487
1713
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1488
|
-
import * as
|
|
1714
|
+
import * as React42 from "react";
|
|
1489
1715
|
import { Stack as Stack14 } from "@elementor/ui";
|
|
1490
1716
|
|
|
1491
1717
|
// src/hooks/use-session-storage.ts
|
|
1492
|
-
import { useEffect as
|
|
1718
|
+
import { useEffect as useEffect3, useState as useState7 } from "react";
|
|
1493
1719
|
import { getSessionStorageItem, removeSessionStorageItem, setSessionStorageItem } from "@elementor/utils";
|
|
1494
1720
|
var useSessionStorage = (key) => {
|
|
1495
1721
|
const prefixedKey = `elementor/${key}`;
|
|
1496
|
-
const [value, setValue] =
|
|
1497
|
-
|
|
1722
|
+
const [value, setValue] = useState7();
|
|
1723
|
+
useEffect3(() => {
|
|
1498
1724
|
return subscribeToSessionStorage(prefixedKey, (newValue) => {
|
|
1499
1725
|
setValue(newValue ?? null);
|
|
1500
1726
|
});
|
|
@@ -1526,26 +1752,26 @@ var subscribeToSessionStorage = (key, subscriber) => {
|
|
|
1526
1752
|
};
|
|
1527
1753
|
|
|
1528
1754
|
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
1529
|
-
import * as
|
|
1755
|
+
import * as React39 from "react";
|
|
1530
1756
|
import { ControlLabel as ControlLabel14, SizeControl as SizeControl3 } from "@elementor/editor-controls";
|
|
1531
1757
|
import { SideBottomIcon as SideBottomIcon2, SideLeftIcon as SideLeftIcon2, SideRightIcon as SideRightIcon2, SideTopIcon as SideTopIcon2 } from "@elementor/icons";
|
|
1532
1758
|
import { Grid as Grid9, Stack as Stack13 } from "@elementor/ui";
|
|
1533
1759
|
import { __ as __19 } from "@wordpress/i18n";
|
|
1534
1760
|
var sideIcons = {
|
|
1535
|
-
left: /* @__PURE__ */
|
|
1536
|
-
right: /* @__PURE__ */
|
|
1537
|
-
top: /* @__PURE__ */
|
|
1538
|
-
bottom: /* @__PURE__ */
|
|
1761
|
+
left: /* @__PURE__ */ React39.createElement(SideLeftIcon2, { fontSize: "tiny" }),
|
|
1762
|
+
right: /* @__PURE__ */ React39.createElement(SideRightIcon2, { fontSize: "tiny" }),
|
|
1763
|
+
top: /* @__PURE__ */ React39.createElement(SideTopIcon2, { fontSize: "tiny" }),
|
|
1764
|
+
bottom: /* @__PURE__ */ React39.createElement(SideBottomIcon2, { fontSize: "tiny" })
|
|
1539
1765
|
};
|
|
1540
1766
|
var DimensionsField = () => {
|
|
1541
|
-
return /* @__PURE__ */
|
|
1767
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(Stack13, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(DimensionField, { side: "top", label: __19("Top", "elementor") }), /* @__PURE__ */ React39.createElement(DimensionField, { side: "right", label: __19("Right", "elementor") })), /* @__PURE__ */ React39.createElement(Stack13, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(DimensionField, { side: "bottom", label: __19("Bottom", "elementor") }), /* @__PURE__ */ React39.createElement(DimensionField, { side: "left", label: __19("Left", "elementor") })));
|
|
1542
1768
|
};
|
|
1543
1769
|
var DimensionField = ({ side, label }) => {
|
|
1544
|
-
return /* @__PURE__ */
|
|
1770
|
+
return /* @__PURE__ */ React39.createElement(Grid9, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React39.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(ControlLabel14, null, label)), /* @__PURE__ */ React39.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(StylesField, { bind: side }, /* @__PURE__ */ React39.createElement(SizeControl3, { startIcon: sideIcons[side] }))));
|
|
1545
1771
|
};
|
|
1546
1772
|
|
|
1547
1773
|
// src/components/style-sections/position-section/position-field.tsx
|
|
1548
|
-
import * as
|
|
1774
|
+
import * as React40 from "react";
|
|
1549
1775
|
import { ControlLabel as ControlLabel15, SelectControl as SelectControl3 } from "@elementor/editor-controls";
|
|
1550
1776
|
import { Grid as Grid10 } from "@elementor/ui";
|
|
1551
1777
|
import { __ as __20 } from "@wordpress/i18n";
|
|
@@ -1553,19 +1779,20 @@ var positionOptions = [
|
|
|
1553
1779
|
{ label: __20("Static", "elementor"), value: "static" },
|
|
1554
1780
|
{ label: __20("Relative", "elementor"), value: "relative" },
|
|
1555
1781
|
{ label: __20("Absolute", "elementor"), value: "absolute" },
|
|
1556
|
-
{ label: __20("Fixed", "elementor"), value: "fixed" }
|
|
1782
|
+
{ label: __20("Fixed", "elementor"), value: "fixed" },
|
|
1783
|
+
{ label: __20("Sticky", "elementor"), value: "sticky" }
|
|
1557
1784
|
];
|
|
1558
1785
|
var PositionField = ({ onChange }) => {
|
|
1559
|
-
return /* @__PURE__ */
|
|
1786
|
+
return /* @__PURE__ */ React40.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React40.createElement(Grid10, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlLabel15, null, __20("Position", "elementor"))), /* @__PURE__ */ React40.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(SelectControl3, { options: positionOptions, onChange }))));
|
|
1560
1787
|
};
|
|
1561
1788
|
|
|
1562
1789
|
// src/components/style-sections/position-section/z-index-field.tsx
|
|
1563
|
-
import * as
|
|
1790
|
+
import * as React41 from "react";
|
|
1564
1791
|
import { ControlLabel as ControlLabel16, NumberControl as NumberControl3 } from "@elementor/editor-controls";
|
|
1565
1792
|
import { Grid as Grid11 } from "@elementor/ui";
|
|
1566
1793
|
import { __ as __21 } from "@wordpress/i18n";
|
|
1567
1794
|
var ZIndexField = () => {
|
|
1568
|
-
return /* @__PURE__ */
|
|
1795
|
+
return /* @__PURE__ */ React41.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React41.createElement(Grid11, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlLabel16, null, __21("Z-Index", "elementor"))), /* @__PURE__ */ React41.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(NumberControl3, null))));
|
|
1569
1796
|
};
|
|
1570
1797
|
|
|
1571
1798
|
// src/components/style-sections/position-section/position-section.tsx
|
|
@@ -1597,7 +1824,7 @@ var PositionSection = () => {
|
|
|
1597
1824
|
}
|
|
1598
1825
|
};
|
|
1599
1826
|
const isNotStatic = positionValue && positionValue?.value !== "static";
|
|
1600
|
-
return /* @__PURE__ */
|
|
1827
|
+
return /* @__PURE__ */ React42.createElement(Stack14, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(PositionField, { onChange: onPositionChange }), isNotStatic ? /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(DimensionsField, null), /* @__PURE__ */ React42.createElement(ZIndexField, null)) : null);
|
|
1601
1828
|
};
|
|
1602
1829
|
var usePersistDimensions = () => {
|
|
1603
1830
|
const { id: styleDefID, meta } = useStyle();
|
|
@@ -1607,13 +1834,13 @@ var usePersistDimensions = () => {
|
|
|
1607
1834
|
};
|
|
1608
1835
|
|
|
1609
1836
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1610
|
-
import * as
|
|
1837
|
+
import * as React44 from "react";
|
|
1611
1838
|
import { ControlLabel as ControlLabel18, SizeControl as SizeControl4 } from "@elementor/editor-controls";
|
|
1612
1839
|
import { Divider as Divider4, Grid as Grid13, Stack as Stack15 } from "@elementor/ui";
|
|
1613
1840
|
import { __ as __23 } from "@wordpress/i18n";
|
|
1614
1841
|
|
|
1615
1842
|
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1616
|
-
import * as
|
|
1843
|
+
import * as React43 from "react";
|
|
1617
1844
|
import { ControlLabel as ControlLabel17, ToggleControl as ToggleControl7 } from "@elementor/editor-controls";
|
|
1618
1845
|
import { ExpandBottomIcon, EyeIcon, EyeOffIcon } from "@elementor/icons";
|
|
1619
1846
|
import { Grid as Grid12 } from "@elementor/ui";
|
|
@@ -1622,58 +1849,58 @@ var options6 = [
|
|
|
1622
1849
|
{
|
|
1623
1850
|
value: "visible",
|
|
1624
1851
|
label: __22("Visible", "elementor"),
|
|
1625
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1852
|
+
renderContent: ({ size }) => /* @__PURE__ */ React43.createElement(EyeIcon, { fontSize: size }),
|
|
1626
1853
|
showTooltip: true
|
|
1627
1854
|
},
|
|
1628
1855
|
{
|
|
1629
1856
|
value: "hidden",
|
|
1630
1857
|
label: __22("Hidden", "elementor"),
|
|
1631
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1858
|
+
renderContent: ({ size }) => /* @__PURE__ */ React43.createElement(EyeOffIcon, { fontSize: size }),
|
|
1632
1859
|
showTooltip: true
|
|
1633
1860
|
},
|
|
1634
1861
|
{
|
|
1635
1862
|
value: "auto",
|
|
1636
1863
|
label: __22("Auto", "elementor"),
|
|
1637
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1864
|
+
renderContent: ({ size }) => /* @__PURE__ */ React43.createElement(ExpandBottomIcon, { fontSize: size }),
|
|
1638
1865
|
showTooltip: true
|
|
1639
1866
|
}
|
|
1640
1867
|
];
|
|
1641
1868
|
var OverflowField = () => {
|
|
1642
|
-
return /* @__PURE__ */
|
|
1869
|
+
return /* @__PURE__ */ React43.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React43.createElement(Grid12, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React43.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(ControlLabel17, null, __22("Overflow", "elementor"))), /* @__PURE__ */ React43.createElement(Grid12, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React43.createElement(ToggleControl7, { options: options6 }))));
|
|
1643
1870
|
};
|
|
1644
1871
|
|
|
1645
1872
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1646
1873
|
var SizeSection = () => {
|
|
1647
|
-
return /* @__PURE__ */
|
|
1874
|
+
return /* @__PURE__ */ React44.createElement(Stack15, { gap: 1.5 }, /* @__PURE__ */ React44.createElement(Grid13, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React44.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(SizeField, { bind: "width", label: __23("Width", "elementor") })), /* @__PURE__ */ React44.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(SizeField, { bind: "height", label: __23("Height", "elementor") }))), /* @__PURE__ */ React44.createElement(Grid13, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React44.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(SizeField, { bind: "min-width", label: __23("Min. Width", "elementor") })), /* @__PURE__ */ React44.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(SizeField, { bind: "min-height", label: __23("Min. Height", "elementor") }))), /* @__PURE__ */ React44.createElement(Grid13, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React44.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(SizeField, { bind: "max-width", label: __23("Max. Width", "elementor") })), /* @__PURE__ */ React44.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(SizeField, { bind: "max-height", label: __23("Max. Height", "elementor") }))), /* @__PURE__ */ React44.createElement(Divider4, null), /* @__PURE__ */ React44.createElement(Stack15, null, /* @__PURE__ */ React44.createElement(OverflowField, null)));
|
|
1648
1875
|
};
|
|
1649
1876
|
var SizeField = ({ label, bind }) => {
|
|
1650
|
-
return /* @__PURE__ */
|
|
1877
|
+
return /* @__PURE__ */ React44.createElement(StylesField, { bind }, /* @__PURE__ */ React44.createElement(Grid13, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React44.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React44.createElement(ControlLabel18, null, label)), /* @__PURE__ */ React44.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React44.createElement(SizeControl4, null))));
|
|
1651
1878
|
};
|
|
1652
1879
|
|
|
1653
1880
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1654
|
-
import * as
|
|
1881
|
+
import * as React45 from "react";
|
|
1655
1882
|
import { LinkedDimensionsControl } from "@elementor/editor-controls";
|
|
1656
1883
|
import { Divider as Divider5, Stack as Stack16 } from "@elementor/ui";
|
|
1657
1884
|
import { __ as __24 } from "@wordpress/i18n";
|
|
1658
1885
|
var SpacingSection = () => {
|
|
1659
|
-
return /* @__PURE__ */
|
|
1886
|
+
return /* @__PURE__ */ React45.createElement(Stack16, { gap: 1.5 }, /* @__PURE__ */ React45.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React45.createElement(LinkedDimensionsControl, { label: __24("Padding", "elementor") })), /* @__PURE__ */ React45.createElement(Divider5, null), /* @__PURE__ */ React45.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React45.createElement(LinkedDimensionsControl, { label: __24("Margin", "elementor") })));
|
|
1660
1887
|
};
|
|
1661
1888
|
|
|
1662
1889
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1663
|
-
import * as
|
|
1890
|
+
import * as React59 from "react";
|
|
1664
1891
|
import { Divider as Divider6, Stack as Stack18 } from "@elementor/ui";
|
|
1665
1892
|
|
|
1666
1893
|
// src/components/collapsible-content.tsx
|
|
1667
|
-
import * as
|
|
1668
|
-
import { useState as
|
|
1894
|
+
import * as React46 from "react";
|
|
1895
|
+
import { useState as useState8 } from "react";
|
|
1669
1896
|
import { Button, Collapse as Collapse3, Stack as Stack17 } from "@elementor/ui";
|
|
1670
1897
|
import { __ as __25 } from "@wordpress/i18n";
|
|
1671
1898
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
1672
|
-
const [open, setOpen] =
|
|
1899
|
+
const [open, setOpen] = useState8(defaultOpen);
|
|
1673
1900
|
const handleToggle = () => {
|
|
1674
1901
|
setOpen((prevOpen) => !prevOpen);
|
|
1675
1902
|
};
|
|
1676
|
-
return /* @__PURE__ */
|
|
1903
|
+
return /* @__PURE__ */ React46.createElement(Stack17, { sx: { py: 0.5 } }, /* @__PURE__ */ React46.createElement(
|
|
1677
1904
|
Button,
|
|
1678
1905
|
{
|
|
1679
1906
|
fullWidth: true,
|
|
@@ -1681,14 +1908,14 @@ var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
|
1681
1908
|
color: "secondary",
|
|
1682
1909
|
variant: "outlined",
|
|
1683
1910
|
onClick: handleToggle,
|
|
1684
|
-
endIcon: /* @__PURE__ */
|
|
1911
|
+
endIcon: /* @__PURE__ */ React46.createElement(CollapseIcon, { open })
|
|
1685
1912
|
},
|
|
1686
1913
|
open ? __25("Show less", "elementor") : __25("Show more", "elementor")
|
|
1687
|
-
), /* @__PURE__ */
|
|
1914
|
+
), /* @__PURE__ */ React46.createElement(Collapse3, { in: open, timeout: "auto", unmountOnExit: true }, children));
|
|
1688
1915
|
};
|
|
1689
1916
|
|
|
1690
1917
|
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1691
|
-
import * as
|
|
1918
|
+
import * as React47 from "react";
|
|
1692
1919
|
import { ControlLabel as ControlLabel19, FontFamilyControl } from "@elementor/editor-controls";
|
|
1693
1920
|
import { Grid as Grid14 } from "@elementor/ui";
|
|
1694
1921
|
import { __ as __26 } from "@wordpress/i18n";
|
|
@@ -1705,7 +1932,7 @@ var FontFamilyField = () => {
|
|
|
1705
1932
|
if (!fontFamilies) {
|
|
1706
1933
|
return null;
|
|
1707
1934
|
}
|
|
1708
|
-
return /* @__PURE__ */
|
|
1935
|
+
return /* @__PURE__ */ React47.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React47.createElement(Grid14, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React47.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(ControlLabel19, null, __26("Font Family", "elementor"))), /* @__PURE__ */ React47.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(FontFamilyControl, { fontFamilies }))));
|
|
1709
1936
|
};
|
|
1710
1937
|
var getFontFamilies = () => {
|
|
1711
1938
|
const { controls } = getElementorConfig();
|
|
@@ -1717,16 +1944,16 @@ var getFontFamilies = () => {
|
|
|
1717
1944
|
};
|
|
1718
1945
|
|
|
1719
1946
|
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1720
|
-
import * as
|
|
1947
|
+
import * as React48 from "react";
|
|
1721
1948
|
import { ControlLabel as ControlLabel20, SizeControl as SizeControl5 } from "@elementor/editor-controls";
|
|
1722
1949
|
import { Grid as Grid15 } from "@elementor/ui";
|
|
1723
1950
|
import { __ as __27 } from "@wordpress/i18n";
|
|
1724
1951
|
var FontSizeField = () => {
|
|
1725
|
-
return /* @__PURE__ */
|
|
1952
|
+
return /* @__PURE__ */ React48.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React48.createElement(Grid15, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React48.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(ControlLabel20, null, __27("Font Size", "elementor"))), /* @__PURE__ */ React48.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(SizeControl5, null))));
|
|
1726
1953
|
};
|
|
1727
1954
|
|
|
1728
1955
|
// src/components/style-sections/typography-section/font-weight-field.tsx
|
|
1729
|
-
import * as
|
|
1956
|
+
import * as React49 from "react";
|
|
1730
1957
|
import { ControlLabel as ControlLabel21, SelectControl as SelectControl4 } from "@elementor/editor-controls";
|
|
1731
1958
|
import { Grid as Grid16 } from "@elementor/ui";
|
|
1732
1959
|
import { __ as __28 } from "@wordpress/i18n";
|
|
@@ -1738,29 +1965,29 @@ var fontWeightOptions = [
|
|
|
1738
1965
|
{ label: __28("Black - 900", "elementor"), value: "900" }
|
|
1739
1966
|
];
|
|
1740
1967
|
var FontWeightField = () => {
|
|
1741
|
-
return /* @__PURE__ */
|
|
1968
|
+
return /* @__PURE__ */ React49.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React49.createElement(Grid16, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React49.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(ControlLabel21, null, __28("Font Weight", "elementor"))), /* @__PURE__ */ React49.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(SelectControl4, { options: fontWeightOptions }))));
|
|
1742
1969
|
};
|
|
1743
1970
|
|
|
1744
1971
|
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
1745
|
-
import * as
|
|
1972
|
+
import * as React50 from "react";
|
|
1746
1973
|
import { ControlLabel as ControlLabel22, SizeControl as SizeControl6 } from "@elementor/editor-controls";
|
|
1747
1974
|
import { Grid as Grid17 } from "@elementor/ui";
|
|
1748
1975
|
import { __ as __29 } from "@wordpress/i18n";
|
|
1749
1976
|
var LetterSpacingField = () => {
|
|
1750
|
-
return /* @__PURE__ */
|
|
1977
|
+
return /* @__PURE__ */ React50.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React50.createElement(Grid17, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React50.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(ControlLabel22, null, __29("Letter Spacing", "elementor"))), /* @__PURE__ */ React50.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(SizeControl6, null))));
|
|
1751
1978
|
};
|
|
1752
1979
|
|
|
1753
1980
|
// src/components/style-sections/typography-section/line-height-field.tsx
|
|
1754
|
-
import * as
|
|
1981
|
+
import * as React51 from "react";
|
|
1755
1982
|
import { ControlLabel as ControlLabel23, SizeControl as SizeControl7 } from "@elementor/editor-controls";
|
|
1756
1983
|
import { Grid as Grid18 } from "@elementor/ui";
|
|
1757
1984
|
import { __ as __30 } from "@wordpress/i18n";
|
|
1758
1985
|
var LineHeightField = () => {
|
|
1759
|
-
return /* @__PURE__ */
|
|
1986
|
+
return /* @__PURE__ */ React51.createElement(StylesField, { bind: "line-height" }, /* @__PURE__ */ React51.createElement(Grid18, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React51.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(ControlLabel23, null, __30("Line Height", "elementor"))), /* @__PURE__ */ React51.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(SizeControl7, null))));
|
|
1760
1987
|
};
|
|
1761
1988
|
|
|
1762
1989
|
// src/components/style-sections/typography-section/text-alignment-field.tsx
|
|
1763
|
-
import * as
|
|
1990
|
+
import * as React52 from "react";
|
|
1764
1991
|
import { ControlLabel as ControlLabel24, ToggleControl as ToggleControl8 } from "@elementor/editor-controls";
|
|
1765
1992
|
import { AlignCenterIcon, AlignJustifiedIcon, AlignLeftIcon, AlignRightIcon } from "@elementor/icons";
|
|
1766
1993
|
import { Grid as Grid19 } from "@elementor/ui";
|
|
@@ -1769,39 +1996,39 @@ var options7 = [
|
|
|
1769
1996
|
{
|
|
1770
1997
|
value: "left",
|
|
1771
1998
|
label: __31("Left", "elementor"),
|
|
1772
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1999
|
+
renderContent: ({ size }) => /* @__PURE__ */ React52.createElement(AlignLeftIcon, { fontSize: size })
|
|
1773
2000
|
},
|
|
1774
2001
|
{
|
|
1775
2002
|
value: "center",
|
|
1776
2003
|
label: __31("Center", "elementor"),
|
|
1777
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2004
|
+
renderContent: ({ size }) => /* @__PURE__ */ React52.createElement(AlignCenterIcon, { fontSize: size })
|
|
1778
2005
|
},
|
|
1779
2006
|
{
|
|
1780
2007
|
value: "right",
|
|
1781
2008
|
label: __31("Right", "elementor"),
|
|
1782
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2009
|
+
renderContent: ({ size }) => /* @__PURE__ */ React52.createElement(AlignRightIcon, { fontSize: size })
|
|
1783
2010
|
},
|
|
1784
2011
|
{
|
|
1785
2012
|
value: "justify",
|
|
1786
2013
|
label: __31("Justify", "elementor"),
|
|
1787
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2014
|
+
renderContent: ({ size }) => /* @__PURE__ */ React52.createElement(AlignJustifiedIcon, { fontSize: size })
|
|
1788
2015
|
}
|
|
1789
2016
|
];
|
|
1790
2017
|
var TextAlignmentField = () => {
|
|
1791
|
-
return /* @__PURE__ */
|
|
2018
|
+
return /* @__PURE__ */ React52.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React52.createElement(Grid19, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React52.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(ControlLabel24, null, __31("Alignment", "elementor"))), /* @__PURE__ */ React52.createElement(Grid19, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React52.createElement(ToggleControl8, { options: options7 }))));
|
|
1792
2019
|
};
|
|
1793
2020
|
|
|
1794
2021
|
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
1795
|
-
import * as
|
|
2022
|
+
import * as React53 from "react";
|
|
1796
2023
|
import { ColorControl as ColorControl2, ControlLabel as ControlLabel25 } from "@elementor/editor-controls";
|
|
1797
2024
|
import { Grid as Grid20 } from "@elementor/ui";
|
|
1798
2025
|
import { __ as __32 } from "@wordpress/i18n";
|
|
1799
2026
|
var TextColorField = () => {
|
|
1800
|
-
return /* @__PURE__ */
|
|
2027
|
+
return /* @__PURE__ */ React53.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React53.createElement(Grid20, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React53.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React53.createElement(ControlLabel25, null, __32("Text Color", "elementor"))), /* @__PURE__ */ React53.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React53.createElement(ColorControl2, null))));
|
|
1801
2028
|
};
|
|
1802
2029
|
|
|
1803
2030
|
// src/components/style-sections/typography-section/text-direction-field.tsx
|
|
1804
|
-
import * as
|
|
2031
|
+
import * as React54 from "react";
|
|
1805
2032
|
import { ControlLabel as ControlLabel26, ToggleControl as ToggleControl9 } from "@elementor/editor-controls";
|
|
1806
2033
|
import { TextDirectionLtrIcon, TextDirectionRtlIcon } from "@elementor/icons";
|
|
1807
2034
|
import { Grid as Grid21 } from "@elementor/ui";
|
|
@@ -1810,20 +2037,20 @@ var options8 = [
|
|
|
1810
2037
|
{
|
|
1811
2038
|
value: "ltr",
|
|
1812
2039
|
label: __33("Left to Right", "elementor"),
|
|
1813
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2040
|
+
renderContent: ({ size }) => /* @__PURE__ */ React54.createElement(TextDirectionLtrIcon, { fontSize: size })
|
|
1814
2041
|
},
|
|
1815
2042
|
{
|
|
1816
2043
|
value: "rtl",
|
|
1817
2044
|
label: __33("Right to Left", "elementor"),
|
|
1818
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2045
|
+
renderContent: ({ size }) => /* @__PURE__ */ React54.createElement(TextDirectionRtlIcon, { fontSize: size })
|
|
1819
2046
|
}
|
|
1820
2047
|
];
|
|
1821
2048
|
var TextDirectionField = () => {
|
|
1822
|
-
return /* @__PURE__ */
|
|
2049
|
+
return /* @__PURE__ */ React54.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React54.createElement(Grid21, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(ControlLabel26, null, __33("Direction", "elementor"))), /* @__PURE__ */ React54.createElement(Grid21, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React54.createElement(ToggleControl9, { options: options8 }))));
|
|
1823
2050
|
};
|
|
1824
2051
|
|
|
1825
2052
|
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1826
|
-
import * as
|
|
2053
|
+
import * as React55 from "react";
|
|
1827
2054
|
import { StrokeControl } from "@elementor/editor-controls";
|
|
1828
2055
|
import { __ as __34 } from "@wordpress/i18n";
|
|
1829
2056
|
var initTextStroke = {
|
|
@@ -1851,7 +2078,7 @@ var TextStrokeField = () => {
|
|
|
1851
2078
|
setTextStroke(null);
|
|
1852
2079
|
};
|
|
1853
2080
|
const hasTextStroke = Boolean(textStroke);
|
|
1854
|
-
return /* @__PURE__ */
|
|
2081
|
+
return /* @__PURE__ */ React55.createElement(
|
|
1855
2082
|
AddOrRemoveContent,
|
|
1856
2083
|
{
|
|
1857
2084
|
label: __34("Text Stroke", "elementor"),
|
|
@@ -1859,12 +2086,12 @@ var TextStrokeField = () => {
|
|
|
1859
2086
|
onAdd: addTextStroke,
|
|
1860
2087
|
onRemove: removeTextStroke
|
|
1861
2088
|
},
|
|
1862
|
-
/* @__PURE__ */
|
|
2089
|
+
/* @__PURE__ */ React55.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React55.createElement(StrokeControl, null))
|
|
1863
2090
|
);
|
|
1864
2091
|
};
|
|
1865
2092
|
|
|
1866
2093
|
// src/components/style-sections/typography-section/text-style-field.tsx
|
|
1867
|
-
import * as
|
|
2094
|
+
import * as React56 from "react";
|
|
1868
2095
|
import { ControlLabel as ControlLabel27 } from "@elementor/editor-controls";
|
|
1869
2096
|
import { ItalicIcon, StrikethroughIcon, UnderlineIcon } from "@elementor/icons";
|
|
1870
2097
|
import { Grid as Grid22, ToggleButton as ToggleButtonBase, ToggleButtonGroup } from "@elementor/ui";
|
|
@@ -1892,7 +2119,7 @@ var TextStyleField = () => {
|
|
|
1892
2119
|
value: newValue
|
|
1893
2120
|
});
|
|
1894
2121
|
};
|
|
1895
|
-
return /* @__PURE__ */
|
|
2122
|
+
return /* @__PURE__ */ React56.createElement(Grid22, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(ControlLabel27, null, __35("Style", "elementor"))), /* @__PURE__ */ React56.createElement(Grid22, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React56.createElement(ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React56.createElement(
|
|
1896
2123
|
ToggleButton,
|
|
1897
2124
|
{
|
|
1898
2125
|
value: "italic",
|
|
@@ -1900,8 +2127,8 @@ var TextStyleField = () => {
|
|
|
1900
2127
|
"aria-label": "italic",
|
|
1901
2128
|
sx: { marginLeft: "auto" }
|
|
1902
2129
|
},
|
|
1903
|
-
/* @__PURE__ */
|
|
1904
|
-
), /* @__PURE__ */
|
|
2130
|
+
/* @__PURE__ */ React56.createElement(ItalicIcon, { fontSize: buttonSize })
|
|
2131
|
+
), /* @__PURE__ */ React56.createElement(
|
|
1905
2132
|
ShorthandControl,
|
|
1906
2133
|
{
|
|
1907
2134
|
value: "line-through",
|
|
@@ -1909,8 +2136,8 @@ var TextStyleField = () => {
|
|
|
1909
2136
|
updateValues: handleSetTextDecoration,
|
|
1910
2137
|
"aria-label": "line-through"
|
|
1911
2138
|
},
|
|
1912
|
-
/* @__PURE__ */
|
|
1913
|
-
), /* @__PURE__ */
|
|
2139
|
+
/* @__PURE__ */ React56.createElement(StrikethroughIcon, { fontSize: buttonSize })
|
|
2140
|
+
), /* @__PURE__ */ React56.createElement(
|
|
1914
2141
|
ShorthandControl,
|
|
1915
2142
|
{
|
|
1916
2143
|
value: "underline",
|
|
@@ -1918,7 +2145,7 @@ var TextStyleField = () => {
|
|
|
1918
2145
|
updateValues: handleSetTextDecoration,
|
|
1919
2146
|
"aria-label": "underline"
|
|
1920
2147
|
},
|
|
1921
|
-
/* @__PURE__ */
|
|
2148
|
+
/* @__PURE__ */ React56.createElement(UnderlineIcon, { fontSize: buttonSize })
|
|
1922
2149
|
))));
|
|
1923
2150
|
};
|
|
1924
2151
|
var ShorthandControl = ({
|
|
@@ -1937,17 +2164,17 @@ var ShorthandControl = ({
|
|
|
1937
2164
|
updateValues([...valuesArr, newValue].join(" "));
|
|
1938
2165
|
}
|
|
1939
2166
|
};
|
|
1940
|
-
return /* @__PURE__ */
|
|
2167
|
+
return /* @__PURE__ */ React56.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
1941
2168
|
};
|
|
1942
2169
|
var ToggleButton = ({ onChange, ...props }) => {
|
|
1943
2170
|
const handleChange = (_e, newValue) => {
|
|
1944
2171
|
onChange(newValue);
|
|
1945
2172
|
};
|
|
1946
|
-
return /* @__PURE__ */
|
|
2173
|
+
return /* @__PURE__ */ React56.createElement(ToggleButtonBase, { ...props, onChange: handleChange, size: buttonSize });
|
|
1947
2174
|
};
|
|
1948
2175
|
|
|
1949
2176
|
// src/components/style-sections/typography-section/transform-field.tsx
|
|
1950
|
-
import * as
|
|
2177
|
+
import * as React57 from "react";
|
|
1951
2178
|
import { ControlLabel as ControlLabel28, ToggleControl as ToggleControl10 } from "@elementor/editor-controls";
|
|
1952
2179
|
import { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon } from "@elementor/icons";
|
|
1953
2180
|
import { Grid as Grid23 } from "@elementor/ui";
|
|
@@ -1956,33 +2183,33 @@ var options9 = [
|
|
|
1956
2183
|
{
|
|
1957
2184
|
value: "capitalize",
|
|
1958
2185
|
label: __36("Capitalize", "elementor"),
|
|
1959
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2186
|
+
renderContent: ({ size }) => /* @__PURE__ */ React57.createElement(LetterCaseIcon, { fontSize: size })
|
|
1960
2187
|
},
|
|
1961
2188
|
{
|
|
1962
2189
|
value: "uppercase",
|
|
1963
2190
|
label: __36("Uppercase", "elementor"),
|
|
1964
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2191
|
+
renderContent: ({ size }) => /* @__PURE__ */ React57.createElement(LetterCaseUpperIcon, { fontSize: size })
|
|
1965
2192
|
},
|
|
1966
2193
|
{
|
|
1967
2194
|
value: "lowercase",
|
|
1968
2195
|
label: __36("Lowercase", "elementor"),
|
|
1969
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2196
|
+
renderContent: ({ size }) => /* @__PURE__ */ React57.createElement(LetterCaseLowerIcon, { fontSize: size })
|
|
1970
2197
|
}
|
|
1971
2198
|
];
|
|
1972
|
-
var TransformField = () => /* @__PURE__ */
|
|
2199
|
+
var TransformField = () => /* @__PURE__ */ React57.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React57.createElement(Grid23, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React57.createElement(Grid23, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ControlLabel28, null, __36("Transform", "elementor"))), /* @__PURE__ */ React57.createElement(Grid23, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React57.createElement(ToggleControl10, { options: options9 }))));
|
|
1973
2200
|
|
|
1974
2201
|
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
1975
|
-
import * as
|
|
2202
|
+
import * as React58 from "react";
|
|
1976
2203
|
import { ControlLabel as ControlLabel29, SizeControl as SizeControl8 } from "@elementor/editor-controls";
|
|
1977
2204
|
import { Grid as Grid24 } from "@elementor/ui";
|
|
1978
2205
|
import { __ as __37 } from "@wordpress/i18n";
|
|
1979
2206
|
var WordSpacingField = () => {
|
|
1980
|
-
return /* @__PURE__ */
|
|
2207
|
+
return /* @__PURE__ */ React58.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React58.createElement(Grid24, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(Grid24, { item: true, xs: 6 }, /* @__PURE__ */ React58.createElement(ControlLabel29, null, __37("Word Spacing", "elementor"))), /* @__PURE__ */ React58.createElement(Grid24, { item: true, xs: 6 }, /* @__PURE__ */ React58.createElement(SizeControl8, null))));
|
|
1981
2208
|
};
|
|
1982
2209
|
|
|
1983
2210
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1984
2211
|
var TypographySection = () => {
|
|
1985
|
-
return /* @__PURE__ */
|
|
2212
|
+
return /* @__PURE__ */ React59.createElement(Stack18, { gap: 1.5 }, /* @__PURE__ */ React59.createElement(FontFamilyField, null), /* @__PURE__ */ React59.createElement(FontWeightField, null), /* @__PURE__ */ React59.createElement(FontSizeField, null), /* @__PURE__ */ React59.createElement(Divider6, null), /* @__PURE__ */ React59.createElement(TextAlignmentField, null), /* @__PURE__ */ React59.createElement(TextColorField, null), /* @__PURE__ */ React59.createElement(CollapsibleContent, null, /* @__PURE__ */ React59.createElement(Stack18, { gap: 1.5, sx: { pt: 1.5 } }, /* @__PURE__ */ React59.createElement(LineHeightField, null), /* @__PURE__ */ React59.createElement(LetterSpacingField, null), /* @__PURE__ */ React59.createElement(WordSpacingField, null), /* @__PURE__ */ React59.createElement(Divider6, null), /* @__PURE__ */ React59.createElement(TextStyleField, null), /* @__PURE__ */ React59.createElement(TransformField, null), /* @__PURE__ */ React59.createElement(TextDirectionField, null), /* @__PURE__ */ React59.createElement(TextStrokeField, null))));
|
|
1986
2213
|
};
|
|
1987
2214
|
|
|
1988
2215
|
// src/components/style-tab.tsx
|
|
@@ -1990,9 +2217,9 @@ var CLASSES_PROP_KEY = "classes";
|
|
|
1990
2217
|
var StyleTab = () => {
|
|
1991
2218
|
const currentClassesProp = useCurrentClassesProp();
|
|
1992
2219
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
1993
|
-
const [activeStyleState, setActiveStyleState] =
|
|
2220
|
+
const [activeStyleState, setActiveStyleState] = useState9(null);
|
|
1994
2221
|
const breakpoint = useActiveBreakpoint();
|
|
1995
|
-
return /* @__PURE__ */
|
|
2222
|
+
return /* @__PURE__ */ React60.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React60.createElement(
|
|
1996
2223
|
StyleProvider,
|
|
1997
2224
|
{
|
|
1998
2225
|
meta: { breakpoint, state: activeStyleState },
|
|
@@ -2003,13 +2230,11 @@ var StyleTab = () => {
|
|
|
2003
2230
|
},
|
|
2004
2231
|
setMetaState: setActiveStyleState
|
|
2005
2232
|
},
|
|
2006
|
-
/* @__PURE__ */
|
|
2007
|
-
/* @__PURE__ */ React59.createElement(Divider7, null),
|
|
2008
|
-
/* @__PURE__ */ React59.createElement(SectionsList, null, /* @__PURE__ */ React59.createElement(Section, { title: __38("Layout", "elementor") }, /* @__PURE__ */ React59.createElement(LayoutSection, null)), /* @__PURE__ */ React59.createElement(Section, { title: __38("Spacing", "elementor") }, /* @__PURE__ */ React59.createElement(SpacingSection, null)), /* @__PURE__ */ React59.createElement(Section, { title: __38("Size", "elementor") }, /* @__PURE__ */ React59.createElement(SizeSection, null)), /* @__PURE__ */ React59.createElement(Section, { title: __38("Position", "elementor") }, /* @__PURE__ */ React59.createElement(PositionSection, null)), /* @__PURE__ */ React59.createElement(Section, { title: __38("Typography", "elementor") }, /* @__PURE__ */ React59.createElement(TypographySection, null)), /* @__PURE__ */ React59.createElement(Section, { title: __38("Background", "elementor") }, /* @__PURE__ */ React59.createElement(BackgroundSection, null)), /* @__PURE__ */ React59.createElement(Section, { title: __38("Border", "elementor") }, /* @__PURE__ */ React59.createElement(BorderSection, null)), /* @__PURE__ */ React59.createElement(Section, { title: __38("Effects", "elementor") }, /* @__PURE__ */ React59.createElement(EffectsSection, null)))
|
|
2233
|
+
/* @__PURE__ */ React60.createElement(SessionStorageProvider2, { prefix: activeStyleDefId ?? "" }, /* @__PURE__ */ React60.createElement(CssClassSelector, null), /* @__PURE__ */ React60.createElement(Divider7, null), /* @__PURE__ */ React60.createElement(SectionsList, null, /* @__PURE__ */ React60.createElement(Section, { title: __38("Layout", "elementor") }, /* @__PURE__ */ React60.createElement(LayoutSection, null)), /* @__PURE__ */ React60.createElement(Section, { title: __38("Spacing", "elementor") }, /* @__PURE__ */ React60.createElement(SpacingSection, null)), /* @__PURE__ */ React60.createElement(Section, { title: __38("Size", "elementor") }, /* @__PURE__ */ React60.createElement(SizeSection, null)), /* @__PURE__ */ React60.createElement(Section, { title: __38("Position", "elementor") }, /* @__PURE__ */ React60.createElement(PositionSection, null)), /* @__PURE__ */ React60.createElement(Section, { title: __38("Typography", "elementor") }, /* @__PURE__ */ React60.createElement(TypographySection, null)), /* @__PURE__ */ React60.createElement(Section, { title: __38("Background", "elementor") }, /* @__PURE__ */ React60.createElement(BackgroundSection, null)), /* @__PURE__ */ React60.createElement(Section, { title: __38("Border", "elementor") }, /* @__PURE__ */ React60.createElement(BorderSection, null)), /* @__PURE__ */ React60.createElement(Section, { title: __38("Effects", "elementor") }, /* @__PURE__ */ React60.createElement(EffectsSection, null))))
|
|
2009
2234
|
));
|
|
2010
2235
|
};
|
|
2011
2236
|
function useActiveStyleDefId(currentClassesProp) {
|
|
2012
|
-
const [activeStyledDefId, setActiveStyledDefId] =
|
|
2237
|
+
const [activeStyledDefId, setActiveStyledDefId] = useState9(null);
|
|
2013
2238
|
const fallback = useFirstElementStyleDef(currentClassesProp);
|
|
2014
2239
|
return [activeStyledDefId || fallback?.id || null, setActiveStyledDefId];
|
|
2015
2240
|
}
|
|
@@ -2022,7 +2247,7 @@ function useFirstElementStyleDef(currentClassesProp) {
|
|
|
2022
2247
|
function useCurrentClassesProp() {
|
|
2023
2248
|
const { elementType } = useElement();
|
|
2024
2249
|
const prop = Object.entries(elementType.propsSchema).find(
|
|
2025
|
-
([, propType]) => propType.kind === "
|
|
2250
|
+
([, propType]) => propType.kind === "plain" && propType.key === CLASSES_PROP_KEY
|
|
2026
2251
|
);
|
|
2027
2252
|
if (!prop) {
|
|
2028
2253
|
throw new Error("Element does not have a classes prop");
|
|
@@ -2037,7 +2262,7 @@ var EditingPanelTabs = () => {
|
|
|
2037
2262
|
return (
|
|
2038
2263
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
2039
2264
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
2040
|
-
/* @__PURE__ */
|
|
2265
|
+
/* @__PURE__ */ React61.createElement(Fragment7, { key: element.id }, /* @__PURE__ */ React61.createElement(Stack19, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React61.createElement(Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React61.createElement(Tab, { label: __39("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React61.createElement(Tab, { label: __39("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React61.createElement(Divider8, null), /* @__PURE__ */ React61.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React61.createElement(SettingsTab, null)), /* @__PURE__ */ React61.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React61.createElement(StyleTab, null))))
|
|
2041
2266
|
);
|
|
2042
2267
|
};
|
|
2043
2268
|
|
|
@@ -2051,7 +2276,7 @@ var EditingPanel = () => {
|
|
|
2051
2276
|
return null;
|
|
2052
2277
|
}
|
|
2053
2278
|
const panelTitle = __40("Edit %s", "elementor").replace("%s", elementType.title);
|
|
2054
|
-
return /* @__PURE__ */
|
|
2279
|
+
return /* @__PURE__ */ React62.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React62.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React62.createElement(SessionStorageProvider3, { prefix: "elementor" }, /* @__PURE__ */ React62.createElement(Panel, null, /* @__PURE__ */ React62.createElement(PanelHeader, null, /* @__PURE__ */ React62.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React62.createElement(PanelBody, null, /* @__PURE__ */ React62.createElement(ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React62.createElement(ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React62.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React62.createElement(EditingPanelTabs, null))))))));
|
|
2055
2280
|
};
|
|
2056
2281
|
|
|
2057
2282
|
// src/panel.ts
|
|
@@ -2074,7 +2299,7 @@ var isAtomicWidgetSelected = () => {
|
|
|
2074
2299
|
// src/hooks/use-close-editor-panel.ts
|
|
2075
2300
|
var useCloseEditorPanel = () => {
|
|
2076
2301
|
const { close } = usePanelActions();
|
|
2077
|
-
return
|
|
2302
|
+
return useEffect4(() => {
|
|
2078
2303
|
return listenTo(commandStartEvent("document/elements/delete"), (e) => {
|
|
2079
2304
|
const selectedElement = getSelectedElements2()[0];
|
|
2080
2305
|
const { container: deletedContainer } = e?.args;
|
|
@@ -2087,11 +2312,11 @@ var useCloseEditorPanel = () => {
|
|
|
2087
2312
|
};
|
|
2088
2313
|
|
|
2089
2314
|
// src/hooks/use-open-editor-panel.ts
|
|
2090
|
-
import { useEffect as
|
|
2315
|
+
import { useEffect as useEffect5 } from "react";
|
|
2091
2316
|
import { __privateListenTo as listenTo2, commandStartEvent as commandStartEvent2 } from "@elementor/editor-v1-adapters";
|
|
2092
2317
|
var useOpenEditorPanel = () => {
|
|
2093
2318
|
const { open } = usePanelActions();
|
|
2094
|
-
|
|
2319
|
+
useEffect5(() => {
|
|
2095
2320
|
return listenTo2(commandStartEvent2("panel/editor/open"), () => {
|
|
2096
2321
|
if (isAtomicWidgetSelected()) {
|
|
2097
2322
|
open();
|
|
@@ -2107,6 +2332,26 @@ var EditingPanelHooks = () => {
|
|
|
2107
2332
|
return null;
|
|
2108
2333
|
};
|
|
2109
2334
|
|
|
2335
|
+
// src/hooks/use-unapply-class.ts
|
|
2336
|
+
import { updateSettings as updateSettings3, useElementSetting as useElementSetting4 } from "@elementor/editor-elements";
|
|
2337
|
+
var useUnapplyClass = (classId) => {
|
|
2338
|
+
const { element } = useElement();
|
|
2339
|
+
const classesProp = useClassesProp();
|
|
2340
|
+
const classes = useElementSetting4(element.id, classesProp);
|
|
2341
|
+
const filteredClasses = classes?.value.filter((className) => className !== classId);
|
|
2342
|
+
return () => {
|
|
2343
|
+
updateSettings3({
|
|
2344
|
+
id: element.id,
|
|
2345
|
+
props: {
|
|
2346
|
+
[classesProp]: {
|
|
2347
|
+
$$type: "classes",
|
|
2348
|
+
value: filteredClasses
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
});
|
|
2352
|
+
};
|
|
2353
|
+
};
|
|
2354
|
+
|
|
2110
2355
|
// src/css-classes.ts
|
|
2111
2356
|
var STATES = ["hover", "focus", "active"];
|
|
2112
2357
|
function initCssClasses() {
|
|
@@ -2130,12 +2375,23 @@ function registerStateItems() {
|
|
|
2130
2375
|
});
|
|
2131
2376
|
}
|
|
2132
2377
|
function registerGlobalClassItems() {
|
|
2378
|
+
registerGlobalClassMenuItem({
|
|
2379
|
+
id: "unapply-class",
|
|
2380
|
+
useProps: () => {
|
|
2381
|
+
const { styleId: currentClass } = useCssClassItem();
|
|
2382
|
+
const unapplyClass = useUnapplyClass(currentClass);
|
|
2383
|
+
return {
|
|
2384
|
+
text: "Remove",
|
|
2385
|
+
onClick: unapplyClass
|
|
2386
|
+
};
|
|
2387
|
+
}
|
|
2388
|
+
});
|
|
2133
2389
|
}
|
|
2134
2390
|
|
|
2135
2391
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
2136
|
-
import * as
|
|
2137
|
-
import { useId as
|
|
2138
|
-
import { ControlLabel as ControlLabel30, useBoundProp as
|
|
2392
|
+
import * as React65 from "react";
|
|
2393
|
+
import { useId as useId5 } from "react";
|
|
2394
|
+
import { ControlLabel as ControlLabel30, useBoundProp as useBoundProp4 } from "@elementor/editor-controls";
|
|
2139
2395
|
import { DatabaseIcon, SettingsIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
2140
2396
|
import {
|
|
2141
2397
|
bindPopover as bindPopover2,
|
|
@@ -2164,14 +2420,15 @@ var usePersistDynamicValue = (propKey) => {
|
|
|
2164
2420
|
};
|
|
2165
2421
|
|
|
2166
2422
|
// src/dynamics/dynamic-control.tsx
|
|
2167
|
-
import * as
|
|
2168
|
-
import {
|
|
2423
|
+
import * as React63 from "react";
|
|
2424
|
+
import { PropKeyProvider as PropKeyProvider3, PropProvider as PropProvider3, useBoundProp as useBoundProp2 } from "@elementor/editor-controls";
|
|
2169
2425
|
|
|
2170
2426
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2171
2427
|
import { useMemo as useMemo3 } from "react";
|
|
2172
2428
|
|
|
2173
2429
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
2174
2430
|
import { useMemo as useMemo2 } from "react";
|
|
2431
|
+
import { useBoundProp } from "@elementor/editor-controls";
|
|
2175
2432
|
|
|
2176
2433
|
// src/dynamics/sync/get-elementor-config.ts
|
|
2177
2434
|
var getElementorConfig2 = () => {
|
|
@@ -2213,15 +2470,14 @@ var dynamicPropTypeUtil = createPropUtils(
|
|
|
2213
2470
|
DYNAMIC_PROP_TYPE_KEY,
|
|
2214
2471
|
z.strictObject({
|
|
2215
2472
|
name: z.string(),
|
|
2216
|
-
settings: z.
|
|
2473
|
+
settings: z.any().optional()
|
|
2217
2474
|
})
|
|
2218
2475
|
);
|
|
2219
2476
|
|
|
2220
2477
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
2221
|
-
var usePropDynamicTags = (
|
|
2478
|
+
var usePropDynamicTags = () => {
|
|
2222
2479
|
let categories = [];
|
|
2223
|
-
const {
|
|
2224
|
-
const propType = elementType.propsSchema?.[propName];
|
|
2480
|
+
const { propType } = useBoundProp();
|
|
2225
2481
|
if (propType) {
|
|
2226
2482
|
const propDynamicType = getDynamicPropType(propType);
|
|
2227
2483
|
categories = propDynamicType?.settings.categories || [];
|
|
@@ -2240,37 +2496,39 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
2240
2496
|
};
|
|
2241
2497
|
|
|
2242
2498
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2243
|
-
var useDynamicTag = (
|
|
2244
|
-
const dynamicTags = usePropDynamicTags(
|
|
2499
|
+
var useDynamicTag = (tagName) => {
|
|
2500
|
+
const dynamicTags = usePropDynamicTags();
|
|
2245
2501
|
return useMemo3(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
2246
2502
|
};
|
|
2247
2503
|
|
|
2248
2504
|
// src/dynamics/dynamic-control.tsx
|
|
2249
2505
|
var DynamicControl = ({ bind, children }) => {
|
|
2250
|
-
const { value, setValue
|
|
2506
|
+
const { value, setValue } = useBoundProp2(dynamicPropTypeUtil);
|
|
2251
2507
|
const { name = "", settings } = value ?? {};
|
|
2252
|
-
const dynamicTag = useDynamicTag(
|
|
2508
|
+
const dynamicTag = useDynamicTag(name);
|
|
2253
2509
|
if (!dynamicTag) {
|
|
2254
2510
|
throw new Error(`Dynamic tag ${name} not found`);
|
|
2255
2511
|
}
|
|
2256
|
-
const
|
|
2512
|
+
const dynamicPropType = dynamicTag.props_schema[bind];
|
|
2513
|
+
const defaultValue = dynamicPropType?.default;
|
|
2257
2514
|
const dynamicValue = settings?.[bind] ?? defaultValue;
|
|
2258
|
-
const setDynamicValue = (
|
|
2515
|
+
const setDynamicValue = (newValues) => {
|
|
2259
2516
|
setValue({
|
|
2260
2517
|
name,
|
|
2261
2518
|
settings: {
|
|
2262
2519
|
...settings,
|
|
2263
|
-
|
|
2520
|
+
...newValues
|
|
2264
2521
|
}
|
|
2265
2522
|
});
|
|
2266
2523
|
};
|
|
2267
|
-
|
|
2524
|
+
const propType = createTopLevelOjectType({ schema: dynamicTag.props_schema });
|
|
2525
|
+
return /* @__PURE__ */ React63.createElement(PropProvider3, { propType, setValue: setDynamicValue, value: { [bind]: dynamicValue } }, /* @__PURE__ */ React63.createElement(PropKeyProvider3, { bind }, children));
|
|
2268
2526
|
};
|
|
2269
2527
|
|
|
2270
2528
|
// src/dynamics/components/dynamic-selection.tsx
|
|
2271
|
-
import * as
|
|
2272
|
-
import { Fragment as Fragment8, useState as
|
|
2273
|
-
import { useBoundProp as
|
|
2529
|
+
import * as React64 from "react";
|
|
2530
|
+
import { Fragment as Fragment8, useState as useState10 } from "react";
|
|
2531
|
+
import { useBoundProp as useBoundProp3 } from "@elementor/editor-controls";
|
|
2274
2532
|
import { PhotoIcon, SearchIcon } from "@elementor/icons";
|
|
2275
2533
|
import {
|
|
2276
2534
|
Box as Box6,
|
|
@@ -2287,13 +2545,13 @@ import {
|
|
|
2287
2545
|
import { __ as __41 } from "@wordpress/i18n";
|
|
2288
2546
|
var SIZE3 = "tiny";
|
|
2289
2547
|
var DynamicSelection = ({ onSelect }) => {
|
|
2290
|
-
const [searchValue, setSearchValue] =
|
|
2548
|
+
const [searchValue, setSearchValue] = useState10("");
|
|
2291
2549
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
2292
|
-
const { value: anyValue } =
|
|
2293
|
-
const { bind, value: dynamicValue, setValue } =
|
|
2550
|
+
const { value: anyValue } = useBoundProp3();
|
|
2551
|
+
const { bind, value: dynamicValue, setValue } = useBoundProp3(dynamicPropTypeUtil);
|
|
2294
2552
|
const [, updatePropValueHistory] = usePersistDynamicValue(bind);
|
|
2295
2553
|
const isCurrentValueDynamic = !!dynamicValue;
|
|
2296
|
-
const options10 = useFilteredOptions(
|
|
2554
|
+
const options10 = useFilteredOptions(searchValue);
|
|
2297
2555
|
const handleSearch = (event) => {
|
|
2298
2556
|
setSearchValue(event.target.value);
|
|
2299
2557
|
};
|
|
@@ -2304,7 +2562,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2304
2562
|
setValue({ name: value, settings: {} });
|
|
2305
2563
|
onSelect?.();
|
|
2306
2564
|
};
|
|
2307
|
-
return /* @__PURE__ */
|
|
2565
|
+
return /* @__PURE__ */ React64.createElement(Stack20, null, /* @__PURE__ */ React64.createElement(Box6, { px: 1.5, pb: 1 }, /* @__PURE__ */ React64.createElement(
|
|
2308
2566
|
TextField2,
|
|
2309
2567
|
{
|
|
2310
2568
|
fullWidth: true,
|
|
@@ -2313,12 +2571,12 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2313
2571
|
onChange: handleSearch,
|
|
2314
2572
|
placeholder: __41("Search dynamic tag", "elementor"),
|
|
2315
2573
|
InputProps: {
|
|
2316
|
-
startAdornment: /* @__PURE__ */
|
|
2574
|
+
startAdornment: /* @__PURE__ */ React64.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React64.createElement(SearchIcon, { fontSize: SIZE3 }))
|
|
2317
2575
|
}
|
|
2318
2576
|
}
|
|
2319
|
-
)), /* @__PURE__ */
|
|
2577
|
+
)), /* @__PURE__ */ React64.createElement(Divider9, null), /* @__PURE__ */ React64.createElement(Box6, { sx: { overflowY: "auto", height: 260, width: 220 } }, options10.length > 0 ? /* @__PURE__ */ React64.createElement(MenuList, { role: "listbox", tabIndex: 0 }, options10.map(([category, items3], index) => /* @__PURE__ */ React64.createElement(Fragment8, { key: index }, /* @__PURE__ */ React64.createElement(ListSubheader2, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items3.map(({ value, label: tagLabel }) => {
|
|
2320
2578
|
const isSelected = isCurrentValueDynamic && value === dynamicValue?.name;
|
|
2321
|
-
return /* @__PURE__ */
|
|
2579
|
+
return /* @__PURE__ */ React64.createElement(
|
|
2322
2580
|
MenuItem2,
|
|
2323
2581
|
{
|
|
2324
2582
|
key: value,
|
|
@@ -2329,7 +2587,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2329
2587
|
},
|
|
2330
2588
|
tagLabel
|
|
2331
2589
|
);
|
|
2332
|
-
})))) : /* @__PURE__ */
|
|
2590
|
+
})))) : /* @__PURE__ */ React64.createElement(Stack20, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React64.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React64.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, __41("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React64.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React64.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React64.createElement(
|
|
2333
2591
|
Link,
|
|
2334
2592
|
{
|
|
2335
2593
|
color: "secondary",
|
|
@@ -2340,8 +2598,8 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2340
2598
|
__41("Clear the filters", "elementor")
|
|
2341
2599
|
), "\xA0", __41("and try again.", "elementor")))));
|
|
2342
2600
|
};
|
|
2343
|
-
var useFilteredOptions = (
|
|
2344
|
-
const dynamicTags = usePropDynamicTags(
|
|
2601
|
+
var useFilteredOptions = (searchValue) => {
|
|
2602
|
+
const dynamicTags = usePropDynamicTags();
|
|
2345
2603
|
const options10 = dynamicTags.reduce((categories, { name, label, group }) => {
|
|
2346
2604
|
const isVisible = label.toLowerCase().includes(searchValue.trim().toLowerCase());
|
|
2347
2605
|
if (!isVisible) {
|
|
@@ -2359,38 +2617,38 @@ var useFilteredOptions = (bind, searchValue) => {
|
|
|
2359
2617
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
2360
2618
|
var SIZE4 = "tiny";
|
|
2361
2619
|
var DynamicSelectionControl = () => {
|
|
2362
|
-
const { setValue: setAnyValue } =
|
|
2363
|
-
const { bind, value } =
|
|
2620
|
+
const { setValue: setAnyValue } = useBoundProp4();
|
|
2621
|
+
const { bind, value } = useBoundProp4(dynamicPropTypeUtil);
|
|
2364
2622
|
const [propValueFromHistory] = usePersistDynamicValue(bind);
|
|
2365
2623
|
const { name: tagName = "" } = value;
|
|
2366
|
-
const selectionPopoverId =
|
|
2624
|
+
const selectionPopoverId = useId5();
|
|
2367
2625
|
const selectionPopoverState = usePopupState3({ variant: "popover", popupId: selectionPopoverId });
|
|
2368
|
-
const dynamicTag = useDynamicTag(
|
|
2626
|
+
const dynamicTag = useDynamicTag(tagName);
|
|
2369
2627
|
const removeDynamicTag = () => {
|
|
2370
2628
|
setAnyValue(propValueFromHistory ?? null);
|
|
2371
2629
|
};
|
|
2372
2630
|
if (!dynamicTag) {
|
|
2373
2631
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
2374
2632
|
}
|
|
2375
|
-
return /* @__PURE__ */
|
|
2633
|
+
return /* @__PURE__ */ React65.createElement(Box7, null, /* @__PURE__ */ React65.createElement(
|
|
2376
2634
|
Tag,
|
|
2377
2635
|
{
|
|
2378
2636
|
fullWidth: true,
|
|
2379
2637
|
showActionsOnHover: true,
|
|
2380
2638
|
label: dynamicTag.label,
|
|
2381
|
-
startIcon: /* @__PURE__ */
|
|
2639
|
+
startIcon: /* @__PURE__ */ React65.createElement(DatabaseIcon, { fontSize: SIZE4 }),
|
|
2382
2640
|
...bindTrigger2(selectionPopoverState),
|
|
2383
|
-
actions: /* @__PURE__ */
|
|
2641
|
+
actions: /* @__PURE__ */ React65.createElement(React65.Fragment, null, /* @__PURE__ */ React65.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React65.createElement(
|
|
2384
2642
|
IconButton3,
|
|
2385
2643
|
{
|
|
2386
2644
|
size: SIZE4,
|
|
2387
2645
|
onClick: removeDynamicTag,
|
|
2388
2646
|
"aria-label": __42("Remove dynamic value", "elementor")
|
|
2389
2647
|
},
|
|
2390
|
-
/* @__PURE__ */
|
|
2648
|
+
/* @__PURE__ */ React65.createElement(XIcon2, { fontSize: SIZE4 })
|
|
2391
2649
|
))
|
|
2392
2650
|
}
|
|
2393
|
-
), /* @__PURE__ */
|
|
2651
|
+
), /* @__PURE__ */ React65.createElement(
|
|
2394
2652
|
Popover2,
|
|
2395
2653
|
{
|
|
2396
2654
|
disablePortal: true,
|
|
@@ -2398,32 +2656,32 @@ var DynamicSelectionControl = () => {
|
|
|
2398
2656
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
2399
2657
|
...bindPopover2(selectionPopoverState)
|
|
2400
2658
|
},
|
|
2401
|
-
/* @__PURE__ */
|
|
2659
|
+
/* @__PURE__ */ React65.createElement(Stack21, null, /* @__PURE__ */ React65.createElement(Stack21, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React65.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React65.createElement(Typography4, { variant: "subtitle2" }, __42("Dynamic Tags", "elementor")), /* @__PURE__ */ React65.createElement(IconButton3, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React65.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React65.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
2402
2660
|
));
|
|
2403
2661
|
};
|
|
2404
2662
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
2405
|
-
const popupId =
|
|
2663
|
+
const popupId = useId5();
|
|
2406
2664
|
const settingsPopupState = usePopupState3({ variant: "popover", popupId });
|
|
2407
2665
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
2408
2666
|
if (!hasDynamicSettings) {
|
|
2409
2667
|
return null;
|
|
2410
2668
|
}
|
|
2411
|
-
return /* @__PURE__ */
|
|
2669
|
+
return /* @__PURE__ */ React65.createElement(React65.Fragment, null, /* @__PURE__ */ React65.createElement(
|
|
2412
2670
|
IconButton3,
|
|
2413
2671
|
{
|
|
2414
2672
|
size: SIZE4,
|
|
2415
2673
|
...bindTrigger2(settingsPopupState),
|
|
2416
2674
|
"aria-label": __42("Settings", "elementor")
|
|
2417
2675
|
},
|
|
2418
|
-
/* @__PURE__ */
|
|
2419
|
-
), /* @__PURE__ */
|
|
2676
|
+
/* @__PURE__ */ React65.createElement(SettingsIcon, { fontSize: SIZE4 })
|
|
2677
|
+
), /* @__PURE__ */ React65.createElement(
|
|
2420
2678
|
Popover2,
|
|
2421
2679
|
{
|
|
2422
2680
|
disableScrollLock: true,
|
|
2423
2681
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
2424
2682
|
...bindPopover2(settingsPopupState)
|
|
2425
2683
|
},
|
|
2426
|
-
/* @__PURE__ */
|
|
2684
|
+
/* @__PURE__ */ React65.createElement(Paper, { component: Stack21, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React65.createElement(Stack21, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React65.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React65.createElement(Typography4, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React65.createElement(IconButton3, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React65.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React65.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
2427
2685
|
));
|
|
2428
2686
|
};
|
|
2429
2687
|
var DynamicSettings = ({ controls }) => {
|
|
@@ -2432,10 +2690,10 @@ var DynamicSettings = ({ controls }) => {
|
|
|
2432
2690
|
if (!tabs.length) {
|
|
2433
2691
|
return null;
|
|
2434
2692
|
}
|
|
2435
|
-
return /* @__PURE__ */
|
|
2436
|
-
return /* @__PURE__ */
|
|
2693
|
+
return /* @__PURE__ */ React65.createElement(React65.Fragment, null, /* @__PURE__ */ React65.createElement(Tabs2, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React65.createElement(Tab2, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React65.createElement(Divider10, null), tabs.map(({ value }, index) => {
|
|
2694
|
+
return /* @__PURE__ */ React65.createElement(TabPanel2, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React65.createElement(Stack21, { gap: 1, px: 2 }, value.items.map((item) => {
|
|
2437
2695
|
if (item.type === "control") {
|
|
2438
|
-
return /* @__PURE__ */
|
|
2696
|
+
return /* @__PURE__ */ React65.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
2439
2697
|
}
|
|
2440
2698
|
return null;
|
|
2441
2699
|
})));
|
|
@@ -2445,24 +2703,22 @@ var Control3 = ({ control }) => {
|
|
|
2445
2703
|
if (!getControlByType(control.type)) {
|
|
2446
2704
|
return null;
|
|
2447
2705
|
}
|
|
2448
|
-
return /* @__PURE__ */
|
|
2706
|
+
return /* @__PURE__ */ React65.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React65.createElement(ControlLabel30, null, control.label) : null, /* @__PURE__ */ React65.createElement(Control, { type: control.type, props: control.props }));
|
|
2449
2707
|
};
|
|
2450
2708
|
|
|
2451
2709
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
2452
|
-
import * as
|
|
2453
|
-
import { useBoundProp as
|
|
2710
|
+
import * as React66 from "react";
|
|
2711
|
+
import { useBoundProp as useBoundProp5 } from "@elementor/editor-controls";
|
|
2454
2712
|
import { DatabaseIcon as DatabaseIcon2 } from "@elementor/icons";
|
|
2455
2713
|
import { __ as __43 } from "@wordpress/i18n";
|
|
2456
2714
|
var usePropDynamicAction = () => {
|
|
2457
|
-
const {
|
|
2458
|
-
const { elementType } = useElement();
|
|
2459
|
-
const propType = elementType.propsSchema[bind];
|
|
2715
|
+
const { propType } = useBoundProp5();
|
|
2460
2716
|
const visible = !!propType && supportsDynamic(propType);
|
|
2461
2717
|
return {
|
|
2462
2718
|
visible,
|
|
2463
2719
|
icon: DatabaseIcon2,
|
|
2464
2720
|
title: __43("Dynamic Tags", "elementor"),
|
|
2465
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
2721
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React66.createElement(DynamicSelection, { onSelect: closePopover })
|
|
2466
2722
|
};
|
|
2467
2723
|
};
|
|
2468
2724
|
|
|
@@ -2503,6 +2759,6 @@ export {
|
|
|
2503
2759
|
registerGlobalClassMenuItem,
|
|
2504
2760
|
registerStateMenuItem,
|
|
2505
2761
|
replaceControl,
|
|
2506
|
-
|
|
2762
|
+
useBoundProp6 as useBoundProp
|
|
2507
2763
|
};
|
|
2508
2764
|
//# sourceMappingURL=index.mjs.map
|