@elementor/editor-editing-panel 3.33.0-271 → 3.33.0-273
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 +188 -136
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +179 -129
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
- package/src/controls-registry/element-controls/tabs-control/tabs-control.tsx +11 -14
- package/src/controls-registry/element-controls/tabs-control/use-actions.ts +221 -0
- package/src/controls-registry/element-controls/tabs-control/actions.ts +0 -159
package/dist/index.js
CHANGED
|
@@ -51,7 +51,7 @@ __export(index_exports, {
|
|
|
51
51
|
registerControlReplacement: () => registerControlReplacement,
|
|
52
52
|
registerStyleProviderToColors: () => registerStyleProviderToColors,
|
|
53
53
|
stylesInheritanceTransformersRegistry: () => stylesInheritanceTransformersRegistry,
|
|
54
|
-
useBoundProp: () =>
|
|
54
|
+
useBoundProp: () => import_editor_controls63.useBoundProp,
|
|
55
55
|
useClassesProp: () => useClassesProp,
|
|
56
56
|
useCustomCss: () => useCustomCss,
|
|
57
57
|
useElement: () => useElement,
|
|
@@ -63,7 +63,7 @@ __export(index_exports, {
|
|
|
63
63
|
useStylesRerender: () => useStylesRerender
|
|
64
64
|
});
|
|
65
65
|
module.exports = __toCommonJS(index_exports);
|
|
66
|
-
var
|
|
66
|
+
var import_editor_controls63 = require("@elementor/editor-controls");
|
|
67
67
|
|
|
68
68
|
// src/components/css-classes/css-class-convert-local.tsx
|
|
69
69
|
var React4 = __toESM(require("react"));
|
|
@@ -5273,7 +5273,7 @@ var EditingPanelHooks = () => {
|
|
|
5273
5273
|
|
|
5274
5274
|
// src/controls-registry/element-controls/tabs-control/tabs-control.tsx
|
|
5275
5275
|
var React91 = __toESM(require("react"));
|
|
5276
|
-
var
|
|
5276
|
+
var import_editor_controls54 = require("@elementor/editor-controls");
|
|
5277
5277
|
var import_editor_elements17 = require("@elementor/editor-elements");
|
|
5278
5278
|
var import_editor_props17 = require("@elementor/editor-props");
|
|
5279
5279
|
var import_icons25 = require("@elementor/icons");
|
|
@@ -5297,128 +5297,181 @@ var getElementByType = (elementId, type) => {
|
|
|
5297
5297
|
return element;
|
|
5298
5298
|
};
|
|
5299
5299
|
|
|
5300
|
-
// src/controls-registry/element-controls/tabs-control/actions.ts
|
|
5300
|
+
// src/controls-registry/element-controls/tabs-control/use-actions.ts
|
|
5301
|
+
var import_editor_controls53 = require("@elementor/editor-controls");
|
|
5301
5302
|
var import_editor_elements16 = require("@elementor/editor-elements");
|
|
5302
5303
|
var import_editor_props16 = require("@elementor/editor-props");
|
|
5303
5304
|
var import_i18n62 = require("@wordpress/i18n");
|
|
5304
5305
|
var TAB_ELEMENT_TYPE = "e-tab";
|
|
5305
5306
|
var TAB_CONTENT_ELEMENT_TYPE = "e-tab-content";
|
|
5306
|
-
var
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
if (!tabContentId) {
|
|
5315
|
-
throw new Error("Original content ID is required for duplication");
|
|
5316
|
-
}
|
|
5317
|
-
(0, import_editor_elements16.duplicateElements)({
|
|
5318
|
-
elementIds: [tabId, tabContentId],
|
|
5319
|
-
title: (0, import_i18n62.__)("Duplicate Tab", "elementor")
|
|
5320
|
-
});
|
|
5321
|
-
});
|
|
5322
|
-
};
|
|
5323
|
-
var moveItem = ({
|
|
5324
|
-
toIndex,
|
|
5325
|
-
tabsMenuId,
|
|
5326
|
-
tabContentAreaId,
|
|
5327
|
-
movedElementId,
|
|
5328
|
-
movedElementIndex
|
|
5329
|
-
}) => {
|
|
5330
|
-
const tabContentContainer = (0, import_editor_elements16.getContainer)(tabContentAreaId);
|
|
5331
|
-
const tabContentId = tabContentContainer?.children?.[movedElementIndex]?.id;
|
|
5332
|
-
if (!tabContentId) {
|
|
5333
|
-
throw new Error("Content ID is required");
|
|
5334
|
-
}
|
|
5335
|
-
(0, import_editor_elements16.moveElements)({
|
|
5336
|
-
title: (0, import_i18n62.__)("Reorder Tabs", "elementor"),
|
|
5337
|
-
moves: [
|
|
5338
|
-
{
|
|
5339
|
-
elementId: movedElementId,
|
|
5340
|
-
targetContainerId: tabsMenuId,
|
|
5341
|
-
options: { at: toIndex }
|
|
5342
|
-
},
|
|
5343
|
-
{
|
|
5344
|
-
elementId: tabContentId,
|
|
5345
|
-
targetContainerId: tabContentAreaId,
|
|
5346
|
-
options: { at: toIndex }
|
|
5347
|
-
}
|
|
5348
|
-
]
|
|
5349
|
-
});
|
|
5350
|
-
};
|
|
5351
|
-
var removeItem = ({
|
|
5352
|
-
items: items3,
|
|
5353
|
-
tabContentAreaId,
|
|
5354
|
-
tabsContainerId
|
|
5355
|
-
}) => {
|
|
5356
|
-
const defaultActiveTab = (0, import_editor_elements16.getElementSetting)(tabsContainerId, "default-active-tab");
|
|
5357
|
-
const isDefault = items3.some(({ index }) => index === defaultActiveTab?.value);
|
|
5358
|
-
(0, import_editor_elements16.removeElements)({
|
|
5359
|
-
title: (0, import_i18n62.__)("Tabs", "elementor"),
|
|
5360
|
-
elementIds: items3.flatMap(({ item, index }) => {
|
|
5307
|
+
var useActions = () => {
|
|
5308
|
+
const { value, setValue: setDefaultActiveTab } = (0, import_editor_controls53.useBoundProp)(import_editor_props16.numberPropTypeUtil);
|
|
5309
|
+
const defaultActiveTab = value ?? 0;
|
|
5310
|
+
const duplicateItem = ({
|
|
5311
|
+
items: items3,
|
|
5312
|
+
tabContentAreaId
|
|
5313
|
+
}) => {
|
|
5314
|
+
items3.forEach(({ item, index }) => {
|
|
5361
5315
|
const tabId = item.id;
|
|
5362
|
-
const
|
|
5363
|
-
const tabContentId =
|
|
5316
|
+
const tabContentAreaContainer = (0, import_editor_elements16.getContainer)(tabContentAreaId);
|
|
5317
|
+
const tabContentId = tabContentAreaContainer?.children?.[index]?.id;
|
|
5364
5318
|
if (!tabContentId) {
|
|
5365
|
-
throw new Error("
|
|
5366
|
-
}
|
|
5367
|
-
return [tabId, tabContentId];
|
|
5368
|
-
}),
|
|
5369
|
-
onRemoveElements: () => {
|
|
5370
|
-
if (isDefault) {
|
|
5371
|
-
(0, import_editor_elements16.updateElementSettings)({
|
|
5372
|
-
id: tabsContainerId,
|
|
5373
|
-
props: { "default-active-tab": import_editor_props16.numberPropTypeUtil.create(0) },
|
|
5374
|
-
withHistory: false
|
|
5375
|
-
});
|
|
5376
|
-
}
|
|
5377
|
-
},
|
|
5378
|
-
onRestoreElements: () => {
|
|
5379
|
-
if (isDefault) {
|
|
5380
|
-
(0, import_editor_elements16.updateElementSettings)({
|
|
5381
|
-
id: tabsContainerId,
|
|
5382
|
-
props: { "default-active-tab": defaultActiveTab },
|
|
5383
|
-
withHistory: false
|
|
5384
|
-
});
|
|
5319
|
+
throw new Error("Original content ID is required for duplication");
|
|
5385
5320
|
}
|
|
5321
|
+
(0, import_editor_elements16.duplicateElements)({
|
|
5322
|
+
elementIds: [tabId, tabContentId],
|
|
5323
|
+
title: (0, import_i18n62.__)("Duplicate Tab", "elementor")
|
|
5324
|
+
});
|
|
5325
|
+
});
|
|
5326
|
+
};
|
|
5327
|
+
const moveItem = ({
|
|
5328
|
+
toIndex,
|
|
5329
|
+
tabsMenuId,
|
|
5330
|
+
tabContentAreaId,
|
|
5331
|
+
movedElementId,
|
|
5332
|
+
movedElementIndex
|
|
5333
|
+
}) => {
|
|
5334
|
+
const tabContentContainer = (0, import_editor_elements16.getContainer)(tabContentAreaId);
|
|
5335
|
+
const tabContentId = tabContentContainer?.children?.[movedElementIndex]?.id;
|
|
5336
|
+
if (!tabContentId) {
|
|
5337
|
+
throw new Error("Content ID is required");
|
|
5386
5338
|
}
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
(0, import_editor_elements16.createElements)({
|
|
5396
|
-
title: (0, import_i18n62.__)("Tabs", "elementor"),
|
|
5397
|
-
elements: [
|
|
5339
|
+
const newDefault = calculateDefaultOnMove({
|
|
5340
|
+
from: movedElementIndex,
|
|
5341
|
+
to: toIndex,
|
|
5342
|
+
defaultActiveTab
|
|
5343
|
+
});
|
|
5344
|
+
(0, import_editor_elements16.moveElements)({
|
|
5345
|
+
title: (0, import_i18n62.__)("Reorder Tabs", "elementor"),
|
|
5346
|
+
moves: [
|
|
5398
5347
|
{
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
editor_settings: { title: `Tab ${index + 1} content` }
|
|
5403
|
-
}
|
|
5348
|
+
elementId: movedElementId,
|
|
5349
|
+
targetContainerId: tabsMenuId,
|
|
5350
|
+
options: { at: toIndex }
|
|
5404
5351
|
},
|
|
5405
5352
|
{
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
editor_settings: { title: `Tab ${index + 1} trigger` }
|
|
5410
|
-
}
|
|
5353
|
+
elementId: tabContentId,
|
|
5354
|
+
targetContainerId: tabContentAreaId,
|
|
5355
|
+
options: { at: toIndex }
|
|
5411
5356
|
}
|
|
5412
|
-
]
|
|
5357
|
+
],
|
|
5358
|
+
onMoveElements: () => {
|
|
5359
|
+
if (newDefault !== defaultActiveTab) {
|
|
5360
|
+
setDefaultActiveTab(newDefault);
|
|
5361
|
+
}
|
|
5362
|
+
},
|
|
5363
|
+
onRestoreElements: () => {
|
|
5364
|
+
if (newDefault !== defaultActiveTab) {
|
|
5365
|
+
setDefaultActiveTab(defaultActiveTab);
|
|
5366
|
+
}
|
|
5367
|
+
}
|
|
5413
5368
|
});
|
|
5414
|
-
}
|
|
5369
|
+
};
|
|
5370
|
+
const removeItem = ({
|
|
5371
|
+
items: items3,
|
|
5372
|
+
tabContentAreaId
|
|
5373
|
+
}) => {
|
|
5374
|
+
const newDefault = calculateDefaultOnRemove({
|
|
5375
|
+
items: items3,
|
|
5376
|
+
defaultActiveTab
|
|
5377
|
+
});
|
|
5378
|
+
(0, import_editor_elements16.removeElements)({
|
|
5379
|
+
title: (0, import_i18n62.__)("Tabs", "elementor"),
|
|
5380
|
+
elementIds: items3.flatMap(({ item, index }) => {
|
|
5381
|
+
const tabId = item.id;
|
|
5382
|
+
const tabContentContainer = (0, import_editor_elements16.getContainer)(tabContentAreaId);
|
|
5383
|
+
const tabContentId = tabContentContainer?.children?.[index]?.id;
|
|
5384
|
+
if (!tabContentId) {
|
|
5385
|
+
throw new Error("Content ID is required");
|
|
5386
|
+
}
|
|
5387
|
+
return [tabId, tabContentId];
|
|
5388
|
+
}),
|
|
5389
|
+
onRemoveElements: () => {
|
|
5390
|
+
if (newDefault !== defaultActiveTab) {
|
|
5391
|
+
setDefaultActiveTab(newDefault);
|
|
5392
|
+
}
|
|
5393
|
+
},
|
|
5394
|
+
onRestoreElements: () => {
|
|
5395
|
+
if (newDefault !== defaultActiveTab) {
|
|
5396
|
+
setDefaultActiveTab(defaultActiveTab);
|
|
5397
|
+
}
|
|
5398
|
+
}
|
|
5399
|
+
});
|
|
5400
|
+
};
|
|
5401
|
+
const addItem = ({
|
|
5402
|
+
tabContentAreaId,
|
|
5403
|
+
tabsMenuId,
|
|
5404
|
+
items: items3
|
|
5405
|
+
}) => {
|
|
5406
|
+
items3.forEach(({ index }) => {
|
|
5407
|
+
(0, import_editor_elements16.createElements)({
|
|
5408
|
+
title: (0, import_i18n62.__)("Tabs", "elementor"),
|
|
5409
|
+
elements: [
|
|
5410
|
+
{
|
|
5411
|
+
containerId: tabContentAreaId,
|
|
5412
|
+
model: {
|
|
5413
|
+
elType: TAB_CONTENT_ELEMENT_TYPE,
|
|
5414
|
+
editor_settings: { title: `Tab ${index + 1} content` }
|
|
5415
|
+
}
|
|
5416
|
+
},
|
|
5417
|
+
{
|
|
5418
|
+
containerId: tabsMenuId,
|
|
5419
|
+
model: {
|
|
5420
|
+
elType: TAB_ELEMENT_TYPE,
|
|
5421
|
+
editor_settings: { title: `Tab ${index + 1} trigger` }
|
|
5422
|
+
}
|
|
5423
|
+
}
|
|
5424
|
+
]
|
|
5425
|
+
});
|
|
5426
|
+
});
|
|
5427
|
+
};
|
|
5428
|
+
return {
|
|
5429
|
+
duplicateItem,
|
|
5430
|
+
moveItem,
|
|
5431
|
+
removeItem,
|
|
5432
|
+
addItem
|
|
5433
|
+
};
|
|
5434
|
+
};
|
|
5435
|
+
var calculateDefaultOnMove = ({
|
|
5436
|
+
from,
|
|
5437
|
+
to,
|
|
5438
|
+
defaultActiveTab
|
|
5439
|
+
}) => {
|
|
5440
|
+
if (from === defaultActiveTab) {
|
|
5441
|
+
return to;
|
|
5442
|
+
}
|
|
5443
|
+
if (to === defaultActiveTab) {
|
|
5444
|
+
return from;
|
|
5445
|
+
}
|
|
5446
|
+
if (from < defaultActiveTab && to > defaultActiveTab) {
|
|
5447
|
+
return defaultActiveTab - 1;
|
|
5448
|
+
}
|
|
5449
|
+
if (from > defaultActiveTab && to < defaultActiveTab) {
|
|
5450
|
+
return defaultActiveTab + 1;
|
|
5451
|
+
}
|
|
5452
|
+
return defaultActiveTab;
|
|
5453
|
+
};
|
|
5454
|
+
var calculateDefaultOnRemove = ({
|
|
5455
|
+
items: items3,
|
|
5456
|
+
defaultActiveTab
|
|
5457
|
+
}) => {
|
|
5458
|
+
const isDefault = items3.some(({ index }) => index === defaultActiveTab);
|
|
5459
|
+
if (isDefault) {
|
|
5460
|
+
return 0;
|
|
5461
|
+
}
|
|
5462
|
+
const defaultGap = items3.reduce((acc, { index }) => index < defaultActiveTab ? acc + 1 : acc, 0);
|
|
5463
|
+
return defaultActiveTab - defaultGap;
|
|
5415
5464
|
};
|
|
5416
5465
|
|
|
5417
5466
|
// src/controls-registry/element-controls/tabs-control/tabs-control.tsx
|
|
5418
5467
|
var TAB_MENU_ELEMENT_TYPE = "e-tabs-menu";
|
|
5419
5468
|
var TAB_CONTENT_AREA_ELEMENT_TYPE = "e-tabs-content-area";
|
|
5420
5469
|
var TabsControl = ({ label }) => {
|
|
5470
|
+
return /* @__PURE__ */ React91.createElement(SettingsField, { bind: "default-active-tab", propDisplayName: (0, import_i18n63.__)("Tabs", "elementor") }, /* @__PURE__ */ React91.createElement(TabsControlContent, { label }));
|
|
5471
|
+
};
|
|
5472
|
+
var TabsControlContent = ({ label }) => {
|
|
5421
5473
|
const { element } = useElement();
|
|
5474
|
+
const { addItem, duplicateItem, moveItem, removeItem } = useActions();
|
|
5422
5475
|
const { [TAB_ELEMENT_TYPE]: tabLinks } = (0, import_editor_elements17.useElementChildren)(element.id, [
|
|
5423
5476
|
TAB_ELEMENT_TYPE,
|
|
5424
5477
|
TAB_CONTENT_ELEMENT_TYPE
|
|
@@ -5442,8 +5495,7 @@ var TabsControl = ({ label }) => {
|
|
|
5442
5495
|
const items3 = meta.action.payload;
|
|
5443
5496
|
return removeItem({
|
|
5444
5497
|
items: items3,
|
|
5445
|
-
tabContentAreaId: tabContentArea.id
|
|
5446
|
-
tabsContainerId: element.id
|
|
5498
|
+
tabContentAreaId: tabContentArea.id
|
|
5447
5499
|
});
|
|
5448
5500
|
}
|
|
5449
5501
|
if (meta?.action?.type === "duplicate") {
|
|
@@ -5462,7 +5514,7 @@ var TabsControl = ({ label }) => {
|
|
|
5462
5514
|
}
|
|
5463
5515
|
};
|
|
5464
5516
|
return /* @__PURE__ */ React91.createElement(
|
|
5465
|
-
|
|
5517
|
+
import_editor_controls54.Repeater,
|
|
5466
5518
|
{
|
|
5467
5519
|
showToggle: false,
|
|
5468
5520
|
values: repeaterValues,
|
|
@@ -5483,10 +5535,10 @@ var ItemLabel = ({ value, index }) => {
|
|
|
5483
5535
|
const id = value.id ?? "";
|
|
5484
5536
|
const editorSettings = (0, import_editor_elements17.useElementEditorSettings)(id);
|
|
5485
5537
|
const elementTitle = editorSettings?.title;
|
|
5486
|
-
return /* @__PURE__ */ React91.createElement(import_ui46.Stack, { sx: { minHeight: 20 }, direction: "row", alignItems: "center", gap: 1.5 }, /* @__PURE__ */ React91.createElement("span", null, elementTitle), /* @__PURE__ */ React91.createElement(
|
|
5538
|
+
return /* @__PURE__ */ React91.createElement(import_ui46.Stack, { sx: { minHeight: 20 }, direction: "row", alignItems: "center", gap: 1.5 }, /* @__PURE__ */ React91.createElement("span", null, elementTitle), /* @__PURE__ */ React91.createElement(ItemDefaultTab, { index }));
|
|
5487
5539
|
};
|
|
5488
5540
|
var ItemDefaultTab = ({ index }) => {
|
|
5489
|
-
const { value: defaultItem } = (0,
|
|
5541
|
+
const { value: defaultItem } = (0, import_editor_controls54.useBoundProp)(import_editor_props17.numberPropTypeUtil);
|
|
5490
5542
|
const isDefault = defaultItem === index;
|
|
5491
5543
|
if (!isDefault) {
|
|
5492
5544
|
return null;
|
|
@@ -5500,9 +5552,9 @@ var ItemContent = ({ value, index }) => {
|
|
|
5500
5552
|
return /* @__PURE__ */ React91.createElement(import_ui46.Stack, { p: 2, gap: 1.5 }, /* @__PURE__ */ React91.createElement(TabLabelControl, { elementId: value.id }), /* @__PURE__ */ React91.createElement(SettingsField, { bind: "default-active-tab", propDisplayName: (0, import_i18n63.__)("Tabs", "elementor") }, /* @__PURE__ */ React91.createElement(DefaultTabControl, { tabIndex: index })));
|
|
5501
5553
|
};
|
|
5502
5554
|
var DefaultTabControl = ({ tabIndex }) => {
|
|
5503
|
-
const { value, setValue } = (0,
|
|
5555
|
+
const { value, setValue } = (0, import_editor_controls54.useBoundProp)(import_editor_props17.numberPropTypeUtil);
|
|
5504
5556
|
const isDefault = value === tabIndex;
|
|
5505
|
-
return /* @__PURE__ */ React91.createElement(import_ui46.Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 2 }, /* @__PURE__ */ React91.createElement(
|
|
5557
|
+
return /* @__PURE__ */ React91.createElement(import_ui46.Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 2 }, /* @__PURE__ */ React91.createElement(import_editor_controls54.ControlFormLabel, null, (0, import_i18n63.__)("Set as default tab", "elementor")), /* @__PURE__ */ React91.createElement(ConditionalTooltip, { showTooltip: isDefault, placement: "right" }, /* @__PURE__ */ React91.createElement(
|
|
5506
5558
|
import_ui46.Switch,
|
|
5507
5559
|
{
|
|
5508
5560
|
size: "small",
|
|
@@ -5520,7 +5572,7 @@ var DefaultTabControl = ({ tabIndex }) => {
|
|
|
5520
5572
|
var TabLabelControl = ({ elementId }) => {
|
|
5521
5573
|
const editorSettings = (0, import_editor_elements17.useElementEditorSettings)(elementId);
|
|
5522
5574
|
const label = editorSettings?.title ?? "";
|
|
5523
|
-
return /* @__PURE__ */ React91.createElement(import_ui46.Stack, { gap: 1 }, /* @__PURE__ */ React91.createElement(
|
|
5575
|
+
return /* @__PURE__ */ React91.createElement(import_ui46.Stack, { gap: 1 }, /* @__PURE__ */ React91.createElement(import_editor_controls54.ControlFormLabel, null, (0, import_i18n63.__)("Tab name", "elementor")), /* @__PURE__ */ React91.createElement(
|
|
5524
5576
|
import_ui46.TextField,
|
|
5525
5577
|
{
|
|
5526
5578
|
size: "tiny",
|
|
@@ -5574,11 +5626,11 @@ var registerElementControls = () => {
|
|
|
5574
5626
|
|
|
5575
5627
|
// src/dynamics/init.ts
|
|
5576
5628
|
var import_editor_canvas5 = require("@elementor/editor-canvas");
|
|
5577
|
-
var
|
|
5629
|
+
var import_editor_controls61 = require("@elementor/editor-controls");
|
|
5578
5630
|
|
|
5579
5631
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
5580
5632
|
var React92 = __toESM(require("react"));
|
|
5581
|
-
var
|
|
5633
|
+
var import_editor_controls56 = require("@elementor/editor-controls");
|
|
5582
5634
|
var import_editor_props19 = require("@elementor/editor-props");
|
|
5583
5635
|
var import_icons26 = require("@elementor/icons");
|
|
5584
5636
|
|
|
@@ -5587,7 +5639,7 @@ var import_react41 = require("react");
|
|
|
5587
5639
|
|
|
5588
5640
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
5589
5641
|
var import_react40 = require("react");
|
|
5590
|
-
var
|
|
5642
|
+
var import_editor_controls55 = require("@elementor/editor-controls");
|
|
5591
5643
|
|
|
5592
5644
|
// src/dynamics/sync/get-elementor-config.ts
|
|
5593
5645
|
var getElementorConfig2 = () => {
|
|
@@ -5633,7 +5685,7 @@ var dynamicPropTypeUtil = (0, import_editor_props18.createPropUtils)(
|
|
|
5633
5685
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
5634
5686
|
var usePropDynamicTags = () => {
|
|
5635
5687
|
let categories = [];
|
|
5636
|
-
const { propType } = (0,
|
|
5688
|
+
const { propType } = (0, import_editor_controls55.useBoundProp)();
|
|
5637
5689
|
if (propType) {
|
|
5638
5690
|
const propDynamicType = getDynamicPropType(propType);
|
|
5639
5691
|
categories = propDynamicType?.settings.categories || [];
|
|
@@ -5674,13 +5726,13 @@ var useDynamicTag = (tagName) => {
|
|
|
5674
5726
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
5675
5727
|
var BackgroundControlDynamicTagIcon = () => /* @__PURE__ */ React92.createElement(import_icons26.DatabaseIcon, { fontSize: "tiny" });
|
|
5676
5728
|
var BackgroundControlDynamicTagLabel = ({ value }) => {
|
|
5677
|
-
const context = (0,
|
|
5678
|
-
return /* @__PURE__ */ React92.createElement(
|
|
5729
|
+
const context = (0, import_editor_controls56.useBoundProp)(import_editor_props19.backgroundImageOverlayPropTypeUtil);
|
|
5730
|
+
return /* @__PURE__ */ React92.createElement(import_editor_controls56.PropProvider, { ...context, value: value.value }, /* @__PURE__ */ React92.createElement(import_editor_controls56.PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React92.createElement(Wrapper, { rawValue: value.value })));
|
|
5679
5731
|
};
|
|
5680
5732
|
var Wrapper = ({ rawValue }) => {
|
|
5681
|
-
const { propType } = (0,
|
|
5733
|
+
const { propType } = (0, import_editor_controls56.useBoundProp)();
|
|
5682
5734
|
const imageOverlayPropType = propType.prop_types["background-image-overlay"];
|
|
5683
|
-
return /* @__PURE__ */ React92.createElement(
|
|
5735
|
+
return /* @__PURE__ */ React92.createElement(import_editor_controls56.PropProvider, { propType: imageOverlayPropType.shape.image, value: rawValue, setValue: () => void 0 }, /* @__PURE__ */ React92.createElement(import_editor_controls56.PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React92.createElement(Content, { rawValue: rawValue.image })));
|
|
5684
5736
|
};
|
|
5685
5737
|
var Content = ({ rawValue }) => {
|
|
5686
5738
|
const src = rawValue.value.src;
|
|
@@ -5690,7 +5742,7 @@ var Content = ({ rawValue }) => {
|
|
|
5690
5742
|
|
|
5691
5743
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
5692
5744
|
var React96 = __toESM(require("react"));
|
|
5693
|
-
var
|
|
5745
|
+
var import_editor_controls59 = require("@elementor/editor-controls");
|
|
5694
5746
|
var import_editor_ui8 = require("@elementor/editor-ui");
|
|
5695
5747
|
var import_icons28 = require("@elementor/icons");
|
|
5696
5748
|
var import_ui48 = require("@elementor/ui");
|
|
@@ -5706,7 +5758,7 @@ var usePersistDynamicValue = (propKey) => {
|
|
|
5706
5758
|
|
|
5707
5759
|
// src/dynamics/dynamic-control.tsx
|
|
5708
5760
|
var React94 = __toESM(require("react"));
|
|
5709
|
-
var
|
|
5761
|
+
var import_editor_controls57 = require("@elementor/editor-controls");
|
|
5710
5762
|
|
|
5711
5763
|
// src/dynamics/components/dynamic-conditional-control.tsx
|
|
5712
5764
|
var React93 = __toESM(require("react"));
|
|
@@ -5758,7 +5810,7 @@ var DynamicConditionalControl = ({
|
|
|
5758
5810
|
|
|
5759
5811
|
// src/dynamics/dynamic-control.tsx
|
|
5760
5812
|
var DynamicControl = ({ bind, children }) => {
|
|
5761
|
-
const { value, setValue } = (0,
|
|
5813
|
+
const { value, setValue } = (0, import_editor_controls57.useBoundProp)(dynamicPropTypeUtil);
|
|
5762
5814
|
const { name = "", settings } = value ?? {};
|
|
5763
5815
|
const dynamicTag = useDynamicTag(name);
|
|
5764
5816
|
if (!dynamicTag) {
|
|
@@ -5777,7 +5829,7 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
5777
5829
|
});
|
|
5778
5830
|
};
|
|
5779
5831
|
const propType = createTopLevelObjectType({ schema: dynamicTag.props_schema });
|
|
5780
|
-
return /* @__PURE__ */ React94.createElement(
|
|
5832
|
+
return /* @__PURE__ */ React94.createElement(import_editor_controls57.PropProvider, { propType, setValue: setDynamicValue, value: { [bind]: dynamicValue } }, /* @__PURE__ */ React94.createElement(import_editor_controls57.PropKeyProvider, { bind }, /* @__PURE__ */ React94.createElement(
|
|
5781
5833
|
DynamicConditionalControl,
|
|
5782
5834
|
{
|
|
5783
5835
|
propType: dynamicPropType,
|
|
@@ -5791,7 +5843,7 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
5791
5843
|
// src/dynamics/components/dynamic-selection.tsx
|
|
5792
5844
|
var import_react42 = require("react");
|
|
5793
5845
|
var React95 = __toESM(require("react"));
|
|
5794
|
-
var
|
|
5846
|
+
var import_editor_controls58 = require("@elementor/editor-controls");
|
|
5795
5847
|
var import_editor_ui7 = require("@elementor/editor-ui");
|
|
5796
5848
|
var import_icons27 = require("@elementor/icons");
|
|
5797
5849
|
var import_ui47 = require("@elementor/ui");
|
|
@@ -5801,8 +5853,8 @@ var DynamicSelection = ({ close: closePopover }) => {
|
|
|
5801
5853
|
const [searchValue, setSearchValue] = (0, import_react42.useState)("");
|
|
5802
5854
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
5803
5855
|
const theme = (0, import_ui47.useTheme)();
|
|
5804
|
-
const { value: anyValue } = (0,
|
|
5805
|
-
const { bind, value: dynamicValue, setValue } = (0,
|
|
5856
|
+
const { value: anyValue } = (0, import_editor_controls58.useBoundProp)();
|
|
5857
|
+
const { bind, value: dynamicValue, setValue } = (0, import_editor_controls58.useBoundProp)(dynamicPropTypeUtil);
|
|
5806
5858
|
const [, updatePropValueHistory] = usePersistDynamicValue(bind);
|
|
5807
5859
|
const isCurrentValueDynamic = !!dynamicValue;
|
|
5808
5860
|
const options12 = useFilteredOptions(searchValue);
|
|
@@ -5906,8 +5958,8 @@ var useFilteredOptions = (searchValue) => {
|
|
|
5906
5958
|
var SIZE7 = "tiny";
|
|
5907
5959
|
var tagsWithoutTabs = ["popup"];
|
|
5908
5960
|
var DynamicSelectionControl = () => {
|
|
5909
|
-
const { setValue: setAnyValue } = (0,
|
|
5910
|
-
const { bind, value } = (0,
|
|
5961
|
+
const { setValue: setAnyValue } = (0, import_editor_controls59.useBoundProp)();
|
|
5962
|
+
const { bind, value } = (0, import_editor_controls59.useBoundProp)(dynamicPropTypeUtil);
|
|
5911
5963
|
const [propValueFromHistory] = usePersistDynamicValue(bind);
|
|
5912
5964
|
const selectionPopoverState = (0, import_ui48.usePopupState)({ variant: "popover" });
|
|
5913
5965
|
const { name: tagName = "" } = value;
|
|
@@ -6055,7 +6107,7 @@ var Control3 = ({ control }) => {
|
|
|
6055
6107
|
display: "grid",
|
|
6056
6108
|
gridTemplateColumns: isSwitchControl ? "minmax(0, 1fr) max-content" : "1fr 1fr"
|
|
6057
6109
|
} : {};
|
|
6058
|
-
return /* @__PURE__ */ React96.createElement(DynamicControl, { bind: control.bind }, /* @__PURE__ */ React96.createElement(import_ui48.Grid, { container: true, gap: 0.75, sx: layoutStyleProps }, control.label ? /* @__PURE__ */ React96.createElement(import_ui48.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React96.createElement(
|
|
6110
|
+
return /* @__PURE__ */ React96.createElement(DynamicControl, { bind: control.bind }, /* @__PURE__ */ React96.createElement(import_ui48.Grid, { container: true, gap: 0.75, sx: layoutStyleProps }, control.label ? /* @__PURE__ */ React96.createElement(import_ui48.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React96.createElement(import_editor_controls59.ControlFormLabel, null, control.label)) : null, /* @__PURE__ */ React96.createElement(import_ui48.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React96.createElement(Control, { type: control.type, props: controlProps }))));
|
|
6059
6111
|
};
|
|
6060
6112
|
function ControlsItemsStack({ items: items3 }) {
|
|
6061
6113
|
return /* @__PURE__ */ React96.createElement(import_ui48.Stack, { p: 2, gap: 2, sx: { overflowY: "auto" } }, items3.map(
|
|
@@ -6114,11 +6166,11 @@ function getDynamicValue(name, settings) {
|
|
|
6114
6166
|
|
|
6115
6167
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
6116
6168
|
var React97 = __toESM(require("react"));
|
|
6117
|
-
var
|
|
6169
|
+
var import_editor_controls60 = require("@elementor/editor-controls");
|
|
6118
6170
|
var import_icons29 = require("@elementor/icons");
|
|
6119
6171
|
var import_i18n66 = require("@wordpress/i18n");
|
|
6120
6172
|
var usePropDynamicAction = () => {
|
|
6121
|
-
const { propType } = (0,
|
|
6173
|
+
const { propType } = (0, import_editor_controls60.useBoundProp)();
|
|
6122
6174
|
const visible = !!propType && supportsDynamic(propType);
|
|
6123
6175
|
return {
|
|
6124
6176
|
visible,
|
|
@@ -6135,12 +6187,12 @@ var init = () => {
|
|
|
6135
6187
|
component: DynamicSelectionControl,
|
|
6136
6188
|
condition: ({ value }) => isDynamicPropValue(value)
|
|
6137
6189
|
});
|
|
6138
|
-
(0,
|
|
6190
|
+
(0, import_editor_controls61.injectIntoRepeaterItemLabel)({
|
|
6139
6191
|
id: "dynamic-background-image",
|
|
6140
6192
|
condition: ({ value }) => isDynamicPropValue(value.value?.image?.value?.src),
|
|
6141
6193
|
component: BackgroundControlDynamicTagLabel
|
|
6142
6194
|
});
|
|
6143
|
-
(0,
|
|
6195
|
+
(0, import_editor_controls61.injectIntoRepeaterItemIcon)({
|
|
6144
6196
|
id: "dynamic-background-image",
|
|
6145
6197
|
condition: ({ value }) => isDynamicPropValue(value.value?.image?.value?.src),
|
|
6146
6198
|
component: BackgroundControlDynamicTagIcon
|
|
@@ -6154,7 +6206,7 @@ var init = () => {
|
|
|
6154
6206
|
};
|
|
6155
6207
|
|
|
6156
6208
|
// src/reset-style-props.tsx
|
|
6157
|
-
var
|
|
6209
|
+
var import_editor_controls62 = require("@elementor/editor-controls");
|
|
6158
6210
|
var import_icons30 = require("@elementor/icons");
|
|
6159
6211
|
var import_i18n67 = require("@wordpress/i18n");
|
|
6160
6212
|
|
|
@@ -6211,7 +6263,7 @@ function initResetStyleProps() {
|
|
|
6211
6263
|
}
|
|
6212
6264
|
function useResetStyleValueProps() {
|
|
6213
6265
|
const isStyle = useIsStyle();
|
|
6214
|
-
const { value, resetValue, propType } = (0,
|
|
6266
|
+
const { value, resetValue, propType } = (0, import_editor_controls62.useBoundProp)();
|
|
6215
6267
|
const hasValue = value !== null && value !== void 0;
|
|
6216
6268
|
const hasInitial = propType.initial_value !== void 0 && propType.initial_value !== null;
|
|
6217
6269
|
const isRequired = !!propType.settings?.required;
|