@elementor/editor-editing-panel 4.3.0-1060 → 4.3.0-1062
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.js +575 -311
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +492 -222
- package/dist/index.mjs.map +1 -1
- package/package.json +24 -24
- package/src/controls-registry/element-controls/list-items-control/list-actions.ts +129 -0
- package/src/controls-registry/element-controls/list-items-control/list-items-control.tsx +152 -0
- package/src/controls-registry/element-controls/list-items-control/use-show-markers-write-through.ts +89 -0
- package/src/controls-registry/element-controls/registry.ts +2 -0
package/dist/index.mjs
CHANGED
|
@@ -5992,7 +5992,7 @@ var buildItemModel = (position, showIcon) => {
|
|
|
5992
5992
|
};
|
|
5993
5993
|
};
|
|
5994
5994
|
var useActions = () => {
|
|
5995
|
-
const
|
|
5995
|
+
const addItem2 = ({
|
|
5996
5996
|
accordionId,
|
|
5997
5997
|
existingTitles,
|
|
5998
5998
|
items: items3,
|
|
@@ -6025,19 +6025,19 @@ var useActions = () => {
|
|
|
6025
6025
|
titles.push(getItemTitle(position));
|
|
6026
6026
|
});
|
|
6027
6027
|
};
|
|
6028
|
-
const
|
|
6028
|
+
const removeItem2 = ({ items: items3 }) => {
|
|
6029
6029
|
removeElements({
|
|
6030
6030
|
title: __68("Accordion", "elementor"),
|
|
6031
6031
|
elementIds: items3.map(({ item }) => item.id)
|
|
6032
6032
|
});
|
|
6033
6033
|
};
|
|
6034
|
-
const
|
|
6034
|
+
const duplicateItem2 = ({ items: items3 }) => {
|
|
6035
6035
|
duplicateElements({
|
|
6036
6036
|
title: __68("Duplicate Accordion Item", "elementor"),
|
|
6037
6037
|
elementIds: items3.map(({ item }) => item.id)
|
|
6038
6038
|
});
|
|
6039
6039
|
};
|
|
6040
|
-
const
|
|
6040
|
+
const moveItem2 = ({
|
|
6041
6041
|
accordionId,
|
|
6042
6042
|
movedElementId,
|
|
6043
6043
|
toIndex
|
|
@@ -6059,10 +6059,10 @@ var useActions = () => {
|
|
|
6059
6059
|
});
|
|
6060
6060
|
};
|
|
6061
6061
|
return {
|
|
6062
|
-
addItem,
|
|
6063
|
-
removeItem,
|
|
6064
|
-
duplicateItem,
|
|
6065
|
-
moveItem
|
|
6062
|
+
addItem: addItem2,
|
|
6063
|
+
removeItem: removeItem2,
|
|
6064
|
+
duplicateItem: duplicateItem2,
|
|
6065
|
+
moveItem: moveItem2
|
|
6066
6066
|
};
|
|
6067
6067
|
};
|
|
6068
6068
|
|
|
@@ -6148,7 +6148,7 @@ function useShowIconWriteThrough(accordionId, showIcon) {
|
|
|
6148
6148
|
// src/controls-registry/element-controls/accordion-items-control/accordion-items-control.tsx
|
|
6149
6149
|
var AccordionItemsControl = ({ label }) => {
|
|
6150
6150
|
const { element, settings } = useElement();
|
|
6151
|
-
const { addItem, duplicateItem, moveItem, removeItem } = useActions();
|
|
6151
|
+
const { addItem: addItem2, duplicateItem: duplicateItem2, moveItem: moveItem2, removeItem: removeItem2 } = useActions();
|
|
6152
6152
|
const { [ACCORDION_ITEM_ELEMENT_TYPE]: items3 } = useElementChildren(
|
|
6153
6153
|
element.id,
|
|
6154
6154
|
{ [ACCORDION_ELEMENT_TYPE]: ACCORDION_ITEM_ELEMENT_TYPE },
|
|
@@ -6165,7 +6165,7 @@ var AccordionItemsControl = ({ label }) => {
|
|
|
6165
6165
|
});
|
|
6166
6166
|
const setValue = (_newValues, _options, meta) => {
|
|
6167
6167
|
if (meta?.action?.type === "add") {
|
|
6168
|
-
return
|
|
6168
|
+
return addItem2({
|
|
6169
6169
|
accordionId: element.id,
|
|
6170
6170
|
// The new item's number comes from the titles already in use, not from the item count -
|
|
6171
6171
|
// see `getNextItemNumber`.
|
|
@@ -6175,14 +6175,14 @@ var AccordionItemsControl = ({ label }) => {
|
|
|
6175
6175
|
});
|
|
6176
6176
|
}
|
|
6177
6177
|
if (meta?.action?.type === "remove") {
|
|
6178
|
-
return
|
|
6178
|
+
return removeItem2({ items: meta.action.payload });
|
|
6179
6179
|
}
|
|
6180
6180
|
if (meta?.action?.type === "duplicate") {
|
|
6181
|
-
return
|
|
6181
|
+
return duplicateItem2({ items: meta.action.payload });
|
|
6182
6182
|
}
|
|
6183
6183
|
if (meta?.action?.type === "reorder") {
|
|
6184
6184
|
const { from, to } = meta.action.payload;
|
|
6185
|
-
return
|
|
6185
|
+
return moveItem2({
|
|
6186
6186
|
accordionId: element.id,
|
|
6187
6187
|
movedElementId: items3[from].id,
|
|
6188
6188
|
toIndex: to
|
|
@@ -6235,27 +6235,296 @@ var ItemNameControl = ({ elementId }) => {
|
|
|
6235
6235
|
));
|
|
6236
6236
|
};
|
|
6237
6237
|
|
|
6238
|
-
// src/controls-registry/element-controls/
|
|
6238
|
+
// src/controls-registry/element-controls/list-items-control/list-items-control.tsx
|
|
6239
6239
|
import * as React96 from "react";
|
|
6240
|
+
import { ControlFormLabel as ControlFormLabel4, Repeater as Repeater2 } from "@elementor/editor-controls";
|
|
6241
|
+
import { updateElementEditorSettings as updateElementEditorSettings3, useElementChildren as useElementChildren2, useElementEditorSettings as useElementEditorSettings3 } from "@elementor/editor-elements";
|
|
6242
|
+
import { booleanPropTypeUtil as booleanPropTypeUtil7 } from "@elementor/editor-props";
|
|
6243
|
+
import { Stack as Stack16, TextField as TextField3 } from "@elementor/ui";
|
|
6244
|
+
import { __ as __73 } from "@wordpress/i18n";
|
|
6245
|
+
|
|
6246
|
+
// src/controls-registry/element-controls/list-items-control/list-actions.ts
|
|
6240
6247
|
import {
|
|
6241
|
-
|
|
6242
|
-
|
|
6248
|
+
createElements as createElements2,
|
|
6249
|
+
duplicateElements as duplicateElements2,
|
|
6250
|
+
getContainer as getContainer4,
|
|
6251
|
+
moveElements as moveElements2,
|
|
6252
|
+
removeElements as removeElements2
|
|
6253
|
+
} from "@elementor/editor-elements";
|
|
6254
|
+
import { booleanPropTypeUtil as booleanPropTypeUtil5 } from "@elementor/editor-props";
|
|
6255
|
+
import { __ as __71 } from "@wordpress/i18n";
|
|
6256
|
+
var LIST_ITEM_ELEMENT_TYPE = "e-list-item";
|
|
6257
|
+
var TRAILING_NUMBER2 = /(\d+)\s*$/;
|
|
6258
|
+
var getItemTitle2 = (position) => `Item ${position}`;
|
|
6259
|
+
var getNextItemNumber2 = (existingTitles) => {
|
|
6260
|
+
const taken = new Set(existingTitles.filter((title) => Boolean(title)));
|
|
6261
|
+
const highest = existingTitles.reduce((max, title) => {
|
|
6262
|
+
const [, trailingNumber] = title?.match(TRAILING_NUMBER2) ?? [];
|
|
6263
|
+
const parsed = trailingNumber ? Number(trailingNumber) : 0;
|
|
6264
|
+
return Number.isFinite(parsed) && parsed > max ? parsed : max;
|
|
6265
|
+
}, 0);
|
|
6266
|
+
let next = highest + 1;
|
|
6267
|
+
while (taken.has(getItemTitle2(next))) {
|
|
6268
|
+
next += 1;
|
|
6269
|
+
}
|
|
6270
|
+
return next;
|
|
6271
|
+
};
|
|
6272
|
+
var duplicateItem = ({ items: items3 }) => {
|
|
6273
|
+
duplicateElements2({
|
|
6274
|
+
elementIds: items3.map(({ item }) => item.id),
|
|
6275
|
+
title: __71("Duplicate List Item", "elementor")
|
|
6276
|
+
});
|
|
6277
|
+
};
|
|
6278
|
+
var moveItem = ({
|
|
6279
|
+
toIndex,
|
|
6280
|
+
listContainerId,
|
|
6281
|
+
movedElementId
|
|
6282
|
+
}) => {
|
|
6283
|
+
const movedElement = getContainer4(movedElementId);
|
|
6284
|
+
const listContainer = getContainer4(listContainerId);
|
|
6285
|
+
if (!movedElement || !listContainer) {
|
|
6286
|
+
throw new Error("List item or list container not found");
|
|
6287
|
+
}
|
|
6288
|
+
moveElements2({
|
|
6289
|
+
title: __71("Reorder List Items", "elementor"),
|
|
6290
|
+
moves: [
|
|
6291
|
+
{
|
|
6292
|
+
element: movedElement,
|
|
6293
|
+
targetContainer: listContainer,
|
|
6294
|
+
options: { at: toIndex }
|
|
6295
|
+
}
|
|
6296
|
+
]
|
|
6297
|
+
});
|
|
6298
|
+
};
|
|
6299
|
+
var removeItem = ({ items: items3 }) => {
|
|
6300
|
+
removeElements2({
|
|
6301
|
+
title: __71("List Items", "elementor"),
|
|
6302
|
+
elementIds: items3.map(({ item }) => item.id)
|
|
6303
|
+
});
|
|
6304
|
+
};
|
|
6305
|
+
var addItem = ({
|
|
6306
|
+
existingTitles,
|
|
6307
|
+
listContainerId,
|
|
6308
|
+
items: items3,
|
|
6309
|
+
showMarkers
|
|
6310
|
+
}) => {
|
|
6311
|
+
const listContainer = getContainer4(listContainerId);
|
|
6312
|
+
if (!listContainer) {
|
|
6313
|
+
throw new Error("List container not found");
|
|
6314
|
+
}
|
|
6315
|
+
const titles = [...existingTitles];
|
|
6316
|
+
items3.forEach(({ index }) => {
|
|
6317
|
+
const position = getNextItemNumber2(titles);
|
|
6318
|
+
createElements2({
|
|
6319
|
+
title: __71("List Items", "elementor"),
|
|
6320
|
+
elements: [
|
|
6321
|
+
{
|
|
6322
|
+
container: listContainer,
|
|
6323
|
+
model: {
|
|
6324
|
+
elType: LIST_ITEM_ELEMENT_TYPE,
|
|
6325
|
+
settings: {
|
|
6326
|
+
show_markers: booleanPropTypeUtil5.create(showMarkers)
|
|
6327
|
+
},
|
|
6328
|
+
hydrateDefaultChildren: true,
|
|
6329
|
+
editor_settings: {
|
|
6330
|
+
title: getItemTitle2(position),
|
|
6331
|
+
initial_position: position
|
|
6332
|
+
}
|
|
6333
|
+
},
|
|
6334
|
+
options: { at: index }
|
|
6335
|
+
}
|
|
6336
|
+
]
|
|
6337
|
+
});
|
|
6338
|
+
titles.push(getItemTitle2(position));
|
|
6339
|
+
});
|
|
6340
|
+
};
|
|
6341
|
+
|
|
6342
|
+
// src/controls-registry/element-controls/list-items-control/use-show-markers-write-through.ts
|
|
6343
|
+
import { useEffect as useEffect10, useRef as useRef21 } from "react";
|
|
6344
|
+
import { getContainer as getContainer5, getElementSettings as getElementSettings3, updateElementSettings as updateElementSettings5 } from "@elementor/editor-elements";
|
|
6345
|
+
import { booleanPropTypeUtil as booleanPropTypeUtil6 } from "@elementor/editor-props";
|
|
6346
|
+
import { undoable as undoable6 } from "@elementor/editor-v1-adapters";
|
|
6347
|
+
import { __ as __72 } from "@wordpress/i18n";
|
|
6348
|
+
var cascadeShowMarkersToItems = undoable6(
|
|
6349
|
+
{
|
|
6350
|
+
do: ({ listId, showMarkers }) => {
|
|
6351
|
+
const itemIds = getListItemIds(listId);
|
|
6352
|
+
const previous = Object.fromEntries(
|
|
6353
|
+
itemIds.map(
|
|
6354
|
+
(itemId) => [
|
|
6355
|
+
itemId,
|
|
6356
|
+
getElementSettings3(itemId, [
|
|
6357
|
+
"show_markers"
|
|
6358
|
+
]).show_markers
|
|
6359
|
+
]
|
|
6360
|
+
)
|
|
6361
|
+
);
|
|
6362
|
+
itemIds.forEach((itemId) => {
|
|
6363
|
+
updateElementSettings5({
|
|
6364
|
+
id: itemId,
|
|
6365
|
+
props: { show_markers: booleanPropTypeUtil6.create(showMarkers) },
|
|
6366
|
+
withHistory: false
|
|
6367
|
+
});
|
|
6368
|
+
});
|
|
6369
|
+
return { previous };
|
|
6370
|
+
},
|
|
6371
|
+
undo: (_payload, { previous }) => {
|
|
6372
|
+
Object.entries(previous).forEach(([itemId, previousValue]) => {
|
|
6373
|
+
updateElementSettings5({
|
|
6374
|
+
id: itemId,
|
|
6375
|
+
props: { show_markers: previousValue ?? null },
|
|
6376
|
+
withHistory: false
|
|
6377
|
+
});
|
|
6378
|
+
});
|
|
6379
|
+
}
|
|
6380
|
+
},
|
|
6381
|
+
{
|
|
6382
|
+
title: __72("List", "elementor"),
|
|
6383
|
+
subtitle: __72("Show Markers", "elementor"),
|
|
6384
|
+
debounce: { wait: HISTORY_DEBOUNCE_WAIT }
|
|
6385
|
+
}
|
|
6386
|
+
);
|
|
6387
|
+
function getListItemIds(listId) {
|
|
6388
|
+
const list = getContainer5(listId);
|
|
6389
|
+
const itemContainers = (list?.children ?? []).filter(
|
|
6390
|
+
(child) => child.model.get("elType") === LIST_ITEM_ELEMENT_TYPE
|
|
6391
|
+
);
|
|
6392
|
+
return itemContainers.map((item) => item.id);
|
|
6393
|
+
}
|
|
6394
|
+
function useShowMarkersWriteThrough(listId, showMarkers) {
|
|
6395
|
+
const previousRef = useRef21(null);
|
|
6396
|
+
useEffect10(() => {
|
|
6397
|
+
const previous = previousRef.current;
|
|
6398
|
+
previousRef.current = { listId, showMarkers };
|
|
6399
|
+
if (!previous || previous.listId !== listId || previous.showMarkers === showMarkers) {
|
|
6400
|
+
return;
|
|
6401
|
+
}
|
|
6402
|
+
cascadeShowMarkersToItems({ listId, showMarkers });
|
|
6403
|
+
}, [listId, showMarkers]);
|
|
6404
|
+
}
|
|
6405
|
+
|
|
6406
|
+
// src/controls-registry/element-controls/list-items-control/list-items-control.tsx
|
|
6407
|
+
var LIST_ELEMENT_TYPE = "e-list";
|
|
6408
|
+
var getEffectiveListItemLabel = (label, fallbackLabel) => {
|
|
6409
|
+
return label?.trim() ? label : fallbackLabel;
|
|
6410
|
+
};
|
|
6411
|
+
var getDefaultListItemLabel = (index) => {
|
|
6412
|
+
return `Item ${index + 1}`;
|
|
6413
|
+
};
|
|
6414
|
+
var ListItemsControl = ({ label }) => {
|
|
6415
|
+
return /* @__PURE__ */ React96.createElement(ListItemsControlContent, { label });
|
|
6416
|
+
};
|
|
6417
|
+
var ListItemsControlContent = ({ label }) => {
|
|
6418
|
+
const { element, settings } = useElement();
|
|
6419
|
+
const { [LIST_ITEM_ELEMENT_TYPE]: listItems } = useElementChildren2(
|
|
6420
|
+
element.id,
|
|
6421
|
+
{ [LIST_ELEMENT_TYPE]: LIST_ITEM_ELEMENT_TYPE },
|
|
6422
|
+
{ includeSelfAsParent: true }
|
|
6423
|
+
);
|
|
6424
|
+
const showMarkers = booleanPropTypeUtil7.extract(settings.show_markers) ?? true;
|
|
6425
|
+
useShowMarkersWriteThrough(element.id, showMarkers);
|
|
6426
|
+
const repeaterValues = listItems.map((item, index) => ({
|
|
6427
|
+
id: item.id,
|
|
6428
|
+
title: item.editorSettings?.title ?? getDefaultListItemLabel(index),
|
|
6429
|
+
index
|
|
6430
|
+
}));
|
|
6431
|
+
const setValue = (_newValues, _options, meta) => {
|
|
6432
|
+
if (meta?.action?.type === "add") {
|
|
6433
|
+
return addItem({
|
|
6434
|
+
existingTitles: repeaterValues.map(({ title }) => title),
|
|
6435
|
+
listContainerId: element.id,
|
|
6436
|
+
items: meta.action.payload,
|
|
6437
|
+
showMarkers
|
|
6438
|
+
});
|
|
6439
|
+
}
|
|
6440
|
+
if (meta?.action?.type === "remove") {
|
|
6441
|
+
return removeItem({ items: meta.action.payload });
|
|
6442
|
+
}
|
|
6443
|
+
if (meta?.action?.type === "duplicate") {
|
|
6444
|
+
return duplicateItem({ items: meta.action.payload });
|
|
6445
|
+
}
|
|
6446
|
+
if (meta?.action?.type === "reorder") {
|
|
6447
|
+
const { from, to } = meta.action.payload;
|
|
6448
|
+
return moveItem({
|
|
6449
|
+
toIndex: to,
|
|
6450
|
+
listContainerId: element.id,
|
|
6451
|
+
movedElementId: listItems[from].id
|
|
6452
|
+
});
|
|
6453
|
+
}
|
|
6454
|
+
};
|
|
6455
|
+
return /* @__PURE__ */ React96.createElement(
|
|
6456
|
+
Repeater2,
|
|
6457
|
+
{
|
|
6458
|
+
showToggle: false,
|
|
6459
|
+
values: repeaterValues,
|
|
6460
|
+
setValues: setValue,
|
|
6461
|
+
showRemove: repeaterValues.length > 1,
|
|
6462
|
+
label,
|
|
6463
|
+
adornment: () => null,
|
|
6464
|
+
itemSettings: {
|
|
6465
|
+
getId: ({ item }) => item.id,
|
|
6466
|
+
initialValues: { id: "", title: "Item" },
|
|
6467
|
+
Label: ItemLabel2,
|
|
6468
|
+
Content: ItemContent2,
|
|
6469
|
+
Icon: () => null
|
|
6470
|
+
}
|
|
6471
|
+
}
|
|
6472
|
+
);
|
|
6473
|
+
};
|
|
6474
|
+
var ItemLabel2 = ({ value, index }) => {
|
|
6475
|
+
const fallbackLabel = value.title ?? getDefaultListItemLabel(index);
|
|
6476
|
+
return /* @__PURE__ */ React96.createElement(Stack16, { sx: { minHeight: 20 }, direction: "row", alignItems: "center", gap: 1.5 }, value.id ? /* @__PURE__ */ React96.createElement(ListItemRepeaterLabel, { elementId: value.id, fallbackLabel }) : /* @__PURE__ */ React96.createElement("span", null, fallbackLabel));
|
|
6477
|
+
};
|
|
6478
|
+
var ItemContent2 = ({ value }) => {
|
|
6479
|
+
if (!value.id) {
|
|
6480
|
+
return null;
|
|
6481
|
+
}
|
|
6482
|
+
return /* @__PURE__ */ React96.createElement(Stack16, { p: 2, gap: 1.5 }, /* @__PURE__ */ React96.createElement(ListItemLabelControl, { elementId: value.id, fallbackLabel: value.title ?? "" }));
|
|
6483
|
+
};
|
|
6484
|
+
var ListItemRepeaterLabel = ({ elementId, fallbackLabel }) => {
|
|
6485
|
+
const editorSettings = useElementEditorSettings3(elementId);
|
|
6486
|
+
const label = getEffectiveListItemLabel(editorSettings?.title, fallbackLabel);
|
|
6487
|
+
return /* @__PURE__ */ React96.createElement("span", null, label);
|
|
6488
|
+
};
|
|
6489
|
+
var ListItemLabelControl = ({ elementId, fallbackLabel }) => {
|
|
6490
|
+
const editorSettings = useElementEditorSettings3(elementId);
|
|
6491
|
+
const label = getEffectiveListItemLabel(editorSettings?.title, fallbackLabel);
|
|
6492
|
+
return /* @__PURE__ */ React96.createElement(Stack16, { gap: 1 }, /* @__PURE__ */ React96.createElement(ControlFormLabel4, null, __73("Item name", "elementor")), /* @__PURE__ */ React96.createElement(
|
|
6493
|
+
TextField3,
|
|
6494
|
+
{
|
|
6495
|
+
size: "tiny",
|
|
6496
|
+
value: label,
|
|
6497
|
+
onChange: ({ target }) => {
|
|
6498
|
+
updateElementEditorSettings3({
|
|
6499
|
+
elementId,
|
|
6500
|
+
settings: { title: target.value }
|
|
6501
|
+
});
|
|
6502
|
+
}
|
|
6503
|
+
}
|
|
6504
|
+
));
|
|
6505
|
+
};
|
|
6506
|
+
|
|
6507
|
+
// src/controls-registry/element-controls/tabs-control/tabs-control.tsx
|
|
6508
|
+
import * as React97 from "react";
|
|
6509
|
+
import {
|
|
6510
|
+
ControlFormLabel as ControlFormLabel5,
|
|
6511
|
+
Repeater as Repeater3,
|
|
6243
6512
|
useBoundProp as useBoundProp7
|
|
6244
6513
|
} from "@elementor/editor-controls";
|
|
6245
6514
|
import {
|
|
6246
|
-
updateElementEditorSettings as
|
|
6247
|
-
useElementChildren as
|
|
6248
|
-
useElementEditorSettings as
|
|
6515
|
+
updateElementEditorSettings as updateElementEditorSettings4,
|
|
6516
|
+
useElementChildren as useElementChildren3,
|
|
6517
|
+
useElementEditorSettings as useElementEditorSettings4
|
|
6249
6518
|
} from "@elementor/editor-elements";
|
|
6250
6519
|
import { numberPropTypeUtil as numberPropTypeUtil4 } from "@elementor/editor-props";
|
|
6251
6520
|
import { InfoCircleFilledIcon as InfoCircleFilledIcon2 } from "@elementor/icons";
|
|
6252
|
-
import { Alert as Alert4, Chip as Chip4, Infotip as Infotip2, Stack as
|
|
6253
|
-
import { __ as
|
|
6521
|
+
import { Alert as Alert4, Chip as Chip4, Infotip as Infotip2, Stack as Stack17, Switch as Switch2, TextField as TextField4, Typography as Typography5 } from "@elementor/ui";
|
|
6522
|
+
import { __ as __75 } from "@wordpress/i18n";
|
|
6254
6523
|
|
|
6255
6524
|
// src/controls-registry/element-controls/get-element-by-type.ts
|
|
6256
|
-
import { getContainer as
|
|
6525
|
+
import { getContainer as getContainer6 } from "@elementor/editor-elements";
|
|
6257
6526
|
var getElementByType = (elementId, type) => {
|
|
6258
|
-
const currentElement =
|
|
6527
|
+
const currentElement = getContainer6(elementId);
|
|
6259
6528
|
if (!currentElement) {
|
|
6260
6529
|
return null;
|
|
6261
6530
|
}
|
|
@@ -6268,20 +6537,20 @@ var getElementByType = (elementId, type) => {
|
|
|
6268
6537
|
// src/controls-registry/element-controls/tabs-control/use-actions.ts
|
|
6269
6538
|
import { useBoundProp as useBoundProp6 } from "@elementor/editor-controls";
|
|
6270
6539
|
import {
|
|
6271
|
-
createElements as
|
|
6272
|
-
duplicateElements as
|
|
6273
|
-
getContainer as
|
|
6274
|
-
moveElements as
|
|
6275
|
-
removeElements as
|
|
6540
|
+
createElements as createElements3,
|
|
6541
|
+
duplicateElements as duplicateElements3,
|
|
6542
|
+
getContainer as getContainer7,
|
|
6543
|
+
moveElements as moveElements3,
|
|
6544
|
+
removeElements as removeElements3
|
|
6276
6545
|
} from "@elementor/editor-elements";
|
|
6277
6546
|
import { numberPropTypeUtil as numberPropTypeUtil3 } from "@elementor/editor-props";
|
|
6278
|
-
import { __ as
|
|
6547
|
+
import { __ as __74 } from "@wordpress/i18n";
|
|
6279
6548
|
var TAB_ELEMENT_TYPE = "e-tab";
|
|
6280
6549
|
var TAB_CONTENT_ELEMENT_TYPE = "e-tab-content";
|
|
6281
6550
|
var useActions2 = () => {
|
|
6282
6551
|
const { value, setValue: setDefaultActiveTab } = useBoundProp6(numberPropTypeUtil3);
|
|
6283
6552
|
const defaultActiveTab = value ?? 0;
|
|
6284
|
-
const
|
|
6553
|
+
const duplicateItem2 = ({
|
|
6285
6554
|
items: items3,
|
|
6286
6555
|
tabContentAreaId
|
|
6287
6556
|
}) => {
|
|
@@ -6291,14 +6560,14 @@ var useActions2 = () => {
|
|
|
6291
6560
|
});
|
|
6292
6561
|
items3.forEach(({ item, index }) => {
|
|
6293
6562
|
const tabId = item.id;
|
|
6294
|
-
const tabContentAreaContainer =
|
|
6563
|
+
const tabContentAreaContainer = getContainer7(tabContentAreaId);
|
|
6295
6564
|
const tabContentId = tabContentAreaContainer?.children?.[index]?.id;
|
|
6296
6565
|
if (!tabContentId) {
|
|
6297
6566
|
throw new Error("Original content ID is required for duplication");
|
|
6298
6567
|
}
|
|
6299
|
-
|
|
6568
|
+
duplicateElements3({
|
|
6300
6569
|
elementIds: [tabId, tabContentId],
|
|
6301
|
-
title:
|
|
6570
|
+
title: __74("Duplicate Tab", "elementor"),
|
|
6302
6571
|
onDuplicateElements: () => {
|
|
6303
6572
|
if (newDefault !== defaultActiveTab) {
|
|
6304
6573
|
setDefaultActiveTab(newDefault, {}, { withHistory: false });
|
|
@@ -6312,17 +6581,17 @@ var useActions2 = () => {
|
|
|
6312
6581
|
});
|
|
6313
6582
|
});
|
|
6314
6583
|
};
|
|
6315
|
-
const
|
|
6584
|
+
const moveItem2 = ({
|
|
6316
6585
|
toIndex,
|
|
6317
6586
|
tabsMenuId,
|
|
6318
6587
|
tabContentAreaId,
|
|
6319
6588
|
movedElementId,
|
|
6320
6589
|
movedElementIndex
|
|
6321
6590
|
}) => {
|
|
6322
|
-
const tabContentContainer =
|
|
6591
|
+
const tabContentContainer = getContainer7(tabContentAreaId);
|
|
6323
6592
|
const tabContent = tabContentContainer?.children?.[movedElementIndex];
|
|
6324
|
-
const movedElement =
|
|
6325
|
-
const tabsMenu =
|
|
6593
|
+
const movedElement = getContainer7(movedElementId);
|
|
6594
|
+
const tabsMenu = getContainer7(tabsMenuId);
|
|
6326
6595
|
if (!tabContent) {
|
|
6327
6596
|
throw new Error("Content element is required");
|
|
6328
6597
|
}
|
|
@@ -6334,8 +6603,8 @@ var useActions2 = () => {
|
|
|
6334
6603
|
to: toIndex,
|
|
6335
6604
|
defaultActiveTab
|
|
6336
6605
|
});
|
|
6337
|
-
|
|
6338
|
-
title:
|
|
6606
|
+
moveElements3({
|
|
6607
|
+
title: __74("Reorder Tabs", "elementor"),
|
|
6339
6608
|
moves: [
|
|
6340
6609
|
{
|
|
6341
6610
|
element: movedElement,
|
|
@@ -6360,7 +6629,7 @@ var useActions2 = () => {
|
|
|
6360
6629
|
}
|
|
6361
6630
|
});
|
|
6362
6631
|
};
|
|
6363
|
-
const
|
|
6632
|
+
const removeItem2 = ({
|
|
6364
6633
|
items: items3,
|
|
6365
6634
|
tabContentAreaId
|
|
6366
6635
|
}) => {
|
|
@@ -6368,11 +6637,11 @@ var useActions2 = () => {
|
|
|
6368
6637
|
items: items3,
|
|
6369
6638
|
defaultActiveTab
|
|
6370
6639
|
});
|
|
6371
|
-
|
|
6372
|
-
title:
|
|
6640
|
+
removeElements3({
|
|
6641
|
+
title: __74("Tabs", "elementor"),
|
|
6373
6642
|
elementIds: items3.flatMap(({ item, index }) => {
|
|
6374
6643
|
const tabId = item.id;
|
|
6375
|
-
const tabContentContainer =
|
|
6644
|
+
const tabContentContainer = getContainer7(tabContentAreaId);
|
|
6376
6645
|
const tabContentId = tabContentContainer?.children?.[index]?.id;
|
|
6377
6646
|
if (!tabContentId) {
|
|
6378
6647
|
throw new Error("Content ID is required");
|
|
@@ -6391,20 +6660,20 @@ var useActions2 = () => {
|
|
|
6391
6660
|
}
|
|
6392
6661
|
});
|
|
6393
6662
|
};
|
|
6394
|
-
const
|
|
6663
|
+
const addItem2 = ({
|
|
6395
6664
|
tabContentAreaId,
|
|
6396
6665
|
tabsMenuId,
|
|
6397
6666
|
items: items3
|
|
6398
6667
|
}) => {
|
|
6399
|
-
const tabContentArea =
|
|
6400
|
-
const tabsMenu =
|
|
6668
|
+
const tabContentArea = getContainer7(tabContentAreaId);
|
|
6669
|
+
const tabsMenu = getContainer7(tabsMenuId);
|
|
6401
6670
|
if (!tabContentArea || !tabsMenu) {
|
|
6402
6671
|
throw new Error("Tab containers not found");
|
|
6403
6672
|
}
|
|
6404
6673
|
items3.forEach(({ index }) => {
|
|
6405
6674
|
const position = index + 1;
|
|
6406
|
-
|
|
6407
|
-
title:
|
|
6675
|
+
createElements3({
|
|
6676
|
+
title: __74("Tabs", "elementor"),
|
|
6408
6677
|
elements: [
|
|
6409
6678
|
{
|
|
6410
6679
|
container: tabContentArea,
|
|
@@ -6425,10 +6694,10 @@ var useActions2 = () => {
|
|
|
6425
6694
|
});
|
|
6426
6695
|
};
|
|
6427
6696
|
return {
|
|
6428
|
-
duplicateItem,
|
|
6429
|
-
moveItem,
|
|
6430
|
-
removeItem,
|
|
6431
|
-
addItem
|
|
6697
|
+
duplicateItem: duplicateItem2,
|
|
6698
|
+
moveItem: moveItem2,
|
|
6699
|
+
removeItem: removeItem2,
|
|
6700
|
+
addItem: addItem2
|
|
6432
6701
|
};
|
|
6433
6702
|
};
|
|
6434
6703
|
var calculateDefaultOnMove = ({
|
|
@@ -6473,12 +6742,12 @@ var calculateDefaultOnDuplicate = ({
|
|
|
6473
6742
|
var TAB_MENU_ELEMENT_TYPE = "e-tabs-menu";
|
|
6474
6743
|
var TAB_CONTENT_AREA_ELEMENT_TYPE = "e-tabs-content-area";
|
|
6475
6744
|
var TabsControl = ({ label }) => {
|
|
6476
|
-
return /* @__PURE__ */
|
|
6745
|
+
return /* @__PURE__ */ React97.createElement(SettingsField, { bind: "default-active-tab", propDisplayName: __75("Tabs", "elementor") }, /* @__PURE__ */ React97.createElement(TabsControlContent, { label }));
|
|
6477
6746
|
};
|
|
6478
6747
|
var TabsControlContent = ({ label }) => {
|
|
6479
6748
|
const { element } = useElement();
|
|
6480
|
-
const { addItem, duplicateItem, moveItem, removeItem } = useActions2();
|
|
6481
|
-
const { [TAB_ELEMENT_TYPE]: tabLinks } =
|
|
6749
|
+
const { addItem: addItem2, duplicateItem: duplicateItem2, moveItem: moveItem2, removeItem: removeItem2 } = useActions2();
|
|
6750
|
+
const { [TAB_ELEMENT_TYPE]: tabLinks } = useElementChildren3(element.id, {
|
|
6482
6751
|
[TAB_MENU_ELEMENT_TYPE]: TAB_ELEMENT_TYPE
|
|
6483
6752
|
});
|
|
6484
6753
|
const tabList = getElementByType(element.id, TAB_MENU_ELEMENT_TYPE);
|
|
@@ -6493,22 +6762,22 @@ var TabsControlContent = ({ label }) => {
|
|
|
6493
6762
|
const setValue = (_newValues, _options, meta) => {
|
|
6494
6763
|
if (meta?.action?.type === "add") {
|
|
6495
6764
|
const items3 = meta.action.payload;
|
|
6496
|
-
return
|
|
6765
|
+
return addItem2({ tabContentAreaId: tabContentArea.id, items: items3, tabsMenuId: tabList.id });
|
|
6497
6766
|
}
|
|
6498
6767
|
if (meta?.action?.type === "remove") {
|
|
6499
6768
|
const items3 = meta.action.payload;
|
|
6500
|
-
return
|
|
6769
|
+
return removeItem2({
|
|
6501
6770
|
items: items3,
|
|
6502
6771
|
tabContentAreaId: tabContentArea.id
|
|
6503
6772
|
});
|
|
6504
6773
|
}
|
|
6505
6774
|
if (meta?.action?.type === "duplicate") {
|
|
6506
6775
|
const items3 = meta.action.payload;
|
|
6507
|
-
return
|
|
6776
|
+
return duplicateItem2({ items: items3, tabContentAreaId: tabContentArea.id });
|
|
6508
6777
|
}
|
|
6509
6778
|
if (meta?.action?.type === "reorder") {
|
|
6510
6779
|
const { from, to } = meta.action.payload;
|
|
6511
|
-
return
|
|
6780
|
+
return moveItem2({
|
|
6512
6781
|
toIndex: to,
|
|
6513
6782
|
tabsMenuId: tabList.id,
|
|
6514
6783
|
tabContentAreaId: tabContentArea.id,
|
|
@@ -6517,8 +6786,8 @@ var TabsControlContent = ({ label }) => {
|
|
|
6517
6786
|
});
|
|
6518
6787
|
}
|
|
6519
6788
|
};
|
|
6520
|
-
return /* @__PURE__ */
|
|
6521
|
-
|
|
6789
|
+
return /* @__PURE__ */ React97.createElement(
|
|
6790
|
+
Repeater3,
|
|
6522
6791
|
{
|
|
6523
6792
|
showToggle: false,
|
|
6524
6793
|
values: repeaterValues,
|
|
@@ -6528,16 +6797,16 @@ var TabsControlContent = ({ label }) => {
|
|
|
6528
6797
|
itemSettings: {
|
|
6529
6798
|
getId: ({ item }) => item.id,
|
|
6530
6799
|
initialValues: { id: "", title: "Tab" },
|
|
6531
|
-
Label:
|
|
6532
|
-
Content:
|
|
6800
|
+
Label: ItemLabel3,
|
|
6801
|
+
Content: ItemContent3,
|
|
6533
6802
|
Icon: () => null
|
|
6534
6803
|
}
|
|
6535
6804
|
}
|
|
6536
6805
|
);
|
|
6537
6806
|
};
|
|
6538
|
-
var
|
|
6807
|
+
var ItemLabel3 = ({ value, index }) => {
|
|
6539
6808
|
const elementTitle = value?.title;
|
|
6540
|
-
return /* @__PURE__ */
|
|
6809
|
+
return /* @__PURE__ */ React97.createElement(Stack17, { sx: { minHeight: 20 }, direction: "row", alignItems: "center", gap: 1.5 }, /* @__PURE__ */ React97.createElement("span", null, elementTitle), /* @__PURE__ */ React97.createElement(ItemDefaultTab, { index }));
|
|
6541
6810
|
};
|
|
6542
6811
|
var ItemDefaultTab = ({ index }) => {
|
|
6543
6812
|
const { value: defaultItem } = useBoundProp7(numberPropTypeUtil4);
|
|
@@ -6545,18 +6814,18 @@ var ItemDefaultTab = ({ index }) => {
|
|
|
6545
6814
|
if (!isDefault) {
|
|
6546
6815
|
return null;
|
|
6547
6816
|
}
|
|
6548
|
-
return /* @__PURE__ */
|
|
6817
|
+
return /* @__PURE__ */ React97.createElement(Chip4, { size: "tiny", shape: "rounded", label: __75("Default", "elementor") });
|
|
6549
6818
|
};
|
|
6550
|
-
var
|
|
6819
|
+
var ItemContent3 = ({ value, index }) => {
|
|
6551
6820
|
if (!value.id) {
|
|
6552
6821
|
return null;
|
|
6553
6822
|
}
|
|
6554
|
-
return /* @__PURE__ */
|
|
6823
|
+
return /* @__PURE__ */ React97.createElement(Stack17, { p: 2, gap: 1.5 }, /* @__PURE__ */ React97.createElement(TabLabelControl, { elementId: value.id }), /* @__PURE__ */ React97.createElement(SettingsField, { bind: "default-active-tab", propDisplayName: __75("Tabs", "elementor") }, /* @__PURE__ */ React97.createElement(DefaultTabControl, { tabIndex: index })));
|
|
6555
6824
|
};
|
|
6556
6825
|
var DefaultTabControl = ({ tabIndex }) => {
|
|
6557
6826
|
const { value, setValue } = useBoundProp7(numberPropTypeUtil4);
|
|
6558
6827
|
const isDefault = value === tabIndex;
|
|
6559
|
-
return /* @__PURE__ */
|
|
6828
|
+
return /* @__PURE__ */ React97.createElement(Stack17, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 2 }, /* @__PURE__ */ React97.createElement(ControlFormLabel5, null, __75("Set as default tab", "elementor")), /* @__PURE__ */ React97.createElement(ConditionalTooltip, { showTooltip: isDefault, placement: "right" }, /* @__PURE__ */ React97.createElement(
|
|
6560
6829
|
Switch2,
|
|
6561
6830
|
{
|
|
6562
6831
|
size: "small",
|
|
@@ -6572,15 +6841,15 @@ var DefaultTabControl = ({ tabIndex }) => {
|
|
|
6572
6841
|
)));
|
|
6573
6842
|
};
|
|
6574
6843
|
var TabLabelControl = ({ elementId }) => {
|
|
6575
|
-
const editorSettings =
|
|
6844
|
+
const editorSettings = useElementEditorSettings4(elementId);
|
|
6576
6845
|
const label = editorSettings?.title ?? "";
|
|
6577
|
-
return /* @__PURE__ */
|
|
6578
|
-
|
|
6846
|
+
return /* @__PURE__ */ React97.createElement(Stack17, { gap: 1 }, /* @__PURE__ */ React97.createElement(ControlFormLabel5, null, __75("Tab name", "elementor")), /* @__PURE__ */ React97.createElement(
|
|
6847
|
+
TextField4,
|
|
6579
6848
|
{
|
|
6580
6849
|
size: "tiny",
|
|
6581
6850
|
value: label,
|
|
6582
6851
|
onChange: ({ target }) => {
|
|
6583
|
-
|
|
6852
|
+
updateElementEditorSettings4({
|
|
6584
6853
|
elementId,
|
|
6585
6854
|
settings: { title: target.value }
|
|
6586
6855
|
});
|
|
@@ -6595,27 +6864,28 @@ var ConditionalTooltip = ({
|
|
|
6595
6864
|
if (!showTooltip) {
|
|
6596
6865
|
return children;
|
|
6597
6866
|
}
|
|
6598
|
-
return /* @__PURE__ */
|
|
6867
|
+
return /* @__PURE__ */ React97.createElement(
|
|
6599
6868
|
Infotip2,
|
|
6600
6869
|
{
|
|
6601
6870
|
arrow: false,
|
|
6602
|
-
content: /* @__PURE__ */
|
|
6871
|
+
content: /* @__PURE__ */ React97.createElement(
|
|
6603
6872
|
Alert4,
|
|
6604
6873
|
{
|
|
6605
6874
|
color: "secondary",
|
|
6606
|
-
icon: /* @__PURE__ */
|
|
6875
|
+
icon: /* @__PURE__ */ React97.createElement(InfoCircleFilledIcon2, { fontSize: "tiny" }),
|
|
6607
6876
|
size: "small",
|
|
6608
6877
|
sx: { width: 288 }
|
|
6609
6878
|
},
|
|
6610
|
-
/* @__PURE__ */
|
|
6879
|
+
/* @__PURE__ */ React97.createElement(Typography5, { variant: "body2" }, __75("To change the default tab, simply set another tab as default.", "elementor"))
|
|
6611
6880
|
)
|
|
6612
6881
|
},
|
|
6613
|
-
/* @__PURE__ */
|
|
6882
|
+
/* @__PURE__ */ React97.createElement("span", null, children)
|
|
6614
6883
|
);
|
|
6615
6884
|
};
|
|
6616
6885
|
|
|
6617
6886
|
// src/controls-registry/element-controls/registry.ts
|
|
6618
6887
|
var controlTypes2 = {
|
|
6888
|
+
"list-items": { component: ListItemsControl, layout: "full" },
|
|
6619
6889
|
tabs: { component: TabsControl, layout: "full" },
|
|
6620
6890
|
"accordion-items": { component: AccordionItemsControl, layout: "full" }
|
|
6621
6891
|
};
|
|
@@ -6637,7 +6907,7 @@ import {
|
|
|
6637
6907
|
import { controlActionsMenu as controlActionsMenu2 } from "@elementor/menus";
|
|
6638
6908
|
|
|
6639
6909
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
6640
|
-
import * as
|
|
6910
|
+
import * as React98 from "react";
|
|
6641
6911
|
import { PropKeyProvider as PropKeyProvider4, PropProvider as PropProvider4, useBoundProp as useBoundProp9 } from "@elementor/editor-controls";
|
|
6642
6912
|
import {
|
|
6643
6913
|
backgroundImageOverlayPropTypeUtil
|
|
@@ -6780,26 +7050,26 @@ var useDynamicTag = (tagName) => {
|
|
|
6780
7050
|
};
|
|
6781
7051
|
|
|
6782
7052
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
6783
|
-
var BackgroundControlDynamicTagIcon = () => /* @__PURE__ */
|
|
7053
|
+
var BackgroundControlDynamicTagIcon = () => /* @__PURE__ */ React98.createElement(DatabaseIcon, { fontSize: "tiny" });
|
|
6784
7054
|
var BackgroundControlDynamicTagLabel = ({ value }) => {
|
|
6785
7055
|
const context = useBoundProp9(backgroundImageOverlayPropTypeUtil);
|
|
6786
|
-
return /* @__PURE__ */
|
|
7056
|
+
return /* @__PURE__ */ React98.createElement(PropProvider4, { ...context, value: value.value }, /* @__PURE__ */ React98.createElement(PropKeyProvider4, { bind: "image" }, /* @__PURE__ */ React98.createElement(Wrapper2, { rawValue: value.value })));
|
|
6787
7057
|
};
|
|
6788
7058
|
var Wrapper2 = ({ rawValue }) => {
|
|
6789
7059
|
const { propType } = useBoundProp9();
|
|
6790
7060
|
const imageOverlayPropType = propType.prop_types["background-image-overlay"];
|
|
6791
|
-
return /* @__PURE__ */
|
|
7061
|
+
return /* @__PURE__ */ React98.createElement(PropProvider4, { propType: imageOverlayPropType.shape.image, value: rawValue, setValue: () => void 0 }, /* @__PURE__ */ React98.createElement(PropKeyProvider4, { bind: "src" }, /* @__PURE__ */ React98.createElement(Content, { rawValue: rawValue.image })));
|
|
6792
7062
|
};
|
|
6793
7063
|
var Content = ({ rawValue }) => {
|
|
6794
7064
|
const src = rawValue.value.src;
|
|
6795
7065
|
const dynamicTag = useDynamicTag(src.value.name || "");
|
|
6796
|
-
return /* @__PURE__ */
|
|
7066
|
+
return /* @__PURE__ */ React98.createElement(React98.Fragment, null, dynamicTag?.label);
|
|
6797
7067
|
};
|
|
6798
7068
|
|
|
6799
7069
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
6800
|
-
import * as
|
|
7070
|
+
import * as React102 from "react";
|
|
6801
7071
|
import {
|
|
6802
|
-
ControlFormLabel as
|
|
7072
|
+
ControlFormLabel as ControlFormLabel6,
|
|
6803
7073
|
PropKeyProvider as PropKeyProvider6,
|
|
6804
7074
|
PropProvider as PropProvider6,
|
|
6805
7075
|
useBoundProp as useBoundProp12
|
|
@@ -6814,7 +7084,7 @@ import {
|
|
|
6814
7084
|
Grid as Grid8,
|
|
6815
7085
|
IconButton as IconButton2,
|
|
6816
7086
|
Popover,
|
|
6817
|
-
Stack as
|
|
7087
|
+
Stack as Stack19,
|
|
6818
7088
|
Tab as Tab2,
|
|
6819
7089
|
TabPanel as TabPanel2,
|
|
6820
7090
|
Tabs as Tabs2,
|
|
@@ -6822,7 +7092,7 @@ import {
|
|
|
6822
7092
|
usePopupState as usePopupState2,
|
|
6823
7093
|
useTabs as useTabs2
|
|
6824
7094
|
} from "@elementor/ui";
|
|
6825
|
-
import { __ as
|
|
7095
|
+
import { __ as __77 } from "@wordpress/i18n";
|
|
6826
7096
|
|
|
6827
7097
|
// src/hooks/use-persist-dynamic-value.ts
|
|
6828
7098
|
import { useSessionStorage as useSessionStorage5 } from "@elementor/session";
|
|
@@ -6833,11 +7103,11 @@ var usePersistDynamicValue = (propKey) => {
|
|
|
6833
7103
|
};
|
|
6834
7104
|
|
|
6835
7105
|
// src/dynamics/dynamic-control.tsx
|
|
6836
|
-
import * as
|
|
7106
|
+
import * as React100 from "react";
|
|
6837
7107
|
import { PropKeyProvider as PropKeyProvider5, PropProvider as PropProvider5, useBoundProp as useBoundProp10 } from "@elementor/editor-controls";
|
|
6838
7108
|
|
|
6839
7109
|
// src/dynamics/components/dynamic-conditional-control.tsx
|
|
6840
|
-
import * as
|
|
7110
|
+
import * as React99 from "react";
|
|
6841
7111
|
import { useMemo as useMemo13 } from "react";
|
|
6842
7112
|
import { isDependencyMet as isDependencyMet3 } from "@elementor/editor-props";
|
|
6843
7113
|
var DynamicConditionalControl = ({
|
|
@@ -6879,10 +7149,10 @@ var DynamicConditionalControl = ({
|
|
|
6879
7149
|
return { ...defaults, ...convertedSettings };
|
|
6880
7150
|
}, [defaults, convertedSettings]);
|
|
6881
7151
|
if (!propType?.dependencies?.terms.length) {
|
|
6882
|
-
return /* @__PURE__ */
|
|
7152
|
+
return /* @__PURE__ */ React99.createElement(React99.Fragment, null, children);
|
|
6883
7153
|
}
|
|
6884
7154
|
const isHidden = !isDependencyMet3(propType?.dependencies, effectiveSettings).isMet;
|
|
6885
|
-
return isHidden ? null : /* @__PURE__ */
|
|
7155
|
+
return isHidden ? null : /* @__PURE__ */ React99.createElement(React99.Fragment, null, children);
|
|
6886
7156
|
};
|
|
6887
7157
|
|
|
6888
7158
|
// src/dynamics/dynamic-control.tsx
|
|
@@ -6907,7 +7177,7 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
6907
7177
|
});
|
|
6908
7178
|
};
|
|
6909
7179
|
const propType = createTopLevelObjectType({ schema: dynamicTag.props_schema });
|
|
6910
|
-
return /* @__PURE__ */
|
|
7180
|
+
return /* @__PURE__ */ React100.createElement(PropProvider5, { propType, setValue: setDynamicValue, value: { [bind]: dynamicValue } }, /* @__PURE__ */ React100.createElement(PropKeyProvider5, { bind }, /* @__PURE__ */ React100.createElement(
|
|
6911
7181
|
DynamicConditionalControl,
|
|
6912
7182
|
{
|
|
6913
7183
|
propType: dynamicPropType,
|
|
@@ -6919,13 +7189,13 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
6919
7189
|
};
|
|
6920
7190
|
|
|
6921
7191
|
// src/dynamics/components/dynamic-selection.tsx
|
|
6922
|
-
import * as
|
|
6923
|
-
import { Fragment as Fragment16, useEffect as
|
|
7192
|
+
import * as React101 from "react";
|
|
7193
|
+
import { Fragment as Fragment16, useEffect as useEffect11, useState as useState10 } from "react";
|
|
6924
7194
|
import { trackUpgradePromotionClick, trackViewPromotion, useBoundProp as useBoundProp11 } from "@elementor/editor-controls";
|
|
6925
7195
|
import { CtaButton, PopoverHeader, PopoverMenuList, SearchField, SectionPopoverBody } from "@elementor/editor-ui";
|
|
6926
7196
|
import { DatabaseIcon as DatabaseIcon2 } from "@elementor/icons";
|
|
6927
|
-
import { Divider as Divider7, Link as Link2, Stack as
|
|
6928
|
-
import { __ as
|
|
7197
|
+
import { Divider as Divider7, Link as Link2, Stack as Stack18, Typography as Typography6, useTheme as useTheme3 } from "@elementor/ui";
|
|
7198
|
+
import { __ as __76 } from "@wordpress/i18n";
|
|
6929
7199
|
var SIZE2 = "tiny";
|
|
6930
7200
|
var PROMO_TEXT_WIDTH = 170;
|
|
6931
7201
|
var PRO_DYNAMIC_TAGS_URL = "https://go.elementor.com/go-pro-dynamic-tags-modal/";
|
|
@@ -6940,7 +7210,7 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
|
6940
7210
|
const isCurrentValueDynamic = !!dynamicValue;
|
|
6941
7211
|
const options13 = useFilteredOptions(searchValue);
|
|
6942
7212
|
const hasNoDynamicTags = !options13.length && !searchValue.trim();
|
|
6943
|
-
|
|
7213
|
+
useEffect11(() => {
|
|
6944
7214
|
if (hasNoDynamicTags) {
|
|
6945
7215
|
trackViewPromotion({ target_name: "dynamic_tags" });
|
|
6946
7216
|
} else if (expired) {
|
|
@@ -6972,19 +7242,19 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
|
6972
7242
|
]);
|
|
6973
7243
|
const getPopOverContent = () => {
|
|
6974
7244
|
if (hasNoDynamicTags) {
|
|
6975
|
-
return /* @__PURE__ */
|
|
7245
|
+
return /* @__PURE__ */ React101.createElement(NoDynamicTags, null);
|
|
6976
7246
|
}
|
|
6977
7247
|
if (expired) {
|
|
6978
|
-
return /* @__PURE__ */
|
|
7248
|
+
return /* @__PURE__ */ React101.createElement(ExpiredDynamicTags, null);
|
|
6979
7249
|
}
|
|
6980
|
-
return /* @__PURE__ */
|
|
7250
|
+
return /* @__PURE__ */ React101.createElement(Fragment16, null, /* @__PURE__ */ React101.createElement(
|
|
6981
7251
|
SearchField,
|
|
6982
7252
|
{
|
|
6983
7253
|
value: searchValue,
|
|
6984
7254
|
onSearch: handleSearch,
|
|
6985
|
-
placeholder:
|
|
7255
|
+
placeholder: __76("Search dynamic tags\u2026", "elementor")
|
|
6986
7256
|
}
|
|
6987
|
-
), /* @__PURE__ */
|
|
7257
|
+
), /* @__PURE__ */ React101.createElement(Divider7, null), /* @__PURE__ */ React101.createElement(
|
|
6988
7258
|
PopoverMenuList,
|
|
6989
7259
|
{
|
|
6990
7260
|
items: virtualizedItems,
|
|
@@ -6992,21 +7262,21 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
|
6992
7262
|
onClose: closePopover,
|
|
6993
7263
|
selectedValue: dynamicValue?.name,
|
|
6994
7264
|
itemStyle: (item) => item.type === "item" ? { paddingInlineStart: theme.spacing(3.5) } : {},
|
|
6995
|
-
noResultsComponent: /* @__PURE__ */
|
|
7265
|
+
noResultsComponent: /* @__PURE__ */ React101.createElement(NoResults, { searchValue, onClear: () => setSearchValue("") })
|
|
6996
7266
|
}
|
|
6997
7267
|
));
|
|
6998
7268
|
};
|
|
6999
|
-
return /* @__PURE__ */
|
|
7269
|
+
return /* @__PURE__ */ React101.createElement(SectionPopoverBody, { "aria-label": __76("Dynamic tags", "elementor") }, /* @__PURE__ */ React101.createElement(
|
|
7000
7270
|
PopoverHeader,
|
|
7001
7271
|
{
|
|
7002
|
-
title:
|
|
7272
|
+
title: __76("Dynamic tags", "elementor"),
|
|
7003
7273
|
onClose: closePopover,
|
|
7004
|
-
icon: /* @__PURE__ */
|
|
7274
|
+
icon: /* @__PURE__ */ React101.createElement(DatabaseIcon2, { fontSize: SIZE2 })
|
|
7005
7275
|
}
|
|
7006
7276
|
), getPopOverContent());
|
|
7007
7277
|
};
|
|
7008
|
-
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */
|
|
7009
|
-
|
|
7278
|
+
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React101.createElement(
|
|
7279
|
+
Stack18,
|
|
7010
7280
|
{
|
|
7011
7281
|
gap: 1,
|
|
7012
7282
|
alignItems: "center",
|
|
@@ -7016,12 +7286,12 @@ var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React100.createEle
|
|
|
7016
7286
|
color: "text.secondary",
|
|
7017
7287
|
sx: { pb: 3.5 }
|
|
7018
7288
|
},
|
|
7019
|
-
/* @__PURE__ */
|
|
7020
|
-
/* @__PURE__ */
|
|
7021
|
-
/* @__PURE__ */
|
|
7289
|
+
/* @__PURE__ */ React101.createElement(DatabaseIcon2, { fontSize: "large" }),
|
|
7290
|
+
/* @__PURE__ */ React101.createElement(Typography6, { align: "center", variant: "subtitle2" }, __76("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React101.createElement("br", null), "\u201C", searchValue, "\u201D."),
|
|
7291
|
+
/* @__PURE__ */ React101.createElement(Typography6, { align: "center", variant: "caption", sx: { display: "flex", flexDirection: "column" } }, __76("Try something else.", "elementor"), /* @__PURE__ */ React101.createElement(Link2, { color: "text.secondary", variant: "caption", component: "button", onClick: onClear }, __76("Clear & try again", "elementor")))
|
|
7022
7292
|
);
|
|
7023
|
-
var NoDynamicTags = () => /* @__PURE__ */
|
|
7024
|
-
|
|
7293
|
+
var NoDynamicTags = () => /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(Divider7, null), /* @__PURE__ */ React101.createElement(
|
|
7294
|
+
Stack18,
|
|
7025
7295
|
{
|
|
7026
7296
|
gap: 1,
|
|
7027
7297
|
alignItems: "center",
|
|
@@ -7031,10 +7301,10 @@ var NoDynamicTags = () => /* @__PURE__ */ React100.createElement(React100.Fragme
|
|
|
7031
7301
|
color: "text.secondary",
|
|
7032
7302
|
sx: { pb: 3.5 }
|
|
7033
7303
|
},
|
|
7034
|
-
/* @__PURE__ */
|
|
7035
|
-
/* @__PURE__ */
|
|
7036
|
-
/* @__PURE__ */
|
|
7037
|
-
/* @__PURE__ */
|
|
7304
|
+
/* @__PURE__ */ React101.createElement(DatabaseIcon2, { fontSize: "large" }),
|
|
7305
|
+
/* @__PURE__ */ React101.createElement(Typography6, { align: "center", variant: "subtitle2" }, __76("Streamline your workflow with dynamic tags", "elementor")),
|
|
7306
|
+
/* @__PURE__ */ React101.createElement(Typography6, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, __76("Upgrade now to display your content dynamically.", "elementor")),
|
|
7307
|
+
/* @__PURE__ */ React101.createElement(
|
|
7038
7308
|
CtaButton,
|
|
7039
7309
|
{
|
|
7040
7310
|
size: "small",
|
|
@@ -7043,8 +7313,8 @@ var NoDynamicTags = () => /* @__PURE__ */ React100.createElement(React100.Fragme
|
|
|
7043
7313
|
}
|
|
7044
7314
|
)
|
|
7045
7315
|
));
|
|
7046
|
-
var ExpiredDynamicTags = () => /* @__PURE__ */
|
|
7047
|
-
|
|
7316
|
+
var ExpiredDynamicTags = () => /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(Divider7, null), /* @__PURE__ */ React101.createElement(
|
|
7317
|
+
Stack18,
|
|
7048
7318
|
{
|
|
7049
7319
|
gap: 1,
|
|
7050
7320
|
alignItems: "center",
|
|
@@ -7054,16 +7324,16 @@ var ExpiredDynamicTags = () => /* @__PURE__ */ React100.createElement(React100.F
|
|
|
7054
7324
|
color: "text.secondary",
|
|
7055
7325
|
sx: { pb: 3.5 }
|
|
7056
7326
|
},
|
|
7057
|
-
/* @__PURE__ */
|
|
7058
|
-
/* @__PURE__ */
|
|
7059
|
-
/* @__PURE__ */
|
|
7060
|
-
/* @__PURE__ */
|
|
7327
|
+
/* @__PURE__ */ React101.createElement(DatabaseIcon2, { fontSize: "large" }),
|
|
7328
|
+
/* @__PURE__ */ React101.createElement(Typography6, { align: "center", variant: "subtitle2" }, __76("Unlock your Dynamic tags again", "elementor")),
|
|
7329
|
+
/* @__PURE__ */ React101.createElement(Typography6, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, __76("Dynamic tags need Elementor Pro. Renew now to keep them active.", "elementor")),
|
|
7330
|
+
/* @__PURE__ */ React101.createElement(
|
|
7061
7331
|
CtaButton,
|
|
7062
7332
|
{
|
|
7063
7333
|
size: "small",
|
|
7064
7334
|
href: RENEW_DYNAMIC_TAGS_URL,
|
|
7065
7335
|
onClick: () => trackUpgradePromotionClick({ target_name: "dynamic_tags" }),
|
|
7066
|
-
children:
|
|
7336
|
+
children: __76("Renew Now", "elementor")
|
|
7067
7337
|
}
|
|
7068
7338
|
)
|
|
7069
7339
|
));
|
|
@@ -7100,7 +7370,7 @@ var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
|
7100
7370
|
const { name: tagName = "" } = value;
|
|
7101
7371
|
const dynamicTag = useDynamicTag(tagName);
|
|
7102
7372
|
if (!isDynamicTagSupported(tagName) && OriginalControl) {
|
|
7103
|
-
return /* @__PURE__ */
|
|
7373
|
+
return /* @__PURE__ */ React102.createElement(PropProvider6, { propType: originalPropType, value: { [bind]: null }, setValue: setAnyValue }, /* @__PURE__ */ React102.createElement(PropKeyProvider6, { bind }, /* @__PURE__ */ React102.createElement(OriginalControl, { ...props })));
|
|
7104
7374
|
}
|
|
7105
7375
|
const removeDynamicTag = () => {
|
|
7106
7376
|
setAnyValue(propValueFromHistory ?? null);
|
|
@@ -7108,25 +7378,25 @@ var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
|
7108
7378
|
if (!dynamicTag) {
|
|
7109
7379
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
7110
7380
|
}
|
|
7111
|
-
return /* @__PURE__ */
|
|
7381
|
+
return /* @__PURE__ */ React102.createElement(Box8, null, /* @__PURE__ */ React102.createElement(
|
|
7112
7382
|
Tag,
|
|
7113
7383
|
{
|
|
7114
7384
|
fullWidth: true,
|
|
7115
7385
|
showActionsOnHover: true,
|
|
7116
7386
|
label: dynamicTag.label,
|
|
7117
|
-
startIcon: /* @__PURE__ */
|
|
7387
|
+
startIcon: /* @__PURE__ */ React102.createElement(DatabaseIcon3, { fontSize: SIZE3 }),
|
|
7118
7388
|
...bindTrigger2(selectionPopoverState),
|
|
7119
|
-
actions: /* @__PURE__ */
|
|
7389
|
+
actions: /* @__PURE__ */ React102.createElement(React102.Fragment, null, /* @__PURE__ */ React102.createElement(DynamicSettingsPopover, { dynamicTag, disabled: readonly }), /* @__PURE__ */ React102.createElement(
|
|
7120
7390
|
IconButton2,
|
|
7121
7391
|
{
|
|
7122
7392
|
size: SIZE3,
|
|
7123
7393
|
onClick: removeDynamicTag,
|
|
7124
|
-
"aria-label":
|
|
7394
|
+
"aria-label": __77("Remove dynamic value", "elementor")
|
|
7125
7395
|
},
|
|
7126
|
-
/* @__PURE__ */
|
|
7396
|
+
/* @__PURE__ */ React102.createElement(XIcon, { fontSize: SIZE3 })
|
|
7127
7397
|
))
|
|
7128
7398
|
}
|
|
7129
|
-
), /* @__PURE__ */
|
|
7399
|
+
), /* @__PURE__ */ React102.createElement(
|
|
7130
7400
|
Popover,
|
|
7131
7401
|
{
|
|
7132
7402
|
disablePortal: true,
|
|
@@ -7138,7 +7408,7 @@ var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
|
|
|
7138
7408
|
},
|
|
7139
7409
|
...bindPopover(selectionPopoverState)
|
|
7140
7410
|
},
|
|
7141
|
-
/* @__PURE__ */
|
|
7411
|
+
/* @__PURE__ */ React102.createElement(SectionPopoverBody2, { "aria-label": __77("Dynamic tags", "elementor") }, /* @__PURE__ */ React102.createElement(DynamicSelection, { close: selectionPopoverState.close, expired: readonly }))
|
|
7142
7412
|
));
|
|
7143
7413
|
};
|
|
7144
7414
|
var DynamicSettingsPopover = ({
|
|
@@ -7150,16 +7420,16 @@ var DynamicSettingsPopover = ({
|
|
|
7150
7420
|
if (!hasDynamicSettings) {
|
|
7151
7421
|
return null;
|
|
7152
7422
|
}
|
|
7153
|
-
return /* @__PURE__ */
|
|
7423
|
+
return /* @__PURE__ */ React102.createElement(React102.Fragment, null, /* @__PURE__ */ React102.createElement(
|
|
7154
7424
|
IconButton2,
|
|
7155
7425
|
{
|
|
7156
7426
|
size: SIZE3,
|
|
7157
7427
|
disabled,
|
|
7158
7428
|
...!disabled && bindTrigger2(popupState),
|
|
7159
|
-
"aria-label":
|
|
7429
|
+
"aria-label": __77("Dynamic settings", "elementor")
|
|
7160
7430
|
},
|
|
7161
|
-
/* @__PURE__ */
|
|
7162
|
-
), /* @__PURE__ */
|
|
7431
|
+
/* @__PURE__ */ React102.createElement(SettingsIcon, { fontSize: SIZE3 })
|
|
7432
|
+
), /* @__PURE__ */ React102.createElement(
|
|
7163
7433
|
Popover,
|
|
7164
7434
|
{
|
|
7165
7435
|
disablePortal: true,
|
|
@@ -7171,14 +7441,14 @@ var DynamicSettingsPopover = ({
|
|
|
7171
7441
|
},
|
|
7172
7442
|
...bindPopover(popupState)
|
|
7173
7443
|
},
|
|
7174
|
-
/* @__PURE__ */
|
|
7444
|
+
/* @__PURE__ */ React102.createElement(SectionPopoverBody2, { "aria-label": __77("Dynamic settings", "elementor") }, /* @__PURE__ */ React102.createElement(
|
|
7175
7445
|
PopoverHeader2,
|
|
7176
7446
|
{
|
|
7177
7447
|
title: dynamicTag.label,
|
|
7178
7448
|
onClose: popupState.close,
|
|
7179
|
-
icon: /* @__PURE__ */
|
|
7449
|
+
icon: /* @__PURE__ */ React102.createElement(DatabaseIcon3, { fontSize: SIZE3 })
|
|
7180
7450
|
}
|
|
7181
|
-
), /* @__PURE__ */
|
|
7451
|
+
), /* @__PURE__ */ React102.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls, tagName: dynamicTag.name }))
|
|
7182
7452
|
));
|
|
7183
7453
|
};
|
|
7184
7454
|
var DynamicSettings = ({ controls, tagName }) => {
|
|
@@ -7189,9 +7459,9 @@ var DynamicSettings = ({ controls, tagName }) => {
|
|
|
7189
7459
|
}
|
|
7190
7460
|
if (tagsWithoutTabs.includes(tagName)) {
|
|
7191
7461
|
const singleTab = tabs[0];
|
|
7192
|
-
return /* @__PURE__ */
|
|
7462
|
+
return /* @__PURE__ */ React102.createElement(React102.Fragment, null, /* @__PURE__ */ React102.createElement(Divider8, null), /* @__PURE__ */ React102.createElement(ControlsItemsStack, { items: singleTab.value.items }));
|
|
7193
7463
|
}
|
|
7194
|
-
return /* @__PURE__ */
|
|
7464
|
+
return /* @__PURE__ */ React102.createElement(React102.Fragment, null, tabs.length > 1 && /* @__PURE__ */ React102.createElement(Tabs2, { size: "small", variant: "fullWidth", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React102.createElement(
|
|
7195
7465
|
Tab2,
|
|
7196
7466
|
{
|
|
7197
7467
|
key: index,
|
|
@@ -7199,15 +7469,15 @@ var DynamicSettings = ({ controls, tagName }) => {
|
|
|
7199
7469
|
sx: { px: 1, py: 0.5 },
|
|
7200
7470
|
...getTabProps(index)
|
|
7201
7471
|
}
|
|
7202
|
-
))), /* @__PURE__ */
|
|
7203
|
-
return /* @__PURE__ */
|
|
7472
|
+
))), /* @__PURE__ */ React102.createElement(Divider8, null), tabs.map(({ value }, index) => {
|
|
7473
|
+
return /* @__PURE__ */ React102.createElement(
|
|
7204
7474
|
TabPanel2,
|
|
7205
7475
|
{
|
|
7206
7476
|
key: index,
|
|
7207
7477
|
sx: { flexGrow: 1, py: 0, overflowY: "auto" },
|
|
7208
7478
|
...getTabPanelProps(index)
|
|
7209
7479
|
},
|
|
7210
|
-
/* @__PURE__ */
|
|
7480
|
+
/* @__PURE__ */ React102.createElement(ControlsItemsStack, { items: value.items })
|
|
7211
7481
|
);
|
|
7212
7482
|
}));
|
|
7213
7483
|
};
|
|
@@ -7249,11 +7519,11 @@ var Control2 = ({ control }) => {
|
|
|
7249
7519
|
display: "grid",
|
|
7250
7520
|
gridTemplateColumns: isSwitchControl ? "minmax(0, 1fr) max-content" : "1fr 1fr"
|
|
7251
7521
|
} : {};
|
|
7252
|
-
return /* @__PURE__ */
|
|
7522
|
+
return /* @__PURE__ */ React102.createElement(DynamicControl, { bind: control.bind }, /* @__PURE__ */ React102.createElement(Grid8, { container: true, gap: 0.75, sx: layoutStyleProps }, control.label ? /* @__PURE__ */ React102.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React102.createElement(ControlFormLabel6, null, control.label)) : null, /* @__PURE__ */ React102.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React102.createElement(Control, { type: control.type, props: controlProps }))));
|
|
7253
7523
|
};
|
|
7254
7524
|
function ControlsItemsStack({ items: items3 }) {
|
|
7255
|
-
return /* @__PURE__ */
|
|
7256
|
-
(item) => item.type === "control" ? /* @__PURE__ */
|
|
7525
|
+
return /* @__PURE__ */ React102.createElement(Stack19, { p: 2, gap: 2, sx: { overflowY: "auto" } }, items3.map(
|
|
7526
|
+
(item) => item.type === "control" ? /* @__PURE__ */ React102.createElement(Control2, { key: item.value.bind, control: item.value }) : null
|
|
7257
7527
|
));
|
|
7258
7528
|
}
|
|
7259
7529
|
|
|
@@ -7310,18 +7580,18 @@ function getDynamicValue(name, settings, renderPostId) {
|
|
|
7310
7580
|
}
|
|
7311
7581
|
|
|
7312
7582
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
7313
|
-
import * as
|
|
7583
|
+
import * as React103 from "react";
|
|
7314
7584
|
import { useBoundProp as useBoundProp13 } from "@elementor/editor-controls";
|
|
7315
7585
|
import { DatabaseIcon as DatabaseIcon4 } from "@elementor/icons";
|
|
7316
|
-
import { __ as
|
|
7586
|
+
import { __ as __78 } from "@wordpress/i18n";
|
|
7317
7587
|
var usePropDynamicAction = () => {
|
|
7318
7588
|
const { propType } = useBoundProp13();
|
|
7319
7589
|
const visible = !!propType && supportsDynamic(propType);
|
|
7320
7590
|
return {
|
|
7321
7591
|
visible,
|
|
7322
7592
|
icon: DatabaseIcon4,
|
|
7323
|
-
title:
|
|
7324
|
-
content: ({ close }) => /* @__PURE__ */
|
|
7593
|
+
title: __78("Dynamic tags", "elementor"),
|
|
7594
|
+
content: ({ close }) => /* @__PURE__ */ React103.createElement(DynamicSelection, { close })
|
|
7325
7595
|
};
|
|
7326
7596
|
};
|
|
7327
7597
|
|
|
@@ -7356,7 +7626,7 @@ import { useBoundProp as useBoundProp14 } from "@elementor/editor-controls";
|
|
|
7356
7626
|
import { hasVariable as hasVariable2 } from "@elementor/editor-variables";
|
|
7357
7627
|
import { BrushBigIcon } from "@elementor/icons";
|
|
7358
7628
|
import { controlActionsMenu as controlActionsMenu3 } from "@elementor/menus";
|
|
7359
|
-
import { __ as
|
|
7629
|
+
import { __ as __79 } from "@wordpress/i18n";
|
|
7360
7630
|
|
|
7361
7631
|
// src/utils/is-equal.ts
|
|
7362
7632
|
function isEqual(a, b) {
|
|
@@ -7432,22 +7702,22 @@ function useResetStyleValueProps() {
|
|
|
7432
7702
|
const visible = calculateVisibility();
|
|
7433
7703
|
return {
|
|
7434
7704
|
visible,
|
|
7435
|
-
title:
|
|
7705
|
+
title: __79("Clear", "elementor"),
|
|
7436
7706
|
icon: BrushBigIcon,
|
|
7437
7707
|
onClick: () => resetValue()
|
|
7438
7708
|
};
|
|
7439
7709
|
}
|
|
7440
7710
|
|
|
7441
7711
|
// src/styles-inheritance/components/styles-inheritance-indicator.tsx
|
|
7442
|
-
import * as
|
|
7712
|
+
import * as React109 from "react";
|
|
7443
7713
|
import { useBoundProp as useBoundProp15 } from "@elementor/editor-controls";
|
|
7444
7714
|
import { isEmpty as isEmpty3 } from "@elementor/editor-props";
|
|
7445
7715
|
import { ELEMENTS_BASE_STYLES_PROVIDER_KEY as ELEMENTS_BASE_STYLES_PROVIDER_KEY4 } from "@elementor/editor-styles-repository";
|
|
7446
|
-
import { __ as
|
|
7716
|
+
import { __ as __83 } from "@wordpress/i18n";
|
|
7447
7717
|
|
|
7448
7718
|
// src/styles-inheritance/components/styles-inheritance-infotip.tsx
|
|
7449
|
-
import * as
|
|
7450
|
-
import { useMemo as useMemo14, useRef as
|
|
7719
|
+
import * as React108 from "react";
|
|
7720
|
+
import { useMemo as useMemo14, useRef as useRef22, useState as useState12 } from "react";
|
|
7451
7721
|
import {
|
|
7452
7722
|
createPropsResolver as createPropsResolver2,
|
|
7453
7723
|
stylesInheritanceTransformersRegistry
|
|
@@ -7461,31 +7731,31 @@ import {
|
|
|
7461
7731
|
ClickAwayListener,
|
|
7462
7732
|
IconButton as IconButton3,
|
|
7463
7733
|
Infotip as Infotip3,
|
|
7464
|
-
Stack as
|
|
7734
|
+
Stack as Stack20,
|
|
7465
7735
|
Tooltip as Tooltip7
|
|
7466
7736
|
} from "@elementor/ui";
|
|
7467
|
-
import { __ as
|
|
7737
|
+
import { __ as __82 } from "@wordpress/i18n";
|
|
7468
7738
|
|
|
7469
7739
|
// src/styles-inheritance/hooks/use-normalized-inheritance-chain-items.tsx
|
|
7470
|
-
import { isValidElement, useEffect as
|
|
7740
|
+
import { isValidElement, useEffect as useEffect12, useState as useState11 } from "react";
|
|
7471
7741
|
import { UnknownStyleStateError } from "@elementor/editor-canvas";
|
|
7472
7742
|
import {
|
|
7473
7743
|
isClassState as isClassState2,
|
|
7474
7744
|
isPseudoState
|
|
7475
7745
|
} from "@elementor/editor-styles";
|
|
7476
7746
|
import { ELEMENTS_BASE_STYLES_PROVIDER_KEY as ELEMENTS_BASE_STYLES_PROVIDER_KEY2 } from "@elementor/editor-styles-repository";
|
|
7477
|
-
import { __ as
|
|
7747
|
+
import { __ as __80 } from "@wordpress/i18n";
|
|
7478
7748
|
var MAXIMUM_ITEMS = 2;
|
|
7479
7749
|
var useNormalizedInheritanceChainItems = (inheritanceChain, bind, resolve) => {
|
|
7480
7750
|
const [items3, setItems] = useState11([]);
|
|
7481
|
-
|
|
7751
|
+
useEffect12(() => {
|
|
7482
7752
|
(async () => {
|
|
7483
7753
|
const normalizedItems = await Promise.all(
|
|
7484
7754
|
inheritanceChain.filter(({ style }) => style).map((item, index) => normalizeInheritanceItem(item, index, bind, resolve))
|
|
7485
7755
|
);
|
|
7486
7756
|
const validItems = normalizedItems.map((item) => ({
|
|
7487
7757
|
...item,
|
|
7488
|
-
displayLabel: ELEMENTS_BASE_STYLES_PROVIDER_KEY2 !== item.provider ? item.displayLabel :
|
|
7758
|
+
displayLabel: ELEMENTS_BASE_STYLES_PROVIDER_KEY2 !== item.provider ? item.displayLabel : __80("Base", "elementor")
|
|
7489
7759
|
})).filter((item) => !item.value || item.displayLabel !== "").slice(0, MAXIMUM_ITEMS);
|
|
7490
7760
|
setItems(validItems);
|
|
7491
7761
|
})();
|
|
@@ -7542,7 +7812,7 @@ var getTransformedValue = async (item, bind, resolve) => {
|
|
|
7542
7812
|
};
|
|
7543
7813
|
|
|
7544
7814
|
// src/styles-inheritance/components/infotip/breakpoint-icon.tsx
|
|
7545
|
-
import * as
|
|
7815
|
+
import * as React104 from "react";
|
|
7546
7816
|
import { useBreakpoints } from "@elementor/editor-responsive";
|
|
7547
7817
|
import {
|
|
7548
7818
|
DesktopIcon,
|
|
@@ -7573,20 +7843,20 @@ var BreakpointIcon = ({ breakpoint }) => {
|
|
|
7573
7843
|
return null;
|
|
7574
7844
|
}
|
|
7575
7845
|
const breakpointLabel = breakpoints.find((breakpointItem) => breakpointItem.id === currentBreakpoint)?.label;
|
|
7576
|
-
return /* @__PURE__ */
|
|
7846
|
+
return /* @__PURE__ */ React104.createElement(Tooltip4, { title: breakpointLabel, placement: "top" }, /* @__PURE__ */ React104.createElement(IconComponent, { fontSize: SIZE4, sx: { mt: "2px" } }));
|
|
7577
7847
|
};
|
|
7578
7848
|
|
|
7579
7849
|
// src/styles-inheritance/components/infotip/label-chip.tsx
|
|
7580
|
-
import * as
|
|
7850
|
+
import * as React105 from "react";
|
|
7581
7851
|
import { ELEMENTS_BASE_STYLES_PROVIDER_KEY as ELEMENTS_BASE_STYLES_PROVIDER_KEY3 } from "@elementor/editor-styles-repository";
|
|
7582
7852
|
import { InfoCircleIcon as InfoCircleIcon2 } from "@elementor/icons";
|
|
7583
7853
|
import { Chip as Chip5, Tooltip as Tooltip5 } from "@elementor/ui";
|
|
7584
|
-
import { __ as
|
|
7854
|
+
import { __ as __81 } from "@wordpress/i18n";
|
|
7585
7855
|
var SIZE5 = "tiny";
|
|
7586
7856
|
var LabelChip = ({ displayLabel, provider }) => {
|
|
7587
7857
|
const isBaseStyle = provider === ELEMENTS_BASE_STYLES_PROVIDER_KEY3;
|
|
7588
|
-
const chipIcon = isBaseStyle ? /* @__PURE__ */
|
|
7589
|
-
return /* @__PURE__ */
|
|
7858
|
+
const chipIcon = isBaseStyle ? /* @__PURE__ */ React105.createElement(Tooltip5, { title: __81("Inherited from base styles", "elementor"), placement: "top" }, /* @__PURE__ */ React105.createElement(InfoCircleIcon2, { fontSize: SIZE5 })) : void 0;
|
|
7859
|
+
return /* @__PURE__ */ React105.createElement(
|
|
7590
7860
|
Chip5,
|
|
7591
7861
|
{
|
|
7592
7862
|
label: displayLabel,
|
|
@@ -7612,10 +7882,10 @@ var LabelChip = ({ displayLabel, provider }) => {
|
|
|
7612
7882
|
};
|
|
7613
7883
|
|
|
7614
7884
|
// src/styles-inheritance/components/infotip/value-component.tsx
|
|
7615
|
-
import * as
|
|
7885
|
+
import * as React106 from "react";
|
|
7616
7886
|
import { Tooltip as Tooltip6, Typography as Typography7 } from "@elementor/ui";
|
|
7617
7887
|
var ValueComponent = ({ index, value }) => {
|
|
7618
|
-
return /* @__PURE__ */
|
|
7888
|
+
return /* @__PURE__ */ React106.createElement(Tooltip6, { title: value, placement: "top" }, /* @__PURE__ */ React106.createElement(
|
|
7619
7889
|
Typography7,
|
|
7620
7890
|
{
|
|
7621
7891
|
variant: "caption",
|
|
@@ -7637,9 +7907,9 @@ var ValueComponent = ({ index, value }) => {
|
|
|
7637
7907
|
};
|
|
7638
7908
|
|
|
7639
7909
|
// src/styles-inheritance/components/infotip/action-icons.tsx
|
|
7640
|
-
import * as
|
|
7910
|
+
import * as React107 from "react";
|
|
7641
7911
|
import { Box as Box9 } from "@elementor/ui";
|
|
7642
|
-
var ActionIcons = () => /* @__PURE__ */
|
|
7912
|
+
var ActionIcons = () => /* @__PURE__ */ React107.createElement(Box9, { display: "flex", gap: 0.5, alignItems: "center" });
|
|
7643
7913
|
|
|
7644
7914
|
// src/styles-inheritance/components/styles-inheritance-infotip.tsx
|
|
7645
7915
|
var SECTION_PADDING_INLINE = 32;
|
|
@@ -7653,7 +7923,7 @@ var StylesInheritanceInfotip = ({
|
|
|
7653
7923
|
isDisabled
|
|
7654
7924
|
}) => {
|
|
7655
7925
|
const [showInfotip, setShowInfotip] = useState12(false);
|
|
7656
|
-
const triggerRef =
|
|
7926
|
+
const triggerRef = useRef22(null);
|
|
7657
7927
|
const toggleInfotip = () => {
|
|
7658
7928
|
if (isDisabled) {
|
|
7659
7929
|
return;
|
|
@@ -7675,7 +7945,7 @@ var StylesInheritanceInfotip = ({
|
|
|
7675
7945
|
});
|
|
7676
7946
|
}, [key, propType]);
|
|
7677
7947
|
const items3 = useNormalizedInheritanceChainItems(inheritanceChain, key, resolve);
|
|
7678
|
-
const infotipContent = /* @__PURE__ */
|
|
7948
|
+
const infotipContent = /* @__PURE__ */ React108.createElement(ClickAwayListener, { onClickAway: closeInfotip }, /* @__PURE__ */ React108.createElement(
|
|
7679
7949
|
Card,
|
|
7680
7950
|
{
|
|
7681
7951
|
elevation: 0,
|
|
@@ -7688,7 +7958,7 @@ var StylesInheritanceInfotip = ({
|
|
|
7688
7958
|
flexDirection: "column"
|
|
7689
7959
|
}
|
|
7690
7960
|
},
|
|
7691
|
-
/* @__PURE__ */
|
|
7961
|
+
/* @__PURE__ */ React108.createElement(
|
|
7692
7962
|
Box10,
|
|
7693
7963
|
{
|
|
7694
7964
|
sx: {
|
|
@@ -7698,9 +7968,9 @@ var StylesInheritanceInfotip = ({
|
|
|
7698
7968
|
backgroundColor: "background.paper"
|
|
7699
7969
|
}
|
|
7700
7970
|
},
|
|
7701
|
-
/* @__PURE__ */
|
|
7971
|
+
/* @__PURE__ */ React108.createElement(PopoverHeader3, { title: __82("Style origin", "elementor"), onClose: closeInfotip })
|
|
7702
7972
|
),
|
|
7703
|
-
/* @__PURE__ */
|
|
7973
|
+
/* @__PURE__ */ React108.createElement(
|
|
7704
7974
|
CardContent,
|
|
7705
7975
|
{
|
|
7706
7976
|
sx: {
|
|
@@ -7714,39 +7984,39 @@ var StylesInheritanceInfotip = ({
|
|
|
7714
7984
|
}
|
|
7715
7985
|
}
|
|
7716
7986
|
},
|
|
7717
|
-
/* @__PURE__ */
|
|
7718
|
-
return /* @__PURE__ */
|
|
7987
|
+
/* @__PURE__ */ React108.createElement(Stack20, { gap: 1.5, sx: { pl: 2, pr: 1, pt: 1.5, pb: 1.5 }, role: "list" }, items3.map((item, index) => {
|
|
7988
|
+
return /* @__PURE__ */ React108.createElement(
|
|
7719
7989
|
Box10,
|
|
7720
7990
|
{
|
|
7721
7991
|
key: item.id,
|
|
7722
7992
|
display: "flex",
|
|
7723
7993
|
gap: 0.5,
|
|
7724
7994
|
role: "listitem",
|
|
7725
|
-
"aria-label":
|
|
7995
|
+
"aria-label": __82("Inheritance item: %s", "elementor").replace(
|
|
7726
7996
|
"%s",
|
|
7727
7997
|
item.displayLabel
|
|
7728
7998
|
)
|
|
7729
7999
|
},
|
|
7730
|
-
/* @__PURE__ */
|
|
8000
|
+
/* @__PURE__ */ React108.createElement(
|
|
7731
8001
|
Box10,
|
|
7732
8002
|
{
|
|
7733
8003
|
display: "flex",
|
|
7734
8004
|
gap: 0.5,
|
|
7735
8005
|
sx: { flexWrap: "wrap", width: "100%", alignItems: "flex-start" }
|
|
7736
8006
|
},
|
|
7737
|
-
/* @__PURE__ */
|
|
7738
|
-
/* @__PURE__ */
|
|
7739
|
-
/* @__PURE__ */
|
|
8007
|
+
/* @__PURE__ */ React108.createElement(BreakpointIcon, { breakpoint: item.breakpoint }),
|
|
8008
|
+
/* @__PURE__ */ React108.createElement(LabelChip, { displayLabel: item.displayLabel, provider: item.provider }),
|
|
8009
|
+
/* @__PURE__ */ React108.createElement(ValueComponent, { index, value: item.value })
|
|
7740
8010
|
),
|
|
7741
|
-
/* @__PURE__ */
|
|
8011
|
+
/* @__PURE__ */ React108.createElement(ActionIcons, null)
|
|
7742
8012
|
);
|
|
7743
8013
|
}))
|
|
7744
8014
|
)
|
|
7745
8015
|
));
|
|
7746
8016
|
if (isDisabled) {
|
|
7747
|
-
return /* @__PURE__ */
|
|
8017
|
+
return /* @__PURE__ */ React108.createElement(Box10, { sx: { display: "inline-flex" } }, children);
|
|
7748
8018
|
}
|
|
7749
|
-
return /* @__PURE__ */
|
|
8019
|
+
return /* @__PURE__ */ React108.createElement(Box10, { ref: triggerRef, sx: { display: "inline-flex" } }, /* @__PURE__ */ React108.createElement(
|
|
7750
8020
|
TooltipOrInfotip,
|
|
7751
8021
|
{
|
|
7752
8022
|
showInfotip,
|
|
@@ -7754,7 +8024,7 @@ var StylesInheritanceInfotip = ({
|
|
|
7754
8024
|
infotipContent,
|
|
7755
8025
|
isDisabled
|
|
7756
8026
|
},
|
|
7757
|
-
/* @__PURE__ */
|
|
8027
|
+
/* @__PURE__ */ React108.createElement(
|
|
7758
8028
|
IconButton3,
|
|
7759
8029
|
{
|
|
7760
8030
|
onClick: toggleInfotip,
|
|
@@ -7774,10 +8044,10 @@ function TooltipOrInfotip({
|
|
|
7774
8044
|
isDisabled
|
|
7775
8045
|
}) {
|
|
7776
8046
|
if (isDisabled) {
|
|
7777
|
-
return /* @__PURE__ */
|
|
8047
|
+
return /* @__PURE__ */ React108.createElement(Box10, { sx: { display: "inline-flex" } }, children);
|
|
7778
8048
|
}
|
|
7779
8049
|
if (showInfotip) {
|
|
7780
|
-
return /* @__PURE__ */
|
|
8050
|
+
return /* @__PURE__ */ React108.createElement(React108.Fragment, null, /* @__PURE__ */ React108.createElement(
|
|
7781
8051
|
Backdrop,
|
|
7782
8052
|
{
|
|
7783
8053
|
open: showInfotip,
|
|
@@ -7787,7 +8057,7 @@ function TooltipOrInfotip({
|
|
|
7787
8057
|
zIndex: (theme) => theme.zIndex.modal - 1
|
|
7788
8058
|
}
|
|
7789
8059
|
}
|
|
7790
|
-
), /* @__PURE__ */
|
|
8060
|
+
), /* @__PURE__ */ React108.createElement(
|
|
7791
8061
|
Infotip3,
|
|
7792
8062
|
{
|
|
7793
8063
|
placement: "top-end",
|
|
@@ -7799,7 +8069,7 @@ function TooltipOrInfotip({
|
|
|
7799
8069
|
children
|
|
7800
8070
|
));
|
|
7801
8071
|
}
|
|
7802
|
-
return /* @__PURE__ */
|
|
8072
|
+
return /* @__PURE__ */ React108.createElement(Tooltip7, { title: __82("Style origin", "elementor"), placement: "top" }, children);
|
|
7803
8073
|
}
|
|
7804
8074
|
|
|
7805
8075
|
// src/styles-inheritance/components/styles-inheritance-indicator.tsx
|
|
@@ -7812,7 +8082,7 @@ var StylesInheritanceIndicator = ({
|
|
|
7812
8082
|
if (!path || !inheritanceChain.length) {
|
|
7813
8083
|
return null;
|
|
7814
8084
|
}
|
|
7815
|
-
return /* @__PURE__ */
|
|
8085
|
+
return /* @__PURE__ */ React109.createElement(Indicator, { inheritanceChain, path, propType });
|
|
7816
8086
|
};
|
|
7817
8087
|
var Indicator = ({ inheritanceChain, path, propType, isDisabled }) => {
|
|
7818
8088
|
const { id: currentStyleId, provider: currentStyleProvider, meta: currentStyleMeta } = useStyle();
|
|
@@ -7828,7 +8098,7 @@ var Indicator = ({ inheritanceChain, path, propType, isDisabled }) => {
|
|
|
7828
8098
|
getColor: isFinalValue && currentStyleProvider ? getStylesProviderThemeColor(currentStyleProvider.getKey()) : void 0,
|
|
7829
8099
|
isOverridden: hasValue && !isFinalValue ? true : void 0
|
|
7830
8100
|
};
|
|
7831
|
-
return /* @__PURE__ */
|
|
8101
|
+
return /* @__PURE__ */ React109.createElement(
|
|
7832
8102
|
StylesInheritanceInfotip,
|
|
7833
8103
|
{
|
|
7834
8104
|
inheritanceChain,
|
|
@@ -7837,17 +8107,17 @@ var Indicator = ({ inheritanceChain, path, propType, isDisabled }) => {
|
|
|
7837
8107
|
label,
|
|
7838
8108
|
isDisabled
|
|
7839
8109
|
},
|
|
7840
|
-
/* @__PURE__ */
|
|
8110
|
+
/* @__PURE__ */ React109.createElement(StyleIndicator, { ...styleIndicatorProps })
|
|
7841
8111
|
);
|
|
7842
8112
|
};
|
|
7843
8113
|
var getLabel = ({ isFinalValue, hasValue }) => {
|
|
7844
8114
|
if (isFinalValue) {
|
|
7845
|
-
return
|
|
8115
|
+
return __83("This is the final value", "elementor");
|
|
7846
8116
|
}
|
|
7847
8117
|
if (hasValue) {
|
|
7848
|
-
return
|
|
8118
|
+
return __83("This value is overridden by another style", "elementor");
|
|
7849
8119
|
}
|
|
7850
|
-
return
|
|
8120
|
+
return __83("This has value from another style", "elementor");
|
|
7851
8121
|
};
|
|
7852
8122
|
|
|
7853
8123
|
// src/styles-inheritance/init-styles-inheritance-transformers.ts
|
|
@@ -7872,7 +8142,7 @@ var excludePropTypeTransformers = /* @__PURE__ */ new Set([
|
|
|
7872
8142
|
]);
|
|
7873
8143
|
|
|
7874
8144
|
// src/styles-inheritance/transformers/array-transformer.tsx
|
|
7875
|
-
import * as
|
|
8145
|
+
import * as React110 from "react";
|
|
7876
8146
|
import { createTransformer as createTransformer2 } from "@elementor/editor-canvas";
|
|
7877
8147
|
var arrayTransformer = createTransformer2((values) => {
|
|
7878
8148
|
if (!values || values.length === 0) {
|
|
@@ -7882,16 +8152,16 @@ var arrayTransformer = createTransformer2((values) => {
|
|
|
7882
8152
|
if (allStrings) {
|
|
7883
8153
|
return values.join(" ");
|
|
7884
8154
|
}
|
|
7885
|
-
return /* @__PURE__ */
|
|
8155
|
+
return /* @__PURE__ */ React110.createElement(React110.Fragment, null, values.map((item, index) => /* @__PURE__ */ React110.createElement(React110.Fragment, { key: index }, index > 0 && " ", item)));
|
|
7886
8156
|
});
|
|
7887
8157
|
|
|
7888
8158
|
// src/styles-inheritance/transformers/background-color-overlay-transformer.tsx
|
|
7889
|
-
import * as
|
|
8159
|
+
import * as React111 from "react";
|
|
7890
8160
|
import { createTransformer as createTransformer3 } from "@elementor/editor-canvas";
|
|
7891
|
-
import { Stack as
|
|
7892
|
-
var backgroundColorOverlayTransformer = createTransformer3((value) => /* @__PURE__ */
|
|
8161
|
+
import { Stack as Stack21, styled as styled7, UnstableColorIndicator } from "@elementor/ui";
|
|
8162
|
+
var backgroundColorOverlayTransformer = createTransformer3((value) => /* @__PURE__ */ React111.createElement(Stack21, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React111.createElement(ItemLabelColor, { value })));
|
|
7893
8163
|
var ItemLabelColor = ({ value: { color } }) => {
|
|
7894
|
-
return /* @__PURE__ */
|
|
8164
|
+
return /* @__PURE__ */ React111.createElement("span", null, color);
|
|
7895
8165
|
};
|
|
7896
8166
|
var StyledUnstableColorIndicator = styled7(UnstableColorIndicator)(({ theme }) => ({
|
|
7897
8167
|
width: "1em",
|
|
@@ -7902,20 +8172,20 @@ var StyledUnstableColorIndicator = styled7(UnstableColorIndicator)(({ theme }) =
|
|
|
7902
8172
|
}));
|
|
7903
8173
|
|
|
7904
8174
|
// src/styles-inheritance/transformers/background-gradient-overlay-transformer.tsx
|
|
7905
|
-
import * as
|
|
8175
|
+
import * as React112 from "react";
|
|
7906
8176
|
import { createTransformer as createTransformer4 } from "@elementor/editor-canvas";
|
|
7907
|
-
import { Stack as
|
|
7908
|
-
import { __ as
|
|
7909
|
-
var backgroundGradientOverlayTransformer = createTransformer4((value) => /* @__PURE__ */
|
|
8177
|
+
import { Stack as Stack22 } from "@elementor/ui";
|
|
8178
|
+
import { __ as __84 } from "@wordpress/i18n";
|
|
8179
|
+
var backgroundGradientOverlayTransformer = createTransformer4((value) => /* @__PURE__ */ React112.createElement(Stack22, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React112.createElement(ItemIconGradient, { value }), /* @__PURE__ */ React112.createElement(ItemLabelGradient, { value })));
|
|
7910
8180
|
var ItemIconGradient = ({ value }) => {
|
|
7911
8181
|
const gradient = getGradientValue(value);
|
|
7912
|
-
return /* @__PURE__ */
|
|
8182
|
+
return /* @__PURE__ */ React112.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
7913
8183
|
};
|
|
7914
8184
|
var ItemLabelGradient = ({ value }) => {
|
|
7915
8185
|
if (value.type === "linear") {
|
|
7916
|
-
return /* @__PURE__ */
|
|
8186
|
+
return /* @__PURE__ */ React112.createElement("span", null, __84("Linear gradient", "elementor"));
|
|
7917
8187
|
}
|
|
7918
|
-
return /* @__PURE__ */
|
|
8188
|
+
return /* @__PURE__ */ React112.createElement("span", null, __84("Radial gradient", "elementor"));
|
|
7919
8189
|
};
|
|
7920
8190
|
var getGradientValue = (gradient) => {
|
|
7921
8191
|
const stops = gradient.stops?.map(({ color, offset }) => `${color} ${offset ?? 0}%`)?.join(",");
|
|
@@ -7926,15 +8196,15 @@ var getGradientValue = (gradient) => {
|
|
|
7926
8196
|
};
|
|
7927
8197
|
|
|
7928
8198
|
// src/styles-inheritance/transformers/background-image-overlay-transformer.tsx
|
|
7929
|
-
import * as
|
|
8199
|
+
import * as React113 from "react";
|
|
7930
8200
|
import { createTransformer as createTransformer5 } from "@elementor/editor-canvas";
|
|
7931
8201
|
import { EllipsisWithTooltip as EllipsisWithTooltip2 } from "@elementor/editor-ui";
|
|
7932
|
-
import { CardMedia, Stack as
|
|
8202
|
+
import { CardMedia, Stack as Stack23 } from "@elementor/ui";
|
|
7933
8203
|
import { useWpMediaAttachment } from "@elementor/wp-media";
|
|
7934
|
-
var backgroundImageOverlayTransformer = createTransformer5((value) => /* @__PURE__ */
|
|
8204
|
+
var backgroundImageOverlayTransformer = createTransformer5((value) => /* @__PURE__ */ React113.createElement(Stack23, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React113.createElement(ItemIconImage, { value }), /* @__PURE__ */ React113.createElement(ItemLabelImage, { value })));
|
|
7935
8205
|
var ItemIconImage = ({ value }) => {
|
|
7936
8206
|
const { imageUrl } = useImage(value);
|
|
7937
|
-
return /* @__PURE__ */
|
|
8207
|
+
return /* @__PURE__ */ React113.createElement(
|
|
7938
8208
|
CardMedia,
|
|
7939
8209
|
{
|
|
7940
8210
|
image: imageUrl,
|
|
@@ -7950,7 +8220,7 @@ var ItemIconImage = ({ value }) => {
|
|
|
7950
8220
|
};
|
|
7951
8221
|
var ItemLabelImage = ({ value }) => {
|
|
7952
8222
|
const { imageTitle } = useImage(value);
|
|
7953
|
-
return /* @__PURE__ */
|
|
8223
|
+
return /* @__PURE__ */ React113.createElement(EllipsisWithTooltip2, { title: imageTitle }, /* @__PURE__ */ React113.createElement("span", null, imageTitle));
|
|
7954
8224
|
};
|
|
7955
8225
|
var useImage = (image) => {
|
|
7956
8226
|
let imageTitle, imageUrl = null;
|
|
@@ -7975,7 +8245,7 @@ var getFileExtensionFromFilename = (filename) => {
|
|
|
7975
8245
|
};
|
|
7976
8246
|
|
|
7977
8247
|
// src/styles-inheritance/transformers/box-shadow-transformer.tsx
|
|
7978
|
-
import * as
|
|
8248
|
+
import * as React114 from "react";
|
|
7979
8249
|
import { createTransformer as createTransformer6 } from "@elementor/editor-canvas";
|
|
7980
8250
|
var boxShadowTransformer = createTransformer6((value) => {
|
|
7981
8251
|
if (!value) {
|
|
@@ -7985,13 +8255,13 @@ var boxShadowTransformer = createTransformer6((value) => {
|
|
|
7985
8255
|
const colorValue = color || "#000000";
|
|
7986
8256
|
const sizes = [hOffset || "0px", vOffset || "0px", blur || "10px", spread || "0px"].join(" ");
|
|
7987
8257
|
const positionValue = position || "outset";
|
|
7988
|
-
return /* @__PURE__ */
|
|
8258
|
+
return /* @__PURE__ */ React114.createElement(React114.Fragment, null, colorValue, " ", positionValue, ", ", sizes);
|
|
7989
8259
|
});
|
|
7990
8260
|
|
|
7991
8261
|
// src/styles-inheritance/transformers/color-transformer.tsx
|
|
7992
|
-
import * as
|
|
8262
|
+
import * as React115 from "react";
|
|
7993
8263
|
import { createTransformer as createTransformer7 } from "@elementor/editor-canvas";
|
|
7994
|
-
import { Stack as
|
|
8264
|
+
import { Stack as Stack24, styled as styled8, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
7995
8265
|
function isValidCSSColor(value) {
|
|
7996
8266
|
if (!value.trim()) {
|
|
7997
8267
|
return false;
|
|
@@ -8009,7 +8279,7 @@ var colorTransformer = createTransformer7((value) => {
|
|
|
8009
8279
|
if (!isValidCSSColor(value)) {
|
|
8010
8280
|
return value;
|
|
8011
8281
|
}
|
|
8012
|
-
return /* @__PURE__ */
|
|
8282
|
+
return /* @__PURE__ */ React115.createElement(Stack24, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React115.createElement(StyledColorIndicator, { size: "inherit", component: "span", value }), /* @__PURE__ */ React115.createElement("span", null, value));
|
|
8013
8283
|
});
|
|
8014
8284
|
|
|
8015
8285
|
// src/styles-inheritance/transformers/repeater-to-items-transformer.tsx
|