@elementor/editor-controls 4.4.0-1145 → 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.d.mts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +291 -169
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +268 -147
- 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-preview.tsx +32 -7
- package/src/index.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -117,6 +117,7 @@ __export(index_exports, {
|
|
|
117
117
|
registerIconLibraryProvider: () => registerIconLibraryProvider,
|
|
118
118
|
resetFontAwesome7IconsCache: () => resetFontAwesome7IconsCache,
|
|
119
119
|
resolveFontAwesome7Icon: () => resolveFontAwesome7Icon,
|
|
120
|
+
resolveProviderIconPreviewSvg: () => resolveProviderIconPreviewSvg,
|
|
120
121
|
resolveProviderIconSvg: () => resolveProviderIconSvg,
|
|
121
122
|
trackUpgradePromotionClick: () => trackUpgradePromotionClick,
|
|
122
123
|
trackViewPromotion: () => trackViewPromotion,
|
|
@@ -5750,7 +5751,7 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
5750
5751
|
|
|
5751
5752
|
// src/controls/svg-media-control.tsx
|
|
5752
5753
|
var React93 = __toESM(require("react"));
|
|
5753
|
-
var
|
|
5754
|
+
var import_react59 = require("react");
|
|
5754
5755
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
5755
5756
|
var import_editor_props35 = require("@elementor/editor-props");
|
|
5756
5757
|
var import_ui76 = require("@elementor/ui");
|
|
@@ -5824,7 +5825,7 @@ function measureIconLibraryAnchor(container, buttonGroup) {
|
|
|
5824
5825
|
|
|
5825
5826
|
// src/controls/icon-library/icon-library-popover.tsx
|
|
5826
5827
|
var React90 = __toESM(require("react"));
|
|
5827
|
-
var
|
|
5828
|
+
var import_react57 = require("react");
|
|
5828
5829
|
var import_editor_ui12 = require("@elementor/editor-ui");
|
|
5829
5830
|
var import_icons26 = require("@elementor/icons");
|
|
5830
5831
|
var import_session2 = require("@elementor/session");
|
|
@@ -6079,8 +6080,74 @@ function toCatalogIcon(icon, library) {
|
|
|
6079
6080
|
|
|
6080
6081
|
// src/controls/icon-library/font-awesome-glyph.tsx
|
|
6081
6082
|
var React84 = __toESM(require("react"));
|
|
6083
|
+
var import_react53 = require("react");
|
|
6082
6084
|
var import_ui67 = require("@elementor/ui");
|
|
6083
6085
|
|
|
6086
|
+
// src/controls/icon-library/icon-library-providers.ts
|
|
6087
|
+
var import_react52 = require("react");
|
|
6088
|
+
var import_query2 = require("@elementor/query");
|
|
6089
|
+
var PROVIDER_ICON_SVG_QUERY_KEY = "icon-library-provider-svg";
|
|
6090
|
+
var providers = /* @__PURE__ */ new Map();
|
|
6091
|
+
function registerIconLibraryProvider(provider) {
|
|
6092
|
+
providers.set(provider.id, provider);
|
|
6093
|
+
}
|
|
6094
|
+
function unregisterIconLibraryProvider(id) {
|
|
6095
|
+
providers.delete(id);
|
|
6096
|
+
}
|
|
6097
|
+
function useIconLibraryProviderIcons(enabled) {
|
|
6098
|
+
const [snapshot] = (0, import_react52.useState)(() => [...providers.values()]);
|
|
6099
|
+
const states = snapshot.map((provider) => provider.useIcons(enabled));
|
|
6100
|
+
const data = useStableConcat(states.map((state) => state.data));
|
|
6101
|
+
return {
|
|
6102
|
+
data,
|
|
6103
|
+
isLoading: states.some((state) => state.isLoading)
|
|
6104
|
+
};
|
|
6105
|
+
}
|
|
6106
|
+
function resolveProviderIconSvg(library, iconValue, signal) {
|
|
6107
|
+
return resolveFromProviders((provider) => provider.resolveSvg, library, iconValue, signal);
|
|
6108
|
+
}
|
|
6109
|
+
function resolveProviderIconPreviewSvg(library, iconValue, signal) {
|
|
6110
|
+
return resolveFromProviders(
|
|
6111
|
+
(provider) => provider.resolvePreviewSvg ?? provider.resolveSvg,
|
|
6112
|
+
library,
|
|
6113
|
+
iconValue,
|
|
6114
|
+
signal
|
|
6115
|
+
);
|
|
6116
|
+
}
|
|
6117
|
+
async function resolveFromProviders(pickResolver, library, iconValue, signal) {
|
|
6118
|
+
for (const provider of providers.values()) {
|
|
6119
|
+
try {
|
|
6120
|
+
const markup = await pickResolver(provider)?.(library, iconValue, signal);
|
|
6121
|
+
if (markup) {
|
|
6122
|
+
return markup;
|
|
6123
|
+
}
|
|
6124
|
+
} catch (error) {
|
|
6125
|
+
if (signal?.aborted) {
|
|
6126
|
+
throw error;
|
|
6127
|
+
}
|
|
6128
|
+
}
|
|
6129
|
+
}
|
|
6130
|
+
return null;
|
|
6131
|
+
}
|
|
6132
|
+
function useStableConcat(lists) {
|
|
6133
|
+
const previous = (0, import_react52.useRef)(null);
|
|
6134
|
+
if (!previous.current || !areSameLists(previous.current.lists, lists)) {
|
|
6135
|
+
previous.current = { lists, merged: lists.flatMap((list) => list ?? []) };
|
|
6136
|
+
}
|
|
6137
|
+
return previous.current.merged;
|
|
6138
|
+
}
|
|
6139
|
+
function areSameLists(a, b) {
|
|
6140
|
+
return a.length === b.length && a.every((item, index) => item === b[index]);
|
|
6141
|
+
}
|
|
6142
|
+
function useProviderIconSvg(library, iconValue, enabled) {
|
|
6143
|
+
return (0, import_query2.useQuery)({
|
|
6144
|
+
queryKey: [PROVIDER_ICON_SVG_QUERY_KEY, library, iconValue],
|
|
6145
|
+
queryFn: ({ signal }) => resolveProviderIconSvg(library, iconValue, signal),
|
|
6146
|
+
enabled: enabled && Boolean(library && iconValue),
|
|
6147
|
+
staleTime: Infinity
|
|
6148
|
+
});
|
|
6149
|
+
}
|
|
6150
|
+
|
|
6084
6151
|
// src/controls/icon-library/sanitize-icon-svg-markup.ts
|
|
6085
6152
|
var ALLOWED_SVG_TAGS = /* @__PURE__ */ new Set(["svg", "g", "path", "title", "desc"]);
|
|
6086
6153
|
var ALLOWED_SVG_ATTRS = /* @__PURE__ */ new Set([
|
|
@@ -6127,7 +6194,56 @@ function pruneNode(node) {
|
|
|
6127
6194
|
}
|
|
6128
6195
|
|
|
6129
6196
|
// src/controls/icon-library/font-awesome-glyph.tsx
|
|
6130
|
-
var FontAwesomeGlyph = (
|
|
6197
|
+
var FontAwesomeGlyph = (props) => {
|
|
6198
|
+
const { icon } = props;
|
|
6199
|
+
if (icon.lazySvg && !icon.svgMarkup) {
|
|
6200
|
+
return /* @__PURE__ */ React84.createElement(LazyProviderGlyph, { ...props });
|
|
6201
|
+
}
|
|
6202
|
+
return /* @__PURE__ */ React84.createElement(ResolvedGlyph, { ...props });
|
|
6203
|
+
};
|
|
6204
|
+
var LazyProviderGlyph = (props) => {
|
|
6205
|
+
const { icon, size } = props;
|
|
6206
|
+
const [resolved, setResolved] = (0, import_react53.useState)(null);
|
|
6207
|
+
const [isVisible, setIsVisible] = (0, import_react53.useState)(typeof IntersectionObserver === "undefined");
|
|
6208
|
+
const placeholderRef = (0, import_react53.useRef)(null);
|
|
6209
|
+
const svgMarkup = resolved?.id === icon.id ? resolved.markup : null;
|
|
6210
|
+
(0, import_react53.useEffect)(() => {
|
|
6211
|
+
const element = placeholderRef.current;
|
|
6212
|
+
if (isVisible || !element) {
|
|
6213
|
+
return;
|
|
6214
|
+
}
|
|
6215
|
+
const observer = new IntersectionObserver((entries) => {
|
|
6216
|
+
if (entries.some((entry) => entry.isIntersecting)) {
|
|
6217
|
+
setIsVisible(true);
|
|
6218
|
+
observer.disconnect();
|
|
6219
|
+
}
|
|
6220
|
+
});
|
|
6221
|
+
observer.observe(element);
|
|
6222
|
+
return () => observer.disconnect();
|
|
6223
|
+
}, [isVisible]);
|
|
6224
|
+
(0, import_react53.useEffect)(() => {
|
|
6225
|
+
if (!isVisible) {
|
|
6226
|
+
return;
|
|
6227
|
+
}
|
|
6228
|
+
const controller = new AbortController();
|
|
6229
|
+
resolveProviderIconPreviewSvg(icon.library, icon.value, controller.signal).then((markup) => !controller.signal.aborted && setResolved({ id: icon.id, markup })).catch(() => {
|
|
6230
|
+
});
|
|
6231
|
+
return () => controller.abort();
|
|
6232
|
+
}, [isVisible, icon.id, icon.library, icon.value]);
|
|
6233
|
+
if (!svgMarkup) {
|
|
6234
|
+
return /* @__PURE__ */ React84.createElement(
|
|
6235
|
+
import_ui67.Box,
|
|
6236
|
+
{
|
|
6237
|
+
component: "span",
|
|
6238
|
+
ref: placeholderRef,
|
|
6239
|
+
"aria-hidden": "true",
|
|
6240
|
+
sx: { display: "inline-block", width: size, height: size }
|
|
6241
|
+
}
|
|
6242
|
+
);
|
|
6243
|
+
}
|
|
6244
|
+
return /* @__PURE__ */ React84.createElement(ResolvedGlyph, { ...props, icon: { ...icon, svgMarkup } });
|
|
6245
|
+
};
|
|
6246
|
+
var ResolvedGlyph = ({ icon, size, color, label }) => {
|
|
6131
6247
|
const svgMarkup = sanitizeIconSvgMarkup(icon.svgMarkup);
|
|
6132
6248
|
if (svgMarkup) {
|
|
6133
6249
|
return /* @__PURE__ */ React84.createElement(
|
|
@@ -6188,7 +6304,7 @@ var FontAwesomeGlyph = ({ icon, size, color, label }) => {
|
|
|
6188
6304
|
|
|
6189
6305
|
// src/controls/icon-library/icon-library-filter.tsx
|
|
6190
6306
|
var React85 = __toESM(require("react"));
|
|
6191
|
-
var
|
|
6307
|
+
var import_react54 = require("react");
|
|
6192
6308
|
var import_icons23 = require("@elementor/icons");
|
|
6193
6309
|
var import_ui68 = require("@elementor/ui");
|
|
6194
6310
|
var import_i18n34 = require("@wordpress/i18n");
|
|
@@ -6217,7 +6333,7 @@ var DEFAULT_FILTER = [
|
|
|
6217
6333
|
{ type: FILTER_TYPE_ITEM, value: "fa-brands", label: "Font Awesome - Brands", icon: "rosette" }
|
|
6218
6334
|
];
|
|
6219
6335
|
var IconLibraryFilter = ({ value, onChange }) => {
|
|
6220
|
-
const popupId = (0,
|
|
6336
|
+
const popupId = (0, import_react54.useId)();
|
|
6221
6337
|
const popupState = (0, import_ui68.usePopupState)({
|
|
6222
6338
|
variant: "popover",
|
|
6223
6339
|
popupId
|
|
@@ -6362,7 +6478,7 @@ function parseFilterEntry(value) {
|
|
|
6362
6478
|
|
|
6363
6479
|
// src/controls/icon-library/icon-library-grid.tsx
|
|
6364
6480
|
var React86 = __toESM(require("react"));
|
|
6365
|
-
var
|
|
6481
|
+
var import_react55 = require("react");
|
|
6366
6482
|
var import_ui69 = require("@elementor/ui");
|
|
6367
6483
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
6368
6484
|
var import_i18n35 = require("@wordpress/i18n");
|
|
@@ -6401,12 +6517,12 @@ var IconLibraryGrid = ({
|
|
|
6401
6517
|
noResultsComponent
|
|
6402
6518
|
}) => {
|
|
6403
6519
|
const theme = (0, import_ui69.useTheme)();
|
|
6404
|
-
const containerRef = (0,
|
|
6405
|
-
const cellRefs = (0,
|
|
6406
|
-
const shouldRestoreFocusRef = (0,
|
|
6520
|
+
const containerRef = (0, import_react55.useRef)(null);
|
|
6521
|
+
const cellRefs = (0, import_react55.useRef)(/* @__PURE__ */ new Map());
|
|
6522
|
+
const shouldRestoreFocusRef = (0, import_react55.useRef)(false);
|
|
6407
6523
|
const selectedIndex = items2.findIndex((item) => item.id === selectedValue);
|
|
6408
|
-
const [focusedIndex, setFocusedIndex] = (0,
|
|
6409
|
-
const [{ columnCount, cellSize }, setGridMetrics] = (0,
|
|
6524
|
+
const [focusedIndex, setFocusedIndex] = (0, import_react55.useState)(selectedIndex >= 0 ? selectedIndex : 0);
|
|
6525
|
+
const [{ columnCount, cellSize }, setGridMetrics] = (0, import_react55.useState)(() => getGridMetrics(0, 0, 0));
|
|
6410
6526
|
const rowCount = Math.ceil(items2.length / columnCount);
|
|
6411
6527
|
const cellGap = Number.parseFloat(theme.spacing(GRID_CELL_GAP));
|
|
6412
6528
|
const verticalPadding = Number.parseFloat(theme.spacing(GRID_VERTICAL_PADDING));
|
|
@@ -6421,7 +6537,7 @@ var IconLibraryGrid = ({
|
|
|
6421
6537
|
});
|
|
6422
6538
|
const focusedItem = items2[focusedIndex];
|
|
6423
6539
|
const visibleRowIndexes = virtualizer.getVirtualIndexes().join(",");
|
|
6424
|
-
(0,
|
|
6540
|
+
(0, import_react55.useLayoutEffect)(() => {
|
|
6425
6541
|
setFocusedIndex((current) => {
|
|
6426
6542
|
if (items2.length === 0) {
|
|
6427
6543
|
return 0;
|
|
@@ -6436,7 +6552,7 @@ var IconLibraryGrid = ({
|
|
|
6436
6552
|
virtualizer.scrollToIndex(Math.floor(selectedIndex / columnCount), { align: "center" });
|
|
6437
6553
|
}
|
|
6438
6554
|
}, [cellSize, columnCount, items2, selectedIndex, selectedValue]);
|
|
6439
|
-
(0,
|
|
6555
|
+
(0, import_react55.useLayoutEffect)(() => {
|
|
6440
6556
|
if (!shouldRestoreFocusRef.current || !focusedItem) {
|
|
6441
6557
|
return;
|
|
6442
6558
|
}
|
|
@@ -6447,7 +6563,7 @@ var IconLibraryGrid = ({
|
|
|
6447
6563
|
cell.focus();
|
|
6448
6564
|
shouldRestoreFocusRef.current = false;
|
|
6449
6565
|
}, [focusedItem, visibleRowIndexes]);
|
|
6450
|
-
(0,
|
|
6566
|
+
(0, import_react55.useLayoutEffect)(() => {
|
|
6451
6567
|
const container = containerRef.current;
|
|
6452
6568
|
if (!container) {
|
|
6453
6569
|
return;
|
|
@@ -6463,7 +6579,7 @@ var IconLibraryGrid = ({
|
|
|
6463
6579
|
resizeObserver.disconnect();
|
|
6464
6580
|
};
|
|
6465
6581
|
}, [theme, cellGap, items2.length]);
|
|
6466
|
-
(0,
|
|
6582
|
+
(0, import_react55.useLayoutEffect)(() => {
|
|
6467
6583
|
virtualizer.measure();
|
|
6468
6584
|
}, [cellSize, columnCount]);
|
|
6469
6585
|
const isRtl = theme.direction === "rtl" || document.documentElement.dir === "rtl";
|
|
@@ -6643,7 +6759,7 @@ var IconLibraryGrid = ({
|
|
|
6643
6759
|
/* @__PURE__ */ React86.createElement(
|
|
6644
6760
|
FontAwesomeGlyph,
|
|
6645
6761
|
{
|
|
6646
|
-
icon: item,
|
|
6762
|
+
icon: { ...item, value: item.iconValue ?? item.value },
|
|
6647
6763
|
size: ICON_GLYPH_SIZE,
|
|
6648
6764
|
color: "currentColor"
|
|
6649
6765
|
}
|
|
@@ -6658,52 +6774,9 @@ var IconLibraryGrid = ({
|
|
|
6658
6774
|
);
|
|
6659
6775
|
};
|
|
6660
6776
|
|
|
6661
|
-
// src/controls/icon-library/icon-library-providers.ts
|
|
6662
|
-
var import_react54 = require("react");
|
|
6663
|
-
var import_query2 = require("@elementor/query");
|
|
6664
|
-
var PROVIDER_ICON_SVG_QUERY_KEY = "icon-library-provider-svg";
|
|
6665
|
-
var providers = /* @__PURE__ */ new Map();
|
|
6666
|
-
function registerIconLibraryProvider(provider) {
|
|
6667
|
-
providers.set(provider.id, provider);
|
|
6668
|
-
}
|
|
6669
|
-
function unregisterIconLibraryProvider(id) {
|
|
6670
|
-
providers.delete(id);
|
|
6671
|
-
}
|
|
6672
|
-
function useIconLibraryProviderIcons(enabled) {
|
|
6673
|
-
const [snapshot] = (0, import_react54.useState)(() => [...providers.values()]);
|
|
6674
|
-
const states = snapshot.map((provider) => provider.useIcons(enabled));
|
|
6675
|
-
return {
|
|
6676
|
-
data: states.flatMap((state) => state.data ?? []),
|
|
6677
|
-
isLoading: states.some((state) => state.isLoading)
|
|
6678
|
-
};
|
|
6679
|
-
}
|
|
6680
|
-
async function resolveProviderIconSvg(library, iconValue, signal) {
|
|
6681
|
-
for (const provider of providers.values()) {
|
|
6682
|
-
try {
|
|
6683
|
-
const markup = await provider.resolveSvg?.(library, iconValue, signal);
|
|
6684
|
-
if (markup) {
|
|
6685
|
-
return markup;
|
|
6686
|
-
}
|
|
6687
|
-
} catch (error) {
|
|
6688
|
-
if (signal?.aborted) {
|
|
6689
|
-
throw error;
|
|
6690
|
-
}
|
|
6691
|
-
}
|
|
6692
|
-
}
|
|
6693
|
-
return null;
|
|
6694
|
-
}
|
|
6695
|
-
function useProviderIconSvg(library, iconValue, enabled) {
|
|
6696
|
-
return (0, import_query2.useQuery)({
|
|
6697
|
-
queryKey: [PROVIDER_ICON_SVG_QUERY_KEY, library, iconValue],
|
|
6698
|
-
queryFn: ({ signal }) => resolveProviderIconSvg(library, iconValue, signal),
|
|
6699
|
-
enabled: enabled && Boolean(library && iconValue),
|
|
6700
|
-
staleTime: Infinity
|
|
6701
|
-
});
|
|
6702
|
-
}
|
|
6703
|
-
|
|
6704
6777
|
// src/controls/icon-library/icon-library-upload-action.tsx
|
|
6705
6778
|
var React87 = __toESM(require("react"));
|
|
6706
|
-
var
|
|
6779
|
+
var import_react56 = require("react");
|
|
6707
6780
|
var import_editor_ui11 = require("@elementor/editor-ui");
|
|
6708
6781
|
var import_icons24 = require("@elementor/icons");
|
|
6709
6782
|
var import_locations3 = require("@elementor/locations");
|
|
@@ -6752,7 +6825,7 @@ var trackUpgradePromotionClick = (data) => {
|
|
|
6752
6825
|
var ICON_LIBRARY_UPLOAD_UPGRADE_URL = "https://go.elementor.com/go-pro-svg-library-upload-upgrade/";
|
|
6753
6826
|
var TRACKING_DATA = { target_name: "icon_library_upload", location_l2: "general" };
|
|
6754
6827
|
var { Slot: IconLibraryUploadActionSlot, inject: injectIntoIconLibraryUploadAction } = (0, import_locations3.createReplaceableLocation)();
|
|
6755
|
-
var IconLibraryUploadButton = (0,
|
|
6828
|
+
var IconLibraryUploadButton = (0, import_react56.forwardRef)(
|
|
6756
6829
|
(props, ref) => {
|
|
6757
6830
|
const label = (0, import_i18n36.__)("Upload library", "elementor");
|
|
6758
6831
|
return /* @__PURE__ */ React87.createElement(import_ui70.Tooltip, { title: label, placement: "top" }, /* @__PURE__ */ React87.createElement(import_ui70.IconButton, { ref, size: "tiny", "aria-label": label, ...props }, /* @__PURE__ */ React87.createElement(import_icons24.UploadIcon, { fontSize: "tiny" })));
|
|
@@ -6764,8 +6837,8 @@ var IconLibraryUploadPromotion = ({
|
|
|
6764
6837
|
title = (0, import_i18n36.__)("Upload custom icons", "elementor"),
|
|
6765
6838
|
content = (0, import_i18n36.__)("Add your own icon font library to use across your site.", "elementor")
|
|
6766
6839
|
}) => {
|
|
6767
|
-
const [isOpen, setIsOpen] = (0,
|
|
6768
|
-
const triggerRef = (0,
|
|
6840
|
+
const [isOpen, setIsOpen] = (0, import_react56.useState)(false);
|
|
6841
|
+
const triggerRef = (0, import_react56.useRef)(null);
|
|
6769
6842
|
const canSeePromotions = !!window.elementor?.config?.v4Promotions;
|
|
6770
6843
|
const close = () => {
|
|
6771
6844
|
setIsOpen(false);
|
|
@@ -6849,6 +6922,21 @@ var IconLibraryViewToggle = ({ value, onChange }) => {
|
|
|
6849
6922
|
);
|
|
6850
6923
|
};
|
|
6851
6924
|
|
|
6925
|
+
// src/controls/icon-library/merge-icons-by-id.ts
|
|
6926
|
+
var getNames = (icon) => [icon.name, ...icon.aliases ?? []].filter(Boolean);
|
|
6927
|
+
function mergeIconsById(primary, secondary) {
|
|
6928
|
+
const ids = new Set(primary.map((icon) => icon.id));
|
|
6929
|
+
const names = new Set(
|
|
6930
|
+
primary.flatMap((icon) => getNames(icon).map((name) => `${icon.library}:${name}`))
|
|
6931
|
+
);
|
|
6932
|
+
return [
|
|
6933
|
+
...primary,
|
|
6934
|
+
...secondary.filter(
|
|
6935
|
+
(icon) => !ids.has(icon.id) && !getNames(icon).some((name) => names.has(`${icon.library}:${name}`))
|
|
6936
|
+
)
|
|
6937
|
+
];
|
|
6938
|
+
}
|
|
6939
|
+
|
|
6852
6940
|
// src/controls/icon-library/svg-element-icon.tsx
|
|
6853
6941
|
var React89 = __toESM(require("react"));
|
|
6854
6942
|
var import_ui72 = require("@elementor/ui");
|
|
@@ -6905,7 +6993,7 @@ var IconLibraryPopover = ({
|
|
|
6905
6993
|
handleChange: handleSearchChange,
|
|
6906
6994
|
setImmediateValue: setSearchValue
|
|
6907
6995
|
} = (0, import_utils6.useDebounceState)({ delay: ICON_LIBRARY_SEARCH_DEBOUNCE_DELAY });
|
|
6908
|
-
const [activeLibraries, setActiveLibraries] = (0,
|
|
6996
|
+
const [activeLibraries, setActiveLibraries] = (0, import_react57.useState)([]);
|
|
6909
6997
|
const [storedView, setStoredView] = (0, import_session2.useSessionStorage)(
|
|
6910
6998
|
ICON_LIBRARY_VIEW_STORAGE_KEY,
|
|
6911
6999
|
ICON_LIBRARY_VIEW_STORAGE_PREFIX
|
|
@@ -6913,13 +7001,16 @@ var IconLibraryPopover = ({
|
|
|
6913
7001
|
const view = isIconLibraryView(storedView) ? storedView : DEFAULT_ICON_LIBRARY_VIEW;
|
|
6914
7002
|
const { data: fontAwesomeIcons = [], isLoading: isFontAwesomeLoading } = useFontAwesome7Catalog(open);
|
|
6915
7003
|
const { data: providerIcons = [], isLoading: isProviderLoading } = useIconLibraryProviderIcons(open);
|
|
6916
|
-
const
|
|
6917
|
-
|
|
6918
|
-
|
|
7004
|
+
const icons = (0, import_react57.useMemo)(
|
|
7005
|
+
() => mergeIconsById(fontAwesomeIcons, providerIcons),
|
|
7006
|
+
[providerIcons, fontAwesomeIcons]
|
|
7007
|
+
);
|
|
7008
|
+
const items2 = (0, import_react57.useMemo)(
|
|
6919
7009
|
() => createIconLibraryItems(icons, searchValue, activeLibraries),
|
|
6920
7010
|
[activeLibraries, icons, searchValue]
|
|
6921
7011
|
);
|
|
6922
|
-
const
|
|
7012
|
+
const isLoading = isFontAwesomeLoading || isProviderLoading && items2.length === 0;
|
|
7013
|
+
const selectedValue = (0, import_react57.useMemo)(
|
|
6923
7014
|
() => findFontAwesome7Icon(icons, selectedIconClass, selectedIconLibrary)?.id,
|
|
6924
7015
|
[icons, selectedIconClass, selectedIconLibrary]
|
|
6925
7016
|
);
|
|
@@ -7040,7 +7131,7 @@ var IconLibraryContent = ({
|
|
|
7040
7131
|
}
|
|
7041
7132
|
);
|
|
7042
7133
|
};
|
|
7043
|
-
var IconLibraryLoadingState = () => /* @__PURE__ */ React90.createElement(import_ui73.Stack, { alignItems: "center", justifyContent: "center", height: "100%" }, /* @__PURE__ */ React90.createElement(import_ui73.CircularProgress, { role: "progressbar", size: 24 }));
|
|
7134
|
+
var IconLibraryLoadingState = () => /* @__PURE__ */ React90.createElement(import_ui73.Stack, { alignItems: "center", justifyContent: "center", height: "100%" }, /* @__PURE__ */ React90.createElement(import_ui73.CircularProgress, { role: "progressbar", size: 24, "aria-label": (0, import_i18n38.__)("Loading icons", "elementor") }));
|
|
7044
7135
|
var IconLibraryEmptyState = ({
|
|
7045
7136
|
searchValue,
|
|
7046
7137
|
isCatalogAvailable,
|
|
@@ -7069,7 +7160,14 @@ var IconLibraryRow = (item) => {
|
|
|
7069
7160
|
flexShrink: 0
|
|
7070
7161
|
}
|
|
7071
7162
|
},
|
|
7072
|
-
/* @__PURE__ */ React90.createElement(
|
|
7163
|
+
/* @__PURE__ */ React90.createElement(
|
|
7164
|
+
FontAwesomeGlyph,
|
|
7165
|
+
{
|
|
7166
|
+
icon: { ...icon, value: icon.iconValue },
|
|
7167
|
+
size: ICON_GLYPH_SIZE2,
|
|
7168
|
+
color: "currentColor"
|
|
7169
|
+
}
|
|
7170
|
+
)
|
|
7073
7171
|
), /* @__PURE__ */ React90.createElement(import_ui73.Typography, { variant: "caption", color: "text.primary", noWrap: true }, icon.label));
|
|
7074
7172
|
};
|
|
7075
7173
|
var CatalogUnavailable = () => /* @__PURE__ */ React90.createElement(import_ui73.Stack, { alignItems: "center", justifyContent: "center", height: "100%", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React90.createElement(SvgElementIcon, { fontSize: "large" }), /* @__PURE__ */ React90.createElement(import_ui73.Typography, { align: "center", variant: "subtitle2", color: "text.secondary" }, (0, import_i18n38.__)("Icons couldn't be loaded.", "elementor")));
|
|
@@ -7077,7 +7175,8 @@ var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React90.createElem
|
|
|
7077
7175
|
var createIconLibraryItems = (icons, searchValue, libraries) => filterFontAwesome7Icons(icons, searchValue, libraries).map((icon) => ({
|
|
7078
7176
|
...icon,
|
|
7079
7177
|
type: "item",
|
|
7080
|
-
value: icon.id
|
|
7178
|
+
value: icon.id,
|
|
7179
|
+
iconValue: icon.value
|
|
7081
7180
|
}));
|
|
7082
7181
|
|
|
7083
7182
|
// src/controls/open-icon-library.ts
|
|
@@ -7154,6 +7253,7 @@ var UploadControl = ({ isAdmin, onUpload }) => {
|
|
|
7154
7253
|
|
|
7155
7254
|
// src/controls/svg-media-preview.tsx
|
|
7156
7255
|
var React92 = __toESM(require("react"));
|
|
7256
|
+
var import_react58 = require("react");
|
|
7157
7257
|
var import_ui75 = require("@elementor/ui");
|
|
7158
7258
|
var import_i18n40 = require("@wordpress/i18n");
|
|
7159
7259
|
var ICON_PREVIEW_SIZE = 50;
|
|
@@ -7161,21 +7261,30 @@ var ICON_PREVIEW_COLOR = "#000000";
|
|
|
7161
7261
|
var SvgMediaPreview = ({ isFetching, src, iconClassName, iconLibrary }) => {
|
|
7162
7262
|
const shouldLoadIconCatalog = Boolean(iconClassName && iconLibrary);
|
|
7163
7263
|
const { data: fontAwesomeIcons = [], isLoading: isFontAwesomeLoading } = useFontAwesome7Catalog(shouldLoadIconCatalog);
|
|
7164
|
-
const
|
|
7165
|
-
const
|
|
7264
|
+
const isFontAwesomeLibrary = Boolean(iconLibrary?.startsWith("fa-"));
|
|
7265
|
+
const { data: providerIcons = [], isLoading: isProviderLoading } = useIconLibraryProviderIcons(
|
|
7266
|
+
shouldLoadIconCatalog && !isFontAwesomeLibrary
|
|
7267
|
+
);
|
|
7268
|
+
const icons = (0, import_react58.useMemo)(
|
|
7269
|
+
() => mergeIconsById(fontAwesomeIcons, providerIcons),
|
|
7270
|
+
[fontAwesomeIcons, providerIcons]
|
|
7271
|
+
);
|
|
7166
7272
|
const selectedIcon = findFontAwesome7Icon(icons, iconClassName, iconLibrary);
|
|
7167
|
-
const isLoadingCatalog = shouldLoadIconCatalog && (isFontAwesomeLoading || isProviderLoading);
|
|
7273
|
+
const isLoadingCatalog = shouldLoadIconCatalog && (isFontAwesomeLoading || !isFontAwesomeLibrary && isProviderLoading);
|
|
7168
7274
|
const { data: savedIconSvg, isLoading: isSavedIconLoading } = useProviderIconSvg(
|
|
7169
7275
|
iconLibrary,
|
|
7170
7276
|
iconClassName,
|
|
7171
|
-
shouldLoadIconCatalog && !isLoadingCatalog && !selectedIcon
|
|
7277
|
+
shouldLoadIconCatalog && !isLoadingCatalog && !selectedIcon && !isFontAwesomeLibrary
|
|
7172
7278
|
);
|
|
7173
7279
|
if (isFetching || isLoadingCatalog || isSavedIconLoading) {
|
|
7174
|
-
return /* @__PURE__ */ React92.createElement(import_ui75.CircularProgress, { role: "progressbar" });
|
|
7280
|
+
return /* @__PURE__ */ React92.createElement(import_ui75.CircularProgress, { role: "progressbar", "aria-label": (0, import_i18n40.__)("Loading icon", "elementor") });
|
|
7175
7281
|
}
|
|
7176
7282
|
if (selectedIcon) {
|
|
7177
7283
|
return /* @__PURE__ */ React92.createElement(IconPreview, { icon: selectedIcon });
|
|
7178
7284
|
}
|
|
7285
|
+
if (shouldLoadIconCatalog && iconClassName && iconLibrary && isFontAwesomeLibrary) {
|
|
7286
|
+
return /* @__PURE__ */ React92.createElement(IconPreview, { icon: createLazyIcon(iconLibrary, iconClassName) });
|
|
7287
|
+
}
|
|
7179
7288
|
if (savedIconSvg) {
|
|
7180
7289
|
return /* @__PURE__ */ React92.createElement(IconPreview, { icon: toSvgMarkupIcon(savedIconSvg, iconLibrary, iconClassName) });
|
|
7181
7290
|
}
|
|
@@ -7184,6 +7293,18 @@ var SvgMediaPreview = ({ isFetching, src, iconClassName, iconLibrary }) => {
|
|
|
7184
7293
|
}
|
|
7185
7294
|
return /* @__PURE__ */ React92.createElement(SvgPreview, { src });
|
|
7186
7295
|
};
|
|
7296
|
+
var createLazyIcon = (library, value) => ({
|
|
7297
|
+
id: `${library}:${value}`,
|
|
7298
|
+
name: value,
|
|
7299
|
+
label: value,
|
|
7300
|
+
library,
|
|
7301
|
+
value,
|
|
7302
|
+
aliases: [],
|
|
7303
|
+
width: ICON_PREVIEW_SIZE,
|
|
7304
|
+
height: ICON_PREVIEW_SIZE,
|
|
7305
|
+
paths: [],
|
|
7306
|
+
lazySvg: true
|
|
7307
|
+
});
|
|
7187
7308
|
var toSvgMarkupIcon = (svgMarkup, library, value) => ({
|
|
7188
7309
|
id: `${library}:${value}`,
|
|
7189
7310
|
label: value ?? "",
|
|
@@ -7196,7 +7317,7 @@ var toSvgMarkupIcon = (svgMarkup, library, value) => ({
|
|
|
7196
7317
|
paths: [],
|
|
7197
7318
|
svgMarkup
|
|
7198
7319
|
});
|
|
7199
|
-
var IconPreview = ({ icon }) => /* @__PURE__ */ React92.createElement(import_ui75.Box, { sx: { color: ICON_PREVIEW_COLOR } }, /* @__PURE__ */ React92.createElement(
|
|
7320
|
+
var IconPreview = ({ icon }) => /* @__PURE__ */ React92.createElement(import_ui75.Box, { sx: { color: ICON_PREVIEW_COLOR, minWidth: ICON_PREVIEW_SIZE, minHeight: ICON_PREVIEW_SIZE } }, /* @__PURE__ */ React92.createElement(
|
|
7200
7321
|
FontAwesomeGlyph,
|
|
7201
7322
|
{
|
|
7202
7323
|
icon,
|
|
@@ -7265,11 +7386,11 @@ var SvgMediaControl = createControl(({ showIconLibrary = false, label }) => {
|
|
|
7265
7386
|
const { data: attachment, isFetching } = (0, import_wp_media2.useWpMediaAttachment)(previewSvgValue?.id?.value || null);
|
|
7266
7387
|
const src = attachment?.url ?? previewSvgValue?.url?.value ?? null;
|
|
7267
7388
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
7268
|
-
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0,
|
|
7389
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0, import_react59.useState)(false);
|
|
7269
7390
|
const iconLibraryPopoverState = (0, import_ui76.usePopupState)({ variant: "popover" });
|
|
7270
|
-
const controlContainerRef = (0,
|
|
7271
|
-
const buttonGroupRef = (0,
|
|
7272
|
-
const [iconLibraryAnchor, setIconLibraryAnchor] = (0,
|
|
7391
|
+
const controlContainerRef = (0, import_react59.useRef)(null);
|
|
7392
|
+
const buttonGroupRef = (0, import_react59.useRef)(null);
|
|
7393
|
+
const [iconLibraryAnchor, setIconLibraryAnchor] = (0, import_react59.useState)(null);
|
|
7273
7394
|
const { isAdmin } = (0, import_editor_current_user.useCurrentUserCapabilities)();
|
|
7274
7395
|
const selectedIconClass = showIconLibrary && typeof previewIconValue?.value?.value === "string" ? previewIconValue.value.value : null;
|
|
7275
7396
|
const selectedIconLibrary = showIconLibrary && typeof previewIconValue?.library?.value === "string" ? previewIconValue.library.value : null;
|
|
@@ -7321,7 +7442,7 @@ var SvgMediaControl = createControl(({ showIconLibrary = false, label }) => {
|
|
|
7321
7442
|
setIconLibraryAnchor(anchor);
|
|
7322
7443
|
iconLibraryPopoverState.open(event);
|
|
7323
7444
|
};
|
|
7324
|
-
(0,
|
|
7445
|
+
(0, import_react59.useEffect)(() => {
|
|
7325
7446
|
if (!iconLibraryPopoverState.isOpen) {
|
|
7326
7447
|
return;
|
|
7327
7448
|
}
|
|
@@ -7603,7 +7724,7 @@ var BackgroundImageOverlayAttachment = () => {
|
|
|
7603
7724
|
|
|
7604
7725
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
7605
7726
|
var React97 = __toESM(require("react"));
|
|
7606
|
-
var
|
|
7727
|
+
var import_react60 = require("react");
|
|
7607
7728
|
var import_editor_props38 = require("@elementor/editor-props");
|
|
7608
7729
|
var import_editor_ui14 = require("@elementor/editor-ui");
|
|
7609
7730
|
var import_icons29 = require("@elementor/icons");
|
|
@@ -7625,7 +7746,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
7625
7746
|
const backgroundImageOffsetContext = useBoundProp(import_editor_props38.backgroundImagePositionOffsetPropTypeUtil);
|
|
7626
7747
|
const stringPropContext = useBoundProp(import_editor_props38.stringPropTypeUtil);
|
|
7627
7748
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
7628
|
-
const rowRef = (0,
|
|
7749
|
+
const rowRef = (0, import_react60.useRef)(null);
|
|
7629
7750
|
const handlePositionChange = (event) => {
|
|
7630
7751
|
const value = event.target.value || null;
|
|
7631
7752
|
if (value === "custom") {
|
|
@@ -7698,7 +7819,7 @@ var BackgroundImageOverlayRepeat = () => {
|
|
|
7698
7819
|
|
|
7699
7820
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
7700
7821
|
var React99 = __toESM(require("react"));
|
|
7701
|
-
var
|
|
7822
|
+
var import_react61 = require("react");
|
|
7702
7823
|
var import_editor_props39 = require("@elementor/editor-props");
|
|
7703
7824
|
var import_icons31 = require("@elementor/icons");
|
|
7704
7825
|
var import_ui82 = require("@elementor/ui");
|
|
@@ -7733,7 +7854,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
7733
7854
|
const backgroundImageScaleContext = useBoundProp(import_editor_props39.backgroundImageSizeScalePropTypeUtil);
|
|
7734
7855
|
const stringPropContext = useBoundProp(import_editor_props39.stringPropTypeUtil);
|
|
7735
7856
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
7736
|
-
const rowRef = (0,
|
|
7857
|
+
const rowRef = (0, import_react61.useRef)(null);
|
|
7737
7858
|
const handleSizeChange = (size) => {
|
|
7738
7859
|
if (size === "custom") {
|
|
7739
7860
|
backgroundImageScaleContext.setValue({ width: null, height: null });
|
|
@@ -7768,7 +7889,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
7768
7889
|
};
|
|
7769
7890
|
|
|
7770
7891
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
7771
|
-
var
|
|
7892
|
+
var import_react62 = require("react");
|
|
7772
7893
|
var import_editor_props40 = require("@elementor/editor-props");
|
|
7773
7894
|
var import_ui83 = require("@elementor/ui");
|
|
7774
7895
|
var useBackgroundTabsHistory = ({
|
|
@@ -7789,7 +7910,7 @@ var useBackgroundTabsHistory = ({
|
|
|
7789
7910
|
return "image";
|
|
7790
7911
|
};
|
|
7791
7912
|
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui83.useTabs)(getCurrentOverlayType());
|
|
7792
|
-
const valuesHistory = (0,
|
|
7913
|
+
const valuesHistory = (0, import_react62.useRef)({
|
|
7793
7914
|
image: initialBackgroundImageOverlay,
|
|
7794
7915
|
color: initialBackgroundColorOverlay2,
|
|
7795
7916
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -8040,7 +8161,7 @@ var BackgroundClipField = () => {
|
|
|
8040
8161
|
|
|
8041
8162
|
// src/controls/repeatable-control.tsx
|
|
8042
8163
|
var React102 = __toESM(require("react"));
|
|
8043
|
-
var
|
|
8164
|
+
var import_react63 = require("react");
|
|
8044
8165
|
var import_editor_props43 = require("@elementor/editor-props");
|
|
8045
8166
|
var import_ui86 = require("@elementor/ui");
|
|
8046
8167
|
var PLACEHOLDER_REGEX = /\$\{([^}]+)\}/g;
|
|
@@ -8061,11 +8182,11 @@ var RepeatableControl = createControl(
|
|
|
8061
8182
|
if (!childPropTypeUtil) {
|
|
8062
8183
|
return null;
|
|
8063
8184
|
}
|
|
8064
|
-
const childArrayPropTypeUtil2 = (0,
|
|
8185
|
+
const childArrayPropTypeUtil2 = (0, import_react63.useMemo)(
|
|
8065
8186
|
() => (0, import_editor_props43.createArrayPropUtils)(childPropTypeUtil.key, childPropTypeUtil.schema, propKey),
|
|
8066
8187
|
[childPropTypeUtil.key, childPropTypeUtil.schema, propKey]
|
|
8067
8188
|
);
|
|
8068
|
-
const contextValue = (0,
|
|
8189
|
+
const contextValue = (0, import_react63.useMemo)(
|
|
8069
8190
|
() => ({
|
|
8070
8191
|
...childControlConfig,
|
|
8071
8192
|
placeholder: placeholder || "",
|
|
@@ -8197,7 +8318,7 @@ var getAllProperties = (pattern) => {
|
|
|
8197
8318
|
|
|
8198
8319
|
// src/controls/key-value-control.tsx
|
|
8199
8320
|
var React103 = __toESM(require("react"));
|
|
8200
|
-
var
|
|
8321
|
+
var import_react64 = require("react");
|
|
8201
8322
|
var import_editor_props44 = require("@elementor/editor-props");
|
|
8202
8323
|
var import_ui87 = require("@elementor/ui");
|
|
8203
8324
|
var import_i18n49 = require("@wordpress/i18n");
|
|
@@ -8224,9 +8345,9 @@ var getInitialFieldValue = (fieldValue) => {
|
|
|
8224
8345
|
};
|
|
8225
8346
|
var KeyValueControl = createControl((props = {}) => {
|
|
8226
8347
|
const { value, setValue, ...propContext } = useBoundProp(import_editor_props44.keyValuePropTypeUtil);
|
|
8227
|
-
const [keyError, setKeyError] = (0,
|
|
8228
|
-
const [valueError, setValueError] = (0,
|
|
8229
|
-
const [sessionState, setSessionState] = (0,
|
|
8348
|
+
const [keyError, setKeyError] = (0, import_react64.useState)("");
|
|
8349
|
+
const [valueError, setValueError] = (0, import_react64.useState)("");
|
|
8350
|
+
const [sessionState, setSessionState] = (0, import_react64.useState)({
|
|
8230
8351
|
key: getInitialFieldValue(value?.key),
|
|
8231
8352
|
value: getInitialFieldValue(value?.value)
|
|
8232
8353
|
});
|
|
@@ -8236,7 +8357,7 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
8236
8357
|
keyHelper: void 0,
|
|
8237
8358
|
valueHelper: void 0
|
|
8238
8359
|
};
|
|
8239
|
-
const [keyRegex, valueRegex, errMsg] = (0,
|
|
8360
|
+
const [keyRegex, valueRegex, errMsg] = (0, import_react64.useMemo)(
|
|
8240
8361
|
() => [
|
|
8241
8362
|
props.regexKey ? new RegExp(props.regexKey) : void 0,
|
|
8242
8363
|
props.regexValue ? new RegExp(props.regexValue) : void 0,
|
|
@@ -8368,7 +8489,7 @@ var PositionControl = () => {
|
|
|
8368
8489
|
|
|
8369
8490
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
8370
8491
|
var React117 = __toESM(require("react"));
|
|
8371
|
-
var
|
|
8492
|
+
var import_react72 = require("react");
|
|
8372
8493
|
var import_editor_props54 = require("@elementor/editor-props");
|
|
8373
8494
|
var import_icons39 = require("@elementor/icons");
|
|
8374
8495
|
var import_ui101 = require("@elementor/ui");
|
|
@@ -8427,7 +8548,7 @@ var import_i18n55 = require("@wordpress/i18n");
|
|
|
8427
8548
|
|
|
8428
8549
|
// src/controls/transform-control/functions/move.tsx
|
|
8429
8550
|
var React106 = __toESM(require("react"));
|
|
8430
|
-
var
|
|
8551
|
+
var import_react65 = require("react");
|
|
8431
8552
|
var import_editor_props47 = require("@elementor/editor-props");
|
|
8432
8553
|
var import_icons33 = require("@elementor/icons");
|
|
8433
8554
|
var import_ui90 = require("@elementor/ui");
|
|
@@ -8474,7 +8595,7 @@ var moveAxisControls = [
|
|
|
8474
8595
|
];
|
|
8475
8596
|
var Move = () => {
|
|
8476
8597
|
const context = useBoundProp(import_editor_props47.moveTransformPropTypeUtil);
|
|
8477
|
-
const rowRefs = [(0,
|
|
8598
|
+
const rowRefs = [(0, import_react65.useRef)(null), (0, import_react65.useRef)(null), (0, import_react65.useRef)(null)];
|
|
8478
8599
|
return /* @__PURE__ */ React106.createElement(import_ui90.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React106.createElement(PropProvider, { ...context }, /* @__PURE__ */ React106.createElement(PropKeyProvider, { bind: TransformFunctionKeys.move }, moveAxisControls.map((control, index) => /* @__PURE__ */ React106.createElement(
|
|
8479
8600
|
AxisRow,
|
|
8480
8601
|
{
|
|
@@ -8489,7 +8610,7 @@ var Move = () => {
|
|
|
8489
8610
|
|
|
8490
8611
|
// src/controls/transform-control/functions/rotate.tsx
|
|
8491
8612
|
var React107 = __toESM(require("react"));
|
|
8492
|
-
var
|
|
8613
|
+
var import_react66 = require("react");
|
|
8493
8614
|
var import_editor_props48 = require("@elementor/editor-props");
|
|
8494
8615
|
var import_icons34 = require("@elementor/icons");
|
|
8495
8616
|
var import_ui91 = require("@elementor/ui");
|
|
@@ -8514,7 +8635,7 @@ var rotateAxisControls = [
|
|
|
8514
8635
|
var rotateUnits = ["deg", "rad", "grad", "turn"];
|
|
8515
8636
|
var Rotate = () => {
|
|
8516
8637
|
const context = useBoundProp(import_editor_props48.rotateTransformPropTypeUtil);
|
|
8517
|
-
const rowRefs = [(0,
|
|
8638
|
+
const rowRefs = [(0, import_react66.useRef)(null), (0, import_react66.useRef)(null), (0, import_react66.useRef)(null)];
|
|
8518
8639
|
return /* @__PURE__ */ React107.createElement(import_ui91.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React107.createElement(PropProvider, { ...context }, /* @__PURE__ */ React107.createElement(PropKeyProvider, { bind: TransformFunctionKeys.rotate }, rotateAxisControls.map((control, index) => /* @__PURE__ */ React107.createElement(
|
|
8519
8640
|
AxisRow,
|
|
8520
8641
|
{
|
|
@@ -8528,7 +8649,7 @@ var Rotate = () => {
|
|
|
8528
8649
|
|
|
8529
8650
|
// src/controls/transform-control/functions/scale.tsx
|
|
8530
8651
|
var React109 = __toESM(require("react"));
|
|
8531
|
-
var
|
|
8652
|
+
var import_react67 = require("react");
|
|
8532
8653
|
var import_editor_props49 = require("@elementor/editor-props");
|
|
8533
8654
|
var import_icons35 = require("@elementor/icons");
|
|
8534
8655
|
var import_ui93 = require("@elementor/ui");
|
|
@@ -8561,13 +8682,13 @@ var scaleAxisControls = [
|
|
|
8561
8682
|
];
|
|
8562
8683
|
var Scale = () => {
|
|
8563
8684
|
const context = useBoundProp(import_editor_props49.scaleTransformPropTypeUtil);
|
|
8564
|
-
const rowRefs = [(0,
|
|
8685
|
+
const rowRefs = [(0, import_react67.useRef)(null), (0, import_react67.useRef)(null), (0, import_react67.useRef)(null)];
|
|
8565
8686
|
return /* @__PURE__ */ React109.createElement(import_ui93.Grid, { 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] })))));
|
|
8566
8687
|
};
|
|
8567
8688
|
|
|
8568
8689
|
// src/controls/transform-control/functions/skew.tsx
|
|
8569
8690
|
var React110 = __toESM(require("react"));
|
|
8570
|
-
var
|
|
8691
|
+
var import_react68 = require("react");
|
|
8571
8692
|
var import_editor_props50 = require("@elementor/editor-props");
|
|
8572
8693
|
var import_icons36 = require("@elementor/icons");
|
|
8573
8694
|
var import_ui94 = require("@elementor/ui");
|
|
@@ -8587,7 +8708,7 @@ var skewAxisControls = [
|
|
|
8587
8708
|
var skewUnits = ["deg", "rad", "grad", "turn"];
|
|
8588
8709
|
var Skew = () => {
|
|
8589
8710
|
const context = useBoundProp(import_editor_props50.skewTransformPropTypeUtil);
|
|
8590
|
-
const rowRefs = [(0,
|
|
8711
|
+
const rowRefs = [(0, import_react68.useRef)(null), (0, import_react68.useRef)(null), (0, import_react68.useRef)(null)];
|
|
8591
8712
|
return /* @__PURE__ */ React110.createElement(import_ui94.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React110.createElement(PropProvider, { ...context }, /* @__PURE__ */ React110.createElement(PropKeyProvider, { bind: TransformFunctionKeys.skew }, skewAxisControls.map((control, index) => /* @__PURE__ */ React110.createElement(
|
|
8592
8713
|
AxisRow,
|
|
8593
8714
|
{
|
|
@@ -8600,7 +8721,7 @@ var Skew = () => {
|
|
|
8600
8721
|
};
|
|
8601
8722
|
|
|
8602
8723
|
// src/controls/transform-control/use-transform-tabs-history.tsx
|
|
8603
|
-
var
|
|
8724
|
+
var import_react69 = require("react");
|
|
8604
8725
|
var import_editor_props51 = require("@elementor/editor-props");
|
|
8605
8726
|
var import_ui95 = require("@elementor/ui");
|
|
8606
8727
|
var useTransformTabsHistory = ({
|
|
@@ -8627,7 +8748,7 @@ var useTransformTabsHistory = ({
|
|
|
8627
8748
|
}
|
|
8628
8749
|
};
|
|
8629
8750
|
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui95.useTabs)(getCurrentTransformType());
|
|
8630
|
-
const valuesHistory = (0,
|
|
8751
|
+
const valuesHistory = (0, import_react69.useRef)({
|
|
8631
8752
|
move: initialMove,
|
|
8632
8753
|
scale: initialScale,
|
|
8633
8754
|
rotate: initialRotate,
|
|
@@ -8771,7 +8892,7 @@ var import_i18n59 = require("@wordpress/i18n");
|
|
|
8771
8892
|
|
|
8772
8893
|
// src/controls/transform-control/transform-base-controls/children-perspective-control.tsx
|
|
8773
8894
|
var React114 = __toESM(require("react"));
|
|
8774
|
-
var
|
|
8895
|
+
var import_react70 = require("react");
|
|
8775
8896
|
var import_editor_props52 = require("@elementor/editor-props");
|
|
8776
8897
|
var import_ui98 = require("@elementor/ui");
|
|
8777
8898
|
var import_i18n57 = require("@wordpress/i18n");
|
|
@@ -8803,13 +8924,13 @@ var PerspectiveOriginControlProvider = () => {
|
|
|
8803
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 }))));
|
|
8804
8925
|
};
|
|
8805
8926
|
var ControlFields = ({ control }) => {
|
|
8806
|
-
const rowRef = (0,
|
|
8927
|
+
const rowRef = (0, import_react70.useRef)(null);
|
|
8807
8928
|
return /* @__PURE__ */ React114.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React114.createElement(import_ui98.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React114.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ React114.createElement(import_ui98.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React114.createElement(SizeControl, { variant: "length", units: control.units, anchorRef: rowRef, disableCustom: true })));
|
|
8808
8929
|
};
|
|
8809
8930
|
|
|
8810
8931
|
// src/controls/transform-control/transform-base-controls/transform-origin-control.tsx
|
|
8811
8932
|
var React115 = __toESM(require("react"));
|
|
8812
|
-
var
|
|
8933
|
+
var import_react71 = require("react");
|
|
8813
8934
|
var import_editor_props53 = require("@elementor/editor-props");
|
|
8814
8935
|
var import_ui99 = require("@elementor/ui");
|
|
8815
8936
|
var import_i18n58 = require("@wordpress/i18n");
|
|
@@ -8837,7 +8958,7 @@ var TransformOriginControl = () => {
|
|
|
8837
8958
|
};
|
|
8838
8959
|
var ControlFields2 = ({ control }) => {
|
|
8839
8960
|
const context = useBoundProp(import_editor_props53.transformOriginPropTypeUtil);
|
|
8840
|
-
const rowRef = (0,
|
|
8961
|
+
const rowRef = (0, import_react71.useRef)(null);
|
|
8841
8962
|
return /* @__PURE__ */ React115.createElement(PropProvider, { ...context }, /* @__PURE__ */ React115.createElement(PropKeyProvider, { bind: control.bind }, /* @__PURE__ */ React115.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React115.createElement(import_ui99.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React115.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ React115.createElement(import_ui99.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React115.createElement(SizeControl, { variant: "length", units: control.units, anchorRef: rowRef })))));
|
|
8842
8963
|
};
|
|
8843
8964
|
|
|
@@ -8885,7 +9006,7 @@ var SIZE11 = "tiny";
|
|
|
8885
9006
|
var TransformRepeaterControl = createControl(
|
|
8886
9007
|
({ showChildrenPerspective }) => {
|
|
8887
9008
|
const context = useBoundProp(import_editor_props54.transformPropTypeUtil);
|
|
8888
|
-
const headerRef = (0,
|
|
9009
|
+
const headerRef = (0, import_react72.useRef)(null);
|
|
8889
9010
|
const popupState = (0, import_ui101.usePopupState)({ variant: "popover" });
|
|
8890
9011
|
return /* @__PURE__ */ React117.createElement(PropProvider, { ...context }, /* @__PURE__ */ React117.createElement(
|
|
8891
9012
|
TransformSettingsControl,
|
|
@@ -8965,7 +9086,7 @@ var TransformBasePopoverTrigger = ({
|
|
|
8965
9086
|
|
|
8966
9087
|
// src/controls/transition-control/transition-repeater-control.tsx
|
|
8967
9088
|
var React120 = __toESM(require("react"));
|
|
8968
|
-
var
|
|
9089
|
+
var import_react75 = require("react");
|
|
8969
9090
|
var import_editor_props57 = require("@elementor/editor-props");
|
|
8970
9091
|
var import_icons41 = require("@elementor/icons");
|
|
8971
9092
|
var import_ui104 = require("@elementor/ui");
|
|
@@ -8974,15 +9095,15 @@ var import_i18n63 = require("@wordpress/i18n");
|
|
|
8974
9095
|
|
|
8975
9096
|
// src/controls/selection-size-control.tsx
|
|
8976
9097
|
var React118 = __toESM(require("react"));
|
|
8977
|
-
var
|
|
9098
|
+
var import_react73 = require("react");
|
|
8978
9099
|
var import_editor_props55 = require("@elementor/editor-props");
|
|
8979
9100
|
var import_ui102 = require("@elementor/ui");
|
|
8980
9101
|
var SelectionSizeControl = createControl(
|
|
8981
9102
|
({ selectionLabel, sizeLabel, selectionConfig, sizeConfigMap }) => {
|
|
8982
9103
|
const { value, setValue, propType } = useBoundProp(import_editor_props55.selectionSizePropTypeUtil);
|
|
8983
|
-
const rowRef = (0,
|
|
9104
|
+
const rowRef = (0, import_react73.useRef)(null);
|
|
8984
9105
|
const sizeFieldId = sizeLabel.replace(/\s+/g, "-").toLowerCase();
|
|
8985
|
-
const currentSizeConfig = (0,
|
|
9106
|
+
const currentSizeConfig = (0, import_react73.useMemo)(() => {
|
|
8986
9107
|
switch (value.selection.$$type) {
|
|
8987
9108
|
case "key-value":
|
|
8988
9109
|
return sizeConfigMap[value?.selection?.value.value.value || ""];
|
|
@@ -9195,7 +9316,7 @@ function subscribeToTransitionEvent() {
|
|
|
9195
9316
|
|
|
9196
9317
|
// src/controls/transition-control/transition-selector.tsx
|
|
9197
9318
|
var React119 = __toESM(require("react"));
|
|
9198
|
-
var
|
|
9319
|
+
var import_react74 = require("react");
|
|
9199
9320
|
var import_editor_props56 = require("@elementor/editor-props");
|
|
9200
9321
|
var import_editor_ui17 = require("@elementor/editor-ui");
|
|
9201
9322
|
var import_icons40 = require("@elementor/icons");
|
|
@@ -9241,9 +9362,9 @@ var TransitionSelector = ({
|
|
|
9241
9362
|
const {
|
|
9242
9363
|
key: { value: transitionLabel }
|
|
9243
9364
|
} = value;
|
|
9244
|
-
const defaultRef = (0,
|
|
9365
|
+
const defaultRef = (0, import_react74.useRef)(null);
|
|
9245
9366
|
const popoverState = (0, import_ui103.usePopupState)({ variant: "popover" });
|
|
9246
|
-
const disabledCategories = (0,
|
|
9367
|
+
const disabledCategories = (0, import_react74.useMemo)(() => {
|
|
9247
9368
|
return new Set(
|
|
9248
9369
|
transitionProperties.filter((cat) => cat.properties.some((prop) => prop.isDisabled)).map((cat) => cat.label)
|
|
9249
9370
|
);
|
|
@@ -9469,14 +9590,14 @@ var TransitionRepeaterControl = createControl(
|
|
|
9469
9590
|
currentStyleState
|
|
9470
9591
|
}) => {
|
|
9471
9592
|
const currentStyleIsNormal = currentStyleState === null;
|
|
9472
|
-
const [recentlyUsedList, setRecentlyUsedList] = (0,
|
|
9593
|
+
const [recentlyUsedList, setRecentlyUsedList] = (0, import_react75.useState)([]);
|
|
9473
9594
|
const proInstalled = (0, import_utils8.hasProInstalled)();
|
|
9474
9595
|
const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
9475
|
-
const { allDisabled: disabledItems, proDisabled: proDisabledItems } = (0,
|
|
9596
|
+
const { allDisabled: disabledItems, proDisabled: proDisabledItems } = (0, import_react75.useMemo)(
|
|
9476
9597
|
() => getDisabledItemLabels(value),
|
|
9477
9598
|
[value]
|
|
9478
9599
|
);
|
|
9479
|
-
const allowedTransitionSet = (0,
|
|
9600
|
+
const allowedTransitionSet = (0, import_react75.useMemo)(() => {
|
|
9480
9601
|
const set = /* @__PURE__ */ new Set();
|
|
9481
9602
|
transitionProperties.forEach((category) => {
|
|
9482
9603
|
category.properties.forEach((prop) => {
|
|
@@ -9487,7 +9608,7 @@ var TransitionRepeaterControl = createControl(
|
|
|
9487
9608
|
});
|
|
9488
9609
|
return set;
|
|
9489
9610
|
}, [proInstalled]);
|
|
9490
|
-
(0,
|
|
9611
|
+
(0, import_react75.useEffect)(() => {
|
|
9491
9612
|
if (!value || value.length === 0) {
|
|
9492
9613
|
return;
|
|
9493
9614
|
}
|
|
@@ -9499,10 +9620,10 @@ var TransitionRepeaterControl = createControl(
|
|
|
9499
9620
|
setValue(sanitized);
|
|
9500
9621
|
}
|
|
9501
9622
|
}, [allowedTransitionSet]);
|
|
9502
|
-
(0,
|
|
9623
|
+
(0, import_react75.useEffect)(() => {
|
|
9503
9624
|
recentlyUsedListGetter().then(setRecentlyUsedList);
|
|
9504
9625
|
}, [recentlyUsedListGetter]);
|
|
9505
|
-
const allPropertiesUsed = (0,
|
|
9626
|
+
const allPropertiesUsed = (0, import_react75.useMemo)(() => areAllPropertiesUsed(value), [value]);
|
|
9506
9627
|
const isAddItemDisabled = !currentStyleIsNormal || allPropertiesUsed;
|
|
9507
9628
|
return /* @__PURE__ */ React120.createElement(
|
|
9508
9629
|
RepeatableControl,
|
|
@@ -9785,13 +9906,13 @@ var BoundTimeStringControl = ({ bind, ariaLabel }) => {
|
|
|
9785
9906
|
|
|
9786
9907
|
// src/controls/inline-editing-control.tsx
|
|
9787
9908
|
var React129 = __toESM(require("react"));
|
|
9788
|
-
var
|
|
9909
|
+
var import_react81 = require("react");
|
|
9789
9910
|
var import_editor_props65 = require("@elementor/editor-props");
|
|
9790
9911
|
var import_ui113 = require("@elementor/ui");
|
|
9791
9912
|
|
|
9792
9913
|
// src/components/inline-editor.tsx
|
|
9793
9914
|
var React126 = __toESM(require("react"));
|
|
9794
|
-
var
|
|
9915
|
+
var import_react76 = require("react");
|
|
9795
9916
|
var import_ui110 = require("@elementor/ui");
|
|
9796
9917
|
var import_extension_bold = __toESM(require("@tiptap/extension-bold"));
|
|
9797
9918
|
var import_extension_document = __toESM(require("@tiptap/extension-document"));
|
|
@@ -9805,7 +9926,7 @@ var import_extension_subscript = __toESM(require("@tiptap/extension-subscript"))
|
|
|
9805
9926
|
var import_extension_superscript = __toESM(require("@tiptap/extension-superscript"));
|
|
9806
9927
|
var import_extension_text = __toESM(require("@tiptap/extension-text"));
|
|
9807
9928
|
var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
|
|
9808
|
-
var
|
|
9929
|
+
var import_react77 = require("@tiptap/react");
|
|
9809
9930
|
|
|
9810
9931
|
// src/utils/inline-editing.ts
|
|
9811
9932
|
var import_editor_props64 = require("@elementor/editor-props");
|
|
@@ -9854,8 +9975,8 @@ var InlineEditor = React126.forwardRef((props, ref) => {
|
|
|
9854
9975
|
onSelectionEnd,
|
|
9855
9976
|
mountElement = null
|
|
9856
9977
|
} = props;
|
|
9857
|
-
const containerRef = (0,
|
|
9858
|
-
const onBlurRef = (0,
|
|
9978
|
+
const containerRef = (0, import_react76.useRef)(null);
|
|
9979
|
+
const onBlurRef = (0, import_react76.useRef)(onBlur);
|
|
9859
9980
|
onBlurRef.current = onBlur;
|
|
9860
9981
|
const documentContentSettings = !!expectedTag ? "block+" : "inline*";
|
|
9861
9982
|
const onUpdate = ({ editor: updatedEditor }) => {
|
|
@@ -9877,7 +9998,7 @@ var InlineEditor = React126.forwardRef((props, ref) => {
|
|
|
9877
9998
|
...HTMLAttributes,
|
|
9878
9999
|
class: elementClasses
|
|
9879
10000
|
});
|
|
9880
|
-
const editor = (0,
|
|
10001
|
+
const editor = (0, import_react77.useEditor)({
|
|
9881
10002
|
...mountElement ? { element: mountElement } : {},
|
|
9882
10003
|
extensions: [
|
|
9883
10004
|
import_extension_document.default.extend({
|
|
@@ -9950,11 +10071,11 @@ var InlineEditor = React126.forwardRef((props, ref) => {
|
|
|
9950
10071
|
if (mountElement) {
|
|
9951
10072
|
return null;
|
|
9952
10073
|
}
|
|
9953
|
-
return /* @__PURE__ */ React126.createElement(import_ui110.Box, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React126.createElement(
|
|
10074
|
+
return /* @__PURE__ */ React126.createElement(import_ui110.Box, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React126.createElement(import_react77.EditorContent, { ref, editor }));
|
|
9954
10075
|
});
|
|
9955
10076
|
var useOnUpdate = (callback, dependencies) => {
|
|
9956
|
-
const hasMounted = (0,
|
|
9957
|
-
(0,
|
|
10077
|
+
const hasMounted = (0, import_react76.useRef)(false);
|
|
10078
|
+
(0, import_react76.useEffect)(() => {
|
|
9958
10079
|
if (hasMounted.current) {
|
|
9959
10080
|
callback();
|
|
9960
10081
|
} else {
|
|
@@ -9965,16 +10086,16 @@ var useOnUpdate = (callback, dependencies) => {
|
|
|
9965
10086
|
|
|
9966
10087
|
// src/components/inline-editor-toolbar.tsx
|
|
9967
10088
|
var React128 = __toESM(require("react"));
|
|
9968
|
-
var
|
|
10089
|
+
var import_react79 = require("react");
|
|
9969
10090
|
var import_editor_elements7 = require("@elementor/editor-elements");
|
|
9970
10091
|
var import_icons43 = require("@elementor/icons");
|
|
9971
10092
|
var import_ui112 = require("@elementor/ui");
|
|
9972
|
-
var
|
|
10093
|
+
var import_react80 = require("@tiptap/react");
|
|
9973
10094
|
var import_i18n67 = require("@wordpress/i18n");
|
|
9974
10095
|
|
|
9975
10096
|
// src/components/url-popover.tsx
|
|
9976
10097
|
var React127 = __toESM(require("react"));
|
|
9977
|
-
var
|
|
10098
|
+
var import_react78 = require("react");
|
|
9978
10099
|
var import_icons42 = require("@elementor/icons");
|
|
9979
10100
|
var import_ui111 = require("@elementor/ui");
|
|
9980
10101
|
var import_i18n66 = require("@wordpress/i18n");
|
|
@@ -9987,8 +10108,8 @@ var UrlPopover = ({
|
|
|
9987
10108
|
openInNewTab,
|
|
9988
10109
|
onToggleNewTab
|
|
9989
10110
|
}) => {
|
|
9990
|
-
const inputRef = (0,
|
|
9991
|
-
(0,
|
|
10111
|
+
const inputRef = (0, import_react78.useRef)(null);
|
|
10112
|
+
(0, import_react78.useEffect)(() => {
|
|
9992
10113
|
if (popupState.isOpen) {
|
|
9993
10114
|
requestAnimationFrame(() => inputRef.current?.focus());
|
|
9994
10115
|
}
|
|
@@ -10043,16 +10164,16 @@ var InlineEditorToolbar = ({
|
|
|
10043
10164
|
sx = {},
|
|
10044
10165
|
inControlPanel = false
|
|
10045
10166
|
}) => {
|
|
10046
|
-
const [urlValue, setUrlValue] = (0,
|
|
10047
|
-
const [openInNewTab, setOpenInNewTab] = (0,
|
|
10048
|
-
const toolbarRef = (0,
|
|
10167
|
+
const [urlValue, setUrlValue] = (0, import_react79.useState)("");
|
|
10168
|
+
const [openInNewTab, setOpenInNewTab] = (0, import_react79.useState)(false);
|
|
10169
|
+
const toolbarRef = (0, import_react79.useRef)(null);
|
|
10049
10170
|
const linkPopupState = (0, import_ui112.usePopupState)({ variant: "popover" });
|
|
10050
10171
|
const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
|
|
10051
|
-
const editorState = (0,
|
|
10172
|
+
const editorState = (0, import_react80.useEditorState)({
|
|
10052
10173
|
editor,
|
|
10053
10174
|
selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
|
|
10054
10175
|
});
|
|
10055
|
-
const formatButtonsList = (0,
|
|
10176
|
+
const formatButtonsList = (0, import_react79.useMemo)(() => {
|
|
10056
10177
|
const buttons = Object.values(formatButtons);
|
|
10057
10178
|
if (isElementClickable) {
|
|
10058
10179
|
return buttons.filter((button) => button.action !== "link");
|
|
@@ -10089,7 +10210,7 @@ var InlineEditorToolbar = ({
|
|
|
10089
10210
|
}
|
|
10090
10211
|
linkPopupState.close();
|
|
10091
10212
|
};
|
|
10092
|
-
(0,
|
|
10213
|
+
(0, import_react79.useEffect)(() => {
|
|
10093
10214
|
if (!inControlPanel) {
|
|
10094
10215
|
editor?.commands?.focus();
|
|
10095
10216
|
}
|
|
@@ -10271,8 +10392,8 @@ var InlineEditingControl = createControl(
|
|
|
10271
10392
|
const { setValue, placeholder, value } = useBoundProp(import_editor_props65.escapedHtmlPropTypeUtil);
|
|
10272
10393
|
const { value: rawValue } = usePropKeyContext();
|
|
10273
10394
|
const content = value ?? extractInlineHtmlContent(rawValue);
|
|
10274
|
-
const [editor, setEditor] = (0,
|
|
10275
|
-
const handleChange = (0,
|
|
10395
|
+
const [editor, setEditor] = (0, import_react81.useState)(null);
|
|
10396
|
+
const handleChange = (0, import_react81.useCallback)(
|
|
10276
10397
|
(newValue) => {
|
|
10277
10398
|
const html = newValue ?? "";
|
|
10278
10399
|
setValue(html);
|
|
@@ -10459,7 +10580,7 @@ function useFormFieldSuggestions(options) {
|
|
|
10459
10580
|
|
|
10460
10581
|
// src/controls/email-form-action-control/email-chips-field.tsx
|
|
10461
10582
|
var React130 = __toESM(require("react"));
|
|
10462
|
-
var
|
|
10583
|
+
var import_react82 = require("react");
|
|
10463
10584
|
var import_editor_props67 = require("@elementor/editor-props");
|
|
10464
10585
|
var import_ui114 = require("@elementor/ui");
|
|
10465
10586
|
|
|
@@ -10497,10 +10618,10 @@ function resolveMention(raw, suggestions) {
|
|
|
10497
10618
|
}
|
|
10498
10619
|
var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
|
|
10499
10620
|
const { value, setValue, disabled } = useBoundProp(import_editor_props67.stringArrayPropTypeUtil);
|
|
10500
|
-
const [inputValue, setInputValue] = (0,
|
|
10621
|
+
const [inputValue, setInputValue] = (0, import_react82.useState)("");
|
|
10501
10622
|
const items2 = value || [];
|
|
10502
10623
|
const selectedValues = items2.map((item) => import_editor_props67.stringPropTypeUtil.extract(item)).filter((val) => val !== null);
|
|
10503
|
-
const suggestionOptions = (0,
|
|
10624
|
+
const suggestionOptions = (0, import_react82.useMemo)(
|
|
10504
10625
|
() => suggestions.map((suggestion) => `[${suggestion.value}]`),
|
|
10505
10626
|
[suggestions]
|
|
10506
10627
|
);
|
|
@@ -10728,24 +10849,24 @@ var GridSpanControl = createControl(
|
|
|
10728
10849
|
|
|
10729
10850
|
// src/components/promotions/display-conditions-control.tsx
|
|
10730
10851
|
var React137 = __toESM(require("react"));
|
|
10731
|
-
var
|
|
10852
|
+
var import_react84 = require("react");
|
|
10732
10853
|
var import_icons44 = require("@elementor/icons");
|
|
10733
10854
|
var import_ui121 = require("@elementor/ui");
|
|
10734
10855
|
var import_i18n71 = require("@wordpress/i18n");
|
|
10735
10856
|
|
|
10736
10857
|
// src/components/promotions/promotion-trigger.tsx
|
|
10737
10858
|
var React136 = __toESM(require("react"));
|
|
10738
|
-
var
|
|
10859
|
+
var import_react83 = require("react");
|
|
10739
10860
|
var import_editor_ui21 = require("@elementor/editor-ui");
|
|
10740
10861
|
var import_ui120 = require("@elementor/ui");
|
|
10741
10862
|
function getV4Promotion(key) {
|
|
10742
10863
|
return window.elementor?.config?.v4Promotions?.[key];
|
|
10743
10864
|
}
|
|
10744
|
-
var PromotionTrigger = (0,
|
|
10865
|
+
var PromotionTrigger = (0, import_react83.forwardRef)(
|
|
10745
10866
|
({ promotionKey, children, trackingData }, ref) => {
|
|
10746
|
-
const [isOpen, setIsOpen] = (0,
|
|
10867
|
+
const [isOpen, setIsOpen] = (0, import_react83.useState)(false);
|
|
10747
10868
|
const promotion = getV4Promotion(promotionKey);
|
|
10748
|
-
const toggle = (0,
|
|
10869
|
+
const toggle = (0, import_react83.useCallback)(() => {
|
|
10749
10870
|
setIsOpen((prev) => {
|
|
10750
10871
|
if (!prev) {
|
|
10751
10872
|
trackViewPromotion(trackingData);
|
|
@@ -10753,7 +10874,7 @@ var PromotionTrigger = (0, import_react81.forwardRef)(
|
|
|
10753
10874
|
return !prev;
|
|
10754
10875
|
});
|
|
10755
10876
|
}, [trackingData]);
|
|
10756
|
-
(0,
|
|
10877
|
+
(0, import_react83.useImperativeHandle)(ref, () => ({ toggle }), [toggle]);
|
|
10757
10878
|
return /* @__PURE__ */ React136.createElement(React136.Fragment, null, promotion && /* @__PURE__ */ React136.createElement(
|
|
10758
10879
|
import_editor_ui21.PromotionInfotip,
|
|
10759
10880
|
{
|
|
@@ -10787,7 +10908,7 @@ var PromotionTrigger = (0, import_react81.forwardRef)(
|
|
|
10787
10908
|
var ARIA_LABEL = (0, import_i18n71.__)("Display Conditions", "elementor");
|
|
10788
10909
|
var TRACKING_DATA2 = { target_name: "display_conditions", location_l2: "general" };
|
|
10789
10910
|
var DisplayConditionsControl = createControl(() => {
|
|
10790
|
-
const triggerRef = (0,
|
|
10911
|
+
const triggerRef = (0, import_react84.useRef)(null);
|
|
10791
10912
|
return /* @__PURE__ */ React137.createElement(
|
|
10792
10913
|
import_ui121.Stack,
|
|
10793
10914
|
{
|
|
@@ -10819,14 +10940,14 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
10819
10940
|
|
|
10820
10941
|
// src/components/promotions/attributes-control.tsx
|
|
10821
10942
|
var React138 = __toESM(require("react"));
|
|
10822
|
-
var
|
|
10943
|
+
var import_react85 = require("react");
|
|
10823
10944
|
var import_icons45 = require("@elementor/icons");
|
|
10824
10945
|
var import_ui122 = require("@elementor/ui");
|
|
10825
10946
|
var import_i18n72 = require("@wordpress/i18n");
|
|
10826
10947
|
var ARIA_LABEL2 = (0, import_i18n72.__)("Attributes", "elementor");
|
|
10827
10948
|
var TRACKING_DATA3 = { target_name: "attributes", location_l2: "general" };
|
|
10828
10949
|
var AttributesControl = createControl(() => {
|
|
10829
|
-
const triggerRef = (0,
|
|
10950
|
+
const triggerRef = (0, import_react85.useRef)(null);
|
|
10830
10951
|
return /* @__PURE__ */ React138.createElement(
|
|
10831
10952
|
import_ui122.Stack,
|
|
10832
10953
|
{
|
|
@@ -10863,7 +10984,7 @@ var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /*
|
|
|
10863
10984
|
|
|
10864
10985
|
// src/components/repeater/repeater.tsx
|
|
10865
10986
|
var React140 = __toESM(require("react"));
|
|
10866
|
-
var
|
|
10987
|
+
var import_react86 = require("react");
|
|
10867
10988
|
var import_icons47 = require("@elementor/icons");
|
|
10868
10989
|
var import_ui124 = require("@elementor/ui");
|
|
10869
10990
|
var import_i18n73 = require("@wordpress/i18n");
|
|
@@ -10885,7 +11006,7 @@ var Repeater3 = ({
|
|
|
10885
11006
|
isSortable = true,
|
|
10886
11007
|
adornment = ControlAdornments
|
|
10887
11008
|
}) => {
|
|
10888
|
-
const [openItem, setOpenItem] = (0,
|
|
11009
|
+
const [openItem, setOpenItem] = (0, import_react86.useState)(initialOpenItem);
|
|
10889
11010
|
const uniqueKeys = items2.map(
|
|
10890
11011
|
(item, index) => isSortable && "getId" in itemSettings ? itemSettings.getId({ item, index }) : String(index)
|
|
10891
11012
|
);
|
|
@@ -11061,10 +11182,10 @@ var RepeaterItem = ({
|
|
|
11061
11182
|
), /* @__PURE__ */ React140.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React140.createElement(import_ui124.Box, null, children({ anchorEl: ref }))));
|
|
11062
11183
|
};
|
|
11063
11184
|
var usePopover = (openOnMount, onOpen, onPopoverClose) => {
|
|
11064
|
-
const [ref, setRef] = (0,
|
|
11185
|
+
const [ref, setRef] = (0, import_react86.useState)(null);
|
|
11065
11186
|
const popoverState = (0, import_ui124.usePopupState)({ variant: "popover" });
|
|
11066
11187
|
const popoverProps = (0, import_ui124.bindPopover)(popoverState);
|
|
11067
|
-
(0,
|
|
11188
|
+
(0, import_react86.useEffect)(() => {
|
|
11068
11189
|
if (openOnMount && ref) {
|
|
11069
11190
|
popoverState.open(ref);
|
|
11070
11191
|
onOpen?.();
|
|
@@ -11127,7 +11248,7 @@ var differsFromExternal = (newState, externalState) => {
|
|
|
11127
11248
|
|
|
11128
11249
|
// src/components/size/unit-select.tsx
|
|
11129
11250
|
var React141 = __toESM(require("react"));
|
|
11130
|
-
var
|
|
11251
|
+
var import_react87 = require("react");
|
|
11131
11252
|
var import_editor_ui22 = require("@elementor/editor-ui");
|
|
11132
11253
|
var import_ui125 = require("@elementor/ui");
|
|
11133
11254
|
var menuItemContentStyles2 = {
|
|
@@ -11138,7 +11259,7 @@ var menuItemContentStyles2 = {
|
|
|
11138
11259
|
var UnitSelect = ({ value, showPrimaryColor, onClick, options }) => {
|
|
11139
11260
|
const popupState = (0, import_ui125.usePopupState)({
|
|
11140
11261
|
variant: "popover",
|
|
11141
|
-
popupId: (0,
|
|
11262
|
+
popupId: (0, import_react87.useId)()
|
|
11142
11263
|
});
|
|
11143
11264
|
const handleMenuItemClick = (index) => {
|
|
11144
11265
|
onClick(options[index]);
|
|
@@ -11174,8 +11295,8 @@ var StyledButton3 = (0, import_ui125.styled)(import_ui125.Button, {
|
|
|
11174
11295
|
|
|
11175
11296
|
// src/components/size/unstable-size-input.tsx
|
|
11176
11297
|
var React142 = __toESM(require("react"));
|
|
11177
|
-
var
|
|
11178
|
-
var UnstableSizeInput = (0,
|
|
11298
|
+
var import_react88 = require("react");
|
|
11299
|
+
var UnstableSizeInput = (0, import_react88.forwardRef)(
|
|
11179
11300
|
({ type, value, onChange, onKeyDown, onKeyUp, InputProps, onBlur, focused, disabled }, ref) => {
|
|
11180
11301
|
return /* @__PURE__ */ React142.createElement(
|
|
11181
11302
|
NumberInput,
|
|
@@ -11243,7 +11364,7 @@ var hasValue = (value) => {
|
|
|
11243
11364
|
};
|
|
11244
11365
|
|
|
11245
11366
|
// src/hooks/use-font-families.ts
|
|
11246
|
-
var
|
|
11367
|
+
var import_react89 = require("react");
|
|
11247
11368
|
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
11248
11369
|
var getFontControlConfig = () => {
|
|
11249
11370
|
const { controls } = (0, import_editor_v1_adapters5.getElementorConfig)();
|
|
@@ -11251,7 +11372,7 @@ var getFontControlConfig = () => {
|
|
|
11251
11372
|
};
|
|
11252
11373
|
var useFontFamilies = () => {
|
|
11253
11374
|
const { groups, options } = getFontControlConfig();
|
|
11254
|
-
return (0,
|
|
11375
|
+
return (0, import_react89.useMemo)(() => {
|
|
11255
11376
|
if (!groups || !options) {
|
|
11256
11377
|
return [];
|
|
11257
11378
|
}
|
|
@@ -11362,6 +11483,7 @@ var useFontFamilies = () => {
|
|
|
11362
11483
|
registerIconLibraryProvider,
|
|
11363
11484
|
resetFontAwesome7IconsCache,
|
|
11364
11485
|
resolveFontAwesome7Icon,
|
|
11486
|
+
resolveProviderIconPreviewSvg,
|
|
11365
11487
|
resolveProviderIconSvg,
|
|
11366
11488
|
trackUpgradePromotionClick,
|
|
11367
11489
|
trackViewPromotion,
|