@elementor/editor-variables 4.5.0-1180 → 4.5.0-1182

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.mjs CHANGED
@@ -833,6 +833,14 @@ var NoSearchResults = ({ searchValue, onClear, icon }) => {
833
833
  );
834
834
  };
835
835
 
836
+ // src/components/variables-manager-header-location.tsx
837
+ import { createLocation } from "@elementor/locations";
838
+ var {
839
+ Slot: VariablesManagerHeaderSlot,
840
+ inject: injectIntoVariablesManagerHeader,
841
+ useInjections: useVariablesManagerHeaderInjections
842
+ } = createLocation();
843
+
836
844
  // src/components/variables-manager/hooks/use-auto-edit.ts
837
845
  import { useCallback, useState } from "react";
838
846
  var useAutoEdit = () => {
@@ -2170,7 +2178,7 @@ function VariablesManagerPanelContent({ onRequestClose, onExposeCloseAttempt })
2170
2178
  }
2171
2179
  }
2172
2180
  ),
2173
- /* @__PURE__ */ React14.createElement(Box2, { sx: { display: "flex", flexShrink: 0, alignItems: "center" } }, /* @__PURE__ */ React14.createElement(
2181
+ /* @__PURE__ */ React14.createElement(Box2, { sx: { display: "flex", flexShrink: 0, alignItems: "center", gap: 0.5 } }, /* @__PURE__ */ React14.createElement(VariablesManagerHeaderSlot, null), /* @__PURE__ */ React14.createElement(
2174
2182
  VariableManagerCreateMenu,
2175
2183
  {
2176
2184
  outlinedTrigger: true,
@@ -2538,10 +2546,18 @@ var FormField = ({ id, label, errorMsg, noticeMsg, children }) => {
2538
2546
  return /* @__PURE__ */ React16.createElement(Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React16.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React16.createElement(FormLabel, { htmlFor: id, size: "tiny" }, label)), /* @__PURE__ */ React16.createElement(Grid, { item: true, xs: 12 }, children, errorMsg && /* @__PURE__ */ React16.createElement(FormHelperText, { error: true }, errorMsg), noticeMsg && /* @__PURE__ */ React16.createElement(FormHelperText, null, noticeMsg)));
2539
2547
  };
2540
2548
 
2549
+ // src/components/variable-form-header-location.tsx
2550
+ import { createLocation as createLocation2 } from "@elementor/locations";
2551
+ var {
2552
+ Slot: VariableFormHeaderSlot,
2553
+ inject: injectIntoVariableFormHeader,
2554
+ useInjections: useVariableFormHeaderInjections
2555
+ } = createLocation2();
2556
+
2541
2557
  // src/components/variable-creation.tsx
2542
2558
  var SIZE2 = "tiny";
2543
2559
  var VariableCreation = ({ onGoBack, onClose }) => {
2544
- const { icon: VariableIcon, valueField: ValueField, propTypeUtil } = useVariableType();
2560
+ const { icon: VariableIcon, valueField: ValueField, propTypeUtil, variableType } = useVariableType();
2545
2561
  const { setVariableValue: setVariable, path } = useVariableBoundProp();
2546
2562
  const { propType } = useBoundProp4();
2547
2563
  const initialValue = useInitialValue();
@@ -2609,7 +2625,17 @@ var VariableCreation = ({ onGoBack, onClose }) => {
2609
2625
  {
2610
2626
  icon: /* @__PURE__ */ React17.createElement(React17.Fragment, null, onGoBack && /* @__PURE__ */ React17.createElement(IconButton4, { size: SIZE2, "aria-label": __11("Go Back", "elementor"), onClick: onGoBack }, /* @__PURE__ */ React17.createElement(ArrowLeftIcon, { fontSize: SIZE2 })), /* @__PURE__ */ React17.createElement(VariableIcon, { fontSize: SIZE2 })),
2611
2627
  title: __11("Create variable", "elementor"),
2612
- onClose: closePopover
2628
+ onClose: closePopover,
2629
+ actions: [
2630
+ /* @__PURE__ */ React17.createElement(
2631
+ VariableFormHeaderSlot,
2632
+ {
2633
+ key: "variable-form-header",
2634
+ variableType,
2635
+ label: label || void 0
2636
+ }
2637
+ )
2638
+ ]
2613
2639
  }
2614
2640
  ), /* @__PURE__ */ React17.createElement(Divider2, null), /* @__PURE__ */ React17.createElement(PopoverContent, { p: 2 }, /* @__PURE__ */ React17.createElement(
2615
2641
  FormField,
@@ -2804,7 +2830,17 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
2804
2830
  const closeEditDialog = () => () => {
2805
2831
  setEditConfirmation(false);
2806
2832
  };
2807
- const actions = [];
2833
+ const actions = [
2834
+ /* @__PURE__ */ React19.createElement(
2835
+ VariableFormHeaderSlot,
2836
+ {
2837
+ key: "variable-form-header",
2838
+ variableType,
2839
+ variableId: editId,
2840
+ label
2841
+ }
2842
+ )
2843
+ ];
2808
2844
  if (userPermissions.canDelete()) {
2809
2845
  actions.push(
2810
2846
  /* @__PURE__ */ React19.createElement(Tooltip, { key: "delete", placement: "top", title: DELETE_LABEL }, /* @__PURE__ */ React19.createElement(IconButton5, { size: SIZE3, onClick: handleDeleteConfirmation, "aria-label": DELETE_LABEL }, /* @__PURE__ */ React19.createElement(TrashIcon2, { fontSize: SIZE3 })))
@@ -4659,6 +4695,8 @@ export {
4659
4695
  getMenuActionsForVariable,
4660
4696
  hasVariable,
4661
4697
  init,
4698
+ injectIntoVariableFormHeader,
4699
+ injectIntoVariablesManagerHeader,
4662
4700
  registerVariableType,
4663
4701
  registerVariableTypes,
4664
4702
  service,