@elementor/editor-controls 3.35.0-486 → 3.35.0-488

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.d.mts CHANGED
@@ -223,8 +223,10 @@ type ItemSelectorProps = {
223
223
  }>;
224
224
  disabledItems?: string[];
225
225
  id?: string;
226
+ footer?: ReactNode;
227
+ categoryItemContentTemplate?: (item: SelectableItem) => ReactNode;
226
228
  };
227
- declare const ItemSelector: ({ itemsList, selectedItem, onItemChange, onClose, sectionWidth, title, itemStyle, onDebounce, icon, disabledItems, id, }: ItemSelectorProps) => React$1.JSX.Element;
229
+ declare const ItemSelector: ({ itemsList, selectedItem, onItemChange, onClose, sectionWidth, title, itemStyle, onDebounce, icon, disabledItems, id, footer, categoryItemContentTemplate, }: ItemSelectorProps) => React$1.JSX.Element;
228
230
 
229
231
  declare const UrlControl: ControlComponent$1<({ placeholder, ariaLabel }: {
230
232
  placeholder?: string;
package/dist/index.d.ts CHANGED
@@ -223,8 +223,10 @@ type ItemSelectorProps = {
223
223
  }>;
224
224
  disabledItems?: string[];
225
225
  id?: string;
226
+ footer?: ReactNode;
227
+ categoryItemContentTemplate?: (item: SelectableItem) => ReactNode;
226
228
  };
227
- declare const ItemSelector: ({ itemsList, selectedItem, onItemChange, onClose, sectionWidth, title, itemStyle, onDebounce, icon, disabledItems, id, }: ItemSelectorProps) => React$1.JSX.Element;
229
+ declare const ItemSelector: ({ itemsList, selectedItem, onItemChange, onClose, sectionWidth, title, itemStyle, onDebounce, icon, disabledItems, id, footer, categoryItemContentTemplate, }: ItemSelectorProps) => React$1.JSX.Element;
228
230
 
229
231
  declare const UrlControl: ControlComponent$1<({ placeholder, ariaLabel }: {
230
232
  placeholder?: string;
package/dist/index.js CHANGED
@@ -2971,7 +2971,9 @@ var ItemSelector = ({
2971
2971
  },
2972
2972
  icon,
2973
2973
  disabledItems,
2974
- id = "item-selector"
2974
+ id = "item-selector",
2975
+ footer,
2976
+ categoryItemContentTemplate
2975
2977
  }) => {
2976
2978
  const [searchValue, setSearchValue] = (0, import_react30.useState)("");
2977
2979
  const filteredItemsList = useFilteredItemsList(itemsList, searchValue, disabledItems);
@@ -2991,7 +2993,7 @@ var ItemSelector = ({
2991
2993
  placeholder: (0, import_i18n19.__)("Search", "elementor"),
2992
2994
  id: id + "-search"
2993
2995
  }
2994
- ), /* @__PURE__ */ React58.createElement(import_ui43.Divider, null), filteredItemsList.length > 0 ? /* @__PURE__ */ React58.createElement(
2996
+ ), /* @__PURE__ */ React58.createElement(import_ui43.Divider, null), /* @__PURE__ */ React58.createElement(import_ui43.Box, { sx: { flex: 1, overflow: "auto", minHeight: 0 } }, filteredItemsList.length > 0 ? /* @__PURE__ */ React58.createElement(
2995
2997
  ItemList,
2996
2998
  {
2997
2999
  itemListItems: filteredItemsList,
@@ -2999,7 +3001,8 @@ var ItemSelector = ({
2999
3001
  handleClose,
3000
3002
  selectedItem,
3001
3003
  itemStyle,
3002
- onDebounce
3004
+ onDebounce,
3005
+ categoryItemContentTemplate
3003
3006
  }
3004
3007
  ) : /* @__PURE__ */ React58.createElement(
3005
3008
  import_ui43.Stack,
@@ -3050,7 +3053,7 @@ var ItemSelector = ({
3050
3053
  (0, import_i18n19.__)("Clear & try again", "elementor")
3051
3054
  )
3052
3055
  )
3053
- ));
3056
+ )), footer);
3054
3057
  };
3055
3058
  var ItemList = ({
3056
3059
  itemListItems,
@@ -3059,7 +3062,8 @@ var ItemList = ({
3059
3062
  selectedItem,
3060
3063
  itemStyle = () => ({}),
3061
3064
  onDebounce = () => {
3062
- }
3065
+ },
3066
+ categoryItemContentTemplate
3063
3067
  }) => {
3064
3068
  const selectedItemFound = itemListItems.find((item) => item.value === selectedItem);
3065
3069
  const debouncedVirtualizeChange = useDebounce((visibleItems) => {
@@ -3079,7 +3083,8 @@ var ItemList = ({
3079
3083
  onSelect: setSelectedItem,
3080
3084
  onClose: handleClose,
3081
3085
  itemStyle: memoizedItemStyle,
3082
- "data-testid": "item-list"
3086
+ "data-testid": "item-list",
3087
+ categoryItemContentTemplate
3083
3088
  }
3084
3089
  );
3085
3090
  };
@@ -5620,6 +5625,7 @@ var SelectionSizeControl = createControl(
5620
5625
  );
5621
5626
 
5622
5627
  // src/controls/transition-control/data.ts
5628
+ var import_utils6 = require("@elementor/utils");
5623
5629
  var import_i18n47 = require("@wordpress/i18n");
5624
5630
  var initialTransitionValue = {
5625
5631
  selection: {
@@ -5631,13 +5637,125 @@ var initialTransitionValue = {
5631
5637
  },
5632
5638
  size: { $$type: "size", value: { size: 200, unit: "ms" } }
5633
5639
  };
5634
- var transitionProperties = [
5635
- {
5636
- label: (0, import_i18n47.__)("Default", "elementor"),
5637
- type: "category",
5638
- properties: [{ label: (0, import_i18n47.__)("All properties", "elementor"), value: "all" }]
5640
+ var MIN_PRO_VERSION = "3.35";
5641
+ var shouldExtendTransitionProperties = () => {
5642
+ const hasProInstalled = !!window.elementorPro;
5643
+ if (!hasProInstalled) {
5644
+ return true;
5639
5645
  }
5640
- ];
5646
+ const proVersion = window.elementorPro?.config?.version;
5647
+ if (!proVersion) {
5648
+ return false;
5649
+ }
5650
+ return (0, import_utils6.isVersionGreaterOrEqual)(proVersion, MIN_PRO_VERSION);
5651
+ };
5652
+ var createTransitionPropertiesList = () => {
5653
+ const baseProperties = [
5654
+ {
5655
+ label: (0, import_i18n47.__)("Default", "elementor"),
5656
+ type: "category",
5657
+ properties: [{ label: (0, import_i18n47.__)("All properties", "elementor"), value: "all" }]
5658
+ },
5659
+ {
5660
+ label: (0, import_i18n47.__)("Margin", "elementor"),
5661
+ type: "category",
5662
+ properties: [
5663
+ { label: (0, import_i18n47.__)("Margin (all)", "elementor"), value: "margin", isDisabled: true },
5664
+ { label: (0, import_i18n47.__)("Margin bottom", "elementor"), value: "margin-block-end", isDisabled: true },
5665
+ { label: (0, import_i18n47.__)("Margin left", "elementor"), value: "margin-inline-start", isDisabled: true },
5666
+ { label: (0, import_i18n47.__)("Margin right", "elementor"), value: "margin-inline-end", isDisabled: true },
5667
+ { label: (0, import_i18n47.__)("Margin top", "elementor"), value: "margin-block-start", isDisabled: true }
5668
+ ]
5669
+ },
5670
+ {
5671
+ label: (0, import_i18n47.__)("Padding", "elementor"),
5672
+ type: "category",
5673
+ properties: [
5674
+ { label: (0, import_i18n47.__)("Padding (all)", "elementor"), value: "padding", isDisabled: true },
5675
+ { label: (0, import_i18n47.__)("Padding bottom", "elementor"), value: "padding-block-end", isDisabled: true },
5676
+ { label: (0, import_i18n47.__)("Padding left", "elementor"), value: "padding-inline-start", isDisabled: true },
5677
+ { label: (0, import_i18n47.__)("Padding right", "elementor"), value: "padding-inline-end", isDisabled: true },
5678
+ { label: (0, import_i18n47.__)("Padding top", "elementor"), value: "padding-block-start", isDisabled: true }
5679
+ ]
5680
+ },
5681
+ {
5682
+ label: (0, import_i18n47.__)("Flex", "elementor"),
5683
+ type: "category",
5684
+ properties: [
5685
+ { label: (0, import_i18n47.__)("Flex (all)", "elementor"), value: "flex", isDisabled: true },
5686
+ { label: (0, import_i18n47.__)("Flex grow", "elementor"), value: "flex-grow", isDisabled: true },
5687
+ { label: (0, import_i18n47.__)("Flex shrink", "elementor"), value: "flex-shrink", isDisabled: true },
5688
+ { label: (0, import_i18n47.__)("Flex basis", "elementor"), value: "flex-basis", isDisabled: true }
5689
+ ]
5690
+ },
5691
+ {
5692
+ label: (0, import_i18n47.__)("Size", "elementor"),
5693
+ type: "category",
5694
+ properties: [
5695
+ { label: (0, import_i18n47.__)("Width", "elementor"), value: "width", isDisabled: true },
5696
+ { label: (0, import_i18n47.__)("Height", "elementor"), value: "height", isDisabled: true },
5697
+ { label: (0, import_i18n47.__)("Max height", "elementor"), value: "max-height", isDisabled: true },
5698
+ { label: (0, import_i18n47.__)("Max width", "elementor"), value: "max-width", isDisabled: true },
5699
+ { label: (0, import_i18n47.__)("Min height", "elementor"), value: "min-height", isDisabled: true },
5700
+ { label: (0, import_i18n47.__)("Min width", "elementor"), value: "min-width", isDisabled: true }
5701
+ ]
5702
+ },
5703
+ {
5704
+ label: (0, import_i18n47.__)("Position", "elementor"),
5705
+ type: "category",
5706
+ properties: [
5707
+ { label: (0, import_i18n47.__)("Top", "elementor"), value: "inset-block-start", isDisabled: true },
5708
+ { label: (0, import_i18n47.__)("Left", "elementor"), value: "inset-inline-start", isDisabled: true },
5709
+ { label: (0, import_i18n47.__)("Right", "elementor"), value: "inset-inline-end", isDisabled: true },
5710
+ { label: (0, import_i18n47.__)("Bottom", "elementor"), value: "inset-block-end", isDisabled: true },
5711
+ { label: (0, import_i18n47.__)("Z-index", "elementor"), value: "z-index", isDisabled: true }
5712
+ ]
5713
+ },
5714
+ {
5715
+ label: (0, import_i18n47.__)("Typography", "elementor"),
5716
+ type: "category",
5717
+ properties: [
5718
+ { label: (0, import_i18n47.__)("Font color", "elementor"), value: "color", isDisabled: true },
5719
+ { label: (0, import_i18n47.__)("Font size", "elementor"), value: "font-size", isDisabled: true },
5720
+ { label: (0, import_i18n47.__)("Line height", "elementor"), value: "line-height", isDisabled: true },
5721
+ { label: (0, import_i18n47.__)("Letter spacing", "elementor"), value: "letter-spacing", isDisabled: true },
5722
+ { label: (0, import_i18n47.__)("Word spacing", "elementor"), value: "word-spacing", isDisabled: true },
5723
+ { label: (0, import_i18n47.__)("Font variations", "elementor"), value: "font-variation-settings", isDisabled: true },
5724
+ { label: (0, import_i18n47.__)("Text stroke color", "elementor"), value: "-webkit-text-stroke-color", isDisabled: true }
5725
+ ]
5726
+ },
5727
+ {
5728
+ label: (0, import_i18n47.__)("Background", "elementor"),
5729
+ type: "category",
5730
+ properties: [
5731
+ { label: (0, import_i18n47.__)("Background color", "elementor"), value: "background-color", isDisabled: true },
5732
+ { label: (0, import_i18n47.__)("Background position", "elementor"), value: "background-position", isDisabled: true },
5733
+ { label: (0, import_i18n47.__)("Box shadow", "elementor"), value: "box-shadow", isDisabled: true }
5734
+ ]
5735
+ },
5736
+ {
5737
+ label: (0, import_i18n47.__)("Border", "elementor"),
5738
+ type: "category",
5739
+ properties: [
5740
+ { label: (0, import_i18n47.__)("Border (all)", "elementor"), value: "border", isDisabled: true },
5741
+ { label: (0, import_i18n47.__)("Border radius", "elementor"), value: "border-radius", isDisabled: true },
5742
+ { label: (0, import_i18n47.__)("Border color", "elementor"), value: "border-color", isDisabled: true },
5743
+ { label: (0, import_i18n47.__)("Border width", "elementor"), value: "border-width", isDisabled: true }
5744
+ ]
5745
+ },
5746
+ {
5747
+ label: (0, import_i18n47.__)("Effects", "elementor"),
5748
+ type: "category",
5749
+ properties: [
5750
+ { label: (0, import_i18n47.__)("Opacity", "elementor"), value: "opacity", isDisabled: true },
5751
+ { label: (0, import_i18n47.__)("Transform (all)", "elementor"), value: "transform", isDisabled: true },
5752
+ { label: (0, import_i18n47.__)("Filter (all)", "elementor"), value: "filter", isDisabled: true }
5753
+ ]
5754
+ }
5755
+ ];
5756
+ return shouldExtendTransitionProperties() ? baseProperties : [baseProperties[0]];
5757
+ };
5758
+ var transitionProperties = createTransitionPropertiesList();
5641
5759
  var transitionsItemsList = transitionProperties.map((category) => ({
5642
5760
  label: category.label,
5643
5761
  items: category.properties.map((property) => property.label)
@@ -5670,6 +5788,7 @@ function subscribeToTransitionEvent() {
5670
5788
  var React96 = __toESM(require("react"));
5671
5789
  var import_react51 = require("react");
5672
5790
  var import_editor_props47 = require("@elementor/editor-props");
5791
+ var import_editor_ui11 = require("@elementor/editor-ui");
5673
5792
  var import_icons31 = require("@elementor/icons");
5674
5793
  var import_ui82 = require("@elementor/ui");
5675
5794
  var import_i18n48 = require("@wordpress/i18n");
@@ -5703,9 +5822,11 @@ var includeCurrentValueInOptions = (value, disabledItems) => {
5703
5822
  return item !== value.key.value;
5704
5823
  });
5705
5824
  };
5825
+ var PRO_UPGRADE_URL = "https://go.elementor.com/go-pro-transitions-modal/";
5706
5826
  var TransitionSelector = ({
5707
5827
  recentlyUsedList = [],
5708
- disabledItems = []
5828
+ disabledItems = [],
5829
+ showPromotion = false
5709
5830
  }) => {
5710
5831
  const { value, setValue } = useBoundProp(import_editor_props47.keyValuePropTypeUtil);
5711
5832
  const {
@@ -5713,6 +5834,11 @@ var TransitionSelector = ({
5713
5834
  } = value;
5714
5835
  const defaultRef = (0, import_react51.useRef)(null);
5715
5836
  const popoverState = (0, import_ui82.usePopupState)({ variant: "popover" });
5837
+ const disabledCategories = (0, import_react51.useMemo)(() => {
5838
+ return new Set(
5839
+ transitionProperties.filter((cat) => cat.properties.some((prop) => prop.isDisabled)).map((cat) => cat.label)
5840
+ );
5841
+ }, []);
5716
5842
  const getItemList = () => {
5717
5843
  const recentItems = recentlyUsedList.map((item) => getTransitionPropertyByValue({ value: item, $$type: "string" })?.label).filter((item) => !!item);
5718
5844
  const filteredItems = transitionsItemsList.map((category) => {
@@ -5782,7 +5908,50 @@ var TransitionSelector = ({
5782
5908
  sectionWidth: 268,
5783
5909
  title: (0, import_i18n48.__)("Transition Property", "elementor"),
5784
5910
  icon: import_icons31.VariationsIcon,
5785
- disabledItems: includeCurrentValueInOptions(value, disabledItems)
5911
+ disabledItems: includeCurrentValueInOptions(value, disabledItems),
5912
+ categoryItemContentTemplate: (item) => /* @__PURE__ */ React96.createElement(
5913
+ import_ui82.Box,
5914
+ {
5915
+ sx: {
5916
+ display: "flex",
5917
+ alignItems: "center",
5918
+ justifyContent: "space-between",
5919
+ width: "100%"
5920
+ }
5921
+ },
5922
+ /* @__PURE__ */ React96.createElement("span", null, item.value),
5923
+ showPromotion && disabledCategories.has(item.value) && /* @__PURE__ */ React96.createElement(import_editor_ui11.PromotionChip, null)
5924
+ ),
5925
+ footer: showPromotion ? /* @__PURE__ */ React96.createElement(
5926
+ import_ui82.Alert,
5927
+ {
5928
+ variant: "standard",
5929
+ color: "promotion",
5930
+ icon: false,
5931
+ role: "dialog",
5932
+ "aria-label": "promotion-alert",
5933
+ size: "small",
5934
+ sx: { m: 1.5, mt: 0 }
5935
+ },
5936
+ (0, import_i18n48.__)("Upgrade to customize transition properties and control effects.", "elementor"),
5937
+ /* @__PURE__ */ React96.createElement(
5938
+ import_ui82.Box,
5939
+ {
5940
+ component: "a",
5941
+ href: PRO_UPGRADE_URL,
5942
+ target: "_blank",
5943
+ rel: "noopener noreferrer",
5944
+ sx: {
5945
+ display: "flex",
5946
+ alignItems: "center",
5947
+ gap: 0.5,
5948
+ color: "promotion.main"
5949
+ }
5950
+ },
5951
+ /* @__PURE__ */ React96.createElement(import_icons31.CrownFilledIcon, { fontSize: "tiny" }),
5952
+ (0, import_i18n48.__)("Upgrade now", "elementor")
5953
+ )
5954
+ ) : null
5786
5955
  }
5787
5956
  )
5788
5957
  ));
@@ -5809,7 +5978,7 @@ var areAllPropertiesUsed = (value = []) => {
5809
5978
  });
5810
5979
  }) : false;
5811
5980
  };
5812
- var getSelectionSizeProps = (recentlyUsedList, disabledItems) => {
5981
+ var getSelectionSizeProps = (recentlyUsedList, disabledItems, showPromotion) => {
5813
5982
  return {
5814
5983
  selectionLabel: (0, import_i18n49.__)("Type", "elementor"),
5815
5984
  sizeLabel: (0, import_i18n49.__)("Duration", "elementor"),
@@ -5817,7 +5986,8 @@ var getSelectionSizeProps = (recentlyUsedList, disabledItems) => {
5817
5986
  component: TransitionSelector,
5818
5987
  props: {
5819
5988
  recentlyUsedList,
5820
- disabledItems
5989
+ disabledItems,
5990
+ showPromotion
5821
5991
  }
5822
5992
  },
5823
5993
  sizeConfigMap: {
@@ -5837,11 +6007,11 @@ var isItemDisabled = (item) => {
5837
6007
  const property = getTransitionPropertyByValue(item.value.selection.value?.value);
5838
6008
  return !property ? false : !!property.isDisabled;
5839
6009
  };
5840
- var getChildControlConfig = (recentlyUsedList, disabledItems) => {
6010
+ var getChildControlConfig = (recentlyUsedList, disabledItems, showPromotion) => {
5841
6011
  return {
5842
6012
  propTypeUtil: import_editor_props48.selectionSizePropTypeUtil,
5843
6013
  component: SelectionSizeControl,
5844
- props: getSelectionSizeProps(recentlyUsedList, disabledItems),
6014
+ props: getSelectionSizeProps(recentlyUsedList, disabledItems, showPromotion),
5845
6015
  isItemDisabled
5846
6016
  };
5847
6017
  };
@@ -5851,14 +6021,18 @@ var isPropertyUsed = (value, property) => {
5851
6021
  });
5852
6022
  };
5853
6023
  var getDisabledItemLabels = (values = []) => {
5854
- const disabledLabels = (values || []).map(
6024
+ const selectedLabels = (values || []).map(
5855
6025
  (item) => item.value?.selection?.value?.key?.value
5856
6026
  );
6027
+ const proDisabledLabels = [];
5857
6028
  transitionProperties.forEach((category) => {
5858
- const disabledProperties = category.properties.filter((property) => property.isDisabled && !disabledLabels.includes(property.label)).map((property) => property.label);
5859
- disabledLabels.push(...disabledProperties);
6029
+ const disabledProperties = category.properties.filter((property) => property.isDisabled && !selectedLabels.includes(property.label)).map((property) => property.label);
6030
+ proDisabledLabels.push(...disabledProperties);
5860
6031
  });
5861
- return disabledLabels;
6032
+ return {
6033
+ allDisabled: [...selectedLabels, ...proDisabledLabels],
6034
+ proDisabled: proDisabledLabels
6035
+ };
5862
6036
  };
5863
6037
  var getInitialValue = (values = []) => {
5864
6038
  if (!values?.length) {
@@ -5904,7 +6078,10 @@ var TransitionRepeaterControl = createControl(
5904
6078
  const currentStyleIsNormal = currentStyleState === null;
5905
6079
  const [recentlyUsedList, setRecentlyUsedList] = (0, import_react52.useState)([]);
5906
6080
  const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
5907
- const disabledItems = (0, import_react52.useMemo)(() => getDisabledItemLabels(value), [value]);
6081
+ const { allDisabled: disabledItems, proDisabled: proDisabledItems } = (0, import_react52.useMemo)(
6082
+ () => getDisabledItemLabels(value),
6083
+ [value]
6084
+ );
5908
6085
  const allowedTransitionSet = (0, import_react52.useMemo)(() => {
5909
6086
  const set = /* @__PURE__ */ new Set();
5910
6087
  transitionProperties.forEach((category) => {
@@ -5939,7 +6116,11 @@ var TransitionRepeaterControl = createControl(
5939
6116
  showDuplicate: false,
5940
6117
  showToggle: true,
5941
6118
  initialValues: getInitialValue(value),
5942
- childControlConfig: getChildControlConfig(recentlyUsedList, disabledItems),
6119
+ childControlConfig: getChildControlConfig(
6120
+ recentlyUsedList,
6121
+ disabledItems,
6122
+ proDisabledItems.length > 0
6123
+ ),
5943
6124
  propKey: "transition",
5944
6125
  addItemTooltipProps: {
5945
6126
  disabled: isAddItemDisabled,