@elementor/editor-controls 4.4.0-1144 → 4.4.0-1146

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.mjs CHANGED
@@ -558,24 +558,37 @@ var NoticeControl = createControl(
558
558
  });
559
559
  };
560
560
  const handleActionClick = () => {
561
- setIsDismissed(true);
562
- if (dismissible) {
563
- markNoticeAsDismissedInSession(dismissible);
561
+ if (!dismissible) {
562
+ return;
564
563
  }
564
+ setIsDismissed(true);
565
+ markNoticeAsDismissedInSession(dismissible);
565
566
  };
566
- return /* @__PURE__ */ React13.createElement(Alert, { variant: "outlined", severity, icon, size: "small", onClose: handleDismiss }, heading && /* @__PURE__ */ React13.createElement(NoticeTitle, null, heading), /* @__PURE__ */ React13.createElement(Typography, { variant: "caption", color: "textSecondary", sx: { fontStyle: "italic" } }, content), buttonText && buttonUrl && /* @__PURE__ */ React13.createElement(
567
- AlertAction,
567
+ return /* @__PURE__ */ React13.createElement(
568
+ Alert,
568
569
  {
569
- variant: "contained",
570
- color: severity,
571
- target: "_blank",
572
- rel: "noopener noreferrer",
573
- href: buttonUrl,
574
- onClick: handleActionClick,
575
- sx: { mt: 2 }
570
+ variant: "outlined",
571
+ severity,
572
+ icon,
573
+ size: "small",
574
+ onClose: dismissible ? handleDismiss : void 0
576
575
  },
577
- buttonText
578
- ));
576
+ heading && /* @__PURE__ */ React13.createElement(NoticeTitle, null, heading),
577
+ /* @__PURE__ */ React13.createElement(Typography, { variant: "caption", color: "textSecondary", sx: { fontStyle: "italic" } }, content),
578
+ buttonText && buttonUrl && /* @__PURE__ */ React13.createElement(
579
+ AlertAction,
580
+ {
581
+ variant: "contained",
582
+ color: severity,
583
+ target: "_blank",
584
+ rel: "noopener noreferrer",
585
+ href: buttonUrl,
586
+ onClick: handleActionClick,
587
+ sx: { mt: 2 }
588
+ },
589
+ buttonText
590
+ )
591
+ );
579
592
  }
580
593
  );
581
594
 
