@elementor/editor-controls 3.35.0-403 → 3.35.0-405

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
@@ -5981,7 +5981,7 @@ import {
5981
5981
  ToggleButton as ToggleButton3,
5982
5982
  ToggleButtonGroup as ToggleButtonGroup2,
5983
5983
  toggleButtonGroupClasses,
5984
- Tooltip as Tooltip9,
5984
+ Tooltip as Tooltip10,
5985
5985
  usePopupState as usePopupState8
5986
5986
  } from "@elementor/ui";
5987
5987
  import { useEditorState } from "@tiptap/react";
@@ -5991,7 +5991,7 @@ import { __ as __51 } from "@wordpress/i18n";
5991
5991
  import * as React99 from "react";
5992
5992
  import { useEffect as useEffect9, useRef as useRef24 } from "react";
5993
5993
  import { ExternalLinkIcon } from "@elementor/icons";
5994
- import { bindPopover as bindPopover7, Popover as Popover7, Stack as Stack16, TextField as TextField8, ToggleButton as ToggleButton2 } from "@elementor/ui";
5994
+ import { bindPopover as bindPopover7, Popover as Popover7, Stack as Stack16, TextField as TextField8, ToggleButton as ToggleButton2, Tooltip as Tooltip9 } from "@elementor/ui";
5995
5995
  import { __ as __50 } from "@wordpress/i18n";
5996
5996
  var UrlPopover = ({
5997
5997
  popupState,
@@ -6033,9 +6033,10 @@ var UrlPopover = ({
6033
6033
  placeholder: __50("Type a URL", "elementor"),
6034
6034
  inputProps: { ref: inputRef },
6035
6035
  color: "secondary",
6036
- InputProps: { sx: { borderRadius: "8px" } }
6036
+ InputProps: { sx: { borderRadius: "8px" } },
6037
+ onKeyUp: (event) => event.key === "Enter" && handleClose()
6037
6038
  }
6038
- ), /* @__PURE__ */ React99.createElement(
6039
+ ), /* @__PURE__ */ React99.createElement(Tooltip9, { title: __50("Open in a new tab", "elementor") }, /* @__PURE__ */ React99.createElement(
6039
6040
  ToggleButton2,
6040
6041
  {
6041
6042
  size: "tiny",
@@ -6046,7 +6047,7 @@ var UrlPopover = ({
6046
6047
  sx: { borderRadius: "8px" }
6047
6048
  },
6048
6049
  /* @__PURE__ */ React99.createElement(ExternalLinkIcon, { fontSize: "tiny" })
6049
- ))
6050
+ )))
6050
6051
  );
6051
6052
  };
6052
6053
 
@@ -6169,7 +6170,7 @@ var InlineEditorToolbar = ({ editor }) => {
6169
6170
  pointerEvents: linkPopupState.isOpen ? "none" : "all"
6170
6171
  }
6171
6172
  },
