@elementor/editor-controls 4.3.0-1059 → 4.3.0-1060
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 +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +243 -135
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +201 -83
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
- package/src/controls/open-icon-library.ts +82 -0
- package/src/controls/svg-media-control.tsx +124 -18
package/dist/index.mjs
CHANGED
|
@@ -5315,11 +5315,21 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
5315
5315
|
|
|
5316
5316
|
// src/controls/svg-media-control.tsx
|
|
5317
5317
|
import * as React81 from "react";
|
|
5318
|
-
import { useState as useState16 } from "react";
|
|
5318
|
+
import { useEffect as useEffect16, useState as useState16 } from "react";
|
|
5319
5319
|
import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
|
|
5320
|
-
import { svgSrcPropTypeUtil, urlPropTypeUtil as urlPropTypeUtil4 } from "@elementor/editor-props";
|
|
5320
|
+
import { iconPropTypeUtil, svgSrcPropTypeUtil, urlPropTypeUtil as urlPropTypeUtil4 } from "@elementor/editor-props";
|
|
5321
5321
|
import { UploadIcon as UploadIcon2 } from "@elementor/icons";
|
|
5322
|
-
import {
|
|
5322
|
+
import {
|
|
5323
|
+
Box as Box15,
|
|
5324
|
+
Button as Button5,
|
|
5325
|
+
Card as Card2,
|
|
5326
|
+
CardMedia as CardMedia2,
|
|
5327
|
+
CardOverlay as CardOverlay2,
|
|
5328
|
+
CircularProgress as CircularProgress3,
|
|
5329
|
+
Stack as Stack13,
|
|
5330
|
+
styled as styled9,
|
|
5331
|
+
ThemeProvider
|
|
5332
|
+
} from "@elementor/ui";
|
|
5323
5333
|
import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWpMediaFrame2 } from "@elementor/wp-media";
|
|
5324
5334
|
import { __ as __32 } from "@wordpress/i18n";
|
|
5325
5335
|
|
|
@@ -5383,10 +5393,49 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
5383
5393
|
isPending ? /* @__PURE__ */ React80.createElement(CircularProgress2, { size: 24 }) : __31("Enable", "elementor")
|
|
5384
5394
|
)));
|
|
5385
5395
|
|
|
5396
|
+
// src/controls/open-icon-library.ts
|
|
5397
|
+
import { stringPropTypeUtil as stringPropTypeUtil14 } from "@elementor/editor-props";
|
|
5398
|
+
var SVG_ICON_LIBRARY = "svg";
|
|
5399
|
+
function isSvgLibrarySelection(icon) {
|
|
5400
|
+
return icon.library === SVG_ICON_LIBRARY && typeof icon.value === "object" && icon.value !== null;
|
|
5401
|
+
}
|
|
5402
|
+
function openIconLibrary({ selected, onSelect } = {}) {
|
|
5403
|
+
const iconManager = window.elementor?.iconManager;
|
|
5404
|
+
if (!iconManager) {
|
|
5405
|
+
return;
|
|
5406
|
+
}
|
|
5407
|
+
iconManager.loadIconLibraries();
|
|
5408
|
+
iconManager.show({
|
|
5409
|
+
view: createIconManagerControlView(selected, onSelect)
|
|
5410
|
+
});
|
|
5411
|
+
}
|
|
5412
|
+
function enqueueIconFonts(library) {
|
|
5413
|
+
window.elementor?.helpers?.enqueueIconFonts?.(library);
|
|
5414
|
+
}
|
|
5415
|
+
function createIconManagerControlView(selected, onSelect) {
|
|
5416
|
+
return {
|
|
5417
|
+
model: {
|
|
5418
|
+
get: () => false
|
|
5419
|
+
},
|
|
5420
|
+
getControlValue: () => selected ?? { value: "", library: "" },
|
|
5421
|
+
setValue: (icon) => {
|
|
5422
|
+
onSelect?.(icon);
|
|
5423
|
+
},
|
|
5424
|
+
applySavedValue: () => void 0
|
|
5425
|
+
};
|
|
5426
|
+
}
|
|
5427
|
+
function createIconPropValue(icon, library) {
|
|
5428
|
+
return {
|
|
5429
|
+
value: stringPropTypeUtil14.create(icon),
|
|
5430
|
+
library: stringPropTypeUtil14.create(library)
|
|
5431
|
+
};
|
|
5432
|
+
}
|
|
5433
|
+
|
|
5386
5434
|
// src/controls/svg-media-control.tsx
|
|
5387
5435
|
var TILE_SIZE = 8;
|
|
5388
5436
|
var TILE_WHITE = "transparent";
|
|
5389
5437
|
var TILE_BLACK = "#c1c1c1";
|
|
5438
|
+
var ICON_PREVIEW_FONT_SIZE = 50;
|
|
5390
5439
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
5391
5440
|
var StyledCard = styled9(Card2)`
|
|
5392
5441
|
background-color: white;
|
|
@@ -5408,21 +5457,24 @@ var StyledCardMediaContainer = styled9(Stack13)`
|
|
|
5408
5457
|
`;
|
|
5409
5458
|
var MODE_BROWSE = { mode: "browse" };
|
|
5410
5459
|
var MODE_UPLOAD = { mode: "upload" };
|
|
5411
|
-
var SvgMediaControl = createControl(() => {
|
|
5412
|
-
const { value, setValue } = useBoundProp(svgSrcPropTypeUtil);
|
|
5413
|
-
const
|
|
5414
|
-
const
|
|
5460
|
+
var SvgMediaControl = createControl(({ showIconLibrary = false }) => {
|
|
5461
|
+
const { value: svgValue, setValue: setSvgValue } = useBoundProp(svgSrcPropTypeUtil);
|
|
5462
|
+
const { value: iconValue, setValue: setIconValue } = useBoundProp(iconPropTypeUtil);
|
|
5463
|
+
const id = svgValue?.id;
|
|
5464
|
+
const url = svgValue?.url;
|
|
5415
5465
|
const { data: attachment, isFetching } = useWpMediaAttachment2(id?.value || null);
|
|
5416
5466
|
const src = attachment?.url ?? url?.value ?? null;
|
|
5417
5467
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
5418
5468
|
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = useState16(false);
|
|
5419
5469
|
const { isAdmin } = useCurrentUserCapabilities();
|
|
5470
|
+
const selectedIconClass = showIconLibrary && typeof iconValue?.value?.value === "string" ? iconValue.value.value : null;
|
|
5471
|
+
const selectedIconLibrary = showIconLibrary && typeof iconValue?.library?.value === "string" ? iconValue.library.value : null;
|
|
5420
5472
|
const { open } = useWpMediaFrame2({
|
|
5421
5473
|
mediaTypes: ["svg"],
|
|
5422
5474
|
multiple: false,
|
|
5423
5475
|
selected: id?.value || null,
|
|
5424
5476
|
onSelect: (selectedAttachment) => {
|
|
5425
|
-
|
|
5477
|
+
setSvgValue({
|
|
5426
5478
|
id: {
|
|
5427
5479
|
$$type: "image-attachment-id",
|
|
5428
5480
|
value: selectedAttachment.id
|
|
@@ -5444,18 +5496,36 @@ var SvgMediaControl = createControl(() => {
|
|
|
5444
5496
|
open(openOptions);
|
|
5445
5497
|
}
|
|
5446
5498
|
};
|
|
5499
|
+
const handleIconLibrarySelect = (icon) => {
|
|
5500
|
+
if (!showIconLibrary) {
|
|
5501
|
+
return;
|
|
5502
|
+
}
|
|
5503
|
+
if (isSvgLibrarySelection(icon)) {
|
|
5504
|
+
setSvgValue({
|
|
5505
|
+
id: icon.value.id ? {
|
|
5506
|
+
$$type: "image-attachment-id",
|
|
5507
|
+
value: icon.value.id
|
|
5508
|
+
} : null,
|
|
5509
|
+
url: icon.value.url ? urlPropTypeUtil4.create(icon.value.url) : null
|
|
5510
|
+
});
|
|
5511
|
+
return;
|
|
5512
|
+
}
|
|
5513
|
+
if (typeof icon.value === "string") {
|
|
5514
|
+
setIconValue(createIconPropValue(icon.value, icon.library));
|
|
5515
|
+
}
|
|
5516
|
+
};
|
|
5447
5517
|
const infotipProps = {
|
|
5448
5518
|
title: __32("Sorry, you can't upload that file yet.", "elementor"),
|
|
5449
5519
|
description: /* @__PURE__ */ React81.createElement(React81.Fragment, null, __32("To upload them anyway, ask the site administrator to enable unfiltered", "elementor"), /* @__PURE__ */ React81.createElement("br", null), __32("file uploads.", "elementor")),
|
|
5450
5520
|
isEnabled: !isAdmin
|
|
5451
5521
|
};
|
|
5452
|
-
return /* @__PURE__ */ React81.createElement(Stack13, { 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,
|
|
5453
|
-
|
|
5522
|
+
return /* @__PURE__ */ React81.createElement(Stack13, { 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(
|
|
5523
|
+
SvgMediaPreview,
|
|
5454
5524
|
{
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5525
|
+
isFetching,
|
|
5526
|
+
src,
|
|
5527
|
+
iconClassName: selectedIconClass,
|
|
5528
|
+
iconLibrary: selectedIconLibrary
|
|
5459
5529
|
}
|
|
5460
5530
|
)), /* @__PURE__ */ React81.createElement(
|
|
5461
5531
|
CardOverlay2,
|
|
@@ -5476,7 +5546,20 @@ var SvgMediaControl = createControl(() => {
|
|
|
5476
5546
|
"aria-label": "Select SVG"
|
|
5477
5547
|
},
|
|
5478
5548
|
__32("Select SVG", "elementor")
|
|
5479
|
-
),
|
|
5549
|
+
), showIconLibrary ? /* @__PURE__ */ React81.createElement(
|
|
5550
|
+
Button5,
|
|
5551
|
+
{
|
|
5552
|
+
size: "tiny",
|
|
5553
|
+
variant: "text",
|
|
5554
|
+
color: "inherit",
|
|
5555
|
+
onClick: () => openIconLibrary({
|
|
5556
|
+
selected: selectedIconClass && selectedIconLibrary ? { value: selectedIconClass, library: selectedIconLibrary } : void 0,
|
|
5557
|
+
onSelect: handleIconLibrarySelect
|
|
5558
|
+
}),
|
|
5559
|
+
"aria-label": __32("Icon library", "elementor")
|
|
5560
|
+
},
|
|
5561
|
+
__32("Icon library", "elementor")
|
|
5562
|
+
) : null, /* @__PURE__ */ React81.createElement(ConditionalControlInfotip, { ...infotipProps }, /* @__PURE__ */ React81.createElement("span", null, /* @__PURE__ */ React81.createElement(ThemeProvider, { colorScheme: isAdmin ? "light" : "dark" }, /* @__PURE__ */ React81.createElement(
|
|
5480
5563
|
Button5,
|
|
5481
5564
|
{
|
|
5482
5565
|
size: "tiny",
|
|
@@ -5491,6 +5574,41 @@ var SvgMediaControl = createControl(() => {
|
|
|
5491
5574
|
)))))
|
|
5492
5575
|
))));
|
|
5493
5576
|
});
|
|
5577
|
+
function SvgMediaPreview({
|
|
5578
|
+
isFetching,
|
|
5579
|
+
src,
|
|
5580
|
+
iconClassName,
|
|
5581
|
+
iconLibrary
|
|
5582
|
+
}) {
|
|
5583
|
+
useEffect16(() => {
|
|
5584
|
+
if (iconLibrary) {
|
|
5585
|
+
enqueueIconFonts(iconLibrary);
|
|
5586
|
+
}
|
|
5587
|
+
}, [iconLibrary]);
|
|
5588
|
+
if (isFetching) {
|
|
5589
|
+
return /* @__PURE__ */ React81.createElement(CircularProgress3, { role: "progressbar" });
|
|
5590
|
+
}
|
|
5591
|
+
if (iconClassName) {
|
|
5592
|
+
return /* @__PURE__ */ React81.createElement(
|
|
5593
|
+
Box15,
|
|
5594
|
+
{
|
|
5595
|
+
component: "i",
|
|
5596
|
+
className: iconClassName,
|
|
5597
|
+
"aria-label": __32("Preview icon", "elementor"),
|
|
5598
|
+
sx: { fontSize: ICON_PREVIEW_FONT_SIZE }
|
|
5599
|
+
}
|
|
5600
|
+
);
|
|
5601
|
+
}
|
|
5602
|
+
return /* @__PURE__ */ React81.createElement(
|
|
5603
|
+
CardMedia2,
|
|
5604
|
+
{
|
|
5605
|
+
component: "img",
|
|
5606
|
+
image: src,
|
|
5607
|
+
alt: __32("Preview SVG", "elementor"),
|
|
5608
|
+
sx: { maxHeight: "140px", width: `${ICON_PREVIEW_FONT_SIZE}px` }
|
|
5609
|
+
}
|
|
5610
|
+
);
|
|
5611
|
+
}
|
|
5494
5612
|
|
|
5495
5613
|
// src/controls/video-media-control.tsx
|
|
5496
5614
|
import * as React82 from "react";
|
|
@@ -5612,7 +5730,7 @@ import {
|
|
|
5612
5730
|
backgroundOverlayPropTypeUtil,
|
|
5613
5731
|
colorPropTypeUtil as colorPropTypeUtil3
|
|
5614
5732
|
} from "@elementor/editor-props";
|
|
5615
|
-
import { Box as
|
|
5733
|
+
import { Box as Box16, CardMedia as CardMedia4, styled as styled10, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator3 } from "@elementor/ui";
|
|
5616
5734
|
import { useWpMediaAttachment as useWpMediaAttachment4 } from "@elementor/wp-media";
|
|
5617
5735
|
import { __ as __38 } from "@wordpress/i18n";
|
|
5618
5736
|
|
|
@@ -5628,7 +5746,7 @@ import {
|
|
|
5628
5746
|
colorStopPropTypeUtil,
|
|
5629
5747
|
gradientColorStopPropTypeUtil,
|
|
5630
5748
|
numberPropTypeUtil as numberPropTypeUtil5,
|
|
5631
|
-
stringPropTypeUtil as
|
|
5749
|
+
stringPropTypeUtil as stringPropTypeUtil15
|
|
5632
5750
|
} from "@elementor/editor-props";
|
|
5633
5751
|
import { UnstableGradientBox } from "@elementor/ui";
|
|
5634
5752
|
var BackgroundGradientColorControl = createControl(() => {
|
|
@@ -5636,13 +5754,13 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
5636
5754
|
const handleChange = (newValue) => {
|
|
5637
5755
|
const transformedValue = createTransformableValue(newValue);
|
|
5638
5756
|
if (transformedValue.positions) {
|
|
5639
|
-
transformedValue.positions =
|
|
5757
|
+
transformedValue.positions = stringPropTypeUtil15.create(newValue.positions.join(" "));
|
|
5640
5758
|
}
|
|
5641
5759
|
setValue(transformedValue);
|
|
5642
5760
|
};
|
|
5643
5761
|
const createTransformableValue = (newValue) => ({
|
|
5644
5762
|
...newValue,
|
|
5645
|
-
type:
|
|
5763
|
+
type: stringPropTypeUtil15.create(newValue.type),
|
|
5646
5764
|
angle: numberPropTypeUtil5.create(newValue.angle),
|
|
5647
5765
|
stops: gradientColorStopPropTypeUtil.create(
|
|
5648
5766
|
newValue.stops.map(
|
|
@@ -5678,7 +5796,7 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
5678
5796
|
);
|
|
5679
5797
|
});
|
|
5680
5798
|
var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.create({
|
|
5681
|
-
type:
|
|
5799
|
+
type: stringPropTypeUtil15.create("linear"),
|
|
5682
5800
|
angle: numberPropTypeUtil5.create(180),
|
|
5683
5801
|
stops: gradientColorStopPropTypeUtil.create([
|
|
5684
5802
|
colorStopPropTypeUtil.create({
|
|
@@ -5718,7 +5836,7 @@ var BackgroundImageOverlayAttachment = () => {
|
|
|
5718
5836
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
5719
5837
|
import * as React85 from "react";
|
|
5720
5838
|
import { useRef as useRef15 } from "react";
|
|
5721
|
-
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as
|
|
5839
|
+
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil16 } from "@elementor/editor-props";
|
|
5722
5840
|
import { MenuListItem as MenuListItem6 } from "@elementor/editor-ui";
|
|
5723
5841
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
5724
5842
|
import { Grid as Grid15, Select as Select4 } from "@elementor/ui";
|
|
@@ -5737,7 +5855,7 @@ var backgroundPositionOptions = [
|
|
|
5737
5855
|
];
|
|
5738
5856
|
var BackgroundImageOverlayPosition = () => {
|
|
5739
5857
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
5740
|
-
const stringPropContext = useBoundProp(
|
|
5858
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil16);
|
|
5741
5859
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
5742
5860
|
const rowRef = useRef15(null);
|
|
5743
5861
|
const handlePositionChange = (event) => {
|
|
@@ -5813,7 +5931,7 @@ var BackgroundImageOverlayRepeat = () => {
|
|
|
5813
5931
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
5814
5932
|
import * as React87 from "react";
|
|
5815
5933
|
import { useRef as useRef16 } from "react";
|
|
5816
|
-
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as
|
|
5934
|
+
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil17 } from "@elementor/editor-props";
|
|
5817
5935
|
import {
|
|
5818
5936
|
ArrowBarBothIcon,
|
|
5819
5937
|
ArrowsMaximizeIcon,
|
|
@@ -5852,7 +5970,7 @@ var sizeControlOptions = [
|
|
|
5852
5970
|
];
|
|
5853
5971
|
var BackgroundImageOverlaySize = () => {
|
|
5854
5972
|
const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
|
|
5855
|
-
const stringPropContext = useBoundProp(
|
|
5973
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil17);
|
|
5856
5974
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
5857
5975
|
const rowRef = useRef16(null);
|
|
5858
5976
|
const handleSizeChange = (size) => {
|
|
@@ -6014,7 +6132,7 @@ var ItemContent2 = () => {
|
|
|
6014
6132
|
gradient: initialBackgroundGradientOverlay.value
|
|
6015
6133
|
});
|
|
6016
6134
|
const { rowRef } = useRepeaterContext();
|
|
6017
|
-
return /* @__PURE__ */ React88.createElement(
|
|
6135
|
+
return /* @__PURE__ */ React88.createElement(Box16, { sx: { width: "100%" } }, /* @__PURE__ */ React88.createElement(Box16, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React88.createElement(
|
|
6018
6136
|
Tabs,
|
|
6019
6137
|
{
|
|
6020
6138
|
size: "small",
|
|
@@ -6163,7 +6281,7 @@ var BackgroundClipField = () => {
|
|
|
6163
6281
|
import * as React90 from "react";
|
|
6164
6282
|
import { useMemo as useMemo12 } from "react";
|
|
6165
6283
|
import { createArrayPropUtils as createArrayPropUtils2 } from "@elementor/editor-props";
|
|
6166
|
-
import { Box as
|
|
6284
|
+
import { Box as Box17 } from "@elementor/ui";
|
|
6167
6285
|
var PLACEHOLDER_REGEX = /\$\{([^}]+)\}/g;
|
|
6168
6286
|
var RepeatableControl = createControl(
|
|
6169
6287
|
({
|
|
@@ -6309,7 +6427,7 @@ var ItemLabel4 = ({ value }) => {
|
|
|
6309
6427
|
const label = showPlaceholder ? placeholder : interpolate(patternLabel, value);
|
|
6310
6428
|
const isReadOnly = !!childProps?.readOnly;
|
|
6311
6429
|
const color = getTextColor(isReadOnly, showPlaceholder);
|
|
6312
|
-
return /* @__PURE__ */ React90.createElement(
|
|
6430
|
+
return /* @__PURE__ */ React90.createElement(Box17, { component: "span", color }, label);
|
|
6313
6431
|
};
|
|
6314
6432
|
var getAllProperties = (pattern) => {
|
|
6315
6433
|
const properties = pattern.match(PLACEHOLDER_REGEX)?.map((match) => match.slice(2, -1)) || [];
|
|
@@ -6322,7 +6440,7 @@ import { useMemo as useMemo13, useState as useState17 } from "react";
|
|
|
6322
6440
|
import {
|
|
6323
6441
|
isTransformable,
|
|
6324
6442
|
keyValuePropTypeUtil,
|
|
6325
|
-
stringPropTypeUtil as
|
|
6443
|
+
stringPropTypeUtil as stringPropTypeUtil18
|
|
6326
6444
|
} from "@elementor/editor-props";
|
|
6327
6445
|
import { FormHelperText, FormLabel as FormLabel3, Grid as Grid19 } from "@elementor/ui";
|
|
6328
6446
|
import { __ as __40 } from "@wordpress/i18n";
|
|
@@ -6394,7 +6512,7 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
6394
6512
|
});
|
|
6395
6513
|
return;
|
|
6396
6514
|
}
|
|
6397
|
-
const extractedValue =
|
|
6515
|
+
const extractedValue = stringPropTypeUtil18.extract(newChangedValue);
|
|
6398
6516
|
setSessionState((prev) => ({
|
|
6399
6517
|
...prev,
|
|
6400
6518
|
[fieldType]: extractedValue
|
|
@@ -6434,7 +6552,7 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
6434
6552
|
|
|
6435
6553
|
// src/controls/position-control.tsx
|
|
6436
6554
|
import * as React92 from "react";
|
|
6437
|
-
import { positionPropTypeUtil, stringPropTypeUtil as
|
|
6555
|
+
import { positionPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil19 } from "@elementor/editor-props";
|
|
6438
6556
|
import { MenuListItem as MenuListItem7 } from "@elementor/editor-ui";
|
|
6439
6557
|
import { LetterXIcon as LetterXIcon2, LetterYIcon as LetterYIcon2 } from "@elementor/icons";
|
|
6440
6558
|
import { Grid as Grid20, Select as Select5 } from "@elementor/ui";
|
|
@@ -6453,7 +6571,7 @@ var positionOptions = [
|
|
|
6453
6571
|
];
|
|
6454
6572
|
var PositionControl = () => {
|
|
6455
6573
|
const positionContext = useBoundProp(positionPropTypeUtil);
|
|
6456
|
-
const stringPropContext = useBoundProp(
|
|
6574
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil19);
|
|
6457
6575
|
const isCustom = !!positionContext.value;
|
|
6458
6576
|
const placeholder = positionContext.placeholder ? "custom" : stringPropContext.placeholder ?? null;
|
|
6459
6577
|
const handlePositionChange = (event) => {
|
|
@@ -6496,7 +6614,7 @@ import * as React105 from "react";
|
|
|
6496
6614
|
import { useRef as useRef25 } from "react";
|
|
6497
6615
|
import { transformFunctionsPropTypeUtil, transformPropTypeUtil } from "@elementor/editor-props";
|
|
6498
6616
|
import { AdjustmentsIcon as AdjustmentsIcon2, InfoCircleFilledIcon as InfoCircleFilledIcon2 } from "@elementor/icons";
|
|
6499
|
-
import { bindTrigger as bindTrigger5, Box as
|
|
6617
|
+
import { bindTrigger as bindTrigger5, Box as Box21, IconButton as IconButton8, Tooltip as Tooltip8, Typography as Typography7, usePopupState as usePopupState8 } from "@elementor/ui";
|
|
6500
6618
|
import { __ as __51 } from "@wordpress/i18n";
|
|
6501
6619
|
|
|
6502
6620
|
// src/controls/transform-control/initial-values.ts
|
|
@@ -6552,7 +6670,7 @@ var initialSkewValue = skewTransformPropTypeUtil.create({
|
|
|
6552
6670
|
|
|
6553
6671
|
// src/controls/transform-control/transform-content.tsx
|
|
6554
6672
|
import * as React99 from "react";
|
|
6555
|
-
import { Box as
|
|
6673
|
+
import { Box as Box18, Tab as Tab2, TabPanel as TabPanel2, Tabs as Tabs2 } from "@elementor/ui";
|
|
6556
6674
|
import { __ as __46 } from "@wordpress/i18n";
|
|
6557
6675
|
|
|
6558
6676
|
// src/controls/transform-control/functions/move.tsx
|
|
@@ -6823,7 +6941,7 @@ var TransformContent = () => {
|
|
|
6823
6941
|
rotate: initialRotateValue.value,
|
|
6824
6942
|
skew: initialSkewValue.value
|
|
6825
6943
|
});
|
|
6826
|
-
return /* @__PURE__ */ React99.createElement(PopoverContent, null, /* @__PURE__ */ React99.createElement(
|
|
6944
|
+
return /* @__PURE__ */ React99.createElement(PopoverContent, null, /* @__PURE__ */ React99.createElement(Box18, { sx: { width: "100%" } }, /* @__PURE__ */ React99.createElement(Box18, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React99.createElement(
|
|
6827
6945
|
Tabs2,
|
|
6828
6946
|
{
|
|
6829
6947
|
size: "small",
|
|
@@ -6863,7 +6981,7 @@ var TransformIcon = ({ value }) => {
|
|
|
6863
6981
|
|
|
6864
6982
|
// src/controls/transform-control/transform-label.tsx
|
|
6865
6983
|
import * as React101 from "react";
|
|
6866
|
-
import { Box as
|
|
6984
|
+
import { Box as Box19 } from "@elementor/ui";
|
|
6867
6985
|
import { __ as __47 } from "@wordpress/i18n";
|
|
6868
6986
|
var orderedAxis = ["x", "y", "z"];
|
|
6869
6987
|
var formatLabel = (value, functionType) => {
|
|
@@ -6894,14 +7012,14 @@ var TransformLabel = (props) => {
|
|
|
6894
7012
|
}
|
|
6895
7013
|
};
|
|
6896
7014
|
var Label2 = ({ label, value }) => {
|
|
6897
|
-
return /* @__PURE__ */ React101.createElement(
|
|
7015
|
+
return /* @__PURE__ */ React101.createElement(Box19, { component: "span" }, label, ": ", value);
|
|
6898
7016
|
};
|
|
6899
7017
|
|
|
6900
7018
|
// src/controls/transform-control/transform-settings-control.tsx
|
|
6901
7019
|
import * as React104 from "react";
|
|
6902
7020
|
import { PopoverHeader as PopoverHeader4 } from "@elementor/editor-ui";
|
|
6903
7021
|
import { AdjustmentsIcon } from "@elementor/icons";
|
|
6904
|
-
import { bindPopover as bindPopover6, Box as
|
|
7022
|
+
import { bindPopover as bindPopover6, Box as Box20, Divider as Divider4, Popover as Popover6 } from "@elementor/ui";
|
|
6905
7023
|
import { __ as __50 } from "@wordpress/i18n";
|
|
6906
7024
|
|
|
6907
7025
|
// src/controls/transform-control/transform-base-controls/children-perspective-control.tsx
|
|
@@ -7011,7 +7129,7 @@ var TransformSettingsControl = ({
|
|
|
7011
7129
|
}
|
|
7012
7130
|
),
|
|
7013
7131
|
/* @__PURE__ */ React104.createElement(Divider4, null),
|
|
7014
|
-
/* @__PURE__ */ React104.createElement(PopoverContent, { sx: { px: 2, py: 1.5 } }, /* @__PURE__ */ React104.createElement(PropKeyProvider, { bind: "transform-origin" }, /* @__PURE__ */ React104.createElement(TransformOriginControl, null)), showChildrenPerspective && /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(
|
|
7132
|
+
/* @__PURE__ */ React104.createElement(PopoverContent, { sx: { px: 2, py: 1.5 } }, /* @__PURE__ */ React104.createElement(PropKeyProvider, { bind: "transform-origin" }, /* @__PURE__ */ React104.createElement(TransformOriginControl, null)), showChildrenPerspective && /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(Box20, { sx: { my: 0.5 } }, /* @__PURE__ */ React104.createElement(Divider4, null)), /* @__PURE__ */ React104.createElement(ChildrenPerspectiveControl, null)))
|
|
7015
7133
|
);
|
|
7016
7134
|
};
|
|
7017
7135
|
|
|
@@ -7033,7 +7151,7 @@ var TransformRepeaterControl = createControl(
|
|
|
7033
7151
|
}
|
|
7034
7152
|
);
|
|
7035
7153
|
var ToolTip = /* @__PURE__ */ React105.createElement(
|
|
7036
|
-
|
|
7154
|
+
Box21,
|
|
7037
7155
|
{
|
|
7038
7156
|
component: "span",
|
|
7039
7157
|
"aria-label": void 0,
|
|
@@ -7100,13 +7218,13 @@ var TransformBasePopoverTrigger = ({
|
|
|
7100
7218
|
|
|
7101
7219
|
// src/controls/transition-control/transition-repeater-control.tsx
|
|
7102
7220
|
import * as React108 from "react";
|
|
7103
|
-
import { useEffect as
|
|
7221
|
+
import { useEffect as useEffect17, useMemo as useMemo16, useState as useState18 } from "react";
|
|
7104
7222
|
import {
|
|
7105
7223
|
createArrayPropUtils as createArrayPropUtils3,
|
|
7106
7224
|
selectionSizePropTypeUtil as selectionSizePropTypeUtil2
|
|
7107
7225
|
} from "@elementor/editor-props";
|
|
7108
7226
|
import { InfoCircleFilledIcon as InfoCircleFilledIcon3 } from "@elementor/icons";
|
|
7109
|
-
import { Alert as Alert2, AlertTitle as AlertTitle3, Box as
|
|
7227
|
+
import { Alert as Alert2, AlertTitle as AlertTitle3, Box as Box23, Typography as Typography8 } from "@elementor/ui";
|
|
7110
7228
|
import { hasProInstalled as hasProInstalled2 } from "@elementor/utils";
|
|
7111
7229
|
import { __ as __54 } from "@wordpress/i18n";
|
|
7112
7230
|
|
|
@@ -7337,7 +7455,7 @@ import { useMemo as useMemo15, useRef as useRef27 } from "react";
|
|
|
7337
7455
|
import { keyValuePropTypeUtil as keyValuePropTypeUtil2 } from "@elementor/editor-props";
|
|
7338
7456
|
import { PromotionAlert, PromotionChip } from "@elementor/editor-ui";
|
|
7339
7457
|
import { ChevronDownIcon as ChevronDownIcon3, VariationsIcon } from "@elementor/icons";
|
|
7340
|
-
import { bindPopover as bindPopover7, bindTrigger as bindTrigger6, Box as
|
|
7458
|
+
import { bindPopover as bindPopover7, bindTrigger as bindTrigger6, Box as Box22, Popover as Popover7, UnstableTag as UnstableTag3, usePopupState as usePopupState9 } from "@elementor/ui";
|
|
7341
7459
|
import { __ as __53 } from "@wordpress/i18n";
|
|
7342
7460
|
|
|
7343
7461
|
// src/utils/tracking.ts
|
|
@@ -7465,7 +7583,7 @@ var TransitionSelector = ({
|
|
|
7465
7583
|
left: rect.right + 36
|
|
7466
7584
|
};
|
|
7467
7585
|
};
|
|
7468
|
-
return /* @__PURE__ */ React107.createElement(
|
|
7586
|
+
return /* @__PURE__ */ React107.createElement(Box22, { ref: defaultRef }, /* @__PURE__ */ React107.createElement(ControlActions, null, /* @__PURE__ */ React107.createElement(
|
|
7469
7587
|
UnstableTag3,
|
|
7470
7588
|
{
|
|
7471
7589
|
variant: "outlined",
|
|
@@ -7497,7 +7615,7 @@ var TransitionSelector = ({
|
|
|
7497
7615
|
icon: VariationsIcon,
|
|
7498
7616
|
disabledItems: includeCurrentValueInOptions(value, disabledItems),
|
|
7499
7617
|
categoryItemContentTemplate: (item) => /* @__PURE__ */ React107.createElement(
|
|
7500
|
-
|
|
7618
|
+
Box22,
|
|
7501
7619
|
{
|
|
7502
7620
|
sx: {
|
|
7503
7621
|
display: "flex",
|
|
@@ -7639,7 +7757,7 @@ var disableAddItemTooltipContent = /* @__PURE__ */ React108.createElement(
|
|
|
7639
7757
|
icon: /* @__PURE__ */ React108.createElement(InfoCircleFilledIcon3, null)
|
|
7640
7758
|
},
|
|
7641
7759
|
/* @__PURE__ */ React108.createElement(AlertTitle3, null, __54("Transitions", "elementor")),
|
|
7642
|
-
/* @__PURE__ */ React108.createElement(
|
|
7760
|
+
/* @__PURE__ */ React108.createElement(Box23, { component: "span" }, /* @__PURE__ */ React108.createElement(Typography8, { variant: "body2" }, __54("Switch to 'Normal' state to add a transition.", "elementor")))
|
|
7643
7761
|
);
|
|
7644
7762
|
var TransitionRepeaterControl = createControl(
|
|
7645
7763
|
({
|
|
@@ -7665,7 +7783,7 @@ var TransitionRepeaterControl = createControl(
|
|
|
7665
7783
|
});
|
|
7666
7784
|
return set;
|
|
7667
7785
|
}, [proInstalled]);
|
|
7668
|
-
|
|
7786
|
+
useEffect17(() => {
|
|
7669
7787
|
if (!value || value.length === 0) {
|
|
7670
7788
|
return;
|
|
7671
7789
|
}
|
|
@@ -7677,7 +7795,7 @@ var TransitionRepeaterControl = createControl(
|
|
|
7677
7795
|
setValue(sanitized);
|
|
7678
7796
|
}
|
|
7679
7797
|
}, [allowedTransitionSet]);
|
|
7680
|
-
|
|
7798
|
+
useEffect17(() => {
|
|
7681
7799
|
recentlyUsedListGetter().then(setRecentlyUsedList);
|
|
7682
7800
|
}, [recentlyUsedListGetter]);
|
|
7683
7801
|
const allPropertiesUsed = useMemo16(() => areAllPropertiesUsed(value), [value]);
|
|
@@ -7711,9 +7829,9 @@ var TransitionRepeaterControl = createControl(
|
|
|
7711
7829
|
// src/controls/date-time-control.tsx
|
|
7712
7830
|
import * as React109 from "react";
|
|
7713
7831
|
import * as dayjs from "dayjs";
|
|
7714
|
-
import { isTransformable as isTransformable2, stringPropTypeUtil as
|
|
7832
|
+
import { isTransformable as isTransformable2, stringPropTypeUtil as stringPropTypeUtil20 } from "@elementor/editor-props";
|
|
7715
7833
|
import { DateTimePropTypeUtil } from "@elementor/editor-props";
|
|
7716
|
-
import { Box as
|
|
7834
|
+
import { Box as Box24, DatePicker, LocalizationProvider, TimePicker } from "@elementor/ui";
|
|
7717
7835
|
var DATE_FORMAT = "YYYY-MM-DD";
|
|
7718
7836
|
var TIME_FORMAT = "HH:mm";
|
|
7719
7837
|
var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
@@ -7757,10 +7875,10 @@ var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
|
7757
7875
|
const base = dayjs.default();
|
|
7758
7876
|
return base.hour(h).minute(m).second(0).millisecond(0);
|
|
7759
7877
|
};
|
|
7760
|
-
return /* @__PURE__ */ React109.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React109.createElement(ControlActions, null, /* @__PURE__ */ React109.createElement(LocalizationProvider, null, /* @__PURE__ */ React109.createElement(
|
|
7878
|
+
return /* @__PURE__ */ React109.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React109.createElement(ControlActions, null, /* @__PURE__ */ React109.createElement(LocalizationProvider, null, /* @__PURE__ */ React109.createElement(Box24, { display: "flex", gap: 1, alignItems: "center" }, /* @__PURE__ */ React109.createElement(PropKeyProvider, { bind: "date" }, /* @__PURE__ */ React109.createElement(
|
|
7761
7879
|
DatePicker,
|
|
7762
7880
|
{
|
|
7763
|
-
value: parseDateValue(
|
|
7881
|
+
value: parseDateValue(stringPropTypeUtil20.extract(value?.date)),
|
|
7764
7882
|
onChange: (v) => handleChange({ date: v }, { bind: "date" }),
|
|
7765
7883
|
disabled: inputDisabled,
|
|
7766
7884
|
slotProps: {
|
|
@@ -7772,7 +7890,7 @@ var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
|
7772
7890
|
)), /* @__PURE__ */ React109.createElement(PropKeyProvider, { bind: "time" }, /* @__PURE__ */ React109.createElement(
|
|
7773
7891
|
TimePicker,
|
|
7774
7892
|
{
|
|
7775
|
-
value: parseTimeValue(
|
|
7893
|
+
value: parseTimeValue(stringPropTypeUtil20.extract(value?.time)),
|
|
7776
7894
|
onChange: (v) => handleChange({ time: v }, { bind: "time" }),
|
|
7777
7895
|
disabled: inputDisabled,
|
|
7778
7896
|
slotProps: {
|
|
@@ -7965,12 +8083,12 @@ var BoundTimeStringControl = ({ bind, ariaLabel }) => {
|
|
|
7965
8083
|
import * as React117 from "react";
|
|
7966
8084
|
import { useCallback as useCallback4, useState as useState20 } from "react";
|
|
7967
8085
|
import { escapedHtmlPropTypeUtil as escapedHtmlPropTypeUtil2 } from "@elementor/editor-props";
|
|
7968
|
-
import { Box as
|
|
8086
|
+
import { Box as Box27 } from "@elementor/ui";
|
|
7969
8087
|
|
|
7970
8088
|
// src/components/inline-editor.tsx
|
|
7971
8089
|
import * as React114 from "react";
|
|
7972
|
-
import { useEffect as
|
|
7973
|
-
import { Box as
|
|
8090
|
+
import { useEffect as useEffect18, useRef as useRef28 } from "react";
|
|
8091
|
+
import { Box as Box25 } from "@elementor/ui";
|
|
7974
8092
|
import Bold from "@tiptap/extension-bold";
|
|
7975
8093
|
import Document from "@tiptap/extension-document";
|
|
7976
8094
|
import HardBreak from "@tiptap/extension-hard-break";
|
|
@@ -7986,7 +8104,7 @@ import Underline from "@tiptap/extension-underline";
|
|
|
7986
8104
|
import { EditorContent, useEditor } from "@tiptap/react";
|
|
7987
8105
|
|
|
7988
8106
|
// src/utils/inline-editing.ts
|
|
7989
|
-
import { escapedHtmlPropTypeUtil, htmlV3PropTypeUtil, stringPropTypeUtil as
|
|
8107
|
+
import { escapedHtmlPropTypeUtil, htmlV3PropTypeUtil, stringPropTypeUtil as stringPropTypeUtil21 } from "@elementor/editor-props";
|
|
7990
8108
|
function isEmpty(value = "") {
|
|
7991
8109
|
if (!value) {
|
|
7992
8110
|
return true;
|
|
@@ -8008,7 +8126,7 @@ function extractInlineHtmlContent(propValue) {
|
|
|
8008
8126
|
return escapedHtmlPropTypeUtil.extract(propValue) ?? "";
|
|
8009
8127
|
}
|
|
8010
8128
|
const htmlV3 = htmlV3PropTypeUtil.extract(propValue);
|
|
8011
|
-
return
|
|
8129
|
+
return stringPropTypeUtil21.extract(htmlV3?.content ?? null) ?? "";
|
|
8012
8130
|
}
|
|
8013
8131
|
|
|
8014
8132
|
// src/components/inline-editor.tsx
|
|
@@ -8128,11 +8246,11 @@ var InlineEditor = React114.forwardRef((props, ref) => {
|
|
|
8128
8246
|
if (mountElement) {
|
|
8129
8247
|
return null;
|
|
8130
8248
|
}
|
|
8131
|
-
return /* @__PURE__ */ React114.createElement(
|
|
8249
|
+
return /* @__PURE__ */ React114.createElement(Box25, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React114.createElement(EditorContent, { ref, editor }));
|
|
8132
8250
|
});
|
|
8133
8251
|
var useOnUpdate = (callback, dependencies) => {
|
|
8134
8252
|
const hasMounted = useRef28(false);
|
|
8135
|
-
|
|
8253
|
+
useEffect18(() => {
|
|
8136
8254
|
if (hasMounted.current) {
|
|
8137
8255
|
callback();
|
|
8138
8256
|
} else {
|
|
@@ -8143,7 +8261,7 @@ var useOnUpdate = (callback, dependencies) => {
|
|
|
8143
8261
|
|
|
8144
8262
|
// src/components/inline-editor-toolbar.tsx
|
|
8145
8263
|
import * as React116 from "react";
|
|
8146
|
-
import { useEffect as
|
|
8264
|
+
import { useEffect as useEffect20, useMemo as useMemo17, useRef as useRef30, useState as useState19 } from "react";
|
|
8147
8265
|
import { getContainer as getContainer2, getElementSetting } from "@elementor/editor-elements";
|
|
8148
8266
|
import {
|
|
8149
8267
|
BoldIcon,
|
|
@@ -8156,7 +8274,7 @@ import {
|
|
|
8156
8274
|
UnderlineIcon
|
|
8157
8275
|
} from "@elementor/icons";
|
|
8158
8276
|
import {
|
|
8159
|
-
Box as
|
|
8277
|
+
Box as Box26,
|
|
8160
8278
|
IconButton as IconButton9,
|
|
8161
8279
|
ToggleButton as ToggleButton3,
|
|
8162
8280
|
ToggleButtonGroup as ToggleButtonGroup2,
|
|
@@ -8169,7 +8287,7 @@ import { __ as __58 } from "@wordpress/i18n";
|
|
|
8169
8287
|
|
|
8170
8288
|
// src/components/url-popover.tsx
|
|
8171
8289
|
import * as React115 from "react";
|
|
8172
|
-
import { useEffect as
|
|
8290
|
+
import { useEffect as useEffect19, useRef as useRef29 } from "react";
|
|
8173
8291
|
import { ExternalLinkIcon } from "@elementor/icons";
|
|
8174
8292
|
import { bindPopover as bindPopover8, Popover as Popover8, Stack as Stack19, TextField as TextField11, ToggleButton as ToggleButton2, Tooltip as Tooltip9 } from "@elementor/ui";
|
|
8175
8293
|
import { __ as __57 } from "@wordpress/i18n";
|
|
@@ -8183,7 +8301,7 @@ var UrlPopover = ({
|
|
|
8183
8301
|
onToggleNewTab
|
|
8184
8302
|
}) => {
|
|
8185
8303
|
const inputRef = useRef29(null);
|
|
8186
|
-
|
|
8304
|
+
useEffect19(() => {
|
|
8187
8305
|
if (popupState.isOpen) {
|
|
8188
8306
|
requestAnimationFrame(() => inputRef.current?.focus());
|
|
8189
8307
|
}
|
|
@@ -8284,13 +8402,13 @@ var InlineEditorToolbar = ({
|
|
|
8284
8402
|
}
|
|
8285
8403
|
linkPopupState.close();
|
|
8286
8404
|
};
|
|
8287
|
-
|
|
8405
|
+
useEffect20(() => {
|
|
8288
8406
|
if (!inControlPanel) {
|
|
8289
8407
|
editor?.commands?.focus();
|
|
8290
8408
|
}
|
|
8291
8409
|
}, [editor, inControlPanel]);
|
|
8292
8410
|
return /* @__PURE__ */ React116.createElement(
|
|
8293
|
-
|
|
8411
|
+
Box26,
|
|
8294
8412
|
{
|
|
8295
8413
|
ref: toolbarRef,
|
|
8296
8414
|
sx: {
|
|
@@ -8471,7 +8589,7 @@ var InlineEditingControl = createControl(({ sx, attributes, props, context: { el
|
|
|
8471
8589
|
},
|
|
8472
8590
|
[setValue]
|
|
8473
8591
|
);
|
|
8474
|
-
return /* @__PURE__ */ React117.createElement(ControlActions, null, /* @__PURE__ */ React117.createElement(
|
|
8592
|
+
return /* @__PURE__ */ React117.createElement(ControlActions, null, /* @__PURE__ */ React117.createElement(Box27, { sx: { position: "relative" } }, editor && editor.isEditable && /* @__PURE__ */ React117.createElement(
|
|
8475
8593
|
InlineEditorToolbar,
|
|
8476
8594
|
{
|
|
8477
8595
|
editor,
|
|
@@ -8485,7 +8603,7 @@ var InlineEditingControl = createControl(({ sx, attributes, props, context: { el
|
|
|
8485
8603
|
inControlPanel: true
|
|
8486
8604
|
}
|
|
8487
8605
|
), /* @__PURE__ */ React117.createElement(
|
|
8488
|
-
|
|
8606
|
+
Box27,
|
|
8489
8607
|
{
|
|
8490
8608
|
sx: {
|
|
8491
8609
|
p: 0.8,
|
|
@@ -8549,7 +8667,7 @@ var InlineEditingControl = createControl(({ sx, attributes, props, context: { el
|
|
|
8549
8667
|
import * as React121 from "react";
|
|
8550
8668
|
import { emailsPropTypeUtil } from "@elementor/editor-props";
|
|
8551
8669
|
import { CollapsibleContent } from "@elementor/editor-ui";
|
|
8552
|
-
import { Box as
|
|
8670
|
+
import { Box as Box28, Divider as Divider5, Stack as Stack21 } from "@elementor/ui";
|
|
8553
8671
|
import { __ as __60 } from "@wordpress/i18n";
|
|
8554
8672
|
|
|
8555
8673
|
// src/controls/email-form-action-control/fields.tsx
|
|
@@ -8560,7 +8678,7 @@ import { __ as __59 } from "@wordpress/i18n";
|
|
|
8560
8678
|
|
|
8561
8679
|
// src/hooks/use-form-field-suggestions.ts
|
|
8562
8680
|
import { getContainer as getContainer3, getSelectedElements as getSelectedElements3, getWidgetsCache } from "@elementor/editor-elements";
|
|
8563
|
-
import { stringPropTypeUtil as
|
|
8681
|
+
import { stringPropTypeUtil as stringPropTypeUtil22 } from "@elementor/editor-props";
|
|
8564
8682
|
import { __privateUseListenTo as useListenTo2, commandEndEvent as commandEndEvent2, v1ReadyEvent } from "@elementor/editor-v1-adapters";
|
|
8565
8683
|
var FORM_FIELD_WIDGET_TYPES = [
|
|
8566
8684
|
"e-form-input",
|
|
@@ -8577,7 +8695,7 @@ function isFormFieldWidgetType(widgetType) {
|
|
|
8577
8695
|
return FORM_FIELD_WIDGET_TYPES.includes(widgetType);
|
|
8578
8696
|
}
|
|
8579
8697
|
function extractStringPropValue(value) {
|
|
8580
|
-
return
|
|
8698
|
+
return stringPropTypeUtil22.extract(value);
|
|
8581
8699
|
}
|
|
8582
8700
|
function getSettingWithDefault(child, widgetType, key) {
|
|
8583
8701
|
const fromGet = child.settings.get(key);
|
|
@@ -8647,7 +8765,7 @@ function useFormFieldSuggestions(options) {
|
|
|
8647
8765
|
// src/controls/email-form-action-control/email-chips-field.tsx
|
|
8648
8766
|
import * as React118 from "react";
|
|
8649
8767
|
import { useMemo as useMemo18, useState as useState21 } from "react";
|
|
8650
|
-
import { stringArrayPropTypeUtil as stringArrayPropTypeUtil3, stringPropTypeUtil as
|
|
8768
|
+
import { stringArrayPropTypeUtil as stringArrayPropTypeUtil3, stringPropTypeUtil as stringPropTypeUtil23 } from "@elementor/editor-props";
|
|
8651
8769
|
import { Autocomplete as Autocomplete4, Grid as Grid32, TextField as TextField12 } from "@elementor/ui";
|
|
8652
8770
|
|
|
8653
8771
|
// src/controls/email-form-action-control/utils.ts
|
|
@@ -8686,7 +8804,7 @@ var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
|
|
|
8686
8804
|
const { value, setValue, disabled } = useBoundProp(stringArrayPropTypeUtil3);
|
|
8687
8805
|
const [inputValue, setInputValue] = useState21("");
|
|
8688
8806
|
const items2 = value || [];
|
|
8689
|
-
const selectedValues = items2.map((item) =>
|
|
8807
|
+
const selectedValues = items2.map((item) => stringPropTypeUtil23.extract(item)).filter((val) => val !== null);
|
|
8690
8808
|
const suggestionOptions = useMemo18(
|
|
8691
8809
|
() => suggestions.map((suggestion) => `[${suggestion.value}]`),
|
|
8692
8810
|
[suggestions]
|
|
@@ -8696,7 +8814,7 @@ var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
|
|
|
8696
8814
|
if (!address || selectedValues.includes(address) || !isValidRecipient(address)) {
|
|
8697
8815
|
return;
|
|
8698
8816
|
}
|
|
8699
|
-
setValue([...items2,
|
|
8817
|
+
setValue([...items2, stringPropTypeUtil23.create(address)]);
|
|
8700
8818
|
setInputValue("");
|
|
8701
8819
|
};
|
|
8702
8820
|
const handleChange = (_, newValue) => {
|
|
@@ -8706,7 +8824,7 @@ var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
|
|
|
8706
8824
|
if (!address || !isValidRecipient(address)) {
|
|
8707
8825
|
continue;
|
|
8708
8826
|
}
|
|
8709
|
-
updated.push(
|
|
8827
|
+
updated.push(stringPropTypeUtil23.create(address));
|
|
8710
8828
|
}
|
|
8711
8829
|
setValue(updated);
|
|
8712
8830
|
setInputValue("");
|
|
@@ -8851,7 +8969,7 @@ var EmailFormActionControl = createControl(
|
|
|
8851
8969
|
return /* @__PURE__ */ React121.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React121.createElement(Stack21, { gap: 2 }, /* @__PURE__ */ React121.createElement(ControlLabel, null, label ? label + " " + __60("settings", "elementor") : __60("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)));
|
|
8852
8970
|
}
|
|
8853
8971
|
);
|
|
8854
|
-
var AdvancedSettings = () => /* @__PURE__ */ React121.createElement(CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ React121.createElement(
|
|
8972
|
+
var AdvancedSettings = () => /* @__PURE__ */ React121.createElement(CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ React121.createElement(Box28, { sx: { pt: 2 } }, /* @__PURE__ */ React121.createElement(Stack21, { 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(Divider5, null), /* @__PURE__ */ React121.createElement(MetaDataField, null), /* @__PURE__ */ React121.createElement(SendAsField, null))));
|
|
8855
8973
|
|
|
8856
8974
|
// src/controls/attachment-type-control.tsx
|
|
8857
8975
|
import * as React122 from "react";
|
|
@@ -8916,7 +9034,7 @@ import { __ as __62 } from "@wordpress/i18n";
|
|
|
8916
9034
|
import * as React124 from "react";
|
|
8917
9035
|
import { forwardRef as forwardRef12, useCallback as useCallback5, useImperativeHandle, useState as useState22 } from "react";
|
|
8918
9036
|
import { PromotionChip as PromotionChip2, PromotionInfotip } from "@elementor/editor-ui";
|
|
8919
|
-
import { Box as
|
|
9037
|
+
import { Box as Box29 } from "@elementor/ui";
|
|
8920
9038
|
function getV4Promotion(key) {
|
|
8921
9039
|
return window.elementor?.config?.v4Promotions?.[key];
|
|
8922
9040
|
}
|
|
@@ -8948,7 +9066,7 @@ var PromotionTrigger = forwardRef12(
|
|
|
8948
9066
|
onCtaClick: () => trackUpgradePromotionClick(trackingData)
|
|
8949
9067
|
},
|
|
8950
9068
|
/* @__PURE__ */ React124.createElement(
|
|
8951
|
-
|
|
9069
|
+
Box29,
|
|
8952
9070
|
{
|
|
8953
9071
|
onClick: (e) => {
|
|
8954
9072
|
e.stopPropagation();
|
|
@@ -9042,12 +9160,12 @@ var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /*
|
|
|
9042
9160
|
|
|
9043
9161
|
// src/components/repeater/repeater.tsx
|
|
9044
9162
|
import * as React128 from "react";
|
|
9045
|
-
import { useEffect as
|
|
9163
|
+
import { useEffect as useEffect21, useState as useState23 } from "react";
|
|
9046
9164
|
import { CopyIcon as CopyIcon2, EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2, PlusIcon as PlusIcon5, XIcon as XIcon4 } from "@elementor/icons";
|
|
9047
9165
|
import {
|
|
9048
9166
|
bindPopover as bindPopover9,
|
|
9049
9167
|
bindTrigger as bindTrigger7,
|
|
9050
|
-
Box as
|
|
9168
|
+
Box as Box30,
|
|
9051
9169
|
IconButton as IconButton12,
|
|
9052
9170
|
Infotip as Infotip4,
|
|
9053
9171
|
Tooltip as Tooltip14,
|
|
@@ -9156,7 +9274,7 @@ var Repeater3 = ({
|
|
|
9156
9274
|
color: "secondary",
|
|
9157
9275
|
slotProps: { popper: { sx: { width: 300 } } }
|
|
9158
9276
|
},
|
|
9159
|
-
/* @__PURE__ */ React128.createElement(
|
|
9277
|
+
/* @__PURE__ */ React128.createElement(Box30, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
|
|
9160
9278
|
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React128.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
|
|
9161
9279
|
const index = uniqueKeys.indexOf(key);
|
|
9162
9280
|
const value = items2[index];
|
|
@@ -9228,7 +9346,7 @@ var RepeaterItem = ({
|
|
|
9228
9346
|
const duplicateLabel = __64("Duplicate", "elementor");
|
|
9229
9347
|
const toggleLabel = propDisabled ? __64("Show", "elementor") : __64("Hide", "elementor");
|
|
9230
9348
|
const removeLabel = __64("Remove", "elementor");
|
|
9231
|
-
return /* @__PURE__ */ React128.createElement(
|
|
9349
|
+
return /* @__PURE__ */ React128.createElement(Box30, { sx: { display: "contents" } }, /* @__PURE__ */ React128.createElement(
|
|
9232
9350
|
RepeaterTag,
|
|
9233
9351
|
{
|
|
9234
9352
|
disabled,
|
|
@@ -9245,13 +9363,13 @@ var RepeaterItem = ({
|
|
|
9245
9363
|
startIcon,
|
|
9246
9364
|
actions: /* @__PURE__ */ React128.createElement(React128.Fragment, null, showDuplicate && /* @__PURE__ */ React128.createElement(Tooltip14, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React128.createElement(IconButton12, { size: SIZE12, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React128.createElement(CopyIcon2, { fontSize: SIZE12 }))), showToggle && /* @__PURE__ */ React128.createElement(Tooltip14, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React128.createElement(IconButton12, { size: SIZE12, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React128.createElement(EyeOffIcon2, { fontSize: SIZE12 }) : /* @__PURE__ */ React128.createElement(EyeIcon2, { fontSize: SIZE12 }))), actions?.(value), showRemove && /* @__PURE__ */ React128.createElement(Tooltip14, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React128.createElement(IconButton12, { size: SIZE12, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React128.createElement(XIcon4, { fontSize: SIZE12 }))))
|
|
9247
9365
|
}
|
|
9248
|
-
), /* @__PURE__ */ React128.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React128.createElement(
|
|
9366
|
+
), /* @__PURE__ */ React128.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React128.createElement(Box30, null, children({ anchorEl: ref }))));
|
|
9249
9367
|
};
|
|
9250
9368
|
var usePopover = (openOnMount, onOpen, onPopoverClose) => {
|
|
9251
9369
|
const [ref, setRef] = useState23(null);
|
|
9252
9370
|
const popoverState = usePopupState11({ variant: "popover" });
|
|
9253
9371
|
const popoverProps = bindPopover9(popoverState);
|
|
9254
|
-
|
|
9372
|
+
useEffect21(() => {
|
|
9255
9373
|
if (openOnMount && ref) {
|
|
9256
9374
|
popoverState.open(ref);
|
|
9257
9375
|
onOpen?.();
|