@elementor/editor-editing-panel 3.33.0-267 → 3.33.0-269
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 +44 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
- package/src/controls-registry/element-controls/tabs-control/actions.ts +32 -5
- package/src/controls-registry/element-controls/tabs-control/tabs-control.tsx +8 -4
package/dist/index.js
CHANGED
|
@@ -5275,7 +5275,7 @@ var EditingPanelHooks = () => {
|
|
|
5275
5275
|
var React91 = __toESM(require("react"));
|
|
5276
5276
|
var import_editor_controls53 = require("@elementor/editor-controls");
|
|
5277
5277
|
var import_editor_elements17 = require("@elementor/editor-elements");
|
|
5278
|
-
var
|
|
5278
|
+
var import_editor_props17 = require("@elementor/editor-props");
|
|
5279
5279
|
var import_icons25 = require("@elementor/icons");
|
|
5280
5280
|
var import_ui46 = require("@elementor/ui");
|
|
5281
5281
|
var import_i18n63 = require("@wordpress/i18n");
|
|
@@ -5299,6 +5299,7 @@ var getElementByType = (elementId, type) => {
|
|
|
5299
5299
|
|
|
5300
5300
|
// src/controls-registry/element-controls/tabs-control/actions.ts
|
|
5301
5301
|
var import_editor_elements16 = require("@elementor/editor-elements");
|
|
5302
|
+
var import_editor_props16 = require("@elementor/editor-props");
|
|
5302
5303
|
var import_i18n62 = require("@wordpress/i18n");
|
|
5303
5304
|
var TAB_ELEMENT_TYPE = "e-tab";
|
|
5304
5305
|
var TAB_CONTENT_ELEMENT_TYPE = "e-tab-content";
|
|
@@ -5349,8 +5350,11 @@ var moveItem = ({
|
|
|
5349
5350
|
};
|
|
5350
5351
|
var removeItem = ({
|
|
5351
5352
|
items: items3,
|
|
5352
|
-
tabContentAreaId
|
|
5353
|
+
tabContentAreaId,
|
|
5354
|
+
tabsContainerId
|
|
5353
5355
|
}) => {
|
|
5356
|
+
const defaultActiveTab = (0, import_editor_elements16.getElementSetting)(tabsContainerId, "default-active-tab");
|
|
5357
|
+
const isDefault = items3.some(({ index }) => index === defaultActiveTab?.value);
|
|
5354
5358
|
(0, import_editor_elements16.removeElements)({
|
|
5355
5359
|
title: (0, import_i18n62.__)("Tabs", "elementor"),
|
|
5356
5360
|
elementIds: items3.flatMap(({ item, index }) => {
|
|
@@ -5361,7 +5365,25 @@ var removeItem = ({
|
|
|
5361
5365
|
throw new Error("Content ID is required");
|
|
5362
5366
|
}
|
|
5363
5367
|
return [tabId, tabContentId];
|
|
5364
|
-
})
|
|
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
|
+
});
|
|
5385
|
+
}
|
|
5386
|
+
}
|
|
5365
5387
|
});
|
|
5366
5388
|
};
|
|
5367
5389
|
var addItem = ({
|
|
@@ -5418,7 +5440,11 @@ var TabsControl = ({ label }) => {
|
|
|
5418
5440
|
}
|
|
5419
5441
|
if (meta?.action?.type === "remove") {
|
|
5420
5442
|
const items3 = meta.action.payload;
|
|
5421
|
-
return removeItem({
|
|
5443
|
+
return removeItem({
|
|
5444
|
+
items: items3,
|
|
5445
|
+
tabContentAreaId: tabContentArea.id,
|
|
5446
|
+
tabsContainerId: element.id
|
|
5447
|
+
});
|
|
5422
5448
|
}
|
|
5423
5449
|
if (meta?.action?.type === "duplicate") {
|
|
5424
5450
|
const items3 = meta.action.payload;
|
|
@@ -5438,14 +5464,14 @@ var TabsControl = ({ label }) => {
|
|
|
5438
5464
|
return /* @__PURE__ */ React91.createElement(
|
|
5439
5465
|
import_editor_controls53.Repeater,
|
|
5440
5466
|
{
|
|
5441
|
-
addToBottom: true,
|
|
5442
5467
|
showToggle: false,
|
|
5443
|
-
openOnAdd: false,
|
|
5444
5468
|
values: repeaterValues,
|
|
5445
5469
|
setValues: setValue,
|
|
5470
|
+
showRemove: repeaterValues.length > 1,
|
|
5446
5471
|
label,
|
|
5447
5472
|
itemSettings: {
|
|
5448
|
-
|
|
5473
|
+
getId: ({ item }) => item.id,
|
|
5474
|
+
initialValues: { id: "", title: "Tab" },
|
|
5449
5475
|
Label: ItemLabel,
|
|
5450
5476
|
Content: ItemContent,
|
|
5451
5477
|
Icon: () => null
|
|
@@ -5460,7 +5486,7 @@ var ItemLabel = ({ value, index }) => {
|
|
|
5460
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(SettingsField, { bind: "default-active-tab", propDisplayName: (0, import_i18n63.__)("Tabs", "elementor") }, /* @__PURE__ */ React91.createElement(ItemDefaultTab, { index })));
|
|
5461
5487
|
};
|
|
5462
5488
|
var ItemDefaultTab = ({ index }) => {
|
|
5463
|
-
const { value: defaultItem } = (0, import_editor_controls53.useBoundProp)(
|
|
5489
|
+
const { value: defaultItem } = (0, import_editor_controls53.useBoundProp)(import_editor_props17.numberPropTypeUtil);
|
|
5464
5490
|
const isDefault = defaultItem === index;
|
|
5465
5491
|
if (!isDefault) {
|
|
5466
5492
|
return null;
|
|
@@ -5474,7 +5500,7 @@ var ItemContent = ({ value, index }) => {
|
|
|
5474
5500
|
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 })));
|
|
5475
5501
|
};
|
|
5476
5502
|
var DefaultTabControl = ({ tabIndex }) => {
|
|
5477
|
-
const { value, setValue } = (0, import_editor_controls53.useBoundProp)(
|
|
5503
|
+
const { value, setValue } = (0, import_editor_controls53.useBoundProp)(import_editor_props17.numberPropTypeUtil);
|
|
5478
5504
|
const isDefault = value === tabIndex;
|
|
5479
5505
|
return /* @__PURE__ */ React91.createElement(import_ui46.Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 2 }, /* @__PURE__ */ React91.createElement(import_editor_controls53.ControlFormLabel, null, (0, import_i18n63.__)("Set as default tab", "elementor")), /* @__PURE__ */ React91.createElement(ConditionalTooltip, { showTooltip: isDefault, placement: "right" }, /* @__PURE__ */ React91.createElement(
|
|
5480
5506
|
import_ui46.Switch,
|
|
@@ -5553,7 +5579,7 @@ var import_editor_controls60 = require("@elementor/editor-controls");
|
|
|
5553
5579
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
5554
5580
|
var React92 = __toESM(require("react"));
|
|
5555
5581
|
var import_editor_controls55 = require("@elementor/editor-controls");
|
|
5556
|
-
var
|
|
5582
|
+
var import_editor_props19 = require("@elementor/editor-props");
|
|
5557
5583
|
var import_icons26 = require("@elementor/icons");
|
|
5558
5584
|
|
|
5559
5585
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
@@ -5582,7 +5608,7 @@ var getAtomicDynamicTags = () => {
|
|
|
5582
5608
|
};
|
|
5583
5609
|
|
|
5584
5610
|
// src/dynamics/utils.ts
|
|
5585
|
-
var
|
|
5611
|
+
var import_editor_props18 = require("@elementor/editor-props");
|
|
5586
5612
|
var import_schema = require("@elementor/schema");
|
|
5587
5613
|
var DYNAMIC_PROP_TYPE_KEY = "dynamic";
|
|
5588
5614
|
var isDynamicPropType = (prop) => prop.key === DYNAMIC_PROP_TYPE_KEY;
|
|
@@ -5591,12 +5617,12 @@ var getDynamicPropType = (propType) => {
|
|
|
5591
5617
|
return dynamicPropType && isDynamicPropType(dynamicPropType) ? dynamicPropType : null;
|
|
5592
5618
|
};
|
|
5593
5619
|
var isDynamicPropValue = (prop) => {
|
|
5594
|
-
return (0,
|
|
5620
|
+
return (0, import_editor_props18.isTransformable)(prop) && prop.$$type === DYNAMIC_PROP_TYPE_KEY;
|
|
5595
5621
|
};
|
|
5596
5622
|
var supportsDynamic = (propType) => {
|
|
5597
5623
|
return !!getDynamicPropType(propType);
|
|
5598
5624
|
};
|
|
5599
|
-
var dynamicPropTypeUtil = (0,
|
|
5625
|
+
var dynamicPropTypeUtil = (0, import_editor_props18.createPropUtils)(
|
|
5600
5626
|
DYNAMIC_PROP_TYPE_KEY,
|
|
5601
5627
|
import_schema.z.strictObject({
|
|
5602
5628
|
name: import_schema.z.string(),
|
|
@@ -5648,7 +5674,7 @@ var useDynamicTag = (tagName) => {
|
|
|
5648
5674
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
5649
5675
|
var BackgroundControlDynamicTagIcon = () => /* @__PURE__ */ React92.createElement(import_icons26.DatabaseIcon, { fontSize: "tiny" });
|
|
5650
5676
|
var BackgroundControlDynamicTagLabel = ({ value }) => {
|
|
5651
|
-
const context = (0, import_editor_controls55.useBoundProp)(
|
|
5677
|
+
const context = (0, import_editor_controls55.useBoundProp)(import_editor_props19.backgroundImageOverlayPropTypeUtil);
|
|
5652
5678
|
return /* @__PURE__ */ React92.createElement(import_editor_controls55.PropProvider, { ...context, value: value.value }, /* @__PURE__ */ React92.createElement(import_editor_controls55.PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React92.createElement(Wrapper, { rawValue: value.value })));
|
|
5653
5679
|
};
|
|
5654
5680
|
var Wrapper = ({ rawValue }) => {
|
|
@@ -5684,7 +5710,7 @@ var import_editor_controls56 = require("@elementor/editor-controls");
|
|
|
5684
5710
|
|
|
5685
5711
|
// src/dynamics/components/dynamic-conditional-control.tsx
|
|
5686
5712
|
var React93 = __toESM(require("react"));
|
|
5687
|
-
var
|
|
5713
|
+
var import_editor_props20 = require("@elementor/editor-props");
|
|
5688
5714
|
var DynamicConditionalControl = ({
|
|
5689
5715
|
children,
|
|
5690
5716
|
propType,
|
|
@@ -5726,7 +5752,7 @@ var DynamicConditionalControl = ({
|
|
|
5726
5752
|
if (!propType?.dependencies?.terms.length) {
|
|
5727
5753
|
return /* @__PURE__ */ React93.createElement(React93.Fragment, null, children);
|
|
5728
5754
|
}
|
|
5729
|
-
const isHidden = !(0,
|
|
5755
|
+
const isHidden = !(0, import_editor_props20.isDependencyMet)(propType?.dependencies, effectiveSettings).isMet;
|
|
5730
5756
|
return isHidden ? null : /* @__PURE__ */ React93.createElement(React93.Fragment, null, children);
|
|
5731
5757
|
};
|
|
5732
5758
|
|
|
@@ -6039,7 +6065,7 @@ function ControlsItemsStack({ items: items3 }) {
|
|
|
6039
6065
|
|
|
6040
6066
|
// src/dynamics/dynamic-transformer.ts
|
|
6041
6067
|
var import_editor_canvas4 = require("@elementor/editor-canvas");
|
|
6042
|
-
var
|
|
6068
|
+
var import_editor_props21 = require("@elementor/editor-props");
|
|
6043
6069
|
|
|
6044
6070
|
// src/dynamics/errors.ts
|
|
6045
6071
|
var import_utils10 = require("@elementor/utils");
|
|
@@ -6057,7 +6083,7 @@ var dynamicTransformer = (0, import_editor_canvas4.createTransformer)((value) =>
|
|
|
6057
6083
|
});
|
|
6058
6084
|
function simpleTransform(props) {
|
|
6059
6085
|
const transformed = Object.entries(props).map(([settingKey, settingValue]) => {
|
|
6060
|
-
const value = (0,
|
|
6086
|
+
const value = (0, import_editor_props21.isTransformable)(settingValue) ? settingValue.value : settingValue;
|
|
6061
6087
|
return [settingKey, value];
|
|
6062
6088
|
});
|
|
6063
6089
|
return Object.fromEntries(transformed);
|