@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.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
|
|
@@ -7104,7 +7203,6 @@ var ICON_LIBRARY_PADDING = 0.625;
|
|
|
7104
7203
|
var SvgMediaOverlay = ({
|
|
7105
7204
|
label,
|
|
7106
7205
|
isAdmin,
|
|
7107
|
-
showIconLibrary,
|
|
7108
7206
|
buttonGroupRef,
|
|
7109
7207
|
onSelectSvg,
|
|
7110
7208
|
onUpload,
|
|
@@ -7128,7 +7226,7 @@ var SvgMediaOverlay = ({
|
|
|
7128
7226
|
/* @__PURE__ */ React91.createElement(import_ui74.Box, { component: "span", sx: { display: "flex", width: "100%" } }, /* @__PURE__ */ React91.createElement(UploadControl, { isAdmin, onUpload }))
|
|
7129
7227
|
)
|
|
7130
7228
|
}
|
|
7131
|
-
),
|
|
7229
|
+
), /* @__PURE__ */ React91.createElement(
|
|
7132
7230
|
import_ui74.Button,
|
|
7133
7231
|
{
|
|
7134
7232
|
size: "tiny",
|
|
@@ -7144,7 +7242,7 @@ var SvgMediaOverlay = ({
|
|
|
7144
7242
|
}
|
|
7145
7243
|
},
|
|
7146
7244
|
/* @__PURE__ */ React91.createElement(import_ui74.Typography, null, (0, import_i18n39.__)("Icon library", "elementor"))
|
|
7147
|
-
)
|
|
7245
|
+
));
|
|
7148
7246
|
var UploadControl = ({ isAdmin, onUpload }) => {
|
|
7149
7247
|
if (isAdmin) {
|
|
7150
7248
|
return /* @__PURE__ */ React91.createElement(MediaUploadButton, { onClick: onUpload });
|
|
@@ -7154,6 +7252,7 @@ var UploadControl = ({ isAdmin, onUpload }) => {
|
|
|
7154
7252
|
|
|
7155
7253
|
// src/controls/svg-media-preview.tsx
|
|
7156
7254
|
var React92 = __toESM(require("react"));
|
|
7255
|
+
var import_react58 = require("react");
|
|
7157
7256
|
var import_ui75 = require("@elementor/ui");
|
|
7158
7257
|
var import_i18n40 = require("@wordpress/i18n");
|
|
7159
7258
|
var ICON_PREVIEW_SIZE = 50;
|
|
@@ -7161,21 +7260,30 @@ var ICON_PREVIEW_COLOR = "#000000";
|
|
|
7161
7260
|
var SvgMediaPreview = ({ isFetching, src, iconClassName, iconLibrary }) => {
|
|
7162
7261
|
const shouldLoadIconCatalog = Boolean(iconClassName && iconLibrary);
|
|
7163
7262
|
const { data: fontAwesomeIcons = [], isLoading: isFontAwesomeLoading } = useFontAwesome7Catalog(shouldLoadIconCatalog);
|
|
7164
|
-
const
|
|
7165
|
-
const
|
|
7263
|
+
const isFontAwesomeLibrary = Boolean(iconLibrary?.startsWith("fa-"));
|
|
7264
|
+
const { data: providerIcons = [], isLoading: isProviderLoading } = useIconLibraryProviderIcons(
|
|
7265
|
+
shouldLoadIconCatalog && !isFontAwesomeLibrary
|
|
7266
|
+
);
|
|
7267
|
+
const icons = (0, import_react58.useMemo)(
|
|
7268
|
+
() => mergeIconsById(fontAwesomeIcons, providerIcons),
|
|
7269
|
+
[fontAwesomeIcons, providerIcons]
|
|
7270
|
+
);
|
|
7166
7271
|
const selectedIcon = findFontAwesome7Icon(icons, iconClassName, iconLibrary);
|
|
7167
|
-
const isLoadingCatalog = shouldLoadIconCatalog && (isFontAwesomeLoading || isProviderLoading);
|
|
7272
|
+
const isLoadingCatalog = shouldLoadIconCatalog && (isFontAwesomeLoading || !isFontAwesomeLibrary && isProviderLoading);
|
|
7168
7273
|
const { data: savedIconSvg, isLoading: isSavedIconLoading } = useProviderIconSvg(
|
|
7169
7274
|
iconLibrary,
|
|
7170
7275
|
iconClassName,
|
|
7171
|
-
shouldLoadIconCatalog && !isLoadingCatalog && !selectedIcon
|
|
7276
|
+
shouldLoadIconCatalog && !isLoadingCatalog && !selectedIcon && !isFontAwesomeLibrary
|
|
7172
7277
|
);
|
|
7173
7278
|
if (isFetching || isLoadingCatalog || isSavedIconLoading) {
|
|
7174
|
-
return /* @__PURE__ */ React92.createElement(import_ui75.CircularProgress, { role: "progressbar" });
|
|
7279
|
+
return /* @__PURE__ */ React92.createElement(import_ui75.CircularProgress, { role: "progressbar", "aria-label": (0, import_i18n40.__)("Loading icon", "elementor") });
|
|
7175
7280
|
}
|
|
7176
7281
|
if (selectedIcon) {
|
|
7177
7282
|
return /* @__PURE__ */ React92.createElement(IconPreview, { icon: selectedIcon });
|
|
7178
7283
|
}
|
|
7284
|
+
if (shouldLoadIconCatalog && iconClassName && iconLibrary && isFontAwesomeLibrary) {
|
|
7285
|
+
return /* @__PURE__ */ React92.createElement(IconPreview, { icon: createLazyIcon(iconLibrary, iconClassName) });
|
|
7286
|
+
}
|
|
7179
7287
|
if (savedIconSvg) {
|
|
7180
7288
|
return /* @__PURE__ */ React92.createElement(IconPreview, { icon: toSvgMarkupIcon(savedIconSvg, iconLibrary, iconClassName) });
|
|
7181
7289
|
}
|
|
@@ -7184,6 +7292,18 @@ var SvgMediaPreview = ({ isFetching, src, iconClassName, iconLibrary }) => {
|
|
|
7184
7292
|
}
|
|
7185
7293
|
return /* @__PURE__ */ React92.createElement(SvgPreview, { src });
|
|
7186
7294
|
};
|
|
7295
|
+
var createLazyIcon = (library, value) => ({
|
|
7296
|
+
id: `${library}:${value}`,
|
|
7297
|
+
name: value,
|
|
7298
|
+
label: value,
|
|
7299
|
+
library,
|
|
7300
|
+
value,
|
|
7301
|
+
aliases: [],
|
|
7302
|
+
width: ICON_PREVIEW_SIZE,
|
|
7303
|
+
height: ICON_PREVIEW_SIZE,
|
|
7304
|
+
paths: [],
|
|
7305
|
+
lazySvg: true
|
|
7306
|
+
});
|
|
7187
7307
|
var toSvgMarkupIcon = (svgMarkup, library, value) => ({
|
|
7188
7308
|
id: `${library}:${value}`,
|
|
7189
7309
|
label: value ?? "",
|
|
@@ -7196,7 +7316,7 @@ var toSvgMarkupIcon = (svgMarkup, library, value) => ({
|
|
|
7196
7316
|
paths: [],
|
|
7197
7317
|
svgMarkup
|
|
7198
7318
|
});
|
|
7199
|
-
var IconPreview = ({ icon }) => /* @__PURE__ */ React92.createElement(import_ui75.Box, { sx: { color: ICON_PREVIEW_COLOR } }, /* @__PURE__ */ React92.createElement(
|
|
7319
|
+
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
7320
|
FontAwesomeGlyph,
|
|
7201
7321
|
{
|
|
7202
7322
|
icon,
|
|
@@ -7254,7 +7374,7 @@ var StyledCardMediaContainer = (0, import_ui76.styled)(import_ui76.Stack)`
|
|
|
7254
7374
|
`;
|
|
7255
7375
|
var MODE_BROWSE = { mode: "browse" };
|
|
7256
7376
|
var MODE_UPLOAD = { mode: "upload" };
|
|
7257
|
-
var SvgMediaControl = createControl(({
|
|
7377
|
+
var SvgMediaControl = createControl(({ label }) => {
|
|
7258
7378
|
const groupLabel = label ?? (0, import_i18n41.__)("SVG", "elementor");
|
|
7259
7379
|
const { value: svgValue, setValue: setSvgValue, placeholder: svgPlaceholder } = useBoundProp(import_editor_props35.svgSrcPropTypeUtil);
|
|
7260
7380
|
const { value: iconValue, setValue: setIconValue, placeholder: iconPlaceholder } = useBoundProp(import_editor_props35.iconPropTypeUtil);
|
|
@@ -7265,14 +7385,14 @@ var SvgMediaControl = createControl(({ showIconLibrary = false, label }) => {
|
|
|
7265
7385
|
const { data: attachment, isFetching } = (0, import_wp_media2.useWpMediaAttachment)(previewSvgValue?.id?.value || null);
|
|
7266
7386
|
const src = attachment?.url ?? previewSvgValue?.url?.value ?? null;
|
|
7267
7387
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
7268
|
-
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0,
|
|
7388
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0, import_react59.useState)(false);
|
|
7269
7389
|
const iconLibraryPopoverState = (0, import_ui76.usePopupState)({ variant: "popover" });
|
|
7270
|
-
const controlContainerRef = (0,
|
|
7271
|
-
const buttonGroupRef = (0,
|
|
7272
|
-
const [iconLibraryAnchor, setIconLibraryAnchor] = (0,
|
|
7390
|
+
const controlContainerRef = (0, import_react59.useRef)(null);
|
|
7391
|
+
const buttonGroupRef = (0, import_react59.useRef)(null);
|
|
7392
|
+
const [iconLibraryAnchor, setIconLibraryAnchor] = (0, import_react59.useState)(null);
|
|
7273
7393
|
const { isAdmin } = (0, import_editor_current_user.useCurrentUserCapabilities)();
|
|
7274
|
-
const selectedIconClass =
|
|
7275
|
-
const selectedIconLibrary =
|
|
7394
|
+
const selectedIconClass = typeof previewIconValue?.value?.value === "string" ? previewIconValue.value.value : null;
|
|
7395
|
+
const selectedIconLibrary = typeof previewIconValue?.library?.value === "string" ? previewIconValue.library.value : null;
|
|
7276
7396
|
const { open } = (0, import_wp_media2.useWpMediaFrame)({
|
|
7277
7397
|
mediaTypes: ["svg"],
|
|
7278
7398
|
multiple: false,
|
|
@@ -7321,7 +7441,7 @@ var SvgMediaControl = createControl(({ showIconLibrary = false, label }) => {
|
|
|
7321
7441
|
setIconLibraryAnchor(anchor);
|
|
7322
7442
|
iconLibraryPopoverState.open(event);
|
|
7323
7443
|
};
|
|
7324
|
-
(0,
|
|
7444
|
+
(0, import_react59.useEffect)(() => {
|
|
7325
7445
|
if (!iconLibraryPopoverState.isOpen) {
|
|
7326
7446
|
return;
|
|
7327
7447
|
}
|
|
@@ -7337,7 +7457,7 @@ var SvgMediaControl = createControl(({ showIconLibrary = false, label }) => {
|
|
|
7337
7457
|
};
|
|
7338
7458
|
}, [iconLibraryPopoverState.isOpen]);
|
|
7339
7459
|
const iconLibraryWidth = iconLibraryAnchor?.width ?? ICON_LIBRARY_POPOVER_WIDTH;
|
|
7340
|
-
return /* @__PURE__ */ React93.createElement(import_ui76.Stack, { gap: 1, "aria-label": (0, import_i18n41.__)("SVG control", "elementor") }, /* @__PURE__ */ React93.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: handleCloseUnfilteredModal }),
|
|
7460
|
+
return /* @__PURE__ */ React93.createElement(import_ui76.Stack, { gap: 1, "aria-label": (0, import_i18n41.__)("SVG control", "elementor") }, /* @__PURE__ */ React93.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: handleCloseUnfilteredModal }), iconLibraryAnchor ? /* @__PURE__ */ React93.createElement(
|
|
7341
7461
|
import_ui76.Popover,
|
|
7342
7462
|
{
|
|
7343
7463
|
disableScrollLock: true,
|
|
@@ -7397,7 +7517,6 @@ var SvgMediaControl = createControl(({ showIconLibrary = false, label }) => {
|
|
|
7397
7517
|
{
|
|
7398
7518
|
label: groupLabel,
|
|
7399
7519
|
isAdmin,
|
|
7400
|
-
showIconLibrary,
|
|
7401
7520
|
buttonGroupRef,
|
|
7402
7521
|
onSelectSvg: handleSelectSvg,
|
|
7403
7522
|
onUpload: handleUpload,
|
|
@@ -7603,7 +7722,7 @@ var BackgroundImageOverlayAttachment = () => {
|
|
|
7603
7722
|
|
|
7604
7723
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
7605
7724
|
var React97 = __toESM(require("react"));
|
|
7606
|
-
var
|
|
7725
|
+
var import_react60 = require("react");
|
|
7607
7726
|
var import_editor_props38 = require("@elementor/editor-props");
|
|
7608
7727
|
var import_editor_ui14 = require("@elementor/editor-ui");
|
|
7609
7728
|
var import_icons29 = require("@elementor/icons");
|
|
@@ -7625,7 +7744,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
7625
7744
|
const backgroundImageOffsetContext = useBoundProp(import_editor_props38.backgroundImagePositionOffsetPropTypeUtil);
|
|
7626
7745
|
const stringPropContext = useBoundProp(import_editor_props38.stringPropTypeUtil);
|
|
7627
7746
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
7628
|
-
const rowRef = (0,
|
|
7747
|
+
const rowRef = (0, import_react60.useRef)(null);
|
|
7629
7748
|
const handlePositionChange = (event) => {
|
|
7630
7749
|
const value = event.target.value || null;
|
|
7631
7750
|
if (value === "custom") {
|
|
@@ -7698,7 +7817,7 @@ var BackgroundImageOverlayRepeat = () => {
|
|
|
7698
7817
|
|
|
7699
7818
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
7700
7819
|
var React99 = __toESM(require("react"));
|
|
7701
|
-
var
|
|
7820
|
+
var import_react61 = require("react");
|
|
7702
7821
|
var import_editor_props39 = require("@elementor/editor-props");
|
|
7703
7822
|
var import_icons31 = require("@elementor/icons");
|
|
7704
7823
|
var import_ui82 = require("@elementor/ui");
|
|
@@ -7733,7 +7852,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
7733
7852
|
const backgroundImageScaleContext = useBoundProp(import_editor_props39.backgroundImageSizeScalePropTypeUtil);
|
|
7734
7853
|
const stringPropContext = useBoundProp(import_editor_props39.stringPropTypeUtil);
|
|
7735
7854
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
7736
|
-
const rowRef = (0,
|
|
7855
|
+
const rowRef = (0, import_react61.useRef)(null);
|
|
7737
7856
|
const handleSizeChange = (size) => {
|
|
7738
7857
|
if (size === "custom") {
|
|
7739
7858
|
backgroundImageScaleContext.setValue({ width: null, height: null });
|
|
@@ -7768,7 +7887,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
7768
7887
|
};
|
|
7769
7888
|
|
|
7770
7889
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
7771
|
-
var
|
|
7890
|
+
var import_react62 = require("react");
|
|
7772
7891
|
var import_editor_props40 = require("@elementor/editor-props");
|
|
7773
7892
|
var import_ui83 = require("@elementor/ui");
|
|
7774
7893
|
var useBackgroundTabsHistory = ({
|
|
@@ -7789,7 +7908,7 @@ var useBackgroundTabsHistory = ({
|
|
|
7789
7908
|
return "image";
|
|
7790
7909
|
};
|
|
7791
7910
|
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui83.useTabs)(getCurrentOverlayType());
|
|
7792
|
-
const valuesHistory = (0,
|
|
7911
|
+
const valuesHistory = (0, import_react62.useRef)({
|
|
7793
7912
|
image: initialBackgroundImageOverlay,
|
|
7794
7913
|
color: initialBackgroundColorOverlay2,
|
|
7795
7914
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -8040,7 +8159,7 @@ var BackgroundClipField = () => {
|
|
|
8040
8159
|
|
|
8041
8160
|
// src/controls/repeatable-control.tsx
|
|
8042
8161
|
var React102 = __toESM(require("react"));
|
|
8043
|
-
var
|
|
8162
|
+
var import_react63 = require("react");
|
|
8044
8163
|
var import_editor_props43 = require("@elementor/editor-props");
|
|
8045
8164
|
var import_ui86 = require("@elementor/ui");
|
|
8046
8165
|
var PLACEHOLDER_REGEX = /\$\{([^}]+)\}/g;
|
|
@@ -8061,11 +8180,11 @@ var RepeatableControl = createControl(
|
|
|
8061
8180
|
if (!childPropTypeUtil) {
|
|
8062
8181
|
return null;
|
|
8063
8182
|
}
|
|
8064
|
-
const childArrayPropTypeUtil2 = (0,
|
|
8183
|
+
const childArrayPropTypeUtil2 = (0, import_react63.useMemo)(
|
|
8065
8184
|
() => (0, import_editor_props43.createArrayPropUtils)(childPropTypeUtil.key, childPropTypeUtil.schema, propKey),
|
|
8066
8185
|
[childPropTypeUtil.key, childPropTypeUtil.schema, propKey]
|
|
8067
8186
|
);
|
|
8068
|
-
const contextValue = (0,
|
|
8187
|
+
const contextValue = (0, import_react63.useMemo)(
|
|
8069
8188
|
() => ({
|
|
8070
8189
|
...childControlConfig,
|
|
8071
8190
|
placeholder: placeholder || "",
|
|
@@ -8197,7 +8316,7 @@ var getAllProperties = (pattern) => {
|
|
|
8197
8316
|
|
|
8198
8317
|
// src/controls/key-value-control.tsx
|
|
8199
8318
|
var React103 = __toESM(require("react"));
|
|
8200
|
-
var
|
|
8319
|
+
var import_react64 = require("react");
|
|
8201
8320
|
var import_editor_props44 = require("@elementor/editor-props");
|
|
8202
8321
|
var import_ui87 = require("@elementor/ui");
|
|
8203
8322
|
var import_i18n49 = require("@wordpress/i18n");
|
|
@@ -8224,9 +8343,9 @@ var getInitialFieldValue = (fieldValue) => {
|
|
|
8224
8343
|
};
|
|
8225
8344
|
var KeyValueControl = createControl((props = {}) => {
|
|
8226
8345
|
const { value, setValue, ...propContext } = useBoundProp(import_editor_props44.keyValuePropTypeUtil);
|
|
8227
|
-
const [keyError, setKeyError] = (0,
|
|
8228
|
-
const [valueError, setValueError] = (0,
|
|
8229
|
-
const [sessionState, setSessionState] = (0,
|
|
8346
|
+
const [keyError, setKeyError] = (0, import_react64.useState)("");
|
|
8347
|
+
const [valueError, setValueError] = (0, import_react64.useState)("");
|
|
8348
|
+
const [sessionState, setSessionState] = (0, import_react64.useState)({
|
|
8230
8349
|
key: getInitialFieldValue(value?.key),
|
|
8231
8350
|
value: getInitialFieldValue(value?.value)
|
|
8232
8351
|
});
|
|
@@ -8236,7 +8355,7 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
8236
8355
|
keyHelper: void 0,
|
|
8237
8356
|
valueHelper: void 0
|
|
8238
8357
|
};
|
|
8239
|
-
const [keyRegex, valueRegex, errMsg] = (0,
|
|
8358
|
+
const [keyRegex, valueRegex, errMsg] = (0, import_react64.useMemo)(
|
|
8240
8359
|
() => [
|
|
8241
8360
|
props.regexKey ? new RegExp(props.regexKey) : void 0,
|
|
8242
8361
|
props.regexValue ? new RegExp(props.regexValue) : void 0,
|
|
@@ -8368,7 +8487,7 @@ var PositionControl = () => {
|
|
|
8368
8487
|
|
|
8369
8488
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
8370
8489
|
var React117 = __toESM(require("react"));
|
|
8371
|
-
var
|
|
8490
|
+
var import_react72 = require("react");
|
|
8372
8491
|
var import_editor_props54 = require("@elementor/editor-props");
|
|
8373
8492
|
var import_icons39 = require("@elementor/icons");
|
|
8374
8493
|
var import_ui101 = require("@elementor/ui");
|
|
@@ -8427,7 +8546,7 @@ var import_i18n55 = require("@wordpress/i18n");
|
|
|
8427
8546
|
|
|
8428
8547
|
// src/controls/transform-control/functions/move.tsx
|
|
8429
8548
|
var React106 = __toESM(require("react"));
|
|
8430
|
-
var
|
|
8549
|
+
var import_react65 = require("react");
|
|
8431
8550
|
var import_editor_props47 = require("@elementor/editor-props");
|
|
8432
8551
|
var import_icons33 = require("@elementor/icons");
|
|
8433
8552
|
var import_ui90 = require("@elementor/ui");
|
|
@@ -8474,7 +8593,7 @@ var moveAxisControls = [
|
|
|
8474
8593
|
];
|
|
8475
8594
|
var Move = () => {
|
|
8476
8595
|
const context = useBoundProp(import_editor_props47.moveTransformPropTypeUtil);
|
|
8477
|
-
const rowRefs = [(0,
|
|
8596
|
+
const rowRefs = [(0, import_react65.useRef)(null), (0, import_react65.useRef)(null), (0, import_react65.useRef)(null)];
|
|
8478
8597
|
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
8598
|
AxisRow,
|
|
8480
8599
|
{
|
|
@@ -8489,7 +8608,7 @@ var Move = () => {
|
|
|
8489
8608
|
|
|
8490
8609
|
// src/controls/transform-control/functions/rotate.tsx
|
|
8491
8610
|
var React107 = __toESM(require("react"));
|
|
8492
|
-
var
|
|
8611
|
+
var import_react66 = require("react");
|
|
8493
8612
|
var import_editor_props48 = require("@elementor/editor-props");
|
|
8494
8613
|
var import_icons34 = require("@elementor/icons");
|
|
8495
8614
|
var import_ui91 = require("@elementor/ui");
|
|
@@ -8514,7 +8633,7 @@ var rotateAxisControls = [
|
|
|
8514
8633
|
var rotateUnits = ["deg", "rad", "grad", "turn"];
|
|
8515
8634
|
var Rotate = () => {
|
|
8516
8635
|
const context = useBoundProp(import_editor_props48.rotateTransformPropTypeUtil);
|
|
8517
|
-
const rowRefs = [(0,
|
|
8636
|
+
const rowRefs = [(0, import_react66.useRef)(null), (0, import_react66.useRef)(null), (0, import_react66.useRef)(null)];
|
|
8518
8637
|
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
8638
|
AxisRow,
|
|
8520
8639
|
{
|
|
@@ -8528,7 +8647,7 @@ var Rotate = () => {
|
|
|
8528
8647
|
|
|
8529
8648
|
// src/controls/transform-control/functions/scale.tsx
|
|
8530
8649
|
var React109 = __toESM(require("react"));
|
|
8531
|
-
var
|
|
8650
|
+
var import_react67 = require("react");
|
|
8532
8651
|
var import_editor_props49 = require("@elementor/editor-props");
|
|
8533
8652
|
var import_icons35 = require("@elementor/icons");
|
|
8534
8653
|
var import_ui93 = require("@elementor/ui");
|
|
@@ -8561,13 +8680,13 @@ var scaleAxisControls = [
|
|
|
8561
8680
|
];
|
|
8562
8681
|
var Scale = () => {
|
|
8563
8682
|
const context = useBoundProp(import_editor_props49.scaleTransformPropTypeUtil);
|
|
8564
|
-
const rowRefs = [(0,
|
|
8683
|
+
const rowRefs = [(0, import_react67.useRef)(null), (0, import_react67.useRef)(null), (0, import_react67.useRef)(null)];
|
|
8565
8684
|
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
8685
|
};
|
|
8567
8686
|
|
|
8568
8687
|
// src/controls/transform-control/functions/skew.tsx
|
|
8569
8688
|
var React110 = __toESM(require("react"));
|
|
8570
|
-
var
|
|
8689
|
+
var import_react68 = require("react");
|
|
8571
8690
|
var import_editor_props50 = require("@elementor/editor-props");
|
|
8572
8691
|
var import_icons36 = require("@elementor/icons");
|
|
8573
8692
|
var import_ui94 = require("@elementor/ui");
|
|
@@ -8587,7 +8706,7 @@ var skewAxisControls = [
|
|
|
8587
8706
|
var skewUnits = ["deg", "rad", "grad", "turn"];
|
|
8588
8707
|
var Skew = () => {
|
|
8589
8708
|
const context = useBoundProp(import_editor_props50.skewTransformPropTypeUtil);
|
|
8590
|
-
const rowRefs = [(0,
|
|
8709
|
+
const rowRefs = [(0, import_react68.useRef)(null), (0, import_react68.useRef)(null), (0, import_react68.useRef)(null)];
|
|
8591
8710
|
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
8711
|
AxisRow,
|
|
8593
8712
|
{
|
|
@@ -8600,7 +8719,7 @@ var Skew = () => {
|
|
|
8600
8719
|
};
|
|
8601
8720
|
|
|
8602
8721
|
// src/controls/transform-control/use-transform-tabs-history.tsx
|
|
8603
|
-
var
|
|
8722
|
+
var import_react69 = require("react");
|
|
8604
8723
|
var import_editor_props51 = require("@elementor/editor-props");
|
|
8605
8724
|
var import_ui95 = require("@elementor/ui");
|
|
8606
8725
|
var useTransformTabsHistory = ({
|
|
@@ -8627,7 +8746,7 @@ var useTransformTabsHistory = ({
|
|
|
8627
8746
|
}
|
|
8628
8747
|
};
|
|
8629
8748
|
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui95.useTabs)(getCurrentTransformType());
|
|
8630
|
-
const valuesHistory = (0,
|
|
8749
|
+
const valuesHistory = (0, import_react69.useRef)({
|
|
8631
8750
|
move: initialMove,
|
|
8632
8751
|
scale: initialScale,
|
|
8633
8752
|
rotate: initialRotate,
|
|
@@ -8771,7 +8890,7 @@ var import_i18n59 = require("@wordpress/i18n");
|
|
|
8771
8890
|
|
|
8772
8891
|
// src/controls/transform-control/transform-base-controls/children-perspective-control.tsx
|
|
8773
8892
|
var React114 = __toESM(require("react"));
|
|
8774
|
-
var
|
|
8893
|
+
var import_react70 = require("react");
|
|
8775
8894
|
var import_editor_props52 = require("@elementor/editor-props");
|
|
8776
8895
|
var import_ui98 = require("@elementor/ui");
|
|
8777
8896
|
var import_i18n57 = require("@wordpress/i18n");
|
|
@@ -8803,13 +8922,13 @@ var PerspectiveOriginControlProvider = () => {
|
|
|
8803
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 }))));
|
|
8804
8923
|
};
|
|
8805
8924
|
var ControlFields = ({ control }) => {
|
|
8806
|
-
const rowRef = (0,
|
|
8925
|
+
const rowRef = (0, import_react70.useRef)(null);
|
|
8807
8926
|
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
8927
|
};
|
|
8809
8928
|
|
|
8810
8929
|
// src/controls/transform-control/transform-base-controls/transform-origin-control.tsx
|
|
8811
8930
|
var React115 = __toESM(require("react"));
|
|
8812
|
-
var
|
|
8931
|
+
var import_react71 = require("react");
|
|
8813
8932
|
var import_editor_props53 = require("@elementor/editor-props");
|
|
8814
8933
|
var import_ui99 = require("@elementor/ui");
|
|
8815
8934
|
var import_i18n58 = require("@wordpress/i18n");
|
|
@@ -8837,7 +8956,7 @@ var TransformOriginControl = () => {
|
|
|
8837
8956
|
};
|
|
8838
8957
|
var ControlFields2 = ({ control }) => {
|
|
8839
8958
|
const context = useBoundProp(import_editor_props53.transformOriginPropTypeUtil);
|
|
8840
|
-
const rowRef = (0,
|
|
8959
|
+
const rowRef = (0, import_react71.useRef)(null);
|
|
8841
8960
|
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
8961
|
};
|
|
8843
8962
|
|
|
@@ -8885,7 +9004,7 @@ var SIZE11 = "tiny";
|
|
|
8885
9004
|
var TransformRepeaterControl = createControl(
|
|
8886
9005
|
({ showChildrenPerspective }) => {
|
|
8887
9006
|
const context = useBoundProp(import_editor_props54.transformPropTypeUtil);
|
|
8888
|
-
const headerRef = (0,
|
|
9007
|
+
const headerRef = (0, import_react72.useRef)(null);
|
|
8889
9008
|
const popupState = (0, import_ui101.usePopupState)({ variant: "popover" });
|
|
8890
9009
|
return /* @__PURE__ */ React117.createElement(PropProvider, { ...context }, /* @__PURE__ */ React117.createElement(
|
|
8891
9010
|
TransformSettingsControl,
|
|
@@ -8965,7 +9084,7 @@ var TransformBasePopoverTrigger = ({
|
|
|
8965
9084
|
|
|
8966
9085
|
// src/controls/transition-control/transition-repeater-control.tsx
|
|
8967
9086
|
var React120 = __toESM(require("react"));
|
|
8968
|
-
var
|
|
9087
|
+
var import_react75 = require("react");
|
|
8969
9088
|
var import_editor_props57 = require("@elementor/editor-props");
|
|
8970
9089
|
var import_icons41 = require("@elementor/icons");
|
|
8971
9090
|
var import_ui104 = require("@elementor/ui");
|
|
@@ -8974,15 +9093,15 @@ var import_i18n63 = require("@wordpress/i18n");
|
|
|
8974
9093
|
|
|
8975
9094
|
// src/controls/selection-size-control.tsx
|
|
8976
9095
|
var React118 = __toESM(require("react"));
|
|
8977
|
-
var
|
|
9096
|
+
var import_react73 = require("react");
|
|
8978
9097
|
var import_editor_props55 = require("@elementor/editor-props");
|
|
8979
9098
|
var import_ui102 = require("@elementor/ui");
|
|
8980
9099
|
var SelectionSizeControl = createControl(
|
|
8981
9100
|
({ selectionLabel, sizeLabel, selectionConfig, sizeConfigMap }) => {
|
|
8982
9101
|
const { value, setValue, propType } = useBoundProp(import_editor_props55.selectionSizePropTypeUtil);
|
|
8983
|
-
const rowRef = (0,
|
|
9102
|
+
const rowRef = (0, import_react73.useRef)(null);
|
|
8984
9103
|
const sizeFieldId = sizeLabel.replace(/\s+/g, "-").toLowerCase();
|
|
8985
|
-
const currentSizeConfig = (0,
|
|
9104
|
+
const currentSizeConfig = (0, import_react73.useMemo)(() => {
|
|
8986
9105
|
switch (value.selection.$$type) {
|
|
8987
9106
|
case "key-value":
|
|
8988
9107
|
return sizeConfigMap[value?.selection?.value.value.value || ""];
|
|
@@ -9195,7 +9314,7 @@ function subscribeToTransitionEvent() {
|
|
|
9195
9314
|
|
|
9196
9315
|
// src/controls/transition-control/transition-selector.tsx
|
|
9197
9316
|
var React119 = __toESM(require("react"));
|
|
9198
|
-
var
|
|
9317
|
+
var import_react74 = require("react");
|
|
9199
9318
|
var import_editor_props56 = require("@elementor/editor-props");
|
|
9200
9319
|
var import_editor_ui17 = require("@elementor/editor-ui");
|
|
9201
9320
|
var import_icons40 = require("@elementor/icons");
|
|
@@ -9241,9 +9360,9 @@ var TransitionSelector = ({
|
|
|
9241
9360
|
const {
|
|
9242
9361
|
key: { value: transitionLabel }
|
|
9243
9362
|
} = value;
|
|
9244
|
-
const defaultRef = (0,
|
|
9363
|
+
const defaultRef = (0, import_react74.useRef)(null);
|
|
9245
9364
|
const popoverState = (0, import_ui103.usePopupState)({ variant: "popover" });
|
|
9246
|
-
const disabledCategories = (0,
|
|
9365
|
+
const disabledCategories = (0, import_react74.useMemo)(() => {
|
|
9247
9366
|
return new Set(
|
|
9248
9367
|
transitionProperties.filter((cat) => cat.properties.some((prop) => prop.isDisabled)).map((cat) => cat.label)
|
|
9249
9368
|
);
|
|
@@ -9469,14 +9588,14 @@ var TransitionRepeaterControl = createControl(
|
|
|
9469
9588
|
currentStyleState
|
|
9470
9589
|
}) => {
|
|
9471
9590
|
const currentStyleIsNormal = currentStyleState === null;
|
|
9472
|
-
const [recentlyUsedList, setRecentlyUsedList] = (0,
|
|
9591
|
+
const [recentlyUsedList, setRecentlyUsedList] = (0, import_react75.useState)([]);
|
|
9473
9592
|
const proInstalled = (0, import_utils8.hasProInstalled)();
|
|
9474
9593
|
const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
9475
|
-
const { allDisabled: disabledItems, proDisabled: proDisabledItems } = (0,
|
|
9594
|
+
const { allDisabled: disabledItems, proDisabled: proDisabledItems } = (0, import_react75.useMemo)(
|
|
9476
9595
|
() => getDisabledItemLabels(value),
|
|
9477
9596
|
[value]
|
|
9478
9597
|
);
|
|
9479
|
-
const allowedTransitionSet = (0,
|
|
9598
|
+
const allowedTransitionSet = (0, import_react75.useMemo)(() => {
|
|
9480
9599
|
const set = /* @__PURE__ */ new Set();
|
|
9481
9600
|
transitionProperties.forEach((category) => {
|
|
9482
9601
|
category.properties.forEach((prop) => {
|
|
@@ -9487,7 +9606,7 @@ var TransitionRepeaterControl = createControl(
|
|
|
9487
9606
|
});
|
|
9488
9607
|
return set;
|
|
9489
9608
|
}, [proInstalled]);
|
|
9490
|
-
(0,
|
|
9609
|
+
(0, import_react75.useEffect)(() => {
|
|
9491
9610
|
if (!value || value.length === 0) {
|
|
9492
9611
|
return;
|
|
9493
9612
|
}
|
|
@@ -9499,10 +9618,10 @@ var TransitionRepeaterControl = createControl(
|
|
|
9499
9618
|
setValue(sanitized);
|
|
9500
9619
|
}
|
|
9501
9620
|
}, [allowedTransitionSet]);
|
|
9502
|
-
(0,
|
|
9621
|
+
(0, import_react75.useEffect)(() => {
|
|
9503
9622
|
recentlyUsedListGetter().then(setRecentlyUsedList);
|
|
9504
9623
|
}, [recentlyUsedListGetter]);
|
|
9505
|
-
const allPropertiesUsed = (0,
|
|
9624
|
+
const allPropertiesUsed = (0, import_react75.useMemo)(() => areAllPropertiesUsed(value), [value]);
|
|
9506
9625
|
const isAddItemDisabled = !currentStyleIsNormal || allPropertiesUsed;
|
|
9507
9626
|
return /* @__PURE__ */ React120.createElement(
|
|
9508
9627
|
RepeatableControl,
|
|
@@ -9785,13 +9904,13 @@ var BoundTimeStringControl = ({ bind, ariaLabel }) => {
|
|
|
9785
9904
|
|
|
9786
9905
|
// src/controls/inline-editing-control.tsx
|
|
9787
9906
|
var React129 = __toESM(require("react"));
|
|
9788
|
-
var
|
|
9907
|
+
var import_react81 = require("react");
|
|
9789
9908
|
var import_editor_props65 = require("@elementor/editor-props");
|
|
9790
9909
|
var import_ui113 = require("@elementor/ui");
|
|
9791
9910
|
|
|
9792
9911
|
// src/components/inline-editor.tsx
|
|
9793
9912
|
var React126 = __toESM(require("react"));
|
|
9794
|
-
var
|
|
9913
|
+
var import_react76 = require("react");
|
|
9795
9914
|
var import_ui110 = require("@elementor/ui");
|
|
9796
9915
|
var import_extension_bold = __toESM(require("@tiptap/extension-bold"));
|
|
9797
9916
|
var import_extension_document = __toESM(require("@tiptap/extension-document"));
|
|
@@ -9805,7 +9924,7 @@ var import_extension_subscript = __toESM(require("@tiptap/extension-subscript"))
|
|
|
9805
9924
|
var import_extension_superscript = __toESM(require("@tiptap/extension-superscript"));
|
|
9806
9925
|
var import_extension_text = __toESM(require("@tiptap/extension-text"));
|
|
9807
9926
|
var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
|
|
9808
|
-
var
|
|
9927
|
+
var import_react77 = require("@tiptap/react");
|
|
9809
9928
|
|
|
9810
9929
|
// src/utils/inline-editing.ts
|
|
9811
9930
|
var import_editor_props64 = require("@elementor/editor-props");
|
|
@@ -9854,8 +9973,8 @@ var InlineEditor = React126.forwardRef((props, ref) => {
|
|
|
9854
9973
|
onSelectionEnd,
|
|
9855
9974
|
mountElement = null
|
|
9856
9975
|
} = props;
|
|
9857
|
-
const containerRef = (0,
|
|
9858
|
-
const onBlurRef = (0,
|
|
9976
|
+
const containerRef = (0, import_react76.useRef)(null);
|
|
9977
|
+
const onBlurRef = (0, import_react76.useRef)(onBlur);
|
|
9859
9978
|
onBlurRef.current = onBlur;
|
|
9860
9979
|
const documentContentSettings = !!expectedTag ? "block+" : "inline*";
|
|
9861
9980
|
const onUpdate = ({ editor: updatedEditor }) => {
|
|
@@ -9877,7 +9996,7 @@ var InlineEditor = React126.forwardRef((props, ref) => {
|
|
|
9877
9996
|
...HTMLAttributes,
|
|
9878
9997
|
class: elementClasses
|
|
9879
9998
|
});
|
|
9880
|
-
const editor = (0,
|
|
9999
|
+
const editor = (0, import_react77.useEditor)({
|
|
9881
10000
|
...mountElement ? { element: mountElement } : {},
|
|
9882
10001
|
extensions: [
|
|
9883
10002
|
import_extension_document.default.extend({
|
|
@@ -9950,11 +10069,11 @@ var InlineEditor = React126.forwardRef((props, ref) => {
|
|
|
9950
10069
|
if (mountElement) {
|
|
9951
10070
|
return null;
|
|
9952
10071
|
}
|
|
9953
|
-
return /* @__PURE__ */ React126.createElement(import_ui110.Box, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React126.createElement(
|
|
10072
|
+
return /* @__PURE__ */ React126.createElement(import_ui110.Box, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React126.createElement(import_react77.EditorContent, { ref, editor }));
|
|
9954
10073
|
});
|
|
9955
10074
|
var useOnUpdate = (callback, dependencies) => {
|
|
9956
|
-
const hasMounted = (0,
|
|
9957
|
-
(0,
|
|
10075
|
+
const hasMounted = (0, import_react76.useRef)(false);
|
|
10076
|
+
(0, import_react76.useEffect)(() => {
|
|
9958
10077
|
if (hasMounted.current) {
|
|
9959
10078
|
callback();
|
|
9960
10079
|
} else {
|
|
@@ -9965,16 +10084,16 @@ var useOnUpdate = (callback, dependencies) => {
|
|
|
9965
10084
|
|
|
9966
10085
|
// src/components/inline-editor-toolbar.tsx
|
|
9967
10086
|
var React128 = __toESM(require("react"));
|
|
9968
|
-
var
|
|
10087
|
+
var import_react79 = require("react");
|
|
9969
10088
|
var import_editor_elements7 = require("@elementor/editor-elements");
|
|
9970
10089
|
var import_icons43 = require("@elementor/icons");
|
|
9971
10090
|
var import_ui112 = require("@elementor/ui");
|
|
9972
|
-
var
|
|
10091
|
+
var import_react80 = require("@tiptap/react");
|
|
9973
10092
|
var import_i18n67 = require("@wordpress/i18n");
|
|
9974
10093
|
|
|
9975
10094
|
// src/components/url-popover.tsx
|
|
9976
10095
|
var React127 = __toESM(require("react"));
|
|
9977
|
-
var
|
|
10096
|
+
var import_react78 = require("react");
|
|
9978
10097
|
var import_icons42 = require("@elementor/icons");
|
|
9979
10098
|
var import_ui111 = require("@elementor/ui");
|
|
9980
10099
|
var import_i18n66 = require("@wordpress/i18n");
|
|
@@ -9987,8 +10106,8 @@ var UrlPopover = ({
|
|
|
9987
10106
|
openInNewTab,
|
|
9988
10107
|
onToggleNewTab
|
|
9989
10108
|
}) => {
|
|
9990
|
-
const inputRef = (0,
|
|
9991
|
-
(0,
|
|
10109
|
+
const inputRef = (0, import_react78.useRef)(null);
|
|
10110
|
+
(0, import_react78.useEffect)(() => {
|
|
9992
10111
|
if (popupState.isOpen) {
|
|
9993
10112
|
requestAnimationFrame(() => inputRef.current?.focus());
|
|
9994
10113
|
}
|
|
@@ -10043,16 +10162,16 @@ var InlineEditorToolbar = ({
|
|
|
10043
10162
|
sx = {},
|
|
10044
10163
|
inControlPanel = false
|
|
10045
10164
|
}) => {
|
|
10046
|
-
const [urlValue, setUrlValue] = (0,
|
|
10047
|
-
const [openInNewTab, setOpenInNewTab] = (0,
|
|
10048
|
-
const toolbarRef = (0,
|
|
10165
|
+
const [urlValue, setUrlValue] = (0, import_react79.useState)("");
|
|
10166
|
+
const [openInNewTab, setOpenInNewTab] = (0, import_react79.useState)(false);
|
|
10167
|
+
const toolbarRef = (0, import_react79.useRef)(null);
|
|
10049
10168
|
const linkPopupState = (0, import_ui112.usePopupState)({ variant: "popover" });
|
|
10050
10169
|
const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
|
|
10051
|
-
const editorState = (0,
|
|
10170
|
+
const editorState = (0, import_react80.useEditorState)({
|
|
10052
10171
|
editor,
|
|
10053
10172
|
selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
|
|
10054
10173
|
});
|
|
10055
|
-
const formatButtonsList = (0,
|
|
10174
|
+
const formatButtonsList = (0, import_react79.useMemo)(() => {
|
|
10056
10175
|
const buttons = Object.values(formatButtons);
|
|
10057
10176
|
if (isElementClickable) {
|
|
10058
10177
|
return buttons.filter((button) => button.action !== "link");
|
|
@@ -10089,7 +10208,7 @@ var InlineEditorToolbar = ({
|
|
|
10089
10208
|
}
|
|
10090
10209
|
linkPopupState.close();
|
|
10091
10210
|
};
|
|
10092
|
-
(0,
|
|
10211
|
+
(0, import_react79.useEffect)(() => {
|
|
10093
10212
|
if (!inControlPanel) {
|
|
10094
10213
|
editor?.commands?.focus();
|
|
10095
10214
|
}
|
|
@@ -10271,8 +10390,8 @@ var InlineEditingControl = createControl(
|
|
|
10271
10390
|
const { setValue, placeholder, value } = useBoundProp(import_editor_props65.escapedHtmlPropTypeUtil);
|
|
10272
10391
|
const { value: rawValue } = usePropKeyContext();
|
|
10273
10392
|
const content = value ?? extractInlineHtmlContent(rawValue);
|
|
10274
|
-
const [editor, setEditor] = (0,
|
|
10275
|
-
const handleChange = (0,
|
|
10393
|
+
const [editor, setEditor] = (0, import_react81.useState)(null);
|
|
10394
|
+
const handleChange = (0, import_react81.useCallback)(
|
|
10276
10395
|
(newValue) => {
|
|
10277
10396
|
const html = newValue ?? "";
|
|
10278
10397
|
setValue(html);
|
|
@@ -10459,7 +10578,7 @@ function useFormFieldSuggestions(options) {
|
|
|
10459
10578
|
|
|
10460
10579
|
// src/controls/email-form-action-control/email-chips-field.tsx
|
|
10461
10580
|
var React130 = __toESM(require("react"));
|
|
10462
|
-
var
|
|
10581
|
+
var import_react82 = require("react");
|
|
10463
10582
|
var import_editor_props67 = require("@elementor/editor-props");
|
|
10464
10583
|
var import_ui114 = require("@elementor/ui");
|
|
10465
10584
|
|
|
@@ -10497,10 +10616,10 @@ function resolveMention(raw, suggestions) {
|
|
|
10497
10616
|
}
|
|
10498
10617
|
var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
|
|
10499
10618
|
const { value, setValue, disabled } = useBoundProp(import_editor_props67.stringArrayPropTypeUtil);
|
|
10500
|
-
const [inputValue, setInputValue] = (0,
|
|
10619
|
+
const [inputValue, setInputValue] = (0, import_react82.useState)("");
|
|
10501
10620
|
const items2 = value || [];
|
|
10502
10621
|
const selectedValues = items2.map((item) => import_editor_props67.stringPropTypeUtil.extract(item)).filter((val) => val !== null);
|
|
10503
|
-
const suggestionOptions = (0,
|
|
10622
|
+
const suggestionOptions = (0, import_react82.useMemo)(
|
|
10504
10623
|
() => suggestions.map((suggestion) => `[${suggestion.value}]`),
|
|
10505
10624
|
[suggestions]
|
|
10506
10625
|
);
|
|
@@ -10728,24 +10847,24 @@ var GridSpanControl = createControl(
|
|
|
10728
10847
|
|
|
10729
10848
|
// src/components/promotions/display-conditions-control.tsx
|
|
10730
10849
|
var React137 = __toESM(require("react"));
|
|
10731
|
-
var
|
|
10850
|
+
var import_react84 = require("react");
|
|
10732
10851
|
var import_icons44 = require("@elementor/icons");
|
|
10733
10852
|
var import_ui121 = require("@elementor/ui");
|
|
10734
10853
|
var import_i18n71 = require("@wordpress/i18n");
|
|
10735
10854
|
|
|
10736
10855
|
// src/components/promotions/promotion-trigger.tsx
|
|
10737
10856
|
var React136 = __toESM(require("react"));
|
|
10738
|
-
var
|
|
10857
|
+
var import_react83 = require("react");
|
|
10739
10858
|
var import_editor_ui21 = require("@elementor/editor-ui");
|
|
10740
10859
|
var import_ui120 = require("@elementor/ui");
|
|
10741
10860
|
function getV4Promotion(key) {
|
|
10742
10861
|
return window.elementor?.config?.v4Promotions?.[key];
|
|
10743
10862
|
}
|
|
10744
|
-
var PromotionTrigger = (0,
|
|
10863
|
+
var PromotionTrigger = (0, import_react83.forwardRef)(
|
|
10745
10864
|
({ promotionKey, children, trackingData }, ref) => {
|
|
10746
|
-
const [isOpen, setIsOpen] = (0,
|
|
10865
|
+
const [isOpen, setIsOpen] = (0, import_react83.useState)(false);
|
|
10747
10866
|
const promotion = getV4Promotion(promotionKey);
|
|
10748
|
-
const toggle = (0,
|
|
10867
|
+
const toggle = (0, import_react83.useCallback)(() => {
|
|
10749
10868
|
setIsOpen((prev) => {
|
|
10750
10869
|
if (!prev) {
|
|
10751
10870
|
trackViewPromotion(trackingData);
|
|
@@ -10753,7 +10872,7 @@ var PromotionTrigger = (0, import_react81.forwardRef)(
|
|
|
10753
10872
|
return !prev;
|
|
10754
10873
|
});
|
|
10755
10874
|
}, [trackingData]);
|
|
10756
|
-
(0,
|
|
10875
|
+
(0, import_react83.useImperativeHandle)(ref, () => ({ toggle }), [toggle]);
|
|
10757
10876
|
return /* @__PURE__ */ React136.createElement(React136.Fragment, null, promotion && /* @__PURE__ */ React136.createElement(
|
|
10758
10877
|
import_editor_ui21.PromotionInfotip,
|
|
10759
10878
|
{
|
|
@@ -10787,7 +10906,7 @@ var PromotionTrigger = (0, import_react81.forwardRef)(
|
|
|
10787
10906
|
var ARIA_LABEL = (0, import_i18n71.__)("Display Conditions", "elementor");
|
|
10788
10907
|
var TRACKING_DATA2 = { target_name: "display_conditions", location_l2: "general" };
|
|
10789
10908
|
var DisplayConditionsControl = createControl(() => {
|
|
10790
|
-
const triggerRef = (0,
|
|
10909
|
+
const triggerRef = (0, import_react84.useRef)(null);
|
|
10791
10910
|
return /* @__PURE__ */ React137.createElement(
|
|
10792
10911
|
import_ui121.Stack,
|
|
10793
10912
|
{
|
|
@@ -10819,14 +10938,14 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
10819
10938
|
|
|
10820
10939
|
// src/components/promotions/attributes-control.tsx
|
|
10821
10940
|
var React138 = __toESM(require("react"));
|
|
10822
|
-
var
|
|
10941
|
+
var import_react85 = require("react");
|
|
10823
10942
|
var import_icons45 = require("@elementor/icons");
|
|
10824
10943
|
var import_ui122 = require("@elementor/ui");
|
|
10825
10944
|
var import_i18n72 = require("@wordpress/i18n");
|
|
10826
10945
|
var ARIA_LABEL2 = (0, import_i18n72.__)("Attributes", "elementor");
|
|
10827
10946
|
var TRACKING_DATA3 = { target_name: "attributes", location_l2: "general" };
|
|
10828
10947
|
var AttributesControl = createControl(() => {
|
|
10829
|
-
const triggerRef = (0,
|
|
10948
|
+
const triggerRef = (0, import_react85.useRef)(null);
|
|
10830
10949
|
return /* @__PURE__ */ React138.createElement(
|
|
10831
10950
|
import_ui122.Stack,
|
|
10832
10951
|
{
|
|
@@ -10863,7 +10982,7 @@ var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /*
|
|
|
10863
10982
|
|
|
10864
10983
|
// src/components/repeater/repeater.tsx
|
|
10865
10984
|
var React140 = __toESM(require("react"));
|
|
10866
|
-
var
|
|
10985
|
+
var import_react86 = require("react");
|
|
10867
10986
|
var import_icons47 = require("@elementor/icons");
|
|
10868
10987
|
var import_ui124 = require("@elementor/ui");
|
|
10869
10988
|
var import_i18n73 = require("@wordpress/i18n");
|
|
@@ -10885,7 +11004,7 @@ var Repeater3 = ({
|
|
|
10885
11004
|
isSortable = true,
|
|
10886
11005
|
adornment = ControlAdornments
|
|
10887
11006
|
}) => {
|
|
10888
|
-
const [openItem, setOpenItem] = (0,
|
|
11007
|
+
const [openItem, setOpenItem] = (0, import_react86.useState)(initialOpenItem);
|
|
10889
11008
|
const uniqueKeys = items2.map(
|
|
10890
11009
|
(item, index) => isSortable && "getId" in itemSettings ? itemSettings.getId({ item, index }) : String(index)
|
|
10891
11010
|
);
|
|
@@ -11061,10 +11180,10 @@ var RepeaterItem = ({
|
|
|
11061
11180
|
), /* @__PURE__ */ React140.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React140.createElement(import_ui124.Box, null, children({ anchorEl: ref }))));
|
|
11062
11181
|
};
|
|
11063
11182
|
var usePopover = (openOnMount, onOpen, onPopoverClose) => {
|
|
11064
|
-
const [ref, setRef] = (0,
|
|
11183
|
+
const [ref, setRef] = (0, import_react86.useState)(null);
|
|
11065
11184
|
const popoverState = (0, import_ui124.usePopupState)({ variant: "popover" });
|
|
11066
11185
|
const popoverProps = (0, import_ui124.bindPopover)(popoverState);
|
|
11067
|
-
(0,
|
|
11186
|
+
(0, import_react86.useEffect)(() => {
|
|
11068
11187
|
if (openOnMount && ref) {
|
|
11069
11188
|
popoverState.open(ref);
|
|
11070
11189
|
onOpen?.();
|
|
@@ -11127,7 +11246,7 @@ var differsFromExternal = (newState, externalState) => {
|
|
|
11127
11246
|
|
|
11128
11247
|
// src/components/size/unit-select.tsx
|
|
11129
11248
|
var React141 = __toESM(require("react"));
|
|
11130
|
-
var
|
|
11249
|
+
var import_react87 = require("react");
|
|
11131
11250
|
var import_editor_ui22 = require("@elementor/editor-ui");
|
|
11132
11251
|
var import_ui125 = require("@elementor/ui");
|
|
11133
11252
|
var menuItemContentStyles2 = {
|
|
@@ -11138,7 +11257,7 @@ var menuItemContentStyles2 = {
|
|
|
11138
11257
|
var UnitSelect = ({ value, showPrimaryColor, onClick, options }) => {
|
|
11139
11258
|
const popupState = (0, import_ui125.usePopupState)({
|
|
11140
11259
|
variant: "popover",
|
|
11141
|
-
popupId: (0,
|
|
11260
|
+
popupId: (0, import_react87.useId)()
|
|
11142
11261
|
});
|
|
11143
11262
|
const handleMenuItemClick = (index) => {
|
|
11144
11263
|
onClick(options[index]);
|
|
@@ -11174,8 +11293,8 @@ var StyledButton3 = (0, import_ui125.styled)(import_ui125.Button, {
|
|
|
11174
11293
|
|
|
11175
11294
|
// src/components/size/unstable-size-input.tsx
|
|
11176
11295
|
var React142 = __toESM(require("react"));
|
|
11177
|
-
var
|
|
11178
|
-
var UnstableSizeInput = (0,
|
|
11296
|
+
var import_react88 = require("react");
|
|
11297
|
+
var UnstableSizeInput = (0, import_react88.forwardRef)(
|
|
11179
11298
|
({ type, value, onChange, onKeyDown, onKeyUp, InputProps, onBlur, focused, disabled }, ref) => {
|
|
11180
11299
|
return /* @__PURE__ */ React142.createElement(
|
|
11181
11300
|
NumberInput,
|
|
@@ -11243,7 +11362,7 @@ var hasValue = (value) => {
|
|
|
11243
11362
|
};
|
|
11244
11363
|
|
|
11245
11364
|
// src/hooks/use-font-families.ts
|
|
11246
|
-
var
|
|
11365
|
+
var import_react89 = require("react");
|
|
11247
11366
|
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
11248
11367
|
var getFontControlConfig = () => {
|
|
11249
11368
|
const { controls } = (0, import_editor_v1_adapters5.getElementorConfig)();
|
|
@@ -11251,7 +11370,7 @@ var getFontControlConfig = () => {
|
|
|
11251
11370
|
};
|
|
11252
11371
|
var useFontFamilies = () => {
|
|
11253
11372
|
const { groups, options } = getFontControlConfig();
|
|
11254
|
-
return (0,
|
|
11373
|
+
return (0, import_react89.useMemo)(() => {
|
|
11255
11374
|
if (!groups || !options) {
|
|
11256
11375
|
return [];
|
|
11257
11376
|
}
|
|
@@ -11362,6 +11481,7 @@ var useFontFamilies = () => {
|
|
|
11362
11481
|
registerIconLibraryProvider,
|
|
11363
11482
|
resetFontAwesome7IconsCache,
|
|
11364
11483
|
resolveFontAwesome7Icon,
|
|
11484
|
+
resolveProviderIconPreviewSvg,
|
|
11365
11485
|
resolveProviderIconSvg,
|
|
11366
11486
|
trackUpgradePromotionClick,
|
|
11367
11487
|
trackViewPromotion,
|