@elementor/editor-editing-panel 1.41.0 → 1.43.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/dist/index.js CHANGED
@@ -49,8 +49,7 @@ var { registerControlReplacement, getControlReplacements } = (0, import_editor_c
49
49
  var React8 = __toESM(require("react"));
50
50
  var import_react10 = require("react");
51
51
  var import_editor_elements2 = require("@elementor/editor-elements");
52
- var import_editor_props2 = require("@elementor/editor-props");
53
- var import_editor_styles_repository4 = require("@elementor/editor-styles-repository");
52
+ var import_editor_styles_repository5 = require("@elementor/editor-styles-repository");
54
53
  var import_editor_ui3 = require("@elementor/editor-ui");
55
54
  var import_icons2 = require("@elementor/icons");
56
55
  var import_locations = require("@elementor/locations");
@@ -468,7 +467,7 @@ var StyledGroupItems = (0, import_ui2.styled)("ul")`
468
467
  // src/components/css-classes/css-class-item.tsx
469
468
  var React7 = __toESM(require("react"));
470
469
  var import_react9 = require("react");
471
- var import_editor_styles_repository3 = require("@elementor/editor-styles-repository");
470
+ var import_editor_styles_repository4 = require("@elementor/editor-styles-repository");
472
471
  var import_editor_ui2 = require("@elementor/editor-ui");
473
472
  var import_icons = require("@elementor/icons");
474
473
  var import_ui5 = require("@elementor/ui");
@@ -491,7 +490,7 @@ function CssClassProvider({ children, ...contextValue }) {
491
490
 
492
491
  // src/components/css-classes/css-class-menu.tsx
493
492
  var React6 = __toESM(require("react"));
494
- var import_editor_styles_repository2 = require("@elementor/editor-styles-repository");
493
+ var import_editor_styles_repository3 = require("@elementor/editor-styles-repository");
495
494
  var import_editor_ui = require("@elementor/editor-ui");
496
495
  var import_ui4 = require("@elementor/ui");
497
496
  var import_i18n2 = require("@wordpress/i18n");
@@ -523,12 +522,20 @@ var import_react8 = require("react");
523
522
  var import_editor_documents = require("@elementor/editor-documents");
524
523
  var import_editor_elements = require("@elementor/editor-elements");
525
524
  var import_editor_props = require("@elementor/editor-props");
525
+ var import_editor_styles_repository2 = require("@elementor/editor-styles-repository");
526
526
  var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
527
527
  var import_i18n = require("@wordpress/i18n");
528
+
529
+ // src/sync/experiments-flags.ts
530
+ var EXPERIMENTAL_FEATURES = {
531
+ V_3_30: "e_v_3_30"
532
+ };
533
+
534
+ // src/components/css-classes/use-apply-and-unapply-class.ts
528
535
  function useApplyClass() {
529
536
  const { id: activeId, setId: setActiveId } = useStyle();
530
537
  const { element } = useElement();
531
- const isVersion330Active = (0, import_editor_v1_adapters.isExperimentActive)("e_v_3_30");
538
+ const isVersion330Active = (0, import_editor_v1_adapters.isExperimentActive)(EXPERIMENTAL_FEATURES.V_3_30);
532
539
  const applyClass = useApply();
533
540
  const unapplyClass = useUnapply();
534
541
  const undoableApply = (0, import_react8.useMemo)(() => {
@@ -563,7 +570,7 @@ function useApplyClass() {
563
570
  function useUnapplyClass() {
564
571
  const { id: activeId, setId: setActiveId } = useStyle();
565
572
  const { element } = useElement();
566
- const isVersion330Active = (0, import_editor_v1_adapters.isExperimentActive)("e_v_3_30");
573
+ const isVersion330Active = (0, import_editor_v1_adapters.isExperimentActive)(EXPERIMENTAL_FEATURES.V_3_30);
567
574
  const applyClass = useApply();
568
575
  const unapplyClass = useUnapply();
569
576
  const undoableUnapply = (0, import_react8.useMemo)(() => {
@@ -595,10 +602,58 @@ function useUnapplyClass() {
595
602
  );
596
603
  return isVersion330Active ? undoableUnapply : unapplyWithoutHistory;
597
604
  }
605
+ function useCreateAndApplyClass() {
606
+ const { id: activeId, setId: setActiveId } = useStyle();
607
+ const isVersion330Active = (0, import_editor_v1_adapters.isExperimentActive)(EXPERIMENTAL_FEATURES.V_3_30);
608
+ const [provider, createAction] = (0, import_editor_styles_repository2.useGetStylesRepositoryCreateAction)() ?? [null, null];
609
+ const deleteAction = provider?.actions.delete;
610
+ const applyClass = useApply();
611
+ const unapplyClass = useUnapply();
612
+ const undoableCreateAndApply = (0, import_react8.useMemo)(() => {
613
+ if (!provider || !createAction) {
614
+ return;
615
+ }
616
+ return (0, import_editor_v1_adapters.undoable)(
617
+ {
618
+ do: ({ classLabel }) => {
619
+ const prevActiveId = activeId;
620
+ const createdId = createAction(classLabel);
621
+ applyClass(createdId);
622
+ return { prevActiveId, createdId };
623
+ },
624
+ undo: (_, { prevActiveId, createdId }) => {
625
+ unapplyClass(createdId);
626
+ deleteAction?.(createdId);
627
+ setActiveId(prevActiveId);
628
+ }
629
+ },
630
+ {
631
+ title: (0, import_i18n.__)("Class", "elementor"),
632
+ subtitle: ({ classLabel }) => {
633
+ return (0, import_i18n.__)(`%s created`, "elementor").replace("%s", classLabel);
634
+ }
635
+ }
636
+ );
637
+ }, [activeId, applyClass, createAction, deleteAction, provider, setActiveId, unapplyClass]);
638
+ const createAndApplyWithoutHistory = (0, import_react8.useCallback)(
639
+ ({ classLabel }) => {
640
+ if (!createAction) {
641
+ return;
642
+ }
643
+ const createdId = createAction(classLabel);
644
+ applyClass(createdId);
645
+ },
646
+ [applyClass, createAction]
647
+ );
648
+ if (!provider || !undoableCreateAndApply) {
649
+ return [null, null];
650
+ }
651
+ return isVersion330Active ? [provider, undoableCreateAndApply] : [provider, createAndApplyWithoutHistory];
652
+ }
598
653
  function useApply() {
599
654
  const { element } = useElement();
600
655
  const { setId: setActiveId } = useStyle();
601
- const { setClasses, getAppliedClasses } = useSetClasses();
656
+ const { setClasses, getAppliedClasses } = useClasses();
602
657
  return (0, import_react8.useCallback)(
603
658
  (classIDToApply) => {
604
659
  const appliedClasses = getAppliedClasses();
@@ -617,7 +672,7 @@ function useApply() {
617
672
  function useUnapply() {
618
673
  const { element } = useElement();
619
674
  const { id: activeId, setId: setActiveId } = useStyle();
620
- const { setClasses, getAppliedClasses } = useSetClasses();
675
+ const { setClasses, getAppliedClasses } = useClasses();
621
676
  return (0, import_react8.useCallback)(
622
677
  (classIDToUnapply) => {
623
678
  const appliedClasses = getAppliedClasses();
@@ -635,10 +690,10 @@ function useUnapply() {
635
690
  [activeId, element.id, getAppliedClasses, setActiveId, setClasses]
636
691
  );
637
692
  }
638
- function useSetClasses() {
693
+ function useClasses() {
639
694
  const { element } = useElement();
640
695
  const currentClassesProp = useClassesProp();
641
- const isVersion330Active = (0, import_editor_v1_adapters.isExperimentActive)("e_v_3_30");
696
+ const isVersion330Active = (0, import_editor_v1_adapters.isExperimentActive)(EXPERIMENTAL_FEATURES.V_3_30);
642
697
  return (0, import_react8.useMemo)(() => {
643
698
  const setClasses = (ids) => {
644
699
  (0, import_editor_elements.updateElementSettings)({
@@ -651,10 +706,7 @@ function useSetClasses() {
651
706
  }
652
707
  };
653
708
  const getAppliedClasses = () => (0, import_editor_elements.getElementSetting)(element.id, currentClassesProp)?.value || [];
654
- return {
655
- setClasses,
656
- getAppliedClasses
657
- };
709
+ return { setClasses, getAppliedClasses };
658
710
  }, [currentClassesProp, element.id, isVersion330Active]);
659
711
  }
660
712
 
@@ -696,7 +748,7 @@ function CssClassMenu({ popupState, anchorEl, fixed }) {
696
748
  }
697
749
  function useModifiedStates(styleId) {
698
750
  const { meta } = useStyle();
699
- const styleDef = import_editor_styles_repository2.stylesRepository.all().find((style) => style.id === styleId);
751
+ const styleDef = import_editor_styles_repository3.stylesRepository.all().find((style) => style.id === styleId);
700
752
  return Object.fromEntries(
701
753
  styleDef?.variants.filter((variant) => meta.breakpoint === variant.meta.breakpoint).map((variant) => [variant.meta.state ?? "normal", true]) ?? []
702
754
  );
@@ -709,7 +761,7 @@ function getMenuItemsByProvider({
709
761
  if (!provider) {
710
762
  return [];
711
763
  }
712
- const providerInstance = import_editor_styles_repository2.stylesRepository.getProviderByKey(provider);
764
+ const providerInstance = import_editor_styles_repository3.stylesRepository.getProviderByKey(provider);
713
765
  const providerActions = providerInstance?.actions;
714
766
  const canUpdate = providerActions?.update;
715
767
  const canUnapply = !fixed;
@@ -736,12 +788,12 @@ function StateMenuItem({ state, closeMenu, ...props }) {
736
788
  const { id: styleId, provider } = useCssClass();
737
789
  const { id: activeId, setId: setActiveId, setMetaState: setActiveMetaState, meta } = useStyle();
738
790
  const { state: activeState } = meta;
739
- const { userCan } = (0, import_editor_styles_repository2.useUserStylesCapability)();
791
+ const { userCan } = (0, import_editor_styles_repository3.useUserStylesCapability)();
740
792
  const modifiedStates = useModifiedStates(styleId);
741
- const isUpdateAllowed = userCan(provider ?? "").updateProps;
742
- const indicatorVariant = !provider || (0, import_editor_styles_repository2.isElementsStylesProvider)(provider) ? "local" : "global";
793
+ const isUpdateAllowed = !state || userCan(provider ?? "").updateProps;
794
+ const indicatorVariant = !provider || (0, import_editor_styles_repository3.isElementsStylesProvider)(provider) ? "local" : "global";
743
795
  const isStyled = modifiedStates[state ?? "normal"] ?? false;
744
- const disabled = isUpdateAllowed ? false : !isStyled;
796
+ const disabled = !isUpdateAllowed && !isStyled;
745
797
  const isActive = styleId === activeId;
746
798
  const isSelected = state === activeState && isActive;
747
799
  return /* @__PURE__ */ React6.createElement(
@@ -763,7 +815,7 @@ function StateMenuItem({ state, closeMenu, ...props }) {
763
815
  import_editor_ui.MenuItemInfotip,
764
816
  {
765
817
  showInfoTip: disabled,
766
- content: (0, import_i18n2.__)("With your role as an editor, you can only use existing states.", "elementor")
818
+ content: (0, import_i18n2.__)("With your current role, you can only use existing states.", "elementor")
767
819
  },
768
820
  /* @__PURE__ */ React6.createElement(import_ui4.Stack, { gap: 0.75, direction: "row", alignItems: "center" }, isStyled && /* @__PURE__ */ React6.createElement(StyleIndicator, { "aria-label": (0, import_i18n2.__)("Has style", "elementor"), variant: indicatorVariant }), state ?? "normal")
769
821
  )
@@ -786,7 +838,7 @@ function UnapplyClassMenuItem({ closeMenu, ...props }) {
786
838
  }
787
839
  function RenameClassMenuItem({ closeMenu }) {
788
840
  const { handleRename, provider } = useCssClass();
789
- const { userCan } = (0, import_editor_styles_repository2.useUserStylesCapability)();
841
+ const { userCan } = (0, import_editor_styles_repository3.useUserStylesCapability)();
790
842
  if (!provider) {
791
843
  return null;
792
844
  }
@@ -805,7 +857,7 @@ function RenameClassMenuItem({ closeMenu }) {
805
857
  {
806
858
  showInfoTip: !isAllowed,
807
859
  content: (0, import_i18n2.__)(
808
- "With your role as an editor, you can use existing classes but can\u2019t modify them.",
860
+ "With your current role, you can use existing classes but can\u2019t modify them.",
809
861
  "elementor"
810
862
  )
811
863
  },
@@ -823,6 +875,7 @@ function CssClassItem(props) {
823
875
  const popupState = (0, import_ui5.usePopupState)({ variant: "popover" });
824
876
  const [chipRef, setChipRef] = (0, import_react9.useState)(null);
825
877
  const { onDelete, ...chipGroupProps } = chipProps;
878
+ const { userCan } = (0, import_editor_styles_repository4.useUserStylesCapability)();
826
879
  const {
827
880
  ref,
828
881
  isEditing,
@@ -836,8 +889,8 @@ function CssClassItem(props) {
836
889
  onError: setError
837
890
  });
838
891
  const color = error ? "error" : colorProp;
839
- const providerActions = provider ? import_editor_styles_repository3.stylesRepository.getProviderByKey(provider)?.actions : null;
840
- const allowRename = Boolean(providerActions?.update);
892
+ const providerActions = provider ? import_editor_styles_repository4.stylesRepository.getProviderByKey(provider)?.actions : null;
893
+ const allowRename = Boolean(providerActions?.update) && userCan(provider ?? "")?.update;
841
894
  const isShowingState = isActive && meta.state;
842
895
  return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(
843
896
  import_ui5.UnstableChipGroup,
@@ -903,7 +956,7 @@ function CssClassItem(props) {
903
956
  ), /* @__PURE__ */ React7.createElement(CssClassProvider, { ...classProps, handleRename: openEditMode }, /* @__PURE__ */ React7.createElement(CssClassMenu, { popupState, anchorEl: chipRef, fixed })));
904
957
  }
905
958
  var validateLabel = (newLabel) => {
906
- const result = (0, import_editor_styles_repository3.validateStyleLabel)(newLabel, "rename");
959
+ const result = (0, import_editor_styles_repository4.validateStyleLabel)(newLabel, "rename");
907
960
  if (result.isValid) {
908
961
  return null;
909
962
  }
@@ -924,15 +977,16 @@ var EMPTY_OPTION = {
924
977
  var { Slot: ClassSelectorActionsSlot, inject: injectIntoClassSelectorActions } = (0, import_locations.createLocation)();
925
978
  function CssClassSelector() {
926
979
  const options12 = useOptions();
927
- const { value: appliedIds, pushValue: pushAppliedId } = useAppliedClassesIds();
928
980
  const { id: activeId, setId: setActiveId } = useStyle();
929
981
  const autocompleteRef = (0, import_react10.useRef)(null);
930
982
  const [renameError, setRenameError] = (0, import_react10.useState)(null);
931
983
  const handleSelect = useHandleSelect();
932
- const { create, validate, entityName } = useCreateAction({ pushAppliedId, setActiveId });
933
- const applied = useAppliedOptions(options12, appliedIds);
934
- const active = applied.find((option) => option.value === activeId) ?? EMPTY_OPTION;
935
- const showPlaceholder = applied.every(({ fixed }) => fixed);
984
+ const { create, validate, entityName } = useCreateAction();
985
+ const appliedOptions = useAppliedOptions(options12);
986
+ const active = appliedOptions.find((option) => option.value === activeId) ?? EMPTY_OPTION;
987
+ const showPlaceholder = appliedOptions.every(({ fixed }) => fixed);
988
+ const { userCan } = (0, import_editor_styles_repository5.useUserStylesCapability)();
989
+ const canEdit = active.provider ? userCan(active.provider).updateProps : true;
936
990
  return /* @__PURE__ */ React8.createElement(import_ui6.Stack, { p: 2 }, /* @__PURE__ */ React8.createElement(import_ui6.Stack, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React8.createElement(import_ui6.FormLabel, { htmlFor: ID, size: "small" }, (0, import_i18n4.__)("Classes", "elementor")), /* @__PURE__ */ React8.createElement(import_ui6.Stack, { direction: "row", gap: 1 }, /* @__PURE__ */ React8.createElement(ClassSelectorActionsSlot, null))), /* @__PURE__ */ React8.createElement(
937
991
  import_editor_ui3.WarningInfotip,
938
992
  {
@@ -950,7 +1004,7 @@ function CssClassSelector() {
950
1004
  size: "tiny",
951
1005
  placeholder: showPlaceholder ? (0, import_i18n4.__)("Type class name", "elementor") : void 0,
952
1006
  options: options12,
953
- selected: applied,
1007
+ selected: appliedOptions,
954
1008
  entityName,
955
1009
  onSelect: handleSelect,
956
1010
  onCreate: create ?? void 0,
@@ -987,6 +1041,15 @@ function CssClassSelector() {
987
1041
  })
988
1042
  }
989
1043
  )
1044
+ ), !canEdit && /* @__PURE__ */ React8.createElement(
1045
+ import_editor_ui3.InfoAlert,
1046
+ {
1047
+ content: (0, import_i18n4.__)(
1048
+ "With your current role, you can use existing classes but can\u2019t modify them.",
1049
+ "elementor"
1050
+ ),
1051
+ sx: { mt: 1 }
1052
+ }
990
1053
  ));
991
1054
  }
992
1055
  var EmptyState = ({ searchValue, onClear }) => /* @__PURE__ */ React8.createElement(import_ui6.Box, { sx: { py: 4 } }, /* @__PURE__ */ React8.createElement(
@@ -1007,7 +1070,7 @@ var updateClassByProvider = (provider, data) => {
1007
1070
  if (!provider) {
1008
1071
  return;
1009
1072
  }
1010
- const providerInstance = import_editor_styles_repository4.stylesRepository.getProviderByKey(provider);
1073
+ const providerInstance = import_editor_styles_repository5.stylesRepository.getProviderByKey(provider);
1011
1074
  if (!providerInstance) {
1012
1075
  return;
1013
1076
  }
@@ -1016,8 +1079,8 @@ var updateClassByProvider = (provider, data) => {
1016
1079
  function useOptions() {
1017
1080
  const { element } = useElement();
1018
1081
  const isProviderEditable = (provider) => !!provider.actions.updateProps;
1019
- return (0, import_editor_styles_repository4.useProviders)().filter(isProviderEditable).flatMap((provider) => {
1020
- const isElements = (0, import_editor_styles_repository4.isElementsStylesProvider)(provider.getKey());
1082
+ return (0, import_editor_styles_repository5.useProviders)().filter(isProviderEditable).flatMap((provider) => {
1083
+ const isElements = (0, import_editor_styles_repository5.isElementsStylesProvider)(provider.getKey());
1021
1084
  const styleDefs = provider.actions.all({ elementId: element.id });
1022
1085
  if (isElements && styleDefs.length === 0) {
1023
1086
  return [EMPTY_OPTION];
@@ -1034,18 +1097,13 @@ function useOptions() {
1034
1097
  });
1035
1098
  });
1036
1099
  }
1037
- function useCreateAction({
1038
- pushAppliedId,
1039
- setActiveId
1040
- }) {
1041
- const [provider, createAction] = (0, import_editor_styles_repository4.useGetStylesRepositoryCreateAction)() ?? [null, null];
1100
+ function useCreateAction() {
1101
+ const [provider, createAction] = useCreateAndApplyClass();
1042
1102
  if (!provider || !createAction) {
1043
1103
  return {};
1044
1104
  }
1045
- const create = (newClassLabel) => {
1046
- const createdId = createAction(newClassLabel);
1047
- pushAppliedId(createdId);
1048
- setActiveId(createdId);
1105
+ const create = (classLabel) => {
1106
+ createAction({ classLabel });
1049
1107
  };
1050
1108
  const validate = (newClassLabel, event) => {
1051
1109
  if (hasReachedLimit(provider)) {
@@ -1057,7 +1115,7 @@ function useCreateAction({
1057
1115
  )
1058
1116
  };
1059
1117
  }
1060
- return (0, import_editor_styles_repository4.validateStyleLabel)(newClassLabel, event);
1118
+ return (0, import_editor_styles_repository5.validateStyleLabel)(newClassLabel, event);
1061
1119
  };
1062
1120
  const entityName = provider.labels.singular && provider.labels.plural ? provider.labels : void 0;
1063
1121
  return { create, validate, entityName };
@@ -1065,36 +1123,18 @@ function useCreateAction({
1065
1123
  function hasReachedLimit(provider) {
1066
1124
  return provider.actions.all().length >= provider.limit;
1067
1125
  }
1068
- function useAppliedOptions(options12, appliedIds) {
1069
- const applied = options12.filter((option) => option.value && appliedIds.includes(option.value));
1070
- const hasElementsProviderStyleApplied = applied.some(
1071
- (option) => option.provider && (0, import_editor_styles_repository4.isElementsStylesProvider)(option.provider)
1126
+ function useAppliedOptions(options12) {
1127
+ const { element } = useElement();
1128
+ const currentClassesProp = useClassesProp();
1129
+ const appliedIds = (0, import_editor_elements2.useElementSetting)(element.id, currentClassesProp)?.value || [];
1130
+ const appliedOptions = options12.filter((option) => option.value && appliedIds.includes(option.value));
1131
+ const hasElementsProviderStyleApplied = appliedOptions.some(
1132
+ (option) => option.provider && (0, import_editor_styles_repository5.isElementsStylesProvider)(option.provider)
1072
1133
  );
1073
1134
  if (!hasElementsProviderStyleApplied) {
1074
- applied.unshift(EMPTY_OPTION);
1135
+ appliedOptions.unshift(EMPTY_OPTION);
1075
1136
  }
1076
- return applied;
1077
- }
1078
- function useAppliedClassesIds() {
1079
- const { element } = useElement();
1080
- const currentClassesProp = useClassesProp();
1081
- const value = (0, import_editor_elements2.useElementSetting)(element.id, currentClassesProp)?.value || [];
1082
- const setValue = (ids) => {
1083
- (0, import_editor_elements2.updateElementSettings)({
1084
- id: element.id,
1085
- props: {
1086
- [currentClassesProp]: import_editor_props2.classesPropTypeUtil.create(ids)
1087
- }
1088
- });
1089
- };
1090
- const pushValue = (id) => {
1091
- const ids = (0, import_editor_elements2.getElementSetting)(element.id, currentClassesProp)?.value || [];
1092
- setValue([...ids, id]);
1093
- };
1094
- return {
1095
- value,
1096
- pushValue
1097
- };
1137
+ return appliedOptions;
1098
1138
  }
1099
1139
  function useHandleSelect() {
1100
1140
  const apply = useApplyClass();
@@ -1268,13 +1308,6 @@ var useDefaultPanelSettings = () => {
1268
1308
  var import_react14 = require("react");
1269
1309
  var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
1270
1310
  var import_session = require("@elementor/session");
1271
-
1272
- // src/sync/experiments-flags.ts
1273
- var EXPERIMENTAL_FEATURES = {
1274
- V_3_30: "e_v_3_30"
1275
- };
1276
-
1277
- // src/hooks/use-state-by-element.ts
1278
1311
  var useStateByElement = (key, initialValue) => {
1279
1312
  const { element } = useElement();
1280
1313
  const isFeatureActive = (0, import_editor_v1_adapters2.isExperimentActive)(EXPERIMENTAL_FEATURES.V_3_30);
@@ -1468,7 +1501,7 @@ var Control2 = ({ control }) => {
1468
1501
  // src/components/style-tab.tsx
1469
1502
  var React78 = __toESM(require("react"));
1470
1503
  var import_react27 = require("react");
1471
- var import_editor_props10 = require("@elementor/editor-props");
1504
+ var import_editor_props9 = require("@elementor/editor-props");
1472
1505
  var import_editor_responsive3 = require("@elementor/editor-responsive");
1473
1506
  var import_editor_v1_adapters12 = require("@elementor/editor-v1-adapters");
1474
1507
  var import_session4 = require("@elementor/session");
@@ -1479,10 +1512,10 @@ var import_i18n52 = require("@wordpress/i18n");
1479
1512
  var React19 = __toESM(require("react"));
1480
1513
  var import_react17 = require("react");
1481
1514
  var import_editor_elements4 = require("@elementor/editor-elements");
1482
- var import_editor_props5 = require("@elementor/editor-props");
1515
+ var import_editor_props4 = require("@elementor/editor-props");
1483
1516
  var import_editor_responsive = require("@elementor/editor-responsive");
1484
1517
  var import_editor_styles = require("@elementor/editor-styles");
1485
- var import_editor_styles_repository5 = require("@elementor/editor-styles-repository");
1518
+ var import_editor_styles_repository6 = require("@elementor/editor-styles-repository");
1486
1519
 
1487
1520
  // src/hooks/use-styles-rerender.ts
1488
1521
  var import_react16 = require("react");
@@ -1493,10 +1526,10 @@ var useStylesRerender = () => {
1493
1526
  };
1494
1527
 
1495
1528
  // src/styles-inheritance/create-styles-inheritance.ts
1496
- var import_editor_props4 = require("@elementor/editor-props");
1529
+ var import_editor_props3 = require("@elementor/editor-props");
1497
1530
 
1498
1531
  // src/styles-inheritance/create-snapshots-manager.ts
1499
- var import_editor_props3 = require("@elementor/editor-props");
1532
+ var import_editor_props2 = require("@elementor/editor-props");
1500
1533
 
1501
1534
  // src/styles-inheritance/utils.ts
1502
1535
  var DEFAULT_STATE = "normal";
@@ -1588,7 +1621,7 @@ function buildInitialSnapshotFromStyles(styles) {
1588
1621
  variant: { props }
1589
1622
  } = styleData;
1590
1623
  Object.entries(props).forEach(([key, value]) => {
1591
- const filteredValue = (0, import_editor_props3.filterEmptyValues)(value);
1624
+ const filteredValue = (0, import_editor_props2.filterEmptyValues)(value);
1592
1625
  if (filteredValue === null) {
1593
1626
  return;
1594
1627
  }
@@ -1634,7 +1667,7 @@ function createStylesInheritance(styleDefs, breakpointsRoot) {
1634
1667
  inheritanceChain = inheritanceChain.map(({ value: styleValue, ...rest }) => ({
1635
1668
  ...rest,
1636
1669
  value: getValueByPath(styleValue, nextFields, filterPropType)
1637
- })).filter(({ value: styleValue }) => !(0, import_editor_props4.isEmpty)(styleValue));
1670
+ })).filter(({ value: styleValue }) => !(0, import_editor_props3.isEmpty)(styleValue));
1638
1671
  }
1639
1672
  return inheritanceChain;
1640
1673
  }
@@ -1676,7 +1709,7 @@ function getValueByPath(value, path, filterPropType) {
1676
1709
  if (!currentScope) {
1677
1710
  return null;
1678
1711
  }
1679
- if ((0, import_editor_props4.isTransformable)(currentScope)) {
1712
+ if ((0, import_editor_props3.isTransformable)(currentScope)) {
1680
1713
  return currentScope.value?.[key] ?? null;
1681
1714
  }
1682
1715
  if (typeof currentScope === "object") {
@@ -1686,7 +1719,7 @@ function getValueByPath(value, path, filterPropType) {
1686
1719
  }, value);
1687
1720
  }
1688
1721
  function shouldUseOriginalValue(filterPropType, value) {
1689
- return !!filterPropType && (0, import_editor_props4.isTransformable)(value) && filterPropType.key !== value.$$type;
1722
+ return !!filterPropType && (0, import_editor_props3.isTransformable)(value) && filterPropType.key !== value.$$type;
1690
1723
  }
1691
1724
  var getFilterPropType = (propType, path) => {
1692
1725
  if (!propType || propType.kind !== "union") {
@@ -1744,8 +1777,8 @@ var useAppliedStyles = () => {
1744
1777
  const baseStyles = useBaseStyles();
1745
1778
  useStylesRerender();
1746
1779
  const classesProp = (0, import_editor_elements4.useElementSetting)(element.id, currentClassesProp);
1747
- const appliedStyles = import_editor_props5.classesPropTypeUtil.extract(classesProp) ?? [];
1748
- return import_editor_styles_repository5.stylesRepository.all().filter((style) => [...baseStyles, ...appliedStyles].includes(style.id));
1780
+ const appliedStyles = import_editor_props4.classesPropTypeUtil.extract(classesProp) ?? [];
1781
+ return import_editor_styles_repository6.stylesRepository.all().filter((style) => [...baseStyles, ...appliedStyles].includes(style.id));
1749
1782
  };
1750
1783
  var useBaseStyles = () => {
1751
1784
  const { elementType } = useElement();
@@ -1761,7 +1794,7 @@ function useActiveStyleDefId(classProp) {
1761
1794
  "active-style-id",
1762
1795
  null
1763
1796
  );
1764
- const appliedClassesIds = useAppliedClassesIds2(classProp)?.value || [];
1797
+ const appliedClassesIds = useAppliedClassesIds(classProp)?.value || [];
1765
1798
  const fallback = useFirstAppliedClass(appliedClassesIds);
1766
1799
  const activeAndAppliedClassId = useActiveAndAppliedClassId(activeStyledDefId, appliedClassesIds);
1767
1800
  return [activeAndAppliedClassId || fallback?.id || null, setActiveStyledDefId];
@@ -1771,7 +1804,7 @@ function useFirstAppliedClass(appliedClassesIds) {
1771
1804
  const stylesDefs = (0, import_editor_elements5.getElementStyles)(element.id) ?? {};
1772
1805
  return Object.values(stylesDefs).find((styleDef) => appliedClassesIds.includes(styleDef.id));
1773
1806
  }
1774
- function useAppliedClassesIds2(classProp) {
1807
+ function useAppliedClassesIds(classProp) {
1775
1808
  const { element } = useElement();
1776
1809
  return (0, import_editor_elements5.useElementSetting)(element.id, classProp);
1777
1810
  }
@@ -1793,7 +1826,7 @@ var import_editor_styles3 = require("@elementor/editor-styles");
1793
1826
  var import_react18 = require("react");
1794
1827
  var import_editor_elements6 = require("@elementor/editor-elements");
1795
1828
  var import_editor_styles2 = require("@elementor/editor-styles");
1796
- var import_editor_styles_repository6 = require("@elementor/editor-styles-repository");
1829
+ var import_editor_styles_repository7 = require("@elementor/editor-styles-repository");
1797
1830
  var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
1798
1831
  var import_i18n5 = require("@wordpress/i18n");
1799
1832
  function useStylesFields(propNames) {
@@ -1850,7 +1883,7 @@ function useUndoableCreateElementStyle() {
1850
1883
  do: (payload) => {
1851
1884
  return (0, import_editor_elements6.createElementStyle)({
1852
1885
  ...payload,
1853
- label: import_editor_styles_repository6.ELEMENTS_STYLES_RESERVED_LABEL
1886
+ label: import_editor_styles_repository7.ELEMENTS_STYLES_RESERVED_LABEL
1854
1887
  });
1855
1888
  },
1856
1889
  undo: ({ elementId }, styleId) => {
@@ -1860,7 +1893,7 @@ function useUndoableCreateElementStyle() {
1860
1893
  return (0, import_editor_elements6.createElementStyle)({
1861
1894
  ...payload,
1862
1895
  styleId,
1863
- label: import_editor_styles_repository6.ELEMENTS_STYLES_RESERVED_LABEL
1896
+ label: import_editor_styles_repository7.ELEMENTS_STYLES_RESERVED_LABEL
1864
1897
  });
1865
1898
  }
1866
1899
  },
@@ -1928,8 +1961,8 @@ function useStylesField(propName) {
1928
1961
  // src/styles-inheritance/styles-inheritance-indicator.tsx
1929
1962
  var React26 = __toESM(require("react"));
1930
1963
  var import_editor_controls5 = require("@elementor/editor-controls");
1931
- var import_editor_props6 = require("@elementor/editor-props");
1932
- var import_editor_styles_repository9 = require("@elementor/editor-styles-repository");
1964
+ var import_editor_props5 = require("@elementor/editor-props");
1965
+ var import_editor_styles_repository10 = require("@elementor/editor-styles-repository");
1933
1966
  var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
1934
1967
  var import_ui23 = require("@elementor/ui");
1935
1968
  var import_i18n9 = require("@wordpress/i18n");
@@ -1948,7 +1981,7 @@ var excludePropTypeTransformers = /* @__PURE__ */ new Set([
1948
1981
  "image",
1949
1982
  "background-overlay"
1950
1983
  ]);
1951
- var isUsingIndicatorPopover = () => (0, import_editor_v1_adapters5.isExperimentActive)("e_indications_popover");
1984
+ var isUsingIndicatorPopover = () => (0, import_editor_v1_adapters5.isExperimentActive)("e_v_3_30");
1952
1985
 
1953
1986
  // src/styles-inheritance/styles-inheritance-infotip.tsx
1954
1987
  var React25 = __toESM(require("react"));
@@ -2017,21 +2050,23 @@ var BreakpointIcon = ({ breakpoint }) => {
2017
2050
 
2018
2051
  // src/styles-inheritance/components/label-chip.tsx
2019
2052
  var React22 = __toESM(require("react"));
2020
- var import_editor_styles_repository7 = require("@elementor/editor-styles-repository");
2053
+ var import_editor_styles_repository8 = require("@elementor/editor-styles-repository");
2021
2054
  var import_icons6 = require("@elementor/icons");
2022
2055
  var import_ui19 = require("@elementor/ui");
2023
2056
  var import_i18n6 = require("@wordpress/i18n");
2024
2057
  var SIZE4 = "tiny";
2025
- var LabelChip = ({ displayLabel, provider }) => {
2058
+ var LabelChip = ({ displayLabel, provider, chipColor }) => {
2059
+ const isBaseStyle = provider === import_editor_styles_repository8.ELEMENTS_BASE_STYLES_PROVIDER_KEY;
2060
+ const chipIcon = isBaseStyle ? /* @__PURE__ */ React22.createElement(import_ui19.Tooltip, { title: (0, import_i18n6.__)("Inherited from base styles", "elementor"), placement: "top" }, /* @__PURE__ */ React22.createElement(import_icons6.InfoCircleIcon, { fontSize: SIZE4 })) : void 0;
2026
2061
  return /* @__PURE__ */ React22.createElement(
2027
2062
  import_ui19.Chip,
2028
2063
  {
2029
2064
  label: displayLabel,
2030
2065
  size: SIZE4,
2031
- color: "global",
2066
+ color: chipColor,
2032
2067
  variant: "standard",
2033
2068
  state: "enabled",
2034
- icon: provider === import_editor_styles_repository7.ELEMENTS_BASE_STYLES_PROVIDER_KEY ? /* @__PURE__ */ React22.createElement(import_ui19.Tooltip, { title: (0, import_i18n6.__)("Inherited from base styles", "elementor"), placement: "top" }, /* @__PURE__ */ React22.createElement(import_icons6.InfoCircleIcon, { fontSize: SIZE4 })) : void 0,
2069
+ icon: chipIcon,
2035
2070
  sx: (theme) => ({
2036
2071
  lineHeight: 1,
2037
2072
  flexWrap: "nowrap",
@@ -2076,7 +2111,7 @@ var ActionIcons = () => /* @__PURE__ */ React24.createElement(import_ui21.Box, {
2076
2111
 
2077
2112
  // src/styles-inheritance/hooks/use-normalized-inheritance-chain-items.tsx
2078
2113
  var import_react20 = require("react");
2079
- var import_editor_styles_repository8 = require("@elementor/editor-styles-repository");
2114
+ var import_editor_styles_repository9 = require("@elementor/editor-styles-repository");
2080
2115
  var import_i18n7 = require("@wordpress/i18n");
2081
2116
  var MAXIMUM_ITEMS = 2;
2082
2117
  var useNormalizedInheritanceChainItems = (inheritanceChain, bind, resolve) => {
@@ -2088,7 +2123,7 @@ var useNormalizedInheritanceChainItems = (inheritanceChain, bind, resolve) => {
2088
2123
  );
2089
2124
  const validItems = normalizedItems.map((item) => ({
2090
2125
  ...item,
2091
- displayLabel: import_editor_styles_repository8.ELEMENTS_BASE_STYLES_PROVIDER_KEY !== item.provider ? item.displayLabel : (0, import_i18n7.__)("Base", "elementor")
2126
+ displayLabel: import_editor_styles_repository9.ELEMENTS_BASE_STYLES_PROVIDER_KEY !== item.provider ? item.displayLabel : (0, import_i18n7.__)("Base", "elementor")
2092
2127
  })).filter((item) => !item.value || item.displayLabel !== "").slice(0, MAXIMUM_ITEMS);
2093
2128
  setItems(validItems);
2094
2129
  })();
@@ -2109,7 +2144,8 @@ var normalizeInheritanceItem = async (item, index, bind, resolve) => {
2109
2144
  provider: item.provider || "",
2110
2145
  breakpoint: breakpoint ?? DEFAULT_BREAKPOINT3,
2111
2146
  displayLabel,
2112
- value: await getTransformedValue(item, bind, resolve)
2147
+ value: await getTransformedValue(item, bind, resolve),
2148
+ chipColor: getChipColor(item)
2113
2149
  };
2114
2150
  };
2115
2151
  var getTransformedValue = async (item, bind, resolve) => {
@@ -2131,6 +2167,16 @@ var getTransformedValue = async (item, bind, resolve) => {
2131
2167
  return "";
2132
2168
  }
2133
2169
  };
2170
+ var getChipColor = (item) => {
2171
+ const { provider = "", style } = item;
2172
+ if (provider === import_editor_styles_repository9.ELEMENTS_BASE_STYLES_PROVIDER_KEY) {
2173
+ return "default";
2174
+ }
2175
+ if (style?.label === "local") {
2176
+ return "accent";
2177
+ }
2178
+ return "global";
2179
+ };
2134
2180
 
2135
2181
  // src/styles-inheritance/styles-inheritance-transformers-registry.tsx
2136
2182
  var import_editor_canvas = require("@elementor/editor-canvas");
@@ -2139,8 +2185,9 @@ var stylesInheritanceTransformersRegistry = (0, import_editor_canvas.createTrans
2139
2185
  // src/styles-inheritance/styles-inheritance-infotip.tsx
2140
2186
  var SIZE5 = "tiny";
2141
2187
  var StyleIndicatorInfotip = ({ inheritanceChain, propType, path, label, children }) => {
2142
- const [open, setOpen] = (0, import_react21.useState)(false);
2143
- const { isSiteRtl } = useDirection();
2188
+ const [showInfotip, setShowInfotip] = (0, import_react21.useState)(false);
2189
+ const toggleInfotip = () => setShowInfotip((prev) => !prev);
2190
+ const closeInfotip = () => setShowInfotip(false);
2144
2191
  const key = path.join(".");
2145
2192
  const sectionContentRef = useSectionContentRef();
2146
2193
  const sectionContentWidth = sectionContentRef?.current?.offsetWidth ?? 320;
@@ -2151,12 +2198,7 @@ var StyleIndicatorInfotip = ({ inheritanceChain, propType, path, label, children
2151
2198
  });
2152
2199
  }, [key, propType]);
2153
2200
  const items3 = useNormalizedInheritanceChainItems(inheritanceChain, key, resolve);
2154
- const toggleOpen = () => setOpen((prev) => !prev);
2155
- const closeInfotip = () => {
2156
- setOpen(false);
2157
- };
2158
- const forceInfotipAlignLeft = isSiteRtl ? 9999999 : -9999999;
2159
- const infotipContent = /* @__PURE__ */ React25.createElement(
2201
+ const infotipContent = /* @__PURE__ */ React25.createElement(import_ui22.ClickAwayListener, { onClickAway: closeInfotip }, /* @__PURE__ */ React25.createElement(
2160
2202
  import_ui22.Card,
2161
2203
  {
2162
2204
  elevation: 0,
@@ -2187,54 +2229,90 @@ var StyleIndicatorInfotip = ({ inheritanceChain, propType, path, label, children
2187
2229
  onClick: closeInfotip
2188
2230
  }
2189
2231
  )),
2190
- /* @__PURE__ */ React25.createElement(import_ui22.Stack, { gap: 1.5, sx: { pl: 2, pr: 1, pb: 2, overflowX: "hidden", overflowY: "auto" }, role: "list" }, items3.map((item, index) => {
2191
- return /* @__PURE__ */ React25.createElement(
2192
- import_ui22.Box,
2193
- {
2194
- key: item.id,
2195
- display: "flex",
2196
- gap: 0.5,
2197
- role: "listitem",
2198
- "aria-label": (0, import_i18n8.__)("Inheritance item: %s", "elementor").replace(
2199
- "%s",
2200
- item.displayLabel
2201
- )
2202
- },
2203
- /* @__PURE__ */ React25.createElement(import_ui22.Box, { display: "flex", gap: 0.5, sx: { flexWrap: "wrap", width: "100%" } }, /* @__PURE__ */ React25.createElement(BreakpointIcon, { breakpoint: item.breakpoint }), /* @__PURE__ */ React25.createElement(LabelChip, { displayLabel: item.displayLabel, provider: item.provider }), /* @__PURE__ */ React25.createElement(ValueComponent, { index, value: item.value })),
2204
- /* @__PURE__ */ React25.createElement(ActionIcons, null)
2205
- );
2206
- }))
2232
+ /* @__PURE__ */ React25.createElement(
2233
+ import_ui22.Stack,
2234
+ {
2235
+ gap: 1.5,
2236
+ sx: { pl: 2, pr: 1, pb: 2, overflowX: "hidden", overflowY: "auto" },
2237
+ role: "list"
2238
+ },
2239
+ items3.map((item, index) => {
2240
+ return /* @__PURE__ */ React25.createElement(
2241
+ import_ui22.Box,
2242
+ {
2243
+ key: item.id,
2244
+ display: "flex",
2245
+ gap: 0.5,
2246
+ role: "listitem",
2247
+ "aria-label": (0, import_i18n8.__)("Inheritance item: %s", "elementor").replace(
2248
+ "%s",
2249
+ item.displayLabel
2250
+ )
2251
+ },
2252
+ /* @__PURE__ */ React25.createElement(import_ui22.Box, { display: "flex", gap: 0.5, sx: { flexWrap: "wrap", width: "100%" } }, /* @__PURE__ */ React25.createElement(BreakpointIcon, { breakpoint: item.breakpoint }), /* @__PURE__ */ React25.createElement(
2253
+ LabelChip,
2254
+ {
2255
+ displayLabel: item.displayLabel,
2256
+ provider: item.provider,
2257
+ chipColor: item.chipColor
2258
+ }
2259
+ ), /* @__PURE__ */ React25.createElement(ValueComponent, { index, value: item.value })),
2260
+ /* @__PURE__ */ React25.createElement(ActionIcons, null)
2261
+ );
2262
+ })
2263
+ )
2207
2264
  )
2208
- );
2209
- return /* @__PURE__ */ React25.createElement(
2210
- import_ui22.Infotip,
2211
- {
2212
- placement: "top",
2213
- content: infotipContent,
2214
- open,
2215
- onClose: closeInfotip,
2216
- disableHoverListener: true,
2217
- componentsProps: {
2218
- tooltip: {
2219
- sx: {
2220
- mx: 2
2265
+ ));
2266
+ return /* @__PURE__ */ React25.createElement(TooltipOrInfotip, { showInfotip, onClose: closeInfotip, infotipContent }, /* @__PURE__ */ React25.createElement(import_ui22.IconButton, { onClick: toggleInfotip, "aria-label": label, sx: { my: "-1px" } }, children));
2267
+ };
2268
+ function TooltipOrInfotip({
2269
+ children,
2270
+ showInfotip,
2271
+ onClose,
2272
+ infotipContent
2273
+ }) {
2274
+ const { isSiteRtl } = useDirection();
2275
+ const forceInfotipAlignLeft = isSiteRtl ? 9999999 : -9999999;
2276
+ if (showInfotip) {
2277
+ return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(
2278
+ import_ui22.Backdrop,
2279
+ {
2280
+ open: showInfotip,
2281
+ onClick: onClose,
2282
+ sx: {
2283
+ backgroundColor: "transparent",
2284
+ zIndex: (theme) => theme.zIndex.modal - 1
2285
+ }
2286
+ }
2287
+ ), /* @__PURE__ */ React25.createElement(
2288
+ import_ui22.Infotip,
2289
+ {
2290
+ placement: "top",
2291
+ content: infotipContent,
2292
+ open: showInfotip,
2293
+ onClose,
2294
+ disableHoverListener: true,
2295
+ componentsProps: {
2296
+ tooltip: {
2297
+ sx: { mx: 2 }
2298
+ }
2299
+ },
2300
+ slotProps: {
2301
+ popper: {
2302
+ modifiers: [
2303
+ {
2304
+ name: "offset",
2305
+ options: { offset: [forceInfotipAlignLeft, 0] }
2306
+ }
2307
+ ]
2221
2308
  }
2222
2309
  }
2223
2310
  },
2224
- slotProps: {
2225
- popper: {
2226
- modifiers: [
2227
- {
2228
- name: "offset",
2229
- options: { offset: [forceInfotipAlignLeft, 0] }
2230
- }
2231
- ]
2232
- }
2233
- }
2234
- },
2235
- /* @__PURE__ */ React25.createElement(import_ui22.IconButton, { onClick: toggleOpen, "aria-label": label, sx: { my: "-1px" } }, children)
2236
- );
2237
- };
2311
+ children
2312
+ ));
2313
+ }
2314
+ return /* @__PURE__ */ React25.createElement(import_ui22.Tooltip, { title: (0, import_i18n8.__)("Style origin", "elementor"), placement: "top" }, children);
2315
+ }
2238
2316
 
2239
2317
  // src/styles-inheritance/styles-inheritance-indicator.tsx
2240
2318
  var StylesInheritanceIndicator = () => {
@@ -2254,9 +2332,9 @@ var StylesInheritanceIndicator = () => {
2254
2332
  }
2255
2333
  }) => style.id === currentStyleId && breakpoint === currentStyleMeta.breakpoint && state === currentStyleMeta.state
2256
2334
  );
2257
- const hasValue = !(0, import_editor_props6.isEmpty)(currentItem?.value);
2335
+ const hasValue = !(0, import_editor_props5.isEmpty)(currentItem?.value);
2258
2336
  const [actualStyle] = inheritanceChain;
2259
- if (actualStyle.provider === import_editor_styles_repository9.ELEMENTS_BASE_STYLES_PROVIDER_KEY) {
2337
+ if (actualStyle.provider === import_editor_styles_repository10.ELEMENTS_BASE_STYLES_PROVIDER_KEY) {
2260
2338
  return null;
2261
2339
  }
2262
2340
  const isFinalValue = currentItem === actualStyle;
@@ -2291,7 +2369,7 @@ var getVariant = ({
2291
2369
  currentStyleProvider
2292
2370
  }) => {
2293
2371
  if (isFinalValue) {
2294
- return (0, import_editor_styles_repository9.isElementsStylesProvider)(currentStyleProvider?.getKey?.()) ? "local" : "global";
2372
+ return (0, import_editor_styles_repository10.isElementsStylesProvider)(currentStyleProvider?.getKey?.()) ? "local" : "global";
2295
2373
  }
2296
2374
  if (hasValue) {
2297
2375
  return "overridden";
@@ -2421,7 +2499,7 @@ var BorderStyleField = () => {
2421
2499
  // src/components/style-sections/border-section/border-width-field.tsx
2422
2500
  var React34 = __toESM(require("react"));
2423
2501
  var import_editor_controls11 = require("@elementor/editor-controls");
2424
- var import_editor_props7 = require("@elementor/editor-props");
2502
+ var import_editor_props6 = require("@elementor/editor-props");
2425
2503
  var import_icons8 = require("@elementor/icons");
2426
2504
  var import_ui29 = require("@elementor/ui");
2427
2505
  var import_i18n12 = require("@wordpress/i18n");
@@ -2458,7 +2536,7 @@ var BorderWidthField = () => {
2458
2536
  label: (0, import_i18n12.__)("Border width", "elementor"),
2459
2537
  icon: /* @__PURE__ */ React34.createElement(import_icons8.SideAllIcon, { fontSize: "tiny" }),
2460
2538
  tooltipLabel: (0, import_i18n12.__)("Adjust borders", "elementor"),
2461
- multiSizePropTypeUtil: import_editor_props7.borderWidthPropTypeUtil
2539
+ multiSizePropTypeUtil: import_editor_props6.borderWidthPropTypeUtil
2462
2540
  }
2463
2541
  ));
2464
2542
  };
@@ -2501,7 +2579,7 @@ var BorderField = () => {
2501
2579
  // src/components/style-sections/border-section/border-radius-field.tsx
2502
2580
  var React36 = __toESM(require("react"));
2503
2581
  var import_editor_controls12 = require("@elementor/editor-controls");
2504
- var import_editor_props8 = require("@elementor/editor-props");
2582
+ var import_editor_props7 = require("@elementor/editor-props");
2505
2583
  var import_icons9 = require("@elementor/icons");
2506
2584
  var import_ui30 = require("@elementor/ui");
2507
2585
  var import_i18n14 = require("@wordpress/i18n");
@@ -2544,7 +2622,7 @@ var BorderRadiusField = () => {
2544
2622
  label: (0, import_i18n14.__)("Border radius", "elementor"),
2545
2623
  icon: /* @__PURE__ */ React36.createElement(import_icons9.BorderCornersIcon, { fontSize: "tiny" }),
2546
2624
  tooltipLabel: (0, import_i18n14.__)("Adjust corners", "elementor"),
2547
- multiSizePropTypeUtil: import_editor_props8.borderRadiusPropTypeUtil
2625
+ multiSizePropTypeUtil: import_editor_props7.borderRadiusPropTypeUtil
2548
2626
  }
2549
2627
  ));
2550
2628
  };
@@ -2986,7 +3064,7 @@ var getGroupControlValue = (order) => {
2986
3064
  var React46 = __toESM(require("react"));
2987
3065
  var import_react24 = require("react");
2988
3066
  var import_editor_controls20 = require("@elementor/editor-controls");
2989
- var import_editor_props9 = require("@elementor/editor-props");
3067
+ var import_editor_props8 = require("@elementor/editor-props");
2990
3068
  var import_icons15 = require("@elementor/icons");
2991
3069
  var import_ui38 = require("@elementor/ui");
2992
3070
  var import_i18n21 = require("@wordpress/i18n");
@@ -3032,7 +3110,7 @@ var FlexSizeField = () => {
3032
3110
  if (group === "flex-grow") {
3033
3111
  setFields({
3034
3112
  "flex-basis": null,
3035
- "flex-grow": import_editor_props9.numberPropTypeUtil.create(DEFAULT),
3113
+ "flex-grow": import_editor_props8.numberPropTypeUtil.create(DEFAULT),
3036
3114
  "flex-shrink": null
3037
3115
  });
3038
3116
  return;
@@ -3040,7 +3118,7 @@ var FlexSizeField = () => {
3040
3118
  setFields({
3041
3119
  "flex-basis": null,
3042
3120
  "flex-grow": null,
3043
- "flex-shrink": import_editor_props9.numberPropTypeUtil.create(DEFAULT)
3121
+ "flex-shrink": import_editor_props8.numberPropTypeUtil.create(DEFAULT)
3044
3122
  });
3045
3123
  };
3046
3124
  return /* @__PURE__ */ React46.createElement(import_ui38.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React46.createElement(import_ui38.ThemeProvider, null, /* @__PURE__ */ React46.createElement(SectionContent, null, /* @__PURE__ */ React46.createElement(import_ui38.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(StylesField, { bind: activeGroup ?? "" }, /* @__PURE__ */ React46.createElement(import_ui38.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlLabel, null, (0, import_i18n21.__)("Size", "elementor"))), /* @__PURE__ */ React46.createElement(import_ui38.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React46.createElement(
@@ -3340,8 +3418,8 @@ var positionOptions2 = [
3340
3418
  { label: (0, import_i18n31.__)("None", "elementor"), value: "none" },
3341
3419
  { label: (0, import_i18n31.__)("Scale down", "elementor"), value: "scale-down" }
3342
3420
  ];
3343
- var ObjectFitField = ({ onChange }) => {
3344
- return /* @__PURE__ */ React57.createElement(StylesField, { bind: "object-fit" }, /* @__PURE__ */ React57.createElement(import_ui47.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React57.createElement(import_ui47.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ControlLabel, null, (0, import_i18n31.__)("Object fit", "elementor"))), /* @__PURE__ */ React57.createElement(import_ui47.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React57.createElement(import_editor_controls29.SelectControl, { options: positionOptions2, onChange }))));
3421
+ var ObjectFitField = () => {
3422
+ return /* @__PURE__ */ React57.createElement(StylesField, { bind: "object-fit" }, /* @__PURE__ */ React57.createElement(import_ui47.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React57.createElement(import_ui47.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ControlLabel, null, (0, import_i18n31.__)("Object fit", "elementor"))), /* @__PURE__ */ React57.createElement(import_ui47.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React57.createElement(import_editor_controls29.SelectControl, { options: positionOptions2 }))));
3345
3423
  };
3346
3424
 
3347
3425
  // src/components/style-sections/size-section/object-position-field.tsx
@@ -3360,8 +3438,8 @@ var positionOptions3 = [
3360
3438
  { label: (0, import_i18n32.__)("Bottom left", "elementor"), value: "bottom left" },
3361
3439
  { label: (0, import_i18n32.__)("Bottom right", "elementor"), value: "bottom right" }
3362
3440
  ];
3363
- var ObjectPositionField = ({ onChange }) => {
3364
- return /* @__PURE__ */ React58.createElement(StylesField, { bind: "object-position" }, /* @__PURE__ */ React58.createElement(import_ui48.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(import_ui48.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React58.createElement(ControlLabel, null, (0, import_i18n32.__)("Object position", "elementor"))), /* @__PURE__ */ React58.createElement(import_ui48.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React58.createElement(import_editor_controls30.SelectControl, { options: positionOptions3, onChange }))));
3441
+ var ObjectPositionField = () => {
3442
+ return /* @__PURE__ */ React58.createElement(StylesField, { bind: "object-position" }, /* @__PURE__ */ React58.createElement(import_ui48.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(import_ui48.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React58.createElement(ControlLabel, null, (0, import_i18n32.__)("Object position", "elementor"))), /* @__PURE__ */ React58.createElement(import_ui48.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React58.createElement(import_editor_controls30.SelectControl, { options: positionOptions3 }))));
3365
3443
  };
3366
3444
 
3367
3445
  // src/components/style-sections/size-section/overflow-field.tsx
@@ -3396,16 +3474,8 @@ var OverflowField = () => {
3396
3474
 
3397
3475
  // src/components/style-sections/size-section/size-section.tsx
3398
3476
  var SizeSection = () => {
3399
- const [fitValue, setFitValue] = useStylesField("object-fit");
3477
+ const [fitValue] = useStylesField("object-fit");
3400
3478
  const isNotFill = fitValue && fitValue?.value !== "fill";
3401
- const onFitChange = (newFit, previousValue) => {
3402
- if (newFit && newFit !== previousValue) {
3403
- setFitValue({
3404
- value: newFit,
3405
- $$type: "string"
3406
- });
3407
- }
3408
- };
3409
3479
  const isVersion330Active = (0, import_editor_v1_adapters10.isExperimentActive)("e_v_3_30");
3410
3480
  return /* @__PURE__ */ React60.createElement(SectionContent, null, /* @__PURE__ */ React60.createElement(import_ui50.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(SizeField, { bind: "width", label: (0, import_i18n34.__)("Width", "elementor"), extendedValues: ["auto"] })), /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(SizeField, { bind: "height", label: (0, import_i18n34.__)("Height", "elementor"), extendedValues: ["auto"] }))), /* @__PURE__ */ React60.createElement(import_ui50.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(
3411
3481
  SizeField,
@@ -3421,7 +3491,7 @@ var SizeSection = () => {
3421
3491
  label: (0, import_i18n34.__)("Min height", "elementor"),
3422
3492
  extendedValues: ["auto"]
3423
3493
  }
3424
- ))), /* @__PURE__ */ React60.createElement(import_ui50.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(SizeField, { bind: "max-width", label: (0, import_i18n34.__)("Max width", "elementor") })), /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(SizeField, { bind: "max-height", label: (0, import_i18n34.__)("Max height", "elementor") }))), /* @__PURE__ */ React60.createElement(PanelDivider, null), /* @__PURE__ */ React60.createElement(import_ui50.Stack, null, /* @__PURE__ */ React60.createElement(OverflowField, null)), isVersion330Active && /* @__PURE__ */ React60.createElement(CollapsibleContent, null, /* @__PURE__ */ React60.createElement(import_ui50.Stack, { gap: 2 }, /* @__PURE__ */ React60.createElement(StylesField, { bind: "aspect-ratio" }, /* @__PURE__ */ React60.createElement(import_editor_controls32.AspectRatioControl, { label: (0, import_i18n34.__)("Aspect Ratio", "elementor") })), /* @__PURE__ */ React60.createElement(PanelDivider, null), /* @__PURE__ */ React60.createElement(ObjectFitField, { onChange: onFitChange }), isNotFill && /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(ObjectPositionField, null)))));
3494
+ ))), /* @__PURE__ */ React60.createElement(import_ui50.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(SizeField, { bind: "max-width", label: (0, import_i18n34.__)("Max width", "elementor") })), /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(SizeField, { bind: "max-height", label: (0, import_i18n34.__)("Max height", "elementor") }))), /* @__PURE__ */ React60.createElement(PanelDivider, null), /* @__PURE__ */ React60.createElement(import_ui50.Stack, null, /* @__PURE__ */ React60.createElement(OverflowField, null)), isVersion330Active && /* @__PURE__ */ React60.createElement(CollapsibleContent, null, /* @__PURE__ */ React60.createElement(import_ui50.Stack, { gap: 2 }, /* @__PURE__ */ React60.createElement(StylesField, { bind: "aspect-ratio" }, /* @__PURE__ */ React60.createElement(import_editor_controls32.AspectRatioControl, { label: (0, import_i18n34.__)("Aspect Ratio", "elementor") })), /* @__PURE__ */ React60.createElement(PanelDivider, null), /* @__PURE__ */ React60.createElement(ObjectFitField, null), isNotFill && /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(ObjectPositionField, null)))));
3425
3495
  };
3426
3496
  var SizeField = ({ label, bind, extendedValues }) => {
3427
3497
  return /* @__PURE__ */ React60.createElement(StylesField, { bind }, /* @__PURE__ */ React60.createElement(import_ui50.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React60.createElement(ControlLabel, null, label)), /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React60.createElement(import_editor_controls32.SizeControl, { extendedValues }))));
@@ -3900,7 +3970,7 @@ function ClassesHeader({ children }) {
3900
3970
  function useCurrentClassesProp() {
3901
3971
  const { elementType } = useElement();
3902
3972
  const prop = Object.entries(elementType.propsSchema).find(
3903
- ([, propType]) => propType.kind === "plain" && propType.key === import_editor_props10.CLASSES_PROP_KEY
3973
+ ([, propType]) => propType.kind === "plain" && propType.key === import_editor_props9.CLASSES_PROP_KEY
3904
3974
  );
3905
3975
  if (!prop) {
3906
3976
  throw new Error("Element does not have a classes prop");
@@ -4050,7 +4120,7 @@ var getAtomicDynamicTags = () => {
4050
4120
  };
4051
4121
 
4052
4122
  // src/dynamics/utils.ts
4053
- var import_editor_props11 = require("@elementor/editor-props");
4123
+ var import_editor_props10 = require("@elementor/editor-props");
4054
4124
  var import_schema = require("@elementor/schema");
4055
4125
  var DYNAMIC_PROP_TYPE_KEY = "dynamic";
4056
4126
  var isDynamicPropType = (prop) => prop.key === DYNAMIC_PROP_TYPE_KEY;
@@ -4059,12 +4129,12 @@ var getDynamicPropType = (propType) => {
4059
4129
  return dynamicPropType && isDynamicPropType(dynamicPropType) ? dynamicPropType : null;
4060
4130
  };
4061
4131
  var isDynamicPropValue = (prop) => {
4062
- return (0, import_editor_props11.isTransformable)(prop) && prop.$$type === DYNAMIC_PROP_TYPE_KEY;
4132
+ return (0, import_editor_props10.isTransformable)(prop) && prop.$$type === DYNAMIC_PROP_TYPE_KEY;
4063
4133
  };
4064
4134
  var supportsDynamic = (propType) => {
4065
4135
  return !!getDynamicPropType(propType);
4066
4136
  };
4067
- var dynamicPropTypeUtil = (0, import_editor_props11.createPropUtils)(
4137
+ var dynamicPropTypeUtil = (0, import_editor_props10.createPropUtils)(
4068
4138
  DYNAMIC_PROP_TYPE_KEY,
4069
4139
  import_schema.z.strictObject({
4070
4140
  name: import_schema.z.string(),
@@ -4314,7 +4384,7 @@ var Control3 = ({ control }) => {
4314
4384
 
4315
4385
  // src/dynamics/dynamic-transformer.ts
4316
4386
  var import_editor_canvas3 = require("@elementor/editor-canvas");
4317
- var import_editor_props12 = require("@elementor/editor-props");
4387
+ var import_editor_props11 = require("@elementor/editor-props");
4318
4388
 
4319
4389
  // src/dynamics/errors.ts
4320
4390
  var import_utils8 = require("@elementor/utils");
@@ -4332,7 +4402,7 @@ var dynamicTransformer = (0, import_editor_canvas3.createTransformer)((value) =>
4332
4402
  });
4333
4403
  function simpleTransform(props) {
4334
4404
  const transformed = Object.entries(props).map(([settingKey, settingValue]) => {
4335
- const value = (0, import_editor_props12.isTransformable)(settingValue) ? settingValue.value : settingValue;
4405
+ const value = (0, import_editor_props11.isTransformable)(settingValue) ? settingValue.value : settingValue;
4336
4406
  return [settingKey, value];
4337
4407
  });
4338
4408
  return Object.fromEntries(transformed);