6172
- /* @__PURE__ */ React100.createElement(Tooltip9, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React100.createElement(IconButton8, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
6173
+ /* @__PURE__ */ React100.createElement(Tooltip10, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React100.createElement(IconButton8, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
6173
6174
  /* @__PURE__ */ React100.createElement(
6174
6175
  ToggleButtonGroup2,
6175
6176
  {
@@ -6192,7 +6193,7 @@ var InlineEditorToolbar = ({ editor }) => {
6192
6193
  }
6193
6194
  }
6194
6195
  },
6195
- formatButtonsList.map((button) => /* @__PURE__ */ React100.createElement(Tooltip9, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React100.createElement(
6196
+ formatButtonsList.map((button) => /* @__PURE__ */ React100.createElement(Tooltip10, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React100.createElement(
6196
6197
  ToggleButton3,
6197
6198
  {
6198
6199
  value: button.action,
@@ -6226,6 +6227,9 @@ var InlineEditorToolbar = ({ editor }) => {
6226
6227
  };
6227
6228
 
6228
6229
  // src/components/inline-editor.tsx
6230
+ var ITALIC_KEYBOARD_SHORTCUT = "i";
6231
+ var BOLD_KEYBOARD_SHORTCUT = "b";
6232
+ var UNDERLINE_KEYBOARD_SHORTCUT = "u";
6229
6233
  var INITIAL_STYLE = "margin:0;padding:0;";
6230
6234
  var useOnUpdate = (callback, dependencies) => {
6231
6235
  const hasMounted = useRef26(false);
@@ -6296,6 +6300,12 @@ var InlineEditor = forwardRef10(
6296
6300
  if (event.key === "Escape") {
6297
6301
  onBlur?.(event);
6298
6302
  }
6303
+ if (!event.metaKey && !event.ctrlKey || event.altKey) {
6304
+ return;
6305
+ }
6306
+ if ([ITALIC_KEYBOARD_SHORTCUT, BOLD_KEYBOARD_SHORTCUT, UNDERLINE_KEYBOARD_SHORTCUT].includes(event.key)) {
6307
+ event.stopPropagation();
6308
+ }
6299
6309
  };
6300
6310
  const toolbarRelatedListeners = showToolbar ? {
6301
6311
  mouseup: onSelectionEnd,
@@ -6458,12 +6468,12 @@ var InlineEditingControl = createControl(
6458
6468
  // src/components/icon-buttons/clear-icon-button.tsx
6459
6469
  import * as React103 from "react";
6460
6470
  import { BrushBigIcon } from "@elementor/icons";
6461
- import { IconButton as IconButton9, styled as styled10, Tooltip as Tooltip10 } from "@elementor/ui";
6471
+ import { IconButton as IconButton9, styled as styled10, Tooltip as Tooltip11 } from "@elementor/ui";
6462
6472
  var CustomIconButton = styled10(IconButton9)(({ theme }) => ({
6463
6473
  width: theme.spacing(2.5),
6464
6474
  height: theme.spacing(2.5)
6465
6475
  }));
6466
- var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React103.createElement(Tooltip10, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React103.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React103.createElement(BrushBigIcon, { fontSize: size })));
6476
+ var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React103.createElement(Tooltip11, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React103.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React103.createElement(BrushBigIcon, { fontSize: size })));
6467
6477
 
6468
6478
  // src/components/repeater/repeater.tsx
6469
6479
  import * as React104 from "react";
@@ -6475,7 +6485,7 @@ import {
6475
6485
  Box as Box25,
6476
6486
  IconButton as IconButton10,
6477
6487
  Infotip as Infotip4,
6478
- Tooltip as Tooltip11,
6488
+ Tooltip as Tooltip12,
6479
6489
  usePopupState as usePopupState10
6480
6490
  } from "@elementor/ui";
6481
6491
  import { __ as __52 } from "@wordpress/i18n";
@@ -6647,7 +6657,7 @@ var RepeaterItem = ({
6647
6657
  "aria-label": __52("Open item", "elementor"),
6648
6658
  ...bindTrigger6(popoverState),
6649
6659
  startIcon,
6650
- actions: /* @__PURE__ */ React104.createElement(React104.Fragment, null, showDuplicate && /* @__PURE__ */ React104.createElement(Tooltip11, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React104.createElement(IconButton10, { size: SIZE9, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React104.createElement(CopyIcon2, { fontSize: SIZE9 }))), showToggle && /* @__PURE__ */ React104.createElement(Tooltip11, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React104.createElement(IconButton10, { size: SIZE9, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React104.createElement(EyeOffIcon2, { fontSize: SIZE9 }) : /* @__PURE__ */ React104.createElement(EyeIcon2, { fontSize: SIZE9 }))), actions?.(value), showRemove && /* @__PURE__ */ React104.createElement(Tooltip11, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React104.createElement(IconButton10, { size: SIZE9, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React104.createElement(XIcon4, { fontSize: SIZE9 }))))
6660
+ actions: /* @__PURE__ */ React104.createElement(React104.Fragment, null, showDuplicate && /* @__PURE__ */ React104.createElement(Tooltip12, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React104.createElement(IconButton10, { size: SIZE9, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React104.createElement(CopyIcon2, { fontSize: SIZE9 }))), showToggle && /* @__PURE__ */ React104.createElement(Tooltip12, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React104.createElement(IconButton10, { size: SIZE9, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React104.createElement(EyeOffIcon2, { fontSize: SIZE9 }) : /* @__PURE__ */ React104.createElement(EyeIcon2, { fontSize: SIZE9 }))), actions?.(value), showRemove && /* @__PURE__ */ React104.createElement(Tooltip12, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React104.createElement(IconButton10, { size: SIZE9, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React104.createElement(XIcon4, { fontSize: SIZE9 }))))
6651
6661
  }
6652
6662
  ), /* @__PURE__ */ React104.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React104.createElement(Box25, null, children({ anchorEl: ref }))));
6653
6663
  };