@elementor/editor-controls 4.3.0-998 → 4.3.0-beta1
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 +37 -26
- package/dist/index.d.ts +37 -26
- package/dist/index.js +919 -688
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +809 -568
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
- package/src/components/inline-editor-toolbar.tsx +36 -3
- package/src/components/inline-editor.tsx +3 -0
- package/src/controls/aspect-ratio-control.tsx +2 -2
- package/src/controls/background-control/background-gradient-color-control.tsx +2 -2
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +3 -1
- package/src/controls/email-form-action-control/email-chips-field.tsx +37 -10
- package/src/controls/email-form-action-control/fields.tsx +38 -15
- package/src/controls/email-form-action-control/utils.ts +6 -0
- package/src/controls/inline-editing-control.tsx +57 -58
- package/src/controls/mention-text-area-control.tsx +2 -2
- package/src/controls/open-icon-library.ts +82 -0
- package/src/controls/select-control.tsx +47 -10
- package/src/controls/svg-media-control.tsx +124 -18
- package/src/controls/video-media-control.tsx +21 -2
- package/src/utils/inline-editing.ts +12 -0
package/dist/index.js
CHANGED
|
@@ -584,14 +584,15 @@ var DEFAULT_MENU_PROPS = {
|
|
|
584
584
|
}
|
|
585
585
|
};
|
|
586
586
|
var SelectControl = createControl(
|
|
587
|
-
({ options, onChange, MenuProps = DEFAULT_MENU_PROPS, ariaLabel }) => {
|
|
587
|
+
({ options = [], groups = [], onChange, MenuProps = DEFAULT_MENU_PROPS, ariaLabel }) => {
|
|
588
588
|
const { value, setValue, disabled, placeholder } = useBoundProp(import_editor_props2.stringPropTypeUtil);
|
|
589
589
|
const handleChange = (event) => {
|
|
590
590
|
const newValue = event.target.value || null;
|
|
591
591
|
onChange?.(newValue, value);
|
|
592
592
|
setValue(newValue);
|
|
593
593
|
};
|
|
594
|
-
const
|
|
594
|
+
const flatOptions = flattenGroupedOptions(options, groups);
|
|
595
|
+
const isDisabled = disabled || flatOptions.length === 0;
|
|
595
596
|
return /* @__PURE__ */ React12.createElement(ControlActions, null, /* @__PURE__ */ React12.createElement(
|
|
596
597
|
import_ui5.Select,
|
|
597
598
|
{
|
|
@@ -600,16 +601,41 @@ var SelectControl = createControl(
|
|
|
600
601
|
size: "tiny",
|
|
601
602
|
MenuProps,
|
|
602
603
|
"aria-label": ariaLabel || placeholder,
|
|
603
|
-
renderValue: (selectedValue) => getSelectRenderValue(
|
|
604
|
+
renderValue: (selectedValue) => getSelectRenderValue(flatOptions, placeholder, selectedValue),
|
|
604
605
|
value: value ?? "",
|
|
605
606
|
onChange: handleChange,
|
|
606
607
|
disabled: isDisabled,
|
|
607
608
|
fullWidth: true
|
|
608
609
|
},
|
|
609
|
-
|
|
610
|
+
groups.length ? groups.flatMap((group) => renderGroup(group)) : options.map((option) => renderOption(option))
|
|
610
611
|
));
|
|
611
612
|
}
|
|
612
613
|
);
|
|
614
|
+
var GROUPED_OPTION_INDENT = 3.5;
|
|
615
|
+
function renderGroup(group) {
|
|
616
|
+
return [
|
|
617
|
+
/* @__PURE__ */ React12.createElement(import_ui5.MenuSubheader, { key: `group-${group.label}`, sx: { fontWeight: 400, color: "text.tertiary" } }, group.label),
|
|
618
|
+
...group.options.map((option) => renderOption(option, true))
|
|
619
|
+
];
|
|
620
|
+
}
|
|
621
|
+
function renderOption({ label, ...props }, isGrouped = false) {
|
|
622
|
+
return /* @__PURE__ */ React12.createElement(
|
|
623
|
+
import_editor_ui2.MenuListItem,
|
|
624
|
+
{
|
|
625
|
+
key: props.value,
|
|
626
|
+
...props,
|
|
627
|
+
value: props.value ?? "",
|
|
628
|
+
sx: isGrouped ? { pl: GROUPED_OPTION_INDENT } : void 0
|
|
629
|
+
},
|
|
630
|
+
label
|
|
631
|
+
);
|
|
632
|
+
}
|
|
633
|
+
function flattenGroupedOptions(options, groups) {
|
|
634
|
+
if (!groups.length) {
|
|
635
|
+
return options;
|
|
636
|
+
}
|
|
637
|
+
return groups.flatMap((group) => group.options);
|
|
638
|
+
}
|
|
613
639
|
function getSelectRenderValue(options, placeholder, selectedValue) {
|
|
614
640
|
const optionWithValue = (v) => options.find(({ value }) => value === v);
|
|
615
641
|
if (!isUnsetSelectValue(selectedValue)) {
|
|
@@ -5268,8 +5294,8 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
5268
5294
|
const isCustomValue = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
5269
5295
|
if (isCustomValue) {
|
|
5270
5296
|
const [width, height] = aspectRatioValue.split("/");
|
|
5271
|
-
setCustomWidth(width || "");
|
|
5272
|
-
setCustomHeight(height || "");
|
|
5297
|
+
setCustomWidth(width.trim() || "");
|
|
5298
|
+
setCustomHeight(height.trim() || "");
|
|
5273
5299
|
setSelectedValue(CUSTOM_RATIO);
|
|
5274
5300
|
setIsCustom(true);
|
|
5275
5301
|
} else {
|
|
@@ -5353,7 +5379,7 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
5353
5379
|
var React81 = __toESM(require("react"));
|
|
5354
5380
|
var import_react49 = require("react");
|
|
5355
5381
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
5356
|
-
var
|
|
5382
|
+
var import_editor_props35 = require("@elementor/editor-props");
|
|
5357
5383
|
var import_icons21 = require("@elementor/icons");
|
|
5358
5384
|
var import_ui64 = require("@elementor/ui");
|
|
5359
5385
|
var import_wp_media2 = require("@elementor/wp-media");
|
|
@@ -5409,10 +5435,49 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
5409
5435
|
isPending ? /* @__PURE__ */ React80.createElement(import_ui63.CircularProgress, { size: 24 }) : (0, import_i18n31.__)("Enable", "elementor")
|
|
5410
5436
|
)));
|
|
5411
5437
|
|
|
5438
|
+
// src/controls/open-icon-library.ts
|
|
5439
|
+
var import_editor_props34 = require("@elementor/editor-props");
|
|
5440
|
+
var SVG_ICON_LIBRARY = "svg";
|
|
5441
|
+
function isSvgLibrarySelection(icon) {
|
|
5442
|
+
return icon.library === SVG_ICON_LIBRARY && typeof icon.value === "object" && icon.value !== null;
|
|
5443
|
+
}
|
|
5444
|
+
function openIconLibrary({ selected, onSelect } = {}) {
|
|
5445
|
+
const iconManager = window.elementor?.iconManager;
|
|
5446
|
+
if (!iconManager) {
|
|
5447
|
+
return;
|
|
5448
|
+
}
|
|
5449
|
+
iconManager.loadIconLibraries();
|
|
5450
|
+
iconManager.show({
|
|
5451
|
+
view: createIconManagerControlView(selected, onSelect)
|
|
5452
|
+
});
|
|
5453
|
+
}
|
|
5454
|
+
function enqueueIconFonts(library) {
|
|
5455
|
+
window.elementor?.helpers?.enqueueIconFonts?.(library);
|
|
5456
|
+
}
|
|
5457
|
+
function createIconManagerControlView(selected, onSelect) {
|
|
5458
|
+
return {
|
|
5459
|
+
model: {
|
|
5460
|
+
get: () => false
|
|
5461
|
+
},
|
|
5462
|
+
getControlValue: () => selected ?? { value: "", library: "" },
|
|
5463
|
+
setValue: (icon) => {
|
|
5464
|
+
onSelect?.(icon);
|
|
5465
|
+
},
|
|
5466
|
+
applySavedValue: () => void 0
|
|
5467
|
+
};
|
|
5468
|
+
}
|
|
5469
|
+
function createIconPropValue(icon, library) {
|
|
5470
|
+
return {
|
|
5471
|
+
value: import_editor_props34.stringPropTypeUtil.create(icon),
|
|
5472
|
+
library: import_editor_props34.stringPropTypeUtil.create(library)
|
|
5473
|
+
};
|
|
5474
|
+
}
|
|
5475
|
+
|
|
5412
5476
|
// src/controls/svg-media-control.tsx
|
|
5413
5477
|
var TILE_SIZE = 8;
|
|
5414
5478
|
var TILE_WHITE = "transparent";
|
|
5415
5479
|
var TILE_BLACK = "#c1c1c1";
|
|
5480
|
+
var ICON_PREVIEW_FONT_SIZE = 50;
|
|
5416
5481
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
5417
5482
|
var StyledCard = (0, import_ui64.styled)(import_ui64.Card)`
|
|
5418
5483
|
background-color: white;
|
|
@@ -5434,26 +5499,29 @@ var StyledCardMediaContainer = (0, import_ui64.styled)(import_ui64.Stack)`
|
|
|
5434
5499
|
`;
|
|
5435
5500
|
var MODE_BROWSE = { mode: "browse" };
|
|
5436
5501
|
var MODE_UPLOAD = { mode: "upload" };
|
|
5437
|
-
var SvgMediaControl = createControl(() => {
|
|
5438
|
-
const { value, setValue } = useBoundProp(
|
|
5439
|
-
const
|
|
5440
|
-
const
|
|
5502
|
+
var SvgMediaControl = createControl(({ showIconLibrary = false }) => {
|
|
5503
|
+
const { value: svgValue, setValue: setSvgValue } = useBoundProp(import_editor_props35.svgSrcPropTypeUtil);
|
|
5504
|
+
const { value: iconValue, setValue: setIconValue } = useBoundProp(import_editor_props35.iconPropTypeUtil);
|
|
5505
|
+
const id = svgValue?.id;
|
|
5506
|
+
const url = svgValue?.url;
|
|
5441
5507
|
const { data: attachment, isFetching } = (0, import_wp_media2.useWpMediaAttachment)(id?.value || null);
|
|
5442
5508
|
const src = attachment?.url ?? url?.value ?? null;
|
|
5443
5509
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
5444
5510
|
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0, import_react49.useState)(false);
|
|
5445
5511
|
const { isAdmin } = (0, import_editor_current_user.useCurrentUserCapabilities)();
|
|
5512
|
+
const selectedIconClass = showIconLibrary && typeof iconValue?.value?.value === "string" ? iconValue.value.value : null;
|
|
5513
|
+
const selectedIconLibrary = showIconLibrary && typeof iconValue?.library?.value === "string" ? iconValue.library.value : null;
|
|
5446
5514
|
const { open } = (0, import_wp_media2.useWpMediaFrame)({
|
|
5447
5515
|
mediaTypes: ["svg"],
|
|
5448
5516
|
multiple: false,
|
|
5449
5517
|
selected: id?.value || null,
|
|
5450
5518
|
onSelect: (selectedAttachment) => {
|
|
5451
|
-
|
|
5519
|
+
setSvgValue({
|
|
5452
5520
|
id: {
|
|
5453
5521
|
$$type: "image-attachment-id",
|
|
5454
5522
|
value: selectedAttachment.id
|
|
5455
5523
|
},
|
|
5456
|
-
url:
|
|
5524
|
+
url: import_editor_props35.urlPropTypeUtil.create(selectedAttachment.url)
|
|
5457
5525
|
});
|
|
5458
5526
|
}
|
|
5459
5527
|
});
|
|
@@ -5470,18 +5538,36 @@ var SvgMediaControl = createControl(() => {
|
|
|
5470
5538
|
open(openOptions);
|
|
5471
5539
|
}
|
|
5472
5540
|
};
|
|
5541
|
+
const handleIconLibrarySelect = (icon) => {
|
|
5542
|
+
if (!showIconLibrary) {
|
|
5543
|
+
return;
|
|
5544
|
+
}
|
|
5545
|
+
if (isSvgLibrarySelection(icon)) {
|
|
5546
|
+
setSvgValue({
|
|
5547
|
+
id: icon.value.id ? {
|
|
5548
|
+
$$type: "image-attachment-id",
|
|
5549
|
+
value: icon.value.id
|
|
5550
|
+
} : null,
|
|
5551
|
+
url: icon.value.url ? import_editor_props35.urlPropTypeUtil.create(icon.value.url) : null
|
|
5552
|
+
});
|
|
5553
|
+
return;
|
|
5554
|
+
}
|
|
5555
|
+
if (typeof icon.value === "string") {
|
|
5556
|
+
setIconValue(createIconPropValue(icon.value, icon.library));
|
|
5557
|
+
}
|
|
5558
|
+
};
|
|
5473
5559
|
const infotipProps = {
|
|
5474
5560
|
title: (0, import_i18n32.__)("Sorry, you can't upload that file yet.", "elementor"),
|
|
5475
5561
|
description: /* @__PURE__ */ React81.createElement(React81.Fragment, null, (0, import_i18n32.__)("To upload them anyway, ask the site administrator to enable unfiltered", "elementor"), /* @__PURE__ */ React81.createElement("br", null), (0, import_i18n32.__)("file uploads.", "elementor")),
|
|
5476
5562
|
isEnabled: !isAdmin
|
|
5477
5563
|
};
|
|
5478
|
-
return /* @__PURE__ */ React81.createElement(import_ui64.Stack, { gap: 1, "aria-label": "SVG Control" }, /* @__PURE__ */ React81.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React81.createElement(ControlActions, null, /* @__PURE__ */ React81.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React81.createElement(StyledCardMediaContainer, null,
|
|
5479
|
-
|
|
5564
|
+
return /* @__PURE__ */ React81.createElement(import_ui64.Stack, { gap: 1, "aria-label": "SVG Control" }, /* @__PURE__ */ React81.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React81.createElement(ControlActions, null, /* @__PURE__ */ React81.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React81.createElement(StyledCardMediaContainer, null, /* @__PURE__ */ React81.createElement(
|
|
5565
|
+
SvgMediaPreview,
|
|
5480
5566
|
{
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5567
|
+
isFetching,
|
|
5568
|
+
src,
|
|
5569
|
+
iconClassName: selectedIconClass,
|
|
5570
|
+
iconLibrary: selectedIconLibrary
|
|
5485
5571
|
}
|
|
5486
5572
|
)), /* @__PURE__ */ React81.createElement(
|
|
5487
5573
|
import_ui64.CardOverlay,
|
|
@@ -5502,7 +5588,20 @@ var SvgMediaControl = createControl(() => {
|
|
|
5502
5588
|
"aria-label": "Select SVG"
|
|
5503
5589
|
},
|
|
5504
5590
|
(0, import_i18n32.__)("Select SVG", "elementor")
|
|
5505
|
-
),
|
|
5591
|
+
), showIconLibrary ? /* @__PURE__ */ React81.createElement(
|
|
5592
|
+
import_ui64.Button,
|
|
5593
|
+
{
|
|
5594
|
+
size: "tiny",
|
|
5595
|
+
variant: "text",
|
|
5596
|
+
color: "inherit",
|
|
5597
|
+
onClick: () => openIconLibrary({
|
|
5598
|
+
selected: selectedIconClass && selectedIconLibrary ? { value: selectedIconClass, library: selectedIconLibrary } : void 0,
|
|
5599
|
+
onSelect: handleIconLibrarySelect
|
|
5600
|
+
}),
|
|
5601
|
+
"aria-label": (0, import_i18n32.__)("Icon library", "elementor")
|
|
5602
|
+
},
|
|
5603
|
+
(0, import_i18n32.__)("Icon library", "elementor")
|
|
5604
|
+
) : null, /* @__PURE__ */ React81.createElement(ConditionalControlInfotip, { ...infotipProps }, /* @__PURE__ */ React81.createElement("span", null, /* @__PURE__ */ React81.createElement(import_ui64.ThemeProvider, { colorScheme: isAdmin ? "light" : "dark" }, /* @__PURE__ */ React81.createElement(
|
|
5506
5605
|
import_ui64.Button,
|
|
5507
5606
|
{
|
|
5508
5607
|
size: "tiny",
|
|
@@ -5517,24 +5616,62 @@ var SvgMediaControl = createControl(() => {
|
|
|
5517
5616
|
)))))
|
|
5518
5617
|
))));
|
|
5519
5618
|
});
|
|
5619
|
+
function SvgMediaPreview({
|
|
5620
|
+
isFetching,
|
|
5621
|
+
src,
|
|
5622
|
+
iconClassName,
|
|
5623
|
+
iconLibrary
|
|
5624
|
+
}) {
|
|
5625
|
+
(0, import_react49.useEffect)(() => {
|
|
5626
|
+
if (iconLibrary) {
|
|
5627
|
+
enqueueIconFonts(iconLibrary);
|
|
5628
|
+
}
|
|
5629
|
+
}, [iconLibrary]);
|
|
5630
|
+
if (isFetching) {
|
|
5631
|
+
return /* @__PURE__ */ React81.createElement(import_ui64.CircularProgress, { role: "progressbar" });
|
|
5632
|
+
}
|
|
5633
|
+
if (iconClassName) {
|
|
5634
|
+
return /* @__PURE__ */ React81.createElement(
|
|
5635
|
+
import_ui64.Box,
|
|
5636
|
+
{
|
|
5637
|
+
component: "i",
|
|
5638
|
+
className: iconClassName,
|
|
5639
|
+
"aria-label": (0, import_i18n32.__)("Preview icon", "elementor"),
|
|
5640
|
+
sx: { fontSize: ICON_PREVIEW_FONT_SIZE }
|
|
5641
|
+
}
|
|
5642
|
+
);
|
|
5643
|
+
}
|
|
5644
|
+
return /* @__PURE__ */ React81.createElement(
|
|
5645
|
+
import_ui64.CardMedia,
|
|
5646
|
+
{
|
|
5647
|
+
component: "img",
|
|
5648
|
+
image: src,
|
|
5649
|
+
alt: (0, import_i18n32.__)("Preview SVG", "elementor"),
|
|
5650
|
+
sx: { maxHeight: "140px", width: `${ICON_PREVIEW_FONT_SIZE}px` }
|
|
5651
|
+
}
|
|
5652
|
+
);
|
|
5653
|
+
}
|
|
5520
5654
|
|
|
5521
5655
|
// src/controls/video-media-control.tsx
|
|
5522
5656
|
var React82 = __toESM(require("react"));
|
|
5523
|
-
var
|
|
5657
|
+
var import_editor_props36 = require("@elementor/editor-props");
|
|
5524
5658
|
var import_icons22 = require("@elementor/icons");
|
|
5525
5659
|
var import_ui65 = require("@elementor/ui");
|
|
5526
5660
|
var import_wp_media3 = require("@elementor/wp-media");
|
|
5527
5661
|
var import_i18n33 = require("@wordpress/i18n");
|
|
5528
5662
|
var PLACEHOLDER_IMAGE = window.elementorCommon?.config?.urls?.assets + "/shapes/play-triangle.svg";
|
|
5529
5663
|
var VideoMediaControl = createControl(() => {
|
|
5530
|
-
const { value, setValue } = useBoundProp(
|
|
5664
|
+
const { value, setValue, propType } = useBoundProp(import_editor_props36.videoSrcPropTypeUtil);
|
|
5531
5665
|
const { id, url } = value ?? {};
|
|
5532
5666
|
const { data: attachment, isFetching } = (0, import_wp_media3.useWpMediaAttachment)(id?.value || null);
|
|
5533
5667
|
const videoUrl = attachment?.url ?? url?.value ?? null;
|
|
5668
|
+
const defaultUrl = import_editor_props36.videoSrcPropTypeUtil.extract(propType.default ?? null)?.url?.value;
|
|
5669
|
+
const currentUrlForModal = url?.value && url.value !== defaultUrl ? url.value : void 0;
|
|
5534
5670
|
const { open } = (0, import_wp_media3.useWpMediaFrame)({
|
|
5535
5671
|
mediaTypes: ["video"],
|
|
5536
5672
|
multiple: false,
|
|
5537
5673
|
selected: id?.value || null,
|
|
5674
|
+
allowUrlImport: true,
|
|
5538
5675
|
onSelect: (selectedAttachment) => {
|
|
5539
5676
|
setValue({
|
|
5540
5677
|
id: {
|
|
@@ -5543,6 +5680,12 @@ var VideoMediaControl = createControl(() => {
|
|
|
5543
5680
|
},
|
|
5544
5681
|
url: null
|
|
5545
5682
|
});
|
|
5683
|
+
},
|
|
5684
|
+
onSelectUrl: (selectedUrl) => {
|
|
5685
|
+
setValue({
|
|
5686
|
+
id: null,
|
|
5687
|
+
url: import_editor_props36.urlPropTypeUtil.create(selectedUrl)
|
|
5688
|
+
});
|
|
5546
5689
|
}
|
|
5547
5690
|
});
|
|
5548
5691
|
return /* @__PURE__ */ React82.createElement(ControlActions, null, /* @__PURE__ */ React82.createElement(import_ui65.Card, { variant: "outlined" }, /* @__PURE__ */ React82.createElement(
|
|
@@ -5580,6 +5723,15 @@ var VideoMediaControl = createControl(() => {
|
|
|
5580
5723
|
onClick: () => open({ mode: "upload" })
|
|
5581
5724
|
},
|
|
5582
5725
|
(0, import_i18n33.__)("Upload", "elementor")
|
|
5726
|
+
), /* @__PURE__ */ React82.createElement(
|
|
5727
|
+
import_ui65.Button,
|
|
5728
|
+
{
|
|
5729
|
+
size: "tiny",
|
|
5730
|
+
variant: "text",
|
|
5731
|
+
color: "inherit",
|
|
5732
|
+
onClick: () => open({ mode: "url", currentUrl: currentUrlForModal })
|
|
5733
|
+
},
|
|
5734
|
+
(0, import_i18n33.__)("Insert from URL", "elementor")
|
|
5583
5735
|
)))));
|
|
5584
5736
|
});
|
|
5585
5737
|
var VideoPreview = ({ isFetching = false, videoUrl }) => {
|
|
@@ -5590,6 +5742,7 @@ var VideoPreview = ({ isFetching = false, videoUrl }) => {
|
|
|
5590
5742
|
return /* @__PURE__ */ React82.createElement(
|
|
5591
5743
|
"video",
|
|
5592
5744
|
{
|
|
5745
|
+
"aria-label": (0, import_i18n33.__)("Video preview", "elementor"),
|
|
5593
5746
|
src: videoUrl,
|
|
5594
5747
|
muted: true,
|
|
5595
5748
|
preload: "metadata",
|
|
@@ -5607,13 +5760,13 @@ var VideoPreview = ({ isFetching = false, videoUrl }) => {
|
|
|
5607
5760
|
|
|
5608
5761
|
// src/controls/background-control/background-control.tsx
|
|
5609
5762
|
var React89 = __toESM(require("react"));
|
|
5610
|
-
var
|
|
5763
|
+
var import_editor_props42 = require("@elementor/editor-props");
|
|
5611
5764
|
var import_ui73 = require("@elementor/ui");
|
|
5612
5765
|
var import_i18n39 = require("@wordpress/i18n");
|
|
5613
5766
|
|
|
5614
5767
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
5615
5768
|
var React88 = __toESM(require("react"));
|
|
5616
|
-
var
|
|
5769
|
+
var import_editor_props41 = require("@elementor/editor-props");
|
|
5617
5770
|
var import_ui72 = require("@elementor/ui");
|
|
5618
5771
|
var import_wp_media4 = require("@elementor/wp-media");
|
|
5619
5772
|
var import_i18n38 = require("@wordpress/i18n");
|
|
@@ -5624,26 +5777,26 @@ var { env } = (0, import_env.parseEnv)("@elementor/editor-controls");
|
|
|
5624
5777
|
|
|
5625
5778
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
5626
5779
|
var React83 = __toESM(require("react"));
|
|
5627
|
-
var
|
|
5780
|
+
var import_editor_props37 = require("@elementor/editor-props");
|
|
5628
5781
|
var import_ui66 = require("@elementor/ui");
|
|
5629
5782
|
var BackgroundGradientColorControl = createControl(() => {
|
|
5630
|
-
const { value, setValue } = useBoundProp(
|
|
5783
|
+
const { value, setValue } = useBoundProp(import_editor_props37.backgroundGradientOverlayPropTypeUtil);
|
|
5631
5784
|
const handleChange = (newValue) => {
|
|
5632
5785
|
const transformedValue = createTransformableValue(newValue);
|
|
5633
5786
|
if (transformedValue.positions) {
|
|
5634
|
-
transformedValue.positions =
|
|
5787
|
+
transformedValue.positions = import_editor_props37.stringPropTypeUtil.create(newValue.positions.join(" "));
|
|
5635
5788
|
}
|
|
5636
5789
|
setValue(transformedValue);
|
|
5637
5790
|
};
|
|
5638
5791
|
const createTransformableValue = (newValue) => ({
|
|
5639
5792
|
...newValue,
|
|
5640
|
-
type:
|
|
5641
|
-
angle:
|
|
5642
|
-
stops:
|
|
5793
|
+
type: import_editor_props37.stringPropTypeUtil.create(newValue.type),
|
|
5794
|
+
angle: import_editor_props37.numberPropTypeUtil.create(newValue.angle),
|
|
5795
|
+
stops: import_editor_props37.gradientColorStopPropTypeUtil.create(
|
|
5643
5796
|
newValue.stops.map(
|
|
5644
|
-
({ color, offset }) =>
|
|
5645
|
-
color:
|
|
5646
|
-
offset:
|
|
5797
|
+
({ color, offset }) => import_editor_props37.colorStopPropTypeUtil.create({
|
|
5798
|
+
color: import_editor_props37.colorPropTypeUtil.create(color),
|
|
5799
|
+
offset: import_editor_props37.numberPropTypeUtil.create(offset)
|
|
5647
5800
|
})
|
|
5648
5801
|
)
|
|
5649
5802
|
)
|
|
@@ -5656,9 +5809,9 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
5656
5809
|
return {
|
|
5657
5810
|
type: type.value,
|
|
5658
5811
|
angle: angle?.value || 0,
|
|
5659
|
-
stops: stops.value.map(({ value: { color, offset } }) => ({
|
|
5812
|
+
stops: stops.value.map(({ value: { color, offset } }, index, arr) => ({
|
|
5660
5813
|
color: color.value,
|
|
5661
|
-
offset: offset.
|
|
5814
|
+
offset: offset?.value ?? (arr.length > 1 ? index / (arr.length - 1) * 100 : 0)
|
|
5662
5815
|
})),
|
|
5663
5816
|
positions: positions?.value.split(" ")
|
|
5664
5817
|
};
|
|
@@ -5672,17 +5825,17 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
5672
5825
|
}
|
|
5673
5826
|
);
|
|
5674
5827
|
});
|
|
5675
|
-
var initialBackgroundGradientOverlay =
|
|
5676
|
-
type:
|
|
5677
|
-
angle:
|
|
5678
|
-
stops:
|
|
5679
|
-
|
|
5680
|
-
color:
|
|
5681
|
-
offset:
|
|
5828
|
+
var initialBackgroundGradientOverlay = import_editor_props37.backgroundGradientOverlayPropTypeUtil.create({
|
|
5829
|
+
type: import_editor_props37.stringPropTypeUtil.create("linear"),
|
|
5830
|
+
angle: import_editor_props37.numberPropTypeUtil.create(180),
|
|
5831
|
+
stops: import_editor_props37.gradientColorStopPropTypeUtil.create([
|
|
5832
|
+
import_editor_props37.colorStopPropTypeUtil.create({
|
|
5833
|
+
color: import_editor_props37.colorPropTypeUtil.create("rgb(0,0,0)"),
|
|
5834
|
+
offset: import_editor_props37.numberPropTypeUtil.create(0)
|
|
5682
5835
|
}),
|
|
5683
|
-
|
|
5684
|
-
color:
|
|
5685
|
-
offset:
|
|
5836
|
+
import_editor_props37.colorStopPropTypeUtil.create({
|
|
5837
|
+
color: import_editor_props37.colorPropTypeUtil.create("rgb(255,255,255)"),
|
|
5838
|
+
offset: import_editor_props37.numberPropTypeUtil.create(100)
|
|
5686
5839
|
})
|
|
5687
5840
|
])
|
|
5688
5841
|
});
|
|
@@ -5713,7 +5866,7 @@ var BackgroundImageOverlayAttachment = () => {
|
|
|
5713
5866
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
5714
5867
|
var React85 = __toESM(require("react"));
|
|
5715
5868
|
var import_react50 = require("react");
|
|
5716
|
-
var
|
|
5869
|
+
var import_editor_props38 = require("@elementor/editor-props");
|
|
5717
5870
|
var import_editor_ui11 = require("@elementor/editor-ui");
|
|
5718
5871
|
var import_icons24 = require("@elementor/icons");
|
|
5719
5872
|
var import_ui68 = require("@elementor/ui");
|
|
@@ -5731,8 +5884,8 @@ var backgroundPositionOptions = [
|
|
|
5731
5884
|
{ label: (0, import_i18n35.__)("Custom", "elementor"), value: "custom" }
|
|
5732
5885
|
];
|
|
5733
5886
|
var BackgroundImageOverlayPosition = () => {
|
|
5734
|
-
const backgroundImageOffsetContext = useBoundProp(
|
|
5735
|
-
const stringPropContext = useBoundProp(
|
|
5887
|
+
const backgroundImageOffsetContext = useBoundProp(import_editor_props38.backgroundImagePositionOffsetPropTypeUtil);
|
|
5888
|
+
const stringPropContext = useBoundProp(import_editor_props38.stringPropTypeUtil);
|
|
5736
5889
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
5737
5890
|
const rowRef = (0, import_react50.useRef)(null);
|
|
5738
5891
|
const handlePositionChange = (event) => {
|
|
@@ -5808,7 +5961,7 @@ var BackgroundImageOverlayRepeat = () => {
|
|
|
5808
5961
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
5809
5962
|
var React87 = __toESM(require("react"));
|
|
5810
5963
|
var import_react51 = require("react");
|
|
5811
|
-
var
|
|
5964
|
+
var import_editor_props39 = require("@elementor/editor-props");
|
|
5812
5965
|
var import_icons26 = require("@elementor/icons");
|
|
5813
5966
|
var import_ui70 = require("@elementor/ui");
|
|
5814
5967
|
var import_i18n37 = require("@wordpress/i18n");
|
|
@@ -5839,8 +5992,8 @@ var sizeControlOptions = [
|
|
|
5839
5992
|
}
|
|
5840
5993
|
];
|
|
5841
5994
|
var BackgroundImageOverlaySize = () => {
|
|
5842
|
-
const backgroundImageScaleContext = useBoundProp(
|
|
5843
|
-
const stringPropContext = useBoundProp(
|
|
5995
|
+
const backgroundImageScaleContext = useBoundProp(import_editor_props39.backgroundImageSizeScalePropTypeUtil);
|
|
5996
|
+
const stringPropContext = useBoundProp(import_editor_props39.stringPropTypeUtil);
|
|
5844
5997
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
5845
5998
|
const rowRef = (0, import_react51.useRef)(null);
|
|
5846
5999
|
const handleSizeChange = (size) => {
|
|
@@ -5878,16 +6031,16 @@ var BackgroundImageOverlaySize = () => {
|
|
|
5878
6031
|
|
|
5879
6032
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
5880
6033
|
var import_react52 = require("react");
|
|
5881
|
-
var
|
|
6034
|
+
var import_editor_props40 = require("@elementor/editor-props");
|
|
5882
6035
|
var import_ui71 = require("@elementor/ui");
|
|
5883
6036
|
var useBackgroundTabsHistory = ({
|
|
5884
6037
|
color: initialBackgroundColorOverlay2,
|
|
5885
6038
|
image: initialBackgroundImageOverlay,
|
|
5886
6039
|
gradient: initialBackgroundGradientOverlay2
|
|
5887
6040
|
}) => {
|
|
5888
|
-
const { value: imageValue, setValue: setImageValue } = useBoundProp(
|
|
5889
|
-
const { value: colorValue, setValue: setColorValue } = useBoundProp(
|
|
5890
|
-
const { value: gradientValue, setValue: setGradientValue } = useBoundProp(
|
|
6041
|
+
const { value: imageValue, setValue: setImageValue } = useBoundProp(import_editor_props40.backgroundImageOverlayPropTypeUtil);
|
|
6042
|
+
const { value: colorValue, setValue: setColorValue } = useBoundProp(import_editor_props40.backgroundColorOverlayPropTypeUtil);
|
|
6043
|
+
const { value: gradientValue, setValue: setGradientValue } = useBoundProp(import_editor_props40.backgroundGradientOverlayPropTypeUtil);
|
|
5891
6044
|
const getCurrentOverlayType = () => {
|
|
5892
6045
|
if (colorValue) {
|
|
5893
6046
|
return "color";
|
|
@@ -5936,9 +6089,9 @@ var useBackgroundTabsHistory = ({
|
|
|
5936
6089
|
|
|
5937
6090
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
5938
6091
|
var DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR = "#00000033";
|
|
5939
|
-
var initialBackgroundColorOverlay =
|
|
6092
|
+
var initialBackgroundColorOverlay = import_editor_props41.backgroundColorOverlayPropTypeUtil.create(
|
|
5940
6093
|
{
|
|
5941
|
-
color:
|
|
6094
|
+
color: import_editor_props41.colorPropTypeUtil.create(DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR)
|
|
5942
6095
|
}
|
|
5943
6096
|
);
|
|
5944
6097
|
var getInitialBackgroundOverlay = () => ({
|
|
@@ -5972,12 +6125,12 @@ var backgroundResolutionOptions = [
|
|
|
5972
6125
|
{ label: (0, import_i18n38.__)("Full", "elementor"), value: "full" }
|
|
5973
6126
|
];
|
|
5974
6127
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
5975
|
-
const { propType, value: overlayValues, setValue } = useBoundProp(
|
|
6128
|
+
const { propType, value: overlayValues, setValue } = useBoundProp(import_editor_props41.backgroundOverlayPropTypeUtil);
|
|
5976
6129
|
return /* @__PURE__ */ React88.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React88.createElement(
|
|
5977
6130
|
ControlRepeater,
|
|
5978
6131
|
{
|
|
5979
6132
|
initial: getInitialBackgroundOverlay(),
|
|
5980
|
-
propTypeUtil:
|
|
6133
|
+
propTypeUtil: import_editor_props41.backgroundOverlayPropTypeUtil
|
|
5981
6134
|
},
|
|
5982
6135
|
/* @__PURE__ */ React88.createElement(RepeaterHeader, { label: (0, import_i18n38.__)("Overlay", "elementor") }, /* @__PURE__ */ React88.createElement(TooltipAddItemAction, { newItemIndex: 0 })),
|
|
5983
6136
|
/* @__PURE__ */ React88.createElement(ItemsContainer, null, /* @__PURE__ */ React88.createElement(
|
|
@@ -6079,11 +6232,11 @@ var ItemLabelGradient = ({ value }) => {
|
|
|
6079
6232
|
return /* @__PURE__ */ React88.createElement("span", null, (0, import_i18n38.__)("Radial Gradient", "elementor"));
|
|
6080
6233
|
};
|
|
6081
6234
|
var ColorOverlayContent = ({ anchorEl }) => {
|
|
6082
|
-
const propContext = useBoundProp(
|
|
6235
|
+
const propContext = useBoundProp(import_editor_props41.backgroundColorOverlayPropTypeUtil);
|
|
6083
6236
|
return /* @__PURE__ */ React88.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React88.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React88.createElement(ColorControl, { anchorEl })));
|
|
6084
6237
|
};
|
|
6085
6238
|
var ImageOverlayContent = () => {
|
|
6086
|
-
const propContext = useBoundProp(
|
|
6239
|
+
const propContext = useBoundProp(import_editor_props41.backgroundImageOverlayPropTypeUtil);
|
|
6087
6240
|
return /* @__PURE__ */ React88.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React88.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React88.createElement(ImageControl, { sizes: backgroundResolutionOptions })), /* @__PURE__ */ React88.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React88.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React88.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React88.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React88.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React88.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React88.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React88.createElement(BackgroundImageOverlayAttachment, null)));
|
|
6088
6241
|
};
|
|
6089
6242
|
var StyledUnstableColorIndicator3 = (0, import_ui72.styled)(import_ui72.UnstableColorIndicator)(({ theme }) => ({
|
|
@@ -6114,7 +6267,9 @@ var getFileExtensionFromFilename = (filename) => {
|
|
|
6114
6267
|
};
|
|
6115
6268
|
var getGradientValue = (value) => {
|
|
6116
6269
|
const gradient = value.value;
|
|
6117
|
-
const stops = gradient.stops.value?.map(
|
|
6270
|
+
const stops = gradient.stops.value?.map(
|
|
6271
|
+
({ value: { color, offset } }) => offset ? `${color.value} ${offset.value ?? 0}%` : `${color.value}`
|
|
6272
|
+
)?.join(",");
|
|
6118
6273
|
if (gradient.type.value === "linear") {
|
|
6119
6274
|
return `linear-gradient(${gradient.angle.value}deg, ${stops})`;
|
|
6120
6275
|
}
|
|
@@ -6131,7 +6286,7 @@ var clipOptions = [
|
|
|
6131
6286
|
var colorLabel = (0, import_i18n39.__)("Color", "elementor");
|
|
6132
6287
|
var clipLabel = (0, import_i18n39.__)("Clipping", "elementor");
|
|
6133
6288
|
var BackgroundControl = createControl(() => {
|
|
6134
|
-
const propContext = useBoundProp(
|
|
6289
|
+
const propContext = useBoundProp(import_editor_props42.backgroundPropTypeUtil);
|
|
6135
6290
|
return /* @__PURE__ */ React89.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React89.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React89.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React89.createElement(BackgroundColorField, null), /* @__PURE__ */ React89.createElement(BackgroundClipField, null));
|
|
6136
6291
|
});
|
|
6137
6292
|
var BackgroundColorField = () => {
|
|
@@ -6144,7 +6299,7 @@ var BackgroundClipField = () => {
|
|
|
6144
6299
|
// src/controls/repeatable-control.tsx
|
|
6145
6300
|
var React90 = __toESM(require("react"));
|
|
6146
6301
|
var import_react53 = require("react");
|
|
6147
|
-
var
|
|
6302
|
+
var import_editor_props43 = require("@elementor/editor-props");
|
|
6148
6303
|
var import_ui74 = require("@elementor/ui");
|
|
6149
6304
|
var PLACEHOLDER_REGEX = /\$\{([^}]+)\}/g;
|
|
6150
6305
|
var RepeatableControl = createControl(
|
|
@@ -6165,7 +6320,7 @@ var RepeatableControl = createControl(
|
|
|
6165
6320
|
return null;
|
|
6166
6321
|
}
|
|
6167
6322
|
const childArrayPropTypeUtil2 = (0, import_react53.useMemo)(
|
|
6168
|
-
() => (0,
|
|
6323
|
+
() => (0, import_editor_props43.createArrayPropUtils)(childPropTypeUtil.key, childPropTypeUtil.schema, propKey),
|
|
6169
6324
|
[childPropTypeUtil.key, childPropTypeUtil.schema, propKey]
|
|
6170
6325
|
);
|
|
6171
6326
|
const contextValue = (0, import_react53.useMemo)(
|
|
@@ -6301,7 +6456,7 @@ var getAllProperties = (pattern) => {
|
|
|
6301
6456
|
// src/controls/key-value-control.tsx
|
|
6302
6457
|
var React91 = __toESM(require("react"));
|
|
6303
6458
|
var import_react54 = require("react");
|
|
6304
|
-
var
|
|
6459
|
+
var import_editor_props44 = require("@elementor/editor-props");
|
|
6305
6460
|
var import_ui75 = require("@elementor/ui");
|
|
6306
6461
|
var import_i18n40 = require("@wordpress/i18n");
|
|
6307
6462
|
|
|
@@ -6326,7 +6481,7 @@ var getInitialFieldValue = (fieldValue) => {
|
|
|
6326
6481
|
return transformableValue.value || "";
|
|
6327
6482
|
};
|
|
6328
6483
|
var KeyValueControl = createControl((props = {}) => {
|
|
6329
|
-
const { value, setValue, ...propContext } = useBoundProp(
|
|
6484
|
+
const { value, setValue, ...propContext } = useBoundProp(import_editor_props44.keyValuePropTypeUtil);
|
|
6330
6485
|
const [keyError, setKeyError] = (0, import_react54.useState)("");
|
|
6331
6486
|
const [valueError, setValueError] = (0, import_react54.useState)("");
|
|
6332
6487
|
const [sessionState, setSessionState] = (0, import_react54.useState)({
|
|
@@ -6365,14 +6520,14 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
6365
6520
|
return;
|
|
6366
6521
|
}
|
|
6367
6522
|
const newChangedValue = newValue[fieldType];
|
|
6368
|
-
if ((0,
|
|
6523
|
+
if ((0, import_editor_props44.isTransformable)(newChangedValue) && newChangedValue.$$type === "dynamic") {
|
|
6369
6524
|
setValue({
|
|
6370
6525
|
...value,
|
|
6371
6526
|
[fieldType]: newChangedValue
|
|
6372
6527
|
});
|
|
6373
6528
|
return;
|
|
6374
6529
|
}
|
|
6375
|
-
const extractedValue =
|
|
6530
|
+
const extractedValue = import_editor_props44.stringPropTypeUtil.extract(newChangedValue);
|
|
6376
6531
|
setSessionState((prev) => ({
|
|
6377
6532
|
...prev,
|
|
6378
6533
|
[fieldType]: extractedValue
|
|
@@ -6412,7 +6567,7 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
6412
6567
|
|
|
6413
6568
|
// src/controls/position-control.tsx
|
|
6414
6569
|
var React92 = __toESM(require("react"));
|
|
6415
|
-
var
|
|
6570
|
+
var import_editor_props45 = require("@elementor/editor-props");
|
|
6416
6571
|
var import_editor_ui12 = require("@elementor/editor-ui");
|
|
6417
6572
|
var import_icons27 = require("@elementor/icons");
|
|
6418
6573
|
var import_ui76 = require("@elementor/ui");
|
|
@@ -6430,8 +6585,8 @@ var positionOptions = [
|
|
|
6430
6585
|
{ label: (0, import_i18n41.__)("Custom", "elementor"), value: "custom" }
|
|
6431
6586
|
];
|
|
6432
6587
|
var PositionControl = () => {
|
|
6433
|
-
const positionContext = useBoundProp(
|
|
6434
|
-
const stringPropContext = useBoundProp(
|
|
6588
|
+
const positionContext = useBoundProp(import_editor_props45.positionPropTypeUtil);
|
|
6589
|
+
const stringPropContext = useBoundProp(import_editor_props45.stringPropTypeUtil);
|
|
6435
6590
|
const isCustom = !!positionContext.value;
|
|
6436
6591
|
const placeholder = positionContext.placeholder ? "custom" : stringPropContext.placeholder ?? null;
|
|
6437
6592
|
const handlePositionChange = (event) => {
|
|
@@ -6472,13 +6627,13 @@ var PositionControl = () => {
|
|
|
6472
6627
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
6473
6628
|
var React105 = __toESM(require("react"));
|
|
6474
6629
|
var import_react62 = require("react");
|
|
6475
|
-
var
|
|
6630
|
+
var import_editor_props54 = require("@elementor/editor-props");
|
|
6476
6631
|
var import_icons34 = require("@elementor/icons");
|
|
6477
6632
|
var import_ui89 = require("@elementor/ui");
|
|
6478
6633
|
var import_i18n51 = require("@wordpress/i18n");
|
|
6479
6634
|
|
|
6480
6635
|
// src/controls/transform-control/initial-values.ts
|
|
6481
|
-
var
|
|
6636
|
+
var import_editor_props46 = require("@elementor/editor-props");
|
|
6482
6637
|
var TransformFunctionKeys = {
|
|
6483
6638
|
move: "transform-move",
|
|
6484
6639
|
scale: "transform-scale",
|
|
@@ -6508,17 +6663,17 @@ var initialTransformValue = {
|
|
|
6508
6663
|
z: { $$type: "size", value: { size: defaultValues.move.size, unit: defaultValues.move.unit } }
|
|
6509
6664
|
}
|
|
6510
6665
|
};
|
|
6511
|
-
var initialScaleValue =
|
|
6512
|
-
x:
|
|
6513
|
-
y:
|
|
6514
|
-
z:
|
|
6666
|
+
var initialScaleValue = import_editor_props46.scaleTransformPropTypeUtil.create({
|
|
6667
|
+
x: import_editor_props46.numberPropTypeUtil.create(defaultValues.scale),
|
|
6668
|
+
y: import_editor_props46.numberPropTypeUtil.create(defaultValues.scale),
|
|
6669
|
+
z: import_editor_props46.numberPropTypeUtil.create(defaultValues.scale)
|
|
6515
6670
|
});
|
|
6516
|
-
var initialRotateValue =
|
|
6671
|
+
var initialRotateValue = import_editor_props46.rotateTransformPropTypeUtil.create({
|
|
6517
6672
|
x: { $$type: "size", value: { size: defaultValues.rotate.size, unit: defaultValues.rotate.unit } },
|
|
6518
6673
|
y: { $$type: "size", value: { size: defaultValues.rotate.size, unit: defaultValues.rotate.unit } },
|
|
6519
6674
|
z: { $$type: "size", value: { size: defaultValues.rotate.size, unit: defaultValues.rotate.unit } }
|
|
6520
6675
|
});
|
|
6521
|
-
var initialSkewValue =
|
|
6676
|
+
var initialSkewValue = import_editor_props46.skewTransformPropTypeUtil.create({
|
|
6522
6677
|
x: { $$type: "size", value: { size: defaultValues.skew.size, unit: defaultValues.skew.unit } },
|
|
6523
6678
|
y: { $$type: "size", value: { size: defaultValues.skew.size, unit: defaultValues.skew.unit } }
|
|
6524
6679
|
});
|
|
@@ -6531,7 +6686,7 @@ var import_i18n46 = require("@wordpress/i18n");
|
|
|
6531
6686
|
// src/controls/transform-control/functions/move.tsx
|
|
6532
6687
|
var React94 = __toESM(require("react"));
|
|
6533
6688
|
var import_react55 = require("react");
|
|
6534
|
-
var
|
|
6689
|
+
var import_editor_props47 = require("@elementor/editor-props");
|
|
6535
6690
|
var import_icons28 = require("@elementor/icons");
|
|
6536
6691
|
var import_ui78 = require("@elementor/ui");
|
|
6537
6692
|
var import_i18n42 = require("@wordpress/i18n");
|
|
@@ -6576,7 +6731,7 @@ var moveAxisControls = [
|
|
|
6576
6731
|
}
|
|
6577
6732
|
];
|
|
6578
6733
|
var Move = () => {
|
|
6579
|
-
const context = useBoundProp(
|
|
6734
|
+
const context = useBoundProp(import_editor_props47.moveTransformPropTypeUtil);
|
|
6580
6735
|
const rowRefs = [(0, import_react55.useRef)(null), (0, import_react55.useRef)(null), (0, import_react55.useRef)(null)];
|
|
6581
6736
|
return /* @__PURE__ */ React94.createElement(import_ui78.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React94.createElement(PropProvider, { ...context }, /* @__PURE__ */ React94.createElement(PropKeyProvider, { bind: TransformFunctionKeys.move }, moveAxisControls.map((control, index) => /* @__PURE__ */ React94.createElement(
|
|
6582
6737
|
AxisRow,
|
|
@@ -6593,7 +6748,7 @@ var Move = () => {
|
|
|
6593
6748
|
// src/controls/transform-control/functions/rotate.tsx
|
|
6594
6749
|
var React95 = __toESM(require("react"));
|
|
6595
6750
|
var import_react56 = require("react");
|
|
6596
|
-
var
|
|
6751
|
+
var import_editor_props48 = require("@elementor/editor-props");
|
|
6597
6752
|
var import_icons29 = require("@elementor/icons");
|
|
6598
6753
|
var import_ui79 = require("@elementor/ui");
|
|
6599
6754
|
var import_i18n43 = require("@wordpress/i18n");
|
|
@@ -6616,7 +6771,7 @@ var rotateAxisControls = [
|
|
|
6616
6771
|
];
|
|
6617
6772
|
var rotateUnits = ["deg", "rad", "grad", "turn"];
|
|
6618
6773
|
var Rotate = () => {
|
|
6619
|
-
const context = useBoundProp(
|
|
6774
|
+
const context = useBoundProp(import_editor_props48.rotateTransformPropTypeUtil);
|
|
6620
6775
|
const rowRefs = [(0, import_react56.useRef)(null), (0, import_react56.useRef)(null), (0, import_react56.useRef)(null)];
|
|
6621
6776
|
return /* @__PURE__ */ React95.createElement(import_ui79.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React95.createElement(PropProvider, { ...context }, /* @__PURE__ */ React95.createElement(PropKeyProvider, { bind: TransformFunctionKeys.rotate }, rotateAxisControls.map((control, index) => /* @__PURE__ */ React95.createElement(
|
|
6622
6777
|
AxisRow,
|
|
@@ -6632,7 +6787,7 @@ var Rotate = () => {
|
|
|
6632
6787
|
// src/controls/transform-control/functions/scale.tsx
|
|
6633
6788
|
var React97 = __toESM(require("react"));
|
|
6634
6789
|
var import_react57 = require("react");
|
|
6635
|
-
var
|
|
6790
|
+
var import_editor_props49 = require("@elementor/editor-props");
|
|
6636
6791
|
var import_icons30 = require("@elementor/icons");
|
|
6637
6792
|
var import_ui81 = require("@elementor/ui");
|
|
6638
6793
|
var import_i18n44 = require("@wordpress/i18n");
|
|
@@ -6663,7 +6818,7 @@ var scaleAxisControls = [
|
|
|
6663
6818
|
}
|
|
6664
6819
|
];
|
|
6665
6820
|
var Scale = () => {
|
|
6666
|
-
const context = useBoundProp(
|
|
6821
|
+
const context = useBoundProp(import_editor_props49.scaleTransformPropTypeUtil);
|
|
6667
6822
|
const rowRefs = [(0, import_react57.useRef)(null), (0, import_react57.useRef)(null), (0, import_react57.useRef)(null)];
|
|
6668
6823
|
return /* @__PURE__ */ React97.createElement(import_ui81.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React97.createElement(PropProvider, { ...context }, /* @__PURE__ */ React97.createElement(PropKeyProvider, { bind: TransformFunctionKeys.scale }, scaleAxisControls.map((control, index) => /* @__PURE__ */ React97.createElement(ScaleAxisRow, { key: control.bind, ...control, anchorRef: rowRefs[index] })))));
|
|
6669
6824
|
};
|
|
@@ -6671,7 +6826,7 @@ var Scale = () => {
|
|
|
6671
6826
|
// src/controls/transform-control/functions/skew.tsx
|
|
6672
6827
|
var React98 = __toESM(require("react"));
|
|
6673
6828
|
var import_react58 = require("react");
|
|
6674
|
-
var
|
|
6829
|
+
var import_editor_props50 = require("@elementor/editor-props");
|
|
6675
6830
|
var import_icons31 = require("@elementor/icons");
|
|
6676
6831
|
var import_ui82 = require("@elementor/ui");
|
|
6677
6832
|
var import_i18n45 = require("@wordpress/i18n");
|
|
@@ -6689,7 +6844,7 @@ var skewAxisControls = [
|
|
|
6689
6844
|
];
|
|
6690
6845
|
var skewUnits = ["deg", "rad", "grad", "turn"];
|
|
6691
6846
|
var Skew = () => {
|
|
6692
|
-
const context = useBoundProp(
|
|
6847
|
+
const context = useBoundProp(import_editor_props50.skewTransformPropTypeUtil);
|
|
6693
6848
|
const rowRefs = [(0, import_react58.useRef)(null), (0, import_react58.useRef)(null), (0, import_react58.useRef)(null)];
|
|
6694
6849
|
return /* @__PURE__ */ React98.createElement(import_ui82.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React98.createElement(PropProvider, { ...context }, /* @__PURE__ */ React98.createElement(PropKeyProvider, { bind: TransformFunctionKeys.skew }, skewAxisControls.map((control, index) => /* @__PURE__ */ React98.createElement(
|
|
6695
6850
|
AxisRow,
|
|
@@ -6704,7 +6859,7 @@ var Skew = () => {
|
|
|
6704
6859
|
|
|
6705
6860
|
// src/controls/transform-control/use-transform-tabs-history.tsx
|
|
6706
6861
|
var import_react59 = require("react");
|
|
6707
|
-
var
|
|
6862
|
+
var import_editor_props51 = require("@elementor/editor-props");
|
|
6708
6863
|
var import_ui83 = require("@elementor/ui");
|
|
6709
6864
|
var useTransformTabsHistory = ({
|
|
6710
6865
|
move: initialMove,
|
|
@@ -6712,10 +6867,10 @@ var useTransformTabsHistory = ({
|
|
|
6712
6867
|
rotate: initialRotate,
|
|
6713
6868
|
skew: initialSkew
|
|
6714
6869
|
}) => {
|
|
6715
|
-
const { value: moveValue, setValue: setMoveValue } = useBoundProp(
|
|
6716
|
-
const { value: scaleValue, setValue: setScaleValue } = useBoundProp(
|
|
6717
|
-
const { value: rotateValue, setValue: setRotateValue } = useBoundProp(
|
|
6718
|
-
const { value: skewValue, setValue: setSkewValue } = useBoundProp(
|
|
6870
|
+
const { value: moveValue, setValue: setMoveValue } = useBoundProp(import_editor_props51.moveTransformPropTypeUtil);
|
|
6871
|
+
const { value: scaleValue, setValue: setScaleValue } = useBoundProp(import_editor_props51.scaleTransformPropTypeUtil);
|
|
6872
|
+
const { value: rotateValue, setValue: setRotateValue } = useBoundProp(import_editor_props51.rotateTransformPropTypeUtil);
|
|
6873
|
+
const { value: skewValue, setValue: setSkewValue } = useBoundProp(import_editor_props51.skewTransformPropTypeUtil);
|
|
6719
6874
|
const { openItemIndex, items: items2 } = useRepeaterContext();
|
|
6720
6875
|
const getCurrentTransformType = () => {
|
|
6721
6876
|
switch (true) {
|
|
@@ -6875,7 +7030,7 @@ var import_i18n50 = require("@wordpress/i18n");
|
|
|
6875
7030
|
// src/controls/transform-control/transform-base-controls/children-perspective-control.tsx
|
|
6876
7031
|
var React102 = __toESM(require("react"));
|
|
6877
7032
|
var import_react60 = require("react");
|
|
6878
|
-
var
|
|
7033
|
+
var import_editor_props52 = require("@elementor/editor-props");
|
|
6879
7034
|
var import_ui86 = require("@elementor/ui");
|
|
6880
7035
|
var import_i18n48 = require("@wordpress/i18n");
|
|
6881
7036
|
var ORIGIN_UNITS = ["px", "%", "em", "rem"];
|
|
@@ -6902,7 +7057,7 @@ var ChildrenPerspectiveControl = () => {
|
|
|
6902
7057
|
var PerspectiveControl = () => /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: "perspective" }, /* @__PURE__ */ React102.createElement(ControlFields, { control: PERSPECTIVE_CONTROL_FIELD, key: PERSPECTIVE_CONTROL_FIELD.bind }));
|
|
6903
7058
|
var PerspectiveOriginControl = () => /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: "perspective-origin" }, /* @__PURE__ */ React102.createElement(PerspectiveOriginControlProvider, null));
|
|
6904
7059
|
var PerspectiveOriginControlProvider = () => {
|
|
6905
|
-
const context = useBoundProp(
|
|
7060
|
+
const context = useBoundProp(import_editor_props52.perspectiveOriginPropTypeUtil);
|
|
6906
7061
|
return /* @__PURE__ */ React102.createElement(PropProvider, { ...context }, CHILDREN_PERSPECTIVE_FIELDS.map((control) => /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: control.bind, key: control.bind }, /* @__PURE__ */ React102.createElement(ControlFields, { control }))));
|
|
6907
7062
|
};
|
|
6908
7063
|
var ControlFields = ({ control }) => {
|
|
@@ -6913,7 +7068,7 @@ var ControlFields = ({ control }) => {
|
|
|
6913
7068
|
// src/controls/transform-control/transform-base-controls/transform-origin-control.tsx
|
|
6914
7069
|
var React103 = __toESM(require("react"));
|
|
6915
7070
|
var import_react61 = require("react");
|
|
6916
|
-
var
|
|
7071
|
+
var import_editor_props53 = require("@elementor/editor-props");
|
|
6917
7072
|
var import_ui87 = require("@elementor/ui");
|
|
6918
7073
|
var import_i18n49 = require("@wordpress/i18n");
|
|
6919
7074
|
var TRANSFORM_ORIGIN_UNITS = ["px", "%", "em", "rem"];
|
|
@@ -6939,7 +7094,7 @@ var TransformOriginControl = () => {
|
|
|
6939
7094
|
return /* @__PURE__ */ React103.createElement(import_ui87.Stack, { direction: "column", spacing: 1.5 }, /* @__PURE__ */ React103.createElement(ControlFormLabel, null, (0, import_i18n49.__)("Transform", "elementor")), TRANSFORM_ORIGIN_FIELDS.map((control) => /* @__PURE__ */ React103.createElement(ControlFields2, { control, key: control.bind })));
|
|
6940
7095
|
};
|
|
6941
7096
|
var ControlFields2 = ({ control }) => {
|
|
6942
|
-
const context = useBoundProp(
|
|
7097
|
+
const context = useBoundProp(import_editor_props53.transformOriginPropTypeUtil);
|
|
6943
7098
|
const rowRef = (0, import_react61.useRef)(null);
|
|
6944
7099
|
return /* @__PURE__ */ React103.createElement(PropProvider, { ...context }, /* @__PURE__ */ React103.createElement(PropKeyProvider, { bind: control.bind }, /* @__PURE__ */ React103.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React103.createElement(import_ui87.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React103.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ React103.createElement(import_ui87.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React103.createElement(SizeControl, { variant: "length", units: control.units, anchorRef: rowRef })))));
|
|
6945
7100
|
};
|
|
@@ -6987,7 +7142,7 @@ var TransformSettingsControl = ({
|
|
|
6987
7142
|
var SIZE11 = "tiny";
|
|
6988
7143
|
var TransformRepeaterControl = createControl(
|
|
6989
7144
|
({ showChildrenPerspective }) => {
|
|
6990
|
-
const context = useBoundProp(
|
|
7145
|
+
const context = useBoundProp(import_editor_props54.transformPropTypeUtil);
|
|
6991
7146
|
const headerRef = (0, import_react62.useRef)(null);
|
|
6992
7147
|
const popupState = (0, import_ui89.usePopupState)({ variant: "popover" });
|
|
6993
7148
|
return /* @__PURE__ */ React105.createElement(PropProvider, { ...context }, /* @__PURE__ */ React105.createElement(
|
|
@@ -7015,7 +7170,7 @@ var Repeater2 = ({
|
|
|
7015
7170
|
propType,
|
|
7016
7171
|
popupState
|
|
7017
7172
|
}) => {
|
|
7018
|
-
const transformFunctionsContext = useBoundProp(
|
|
7173
|
+
const transformFunctionsContext = useBoundProp(import_editor_props54.transformFunctionsPropTypeUtil);
|
|
7019
7174
|
const availableValues = [initialTransformValue, initialScaleValue, initialRotateValue, initialSkewValue];
|
|
7020
7175
|
const { value: transformValues, bind } = transformFunctionsContext;
|
|
7021
7176
|
const getInitialValue2 = () => {
|
|
@@ -7026,7 +7181,7 @@ var Repeater2 = ({
|
|
|
7026
7181
|
ControlRepeater,
|
|
7027
7182
|
{
|
|
7028
7183
|
initial: getInitialValue2() ?? initialTransformValue,
|
|
7029
|
-
propTypeUtil:
|
|
7184
|
+
propTypeUtil: import_editor_props54.transformFunctionsPropTypeUtil
|
|
7030
7185
|
},
|
|
7031
7186
|
/* @__PURE__ */ React105.createElement(
|
|
7032
7187
|
RepeaterHeader,
|
|
@@ -7069,7 +7224,7 @@ var TransformBasePopoverTrigger = ({
|
|
|
7069
7224
|
// src/controls/transition-control/transition-repeater-control.tsx
|
|
7070
7225
|
var React108 = __toESM(require("react"));
|
|
7071
7226
|
var import_react65 = require("react");
|
|
7072
|
-
var
|
|
7227
|
+
var import_editor_props57 = require("@elementor/editor-props");
|
|
7073
7228
|
var import_icons36 = require("@elementor/icons");
|
|
7074
7229
|
var import_ui92 = require("@elementor/ui");
|
|
7075
7230
|
var import_utils7 = require("@elementor/utils");
|
|
@@ -7078,11 +7233,11 @@ var import_i18n54 = require("@wordpress/i18n");
|
|
|
7078
7233
|
// src/controls/selection-size-control.tsx
|
|
7079
7234
|
var React106 = __toESM(require("react"));
|
|
7080
7235
|
var import_react63 = require("react");
|
|
7081
|
-
var
|
|
7236
|
+
var import_editor_props55 = require("@elementor/editor-props");
|
|
7082
7237
|
var import_ui90 = require("@elementor/ui");
|
|
7083
7238
|
var SelectionSizeControl = createControl(
|
|
7084
7239
|
({ selectionLabel, sizeLabel, selectionConfig, sizeConfigMap }) => {
|
|
7085
|
-
const { value, setValue, propType } = useBoundProp(
|
|
7240
|
+
const { value, setValue, propType } = useBoundProp(import_editor_props55.selectionSizePropTypeUtil);
|
|
7086
7241
|
const rowRef = (0, import_react63.useRef)(null);
|
|
7087
7242
|
const sizeFieldId = sizeLabel.replace(/\s+/g, "-").toLowerCase();
|
|
7088
7243
|
const currentSizeConfig = (0, import_react63.useMemo)(() => {
|
|
@@ -7299,7 +7454,7 @@ function subscribeToTransitionEvent() {
|
|
|
7299
7454
|
// src/controls/transition-control/transition-selector.tsx
|
|
7300
7455
|
var React107 = __toESM(require("react"));
|
|
7301
7456
|
var import_react64 = require("react");
|
|
7302
|
-
var
|
|
7457
|
+
var import_editor_props56 = require("@elementor/editor-props");
|
|
7303
7458
|
var import_editor_ui14 = require("@elementor/editor-ui");
|
|
7304
7459
|
var import_icons35 = require("@elementor/icons");
|
|
7305
7460
|
var import_ui91 = require("@elementor/ui");
|
|
@@ -7380,7 +7535,7 @@ var TransitionSelector = ({
|
|
|
7380
7535
|
disabledItems = [],
|
|
7381
7536
|
showPromotion = false
|
|
7382
7537
|
}) => {
|
|
7383
|
-
const { value, setValue } = useBoundProp(
|
|
7538
|
+
const { value, setValue } = useBoundProp(import_editor_props56.keyValuePropTypeUtil);
|
|
7384
7539
|
const {
|
|
7385
7540
|
key: { value: transitionLabel }
|
|
7386
7541
|
} = value;
|
|
@@ -7499,9 +7654,9 @@ var DURATION_CONFIG = {
|
|
|
7499
7654
|
units: ["s", "ms"],
|
|
7500
7655
|
defaultUnit: "ms"
|
|
7501
7656
|
};
|
|
7502
|
-
var childArrayPropTypeUtil = (0,
|
|
7503
|
-
|
|
7504
|
-
|
|
7657
|
+
var childArrayPropTypeUtil = (0, import_editor_props57.createArrayPropUtils)(
|
|
7658
|
+
import_editor_props57.selectionSizePropTypeUtil.key,
|
|
7659
|
+
import_editor_props57.selectionSizePropTypeUtil.schema,
|
|
7505
7660
|
"transition"
|
|
7506
7661
|
);
|
|
7507
7662
|
subscribeToTransitionEvent();
|
|
@@ -7545,7 +7700,7 @@ var isItemDisabled = (item) => {
|
|
|
7545
7700
|
};
|
|
7546
7701
|
var getChildControlConfig = (recentlyUsedList, disabledItems, showPromotion) => {
|
|
7547
7702
|
return {
|
|
7548
|
-
propTypeUtil:
|
|
7703
|
+
propTypeUtil: import_editor_props57.selectionSizePropTypeUtil,
|
|
7549
7704
|
component: SelectionSizeControl,
|
|
7550
7705
|
props: getSelectionSizeProps(recentlyUsedList, disabledItems, showPromotion),
|
|
7551
7706
|
isItemDisabled
|
|
@@ -7676,17 +7831,17 @@ var TransitionRepeaterControl = createControl(
|
|
|
7676
7831
|
// src/controls/date-time-control.tsx
|
|
7677
7832
|
var React109 = __toESM(require("react"));
|
|
7678
7833
|
var dayjs = __toESM(require("dayjs"));
|
|
7679
|
-
var import_editor_props57 = require("@elementor/editor-props");
|
|
7680
7834
|
var import_editor_props58 = require("@elementor/editor-props");
|
|
7835
|
+
var import_editor_props59 = require("@elementor/editor-props");
|
|
7681
7836
|
var import_ui93 = require("@elementor/ui");
|
|
7682
7837
|
var DATE_FORMAT = "YYYY-MM-DD";
|
|
7683
7838
|
var TIME_FORMAT = "HH:mm";
|
|
7684
7839
|
var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
7685
|
-
const { value, setValue, ...propContext } = useBoundProp(
|
|
7840
|
+
const { value, setValue, ...propContext } = useBoundProp(import_editor_props59.DateTimePropTypeUtil);
|
|
7686
7841
|
const handleChange = (newValue, meta) => {
|
|
7687
7842
|
const field = meta.bind;
|
|
7688
7843
|
const fieldValue = newValue[field];
|
|
7689
|
-
if ((0,
|
|
7844
|
+
if ((0, import_editor_props58.isTransformable)(fieldValue)) {
|
|
7690
7845
|
return setValue({ ...value, [field]: fieldValue });
|
|
7691
7846
|
}
|
|
7692
7847
|
let formattedValue = "";
|
|
@@ -7725,7 +7880,7 @@ var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
|
7725
7880
|
return /* @__PURE__ */ React109.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React109.createElement(ControlActions, null, /* @__PURE__ */ React109.createElement(import_ui93.LocalizationProvider, null, /* @__PURE__ */ React109.createElement(import_ui93.Box, { display: "flex", gap: 1, alignItems: "center" }, /* @__PURE__ */ React109.createElement(PropKeyProvider, { bind: "date" }, /* @__PURE__ */ React109.createElement(
|
|
7726
7881
|
import_ui93.DatePicker,
|
|
7727
7882
|
{
|
|
7728
|
-
value: parseDateValue(
|
|
7883
|
+
value: parseDateValue(import_editor_props58.stringPropTypeUtil.extract(value?.date)),
|
|
7729
7884
|
onChange: (v) => handleChange({ date: v }, { bind: "date" }),
|
|
7730
7885
|
disabled: inputDisabled,
|
|
7731
7886
|
slotProps: {
|
|
@@ -7737,7 +7892,7 @@ var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
|
7737
7892
|
)), /* @__PURE__ */ React109.createElement(PropKeyProvider, { bind: "time" }, /* @__PURE__ */ React109.createElement(
|
|
7738
7893
|
import_ui93.TimePicker,
|
|
7739
7894
|
{
|
|
7740
|
-
value: parseTimeValue(
|
|
7895
|
+
value: parseTimeValue(import_editor_props58.stringPropTypeUtil.extract(value?.time)),
|
|
7741
7896
|
onChange: (v) => handleChange({ time: v }, { bind: "time" }),
|
|
7742
7897
|
disabled: inputDisabled,
|
|
7743
7898
|
slotProps: {
|
|
@@ -7751,13 +7906,13 @@ var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
|
7751
7906
|
|
|
7752
7907
|
// src/controls/date-range-control.tsx
|
|
7753
7908
|
var React111 = __toESM(require("react"));
|
|
7754
|
-
var
|
|
7909
|
+
var import_editor_props61 = require("@elementor/editor-props");
|
|
7755
7910
|
var import_ui95 = require("@elementor/ui");
|
|
7756
7911
|
var import_i18n55 = require("@wordpress/i18n");
|
|
7757
7912
|
|
|
7758
7913
|
// src/controls/date-string-control.tsx
|
|
7759
7914
|
var React110 = __toESM(require("react"));
|
|
7760
|
-
var
|
|
7915
|
+
var import_editor_props60 = require("@elementor/editor-props");
|
|
7761
7916
|
var import_ui94 = require("@elementor/ui");
|
|
7762
7917
|
|
|
7763
7918
|
// src/utils/date-time.ts
|
|
@@ -7792,7 +7947,7 @@ function parseTimeString(raw) {
|
|
|
7792
7947
|
// src/controls/date-string-control.tsx
|
|
7793
7948
|
var DateStringControl = createControl(
|
|
7794
7949
|
({ inputDisabled, ariaLabel, error, coerceInvalidToNull = false }) => {
|
|
7795
|
-
const { value, setValue, disabled } = useBoundProp(
|
|
7950
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props60.dateStringPropTypeUtil);
|
|
7796
7951
|
const isDisabled = inputDisabled ?? disabled;
|
|
7797
7952
|
const slotProps = {
|
|
7798
7953
|
textField: {
|
|
@@ -7840,9 +7995,9 @@ var isMaxBeforeMin = (minIso, maxIso) => {
|
|
|
7840
7995
|
};
|
|
7841
7996
|
var RANGE_ERROR_MESSAGE = (0, import_i18n55.__)("Max date must be on or after Min date", "elementor");
|
|
7842
7997
|
var DateRangeControl = createControl(() => {
|
|
7843
|
-
const { value, setValue, ...propContext } = useBoundProp(
|
|
7844
|
-
const minString =
|
|
7845
|
-
const maxString =
|
|
7998
|
+
const { value, setValue, ...propContext } = useBoundProp(import_editor_props61.dateRangePropTypeUtil);
|
|
7999
|
+
const minString = import_editor_props61.dateStringPropTypeUtil.extract(value?.min);
|
|
8000
|
+
const maxString = import_editor_props61.dateStringPropTypeUtil.extract(value?.max);
|
|
7846
8001
|
const hasInvalidRange = isMaxBeforeMin(minString, maxString);
|
|
7847
8002
|
return /* @__PURE__ */ React111.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React111.createElement(import_ui95.Stack, { gap: 0.75 }, /* @__PURE__ */ React111.createElement(import_ui95.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React111.createElement(import_ui95.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React111.createElement(import_ui95.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React111.createElement(ControlFormLabel, null, RANGE_LABELS.min)), /* @__PURE__ */ React111.createElement(import_ui95.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React111.createElement(
|
|
7848
8003
|
BoundDateStringControl,
|
|
@@ -7870,11 +8025,11 @@ var BoundDateStringControl = ({
|
|
|
7870
8025
|
|
|
7871
8026
|
// src/controls/time-string-control.tsx
|
|
7872
8027
|
var React112 = __toESM(require("react"));
|
|
7873
|
-
var
|
|
8028
|
+
var import_editor_props62 = require("@elementor/editor-props");
|
|
7874
8029
|
var import_ui96 = require("@elementor/ui");
|
|
7875
8030
|
var TimeStringControl = createControl(
|
|
7876
8031
|
({ inputDisabled, ariaLabel, error, coerceInvalidToNull = false }) => {
|
|
7877
|
-
const { value, setValue, disabled } = useBoundProp(
|
|
8032
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props62.timeStringPropTypeUtil);
|
|
7878
8033
|
const isDisabled = inputDisabled ?? disabled;
|
|
7879
8034
|
const slotProps = {
|
|
7880
8035
|
textField: {
|
|
@@ -7911,7 +8066,7 @@ var TimeStringControl = createControl(
|
|
|
7911
8066
|
|
|
7912
8067
|
// src/controls/time-range-control.tsx
|
|
7913
8068
|
var React113 = __toESM(require("react"));
|
|
7914
|
-
var
|
|
8069
|
+
var import_editor_props63 = require("@elementor/editor-props");
|
|
7915
8070
|
var import_ui97 = require("@elementor/ui");
|
|
7916
8071
|
var import_i18n56 = require("@wordpress/i18n");
|
|
7917
8072
|
var RANGE_LABELS2 = {
|
|
@@ -7919,7 +8074,7 @@ var RANGE_LABELS2 = {
|
|
|
7919
8074
|
max: (0, import_i18n56.__)("End time", "elementor")
|
|
7920
8075
|
};
|
|
7921
8076
|
var TimeRangeControl = createControl(() => {
|
|
7922
|
-
const { value, setValue, ...propContext } = useBoundProp(
|
|
8077
|
+
const { value, setValue, ...propContext } = useBoundProp(import_editor_props63.timeRangePropTypeUtil);
|
|
7923
8078
|
return /* @__PURE__ */ React113.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React113.createElement(import_ui97.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React113.createElement(import_ui97.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React113.createElement(import_ui97.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React113.createElement(ControlFormLabel, null, RANGE_LABELS2.min)), /* @__PURE__ */ React113.createElement(import_ui97.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React113.createElement(BoundTimeStringControl, { bind: "min", ariaLabel: RANGE_LABELS2.min }))), /* @__PURE__ */ React113.createElement(import_ui97.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React113.createElement(import_ui97.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React113.createElement(ControlFormLabel, null, RANGE_LABELS2.max)), /* @__PURE__ */ React113.createElement(import_ui97.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React113.createElement(BoundTimeStringControl, { bind: "max", ariaLabel: RANGE_LABELS2.max })))));
|
|
7924
8079
|
});
|
|
7925
8080
|
var BoundTimeStringControl = ({ bind, ariaLabel }) => {
|
|
@@ -7927,11 +8082,10 @@ var BoundTimeStringControl = ({ bind, ariaLabel }) => {
|
|
|
7927
8082
|
};
|
|
7928
8083
|
|
|
7929
8084
|
// src/controls/inline-editing-control.tsx
|
|
7930
|
-
var
|
|
7931
|
-
var
|
|
7932
|
-
var
|
|
7933
|
-
var
|
|
7934
|
-
var import_utils8 = require("@elementor/utils");
|
|
8085
|
+
var React117 = __toESM(require("react"));
|
|
8086
|
+
var import_react71 = require("react");
|
|
8087
|
+
var import_editor_props65 = require("@elementor/editor-props");
|
|
8088
|
+
var import_ui101 = require("@elementor/ui");
|
|
7935
8089
|
|
|
7936
8090
|
// src/components/inline-editor.tsx
|
|
7937
8091
|
var React114 = __toESM(require("react"));
|
|
@@ -7952,6 +8106,7 @@ var import_extension_underline = __toESM(require("@tiptap/extension-underline"))
|
|
|
7952
8106
|
var import_react67 = require("@tiptap/react");
|
|
7953
8107
|
|
|
7954
8108
|
// src/utils/inline-editing.ts
|
|
8109
|
+
var import_editor_props64 = require("@elementor/editor-props");
|
|
7955
8110
|
function isEmpty(value = "") {
|
|
7956
8111
|
if (!value) {
|
|
7957
8112
|
return true;
|
|
@@ -7968,6 +8123,13 @@ function htmlToPlainText(html) {
|
|
|
7968
8123
|
const doc = new DOMParser().parseFromString(normalizedHtml, "text/html");
|
|
7969
8124
|
return doc.body.textContent ?? "";
|
|
7970
8125
|
}
|
|
8126
|
+
function extractInlineHtmlContent(propValue) {
|
|
8127
|
+
if (import_editor_props64.escapedHtmlPropTypeUtil.isValid(propValue)) {
|
|
8128
|
+
return import_editor_props64.escapedHtmlPropTypeUtil.extract(propValue) ?? "";
|
|
8129
|
+
}
|
|
8130
|
+
const htmlV3 = import_editor_props64.htmlV3PropTypeUtil.extract(propValue);
|
|
8131
|
+
return import_editor_props64.stringPropTypeUtil.extract(htmlV3?.content ?? null) ?? "";
|
|
8132
|
+
}
|
|
7971
8133
|
|
|
7972
8134
|
// src/components/inline-editor.tsx
|
|
7973
8135
|
var ITALIC_KEYBOARD_SHORTCUT = "i";
|
|
@@ -7985,6 +8147,7 @@ var InlineEditor = React114.forwardRef((props, ref) => {
|
|
|
7985
8147
|
onBlur = void 0,
|
|
7986
8148
|
expectedTag = null,
|
|
7987
8149
|
onEditorCreate,
|
|
8150
|
+
onEditorDestroy,
|
|
7988
8151
|
wrapperClassName,
|
|
7989
8152
|
onSelectionEnd,
|
|
7990
8153
|
mountElement = null
|
|
@@ -8069,6 +8232,7 @@ var InlineEditor = React114.forwardRef((props, ref) => {
|
|
|
8069
8232
|
}
|
|
8070
8233
|
},
|
|
8071
8234
|
onCreate: onEditorCreate ? ({ editor: mountedEditor }) => onEditorCreate(mountedEditor) : void 0,
|
|
8235
|
+
onDestroy: onEditorDestroy ? () => onEditorDestroy() : void 0,
|
|
8072
8236
|
onBlur: mountElement ? void 0 : () => onBlurRef.current?.(),
|
|
8073
8237
|
onSelectionUpdate: onSelectionEnd ? ({ editor: updatedEditor }) => onSelectionEnd(updatedEditor.view) : void 0
|
|
8074
8238
|
});
|
|
@@ -8097,163 +8261,463 @@ var useOnUpdate = (callback, dependencies) => {
|
|
|
8097
8261
|
}, dependencies);
|
|
8098
8262
|
};
|
|
8099
8263
|
|
|
8100
|
-
// src/
|
|
8101
|
-
var
|
|
8102
|
-
var
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
}) => {
|
|
8108
|
-
const { value, setValue, placeholder } = useBoundProp(import_editor_props63.htmlV3PropTypeUtil);
|
|
8109
|
-
const content = import_editor_props63.stringPropTypeUtil.extract(value?.content ?? null) ?? "";
|
|
8110
|
-
const debouncedParse = (0, import_react68.useMemo)(
|
|
8111
|
-
() => (0, import_utils8.debounce)((html) => {
|
|
8112
|
-
const parsed = (0, import_editor_props63.parseHtmlChildren)(html);
|
|
8113
|
-
setValue({
|
|
8114
|
-
content: parsed.content ? import_editor_props63.stringPropTypeUtil.create(parsed.content) : null,
|
|
8115
|
-
children: parsed.children
|
|
8116
|
-
});
|
|
8117
|
-
}, CHILDREN_PARSE_DEBOUNCE_MS),
|
|
8118
|
-
[setValue]
|
|
8119
|
-
);
|
|
8120
|
-
const handleChange = (0, import_react68.useCallback)(
|
|
8121
|
-
(newValue) => {
|
|
8122
|
-
const html = newValue ?? "";
|
|
8123
|
-
setValue({
|
|
8124
|
-
content: html ? import_editor_props63.stringPropTypeUtil.create(html) : null,
|
|
8125
|
-
children: value?.children ?? []
|
|
8126
|
-
});
|
|
8127
|
-
debouncedParse(html);
|
|
8128
|
-
},
|
|
8129
|
-
[setValue, value?.children, debouncedParse]
|
|
8130
|
-
);
|
|
8131
|
-
(0, import_react68.useEffect)(() => () => debouncedParse.cancel(), [debouncedParse]);
|
|
8132
|
-
return /* @__PURE__ */ React115.createElement(ControlActions, null, /* @__PURE__ */ React115.createElement(
|
|
8133
|
-
import_ui99.Box,
|
|
8134
|
-
{
|
|
8135
|
-
sx: {
|
|
8136
|
-
p: 0.8,
|
|
8137
|
-
border: "1px solid",
|
|
8138
|
-
borderColor: "grey.200",
|
|
8139
|
-
borderRadius: "8px",
|
|
8140
|
-
transition: "border-color .2s ease, box-shadow .2s ease",
|
|
8141
|
-
"&:hover": {
|
|
8142
|
-
borderColor: "black"
|
|
8143
|
-
},
|
|
8144
|
-
"&:focus-within": {
|
|
8145
|
-
borderColor: "black",
|
|
8146
|
-
boxShadow: "0 0 0 1px black"
|
|
8147
|
-
},
|
|
8148
|
-
"& .ProseMirror:focus": {
|
|
8149
|
-
outline: "none"
|
|
8150
|
-
},
|
|
8151
|
-
"& .ProseMirror": {
|
|
8152
|
-
minHeight: "70px",
|
|
8153
|
-
fontSize: "12px",
|
|
8154
|
-
"& a": {
|
|
8155
|
-
color: "inherit"
|
|
8156
|
-
},
|
|
8157
|
-
"& .elementor-inline-editor-reset": {
|
|
8158
|
-
margin: 0,
|
|
8159
|
-
padding: 0
|
|
8160
|
-
},
|
|
8161
|
-
"&.is-empty::before": {
|
|
8162
|
-
content: "attr(data-placeholder)",
|
|
8163
|
-
color: "text.tertiary",
|
|
8164
|
-
pointerEvents: "none",
|
|
8165
|
-
position: "absolute",
|
|
8166
|
-
opacity: 0.6
|
|
8167
|
-
}
|
|
8168
|
-
},
|
|
8169
|
-
".strip-styles *": {
|
|
8170
|
-
all: "unset"
|
|
8171
|
-
},
|
|
8172
|
-
...sx
|
|
8173
|
-
},
|
|
8174
|
-
...attributes,
|
|
8175
|
-
...props
|
|
8176
|
-
},
|
|
8177
|
-
/* @__PURE__ */ React115.createElement(
|
|
8178
|
-
InlineEditor,
|
|
8179
|
-
{
|
|
8180
|
-
value: content,
|
|
8181
|
-
setValue: handleChange,
|
|
8182
|
-
placeholder: placeholder?.content?.value ?? null
|
|
8183
|
-
}
|
|
8184
|
-
)
|
|
8185
|
-
));
|
|
8186
|
-
}
|
|
8187
|
-
);
|
|
8188
|
-
|
|
8189
|
-
// src/controls/email-form-action-control/index.tsx
|
|
8190
|
-
var React119 = __toESM(require("react"));
|
|
8191
|
-
var import_editor_props66 = require("@elementor/editor-props");
|
|
8192
|
-
var import_editor_ui16 = require("@elementor/editor-ui");
|
|
8193
|
-
var import_ui103 = require("@elementor/ui");
|
|
8264
|
+
// src/components/inline-editor-toolbar.tsx
|
|
8265
|
+
var React116 = __toESM(require("react"));
|
|
8266
|
+
var import_react69 = require("react");
|
|
8267
|
+
var import_editor_elements7 = require("@elementor/editor-elements");
|
|
8268
|
+
var import_icons38 = require("@elementor/icons");
|
|
8269
|
+
var import_ui100 = require("@elementor/ui");
|
|
8270
|
+
var import_react70 = require("@tiptap/react");
|
|
8194
8271
|
var import_i18n58 = require("@wordpress/i18n");
|
|
8195
8272
|
|
|
8196
|
-
// src/
|
|
8197
|
-
var
|
|
8198
|
-
var
|
|
8199
|
-
var
|
|
8273
|
+
// src/components/url-popover.tsx
|
|
8274
|
+
var React115 = __toESM(require("react"));
|
|
8275
|
+
var import_react68 = require("react");
|
|
8276
|
+
var import_icons37 = require("@elementor/icons");
|
|
8277
|
+
var import_ui99 = require("@elementor/ui");
|
|
8200
8278
|
var import_i18n57 = require("@wordpress/i18n");
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
];
|
|
8215
|
-
var FORM_ELEMENT_TYPE = "e-form";
|
|
8216
|
-
var CSS_ID_PROP_KEY = "_cssid";
|
|
8217
|
-
function isFormFieldWidgetType(widgetType) {
|
|
8218
|
-
return FORM_FIELD_WIDGET_TYPES.includes(widgetType);
|
|
8219
|
-
}
|
|
8220
|
-
function extractStringPropValue(value) {
|
|
8221
|
-
return import_editor_props64.stringPropTypeUtil.extract(value);
|
|
8222
|
-
}
|
|
8223
|
-
function getSettingWithDefault(child, widgetType, key) {
|
|
8224
|
-
const fromGet = child.settings.get(key);
|
|
8225
|
-
if (fromGet !== null && fromGet !== void 0) {
|
|
8226
|
-
return fromGet;
|
|
8227
|
-
}
|
|
8228
|
-
const schema = (0, import_editor_elements7.getWidgetsCache)()?.[widgetType]?.atomic_props_schema;
|
|
8229
|
-
return schema?.[key]?.default ?? null;
|
|
8230
|
-
}
|
|
8231
|
-
function getFieldCssId(child, widgetType) {
|
|
8232
|
-
return extractStringPropValue(getSettingWithDefault(child, widgetType, CSS_ID_PROP_KEY));
|
|
8233
|
-
}
|
|
8234
|
-
function getFormContainer(elementId) {
|
|
8235
|
-
let container = (0, import_editor_elements7.getContainer)(elementId);
|
|
8236
|
-
while (container) {
|
|
8237
|
-
if (container.model.get("elType") === FORM_ELEMENT_TYPE) {
|
|
8238
|
-
return container;
|
|
8279
|
+
var UrlPopover = ({
|
|
8280
|
+
popupState,
|
|
8281
|
+
restoreValue,
|
|
8282
|
+
anchorRef,
|
|
8283
|
+
value,
|
|
8284
|
+
onChange,
|
|
8285
|
+
openInNewTab,
|
|
8286
|
+
onToggleNewTab
|
|
8287
|
+
}) => {
|
|
8288
|
+
const inputRef = (0, import_react68.useRef)(null);
|
|
8289
|
+
(0, import_react68.useEffect)(() => {
|
|
8290
|
+
if (popupState.isOpen) {
|
|
8291
|
+
requestAnimationFrame(() => inputRef.current?.focus());
|
|
8239
8292
|
}
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
return
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
8255
|
-
|
|
8256
|
-
|
|
8293
|
+
}, [popupState.isOpen]);
|
|
8294
|
+
const handleClose = () => {
|
|
8295
|
+
restoreValue();
|
|
8296
|
+
popupState.close();
|
|
8297
|
+
};
|
|
8298
|
+
return /* @__PURE__ */ React115.createElement(
|
|
8299
|
+
import_ui99.Popover,
|
|
8300
|
+
{
|
|
8301
|
+
slotProps: {
|
|
8302
|
+
paper: { sx: { borderRadius: "16px", width: anchorRef.current?.offsetWidth + "px", marginTop: -1 } }
|
|
8303
|
+
},
|
|
8304
|
+
...(0, import_ui99.bindPopover)(popupState),
|
|
8305
|
+
anchorOrigin: { vertical: "top", horizontal: "left" },
|
|
8306
|
+
transformOrigin: { vertical: "top", horizontal: "left" },
|
|
8307
|
+
onClose: handleClose
|
|
8308
|
+
},
|
|
8309
|
+
/* @__PURE__ */ React115.createElement(import_ui99.Stack, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React115.createElement(
|
|
8310
|
+
import_ui99.TextField,
|
|
8311
|
+
{
|
|
8312
|
+
value,
|
|
8313
|
+
onChange,
|
|
8314
|
+
size: "tiny",
|
|
8315
|
+
fullWidth: true,
|
|
8316
|
+
placeholder: (0, import_i18n57.__)("Type a URL", "elementor"),
|
|
8317
|
+
inputProps: { ref: inputRef },
|
|
8318
|
+
color: "secondary",
|
|
8319
|
+
InputProps: { sx: { borderRadius: "8px" } },
|
|
8320
|
+
onKeyUp: (event) => event.key === "Enter" && handleClose()
|
|
8321
|
+
}
|
|
8322
|
+
), /* @__PURE__ */ React115.createElement(import_ui99.Tooltip, { title: (0, import_i18n57.__)("Open in a new tab", "elementor") }, /* @__PURE__ */ React115.createElement(
|
|
8323
|
+
import_ui99.ToggleButton,
|
|
8324
|
+
{
|
|
8325
|
+
size: "tiny",
|
|
8326
|
+
value: "newTab",
|
|
8327
|
+
selected: openInNewTab,
|
|
8328
|
+
onClick: onToggleNewTab,
|
|
8329
|
+
"aria-label": (0, import_i18n57.__)("Open in a new tab", "elementor"),
|
|
8330
|
+
sx: { borderRadius: "8px" }
|
|
8331
|
+
},
|
|
8332
|
+
/* @__PURE__ */ React115.createElement(import_icons37.ExternalLinkIcon, { fontSize: "tiny" })
|
|
8333
|
+
)))
|
|
8334
|
+
);
|
|
8335
|
+
};
|
|
8336
|
+
|
|
8337
|
+
// src/components/inline-editor-toolbar.tsx
|
|
8338
|
+
var InlineEditorToolbar = ({
|
|
8339
|
+
editor,
|
|
8340
|
+
elementId,
|
|
8341
|
+
sx = {},
|
|
8342
|
+
inControlPanel = false
|
|
8343
|
+
}) => {
|
|
8344
|
+
const [urlValue, setUrlValue] = (0, import_react69.useState)("");
|
|
8345
|
+
const [openInNewTab, setOpenInNewTab] = (0, import_react69.useState)(false);
|
|
8346
|
+
const toolbarRef = (0, import_react69.useRef)(null);
|
|
8347
|
+
const linkPopupState = (0, import_ui100.usePopupState)({ variant: "popover" });
|
|
8348
|
+
const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
|
|
8349
|
+
const editorState = (0, import_react70.useEditorState)({
|
|
8350
|
+
editor,
|
|
8351
|
+
selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
|
|
8352
|
+
});
|
|
8353
|
+
const formatButtonsList = (0, import_react69.useMemo)(() => {
|
|
8354
|
+
const buttons = Object.values(formatButtons);
|
|
8355
|
+
if (isElementClickable) {
|
|
8356
|
+
return buttons.filter((button) => button.action !== "link");
|
|
8357
|
+
}
|
|
8358
|
+
return buttons;
|
|
8359
|
+
}, [isElementClickable]);
|
|
8360
|
+
const handleLinkClick = () => {
|
|
8361
|
+
const linkAttrs = editor.getAttributes("link");
|
|
8362
|
+
setUrlValue(linkAttrs.href || "");
|
|
8363
|
+
setOpenInNewTab(linkAttrs.target === "_blank");
|
|
8364
|
+
linkPopupState.open(toolbarRef.current);
|
|
8365
|
+
};
|
|
8366
|
+
const handleUrlChange = (event) => {
|
|
8367
|
+
setUrlValue(event.target.value);
|
|
8368
|
+
};
|
|
8369
|
+
const handleToggleNewTab = () => {
|
|
8370
|
+
setOpenInNewTab(!openInNewTab);
|
|
8371
|
+
};
|
|
8372
|
+
const handleUrlSubmit = () => {
|
|
8373
|
+
if (urlValue) {
|
|
8374
|
+
editor.chain().focus().setLink({
|
|
8375
|
+
href: urlValue,
|
|
8376
|
+
target: openInNewTab ? "_blank" : "_self"
|
|
8377
|
+
}).run();
|
|
8378
|
+
} else {
|
|
8379
|
+
editor.chain().focus().unsetLink().run();
|
|
8380
|
+
}
|
|
8381
|
+
if (elementId) {
|
|
8382
|
+
window.dispatchEvent(
|
|
8383
|
+
new CustomEvent("elementor:inline-link-changed", {
|
|
8384
|
+
detail: { elementId }
|
|
8385
|
+
})
|
|
8386
|
+
);
|
|
8387
|
+
}
|
|
8388
|
+
linkPopupState.close();
|
|
8389
|
+
};
|
|
8390
|
+
(0, import_react69.useEffect)(() => {
|
|
8391
|
+
if (!inControlPanel) {
|
|
8392
|
+
editor?.commands?.focus();
|
|
8393
|
+
}
|
|
8394
|
+
}, [editor, inControlPanel]);
|
|
8395
|
+
return /* @__PURE__ */ React116.createElement(
|
|
8396
|
+
import_ui100.Box,
|
|
8397
|
+
{
|
|
8398
|
+
ref: toolbarRef,
|
|
8399
|
+
sx: {
|
|
8400
|
+
display: "inline-flex",
|
|
8401
|
+
gap: 0.5,
|
|
8402
|
+
padding: 0.5,
|
|
8403
|
+
borderRadius: "8px",
|
|
8404
|
+
backgroundColor: "background.paper",
|
|
8405
|
+
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.2)",
|
|
8406
|
+
alignItems: "center",
|
|
8407
|
+
visibility: linkPopupState.isOpen ? "hidden" : "visible",
|
|
8408
|
+
pointerEvents: linkPopupState.isOpen ? "none" : "all",
|
|
8409
|
+
...sx,
|
|
8410
|
+
...inControlPanel && {
|
|
8411
|
+
width: "100%",
|
|
8412
|
+
justifyContent: "center",
|
|
8413
|
+
flexDirection: "row",
|
|
8414
|
+
backgroundColor: "transparent",
|
|
8415
|
+
boxShadow: "none",
|
|
8416
|
+
borderWidth: "0",
|
|
8417
|
+
borderBottom: "1px solid",
|
|
8418
|
+
borderBottomColor: (theme) => theme.palette.text.secondary,
|
|
8419
|
+
borderRadius: "0",
|
|
8420
|
+
position: "absolute",
|
|
8421
|
+
top: "0",
|
|
8422
|
+
left: "0",
|
|
8423
|
+
"&, & .MuiIconButton-root, & .MuiToggleButton-root": {
|
|
8424
|
+
color: (theme) => theme.palette.text.primary
|
|
8425
|
+
}
|
|
8426
|
+
}
|
|
8427
|
+
}
|
|
8428
|
+
},
|
|
8429
|
+
/* @__PURE__ */ React116.createElement(import_ui100.Tooltip, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React116.createElement(import_ui100.IconButton, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
|
|
8430
|
+
/* @__PURE__ */ React116.createElement(
|
|
8431
|
+
import_ui100.ToggleButtonGroup,
|
|
8432
|
+
{
|
|
8433
|
+
value: editorState,
|
|
8434
|
+
size: "tiny",
|
|
8435
|
+
sx: {
|
|
8436
|
+
display: "flex",
|
|
8437
|
+
gap: 0.5,
|
|
8438
|
+
border: "none",
|
|
8439
|
+
[`& .${import_ui100.toggleButtonGroupClasses.firstButton}, & .${import_ui100.toggleButtonGroupClasses.middleButton}, & .${import_ui100.toggleButtonGroupClasses.lastButton}`]: {
|
|
8440
|
+
borderRadius: "8px",
|
|
8441
|
+
border: "none",
|
|
8442
|
+
marginLeft: 0,
|
|
8443
|
+
"&.Mui-selected": {
|
|
8444
|
+
marginLeft: 0
|
|
8445
|
+
},
|
|
8446
|
+
"& + &.Mui-selected": {
|
|
8447
|
+
marginLeft: 0
|
|
8448
|
+
}
|
|
8449
|
+
},
|
|
8450
|
+
...inControlPanel && {
|
|
8451
|
+
justifyContent: "space-between",
|
|
8452
|
+
width: "100%",
|
|
8453
|
+
"& svg": {
|
|
8454
|
+
width: "0.7rem",
|
|
8455
|
+
height: "0.7rem"
|
|
8456
|
+
}
|
|
8457
|
+
}
|
|
8458
|
+
}
|
|
8459
|
+
},
|
|
8460
|
+
formatButtonsList.map((button) => /* @__PURE__ */ React116.createElement(import_ui100.Tooltip, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React116.createElement(
|
|
8461
|
+
import_ui100.ToggleButton,
|
|
8462
|
+
{
|
|
8463
|
+
value: button.action,
|
|
8464
|
+
"aria-label": button.label,
|
|
8465
|
+
size: "tiny",
|
|
8466
|
+
onClick: () => {
|
|
8467
|
+
if (button.action === "link") {
|
|
8468
|
+
handleLinkClick();
|
|
8469
|
+
} else {
|
|
8470
|
+
button.method?.(editor);
|
|
8471
|
+
}
|
|
8472
|
+
editor?.commands?.focus();
|
|
8473
|
+
}
|
|
8474
|
+
},
|
|
8475
|
+
button.icon
|
|
8476
|
+
)))
|
|
8477
|
+
),
|
|
8478
|
+
/* @__PURE__ */ React116.createElement(
|
|
8479
|
+
UrlPopover,
|
|
8480
|
+
{
|
|
8481
|
+
popupState: linkPopupState,
|
|
8482
|
+
anchorRef: toolbarRef,
|
|
8483
|
+
restoreValue: handleUrlSubmit,
|
|
8484
|
+
value: urlValue,
|
|
8485
|
+
onChange: handleUrlChange,
|
|
8486
|
+
openInNewTab,
|
|
8487
|
+
onToggleNewTab: handleToggleNewTab
|
|
8488
|
+
}
|
|
8489
|
+
)
|
|
8490
|
+
);
|
|
8491
|
+
};
|
|
8492
|
+
var checkIfElementIsClickable = (elementId) => {
|
|
8493
|
+
const container = (0, import_editor_elements7.getContainer)(elementId);
|
|
8494
|
+
const type = container?.model.get("widgetType");
|
|
8495
|
+
const isButton = type === "e-button";
|
|
8496
|
+
const hasLink = !!(0, import_editor_elements7.getElementSetting)(elementId, "link")?.value?.destination;
|
|
8497
|
+
return isButton || hasLink;
|
|
8498
|
+
};
|
|
8499
|
+
var toolbarButtons = {
|
|
8500
|
+
clear: {
|
|
8501
|
+
label: (0, import_i18n58.__)("Clear", "elementor"),
|
|
8502
|
+
icon: /* @__PURE__ */ React116.createElement(import_icons38.MinusIcon, { fontSize: "tiny" }),
|
|
8503
|
+
action: "clear",
|
|
8504
|
+
method: (editor) => {
|
|
8505
|
+
editor.chain().focus().clearNodes().unsetAllMarks().run();
|
|
8506
|
+
}
|
|
8507
|
+
},
|
|
8508
|
+
bold: {
|
|
8509
|
+
label: (0, import_i18n58.__)("Bold", "elementor"),
|
|
8510
|
+
icon: /* @__PURE__ */ React116.createElement(import_icons38.BoldIcon, { fontSize: "tiny" }),
|
|
8511
|
+
action: "bold",
|
|
8512
|
+
method: (editor) => {
|
|
8513
|
+
editor.chain().focus().toggleBold().run();
|
|
8514
|
+
}
|
|
8515
|
+
},
|
|
8516
|
+
italic: {
|
|
8517
|
+
label: (0, import_i18n58.__)("Italic", "elementor"),
|
|
8518
|
+
icon: /* @__PURE__ */ React116.createElement(import_icons38.ItalicIcon, { fontSize: "tiny" }),
|
|
8519
|
+
action: "italic",
|
|
8520
|
+
method: (editor) => {
|
|
8521
|
+
editor.chain().focus().toggleItalic().run();
|
|
8522
|
+
}
|
|
8523
|
+
},
|
|
8524
|
+
underline: {
|
|
8525
|
+
label: (0, import_i18n58.__)("Underline", "elementor"),
|
|
8526
|
+
icon: /* @__PURE__ */ React116.createElement(import_icons38.UnderlineIcon, { fontSize: "tiny" }),
|
|
8527
|
+
action: "underline",
|
|
8528
|
+
method: (editor) => {
|
|
8529
|
+
editor.chain().focus().toggleUnderline().run();
|
|
8530
|
+
}
|
|
8531
|
+
},
|
|
8532
|
+
strike: {
|
|
8533
|
+
label: (0, import_i18n58.__)("Strikethrough", "elementor"),
|
|
8534
|
+
icon: /* @__PURE__ */ React116.createElement(import_icons38.StrikethroughIcon, { fontSize: "tiny" }),
|
|
8535
|
+
action: "strike",
|
|
8536
|
+
method: (editor) => {
|
|
8537
|
+
editor.chain().focus().toggleStrike().run();
|
|
8538
|
+
}
|
|
8539
|
+
},
|
|
8540
|
+
superscript: {
|
|
8541
|
+
label: (0, import_i18n58.__)("Superscript", "elementor"),
|
|
8542
|
+
icon: /* @__PURE__ */ React116.createElement(import_icons38.SuperscriptIcon, { fontSize: "tiny" }),
|
|
8543
|
+
action: "superscript",
|
|
8544
|
+
method: (editor) => {
|
|
8545
|
+
editor.chain().focus().toggleSuperscript().run();
|
|
8546
|
+
}
|
|
8547
|
+
},
|
|
8548
|
+
subscript: {
|
|
8549
|
+
label: (0, import_i18n58.__)("Subscript", "elementor"),
|
|
8550
|
+
icon: /* @__PURE__ */ React116.createElement(import_icons38.SubscriptIcon, { fontSize: "tiny" }),
|
|
8551
|
+
action: "subscript",
|
|
8552
|
+
method: (editor) => {
|
|
8553
|
+
editor.chain().focus().toggleSubscript().run();
|
|
8554
|
+
}
|
|
8555
|
+
},
|
|
8556
|
+
link: {
|
|
8557
|
+
label: (0, import_i18n58.__)("Link", "elementor"),
|
|
8558
|
+
icon: /* @__PURE__ */ React116.createElement(import_icons38.LinkIcon, { fontSize: "tiny" }),
|
|
8559
|
+
action: "link",
|
|
8560
|
+
method: null
|
|
8561
|
+
}
|
|
8562
|
+
};
|
|
8563
|
+
var { clear: clearButton, ...formatButtons } = toolbarButtons;
|
|
8564
|
+
var possibleFormats = Object.keys(formatButtons);
|
|
8565
|
+
|
|
8566
|
+
// src/controls/inline-editing-control.tsx
|
|
8567
|
+
var InlineEditingControl = createControl(({ sx, attributes, props, context: { elementId } }) => {
|
|
8568
|
+
const { setValue, placeholder, value } = useBoundProp(import_editor_props65.escapedHtmlPropTypeUtil);
|
|
8569
|
+
const { value: rawValue } = usePropKeyContext();
|
|
8570
|
+
const content = value ?? extractInlineHtmlContent(rawValue);
|
|
8571
|
+
const [editor, setEditor] = (0, import_react71.useState)(null);
|
|
8572
|
+
const handleChange = (0, import_react71.useCallback)(
|
|
8573
|
+
(newValue) => {
|
|
8574
|
+
const html = newValue ?? "";
|
|
8575
|
+
setValue(html);
|
|
8576
|
+
},
|
|
8577
|
+
[setValue]
|
|
8578
|
+
);
|
|
8579
|
+
return /* @__PURE__ */ React117.createElement(ControlActions, null, /* @__PURE__ */ React117.createElement(import_ui101.Box, { sx: { position: "relative" } }, editor && editor.isEditable && /* @__PURE__ */ React117.createElement(
|
|
8580
|
+
InlineEditorToolbar,
|
|
8581
|
+
{
|
|
8582
|
+
editor,
|
|
8583
|
+
elementId,
|
|
8584
|
+
sx: (theme) => ({
|
|
8585
|
+
boxShadow: "none",
|
|
8586
|
+
border: "1px solid",
|
|
8587
|
+
borderColor: theme.palette.text.secondary,
|
|
8588
|
+
mb: 0.5
|
|
8589
|
+
}),
|
|
8590
|
+
inControlPanel: true
|
|
8591
|
+
}
|
|
8592
|
+
), /* @__PURE__ */ React117.createElement(
|
|
8593
|
+
import_ui101.Box,
|
|
8594
|
+
{
|
|
8595
|
+
sx: (theme) => ({
|
|
8596
|
+
p: 0.8,
|
|
8597
|
+
border: "1px solid",
|
|
8598
|
+
borderColor: theme.palette.text.secondary,
|
|
8599
|
+
borderRadius: "8px",
|
|
8600
|
+
transition: "border-color .2s ease, box-shadow .2s ease",
|
|
8601
|
+
"&:hover": {
|
|
8602
|
+
borderColor: theme.palette.text.primary
|
|
8603
|
+
},
|
|
8604
|
+
"&:focus-within": {
|
|
8605
|
+
borderColor: theme.palette.text.primary,
|
|
8606
|
+
boxShadow: `0 0 0 1px ${theme.palette.text.primary}`
|
|
8607
|
+
},
|
|
8608
|
+
"& .ProseMirror:focus": {
|
|
8609
|
+
outline: "none"
|
|
8610
|
+
},
|
|
8611
|
+
"& .ProseMirror": {
|
|
8612
|
+
minHeight: "100px",
|
|
8613
|
+
fontSize: "12px",
|
|
8614
|
+
"& a": {
|
|
8615
|
+
color: "inherit"
|
|
8616
|
+
},
|
|
8617
|
+
"& .elementor-inline-editor-reset": {
|
|
8618
|
+
margin: 0,
|
|
8619
|
+
padding: 0
|
|
8620
|
+
},
|
|
8621
|
+
"&.is-empty::before": {
|
|
8622
|
+
content: "attr(data-placeholder)",
|
|
8623
|
+
color: "text.tertiary",
|
|
8624
|
+
pointerEvents: "none",
|
|
8625
|
+
position: "absolute",
|
|
8626
|
+
opacity: 0.6
|
|
8627
|
+
}
|
|
8628
|
+
},
|
|
8629
|
+
".strip-styles *": {
|
|
8630
|
+
all: "unset"
|
|
8631
|
+
},
|
|
8632
|
+
...sx
|
|
8633
|
+
}),
|
|
8634
|
+
...attributes,
|
|
8635
|
+
...props
|
|
8636
|
+
},
|
|
8637
|
+
/* @__PURE__ */ React117.createElement(
|
|
8638
|
+
InlineEditor,
|
|
8639
|
+
{
|
|
8640
|
+
value: content,
|
|
8641
|
+
setValue: handleChange,
|
|
8642
|
+
placeholder: placeholder ?? null,
|
|
8643
|
+
onEditorCreate: setEditor,
|
|
8644
|
+
onEditorDestroy: () => setEditor(null),
|
|
8645
|
+
sx: {
|
|
8646
|
+
paddingBlockStart: 5
|
|
8647
|
+
}
|
|
8648
|
+
}
|
|
8649
|
+
)
|
|
8650
|
+
)));
|
|
8651
|
+
});
|
|
8652
|
+
|
|
8653
|
+
// src/controls/email-form-action-control/index.tsx
|
|
8654
|
+
var React121 = __toESM(require("react"));
|
|
8655
|
+
var import_editor_props68 = require("@elementor/editor-props");
|
|
8656
|
+
var import_editor_ui16 = require("@elementor/editor-ui");
|
|
8657
|
+
var import_ui105 = require("@elementor/ui");
|
|
8658
|
+
var import_i18n60 = require("@wordpress/i18n");
|
|
8659
|
+
|
|
8660
|
+
// src/controls/email-form-action-control/fields.tsx
|
|
8661
|
+
var React120 = __toESM(require("react"));
|
|
8662
|
+
var import_editor_ui15 = require("@elementor/editor-ui");
|
|
8663
|
+
var import_ui104 = require("@elementor/ui");
|
|
8664
|
+
var import_i18n59 = require("@wordpress/i18n");
|
|
8665
|
+
|
|
8666
|
+
// src/hooks/use-form-field-suggestions.ts
|
|
8667
|
+
var import_editor_elements8 = require("@elementor/editor-elements");
|
|
8668
|
+
var import_editor_props66 = require("@elementor/editor-props");
|
|
8669
|
+
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
8670
|
+
var FORM_FIELD_WIDGET_TYPES = [
|
|
8671
|
+
"e-form-input",
|
|
8672
|
+
"e-form-textarea",
|
|
8673
|
+
"e-form-checkbox",
|
|
8674
|
+
"e-form-radio-button",
|
|
8675
|
+
"e-form-select",
|
|
8676
|
+
"e-form-date-picker",
|
|
8677
|
+
"e-form-time-picker"
|
|
8678
|
+
];
|
|
8679
|
+
var FORM_ELEMENT_TYPE = "e-form";
|
|
8680
|
+
var CSS_ID_PROP_KEY = "_cssid";
|
|
8681
|
+
function isFormFieldWidgetType(widgetType) {
|
|
8682
|
+
return FORM_FIELD_WIDGET_TYPES.includes(widgetType);
|
|
8683
|
+
}
|
|
8684
|
+
function extractStringPropValue(value) {
|
|
8685
|
+
return import_editor_props66.stringPropTypeUtil.extract(value);
|
|
8686
|
+
}
|
|
8687
|
+
function getSettingWithDefault(child, widgetType, key) {
|
|
8688
|
+
const fromGet = child.settings.get(key);
|
|
8689
|
+
if (fromGet !== null && fromGet !== void 0) {
|
|
8690
|
+
return fromGet;
|
|
8691
|
+
}
|
|
8692
|
+
const schema = (0, import_editor_elements8.getWidgetsCache)()?.[widgetType]?.atomic_props_schema;
|
|
8693
|
+
return schema?.[key]?.default ?? null;
|
|
8694
|
+
}
|
|
8695
|
+
function getFieldCssId(child, widgetType) {
|
|
8696
|
+
return extractStringPropValue(getSettingWithDefault(child, widgetType, CSS_ID_PROP_KEY));
|
|
8697
|
+
}
|
|
8698
|
+
function getFormContainer(elementId) {
|
|
8699
|
+
let container = (0, import_editor_elements8.getContainer)(elementId);
|
|
8700
|
+
while (container) {
|
|
8701
|
+
if (container.model.get("elType") === FORM_ELEMENT_TYPE) {
|
|
8702
|
+
return container;
|
|
8703
|
+
}
|
|
8704
|
+
container = container.parent ?? null;
|
|
8705
|
+
}
|
|
8706
|
+
return null;
|
|
8707
|
+
}
|
|
8708
|
+
function useFormFieldSuggestions(options) {
|
|
8709
|
+
return (0, import_editor_v1_adapters2.__privateUseListenTo)(
|
|
8710
|
+
[
|
|
8711
|
+
(0, import_editor_v1_adapters2.v1ReadyEvent)(),
|
|
8712
|
+
(0, import_editor_v1_adapters2.commandEndEvent)("document/elements/create"),
|
|
8713
|
+
(0, import_editor_v1_adapters2.commandEndEvent)("document/elements/delete"),
|
|
8714
|
+
(0, import_editor_v1_adapters2.commandEndEvent)("document/elements/set-settings")
|
|
8715
|
+
],
|
|
8716
|
+
() => {
|
|
8717
|
+
const selectedElements = (0, import_editor_elements8.getSelectedElements)();
|
|
8718
|
+
const selectedElement = selectedElements[0];
|
|
8719
|
+
if (!selectedElement) {
|
|
8720
|
+
return [];
|
|
8257
8721
|
}
|
|
8258
8722
|
const formContainer = getFormContainer(selectedElement.id);
|
|
8259
8723
|
if (!formContainer?.children) {
|
|
@@ -8286,52 +8750,68 @@ function useFormFieldSuggestions(options) {
|
|
|
8286
8750
|
}
|
|
8287
8751
|
|
|
8288
8752
|
// src/controls/email-form-action-control/email-chips-field.tsx
|
|
8289
|
-
var
|
|
8290
|
-
var
|
|
8291
|
-
var
|
|
8292
|
-
var
|
|
8753
|
+
var React118 = __toESM(require("react"));
|
|
8754
|
+
var import_react72 = require("react");
|
|
8755
|
+
var import_editor_props67 = require("@elementor/editor-props");
|
|
8756
|
+
var import_ui102 = require("@elementor/ui");
|
|
8293
8757
|
|
|
8294
8758
|
// src/controls/email-form-action-control/utils.ts
|
|
8295
8759
|
var import_schema = require("@elementor/schema");
|
|
8296
|
-
var
|
|
8760
|
+
var import_utils8 = require("@elementor/utils");
|
|
8297
8761
|
var MIN_PRO_VERSION_FOR_MENTIONS = "4.1.0";
|
|
8298
8762
|
var CHIP_TRIGGER_KEYS = /* @__PURE__ */ new Set([" ", ","]);
|
|
8299
8763
|
function isValidEmail(email) {
|
|
8300
8764
|
return import_schema.z.string().email().safeParse(email).success;
|
|
8301
8765
|
}
|
|
8766
|
+
var FORM_FIELD_SHORTCODE_PATTERN = /^\[[^[\]]+]$/;
|
|
8767
|
+
function isFormFieldShortcode(value) {
|
|
8768
|
+
return FORM_FIELD_SHORTCODE_PATTERN.test(value);
|
|
8769
|
+
}
|
|
8302
8770
|
var shouldShowMentionsInfo = () => {
|
|
8303
|
-
if (!(0,
|
|
8771
|
+
if (!(0, import_utils8.hasProInstalled)()) {
|
|
8304
8772
|
return true;
|
|
8305
8773
|
}
|
|
8306
8774
|
const proVersion = window.elementorPro?.config?.version;
|
|
8307
8775
|
if (!proVersion) {
|
|
8308
8776
|
return false;
|
|
8309
8777
|
}
|
|
8310
|
-
return (0,
|
|
8778
|
+
return (0, import_utils8.isVersionGreaterOrEqual)(proVersion, MIN_PRO_VERSION_FOR_MENTIONS);
|
|
8311
8779
|
};
|
|
8312
8780
|
|
|
8313
8781
|
// src/controls/email-form-action-control/email-chips-field.tsx
|
|
8314
|
-
var
|
|
8315
|
-
|
|
8316
|
-
|
|
8782
|
+
var isValidRecipient = (address) => isValidEmail(address) || isFormFieldShortcode(address);
|
|
8783
|
+
function resolveMention(raw, suggestions) {
|
|
8784
|
+
if (!raw.startsWith("@")) {
|
|
8785
|
+
return raw;
|
|
8786
|
+
}
|
|
8787
|
+
const match = suggestions.find((suggestion) => createMentionPattern(suggestion.value, "start").test(raw));
|
|
8788
|
+
return match ? `[${match.value}]` : raw;
|
|
8789
|
+
}
|
|
8790
|
+
var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
|
|
8791
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props67.stringArrayPropTypeUtil);
|
|
8792
|
+
const [inputValue, setInputValue] = (0, import_react72.useState)("");
|
|
8317
8793
|
const items2 = value || [];
|
|
8318
|
-
const selectedValues = items2.map((item) =>
|
|
8794
|
+
const selectedValues = items2.map((item) => import_editor_props67.stringPropTypeUtil.extract(item)).filter((val) => val !== null);
|
|
8795
|
+
const suggestionOptions = (0, import_react72.useMemo)(
|
|
8796
|
+
() => suggestions.map((suggestion) => `[${suggestion.value}]`),
|
|
8797
|
+
[suggestions]
|
|
8798
|
+
);
|
|
8319
8799
|
const tryAddChip = (raw) => {
|
|
8320
|
-
const address = raw.trim();
|
|
8321
|
-
if (!address || selectedValues.includes(address) || !
|
|
8800
|
+
const address = resolveMention(raw.trim(), suggestions);
|
|
8801
|
+
if (!address || selectedValues.includes(address) || !isValidRecipient(address)) {
|
|
8322
8802
|
return;
|
|
8323
8803
|
}
|
|
8324
|
-
setValue([...items2,
|
|
8804
|
+
setValue([...items2, import_editor_props67.stringPropTypeUtil.create(address)]);
|
|
8325
8805
|
setInputValue("");
|
|
8326
8806
|
};
|
|
8327
8807
|
const handleChange = (_, newValue) => {
|
|
8328
8808
|
const updated = [];
|
|
8329
8809
|
for (const entry of newValue) {
|
|
8330
|
-
const address = entry.trim();
|
|
8331
|
-
if (!address || !
|
|
8810
|
+
const address = resolveMention(entry.trim(), suggestions);
|
|
8811
|
+
if (!address || !isValidRecipient(address)) {
|
|
8332
8812
|
continue;
|
|
8333
8813
|
}
|
|
8334
|
-
updated.push(
|
|
8814
|
+
updated.push(import_editor_props67.stringPropTypeUtil.create(address));
|
|
8335
8815
|
}
|
|
8336
8816
|
setValue(updated);
|
|
8337
8817
|
setInputValue("");
|
|
@@ -8347,8 +8827,8 @@ var EmailChipsControl = createControl(({ placeholder }) => {
|
|
|
8347
8827
|
tryAddChip(inputValue);
|
|
8348
8828
|
}
|
|
8349
8829
|
};
|
|
8350
|
-
return /* @__PURE__ */
|
|
8351
|
-
|
|
8830
|
+
return /* @__PURE__ */ React118.createElement(ControlActions, null, /* @__PURE__ */ React118.createElement(
|
|
8831
|
+
import_ui102.Autocomplete,
|
|
8352
8832
|
{
|
|
8353
8833
|
fullWidth: true,
|
|
8354
8834
|
multiple: true,
|
|
@@ -8363,87 +8843,108 @@ var EmailChipsControl = createControl(({ placeholder }) => {
|
|
|
8363
8843
|
},
|
|
8364
8844
|
value: selectedValues,
|
|
8365
8845
|
onChange: handleChange,
|
|
8366
|
-
options:
|
|
8846
|
+
options: suggestionOptions,
|
|
8847
|
+
filterOptions: (options, state) => {
|
|
8848
|
+
const query = state.inputValue.trim().replace(/^@/, "").toLowerCase();
|
|
8849
|
+
return query ? options.filter((option) => option.toLowerCase().includes(query)) : options;
|
|
8850
|
+
},
|
|
8851
|
+
filterSelectedOptions: true,
|
|
8367
8852
|
onBlur: handleBlur,
|
|
8368
8853
|
getOptionLabel: (option) => option,
|
|
8369
8854
|
isOptionEqualToValue: (option, val) => option === val,
|
|
8370
|
-
renderInput: (params) => /* @__PURE__ */
|
|
8371
|
-
renderTags: (tagValues, getTagProps) => /* @__PURE__ */
|
|
8855
|
+
renderInput: (params) => /* @__PURE__ */ React118.createElement(import_ui102.TextField, { ...params, placeholder, onKeyDown: handleKeyDown }),
|
|
8856
|
+
renderTags: (tagValues, getTagProps) => /* @__PURE__ */ React118.createElement(ChipsList, { getLabel: (option) => option, getTagProps, values: tagValues })
|
|
8372
8857
|
}
|
|
8373
8858
|
));
|
|
8374
8859
|
});
|
|
8375
|
-
var EmailChipsField = ({ fieldLabel, placeholder }) => /* @__PURE__ */
|
|
8860
|
+
var EmailChipsField = ({ fieldLabel, placeholder, suggestions }) => /* @__PURE__ */ React118.createElement(import_ui102.Grid, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React118.createElement(import_ui102.Grid, { item: true }, /* @__PURE__ */ React118.createElement(ControlFormLabel, null, fieldLabel)), /* @__PURE__ */ React118.createElement(import_ui102.Grid, { item: true }, /* @__PURE__ */ React118.createElement(EmailChipsControl, { placeholder, suggestions })));
|
|
8376
8861
|
|
|
8377
8862
|
// src/controls/email-form-action-control/email-field.tsx
|
|
8378
|
-
var
|
|
8379
|
-
var
|
|
8380
|
-
var EmailField = ({ bind, label, placeholder }) => /* @__PURE__ */
|
|
8863
|
+
var React119 = __toESM(require("react"));
|
|
8864
|
+
var import_ui103 = require("@elementor/ui");
|
|
8865
|
+
var EmailField = ({ bind, label, placeholder }) => /* @__PURE__ */ React119.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React119.createElement(import_ui103.Grid, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React119.createElement(import_ui103.Grid, { item: true }, /* @__PURE__ */ React119.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React119.createElement(import_ui103.Grid, { item: true }, /* @__PURE__ */ React119.createElement(TextControl, { placeholder }))));
|
|
8381
8866
|
|
|
8382
8867
|
// src/controls/email-form-action-control/fields.tsx
|
|
8383
|
-
var SendToField = ({ placeholder }) =>
|
|
8384
|
-
|
|
8868
|
+
var SendToField = ({ placeholder }) => {
|
|
8869
|
+
const suggestions = useFormFieldSuggestions({ inputType: "email" });
|
|
8870
|
+
return /* @__PURE__ */ React120.createElement(PropKeyProvider, { bind: "to" }, /* @__PURE__ */ React120.createElement(import_ui104.Stack, { gap: 0.5 }, /* @__PURE__ */ React120.createElement(
|
|
8871
|
+
EmailChipsField,
|
|
8872
|
+
{
|
|
8873
|
+
fieldLabel: (0, import_i18n59.__)("Send to", "elementor"),
|
|
8874
|
+
placeholder,
|
|
8875
|
+
suggestions
|
|
8876
|
+
}
|
|
8877
|
+
), shouldShowMentionsInfo() && /* @__PURE__ */ React120.createElement(import_editor_ui15.InfoAlert, null, (0, import_i18n59.__)("Type @ or an email field name to insert its submitted value.", "elementor"))));
|
|
8878
|
+
};
|
|
8879
|
+
var SubjectField = () => /* @__PURE__ */ React120.createElement(
|
|
8385
8880
|
EmailField,
|
|
8386
8881
|
{
|
|
8387
8882
|
bind: "subject",
|
|
8388
|
-
label: (0,
|
|
8389
|
-
placeholder: (0,
|
|
8883
|
+
label: (0, import_i18n59.__)("Email subject", "elementor"),
|
|
8884
|
+
placeholder: (0, import_i18n59.__)("New form submission", "elementor")
|
|
8390
8885
|
}
|
|
8391
8886
|
);
|
|
8392
8887
|
var MessageField = () => {
|
|
8393
8888
|
const suggestions = useFormFieldSuggestions();
|
|
8394
|
-
return /* @__PURE__ */
|
|
8889
|
+
return /* @__PURE__ */ React120.createElement(PropKeyProvider, { bind: "message" }, /* @__PURE__ */ React120.createElement(import_ui104.Grid, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React120.createElement(import_ui104.Grid, { item: true }, /* @__PURE__ */ React120.createElement(ControlFormLabel, null, (0, import_i18n59.__)("Message", "elementor"))), /* @__PURE__ */ React120.createElement(import_ui104.Grid, { item: true }, /* @__PURE__ */ React120.createElement(MentionTextAreaControl, { suggestions })), /* @__PURE__ */ React120.createElement(import_ui104.Grid, { item: true }, /* @__PURE__ */ React120.createElement(import_editor_ui15.InfoAlert, null, shouldShowMentionsInfo() ? (0, import_i18n59.__)(
|
|
8395
8890
|
"[all-fields] shortcode sends all fields. Type @ to insert specific fields and customize your message.",
|
|
8396
8891
|
"elementor"
|
|
8397
|
-
) : (0,
|
|
8892
|
+
) : (0, import_i18n59.__)("[all-fields] shortcode sends all fields.", "elementor")))));
|
|
8398
8893
|
};
|
|
8399
|
-
var FromEmailField = () => /* @__PURE__ */
|
|
8894
|
+
var FromEmailField = () => /* @__PURE__ */ React120.createElement(
|
|
8400
8895
|
EmailField,
|
|
8401
8896
|
{
|
|
8402
8897
|
bind: "from",
|
|
8403
|
-
label: (0,
|
|
8404
|
-
placeholder: (0,
|
|
8898
|
+
label: (0, import_i18n59.__)("From email", "elementor"),
|
|
8899
|
+
placeholder: (0, import_i18n59.__)("What email should appear as the sender?", "elementor")
|
|
8405
8900
|
}
|
|
8406
8901
|
);
|
|
8407
|
-
var FromNameField = () => /* @__PURE__ */
|
|
8902
|
+
var FromNameField = () => /* @__PURE__ */ React120.createElement(
|
|
8408
8903
|
EmailField,
|
|
8409
8904
|
{
|
|
8410
8905
|
bind: "from-name",
|
|
8411
|
-
label: (0,
|
|
8412
|
-
placeholder: (0,
|
|
8906
|
+
label: (0, import_i18n59.__)("From name", "elementor"),
|
|
8907
|
+
placeholder: (0, import_i18n59.__)("What name should appear as the sender?", "elementor")
|
|
8413
8908
|
}
|
|
8414
8909
|
);
|
|
8415
8910
|
var ReplyToField = () => {
|
|
8416
8911
|
const emailSuggestions = useFormFieldSuggestions({ inputType: "email" });
|
|
8417
|
-
return /* @__PURE__ */
|
|
8912
|
+
return /* @__PURE__ */ React120.createElement(PropKeyProvider, { bind: "reply-to" }, /* @__PURE__ */ React120.createElement(import_ui104.Grid, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React120.createElement(import_ui104.Grid, { item: true }, /* @__PURE__ */ React120.createElement(ControlFormLabel, null, (0, import_i18n59.__)("Reply-to", "elementor"))), /* @__PURE__ */ React120.createElement(import_ui104.Grid, { item: true }, /* @__PURE__ */ React120.createElement(
|
|
8418
8913
|
MentionTextAreaControl,
|
|
8419
8914
|
{
|
|
8420
8915
|
suggestions: emailSuggestions,
|
|
8421
8916
|
rows: 1,
|
|
8422
8917
|
triggerPosition: "start",
|
|
8423
|
-
placeholder: (0,
|
|
8918
|
+
placeholder: (0, import_i18n59.__)("You can type @ to insert an email field", "elementor")
|
|
8424
8919
|
}
|
|
8425
8920
|
))));
|
|
8426
8921
|
};
|
|
8427
|
-
var CcField = () =>
|
|
8428
|
-
|
|
8429
|
-
|
|
8922
|
+
var CcField = () => {
|
|
8923
|
+
const suggestions = useFormFieldSuggestions({ inputType: "email" });
|
|
8924
|
+
return /* @__PURE__ */ React120.createElement(PropKeyProvider, { bind: "cc" }, /* @__PURE__ */ React120.createElement(EmailChipsField, { fieldLabel: (0, import_i18n59.__)("Cc", "elementor"), suggestions }));
|
|
8925
|
+
};
|
|
8926
|
+
var BccField = () => {
|
|
8927
|
+
const suggestions = useFormFieldSuggestions({ inputType: "email" });
|
|
8928
|
+
return /* @__PURE__ */ React120.createElement(PropKeyProvider, { bind: "bcc" }, /* @__PURE__ */ React120.createElement(EmailChipsField, { fieldLabel: (0, import_i18n59.__)("Bcc", "elementor"), suggestions }));
|
|
8929
|
+
};
|
|
8930
|
+
var MetaDataField = () => /* @__PURE__ */ React120.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ React120.createElement(import_ui104.Stack, { gap: 0.5 }, /* @__PURE__ */ React120.createElement(ControlFormLabel, null, (0, import_i18n59.__)("Metadata", "elementor")), /* @__PURE__ */ React120.createElement(
|
|
8430
8931
|
ChipsControl,
|
|
8431
8932
|
{
|
|
8432
8933
|
options: [
|
|
8433
|
-
{ label: (0,
|
|
8434
|
-
{ label: (0,
|
|
8435
|
-
{ label: (0,
|
|
8436
|
-
{ label: (0,
|
|
8437
|
-
{ label: (0,
|
|
8934
|
+
{ label: (0, import_i18n59.__)("Date", "elementor"), value: "date" },
|
|
8935
|
+
{ label: (0, import_i18n59.__)("Time", "elementor"), value: "time" },
|
|
8936
|
+
{ label: (0, import_i18n59.__)("Page URL", "elementor"), value: "page-url" },
|
|
8937
|
+
{ label: (0, import_i18n59.__)("User agent", "elementor"), value: "user-agent" },
|
|
8938
|
+
{ label: (0, import_i18n59.__)("Credit", "elementor"), value: "credit" }
|
|
8438
8939
|
]
|
|
8439
8940
|
}
|
|
8440
8941
|
)));
|
|
8441
|
-
var SendAsField = () => /* @__PURE__ */
|
|
8942
|
+
var SendAsField = () => /* @__PURE__ */ React120.createElement(PropKeyProvider, { bind: "send-as" }, /* @__PURE__ */ React120.createElement(import_ui104.Grid, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React120.createElement(import_ui104.Grid, { item: true }, /* @__PURE__ */ React120.createElement(ControlFormLabel, null, (0, import_i18n59.__)("Send as", "elementor"))), /* @__PURE__ */ React120.createElement(import_ui104.Grid, { item: true }, /* @__PURE__ */ React120.createElement(
|
|
8442
8943
|
SelectControl,
|
|
8443
8944
|
{
|
|
8444
8945
|
options: [
|
|
8445
|
-
{ label: (0,
|
|
8446
|
-
{ label: (0,
|
|
8946
|
+
{ label: (0, import_i18n59.__)("HTML", "elementor"), value: "html" },
|
|
8947
|
+
{ label: (0, import_i18n59.__)("Plain Text", "elementor"), value: "plain" }
|
|
8447
8948
|
]
|
|
8448
8949
|
}
|
|
8449
8950
|
))));
|
|
@@ -8451,28 +8952,28 @@ var SendAsField = () => /* @__PURE__ */ React118.createElement(PropKeyProvider,
|
|
|
8451
8952
|
// src/controls/email-form-action-control/index.tsx
|
|
8452
8953
|
var EmailFormActionControl = createControl(
|
|
8453
8954
|
({ toPlaceholder, label }) => {
|
|
8454
|
-
const { value, setValue, ...propContext } = useBoundProp(
|
|
8455
|
-
return /* @__PURE__ */
|
|
8955
|
+
const { value, setValue, ...propContext } = useBoundProp(import_editor_props68.emailsPropTypeUtil);
|
|
8956
|
+
return /* @__PURE__ */ React121.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React121.createElement(import_ui105.Stack, { gap: 2 }, /* @__PURE__ */ React121.createElement(ControlLabel, null, label ? label + " " + (0, import_i18n60.__)("settings", "elementor") : (0, import_i18n60.__)("Email settings", "elementor")), /* @__PURE__ */ React121.createElement(SendToField, { placeholder: toPlaceholder }), /* @__PURE__ */ React121.createElement(SubjectField, null), /* @__PURE__ */ React121.createElement(MessageField, null), /* @__PURE__ */ React121.createElement(FromEmailField, null), /* @__PURE__ */ React121.createElement(AdvancedSettings, null)));
|
|
8456
8957
|
}
|
|
8457
8958
|
);
|
|
8458
|
-
var AdvancedSettings = () => /* @__PURE__ */
|
|
8959
|
+
var AdvancedSettings = () => /* @__PURE__ */ React121.createElement(import_editor_ui16.CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ React121.createElement(import_ui105.Box, { sx: { pt: 2 } }, /* @__PURE__ */ React121.createElement(import_ui105.Stack, { gap: 2 }, /* @__PURE__ */ React121.createElement(FromNameField, null), /* @__PURE__ */ React121.createElement(ReplyToField, null), /* @__PURE__ */ React121.createElement(CcField, null), /* @__PURE__ */ React121.createElement(BccField, null), /* @__PURE__ */ React121.createElement(import_ui105.Divider, null), /* @__PURE__ */ React121.createElement(MetaDataField, null), /* @__PURE__ */ React121.createElement(SendAsField, null))));
|
|
8459
8960
|
|
|
8460
8961
|
// src/controls/attachment-type-control.tsx
|
|
8461
|
-
var
|
|
8962
|
+
var React122 = __toESM(require("react"));
|
|
8462
8963
|
var import_editor_ui17 = require("@elementor/editor-ui");
|
|
8463
|
-
var
|
|
8464
|
-
var
|
|
8964
|
+
var import_ui106 = require("@elementor/ui");
|
|
8965
|
+
var import_i18n61 = require("@wordpress/i18n");
|
|
8465
8966
|
var AttachmentTypeControl = createControl(({ label, options }) => {
|
|
8466
|
-
return /* @__PURE__ */
|
|
8967
|
+
return /* @__PURE__ */ React122.createElement(import_ui106.Grid, { container: true, direction: "column", gap: 1 }, label && /* @__PURE__ */ React122.createElement(import_ui106.Grid, { item: true }, /* @__PURE__ */ React122.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React122.createElement(import_ui106.Grid, { item: true }, /* @__PURE__ */ React122.createElement(SelectControl, { options })), /* @__PURE__ */ React122.createElement(import_ui106.Grid, { item: true }, /* @__PURE__ */ React122.createElement(import_editor_ui17.InfoAlert, null, (0, import_i18n61.__)(
|
|
8467
8968
|
"Linked uploads are saved to the server. Direct attachments will not appear under Submissions.",
|
|
8468
8969
|
"elementor"
|
|
8469
8970
|
))));
|
|
8470
8971
|
});
|
|
8471
8972
|
|
|
8472
8973
|
// src/controls/grid-span-control.tsx
|
|
8473
|
-
var
|
|
8474
|
-
var
|
|
8475
|
-
var
|
|
8974
|
+
var React123 = __toESM(require("react"));
|
|
8975
|
+
var import_editor_props69 = require("@elementor/editor-props");
|
|
8976
|
+
var import_ui107 = require("@elementor/ui");
|
|
8476
8977
|
var GridSpanControl = createControl(
|
|
8477
8978
|
({
|
|
8478
8979
|
placeholder: propPlaceholder,
|
|
@@ -8483,14 +8984,14 @@ var GridSpanControl = createControl(
|
|
|
8483
8984
|
sx,
|
|
8484
8985
|
ariaLabel
|
|
8485
8986
|
}) => {
|
|
8486
|
-
const { value, setValue, disabled, placeholder: boundPlaceholder } = useBoundProp(
|
|
8987
|
+
const { value, setValue, disabled, placeholder: boundPlaceholder } = useBoundProp(import_editor_props69.spanPropTypeUtil);
|
|
8487
8988
|
const handleChange = (event) => {
|
|
8488
8989
|
const next = event.target.value;
|
|
8489
8990
|
setValue(next === "" ? null : next);
|
|
8490
8991
|
};
|
|
8491
8992
|
const placeholder = propPlaceholder ?? boundPlaceholder ?? `e.g: 'span 2' or '1 / 3'`;
|
|
8492
|
-
return /* @__PURE__ */
|
|
8493
|
-
|
|
8993
|
+
return /* @__PURE__ */ React123.createElement(ControlActions, null, /* @__PURE__ */ React123.createElement(
|
|
8994
|
+
import_ui107.TextField,
|
|
8494
8995
|
{
|
|
8495
8996
|
size: "tiny",
|
|
8496
8997
|
fullWidth: true,
|
|
@@ -8509,26 +9010,26 @@ var GridSpanControl = createControl(
|
|
|
8509
9010
|
}
|
|
8510
9011
|
);
|
|
8511
9012
|
|
|
8512
|
-
// src/components/promotions/display-conditions-control.tsx
|
|
8513
|
-
var
|
|
8514
|
-
var
|
|
8515
|
-
var
|
|
8516
|
-
var
|
|
8517
|
-
var
|
|
9013
|
+
// src/components/promotions/display-conditions-control.tsx
|
|
9014
|
+
var React125 = __toESM(require("react"));
|
|
9015
|
+
var import_react74 = require("react");
|
|
9016
|
+
var import_icons39 = require("@elementor/icons");
|
|
9017
|
+
var import_ui109 = require("@elementor/ui");
|
|
9018
|
+
var import_i18n62 = require("@wordpress/i18n");
|
|
8518
9019
|
|
|
8519
9020
|
// src/components/promotions/promotion-trigger.tsx
|
|
8520
|
-
var
|
|
8521
|
-
var
|
|
9021
|
+
var React124 = __toESM(require("react"));
|
|
9022
|
+
var import_react73 = require("react");
|
|
8522
9023
|
var import_editor_ui18 = require("@elementor/editor-ui");
|
|
8523
|
-
var
|
|
9024
|
+
var import_ui108 = require("@elementor/ui");
|
|
8524
9025
|
function getV4Promotion(key) {
|
|
8525
9026
|
return window.elementor?.config?.v4Promotions?.[key];
|
|
8526
9027
|
}
|
|
8527
|
-
var PromotionTrigger = (0,
|
|
9028
|
+
var PromotionTrigger = (0, import_react73.forwardRef)(
|
|
8528
9029
|
({ promotionKey, children, trackingData }, ref) => {
|
|
8529
|
-
const [isOpen, setIsOpen] = (0,
|
|
9030
|
+
const [isOpen, setIsOpen] = (0, import_react73.useState)(false);
|
|
8530
9031
|
const promotion = getV4Promotion(promotionKey);
|
|
8531
|
-
const toggle = (0,
|
|
9032
|
+
const toggle = (0, import_react73.useCallback)(() => {
|
|
8532
9033
|
setIsOpen((prev) => {
|
|
8533
9034
|
if (!prev) {
|
|
8534
9035
|
trackViewPromotion(trackingData);
|
|
@@ -8536,8 +9037,8 @@ var PromotionTrigger = (0, import_react70.forwardRef)(
|
|
|
8536
9037
|
return !prev;
|
|
8537
9038
|
});
|
|
8538
9039
|
}, [trackingData]);
|
|
8539
|
-
(0,
|
|
8540
|
-
return /* @__PURE__ */
|
|
9040
|
+
(0, import_react73.useImperativeHandle)(ref, () => ({ toggle }), [toggle]);
|
|
9041
|
+
return /* @__PURE__ */ React124.createElement(React124.Fragment, null, promotion && /* @__PURE__ */ React124.createElement(
|
|
8541
9042
|
import_editor_ui18.PromotionInfotip,
|
|
8542
9043
|
{
|
|
8543
9044
|
title: promotion.title,
|
|
@@ -8551,8 +9052,8 @@ var PromotionTrigger = (0, import_react70.forwardRef)(
|
|
|
8551
9052
|
},
|
|
8552
9053
|
onCtaClick: () => trackUpgradePromotionClick(trackingData)
|
|
8553
9054
|
},
|
|
8554
|
-
/* @__PURE__ */
|
|
8555
|
-
|
|
9055
|
+
/* @__PURE__ */ React124.createElement(
|
|
9056
|
+
import_ui108.Box,
|
|
8556
9057
|
{
|
|
8557
9058
|
onClick: (e) => {
|
|
8558
9059
|
e.stopPropagation();
|
|
@@ -8560,19 +9061,19 @@ var PromotionTrigger = (0, import_react70.forwardRef)(
|
|
|
8560
9061
|
},
|
|
8561
9062
|
sx: { cursor: "pointer", display: "inline-flex" }
|
|
8562
9063
|
},
|
|
8563
|
-
children ?? /* @__PURE__ */
|
|
9064
|
+
children ?? /* @__PURE__ */ React124.createElement(import_editor_ui18.PromotionChip, null)
|
|
8564
9065
|
)
|
|
8565
9066
|
));
|
|
8566
9067
|
}
|
|
8567
9068
|
);
|
|
8568
9069
|
|
|
8569
9070
|
// src/components/promotions/display-conditions-control.tsx
|
|
8570
|
-
var ARIA_LABEL = (0,
|
|
9071
|
+
var ARIA_LABEL = (0, import_i18n62.__)("Display Conditions", "elementor");
|
|
8571
9072
|
var TRACKING_DATA = { target_name: "display_conditions", location_l2: "general" };
|
|
8572
9073
|
var DisplayConditionsControl = createControl(() => {
|
|
8573
|
-
const triggerRef = (0,
|
|
8574
|
-
return /* @__PURE__ */
|
|
8575
|
-
|
|
9074
|
+
const triggerRef = (0, import_react74.useRef)(null);
|
|
9075
|
+
return /* @__PURE__ */ React125.createElement(
|
|
9076
|
+
import_ui109.Stack,
|
|
8576
9077
|
{
|
|
8577
9078
|
direction: "row",
|
|
8578
9079
|
spacing: 2,
|
|
@@ -8581,9 +9082,9 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
8581
9082
|
alignItems: "center"
|
|
8582
9083
|
}
|
|
8583
9084
|
},
|
|
8584
|
-
/* @__PURE__ */
|
|
8585
|
-
/* @__PURE__ */
|
|
8586
|
-
|
|
9085
|
+
/* @__PURE__ */ React125.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions", trackingData: TRACKING_DATA }),
|
|
9086
|
+
/* @__PURE__ */ React125.createElement(import_ui109.Tooltip, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React125.createElement(
|
|
9087
|
+
import_ui109.IconButton,
|
|
8587
9088
|
{
|
|
8588
9089
|
size: "tiny",
|
|
8589
9090
|
"aria-label": ARIA_LABEL,
|
|
@@ -8595,23 +9096,23 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
8595
9096
|
borderRadius: 1
|
|
8596
9097
|
}
|
|
8597
9098
|
},
|
|
8598
|
-
/* @__PURE__ */
|
|
9099
|
+
/* @__PURE__ */ React125.createElement(import_icons39.SitemapIcon, { fontSize: "tiny", color: "disabled" })
|
|
8599
9100
|
))
|
|
8600
9101
|
);
|
|
8601
9102
|
});
|
|
8602
9103
|
|
|
8603
9104
|
// src/components/promotions/attributes-control.tsx
|
|
8604
|
-
var
|
|
8605
|
-
var
|
|
8606
|
-
var
|
|
8607
|
-
var
|
|
8608
|
-
var
|
|
8609
|
-
var ARIA_LABEL2 = (0,
|
|
9105
|
+
var React126 = __toESM(require("react"));
|
|
9106
|
+
var import_react75 = require("react");
|
|
9107
|
+
var import_icons40 = require("@elementor/icons");
|
|
9108
|
+
var import_ui110 = require("@elementor/ui");
|
|
9109
|
+
var import_i18n63 = require("@wordpress/i18n");
|
|
9110
|
+
var ARIA_LABEL2 = (0, import_i18n63.__)("Attributes", "elementor");
|
|
8610
9111
|
var TRACKING_DATA2 = { target_name: "attributes", location_l2: "general" };
|
|
8611
9112
|
var AttributesControl = createControl(() => {
|
|
8612
|
-
const triggerRef = (0,
|
|
8613
|
-
return /* @__PURE__ */
|
|
8614
|
-
|
|
9113
|
+
const triggerRef = (0, import_react75.useRef)(null);
|
|
9114
|
+
return /* @__PURE__ */ React126.createElement(
|
|
9115
|
+
import_ui110.Stack,
|
|
8615
9116
|
{
|
|
8616
9117
|
direction: "row",
|
|
8617
9118
|
spacing: 2,
|
|
@@ -8620,9 +9121,9 @@ var AttributesControl = createControl(() => {
|
|
|
8620
9121
|
alignItems: "center"
|
|
8621
9122
|
}
|
|
8622
9123
|
},
|
|
8623
|
-
/* @__PURE__ */
|
|
8624
|
-
/* @__PURE__ */
|
|
8625
|
-
|
|
9124
|
+
/* @__PURE__ */ React126.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes", trackingData: TRACKING_DATA2 }),
|
|
9125
|
+
/* @__PURE__ */ React126.createElement(import_ui110.Tooltip, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React126.createElement(
|
|
9126
|
+
import_icons40.PlusIcon,
|
|
8626
9127
|
{
|
|
8627
9128
|
"aria-label": ARIA_LABEL2,
|
|
8628
9129
|
fontSize: "tiny",
|
|
@@ -8635,21 +9136,21 @@ var AttributesControl = createControl(() => {
|
|
|
8635
9136
|
});
|
|
8636
9137
|
|
|
8637
9138
|
// src/components/icon-buttons/clear-icon-button.tsx
|
|
8638
|
-
var
|
|
8639
|
-
var
|
|
8640
|
-
var
|
|
8641
|
-
var CustomIconButton = (0,
|
|
9139
|
+
var React127 = __toESM(require("react"));
|
|
9140
|
+
var import_icons41 = require("@elementor/icons");
|
|
9141
|
+
var import_ui111 = require("@elementor/ui");
|
|
9142
|
+
var CustomIconButton = (0, import_ui111.styled)(import_ui111.IconButton)(({ theme }) => ({
|
|
8642
9143
|
width: theme.spacing(2.5),
|
|
8643
9144
|
height: theme.spacing(2.5)
|
|
8644
9145
|
}));
|
|
8645
|
-
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */
|
|
9146
|
+
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React127.createElement(import_ui111.Tooltip, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React127.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React127.createElement(import_icons41.BrushBigIcon, { fontSize: size })));
|
|
8646
9147
|
|
|
8647
9148
|
// src/components/repeater/repeater.tsx
|
|
8648
|
-
var
|
|
8649
|
-
var
|
|
8650
|
-
var
|
|
8651
|
-
var
|
|
8652
|
-
var
|
|
9149
|
+
var React128 = __toESM(require("react"));
|
|
9150
|
+
var import_react76 = require("react");
|
|
9151
|
+
var import_icons42 = require("@elementor/icons");
|
|
9152
|
+
var import_ui112 = require("@elementor/ui");
|
|
9153
|
+
var import_i18n64 = require("@wordpress/i18n");
|
|
8653
9154
|
var SIZE12 = "tiny";
|
|
8654
9155
|
var EMPTY_OPEN_ITEM2 = -1;
|
|
8655
9156
|
var Repeater3 = ({
|
|
@@ -8668,7 +9169,7 @@ var Repeater3 = ({
|
|
|
8668
9169
|
isSortable = true,
|
|
8669
9170
|
adornment = ControlAdornments
|
|
8670
9171
|
}) => {
|
|
8671
|
-
const [openItem, setOpenItem] = (0,
|
|
9172
|
+
const [openItem, setOpenItem] = (0, import_react76.useState)(initialOpenItem);
|
|
8672
9173
|
const uniqueKeys = items2.map(
|
|
8673
9174
|
(item, index) => isSortable && "getId" in itemSettings ? itemSettings.getId({ item, index }) : String(index)
|
|
8674
9175
|
);
|
|
@@ -8731,8 +9232,8 @@ var Repeater3 = ({
|
|
|
8731
9232
|
};
|
|
8732
9233
|
const isButtonDisabled = disabled || disableAddItemButton;
|
|
8733
9234
|
const shouldShowInfotip = isButtonDisabled && addButtonInfotipContent;
|
|
8734
|
-
const addButton = /* @__PURE__ */
|
|
8735
|
-
|
|
9235
|
+
const addButton = /* @__PURE__ */ React128.createElement(
|
|
9236
|
+
import_ui112.IconButton,
|
|
8736
9237
|
{
|
|
8737
9238
|
size: SIZE12,
|
|
8738
9239
|
sx: {
|
|
@@ -8740,32 +9241,32 @@ var Repeater3 = ({
|
|
|
8740
9241
|
},
|
|
8741
9242
|
disabled: isButtonDisabled,
|
|
8742
9243
|
onClick: addRepeaterItem,
|
|
8743
|
-
"aria-label": (0,
|
|
9244
|
+
"aria-label": (0, import_i18n64.__)("Add item", "elementor")
|
|
8744
9245
|
},
|
|
8745
|
-
/* @__PURE__ */
|
|
9246
|
+
/* @__PURE__ */ React128.createElement(import_icons42.PlusIcon, { fontSize: SIZE12 })
|
|
8746
9247
|
);
|
|
8747
|
-
return /* @__PURE__ */
|
|
8748
|
-
|
|
9248
|
+
return /* @__PURE__ */ React128.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React128.createElement(RepeaterHeader, { label, adornment }, shouldShowInfotip ? /* @__PURE__ */ React128.createElement(
|
|
9249
|
+
import_ui112.Infotip,
|
|
8749
9250
|
{
|
|
8750
9251
|
placement: "right",
|
|
8751
9252
|
content: addButtonInfotipContent,
|
|
8752
9253
|
color: "secondary",
|
|
8753
9254
|
slotProps: { popper: { sx: { width: 300 } } }
|
|
8754
9255
|
},
|
|
8755
|
-
/* @__PURE__ */
|
|
8756
|
-
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */
|
|
9256
|
+
/* @__PURE__ */ React128.createElement(import_ui112.Box, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
|
|
9257
|
+
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React128.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
|
|
8757
9258
|
const index = uniqueKeys.indexOf(key);
|
|
8758
9259
|
const value = items2[index];
|
|
8759
9260
|
if (!value) {
|
|
8760
9261
|
return null;
|
|
8761
9262
|
}
|
|
8762
|
-
return /* @__PURE__ */
|
|
9263
|
+
return /* @__PURE__ */ React128.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React128.createElement(
|
|
8763
9264
|
RepeaterItem,
|
|
8764
9265
|
{
|
|
8765
9266
|
disabled,
|
|
8766
9267
|
propDisabled: value?.disabled,
|
|
8767
|
-
label: /* @__PURE__ */
|
|
8768
|
-
startIcon: /* @__PURE__ */
|
|
9268
|
+
label: /* @__PURE__ */ React128.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React128.createElement(itemSettings.Label, { value, index })),
|
|
9269
|
+
startIcon: /* @__PURE__ */ React128.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React128.createElement(itemSettings.Icon, { value })),
|
|
8769
9270
|
removeItem: () => removeRepeaterItem(index),
|
|
8770
9271
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
8771
9272
|
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
@@ -8779,7 +9280,7 @@ var Repeater3 = ({
|
|
|
8779
9280
|
actions: itemSettings.actions,
|
|
8780
9281
|
value
|
|
8781
9282
|
},
|
|
8782
|
-
(props) => /* @__PURE__ */
|
|
9283
|
+
(props) => /* @__PURE__ */ React128.createElement(
|
|
8783
9284
|
itemSettings.Content,
|
|
8784
9285
|
{
|
|
8785
9286
|
...props,
|
|
@@ -8819,18 +9320,18 @@ var RepeaterItem = ({
|
|
|
8819
9320
|
},
|
|
8820
9321
|
wrappedOnPopoverClose
|
|
8821
9322
|
);
|
|
8822
|
-
const triggerProps = (0,
|
|
9323
|
+
const triggerProps = (0, import_ui112.bindTrigger)(popoverState);
|
|
8823
9324
|
usePopoverDismiss({ isOpen: popoverState.isOpen, onClose: popoverProps.onClose });
|
|
8824
|
-
const duplicateLabel = (0,
|
|
8825
|
-
const toggleLabel = propDisabled ? (0,
|
|
8826
|
-
const removeLabel = (0,
|
|
8827
|
-
return /* @__PURE__ */
|
|
9325
|
+
const duplicateLabel = (0, import_i18n64.__)("Duplicate", "elementor");
|
|
9326
|
+
const toggleLabel = propDisabled ? (0, import_i18n64.__)("Show", "elementor") : (0, import_i18n64.__)("Hide", "elementor");
|
|
9327
|
+
const removeLabel = (0, import_i18n64.__)("Remove", "elementor");
|
|
9328
|
+
return /* @__PURE__ */ React128.createElement(import_ui112.Box, { sx: { display: "contents" } }, /* @__PURE__ */ React128.createElement(
|
|
8828
9329
|
RepeaterTag,
|
|
8829
9330
|
{
|
|
8830
9331
|
disabled,
|
|
8831
9332
|
label,
|
|
8832
9333
|
ref: setRef,
|
|
8833
|
-
"aria-label": (0,
|
|
9334
|
+
"aria-label": (0, import_i18n64.__)("Open item", "elementor"),
|
|
8834
9335
|
...triggerProps,
|
|
8835
9336
|
onClick: (e) => {
|
|
8836
9337
|
triggerProps.onClick(e);
|
|
@@ -8839,15 +9340,15 @@ var RepeaterItem = ({
|
|
|
8839
9340
|
}
|
|
8840
9341
|
},
|
|
8841
9342
|
startIcon,
|
|
8842
|
-
actions: /* @__PURE__ */
|
|
9343
|
+
actions: /* @__PURE__ */ React128.createElement(React128.Fragment, null, showDuplicate && /* @__PURE__ */ React128.createElement(import_ui112.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React128.createElement(import_ui112.IconButton, { size: SIZE12, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React128.createElement(import_icons42.CopyIcon, { fontSize: SIZE12 }))), showToggle && /* @__PURE__ */ React128.createElement(import_ui112.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React128.createElement(import_ui112.IconButton, { size: SIZE12, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React128.createElement(import_icons42.EyeOffIcon, { fontSize: SIZE12 }) : /* @__PURE__ */ React128.createElement(import_icons42.EyeIcon, { fontSize: SIZE12 }))), actions?.(value), showRemove && /* @__PURE__ */ React128.createElement(import_ui112.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React128.createElement(import_ui112.IconButton, { size: SIZE12, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React128.createElement(import_icons42.XIcon, { fontSize: SIZE12 }))))
|
|
8843
9344
|
}
|
|
8844
|
-
), /* @__PURE__ */
|
|
9345
|
+
), /* @__PURE__ */ React128.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React128.createElement(import_ui112.Box, null, children({ anchorEl: ref }))));
|
|
8845
9346
|
};
|
|
8846
9347
|
var usePopover = (openOnMount, onOpen, onPopoverClose) => {
|
|
8847
|
-
const [ref, setRef] = (0,
|
|
8848
|
-
const popoverState = (0,
|
|
8849
|
-
const popoverProps = (0,
|
|
8850
|
-
(0,
|
|
9348
|
+
const [ref, setRef] = (0, import_react76.useState)(null);
|
|
9349
|
+
const popoverState = (0, import_ui112.usePopupState)({ variant: "popover" });
|
|
9350
|
+
const popoverProps = (0, import_ui112.bindPopover)(popoverState);
|
|
9351
|
+
(0, import_react76.useEffect)(() => {
|
|
8851
9352
|
if (openOnMount && ref) {
|
|
8852
9353
|
popoverState.open(ref);
|
|
8853
9354
|
onOpen?.();
|
|
@@ -8865,276 +9366,6 @@ var usePopover = (openOnMount, onOpen, onPopoverClose) => {
|
|
|
8865
9366
|
};
|
|
8866
9367
|
};
|
|
8867
9368
|
|
|
8868
|
-
// src/components/inline-editor-toolbar.tsx
|
|
8869
|
-
var React128 = __toESM(require("react"));
|
|
8870
|
-
var import_react75 = require("react");
|
|
8871
|
-
var import_editor_elements8 = require("@elementor/editor-elements");
|
|
8872
|
-
var import_icons42 = require("@elementor/icons");
|
|
8873
|
-
var import_ui112 = require("@elementor/ui");
|
|
8874
|
-
var import_react76 = require("@tiptap/react");
|
|
8875
|
-
var import_i18n64 = require("@wordpress/i18n");
|
|
8876
|
-
|
|
8877
|
-
// src/components/url-popover.tsx
|
|
8878
|
-
var React127 = __toESM(require("react"));
|
|
8879
|
-
var import_react74 = require("react");
|
|
8880
|
-
var import_icons41 = require("@elementor/icons");
|
|
8881
|
-
var import_ui111 = require("@elementor/ui");
|
|
8882
|
-
var import_i18n63 = require("@wordpress/i18n");
|
|
8883
|
-
var UrlPopover = ({
|
|
8884
|
-
popupState,
|
|
8885
|
-
restoreValue,
|
|
8886
|
-
anchorRef,
|
|
8887
|
-
value,
|
|
8888
|
-
onChange,
|
|
8889
|
-
openInNewTab,
|
|
8890
|
-
onToggleNewTab
|
|
8891
|
-
}) => {
|
|
8892
|
-
const inputRef = (0, import_react74.useRef)(null);
|
|
8893
|
-
(0, import_react74.useEffect)(() => {
|
|
8894
|
-
if (popupState.isOpen) {
|
|
8895
|
-
requestAnimationFrame(() => inputRef.current?.focus());
|
|
8896
|
-
}
|
|
8897
|
-
}, [popupState.isOpen]);
|
|
8898
|
-
const handleClose = () => {
|
|
8899
|
-
restoreValue();
|
|
8900
|
-
popupState.close();
|
|
8901
|
-
};
|
|
8902
|
-
return /* @__PURE__ */ React127.createElement(
|
|
8903
|
-
import_ui111.Popover,
|
|
8904
|
-
{
|
|
8905
|
-
slotProps: {
|
|
8906
|
-
paper: { sx: { borderRadius: "16px", width: anchorRef.current?.offsetWidth + "px", marginTop: -1 } }
|
|
8907
|
-
},
|
|
8908
|
-
...(0, import_ui111.bindPopover)(popupState),
|
|
8909
|
-
anchorOrigin: { vertical: "top", horizontal: "left" },
|
|
8910
|
-
transformOrigin: { vertical: "top", horizontal: "left" },
|
|
8911
|
-
onClose: handleClose
|
|
8912
|
-
},
|
|
8913
|
-
/* @__PURE__ */ React127.createElement(import_ui111.Stack, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React127.createElement(
|
|
8914
|
-
import_ui111.TextField,
|
|
8915
|
-
{
|
|
8916
|
-
value,
|
|
8917
|
-
onChange,
|
|
8918
|
-
size: "tiny",
|
|
8919
|
-
fullWidth: true,
|
|
8920
|
-
placeholder: (0, import_i18n63.__)("Type a URL", "elementor"),
|
|
8921
|
-
inputProps: { ref: inputRef },
|
|
8922
|
-
color: "secondary",
|
|
8923
|
-
InputProps: { sx: { borderRadius: "8px" } },
|
|
8924
|
-
onKeyUp: (event) => event.key === "Enter" && handleClose()
|
|
8925
|
-
}
|
|
8926
|
-
), /* @__PURE__ */ React127.createElement(import_ui111.Tooltip, { title: (0, import_i18n63.__)("Open in a new tab", "elementor") }, /* @__PURE__ */ React127.createElement(
|
|
8927
|
-
import_ui111.ToggleButton,
|
|
8928
|
-
{
|
|
8929
|
-
size: "tiny",
|
|
8930
|
-
value: "newTab",
|
|
8931
|
-
selected: openInNewTab,
|
|
8932
|
-
onClick: onToggleNewTab,
|
|
8933
|
-
"aria-label": (0, import_i18n63.__)("Open in a new tab", "elementor"),
|
|
8934
|
-
sx: { borderRadius: "8px" }
|
|
8935
|
-
},
|
|
8936
|
-
/* @__PURE__ */ React127.createElement(import_icons41.ExternalLinkIcon, { fontSize: "tiny" })
|
|
8937
|
-
)))
|
|
8938
|
-
);
|
|
8939
|
-
};
|
|
8940
|
-
|
|
8941
|
-
// src/components/inline-editor-toolbar.tsx
|
|
8942
|
-
var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
8943
|
-
const [urlValue, setUrlValue] = (0, import_react75.useState)("");
|
|
8944
|
-
const [openInNewTab, setOpenInNewTab] = (0, import_react75.useState)(false);
|
|
8945
|
-
const toolbarRef = (0, import_react75.useRef)(null);
|
|
8946
|
-
const linkPopupState = (0, import_ui112.usePopupState)({ variant: "popover" });
|
|
8947
|
-
const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
|
|
8948
|
-
const editorState = (0, import_react76.useEditorState)({
|
|
8949
|
-
editor,
|
|
8950
|
-
selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
|
|
8951
|
-
});
|
|
8952
|
-
const formatButtonsList = (0, import_react75.useMemo)(() => {
|
|
8953
|
-
const buttons = Object.values(formatButtons);
|
|
8954
|
-
if (isElementClickable) {
|
|
8955
|
-
return buttons.filter((button) => button.action !== "link");
|
|
8956
|
-
}
|
|
8957
|
-
return buttons;
|
|
8958
|
-
}, [isElementClickable]);
|
|
8959
|
-
const handleLinkClick = () => {
|
|
8960
|
-
const linkAttrs = editor.getAttributes("link");
|
|
8961
|
-
setUrlValue(linkAttrs.href || "");
|
|
8962
|
-
setOpenInNewTab(linkAttrs.target === "_blank");
|
|
8963
|
-
linkPopupState.open(toolbarRef.current);
|
|
8964
|
-
};
|
|
8965
|
-
const handleUrlChange = (event) => {
|
|
8966
|
-
setUrlValue(event.target.value);
|
|
8967
|
-
};
|
|
8968
|
-
const handleToggleNewTab = () => {
|
|
8969
|
-
setOpenInNewTab(!openInNewTab);
|
|
8970
|
-
};
|
|
8971
|
-
const handleUrlSubmit = () => {
|
|
8972
|
-
if (urlValue) {
|
|
8973
|
-
editor.chain().focus().setLink({
|
|
8974
|
-
href: urlValue,
|
|
8975
|
-
target: openInNewTab ? "_blank" : "_self"
|
|
8976
|
-
}).run();
|
|
8977
|
-
} else {
|
|
8978
|
-
editor.chain().focus().unsetLink().run();
|
|
8979
|
-
}
|
|
8980
|
-
if (elementId) {
|
|
8981
|
-
window.dispatchEvent(
|
|
8982
|
-
new CustomEvent("elementor:inline-link-changed", {
|
|
8983
|
-
detail: { elementId }
|
|
8984
|
-
})
|
|
8985
|
-
);
|
|
8986
|
-
}
|
|
8987
|
-
linkPopupState.close();
|
|
8988
|
-
};
|
|
8989
|
-
(0, import_react75.useEffect)(() => {
|
|
8990
|
-
editor?.commands?.focus();
|
|
8991
|
-
}, [editor]);
|
|
8992
|
-
return /* @__PURE__ */ React128.createElement(
|
|
8993
|
-
import_ui112.Box,
|
|
8994
|
-
{
|
|
8995
|
-
ref: toolbarRef,
|
|
8996
|
-
sx: {
|
|
8997
|
-
display: "inline-flex",
|
|
8998
|
-
gap: 0.5,
|
|
8999
|
-
padding: 0.5,
|
|
9000
|
-
borderRadius: "8px",
|
|
9001
|
-
backgroundColor: "background.paper",
|
|
9002
|
-
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.2)",
|
|
9003
|
-
alignItems: "center",
|
|
9004
|
-
visibility: linkPopupState.isOpen ? "hidden" : "visible",
|
|
9005
|
-
pointerEvents: linkPopupState.isOpen ? "none" : "all",
|
|
9006
|
-
...sx
|
|
9007
|
-
}
|
|
9008
|
-
},
|
|
9009
|
-
/* @__PURE__ */ React128.createElement(import_ui112.Tooltip, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React128.createElement(import_ui112.IconButton, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
|
|
9010
|
-
/* @__PURE__ */ React128.createElement(
|
|
9011
|
-
import_ui112.ToggleButtonGroup,
|
|
9012
|
-
{
|
|
9013
|
-
value: editorState,
|
|
9014
|
-
size: "tiny",
|
|
9015
|
-
sx: {
|
|
9016
|
-
display: "flex",
|
|
9017
|
-
gap: 0.5,
|
|
9018
|
-
border: "none",
|
|
9019
|
-
[`& .${import_ui112.toggleButtonGroupClasses.firstButton}, & .${import_ui112.toggleButtonGroupClasses.middleButton}, & .${import_ui112.toggleButtonGroupClasses.lastButton}`]: {
|
|
9020
|
-
borderRadius: "8px",
|
|
9021
|
-
border: "none",
|
|
9022
|
-
marginLeft: 0,
|
|
9023
|
-
"&.Mui-selected": {
|
|
9024
|
-
marginLeft: 0
|
|
9025
|
-
},
|
|
9026
|
-
"& + &.Mui-selected": {
|
|
9027
|
-
marginLeft: 0
|
|
9028
|
-
}
|
|
9029
|
-
}
|
|
9030
|
-
}
|
|
9031
|
-
},
|
|
9032
|
-
formatButtonsList.map((button) => /* @__PURE__ */ React128.createElement(import_ui112.Tooltip, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React128.createElement(
|
|
9033
|
-
import_ui112.ToggleButton,
|
|
9034
|
-
{
|
|
9035
|
-
value: button.action,
|
|
9036
|
-
"aria-label": button.label,
|
|
9037
|
-
size: "tiny",
|
|
9038
|
-
onClick: () => {
|
|
9039
|
-
if (button.action === "link") {
|
|
9040
|
-
handleLinkClick();
|
|
9041
|
-
} else {
|
|
9042
|
-
button.method?.(editor);
|
|
9043
|
-
}
|
|
9044
|
-
editor?.commands?.focus();
|
|
9045
|
-
}
|
|
9046
|
-
},
|
|
9047
|
-
button.icon
|
|
9048
|
-
)))
|
|
9049
|
-
),
|
|
9050
|
-
/* @__PURE__ */ React128.createElement(
|
|
9051
|
-
UrlPopover,
|
|
9052
|
-
{
|
|
9053
|
-
popupState: linkPopupState,
|
|
9054
|
-
anchorRef: toolbarRef,
|
|
9055
|
-
restoreValue: handleUrlSubmit,
|
|
9056
|
-
value: urlValue,
|
|
9057
|
-
onChange: handleUrlChange,
|
|
9058
|
-
openInNewTab,
|
|
9059
|
-
onToggleNewTab: handleToggleNewTab
|
|
9060
|
-
}
|
|
9061
|
-
)
|
|
9062
|
-
);
|
|
9063
|
-
};
|
|
9064
|
-
var checkIfElementIsClickable = (elementId) => {
|
|
9065
|
-
const container = (0, import_editor_elements8.getContainer)(elementId);
|
|
9066
|
-
const type = container?.model.get("widgetType");
|
|
9067
|
-
const isButton = type === "e-button";
|
|
9068
|
-
const hasLink = !!(0, import_editor_elements8.getElementSetting)(elementId, "link")?.value?.destination;
|
|
9069
|
-
return isButton || hasLink;
|
|
9070
|
-
};
|
|
9071
|
-
var toolbarButtons = {
|
|
9072
|
-
clear: {
|
|
9073
|
-
label: (0, import_i18n64.__)("Clear", "elementor"),
|
|
9074
|
-
icon: /* @__PURE__ */ React128.createElement(import_icons42.MinusIcon, { fontSize: "tiny" }),
|
|
9075
|
-
action: "clear",
|
|
9076
|
-
method: (editor) => {
|
|
9077
|
-
editor.chain().focus().clearNodes().unsetAllMarks().run();
|
|
9078
|
-
}
|
|
9079
|
-
},
|
|
9080
|
-
bold: {
|
|
9081
|
-
label: (0, import_i18n64.__)("Bold", "elementor"),
|
|
9082
|
-
icon: /* @__PURE__ */ React128.createElement(import_icons42.BoldIcon, { fontSize: "tiny" }),
|
|
9083
|
-
action: "bold",
|
|
9084
|
-
method: (editor) => {
|
|
9085
|
-
editor.chain().focus().toggleBold().run();
|
|
9086
|
-
}
|
|
9087
|
-
},
|
|
9088
|
-
italic: {
|
|
9089
|
-
label: (0, import_i18n64.__)("Italic", "elementor"),
|
|
9090
|
-
icon: /* @__PURE__ */ React128.createElement(import_icons42.ItalicIcon, { fontSize: "tiny" }),
|
|
9091
|
-
action: "italic",
|
|
9092
|
-
method: (editor) => {
|
|
9093
|
-
editor.chain().focus().toggleItalic().run();
|
|
9094
|
-
}
|
|
9095
|
-
},
|
|
9096
|
-
underline: {
|
|
9097
|
-
label: (0, import_i18n64.__)("Underline", "elementor"),
|
|
9098
|
-
icon: /* @__PURE__ */ React128.createElement(import_icons42.UnderlineIcon, { fontSize: "tiny" }),
|
|
9099
|
-
action: "underline",
|
|
9100
|
-
method: (editor) => {
|
|
9101
|
-
editor.chain().focus().toggleUnderline().run();
|
|
9102
|
-
}
|
|
9103
|
-
},
|
|
9104
|
-
strike: {
|
|
9105
|
-
label: (0, import_i18n64.__)("Strikethrough", "elementor"),
|
|
9106
|
-
icon: /* @__PURE__ */ React128.createElement(import_icons42.StrikethroughIcon, { fontSize: "tiny" }),
|
|
9107
|
-
action: "strike",
|
|
9108
|
-
method: (editor) => {
|
|
9109
|
-
editor.chain().focus().toggleStrike().run();
|
|
9110
|
-
}
|
|
9111
|
-
},
|
|
9112
|
-
superscript: {
|
|
9113
|
-
label: (0, import_i18n64.__)("Superscript", "elementor"),
|
|
9114
|
-
icon: /* @__PURE__ */ React128.createElement(import_icons42.SuperscriptIcon, { fontSize: "tiny" }),
|
|
9115
|
-
action: "superscript",
|
|
9116
|
-
method: (editor) => {
|
|
9117
|
-
editor.chain().focus().toggleSuperscript().run();
|
|
9118
|
-
}
|
|
9119
|
-
},
|
|
9120
|
-
subscript: {
|
|
9121
|
-
label: (0, import_i18n64.__)("Subscript", "elementor"),
|
|
9122
|
-
icon: /* @__PURE__ */ React128.createElement(import_icons42.SubscriptIcon, { fontSize: "tiny" }),
|
|
9123
|
-
action: "subscript",
|
|
9124
|
-
method: (editor) => {
|
|
9125
|
-
editor.chain().focus().toggleSubscript().run();
|
|
9126
|
-
}
|
|
9127
|
-
},
|
|
9128
|
-
link: {
|
|
9129
|
-
label: (0, import_i18n64.__)("Link", "elementor"),
|
|
9130
|
-
icon: /* @__PURE__ */ React128.createElement(import_icons42.LinkIcon, { fontSize: "tiny" }),
|
|
9131
|
-
action: "link",
|
|
9132
|
-
method: null
|
|
9133
|
-
}
|
|
9134
|
-
};
|
|
9135
|
-
var { clear: clearButton, ...formatButtons } = toolbarButtons;
|
|
9136
|
-
var possibleFormats = Object.keys(formatButtons);
|
|
9137
|
-
|
|
9138
9369
|
// src/components/size/unstable-size-field.tsx
|
|
9139
9370
|
var React131 = __toESM(require("react"));
|
|
9140
9371
|
var import_ui114 = require("@elementor/ui");
|