@elementor/editor-editing-panel 3.32.0-26 → 3.32.0-28

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
@@ -1713,7 +1713,7 @@ var import_editor_panels2 = require("@elementor/editor-panels");
1713
1713
  // src/components/editing-panel.tsx
1714
1714
  var React89 = __toESM(require("react"));
1715
1715
  var import_editor_controls53 = require("@elementor/editor-controls");
1716
- var import_editor_elements10 = require("@elementor/editor-elements");
1716
+ var import_editor_elements12 = require("@elementor/editor-elements");
1717
1717
  var import_editor_panels = require("@elementor/editor-panels");
1718
1718
  var import_editor_ui6 = require("@elementor/editor-ui");
1719
1719
  var import_icons24 = require("@elementor/icons");
@@ -3241,9 +3241,32 @@ var BorderSection = () => /* @__PURE__ */ React44.createElement(SectionContent,
3241
3241
  // src/components/style-sections/effects-section/effects-section.tsx
3242
3242
  var React46 = __toESM(require("react"));
3243
3243
  var import_editor_controls18 = require("@elementor/editor-controls");
3244
+ var import_editor_elements10 = require("@elementor/editor-elements");
3244
3245
  var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
3245
3246
  var import_i18n21 = require("@wordpress/i18n");
3246
3247
 
3248
+ // src/utils/get-recently-used-styles.ts
3249
+ var import_editor_elements9 = require("@elementor/editor-elements");
3250
+ var quickTransform = (props) => {
3251
+ return Object.entries(props).map(([key, value]) => {
3252
+ if (value && typeof value === "object" && "$$type" in value && value?.$$type === "dimensions") {
3253
+ return Object.keys(value?.value ?? {}).map((nestedKey) => `${key}-${nestedKey}`);
3254
+ }
3255
+ return [key];
3256
+ });
3257
+ };
3258
+ var getRecentlyUsedList = (elementId) => {
3259
+ if (!elementId) {
3260
+ return [];
3261
+ }
3262
+ const styles = (0, import_editor_elements9.getElementStyles)(elementId);
3263
+ const styleKeys = Object.keys(styles ?? {});
3264
+ const variants = styleKeys.map((key) => styles?.[key]?.variants ?? []);
3265
+ const propList = variants.flat().filter((variant) => variant !== void 0).map((variant) => variant.props);
3266
+ const propSet = new Set(propList.map(quickTransform).flat(2));
3267
+ return Array.from(propSet);
3268
+ };
3269
+
3247
3270
  // src/components/style-sections/effects-section/opacity-control-field.tsx
3248
3271
  var React45 = __toESM(require("react"));
3249
3272
  var import_react25 = require("react");
@@ -3264,13 +3287,14 @@ var TRANSITIONS_LABEL = (0, import_i18n21.__)("Transitions", "elementor");
3264
3287
  var EffectsSection = () => {
3265
3288
  const shouldShowTransition = (0, import_editor_v1_adapters5.isExperimentActive)(import_editor_v1_adapters5.EXPERIMENTAL_FEATURES.TRANSITIONS);
3266
3289
  const isUnstableRepeaterActive = (0, import_editor_v1_adapters5.isExperimentActive)(import_editor_v1_adapters5.EXPERIMENTAL_FEATURES.UNSTABLE_REPEATER);
3267
- return /* @__PURE__ */ React46.createElement(SectionContent, null, /* @__PURE__ */ React46.createElement(OpacityControlField, null), /* @__PURE__ */ React46.createElement(PanelDivider, null), /* @__PURE__ */ React46.createElement(StylesField, { bind: "box-shadow", propDisplayName: BOX_SHADOW_LABEL }, /* @__PURE__ */ React46.createElement(import_editor_controls18.BoxShadowRepeaterControl, null)), /* @__PURE__ */ React46.createElement(PanelDivider, null), /* @__PURE__ */ React46.createElement(StylesField, { bind: "transform", propDisplayName: TRANSFORM_LABEL }, isUnstableRepeaterActive ? /* @__PURE__ */ React46.createElement(import_editor_controls18.UnstableTransformRepeaterControl, null) : /* @__PURE__ */ React46.createElement(import_editor_controls18.TransformRepeaterControl, null)), shouldShowTransition && /* @__PURE__ */ React46.createElement(React46.Fragment, null, /* @__PURE__ */ React46.createElement(PanelDivider, null), /* @__PURE__ */ React46.createElement(StylesField, { bind: "transition", propDisplayName: TRANSITIONS_LABEL }, /* @__PURE__ */ React46.createElement(import_editor_controls18.TransitionRepeaterControl, null))), /* @__PURE__ */ React46.createElement(PanelDivider, null), /* @__PURE__ */ React46.createElement(StylesField, { bind: "filter", propDisplayName: FILTER_LABEL }, /* @__PURE__ */ React46.createElement(import_editor_controls18.FilterRepeaterControl, null)), /* @__PURE__ */ React46.createElement(PanelDivider, null), /* @__PURE__ */ React46.createElement(StylesField, { bind: "backdrop-filter", propDisplayName: BACKDROP_FILTER_LABEL }, /* @__PURE__ */ React46.createElement(import_editor_controls18.FilterRepeaterControl, { filterPropName: "backdrop-filter" })));
3290
+ const { element } = (0, import_editor_elements10.useSelectedElement)();
3291
+ return /* @__PURE__ */ React46.createElement(SectionContent, null, /* @__PURE__ */ React46.createElement(OpacityControlField, null), /* @__PURE__ */ React46.createElement(PanelDivider, null), /* @__PURE__ */ React46.createElement(StylesField, { bind: "box-shadow", propDisplayName: BOX_SHADOW_LABEL }, /* @__PURE__ */ React46.createElement(import_editor_controls18.BoxShadowRepeaterControl, null)), /* @__PURE__ */ React46.createElement(PanelDivider, null), /* @__PURE__ */ React46.createElement(StylesField, { bind: "transform", propDisplayName: TRANSFORM_LABEL }, isUnstableRepeaterActive ? /* @__PURE__ */ React46.createElement(import_editor_controls18.UnstableTransformRepeaterControl, null) : /* @__PURE__ */ React46.createElement(import_editor_controls18.TransformRepeaterControl, null)), shouldShowTransition && /* @__PURE__ */ React46.createElement(React46.Fragment, null, /* @__PURE__ */ React46.createElement(PanelDivider, null), /* @__PURE__ */ React46.createElement(StylesField, { bind: "transition", propDisplayName: TRANSITIONS_LABEL }, /* @__PURE__ */ React46.createElement(import_editor_controls18.TransitionRepeaterControl, { recentlyUsedList: getRecentlyUsedList(element?.id) }))), /* @__PURE__ */ React46.createElement(PanelDivider, null), /* @__PURE__ */ React46.createElement(StylesField, { bind: "filter", propDisplayName: FILTER_LABEL }, /* @__PURE__ */ React46.createElement(import_editor_controls18.FilterRepeaterControl, null)), /* @__PURE__ */ React46.createElement(PanelDivider, null), /* @__PURE__ */ React46.createElement(StylesField, { bind: "backdrop-filter", propDisplayName: BACKDROP_FILTER_LABEL }, /* @__PURE__ */ React46.createElement(import_editor_controls18.FilterRepeaterControl, { filterPropName: "backdrop-filter" })));
3268
3292
  };
3269
3293
 
3270
3294
  // src/components/style-sections/layout-section/layout-section.tsx
3271
3295
  var React58 = __toESM(require("react"));
3272
3296
  var import_editor_controls29 = require("@elementor/editor-controls");
3273
- var import_editor_elements9 = require("@elementor/editor-elements");
3297
+ var import_editor_elements11 = require("@elementor/editor-elements");
3274
3298
  var import_i18n33 = require("@wordpress/i18n");
3275
3299
 
3276
3300
  // src/hooks/use-computed-style.ts
@@ -3918,7 +3942,7 @@ var LayoutSection = () => {
3918
3942
  const displayPlaceholder = useDisplayPlaceholderValue();
3919
3943
  const isDisplayFlex = shouldDisplayFlexFields(display, displayPlaceholder);
3920
3944
  const { element } = useElement();
3921
- const parent = (0, import_editor_elements9.useParentElement)(element.id);
3945
+ const parent = (0, import_editor_elements11.useParentElement)(element.id);
3922
3946
  const parentStyle = useComputedStyle(parent?.id || null);
3923
3947
  const parentStyleDirection = parentStyle?.flexDirection ?? "row";
3924
3948
  return /* @__PURE__ */ React58.createElement(SectionContent, null, /* @__PURE__ */ React58.createElement(DisplayField, null), isDisplayFlex && /* @__PURE__ */ React58.createElement(FlexFields, null), "flex" === parentStyle?.display && /* @__PURE__ */ React58.createElement(FlexChildFields, { parentStyleDirection }));
@@ -4801,7 +4825,7 @@ var PanelTabContent = () => {
4801
4825
  // src/components/editing-panel.tsx
4802
4826
  var { useMenuItems } = controlActionsMenu;
4803
4827
  var EditingPanel = () => {
4804
- const { element, elementType } = (0, import_editor_elements10.useSelectedElement)();
4828
+ const { element, elementType } = (0, import_editor_elements12.useSelectedElement)();
4805
4829
  const controlReplacements = getControlReplacements();
4806
4830
  const menuItems = useMenuItems().default;
4807
4831
  if (!element || !elementType) {
@@ -4818,10 +4842,10 @@ var { panel, usePanelActions, usePanelStatus } = (0, import_editor_panels2.__cre
4818
4842
  });
4819
4843
 
4820
4844
  // src/sync/is-atomic-widget-selected.ts
4821
- var import_editor_elements11 = require("@elementor/editor-elements");
4845
+ var import_editor_elements13 = require("@elementor/editor-elements");
4822
4846
  var isAtomicWidgetSelected = () => {
4823
- const selectedElements = (0, import_editor_elements11.getSelectedElements)();
4824
- const widgetCache = (0, import_editor_elements11.getWidgetsCache)();
4847
+ const selectedElements = (0, import_editor_elements13.getSelectedElements)();
4848
+ const widgetCache = (0, import_editor_elements13.getWidgetsCache)();
4825
4849
  if (selectedElements.length !== 1) {
4826
4850
  return false;
4827
4851
  }