@elementor/editor-editing-panel 1.35.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 +22 -0
- package/dist/index.js +166 -138
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +122 -94
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
- 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/style-sections/layout-section/display-field.tsx +1 -1
- package/src/components/style-sections/position-section/position-section.tsx +1 -1
- 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,7 +953,7 @@ 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
958
|
var import_session5 = require("@elementor/session");
|
|
926
959
|
var import_ui58 = require("@elementor/ui");
|
|
@@ -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,17 +1054,17 @@ 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
|
|
|
1027
1060
|
// src/hooks/use-state-by-element.ts
|
|
1028
|
-
var
|
|
1061
|
+
var import_react11 = require("react");
|
|
1029
1062
|
var import_session = require("@elementor/session");
|
|
1030
1063
|
var useStateByElement = (key, initialValue) => {
|
|
1031
1064
|
const { element } = useElement();
|
|
1032
1065
|
const lookup = `elementor/editor-state/${element.id}/${key}`;
|
|
1033
1066
|
const storedValue = (0, import_session.getSessionStorageItem)(lookup);
|
|
1034
|
-
const [value, setValue] = (0,
|
|
1067
|
+
const [value, setValue] = (0, import_react11.useState)(storedValue ?? initialValue);
|
|
1035
1068
|
const doUpdate = (newValue) => {
|
|
1036
1069
|
(0, import_session.setSessionStorageItem)(lookup, newValue);
|
|
1037
1070
|
setValue(newValue);
|
|
@@ -1131,7 +1164,7 @@ var SettingsField = ({ bind, children }) => {
|
|
|
1131
1164
|
|
|
1132
1165
|
// src/components/section.tsx
|
|
1133
1166
|
var React14 = __toESM(require("react"));
|
|
1134
|
-
var
|
|
1167
|
+
var import_react12 = require("react");
|
|
1135
1168
|
var import_ui12 = require("@elementor/ui");
|
|
1136
1169
|
|
|
1137
1170
|
// src/components/collapse-icon.tsx
|
|
@@ -1149,7 +1182,7 @@ var CollapseIcon = (0, import_ui11.styled)(import_icons4.ChevronDownIcon, {
|
|
|
1149
1182
|
// src/components/section.tsx
|
|
1150
1183
|
function Section({ title, children, defaultExpanded = false }) {
|
|
1151
1184
|
const [isOpen, setIsOpen] = useStateByElement(title, !!defaultExpanded);
|
|
1152
|
-
const id = (0,
|
|
1185
|
+
const id = (0, import_react12.useId)();
|
|
1153
1186
|
const labelId = `label-${id}`;
|
|
1154
1187
|
const contentId = `content-${id}`;
|
|
1155
1188
|
return /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(
|
|
@@ -1206,7 +1239,7 @@ var Control2 = ({ control }) => {
|
|
|
1206
1239
|
|
|
1207
1240
|
// src/components/style-tab.tsx
|
|
1208
1241
|
var React68 = __toESM(require("react"));
|
|
1209
|
-
var
|
|
1242
|
+
var import_react25 = require("react");
|
|
1210
1243
|
var import_editor_props7 = require("@elementor/editor-props");
|
|
1211
1244
|
var import_editor_responsive2 = require("@elementor/editor-responsive");
|
|
1212
1245
|
var import_session4 = require("@elementor/session");
|
|
@@ -1215,18 +1248,18 @@ var import_i18n44 = require("@wordpress/i18n");
|
|
|
1215
1248
|
|
|
1216
1249
|
// src/contexts/styles-inheritance-context.tsx
|
|
1217
1250
|
var React17 = __toESM(require("react"));
|
|
1218
|
-
var
|
|
1251
|
+
var import_react14 = require("react");
|
|
1219
1252
|
var import_editor_elements4 = require("@elementor/editor-elements");
|
|
1220
1253
|
var import_editor_props3 = require("@elementor/editor-props");
|
|
1221
1254
|
var import_editor_responsive = require("@elementor/editor-responsive");
|
|
1222
1255
|
var import_editor_styles_repository5 = require("@elementor/editor-styles-repository");
|
|
1223
1256
|
|
|
1224
1257
|
// src/hooks/use-styles-rerender.ts
|
|
1225
|
-
var
|
|
1258
|
+
var import_react13 = require("react");
|
|
1226
1259
|
var useStylesRerender = () => {
|
|
1227
1260
|
const { provider } = useStyle();
|
|
1228
|
-
const [, reRender] = (0,
|
|
1229
|
-
(0,
|
|
1261
|
+
const [, reRender] = (0, import_react13.useReducer)((p) => !p, false);
|
|
1262
|
+
(0, import_react13.useEffect)(() => provider?.subscribe(reRender), [provider]);
|
|
1230
1263
|
};
|
|
1231
1264
|
|
|
1232
1265
|
// src/styles-inheritance/create-snapshots-manager.ts
|
|
@@ -1387,7 +1420,7 @@ function buildStyleVariantsByMetaMapping(styleDefs) {
|
|
|
1387
1420
|
}
|
|
1388
1421
|
|
|
1389
1422
|
// src/contexts/styles-inheritance-context.tsx
|
|
1390
|
-
var Context4 = (0,
|
|
1423
|
+
var Context4 = (0, import_react14.createContext)(null);
|
|
1391
1424
|
function StyleInheritanceProvider({ children }) {
|
|
1392
1425
|
const styleDefs = useAppliedStyles();
|
|
1393
1426
|
const breakpointsTree = (0, import_editor_responsive.getBreakpointsTree)();
|
|
@@ -1395,7 +1428,7 @@ function StyleInheritanceProvider({ children }) {
|
|
|
1395
1428
|
return /* @__PURE__ */ React17.createElement(Context4.Provider, { value: { getSnapshot } }, children);
|
|
1396
1429
|
}
|
|
1397
1430
|
function useStylesInheritanceFields(fields) {
|
|
1398
|
-
const context = (0,
|
|
1431
|
+
const context = (0, import_react14.useContext)(Context4);
|
|
1399
1432
|
const { meta } = useStyle();
|
|
1400
1433
|
if (!context) {
|
|
1401
1434
|
throw new Error("useStylesInheritanceFields must be used within a StyleInheritanceProvider");
|
|
@@ -1429,10 +1462,10 @@ var useBaseStyles = () => {
|
|
|
1429
1462
|
};
|
|
1430
1463
|
|
|
1431
1464
|
// src/hooks/use-active-style-def-id.ts
|
|
1432
|
-
var
|
|
1465
|
+
var import_react15 = require("react");
|
|
1433
1466
|
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
1434
1467
|
function useActiveStyleDefId(classProp) {
|
|
1435
|
-
const [activeStyledDefId, setActiveStyledDefId] = (0,
|
|
1468
|
+
const [activeStyledDefId, setActiveStyledDefId] = (0, import_react15.useState)(null);
|
|
1436
1469
|
const appliedClassesIds = useAppliedClassesIds2(classProp)?.value || [];
|
|
1437
1470
|
const fallback = useFirstAppliedClass(appliedClassesIds);
|
|
1438
1471
|
const activeAndAppliedClassId = useActiveAndAppliedClassId(activeStyledDefId, appliedClassesIds);
|
|
@@ -1462,7 +1495,7 @@ var import_editor_controls6 = require("@elementor/editor-controls");
|
|
|
1462
1495
|
var import_editor_styles3 = require("@elementor/editor-styles");
|
|
1463
1496
|
|
|
1464
1497
|
// src/hooks/use-styles-fields.ts
|
|
1465
|
-
var
|
|
1498
|
+
var import_react16 = require("react");
|
|
1466
1499
|
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
1467
1500
|
var import_editor_styles = require("@elementor/editor-styles");
|
|
1468
1501
|
var import_editor_styles_repository6 = require("@elementor/editor-styles-repository");
|
|
@@ -1516,7 +1549,7 @@ function getProps({ styleId, elementId, provider, meta, propNames }) {
|
|
|
1516
1549
|
);
|
|
1517
1550
|
}
|
|
1518
1551
|
function useUndoableCreateElementStyle() {
|
|
1519
|
-
return (0,
|
|
1552
|
+
return (0, import_react16.useMemo)(() => {
|
|
1520
1553
|
return (0, import_editor_v1_adapters.undoable)(
|
|
1521
1554
|
{
|
|
1522
1555
|
do: (payload) => {
|
|
@@ -1544,7 +1577,7 @@ function useUndoableCreateElementStyle() {
|
|
|
1544
1577
|
}, []);
|
|
1545
1578
|
}
|
|
1546
1579
|
function useUndoableUpdateStyle() {
|
|
1547
|
-
return (0,
|
|
1580
|
+
return (0, import_react16.useMemo)(() => {
|
|
1548
1581
|
return (0, import_editor_v1_adapters.undoable)(
|
|
1549
1582
|
{
|
|
1550
1583
|
do: ({ elementId, styleId, provider, meta, props }) => {
|
|
@@ -1599,45 +1632,26 @@ function useStylesField(propName) {
|
|
|
1599
1632
|
|
|
1600
1633
|
// src/styles-inheritance/styles-inheritance-indicator.tsx
|
|
1601
1634
|
var React19 = __toESM(require("react"));
|
|
1602
|
-
var
|
|
1635
|
+
var import_react19 = require("react");
|
|
1603
1636
|
var import_editor_controls5 = require("@elementor/editor-controls");
|
|
1604
1637
|
var import_editor_styles_repository7 = require("@elementor/editor-styles-repository");
|
|
1638
|
+
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
1605
1639
|
var import_ui16 = require("@elementor/ui");
|
|
1606
1640
|
var import_i18n5 = require("@wordpress/i18n");
|
|
1607
1641
|
|
|
1608
|
-
// src/sync/get-elementor-globals.ts
|
|
1609
|
-
var getElementorConfig = () => {
|
|
1610
|
-
const extendedWindow = window;
|
|
1611
|
-
return extendedWindow.elementor?.config ?? {};
|
|
1612
|
-
};
|
|
1613
|
-
var getElementorFrontendConfig = () => {
|
|
1614
|
-
const extendedWindow = window;
|
|
1615
|
-
return extendedWindow.elementorFrontend?.config ?? {};
|
|
1616
|
-
};
|
|
1617
|
-
var getElementorCommonConfig = () => {
|
|
1618
|
-
const extendedWindow = window;
|
|
1619
|
-
return extendedWindow.elementorCommon?.config ?? {};
|
|
1620
|
-
};
|
|
1621
|
-
|
|
1622
|
-
// src/sync/is-experiment-active.ts
|
|
1623
|
-
var isExperimentActive = (experiment) => {
|
|
1624
|
-
const allFeatures = getElementorCommonConfig()?.experimentalFeatures ?? {};
|
|
1625
|
-
return !!allFeatures?.[experiment];
|
|
1626
|
-
};
|
|
1627
|
-
|
|
1628
1642
|
// src/styles-inheritance/styles-inheritance-infotip.tsx
|
|
1629
1643
|
var React18 = __toESM(require("react"));
|
|
1630
|
-
var
|
|
1644
|
+
var import_react18 = require("react");
|
|
1631
1645
|
var import_editor_canvas = require("@elementor/editor-canvas");
|
|
1632
1646
|
var import_editor_styles2 = require("@elementor/editor-styles");
|
|
1633
1647
|
var import_ui15 = require("@elementor/ui");
|
|
1634
1648
|
|
|
1635
1649
|
// src/hooks/use-normalized-inheritance-chain-items.tsx
|
|
1636
|
-
var
|
|
1650
|
+
var import_react17 = require("react");
|
|
1637
1651
|
var MAXIMUM_ITEMS = 2;
|
|
1638
1652
|
var useNormalizedInheritanceChainItems = (inheritanceChain, bind, resolve) => {
|
|
1639
|
-
const [items3, setItems] = (0,
|
|
1640
|
-
(0,
|
|
1653
|
+
const [items3, setItems] = (0, import_react17.useState)([]);
|
|
1654
|
+
(0, import_react17.useEffect)(() => {
|
|
1641
1655
|
(async () => {
|
|
1642
1656
|
const normalizedItems = await Promise.all(
|
|
1643
1657
|
inheritanceChain.filter((item) => item.style?.label).map((item, index) => normalizeInheritanceItem(item, index, bind, resolve))
|
|
@@ -1674,7 +1688,7 @@ var getTransformedValue = async (item, bind, resolve) => {
|
|
|
1674
1688
|
|
|
1675
1689
|
// src/styles-inheritance/styles-inheritance-infotip.tsx
|
|
1676
1690
|
var StyleIndicatorInfotip = ({ inheritanceChain, bind }) => {
|
|
1677
|
-
const resolve = (0,
|
|
1691
|
+
const resolve = (0, import_react18.useMemo)(() => {
|
|
1678
1692
|
const stylesSchema = (0, import_editor_styles2.getStylesSchema)();
|
|
1679
1693
|
return (0, import_editor_canvas.createPropsResolver)({
|
|
1680
1694
|
transformers: import_editor_canvas.styleTransformersRegistry,
|
|
@@ -1692,7 +1706,7 @@ var StyleIndicatorInfotip = ({ inheritanceChain, bind }) => {
|
|
|
1692
1706
|
|
|
1693
1707
|
// src/styles-inheritance/styles-inheritance-indicator.tsx
|
|
1694
1708
|
var StylesInheritanceIndicator = () => {
|
|
1695
|
-
const [open, setOpen] = (0,
|
|
1709
|
+
const [open, setOpen] = (0, import_react19.useState)(false);
|
|
1696
1710
|
const { value, path } = (0, import_editor_controls5.useBoundProp)();
|
|
1697
1711
|
const { id: currentStyleId, provider: currentStyleProvider, meta: currentStyleMeta } = useStyle();
|
|
1698
1712
|
const [bind] = path;
|
|
@@ -1709,7 +1723,7 @@ var StylesInheritanceIndicator = () => {
|
|
|
1709
1723
|
const hasValue = value !== null && value !== void 0;
|
|
1710
1724
|
const label = getLabel({ isFinalValue, hasValue });
|
|
1711
1725
|
const variantType = getVariant({ isFinalValue, hasValue, currentStyleProvider });
|
|
1712
|
-
const eIndicationsPopover = isExperimentActive("e_indications_popover");
|
|
1726
|
+
const eIndicationsPopover = (0, import_editor_v1_adapters2.isExperimentActive)("e_indications_popover");
|
|
1713
1727
|
if (!eIndicationsPopover) {
|
|
1714
1728
|
return /* @__PURE__ */ React19.createElement(StyleIndicator, { variant: variantType, "aria-label": label });
|
|
1715
1729
|
}
|
|
@@ -1874,6 +1888,18 @@ var import_i18n8 = require("@wordpress/i18n");
|
|
|
1874
1888
|
|
|
1875
1889
|
// src/hooks/use-direction.ts
|
|
1876
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
|
|
1877
1903
|
function useDirection() {
|
|
1878
1904
|
const theme = (0, import_ui23.useTheme)();
|
|
1879
1905
|
const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!getElementorFrontendConfig()?.is_rtl;
|
|
@@ -2020,14 +2046,14 @@ var import_editor_elements7 = require("@elementor/editor-elements");
|
|
|
2020
2046
|
var import_i18n21 = require("@wordpress/i18n");
|
|
2021
2047
|
|
|
2022
2048
|
// src/hooks/use-computed-style.ts
|
|
2023
|
-
var
|
|
2049
|
+
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
2024
2050
|
function useComputedStyle(elementId) {
|
|
2025
|
-
return (0,
|
|
2051
|
+
return (0, import_editor_v1_adapters3.__privateUseListenTo)(
|
|
2026
2052
|
[
|
|
2027
|
-
(0,
|
|
2028
|
-
(0,
|
|
2029
|
-
(0,
|
|
2030
|
-
(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")
|
|
2031
2057
|
],
|
|
2032
2058
|
() => {
|
|
2033
2059
|
if (!elementId) {
|
|
@@ -2053,7 +2079,7 @@ var import_i18n11 = require("@wordpress/i18n");
|
|
|
2053
2079
|
|
|
2054
2080
|
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
2055
2081
|
var React33 = __toESM(require("react"));
|
|
2056
|
-
var
|
|
2082
|
+
var import_react20 = require("react");
|
|
2057
2083
|
var import_ui26 = require("@elementor/ui");
|
|
2058
2084
|
var CLOCKWISE_ANGLES = {
|
|
2059
2085
|
row: 0,
|
|
@@ -2074,7 +2100,7 @@ var RotatedIcon = ({
|
|
|
2074
2100
|
offset = 0,
|
|
2075
2101
|
disableRotationForReversed = false
|
|
2076
2102
|
}) => {
|
|
2077
|
-
const rotate = (0,
|
|
2103
|
+
const rotate = (0, import_react20.useRef)(useGetTargetAngle(isClockwise, offset, disableRotationForReversed));
|
|
2078
2104
|
rotate.current = useGetTargetAngle(isClockwise, offset, disableRotationForReversed, rotate);
|
|
2079
2105
|
return /* @__PURE__ */ React33.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
2080
2106
|
};
|
|
@@ -2271,6 +2297,7 @@ var AlignSelfChild = ({ parentStyleDirection }) => {
|
|
|
2271
2297
|
// src/components/style-sections/layout-section/display-field.tsx
|
|
2272
2298
|
var React37 = __toESM(require("react"));
|
|
2273
2299
|
var import_editor_controls17 = require("@elementor/editor-controls");
|
|
2300
|
+
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
2274
2301
|
var import_ui30 = require("@elementor/ui");
|
|
2275
2302
|
var import_i18n14 = require("@wordpress/i18n");
|
|
2276
2303
|
var displayFieldItems = [
|
|
@@ -2294,7 +2321,7 @@ var displayFieldItems = [
|
|
|
2294
2321
|
}
|
|
2295
2322
|
];
|
|
2296
2323
|
var DisplayField = () => {
|
|
2297
|
-
const isDisplayNoneFeatureActive = isExperimentActive("e_v_3_30");
|
|
2324
|
+
const isDisplayNoneFeatureActive = (0, import_editor_v1_adapters4.isExperimentActive)("e_v_3_30");
|
|
2298
2325
|
const items3 = [...displayFieldItems];
|
|
2299
2326
|
if (isDisplayNoneFeatureActive) {
|
|
2300
2327
|
items3.push({
|
|
@@ -2360,7 +2387,7 @@ var FlexDirectionField = () => {
|
|
|
2360
2387
|
|
|
2361
2388
|
// src/components/style-sections/layout-section/flex-order-field.tsx
|
|
2362
2389
|
var React39 = __toESM(require("react"));
|
|
2363
|
-
var
|
|
2390
|
+
var import_react21 = require("react");
|
|
2364
2391
|
var import_editor_controls19 = require("@elementor/editor-controls");
|
|
2365
2392
|
var import_icons12 = require("@elementor/icons");
|
|
2366
2393
|
var import_ui32 = require("@elementor/ui");
|
|
@@ -2396,7 +2423,7 @@ var items = [
|
|
|
2396
2423
|
];
|
|
2397
2424
|
var FlexOrderField = () => {
|
|
2398
2425
|
const { isSiteRtl } = useDirection(), [order, setOrder] = useStylesField("order");
|
|
2399
|
-
const [groupControlValue, setGroupControlValue] = (0,
|
|
2426
|
+
const [groupControlValue, setGroupControlValue] = (0, import_react21.useState)(getGroupControlValue(order?.value || null));
|
|
2400
2427
|
const handleToggleButtonChange = (group) => {
|
|
2401
2428
|
setGroupControlValue(group);
|
|
2402
2429
|
if (!group || group === CUSTOM) {
|
|
@@ -2434,7 +2461,7 @@ var getGroupControlValue = (order) => {
|
|
|
2434
2461
|
|
|
2435
2462
|
// src/components/style-sections/layout-section/flex-size-field.tsx
|
|
2436
2463
|
var React40 = __toESM(require("react"));
|
|
2437
|
-
var
|
|
2464
|
+
var import_react22 = require("react");
|
|
2438
2465
|
var import_editor_controls20 = require("@elementor/editor-controls");
|
|
2439
2466
|
var import_editor_props6 = require("@elementor/editor-props");
|
|
2440
2467
|
var import_icons13 = require("@elementor/icons");
|
|
@@ -2467,7 +2494,7 @@ var FlexSizeField = () => {
|
|
|
2467
2494
|
const grow = fields?.["flex-grow"]?.value || null;
|
|
2468
2495
|
const shrink = fields?.["flex-shrink"]?.value || null;
|
|
2469
2496
|
const basis = fields?.["flex-basis"]?.value || null;
|
|
2470
|
-
const currentGroup = (0,
|
|
2497
|
+
const currentGroup = (0, import_react22.useMemo)(() => getActiveGroup({ grow, shrink, basis }), [grow, shrink, basis]), [activeGroup, setActiveGroup] = (0, import_react22.useState)(currentGroup);
|
|
2471
2498
|
const onChangeGroup = (group = null) => {
|
|
2472
2499
|
setActiveGroup(group);
|
|
2473
2500
|
if (!group || group === "custom") {
|
|
@@ -2644,6 +2671,7 @@ var shouldDisplayFlexFields = (display, local) => {
|
|
|
2644
2671
|
|
|
2645
2672
|
// src/components/style-sections/position-section/position-section.tsx
|
|
2646
2673
|
var React49 = __toESM(require("react"));
|
|
2674
|
+
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
2647
2675
|
var import_session3 = require("@elementor/session");
|
|
2648
2676
|
|
|
2649
2677
|
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
@@ -2714,7 +2742,7 @@ var PositionSection = () => {
|
|
|
2714
2742
|
"inset-inline-end"
|
|
2715
2743
|
]);
|
|
2716
2744
|
const [dimensionsValuesFromHistory, updateDimensionsHistory, clearDimensionsHistory] = usePersistDimensions();
|
|
2717
|
-
const isCssIdFeatureActive = isExperimentActive("e_v_3_30");
|
|
2745
|
+
const isCssIdFeatureActive = (0, import_editor_v1_adapters5.isExperimentActive)("e_v_3_30");
|
|
2718
2746
|
const onPositionChange = (newPosition, previousPosition) => {
|
|
2719
2747
|
if (newPosition === "static") {
|
|
2720
2748
|
if (dimensionsValues) {
|
|
@@ -2822,11 +2850,11 @@ var React67 = __toESM(require("react"));
|
|
|
2822
2850
|
|
|
2823
2851
|
// src/components/collapsible-content.tsx
|
|
2824
2852
|
var React53 = __toESM(require("react"));
|
|
2825
|
-
var
|
|
2853
|
+
var import_react23 = require("react");
|
|
2826
2854
|
var import_ui43 = require("@elementor/ui");
|
|
2827
2855
|
var import_i18n29 = require("@wordpress/i18n");
|
|
2828
2856
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
2829
|
-
const [open, setOpen] = (0,
|
|
2857
|
+
const [open, setOpen] = (0, import_react23.useState)(defaultOpen);
|
|
2830
2858
|
const handleToggle = () => {
|
|
2831
2859
|
setOpen((prevOpen) => !prevOpen);
|
|
2832
2860
|
};
|
|
@@ -2852,7 +2880,7 @@ var import_ui44 = require("@elementor/ui");
|
|
|
2852
2880
|
var import_i18n31 = require("@wordpress/i18n");
|
|
2853
2881
|
|
|
2854
2882
|
// src/components/style-sections/typography-section/hooks/use-font-families.ts
|
|
2855
|
-
var
|
|
2883
|
+
var import_react24 = require("react");
|
|
2856
2884
|
var import_i18n30 = require("@wordpress/i18n");
|
|
2857
2885
|
var supportedCategories = {
|
|
2858
2886
|
system: (0, import_i18n30.__)("System", "elementor"),
|
|
@@ -2869,7 +2897,7 @@ var getFontFamilies = () => {
|
|
|
2869
2897
|
};
|
|
2870
2898
|
var useFontFamilies = () => {
|
|
2871
2899
|
const fontFamilies = getFontFamilies();
|
|
2872
|
-
return (0,
|
|
2900
|
+
return (0, import_react24.useMemo)(() => {
|
|
2873
2901
|
const categoriesOrder = ["system", "custom", "googlefonts"];
|
|
2874
2902
|
return Object.entries(fontFamilies || {}).reduce((acc, [font, category]) => {
|
|
2875
2903
|
if (!supportedCategories[category]) {
|
|
@@ -3173,7 +3201,7 @@ var stickyHeaderStyles = {
|
|
|
3173
3201
|
var StyleTab = () => {
|
|
3174
3202
|
const currentClassesProp = useCurrentClassesProp();
|
|
3175
3203
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
3176
|
-
const [activeStyleState, setActiveStyleState] = (0,
|
|
3204
|
+
const [activeStyleState, setActiveStyleState] = (0, import_react25.useState)(null);
|
|
3177
3205
|
const breakpoint = (0, import_editor_responsive2.useActiveBreakpoint)();
|
|
3178
3206
|
return /* @__PURE__ */ React68.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React68.createElement(
|
|
3179
3207
|
StyleProvider,
|
|
@@ -3210,7 +3238,7 @@ var EditingPanelTabs = () => {
|
|
|
3210
3238
|
return (
|
|
3211
3239
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
3212
3240
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
3213
|
-
/* @__PURE__ */ React69.createElement(
|
|
3241
|
+
/* @__PURE__ */ React69.createElement(import_react26.Fragment, { key: element.id }, /* @__PURE__ */ React69.createElement(PanelTabContent, null))
|
|
3214
3242
|
);
|
|
3215
3243
|
};
|
|
3216
3244
|
var PanelTabContent = () => {
|
|
@@ -3244,7 +3272,7 @@ var EditingPanel = () => {
|
|
|
3244
3272
|
return null;
|
|
3245
3273
|
}
|
|
3246
3274
|
const panelTitle = (0, import_i18n46.__)("Edit %s", "elementor").replace("%s", elementType.title);
|
|
3247
|
-
return /* @__PURE__ */ React70.createElement(import_ui58.ErrorBoundary, { fallback: /* @__PURE__ */ React70.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React70.createElement(import_session5.SessionStorageProvider, { prefix: "elementor" }, /* @__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)))))))));
|
|
3248
3276
|
};
|
|
3249
3277
|
|
|
3250
3278
|
// src/panel.ts
|
|
@@ -3257,11 +3285,11 @@ var { panel, usePanelActions, usePanelStatus } = (0, import_editor_panels2.__cre
|
|
|
3257
3285
|
var import_editor = require("@elementor/editor");
|
|
3258
3286
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
3259
3287
|
var import_editor_panels3 = require("@elementor/editor-panels");
|
|
3260
|
-
var
|
|
3288
|
+
var import_editor_v1_adapters7 = require("@elementor/editor-v1-adapters");
|
|
3261
3289
|
|
|
3262
3290
|
// src/hooks/use-open-editor-panel.ts
|
|
3263
|
-
var
|
|
3264
|
-
var
|
|
3291
|
+
var import_react27 = require("react");
|
|
3292
|
+
var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
3265
3293
|
|
|
3266
3294
|
// src/sync/is-atomic-widget-selected.ts
|
|
3267
3295
|
var import_editor_elements9 = require("@elementor/editor-elements");
|
|
@@ -3277,8 +3305,8 @@ var isAtomicWidgetSelected = () => {
|
|
|
3277
3305
|
// src/hooks/use-open-editor-panel.ts
|
|
3278
3306
|
var useOpenEditorPanel = () => {
|
|
3279
3307
|
const { open } = usePanelActions();
|
|
3280
|
-
(0,
|
|
3281
|
-
return (0,
|
|
3308
|
+
(0, import_react27.useEffect)(() => {
|
|
3309
|
+
return (0, import_editor_v1_adapters6.__privateListenTo)((0, import_editor_v1_adapters6.commandStartEvent)("panel/editor/open"), () => {
|
|
3282
3310
|
if (isAtomicWidgetSelected()) {
|
|
3283
3311
|
open();
|
|
3284
3312
|
}
|
|
@@ -3320,10 +3348,10 @@ var React72 = __toESM(require("react"));
|
|
|
3320
3348
|
var import_editor_controls47 = require("@elementor/editor-controls");
|
|
3321
3349
|
|
|
3322
3350
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
3323
|
-
var
|
|
3351
|
+
var import_react29 = require("react");
|
|
3324
3352
|
|
|
3325
3353
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
3326
|
-
var
|
|
3354
|
+
var import_react28 = require("react");
|
|
3327
3355
|
var import_editor_controls46 = require("@elementor/editor-controls");
|
|
3328
3356
|
|
|
3329
3357
|
// src/dynamics/sync/get-elementor-config.ts
|
|
@@ -3375,7 +3403,7 @@ var usePropDynamicTags = () => {
|
|
|
3375
3403
|
const propDynamicType = getDynamicPropType(propType);
|
|
3376
3404
|
categories = propDynamicType?.settings.categories || [];
|
|
3377
3405
|
}
|
|
3378
|
-
return (0,
|
|
3406
|
+
return (0, import_react28.useMemo)(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
3379
3407
|
};
|
|
3380
3408
|
var getDynamicTagsByCategories = (categories) => {
|
|
3381
3409
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -3391,7 +3419,7 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
3391
3419
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
3392
3420
|
var useDynamicTag = (tagName) => {
|
|
3393
3421
|
const dynamicTags = usePropDynamicTags();
|
|
3394
|
-
return (0,
|
|
3422
|
+
return (0, import_react29.useMemo)(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
3395
3423
|
};
|
|
3396
3424
|
|
|
3397
3425
|
// src/dynamics/dynamic-control.tsx
|
|
@@ -3420,14 +3448,14 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
3420
3448
|
|
|
3421
3449
|
// src/dynamics/components/dynamic-selection.tsx
|
|
3422
3450
|
var React73 = __toESM(require("react"));
|
|
3423
|
-
var
|
|
3451
|
+
var import_react30 = require("react");
|
|
3424
3452
|
var import_editor_controls48 = require("@elementor/editor-controls");
|
|
3425
3453
|
var import_icons24 = require("@elementor/icons");
|
|
3426
3454
|
var import_ui60 = require("@elementor/ui");
|
|
3427
3455
|
var import_i18n47 = require("@wordpress/i18n");
|
|
3428
3456
|
var SIZE3 = "tiny";
|
|
3429
3457
|
var DynamicSelection = ({ onSelect }) => {
|
|
3430
|
-
const [searchValue, setSearchValue] = (0,
|
|
3458
|
+
const [searchValue, setSearchValue] = (0, import_react30.useState)("");
|
|
3431
3459
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
3432
3460
|
const { value: anyValue } = (0, import_editor_controls48.useBoundProp)();
|
|
3433
3461
|
const { bind, value: dynamicValue, setValue } = (0, import_editor_controls48.useBoundProp)(dynamicPropTypeUtil);
|
|
@@ -3445,7 +3473,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
3445
3473
|
setValue({ name: value, settings: { label } });
|
|
3446
3474
|
onSelect?.();
|
|
3447
3475
|
};
|
|
3448
|
-
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(
|
|
3449
3477
|
import_ui60.TextField,
|
|
3450
3478
|
{
|
|
3451
3479
|
fullWidth: true,
|
|
@@ -3457,7 +3485,7 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
3457
3485
|
startAdornment: /* @__PURE__ */ React73.createElement(import_ui60.InputAdornment, { position: "start" }, /* @__PURE__ */ React73.createElement(import_icons24.SearchIcon, { fontSize: SIZE3 }))
|
|
3458
3486
|
}
|
|
3459
3487
|
}
|
|
3460
|
-
)), /* @__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(
|
|
3461
3489
|
import_ui60.MenuSubheader,
|
|
3462
3490
|
{
|
|
3463
3491
|
sx: { px: 1.5, typography: "caption", color: "text.tertiary" }
|
|
@@ -3702,7 +3730,7 @@ function init2() {
|
|
|
3702
3730
|
init();
|
|
3703
3731
|
}
|
|
3704
3732
|
var blockV1Panel = () => {
|
|
3705
|
-
(0,
|
|
3733
|
+
(0, import_editor_v1_adapters7.blockCommand)({
|
|
3706
3734
|
command: "panel/editor/open",
|
|
3707
3735
|
condition: isAtomicWidgetSelected
|
|
3708
3736
|
});
|