@elementor/editor-controls 3.32.0-63 → 3.32.0-65

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
@@ -4666,32 +4666,52 @@ var import_i18n35 = require("@wordpress/i18n");
4666
4666
  // src/controls/transform-control/functions/axis-row.tsx
4667
4667
  var React72 = __toESM(require("react"));
4668
4668
  var import_ui63 = require("@elementor/ui");
4669
- var AxisRow = ({ label, bindValue, startIcon, anchorRef, units: units2 }) => {
4670
- return /* @__PURE__ */ React72.createElement(import_ui63.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React72.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React72.createElement(import_ui63.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React72.createElement(ControlLabel, null, label)), /* @__PURE__ */ React72.createElement(import_ui63.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React72.createElement(PropKeyProvider, { bind: bindValue }, /* @__PURE__ */ React72.createElement(SizeControl, { anchorRef, startIcon, units: units2, variant: "angle" })))));
4669
+ var AxisRow = ({ label, bind, startIcon, anchorRef, units: units2, variant = "angle" }) => {
4670
+ return /* @__PURE__ */ React72.createElement(import_ui63.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React72.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React72.createElement(import_ui63.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React72.createElement(ControlLabel, null, label)), /* @__PURE__ */ React72.createElement(import_ui63.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React72.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React72.createElement(
4671
+ SizeControl,
4672
+ {
4673
+ anchorRef,
4674
+ startIcon,
4675
+ units: units2,
4676
+ variant
4677
+ }
4678
+ )))));
4671
4679
  };
4672
4680
 
4673
4681
  // src/controls/transform-control/functions/move.tsx
4674
4682
  var moveAxisControls = [
4675
4683
  {
4676
4684
  label: (0, import_i18n35.__)("Move X", "elementor"),
4677
- bindValue: "x",
4678
- startIcon: /* @__PURE__ */ React73.createElement(import_icons25.ArrowRightIcon, { fontSize: "tiny" })
4685
+ bind: "x",
4686
+ startIcon: /* @__PURE__ */ React73.createElement(import_icons25.ArrowRightIcon, { fontSize: "tiny" }),
4687
+ units: ["px", "%", "em", "rem", "vw"]
4679
4688
  },
4680
4689
  {
4681
4690
  label: (0, import_i18n35.__)("Move Y", "elementor"),
4682
- bindValue: "y",
4683
- startIcon: /* @__PURE__ */ React73.createElement(import_icons25.ArrowDownSmallIcon, { fontSize: "tiny" })
4691
+ bind: "y",
4692
+ startIcon: /* @__PURE__ */ React73.createElement(import_icons25.ArrowDownSmallIcon, { fontSize: "tiny" }),
4693
+ units: ["px", "%", "em", "rem", "vh"]
4684
4694
  },
4685
4695
  {
4686
4696
  label: (0, import_i18n35.__)("Move Z", "elementor"),
4687
- bindValue: "z",
4688
- startIcon: /* @__PURE__ */ React73.createElement(import_icons25.ArrowDownLeftIcon, { fontSize: "tiny" })
4697
+ bind: "z",
4698
+ startIcon: /* @__PURE__ */ React73.createElement(import_icons25.ArrowDownLeftIcon, { fontSize: "tiny" }),
4699
+ units: ["px", "%", "em", "rem", "vw", "vh"]
4689
4700
  }
4690
4701
  ];
4691
4702
  var Move = () => {
4692
4703
  const context = useBoundProp(import_editor_props37.moveTransformPropTypeUtil);
4693
- const rowRef = (0, import_react38.useRef)(null);
4694
- return /* @__PURE__ */ React73.createElement(import_ui64.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React73.createElement(PropProvider, { ...context }, /* @__PURE__ */ React73.createElement(PropKeyProvider, { bind: TransformFunctionKeys.move }, moveAxisControls.map((control) => /* @__PURE__ */ React73.createElement(AxisRow, { key: control.bindValue, ...control, anchorRef: rowRef })))));
4704
+ const rowRefs = [(0, import_react38.useRef)(null), (0, import_react38.useRef)(null), (0, import_react38.useRef)(null)];
4705
+ return /* @__PURE__ */ React73.createElement(import_ui64.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React73.createElement(PropProvider, { ...context }, /* @__PURE__ */ React73.createElement(PropKeyProvider, { bind: TransformFunctionKeys.move }, moveAxisControls.map((control, index) => /* @__PURE__ */ React73.createElement(
4706
+ AxisRow,
4707
+ {
4708
+ key: control.bind,
4709
+ ...control,
4710
+ anchorRef: rowRefs[index],
4711
+ units: control.units,
4712
+ variant: "length"
4713
+ }
4714
+ )))));
4695
4715
  };
