@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.mjs
CHANGED
|
@@ -5677,7 +5677,7 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
5677
5677
|
|
|
5678
5678
|
// src/controls/svg-media-control.tsx
|
|
5679
5679
|
import * as React93 from "react";
|
|
5680
|
-
import { useEffect as
|
|
5680
|
+
import { useEffect as useEffect18, useRef as useRef21, useState as useState24 } from "react";
|
|
5681
5681
|
import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
|
|
5682
5682
|
import { iconPropTypeUtil, svgSrcPropTypeUtil, urlPropTypeUtil as urlPropTypeUtil4 } from "@elementor/editor-props";
|
|
5683
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";
|
|
@@ -5761,7 +5761,7 @@ function measureIconLibraryAnchor(container, buttonGroup) {
|
|
|
5761
5761
|
|
|
5762
5762
|
// src/controls/icon-library/icon-library-popover.tsx
|
|
5763
5763
|
import * as React90 from "react";
|
|
5764
|
-
import { useMemo as useMemo12, useState as
|
|
5764
|
+
import { useMemo as useMemo12, useState as useState23 } from "react";
|
|
5765
5765
|
import {
|
|
5766
5766
|
PopoverBody as PopoverBody2,
|
|
5767
5767
|
PopoverHeader as PopoverHeader4,
|
|
@@ -6022,8 +6022,74 @@ function toCatalogIcon(icon, library) {
|
|
|
6022
6022
|
|
|
6023
6023
|
// src/controls/icon-library/font-awesome-glyph.tsx
|
|
6024
6024
|
import * as React84 from "react";
|
|
6025
|
+
import { useEffect as useEffect17, useRef as useRef18, useState as useState20 } from "react";
|
|
6025
6026
|
import { Box as Box17 } from "@elementor/ui";
|
|
6026
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
|
+
|
|
6027
6093
|
// src/controls/icon-library/sanitize-icon-svg-markup.ts
|
|
6028
6094
|
var ALLOWED_SVG_TAGS = /* @__PURE__ */ new Set(["svg", "g", "path", "title", "desc"]);
|
|
6029
6095
|
var ALLOWED_SVG_ATTRS = /* @__PURE__ */ new Set([
|
|
@@ -6070,7 +6136,56 @@ function pruneNode(node) {
|
|
|
6070
6136
|
}
|
|
6071
6137
|
|
|
6072
6138
|
// src/controls/icon-library/font-awesome-glyph.tsx
|
|
6073
|
-
var FontAwesomeGlyph = (
|
|
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 }) => {
|
|
6074
6189
|
const svgMarkup = sanitizeIconSvgMarkup(icon.svgMarkup);
|
|
6075
6190
|
if (svgMarkup) {
|
|
6076
6191
|
return /* @__PURE__ */ React84.createElement(
|
|
@@ -6326,7 +6441,7 @@ function parseFilterEntry(value) {
|
|
|
6326
6441
|
|
|
6327
6442
|
// src/controls/icon-library/icon-library-grid.tsx
|
|
6328
6443
|
import * as React86 from "react";
|
|
6329
|
-
import { useLayoutEffect as useLayoutEffect3, useRef as
|
|
6444
|
+
import { useLayoutEffect as useLayoutEffect3, useRef as useRef19, useState as useState21 } from "react";
|
|
6330
6445
|
import { Box as Box19, Tooltip as Tooltip9, useTheme as useTheme4 } from "@elementor/ui";
|
|
6331
6446
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
6332
6447
|
import { __ as __35 } from "@wordpress/i18n";
|
|
@@ -6365,12 +6480,12 @@ var IconLibraryGrid = ({
|
|
|
6365
6480
|
noResultsComponent
|
|
6366
6481
|
}) => {
|
|
6367
6482
|
const theme = useTheme4();
|
|
6368
|
-
const containerRef =
|
|
6369
|
-
const cellRefs =
|
|
6370
|
-
const shouldRestoreFocusRef =
|
|
6483
|
+
const containerRef = useRef19(null);
|
|
6484
|
+
const cellRefs = useRef19(/* @__PURE__ */ new Map());
|
|
6485
|
+
const shouldRestoreFocusRef = useRef19(false);
|
|
6371
6486
|
const selectedIndex = items2.findIndex((item) => item.id === selectedValue);
|
|
6372
|
-
const [focusedIndex, setFocusedIndex] =
|
|
6373
|
-
const [{ columnCount, cellSize }, setGridMetrics] =
|
|
6487
|
+
const [focusedIndex, setFocusedIndex] = useState21(selectedIndex >= 0 ? selectedIndex : 0);
|
|
6488
|
+
const [{ columnCount, cellSize }, setGridMetrics] = useState21(() => getGridMetrics(0, 0, 0));
|
|
6374
6489
|
const rowCount = Math.ceil(items2.length / columnCount);
|
|
6375
6490
|
const cellGap = Number.parseFloat(theme.spacing(GRID_CELL_GAP));
|
|
6376
6491
|
const verticalPadding = Number.parseFloat(theme.spacing(GRID_VERTICAL_PADDING));
|
|
@@ -6607,7 +6722,7 @@ var IconLibraryGrid = ({
|
|
|
6607
6722
|
/* @__PURE__ */ React86.createElement(
|
|
6608
6723
|
FontAwesomeGlyph,
|
|
6609
6724
|
{
|
|
6610
|
-
icon: item,
|
|
6725
|
+
icon: { ...item, value: item.iconValue ?? item.value },
|
|
6611
6726
|
size: ICON_GLYPH_SIZE,
|
|
6612
6727
|
color: "currentColor"
|
|
6613
6728
|
}
|
|
@@ -6622,52 +6737,9 @@ var IconLibraryGrid = ({
|
|
|
6622
6737
|
);
|
|
6623
6738
|
};
|
|
6624
6739
|
|
|
6625
|
-
// src/controls/icon-library/icon-library-providers.ts
|
|
6626
|
-
import { useState as useState20 } from "react";
|
|
6627
|
-
import { useQuery as useQuery2 } from "@elementor/query";
|
|
6628
|
-
var PROVIDER_ICON_SVG_QUERY_KEY = "icon-library-provider-svg";
|
|
6629
|
-
var providers = /* @__PURE__ */ new Map();
|
|
6630
|
-
function registerIconLibraryProvider(provider) {
|
|
6631
|
-
providers.set(provider.id, provider);
|
|
6632
|
-
}
|
|
6633
|
-
function unregisterIconLibraryProvider(id) {
|
|
6634
|
-
providers.delete(id);
|
|
6635
|
-
}
|
|
6636
|
-
function useIconLibraryProviderIcons(enabled) {
|
|
6637
|
-
const [snapshot] = useState20(() => [...providers.values()]);
|
|
6638
|
-
const states = snapshot.map((provider) => provider.useIcons(enabled));
|
|
6639
|
-
return {
|
|
6640
|
-
data: states.flatMap((state) => state.data ?? []),
|
|
6641
|
-
isLoading: states.some((state) => state.isLoading)
|
|
6642
|
-
};
|
|
6643
|
-
}
|
|
6644
|
-
async function resolveProviderIconSvg(library, iconValue, signal) {
|
|
6645
|
-
for (const provider of providers.values()) {
|
|
6646
|
-
try {
|
|
6647
|
-
const markup = await provider.resolveSvg?.(library, iconValue, signal);
|
|
6648
|
-
if (markup) {
|
|
6649
|
-
return markup;
|
|
6650
|
-
}
|
|
6651
|
-
} catch (error) {
|
|
6652
|
-
if (signal?.aborted) {
|
|
6653
|
-
throw error;
|
|
6654
|
-
}
|
|
6655
|
-
}
|
|
6656
|
-
}
|
|
6657
|
-
return null;
|
|
6658
|
-
}
|
|
6659
|
-
function useProviderIconSvg(library, iconValue, enabled) {
|
|
6660
|
-
return useQuery2({
|
|
6661
|
-
queryKey: [PROVIDER_ICON_SVG_QUERY_KEY, library, iconValue],
|
|
6662
|
-
queryFn: ({ signal }) => resolveProviderIconSvg(library, iconValue, signal),
|
|
6663
|
-
enabled: enabled && Boolean(library && iconValue),
|
|
6664
|
-
staleTime: Infinity
|
|
6665
|
-
});
|
|
6666
|
-
}
|
|
6667
|
-
|
|
6668
6740
|
// src/controls/icon-library/icon-library-upload-action.tsx
|
|
6669
6741
|
import * as React87 from "react";
|
|
6670
|
-
import { forwardRef as forwardRef11, useRef as
|
|
6742
|
+
import { forwardRef as forwardRef11, useRef as useRef20, useState as useState22 } from "react";
|
|
6671
6743
|
import { PromotionPopover, useCanvasClickHandler } from "@elementor/editor-ui";
|
|
6672
6744
|
import { UploadIcon as UploadIcon2 } from "@elementor/icons";
|
|
6673
6745
|
import { createReplaceableLocation as createReplaceableLocation2 } from "@elementor/locations";
|
|
@@ -6728,8 +6800,8 @@ var IconLibraryUploadPromotion = ({
|
|
|
6728
6800
|
title = __36("Upload custom icons", "elementor"),
|
|
6729
6801
|
content = __36("Add your own icon font library to use across your site.", "elementor")
|
|
6730
6802
|
}) => {
|
|
6731
|
-
const [isOpen, setIsOpen] =
|
|
6732
|
-
const triggerRef =
|
|
6803
|
+
const [isOpen, setIsOpen] = useState22(false);
|
|
6804
|
+
const triggerRef = useRef20(null);
|
|
6733
6805
|
const canSeePromotions = !!window.elementor?.config?.v4Promotions;
|
|
6734
6806
|
const close = () => {
|
|
6735
6807
|
setIsOpen(false);
|
|
@@ -6813,6 +6885,21 @@ var IconLibraryViewToggle = ({ value, onChange }) => {
|
|
|
6813
6885
|
);
|
|
6814
6886
|
};
|
|
6815
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
|
+
|
|
6816
6903
|
// src/controls/icon-library/svg-element-icon.tsx
|
|
6817
6904
|
import * as React89 from "react";
|
|
6818
6905
|
import { SvgIcon } from "@elementor/ui";
|
|
@@ -6869,7 +6956,7 @@ var IconLibraryPopover = ({
|
|
|
6869
6956
|
handleChange: handleSearchChange,
|
|
6870
6957
|
setImmediateValue: setSearchValue
|
|
6871
6958
|
} = useDebounceState({ delay: ICON_LIBRARY_SEARCH_DEBOUNCE_DELAY });
|
|
6872
|
-
const [activeLibraries, setActiveLibraries] =
|
|
6959
|
+
const [activeLibraries, setActiveLibraries] = useState23([]);
|
|
6873
6960
|
const [storedView, setStoredView] = useSessionStorage2(
|
|
6874
6961
|
ICON_LIBRARY_VIEW_STORAGE_KEY,
|
|
6875
6962
|
ICON_LIBRARY_VIEW_STORAGE_PREFIX
|
|
@@ -6877,12 +6964,15 @@ var IconLibraryPopover = ({
|
|
|
6877
6964
|
const view = isIconLibraryView(storedView) ? storedView : DEFAULT_ICON_LIBRARY_VIEW;
|
|
6878
6965
|
const { data: fontAwesomeIcons = [], isLoading: isFontAwesomeLoading } = useFontAwesome7Catalog(open);
|
|
6879
6966
|
const { data: providerIcons = [], isLoading: isProviderLoading } = useIconLibraryProviderIcons(open);
|
|
6880
|
-
const
|
|
6881
|
-
|
|
6967
|
+
const icons = useMemo12(
|
|
6968
|
+
() => mergeIconsById(fontAwesomeIcons, providerIcons),
|
|
6969
|
+
[providerIcons, fontAwesomeIcons]
|
|
6970
|
+
);
|
|
6882
6971
|
const items2 = useMemo12(
|
|
6883
6972
|
() => createIconLibraryItems(icons, searchValue, activeLibraries),
|
|
6884
6973
|
[activeLibraries, icons, searchValue]
|
|
6885
6974
|
);
|
|
6975
|
+
const isLoading = isFontAwesomeLoading || isProviderLoading && items2.length === 0;
|
|
6886
6976
|
const selectedValue = useMemo12(
|
|
6887
6977
|
() => findFontAwesome7Icon(icons, selectedIconClass, selectedIconLibrary)?.id,
|
|
6888
6978
|
[icons, selectedIconClass, selectedIconLibrary]
|
|
@@ -7004,7 +7094,7 @@ var IconLibraryContent = ({
|
|
|
7004
7094
|
}
|
|
7005
7095
|
);
|
|
7006
7096
|
};
|
|
7007
|
-
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") }));
|
|
7008
7098
|
var IconLibraryEmptyState = ({
|
|
7009
7099
|
searchValue,
|
|
7010
7100
|
isCatalogAvailable,
|
|
@@ -7033,7 +7123,14 @@ var IconLibraryRow = (item) => {
|
|
|
7033
7123
|
flexShrink: 0
|
|
7034
7124
|
}
|
|
7035
7125
|
},
|
|
7036
|
-
/* @__PURE__ */ React90.createElement(
|
|
7126
|
+
/* @__PURE__ */ React90.createElement(
|
|
7127
|
+
FontAwesomeGlyph,
|
|
7128
|
+
{
|
|
7129
|
+
icon: { ...icon, value: icon.iconValue },
|
|
7130
|
+
size: ICON_GLYPH_SIZE2,
|
|
7131
|
+
color: "currentColor"
|
|
7132
|
+
}
|
|
7133
|
+
)
|
|
7037
7134
|
), /* @__PURE__ */ React90.createElement(Typography10, { variant: "caption", color: "text.primary", noWrap: true }, icon.label));
|
|
7038
7135
|
};
|
|
7039
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")));
|
|
@@ -7041,7 +7138,8 @@ var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React90.createElem
|
|
|
7041
7138
|
var createIconLibraryItems = (icons, searchValue, libraries) => filterFontAwesome7Icons(icons, searchValue, libraries).map((icon) => ({
|
|
7042
7139
|
...icon,
|
|
7043
7140
|
type: "item",
|
|
7044
|
-
value: icon.id
|
|
7141
|
+
value: icon.id,
|
|
7142
|
+
iconValue: icon.value
|
|
7045
7143
|
}));
|
|
7046
7144
|
|
|
7047
7145
|
// src/controls/open-icon-library.ts
|
|
@@ -7068,7 +7166,6 @@ var ICON_LIBRARY_PADDING = 0.625;
|
|
|
7068
7166
|
var SvgMediaOverlay = ({
|
|
7069
7167
|
label,
|
|
7070
7168
|
isAdmin,
|
|
7071
|
-
showIconLibrary,
|
|
7072
7169
|
buttonGroupRef,
|
|
7073
7170
|
onSelectSvg,
|
|
7074
7171
|
onUpload,
|
|
@@ -7092,7 +7189,7 @@ var SvgMediaOverlay = ({
|
|
|
7092
7189
|
/* @__PURE__ */ React91.createElement(Box22, { component: "span", sx: { display: "flex", width: "100%" } }, /* @__PURE__ */ React91.createElement(UploadControl, { isAdmin, onUpload }))
|
|
7093
7190
|
)
|
|
7094
7191
|
}
|
|
7095
|
-
),
|
|
7192
|
+
), /* @__PURE__ */ React91.createElement(
|
|
7096
7193
|
Button6,
|
|
7097
7194
|
{
|
|
7098
7195
|
size: "tiny",
|
|
@@ -7108,7 +7205,7 @@ var SvgMediaOverlay = ({
|
|
|
7108
7205
|
}
|
|
7109
7206
|
},
|
|
7110
7207
|
/* @__PURE__ */ React91.createElement(Typography11, null, __39("Icon library", "elementor"))
|
|
7111
|
-
)
|
|
7208
|
+
));
|
|
7112
7209
|
var UploadControl = ({ isAdmin, onUpload }) => {
|
|
7113
7210
|
if (isAdmin) {
|
|
7114
7211
|
return /* @__PURE__ */ React91.createElement(MediaUploadButton, { onClick: onUpload });
|
|
@@ -7118,6 +7215,7 @@ var UploadControl = ({ isAdmin, onUpload }) => {
|
|
|
7118
7215
|
|
|
7119
7216
|
// src/controls/svg-media-preview.tsx
|
|
7120
7217
|
import * as React92 from "react";
|
|
7218
|
+
import { useMemo as useMemo13 } from "react";
|
|
7121
7219
|
import { Box as Box23, CardMedia as CardMedia2, CircularProgress as CircularProgress4 } from "@elementor/ui";
|
|
7122
7220
|
import { __ as __40 } from "@wordpress/i18n";
|
|
7123
7221
|
var ICON_PREVIEW_SIZE = 50;
|
|
@@ -7125,21 +7223,30 @@ var ICON_PREVIEW_COLOR = "#000000";
|
|
|
7125
7223
|
var SvgMediaPreview = ({ isFetching, src, iconClassName, iconLibrary }) => {
|
|
7126
7224
|
const shouldLoadIconCatalog = Boolean(iconClassName && iconLibrary);
|
|
7127
7225
|
const { data: fontAwesomeIcons = [], isLoading: isFontAwesomeLoading } = useFontAwesome7Catalog(shouldLoadIconCatalog);
|
|
7128
|
-
const
|
|
7129
|
-
const
|
|
7226
|
+
const isFontAwesomeLibrary = Boolean(iconLibrary?.startsWith("fa-"));
|
|
7227
|
+
const { data: providerIcons = [], isLoading: isProviderLoading } = useIconLibraryProviderIcons(
|
|
7228
|
+
shouldLoadIconCatalog && !isFontAwesomeLibrary
|
|
7229
|
+
);
|
|
7230
|
+
const icons = useMemo13(
|
|
7231
|
+
() => mergeIconsById(fontAwesomeIcons, providerIcons),
|
|
7232
|
+
[fontAwesomeIcons, providerIcons]
|
|
7233
|
+
);
|
|
7130
7234
|
const selectedIcon = findFontAwesome7Icon(icons, iconClassName, iconLibrary);
|
|
7131
|
-
const isLoadingCatalog = shouldLoadIconCatalog && (isFontAwesomeLoading || isProviderLoading);
|
|
7235
|
+
const isLoadingCatalog = shouldLoadIconCatalog && (isFontAwesomeLoading || !isFontAwesomeLibrary && isProviderLoading);
|
|
7132
7236
|
const { data: savedIconSvg, isLoading: isSavedIconLoading } = useProviderIconSvg(
|
|
7133
7237
|
iconLibrary,
|
|
7134
7238
|
iconClassName,
|
|
7135
|
-
shouldLoadIconCatalog && !isLoadingCatalog && !selectedIcon
|
|
7239
|
+
shouldLoadIconCatalog && !isLoadingCatalog && !selectedIcon && !isFontAwesomeLibrary
|
|
7136
7240
|
);
|
|
7137
7241
|
if (isFetching || isLoadingCatalog || isSavedIconLoading) {
|
|
7138
|
-
return /* @__PURE__ */ React92.createElement(CircularProgress4, { role: "progressbar" });
|
|
7242
|
+
return /* @__PURE__ */ React92.createElement(CircularProgress4, { role: "progressbar", "aria-label": __40("Loading icon", "elementor") });
|
|
7139
7243
|
}
|
|
7140
7244
|
if (selectedIcon) {
|
|
7141
7245
|
return /* @__PURE__ */ React92.createElement(IconPreview, { icon: selectedIcon });
|
|
7142
7246
|
}
|
|
7247
|
+
if (shouldLoadIconCatalog && iconClassName && iconLibrary && isFontAwesomeLibrary) {
|
|
7248
|
+
return /* @__PURE__ */ React92.createElement(IconPreview, { icon: createLazyIcon(iconLibrary, iconClassName) });
|
|
7249
|
+
}
|
|
7143
7250
|
if (savedIconSvg) {
|
|
7144
7251
|
return /* @__PURE__ */ React92.createElement(IconPreview, { icon: toSvgMarkupIcon(savedIconSvg, iconLibrary, iconClassName) });
|
|
7145
7252
|
}
|
|
@@ -7148,6 +7255,18 @@ var SvgMediaPreview = ({ isFetching, src, iconClassName, iconLibrary }) => {
|
|
|
7148
7255
|
}
|
|
7149
7256
|
return /* @__PURE__ */ React92.createElement(SvgPreview, { src });
|
|
7150
7257
|
};
|
|
7258
|
+
var createLazyIcon = (library, value) => ({
|
|
7259
|
+
id: `${library}:${value}`,
|
|
7260
|
+
name: value,
|
|
7261
|
+
label: value,
|
|
7262
|
+
library,
|
|
7263
|
+
value,
|
|
7264
|
+
aliases: [],
|
|
7265
|
+
width: ICON_PREVIEW_SIZE,
|
|
7266
|
+
height: ICON_PREVIEW_SIZE,
|
|
7267
|
+
paths: [],
|
|
7268
|
+
lazySvg: true
|
|
7269
|
+
});
|
|
7151
7270
|
var toSvgMarkupIcon = (svgMarkup, library, value) => ({
|
|
7152
7271
|
id: `${library}:${value}`,
|
|
7153
7272
|
label: value ?? "",
|
|
@@ -7160,7 +7279,7 @@ var toSvgMarkupIcon = (svgMarkup, library, value) => ({
|
|
|
7160
7279
|
paths: [],
|
|
7161
7280
|
svgMarkup
|
|
7162
7281
|
});
|
|
7163
|
-
var IconPreview = ({ icon }) => /* @__PURE__ */ React92.createElement(Box23, { sx: { color: ICON_PREVIEW_COLOR } }, /* @__PURE__ */ React92.createElement(
|
|
7282
|
+
var IconPreview = ({ icon }) => /* @__PURE__ */ React92.createElement(Box23, { sx: { color: ICON_PREVIEW_COLOR, minWidth: ICON_PREVIEW_SIZE, minHeight: ICON_PREVIEW_SIZE } }, /* @__PURE__ */ React92.createElement(
|
|
7164
7283
|
FontAwesomeGlyph,
|
|
7165
7284
|
{
|
|
7166
7285
|
icon,
|
|
@@ -7218,7 +7337,7 @@ var StyledCardMediaContainer = styled12(Stack18)`
|
|
|
7218
7337
|
`;
|
|
7219
7338
|
var MODE_BROWSE = { mode: "browse" };
|
|
7220
7339
|
var MODE_UPLOAD = { mode: "upload" };
|
|
7221
|
-
var SvgMediaControl = createControl(({
|
|
7340
|
+
var SvgMediaControl = createControl(({ label }) => {
|
|
7222
7341
|
const groupLabel = label ?? __41("SVG", "elementor");
|
|
7223
7342
|
const { value: svgValue, setValue: setSvgValue, placeholder: svgPlaceholder } = useBoundProp(svgSrcPropTypeUtil);
|
|
7224
7343
|
const { value: iconValue, setValue: setIconValue, placeholder: iconPlaceholder } = useBoundProp(iconPropTypeUtil);
|
|
@@ -7229,14 +7348,14 @@ var SvgMediaControl = createControl(({ showIconLibrary = false, label }) => {
|
|
|
7229
7348
|
const { data: attachment, isFetching } = useWpMediaAttachment2(previewSvgValue?.id?.value || null);
|
|
7230
7349
|
const src = attachment?.url ?? previewSvgValue?.url?.value ?? null;
|
|
7231
7350
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
7232
|
-
const [unfilteredModalOpenState, setUnfilteredModalOpenState] =
|
|
7351
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = useState24(false);
|
|
7233
7352
|
const iconLibraryPopoverState = usePopupState9({ variant: "popover" });
|
|
7234
|
-
const controlContainerRef =
|
|
7235
|
-
const buttonGroupRef =
|
|
7236
|
-
const [iconLibraryAnchor, setIconLibraryAnchor] =
|
|
7353
|
+
const controlContainerRef = useRef21(null);
|
|
7354
|
+
const buttonGroupRef = useRef21(null);
|
|
7355
|
+
const [iconLibraryAnchor, setIconLibraryAnchor] = useState24(null);
|
|
7237
7356
|
const { isAdmin } = useCurrentUserCapabilities();
|
|
7238
|
-
const selectedIconClass =
|
|
7239
|
-
const selectedIconLibrary =
|
|
7357
|
+
const selectedIconClass = typeof previewIconValue?.value?.value === "string" ? previewIconValue.value.value : null;
|
|
7358
|
+
const selectedIconLibrary = typeof previewIconValue?.library?.value === "string" ? previewIconValue.library.value : null;
|
|
7240
7359
|
const { open } = useWpMediaFrame2({
|
|
7241
7360
|
mediaTypes: ["svg"],
|
|
7242
7361
|
multiple: false,
|
|
@@ -7285,7 +7404,7 @@ var SvgMediaControl = createControl(({ showIconLibrary = false, label }) => {
|
|
|
7285
7404
|
setIconLibraryAnchor(anchor);
|
|
7286
7405
|
iconLibraryPopoverState.open(event);
|
|
7287
7406
|
};
|
|
7288
|
-
|
|
7407
|
+
useEffect18(() => {
|
|
7289
7408
|
if (!iconLibraryPopoverState.isOpen) {
|
|
7290
7409
|
return;
|
|
7291
7410
|
}
|
|
@@ -7301,7 +7420,7 @@ var SvgMediaControl = createControl(({ showIconLibrary = false, label }) => {
|
|
|
7301
7420
|
};
|
|
7302
7421
|
}, [iconLibraryPopoverState.isOpen]);
|
|
7303
7422
|
const iconLibraryWidth = iconLibraryAnchor?.width ?? ICON_LIBRARY_POPOVER_WIDTH;
|
|
7304
|
-
return /* @__PURE__ */ React93.createElement(Stack18, { gap: 1, "aria-label": __41("SVG control", "elementor") }, /* @__PURE__ */ React93.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: handleCloseUnfilteredModal }),
|
|
7423
|
+
return /* @__PURE__ */ React93.createElement(Stack18, { gap: 1, "aria-label": __41("SVG control", "elementor") }, /* @__PURE__ */ React93.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: handleCloseUnfilteredModal }), iconLibraryAnchor ? /* @__PURE__ */ React93.createElement(
|
|
7305
7424
|
Popover6,
|
|
7306
7425
|
{
|
|
7307
7426
|
disableScrollLock: true,
|
|
@@ -7361,7 +7480,6 @@ var SvgMediaControl = createControl(({ showIconLibrary = false, label }) => {
|
|
|
7361
7480
|
{
|
|
7362
7481
|
label: groupLabel,
|
|
7363
7482
|
isAdmin,
|
|
7364
|
-
showIconLibrary,
|
|
7365
7483
|
buttonGroupRef,
|
|
7366
7484
|
onSelectSvg: handleSelectSvg,
|
|
7367
7485
|
onUpload: handleUpload,
|
|
@@ -7579,7 +7697,7 @@ var BackgroundImageOverlayAttachment = () => {
|
|
|
7579
7697
|
|
|
7580
7698
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
7581
7699
|
import * as React97 from "react";
|
|
7582
|
-
import { useRef as
|
|
7700
|
+
import { useRef as useRef22 } from "react";
|
|
7583
7701
|
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil16 } from "@elementor/editor-props";
|
|
7584
7702
|
import { MenuListItem as MenuListItem6 } from "@elementor/editor-ui";
|
|
7585
7703
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
@@ -7601,7 +7719,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
7601
7719
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
7602
7720
|
const stringPropContext = useBoundProp(stringPropTypeUtil16);
|
|
7603
7721
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
7604
|
-
const rowRef =
|
|
7722
|
+
const rowRef = useRef22(null);
|
|
7605
7723
|
const handlePositionChange = (event) => {
|
|
7606
7724
|
const value = event.target.value || null;
|
|
7607
7725
|
if (value === "custom") {
|
|
@@ -7674,7 +7792,7 @@ var BackgroundImageOverlayRepeat = () => {
|
|
|
7674
7792
|
|
|
7675
7793
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
7676
7794
|
import * as React99 from "react";
|
|
7677
|
-
import { useRef as
|
|
7795
|
+
import { useRef as useRef23 } from "react";
|
|
7678
7796
|
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil17 } from "@elementor/editor-props";
|
|
7679
7797
|
import {
|
|
7680
7798
|
ArrowBarBothIcon,
|
|
@@ -7716,7 +7834,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
7716
7834
|
const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
|
|
7717
7835
|
const stringPropContext = useBoundProp(stringPropTypeUtil17);
|
|
7718
7836
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
7719
|
-
const rowRef =
|
|
7837
|
+
const rowRef = useRef23(null);
|
|
7720
7838
|
const handleSizeChange = (size) => {
|
|
7721
7839
|
if (size === "custom") {
|
|
7722
7840
|
backgroundImageScaleContext.setValue({ width: null, height: null });
|
|
@@ -7751,7 +7869,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
7751
7869
|
};
|
|
7752
7870
|
|
|
7753
7871
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
7754
|
-
import { useRef as
|
|
7872
|
+
import { useRef as useRef24 } from "react";
|
|
7755
7873
|
import {
|
|
7756
7874
|
backgroundColorOverlayPropTypeUtil,
|
|
7757
7875
|
backgroundGradientOverlayPropTypeUtil as backgroundGradientOverlayPropTypeUtil2,
|
|
@@ -7776,7 +7894,7 @@ var useBackgroundTabsHistory = ({
|
|
|
7776
7894
|
return "image";
|
|
7777
7895
|
};
|
|
7778
7896
|
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs(getCurrentOverlayType());
|
|
7779
|
-
const valuesHistory =
|
|
7897
|
+
const valuesHistory = useRef24({
|
|
7780
7898
|
image: initialBackgroundImageOverlay,
|
|
7781
7899
|
color: initialBackgroundColorOverlay2,
|
|
7782
7900
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -8027,7 +8145,7 @@ var BackgroundClipField = () => {
|
|
|
8027
8145
|
|
|
8028
8146
|
// src/controls/repeatable-control.tsx
|
|
8029
8147
|
import * as React102 from "react";
|
|
8030
|
-
import { useMemo as
|
|
8148
|
+
import { useMemo as useMemo14 } from "react";
|
|
8031
8149
|
import { createArrayPropUtils as createArrayPropUtils2 } from "@elementor/editor-props";
|
|
8032
8150
|
import { Box as Box26 } from "@elementor/ui";
|
|
8033
8151
|
var PLACEHOLDER_REGEX = /\$\{([^}]+)\}/g;
|
|
@@ -8048,11 +8166,11 @@ var RepeatableControl = createControl(
|
|
|
8048
8166
|
if (!childPropTypeUtil) {
|
|
8049
8167
|
return null;
|
|
8050
8168
|
}
|
|
8051
|
-
const childArrayPropTypeUtil2 =
|
|
8169
|
+
const childArrayPropTypeUtil2 = useMemo14(
|
|
8052
8170
|
() => createArrayPropUtils2(childPropTypeUtil.key, childPropTypeUtil.schema, propKey),
|
|
8053
8171
|
[childPropTypeUtil.key, childPropTypeUtil.schema, propKey]
|
|
8054
8172
|
);
|
|
8055
|
-
const contextValue =
|
|
8173
|
+
const contextValue = useMemo14(
|
|
8056
8174
|
() => ({
|
|
8057
8175
|
...childControlConfig,
|
|
8058
8176
|
placeholder: placeholder || "",
|
|
@@ -8184,7 +8302,7 @@ var getAllProperties = (pattern) => {
|
|
|
8184
8302
|
|
|
8185
8303
|
// src/controls/key-value-control.tsx
|
|
8186
8304
|
import * as React103 from "react";
|
|
8187
|
-
import { useMemo as
|
|
8305
|
+
import { useMemo as useMemo15, useState as useState25 } from "react";
|
|
8188
8306
|
import {
|
|
8189
8307
|
isTransformable,
|
|
8190
8308
|
keyValuePropTypeUtil,
|
|
@@ -8215,9 +8333,9 @@ var getInitialFieldValue = (fieldValue) => {
|
|
|
8215
8333
|
};
|
|
8216
8334
|
var KeyValueControl = createControl((props = {}) => {
|
|
8217
8335
|
const { value, setValue, ...propContext } = useBoundProp(keyValuePropTypeUtil);
|
|
8218
|
-
const [keyError, setKeyError] =
|
|
8219
|
-
const [valueError, setValueError] =
|
|
8220
|
-
const [sessionState, setSessionState] =
|
|
8336
|
+
const [keyError, setKeyError] = useState25("");
|
|
8337
|
+
const [valueError, setValueError] = useState25("");
|
|
8338
|
+
const [sessionState, setSessionState] = useState25({
|
|
8221
8339
|
key: getInitialFieldValue(value?.key),
|
|
8222
8340
|
value: getInitialFieldValue(value?.value)
|
|
8223
8341
|
});
|
|
@@ -8227,7 +8345,7 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
8227
8345
|
keyHelper: void 0,
|
|
8228
8346
|
valueHelper: void 0
|
|
8229
8347
|
};
|
|
8230
|
-
const [keyRegex, valueRegex, errMsg] =
|
|
8348
|
+
const [keyRegex, valueRegex, errMsg] = useMemo15(
|
|
8231
8349
|
() => [
|
|
8232
8350
|
props.regexKey ? new RegExp(props.regexKey) : void 0,
|
|
8233
8351
|
props.regexValue ? new RegExp(props.regexValue) : void 0,
|
|
@@ -8359,7 +8477,7 @@ var PositionControl = () => {
|
|
|
8359
8477
|
|
|
8360
8478
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
8361
8479
|
import * as React117 from "react";
|
|
8362
|
-
import { useRef as
|
|
8480
|
+
import { useRef as useRef32 } from "react";
|
|
8363
8481
|
import { transformFunctionsPropTypeUtil, transformPropTypeUtil } from "@elementor/editor-props";
|
|
8364
8482
|
import { AdjustmentsIcon as AdjustmentsIcon2, InfoCircleFilledIcon as InfoCircleFilledIcon2 } from "@elementor/icons";
|
|
8365
8483
|
import { bindTrigger as bindTrigger5, Box as Box30, IconButton as IconButton10, Tooltip as Tooltip12, Typography as Typography12, usePopupState as usePopupState10 } from "@elementor/ui";
|
|
@@ -8423,7 +8541,7 @@ import { __ as __55 } from "@wordpress/i18n";
|
|
|
8423
8541
|
|
|
8424
8542
|
// src/controls/transform-control/functions/move.tsx
|
|
8425
8543
|
import * as React106 from "react";
|
|
8426
|
-
import { useRef as
|
|
8544
|
+
import { useRef as useRef25 } from "react";
|
|
8427
8545
|
import { moveTransformPropTypeUtil } from "@elementor/editor-props";
|
|
8428
8546
|
import { ArrowDownLeftIcon, ArrowDownSmallIcon, ArrowRightIcon } from "@elementor/icons";
|
|
8429
8547
|
import { Grid as Grid22 } from "@elementor/ui";
|
|
@@ -8470,7 +8588,7 @@ var moveAxisControls = [
|
|
|
8470
8588
|
];
|
|
8471
8589
|
var Move = () => {
|
|
8472
8590
|
const context = useBoundProp(moveTransformPropTypeUtil);
|
|
8473
|
-
const rowRefs = [
|
|
8591
|
+
const rowRefs = [useRef25(null), useRef25(null), useRef25(null)];
|
|
8474
8592
|
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(
|
|
8475
8593
|
AxisRow,
|
|
8476
8594
|
{
|
|
@@ -8485,7 +8603,7 @@ var Move = () => {
|
|
|
8485
8603
|
|
|
8486
8604
|
// src/controls/transform-control/functions/rotate.tsx
|
|
8487
8605
|
import * as React107 from "react";
|
|
8488
|
-
import { useRef as
|
|
8606
|
+
import { useRef as useRef26 } from "react";
|
|
8489
8607
|
import { rotateTransformPropTypeUtil as rotateTransformPropTypeUtil2 } from "@elementor/editor-props";
|
|
8490
8608
|
import { Arrow360Icon, RotateClockwiseIcon } from "@elementor/icons";
|
|
8491
8609
|
import { Grid as Grid23 } from "@elementor/ui";
|
|
@@ -8510,7 +8628,7 @@ var rotateAxisControls = [
|
|
|
8510
8628
|
var rotateUnits = ["deg", "rad", "grad", "turn"];
|
|
8511
8629
|
var Rotate = () => {
|
|
8512
8630
|
const context = useBoundProp(rotateTransformPropTypeUtil2);
|
|
8513
|
-
const rowRefs = [
|
|
8631
|
+
const rowRefs = [useRef26(null), useRef26(null), useRef26(null)];
|
|
8514
8632
|
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(
|
|
8515
8633
|
AxisRow,
|
|
8516
8634
|
{
|
|
@@ -8524,7 +8642,7 @@ var Rotate = () => {
|
|
|
8524
8642
|
|
|
8525
8643
|
// src/controls/transform-control/functions/scale.tsx
|
|
8526
8644
|
import * as React109 from "react";
|
|
8527
|
-
import { useRef as
|
|
8645
|
+
import { useRef as useRef27 } from "react";
|
|
8528
8646
|
import { scaleTransformPropTypeUtil as scaleTransformPropTypeUtil2 } from "@elementor/editor-props";
|
|
8529
8647
|
import { ArrowDownLeftIcon as ArrowDownLeftIcon2, ArrowDownSmallIcon as ArrowDownSmallIcon2, ArrowRightIcon as ArrowRightIcon2 } from "@elementor/icons";
|
|
8530
8648
|
import { Grid as Grid25 } from "@elementor/ui";
|
|
@@ -8557,13 +8675,13 @@ var scaleAxisControls = [
|
|
|
8557
8675
|
];
|
|
8558
8676
|
var Scale = () => {
|
|
8559
8677
|
const context = useBoundProp(scaleTransformPropTypeUtil2);
|
|
8560
|
-
const rowRefs = [
|
|
8678
|
+
const rowRefs = [useRef27(null), useRef27(null), useRef27(null)];
|
|
8561
8679
|
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] })))));
|
|
8562
8680
|
};
|
|
8563
8681
|
|
|
8564
8682
|
// src/controls/transform-control/functions/skew.tsx
|
|
8565
8683
|
import * as React110 from "react";
|
|
8566
|
-
import { useRef as
|
|
8684
|
+
import { useRef as useRef28 } from "react";
|
|
8567
8685
|
import { skewTransformPropTypeUtil as skewTransformPropTypeUtil2 } from "@elementor/editor-props";
|
|
8568
8686
|
import { ArrowLeftIcon, ArrowRightIcon as ArrowRightIcon3 } from "@elementor/icons";
|
|
8569
8687
|
import { Grid as Grid26 } from "@elementor/ui";
|
|
@@ -8583,7 +8701,7 @@ var skewAxisControls = [
|
|
|
8583
8701
|
var skewUnits = ["deg", "rad", "grad", "turn"];
|
|
8584
8702
|
var Skew = () => {
|
|
8585
8703
|
const context = useBoundProp(skewTransformPropTypeUtil2);
|
|
8586
|
-
const rowRefs = [
|
|
8704
|
+
const rowRefs = [useRef28(null), useRef28(null), useRef28(null)];
|
|
8587
8705
|
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(
|
|
8588
8706
|
AxisRow,
|
|
8589
8707
|
{
|
|
@@ -8596,7 +8714,7 @@ var Skew = () => {
|
|
|
8596
8714
|
};
|
|
8597
8715
|
|
|
8598
8716
|
// src/controls/transform-control/use-transform-tabs-history.tsx
|
|
8599
|
-
import { useRef as
|
|
8717
|
+
import { useRef as useRef29 } from "react";
|
|
8600
8718
|
import {
|
|
8601
8719
|
moveTransformPropTypeUtil as moveTransformPropTypeUtil2,
|
|
8602
8720
|
rotateTransformPropTypeUtil as rotateTransformPropTypeUtil3,
|
|
@@ -8628,7 +8746,7 @@ var useTransformTabsHistory = ({
|
|
|
8628
8746
|
}
|
|
8629
8747
|
};
|
|
8630
8748
|
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs2(getCurrentTransformType());
|
|
8631
|
-
const valuesHistory =
|
|
8749
|
+
const valuesHistory = useRef29({
|
|
8632
8750
|
move: initialMove,
|
|
8633
8751
|
scale: initialScale,
|
|
8634
8752
|
rotate: initialRotate,
|
|
@@ -8772,7 +8890,7 @@ import { __ as __59 } from "@wordpress/i18n";
|
|
|
8772
8890
|
|
|
8773
8891
|
// src/controls/transform-control/transform-base-controls/children-perspective-control.tsx
|
|
8774
8892
|
import * as React114 from "react";
|
|
8775
|
-
import { useRef as
|
|
8893
|
+
import { useRef as useRef30 } from "react";
|
|
8776
8894
|
import { perspectiveOriginPropTypeUtil } from "@elementor/editor-props";
|
|
8777
8895
|
import { Grid as Grid27, Stack as Stack19 } from "@elementor/ui";
|
|
8778
8896
|
import { __ as __57 } from "@wordpress/i18n";
|
|
@@ -8804,13 +8922,13 @@ var PerspectiveOriginControlProvider = () => {
|
|
|
8804
8922
|
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 }))));
|
|
8805
8923
|
};
|
|
8806
8924
|
var ControlFields = ({ control }) => {
|
|
8807
|
-
const rowRef =
|
|
8925
|
+
const rowRef = useRef30(null);
|
|
8808
8926
|
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 })));
|
|
8809
8927
|
};
|
|
8810
8928
|
|
|
8811
8929
|
// src/controls/transform-control/transform-base-controls/transform-origin-control.tsx
|
|
8812
8930
|
import * as React115 from "react";
|
|
8813
|
-
import { useRef as
|
|
8931
|
+
import { useRef as useRef31 } from "react";
|
|
8814
8932
|
import { transformOriginPropTypeUtil } from "@elementor/editor-props";
|
|
8815
8933
|
import { Grid as Grid28, Stack as Stack20 } from "@elementor/ui";
|
|
8816
8934
|
import { __ as __58 } from "@wordpress/i18n";
|
|
@@ -8838,7 +8956,7 @@ var TransformOriginControl = () => {
|
|
|
8838
8956
|
};
|
|
8839
8957
|
var ControlFields2 = ({ control }) => {
|
|
8840
8958
|
const context = useBoundProp(transformOriginPropTypeUtil);
|
|
8841
|
-
const rowRef =
|
|
8959
|
+
const rowRef = useRef31(null);
|
|
8842
8960
|
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 })))));
|
|
8843
8961
|
};
|
|
8844
8962
|
|
|
@@ -8886,7 +9004,7 @@ var SIZE11 = "tiny";
|
|
|
8886
9004
|
var TransformRepeaterControl = createControl(
|
|
8887
9005
|
({ showChildrenPerspective }) => {
|
|
8888
9006
|
const context = useBoundProp(transformPropTypeUtil);
|
|
8889
|
-
const headerRef =
|
|
9007
|
+
const headerRef = useRef32(null);
|
|
8890
9008
|
const popupState = usePopupState10({ variant: "popover" });
|
|
8891
9009
|
return /* @__PURE__ */ React117.createElement(PropProvider, { ...context }, /* @__PURE__ */ React117.createElement(
|
|
8892
9010
|
TransformSettingsControl,
|
|
@@ -8966,7 +9084,7 @@ var TransformBasePopoverTrigger = ({
|
|
|
8966
9084
|
|
|
8967
9085
|
// src/controls/transition-control/transition-repeater-control.tsx
|
|
8968
9086
|
import * as React120 from "react";
|
|
8969
|
-
import { useEffect as
|
|
9087
|
+
import { useEffect as useEffect19, useMemo as useMemo18, useState as useState26 } from "react";
|
|
8970
9088
|
import {
|
|
8971
9089
|
createArrayPropUtils as createArrayPropUtils3,
|
|
8972
9090
|
selectionSizePropTypeUtil as selectionSizePropTypeUtil2
|
|
@@ -8978,15 +9096,15 @@ import { __ as __63 } from "@wordpress/i18n";
|
|
|
8978
9096
|
|
|
8979
9097
|
// src/controls/selection-size-control.tsx
|
|
8980
9098
|
import * as React118 from "react";
|
|
8981
|
-
import { useMemo as
|
|
9099
|
+
import { useMemo as useMemo16, useRef as useRef33 } from "react";
|
|
8982
9100
|
import { selectionSizePropTypeUtil } from "@elementor/editor-props";
|
|
8983
9101
|
import { Grid as Grid29 } from "@elementor/ui";
|
|
8984
9102
|
var SelectionSizeControl = createControl(
|
|
8985
9103
|
({ selectionLabel, sizeLabel, selectionConfig, sizeConfigMap }) => {
|
|
8986
9104
|
const { value, setValue, propType } = useBoundProp(selectionSizePropTypeUtil);
|
|
8987
|
-
const rowRef =
|
|
9105
|
+
const rowRef = useRef33(null);
|
|
8988
9106
|
const sizeFieldId = sizeLabel.replace(/\s+/g, "-").toLowerCase();
|
|
8989
|
-
const currentSizeConfig =
|
|
9107
|
+
const currentSizeConfig = useMemo16(() => {
|
|
8990
9108
|
switch (value.selection.$$type) {
|
|
8991
9109
|
case "key-value":
|
|
8992
9110
|
return sizeConfigMap[value?.selection?.value.value.value || ""];
|
|
@@ -9199,7 +9317,7 @@ function subscribeToTransitionEvent() {
|
|
|
9199
9317
|
|
|
9200
9318
|
// src/controls/transition-control/transition-selector.tsx
|
|
9201
9319
|
import * as React119 from "react";
|
|
9202
|
-
import { useMemo as
|
|
9320
|
+
import { useMemo as useMemo17, useRef as useRef34 } from "react";
|
|
9203
9321
|
import { keyValuePropTypeUtil as keyValuePropTypeUtil2 } from "@elementor/editor-props";
|
|
9204
9322
|
import { PromotionAlert, PromotionChip } from "@elementor/editor-ui";
|
|
9205
9323
|
import { ChevronDownIcon as ChevronDownIcon3, VariationsIcon } from "@elementor/icons";
|
|
@@ -9245,9 +9363,9 @@ var TransitionSelector = ({
|
|
|
9245
9363
|
const {
|
|
9246
9364
|
key: { value: transitionLabel }
|
|
9247
9365
|
} = value;
|
|
9248
|
-
const defaultRef =
|
|
9366
|
+
const defaultRef = useRef34(null);
|
|
9249
9367
|
const popoverState = usePopupState11({ variant: "popover" });
|
|
9250
|
-
const disabledCategories =
|
|
9368
|
+
const disabledCategories = useMemo17(() => {
|
|
9251
9369
|
return new Set(
|
|
9252
9370
|
transitionProperties.filter((cat) => cat.properties.some((prop) => prop.isDisabled)).map((cat) => cat.label)
|
|
9253
9371
|
);
|
|
@@ -9473,14 +9591,14 @@ var TransitionRepeaterControl = createControl(
|
|
|
9473
9591
|
currentStyleState
|
|
9474
9592
|
}) => {
|
|
9475
9593
|
const currentStyleIsNormal = currentStyleState === null;
|
|
9476
|
-
const [recentlyUsedList, setRecentlyUsedList] =
|
|
9594
|
+
const [recentlyUsedList, setRecentlyUsedList] = useState26([]);
|
|
9477
9595
|
const proInstalled = hasProInstalled2();
|
|
9478
9596
|
const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
9479
|
-
const { allDisabled: disabledItems, proDisabled: proDisabledItems } =
|
|
9597
|
+
const { allDisabled: disabledItems, proDisabled: proDisabledItems } = useMemo18(
|
|
9480
9598
|
() => getDisabledItemLabels(value),
|
|
9481
9599
|
[value]
|
|
9482
9600
|
);
|
|
9483
|
-
const allowedTransitionSet =
|
|
9601
|
+
const allowedTransitionSet = useMemo18(() => {
|
|
9484
9602
|
const set = /* @__PURE__ */ new Set();
|
|
9485
9603
|
transitionProperties.forEach((category) => {
|
|
9486
9604
|
category.properties.forEach((prop) => {
|
|
@@ -9491,7 +9609,7 @@ var TransitionRepeaterControl = createControl(
|
|
|
9491
9609
|
});
|
|
9492
9610
|
return set;
|
|
9493
9611
|
}, [proInstalled]);
|
|
9494
|
-
|
|
9612
|
+
useEffect19(() => {
|
|
9495
9613
|
if (!value || value.length === 0) {
|
|
9496
9614
|
return;
|
|
9497
9615
|
}
|
|
@@ -9503,10 +9621,10 @@ var TransitionRepeaterControl = createControl(
|
|
|
9503
9621
|
setValue(sanitized);
|
|
9504
9622
|
}
|
|
9505
9623
|
}, [allowedTransitionSet]);
|
|
9506
|
-
|
|
9624
|
+
useEffect19(() => {
|
|
9507
9625
|
recentlyUsedListGetter().then(setRecentlyUsedList);
|
|
9508
9626
|
}, [recentlyUsedListGetter]);
|
|
9509
|
-
const allPropertiesUsed =
|
|
9627
|
+
const allPropertiesUsed = useMemo18(() => areAllPropertiesUsed(value), [value]);
|
|
9510
9628
|
const isAddItemDisabled = !currentStyleIsNormal || allPropertiesUsed;
|
|
9511
9629
|
return /* @__PURE__ */ React120.createElement(
|
|
9512
9630
|
RepeatableControl,
|
|
@@ -9789,13 +9907,13 @@ var BoundTimeStringControl = ({ bind, ariaLabel }) => {
|
|
|
9789
9907
|
|
|
9790
9908
|
// src/controls/inline-editing-control.tsx
|
|
9791
9909
|
import * as React129 from "react";
|
|
9792
|
-
import { useCallback as useCallback4, useState as
|
|
9910
|
+
import { useCallback as useCallback4, useState as useState28 } from "react";
|
|
9793
9911
|
import { escapedHtmlPropTypeUtil as escapedHtmlPropTypeUtil2 } from "@elementor/editor-props";
|
|
9794
9912
|
import { Box as Box36, Stack as Stack24 } from "@elementor/ui";
|
|
9795
9913
|
|
|
9796
9914
|
// src/components/inline-editor.tsx
|
|
9797
9915
|
import * as React126 from "react";
|
|
9798
|
-
import { useEffect as
|
|
9916
|
+
import { useEffect as useEffect20, useRef as useRef35 } from "react";
|
|
9799
9917
|
import { Box as Box34 } from "@elementor/ui";
|
|
9800
9918
|
import Bold from "@tiptap/extension-bold";
|
|
9801
9919
|
import Document from "@tiptap/extension-document";
|
|
@@ -9858,8 +9976,8 @@ var InlineEditor = React126.forwardRef((props, ref) => {
|
|
|
9858
9976
|
onSelectionEnd,
|
|
9859
9977
|
mountElement = null
|
|
9860
9978
|
} = props;
|
|
9861
|
-
const containerRef =
|
|
9862
|
-
const onBlurRef =
|
|
9979
|
+
const containerRef = useRef35(null);
|
|
9980
|
+
const onBlurRef = useRef35(onBlur);
|
|
9863
9981
|
onBlurRef.current = onBlur;
|
|
9864
9982
|
const documentContentSettings = !!expectedTag ? "block+" : "inline*";
|
|
9865
9983
|
const onUpdate = ({ editor: updatedEditor }) => {
|
|
@@ -9957,8 +10075,8 @@ var InlineEditor = React126.forwardRef((props, ref) => {
|
|
|
9957
10075
|
return /* @__PURE__ */ React126.createElement(Box34, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React126.createElement(EditorContent, { ref, editor }));
|
|
9958
10076
|
});
|
|
9959
10077
|
var useOnUpdate = (callback, dependencies) => {
|
|
9960
|
-
const hasMounted =
|
|
9961
|
-
|
|
10078
|
+
const hasMounted = useRef35(false);
|
|
10079
|
+
useEffect20(() => {
|
|
9962
10080
|
if (hasMounted.current) {
|
|
9963
10081
|
callback();
|
|
9964
10082
|
} else {
|
|
@@ -9969,7 +10087,7 @@ var useOnUpdate = (callback, dependencies) => {
|
|
|
9969
10087
|
|
|
9970
10088
|
// src/components/inline-editor-toolbar.tsx
|
|
9971
10089
|
import * as React128 from "react";
|
|
9972
|
-
import { useEffect as
|
|
10090
|
+
import { useEffect as useEffect22, useMemo as useMemo19, useRef as useRef37, useState as useState27 } from "react";
|
|
9973
10091
|
import { getContainer as getContainer2, getElementSetting } from "@elementor/editor-elements";
|
|
9974
10092
|
import {
|
|
9975
10093
|
BoldIcon,
|
|
@@ -9995,7 +10113,7 @@ import { __ as __67 } from "@wordpress/i18n";
|
|
|
9995
10113
|
|
|
9996
10114
|
// src/components/url-popover.tsx
|
|
9997
10115
|
import * as React127 from "react";
|
|
9998
|
-
import { useEffect as
|
|
10116
|
+
import { useEffect as useEffect21, useRef as useRef36 } from "react";
|
|
9999
10117
|
import { ExternalLinkIcon } from "@elementor/icons";
|
|
10000
10118
|
import { bindPopover as bindPopover8, Popover as Popover9, Stack as Stack23, TextField as TextField11, ToggleButton as ToggleButton3, Tooltip as Tooltip13 } from "@elementor/ui";
|
|
10001
10119
|
import { __ as __66 } from "@wordpress/i18n";
|
|
@@ -10008,8 +10126,8 @@ var UrlPopover = ({
|
|
|
10008
10126
|
openInNewTab,
|
|
10009
10127
|
onToggleNewTab
|
|
10010
10128
|
}) => {
|
|
10011
|
-
const inputRef =
|
|
10012
|
-
|
|
10129
|
+
const inputRef = useRef36(null);
|
|
10130
|
+
useEffect21(() => {
|
|
10013
10131
|
if (popupState.isOpen) {
|
|
10014
10132
|
requestAnimationFrame(() => inputRef.current?.focus());
|
|
10015
10133
|
}
|
|
@@ -10064,16 +10182,16 @@ var InlineEditorToolbar = ({
|
|
|
10064
10182
|
sx = {},
|
|
10065
10183
|
inControlPanel = false
|
|
10066
10184
|
}) => {
|
|
10067
|
-
const [urlValue, setUrlValue] =
|
|
10068
|
-
const [openInNewTab, setOpenInNewTab] =
|
|
10069
|
-
const toolbarRef =
|
|
10185
|
+
const [urlValue, setUrlValue] = useState27("");
|
|
10186
|
+
const [openInNewTab, setOpenInNewTab] = useState27(false);
|
|
10187
|
+
const toolbarRef = useRef37(null);
|
|
10070
10188
|
const linkPopupState = usePopupState12({ variant: "popover" });
|
|
10071
10189
|
const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
|
|
10072
10190
|
const editorState = useEditorState({
|
|
10073
10191
|
editor,
|
|
10074
10192
|
selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
|
|
10075
10193
|
});
|
|
10076
|
-
const formatButtonsList =
|
|
10194
|
+
const formatButtonsList = useMemo19(() => {
|
|
10077
10195
|
const buttons = Object.values(formatButtons);
|
|
10078
10196
|
if (isElementClickable) {
|
|
10079
10197
|
return buttons.filter((button) => button.action !== "link");
|
|
@@ -10110,7 +10228,7 @@ var InlineEditorToolbar = ({
|
|
|
10110
10228
|
}
|
|
10111
10229
|
linkPopupState.close();
|
|
10112
10230
|
};
|
|
10113
|
-
|
|
10231
|
+
useEffect22(() => {
|
|
10114
10232
|
if (!inControlPanel) {
|
|
10115
10233
|
editor?.commands?.focus();
|
|
10116
10234
|
}
|
|
@@ -10292,7 +10410,7 @@ var InlineEditingControl = createControl(
|
|
|
10292
10410
|
const { setValue, placeholder, value } = useBoundProp(escapedHtmlPropTypeUtil2);
|
|
10293
10411
|
const { value: rawValue } = usePropKeyContext();
|
|
10294
10412
|
const content = value ?? extractInlineHtmlContent(rawValue);
|
|
10295
|
-
const [editor, setEditor] =
|
|
10413
|
+
const [editor, setEditor] = useState28(null);
|
|
10296
10414
|
const handleChange = useCallback4(
|
|
10297
10415
|
(newValue) => {
|
|
10298
10416
|
const html = newValue ?? "";
|
|
@@ -10480,7 +10598,7 @@ function useFormFieldSuggestions(options) {
|
|
|
10480
10598
|
|
|
10481
10599
|
// src/controls/email-form-action-control/email-chips-field.tsx
|
|
10482
10600
|
import * as React130 from "react";
|
|
10483
|
-
import { useMemo as
|
|
10601
|
+
import { useMemo as useMemo20, useState as useState29 } from "react";
|
|
10484
10602
|
import { stringArrayPropTypeUtil as stringArrayPropTypeUtil3, stringPropTypeUtil as stringPropTypeUtil23 } from "@elementor/editor-props";
|
|
10485
10603
|
import { Autocomplete as Autocomplete4, Grid as Grid32, TextField as TextField12 } from "@elementor/ui";
|
|
10486
10604
|
|
|
@@ -10518,10 +10636,10 @@ function resolveMention(raw, suggestions) {
|
|
|
10518
10636
|
}
|
|
10519
10637
|
var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
|
|
10520
10638
|
const { value, setValue, disabled } = useBoundProp(stringArrayPropTypeUtil3);
|
|
10521
|
-
const [inputValue, setInputValue] =
|
|
10639
|
+
const [inputValue, setInputValue] = useState29("");
|
|
10522
10640
|
const items2 = value || [];
|
|
10523
10641
|
const selectedValues = items2.map((item) => stringPropTypeUtil23.extract(item)).filter((val) => val !== null);
|
|
10524
|
-
const suggestionOptions =
|
|
10642
|
+
const suggestionOptions = useMemo20(
|
|
10525
10643
|
() => suggestions.map((suggestion) => `[${suggestion.value}]`),
|
|
10526
10644
|
[suggestions]
|
|
10527
10645
|
);
|
|
@@ -10749,14 +10867,14 @@ var GridSpanControl = createControl(
|
|
|
10749
10867
|
|
|
10750
10868
|
// src/components/promotions/display-conditions-control.tsx
|
|
10751
10869
|
import * as React137 from "react";
|
|
10752
|
-
import { useRef as
|
|
10870
|
+
import { useRef as useRef38 } from "react";
|
|
10753
10871
|
import { SitemapIcon } from "@elementor/icons";
|
|
10754
10872
|
import { IconButton as IconButton12, Stack as Stack27, Tooltip as Tooltip15 } from "@elementor/ui";
|
|
10755
10873
|
import { __ as __71 } from "@wordpress/i18n";
|
|
10756
10874
|
|
|
10757
10875
|
// src/components/promotions/promotion-trigger.tsx
|
|
10758
10876
|
import * as React136 from "react";
|
|
10759
|
-
import { forwardRef as forwardRef14, useCallback as useCallback5, useImperativeHandle, useState as
|
|
10877
|
+
import { forwardRef as forwardRef14, useCallback as useCallback5, useImperativeHandle, useState as useState30 } from "react";
|
|
10760
10878
|
import { PromotionChip as PromotionChip2, PromotionInfotip } from "@elementor/editor-ui";
|
|
10761
10879
|
import { Box as Box38 } from "@elementor/ui";
|
|
10762
10880
|
function getV4Promotion(key) {
|
|
@@ -10764,7 +10882,7 @@ function getV4Promotion(key) {
|
|
|
10764
10882
|
}
|
|
10765
10883
|
var PromotionTrigger = forwardRef14(
|
|
10766
10884
|
({ promotionKey, children, trackingData }, ref) => {
|
|
10767
|
-
const [isOpen, setIsOpen] =
|
|
10885
|
+
const [isOpen, setIsOpen] = useState30(false);
|
|
10768
10886
|
const promotion = getV4Promotion(promotionKey);
|
|
10769
10887
|
const toggle = useCallback5(() => {
|
|
10770
10888
|
setIsOpen((prev) => {
|
|
@@ -10808,7 +10926,7 @@ var PromotionTrigger = forwardRef14(
|
|
|
10808
10926
|
var ARIA_LABEL = __71("Display Conditions", "elementor");
|
|
10809
10927
|
var TRACKING_DATA2 = { target_name: "display_conditions", location_l2: "general" };
|
|
10810
10928
|
var DisplayConditionsControl = createControl(() => {
|
|
10811
|
-
const triggerRef =
|
|
10929
|
+
const triggerRef = useRef38(null);
|
|
10812
10930
|
return /* @__PURE__ */ React137.createElement(
|
|
10813
10931
|
Stack27,
|
|
10814
10932
|
{
|
|
@@ -10840,14 +10958,14 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
10840
10958
|
|
|
10841
10959
|
// src/components/promotions/attributes-control.tsx
|
|
10842
10960
|
import * as React138 from "react";
|
|
10843
|
-
import { useRef as
|
|
10961
|
+
import { useRef as useRef39 } from "react";
|
|
10844
10962
|
import { PlusIcon as PlusIcon4 } from "@elementor/icons";
|
|
10845
10963
|
import { Stack as Stack28, Tooltip as Tooltip16 } from "@elementor/ui";
|
|
10846
10964
|
import { __ as __72 } from "@wordpress/i18n";
|
|
10847
10965
|
var ARIA_LABEL2 = __72("Attributes", "elementor");
|
|
10848
10966
|
var TRACKING_DATA3 = { target_name: "attributes", location_l2: "general" };
|
|
10849
10967
|
var AttributesControl = createControl(() => {
|
|
10850
|
-
const triggerRef =
|
|
10968
|
+
const triggerRef = useRef39(null);
|
|
10851
10969
|
return /* @__PURE__ */ React138.createElement(
|
|
10852
10970
|
Stack28,
|
|
10853
10971
|
{
|
|
@@ -10884,7 +11002,7 @@ var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /*
|
|
|
10884
11002
|
|
|
10885
11003
|
// src/components/repeater/repeater.tsx
|
|
10886
11004
|
import * as React140 from "react";
|
|
10887
|
-
import { useEffect as
|
|
11005
|
+
import { useEffect as useEffect23, useState as useState31 } from "react";
|
|
10888
11006
|
import { CopyIcon as CopyIcon2, EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2, PlusIcon as PlusIcon5, XIcon as XIcon4 } from "@elementor/icons";
|
|
10889
11007
|
import {
|
|
10890
11008
|
bindPopover as bindPopover9,
|
|
@@ -10914,7 +11032,7 @@ var Repeater3 = ({
|
|
|
10914
11032
|
isSortable = true,
|
|
10915
11033
|
adornment = ControlAdornments
|
|
10916
11034
|
}) => {
|
|
10917
|
-
const [openItem, setOpenItem] =
|
|
11035
|
+
const [openItem, setOpenItem] = useState31(initialOpenItem);
|
|
10918
11036
|
const uniqueKeys = items2.map(
|
|
10919
11037
|
(item, index) => isSortable && "getId" in itemSettings ? itemSettings.getId({ item, index }) : String(index)
|
|
10920
11038
|
);
|
|
@@ -11090,10 +11208,10 @@ var RepeaterItem = ({
|
|
|
11090
11208
|
), /* @__PURE__ */ React140.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React140.createElement(Box39, null, children({ anchorEl: ref }))));
|
|
11091
11209
|
};
|
|
11092
11210
|
var usePopover = (openOnMount, onOpen, onPopoverClose) => {
|
|
11093
|
-
const [ref, setRef] =
|
|
11211
|
+
const [ref, setRef] = useState31(null);
|
|
11094
11212
|
const popoverState = usePopupState13({ variant: "popover" });
|
|
11095
11213
|
const popoverProps = bindPopover9(popoverState);
|
|
11096
|
-
|
|
11214
|
+
useEffect23(() => {
|
|
11097
11215
|
if (openOnMount && ref) {
|
|
11098
11216
|
popoverState.open(ref);
|
|
11099
11217
|
onOpen?.();
|
|
@@ -11272,7 +11390,7 @@ var hasValue = (value) => {
|
|
|
11272
11390
|
};
|
|
11273
11391
|
|
|
11274
11392
|
// src/hooks/use-font-families.ts
|
|
11275
|
-
import { useMemo as
|
|
11393
|
+
import { useMemo as useMemo21 } from "react";
|
|
11276
11394
|
import { getElementorConfig } from "@elementor/editor-v1-adapters";
|
|
11277
11395
|
var getFontControlConfig = () => {
|
|
11278
11396
|
const { controls } = getElementorConfig();
|
|
@@ -11280,7 +11398,7 @@ var getFontControlConfig = () => {
|
|
|
11280
11398
|
};
|
|
11281
11399
|
var useFontFamilies = () => {
|
|
11282
11400
|
const { groups, options } = getFontControlConfig();
|
|
11283
|
-
return
|
|
11401
|
+
return useMemo21(() => {
|
|
11284
11402
|
if (!groups || !options) {
|
|
11285
11403
|
return [];
|
|
11286
11404
|
}
|
|
@@ -11390,6 +11508,7 @@ export {
|
|
|
11390
11508
|
registerIconLibraryProvider,
|
|
11391
11509
|
resetFontAwesome7IconsCache,
|
|
11392
11510
|
resolveFontAwesome7Icon,
|
|
11511
|
+
resolveProviderIconPreviewSvg,
|
|
11393
11512
|
resolveProviderIconSvg,
|
|
11394
11513
|
trackUpgradePromotionClick,
|
|
11395
11514
|
trackViewPromotion,
|