@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.d.mts +22 -3
- package/dist/index.d.ts +22 -3
- package/dist/index.js +182 -125
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +151 -96
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/promotions/attributes-control.tsx +36 -0
- package/src/components/promotions/display-conditions-control.tsx +6 -25
- package/src/components/promotions/promotion-trigger.tsx +58 -0
- package/src/components/promotions/types.ts +8 -0
- package/src/controls/transition-control/trainsition-events.ts +1 -1
- package/src/index.ts +5 -1
package/dist/index.mjs
CHANGED
|
@@ -274,7 +274,6 @@ var createControlReplacementsRegistry = () => {
|
|
|
274
274
|
};
|
|
275
275
|
|
|
276
276
|
// src/create-control.tsx
|
|
277
|
-
var brandSymbol = Symbol("control");
|
|
278
277
|
function createControl(Control5) {
|
|
279
278
|
return ((props) => {
|
|
280
279
|
const { ControlToRender, OriginalControl, isReplaced } = useControlReplacement(Control5);
|
|
@@ -5783,7 +5782,7 @@ var transitionsItemsList = transitionProperties.map((category) => ({
|
|
|
5783
5782
|
|
|
5784
5783
|
// src/controls/transition-control/trainsition-events.ts
|
|
5785
5784
|
import { getSelectedElements } from "@elementor/editor-elements";
|
|
5786
|
-
import { trackEvent } from "@elementor/
|
|
5785
|
+
import { trackEvent } from "@elementor/events";
|
|
5787
5786
|
var transitionRepeaterMixpanelEvent = {
|
|
5788
5787
|
eventName: "click_added_transition",
|
|
5789
5788
|
location: "V4 Style Tab",
|
|
@@ -6459,20 +6458,59 @@ var InlineEditingControl = createControl(
|
|
|
6459
6458
|
);
|
|
6460
6459
|
|
|
6461
6460
|
// src/components/promotions/display-conditions-control.tsx
|
|
6462
|
-
import * as
|
|
6463
|
-
import {
|
|
6464
|
-
import { PromotionChip as PromotionChip2, PromotionInfotip } from "@elementor/editor-ui";
|
|
6461
|
+
import * as React102 from "react";
|
|
6462
|
+
import { useRef as useRef25 } from "react";
|
|
6465
6463
|
import { SitemapIcon } from "@elementor/icons";
|
|
6466
|
-
import {
|
|
6464
|
+
import { IconButton as IconButton8, Stack as Stack16, Tooltip as Tooltip9 } from "@elementor/ui";
|
|
6467
6465
|
import { __ as __50 } from "@wordpress/i18n";
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6466
|
+
|
|
6467
|
+
// src/components/promotions/promotion-trigger.tsx
|
|
6468
|
+
import * as React101 from "react";
|
|
6469
|
+
import { forwardRef as forwardRef11, useImperativeHandle, useState as useState18 } from "react";
|
|
6470
|
+
import { PromotionChip as PromotionChip2, PromotionInfotip } from "@elementor/editor-ui";
|
|
6471
|
+
import { Box as Box24 } from "@elementor/ui";
|
|
6472
|
+
function getV4Promotion(key) {
|
|
6473
|
+
return window.elementor?.config?.v4Promotions?.[key];
|
|
6471
6474
|
}
|
|
6475
|
+
var PromotionTrigger = forwardRef11(
|
|
6476
|
+
({ promotionKey, children }, ref) => {
|
|
6477
|
+
const [isOpen, setIsOpen] = useState18(false);
|
|
6478
|
+
const promotion = getV4Promotion(promotionKey);
|
|
6479
|
+
const toggle = () => setIsOpen((prev) => !prev);
|
|
6480
|
+
useImperativeHandle(ref, () => ({ toggle }), []);
|
|
6481
|
+
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, promotion && /* @__PURE__ */ React101.createElement(
|
|
6482
|
+
PromotionInfotip,
|
|
6483
|
+
{
|
|
6484
|
+
title: promotion.title,
|
|
6485
|
+
content: promotion.content,
|
|
6486
|
+
assetUrl: promotion.image,
|
|
6487
|
+
ctaUrl: promotion.ctaUrl,
|
|
6488
|
+
open: isOpen,
|
|
6489
|
+
onClose: (e) => {
|
|
6490
|
+
e.stopPropagation();
|
|
6491
|
+
setIsOpen(false);
|
|
6492
|
+
}
|
|
6493
|
+
},
|
|
6494
|
+
/* @__PURE__ */ React101.createElement(
|
|
6495
|
+
Box24,
|
|
6496
|
+
{
|
|
6497
|
+
onClick: (e) => {
|
|
6498
|
+
e.stopPropagation();
|
|
6499
|
+
toggle();
|
|
6500
|
+
},
|
|
6501
|
+
sx: { cursor: "pointer", display: "inline-flex" }
|
|
6502
|
+
},
|
|
6503
|
+
children ?? /* @__PURE__ */ React101.createElement(PromotionChip2, null)
|
|
6504
|
+
)
|
|
6505
|
+
));
|
|
6506
|
+
}
|
|
6507
|
+
);
|
|
6508
|
+
|
|
6509
|
+
// src/components/promotions/display-conditions-control.tsx
|
|
6510
|
+
var ARIA_LABEL = __50("Display Conditions", "elementor");
|
|
6472
6511
|
var DisplayConditionsControl = createControl(() => {
|
|
6473
|
-
const
|
|
6474
|
-
|
|
6475
|
-
return /* @__PURE__ */ React101.createElement(
|
|
6512
|
+
const triggerRef = useRef25(null);
|
|
6513
|
+
return /* @__PURE__ */ React102.createElement(
|
|
6476
6514
|
Stack16,
|
|
6477
6515
|
{
|
|
6478
6516
|
direction: "row",
|
|
@@ -6482,67 +6520,82 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
6482
6520
|
alignItems: "center"
|
|
6483
6521
|
}
|
|
6484
6522
|
},
|
|
6485
|
-
/* @__PURE__ */
|
|
6486
|
-
|
|
6487
|
-
{
|
|
6488
|
-
title: promotion?.title ?? "",
|
|
6489
|
-
content: promotion?.content ?? "",
|
|
6490
|
-
assetUrl: promotion?.image ?? "",
|
|
6491
|
-
ctaUrl: promotion?.ctaUrl ?? "",
|
|
6492
|
-
open: isInfotipOpen,
|
|
6493
|
-
onClose: () => setIsInfotipOpen(false)
|
|
6494
|
-
},
|
|
6495
|
-
/* @__PURE__ */ React101.createElement(
|
|
6496
|
-
Box24,
|
|
6497
|
-
{
|
|
6498
|
-
onClick: () => setIsInfotipOpen((prev) => !prev),
|
|
6499
|
-
sx: { cursor: "pointer", display: "inline-flex" }
|
|
6500
|
-
},
|
|
6501
|
-
/* @__PURE__ */ React101.createElement(PromotionChip2, null)
|
|
6502
|
-
)
|
|
6503
|
-
),
|
|
6504
|
-
/* @__PURE__ */ React101.createElement(Tooltip9, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React101.createElement(
|
|
6523
|
+
/* @__PURE__ */ React102.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions" }),
|
|
6524
|
+
/* @__PURE__ */ React102.createElement(Tooltip9, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React102.createElement(
|
|
6505
6525
|
IconButton8,
|
|
6506
6526
|
{
|
|
6507
6527
|
size: "tiny",
|
|
6508
6528
|
"aria-label": ARIA_LABEL,
|
|
6509
6529
|
"data-behavior": "display-conditions",
|
|
6510
|
-
onClick: () =>
|
|
6530
|
+
onClick: () => triggerRef.current?.toggle(),
|
|
6511
6531
|
sx: {
|
|
6512
6532
|
border: "1px solid",
|
|
6513
6533
|
borderColor: "divider",
|
|
6514
6534
|
borderRadius: 1
|
|
6515
6535
|
}
|
|
6516
6536
|
},
|
|
6517
|
-
/* @__PURE__ */
|
|
6537
|
+
/* @__PURE__ */ React102.createElement(SitemapIcon, { fontSize: "tiny", color: "disabled" })
|
|
6538
|
+
))
|
|
6539
|
+
);
|
|
6540
|
+
});
|
|
6541
|
+
|
|
6542
|
+
// src/components/promotions/attributes-control.tsx
|
|
6543
|
+
import * as React103 from "react";
|
|
6544
|
+
import { useRef as useRef26 } from "react";
|
|
6545
|
+
import { PlusIcon as PlusIcon3 } from "@elementor/icons";
|
|
6546
|
+
import { Stack as Stack17, Tooltip as Tooltip10 } from "@elementor/ui";
|
|
6547
|
+
import { __ as __51 } from "@wordpress/i18n";
|
|
6548
|
+
var ARIA_LABEL2 = __51("Attributes", "elementor");
|
|
6549
|
+
var AttributesControl = createControl(() => {
|
|
6550
|
+
const triggerRef = useRef26(null);
|
|
6551
|
+
return /* @__PURE__ */ React103.createElement(
|
|
6552
|
+
Stack17,
|
|
6553
|
+
{
|
|
6554
|
+
direction: "row",
|
|
6555
|
+
spacing: 2,
|
|
6556
|
+
sx: {
|
|
6557
|
+
justifyContent: "flex-end",
|
|
6558
|
+
alignItems: "center"
|
|
6559
|
+
}
|
|
6560
|
+
},
|
|
6561
|
+
/* @__PURE__ */ React103.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes" }),
|
|
6562
|
+
/* @__PURE__ */ React103.createElement(Tooltip10, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React103.createElement(
|
|
6563
|
+
PlusIcon3,
|
|
6564
|
+
{
|
|
6565
|
+
"aria-label": ARIA_LABEL2,
|
|
6566
|
+
fontSize: "tiny",
|
|
6567
|
+
color: "disabled",
|
|
6568
|
+
onClick: () => triggerRef.current?.toggle(),
|
|
6569
|
+
sx: { cursor: "pointer" }
|
|
6570
|
+
}
|
|
6518
6571
|
))
|
|
6519
6572
|
);
|
|
6520
6573
|
});
|
|
6521
6574
|
|
|
6522
6575
|
// src/components/icon-buttons/clear-icon-button.tsx
|
|
6523
|
-
import * as
|
|
6576
|
+
import * as React104 from "react";
|
|
6524
6577
|
import { BrushBigIcon } from "@elementor/icons";
|
|
6525
|
-
import { IconButton as IconButton9, styled as styled10, Tooltip as
|
|
6578
|
+
import { IconButton as IconButton9, styled as styled10, Tooltip as Tooltip11 } from "@elementor/ui";
|
|
6526
6579
|
var CustomIconButton = styled10(IconButton9)(({ theme }) => ({
|
|
6527
6580
|
width: theme.spacing(2.5),
|
|
6528
6581
|
height: theme.spacing(2.5)
|
|
6529
6582
|
}));
|
|
6530
|
-
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */
|
|
6583
|
+
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React104.createElement(Tooltip11, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React104.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React104.createElement(BrushBigIcon, { fontSize: size })));
|
|
6531
6584
|
|
|
6532
6585
|
// src/components/repeater/repeater.tsx
|
|
6533
|
-
import * as
|
|
6586
|
+
import * as React105 from "react";
|
|
6534
6587
|
import { useEffect as useEffect12, useState as useState19 } from "react";
|
|
6535
|
-
import { CopyIcon as CopyIcon2, EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2, PlusIcon as
|
|
6588
|
+
import { CopyIcon as CopyIcon2, EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2, PlusIcon as PlusIcon4, XIcon as XIcon4 } from "@elementor/icons";
|
|
6536
6589
|
import {
|
|
6537
6590
|
bindPopover as bindPopover7,
|
|
6538
6591
|
bindTrigger as bindTrigger6,
|
|
6539
6592
|
Box as Box25,
|
|
6540
6593
|
IconButton as IconButton10,
|
|
6541
6594
|
Infotip as Infotip4,
|
|
6542
|
-
Tooltip as
|
|
6595
|
+
Tooltip as Tooltip12,
|
|
6543
6596
|
usePopupState as usePopupState8
|
|
6544
6597
|
} from "@elementor/ui";
|
|
6545
|
-
import { __ as
|
|
6598
|
+
import { __ as __52 } from "@wordpress/i18n";
|
|
6546
6599
|
var SIZE9 = "tiny";
|
|
6547
6600
|
var EMPTY_OPEN_ITEM2 = -1;
|
|
6548
6601
|
var Repeater3 = ({
|
|
@@ -6623,7 +6676,7 @@ var Repeater3 = ({
|
|
|
6623
6676
|
};
|
|
6624
6677
|
const isButtonDisabled = disabled || disableAddItemButton;
|
|
6625
6678
|
const shouldShowInfotip = isButtonDisabled && addButtonInfotipContent;
|
|
6626
|
-
const addButton = /* @__PURE__ */
|
|
6679
|
+
const addButton = /* @__PURE__ */ React105.createElement(
|
|
6627
6680
|
IconButton10,
|
|
6628
6681
|
{
|
|
6629
6682
|
size: SIZE9,
|
|
@@ -6632,11 +6685,11 @@ var Repeater3 = ({
|
|
|
6632
6685
|
},
|
|
6633
6686
|
disabled: isButtonDisabled,
|
|
6634
6687
|
onClick: addRepeaterItem,
|
|
6635
|
-
"aria-label":
|
|
6688
|
+
"aria-label": __52("Add item", "elementor")
|
|
6636
6689
|
},
|
|
6637
|
-
/* @__PURE__ */
|
|
6690
|
+
/* @__PURE__ */ React105.createElement(PlusIcon4, { fontSize: SIZE9 })
|
|
6638
6691
|
);
|
|
6639
|
-
return /* @__PURE__ */
|
|
6692
|
+
return /* @__PURE__ */ React105.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React105.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, shouldShowInfotip ? /* @__PURE__ */ React105.createElement(
|
|
6640
6693
|
Infotip4,
|
|
6641
6694
|
{
|
|
6642
6695
|
placement: "right",
|
|
@@ -6644,20 +6697,20 @@ var Repeater3 = ({
|
|
|
6644
6697
|
color: "secondary",
|
|
6645
6698
|
slotProps: { popper: { sx: { width: 300 } } }
|
|
6646
6699
|
},
|
|
6647
|
-
/* @__PURE__ */
|
|
6648
|
-
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */
|
|
6700
|
+
/* @__PURE__ */ React105.createElement(Box25, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
|
|
6701
|
+
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React105.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
|
|
6649
6702
|
const index = uniqueKeys.indexOf(key);
|
|
6650
6703
|
const value = items2[index];
|
|
6651
6704
|
if (!value) {
|
|
6652
6705
|
return null;
|
|
6653
6706
|
}
|
|
6654
|
-
return /* @__PURE__ */
|
|
6707
|
+
return /* @__PURE__ */ React105.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React105.createElement(
|
|
6655
6708
|
RepeaterItem,
|
|
6656
6709
|
{
|
|
6657
6710
|
disabled,
|
|
6658
6711
|
propDisabled: value?.disabled,
|
|
6659
|
-
label: /* @__PURE__ */
|
|
6660
|
-
startIcon: /* @__PURE__ */
|
|
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 })),
|
|
6661
6714
|
removeItem: () => removeRepeaterItem(index),
|
|
6662
6715
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
6663
6716
|
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
@@ -6669,7 +6722,7 @@ var Repeater3 = ({
|
|
|
6669
6722
|
actions: itemSettings.actions,
|
|
6670
6723
|
value
|
|
6671
6724
|
},
|
|
6672
|
-
(props) => /* @__PURE__ */
|
|
6725
|
+
(props) => /* @__PURE__ */ React105.createElement(
|
|
6673
6726
|
itemSettings.Content,
|
|
6674
6727
|
{
|
|
6675
6728
|
...props,
|
|
@@ -6699,21 +6752,21 @@ var RepeaterItem = ({
|
|
|
6699
6752
|
value
|
|
6700
6753
|
}) => {
|
|
6701
6754
|
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
|
|
6702
|
-
const duplicateLabel =
|
|
6703
|
-
const toggleLabel = propDisabled ?
|
|
6704
|
-
const removeLabel =
|
|
6705
|
-
return /* @__PURE__ */
|
|
6755
|
+
const duplicateLabel = __52("Duplicate", "elementor");
|
|
6756
|
+
const toggleLabel = propDisabled ? __52("Show", "elementor") : __52("Hide", "elementor");
|
|
6757
|
+
const removeLabel = __52("Remove", "elementor");
|
|
6758
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(
|
|
6706
6759
|
RepeaterTag,
|
|
6707
6760
|
{
|
|
6708
6761
|
disabled,
|
|
6709
6762
|
label,
|
|
6710
6763
|
ref: setRef,
|
|
6711
|
-
"aria-label":
|
|
6764
|
+
"aria-label": __52("Open item", "elementor"),
|
|
6712
6765
|
...bindTrigger6(popoverState),
|
|
6713
6766
|
startIcon,
|
|
6714
|
-
actions: /* @__PURE__ */
|
|
6767
|
+
actions: /* @__PURE__ */ React105.createElement(React105.Fragment, null, showDuplicate && /* @__PURE__ */ React105.createElement(Tooltip12, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React105.createElement(IconButton10, { size: SIZE9, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React105.createElement(CopyIcon2, { fontSize: SIZE9 }))), showToggle && /* @__PURE__ */ React105.createElement(Tooltip12, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React105.createElement(IconButton10, { size: SIZE9, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React105.createElement(EyeOffIcon2, { fontSize: SIZE9 }) : /* @__PURE__ */ React105.createElement(EyeIcon2, { fontSize: SIZE9 }))), actions?.(value), showRemove && /* @__PURE__ */ React105.createElement(Tooltip12, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React105.createElement(IconButton10, { size: SIZE9, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React105.createElement(XIcon4, { fontSize: SIZE9 }))))
|
|
6715
6768
|
}
|
|
6716
|
-
), /* @__PURE__ */
|
|
6769
|
+
), /* @__PURE__ */ React105.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React105.createElement(Box25, null, children({ anchorEl: ref }))));
|
|
6717
6770
|
};
|
|
6718
6771
|
var usePopover = (openOnMount, onOpen) => {
|
|
6719
6772
|
const [ref, setRef] = useState19(null);
|
|
@@ -6734,8 +6787,8 @@ var usePopover = (openOnMount, onOpen) => {
|
|
|
6734
6787
|
};
|
|
6735
6788
|
|
|
6736
6789
|
// src/components/inline-editor-toolbar.tsx
|
|
6737
|
-
import * as
|
|
6738
|
-
import { useMemo as useMemo15, useRef as
|
|
6790
|
+
import * as React107 from "react";
|
|
6791
|
+
import { useMemo as useMemo15, useRef as useRef28, useState as useState20 } from "react";
|
|
6739
6792
|
import { getElementSetting } from "@elementor/editor-elements";
|
|
6740
6793
|
import {
|
|
6741
6794
|
BoldIcon,
|
|
@@ -6753,18 +6806,18 @@ import {
|
|
|
6753
6806
|
ToggleButton as ToggleButton3,
|
|
6754
6807
|
ToggleButtonGroup as ToggleButtonGroup2,
|
|
6755
6808
|
toggleButtonGroupClasses,
|
|
6756
|
-
Tooltip as
|
|
6809
|
+
Tooltip as Tooltip14,
|
|
6757
6810
|
usePopupState as usePopupState9
|
|
6758
6811
|
} from "@elementor/ui";
|
|
6759
6812
|
import { useEditorState } from "@tiptap/react";
|
|
6760
|
-
import { __ as
|
|
6813
|
+
import { __ as __54 } from "@wordpress/i18n";
|
|
6761
6814
|
|
|
6762
6815
|
// src/components/url-popover.tsx
|
|
6763
|
-
import * as
|
|
6764
|
-
import { useEffect as useEffect13, useRef as
|
|
6816
|
+
import * as React106 from "react";
|
|
6817
|
+
import { useEffect as useEffect13, useRef as useRef27 } from "react";
|
|
6765
6818
|
import { ExternalLinkIcon } from "@elementor/icons";
|
|
6766
|
-
import { bindPopover as bindPopover8, Popover as Popover7, Stack as
|
|
6767
|
-
import { __ as
|
|
6819
|
+
import { bindPopover as bindPopover8, Popover as Popover7, Stack as Stack18, TextField as TextField8, ToggleButton as ToggleButton2, Tooltip as Tooltip13 } from "@elementor/ui";
|
|
6820
|
+
import { __ as __53 } from "@wordpress/i18n";
|
|
6768
6821
|
var UrlPopover = ({
|
|
6769
6822
|
popupState,
|
|
6770
6823
|
restoreValue,
|
|
@@ -6774,7 +6827,7 @@ var UrlPopover = ({
|
|
|
6774
6827
|
openInNewTab,
|
|
6775
6828
|
onToggleNewTab
|
|
6776
6829
|
}) => {
|
|
6777
|
-
const inputRef =
|
|
6830
|
+
const inputRef = useRef27(null);
|
|
6778
6831
|
useEffect13(() => {
|
|
6779
6832
|
if (popupState.isOpen) {
|
|
6780
6833
|
requestAnimationFrame(() => inputRef.current?.focus());
|
|
@@ -6784,7 +6837,7 @@ var UrlPopover = ({
|
|
|
6784
6837
|
restoreValue();
|
|
6785
6838
|
popupState.close();
|
|
6786
6839
|
};
|
|
6787
|
-
return /* @__PURE__ */
|
|
6840
|
+
return /* @__PURE__ */ React106.createElement(
|
|
6788
6841
|
Popover7,
|
|
6789
6842
|
{
|
|
6790
6843
|
slotProps: {
|
|
@@ -6795,30 +6848,30 @@ var UrlPopover = ({
|
|
|
6795
6848
|
transformOrigin: { vertical: "top", horizontal: "left" },
|
|
6796
6849
|
onClose: handleClose
|
|
6797
6850
|
},
|
|
6798
|
-
/* @__PURE__ */
|
|
6851
|
+
/* @__PURE__ */ React106.createElement(Stack18, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React106.createElement(
|
|
6799
6852
|
TextField8,
|
|
6800
6853
|
{
|
|
6801
6854
|
value,
|
|
6802
6855
|
onChange,
|
|
6803
6856
|
size: "tiny",
|
|
6804
6857
|
fullWidth: true,
|
|
6805
|
-
placeholder:
|
|
6858
|
+
placeholder: __53("Type a URL", "elementor"),
|
|
6806
6859
|
inputProps: { ref: inputRef },
|
|
6807
6860
|
color: "secondary",
|
|
6808
6861
|
InputProps: { sx: { borderRadius: "8px" } },
|
|
6809
6862
|
onKeyUp: (event) => event.key === "Enter" && handleClose()
|
|
6810
6863
|
}
|
|
6811
|
-
), /* @__PURE__ */
|
|
6864
|
+
), /* @__PURE__ */ React106.createElement(Tooltip13, { title: __53("Open in a new tab", "elementor") }, /* @__PURE__ */ React106.createElement(
|
|
6812
6865
|
ToggleButton2,
|
|
6813
6866
|
{
|
|
6814
6867
|
size: "tiny",
|
|
6815
6868
|
value: "newTab",
|
|
6816
6869
|
selected: openInNewTab,
|
|
6817
6870
|
onClick: onToggleNewTab,
|
|
6818
|
-
"aria-label":
|
|
6871
|
+
"aria-label": __53("Open in a new tab", "elementor"),
|
|
6819
6872
|
sx: { borderRadius: "8px" }
|
|
6820
6873
|
},
|
|
6821
|
-
/* @__PURE__ */
|
|
6874
|
+
/* @__PURE__ */ React106.createElement(ExternalLinkIcon, { fontSize: "tiny" })
|
|
6822
6875
|
)))
|
|
6823
6876
|
);
|
|
6824
6877
|
};
|
|
@@ -6827,7 +6880,7 @@ var UrlPopover = ({
|
|
|
6827
6880
|
var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
6828
6881
|
const [urlValue, setUrlValue] = useState20("");
|
|
6829
6882
|
const [openInNewTab, setOpenInNewTab] = useState20(false);
|
|
6830
|
-
const toolbarRef =
|
|
6883
|
+
const toolbarRef = useRef28(null);
|
|
6831
6884
|
const linkPopupState = usePopupState9({ variant: "popover" });
|
|
6832
6885
|
const hasLinkOnElement = elementId ? checkIfElementHasLink(elementId) : false;
|
|
6833
6886
|
const editorState = useEditorState({
|
|
@@ -6871,10 +6924,10 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
6871
6924
|
}
|
|
6872
6925
|
linkPopupState.close();
|
|
6873
6926
|
};
|
|
6874
|
-
|
|
6927
|
+
React107.useEffect(() => {
|
|
6875
6928
|
editor?.commands?.focus();
|
|
6876
6929
|
}, [editor]);
|
|
6877
|
-
return /* @__PURE__ */
|
|
6930
|
+
return /* @__PURE__ */ React107.createElement(
|
|
6878
6931
|
Box26,
|
|
6879
6932
|
{
|
|
6880
6933
|
ref: toolbarRef,
|
|
@@ -6891,8 +6944,8 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
6891
6944
|
...sx
|
|
6892
6945
|
}
|
|
6893
6946
|
},
|
|
6894
|
-
/* @__PURE__ */
|
|
6895
|
-
/* @__PURE__ */
|
|
6947
|
+
/* @__PURE__ */ React107.createElement(Tooltip14, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React107.createElement(IconButton11, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
|
|
6948
|
+
/* @__PURE__ */ React107.createElement(
|
|
6896
6949
|
ToggleButtonGroup2,
|
|
6897
6950
|
{
|
|
6898
6951
|
value: editorState,
|
|
@@ -6914,7 +6967,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
6914
6967
|
}
|
|
6915
6968
|
}
|
|
6916
6969
|
},
|
|
6917
|
-
formatButtonsList.map((button) => /* @__PURE__ */
|
|
6970
|
+
formatButtonsList.map((button) => /* @__PURE__ */ React107.createElement(Tooltip14, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React107.createElement(
|
|
6918
6971
|
ToggleButton3,
|
|
6919
6972
|
{
|
|
6920
6973
|
value: button.action,
|
|
@@ -6932,7 +6985,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
6932
6985
|
button.icon
|
|
6933
6986
|
)))
|
|
6934
6987
|
),
|
|
6935
|
-
/* @__PURE__ */
|
|
6988
|
+
/* @__PURE__ */ React107.createElement(
|
|
6936
6989
|
UrlPopover,
|
|
6937
6990
|
{
|
|
6938
6991
|
popupState: linkPopupState,
|
|
@@ -6949,64 +7002,64 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
6949
7002
|
var checkIfElementHasLink = (elementId) => !!getElementSetting(elementId, "link")?.value?.destination;
|
|
6950
7003
|
var toolbarButtons = {
|
|
6951
7004
|
clear: {
|
|
6952
|
-
label:
|
|
6953
|
-
icon: /* @__PURE__ */
|
|
7005
|
+
label: __54("Clear", "elementor"),
|
|
7006
|
+
icon: /* @__PURE__ */ React107.createElement(MinusIcon2, { fontSize: "tiny" }),
|
|
6954
7007
|
action: "clear",
|
|
6955
7008
|
method: (editor) => {
|
|
6956
7009
|
editor.chain().focus().clearNodes().unsetAllMarks().run();
|
|
6957
7010
|
}
|
|
6958
7011
|
},
|
|
6959
7012
|
bold: {
|
|
6960
|
-
label:
|
|
6961
|
-
icon: /* @__PURE__ */
|
|
7013
|
+
label: __54("Bold", "elementor"),
|
|
7014
|
+
icon: /* @__PURE__ */ React107.createElement(BoldIcon, { fontSize: "tiny" }),
|
|
6962
7015
|
action: "bold",
|
|
6963
7016
|
method: (editor) => {
|
|
6964
7017
|
editor.chain().focus().toggleBold().run();
|
|
6965
7018
|
}
|
|
6966
7019
|
},
|
|
6967
7020
|
italic: {
|
|
6968
|
-
label:
|
|
6969
|
-
icon: /* @__PURE__ */
|
|
7021
|
+
label: __54("Italic", "elementor"),
|
|
7022
|
+
icon: /* @__PURE__ */ React107.createElement(ItalicIcon, { fontSize: "tiny" }),
|
|
6970
7023
|
action: "italic",
|
|
6971
7024
|
method: (editor) => {
|
|
6972
7025
|
editor.chain().focus().toggleItalic().run();
|
|
6973
7026
|
}
|
|
6974
7027
|
},
|
|
6975
7028
|
underline: {
|
|
6976
|
-
label:
|
|
6977
|
-
icon: /* @__PURE__ */
|
|
7029
|
+
label: __54("Underline", "elementor"),
|
|
7030
|
+
icon: /* @__PURE__ */ React107.createElement(UnderlineIcon, { fontSize: "tiny" }),
|
|
6978
7031
|
action: "underline",
|
|
6979
7032
|
method: (editor) => {
|
|
6980
7033
|
editor.chain().focus().toggleUnderline().run();
|
|
6981
7034
|
}
|
|
6982
7035
|
},
|
|
6983
7036
|
strike: {
|
|
6984
|
-
label:
|
|
6985
|
-
icon: /* @__PURE__ */
|
|
7037
|
+
label: __54("Strikethrough", "elementor"),
|
|
7038
|
+
icon: /* @__PURE__ */ React107.createElement(StrikethroughIcon, { fontSize: "tiny" }),
|
|
6986
7039
|
action: "strike",
|
|
6987
7040
|
method: (editor) => {
|
|
6988
7041
|
editor.chain().focus().toggleStrike().run();
|
|
6989
7042
|
}
|
|
6990
7043
|
},
|
|
6991
7044
|
superscript: {
|
|
6992
|
-
label:
|
|
6993
|
-
icon: /* @__PURE__ */
|
|
7045
|
+
label: __54("Superscript", "elementor"),
|
|
7046
|
+
icon: /* @__PURE__ */ React107.createElement(SuperscriptIcon, { fontSize: "tiny" }),
|
|
6994
7047
|
action: "superscript",
|
|
6995
7048
|
method: (editor) => {
|
|
6996
7049
|
editor.chain().focus().toggleSuperscript().run();
|
|
6997
7050
|
}
|
|
6998
7051
|
},
|
|
6999
7052
|
subscript: {
|
|
7000
|
-
label:
|
|
7001
|
-
icon: /* @__PURE__ */
|
|
7053
|
+
label: __54("Subscript", "elementor"),
|
|
7054
|
+
icon: /* @__PURE__ */ React107.createElement(SubscriptIcon, { fontSize: "tiny" }),
|
|
7002
7055
|
action: "subscript",
|
|
7003
7056
|
method: (editor) => {
|
|
7004
7057
|
editor.chain().focus().toggleSubscript().run();
|
|
7005
7058
|
}
|
|
7006
7059
|
},
|
|
7007
7060
|
link: {
|
|
7008
|
-
label:
|
|
7009
|
-
icon: /* @__PURE__ */
|
|
7061
|
+
label: __54("Link", "elementor"),
|
|
7062
|
+
icon: /* @__PURE__ */ React107.createElement(LinkIcon3, { fontSize: "tiny" }),
|
|
7010
7063
|
action: "link",
|
|
7011
7064
|
method: null
|
|
7012
7065
|
}
|
|
@@ -7015,6 +7068,7 @@ var { clear: clearButton, ...formatButtons } = toolbarButtons;
|
|
|
7015
7068
|
var possibleFormats = Object.keys(formatButtons);
|
|
7016
7069
|
export {
|
|
7017
7070
|
AspectRatioControl,
|
|
7071
|
+
AttributesControl,
|
|
7018
7072
|
BackgroundControl,
|
|
7019
7073
|
BoxShadowRepeaterControl,
|
|
7020
7074
|
ClearIconButton,
|
|
@@ -7045,6 +7099,7 @@ export {
|
|
|
7045
7099
|
PopoverContent,
|
|
7046
7100
|
PopoverGridContainer,
|
|
7047
7101
|
PositionControl,
|
|
7102
|
+
PromotionTrigger,
|
|
7048
7103
|
PropKeyProvider,
|
|
7049
7104
|
PropProvider,
|
|
7050
7105
|
QueryControl,
|