4696
4716
 
4697
4717
  // src/controls/transform-control/functions/rotate.tsx
@@ -4704,25 +4724,33 @@ var import_i18n36 = require("@wordpress/i18n");
4704
4724
  var rotateAxisControls = [
4705
4725
  {
4706
4726
  label: (0, import_i18n36.__)("Rotate X", "elementor"),
4707
- bindValue: "x",
4727
+ bind: "x",
4708
4728
  startIcon: /* @__PURE__ */ React74.createElement(import_icons26.Arrow360Icon, { fontSize: "tiny" })
4709
4729
  },
4710
4730
  {
4711
4731
  label: (0, import_i18n36.__)("Rotate Y", "elementor"),
4712
- bindValue: "y",
4732
+ bind: "y",
4713
4733
  startIcon: /* @__PURE__ */ React74.createElement(import_icons26.Arrow360Icon, { fontSize: "tiny", style: { transform: "scaleX(-1) rotate(-90deg)" } })
4714
4734
  },
4715
4735
  {
4716
4736
  label: (0, import_i18n36.__)("Rotate Z", "elementor"),
4717
- bindValue: "z",
4737
+ bind: "z",
4718
4738
  startIcon: /* @__PURE__ */ React74.createElement(import_icons26.RotateClockwiseIcon, { fontSize: "tiny" })
4719
4739
  }
4720
4740
  ];
4721
4741
  var rotateUnits = ["deg", "rad", "grad", "turn"];
4722
4742
  var Rotate = () => {
4723
4743
  const context = useBoundProp(import_editor_props38.rotateTransformPropTypeUtil);
4724
- const rowRef = (0, import_react39.useRef)(null);
4725
- return /* @__PURE__ */ React74.createElement(import_ui65.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React74.createElement(PropProvider, { ...context }, /* @__PURE__ */ React74.createElement(PropKeyProvider, { bind: TransformFunctionKeys.rotate }, rotateAxisControls.map((control) => /* @__PURE__ */ React74.createElement(AxisRow, { key: control.bindValue, ...control, anchorRef: rowRef, units: rotateUnits })))));
4744
+ const rowRefs = [(0, import_react39.useRef)(null), (0, import_react39.useRef)(null), (0, import_react39.useRef)(null)];
4745
+ return /* @__PURE__ */ React74.createElement(import_ui65.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React74.createElement(PropProvider, { ...context }, /* @__PURE__ */ React74.createElement(PropKeyProvider, { bind: TransformFunctionKeys.rotate }, rotateAxisControls.map((control, index) => /* @__PURE__ */ React74.createElement(
4746
+ AxisRow,
4747
+ {
4748
+ key: control.bind,
4749
+ ...control,
4750
+ anchorRef: rowRefs[index],
4751
+ units: rotateUnits
4752
+ }
4753
+ )))));
4726
4754
  };
4727
4755
 
4728
4756
  // src/controls/transform-control/functions/scale.tsx
@@ -4736,32 +4764,32 @@ var import_i18n37 = require("@wordpress/i18n");
4736
4764
  // src/controls/transform-control/functions/scale-axis-row.tsx
4737
4765
  var React75 = __toESM(require("react"));
4738
4766
  var import_ui66 = require("@elementor/ui");
4739
- var ScaleAxisRow = ({ label, bindValue, startIcon, anchorRef }) => {
4740
- return /* @__PURE__ */ React75.createElement(import_ui66.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React75.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React75.createElement(import_ui66.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React75.createElement(ControlLabel, null, label)), /* @__PURE__ */ React75.createElement(import_ui66.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React75.createElement(PropKeyProvider, { bind: bindValue }, /* @__PURE__ */ React75.createElement(NumberControl, { step: 0.1, placeholder: "1", startIcon })))));
4767
+ var ScaleAxisRow = ({ label, bind, startIcon, anchorRef }) => {
4768
+ return /* @__PURE__ */ React75.createElement(import_ui66.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React75.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React75.createElement(import_ui66.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React75.createElement(ControlLabel, null, label)), /* @__PURE__ */ React75.createElement(import_ui66.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React75.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React75.createElement(NumberControl, { step: 0.1, placeholder: "1", startIcon })))));
4741
4769
  };
4742
4770
 
