@elementor/editor-controls 4.4.0-1086 → 4.4.0-1088
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 +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +148 -85
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +109 -47
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
- package/src/controls/notice-control.tsx +105 -0
- package/src/index.ts +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -493,6 +493,17 @@ type Props$4 = {
|
|
|
493
493
|
};
|
|
494
494
|
declare const AttachmentTypeControl: ControlComponent$1<({ label, options }: Props$4) => React$1.JSX.Element>;
|
|
495
495
|
|
|
496
|
+
type NoticeType = 'info' | 'success' | 'warning' | 'danger';
|
|
497
|
+
type NoticeControlProps = {
|
|
498
|
+
noticeType?: NoticeType;
|
|
499
|
+
heading?: string;
|
|
500
|
+
content?: string;
|
|
501
|
+
dismissible?: string;
|
|
502
|
+
buttonText?: string;
|
|
503
|
+
buttonUrl?: string;
|
|
504
|
+
};
|
|
505
|
+
declare const NoticeControl: ControlComponent$1<({ noticeType, heading, content, dismissible, buttonText, buttonUrl }: NoticeControlProps) => React$1.JSX.Element | null>;
|
|
506
|
+
|
|
496
507
|
type Action = {
|
|
497
508
|
type: string;
|
|
498
509
|
payload?: object;
|
|
@@ -895,4 +906,4 @@ declare function useTypingBuffer(options?: UseTypingBufferOptions): {
|
|
|
895
906
|
startsWith: (haystack: string, needle: string) => boolean;
|
|
896
907
|
};
|
|
897
908
|
|
|
898
|
-
export { type AdornmentComponent, type AngleUnit, AspectRatioControl, AttachmentTypeControl, AttributesControl, BackgroundControl, BoxShadowRepeaterControl, ChipsControl, ClearIconButton, ColorControl, ControlActions, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent$1 as ControlComponent, ControlFormLabel, type ControlReplacement, ControlReplacementsProvider, ControlToggleButtonGroup, DateRangeControl, DateTimeControl, DisplayConditionsControl, EmailFormActionControl, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontAwesome7IconDefinition, type FontCategory, FontFamilyControl, GapControl, GridSpanControl, HtmlTagControl, ImageControl, InlineEditingControl, InlineEditor, InlineEditorToolbar, type InlineEditorToolbarProps, ItemSelector, type ItemsActionPayload, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, MentionTextAreaControl, NumberControl, NumberInput, PopoverContent, PopoverGridContainer, PositionControl, type PromotionTrackingData, PromotionTrigger, type PromotionTriggerRef, PropKeyProvider, PropProvider, type PropProviderProps, QueryChipsControl, QueryControl, QueryFilterRepeaterControl, RepeatableControl, Repeater, type RepeaterItem, SelectControl, SelectControlWrapper, type SetRepeaterValuesMeta, type SetValue, type SetValueMeta, SizeComponent, SizeControl, StrokeControl, StyledToggleButton, StyledToggleButtonGroup, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, TimeRangeControl, TimeStringControl, type TimeUnit, type ToggleButtonGroupItem, ToggleButtonGroupUi, ToggleControl, type ToggleControlProps, TransformRepeaterControl, TransformSettingsControl, TransitionRepeaterControl, type Unit, UnstableSizeControl, UnstableSizeField, UrlControl, type UseTypingBufferOptions, type V4PromotionData, type V4PromotionKey, VideoMediaControl, createControl, createControlReplacementsRegistry, enqueueFont, getControlReplacements, getFontAwesome7IconName, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, isUnitExtendedOption, registerControlReplacement, resetFontAwesome7IconsCache, resolveFontAwesome7Icon, trackUpgradePromotionClick, trackViewPromotion, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useControlReplacement, useFontFamilies, useSyncExternalState, useTypingBuffer };
|
|
909
|
+
export { type AdornmentComponent, type AngleUnit, AspectRatioControl, AttachmentTypeControl, AttributesControl, BackgroundControl, BoxShadowRepeaterControl, ChipsControl, ClearIconButton, ColorControl, ControlActions, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent$1 as ControlComponent, ControlFormLabel, type ControlReplacement, ControlReplacementsProvider, ControlToggleButtonGroup, DateRangeControl, DateTimeControl, DisplayConditionsControl, EmailFormActionControl, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontAwesome7IconDefinition, type FontCategory, FontFamilyControl, GapControl, GridSpanControl, HtmlTagControl, ImageControl, InlineEditingControl, InlineEditor, InlineEditorToolbar, type InlineEditorToolbarProps, ItemSelector, type ItemsActionPayload, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, MentionTextAreaControl, NoticeControl, NumberControl, NumberInput, PopoverContent, PopoverGridContainer, PositionControl, type PromotionTrackingData, PromotionTrigger, type PromotionTriggerRef, PropKeyProvider, PropProvider, type PropProviderProps, QueryChipsControl, QueryControl, QueryFilterRepeaterControl, RepeatableControl, Repeater, type RepeaterItem, SelectControl, SelectControlWrapper, type SetRepeaterValuesMeta, type SetValue, type SetValueMeta, SizeComponent, SizeControl, StrokeControl, StyledToggleButton, StyledToggleButtonGroup, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, TimeRangeControl, TimeStringControl, type TimeUnit, type ToggleButtonGroupItem, ToggleButtonGroupUi, ToggleControl, type ToggleControlProps, TransformRepeaterControl, TransformSettingsControl, TransitionRepeaterControl, type Unit, UnstableSizeControl, UnstableSizeField, UrlControl, type UseTypingBufferOptions, type V4PromotionData, type V4PromotionKey, VideoMediaControl, createControl, createControlReplacementsRegistry, enqueueFont, getControlReplacements, getFontAwesome7IconName, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, isUnitExtendedOption, registerControlReplacement, resetFontAwesome7IconsCache, resolveFontAwesome7Icon, trackUpgradePromotionClick, trackViewPromotion, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useControlReplacement, useFontFamilies, useSyncExternalState, useTypingBuffer };
|
package/dist/index.d.ts
CHANGED
|
@@ -493,6 +493,17 @@ type Props$4 = {
|
|
|
493
493
|
};
|
|
494
494
|
declare const AttachmentTypeControl: ControlComponent$1<({ label, options }: Props$4) => React$1.JSX.Element>;
|
|
495
495
|
|
|
496
|
+
type NoticeType = 'info' | 'success' | 'warning' | 'danger';
|
|
497
|
+
type NoticeControlProps = {
|
|
498
|
+
noticeType?: NoticeType;
|
|
499
|
+
heading?: string;
|
|
500
|
+
content?: string;
|
|
501
|
+
dismissible?: string;
|
|
502
|
+
buttonText?: string;
|
|
503
|
+
buttonUrl?: string;
|
|
504
|
+
};
|
|
505
|
+
declare const NoticeControl: ControlComponent$1<({ noticeType, heading, content, dismissible, buttonText, buttonUrl }: NoticeControlProps) => React$1.JSX.Element | null>;
|
|
506
|
+
|
|
496
507
|
type Action = {
|
|
497
508
|
type: string;
|
|
498
509
|
payload?: object;
|
|
@@ -895,4 +906,4 @@ declare function useTypingBuffer(options?: UseTypingBufferOptions): {
|
|
|
895
906
|
startsWith: (haystack: string, needle: string) => boolean;
|
|
896
907
|
};
|
|
897
908
|
|
|
898
|
-
export { type AdornmentComponent, type AngleUnit, AspectRatioControl, AttachmentTypeControl, AttributesControl, BackgroundControl, BoxShadowRepeaterControl, ChipsControl, ClearIconButton, ColorControl, ControlActions, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent$1 as ControlComponent, ControlFormLabel, type ControlReplacement, ControlReplacementsProvider, ControlToggleButtonGroup, DateRangeControl, DateTimeControl, DisplayConditionsControl, EmailFormActionControl, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontAwesome7IconDefinition, type FontCategory, FontFamilyControl, GapControl, GridSpanControl, HtmlTagControl, ImageControl, InlineEditingControl, InlineEditor, InlineEditorToolbar, type InlineEditorToolbarProps, ItemSelector, type ItemsActionPayload, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, MentionTextAreaControl, NumberControl, NumberInput, PopoverContent, PopoverGridContainer, PositionControl, type PromotionTrackingData, PromotionTrigger, type PromotionTriggerRef, PropKeyProvider, PropProvider, type PropProviderProps, QueryChipsControl, QueryControl, QueryFilterRepeaterControl, RepeatableControl, Repeater, type RepeaterItem, SelectControl, SelectControlWrapper, type SetRepeaterValuesMeta, type SetValue, type SetValueMeta, SizeComponent, SizeControl, StrokeControl, StyledToggleButton, StyledToggleButtonGroup, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, TimeRangeControl, TimeStringControl, type TimeUnit, type ToggleButtonGroupItem, ToggleButtonGroupUi, ToggleControl, type ToggleControlProps, TransformRepeaterControl, TransformSettingsControl, TransitionRepeaterControl, type Unit, UnstableSizeControl, UnstableSizeField, UrlControl, type UseTypingBufferOptions, type V4PromotionData, type V4PromotionKey, VideoMediaControl, createControl, createControlReplacementsRegistry, enqueueFont, getControlReplacements, getFontAwesome7IconName, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, isUnitExtendedOption, registerControlReplacement, resetFontAwesome7IconsCache, resolveFontAwesome7Icon, trackUpgradePromotionClick, trackViewPromotion, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useControlReplacement, useFontFamilies, useSyncExternalState, useTypingBuffer };
|
|
909
|
+
export { type AdornmentComponent, type AngleUnit, AspectRatioControl, AttachmentTypeControl, AttributesControl, BackgroundControl, BoxShadowRepeaterControl, ChipsControl, ClearIconButton, ColorControl, ControlActions, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent$1 as ControlComponent, ControlFormLabel, type ControlReplacement, ControlReplacementsProvider, ControlToggleButtonGroup, DateRangeControl, DateTimeControl, DisplayConditionsControl, EmailFormActionControl, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontAwesome7IconDefinition, type FontCategory, FontFamilyControl, GapControl, GridSpanControl, HtmlTagControl, ImageControl, InlineEditingControl, InlineEditor, InlineEditorToolbar, type InlineEditorToolbarProps, ItemSelector, type ItemsActionPayload, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, MentionTextAreaControl, NoticeControl, NumberControl, NumberInput, PopoverContent, PopoverGridContainer, PositionControl, type PromotionTrackingData, PromotionTrigger, type PromotionTriggerRef, PropKeyProvider, PropProvider, type PropProviderProps, QueryChipsControl, QueryControl, QueryFilterRepeaterControl, RepeatableControl, Repeater, type RepeaterItem, SelectControl, SelectControlWrapper, type SetRepeaterValuesMeta, type SetValue, type SetValueMeta, SizeComponent, SizeControl, StrokeControl, StyledToggleButton, StyledToggleButtonGroup, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, TimeRangeControl, TimeStringControl, type TimeUnit, type ToggleButtonGroupItem, ToggleButtonGroupUi, ToggleControl, type ToggleControlProps, TransformRepeaterControl, TransformSettingsControl, TransitionRepeaterControl, type Unit, UnstableSizeControl, UnstableSizeField, UrlControl, type UseTypingBufferOptions, type V4PromotionData, type V4PromotionKey, VideoMediaControl, createControl, createControlReplacementsRegistry, enqueueFont, getControlReplacements, getFontAwesome7IconName, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, isUnitExtendedOption, registerControlReplacement, resetFontAwesome7IconsCache, resolveFontAwesome7Icon, trackUpgradePromotionClick, trackViewPromotion, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useControlReplacement, useFontFamilies, useSyncExternalState, useTypingBuffer };
|
package/dist/index.js
CHANGED
|
@@ -64,6 +64,7 @@ __export(index_exports, {
|
|
|
64
64
|
LinkControl: () => LinkControl,
|
|
65
65
|
LinkedDimensionsControl: () => LinkedDimensionsControl,
|
|
66
66
|
MentionTextAreaControl: () => MentionTextAreaControl,
|
|
67
|
+
NoticeControl: () => NoticeControl,
|
|
67
68
|
NumberControl: () => NumberControl,
|
|
68
69
|
NumberInput: () => NumberInput,
|
|
69
70
|
PopoverContent: () => PopoverContent,
|
|
@@ -9680,10 +9681,71 @@ var AttachmentTypeControl = createControl(({ label, options }) => {
|
|
|
9680
9681
|
))));
|
|
9681
9682
|
});
|
|
9682
9683
|
|
|
9683
|
-
// src/controls/
|
|
9684
|
+
// src/controls/notice-control.tsx
|
|
9684
9685
|
var React128 = __toESM(require("react"));
|
|
9685
|
-
var
|
|
9686
|
+
var import_react75 = require("react");
|
|
9687
|
+
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
9688
|
+
var import_icons41 = require("@elementor/icons");
|
|
9686
9689
|
var import_ui111 = require("@elementor/ui");
|
|
9690
|
+
var NoticeTitle = (0, import_ui111.styled)(import_ui111.AlertTitle)({
|
|
9691
|
+
"&.MuiAlertTitle-root.MuiAlertTitle-root": {
|
|
9692
|
+
marginBottom: 4,
|
|
9693
|
+
fontStyle: "italic"
|
|
9694
|
+
}
|
|
9695
|
+
});
|
|
9696
|
+
var markNoticeAsDismissedInSession = (dismissId) => {
|
|
9697
|
+
const dismissedNotices = window.elementor?.config?.user?.dismissed_editor_notices;
|
|
9698
|
+
if (dismissedNotices && !dismissedNotices.includes(dismissId)) {
|
|
9699
|
+
dismissedNotices.push(dismissId);
|
|
9700
|
+
}
|
|
9701
|
+
};
|
|
9702
|
+
var NoticeControl = createControl(
|
|
9703
|
+
({ noticeType = "info", heading, content, dismissible, buttonText, buttonUrl }) => {
|
|
9704
|
+
const [isDismissed, setIsDismissed] = (0, import_react75.useState)(false);
|
|
9705
|
+
if (isDismissed || !content) {
|
|
9706
|
+
return null;
|
|
9707
|
+
}
|
|
9708
|
+
const severity = noticeType === "danger" ? "error" : noticeType;
|
|
9709
|
+
const icon = noticeType === "info" ? /* @__PURE__ */ React128.createElement(import_icons41.BulbIcon, { fontSize: "inherit" }) : void 0;
|
|
9710
|
+
const handleDismiss = () => {
|
|
9711
|
+
setIsDismissed(true);
|
|
9712
|
+
if (!dismissible) {
|
|
9713
|
+
return;
|
|
9714
|
+
}
|
|
9715
|
+
markNoticeAsDismissedInSession(dismissible);
|
|
9716
|
+
import_editor_v1_adapters3.ajax.load({
|
|
9717
|
+
action: "dismissed_editor_notices",
|
|
9718
|
+
unique_id: `dismiss-editor-notice-${dismissible}`,
|
|
9719
|
+
data: { dismissId: dismissible }
|
|
9720
|
+
}).catch(() => {
|
|
9721
|
+
});
|
|
9722
|
+
};
|
|
9723
|
+
const handleActionClick = () => {
|
|
9724
|
+
setIsDismissed(true);
|
|
9725
|
+
if (dismissible) {
|
|
9726
|
+
markNoticeAsDismissedInSession(dismissible);
|
|
9727
|
+
}
|
|
9728
|
+
};
|
|
9729
|
+
return /* @__PURE__ */ React128.createElement(import_ui111.Alert, { variant: "outlined", severity, icon, size: "small", onClose: handleDismiss }, heading && /* @__PURE__ */ React128.createElement(NoticeTitle, null, heading), /* @__PURE__ */ React128.createElement(import_ui111.Typography, { variant: "caption", color: "textSecondary", sx: { fontStyle: "italic" } }, content), buttonText && buttonUrl && /* @__PURE__ */ React128.createElement(
|
|
9730
|
+
import_ui111.AlertAction,
|
|
9731
|
+
{
|
|
9732
|
+
variant: "contained",
|
|
9733
|
+
color: severity,
|
|
9734
|
+
target: "_blank",
|
|
9735
|
+
rel: "noopener noreferrer",
|
|
9736
|
+
href: buttonUrl,
|
|
9737
|
+
onClick: handleActionClick,
|
|
9738
|
+
sx: { mt: 2 }
|
|
9739
|
+
},
|
|
9740
|
+
buttonText
|
|
9741
|
+
));
|
|
9742
|
+
}
|
|
9743
|
+
);
|
|
9744
|
+
|
|
9745
|
+
// src/controls/grid-span-control.tsx
|
|
9746
|
+
var React129 = __toESM(require("react"));
|
|
9747
|
+
var import_editor_props69 = require("@elementor/editor-props");
|
|
9748
|
+
var import_ui112 = require("@elementor/ui");
|
|
9687
9749
|
var GridSpanControl = createControl(
|
|
9688
9750
|
({
|
|
9689
9751
|
placeholder: propPlaceholder,
|
|
@@ -9700,8 +9762,8 @@ var GridSpanControl = createControl(
|
|
|
9700
9762
|
setValue(next === "" ? null : next);
|
|
9701
9763
|
};
|
|
9702
9764
|
const placeholder = propPlaceholder ?? boundPlaceholder ?? `e.g: 'span 2' or '1 / 3'`;
|
|
9703
|
-
return /* @__PURE__ */
|
|
9704
|
-
|
|
9765
|
+
return /* @__PURE__ */ React129.createElement(ControlActions, null, /* @__PURE__ */ React129.createElement(
|
|
9766
|
+
import_ui112.TextField,
|
|
9705
9767
|
{
|
|
9706
9768
|
size: "tiny",
|
|
9707
9769
|
fullWidth: true,
|
|
@@ -9721,25 +9783,25 @@ var GridSpanControl = createControl(
|
|
|
9721
9783
|
);
|
|
9722
9784
|
|
|
9723
9785
|
// src/components/promotions/display-conditions-control.tsx
|
|
9724
|
-
var
|
|
9725
|
-
var
|
|
9726
|
-
var
|
|
9727
|
-
var
|
|
9786
|
+
var React131 = __toESM(require("react"));
|
|
9787
|
+
var import_react77 = require("react");
|
|
9788
|
+
var import_icons42 = require("@elementor/icons");
|
|
9789
|
+
var import_ui114 = require("@elementor/ui");
|
|
9728
9790
|
var import_i18n66 = require("@wordpress/i18n");
|
|
9729
9791
|
|
|
9730
9792
|
// src/components/promotions/promotion-trigger.tsx
|
|
9731
|
-
var
|
|
9732
|
-
var
|
|
9793
|
+
var React130 = __toESM(require("react"));
|
|
9794
|
+
var import_react76 = require("react");
|
|
9733
9795
|
var import_editor_ui19 = require("@elementor/editor-ui");
|
|
9734
|
-
var
|
|
9796
|
+
var import_ui113 = require("@elementor/ui");
|
|
9735
9797
|
function getV4Promotion(key) {
|
|
9736
9798
|
return window.elementor?.config?.v4Promotions?.[key];
|
|
9737
9799
|
}
|
|
9738
|
-
var PromotionTrigger = (0,
|
|
9800
|
+
var PromotionTrigger = (0, import_react76.forwardRef)(
|
|
9739
9801
|
({ promotionKey, children, trackingData }, ref) => {
|
|
9740
|
-
const [isOpen, setIsOpen] = (0,
|
|
9802
|
+
const [isOpen, setIsOpen] = (0, import_react76.useState)(false);
|
|
9741
9803
|
const promotion = getV4Promotion(promotionKey);
|
|
9742
|
-
const toggle = (0,
|
|
9804
|
+
const toggle = (0, import_react76.useCallback)(() => {
|
|
9743
9805
|
setIsOpen((prev) => {
|
|
9744
9806
|
if (!prev) {
|
|
9745
9807
|
trackViewPromotion(trackingData);
|
|
@@ -9747,8 +9809,8 @@ var PromotionTrigger = (0, import_react75.forwardRef)(
|
|
|
9747
9809
|
return !prev;
|
|
9748
9810
|
});
|
|
9749
9811
|
}, [trackingData]);
|
|
9750
|
-
(0,
|
|
9751
|
-
return /* @__PURE__ */
|
|
9812
|
+
(0, import_react76.useImperativeHandle)(ref, () => ({ toggle }), [toggle]);
|
|
9813
|
+
return /* @__PURE__ */ React130.createElement(React130.Fragment, null, promotion && /* @__PURE__ */ React130.createElement(
|
|
9752
9814
|
import_editor_ui19.PromotionInfotip,
|
|
9753
9815
|
{
|
|
9754
9816
|
title: promotion.title,
|
|
@@ -9762,8 +9824,8 @@ var PromotionTrigger = (0, import_react75.forwardRef)(
|
|
|
9762
9824
|
},
|
|
9763
9825
|
onCtaClick: () => trackUpgradePromotionClick(trackingData)
|
|
9764
9826
|
},
|
|
9765
|
-
/* @__PURE__ */
|
|
9766
|
-
|
|
9827
|
+
/* @__PURE__ */ React130.createElement(
|
|
9828
|
+
import_ui113.Box,
|
|
9767
9829
|
{
|
|
9768
9830
|
onClick: (e) => {
|
|
9769
9831
|
e.stopPropagation();
|
|
@@ -9771,7 +9833,7 @@ var PromotionTrigger = (0, import_react75.forwardRef)(
|
|
|
9771
9833
|
},
|
|
9772
9834
|
sx: { cursor: "pointer", display: "inline-flex" }
|
|
9773
9835
|
},
|
|
9774
|
-
children ?? /* @__PURE__ */
|
|
9836
|
+
children ?? /* @__PURE__ */ React130.createElement(import_editor_ui19.PromotionChip, null)
|
|
9775
9837
|
)
|
|
9776
9838
|
));
|
|
9777
9839
|
}
|
|
@@ -9781,9 +9843,9 @@ var PromotionTrigger = (0, import_react75.forwardRef)(
|
|
|
9781
9843
|
var ARIA_LABEL = (0, import_i18n66.__)("Display Conditions", "elementor");
|
|
9782
9844
|
var TRACKING_DATA = { target_name: "display_conditions", location_l2: "general" };
|
|
9783
9845
|
var DisplayConditionsControl = createControl(() => {
|
|
9784
|
-
const triggerRef = (0,
|
|
9785
|
-
return /* @__PURE__ */
|
|
9786
|
-
|
|
9846
|
+
const triggerRef = (0, import_react77.useRef)(null);
|
|
9847
|
+
return /* @__PURE__ */ React131.createElement(
|
|
9848
|
+
import_ui114.Stack,
|
|
9787
9849
|
{
|
|
9788
9850
|
direction: "row",
|
|
9789
9851
|
spacing: 2,
|
|
@@ -9792,9 +9854,9 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
9792
9854
|
alignItems: "center"
|
|
9793
9855
|
}
|
|
9794
9856
|
},
|
|
9795
|
-
/* @__PURE__ */
|
|
9796
|
-
/* @__PURE__ */
|
|
9797
|
-
|
|
9857
|
+
/* @__PURE__ */ React131.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions", trackingData: TRACKING_DATA }),
|
|
9858
|
+
/* @__PURE__ */ React131.createElement(import_ui114.Tooltip, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React131.createElement(
|
|
9859
|
+
import_ui114.IconButton,
|
|
9798
9860
|
{
|
|
9799
9861
|
size: "tiny",
|
|
9800
9862
|
"aria-label": ARIA_LABEL,
|
|
@@ -9806,23 +9868,23 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
9806
9868
|
borderRadius: 1
|
|
9807
9869
|
}
|
|
9808
9870
|
},
|
|
9809
|
-
/* @__PURE__ */
|
|
9871
|
+
/* @__PURE__ */ React131.createElement(import_icons42.SitemapIcon, { fontSize: "tiny", color: "disabled" })
|
|
9810
9872
|
))
|
|
9811
9873
|
);
|
|
9812
9874
|
});
|
|
9813
9875
|
|
|
9814
9876
|
// src/components/promotions/attributes-control.tsx
|
|
9815
|
-
var
|
|
9816
|
-
var
|
|
9817
|
-
var
|
|
9818
|
-
var
|
|
9877
|
+
var React132 = __toESM(require("react"));
|
|
9878
|
+
var import_react78 = require("react");
|
|
9879
|
+
var import_icons43 = require("@elementor/icons");
|
|
9880
|
+
var import_ui115 = require("@elementor/ui");
|
|
9819
9881
|
var import_i18n67 = require("@wordpress/i18n");
|
|
9820
9882
|
var ARIA_LABEL2 = (0, import_i18n67.__)("Attributes", "elementor");
|
|
9821
9883
|
var TRACKING_DATA2 = { target_name: "attributes", location_l2: "general" };
|
|
9822
9884
|
var AttributesControl = createControl(() => {
|
|
9823
|
-
const triggerRef = (0,
|
|
9824
|
-
return /* @__PURE__ */
|
|
9825
|
-
|
|
9885
|
+
const triggerRef = (0, import_react78.useRef)(null);
|
|
9886
|
+
return /* @__PURE__ */ React132.createElement(
|
|
9887
|
+
import_ui115.Stack,
|
|
9826
9888
|
{
|
|
9827
9889
|
direction: "row",
|
|
9828
9890
|
spacing: 2,
|
|
@@ -9831,9 +9893,9 @@ var AttributesControl = createControl(() => {
|
|
|
9831
9893
|
alignItems: "center"
|
|
9832
9894
|
}
|
|
9833
9895
|
},
|
|
9834
|
-
/* @__PURE__ */
|
|
9835
|
-
/* @__PURE__ */
|
|
9836
|
-
|
|
9896
|
+
/* @__PURE__ */ React132.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes", trackingData: TRACKING_DATA2 }),
|
|
9897
|
+
/* @__PURE__ */ React132.createElement(import_ui115.Tooltip, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React132.createElement(
|
|
9898
|
+
import_icons43.PlusIcon,
|
|
9837
9899
|
{
|
|
9838
9900
|
"aria-label": ARIA_LABEL2,
|
|
9839
9901
|
fontSize: "tiny",
|
|
@@ -9846,20 +9908,20 @@ var AttributesControl = createControl(() => {
|
|
|
9846
9908
|
});
|
|
9847
9909
|
|
|
9848
9910
|
// src/components/icon-buttons/clear-icon-button.tsx
|
|
9849
|
-
var
|
|
9850
|
-
var
|
|
9851
|
-
var
|
|
9852
|
-
var CustomIconButton = (0,
|
|
9911
|
+
var React133 = __toESM(require("react"));
|
|
9912
|
+
var import_icons44 = require("@elementor/icons");
|
|
9913
|
+
var import_ui116 = require("@elementor/ui");
|
|
9914
|
+
var CustomIconButton = (0, import_ui116.styled)(import_ui116.IconButton)(({ theme }) => ({
|
|
9853
9915
|
width: theme.spacing(2.5),
|
|
9854
9916
|
height: theme.spacing(2.5)
|
|
9855
9917
|
}));
|
|
9856
|
-
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */
|
|
9918
|
+
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React133.createElement(import_ui116.Tooltip, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React133.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React133.createElement(import_icons44.BrushBigIcon, { fontSize: size })));
|
|
9857
9919
|
|
|
9858
9920
|
// src/components/repeater/repeater.tsx
|
|
9859
|
-
var
|
|
9860
|
-
var
|
|
9861
|
-
var
|
|
9862
|
-
var
|
|
9921
|
+
var React134 = __toESM(require("react"));
|
|
9922
|
+
var import_react79 = require("react");
|
|
9923
|
+
var import_icons45 = require("@elementor/icons");
|
|
9924
|
+
var import_ui117 = require("@elementor/ui");
|
|
9863
9925
|
var import_i18n68 = require("@wordpress/i18n");
|
|
9864
9926
|
var SIZE12 = "tiny";
|
|
9865
9927
|
var EMPTY_OPEN_ITEM2 = -1;
|
|
@@ -9879,7 +9941,7 @@ var Repeater3 = ({
|
|
|
9879
9941
|
isSortable = true,
|
|
9880
9942
|
adornment = ControlAdornments
|
|
9881
9943
|
}) => {
|
|
9882
|
-
const [openItem, setOpenItem] = (0,
|
|
9944
|
+
const [openItem, setOpenItem] = (0, import_react79.useState)(initialOpenItem);
|
|
9883
9945
|
const uniqueKeys = items2.map(
|
|
9884
9946
|
(item, index) => isSortable && "getId" in itemSettings ? itemSettings.getId({ item, index }) : String(index)
|
|
9885
9947
|
);
|
|
@@ -9942,8 +10004,8 @@ var Repeater3 = ({
|
|
|
9942
10004
|
};
|
|
9943
10005
|
const isButtonDisabled = disabled || disableAddItemButton;
|
|
9944
10006
|
const shouldShowInfotip = isButtonDisabled && addButtonInfotipContent;
|
|
9945
|
-
const addButton = /* @__PURE__ */
|
|
9946
|
-
|
|
10007
|
+
const addButton = /* @__PURE__ */ React134.createElement(
|
|
10008
|
+
import_ui117.IconButton,
|
|
9947
10009
|
{
|
|
9948
10010
|
size: SIZE12,
|
|
9949
10011
|
sx: {
|
|
@@ -9953,30 +10015,30 @@ var Repeater3 = ({
|
|
|
9953
10015
|
onClick: addRepeaterItem,
|
|
9954
10016
|
"aria-label": (0, import_i18n68.__)("Add item", "elementor")
|
|
9955
10017
|
},
|
|
9956
|
-
/* @__PURE__ */
|
|
10018
|
+
/* @__PURE__ */ React134.createElement(import_icons45.PlusIcon, { fontSize: SIZE12 })
|
|
9957
10019
|
);
|
|
9958
|
-
return /* @__PURE__ */
|
|
9959
|
-
|
|
10020
|
+
return /* @__PURE__ */ React134.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React134.createElement(RepeaterHeader, { label, adornment }, shouldShowInfotip ? /* @__PURE__ */ React134.createElement(
|
|
10021
|
+
import_ui117.Infotip,
|
|
9960
10022
|
{
|
|
9961
10023
|
placement: "right",
|
|
9962
10024
|
content: addButtonInfotipContent,
|
|
9963
10025
|
color: "secondary",
|
|
9964
10026
|
slotProps: { popper: { sx: { width: 300 } } }
|
|
9965
10027
|
},
|
|
9966
|
-
/* @__PURE__ */
|
|
9967
|
-
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */
|
|
10028
|
+
/* @__PURE__ */ React134.createElement(import_ui117.Box, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
|
|
10029
|
+
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React134.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
|
|
9968
10030
|
const index = uniqueKeys.indexOf(key);
|
|
9969
10031
|
const value = items2[index];
|
|
9970
10032
|
if (!value) {
|
|
9971
10033
|
return null;
|
|
9972
10034
|
}
|
|
9973
|
-
return /* @__PURE__ */
|
|
10035
|
+
return /* @__PURE__ */ React134.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React134.createElement(
|
|
9974
10036
|
RepeaterItem,
|
|
9975
10037
|
{
|
|
9976
10038
|
disabled,
|
|
9977
10039
|
propDisabled: value?.disabled,
|
|
9978
|
-
label: /* @__PURE__ */
|
|
9979
|
-
startIcon: /* @__PURE__ */
|
|
10040
|
+
label: /* @__PURE__ */ React134.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React134.createElement(itemSettings.Label, { value, index })),
|
|
10041
|
+
startIcon: /* @__PURE__ */ React134.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React134.createElement(itemSettings.Icon, { value })),
|
|
9980
10042
|
removeItem: () => removeRepeaterItem(index),
|
|
9981
10043
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
9982
10044
|
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
@@ -9990,7 +10052,7 @@ var Repeater3 = ({
|
|
|
9990
10052
|
actions: itemSettings.actions,
|
|
9991
10053
|
value
|
|
9992
10054
|
},
|
|
9993
|
-
(props) => /* @__PURE__ */
|
|
10055
|
+
(props) => /* @__PURE__ */ React134.createElement(
|
|
9994
10056
|
itemSettings.Content,
|
|
9995
10057
|
{
|
|
9996
10058
|
...props,
|
|
@@ -10030,12 +10092,12 @@ var RepeaterItem = ({
|
|
|
10030
10092
|
},
|
|
10031
10093
|
wrappedOnPopoverClose
|
|
10032
10094
|
);
|
|
10033
|
-
const triggerProps = (0,
|
|
10095
|
+
const triggerProps = (0, import_ui117.bindTrigger)(popoverState);
|
|
10034
10096
|
usePopoverDismiss({ isOpen: popoverState.isOpen, onClose: popoverProps.onClose });
|
|
10035
10097
|
const duplicateLabel = (0, import_i18n68.__)("Duplicate", "elementor");
|
|
10036
10098
|
const toggleLabel = propDisabled ? (0, import_i18n68.__)("Show", "elementor") : (0, import_i18n68.__)("Hide", "elementor");
|
|
10037
10099
|
const removeLabel = (0, import_i18n68.__)("Remove", "elementor");
|
|
10038
|
-
return /* @__PURE__ */
|
|
10100
|
+
return /* @__PURE__ */ React134.createElement(import_ui117.Box, { sx: { display: "contents" } }, /* @__PURE__ */ React134.createElement(
|
|
10039
10101
|
RepeaterTag,
|
|
10040
10102
|
{
|
|
10041
10103
|
disabled,
|
|
@@ -10050,15 +10112,15 @@ var RepeaterItem = ({
|
|
|
10050
10112
|
}
|
|
10051
10113
|
},
|
|
10052
10114
|
startIcon,
|
|
10053
|
-
actions: /* @__PURE__ */
|
|
10115
|
+
actions: /* @__PURE__ */ React134.createElement(React134.Fragment, null, showDuplicate && /* @__PURE__ */ React134.createElement(import_ui117.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React134.createElement(import_ui117.IconButton, { size: SIZE12, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React134.createElement(import_icons45.CopyIcon, { fontSize: SIZE12 }))), showToggle && /* @__PURE__ */ React134.createElement(import_ui117.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React134.createElement(import_ui117.IconButton, { size: SIZE12, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React134.createElement(import_icons45.EyeOffIcon, { fontSize: SIZE12 }) : /* @__PURE__ */ React134.createElement(import_icons45.EyeIcon, { fontSize: SIZE12 }))), actions?.(value), showRemove && /* @__PURE__ */ React134.createElement(import_ui117.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React134.createElement(import_ui117.IconButton, { size: SIZE12, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React134.createElement(import_icons45.XIcon, { fontSize: SIZE12 }))))
|
|
10054
10116
|
}
|
|
10055
|
-
), /* @__PURE__ */
|
|
10117
|
+
), /* @__PURE__ */ React134.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React134.createElement(import_ui117.Box, null, children({ anchorEl: ref }))));
|
|
10056
10118
|
};
|
|
10057
10119
|
var usePopover = (openOnMount, onOpen, onPopoverClose) => {
|
|
10058
|
-
const [ref, setRef] = (0,
|
|
10059
|
-
const popoverState = (0,
|
|
10060
|
-
const popoverProps = (0,
|
|
10061
|
-
(0,
|
|
10120
|
+
const [ref, setRef] = (0, import_react79.useState)(null);
|
|
10121
|
+
const popoverState = (0, import_ui117.usePopupState)({ variant: "popover" });
|
|
10122
|
+
const popoverProps = (0, import_ui117.bindPopover)(popoverState);
|
|
10123
|
+
(0, import_react79.useEffect)(() => {
|
|
10062
10124
|
if (openOnMount && ref) {
|
|
10063
10125
|
popoverState.open(ref);
|
|
10064
10126
|
onOpen?.();
|
|
@@ -10077,8 +10139,8 @@ var usePopover = (openOnMount, onOpen, onPopoverClose) => {
|
|
|
10077
10139
|
};
|
|
10078
10140
|
|
|
10079
10141
|
// src/components/size/unstable-size-field.tsx
|
|
10080
|
-
var
|
|
10081
|
-
var
|
|
10142
|
+
var React137 = __toESM(require("react"));
|
|
10143
|
+
var import_ui119 = require("@elementor/ui");
|
|
10082
10144
|
|
|
10083
10145
|
// src/hooks/use-size-value.ts
|
|
10084
10146
|
var DEFAULT_UNIT2 = "px";
|
|
@@ -10120,25 +10182,25 @@ var differsFromExternal = (newState, externalState) => {
|
|
|
10120
10182
|
};
|
|
10121
10183
|
|
|
10122
10184
|
// src/components/size/unit-select.tsx
|
|
10123
|
-
var
|
|
10124
|
-
var
|
|
10185
|
+
var React135 = __toESM(require("react"));
|
|
10186
|
+
var import_react80 = require("react");
|
|
10125
10187
|
var import_editor_ui20 = require("@elementor/editor-ui");
|
|
10126
|
-
var
|
|
10188
|
+
var import_ui118 = require("@elementor/ui");
|
|
10127
10189
|
var menuItemContentStyles2 = {
|
|
10128
10190
|
display: "flex",
|
|
10129
10191
|
flexDirection: "column",
|
|
10130
10192
|
justifyContent: "center"
|
|
10131
10193
|
};
|
|
10132
10194
|
var UnitSelect = ({ value, showPrimaryColor, onClick, options }) => {
|
|
10133
|
-
const popupState = (0,
|
|
10195
|
+
const popupState = (0, import_ui118.usePopupState)({
|
|
10134
10196
|
variant: "popover",
|
|
10135
|
-
popupId: (0,
|
|
10197
|
+
popupId: (0, import_react80.useId)()
|
|
10136
10198
|
});
|
|
10137
10199
|
const handleMenuItemClick = (index) => {
|
|
10138
10200
|
onClick(options[index]);
|
|
10139
10201
|
popupState.close();
|
|
10140
10202
|
};
|
|
10141
|
-
return /* @__PURE__ */
|
|
10203
|
+
return /* @__PURE__ */ React135.createElement(React135.Fragment, null, /* @__PURE__ */ React135.createElement(StyledButton3, { isPrimaryColor: showPrimaryColor, size: "small", ...(0, import_ui118.bindTrigger)(popupState) }, value), /* @__PURE__ */ React135.createElement(import_ui118.Menu, { MenuListProps: { dense: true }, ...(0, import_ui118.bindMenu)(popupState) }, options.map((option, index) => /* @__PURE__ */ React135.createElement(
|
|
10142
10204
|
import_editor_ui20.MenuListItem,
|
|
10143
10205
|
{
|
|
10144
10206
|
key: option,
|
|
@@ -10157,7 +10219,7 @@ var UnitSelect = ({ value, showPrimaryColor, onClick, options }) => {
|
|
|
10157
10219
|
option.toUpperCase()
|
|
10158
10220
|
))));
|
|
10159
10221
|
};
|
|
10160
|
-
var StyledButton3 = (0,
|
|
10222
|
+
var StyledButton3 = (0, import_ui118.styled)(import_ui118.Button, {
|
|
10161
10223
|
shouldForwardProp: (prop) => prop !== "isPrimaryColor"
|
|
10162
10224
|
})(({ isPrimaryColor, theme }) => ({
|
|
10163
10225
|
color: isPrimaryColor ? theme.palette.text.primary : theme.palette.text.tertiary,
|
|
@@ -10167,11 +10229,11 @@ var StyledButton3 = (0, import_ui117.styled)(import_ui117.Button, {
|
|
|
10167
10229
|
}));
|
|
10168
10230
|
|
|
10169
10231
|
// src/components/size/unstable-size-input.tsx
|
|
10170
|
-
var
|
|
10171
|
-
var
|
|
10172
|
-
var UnstableSizeInput = (0,
|
|
10232
|
+
var React136 = __toESM(require("react"));
|
|
10233
|
+
var import_react81 = require("react");
|
|
10234
|
+
var UnstableSizeInput = (0, import_react81.forwardRef)(
|
|
10173
10235
|
({ type, value, onChange, onKeyDown, onKeyUp, InputProps, onBlur, focused, disabled }, ref) => {
|
|
10174
|
-
return /* @__PURE__ */
|
|
10236
|
+
return /* @__PURE__ */ React136.createElement(
|
|
10175
10237
|
NumberInput,
|
|
10176
10238
|
{
|
|
10177
10239
|
ref,
|
|
@@ -10209,7 +10271,7 @@ var UnstableSizeField = ({
|
|
|
10209
10271
|
const shouldHighlightUnit2 = () => {
|
|
10210
10272
|
return hasValue(size);
|
|
10211
10273
|
};
|
|
10212
|
-
return /* @__PURE__ */
|
|
10274
|
+
return /* @__PURE__ */ React137.createElement(
|
|
10213
10275
|
UnstableSizeInput,
|
|
10214
10276
|
{
|
|
10215
10277
|
type: "number",
|
|
@@ -10218,8 +10280,8 @@ var UnstableSizeField = ({
|
|
|
10218
10280
|
onChange: (event) => setSize(event.target.value),
|
|
10219
10281
|
InputProps: {
|
|
10220
10282
|
...InputProps,
|
|
10221
|
-
startAdornment: startIcon && /* @__PURE__ */
|
|
10222
|
-
endAdornment: /* @__PURE__ */
|
|
10283
|
+
startAdornment: startIcon && /* @__PURE__ */ React137.createElement(import_ui119.InputAdornment, { position: "start" }, startIcon),
|
|
10284
|
+
endAdornment: /* @__PURE__ */ React137.createElement(import_ui119.InputAdornment, { position: "end" }, /* @__PURE__ */ React137.createElement(
|
|
10223
10285
|
UnitSelect,
|
|
10224
10286
|
{
|
|
10225
10287
|
options: units2,
|
|
@@ -10237,15 +10299,15 @@ var hasValue = (value) => {
|
|
|
10237
10299
|
};
|
|
10238
10300
|
|
|
10239
10301
|
// src/hooks/use-font-families.ts
|
|
10240
|
-
var
|
|
10241
|
-
var
|
|
10302
|
+
var import_react82 = require("react");
|
|
10303
|
+
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
10242
10304
|
var getFontControlConfig = () => {
|
|
10243
|
-
const { controls } = (0,
|
|
10305
|
+
const { controls } = (0, import_editor_v1_adapters4.getElementorConfig)();
|
|
10244
10306
|
return controls?.font ?? {};
|
|
10245
10307
|
};
|
|
10246
10308
|
var useFontFamilies = () => {
|
|
10247
10309
|
const { groups, options } = getFontControlConfig();
|
|
10248
|
-
return (0,
|
|
10310
|
+
return (0, import_react82.useMemo)(() => {
|
|
10249
10311
|
if (!groups || !options) {
|
|
10250
10312
|
return [];
|
|
10251
10313
|
}
|
|
@@ -10303,6 +10365,7 @@ var useFontFamilies = () => {
|
|
|
10303
10365
|
LinkControl,
|
|
10304
10366
|
LinkedDimensionsControl,
|
|
10305
10367
|
MentionTextAreaControl,
|
|
10368
|
+
NoticeControl,
|
|
10306
10369
|
NumberControl,
|
|
10307
10370
|
NumberInput,
|
|
10308
10371
|
PopoverContent,
|