@elementor/editor-controls 4.0.0-manual → 4.1.0-685
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 +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +87 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +94 -43
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/promotions/attributes-control.tsx +2 -1
- package/src/components/promotions/display-conditions-control.tsx +2 -1
- package/src/components/promotions/promotion-trigger.tsx +14 -4
- package/src/controls/chips-control.tsx +1 -1
- package/src/controls/number-control.tsx +8 -2
- package/src/controls/size-control/hooks/use-size-unit-keyboard.tsx +55 -0
- package/src/controls/size-control/hooks/use-size-value.ts +75 -0
- package/src/controls/size-control/size-component.tsx +73 -0
- package/src/controls/size-control/size-field.tsx +89 -0
- package/src/controls/size-control/sync/get-units.ts +3 -0
- package/src/controls/size-control/types.ts +9 -0
- package/src/controls/size-control/ui/size-input.tsx +68 -0
- package/src/controls/size-control/ui/text-field-popover.tsx +78 -0
- package/src/controls/size-control/ui/unit-selector.tsx +80 -0
- package/src/controls/size-control/utils/is-extended-unit.ts +8 -0
- package/src/controls/size-control/utils/is-numeric-value.ts +11 -0
- package/src/controls/size-control/utils/resolve-size-value.ts +84 -0
- package/src/controls/transition-control/transition-selector.tsx +7 -0
- package/src/hooks/use-font-families.ts +22 -25
- package/src/index.ts +2 -0
- package/src/utils/tracking.ts +61 -0
package/dist/index.d.mts
CHANGED
|
@@ -413,6 +413,15 @@ declare const DisplayConditionsControl: ControlComponent$1<() => React$1.JSX.Ele
|
|
|
413
413
|
|
|
414
414
|
declare const AttributesControl: ControlComponent$1<() => React$1.JSX.Element>;
|
|
415
415
|
|
|
416
|
+
type PromotionTrackingData = {
|
|
417
|
+
target_name: string;
|
|
418
|
+
target_location?: 'widget_panel' | 'variables_manager';
|
|
419
|
+
location_l1?: string;
|
|
420
|
+
location_l2?: 'style' | 'general' | 'interactions';
|
|
421
|
+
};
|
|
422
|
+
declare const trackViewPromotion: (data: PromotionTrackingData) => void;
|
|
423
|
+
declare const trackUpgradePromotionClick: (data: PromotionTrackingData) => void;
|
|
424
|
+
|
|
416
425
|
type V4PromotionData = {
|
|
417
426
|
title: string;
|
|
418
427
|
content: string;
|
|
@@ -424,6 +433,7 @@ type V4PromotionKey = 'displayConditions' | 'customCss' | 'attributes';
|
|
|
424
433
|
type PromotionTriggerProps = {
|
|
425
434
|
promotionKey: V4PromotionKey;
|
|
426
435
|
children?: ReactNode;
|
|
436
|
+
trackingData: PromotionTrackingData;
|
|
427
437
|
};
|
|
428
438
|
type PromotionTriggerRef = {
|
|
429
439
|
toggle: () => void;
|
|
@@ -727,4 +737,4 @@ declare function useTypingBuffer(options?: UseTypingBufferOptions): {
|
|
|
727
737
|
startsWith: (haystack: string, needle: string) => boolean;
|
|
728
738
|
};
|
|
729
739
|
|
|
730
|
-
export { type AdornmentComponent, type AngleUnit, AspectRatioControl, AttributesControl, BackgroundControl, BoxShadowRepeaterControl, ChipsControl, ClearIconButton, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent$1 as ControlComponent, ControlFormLabel, type ControlReplacement, ControlReplacementsProvider, ControlToggleButtonGroup, DateTimeControl, DisplayConditionsControl, EmailFormActionControl, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, GapControl, HtmlTagControl, ImageControl, InlineEditingControl, InlineEditor, InlineEditorToolbar, type InlineEditorToolbarProps, ItemSelector, type ItemsActionPayload, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, NumberControl, NumberInput, PopoverContent, PopoverGridContainer, PositionControl, PromotionTrigger, type PromotionTriggerRef, PropKeyProvider, PropProvider, type PropProviderProps, QueryControl, RepeatableControl, Repeater, type RepeaterItem, SelectControl, SelectControlWrapper, type SetRepeaterValuesMeta, type SetValue, type SetValueMeta, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type TimeUnit, type ToggleButtonGroupItem, ToggleButtonGroupUi, ToggleControl, type ToggleControlProps, TransformRepeaterControl, TransformSettingsControl, TransitionRepeaterControl, type Unit, UnstableSizeField, UrlControl, type UseTypingBufferOptions, type V4PromotionData, type V4PromotionKey, VideoMediaControl, createControl, createControlReplacementsRegistry, enqueueFont, getControlReplacements, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, isUnitExtendedOption, registerControlReplacement, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useControlReplacement, useFontFamilies, useSyncExternalState, useTypingBuffer };
|
|
740
|
+
export { type AdornmentComponent, type AngleUnit, AspectRatioControl, AttributesControl, BackgroundControl, BoxShadowRepeaterControl, ChipsControl, ClearIconButton, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent$1 as ControlComponent, ControlFormLabel, type ControlReplacement, ControlReplacementsProvider, ControlToggleButtonGroup, DateTimeControl, DisplayConditionsControl, EmailFormActionControl, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, GapControl, HtmlTagControl, ImageControl, InlineEditingControl, InlineEditor, InlineEditorToolbar, type InlineEditorToolbarProps, ItemSelector, type ItemsActionPayload, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, NumberControl, NumberInput, PopoverContent, PopoverGridContainer, PositionControl, type PromotionTrackingData, PromotionTrigger, type PromotionTriggerRef, PropKeyProvider, PropProvider, type PropProviderProps, QueryControl, RepeatableControl, Repeater, type RepeaterItem, SelectControl, SelectControlWrapper, type SetRepeaterValuesMeta, type SetValue, type SetValueMeta, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type TimeUnit, type ToggleButtonGroupItem, ToggleButtonGroupUi, ToggleControl, type ToggleControlProps, TransformRepeaterControl, TransformSettingsControl, TransitionRepeaterControl, type Unit, UnstableSizeField, UrlControl, type UseTypingBufferOptions, type V4PromotionData, type V4PromotionKey, VideoMediaControl, createControl, createControlReplacementsRegistry, enqueueFont, getControlReplacements, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, isUnitExtendedOption, registerControlReplacement, trackUpgradePromotionClick, trackViewPromotion, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useControlReplacement, useFontFamilies, useSyncExternalState, useTypingBuffer };
|
package/dist/index.d.ts
CHANGED
|
@@ -413,6 +413,15 @@ declare const DisplayConditionsControl: ControlComponent$1<() => React$1.JSX.Ele
|
|
|
413
413
|
|
|
414
414
|
declare const AttributesControl: ControlComponent$1<() => React$1.JSX.Element>;
|
|
415
415
|
|
|
416
|
+
type PromotionTrackingData = {
|
|
417
|
+
target_name: string;
|
|
418
|
+
target_location?: 'widget_panel' | 'variables_manager';
|
|
419
|
+
location_l1?: string;
|
|
420
|
+
location_l2?: 'style' | 'general' | 'interactions';
|
|
421
|
+
};
|
|
422
|
+
declare const trackViewPromotion: (data: PromotionTrackingData) => void;
|
|
423
|
+
declare const trackUpgradePromotionClick: (data: PromotionTrackingData) => void;
|
|
424
|
+
|
|
416
425
|
type V4PromotionData = {
|
|
417
426
|
title: string;
|
|
418
427
|
content: string;
|
|
@@ -424,6 +433,7 @@ type V4PromotionKey = 'displayConditions' | 'customCss' | 'attributes';
|
|
|
424
433
|
type PromotionTriggerProps = {
|
|
425
434
|
promotionKey: V4PromotionKey;
|
|
426
435
|
children?: ReactNode;
|
|
436
|
+
trackingData: PromotionTrackingData;
|
|
427
437
|
};
|
|
428
438
|
type PromotionTriggerRef = {
|
|
429
439
|
toggle: () => void;
|
|
@@ -727,4 +737,4 @@ declare function useTypingBuffer(options?: UseTypingBufferOptions): {
|
|
|
727
737
|
startsWith: (haystack: string, needle: string) => boolean;
|
|
728
738
|
};
|
|
729
739
|
|
|
730
|
-
export { type AdornmentComponent, type AngleUnit, AspectRatioControl, AttributesControl, BackgroundControl, BoxShadowRepeaterControl, ChipsControl, ClearIconButton, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent$1 as ControlComponent, ControlFormLabel, type ControlReplacement, ControlReplacementsProvider, ControlToggleButtonGroup, DateTimeControl, DisplayConditionsControl, EmailFormActionControl, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, GapControl, HtmlTagControl, ImageControl, InlineEditingControl, InlineEditor, InlineEditorToolbar, type InlineEditorToolbarProps, ItemSelector, type ItemsActionPayload, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, NumberControl, NumberInput, PopoverContent, PopoverGridContainer, PositionControl, PromotionTrigger, type PromotionTriggerRef, PropKeyProvider, PropProvider, type PropProviderProps, QueryControl, RepeatableControl, Repeater, type RepeaterItem, SelectControl, SelectControlWrapper, type SetRepeaterValuesMeta, type SetValue, type SetValueMeta, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type TimeUnit, type ToggleButtonGroupItem, ToggleButtonGroupUi, ToggleControl, type ToggleControlProps, TransformRepeaterControl, TransformSettingsControl, TransitionRepeaterControl, type Unit, UnstableSizeField, UrlControl, type UseTypingBufferOptions, type V4PromotionData, type V4PromotionKey, VideoMediaControl, createControl, createControlReplacementsRegistry, enqueueFont, getControlReplacements, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, isUnitExtendedOption, registerControlReplacement, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useControlReplacement, useFontFamilies, useSyncExternalState, useTypingBuffer };
|
|
740
|
+
export { type AdornmentComponent, type AngleUnit, AspectRatioControl, AttributesControl, BackgroundControl, BoxShadowRepeaterControl, ChipsControl, ClearIconButton, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent$1 as ControlComponent, ControlFormLabel, type ControlReplacement, ControlReplacementsProvider, ControlToggleButtonGroup, DateTimeControl, DisplayConditionsControl, EmailFormActionControl, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, GapControl, HtmlTagControl, ImageControl, InlineEditingControl, InlineEditor, InlineEditorToolbar, type InlineEditorToolbarProps, ItemSelector, type ItemsActionPayload, KeyValueControl, type LengthUnit, LinkControl, LinkedDimensionsControl, NumberControl, NumberInput, PopoverContent, PopoverGridContainer, PositionControl, type PromotionTrackingData, PromotionTrigger, type PromotionTriggerRef, PropKeyProvider, PropProvider, type PropProviderProps, QueryControl, RepeatableControl, Repeater, type RepeaterItem, SelectControl, SelectControlWrapper, type SetRepeaterValuesMeta, type SetValue, type SetValueMeta, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type TimeUnit, type ToggleButtonGroupItem, ToggleButtonGroupUi, ToggleControl, type ToggleControlProps, TransformRepeaterControl, TransformSettingsControl, TransitionRepeaterControl, type Unit, UnstableSizeField, UrlControl, type UseTypingBufferOptions, type V4PromotionData, type V4PromotionKey, VideoMediaControl, createControl, createControlReplacementsRegistry, enqueueFont, getControlReplacements, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, isUnitExtendedOption, registerControlReplacement, trackUpgradePromotionClick, trackViewPromotion, transitionProperties, transitionsItemsList, useBoundProp, useControlActions, useControlReplacement, useFontFamilies, useSyncExternalState, useTypingBuffer };
|
package/dist/index.js
CHANGED
|
@@ -95,6 +95,8 @@ __export(index_exports, {
|
|
|
95
95
|
injectIntoRepeaterItemLabel: () => injectIntoRepeaterItemLabel,
|
|
96
96
|
isUnitExtendedOption: () => isUnitExtendedOption,
|
|
97
97
|
registerControlReplacement: () => registerControlReplacement,
|
|
98
|
+
trackUpgradePromotionClick: () => trackUpgradePromotionClick,
|
|
99
|
+
trackViewPromotion: () => trackViewPromotion,
|
|
98
100
|
transitionProperties: () => transitionProperties,
|
|
99
101
|
transitionsItemsList: () => transitionsItemsList,
|
|
100
102
|
useBoundProp: () => useBoundProp,
|
|
@@ -2329,7 +2331,7 @@ var ChipsControl = createControl(({ options }) => {
|
|
|
2329
2331
|
const selectedOptions = selectedValues.map((val) => options.find((opt) => opt.value === val)).filter((opt) => opt !== void 0);
|
|
2330
2332
|
const handleChange = (_, newValue) => {
|
|
2331
2333
|
const values = newValue.map((option) => import_editor_props16.stringPropTypeUtil.create(option.value));
|
|
2332
|
-
setValue(values
|
|
2334
|
+
setValue(values);
|
|
2333
2335
|
};
|
|
2334
2336
|
return /* @__PURE__ */ React50.createElement(ControlActions, null, /* @__PURE__ */ React50.createElement(
|
|
2335
2337
|
import_ui37.Autocomplete,
|
|
@@ -2678,7 +2680,7 @@ var import_ui40 = require("@elementor/ui");
|
|
|
2678
2680
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
2679
2681
|
var renderSuffix = (propType) => {
|
|
2680
2682
|
if (propType.meta?.suffix) {
|
|
2681
|
-
return /* @__PURE__ */ React55.createElement(import_ui40.InputAdornment, { position: "end" }, propType.meta.suffix);
|
|
2683
|
+
return /* @__PURE__ */ React55.createElement(import_ui40.InputAdornment, { position: "end" }, /* @__PURE__ */ React55.createElement(import_ui40.Typography, { variant: "caption", color: "text.secondary" }, propType.meta.suffix));
|
|
2682
2684
|
}
|
|
2683
2685
|
return /* @__PURE__ */ React55.createElement(React55.Fragment, null);
|
|
2684
2686
|
};
|
|
@@ -5990,6 +5992,47 @@ var import_editor_ui12 = require("@elementor/editor-ui");
|
|
|
5990
5992
|
var import_icons32 = require("@elementor/icons");
|
|
5991
5993
|
var import_ui83 = require("@elementor/ui");
|
|
5992
5994
|
var import_i18n49 = require("@wordpress/i18n");
|
|
5995
|
+
|
|
5996
|
+
// src/utils/tracking.ts
|
|
5997
|
+
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
5998
|
+
var import_events2 = require("@elementor/events");
|
|
5999
|
+
var getBaseEventProperties = (data, config) => ({
|
|
6000
|
+
app_type: config?.appTypes?.editor ?? "editor",
|
|
6001
|
+
window_name: config?.appTypes?.editor ?? "editor",
|
|
6002
|
+
interaction_type: config?.triggers?.click ?? "Click",
|
|
6003
|
+
target_name: data.target_name,
|
|
6004
|
+
target_location: data.target_location ?? "widget_panel",
|
|
6005
|
+
location_l1: data.location_l1 ?? (0, import_editor_elements5.getSelectedElements)()[0]?.type ?? "",
|
|
6006
|
+
...data.location_l2 && { location_l2: data.location_l2 }
|
|
6007
|
+
});
|
|
6008
|
+
var dispatchPromotionEvent = (data, resolveOptions) => {
|
|
6009
|
+
const { dispatchEvent, config } = (0, import_events2.getMixpanel)();
|
|
6010
|
+
const { eventName, interactionResult, interactionDescription } = resolveOptions(config);
|
|
6011
|
+
if (!eventName) {
|
|
6012
|
+
return;
|
|
6013
|
+
}
|
|
6014
|
+
dispatchEvent?.(eventName, {
|
|
6015
|
+
...getBaseEventProperties(data, config),
|
|
6016
|
+
interaction_result: interactionResult,
|
|
6017
|
+
interaction_description: interactionDescription
|
|
6018
|
+
});
|
|
6019
|
+
};
|
|
6020
|
+
var trackViewPromotion = (data) => {
|
|
6021
|
+
dispatchPromotionEvent(data, (config) => ({
|
|
6022
|
+
eventName: config?.names?.promotions?.viewPromotion,
|
|
6023
|
+
interactionResult: config?.interactionResults?.promotionViewed ?? "promotion_viewed",
|
|
6024
|
+
interactionDescription: "user_viewed_promotion"
|
|
6025
|
+
}));
|
|
6026
|
+
};
|
|
6027
|
+
var trackUpgradePromotionClick = (data) => {
|
|
6028
|
+
dispatchPromotionEvent(data, (config) => ({
|
|
6029
|
+
eventName: config?.names?.promotions?.upgradePromotionClick,
|
|
6030
|
+
interactionResult: config?.interactionResults?.upgradeNow ?? "upgrade_now",
|
|
6031
|
+
interactionDescription: "user_clicked_upgrade_now"
|
|
6032
|
+
}));
|
|
6033
|
+
};
|
|
6034
|
+
|
|
6035
|
+
// src/controls/transition-control/transition-selector.tsx
|
|
5993
6036
|
var toTransitionSelectorValue = (label) => {
|
|
5994
6037
|
for (const category of transitionProperties) {
|
|
5995
6038
|
const property = category.properties.find((prop) => prop.label === label);
|
|
@@ -6127,7 +6170,11 @@ var TransitionSelector = ({
|
|
|
6127
6170
|
"Upgrade to customize transition properties and control effects.",
|
|
6128
6171
|
"elementor"
|
|
6129
6172
|
),
|
|
6130
|
-
upgradeUrl: PRO_UPGRADE_URL
|
|
6173
|
+
upgradeUrl: PRO_UPGRADE_URL,
|
|
6174
|
+
onCtaClick: () => trackUpgradePromotionClick({
|
|
6175
|
+
target_name: "transition_property",
|
|
6176
|
+
location_l2: "style"
|
|
6177
|
+
})
|
|
6131
6178
|
}
|
|
6132
6179
|
) : null
|
|
6133
6180
|
}
|
|
@@ -6732,11 +6779,18 @@ function getV4Promotion(key) {
|
|
|
6732
6779
|
return window.elementor?.config?.v4Promotions?.[key];
|
|
6733
6780
|
}
|
|
6734
6781
|
var PromotionTrigger = (0, import_react54.forwardRef)(
|
|
6735
|
-
({ promotionKey, children }, ref) => {
|
|
6782
|
+
({ promotionKey, children, trackingData }, ref) => {
|
|
6736
6783
|
const [isOpen, setIsOpen] = (0, import_react54.useState)(false);
|
|
6737
6784
|
const promotion = getV4Promotion(promotionKey);
|
|
6738
|
-
const toggle = ()
|
|
6739
|
-
|
|
6785
|
+
const toggle = (0, import_react54.useCallback)(() => {
|
|
6786
|
+
setIsOpen((prev) => {
|
|
6787
|
+
if (!prev) {
|
|
6788
|
+
trackViewPromotion(trackingData);
|
|
6789
|
+
}
|
|
6790
|
+
return !prev;
|
|
6791
|
+
});
|
|
6792
|
+
}, [trackingData]);
|
|
6793
|
+
(0, import_react54.useImperativeHandle)(ref, () => ({ toggle }), [toggle]);
|
|
6740
6794
|
return /* @__PURE__ */ React103.createElement(React103.Fragment, null, promotion && /* @__PURE__ */ React103.createElement(
|
|
6741
6795
|
import_editor_ui14.PromotionInfotip,
|
|
6742
6796
|
{
|
|
@@ -6748,7 +6802,8 @@ var PromotionTrigger = (0, import_react54.forwardRef)(
|
|
|
6748
6802
|
onClose: (e) => {
|
|
6749
6803
|
e.stopPropagation();
|
|
6750
6804
|
setIsOpen(false);
|
|
6751
|
-
}
|
|
6805
|
+
},
|
|
6806
|
+
onCtaClick: () => trackUpgradePromotionClick(trackingData)
|
|
6752
6807
|
},
|
|
6753
6808
|
/* @__PURE__ */ React103.createElement(
|
|
6754
6809
|
import_ui89.Box,
|
|
@@ -6767,6 +6822,7 @@ var PromotionTrigger = (0, import_react54.forwardRef)(
|
|
|
6767
6822
|
|
|
6768
6823
|
// src/components/promotions/display-conditions-control.tsx
|
|
6769
6824
|
var ARIA_LABEL = (0, import_i18n52.__)("Display Conditions", "elementor");
|
|
6825
|
+
var TRACKING_DATA = { target_name: "display_conditions", location_l2: "general" };
|
|
6770
6826
|
var DisplayConditionsControl = createControl(() => {
|
|
6771
6827
|
const triggerRef = (0, import_react55.useRef)(null);
|
|
6772
6828
|
return /* @__PURE__ */ React104.createElement(
|
|
@@ -6779,7 +6835,7 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
6779
6835
|
alignItems: "center"
|
|
6780
6836
|
}
|
|
6781
6837
|
},
|
|
6782
|
-
/* @__PURE__ */ React104.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions" }),
|
|
6838
|
+
/* @__PURE__ */ React104.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions", trackingData: TRACKING_DATA }),
|
|
6783
6839
|
/* @__PURE__ */ React104.createElement(import_ui90.Tooltip, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React104.createElement(
|
|
6784
6840
|
import_ui90.IconButton,
|
|
6785
6841
|
{
|
|
@@ -6805,6 +6861,7 @@ var import_icons35 = require("@elementor/icons");
|
|
|
6805
6861
|
var import_ui91 = require("@elementor/ui");
|
|
6806
6862
|
var import_i18n53 = require("@wordpress/i18n");
|
|
6807
6863
|
var ARIA_LABEL2 = (0, import_i18n53.__)("Attributes", "elementor");
|
|
6864
|
+
var TRACKING_DATA2 = { target_name: "attributes", location_l2: "general" };
|
|
6808
6865
|
var AttributesControl = createControl(() => {
|
|
6809
6866
|
const triggerRef = (0, import_react56.useRef)(null);
|
|
6810
6867
|
return /* @__PURE__ */ React105.createElement(
|
|
@@ -6817,7 +6874,7 @@ var AttributesControl = createControl(() => {
|
|
|
6817
6874
|
alignItems: "center"
|
|
6818
6875
|
}
|
|
6819
6876
|
},
|
|
6820
|
-
/* @__PURE__ */ React105.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes" }),
|
|
6877
|
+
/* @__PURE__ */ React105.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes", trackingData: TRACKING_DATA2 }),
|
|
6821
6878
|
/* @__PURE__ */ React105.createElement(import_ui91.Tooltip, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React105.createElement(
|
|
6822
6879
|
import_icons35.PlusIcon,
|
|
6823
6880
|
{
|
|
@@ -7040,7 +7097,7 @@ var usePopover = (openOnMount, onOpen) => {
|
|
|
7040
7097
|
// src/components/inline-editor-toolbar.tsx
|
|
7041
7098
|
var React109 = __toESM(require("react"));
|
|
7042
7099
|
var import_react59 = require("react");
|
|
7043
|
-
var
|
|
7100
|
+
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
7044
7101
|
var import_icons39 = require("@elementor/icons");
|
|
7045
7102
|
var import_ui95 = require("@elementor/ui");
|
|
7046
7103
|
var import_react60 = require("@tiptap/react");
|
|
@@ -7234,10 +7291,10 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7234
7291
|
);
|
|
7235
7292
|
};
|
|
7236
7293
|
var checkIfElementIsClickable = (elementId) => {
|
|
7237
|
-
const container = (0,
|
|
7294
|
+
const container = (0, import_editor_elements6.getContainer)(elementId);
|
|
7238
7295
|
const type = container?.model.get("widgetType");
|
|
7239
7296
|
const isButton = type === "e-button";
|
|
7240
|
-
const hasLink = !!(0,
|
|
7297
|
+
const hasLink = !!(0, import_editor_elements6.getElementSetting)(elementId, "link")?.value?.destination;
|
|
7241
7298
|
return isButton || hasLink;
|
|
7242
7299
|
};
|
|
7243
7300
|
var toolbarButtons = {
|
|
@@ -7470,39 +7527,33 @@ var hasValue = (value) => {
|
|
|
7470
7527
|
// src/hooks/use-font-families.ts
|
|
7471
7528
|
var import_react63 = require("react");
|
|
7472
7529
|
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
7473
|
-
var
|
|
7474
|
-
var supportedCategories = {
|
|
7475
|
-
system: (0, import_i18n57.__)("System", "elementor"),
|
|
7476
|
-
custom: (0, import_i18n57.__)("Custom Fonts", "elementor"),
|
|
7477
|
-
googlefonts: (0, import_i18n57.__)("Google Fonts", "elementor")
|
|
7478
|
-
};
|
|
7479
|
-
var getFontFamilies = () => {
|
|
7530
|
+
var getFontControlConfig = () => {
|
|
7480
7531
|
const { controls } = (0, import_editor_v1_adapters.getElementorConfig)();
|
|
7481
|
-
|
|
7482
|
-
if (!options) {
|
|
7483
|
-
return null;
|
|
7484
|
-
}
|
|
7485
|
-
return options;
|
|
7532
|
+
return controls?.font ?? {};
|
|
7486
7533
|
};
|
|
7487
7534
|
var useFontFamilies = () => {
|
|
7488
|
-
const
|
|
7535
|
+
const { groups, options } = getFontControlConfig();
|
|
7489
7536
|
return (0, import_react63.useMemo)(() => {
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7537
|
+
if (!groups || !options) {
|
|
7538
|
+
return [];
|
|
7539
|
+
}
|
|
7540
|
+
const groupKeys = Object.keys(groups);
|
|
7541
|
+
const groupIndexMap = new Map(groupKeys.map((key, index) => [key, index]));
|
|
7542
|
+
return Object.entries(options).reduce((acc, [font, category]) => {
|
|
7543
|
+
const groupIndex = groupIndexMap.get(category);
|
|
7544
|
+
if (groupIndex === void 0) {
|
|
7493
7545
|
return acc;
|
|
7494
7546
|
}
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
label: supportedCategories[category],
|
|
7547
|
+
if (!acc[groupIndex]) {
|
|
7548
|
+
acc[groupIndex] = {
|
|
7549
|
+
label: groups[category],
|
|
7499
7550
|
fonts: []
|
|
7500
7551
|
};
|
|
7501
7552
|
}
|
|
7502
|
-
acc[
|
|
7553
|
+
acc[groupIndex].fonts.push(font);
|
|
7503
7554
|
return acc;
|
|
7504
7555
|
}, []).filter(Boolean);
|
|
7505
|
-
}, [
|
|
7556
|
+
}, [groups, options]);
|
|
7506
7557
|
};
|
|
7507
7558
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7508
7559
|
0 && (module.exports = {
|
|
@@ -7571,6 +7622,8 @@ var useFontFamilies = () => {
|
|
|
7571
7622
|
injectIntoRepeaterItemLabel,
|
|
7572
7623
|
isUnitExtendedOption,
|
|
7573
7624
|
registerControlReplacement,
|
|
7625
|
+
trackUpgradePromotionClick,
|
|
7626
|
+
trackViewPromotion,
|
|
7574
7627
|
transitionProperties,
|
|
7575
7628
|
transitionsItemsList,
|
|
7576
7629
|
useBoundProp,
|