4743
4771
  // src/controls/transform-control/functions/scale.tsx
4744
4772
  var scaleAxisControls = [
4745
4773
  {
4746
4774
  label: (0, import_i18n37.__)("Scale X", "elementor"),
4747
- bindValue: "x",
4775
+ bind: "x",
4748
4776
  startIcon: /* @__PURE__ */ React76.createElement(import_icons27.ArrowRightIcon, { fontSize: "tiny" })
4749
4777
  },
4750
4778
  {
4751
4779
  label: (0, import_i18n37.__)("Scale Y", "elementor"),
4752
- bindValue: "y",
4780
+ bind: "y",
4753
4781
  startIcon: /* @__PURE__ */ React76.createElement(import_icons27.ArrowDownSmallIcon, { fontSize: "tiny" })
4754
4782
  },
4755
4783
  {
4756
4784
  label: (0, import_i18n37.__)("Scale Z", "elementor"),
4757
- bindValue: "z",
4785
+ bind: "z",
4758
4786
  startIcon: /* @__PURE__ */ React76.createElement(import_icons27.ArrowDownLeftIcon, { fontSize: "tiny" })
4759
4787
  }
4760
4788
  ];
4761
4789
  var Scale = () => {
4762
4790
  const context = useBoundProp(import_editor_props39.scaleTransformPropTypeUtil);
4763
- const rowRef = (0, import_react40.useRef)(null);
4764
- return /* @__PURE__ */ React76.createElement(import_ui67.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React76.createElement(PropProvider, { ...context }, /* @__PURE__ */ React76.createElement(PropKeyProvider, { bind: TransformFunctionKeys.scale }, scaleAxisControls.map((control) => /* @__PURE__ */ React76.createElement(ScaleAxisRow, { key: control.bindValue, ...control, anchorRef: rowRef })))));
4791
+ const rowRefs = [(0, import_react40.useRef)(null), (0, import_react40.useRef)(null), (0, import_react40.useRef)(null)];
4792
+ return /* @__PURE__ */ React76.createElement(import_ui67.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React76.createElement(PropProvider, { ...context }, /* @__PURE__ */ React76.createElement(PropKeyProvider, { bind: TransformFunctionKeys.scale }, scaleAxisControls.map((control, index) => /* @__PURE__ */ React76.createElement(ScaleAxisRow, { key: control.bind, ...control, anchorRef: rowRefs[index] })))));
4765
4793
  };
4766
4794
 
4767
4795
  // src/controls/transform-control/functions/skew.tsx
@@ -4774,20 +4802,28 @@ var import_i18n38 = require("@wordpress/i18n");
4774
4802
  var skewAxisControls = [
4775
4803
  {
4776
4804
  label: (0, import_i18n38.__)("Skew X", "elementor"),
4777
- bindValue: "x",
4805
+ bind: "x",
4778
4806
  startIcon: /* @__PURE__ */ React77.createElement(import_icons28.ArrowRightIcon, { fontSize: "tiny" })
4779
4807
  },
4780
4808
  {
4781
4809
  label: (0, import_i18n38.__)("Skew Y", "elementor"),
4782
- bindValue: "y",
4810
+ bind: "y",
4783
4811
  startIcon: /* @__PURE__ */ React77.createElement(import_icons28.ArrowLeftIcon, { fontSize: "tiny", style: { transform: "scaleX(-1) rotate(-90deg)" } })
4784
4812
  }
4785
4813
  ];
4786
4814
  var skewUnits = ["deg", "rad", "grad", "turn"];
4787
4815
  var Skew = () => {
4788
4816
  const context = useBoundProp(import_editor_props40.skewTransformPropTypeUtil);
4789
- const rowRef = (0, import_react41.useRef)(null);
4790
- return /* @__PURE__ */ React77.createElement(import_ui68.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React77.createElement(PropProvider, { ...context }, /* @__PURE__ */ React77.createElement(PropKeyProvider, { bind: TransformFunctionKeys.skew }, skewAxisControls.map((control) => /* @__PURE__ */ React77.createElement(AxisRow, { key: control.bindValue, ...control, anchorRef: rowRef, units: skewUnits })))));
4817
+ const rowRefs = [(0, import_react41.useRef)(null), (0, import_react41.useRef)(null), (0, import_react41.useRef)(null)];
4818
+ return /* @__PURE__ */ React77.createElement(import_ui68.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React77.createElement(PropProvider, { ...context }, /* @__PURE__ */ React77.createElement(PropKeyProvider, { bind: TransformFunctionKeys.skew }, skewAxisControls.map((control, index) => /* @__PURE__ */ React77.createElement(
4819
+ AxisRow,
4820
+ {
4821
+ key: control.bind,
4822
+ ...control,
4823
+ anchorRef: rowRefs[index],
4824
+ units: skewUnits
4825
+ }
4826
+ )))));
4791
4827
  };