@@ -5664,7 +5677,7 @@ var AspectRatioControl = createControl(({ label }) => {
5664
5677
 
5665
5678
  // src/controls/svg-media-control.tsx
5666
5679
  import * as React93 from "react";
5667
- import { useEffect as useEffect17, useRef as useRef19, useState as useState23 } from "react";
5680
+ import { useEffect as useEffect18, useRef as useRef21, useState as useState24 } from "react";
5668
5681
  import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
5669
5682
  import { iconPropTypeUtil, svgSrcPropTypeUtil, urlPropTypeUtil as urlPropTypeUtil4 } from "@elementor/editor-props";
5670
5683
  import { Box as Box24, Card as Card2, CardOverlay as CardOverlay2, Popover as Popover6, Stack as Stack18, styled as styled12, usePopupState as usePopupState9 } from "@elementor/ui";
@@ -5748,7 +5761,7 @@ function measureIconLibraryAnchor(container, buttonGroup) {
5748
5761
 
5749
5762
  // src/controls/icon-library/icon-library-popover.tsx
5750
5763
  import * as React90 from "react";
5751
- import { useMemo as useMemo12, useState as useState22 } from "react";
5764
+ import { useMemo as useMemo12, useState as useState23 } from "react";
5752
5765
  import {
5753
5766
  PopoverBody as PopoverBody2,
5754
5767
  PopoverHeader as PopoverHeader4,
@@ -6009,8 +6022,74 @@ function toCatalogIcon(icon, library) {
6009
6022
 
6010
6023
  // src/controls/icon-library/font-awesome-glyph.tsx
6011
6024
  import * as React84 from "react";
6025
+ import { useEffect as useEffect17, useRef as useRef18, useState as useState20 } from "react";
6012
6026
  import { Box as Box17 } from "@elementor/ui";
6013
6027
 
6028
+ // src/controls/icon-library/icon-library-providers.ts
6029
+ import { useRef as useRef17, useState as useState19 } from "react";
6030
+ import { useQuery as useQuery2 } from "@elementor/query";
6031
+ var PROVIDER_ICON_SVG_QUERY_KEY = "icon-library-provider-svg";
6032
+ var providers = /* @__PURE__ */ new Map();
6033
+ function registerIconLibraryProvider(provider) {
6034
+ providers.set(provider.id, provider);
6035
+ }
6036
+ function unregisterIconLibraryProvider(id) {
6037
+ providers.delete(id);
6038
+ }
6039
+ function useIconLibraryProviderIcons(enabled) {
6040
+ const [snapshot] = useState19(() => [...providers.values()]);
6041
+ const states = snapshot.map((provider) => provider.useIcons(enabled));
6042
+ const data = useStableConcat(states.map((state) => state.data));
6043
+ return {
6044
+ data,
6045
+ isLoading: states.some((state) => state.isLoading)
6046
+ };
6047
+ }
6048
+ function resolveProviderIconSvg(library, iconValue, signal) {
6049
+ return resolveFromProviders((provider) => provider.resolveSvg, library, iconValue, signal);
6050
+ }
6051
+ function resolveProviderIconPreviewSvg(library, iconValue, signal) {
6052
+ return resolveFromProviders(
6053
+ (provider) => provider.resolvePreviewSvg ?? provider.resolveSvg,
6054
+ library,
6055
+ iconValue,
6056
+ signal
6057
+ );
6058
+ }
6059
+ async function resolveFromProviders(pickResolver, library, iconValue, signal) {
6060
+ for (const provider of providers.values()) {
6061
+ try {
6062
+ const markup = await pickResolver(provider)?.(library, iconValue, signal);
6063
+ if (markup) {
6064
+ return markup;
6065
+ }
6066
+ } catch (error) {
6067
+ if (signal?.aborted) {
6068
+ throw error;
6069
+ }
6070
+ }
6071
+ }
6072
+ return null;
6073
+ }
6074
+ function useStableConcat(lists) {
6075
+ const previous = useRef17(null);
6076
+ if (!previous.current || !areSameLists(previous.current.lists, lists)) {
6077
+ previous.current = { lists, merged: lists.flatMap((list) => list ?? []) };
6078
+ }
6079
+ return previous.current.merged;
6080
+ }
6081
+ function areSameLists(a, b) {
6082
+ return a.length === b.length && a.every((item, index) => item === b[index]);
6083
+ }
6084
+ function useProviderIconSvg(library, iconValue, enabled) {
6085
+ return useQuery2({
6086
+ queryKey: [PROVIDER_ICON_SVG_QUERY_KEY, library, iconValue],
6087
+ queryFn: ({ signal }) => resolveProviderIconSvg(library, iconValue, signal),
6088
+ enabled: enabled && Boolean(library && iconValue),
6089
+ staleTime: Infinity
6090
+ });
6091
+ }
6092
+
6014
6093
  // src/controls/icon-library/sanitize-icon-svg-markup.ts
6015
6094
  var ALLOWED_SVG_TAGS = /* @__PURE__ */ new Set(["svg", "g", "path", "title", "desc"]);
6016
6095
  var ALLOWED_SVG_ATTRS = /* @__PURE__ */ new Set([
@@ -6057,7 +6136,56 @@ function pruneNode(node) {
6057
6136
  }
6058
6137
 
6059
6138
  // src/controls/icon-library/font-awesome-glyph.tsx
6060
- var FontAwesomeGlyph = ({ icon, size, color, label }) => {
6139
+ var FontAwesomeGlyph = (props) => {
6140
+ const { icon } = props;
6141
+ if (icon.lazySvg && !icon.svgMarkup) {
6142
+ return /* @__PURE__ */ React84.createElement(LazyProviderGlyph, { ...props });
6143
+ }
6144
+ return /* @__PURE__ */ React84.createElement(ResolvedGlyph, { ...props });
6145
+ };
6146
+ var LazyProviderGlyph = (props) => {
6147
+ const { icon, size } = props;
6148
+ const [resolved, setResolved] = useState20(null);
6149
+ const [isVisible, setIsVisible] = useState20(typeof IntersectionObserver === "undefined");
6150
+ const placeholderRef = useRef18(null);
6151
+ const svgMarkup = resolved?.id === icon.id ? resolved.markup : null;
6152
+ useEffect17(() => {
6153
+ const element = placeholderRef.current;
6154
+ if (isVisible || !element) {
6155
+ return;
6156
+ }
6157
+ const observer = new IntersectionObserver((entries) => {
6158
+ if (entries.some((entry) => entry.isIntersecting)) {
6159
+ setIsVisible(true);
6160
+ observer.disconnect();
6161
+ }
6162
+ });
6163
+ observer.observe(element);
6164
+ return () => observer.disconnect();
6165
+ }, [isVisible]);
6166
+ useEffect17(() => {
6167
+ if (!isVisible) {
6168
+ return;
6169
+ }
6170
+ const controller = new AbortController();
6171
+ resolveProviderIconPreviewSvg(icon.library, icon.value, controller.signal).then((markup) => !controller.signal.aborted && setResolved({ id: icon.id, markup })).catch(() => {
6172
+ });
6173
+ return () => controller.abort();
6174
+ }, [isVisible, icon.id, icon.library, icon.value]);
6175
+ if (!svgMarkup) {
6176
+ return /* @__PURE__ */ React84.createElement(
6177
+ Box17,
6178
+ {
6179
+ component: "span",
6180
+ ref: placeholderRef,
6181
+ "aria-hidden": "true",
6182
+ sx: { display: "inline-block", width: size, height: size }
6183
+ }
6184
+ );
6185
+ }
6186
+ return /* @__PURE__ */ React84.createElement(ResolvedGlyph, { ...props, icon: { ...icon, svgMarkup } });
6187
+ };
6188
+ var ResolvedGlyph = ({ icon, size, color, label }) => {
6061
6189
  const svgMarkup = sanitizeIconSvgMarkup(icon.svgMarkup);
6062
6190
  if (svgMarkup) {
6063
6191
  return /* @__PURE__ */ React84.createElement(
@@ -6313,7 +6441,7 @@ function parseFilterEntry(value) {
6313
6441
 
6314
6442
  // src/controls/icon-library/icon-library-grid.tsx
6315
6443
  import * as React86 from "react";
6316
- import { useLayoutEffect as useLayoutEffect3, useRef as useRef17, useState as useState19 } from "react";
6444
+ import { useLayoutEffect as useLayoutEffect3, useRef as useRef19, useState as useState21 } from "react";
6317
6445
  import { Box as Box19, Tooltip as Tooltip9, useTheme as useTheme4 } from "@elementor/ui";
6318
6446
  import { useVirtualizer } from "@tanstack/react-virtual";
6319
6447
  import { __ as __35 } from "@wordpress/i18n";
@@ -6352,12 +6480,12 @@ var IconLibraryGrid = ({
6352
6480
  noResultsComponent
6353
6481
  }) => {
6354
6482
  const theme = useTheme4();
6355
- const containerRef = useRef17(null);
6356
- const cellRefs = useRef17(/* @__PURE__ */ new Map());
6357
- const shouldRestoreFocusRef = useRef17(false);
6483
+ const containerRef = useRef19(null);
6484
+ const cellRefs = useRef19(/* @__PURE__ */ new Map());
6485
+ const shouldRestoreFocusRef = useRef19(false);
6358
6486
  const selectedIndex = items2.findIndex((item) => item.id === selectedValue);
6359
- const [focusedIndex, setFocusedIndex] = useState19(selectedIndex >= 0 ? selectedIndex : 0);
6360
- const [{ columnCount, cellSize }, setGridMetrics] = useState19(() => getGridMetrics(0, 0, 0));
6487
+ const [focusedIndex, setFocusedIndex] = useState21(selectedIndex >= 0 ? selectedIndex : 0);
6488
+ const [{ columnCount, cellSize }, setGridMetrics] = useState21(() => getGridMetrics(0, 0, 0));
6361
6489
  const rowCount = Math.ceil(items2.length / columnCount);
6362
6490
  const cellGap = Number.parseFloat(theme.spacing(GRID_CELL_GAP));
6363
6491
  const verticalPadding = Number.parseFloat(theme.spacing(GRID_VERTICAL_PADDING));
@@ -6594,7 +6722,7 @@ var IconLibraryGrid = ({
6594
6722
  /* @__PURE__ */ React86.createElement(
6595
6723
  FontAwesomeGlyph,
6596
6724
  {
6597
- icon: item,
6725
+ icon: { ...item, value: item.iconValue ?? item.value },
6598
6726
  size: ICON_GLYPH_SIZE,
6599
6727
  color: "currentColor"
6600
6728
  }
@@ -6609,52 +6737,9 @@ var IconLibraryGrid = ({
6609
6737
  );
6610
6738
  };
6611
6739
 
6612
- // src/controls/icon-library/icon-library-providers.ts
6613
- import { useState as useState20 } from "react";
6614
- import { useQuery as useQuery2 } from "@elementor/query";
6615
- var PROVIDER_ICON_SVG_QUERY_KEY = "icon-library-provider-svg";
6616
- var providers = /* @__PURE__ */ new Map();
6617
- function registerIconLibraryProvider(provider) {
6618
- providers.set(provider.id, provider);
6619
- }
6620
- function unregisterIconLibraryProvider(id) {
6621
- providers.delete(id);
6622
- }
6623
- function useIconLibraryProviderIcons(enabled) {
6624
- const [snapshot] = useState20(() => [...providers.values()]);
6625
- const states = snapshot.map((provider) => provider.useIcons(enabled));
6626
- return {
6627
- data: states.flatMap((state) => state.data ?? []),
6628
- isLoading: states.some((state) => state.isLoading)
6629
- };
6630
- }
6631
- async function resolveProviderIconSvg(library, iconValue, signal) {
6632
- for (const provider of providers.values()) {
6633
- try {
6634
- const markup = await provider.resolveSvg?.(library, iconValue, signal);
6635
- if (markup) {
6636
- return markup;
6637
- }
6638
- } catch (error) {
6639
- if (signal?.aborted) {
6640
- throw error;
6641
- }
6642
- }
6643
- }
6644
- return null;
6645
- }
6646
- function useProviderIconSvg(library, iconValue, enabled) {
6647
- return useQuery2({
6648
- queryKey: [PROVIDER_ICON_SVG_QUERY_KEY, library, iconValue],
6649
- queryFn: ({ signal }) => resolveProviderIconSvg(library, iconValue, signal),
6650
- enabled: enabled && Boolean(library && iconValue),
6651
- staleTime: Infinity
6652
- });
6653
- }
6654
-
6655
6740
  // src/controls/icon-library/icon-library-upload-action.tsx
6656
6741
  import * as React87 from "react";
6657
- import { forwardRef as forwardRef11, useRef as useRef18, useState as useState21 } from "react";
6742
+ import { forwardRef as forwardRef11, useRef as useRef20, useState as useState22 } from "react";
6658
6743
  import { PromotionPopover, useCanvasClickHandler } from "@elementor/editor-ui";
6659
6744
  import { UploadIcon as UploadIcon2 } from "@elementor/icons";
6660
6745
  import { createReplaceableLocation as createReplaceableLocation2 } from "@elementor/locations";
@@ -6715,8 +6800,8 @@ var IconLibraryUploadPromotion = ({
6715
6800
  title = __36("Upload custom icons", "elementor"),
6716
6801
  content = __36("Add your own icon font library to use across your site.", "elementor")
6717
6802
  }) => {
6718
- const [isOpen, setIsOpen] = useState21(false);
6719
- const triggerRef = useRef18(null);
6803
+ const [isOpen, setIsOpen] = useState22(false);
6804
+ const triggerRef = useRef20(null);
6720
6805
  const canSeePromotions = !!window.elementor?.config?.v4Promotions;
6721
6806
  const close = () => {
6722
6807
  setIsOpen(false);
@@ -6800,6 +6885,21 @@ var IconLibraryViewToggle = ({ value, onChange }) => {
6800
6885
  );
6801
6886
  };
6802
6887
 
6888
+ // src/controls/icon-library/merge-icons-by-id.ts
6889
+ var getNames = (icon) => [icon.name, ...icon.aliases ?? []].filter(Boolean);
6890
+ function mergeIconsById(primary, secondary) {
6891
+ const ids = new Set(primary.map((icon) => icon.id));
6892
+ const names = new Set(
6893
+ primary.flatMap((icon) => getNames(icon).map((name) => `${icon.library}:${name}`))
6894
+ );
6895
+ return [
6896
+ ...primary,
6897
+ ...secondary.filter(
6898
+ (icon) => !ids.has(icon.id) && !getNames(icon).some((name) => names.has(`${icon.library}:${name}`))
6899
+ )
6900
+ ];
6901
+ }
6902
+
6803
6903
  // src/controls/icon-library/svg-element-icon.tsx
6804
6904
  import * as React89 from "react";
6805
6905
  import { SvgIcon } from "@elementor/ui";
@@ -6856,7 +6956,7 @@ var IconLibraryPopover = ({
6856
6956
  handleChange: handleSearchChange,
6857
6957
  setImmediateValue: setSearchValue
6858
6958
  } = useDebounceState({ delay: ICON_LIBRARY_SEARCH_DEBOUNCE_DELAY });
6859
- const [activeLibraries, setActiveLibraries] = useState22([]);
6959
+ const [activeLibraries, setActiveLibraries] = useState23([]);
6860
6960
  const [storedView, setStoredView] = useSessionStorage2(
6861
6961
  ICON_LIBRARY_VIEW_STORAGE_KEY,
6862
6962
  ICON_LIBRARY_VIEW_STORAGE_PREFIX
@@ -6864,12 +6964,15 @@ var IconLibraryPopover = ({
6864
6964
  const view = isIconLibraryView(storedView) ? storedView : DEFAULT_ICON_LIBRARY_VIEW;
6865
6965
  const { data: fontAwesomeIcons = [], isLoading: isFontAwesomeLoading } = useFontAwesome7Catalog(open);
6866
6966
  const { data: providerIcons = [], isLoading: isProviderLoading } = useIconLibraryProviderIcons(open);
6867
- const isLoading = isFontAwesomeLoading || isProviderLoading;
6868
- const icons = useMemo12(() => [...fontAwesomeIcons, ...providerIcons], [providerIcons, fontAwesomeIcons]);
6967
+ const icons = useMemo12(
6968
+ () => mergeIconsById(fontAwesomeIcons, providerIcons),
6969
+ [providerIcons, fontAwesomeIcons]
6970
+ );
6869
6971
  const items2 = useMemo12(
6870
6972
  () => createIconLibraryItems(icons, searchValue, activeLibraries),
6871
6973
  [activeLibraries, icons, searchValue]
6872
6974
  );
6975
+ const isLoading = isFontAwesomeLoading || isProviderLoading && items2.length === 0;
6873
6976
  const selectedValue = useMemo12(
6874
6977
  () => findFontAwesome7Icon(icons, selectedIconClass, selectedIconLibrary)?.id,
6875
6978
  [icons, selectedIconClass, selectedIconLibrary]
@@ -6991,7 +7094,7 @@ var IconLibraryContent = ({
6991
7094
  }
6992
7095
  );
6993
7096
  };
6994
- var IconLibraryLoadingState = () => /* @__PURE__ */ React90.createElement(Stack16, { alignItems: "center", justifyContent: "center", height: "100%" }, /* @__PURE__ */ React90.createElement(CircularProgress3, { role: "progressbar", size: 24 }));
7097
+ var IconLibraryLoadingState = () => /* @__PURE__ */ React90.createElement(Stack16, { alignItems: "center", justifyContent: "center", height: "100%" }, /* @__PURE__ */ React90.createElement(CircularProgress3, { role: "progressbar", size: 24, "aria-label": __38("Loading icons", "elementor") }));
6995
7098
  var IconLibraryEmptyState = ({
6996
7099
  searchValue,
6997
7100
  isCatalogAvailable,
@@ -7020,7 +7123,14 @@ var IconLibraryRow = (item) => {
7020
7123
  flexShrink: 0
7021
7124
  }
7022
7125
  },
7023
- /* @__PURE__ */ React90.createElement(FontAwesomeGlyph, { icon, size: ICON_GLYPH_SIZE2, color: "currentColor" })
7126
+ /* @__PURE__ */ React90.createElement(
7127
+ FontAwesomeGlyph,
7128
+ {
7129
+ icon: { ...icon, value: icon.iconValue },
7130
+ size: ICON_GLYPH_SIZE2,
7131
+ color: "currentColor"
7132
+ }
7133
+ )
7024
7134
  ), /* @__PURE__ */ React90.createElement(Typography10, { variant: "caption", color: "text.primary", noWrap: true }, icon.label));
7025
7135
  };
7026
7136
  var CatalogUnavailable = () => /* @__PURE__ */ React90.createElement(Stack16, { alignItems: "center", justifyContent: "center", height: "100%", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React90.createElement(SvgElementIcon, { fontSize: "large" }), /* @__PURE__ */ React90.createElement(Typography10, { align: "center", variant: "subtitle2", color: "text.secondary" }, __38("Icons couldn't be loaded.", "elementor")));
@@ -7028,7 +7138,8 @@ var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React90.createElem
7028
7138
  var createIconLibraryItems = (icons, searchValue, libraries) => filterFontAwesome7Icons(icons, searchValue, libraries).map((icon) => ({
7029
7139
  ...icon,
7030
7140
  type: "item",
7031
- value: icon.id
7141
+ value: icon.id,
7142
+ iconValue: icon.value
7032
7143
  }));
7033
7144
 
7034
7145
  // src/controls/open-icon-library.ts
@@ -7105,6 +7216,7 @@ var UploadControl = ({ isAdmin, onUpload }) => {
7105
7216
 
7106
7217
  // src/controls/svg-media-preview.tsx
7107
7218
  import * as React92 from "react";
7219
+ import { useMemo as useMemo13 } from "react";
7108
7220
  import { Box as Box23, CardMedia as CardMedia2, CircularProgress as CircularProgress4 } from "@elementor/ui";
7109
7221
  import { __ as __40 } from "@wordpress/i18n";
7110
7222
  var ICON_PREVIEW_SIZE = 50;
@@ -7112,21 +7224,30 @@ var ICON_PREVIEW_COLOR = "#000000";
7112
7224
  var SvgMediaPreview = ({ isFetching, src, iconClassName, iconLibrary }) => {
7113
7225
  const shouldLoadIconCatalog = Boolean(iconClassName && iconLibrary);
7114
7226
  const { data: fontAwesomeIcons = [], isLoading: isFontAwesomeLoading } = useFontAwesome7Catalog(shouldLoadIconCatalog);
7115
- const { data: providerIcons = [], isLoading: isProviderLoading } = useIconLibraryProviderIcons(shouldLoadIconCatalog);
7116
- const icons = [...fontAwesomeIcons, ...providerIcons];
7227
+ const isFontAwesomeLibrary = Boolean(iconLibrary?.startsWith("fa-"));
7228
+ const { data: providerIcons = [], isLoading: isProviderLoading } = useIconLibraryProviderIcons(
7229
+ shouldLoadIconCatalog && !isFontAwesomeLibrary
7230
+ );
7231
+ const icons = useMemo13(
7232
+ () => mergeIconsById(fontAwesomeIcons, providerIcons),
7233
+ [fontAwesomeIcons, providerIcons]
7234
+ );
7117
7235
  const selectedIcon = findFontAwesome7Icon(icons, iconClassName, iconLibrary);
7118
- const isLoadingCatalog = shouldLoadIconCatalog && (isFontAwesomeLoading || isProviderLoading);
7236
+ const isLoadingCatalog = shouldLoadIconCatalog && (isFontAwesomeLoading || !isFontAwesomeLibrary && isProviderLoading);
7119
7237
  const { data: savedIconSvg, isLoading: isSavedIconLoading } = useProviderIconSvg(
7120
7238
  iconLibrary,
7121
7239
  iconClassName,
7122
- shouldLoadIconCatalog && !isLoadingCatalog && !selectedIcon
7240
+ shouldLoadIconCatalog && !isLoadingCatalog && !selectedIcon && !isFontAwesomeLibrary
7123
7241
  );
7124
7242
  if (isFetching || isLoadingCatalog || isSavedIconLoading) {
7125
- return /* @__PURE__ */ React92.createElement(CircularProgress4, { role: "progressbar" });
7243
+ return /* @__PURE__ */ React92.createElement(CircularProgress4, { role: "progressbar", "aria-label": __40("Loading icon", "elementor") });
7126
7244
  }
7127
7245
  if (selectedIcon) {
7128
7246
  return /* @__PURE__ */ React92.createElement(IconPreview, { icon: selectedIcon });
7129
7247
  }
7248
+ if (shouldLoadIconCatalog && iconClassName && iconLibrary && isFontAwesomeLibrary) {
7249
+ return /* @__PURE__ */ React92.createElement(IconPreview, { icon: createLazyIcon(iconLibrary, iconClassName) });
7250
+ }
7130
7251
  if (savedIconSvg) {
7131
7252
  return /* @__PURE__ */ React92.createElement(IconPreview, { icon: toSvgMarkupIcon(savedIconSvg, iconLibrary, iconClassName) });
7132
7253
  }
@@ -7135,6 +7256,18 @@ var SvgMediaPreview = ({ isFetching, src, iconClassName, iconLibrary }) => {
7135
7256
  }
7136
7257
  return /* @__PURE__ */ React92.createElement(SvgPreview, { src });
7137
7258
  };
7259
+ var createLazyIcon = (library, value) => ({
7260
+ id: `${library}:${value}`,
7261
+ name: value,
7262
+ label: value,
7263
+ library,
7264
+ value,
7265
+ aliases: [],
7266
+ width: ICON_PREVIEW_SIZE,
7267
+ height: ICON_PREVIEW_SIZE,
7268
+ paths: [],
7269
+ lazySvg: true
7270
+ });
7138
7271
  var toSvgMarkupIcon = (svgMarkup, library, value) => ({
7139
7272
  id: `${library}:${value}`,
7140
7273
  label: value ?? "",
@@ -7147,7 +7280,7 @@ var toSvgMarkupIcon = (svgMarkup, library, value) => ({
7147
7280
  paths: [],
7148
7281
  svgMarkup
7149
7282
  });
7150
- var IconPreview = ({ icon }) => /* @__PURE__ */ React92.createElement(Box23, { sx: { color: ICON_PREVIEW_COLOR } }, /* @__PURE__ */ React92.createElement(
7283
+ var IconPreview = ({ icon }) => /* @__PURE__ */ React92.createElement(Box23, { sx: { color: ICON_PREVIEW_COLOR, minWidth: ICON_PREVIEW_SIZE, minHeight: ICON_PREVIEW_SIZE } }, /* @__PURE__ */ React92.createElement(
7151
7284
  FontAwesomeGlyph,
7152
7285
  {
7153
7286
  icon,
@@ -7216,11 +7349,11 @@ var SvgMediaControl = createControl(({ showIconLibrary = false, label }) => {
7216
7349
  const { data: attachment, isFetching } = useWpMediaAttachment2(previewSvgValue?.id?.value || null);
7217
7350
  const src = attachment?.url ?? previewSvgValue?.url?.value ?? null;
7218
7351
  const { data: allowSvgUpload } = useUnfilteredFilesUpload();
7219
- const [unfilteredModalOpenState, setUnfilteredModalOpenState] = useState23(false);
7352
+ const [unfilteredModalOpenState, setUnfilteredModalOpenState] = useState24(false);
7220
7353
  const iconLibraryPopoverState = usePopupState9({ variant: "popover" });
7221
- const controlContainerRef = useRef19(null);
7222
- const buttonGroupRef = useRef19(null);
7223
- const [iconLibraryAnchor, setIconLibraryAnchor] = useState23(null);
7354
+ const controlContainerRef = useRef21(null);
7355
+ const buttonGroupRef = useRef21(null);
7356
+ const [iconLibraryAnchor, setIconLibraryAnchor] = useState24(null);
7224
7357
  const { isAdmin } = useCurrentUserCapabilities();
7225
7358
  const selectedIconClass = showIconLibrary && typeof previewIconValue?.value?.value === "string" ? previewIconValue.value.value : null;
7226
7359
  const selectedIconLibrary = showIconLibrary && typeof previewIconValue?.library?.value === "string" ? previewIconValue.library.value : null;
@@ -7272,7 +7405,7 @@ var SvgMediaControl = createControl(({ showIconLibrary = false, label }) => {
7272
7405
  setIconLibraryAnchor(anchor);
7273
7406
  iconLibraryPopoverState.open(event);
7274
7407
  };
7275
- useEffect17(() => {
7408
+ useEffect18(() => {
7276
7409
  if (!iconLibraryPopoverState.isOpen) {
7277
7410
  return;
7278
7411
  }
@@ -7566,7 +7699,7 @@ var BackgroundImageOverlayAttachment = () => {
7566
7699
 
7567
7700
  // src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
7568
7701
  import * as React97 from "react";
7569
- import { useRef as useRef20 } from "react";
7702
+ import { useRef as useRef22 } from "react";
7570
7703
  import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil16 } from "@elementor/editor-props";
7571
7704
  import { MenuListItem as MenuListItem6 } from "@elementor/editor-ui";
7572
7705
  import { LetterXIcon, LetterYIcon } from "@elementor/icons";
@@ -7588,7 +7721,7 @@ var BackgroundImageOverlayPosition = () => {
7588
7721
  const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
7589
7722
  const stringPropContext = useBoundProp(stringPropTypeUtil16);
7590
7723
  const isCustom = !!backgroundImageOffsetContext.value;
7591
- const rowRef = useRef20(null);
7724
+ const rowRef = useRef22(null);
7592
7725
  const handlePositionChange = (event) => {
7593
7726
  const value = event.target.value || null;
7594
7727
  if (value === "custom") {
@@ -7661,7 +7794,7 @@ var BackgroundImageOverlayRepeat = () => {
7661
7794
 
7662
7795
  // src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
7663
7796
  import * as React99 from "react";
7664
- import { useRef as useRef21 } from "react";
7797
+ import { useRef as useRef23 } from "react";
7665
7798
  import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil17 } from "@elementor/editor-props";
7666
7799
  import {
7667
7800
  ArrowBarBothIcon,
@@ -7703,7 +7836,7 @@ var BackgroundImageOverlaySize = () => {
7703
7836
  const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
7704
7837
  const stringPropContext = useBoundProp(stringPropTypeUtil17);
7705
7838
  const isCustom = !!backgroundImageScaleContext.value;
7706
- const rowRef = useRef21(null);
7839
+ const rowRef = useRef23(null);
7707
7840
  const handleSizeChange = (size) => {
7708
7841
  if (size === "custom") {
7709
7842
  backgroundImageScaleContext.setValue({ width: null, height: null });
@@ -7738,7 +7871,7 @@ var BackgroundImageOverlaySize = () => {
7738
7871
  };
7739
7872
 
7740
7873
  // src/controls/background-control/background-overlay/use-background-tabs-history.ts
7741
- import { useRef as useRef22 } from "react";
7874
+ import { useRef as useRef24 } from "react";
7742
7875
  import {
7743
7876
  backgroundColorOverlayPropTypeUtil,
7744
7877
  backgroundGradientOverlayPropTypeUtil as backgroundGradientOverlayPropTypeUtil2,
@@ -7763,7 +7896,7 @@ var useBackgroundTabsHistory = ({
7763
7896
  return "image";
7764
7897
  };
7765
7898
  const { getTabsProps, getTabProps, getTabPanelProps } = useTabs(getCurrentOverlayType());
7766
- const valuesHistory = useRef22({
7899
+ const valuesHistory = useRef24({
7767
7900
  image: initialBackgroundImageOverlay,
7768
7901
  color: initialBackgroundColorOverlay2,
7769
7902
  gradient: initialBackgroundGradientOverlay2
@@ -8014,7 +8147,7 @@ var BackgroundClipField = () => {
8014
8147
 
8015
8148
  // src/controls/repeatable-control.tsx
8016
8149
  import * as React102 from "react";
8017
- import { useMemo as useMemo13 } from "react";
8150
+ import { useMemo as useMemo14 } from "react";
8018
8151
  import { createArrayPropUtils as createArrayPropUtils2 } from "@elementor/editor-props";
8019
8152
  import { Box as Box26 } from "@elementor/ui";
8020
8153
  var PLACEHOLDER_REGEX = /\$\{([^}]+)\}/g;
@@ -8035,11 +8168,11 @@ var RepeatableControl = createControl(
8035
8168
  if (!childPropTypeUtil) {
8036
8169
  return null;
8037
8170
  }
8038
- const childArrayPropTypeUtil2 = useMemo13(
8171
+ const childArrayPropTypeUtil2 = useMemo14(
8039
8172
  () => createArrayPropUtils2(childPropTypeUtil.key, childPropTypeUtil.schema, propKey),
8040
8173
  [childPropTypeUtil.key, childPropTypeUtil.schema, propKey]
8041
8174
  );
8042
- const contextValue = useMemo13(
8175
+ const contextValue = useMemo14(
8043
8176
  () => ({
8044
8177
  ...childControlConfig,
8045
8178
  placeholder: placeholder || "",
@@ -8171,7 +8304,7 @@ var getAllProperties = (pattern) => {
8171
8304
 
8172
8305
  // src/controls/key-value-control.tsx
8173
8306
  import * as React103 from "react";
8174
- import { useMemo as useMemo14, useState as useState24 } from "react";
8307
+ import { useMemo as useMemo15, useState as useState25 } from "react";
8175
8308
  import {
8176
8309
  isTransformable,
8177
8310
  keyValuePropTypeUtil,
@@ -8202,9 +8335,9 @@ var getInitialFieldValue = (fieldValue) => {
8202
8335
  };
8203
8336
  var KeyValueControl = createControl((props = {}) => {
8204
8337
  const { value, setValue, ...propContext } = useBoundProp(keyValuePropTypeUtil);
8205
- const [keyError, setKeyError] = useState24("");
8206
- const [valueError, setValueError] = useState24("");
8207
- const [sessionState, setSessionState] = useState24({
8338
+ const [keyError, setKeyError] = useState25("");
8339
+ const [valueError, setValueError] = useState25("");
8340
+ const [sessionState, setSessionState] = useState25({
8208
8341
  key: getInitialFieldValue(value?.key),
8209
8342
  value: getInitialFieldValue(value?.value)
8210
8343
  });
@@ -8214,7 +8347,7 @@ var KeyValueControl = createControl((props = {}) => {
8214
8347
  keyHelper: void 0,
8215
8348
  valueHelper: void 0
8216
8349
  };
8217
- const [keyRegex, valueRegex, errMsg] = useMemo14(
8350
+ const [keyRegex, valueRegex, errMsg] = useMemo15(
8218
8351
  () => [
8219
8352
  props.regexKey ? new RegExp(props.regexKey) : void 0,
8220
8353
  props.regexValue ? new RegExp(props.regexValue) : void 0,
@@ -8346,7 +8479,7 @@ var PositionControl = () => {
8346
8479
 
8347
8480
  // src/controls/transform-control/transform-repeater-control.tsx
8348
8481
  import * as React117 from "react";
8349
- import { useRef as useRef30 } from "react";
8482
+ import { useRef as useRef32 } from "react";
8350
8483
  import { transformFunctionsPropTypeUtil, transformPropTypeUtil } from "@elementor/editor-props";
8351
8484
  import { AdjustmentsIcon as AdjustmentsIcon2, InfoCircleFilledIcon as InfoCircleFilledIcon2 } from "@elementor/icons";
8352
8485
  import { bindTrigger as bindTrigger5, Box as Box30, IconButton as IconButton10, Tooltip as Tooltip12, Typography as Typography12, usePopupState as usePopupState10 } from "@elementor/ui";
@@ -8410,7 +8543,7 @@ import { __ as __55 } from "@wordpress/i18n";
8410
8543
 
8411
8544
  // src/controls/transform-control/functions/move.tsx
8412
8545
  import * as React106 from "react";
8413
- import { useRef as useRef23 } from "react";
8546
+ import { useRef as useRef25 } from "react";
8414
8547
  import { moveTransformPropTypeUtil } from "@elementor/editor-props";
8415
8548
  import { ArrowDownLeftIcon, ArrowDownSmallIcon, ArrowRightIcon } from "@elementor/icons";
8416
8549
  import { Grid as Grid22 } from "@elementor/ui";
@@ -8457,7 +8590,7 @@ var moveAxisControls = [
8457
8590
  ];
8458
8591
  var Move = () => {
8459
8592
  const context = useBoundProp(moveTransformPropTypeUtil);
8460
- const rowRefs = [useRef23(null), useRef23(null), useRef23(null)];
8593
+ const rowRefs = [useRef25(null), useRef25(null), useRef25(null)];
8461
8594
  return /* @__PURE__ */ React106.createElement(Grid22, { container: true, spacing: 1.5 }, /* @__PURE__ */ React106.createElement(PropProvider, { ...context }, /* @__PURE__ */ React106.createElement(PropKeyProvider, { bind: TransformFunctionKeys.move }, moveAxisControls.map((control, index) => /* @__PURE__ */ React106.createElement(
8462
8595
  AxisRow,
8463
8596
  {
@@ -8472,7 +8605,7 @@ var Move = () => {
8472
8605
 
8473
8606
  // src/controls/transform-control/functions/rotate.tsx
8474
8607
  import * as React107 from "react";
8475
- import { useRef as useRef24 } from "react";
8608
+ import { useRef as useRef26 } from "react";
8476
8609
  import { rotateTransformPropTypeUtil as rotateTransformPropTypeUtil2 } from "@elementor/editor-props";
8477
8610
  import { Arrow360Icon, RotateClockwiseIcon } from "@elementor/icons";
8478
8611
  import { Grid as Grid23 } from "@elementor/ui";
@@ -8497,7 +8630,7 @@ var rotateAxisControls = [
8497
8630
  var rotateUnits = ["deg", "rad", "grad", "turn"];
8498
8631
  var Rotate = () => {
8499
8632
  const context = useBoundProp(rotateTransformPropTypeUtil2);
8500
- const rowRefs = [useRef24(null), useRef24(null), useRef24(null)];
8633
+ const rowRefs = [useRef26(null), useRef26(null), useRef26(null)];
8501
8634
  return /* @__PURE__ */ React107.createElement(Grid23, { container: true, spacing: 1.5 }, /* @__PURE__ */ React107.createElement(PropProvider, { ...context }, /* @__PURE__ */ React107.createElement(PropKeyProvider, { bind: TransformFunctionKeys.rotate }, rotateAxisControls.map((control, index) => /* @__PURE__ */ React107.createElement(
8502
8635
  AxisRow,
8503
8636
  {
@@ -8511,7 +8644,7 @@ var Rotate = () => {
8511
8644
 
8512
8645
  // src/controls/transform-control/functions/scale.tsx
8513
8646
  import * as React109 from "react";
8514
- import { useRef as useRef25 } from "react";
8647
+ import { useRef as useRef27 } from "react";
8515
8648
  import { scaleTransformPropTypeUtil as scaleTransformPropTypeUtil2 } from "@elementor/editor-props";
8516
8649
  import { ArrowDownLeftIcon as ArrowDownLeftIcon2, ArrowDownSmallIcon as ArrowDownSmallIcon2, ArrowRightIcon as ArrowRightIcon2 } from "@elementor/icons";
8517
8650
  import { Grid as Grid25 } from "@elementor/ui";
@@ -8544,13 +8677,13 @@ var scaleAxisControls = [
8544
8677
  ];
8545
8678
  var Scale = () => {
8546
8679
  const context = useBoundProp(scaleTransformPropTypeUtil2);
8547
- const rowRefs = [useRef25(null), useRef25(null), useRef25(null)];
8680
+ const rowRefs = [useRef27(null), useRef27(null), useRef27(null)];
8548
8681
  return /* @__PURE__ */ React109.createElement(Grid25, { container: true, spacing: 1.5 }, /* @__PURE__ */ React109.createElement(PropProvider, { ...context }, /* @__PURE__ */ React109.createElement(PropKeyProvider, { bind: TransformFunctionKeys.scale }, scaleAxisControls.map((control, index) => /* @__PURE__ */ React109.createElement(ScaleAxisRow, { key: control.bind, ...control, anchorRef: rowRefs[index] })))));
8549
8682
  };
8550
8683
 
8551
8684
  // src/controls/transform-control/functions/skew.tsx
8552
8685
  import * as React110 from "react";
8553
- import { useRef as useRef26 } from "react";
8686
+ import { useRef as useRef28 } from "react";
8554
8687
  import { skewTransformPropTypeUtil as skewTransformPropTypeUtil2 } from "@elementor/editor-props";
8555
8688
  import { ArrowLeftIcon, ArrowRightIcon as ArrowRightIcon3 } from "@elementor/icons";
8556
8689
  import { Grid as Grid26 } from "@elementor/ui";
@@ -8570,7 +8703,7 @@ var skewAxisControls = [
8570
8703
  var skewUnits = ["deg", "rad", "grad", "turn"];
8571
8704
  var Skew = () => {
8572
8705
  const context = useBoundProp(skewTransformPropTypeUtil2);
8573
- const rowRefs = [useRef26(null), useRef26(null), useRef26(null)];
8706
+ const rowRefs = [useRef28(null), useRef28(null), useRef28(null)];
8574
8707
  return /* @__PURE__ */ React110.createElement(Grid26, { container: true, spacing: 1.5 }, /* @__PURE__ */ React110.createElement(PropProvider, { ...context }, /* @__PURE__ */ React110.createElement(PropKeyProvider, { bind: TransformFunctionKeys.skew }, skewAxisControls.map((control, index) => /* @__PURE__ */ React110.createElement(
8575
8708
  AxisRow,
8576
8709
  {
@@ -8583,7 +8716,7 @@ var Skew = () => {
8583
8716
  };
8584
8717
 
8585
8718
  // src/controls/transform-control/use-transform-tabs-history.tsx
8586
- import { useRef as useRef27 } from "react";
8719
+ import { useRef as useRef29 } from "react";
8587
8720
  import {
8588
8721
  moveTransformPropTypeUtil as moveTransformPropTypeUtil2,
8589
8722
  rotateTransformPropTypeUtil as rotateTransformPropTypeUtil3,
@@ -8615,7 +8748,7 @@ var useTransformTabsHistory = ({
8615
8748
  }
8616
8749
  };
8617
8750
  const { getTabsProps, getTabProps, getTabPanelProps } = useTabs2(getCurrentTransformType());
8618
- const valuesHistory = useRef27({
8751
+ const valuesHistory = useRef29({
8619
8752
  move: initialMove,
8620
8753
  scale: initialScale,
8621
8754
  rotate: initialRotate,
@@ -8759,7 +8892,7 @@ import { __ as __59 } from "@wordpress/i18n";
8759
8892
 
8760
8893
  // src/controls/transform-control/transform-base-controls/children-perspective-control.tsx
8761
8894
  import * as React114 from "react";
8762
- import { useRef as useRef28 } from "react";
8895
+ import { useRef as useRef30 } from "react";
8763
8896
  import { perspectiveOriginPropTypeUtil } from "@elementor/editor-props";
8764
8897
  import { Grid as Grid27, Stack as Stack19 } from "@elementor/ui";
8765
8898
  import { __ as __57 } from "@wordpress/i18n";
@@ -8791,13 +8924,13 @@ var PerspectiveOriginControlProvider = () => {
8791
8924
  return /* @__PURE__ */ React114.createElement(PropProvider, { ...context }, CHILDREN_PERSPECTIVE_FIELDS.map((control) => /* @__PURE__ */ React114.createElement(PropKeyProvider, { bind: control.bind, key: control.bind }, /* @__PURE__ */ React114.createElement(ControlFields, { control }))));
8792
8925
  };
8793
8926
  var ControlFields = ({ control }) => {
8794
- const rowRef = useRef28(null);
8927
+ const rowRef = useRef30(null);
8795
8928
  return /* @__PURE__ */ React114.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React114.createElement(Grid27, { item: true, xs: 6 }, /* @__PURE__ */ React114.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ React114.createElement(Grid27, { item: true, xs: 6 }, /* @__PURE__ */ React114.createElement(SizeControl, { variant: "length", units: control.units, anchorRef: rowRef, disableCustom: true })));
8796
8929
  };
8797
8930
 
8798
8931
  // src/controls/transform-control/transform-base-controls/transform-origin-control.tsx
8799
8932
  import * as React115 from "react";
8800
- import { useRef as useRef29 } from "react";
8933
+ import { useRef as useRef31 } from "react";
8801
8934
  import { transformOriginPropTypeUtil } from "@elementor/editor-props";
8802
8935
  import { Grid as Grid28, Stack as Stack20 } from "@elementor/ui";
8803
8936
  import { __ as __58 } from "@wordpress/i18n";
@@ -8825,7 +8958,7 @@ var TransformOriginControl = () => {
8825
8958
  };
8826
8959
  var ControlFields2 = ({ control }) => {
8827
8960
  const context = useBoundProp(transformOriginPropTypeUtil);
8828
- const rowRef = useRef29(null);
8961
+ const rowRef = useRef31(null);
8829
8962
  return /* @__PURE__ */ React115.createElement(PropProvider, { ...context }, /* @__PURE__ */ React115.createElement(PropKeyProvider, { bind: control.bind }, /* @__PURE__ */ React115.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React115.createElement(Grid28, { item: true, xs: 6 }, /* @__PURE__ */ React115.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ React115.createElement(Grid28, { item: true, xs: 6 }, /* @__PURE__ */ React115.createElement(SizeControl, { variant: "length", units: control.units, anchorRef: rowRef })))));
8830
8963
  };
8831
8964
 
@@ -8873,7 +9006,7 @@ var SIZE11 = "tiny";
8873
9006
  var TransformRepeaterControl = createControl(
8874
9007
  ({ showChildrenPerspective }) => {
8875
9008
  const context = useBoundProp(transformPropTypeUtil);
8876
- const headerRef = useRef30(null);
9009
+ const headerRef = useRef32(null);
8877
9010
  const popupState = usePopupState10({ variant: "popover" });
8878
9011
  return /* @__PURE__ */ React117.createElement(PropProvider, { ...context }, /* @__PURE__ */ React117.createElement(
8879
9012
  TransformSettingsControl,
@@ -8953,7 +9086,7 @@ var TransformBasePopoverTrigger = ({
8953
9086
 
8954
9087
  // src/controls/transition-control/transition-repeater-control.tsx
8955
9088
  import * as React120 from "react";
8956
- import { useEffect as useEffect18, useMemo as useMemo17, useState as useState25 } from "react";
9089
+ import { useEffect as useEffect19, useMemo as useMemo18, useState as useState26 } from "react";
8957
9090
  import {
8958
9091
  createArrayPropUtils as createArrayPropUtils3,
8959
9092
  selectionSizePropTypeUtil as selectionSizePropTypeUtil2
@@ -8965,15 +9098,15 @@ import { __ as __63 } from "@wordpress/i18n";
8965
9098
 
8966
9099
  // src/controls/selection-size-control.tsx
8967
9100
  import * as React118 from "react";
8968
- import { useMemo as useMemo15, useRef as useRef31 } from "react";
9101
+ import { useMemo as useMemo16, useRef as useRef33 } from "react";
8969
9102
  import { selectionSizePropTypeUtil } from "@elementor/editor-props";
8970
9103
  import { Grid as Grid29 } from "@elementor/ui";
8971
9104
  var SelectionSizeControl = createControl(
8972
9105
  ({ selectionLabel, sizeLabel, selectionConfig, sizeConfigMap }) => {
8973
9106
  const { value, setValue, propType } = useBoundProp(selectionSizePropTypeUtil);
8974
- const rowRef = useRef31(null);
9107
+ const rowRef = useRef33(null);
8975
9108
  const sizeFieldId = sizeLabel.replace(/\s+/g, "-").toLowerCase();
8976
- const currentSizeConfig = useMemo15(() => {
9109
+ const currentSizeConfig = useMemo16(() => {
8977
9110
  switch (value.selection.$$type) {
8978
9111
  case "key-value":
8979
9112
  return sizeConfigMap[value?.selection?.value.value.value || ""];
@@ -9186,7 +9319,7 @@ function subscribeToTransitionEvent() {
9186
9319
 
9187
9320
  // src/controls/transition-control/transition-selector.tsx
9188
9321
  import * as React119 from "react";
9189
- import { useMemo as useMemo16, useRef as useRef32 } from "react";
9322
+ import { useMemo as useMemo17, useRef as useRef34 } from "react";
9190
9323
  import { keyValuePropTypeUtil as keyValuePropTypeUtil2 } from "@elementor/editor-props";
9191
9324
  import { PromotionAlert, PromotionChip } from "@elementor/editor-ui";
9192
9325
  import { ChevronDownIcon as ChevronDownIcon3, VariationsIcon } from "@elementor/icons";
@@ -9232,9 +9365,9 @@ var TransitionSelector = ({
9232
9365
  const {
9233
9366
  key: { value: transitionLabel }
9234
9367
  } = value;
9235
- const defaultRef = useRef32(null);
9368
+ const defaultRef = useRef34(null);
9236
9369
  const popoverState = usePopupState11({ variant: "popover" });
9237
- const disabledCategories = useMemo16(() => {
9370
+ const disabledCategories = useMemo17(() => {
9238
9371
  return new Set(
9239
9372
  transitionProperties.filter((cat) => cat.properties.some((prop) => prop.isDisabled)).map((cat) => cat.label)
9240
9373
  );
@@ -9460,14 +9593,14 @@ var TransitionRepeaterControl = createControl(
9460
9593
  currentStyleState
9461
9594
  }) => {
9462
9595
  const currentStyleIsNormal = currentStyleState === null;
9463
- const [recentlyUsedList, setRecentlyUsedList] = useState25([]);
9596
+ const [recentlyUsedList, setRecentlyUsedList] = useState26([]);
9464
9597
  const proInstalled = hasProInstalled2();
9465
9598
  const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
9466
- const { allDisabled: disabledItems, proDisabled: proDisabledItems } = useMemo17(
9599
+ const { allDisabled: disabledItems, proDisabled: proDisabledItems } = useMemo18(
9467
9600
  () => getDisabledItemLabels(value),
9468
9601
  [value]
9469
9602
  );
9470
- const allowedTransitionSet = useMemo17(() => {
9603
+ const allowedTransitionSet = useMemo18(() => {
9471
9604
  const set = /* @__PURE__ */ new Set();
9472
9605
  transitionProperties.forEach((category) => {
9473
9606
  category.properties.forEach((prop) => {
@@ -9478,7 +9611,7 @@ var TransitionRepeaterControl = createControl(
9478
9611
  });
9479
9612
  return set;
9480
9613
  }, [proInstalled]);
9481
- useEffect18(() => {
9614
+ useEffect19(() => {
9482
9615
  if (!value || value.length === 0) {
9483
9616
  return;
9484
9617
  }
@@ -9490,10 +9623,10 @@ var TransitionRepeaterControl = createControl(
9490
9623
  setValue(sanitized);
9491
9624
  }
9492
9625
  }, [allowedTransitionSet]);
9493
- useEffect18(() => {
9626
+ useEffect19(() => {
9494
9627
  recentlyUsedListGetter().then(setRecentlyUsedList);
9495
9628
  }, [recentlyUsedListGetter]);
9496
- const allPropertiesUsed = useMemo17(() => areAllPropertiesUsed(value), [value]);
9629
+ const allPropertiesUsed = useMemo18(() => areAllPropertiesUsed(value), [value]);
9497
9630
  const isAddItemDisabled = !currentStyleIsNormal || allPropertiesUsed;
9498
9631
  return /* @__PURE__ */ React120.createElement(
9499
9632
  RepeatableControl,
@@ -9776,13 +9909,13 @@ var BoundTimeStringControl = ({ bind, ariaLabel }) => {
9776
9909
 
9777
9910
  // src/controls/inline-editing-control.tsx
9778
9911
  import * as React129 from "react";
9779
- import { useCallback as useCallback4, useState as useState27 } from "react";
9912
+ import { useCallback as useCallback4, useState as useState28 } from "react";
9780
9913
  import { escapedHtmlPropTypeUtil as escapedHtmlPropTypeUtil2 } from "@elementor/editor-props";
9781
9914
  import { Box as Box36, Stack as Stack24 } from "@elementor/ui";
9782
9915
 
9783
9916
  // src/components/inline-editor.tsx
9784
9917
  import * as React126 from "react";
9785
- import { useEffect as useEffect19, useRef as useRef33 } from "react";
9918
+ import { useEffect as useEffect20, useRef as useRef35 } from "react";
9786
9919
  import { Box as Box34 } from "@elementor/ui";
9787
9920
  import Bold from "@tiptap/extension-bold";
9788
9921
  import Document from "@tiptap/extension-document";
@@ -9845,8 +9978,8 @@ var InlineEditor = React126.forwardRef((props, ref) => {
9845
9978
  onSelectionEnd,
9846
9979
  mountElement = null
9847
9980
  } = props;
9848
- const containerRef = useRef33(null);
9849
- const onBlurRef = useRef33(onBlur);
9981
+ const containerRef = useRef35(null);
9982
+ const onBlurRef = useRef35(onBlur);
9850
9983
  onBlurRef.current = onBlur;
9851
9984
  const documentContentSettings = !!expectedTag ? "block+" : "inline*";
9852
9985
  const onUpdate = ({ editor: updatedEditor }) => {
@@ -9944,8 +10077,8 @@ var InlineEditor = React126.forwardRef((props, ref) => {
9944
10077
  return /* @__PURE__ */ React126.createElement(Box34, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React126.createElement(EditorContent, { ref, editor }));
9945
10078
  });
9946
10079
  var useOnUpdate = (callback, dependencies) => {
9947
- const hasMounted = useRef33(false);
9948
- useEffect19(() => {
10080
+ const hasMounted = useRef35(false);
10081
+ useEffect20(() => {
9949
10082
  if (hasMounted.current) {
9950
10083
  callback();
9951
10084
  } else {
@@ -9956,7 +10089,7 @@ var useOnUpdate = (callback, dependencies) => {
9956
10089
 
9957
10090
  // src/components/inline-editor-toolbar.tsx
9958
10091
  import * as React128 from "react";
9959
- import { useEffect as useEffect21, useMemo as useMemo18, useRef as useRef35, useState as useState26 } from "react";
10092
+ import { useEffect as useEffect22, useMemo as useMemo19, useRef as useRef37, useState as useState27 } from "react";
9960
10093
  import { getContainer as getContainer2, getElementSetting } from "@elementor/editor-elements";
9961
10094
  import {
9962
10095
  BoldIcon,
@@ -9982,7 +10115,7 @@ import { __ as __67 } from "@wordpress/i18n";
9982
10115
 
9983
10116
  // src/components/url-popover.tsx
9984
10117
  import * as React127 from "react";
9985
- import { useEffect as useEffect20, useRef as useRef34 } from "react";
10118
+ import { useEffect as useEffect21, useRef as useRef36 } from "react";
9986
10119
  import { ExternalLinkIcon } from "@elementor/icons";
9987
10120
  import { bindPopover as bindPopover8, Popover as Popover9, Stack as Stack23, TextField as TextField11, ToggleButton as ToggleButton3, Tooltip as Tooltip13 } from "@elementor/ui";
9988
10121
  import { __ as __66 } from "@wordpress/i18n";
@@ -9995,8 +10128,8 @@ var UrlPopover = ({
9995
10128
  openInNewTab,
9996
10129
  onToggleNewTab
9997
10130
  }) => {
9998
- const inputRef = useRef34(null);
9999
- useEffect20(() => {
10131
+ const inputRef = useRef36(null);
10132
+ useEffect21(() => {
10000
10133
  if (popupState.isOpen) {
10001
10134
  requestAnimationFrame(() => inputRef.current?.focus());
10002
10135
  }
@@ -10051,16 +10184,16 @@ var InlineEditorToolbar = ({
10051
10184
  sx = {},
10052
10185
  inControlPanel = false
10053
10186
  }) => {
10054
- const [urlValue, setUrlValue] = useState26("");
10055
- const [openInNewTab, setOpenInNewTab] = useState26(false);
10056
- const toolbarRef = useRef35(null);
10187
+ const [urlValue, setUrlValue] = useState27("");
10188
+ const [openInNewTab, setOpenInNewTab] = useState27(false);
10189
+ const toolbarRef = useRef37(null);
10057
10190
  const linkPopupState = usePopupState12({ variant: "popover" });
10058
10191
  const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
10059
10192
  const editorState = useEditorState({
10060
10193
  editor,
10061
10194
  selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
10062
10195
  });
10063
- const formatButtonsList = useMemo18(() => {
10196
+ const formatButtonsList = useMemo19(() => {
10064
10197
  const buttons = Object.values(formatButtons);
10065
10198
  if (isElementClickable) {
10066
10199
  return buttons.filter((button) => button.action !== "link");
@@ -10097,7 +10230,7 @@ var InlineEditorToolbar = ({
10097
10230
  }
10098
10231
  linkPopupState.close();
10099
10232
  };
10100
- useEffect21(() => {
10233
+ useEffect22(() => {
10101
10234
  if (!inControlPanel) {
10102
10235
  editor?.commands?.focus();
10103
10236
  }
@@ -10279,7 +10412,7 @@ var InlineEditingControl = createControl(
10279
10412
  const { setValue, placeholder, value } = useBoundProp(escapedHtmlPropTypeUtil2);
10280
10413
  const { value: rawValue } = usePropKeyContext();
10281
10414
  const content = value ?? extractInlineHtmlContent(rawValue);
10282
- const [editor, setEditor] = useState27(null);
10415
+ const [editor, setEditor] = useState28(null);
10283
10416
  const handleChange = useCallback4(
10284
10417
  (newValue) => {
10285
10418
  const html = newValue ?? "";
@@ -10467,7 +10600,7 @@ function useFormFieldSuggestions(options) {
10467
10600
 
10468
10601
  // src/controls/email-form-action-control/email-chips-field.tsx
10469
10602
  import * as React130 from "react";
10470
- import { useMemo as useMemo19, useState as useState28 } from "react";
10603
+ import { useMemo as useMemo20, useState as useState29 } from "react";
10471
10604
  import { stringArrayPropTypeUtil as stringArrayPropTypeUtil3, stringPropTypeUtil as stringPropTypeUtil23 } from "@elementor/editor-props";
10472
10605
  import { Autocomplete as Autocomplete4, Grid as Grid32, TextField as TextField12 } from "@elementor/ui";
10473
10606
 
@@ -10505,10 +10638,10 @@ function resolveMention(raw, suggestions) {
10505
10638
  }
10506
10639
  var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
10507
10640
  const { value, setValue, disabled } = useBoundProp(stringArrayPropTypeUtil3);
10508
- const [inputValue, setInputValue] = useState28("");
10641
+ const [inputValue, setInputValue] = useState29("");
10509
10642
  const items2 = value || [];
10510
10643
  const selectedValues = items2.map((item) => stringPropTypeUtil23.extract(item)).filter((val) => val !== null);
10511
- const suggestionOptions = useMemo19(
10644
+ const suggestionOptions = useMemo20(
10512
10645
  () => suggestions.map((suggestion) => `[${suggestion.value}]`),
10513
10646
  [suggestions]
10514
10647
  );
@@ -10736,14 +10869,14 @@ var GridSpanControl = createControl(
10736
10869
 
10737
10870
  // src/components/promotions/display-conditions-control.tsx
10738
10871
  import * as React137 from "react";
10739
- import { useRef as useRef36 } from "react";
10872
+ import { useRef as useRef38 } from "react";
10740
10873
  import { SitemapIcon } from "@elementor/icons";
10741
10874
  import { IconButton as IconButton12, Stack as Stack27, Tooltip as Tooltip15 } from "@elementor/ui";
10742
10875
  import { __ as __71 } from "@wordpress/i18n";
10743
10876
 
10744
10877
  // src/components/promotions/promotion-trigger.tsx
10745
10878
  import * as React136 from "react";
10746
- import { forwardRef as forwardRef14, useCallback as useCallback5, useImperativeHandle, useState as useState29 } from "react";
10879
+ import { forwardRef as forwardRef14, useCallback as useCallback5, useImperativeHandle, useState as useState30 } from "react";
10747
10880
  import { PromotionChip as PromotionChip2, PromotionInfotip } from "@elementor/editor-ui";
10748
10881
  import { Box as Box38 } from "@elementor/ui";
10749
10882
  function getV4Promotion(key) {
@@ -10751,7 +10884,7 @@ function getV4Promotion(key) {
10751
10884
  }
10752
10885
  var PromotionTrigger = forwardRef14(
10753
10886
  ({ promotionKey, children, trackingData }, ref) => {
10754
- const [isOpen, setIsOpen] = useState29(false);
10887
+ const [isOpen, setIsOpen] = useState30(false);
10755
10888
  const promotion = getV4Promotion(promotionKey);
10756
10889
  const toggle = useCallback5(() => {
10757
10890
  setIsOpen((prev) => {
@@ -10795,7 +10928,7 @@ var PromotionTrigger = forwardRef14(
10795
10928
  var ARIA_LABEL = __71("Display Conditions", "elementor");
10796
10929
  var TRACKING_DATA2 = { target_name: "display_conditions", location_l2: "general" };
10797
10930
  var DisplayConditionsControl = createControl(() => {
10798
- const triggerRef = useRef36(null);
10931
+ const triggerRef = useRef38(null);
10799
10932
  return /* @__PURE__ */ React137.createElement(
10800
10933
  Stack27,
10801
10934
  {
@@ -10827,14 +10960,14 @@ var DisplayConditionsControl = createControl(() => {
10827
10960
 
10828
10961
  // src/components/promotions/attributes-control.tsx
10829
10962
  import * as React138 from "react";
10830
- import { useRef as useRef37 } from "react";
10963
+ import { useRef as useRef39 } from "react";
10831
10964
  import { PlusIcon as PlusIcon4 } from "@elementor/icons";
10832
10965
  import { Stack as Stack28, Tooltip as Tooltip16 } from "@elementor/ui";
10833
10966
  import { __ as __72 } from "@wordpress/i18n";
10834
10967
  var ARIA_LABEL2 = __72("Attributes", "elementor");
10835
10968
  var TRACKING_DATA3 = { target_name: "attributes", location_l2: "general" };
10836
10969
  var AttributesControl = createControl(() => {
10837
- const triggerRef = useRef37(null);
10970
+ const triggerRef = useRef39(null);
10838
10971
  return /* @__PURE__ */ React138.createElement(
10839
10972
  Stack28,
10840
10973
  {
@@ -10871,7 +11004,7 @@ var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /*
10871
11004
 
10872
11005
  // src/components/repeater/repeater.tsx
10873
11006
  import * as React140 from "react";
10874
- import { useEffect as useEffect22, useState as useState30 } from "react";
11007
+ import { useEffect as useEffect23, useState as useState31 } from "react";
10875
11008
  import { CopyIcon as CopyIcon2, EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2, PlusIcon as PlusIcon5, XIcon as XIcon4 } from "@elementor/icons";
10876
11009
  import {
10877
11010
  bindPopover as bindPopover9,
@@ -10901,7 +11034,7 @@ var Repeater3 = ({
10901
11034
  isSortable = true,
10902
11035
  adornment = ControlAdornments
10903
11036
  }) => {
10904
- const [openItem, setOpenItem] = useState30(initialOpenItem);
11037
+ const [openItem, setOpenItem] = useState31(initialOpenItem);
10905
11038
  const uniqueKeys = items2.map(
10906
11039
  (item, index) => isSortable && "getId" in itemSettings ? itemSettings.getId({ item, index }) : String(index)
10907
11040
  );
@@ -11077,10 +11210,10 @@ var RepeaterItem = ({
11077
11210
  ), /* @__PURE__ */ React140.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React140.createElement(Box39, null, children({ anchorEl: ref }))));
11078
11211
  };
11079
11212
  var usePopover = (openOnMount, onOpen, onPopoverClose) => {
11080
- const [ref, setRef] = useState30(null);
11213
+ const [ref, setRef] = useState31(null);
11081
11214
  const popoverState = usePopupState13({ variant: "popover" });
11082
11215
  const popoverProps = bindPopover9(popoverState);
11083
- useEffect22(() => {
11216
+ useEffect23(() => {
11084
11217
  if (openOnMount && ref) {
11085
11218
  popoverState.open(ref);
11086
11219
  onOpen?.();
@@ -11259,7 +11392,7 @@ var hasValue = (value) => {
11259
11392
  };
11260
11393
 
11261
11394
  // src/hooks/use-font-families.ts
11262
- import { useMemo as useMemo20 } from "react";
11395
+ import { useMemo as useMemo21 } from "react";
11263
11396
  import { getElementorConfig } from "@elementor/editor-v1-adapters";
11264
11397
  var getFontControlConfig = () => {
11265
11398
  const { controls } = getElementorConfig();
@@ -11267,7 +11400,7 @@ var getFontControlConfig = () => {
11267
11400
  };
11268
11401
  var useFontFamilies = () => {
11269
11402
  const { groups, options } = getFontControlConfig();
11270
- return useMemo20(() => {
11403
+ return useMemo21(() => {
11271
11404
  if (!groups || !options) {
11272
11405
  return [];
11273
11406
  }
@@ -11377,6 +11510,7 @@ export {
11377
11510
  registerIconLibraryProvider,
11378
11511
  resetFontAwesome7IconsCache,
11379
11512
  resolveFontAwesome7Icon,
11513
+ resolveProviderIconPreviewSvg,
11380
11514
  resolveProviderIconSvg,
11381
11515
  trackUpgradePromotionClick,
11382
11516
  trackViewPromotion,