@elementor/editor-controls 3.35.0 → 3.35.2

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
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
33
  AspectRatioControl: () => AspectRatioControl,
34
+ AttributesControl: () => AttributesControl,
34
35
  BackgroundControl: () => BackgroundControl,
35
36
  BoxShadowRepeaterControl: () => BoxShadowRepeaterControl,
36
37
  ClearIconButton: () => ClearIconButton,
@@ -61,6 +62,7 @@ __export(index_exports, {
61
62
  PopoverContent: () => PopoverContent,
62
63
  PopoverGridContainer: () => PopoverGridContainer,
63
64
  PositionControl: () => PositionControl,
65
+ PromotionTrigger: () => PromotionTrigger,
64
66
  PropKeyProvider: () => PropKeyProvider,
65
67
  PropProvider: () => PropProvider,
66
68
  QueryControl: () => QueryControl,
@@ -373,7 +375,6 @@ var createControlReplacementsRegistry = () => {
373
375
  };
374
376
 
375
377
  // src/create-control.tsx
376
- var brandSymbol = Symbol("control");
377
378
  function createControl(Control5) {
378
379
  return ((props) => {
379
380
  const { ControlToRender, OriginalControl, isReplaced } = useControlReplacement(Control5);
@@ -5792,7 +5793,7 @@ var transitionsItemsList = transitionProperties.map((category) => ({
5792
5793
 
5793
5794
  // src/controls/transition-control/trainsition-events.ts
5794
5795
  var import_editor_elements5 = require("@elementor/editor-elements");
5795
- var import_mixpanel = require("@elementor/mixpanel");
5796
+ var import_events = require("@elementor/events");
5796
5797
  var transitionRepeaterMixpanelEvent = {
5797
5798
  eventName: "click_added_transition",
5798
5799
  location: "V4 Style Tab",
@@ -5805,7 +5806,7 @@ function subscribeToTransitionEvent() {
5805
5806
  const value = payload?.itemValue?.selection?.value?.value?.value;
5806
5807
  const selectedElements = (0, import_editor_elements5.getSelectedElements)();
5807
5808
  const widgetType = selectedElements[0]?.type ?? null;
5808
- (0, import_mixpanel.trackEvent)({
5809
+ (0, import_events.trackEvent)({
5809
5810
  transition_type: value ?? "unknown",
5810
5811
  ...transitionRepeaterMixpanelEvent,
5811
5812
  widget_type: widgetType
@@ -6465,82 +6466,136 @@ var InlineEditingControl = createControl(
6465
6466
  );
6466
6467
 
6467
6468
  // src/components/promotions/display-conditions-control.tsx
6469
+ var React102 = __toESM(require("react"));
6470
+ var import_react56 = require("react");
6471
+ var import_icons33 = require("@elementor/icons");
6472
+ var import_ui88 = require("@elementor/ui");
6473
+ var import_i18n50 = require("@wordpress/i18n");
6474
+
6475
+ // src/components/promotions/promotion-trigger.tsx
6468
6476
  var React101 = __toESM(require("react"));
6469
6477
  var import_react55 = require("react");
6470
6478
  var import_editor_ui12 = require("@elementor/editor-ui");
6471
- var import_icons33 = require("@elementor/icons");
6472
6479
  var import_ui87 = require("@elementor/ui");
6473
- var import_i18n50 = require("@wordpress/i18n");
6474
- var ARIA_LABEL = (0, import_i18n50.__)("Display Conditions", "elementor");
6475
- function getDisplayConditionPromotion() {
6476
- return window.elementor?.config?.v4Promotions?.displayConditions;
6480
+ function getV4Promotion(key) {
6481
+ return window.elementor?.config?.v4Promotions?.[key];
6477
6482
  }
6478
- var DisplayConditionsControl = createControl(() => {
6479
- const [isInfotipOpen, setIsInfotipOpen] = (0, import_react55.useState)(false);
6480
- const promotion = getDisplayConditionPromotion();
6481
- return /* @__PURE__ */ React101.createElement(
6482
- import_ui87.Stack,
6483
- {
6484
- direction: "row",
6485
- spacing: 2,
6486
- sx: {
6487
- justifyContent: "flex-end",
6488
- alignItems: "center"
6489
- }
6490
- },
6491
- /* @__PURE__ */ React101.createElement(
6483
+ var PromotionTrigger = (0, import_react55.forwardRef)(
6484
+ ({ promotionKey, children }, ref) => {
6485
+ const [isOpen, setIsOpen] = (0, import_react55.useState)(false);
6486
+ const promotion = getV4Promotion(promotionKey);
6487
+ const toggle = () => setIsOpen((prev) => !prev);
6488
+ (0, import_react55.useImperativeHandle)(ref, () => ({ toggle }), []);
6489
+ return /* @__PURE__ */ React101.createElement(React101.Fragment, null, promotion && /* @__PURE__ */ React101.createElement(
6492
6490
  import_editor_ui12.PromotionInfotip,
6493
6491
  {
6494
- title: promotion?.title ?? "",
6495
- content: promotion?.content ?? "",
6496
- assetUrl: promotion?.image ?? "",
6497
- ctaUrl: promotion?.ctaUrl ?? "",
6498
- open: isInfotipOpen,
6499
- onClose: () => setIsInfotipOpen(false)
6492
+ title: promotion.title,
6493
+ content: promotion.content,
6494
+ assetUrl: promotion.image,
6495
+ ctaUrl: promotion.ctaUrl,
6496
+ open: isOpen,
6497
+ onClose: (e) => {
6498
+ e.stopPropagation();
6499
+ setIsOpen(false);
6500
+ }
6500
6501
  },
6501
6502
  /* @__PURE__ */ React101.createElement(
6502
6503
  import_ui87.Box,
6503
6504
  {
6504
- onClick: () => setIsInfotipOpen((prev) => !prev),
6505
+ onClick: (e) => {
6506
+ e.stopPropagation();
6507
+ toggle();
6508
+ },
6505
6509
  sx: { cursor: "pointer", display: "inline-flex" }
6506
6510
  },
6507
- /* @__PURE__ */ React101.createElement(import_editor_ui12.PromotionChip, null)
6511
+ children ?? /* @__PURE__ */ React101.createElement(import_editor_ui12.PromotionChip, null)
6508
6512
  )
6509
- ),
6510
- /* @__PURE__ */ React101.createElement(import_ui87.Tooltip, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React101.createElement(
6511
- import_ui87.IconButton,
6513
+ ));
6514
+ }
6515
+ );
6516
+
6517
+ // src/components/promotions/display-conditions-control.tsx
6518
+ var ARIA_LABEL = (0, import_i18n50.__)("Display Conditions", "elementor");
6519
+ var DisplayConditionsControl = createControl(() => {
6520
+ const triggerRef = (0, import_react56.useRef)(null);
6521
+ return /* @__PURE__ */ React102.createElement(
6522
+ import_ui88.Stack,
6523
+ {
6524
+ direction: "row",
6525
+ spacing: 2,
6526
+ sx: {
6527
+ justifyContent: "flex-end",
6528
+ alignItems: "center"
6529
+ }
6530
+ },
6531
+ /* @__PURE__ */ React102.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions" }),
6532
+ /* @__PURE__ */ React102.createElement(import_ui88.Tooltip, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React102.createElement(
6533
+ import_ui88.IconButton,
6512
6534
  {
6513
6535
  size: "tiny",
6514
6536
  "aria-label": ARIA_LABEL,
6515
6537
  "data-behavior": "display-conditions",
6516
- onClick: () => setIsInfotipOpen((prev) => !prev),
6538
+ onClick: () => triggerRef.current?.toggle(),
6517
6539
  sx: {
6518
6540
  border: "1px solid",
6519
6541
  borderColor: "divider",
6520
6542
  borderRadius: 1
6521
6543
  }
6522
6544
  },
6523
- /* @__PURE__ */ React101.createElement(import_icons33.SitemapIcon, { fontSize: "tiny", color: "disabled" })
6545
+ /* @__PURE__ */ React102.createElement(import_icons33.SitemapIcon, { fontSize: "tiny", color: "disabled" })
6524
6546
  ))
6525
6547
  );
6526
6548
  });
6527
6549
 
6528
- // src/components/icon-buttons/clear-icon-button.tsx
6529
- var React102 = __toESM(require("react"));
6550
+ // src/components/promotions/attributes-control.tsx
6551
+ var React103 = __toESM(require("react"));
6552
+ var import_react57 = require("react");
6530
6553
  var import_icons34 = require("@elementor/icons");
6531
- var import_ui88 = require("@elementor/ui");
6532
- var CustomIconButton = (0, import_ui88.styled)(import_ui88.IconButton)(({ theme }) => ({
6554
+ var import_ui89 = require("@elementor/ui");
6555
+ var import_i18n51 = require("@wordpress/i18n");
6556
+ var ARIA_LABEL2 = (0, import_i18n51.__)("Attributes", "elementor");
6557
+ var AttributesControl = createControl(() => {
6558
+ const triggerRef = (0, import_react57.useRef)(null);
6559
+ return /* @__PURE__ */ React103.createElement(
6560
+ import_ui89.Stack,
6561
+ {
6562
+ direction: "row",
6563
+ spacing: 2,
6564
+ sx: {
6565
+ justifyContent: "flex-end",
6566
+ alignItems: "center"
6567
+ }
6568
+ },
6569
+ /* @__PURE__ */ React103.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes" }),
6570
+ /* @__PURE__ */ React103.createElement(import_ui89.Tooltip, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React103.createElement(
6571
+ import_icons34.PlusIcon,
6572
+ {
6573
+ "aria-label": ARIA_LABEL2,
6574
+ fontSize: "tiny",
6575
+ color: "disabled",
6576
+ onClick: () => triggerRef.current?.toggle(),
6577
+ sx: { cursor: "pointer" }
6578
+ }
6579
+ ))
6580
+ );
6581
+ });
6582
+
6583
+ // src/components/icon-buttons/clear-icon-button.tsx
6584
+ var React104 = __toESM(require("react"));
6585
+ var import_icons35 = require("@elementor/icons");
6586
+ var import_ui90 = require("@elementor/ui");
6587
+ var CustomIconButton = (0, import_ui90.styled)(import_ui90.IconButton)(({ theme }) => ({
6533
6588
  width: theme.spacing(2.5),
6534
6589
  height: theme.spacing(2.5)
6535
6590
  }));
6536
- var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React102.createElement(import_ui88.Tooltip, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React102.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React102.createElement(import_icons34.BrushBigIcon, { fontSize: size })));
6591
+ var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React104.createElement(import_ui90.Tooltip, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React104.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React104.createElement(import_icons35.BrushBigIcon, { fontSize: size })));
6537
6592
 
6538
6593
  // src/components/repeater/repeater.tsx
6539
- var React103 = __toESM(require("react"));
6540
- var import_react56 = require("react");
6541
- var import_icons35 = require("@elementor/icons");
6542
- var import_ui89 = require("@elementor/ui");
6543
- var import_i18n51 = require("@wordpress/i18n");
6594
+ var React105 = __toESM(require("react"));
6595
+ var import_react58 = require("react");
6596
+ var import_icons36 = require("@elementor/icons");
6597
+ var import_ui91 = require("@elementor/ui");
6598
+ var import_i18n52 = require("@wordpress/i18n");
6544
6599
  var SIZE9 = "tiny";
6545
6600
  var EMPTY_OPEN_ITEM2 = -1;
6546
6601
  var Repeater3 = ({
@@ -6558,7 +6613,7 @@ var Repeater3 = ({
6558
6613
  openItem: initialOpenItem = EMPTY_OPEN_ITEM2,
6559
6614
  isSortable = true
6560
6615
  }) => {
6561
- const [openItem, setOpenItem] = (0, import_react56.useState)(initialOpenItem);
6616
+ const [openItem, setOpenItem] = (0, import_react58.useState)(initialOpenItem);
6562
6617
  const uniqueKeys = items2.map(
6563
6618
  (item, index) => isSortable && "getId" in itemSettings ? itemSettings.getId({ item, index }) : String(index)
6564
6619
  );
@@ -6621,8 +6676,8 @@ var Repeater3 = ({
6621
6676
  };
6622
6677
  const isButtonDisabled = disabled || disableAddItemButton;
6623
6678
  const shouldShowInfotip = isButtonDisabled && addButtonInfotipContent;
6624
- const addButton = /* @__PURE__ */ React103.createElement(
6625
- import_ui89.IconButton,
6679
+ const addButton = /* @__PURE__ */ React105.createElement(
6680
+ import_ui91.IconButton,
6626
6681
  {
6627
6682
  size: SIZE9,
6628
6683
  sx: {
@@ -6630,32 +6685,32 @@ var Repeater3 = ({
6630
6685
  },
6631
6686
  disabled: isButtonDisabled,
6632
6687
  onClick: addRepeaterItem,
6633
- "aria-label": (0, import_i18n51.__)("Add item", "elementor")
6688
+ "aria-label": (0, import_i18n52.__)("Add item", "elementor")
6634
6689
  },
6635
- /* @__PURE__ */ React103.createElement(import_icons35.PlusIcon, { fontSize: SIZE9 })
6690
+ /* @__PURE__ */ React105.createElement(import_icons36.PlusIcon, { fontSize: SIZE9 })
6636
6691
  );
6637
- return /* @__PURE__ */ React103.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React103.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, shouldShowInfotip ? /* @__PURE__ */ React103.createElement(
6638
- import_ui89.Infotip,
6692
+ return /* @__PURE__ */ React105.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React105.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, shouldShowInfotip ? /* @__PURE__ */ React105.createElement(
6693
+ import_ui91.Infotip,
6639
6694
  {
6640
6695
  placement: "right",
6641
6696
  content: addButtonInfotipContent,
6642
6697
  color: "secondary",
6643
6698
  slotProps: { popper: { sx: { width: 300 } } }
6644
6699
  },
6645
- /* @__PURE__ */ React103.createElement(import_ui89.Box, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
6646
- ) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React103.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
6700
+ /* @__PURE__ */ React105.createElement(import_ui91.Box, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
6701
+ ) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React105.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
6647
6702
  const index = uniqueKeys.indexOf(key);
6648
6703
  const value = items2[index];
6649
6704
  if (!value) {
6650
6705
  return null;
6651
6706
  }
6652
- return /* @__PURE__ */ React103.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React103.createElement(
6707
+ return /* @__PURE__ */ React105.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React105.createElement(
6653
6708
  RepeaterItem,
6654
6709
  {
6655
6710
  disabled,
6656
6711
  propDisabled: value?.disabled,
6657
- label: /* @__PURE__ */ React103.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React103.createElement(itemSettings.Label, { value, index })),
6658
- startIcon: /* @__PURE__ */ React103.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React103.createElement(itemSettings.Icon, { value })),
6712
+ label: /* @__PURE__ */ React105.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React105.createElement(itemSettings.Label, { value, index })),
6713
+ startIcon: /* @__PURE__ */ React105.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React105.createElement(itemSettings.Icon, { value })),
6659
6714
  removeItem: () => removeRepeaterItem(index),
6660
6715
  duplicateItem: () => duplicateRepeaterItem(index),
6661
6716
  toggleDisableItem: () => toggleDisableRepeaterItem(index),
@@ -6667,7 +6722,7 @@ var Repeater3 = ({
6667
6722
  actions: itemSettings.actions,
6668
6723
  value
6669
6724
  },
6670
- (props) => /* @__PURE__ */ React103.createElement(
6725
+ (props) => /* @__PURE__ */ React105.createElement(
6671
6726
  itemSettings.Content,
6672
6727
  {
6673
6728
  ...props,
@@ -6697,27 +6752,27 @@ var RepeaterItem = ({
6697
6752
  value
6698
6753
  }) => {
6699
6754
  const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
6700
- const duplicateLabel = (0, import_i18n51.__)("Duplicate", "elementor");
6701
- const toggleLabel = propDisabled ? (0, import_i18n51.__)("Show", "elementor") : (0, import_i18n51.__)("Hide", "elementor");
6702
- const removeLabel = (0, import_i18n51.__)("Remove", "elementor");
6703
- return /* @__PURE__ */ React103.createElement(React103.Fragment, null, /* @__PURE__ */ React103.createElement(
6755
+ const duplicateLabel = (0, import_i18n52.__)("Duplicate", "elementor");
6756
+ const toggleLabel = propDisabled ? (0, import_i18n52.__)("Show", "elementor") : (0, import_i18n52.__)("Hide", "elementor");
6757
+ const removeLabel = (0, import_i18n52.__)("Remove", "elementor");
6758
+ return /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(
6704
6759
  RepeaterTag,
6705
6760
  {
6706
6761
  disabled,
6707
6762
  label,
6708
6763
  ref: setRef,
6709
- "aria-label": (0, import_i18n51.__)("Open item", "elementor"),
6710
- ...(0, import_ui89.bindTrigger)(popoverState),
6764
+ "aria-label": (0, import_i18n52.__)("Open item", "elementor"),
6765
+ ...(0, import_ui91.bindTrigger)(popoverState),
6711
6766
  startIcon,
6712
- actions: /* @__PURE__ */ React103.createElement(React103.Fragment, null, showDuplicate && /* @__PURE__ */ React103.createElement(import_ui89.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React103.createElement(import_ui89.IconButton, { size: SIZE9, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React103.createElement(import_icons35.CopyIcon, { fontSize: SIZE9 }))), showToggle && /* @__PURE__ */ React103.createElement(import_ui89.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React103.createElement(import_ui89.IconButton, { size: SIZE9, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React103.createElement(import_icons35.EyeOffIcon, { fontSize: SIZE9 }) : /* @__PURE__ */ React103.createElement(import_icons35.EyeIcon, { fontSize: SIZE9 }))), actions?.(value), showRemove && /* @__PURE__ */ React103.createElement(import_ui89.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React103.createElement(import_ui89.IconButton, { size: SIZE9, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React103.createElement(import_icons35.XIcon, { fontSize: SIZE9 }))))
6767
+ actions: /* @__PURE__ */ React105.createElement(React105.Fragment, null, showDuplicate && /* @__PURE__ */ React105.createElement(import_ui91.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React105.createElement(import_ui91.IconButton, { size: SIZE9, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React105.createElement(import_icons36.CopyIcon, { fontSize: SIZE9 }))), showToggle && /* @__PURE__ */ React105.createElement(import_ui91.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React105.createElement(import_ui91.IconButton, { size: SIZE9, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React105.createElement(import_icons36.EyeOffIcon, { fontSize: SIZE9 }) : /* @__PURE__ */ React105.createElement(import_icons36.EyeIcon, { fontSize: SIZE9 }))), actions?.(value), showRemove && /* @__PURE__ */ React105.createElement(import_ui91.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React105.createElement(import_ui91.IconButton, { size: SIZE9, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React105.createElement(import_icons36.XIcon, { fontSize: SIZE9 }))))
6713
6768
  }
6714
- ), /* @__PURE__ */ React103.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React103.createElement(import_ui89.Box, null, children({ anchorEl: ref }))));
6769
+ ), /* @__PURE__ */ React105.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React105.createElement(import_ui91.Box, null, children({ anchorEl: ref }))));
6715
6770
  };
6716
6771
  var usePopover = (openOnMount, onOpen) => {
6717
- const [ref, setRef] = (0, import_react56.useState)(null);
6718
- const popoverState = (0, import_ui89.usePopupState)({ variant: "popover" });
6719
- const popoverProps = (0, import_ui89.bindPopover)(popoverState);
6720
- (0, import_react56.useEffect)(() => {
6772
+ const [ref, setRef] = (0, import_react58.useState)(null);
6773
+ const popoverState = (0, import_ui91.usePopupState)({ variant: "popover" });
6774
+ const popoverProps = (0, import_ui91.bindPopover)(popoverState);
6775
+ (0, import_react58.useEffect)(() => {
6721
6776
  if (openOnMount && ref) {
6722
6777
  popoverState.open(ref);
6723
6778
  onOpen?.();
@@ -6732,20 +6787,20 @@ var usePopover = (openOnMount, onOpen) => {
6732
6787
  };
6733
6788
 
6734
6789
  // src/components/inline-editor-toolbar.tsx
6735
- var React105 = __toESM(require("react"));
6736
- var import_react58 = require("react");
6790
+ var React107 = __toESM(require("react"));
6791
+ var import_react60 = require("react");
6737
6792
  var import_editor_elements6 = require("@elementor/editor-elements");
6738
- var import_icons37 = require("@elementor/icons");
6739
- var import_ui91 = require("@elementor/ui");
6740
- var import_react59 = require("@tiptap/react");
6741
- var import_i18n53 = require("@wordpress/i18n");
6793
+ var import_icons38 = require("@elementor/icons");
6794
+ var import_ui93 = require("@elementor/ui");
6795
+ var import_react61 = require("@tiptap/react");
6796
+ var import_i18n54 = require("@wordpress/i18n");
6742
6797
 
6743
6798
  // src/components/url-popover.tsx
6744
- var React104 = __toESM(require("react"));
6745
- var import_react57 = require("react");
6746
- var import_icons36 = require("@elementor/icons");
6747
- var import_ui90 = require("@elementor/ui");
6748
- var import_i18n52 = require("@wordpress/i18n");
6799
+ var React106 = __toESM(require("react"));
6800
+ var import_react59 = require("react");
6801
+ var import_icons37 = require("@elementor/icons");
6802
+ var import_ui92 = require("@elementor/ui");
6803
+ var import_i18n53 = require("@wordpress/i18n");
6749
6804
  var UrlPopover = ({
6750
6805
  popupState,
6751
6806
  restoreValue,
@@ -6755,8 +6810,8 @@ var UrlPopover = ({
6755
6810
  openInNewTab,
6756
6811
  onToggleNewTab
6757
6812
  }) => {
6758
- const inputRef = (0, import_react57.useRef)(null);
6759
- (0, import_react57.useEffect)(() => {
6813
+ const inputRef = (0, import_react59.useRef)(null);
6814
+ (0, import_react59.useEffect)(() => {
6760
6815
  if (popupState.isOpen) {
6761
6816
  requestAnimationFrame(() => inputRef.current?.focus());
6762
6817
  }
@@ -6765,57 +6820,57 @@ var UrlPopover = ({
6765
6820
  restoreValue();
6766
6821
  popupState.close();
6767
6822
  };
6768
- return /* @__PURE__ */ React104.createElement(
6769
- import_ui90.Popover,
6823
+ return /* @__PURE__ */ React106.createElement(
6824
+ import_ui92.Popover,
6770
6825
  {
6771
6826
  slotProps: {
6772
6827
  paper: { sx: { borderRadius: "16px", width: anchorRef.current?.offsetWidth + "px", marginTop: -1 } }
6773
6828
  },
6774
- ...(0, import_ui90.bindPopover)(popupState),
6829
+ ...(0, import_ui92.bindPopover)(popupState),
6775
6830
  anchorOrigin: { vertical: "top", horizontal: "left" },
6776
6831
  transformOrigin: { vertical: "top", horizontal: "left" },
6777
6832
  onClose: handleClose
6778
6833
  },
6779
- /* @__PURE__ */ React104.createElement(import_ui90.Stack, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React104.createElement(
6780
- import_ui90.TextField,
6834
+ /* @__PURE__ */ React106.createElement(import_ui92.Stack, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React106.createElement(
6835
+ import_ui92.TextField,
6781
6836
  {
6782
6837
  value,
6783
6838
  onChange,
6784
6839
  size: "tiny",
6785
6840
  fullWidth: true,
6786
- placeholder: (0, import_i18n52.__)("Type a URL", "elementor"),
6841
+ placeholder: (0, import_i18n53.__)("Type a URL", "elementor"),
6787
6842
  inputProps: { ref: inputRef },
6788
6843
  color: "secondary",
6789
6844
  InputProps: { sx: { borderRadius: "8px" } },
6790
6845
  onKeyUp: (event) => event.key === "Enter" && handleClose()
6791
6846
  }
6792
- ), /* @__PURE__ */ React104.createElement(import_ui90.Tooltip, { title: (0, import_i18n52.__)("Open in a new tab", "elementor") }, /* @__PURE__ */ React104.createElement(
6793
- import_ui90.ToggleButton,
6847
+ ), /* @__PURE__ */ React106.createElement(import_ui92.Tooltip, { title: (0, import_i18n53.__)("Open in a new tab", "elementor") }, /* @__PURE__ */ React106.createElement(
6848
+ import_ui92.ToggleButton,
6794
6849
  {
6795
6850
  size: "tiny",
6796
6851
  value: "newTab",
6797
6852
  selected: openInNewTab,
6798
6853
  onClick: onToggleNewTab,
6799
- "aria-label": (0, import_i18n52.__)("Open in a new tab", "elementor"),
6854
+ "aria-label": (0, import_i18n53.__)("Open in a new tab", "elementor"),
6800
6855
  sx: { borderRadius: "8px" }
6801
6856
  },
6802
- /* @__PURE__ */ React104.createElement(import_icons36.ExternalLinkIcon, { fontSize: "tiny" })
6857
+ /* @__PURE__ */ React106.createElement(import_icons37.ExternalLinkIcon, { fontSize: "tiny" })
6803
6858
  )))
6804
6859
  );
6805
6860
  };
6806
6861
 
6807
6862
  // src/components/inline-editor-toolbar.tsx
6808
6863
  var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
6809
- const [urlValue, setUrlValue] = (0, import_react58.useState)("");
6810
- const [openInNewTab, setOpenInNewTab] = (0, import_react58.useState)(false);
6811
- const toolbarRef = (0, import_react58.useRef)(null);
6812
- const linkPopupState = (0, import_ui91.usePopupState)({ variant: "popover" });
6864
+ const [urlValue, setUrlValue] = (0, import_react60.useState)("");
6865
+ const [openInNewTab, setOpenInNewTab] = (0, import_react60.useState)(false);
6866
+ const toolbarRef = (0, import_react60.useRef)(null);
6867
+ const linkPopupState = (0, import_ui93.usePopupState)({ variant: "popover" });
6813
6868
  const hasLinkOnElement = elementId ? checkIfElementHasLink(elementId) : false;
6814
- const editorState = (0, import_react59.useEditorState)({
6869
+ const editorState = (0, import_react61.useEditorState)({
6815
6870
  editor,
6816
6871
  selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
6817
6872
  });
6818
- const formatButtonsList = (0, import_react58.useMemo)(() => {
6873
+ const formatButtonsList = (0, import_react60.useMemo)(() => {
6819
6874
  const buttons = Object.values(formatButtons);
6820
6875
  if (hasLinkOnElement) {
6821
6876
  return buttons.filter((button) => button.action !== "link");
@@ -6852,11 +6907,11 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
6852
6907
  }
6853
6908
  linkPopupState.close();
6854
6909
  };
6855
- React105.useEffect(() => {
6910
+ React107.useEffect(() => {
6856
6911
  editor?.commands?.focus();
6857
6912
  }, [editor]);
6858
- return /* @__PURE__ */ React105.createElement(
6859
- import_ui91.Box,
6913
+ return /* @__PURE__ */ React107.createElement(
6914
+ import_ui93.Box,
6860
6915
  {
6861
6916
  ref: toolbarRef,
6862
6917
  sx: {
@@ -6872,9 +6927,9 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
6872
6927
  ...sx
6873
6928
  }
6874
6929
  },
6875
- /* @__PURE__ */ React105.createElement(import_ui91.Tooltip, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React105.createElement(import_ui91.IconButton, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
6876
- /* @__PURE__ */ React105.createElement(
6877
- import_ui91.ToggleButtonGroup,
6930
+ /* @__PURE__ */ React107.createElement(import_ui93.Tooltip, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React107.createElement(import_ui93.IconButton, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
6931
+ /* @__PURE__ */ React107.createElement(
6932
+ import_ui93.ToggleButtonGroup,
6878
6933
  {
6879
6934
  value: editorState,
6880
6935
  size: "tiny",
@@ -6882,7 +6937,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
6882
6937
  display: "flex",
6883
6938
  gap: 0.5,
6884
6939
  border: "none",
6885
- [`& .${import_ui91.toggleButtonGroupClasses.firstButton}, & .${import_ui91.toggleButtonGroupClasses.middleButton}, & .${import_ui91.toggleButtonGroupClasses.lastButton}`]: {
6940
+ [`& .${import_ui93.toggleButtonGroupClasses.firstButton}, & .${import_ui93.toggleButtonGroupClasses.middleButton}, & .${import_ui93.toggleButtonGroupClasses.lastButton}`]: {
6886
6941
  borderRadius: "8px",
6887
6942
  border: "none",
6888
6943
  marginLeft: 0,
@@ -6895,8 +6950,8 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
6895
6950
  }
6896
6951
  }
6897
6952
  },
6898
- formatButtonsList.map((button) => /* @__PURE__ */ React105.createElement(import_ui91.Tooltip, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React105.createElement(
6899
- import_ui91.ToggleButton,
6953
+ formatButtonsList.map((button) => /* @__PURE__ */ React107.createElement(import_ui93.Tooltip, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React107.createElement(
6954
+ import_ui93.ToggleButton,
6900
6955
  {
6901
6956
  value: button.action,
6902
6957
  "aria-label": button.label,
@@ -6913,7 +6968,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
6913
6968
  button.icon
6914
6969
  )))
6915
6970
  ),
6916
- /* @__PURE__ */ React105.createElement(
6971
+ /* @__PURE__ */ React107.createElement(
6917
6972
  UrlPopover,
6918
6973
  {
6919
6974
  popupState: linkPopupState,
@@ -6930,64 +6985,64 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
6930
6985
  var checkIfElementHasLink = (elementId) => !!(0, import_editor_elements6.getElementSetting)(elementId, "link")?.value?.destination;
6931
6986
  var toolbarButtons = {
6932
6987
  clear: {
6933
- label: (0, import_i18n53.__)("Clear", "elementor"),
6934
- icon: /* @__PURE__ */ React105.createElement(import_icons37.MinusIcon, { fontSize: "tiny" }),
6988
+ label: (0, import_i18n54.__)("Clear", "elementor"),
6989
+ icon: /* @__PURE__ */ React107.createElement(import_icons38.MinusIcon, { fontSize: "tiny" }),
6935
6990
  action: "clear",
6936
6991
  method: (editor) => {
6937
6992
  editor.chain().focus().clearNodes().unsetAllMarks().run();
6938
6993
  }
6939
6994
  },
6940
6995
  bold: {
6941
- label: (0, import_i18n53.__)("Bold", "elementor"),
6942
- icon: /* @__PURE__ */ React105.createElement(import_icons37.BoldIcon, { fontSize: "tiny" }),
6996
+ label: (0, import_i18n54.__)("Bold", "elementor"),
6997
+ icon: /* @__PURE__ */ React107.createElement(import_icons38.BoldIcon, { fontSize: "tiny" }),
6943
6998
  action: "bold",
6944
6999
  method: (editor) => {
6945
7000
  editor.chain().focus().toggleBold().run();
6946
7001
  }
6947
7002
  },
6948
7003
  italic: {
6949
- label: (0, import_i18n53.__)("Italic", "elementor"),
6950
- icon: /* @__PURE__ */ React105.createElement(import_icons37.ItalicIcon, { fontSize: "tiny" }),
7004
+ label: (0, import_i18n54.__)("Italic", "elementor"),
7005
+ icon: /* @__PURE__ */ React107.createElement(import_icons38.ItalicIcon, { fontSize: "tiny" }),
6951
7006
  action: "italic",
6952
7007
  method: (editor) => {
6953
7008
  editor.chain().focus().toggleItalic().run();
6954
7009
  }
6955
7010
  },
6956
7011
  underline: {
6957
- label: (0, import_i18n53.__)("Underline", "elementor"),
6958
- icon: /* @__PURE__ */ React105.createElement(import_icons37.UnderlineIcon, { fontSize: "tiny" }),
7012
+ label: (0, import_i18n54.__)("Underline", "elementor"),
7013
+ icon: /* @__PURE__ */ React107.createElement(import_icons38.UnderlineIcon, { fontSize: "tiny" }),
6959
7014
  action: "underline",
6960
7015
  method: (editor) => {
6961
7016
  editor.chain().focus().toggleUnderline().run();
6962
7017
  }
6963
7018
  },
6964
7019
  strike: {
6965
- label: (0, import_i18n53.__)("Strikethrough", "elementor"),
6966
- icon: /* @__PURE__ */ React105.createElement(import_icons37.StrikethroughIcon, { fontSize: "tiny" }),
7020
+ label: (0, import_i18n54.__)("Strikethrough", "elementor"),
7021
+ icon: /* @__PURE__ */ React107.createElement(import_icons38.StrikethroughIcon, { fontSize: "tiny" }),
6967
7022
  action: "strike",
6968
7023
  method: (editor) => {
6969
7024
  editor.chain().focus().toggleStrike().run();
6970
7025
  }
6971
7026
  },
6972
7027
  superscript: {
6973
- label: (0, import_i18n53.__)("Superscript", "elementor"),
6974
- icon: /* @__PURE__ */ React105.createElement(import_icons37.SuperscriptIcon, { fontSize: "tiny" }),
7028
+ label: (0, import_i18n54.__)("Superscript", "elementor"),
7029
+ icon: /* @__PURE__ */ React107.createElement(import_icons38.SuperscriptIcon, { fontSize: "tiny" }),
6975
7030
  action: "superscript",
6976
7031
  method: (editor) => {
6977
7032
  editor.chain().focus().toggleSuperscript().run();
6978
7033
  }
6979
7034
  },
6980
7035
  subscript: {
6981
- label: (0, import_i18n53.__)("Subscript", "elementor"),
6982
- icon: /* @__PURE__ */ React105.createElement(import_icons37.SubscriptIcon, { fontSize: "tiny" }),
7036
+ label: (0, import_i18n54.__)("Subscript", "elementor"),
7037
+ icon: /* @__PURE__ */ React107.createElement(import_icons38.SubscriptIcon, { fontSize: "tiny" }),
6983
7038
  action: "subscript",
6984
7039
  method: (editor) => {
6985
7040
  editor.chain().focus().toggleSubscript().run();
6986
7041
  }
6987
7042
  },
6988
7043
  link: {
6989
- label: (0, import_i18n53.__)("Link", "elementor"),
6990
- icon: /* @__PURE__ */ React105.createElement(import_icons37.LinkIcon, { fontSize: "tiny" }),
7044
+ label: (0, import_i18n54.__)("Link", "elementor"),
7045
+ icon: /* @__PURE__ */ React107.createElement(import_icons38.LinkIcon, { fontSize: "tiny" }),
6991
7046
  action: "link",
6992
7047
  method: null
6993
7048
  }
@@ -6997,6 +7052,7 @@ var possibleFormats = Object.keys(formatButtons);
6997
7052
  // Annotate the CommonJS export names for ESM import in node:
6998
7053
  0 && (module.exports = {
6999
7054
  AspectRatioControl,
7055
+ AttributesControl,
7000
7056
  BackgroundControl,
7001
7057
  BoxShadowRepeaterControl,
7002
7058
  ClearIconButton,
@@ -7027,6 +7083,7 @@ var possibleFormats = Object.keys(formatButtons);
7027
7083
  PopoverContent,
7028
7084
  PopoverGridContainer,
7029
7085
  PositionControl,
7086
+ PromotionTrigger,
7030
7087
  PropKeyProvider,
7031
7088
  PropProvider,
7032
7089
  QueryControl,