4792
4828
 
4793
4829
  // src/controls/transform-control/use-transform-tabs-history.tsx
@@ -4958,17 +4994,23 @@ var Label2 = ({ label, value }) => {
4958
4994
 
4959
4995
  // src/controls/transform-control/transform-repeater-control.tsx
4960
4996
  var TransformRepeaterControl = createControl(() => {
4961
- const { propType, value: transformValues, setValue } = useBoundProp(import_editor_props42.transformPropTypeUtil);
4997
+ const context = useBoundProp(import_editor_props42.transformPropTypeUtil);
4998
+ return /* @__PURE__ */ React81.createElement(PropProvider, { ...context }, /* @__PURE__ */ React81.createElement(PropKeyProvider, { bind: "transform-functions" }, /* @__PURE__ */ React81.createElement(Repeater2, null)));
4999
+ });
5000
+ var ToolTip = /* @__PURE__ */ React81.createElement(React81.Fragment, null, /* @__PURE__ */ React81.createElement(import_icons30.InfoCircleFilledIcon, { sx: { color: "secondary.main" } }), /* @__PURE__ */ React81.createElement(import_ui72.Typography, { variant: "body2", color: "text.secondary", fontSize: "14px" }, (0, import_i18n41.__)("You can use each kind of transform only once per element.", "elementor")));
5001
+ var Repeater2 = () => {
5002
+ const transformFunctionsContext = useBoundProp(import_editor_props42.transformFunctionsPropTypeUtil);
4962
5003
  const availableValues = [initialTransformValue, initialScaleValue, initialRotateValue, initialSkewValue];
5004
+ const { value: transformValues } = transformFunctionsContext;
4963
5005
  const getInitialValue = () => {
4964
5006
  return availableValues.find((value) => !transformValues?.some((item) => item.$$type === value.$$type));
4965
5007
  };
4966
5008
  const shouldDisableAddItem = !getInitialValue();
4967
- return /* @__PURE__ */ React81.createElement(PropProvider, { propType, value: transformValues, setValue }, /* @__PURE__ */ React81.createElement(
5009
+ return /* @__PURE__ */ React81.createElement(PropProvider, { ...transformFunctionsContext }, /* @__PURE__ */ React81.createElement(
4968
5010
  UnstableRepeater,
4969
5011
  {
4970
5012
  initial: getInitialValue() ?? initialTransformValue,
4971
- propTypeUtil: import_editor_props42.transformPropTypeUtil
5013
+ propTypeUtil: import_editor_props42.transformFunctionsPropTypeUtil
4972
5014
  },
4973
5015
  /* @__PURE__ */ React81.createElement(Header, { label: (0, import_i18n41.__)("Transform", "elementor") }, /* @__PURE__ */ React81.createElement(
4974
5016
  TooltipAddItemAction,
@@ -4981,8 +5023,7 @@ var TransformRepeaterControl = createControl(() => {
4981
5023
  /* @__PURE__ */ React81.createElement(ItemsContainer, { itemTemplate: /* @__PURE__ */ React81.createElement(Item, { Icon: TransformIcon, Label: TransformLabel }) }, /* @__PURE__ */ React81.createElement(DisableItemAction, null), /* @__PURE__ */ React81.createElement(RemoveItemAction, null)),
4982
5024
  /* @__PURE__ */ React81.createElement(EditItemPopover, null, /* @__PURE__ */ React81.createElement(TransformContent, null))
4983
5025
  ));
4984
- });
4985
- var ToolTip = /* @__PURE__ */ React81.createElement(React81.Fragment, null, /* @__PURE__ */ React81.createElement(import_icons30.InfoCircleFilledIcon, { sx: { color: "secondary.main" } }), /* @__PURE__ */ React81.createElement(import_ui72.Typography, { variant: "body2", color: "text.secondary", fontSize: "14px" }, (0, import_i18n41.__)("You can use each kind of transform only once per element.", "elementor")));
5026
+ };
4986
5027
 
4987
5028
  // src/controls/transition-control/transition-repeater-control.tsx
4988
5029
  var React84 = __toESM(require("react"));