@elementor/editor-controls 4.4.0-1145 → 4.4.0-1147
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 +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +297 -177
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +274 -155
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
- package/src/controls/icon-library/font-awesome-7-catalog.ts +2 -0
- package/src/controls/icon-library/font-awesome-glyph.tsx +67 -1
- package/src/controls/icon-library/icon-library-grid.tsx +2 -1
- package/src/controls/icon-library/icon-library-popover.tsx +14 -5
- package/src/controls/icon-library/icon-library-providers.ts +48 -4
- package/src/controls/icon-library/merge-icons-by-id.ts +25 -0
- package/src/controls/svg-media-control.tsx +4 -7
- package/src/controls/svg-media-overlay.tsx +15 -19
- package/src/controls/svg-media-preview.tsx +32 -7
- package/src/index.ts +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -359,10 +359,9 @@ declare const AspectRatioControl: ControlComponent$1<({ label }: {
|
|
|
359
359
|
}) => React$1.JSX.Element>;
|
|
360
360
|
|
|
361
361
|
type SvgMediaControlProps = {
|
|
362
|
-
showIconLibrary?: boolean;
|
|
363
362
|
label?: string;
|
|
364
363
|
};
|
|
365
|
-
declare const SvgMediaControl: ControlComponent$1<({
|
|
364
|
+
declare const SvgMediaControl: ControlComponent$1<({ label }: SvgMediaControlProps) => React$1.JSX.Element>;
|
|
366
365
|
|
|
367
366
|
type VideoMediaControlProps = {
|
|
368
367
|
label?: string;
|
|
@@ -463,6 +462,8 @@ type FontAwesome7Icon = FontAwesome7IconDefinition & {
|
|
|
463
462
|
value: string;
|
|
464
463
|
glyphClass?: string;
|
|
465
464
|
svgMarkup?: string;
|
|
465
|
+
/** Markup is resolved on demand by the icon library providers, once the icon is displayed. */
|
|
466
|
+
lazySvg?: boolean;
|
|
466
467
|
};
|
|
467
468
|
|
|
468
469
|
type IconLibraryProviderState = {
|
|
@@ -473,6 +474,11 @@ type IconLibraryProvider = {
|
|
|
473
474
|
id: string;
|
|
474
475
|
useIcons: (enabled: boolean) => IconLibraryProviderState;
|
|
475
476
|
resolveSvg?: (library: string, iconValue: string, signal?: AbortSignal) => Promise<string | null>;
|
|
477
|
+
/**
|
|
478
|
+
* Resolves markup for picker tiles and the control preview. Falls back to `resolveSvg` when omitted.
|
|
479
|
+
* Use it when `resolveSvg` has side effects that should only happen for icons that are actually rendered.
|
|
480
|
+
*/
|
|
481
|
+
resolvePreviewSvg?: (library: string, iconValue: string, signal?: AbortSignal) => Promise<string | null>;
|
|
476
482
|
};
|
|
477
483
|
/**
|
|
478
484
|
* Register before the icon picker mounts. Each picker instance snapshots the providers on mount,
|
|
@@ -482,6 +488,7 @@ type IconLibraryProvider = {
|
|
|
482
488
|
declare function registerIconLibraryProvider(provider: IconLibraryProvider): void;
|
|
483
489
|
declare function unregisterIconLibraryProvider(id: string): void;
|
|
484
490
|
declare function resolveProviderIconSvg(library: string, iconValue: string, signal?: AbortSignal): Promise<string | null>;
|
|
491
|
+
declare function resolveProviderIconPreviewSvg(library: string, iconValue: string, signal?: AbortSignal): Promise<string | null>;
|
|
485
492
|
|
|
486
493
|
declare function enqueueIconFonts(library: string): void;
|
|
487
494
|
|
|
@@ -966,4 +973,4 @@ declare function useTypingBuffer(options?: UseTypingBufferOptions): {
|
|
|
966
973
|
startsWith: (haystack: string, needle: string) => boolean;
|
|
967
974
|
};
|
|
968
975
|
|
|
969
|
-
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 FontAwesome7Icon, type FontAwesome7IconDefinition, type FontCategory, FontFamilyControl, GapControl, GridSpanControl, HtmlTagControl, type IconLibraryProvider, IconLibraryUploadButton, IconLibraryUploadPromotion, 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, enqueueIconFonts, getControlReplacements, getFontAwesome7IconName, injectIntoIconLibraryUploadAction, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, isUnitExtendedOption, registerControlReplacement, registerIconLibraryProvider, resetFontAwesome7IconsCache, resolveFontAwesome7Icon, resolveProviderIconSvg, trackUpgradePromotionClick, trackViewPromotion, transitionProperties, transitionsItemsList, unregisterIconLibraryProvider, useBoundProp, useControlActions, useControlReplacement, useFontFamilies, useSyncExternalState, useTypingBuffer };
|
|
976
|
+
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 FontAwesome7Icon, type FontAwesome7IconDefinition, type FontCategory, FontFamilyControl, GapControl, GridSpanControl, HtmlTagControl, type IconLibraryProvider, IconLibraryUploadButton, IconLibraryUploadPromotion, 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, enqueueIconFonts, getControlReplacements, getFontAwesome7IconName, injectIntoIconLibraryUploadAction, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, isUnitExtendedOption, registerControlReplacement, registerIconLibraryProvider, resetFontAwesome7IconsCache, resolveFontAwesome7Icon, resolveProviderIconPreviewSvg, resolveProviderIconSvg, trackUpgradePromotionClick, trackViewPromotion, transitionProperties, transitionsItemsList, unregisterIconLibraryProvider, useBoundProp, useControlActions, useControlReplacement, useFontFamilies, useSyncExternalState, useTypingBuffer };
|
package/dist/index.d.ts
CHANGED
|
@@ -359,10 +359,9 @@ declare const AspectRatioControl: ControlComponent$1<({ label }: {
|
|
|
359
359
|
}) => React$1.JSX.Element>;
|
|
360
360
|
|
|
361
361
|
type SvgMediaControlProps = {
|
|
362
|
-
showIconLibrary?: boolean;
|
|
363
362
|
label?: string;
|
|
364
363
|
};
|
|
365
|
-
declare const SvgMediaControl: ControlComponent$1<({
|
|
364
|
+
declare const SvgMediaControl: ControlComponent$1<({ label }: SvgMediaControlProps) => React$1.JSX.Element>;
|
|
366
365
|
|
|
367
366
|
type VideoMediaControlProps = {
|
|
368
367
|
label?: string;
|
|
@@ -463,6 +462,8 @@ type FontAwesome7Icon = FontAwesome7IconDefinition & {
|
|
|
463
462
|
value: string;
|
|
464
463
|
glyphClass?: string;
|
|
465
464
|
svgMarkup?: string;
|
|
465
|
+
/** Markup is resolved on demand by the icon library providers, once the icon is displayed. */
|
|
466
|
+
lazySvg?: boolean;
|
|
466
467
|
};
|
|
467
468
|
|
|
468
469
|
type IconLibraryProviderState = {
|
|
@@ -473,6 +474,11 @@ type IconLibraryProvider = {
|
|
|
473
474
|
id: string;
|
|
474
475
|
useIcons: (enabled: boolean) => IconLibraryProviderState;
|
|
475
476
|
resolveSvg?: (library: string, iconValue: string, signal?: AbortSignal) => Promise<string | null>;
|
|
477
|
+
/**
|
|
478
|
+
* Resolves markup for picker tiles and the control preview. Falls back to `resolveSvg` when omitted.
|
|
479
|
+
* Use it when `resolveSvg` has side effects that should only happen for icons that are actually rendered.
|
|
480
|
+
*/
|
|
481
|
+
resolvePreviewSvg?: (library: string, iconValue: string, signal?: AbortSignal) => Promise<string | null>;
|
|
476
482
|
};
|
|
477
483
|
/**
|
|
478
484
|
* Register before the icon picker mounts. Each picker instance snapshots the providers on mount,
|
|
@@ -482,6 +488,7 @@ type IconLibraryProvider = {
|
|
|
482
488
|
declare function registerIconLibraryProvider(provider: IconLibraryProvider): void;
|
|
483
489
|
declare function unregisterIconLibraryProvider(id: string): void;
|
|
484
490
|
declare function resolveProviderIconSvg(library: string, iconValue: string, signal?: AbortSignal): Promise<string | null>;
|
|
491
|
+
declare function resolveProviderIconPreviewSvg(library: string, iconValue: string, signal?: AbortSignal): Promise<string | null>;
|
|
485
492
|
|
|
486
493
|
declare function enqueueIconFonts(library: string): void;
|
|
487
494
|
|
|
@@ -966,4 +973,4 @@ declare function useTypingBuffer(options?: UseTypingBufferOptions): {
|
|
|
966
973
|
startsWith: (haystack: string, needle: string) => boolean;
|
|
967
974
|
};
|
|
968
975
|
|
|
969
|
-
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 FontAwesome7Icon, type FontAwesome7IconDefinition, type FontCategory, FontFamilyControl, GapControl, GridSpanControl, HtmlTagControl, type IconLibraryProvider, IconLibraryUploadButton, IconLibraryUploadPromotion, 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, enqueueIconFonts, getControlReplacements, getFontAwesome7IconName, injectIntoIconLibraryUploadAction, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, isUnitExtendedOption, registerControlReplacement, registerIconLibraryProvider, resetFontAwesome7IconsCache, resolveFontAwesome7Icon, resolveProviderIconSvg, trackUpgradePromotionClick, trackViewPromotion, transitionProperties, transitionsItemsList, unregisterIconLibraryProvider, useBoundProp, useControlActions, useControlReplacement, useFontFamilies, useSyncExternalState, useTypingBuffer };
|
|
976
|
+
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 FontAwesome7Icon, type FontAwesome7IconDefinition, type FontCategory, FontFamilyControl, GapControl, GridSpanControl, HtmlTagControl, type IconLibraryProvider, IconLibraryUploadButton, IconLibraryUploadPromotion, 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, enqueueIconFonts, getControlReplacements, getFontAwesome7IconName, injectIntoIconLibraryUploadAction, injectIntoRepeaterItemActions, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, isUnitExtendedOption, registerControlReplacement, registerIconLibraryProvider, resetFontAwesome7IconsCache, resolveFontAwesome7Icon, resolveProviderIconPreviewSvg, resolveProviderIconSvg, trackUpgradePromotionClick, trackViewPromotion, transitionProperties, transitionsItemsList, unregisterIconLibraryProvider, useBoundProp, useControlActions, useControlReplacement, useFontFamilies, useSyncExternalState, useTypingBuffer };
|