@elementor/editor-controls 4.1.0-820 → 4.1.0-821
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +16 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +57 -44
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/controls/image-media-control.tsx +15 -3
package/dist/index.mjs
CHANGED
|
@@ -351,7 +351,7 @@ var formatResponse = (response) => {
|
|
|
351
351
|
|
|
352
352
|
// src/controls/image-media-control.tsx
|
|
353
353
|
import * as React11 from "react";
|
|
354
|
-
import { imageSrcPropTypeUtil, urlPropTypeUtil } from "@elementor/editor-props";
|
|
354
|
+
import { imageSrcPropTypeUtil, stringPropTypeUtil, urlPropTypeUtil } from "@elementor/editor-props";
|
|
355
355
|
import { UploadIcon } from "@elementor/icons";
|
|
356
356
|
import { Button, Card, CardMedia, CardOverlay, CircularProgress, Stack as Stack2 } from "@elementor/ui";
|
|
357
357
|
import { useWpMediaAttachment, useWpMediaFrame } from "@elementor/wp-media";
|
|
@@ -392,6 +392,9 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
392
392
|
const { data: attachment, isFetching } = useWpMediaAttachment(id?.value || null);
|
|
393
393
|
const { data: placeholderAttachment } = useWpMediaAttachment(placeholder?.id?.value || null);
|
|
394
394
|
const src = attachment?.url ?? url?.value ?? placeholderAttachment?.url ?? null;
|
|
395
|
+
const defaultUrl = imageSrcPropTypeUtil.extract(propType.default ?? null)?.url?.value;
|
|
396
|
+
const currentUrlForModal = url?.value && url.value !== defaultUrl ? url.value : void 0;
|
|
397
|
+
const currentAltForModal = value?.alt?.value;
|
|
395
398
|
const { open } = useWpMediaFrame({
|
|
396
399
|
mediaTypes,
|
|
397
400
|
multiple: false,
|
|
@@ -406,10 +409,11 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
406
409
|
url: null
|
|
407
410
|
});
|
|
408
411
|
},
|
|
409
|
-
onSelectUrl: (selectedUrl) => {
|
|
412
|
+
onSelectUrl: (selectedUrl, alt) => {
|
|
410
413
|
setValue({
|
|
411
414
|
id: null,
|
|
412
|
-
url: urlPropTypeUtil.create(selectedUrl)
|
|
415
|
+
url: urlPropTypeUtil.create(selectedUrl),
|
|
416
|
+
alt: alt ? stringPropTypeUtil.create(alt) : null
|
|
413
417
|
});
|
|
414
418
|
}
|
|
415
419
|
});
|
|
@@ -432,12 +436,21 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
432
436
|
onClick: () => open({ mode: "upload" })
|
|
433
437
|
},
|
|
434
438
|
__("Upload", "elementor")
|
|
435
|
-
), /* @__PURE__ */ React11.createElement(
|
|
439
|
+
), /* @__PURE__ */ React11.createElement(
|
|
440
|
+
Button,
|
|
441
|
+
{
|
|
442
|
+
size: "tiny",
|
|
443
|
+
variant: "text",
|
|
444
|
+
color: "inherit",
|
|
445
|
+
onClick: () => open({ mode: "url", currentUrl: currentUrlForModal, currentAlt: currentAltForModal })
|
|
446
|
+
},
|
|
447
|
+
__("Insert from URL", "elementor")
|
|
448
|
+
)))));
|
|
436
449
|
});
|
|
437
450
|
|
|
438
451
|
// src/controls/select-control.tsx
|
|
439
452
|
import * as React12 from "react";
|
|
440
|
-
import { stringPropTypeUtil } from "@elementor/editor-props";
|
|
453
|
+
import { stringPropTypeUtil as stringPropTypeUtil2 } from "@elementor/editor-props";
|
|
441
454
|
import { MenuListItem } from "@elementor/editor-ui";
|
|
442
455
|
import { Select, Typography } from "@elementor/ui";
|
|
443
456
|
var DEFAULT_MENU_PROPS = {
|
|
@@ -449,7 +462,7 @@ var DEFAULT_MENU_PROPS = {
|
|
|
449
462
|
};
|
|
450
463
|
var SelectControl = createControl(
|
|
451
464
|
({ options, onChange, MenuProps = DEFAULT_MENU_PROPS, ariaLabel }) => {
|
|
452
|
-
const { value, setValue, disabled, placeholder } = useBoundProp(
|
|
465
|
+
const { value, setValue, disabled, placeholder } = useBoundProp(stringPropTypeUtil2);
|
|
453
466
|
const handleChange = (event) => {
|
|
454
467
|
const newValue = event.target.value || null;
|
|
455
468
|
onChange?.(newValue, value);
|
|
@@ -505,7 +518,7 @@ var ImageSizeControl = ({ sizes }) => {
|
|
|
505
518
|
|
|
506
519
|
// src/controls/text-control.tsx
|
|
507
520
|
import * as React14 from "react";
|
|
508
|
-
import { stringPropTypeUtil as
|
|
521
|
+
import { stringPropTypeUtil as stringPropTypeUtil3 } from "@elementor/editor-props";
|
|
509
522
|
import { TextField } from "@elementor/ui";
|
|
510
523
|
var TextControl = createControl(
|
|
511
524
|
({
|
|
@@ -517,7 +530,7 @@ var TextControl = createControl(
|
|
|
517
530
|
sx,
|
|
518
531
|
ariaLabel
|
|
519
532
|
}) => {
|
|
520
|
-
const { value, setValue, disabled, placeholder: boundPlaceholder } = useBoundProp(
|
|
533
|
+
const { value, setValue, disabled, placeholder: boundPlaceholder } = useBoundProp(stringPropTypeUtil3);
|
|
521
534
|
const handleChange = (event) => setValue(event.target.value);
|
|
522
535
|
const placeholder = propPlaceholder ?? boundPlaceholder ?? void 0;
|
|
523
536
|
return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(
|
|
@@ -542,10 +555,10 @@ var TextControl = createControl(
|
|
|
542
555
|
|
|
543
556
|
// src/controls/text-area-control.tsx
|
|
544
557
|
import * as React15 from "react";
|
|
545
|
-
import { stringPropTypeUtil as
|
|
558
|
+
import { stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-props";
|
|
546
559
|
import { TextField as TextField2 } from "@elementor/ui";
|
|
547
560
|
var TextAreaControl = createControl(({ placeholder: propPlaceholder, ariaLabel }) => {
|
|
548
|
-
const { value, setValue, disabled, placeholder: boundPlaceholder } = useBoundProp(
|
|
561
|
+
const { value, setValue, disabled, placeholder: boundPlaceholder } = useBoundProp(stringPropTypeUtil4);
|
|
549
562
|
const handleChange = (event) => {
|
|
550
563
|
setValue(event.target.value);
|
|
551
564
|
};
|
|
@@ -572,7 +585,7 @@ var TextAreaControl = createControl(({ placeholder: propPlaceholder, ariaLabel }
|
|
|
572
585
|
import * as React16 from "react";
|
|
573
586
|
import { useCallback, useState as useState2 } from "react";
|
|
574
587
|
import { Mention } from "primereact/mention";
|
|
575
|
-
import { stringPropTypeUtil as
|
|
588
|
+
import { stringPropTypeUtil as stringPropTypeUtil5 } from "@elementor/editor-props";
|
|
576
589
|
import { styled } from "@elementor/ui";
|
|
577
590
|
var MentionWrapper = styled("div")(({ theme }) => ({
|
|
578
591
|
position: "relative",
|
|
@@ -652,7 +665,7 @@ function createMentionPattern(value, triggerPosition) {
|
|
|
652
665
|
}
|
|
653
666
|
var MentionTextAreaControl = createControl(
|
|
654
667
|
({ placeholder, ariaLabel, suggestions: allSuggestions, rows = 5, triggerPosition = "auto" }) => {
|
|
655
|
-
const { value, setValue, disabled } = useBoundProp(
|
|
668
|
+
const { value, setValue, disabled } = useBoundProp(stringPropTypeUtil5);
|
|
656
669
|
const [filteredSuggestions, setFilteredSuggestions] = useState2([]);
|
|
657
670
|
const transformMentionsToShortcodes = useCallback(
|
|
658
671
|
(text) => {
|
|
@@ -2492,15 +2505,15 @@ var SelectControlWrapper = createControl(
|
|
|
2492
2505
|
|
|
2493
2506
|
// src/controls/chips-control.tsx
|
|
2494
2507
|
import * as React51 from "react";
|
|
2495
|
-
import { stringArrayPropTypeUtil, stringPropTypeUtil as
|
|
2508
|
+
import { stringArrayPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil6 } from "@elementor/editor-props";
|
|
2496
2509
|
import { Autocomplete, Chip, TextField as TextField5 } from "@elementor/ui";
|
|
2497
2510
|
var SIZE6 = "tiny";
|
|
2498
2511
|
var ChipsControl = createControl(({ options }) => {
|
|
2499
2512
|
const { value, setValue, disabled } = useBoundProp(stringArrayPropTypeUtil);
|
|
2500
|
-
const selectedValues = (value || []).map((item) =>
|
|
2513
|
+
const selectedValues = (value || []).map((item) => stringPropTypeUtil6.extract(item)).filter((val) => val !== null);
|
|
2501
2514
|
const selectedOptions = selectedValues.map((val) => options.find((opt) => opt.value === val)).filter((opt) => opt !== void 0);
|
|
2502
2515
|
const handleChange = (_, newValue) => {
|
|
2503
|
-
const values = newValue.map((option) =>
|
|
2516
|
+
const values = newValue.map((option) => stringPropTypeUtil6.create(option.value));
|
|
2504
2517
|
setValue(values);
|
|
2505
2518
|
};
|
|
2506
2519
|
return /* @__PURE__ */ React51.createElement(ControlActions, null, /* @__PURE__ */ React51.createElement(
|
|
@@ -2526,7 +2539,7 @@ var ChipsControl = createControl(({ options }) => {
|
|
|
2526
2539
|
|
|
2527
2540
|
// src/controls/toggle-control.tsx
|
|
2528
2541
|
import * as React55 from "react";
|
|
2529
|
-
import { stringPropTypeUtil as
|
|
2542
|
+
import { stringPropTypeUtil as stringPropTypeUtil7 } from "@elementor/editor-props";
|
|
2530
2543
|
|
|
2531
2544
|
// src/components/control-toggle-button-group.tsx
|
|
2532
2545
|
import * as React53 from "react";
|
|
@@ -2814,7 +2827,7 @@ var ToggleControl = createControl(
|
|
|
2814
2827
|
maxItems,
|
|
2815
2828
|
convertOptions = false
|
|
2816
2829
|
}) => {
|
|
2817
|
-
const { value, setValue, placeholder, disabled } = useBoundProp(
|
|
2830
|
+
const { value, setValue, placeholder, disabled } = useBoundProp(stringPropTypeUtil7);
|
|
2818
2831
|
const processedOptions = convertOptions ? convertToggleOptionsToAtomic(options) : options;
|
|
2819
2832
|
const exclusiveValues = processedOptions.filter((option) => option.exclusive).map((option) => option.value);
|
|
2820
2833
|
const handleNonExclusiveToggle = (selectedValues) => {
|
|
@@ -3888,7 +3901,7 @@ function getCssDimensionProps(label, isSiteRtl) {
|
|
|
3888
3901
|
// src/controls/font-family-control/font-family-control.tsx
|
|
3889
3902
|
import * as React66 from "react";
|
|
3890
3903
|
import { useMemo as useMemo8 } from "react";
|
|
3891
|
-
import { stringPropTypeUtil as
|
|
3904
|
+
import { stringPropTypeUtil as stringPropTypeUtil8 } from "@elementor/editor-props";
|
|
3892
3905
|
import { ChevronDownIcon as ChevronDownIcon2, TextIcon } from "@elementor/icons";
|
|
3893
3906
|
import { bindPopover as bindPopover5, bindTrigger as bindTrigger4, Popover as Popover5, UnstableTag as UnstableTag2, usePopupState as usePopupState7 } from "@elementor/ui";
|
|
3894
3907
|
import { __ as __22 } from "@wordpress/i18n";
|
|
@@ -4067,7 +4080,7 @@ var FontFamilyControl = createControl(
|
|
|
4067
4080
|
setValue: setFontFamily,
|
|
4068
4081
|
disabled,
|
|
4069
4082
|
placeholder
|
|
4070
|
-
} = useBoundProp(
|
|
4083
|
+
} = useBoundProp(stringPropTypeUtil8);
|
|
4071
4084
|
const popoverState = usePopupState7({ variant: "popover" });
|
|
4072
4085
|
const isShowingPlaceholder = !fontFamily && placeholder;
|
|
4073
4086
|
const mapFontSubs = useMemo8(() => {
|
|
@@ -4229,7 +4242,7 @@ import { useMemo as useMemo9, useState as useState11 } from "react";
|
|
|
4229
4242
|
import {
|
|
4230
4243
|
numberPropTypeUtil as numberPropTypeUtil2,
|
|
4231
4244
|
queryPropTypeUtil,
|
|
4232
|
-
stringPropTypeUtil as
|
|
4245
|
+
stringPropTypeUtil as stringPropTypeUtil9,
|
|
4233
4246
|
urlPropTypeUtil as urlPropTypeUtil3
|
|
4234
4247
|
} from "@elementor/editor-props";
|
|
4235
4248
|
import { httpService as httpService2 } from "@elementor/http-client";
|
|
@@ -4391,7 +4404,7 @@ var QueryControl = createControl((props) => {
|
|
|
4391
4404
|
}
|
|
4392
4405
|
const newQueryValue = {
|
|
4393
4406
|
id: numberPropTypeUtil2.create(newValue),
|
|
4394
|
-
label:
|
|
4407
|
+
label: stringPropTypeUtil9.create(findMatchingOption(options, newValue)?.label || null)
|
|
4395
4408
|
};
|
|
4396
4409
|
setQueryValue(newQueryValue);
|
|
4397
4410
|
onSetValue?.(queryPropTypeUtil.create(newQueryValue));
|
|
@@ -4598,7 +4611,7 @@ var LinkControl = createControl((props) => {
|
|
|
4598
4611
|
// src/controls/html-tag-control.tsx
|
|
4599
4612
|
import * as React74 from "react";
|
|
4600
4613
|
import { getElementLabel } from "@elementor/editor-elements";
|
|
4601
|
-
import { stringPropTypeUtil as
|
|
4614
|
+
import { stringPropTypeUtil as stringPropTypeUtil10 } from "@elementor/editor-props";
|
|
4602
4615
|
import { MenuListItem as MenuListItem4 } from "@elementor/editor-ui";
|
|
4603
4616
|
import { Select as Select2, styled as styled8, Typography as Typography6 } from "@elementor/ui";
|
|
4604
4617
|
import { __ as __26 } from "@wordpress/i18n";
|
|
@@ -4656,7 +4669,7 @@ var HtmlTagControl = createControl((props) => {
|
|
|
4656
4669
|
fallbackLabels = {},
|
|
4657
4670
|
context: { elementId }
|
|
4658
4671
|
} = props;
|
|
4659
|
-
const { value, setValue, disabled, placeholder } = useBoundProp(
|
|
4672
|
+
const { value, setValue, disabled, placeholder } = useBoundProp(stringPropTypeUtil10);
|
|
4660
4673
|
const handleChange = (event) => {
|
|
4661
4674
|
const newValue = event.target.value || null;
|
|
4662
4675
|
onChange?.(newValue, value);
|
|
@@ -4828,7 +4841,7 @@ var Control4 = ({
|
|
|
4828
4841
|
// src/controls/aspect-ratio-control.tsx
|
|
4829
4842
|
import * as React76 from "react";
|
|
4830
4843
|
import { useEffect as useEffect14, useState as useState14 } from "react";
|
|
4831
|
-
import { stringPropTypeUtil as
|
|
4844
|
+
import { stringPropTypeUtil as stringPropTypeUtil11 } from "@elementor/editor-props";
|
|
4832
4845
|
import { MenuListItem as MenuListItem5 } from "@elementor/editor-ui";
|
|
4833
4846
|
import { ArrowsMoveHorizontalIcon, ArrowsMoveVerticalIcon } from "@elementor/icons";
|
|
4834
4847
|
import { Grid as Grid12, Select as Select3, Stack as Stack12, TextField as TextField9 } from "@elementor/ui";
|
|
@@ -4850,7 +4863,7 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
4850
4863
|
setValue: setAspectRatioValue,
|
|
4851
4864
|
disabled,
|
|
4852
4865
|
placeholder: externalPlaceholder
|
|
4853
|
-
} = useBoundProp(
|
|
4866
|
+
} = useBoundProp(stringPropTypeUtil11);
|
|
4854
4867
|
const aspectRatioValue = currentPropValue ?? externalPlaceholder;
|
|
4855
4868
|
const isCustomSelected = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
4856
4869
|
const [initialWidth, initialHeight] = isCustomSelected ? aspectRatioValue.split("/") : ["", ""];
|
|
@@ -5241,7 +5254,7 @@ import {
|
|
|
5241
5254
|
colorStopPropTypeUtil,
|
|
5242
5255
|
gradientColorStopPropTypeUtil,
|
|
5243
5256
|
numberPropTypeUtil as numberPropTypeUtil3,
|
|
5244
|
-
stringPropTypeUtil as
|
|
5257
|
+
stringPropTypeUtil as stringPropTypeUtil12
|
|
5245
5258
|
} from "@elementor/editor-props";
|
|
5246
5259
|
import { UnstableGradientBox } from "@elementor/ui";
|
|
5247
5260
|
var BackgroundGradientColorControl = createControl(() => {
|
|
@@ -5249,13 +5262,13 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
5249
5262
|
const handleChange = (newValue) => {
|
|
5250
5263
|
const transformedValue = createTransformableValue(newValue);
|
|
5251
5264
|
if (transformedValue.positions) {
|
|
5252
|
-
transformedValue.positions =
|
|
5265
|
+
transformedValue.positions = stringPropTypeUtil12.create(newValue.positions.join(" "));
|
|
5253
5266
|
}
|
|
5254
5267
|
setValue(transformedValue);
|
|
5255
5268
|
};
|
|
5256
5269
|
const createTransformableValue = (newValue) => ({
|
|
5257
5270
|
...newValue,
|
|
5258
|
-
type:
|
|
5271
|
+
type: stringPropTypeUtil12.create(newValue.type),
|
|
5259
5272
|
angle: numberPropTypeUtil3.create(newValue.angle),
|
|
5260
5273
|
stops: gradientColorStopPropTypeUtil.create(
|
|
5261
5274
|
newValue.stops.map(
|
|
@@ -5291,7 +5304,7 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
5291
5304
|
);
|
|
5292
5305
|
});
|
|
5293
5306
|
var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.create({
|
|
5294
|
-
type:
|
|
5307
|
+
type: stringPropTypeUtil12.create("linear"),
|
|
5295
5308
|
angle: numberPropTypeUtil3.create(180),
|
|
5296
5309
|
stops: gradientColorStopPropTypeUtil.create([
|
|
5297
5310
|
colorStopPropTypeUtil.create({
|
|
@@ -5331,7 +5344,7 @@ var BackgroundImageOverlayAttachment = () => {
|
|
|
5331
5344
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
5332
5345
|
import * as React82 from "react";
|
|
5333
5346
|
import { useRef as useRef14 } from "react";
|
|
5334
|
-
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as
|
|
5347
|
+
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil13 } from "@elementor/editor-props";
|
|
5335
5348
|
import { MenuListItem as MenuListItem6 } from "@elementor/editor-ui";
|
|
5336
5349
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
5337
5350
|
import { Grid as Grid14, Select as Select4 } from "@elementor/ui";
|
|
@@ -5350,7 +5363,7 @@ var backgroundPositionOptions = [
|
|
|
5350
5363
|
];
|
|
5351
5364
|
var BackgroundImageOverlayPosition = () => {
|
|
5352
5365
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
5353
|
-
const stringPropContext = useBoundProp(
|
|
5366
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil13);
|
|
5354
5367
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
5355
5368
|
const rowRef = useRef14(null);
|
|
5356
5369
|
const handlePositionChange = (event) => {
|
|
@@ -5426,7 +5439,7 @@ var BackgroundImageOverlayRepeat = () => {
|
|
|
5426
5439
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
5427
5440
|
import * as React84 from "react";
|
|
5428
5441
|
import { useRef as useRef15 } from "react";
|
|
5429
|
-
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as
|
|
5442
|
+
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil14 } from "@elementor/editor-props";
|
|
5430
5443
|
import {
|
|
5431
5444
|
ArrowBarBothIcon,
|
|
5432
5445
|
ArrowsMaximizeIcon,
|
|
@@ -5465,7 +5478,7 @@ var sizeControlOptions = [
|
|
|
5465
5478
|
];
|
|
5466
5479
|
var BackgroundImageOverlaySize = () => {
|
|
5467
5480
|
const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
|
|
5468
|
-
const stringPropContext = useBoundProp(
|
|
5481
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil14);
|
|
5469
5482
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
5470
5483
|
const rowRef = useRef15(null);
|
|
5471
5484
|
const handleSizeChange = (size) => {
|
|
@@ -5933,7 +5946,7 @@ import { useMemo as useMemo12, useState as useState17 } from "react";
|
|
|
5933
5946
|
import {
|
|
5934
5947
|
isTransformable,
|
|
5935
5948
|
keyValuePropTypeUtil,
|
|
5936
|
-
stringPropTypeUtil as
|
|
5949
|
+
stringPropTypeUtil as stringPropTypeUtil15
|
|
5937
5950
|
} from "@elementor/editor-props";
|
|
5938
5951
|
import { FormHelperText, FormLabel as FormLabel3, Grid as Grid18 } from "@elementor/ui";
|
|
5939
5952
|
import { __ as __38 } from "@wordpress/i18n";
|
|
@@ -6005,7 +6018,7 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
6005
6018
|
});
|
|
6006
6019
|
return;
|
|
6007
6020
|
}
|
|
6008
|
-
const extractedValue =
|
|
6021
|
+
const extractedValue = stringPropTypeUtil15.extract(newChangedValue);
|
|
6009
6022
|
setSessionState((prev) => ({
|
|
6010
6023
|
...prev,
|
|
6011
6024
|
[fieldType]: extractedValue
|
|
@@ -6045,7 +6058,7 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
6045
6058
|
|
|
6046
6059
|
// src/controls/position-control.tsx
|
|
6047
6060
|
import * as React89 from "react";
|
|
6048
|
-
import { positionPropTypeUtil, stringPropTypeUtil as
|
|
6061
|
+
import { positionPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil16 } from "@elementor/editor-props";
|
|
6049
6062
|
import { MenuListItem as MenuListItem7 } from "@elementor/editor-ui";
|
|
6050
6063
|
import { LetterXIcon as LetterXIcon2, LetterYIcon as LetterYIcon2 } from "@elementor/icons";
|
|
6051
6064
|
import { Grid as Grid19, Select as Select5 } from "@elementor/ui";
|
|
@@ -6064,7 +6077,7 @@ var positionOptions = [
|
|
|
6064
6077
|
];
|
|
6065
6078
|
var PositionControl = () => {
|
|
6066
6079
|
const positionContext = useBoundProp(positionPropTypeUtil);
|
|
6067
|
-
const stringPropContext = useBoundProp(
|
|
6080
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil16);
|
|
6068
6081
|
const isCustom = !!positionContext.value;
|
|
6069
6082
|
const placeholder = positionContext.placeholder ? "custom" : stringPropContext.placeholder ?? null;
|
|
6070
6083
|
const handlePositionChange = (event) => {
|
|
@@ -7323,7 +7336,7 @@ var TransitionRepeaterControl = createControl(
|
|
|
7323
7336
|
// src/controls/date-time-control.tsx
|
|
7324
7337
|
import * as React106 from "react";
|
|
7325
7338
|
import * as dayjs from "dayjs";
|
|
7326
|
-
import { isTransformable as isTransformable2, stringPropTypeUtil as
|
|
7339
|
+
import { isTransformable as isTransformable2, stringPropTypeUtil as stringPropTypeUtil17 } from "@elementor/editor-props";
|
|
7327
7340
|
import { DateTimePropTypeUtil } from "@elementor/editor-props";
|
|
7328
7341
|
import { Box as Box22, DatePicker, LocalizationProvider, TimePicker } from "@elementor/ui";
|
|
7329
7342
|
var DATE_FORMAT = "YYYY-MM-DD";
|
|
@@ -7372,7 +7385,7 @@ var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
|
7372
7385
|
return /* @__PURE__ */ React106.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React106.createElement(ControlActions, null, /* @__PURE__ */ React106.createElement(LocalizationProvider, null, /* @__PURE__ */ React106.createElement(Box22, { display: "flex", gap: 1, alignItems: "center" }, /* @__PURE__ */ React106.createElement(PropKeyProvider, { bind: "date" }, /* @__PURE__ */ React106.createElement(
|
|
7373
7386
|
DatePicker,
|
|
7374
7387
|
{
|
|
7375
|
-
value: parseDateValue(
|
|
7388
|
+
value: parseDateValue(stringPropTypeUtil17.extract(value?.date)),
|
|
7376
7389
|
onChange: (v) => handleChange({ date: v }, { bind: "date" }),
|
|
7377
7390
|
disabled: inputDisabled,
|
|
7378
7391
|
slotProps: {
|
|
@@ -7384,7 +7397,7 @@ var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
|
7384
7397
|
)), /* @__PURE__ */ React106.createElement(PropKeyProvider, { bind: "time" }, /* @__PURE__ */ React106.createElement(
|
|
7385
7398
|
TimePicker,
|
|
7386
7399
|
{
|
|
7387
|
-
value: parseTimeValue(
|
|
7400
|
+
value: parseTimeValue(stringPropTypeUtil17.extract(value?.time)),
|
|
7388
7401
|
onChange: (v) => handleChange({ time: v }, { bind: "time" }),
|
|
7389
7402
|
disabled: inputDisabled,
|
|
7390
7403
|
slotProps: {
|
|
@@ -7399,7 +7412,7 @@ var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
|
7399
7412
|
// src/controls/inline-editing-control.tsx
|
|
7400
7413
|
import * as React108 from "react";
|
|
7401
7414
|
import { useCallback as useCallback4, useEffect as useEffect17, useMemo as useMemo16 } from "react";
|
|
7402
|
-
import { htmlV3PropTypeUtil, parseHtmlChildren, stringPropTypeUtil as
|
|
7415
|
+
import { htmlV3PropTypeUtil, parseHtmlChildren, stringPropTypeUtil as stringPropTypeUtil18 } from "@elementor/editor-props";
|
|
7403
7416
|
import { Box as Box24 } from "@elementor/ui";
|
|
7404
7417
|
import { debounce as debounce4 } from "@elementor/utils";
|
|
7405
7418
|
|
|
@@ -7576,12 +7589,12 @@ var InlineEditingControl = createControl(
|
|
|
7576
7589
|
props
|
|
7577
7590
|
}) => {
|
|
7578
7591
|
const { value, setValue, placeholder } = useBoundProp(htmlV3PropTypeUtil);
|
|
7579
|
-
const content =
|
|
7592
|
+
const content = stringPropTypeUtil18.extract(value?.content ?? null) ?? "";
|
|
7580
7593
|
const debouncedParse = useMemo16(
|
|
7581
7594
|
() => debounce4((html) => {
|
|
7582
7595
|
const parsed = parseHtmlChildren(html);
|
|
7583
7596
|
setValue({
|
|
7584
|
-
content: parsed.content ?
|
|
7597
|
+
content: parsed.content ? stringPropTypeUtil18.create(parsed.content) : null,
|
|
7585
7598
|
children: parsed.children
|
|
7586
7599
|
});
|
|
7587
7600
|
}, CHILDREN_PARSE_DEBOUNCE_MS),
|
|
@@ -7591,7 +7604,7 @@ var InlineEditingControl = createControl(
|
|
|
7591
7604
|
(newValue) => {
|
|
7592
7605
|
const html = newValue ?? "";
|
|
7593
7606
|
setValue({
|
|
7594
|
-
content: html ?
|
|
7607
|
+
content: html ? stringPropTypeUtil18.create(html) : null,
|
|
7595
7608
|
children: value?.children ?? []
|
|
7596
7609
|
});
|
|
7597
7610
|
debouncedParse(html);
|