@elementor/editor-editing-panel 1.34.0 → 1.36.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 +39 -0
- package/dist/index.js +210 -148
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +159 -97
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -13
- package/src/components/creatable-autocomplete/creatable-autocomplete.tsx +27 -15
- package/src/components/creatable-autocomplete/use-autocomplete-states.ts +15 -1
- package/src/components/css-classes/css-class-item.tsx +4 -1
- package/src/components/css-classes/css-class-selector.tsx +58 -44
- package/src/components/editing-panel-tabs.tsx +37 -20
- package/src/components/section.tsx +4 -3
- package/src/components/style-sections/layout-section/display-field.tsx +1 -1
- package/src/components/style-sections/position-section/position-section.tsx +1 -1
- package/src/hooks/use-state-by-element.ts +18 -0
- package/src/styles-inheritance/styles-inheritance-indicator.tsx +1 -1
- package/src/sync/get-elementor-globals.ts +0 -6
- package/src/sync/is-experiment-active.ts +0 -7
package/dist/index.js
CHANGED
|
@@ -47,9 +47,11 @@ var { registerControlReplacement, getControlReplacements } = (0, import_editor_c
|
|
|
47
47
|
|
|
48
48
|
// src/components/css-classes/css-class-selector.tsx
|
|
49
49
|
var React7 = __toESM(require("react"));
|
|
50
|
+
var import_react8 = require("react");
|
|
50
51
|
var import_editor_elements2 = require("@elementor/editor-elements");
|
|
51
52
|
var import_editor_props = require("@elementor/editor-props");
|
|
52
53
|
var import_editor_styles_repository4 = require("@elementor/editor-styles-repository");
|
|
54
|
+
var import_editor_ui3 = require("@elementor/editor-ui");
|
|
53
55
|
var import_icons2 = require("@elementor/icons");
|
|
54
56
|
var import_locations = require("@elementor/locations");
|
|
55
57
|
var import_ui6 = require("@elementor/ui");
|
|
@@ -213,7 +215,20 @@ function useInputState(validate) {
|
|
|
213
215
|
setError(errorMessage);
|
|
214
216
|
}
|
|
215
217
|
};
|
|
216
|
-
|
|
218
|
+
const handleInputBlur = () => {
|
|
219
|
+
setInputValue("");
|
|
220
|
+
setError(null);
|
|
221
|
+
};
|
|
222
|
+
return {
|
|
223
|
+
inputValue,
|
|
224
|
+
setInputValue,
|
|
225
|
+
error,
|
|
226
|
+
setError,
|
|
227
|
+
inputHandlers: {
|
|
228
|
+
onChange: handleInputChange,
|
|
229
|
+
onBlur: handleInputBlur
|
|
230
|
+
}
|
|
231
|
+
};
|
|
217
232
|
}
|
|
218
233
|
function useOpenState(initialOpen = false) {
|
|
219
234
|
const [open, setOpen] = (0, import_react4.useState)(initialOpen);
|
|
@@ -280,7 +295,8 @@ function useFilterOptions(parameters) {
|
|
|
280
295
|
}
|
|
281
296
|
|
|
282
297
|
// src/components/creatable-autocomplete/creatable-autocomplete.tsx
|
|
283
|
-
|
|
298
|
+
var CreatableAutocomplete = React4.forwardRef(CreatableAutocompleteInner);
|
|
299
|
+
function CreatableAutocompleteInner({
|
|
284
300
|
selected,
|
|
285
301
|
options: options12,
|
|
286
302
|
entityName,
|
|
@@ -289,8 +305,8 @@ function CreatableAutocomplete({
|
|
|
289
305
|
onCreate,
|
|
290
306
|
validate,
|
|
291
307
|
...props
|
|
292
|
-
}) {
|
|
293
|
-
const { inputValue, setInputValue, error, setError,
|
|
308
|
+
}, ref) {
|
|
309
|
+
const { inputValue, setInputValue, error, setError, inputHandlers } = useInputState(validate);
|
|
294
310
|
const { open, openDropdown, closeDropdown } = useOpenState(props.open);
|
|
295
311
|
const { createOption, loading } = useCreateOption({ onCreate, validate, setInputValue, setError, closeDropdown });
|
|
296
312
|
const [internalOptions, internalSelected] = (0, import_react6.useMemo)(
|
|
@@ -320,6 +336,7 @@ function CreatableAutocomplete({
|
|
|
320
336
|
));
|
|
321
337
|
},
|
|
322
338
|
...props,
|
|
339
|
+
ref,
|
|
323
340
|
freeSolo: true,
|
|
324
341
|
multiple: true,
|
|
325
342
|
clearOnBlur: true,
|
|
@@ -333,7 +350,7 @@ function CreatableAutocomplete({
|
|
|
333
350
|
disableCloseOnSelect: true,
|
|
334
351
|
value: internalSelected,
|
|
335
352
|
options: internalOptions,
|
|
336
|
-
ListboxComponent: error ? React4.forwardRef((_,
|
|
353
|
+
ListboxComponent: error ? React4.forwardRef((_, errorTextRef) => /* @__PURE__ */ React4.createElement(ErrorText, { ref: errorTextRef, error })) : void 0,
|
|
337
354
|
renderGroup: (params) => /* @__PURE__ */ React4.createElement(Group, { ...params }),
|
|
338
355
|
inputValue,
|
|
339
356
|
renderInput: (params) => {
|
|
@@ -343,7 +360,7 @@ function CreatableAutocomplete({
|
|
|
343
360
|
...params,
|
|
344
361
|
placeholder,
|
|
345
362
|
error: Boolean(error),
|
|
346
|
-
|
|
363
|
+
...inputHandlers,
|
|
347
364
|
sx: (theme) => ({
|
|
348
365
|
".MuiAutocomplete-inputRoot.MuiInputBase-adornedStart": {
|
|
349
366
|
paddingLeft: theme.spacing(0.25),
|
|
@@ -391,7 +408,7 @@ var ErrorText = React4.forwardRef(({ error = "error" }, ref) => {
|
|
|
391
408
|
padding: theme.spacing(2)
|
|
392
409
|
})
|
|
393
410
|
},
|
|
394
|
-
/* @__PURE__ */ React4.createElement(import_ui2.Typography, { variant: "caption", sx: { color: "error.main" } }, error)
|
|
411
|
+
/* @__PURE__ */ React4.createElement(import_ui2.Typography, { variant: "caption", sx: { color: "error.main", display: "inline-block" } }, error)
|
|
395
412
|
);
|
|
396
413
|
});
|
|
397
414
|
var StyledGroup = (0, import_ui2.styled)("li")`
|
|
@@ -633,7 +650,8 @@ function CssClassItem({
|
|
|
633
650
|
icon,
|
|
634
651
|
chipProps,
|
|
635
652
|
onClickActive,
|
|
636
|
-
renameLabel
|
|
653
|
+
renameLabel,
|
|
654
|
+
setError
|
|
637
655
|
}) {
|
|
638
656
|
const { meta, setMetaState } = useStyle();
|
|
639
657
|
const popupState = (0, import_ui5.usePopupState)({ variant: "popover" });
|
|
@@ -648,7 +666,8 @@ function CssClassItem({
|
|
|
648
666
|
} = (0, import_editor_ui2.useEditable)({
|
|
649
667
|
value: label,
|
|
650
668
|
onSubmit: renameLabel,
|
|
651
|
-
validation: validateLabel
|
|
669
|
+
validation: validateLabel,
|
|
670
|
+
onError: setError
|
|
652
671
|
});
|
|
653
672
|
const color = error ? "error" : colorProp;
|
|
654
673
|
const providerActions = provider ? import_editor_styles_repository3.stylesRepository.getProviderByKey(provider)?.actions : null;
|
|
@@ -669,7 +688,7 @@ function CssClassItem({
|
|
|
669
688
|
import_ui5.Chip,
|
|
670
689
|
{
|
|
671
690
|
size: CHIP_SIZE,
|
|
672
|
-
label: isEditing ? /* @__PURE__ */ React6.createElement(import_editor_ui2.EditableField, { ref,
|
|
691
|
+
label: isEditing ? /* @__PURE__ */ React6.createElement(import_editor_ui2.EditableField, { ref, ...getEditableProps() }) : /* @__PURE__ */ React6.createElement(import_editor_ui2.EllipsisWithTooltip, { maxWidth: "10ch", title: label, as: "div" }),
|
|
673
692
|
variant: isActive && !meta.state && !isEditing ? "filled" : "standard",
|
|
674
693
|
shape: "rounded",
|
|
675
694
|
icon,
|
|
@@ -750,51 +769,65 @@ function CssClassSelector() {
|
|
|
750
769
|
const options12 = useOptions();
|
|
751
770
|
const { value: appliedIds, setValue: setAppliedIds, pushValue: pushAppliedId } = useAppliedClassesIds();
|
|
752
771
|
const { id: activeId, setId: setActiveId } = useStyle();
|
|
772
|
+
const autocompleteRef = (0, import_react8.useRef)(null);
|
|
773
|
+
const [renameError, setRenameError] = (0, import_react8.useState)(null);
|
|
753
774
|
const handleApply = useHandleApply(appliedIds, setAppliedIds);
|
|
754
775
|
const { create, validate, entityName } = useCreateAction({ pushAppliedId, setActiveId });
|
|
755
776
|
const applied = useAppliedOptions(options12, appliedIds);
|
|
756
777
|
const active = applied.find((option) => option.value === activeId) ?? EMPTY_OPTION;
|
|
757
778
|
const showPlaceholder = applied.every(({ fixed }) => fixed);
|
|
758
779
|
return /* @__PURE__ */ React7.createElement(import_ui6.Stack, { p: 2 }, /* @__PURE__ */ React7.createElement(import_ui6.Stack, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React7.createElement(import_ui6.FormLabel, { htmlFor: ID, size: "small" }, (0, import_i18n3.__)("Classes", "elementor")), /* @__PURE__ */ React7.createElement(import_ui6.Stack, { direction: "row", gap: 1 }, /* @__PURE__ */ React7.createElement(ClassSelectorActionsSlot, null))), /* @__PURE__ */ React7.createElement(
|
|
759
|
-
|
|
780
|
+
import_editor_ui3.WarningInfotip,
|
|
760
781
|
{
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
{
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
782
|
+
open: Boolean(renameError),
|
|
783
|
+
text: renameError ?? "",
|
|
784
|
+
placement: "bottom",
|
|
785
|
+
width: autocompleteRef.current?.getBoundingClientRect().width,
|
|
786
|
+
offset: [0, -15]
|
|
787
|
+
},
|
|
788
|
+
/* @__PURE__ */ React7.createElement(
|
|
789
|
+
CreatableAutocomplete,
|
|
790
|
+
{
|
|
791
|
+
id: ID,
|
|
792
|
+
ref: autocompleteRef,
|
|
793
|
+
size: "tiny",
|
|
794
|
+
placeholder: showPlaceholder ? (0, import_i18n3.__)("Type class name", "elementor") : void 0,
|
|
795
|
+
options: options12,
|
|
796
|
+
selected: applied,
|
|
797
|
+
entityName,
|
|
798
|
+
onSelect: handleApply,
|
|
799
|
+
onCreate: create ?? void 0,
|
|
800
|
+
validate: validate ?? void 0,
|
|
801
|
+
limitTags: TAGS_LIMIT,
|
|
802
|
+
getLimitTagsText: (more) => /* @__PURE__ */ React7.createElement(import_ui6.Chip, { size: "tiny", variant: "standard", label: `+${more}`, clickable: true }),
|
|
803
|
+
renderTags: (values, getTagProps) => values.map((value, index) => {
|
|
804
|
+
const chipProps = getTagProps({ index });
|
|
805
|
+
const isActive = value.value === active?.value;
|
|
806
|
+
const renameLabel = (newLabel) => {
|
|
807
|
+
if (!value.value) {
|
|
808
|
+
throw new Error(`Cannot rename a class without style id`);
|
|
809
|
+
}
|
|
810
|
+
return updateClassByProvider(value.provider, { label: newLabel, id: value.value });
|
|
811
|
+
};
|
|
812
|
+
return /* @__PURE__ */ React7.createElement(
|
|
813
|
+
CssClassItem,
|
|
814
|
+
{
|
|
815
|
+
key: chipProps.key,
|
|
816
|
+
label: value.label,
|
|
817
|
+
provider: value.provider,
|
|
818
|
+
id: value.value,
|
|
819
|
+
isActive,
|
|
820
|
+
color: isActive && value.color ? value.color : "default",
|
|
821
|
+
icon: value.icon,
|
|
822
|
+
chipProps,
|
|
823
|
+
onClickActive: () => setActiveId(value.value),
|
|
824
|
+
renameLabel,
|
|
825
|
+
setError: setRenameError
|
|
826
|
+
}
|
|
827
|
+
);
|
|
828
|
+
})
|
|
829
|
+
}
|
|
830
|
+
)
|
|
798
831
|
));
|
|
799
832
|
}
|
|
800
833
|
var updateClassByProvider = (provider, data) => {
|
|
@@ -920,9 +953,9 @@ var React70 = __toESM(require("react"));
|
|
|
920
953
|
var import_editor_controls45 = require("@elementor/editor-controls");
|
|
921
954
|
var import_editor_elements8 = require("@elementor/editor-elements");
|
|
922
955
|
var import_editor_panels = require("@elementor/editor-panels");
|
|
923
|
-
var
|
|
956
|
+
var import_editor_ui4 = require("@elementor/editor-ui");
|
|
924
957
|
var import_icons23 = require("@elementor/icons");
|
|
925
|
-
var
|
|
958
|
+
var import_session5 = require("@elementor/session");
|
|
926
959
|
var import_ui58 = require("@elementor/ui");
|
|
927
960
|
var import_i18n46 = require("@wordpress/i18n");
|
|
928
961
|
|
|
@@ -931,7 +964,7 @@ var import_menus = require("@elementor/menus");
|
|
|
931
964
|
|
|
932
965
|
// src/popover-action.tsx
|
|
933
966
|
var React8 = __toESM(require("react"));
|
|
934
|
-
var
|
|
967
|
+
var import_react9 = require("react");
|
|
935
968
|
var import_icons3 = require("@elementor/icons");
|
|
936
969
|
var import_ui7 = require("@elementor/ui");
|
|
937
970
|
var SIZE = "tiny";
|
|
@@ -941,7 +974,7 @@ function PopoverAction({
|
|
|
941
974
|
icon: Icon,
|
|
942
975
|
popoverContent: PopoverContent2
|
|
943
976
|
}) {
|
|
944
|
-
const id = (0,
|
|
977
|
+
const id = (0, import_react9.useId)();
|
|
945
978
|
const popupState = (0, import_ui7.usePopupState)({
|
|
946
979
|
variant: "popover",
|
|
947
980
|
popupId: `elementor-popover-action-${id}`
|
|
@@ -981,25 +1014,25 @@ function EditorPanelErrorFallback() {
|
|
|
981
1014
|
|
|
982
1015
|
// src/components/editing-panel-tabs.tsx
|
|
983
1016
|
var React69 = __toESM(require("react"));
|
|
984
|
-
var
|
|
1017
|
+
var import_react26 = require("react");
|
|
985
1018
|
var import_ui57 = require("@elementor/ui");
|
|
986
1019
|
var import_i18n45 = require("@wordpress/i18n");
|
|
987
1020
|
|
|
988
1021
|
// src/contexts/scroll-context.tsx
|
|
989
1022
|
var React10 = __toESM(require("react"));
|
|
990
|
-
var
|
|
1023
|
+
var import_react10 = require("react");
|
|
991
1024
|
var import_ui9 = require("@elementor/ui");
|
|
992
|
-
var ScrollContext = (0,
|
|
1025
|
+
var ScrollContext = (0, import_react10.createContext)(void 0);
|
|
993
1026
|
var ScrollPanel = (0, import_ui9.styled)("div")`
|
|
994
1027
|
height: 100%;
|
|
995
1028
|
overflow-y: auto;
|
|
996
1029
|
`;
|
|
997
1030
|
var DEFAULT_SCROLL_DIRECTION = "up";
|
|
998
1031
|
function ScrollProvider({ children }) {
|
|
999
|
-
const [direction, setDirection] = (0,
|
|
1000
|
-
const ref = (0,
|
|
1001
|
-
const scrollPos = (0,
|
|
1002
|
-
(0,
|
|
1032
|
+
const [direction, setDirection] = (0, import_react10.useState)(DEFAULT_SCROLL_DIRECTION);
|
|
1033
|
+
const ref = (0, import_react10.useRef)(null);
|
|
1034
|
+
const scrollPos = (0, import_react10.useRef)(0);
|
|
1035
|
+
(0, import_react10.useEffect)(() => {
|
|
1003
1036
|
const scrollElement = ref.current;
|
|
1004
1037
|
if (!scrollElement) {
|
|
1005
1038
|
return;
|
|
@@ -1021,13 +1054,28 @@ function ScrollProvider({ children }) {
|
|
|
1021
1054
|
return /* @__PURE__ */ React10.createElement(ScrollContext.Provider, { value: { direction } }, /* @__PURE__ */ React10.createElement(ScrollPanel, { ref }, children));
|
|
1022
1055
|
}
|
|
1023
1056
|
function useScrollDirection() {
|
|
1024
|
-
return (0,
|
|
1057
|
+
return (0, import_react10.useContext)(ScrollContext)?.direction ?? DEFAULT_SCROLL_DIRECTION;
|
|
1025
1058
|
}
|
|
1026
1059
|
|
|
1060
|
+
// src/hooks/use-state-by-element.ts
|
|
1061
|
+
var import_react11 = require("react");
|
|
1062
|
+
var import_session = require("@elementor/session");
|
|
1063
|
+
var useStateByElement = (key, initialValue) => {
|
|
1064
|
+
const { element } = useElement();
|
|
1065
|
+
const lookup = `elementor/editor-state/${element.id}/${key}`;
|
|
1066
|
+
const storedValue = (0, import_session.getSessionStorageItem)(lookup);
|
|
1067
|
+
const [value, setValue] = (0, import_react11.useState)(storedValue ?? initialValue);
|
|
1068
|
+
const doUpdate = (newValue) => {
|
|
1069
|
+
(0, import_session.setSessionStorageItem)(lookup, newValue);
|
|
1070
|
+
setValue(newValue);
|
|
1071
|
+
};
|
|
1072
|
+
return [value, doUpdate];
|
|
1073
|
+
};
|
|
1074
|
+
|
|
1027
1075
|
// src/components/settings-tab.tsx
|
|
1028
1076
|
var React16 = __toESM(require("react"));
|
|
1029
1077
|
var import_editor_controls4 = require("@elementor/editor-controls");
|
|
1030
|
-
var
|
|
1078
|
+
var import_session2 = require("@elementor/session");
|
|
1031
1079
|
var import_ui14 = require("@elementor/ui");
|
|
1032
1080
|
|
|
1033
1081
|
// src/controls-registry/control.tsx
|
|
@@ -1116,7 +1164,7 @@ var SettingsField = ({ bind, children }) => {
|
|
|
1116
1164
|
|
|
1117
1165
|
// src/components/section.tsx
|
|
1118
1166
|
var React14 = __toESM(require("react"));
|
|
1119
|
-
var
|
|
1167
|
+
var import_react12 = require("react");
|
|
1120
1168
|
var import_ui12 = require("@elementor/ui");
|
|
1121
1169
|
|
|
1122
1170
|
// src/components/collapse-icon.tsx
|
|
@@ -1133,8 +1181,8 @@ var CollapseIcon = (0, import_ui11.styled)(import_icons4.ChevronDownIcon, {
|
|
|
1133
1181
|
|
|
1134
1182
|
// src/components/section.tsx
|
|
1135
1183
|
function Section({ title, children, defaultExpanded = false }) {
|
|
1136
|
-
const [isOpen, setIsOpen] = (
|
|
1137
|
-
const id = (0,
|
|
1184
|
+
const [isOpen, setIsOpen] = useStateByElement(title, !!defaultExpanded);
|
|
1185
|
+
const id = (0, import_react12.useId)();
|
|
1138
1186
|
const labelId = `label-${id}`;
|
|
1139
1187
|
const contentId = `content-${id}`;
|
|
1140
1188
|
return /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(
|
|
@@ -1142,7 +1190,7 @@ function Section({ title, children, defaultExpanded = false }) {
|
|
|
1142
1190
|
{
|
|
1143
1191
|
id: labelId,
|
|
1144
1192
|
"aria-controls": contentId,
|
|
1145
|
-
onClick: () => setIsOpen(
|
|
1193
|
+
onClick: () => setIsOpen(!isOpen),
|
|
1146
1194
|
sx: { "&:hover": { backgroundColor: "transparent" } }
|
|
1147
1195
|
},
|
|
1148
1196
|
/* @__PURE__ */ React14.createElement(
|
|
@@ -1166,7 +1214,7 @@ function SectionsList(props) {
|
|
|
1166
1214
|
// src/components/settings-tab.tsx
|
|
1167
1215
|
var SettingsTab = () => {
|
|
1168
1216
|
const { elementType, element } = useElement();
|
|
1169
|
-
return /* @__PURE__ */ React16.createElement(
|
|
1217
|
+
return /* @__PURE__ */ React16.createElement(import_session2.SessionStorageProvider, { prefix: element.id }, /* @__PURE__ */ React16.createElement(SectionsList, null, elementType.controls.map(({ type, value }, index) => {
|
|
1170
1218
|
if (type === "control") {
|
|
1171
1219
|
return /* @__PURE__ */ React16.createElement(Control2, { key: value.bind, control: value });
|
|
1172
1220
|
}
|
|
@@ -1191,27 +1239,27 @@ var Control2 = ({ control }) => {
|
|
|
1191
1239
|
|
|
1192
1240
|
// src/components/style-tab.tsx
|
|
1193
1241
|
var React68 = __toESM(require("react"));
|
|
1194
|
-
var
|
|
1242
|
+
var import_react25 = require("react");
|
|
1195
1243
|
var import_editor_props7 = require("@elementor/editor-props");
|
|
1196
1244
|
var import_editor_responsive2 = require("@elementor/editor-responsive");
|
|
1197
|
-
var
|
|
1245
|
+
var import_session4 = require("@elementor/session");
|
|
1198
1246
|
var import_ui56 = require("@elementor/ui");
|
|
1199
1247
|
var import_i18n44 = require("@wordpress/i18n");
|
|
1200
1248
|
|
|
1201
1249
|
// src/contexts/styles-inheritance-context.tsx
|
|
1202
1250
|
var React17 = __toESM(require("react"));
|
|
1203
|
-
var
|
|
1251
|
+
var import_react14 = require("react");
|
|
1204
1252
|
var import_editor_elements4 = require("@elementor/editor-elements");
|
|
1205
1253
|
var import_editor_props3 = require("@elementor/editor-props");
|
|
1206
1254
|
var import_editor_responsive = require("@elementor/editor-responsive");
|
|
1207
1255
|
var import_editor_styles_repository5 = require("@elementor/editor-styles-repository");
|
|
1208
1256
|
|
|
1209
1257
|
// src/hooks/use-styles-rerender.ts
|
|
1210
|
-
var
|
|
1258
|
+
var import_react13 = require("react");
|
|
1211
1259
|
var useStylesRerender = () => {
|
|
1212
1260
|
const { provider } = useStyle();
|
|
1213
|
-
const [, reRender] = (0,
|
|
1214
|
-
(0,
|
|
1261
|
+
const [, reRender] = (0, import_react13.useReducer)((p) => !p, false);
|
|
1262
|
+
(0, import_react13.useEffect)(() => provider?.subscribe(reRender), [provider]);
|
|
1215
1263
|
};
|
|
1216
1264
|
|
|
1217
1265
|
// src/styles-inheritance/create-snapshots-manager.ts
|
|
@@ -1372,7 +1420,7 @@ function buildStyleVariantsByMetaMapping(styleDefs) {
|
|
|
1372
1420
|
}
|
|
1373
1421
|
|
|
1374
1422
|
// src/contexts/styles-inheritance-context.tsx
|
|
1375
|
-
var Context4 = (0,
|
|
1423
|
+
var Context4 = (0, import_react14.createContext)(null);
|
|
1376
1424
|
function StyleInheritanceProvider({ children }) {
|
|
1377
1425
|
const styleDefs = useAppliedStyles();
|
|
1378
1426
|
const breakpointsTree = (0, import_editor_responsive.getBreakpointsTree)();
|
|
@@ -1380,7 +1428,7 @@ function StyleInheritanceProvider({ children }) {
|
|
|
1380
1428
|
return /* @__PURE__ */ React17.createElement(Context4.Provider, { value: { getSnapshot } }, children);
|
|
1381
1429
|
}
|
|
1382
1430
|
function useStylesInheritanceFields(fields) {
|
|
1383
|
-
const context = (0,
|
|
1431
|
+
const context = (0, import_react14.useContext)(Context4);
|
|
1384
1432
|
const { meta } = useStyle();
|
|
1385
1433
|
if (!context) {
|
|
1386
1434
|
throw new Error("useStylesInheritanceFields must be used within a StyleInheritanceProvider");
|
|
@@ -1414,10 +1462,10 @@ var useBaseStyles = () => {
|
|
|
1414
1462
|
};
|
|
1415
1463
|
|
|
1416
1464
|
// src/hooks/use-active-style-def-id.ts
|
|
1417
|
-
var
|
|
1465
|
+
var import_react15 = require("react");
|
|
1418
1466
|
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
1419
1467
|
function useActiveStyleDefId(classProp) {
|
|
1420
|
-
const [activeStyledDefId, setActiveStyledDefId] = (0,
|
|
1468
|
+
const [activeStyledDefId, setActiveStyledDefId] = (0, import_react15.useState)(null);
|
|
1421
1469
|
const appliedClassesIds = useAppliedClassesIds2(classProp)?.value || [];
|
|
1422
1470
|
const fallback = useFirstAppliedClass(appliedClassesIds);
|
|
1423
1471
|
const activeAndAppliedClassId = useActiveAndAppliedClassId(activeStyledDefId, appliedClassesIds);
|
|
@@ -1447,7 +1495,7 @@ var import_editor_controls6 = require("@elementor/editor-controls");
|
|
|
1447
1495
|
var import_editor_styles3 = require("@elementor/editor-styles");
|
|
1448
1496
|
|
|
1449
1497
|
// src/hooks/use-styles-fields.ts
|
|
1450
|
-
var
|
|
1498
|
+
var import_react16 = require("react");
|
|
1451
1499
|
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
1452
1500
|
var import_editor_styles = require("@elementor/editor-styles");
|
|
1453
1501
|
var import_editor_styles_repository6 = require("@elementor/editor-styles-repository");
|
|
@@ -1501,7 +1549,7 @@ function getProps({ styleId, elementId, provider, meta, propNames }) {
|
|
|
1501
1549
|
);
|
|
1502
1550
|
}
|
|
1503
1551
|
function useUndoableCreateElementStyle() {
|
|
1504
|
-
return (0,
|
|
1552
|
+
return (0, import_react16.useMemo)(() => {
|
|
1505
1553
|
return (0, import_editor_v1_adapters.undoable)(
|
|
1506
1554
|
{
|
|
1507
1555
|
do: (payload) => {
|
|
@@ -1529,7 +1577,7 @@ function useUndoableCreateElementStyle() {
|
|
|
1529
1577
|
}, []);
|
|
1530
1578
|
}
|
|
1531
1579
|
function useUndoableUpdateStyle() {
|
|
1532
|
-
return (0,
|
|
1580
|
+
return (0, import_react16.useMemo)(() => {
|
|
1533
1581
|
return (0, import_editor_v1_adapters.undoable)(
|
|
1534
1582
|
{
|
|
1535
1583
|
do: ({ elementId, styleId, provider, meta, props }) => {
|
|
@@ -1584,45 +1632,26 @@ function useStylesField(propName) {
|
|
|
1584
1632
|
|
|
1585
1633
|
// src/styles-inheritance/styles-inheritance-indicator.tsx
|
|
1586
1634
|
var React19 = __toESM(require("react"));
|
|
1587
|
-
var
|
|
1635
|
+
var import_react19 = require("react");
|
|
1588
1636
|
var import_editor_controls5 = require("@elementor/editor-controls");
|
|
1589
1637
|
var import_editor_styles_repository7 = require("@elementor/editor-styles-repository");
|
|
1638
|
+
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
1590
1639
|
var import_ui16 = require("@elementor/ui");
|
|
1591
1640
|
var import_i18n5 = require("@wordpress/i18n");
|
|
1592
1641
|
|
|
1593
|
-
// src/sync/get-elementor-globals.ts
|
|
1594
|
-
var getElementorConfig = () => {
|
|
1595
|
-
const extendedWindow = window;
|
|
1596
|
-
return extendedWindow.elementor?.config ?? {};
|
|
1597
|
-
};
|
|
1598
|
-
var getElementorFrontendConfig = () => {
|
|
1599
|
-
const extendedWindow = window;
|
|
1600
|
-
return extendedWindow.elementorFrontend?.config ?? {};
|
|
1601
|
-
};
|
|
1602
|
-
var getElementorCommonConfig = () => {
|
|
1603
|
-
const extendedWindow = window;
|
|
1604
|
-
return extendedWindow.elementorCommon?.config ?? {};
|
|
1605
|
-
};
|
|
1606
|
-
|
|
1607
|
-
// src/sync/is-experiment-active.ts
|
|
1608
|
-
var isExperimentActive = (experiment) => {
|
|
1609
|
-
const allFeatures = getElementorCommonConfig()?.experimentalFeatures ?? {};
|
|
1610
|
-
return !!allFeatures?.[experiment];
|
|
1611
|
-
};
|
|
1612
|
-
|
|
1613
1642
|
// src/styles-inheritance/styles-inheritance-infotip.tsx
|
|
1614
1643
|
var React18 = __toESM(require("react"));
|
|
1615
|
-
var
|
|
1644
|
+
var import_react18 = require("react");
|
|
1616
1645
|
var import_editor_canvas = require("@elementor/editor-canvas");
|
|
1617
1646
|
var import_editor_styles2 = require("@elementor/editor-styles");
|
|
1618
1647
|
var import_ui15 = require("@elementor/ui");
|
|
1619
1648
|
|
|
1620
1649
|
// src/hooks/use-normalized-inheritance-chain-items.tsx
|
|
1621
|
-
var
|
|
1650
|
+
var import_react17 = require("react");
|
|
1622
1651
|
var MAXIMUM_ITEMS = 2;
|
|
1623
1652
|
var useNormalizedInheritanceChainItems = (inheritanceChain, bind, resolve) => {
|
|
1624
|
-
const [items3, setItems] = (0,
|
|
1625
|
-
(0,
|
|
1653
|
+
const [items3, setItems] = (0, import_react17.useState)([]);
|
|
1654
|
+
(0, import_react17.useEffect)(() => {
|
|
1626
1655
|
(async () => {
|
|
1627
1656
|
const normalizedItems = await Promise.all(
|
|
1628
1657
|
inheritanceChain.filter((item) => item.style?.label).map((item, index) => normalizeInheritanceItem(item, index, bind, resolve))
|
|
@@ -1659,7 +1688,7 @@ var getTransformedValue = async (item, bind, resolve) => {
|
|
|
1659
1688
|
|
|
1660
1689
|
// src/styles-inheritance/styles-inheritance-infotip.tsx
|
|
1661
1690
|
var StyleIndicatorInfotip = ({ inheritanceChain, bind }) => {
|
|
1662
|
-
const resolve = (0,
|
|
1691
|
+
const resolve = (0, import_react18.useMemo)(() => {
|
|
1663
1692
|
const stylesSchema = (0, import_editor_styles2.getStylesSchema)();
|
|
1664
1693
|
return (0, import_editor_canvas.createPropsResolver)({
|
|
1665
1694
|
transformers: import_editor_canvas.styleTransformersRegistry,
|
|
@@ -1677,7 +1706,7 @@ var StyleIndicatorInfotip = ({ inheritanceChain, bind }) => {
|
|
|
1677
1706
|
|
|
1678
1707
|
// src/styles-inheritance/styles-inheritance-indicator.tsx
|
|
1679
1708
|
var StylesInheritanceIndicator = () => {
|
|
1680
|
-
const [open, setOpen] = (0,
|
|
1709
|
+
const [open, setOpen] = (0, import_react19.useState)(false);
|
|
1681
1710
|
const { value, path } = (0, import_editor_controls5.useBoundProp)();
|
|
1682
1711
|
const { id: currentStyleId, provider: currentStyleProvider, meta: currentStyleMeta } = useStyle();
|
|
1683
1712
|
const [bind] = path;
|
|
@@ -1694,7 +1723,7 @@ var StylesInheritanceIndicator = () => {
|
|
|
1694
1723
|
const hasValue = value !== null && value !== void 0;
|
|
1695
1724
|
const label = getLabel({ isFinalValue, hasValue });
|
|
1696
1725
|
const variantType = getVariant({ isFinalValue, hasValue, currentStyleProvider });
|
|
1697
|
-
const eIndicationsPopover = isExperimentActive("e_indications_popover");
|
|
1726
|
+
const eIndicationsPopover = (0, import_editor_v1_adapters2.isExperimentActive)("e_indications_popover");
|
|
1698
1727
|
if (!eIndicationsPopover) {
|
|
1699
1728
|
return /* @__PURE__ */ React19.createElement(StyleIndicator, { variant: variantType, "aria-label": label });
|
|
1700
1729
|
}
|
|
@@ -1859,6 +1888,18 @@ var import_i18n8 = require("@wordpress/i18n");
|
|
|
1859
1888
|
|
|
1860
1889
|
// src/hooks/use-direction.ts
|
|
1861
1890
|
var import_ui23 = require("@elementor/ui");
|
|
1891
|
+
|
|
1892
|
+
// src/sync/get-elementor-globals.ts
|
|
1893
|
+
var getElementorConfig = () => {
|
|
1894
|
+
const extendedWindow = window;
|
|
1895
|
+
return extendedWindow.elementor?.config ?? {};
|
|
1896
|
+
};
|
|
1897
|
+
var getElementorFrontendConfig = () => {
|
|
1898
|
+
const extendedWindow = window;
|
|
1899
|
+
return extendedWindow.elementorFrontend?.config ?? {};
|
|
1900
|
+
};
|
|
1901
|
+
|
|
1902
|
+
// src/hooks/use-direction.ts
|
|
1862
1903
|
function useDirection() {
|
|
1863
1904
|
const theme = (0, import_ui23.useTheme)();
|
|
1864
1905
|
const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!getElementorFrontendConfig()?.is_rtl;
|
|
@@ -2005,14 +2046,14 @@ var import_editor_elements7 = require("@elementor/editor-elements");
|
|
|
2005
2046
|
var import_i18n21 = require("@wordpress/i18n");
|
|
2006
2047
|
|
|
2007
2048
|
// src/hooks/use-computed-style.ts
|
|
2008
|
-
var
|
|
2049
|
+
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
2009
2050
|
function useComputedStyle(elementId) {
|
|
2010
|
-
return (0,
|
|
2051
|
+
return (0, import_editor_v1_adapters3.__privateUseListenTo)(
|
|
2011
2052
|
[
|
|
2012
|
-
(0,
|
|
2013
|
-
(0,
|
|
2014
|
-
(0,
|
|
2015
|
-
(0,
|
|
2053
|
+
(0, import_editor_v1_adapters3.windowEvent)("elementor/device-mode/change"),
|
|
2054
|
+
(0, import_editor_v1_adapters3.commandEndEvent)("document/elements/reset-style"),
|
|
2055
|
+
(0, import_editor_v1_adapters3.commandEndEvent)("document/elements/settings"),
|
|
2056
|
+
(0, import_editor_v1_adapters3.commandEndEvent)("document/elements/paste-style")
|
|
2016
2057
|
],
|
|
2017
2058
|
() => {
|
|
2018
2059
|
if (!elementId) {
|
|
@@ -2038,7 +2079,7 @@ var import_i18n11 = require("@wordpress/i18n");
|
|
|
2038
2079
|
|
|
2039
2080
|
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
2040
2081
|
var React33 = __toESM(require("react"));
|
|
2041
|
-
var
|
|
2082
|
+
var import_react20 = require("react");
|
|
2042
2083
|
var import_ui26 = require("@elementor/ui");
|
|
2043
2084
|
var CLOCKWISE_ANGLES = {
|
|
2044
2085
|
row: 0,
|
|
@@ -2059,7 +2100,7 @@ var RotatedIcon = ({
|
|
|
2059
2100
|
offset = 0,
|
|
2060
2101
|
disableRotationForReversed = false
|
|
2061
2102
|
}) => {
|
|
2062
|
-
const rotate = (0,
|
|
2103
|
+
const rotate = (0, import_react20.useRef)(useGetTargetAngle(isClockwise, offset, disableRotationForReversed));
|
|
2063
2104
|
rotate.current = useGetTargetAngle(isClockwise, offset, disableRotationForReversed, rotate);
|
|
2064
2105
|
return /* @__PURE__ */ React33.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
2065
2106
|
};
|
|
@@ -2256,6 +2297,7 @@ var AlignSelfChild = ({ parentStyleDirection }) => {
|
|
|
2256
2297
|
// src/components/style-sections/layout-section/display-field.tsx
|
|
2257
2298
|
var React37 = __toESM(require("react"));
|
|
2258
2299
|
var import_editor_controls17 = require("@elementor/editor-controls");
|
|
2300
|
+
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
2259
2301
|
var import_ui30 = require("@elementor/ui");
|
|
2260
2302
|
var import_i18n14 = require("@wordpress/i18n");
|
|
2261
2303
|
var displayFieldItems = [
|
|
@@ -2279,7 +2321,7 @@ var displayFieldItems = [
|
|
|
2279
2321
|
}
|
|
2280
2322
|
];
|
|
2281
2323
|
var DisplayField = () => {
|
|
2282
|
-
const isDisplayNoneFeatureActive = isExperimentActive("e_v_3_30");
|
|
2324
|
+
const isDisplayNoneFeatureActive = (0, import_editor_v1_adapters4.isExperimentActive)("e_v_3_30");
|
|
2283
2325
|
const items3 = [...displayFieldItems];
|
|
2284
2326
|
if (isDisplayNoneFeatureActive) {
|
|
2285
2327
|
items3.push({
|
|
@@ -2345,7 +2387,7 @@ var FlexDirectionField = () => {
|
|
|
2345
2387
|
|
|
2346
2388
|
// src/components/style-sections/layout-section/flex-order-field.tsx
|
|
2347
2389
|
var React39 = __toESM(require("react"));
|
|
2348
|
-
var
|
|
2390
|
+
var import_react21 = require("react");
|
|
2349
2391
|
var import_editor_controls19 = require("@elementor/editor-controls");
|
|
2350
2392
|
var import_icons12 = require("@elementor/icons");
|
|
2351
2393
|
var import_ui32 = require("@elementor/ui");
|
|
@@ -2381,7 +2423,7 @@ var items = [
|
|
|
2381
2423
|
];
|
|
2382
2424
|
var FlexOrderField = () => {
|
|
2383
2425
|
const { isSiteRtl } = useDirection(), [order, setOrder] = useStylesField("order");
|
|
2384
|
-
const [groupControlValue, setGroupControlValue] = (0,
|
|
2426
|
+
const [groupControlValue, setGroupControlValue] = (0, import_react21.useState)(getGroupControlValue(order?.value || null));
|
|
2385
2427
|
const handleToggleButtonChange = (group) => {
|
|
2386
2428
|
setGroupControlValue(group);
|
|
2387
2429
|
if (!group || group === CUSTOM) {
|
|
@@ -2419,7 +2461,7 @@ var getGroupControlValue = (order) => {
|
|
|
2419
2461
|
|
|
2420
2462
|
// src/components/style-sections/layout-section/flex-size-field.tsx
|
|
2421
2463
|
var React40 = __toESM(require("react"));
|
|
2422
|
-
var
|
|
2464
|
+
var import_react22 = require("react");
|
|
2423
2465
|
var import_editor_controls20 = require("@elementor/editor-controls");
|
|
2424
2466
|
var import_editor_props6 = require("@elementor/editor-props");
|
|
2425
2467
|
var import_icons13 = require("@elementor/icons");
|
|
@@ -2452,7 +2494,7 @@ var FlexSizeField = () => {
|
|
|
2452
2494
|
const grow = fields?.["flex-grow"]?.value || null;
|
|
2453
2495
|
const shrink = fields?.["flex-shrink"]?.value || null;
|
|
2454
2496
|
const basis = fields?.["flex-basis"]?.value || null;
|
|
2455
|
-
const currentGroup = (0,
|
|
2497
|
+
const currentGroup = (0, import_react22.useMemo)(() => getActiveGroup({ grow, shrink, basis }), [grow, shrink, basis]), [activeGroup, setActiveGroup] = (0, import_react22.useState)(currentGroup);
|
|
2456
2498
|
const onChangeGroup = (group = null) => {
|
|
2457
2499
|
setActiveGroup(group);
|
|
2458
2500
|
if (!group || group === "custom") {
|
|
@@ -2629,7 +2671,8 @@ var shouldDisplayFlexFields = (display, local) => {
|
|
|
2629
2671
|
|
|
2630
2672
|
// src/components/style-sections/position-section/position-section.tsx
|
|
2631
2673
|
var React49 = __toESM(require("react"));
|
|
2632
|
-
var
|
|
2674
|
+
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
2675
|
+
var import_session3 = require("@elementor/session");
|
|
2633
2676
|
|
|
2634
2677
|
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
2635
2678
|
var React45 = __toESM(require("react"));
|
|
@@ -2699,7 +2742,7 @@ var PositionSection = () => {
|
|
|
2699
2742
|
"inset-inline-end"
|
|
2700
2743
|
]);
|
|
2701
2744
|
const [dimensionsValuesFromHistory, updateDimensionsHistory, clearDimensionsHistory] = usePersistDimensions();
|
|
2702
|
-
const isCssIdFeatureActive = isExperimentActive("e_v_3_30");
|
|
2745
|
+
const isCssIdFeatureActive = (0, import_editor_v1_adapters5.isExperimentActive)("e_v_3_30");
|
|
2703
2746
|
const onPositionChange = (newPosition, previousPosition) => {
|
|
2704
2747
|
if (newPosition === "static") {
|
|
2705
2748
|
if (dimensionsValues) {
|
|
@@ -2725,7 +2768,7 @@ var usePersistDimensions = () => {
|
|
|
2725
2768
|
const { id: styleDefID, meta } = useStyle();
|
|
2726
2769
|
const styleVariantPath = `styles/${styleDefID}/${meta.breakpoint || "desktop"}/${meta.state || "null"}`;
|
|
2727
2770
|
const dimensionsPath = `${styleVariantPath}/dimensions`;
|
|
2728
|
-
return (0,
|
|
2771
|
+
return (0, import_session3.useSessionStorage)(dimensionsPath);
|
|
2729
2772
|
};
|
|
2730
2773
|
|
|
2731
2774
|
// src/components/style-sections/size-section/size-section.tsx
|
|
@@ -2807,11 +2850,11 @@ var React67 = __toESM(require("react"));
|
|
|
2807
2850
|
|
|
2808
2851
|
// src/components/collapsible-content.tsx
|
|
2809
2852
|
var React53 = __toESM(require("react"));
|
|
2810
|
-
var
|
|
2853
|
+
var import_react23 = require("react");
|
|
2811
2854
|
var import_ui43 = require("@elementor/ui");
|
|
2812
2855
|
var import_i18n29 = require("@wordpress/i18n");
|
|
2813
2856
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
2814
|
-
const [open, setOpen] = (0,
|
|
2857
|
+
const [open, setOpen] = (0, import_react23.useState)(defaultOpen);
|
|
2815
2858
|
const handleToggle = () => {
|
|
2816
2859
|
setOpen((prevOpen) => !prevOpen);
|
|
2817
2860
|
};
|
|
@@ -2837,7 +2880,7 @@ var import_ui44 = require("@elementor/ui");
|
|
|
2837
2880
|
var import_i18n31 = require("@wordpress/i18n");
|
|
2838
2881
|
|
|
2839
2882
|
// src/components/style-sections/typography-section/hooks/use-font-families.ts
|
|
2840
|
-
var
|
|
2883
|
+
var import_react24 = require("react");
|
|
2841
2884
|
var import_i18n30 = require("@wordpress/i18n");
|
|
2842
2885
|
var supportedCategories = {
|
|
2843
2886
|
system: (0, import_i18n30.__)("System", "elementor"),
|
|
@@ -2854,7 +2897,7 @@ var getFontFamilies = () => {
|
|
|
2854
2897
|
};
|
|
2855
2898
|
var useFontFamilies = () => {
|
|
2856
2899
|
const fontFamilies = getFontFamilies();
|
|
2857
|
-
return (0,
|
|
2900
|
+
return (0, import_react24.useMemo)(() => {
|
|
2858
2901
|
const categoriesOrder = ["system", "custom", "googlefonts"];
|
|
2859
2902
|
return Object.entries(fontFamilies || {}).reduce((acc, [font, category]) => {
|
|
2860
2903
|
if (!supportedCategories[category]) {
|
|
@@ -3158,7 +3201,7 @@ var stickyHeaderStyles = {
|
|
|
3158
3201
|
var StyleTab = () => {
|
|
3159
3202
|
const currentClassesProp = useCurrentClassesProp();
|
|
3160
3203
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
3161
|
-
const [activeStyleState, setActiveStyleState] = (0,
|
|
3204
|
+
const [activeStyleState, setActiveStyleState] = (0, import_react25.useState)(null);
|
|
3162
3205
|
const breakpoint = (0, import_editor_responsive2.useActiveBreakpoint)();
|
|
3163
3206
|
return /* @__PURE__ */ React68.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React68.createElement(
|
|
3164
3207
|
StyleProvider,
|
|
@@ -3171,7 +3214,7 @@ var StyleTab = () => {
|
|
|
3171
3214
|
},
|
|
3172
3215
|
setMetaState: setActiveStyleState
|
|
3173
3216
|
},
|
|
3174
|
-
/* @__PURE__ */ React68.createElement(
|
|
3217
|
+
/* @__PURE__ */ React68.createElement(import_session4.SessionStorageProvider, { prefix: activeStyleDefId ?? "" }, /* @__PURE__ */ React68.createElement(StyleInheritanceProvider, null, /* @__PURE__ */ React68.createElement(ClassesHeader, null, /* @__PURE__ */ React68.createElement(CssClassSelector, null), /* @__PURE__ */ React68.createElement(import_ui56.Divider, null)), /* @__PURE__ */ React68.createElement(SectionsList, null, /* @__PURE__ */ React68.createElement(Section, { title: (0, import_i18n44.__)("Layout", "elementor") }, /* @__PURE__ */ React68.createElement(LayoutSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: (0, import_i18n44.__)("Spacing", "elementor") }, /* @__PURE__ */ React68.createElement(SpacingSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: (0, import_i18n44.__)("Size", "elementor") }, /* @__PURE__ */ React68.createElement(SizeSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: (0, import_i18n44.__)("Position", "elementor") }, /* @__PURE__ */ React68.createElement(PositionSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: (0, import_i18n44.__)("Typography", "elementor") }, /* @__PURE__ */ React68.createElement(TypographySection, null)), /* @__PURE__ */ React68.createElement(Section, { title: (0, import_i18n44.__)("Background", "elementor") }, /* @__PURE__ */ React68.createElement(BackgroundSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: (0, import_i18n44.__)("Border", "elementor") }, /* @__PURE__ */ React68.createElement(BorderSection, null)), /* @__PURE__ */ React68.createElement(Section, { title: (0, import_i18n44.__)("Effects", "elementor") }, /* @__PURE__ */ React68.createElement(EffectsSection, null)))))
|
|
3175
3218
|
));
|
|
3176
3219
|
};
|
|
3177
3220
|
function ClassesHeader({ children }) {
|
|
@@ -3192,13 +3235,32 @@ function useCurrentClassesProp() {
|
|
|
3192
3235
|
// src/components/editing-panel-tabs.tsx
|
|
3193
3236
|
var EditingPanelTabs = () => {
|
|
3194
3237
|
const { element } = useElement();
|
|
3195
|
-
const { getTabProps, getTabPanelProps, getTabsProps } = (0, import_ui57.useTabs)("settings");
|
|
3196
3238
|
return (
|
|
3197
3239
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
3198
3240
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
3199
|
-
/* @__PURE__ */ React69.createElement(
|
|
3241
|
+
/* @__PURE__ */ React69.createElement(import_react26.Fragment, { key: element.id }, /* @__PURE__ */ React69.createElement(PanelTabContent, null))
|
|
3200
3242
|
);
|
|
3201
3243
|
};
|
|
3244
|
+
var PanelTabContent = () => {
|
|
3245
|
+
const defaultComponentTab = "settings";
|
|
3246
|
+
const [currentTab, setCurrentTab] = useStateByElement("tab", defaultComponentTab);
|
|
3247
|
+
const { getTabProps, getTabPanelProps, getTabsProps } = (0, import_ui57.useTabs)(currentTab);
|
|
3248
|
+
return /* @__PURE__ */ React69.createElement(ScrollProvider, null, /* @__PURE__ */ React69.createElement(import_ui57.Stack, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React69.createElement(import_ui57.Stack, { sx: { ...stickyHeaderStyles, top: 0 } }, /* @__PURE__ */ React69.createElement(
|
|
3249
|
+
import_ui57.Tabs,
|
|
3250
|
+
{
|
|
3251
|
+
variant: "fullWidth",
|
|
3252
|
+
size: "small",
|
|
3253
|
+
sx: { mt: 0.5 },
|
|
3254
|
+
...getTabsProps(),
|
|
3255
|
+
onChange: (_, newValue) => {
|
|
3256
|
+
getTabsProps().onChange(_, newValue);
|
|
3257
|
+
setCurrentTab(newValue);
|
|
3258
|
+
}
|
|
3259
|
+
},
|
|
3260
|
+
/* @__PURE__ */ React69.createElement(import_ui57.Tab, { label: (0, import_i18n45.__)("General", "elementor"), ...getTabProps("settings") }),
|
|
3261
|
+
/* @__PURE__ */ React69.createElement(import_ui57.Tab, { label: (0, import_i18n45.__)("Style", "elementor"), ...getTabProps("style") })
|
|
3262
|
+
), /* @__PURE__ */ React69.createElement(import_ui57.Divider, null)), /* @__PURE__ */ React69.createElement(import_ui57.TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React69.createElement(SettingsTab, null)), /* @__PURE__ */ React69.createElement(import_ui57.TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React69.createElement(StyleTab, null))));
|
|
3263
|
+
};
|
|
3202
3264
|
|
|
3203
3265
|
// src/components/editing-panel.tsx
|
|
3204
3266
|
var { useMenuItems } = controlActionsMenu;
|
|
@@ -3210,7 +3272,7 @@ var EditingPanel = () => {
|
|
|
3210
3272
|
return null;
|
|
3211
3273
|
}
|
|
3212
3274
|
const panelTitle = (0, import_i18n46.__)("Edit %s", "elementor").replace("%s", elementType.title);
|
|
3213
|
-
return /* @__PURE__ */ React70.createElement(import_ui58.ErrorBoundary, { fallback: /* @__PURE__ */ React70.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React70.createElement(
|
|
3275
|
+
return /* @__PURE__ */ React70.createElement(import_ui58.ErrorBoundary, { fallback: /* @__PURE__ */ React70.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React70.createElement(import_session5.SessionStorageProvider, { prefix: "elementor" }, /* @__PURE__ */ React70.createElement(import_editor_ui4.ThemeProvider, null, /* @__PURE__ */ React70.createElement(import_editor_panels.Panel, null, /* @__PURE__ */ React70.createElement(import_editor_panels.PanelHeader, null, /* @__PURE__ */ React70.createElement(import_editor_panels.PanelHeaderTitle, null, panelTitle), /* @__PURE__ */ React70.createElement(import_icons23.AtomIcon, { fontSize: "small", sx: { color: "text.tertiary" } })), /* @__PURE__ */ React70.createElement(import_editor_panels.PanelBody, null, /* @__PURE__ */ React70.createElement(import_editor_controls45.ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React70.createElement(import_editor_controls45.ControlReplacementsProvider, { replacements: controlReplacements }, /* @__PURE__ */ React70.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React70.createElement(EditingPanelTabs, null)))))))));
|
|
3214
3276
|
};
|
|
3215
3277
|
|
|
3216
3278
|
// src/panel.ts
|
|
@@ -3223,11 +3285,11 @@ var { panel, usePanelActions, usePanelStatus } = (0, import_editor_panels2.__cre
|
|
|
3223
3285
|
var import_editor = require("@elementor/editor");
|
|
3224
3286
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
3225
3287
|
var import_editor_panels3 = require("@elementor/editor-panels");
|
|
3226
|
-
var
|
|
3288
|
+
var import_editor_v1_adapters7 = require("@elementor/editor-v1-adapters");
|
|
3227
3289
|
|
|
3228
3290
|
// src/hooks/use-open-editor-panel.ts
|
|
3229
|
-
var
|
|
3230
|
-
var
|
|
3291
|
+
var import_react27 = require("react");
|
|
3292
|
+
var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
3231
3293
|
|
|
3232
3294
|
// src/sync/is-atomic-widget-selected.ts
|
|
3233
3295
|
var import_editor_elements9 = require("@elementor/editor-elements");
|
|
@@ -3243,8 +3305,8 @@ var isAtomicWidgetSelected = () => {
|
|
|
3243
3305
|
// src/hooks/use-open-editor-panel.ts
|
|
3244
3306
|
var useOpenEditorPanel = () => {
|
|
3245
3307
|
const { open } = usePanelActions();
|
|
3246
|
-
(0,
|
|
3247
|
-
return (0,
|
|
3308
|
+
(0, import_react27.useEffect)(() => {
|
|
3309
|
+
return (0, import_editor_v1_adapters6.__privateListenTo)((0, import_editor_v1_adapters6.commandStartEvent)("panel/editor/open"), () => {
|
|
3248
3310
|
if (isAtomicWidgetSelected()) {
|
|
3249
3311
|
open();
|
|
3250
3312
|
}
|
|
@@ -3274,11 +3336,11 @@ var import_ui59 = require("@elementor/ui");
|
|
|
3274
3336
|
var PopoverContent = ({ alignItems, gap = 1.5, p, children }) => /* @__PURE__ */ React71.createElement(import_ui59.Stack, { alignItems, gap, p }, children);
|
|
3275
3337
|
|
|
3276
3338
|
// src/hooks/use-persist-dynamic-value.ts
|
|
3277
|
-
var
|
|
3339
|
+
var import_session6 = require("@elementor/session");
|
|
3278
3340
|
var usePersistDynamicValue = (propKey) => {
|
|
3279
3341
|
const { element } = useElement();
|
|
3280
3342
|
const prefixedKey = `dynamic/non-dynamic-values-history/${element.id}/${propKey}`;
|
|
3281
|
-
return (0,
|
|
3343
|
+
return (0, import_session6.useSessionStorage)(prefixedKey);
|
|
3282
3344
|
};
|
|
3283
3345
|
|
|
3284
3346
|
// src/dynamics/dynamic-control.tsx
|
|
@@ -3286,10 +3348,10 @@ var React72 = __toESM(require("react"));
|
|
|
3286
3348
|
var import_editor_controls47 = require("@elementor/editor-controls");
|
|
3287
3349
|
|
|
3288
3350
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
3289
|
-
var
|
|
3351
|
+
var import_react29 = require("react");
|
|
3290
3352
|
|
|
3291
3353
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
3292
|
-
var
|
|
3354
|
+
var import_react28 = require("react");
|
|
3293
3355
|
var import_editor_controls46 = require("@elementor/editor-controls");
|
|
3294
3356
|
|
|
3295
3357
|
// src/dynamics/sync/get-elementor-config.ts
|
|
@@ -3341,7 +3403,7 @@ var usePropDynamicTags = () => {
|
|
|
3341
3403
|
const propDynamicType = getDynamicPropType(propType);
|
|
3342
3404
|
categories = propDynamicType?.settings.categories || [];
|
|
3343
3405
|
}
|
|
3344
|
-
return (0,
|
|
3406
|
+
return (0, import_react28.useMemo)(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
3345
3407
|
};
|
|
3346
3408
|
var getDynamicTagsByCategories = (categories) => {
|
|
3347
3409
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -3357,7 +3419,7 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
3357
3419
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
3358
3420
|
var useDynamicTag = (tagName) => {
|
|
3359
3421
|
const dynamicTags = usePropDynamicTags();
|
|
3360
|
-
return (0,
|
|
3422
|
+
return (0, import_react29.useMemo)(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
3361
3423
|
};
|
|
3362
3424
|
|
|
3363
3425
|
// src/dynamics/dynamic-control.tsx
|
|
@@ -3386,14 +3448,14 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
3386
3448
|
|
|
3387
3449
|
// src/dynamics/components/dynamic-selection.tsx
|
|
3388
3450
|
var React73 = __toESM(require("react"));
|
|
3389
|
-
var
|
|
3451
|
+
var import_react30 = require("react");
|
|
3390
3452
|
var import_editor_controls48 = require("@elementor/editor-controls");
|
|
3391
3453
|
var import_icons24 = require("@elementor/icons");
|
|
3392
3454
|
var import_ui60 = require("@elementor/ui");
|
|
3393
3455
|
var import_i18n47 = require("@wordpress/i18n");
|
|
3394
3456
|
var SIZE3 = "tiny";
|
|
3395
3457
|
var DynamicSelection = ({ onSelect }) => {
|
|
3396
|
-
const [searchValue, setSearchValue] = (0,
|
|
3458
|
+
const [searchValue, setSearchValue] = (0, import_react30.useState)("");
|
|
3397
3459
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
3398
3460
|
const { value: anyValue } = (0, import_editor_controls48.useBoundProp)();
|
|
3399
3461
|
const { bind, value: dynamicValue, setValue } = (0, import_editor_controls48.useBoundProp)(dynamicPropTypeUtil);
|
|
@@ -3411,7 +3473,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
3411
3473
|
setValue({ name: value, settings: { label } });
|
|
3412
3474
|
onSelect?.();
|
|
3413
3475
|
};
|
|
3414
|
-
return /* @__PURE__ */ React73.createElement(import_ui60.Stack, null, hasNoDynamicTags ? /* @__PURE__ */ React73.createElement(NoDynamicTags, null) : /* @__PURE__ */ React73.createElement(
|
|
3476
|
+
return /* @__PURE__ */ React73.createElement(import_ui60.Stack, null, hasNoDynamicTags ? /* @__PURE__ */ React73.createElement(NoDynamicTags, null) : /* @__PURE__ */ React73.createElement(import_react30.Fragment, null, /* @__PURE__ */ React73.createElement(import_ui60.Box, { px: 1.5, pb: 1 }, /* @__PURE__ */ React73.createElement(
|
|
3415
3477
|
import_ui60.TextField,
|
|
3416
3478
|
{
|
|
3417
3479
|
fullWidth: true,
|
|
@@ -3423,7 +3485,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
3423
3485
|
startAdornment: /* @__PURE__ */ React73.createElement(import_ui60.InputAdornment, { position: "start" }, /* @__PURE__ */ React73.createElement(import_icons24.SearchIcon, { fontSize: SIZE3 }))
|
|
3424
3486
|
}
|
|
3425
3487
|
}
|
|
3426
|
-
)), /* @__PURE__ */ React73.createElement(import_ui60.Divider, null), /* @__PURE__ */ React73.createElement(import_ui60.Box, { sx: { overflowY: "auto", height: 260, width: 220 } }, options12.length > 0 ? /* @__PURE__ */ React73.createElement(import_ui60.MenuList, { role: "listbox", tabIndex: 0 }, options12.map(([category, items3], index) => /* @__PURE__ */ React73.createElement(
|
|
3488
|
+
)), /* @__PURE__ */ React73.createElement(import_ui60.Divider, null), /* @__PURE__ */ React73.createElement(import_ui60.Box, { sx: { overflowY: "auto", height: 260, width: 220 } }, options12.length > 0 ? /* @__PURE__ */ React73.createElement(import_ui60.MenuList, { role: "listbox", tabIndex: 0 }, options12.map(([category, items3], index) => /* @__PURE__ */ React73.createElement(import_react30.Fragment, { key: index }, /* @__PURE__ */ React73.createElement(
|
|
3427
3489
|
import_ui60.MenuSubheader,
|
|
3428
3490
|
{
|
|
3429
3491
|
sx: { px: 1.5, typography: "caption", color: "text.tertiary" }
|
|
@@ -3668,7 +3730,7 @@ function init2() {
|
|
|
3668
3730
|
init();
|
|
3669
3731
|
}
|
|
3670
3732
|
var blockV1Panel = () => {
|
|
3671
|
-
(0,
|
|
3733
|
+
(0, import_editor_v1_adapters7.blockCommand)({
|
|
3672
3734
|
command: "panel/editor/open",
|
|
3673
3735
|
condition: isAtomicWidgetSelected
|
|
3674
3736
|
});
|