@elementor/editor-editing-panel 4.0.0-manual → 4.1.0-684
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 +37 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -21
- package/src/components/promotions/custom-css.tsx +5 -1
- package/src/controls-registry/settings-field.tsx +7 -14
- package/src/dynamics/components/dynamic-selection.tsx +21 -4
- package/src/utils/prop-dependency-utils.ts +12 -0
package/dist/index.js
CHANGED
|
@@ -2066,6 +2066,15 @@ var import_i18n7 = require("@wordpress/i18n");
|
|
|
2066
2066
|
// src/utils/prop-dependency-utils.ts
|
|
2067
2067
|
var import_editor_props5 = require("@elementor/editor-props");
|
|
2068
2068
|
var import_session4 = require("@elementor/session");
|
|
2069
|
+
function getElementSettingsWithDefaults(propsSchema, elementSettings) {
|
|
2070
|
+
const elementSettingsWithDefaults = { ...elementSettings };
|
|
2071
|
+
Object.keys(propsSchema).forEach((key) => {
|
|
2072
|
+
if (elementSettingsWithDefaults[key] === null && propsSchema[key].default !== null) {
|
|
2073
|
+
elementSettingsWithDefaults[key] = propsSchema[key].default;
|
|
2074
|
+
}
|
|
2075
|
+
});
|
|
2076
|
+
return elementSettingsWithDefaults;
|
|
2077
|
+
}
|
|
2069
2078
|
function extractOrderedDependencies(dependenciesPerTargetMapping) {
|
|
2070
2079
|
return Object.values(dependenciesPerTargetMapping).flat().filter((dependent, index, self) => self.indexOf(dependent) === index);
|
|
2071
2080
|
}
|
|
@@ -2211,19 +2220,8 @@ var createTopLevelObjectType = ({ schema }) => {
|
|
|
2211
2220
|
|
|
2212
2221
|
// src/controls-registry/settings-field.tsx
|
|
2213
2222
|
var HISTORY_DEBOUNCE_WAIT2 = 800;
|
|
2214
|
-
var getElementSettigsWithDefaults = (propsSchema, elementSettings) => {
|
|
2215
|
-
const elementSettingsWithDefaults = { ...elementSettings };
|
|
2216
|
-
Object.keys(propsSchema).forEach((key) => {
|
|
2217
|
-
if (!(key in elementSettingsWithDefaults)) {
|
|
2218
|
-
if (propsSchema[key].default !== null) {
|
|
2219
|
-
elementSettingsWithDefaults[key] = propsSchema[key].default;
|
|
2220
|
-
}
|
|
2221
|
-
}
|
|
2222
|
-
});
|
|
2223
|
-
return elementSettingsWithDefaults;
|
|
2224
|
-
};
|
|
2225
2223
|
var extractDependencyEffect = (bind, propsSchema, currentElementSettings) => {
|
|
2226
|
-
const elementSettingsForDepCheck =
|
|
2224
|
+
const elementSettingsForDepCheck = getElementSettingsWithDefaults(propsSchema, currentElementSettings);
|
|
2227
2225
|
const propType = propsSchema[bind];
|
|
2228
2226
|
const depCheck = (0, import_editor_props6.isDependencyMet)(propType?.dependencies, elementSettingsForDepCheck);
|
|
2229
2227
|
const isHidden = !depCheck.isMet && !(0, import_editor_props6.isDependency)(depCheck.failingDependencies[0]) && depCheck.failingDependencies[0]?.effect === "hide";
|
|
@@ -4808,6 +4806,7 @@ var React82 = __toESM(require("react"));
|
|
|
4808
4806
|
var import_react35 = require("react");
|
|
4809
4807
|
var import_editor_controls50 = require("@elementor/editor-controls");
|
|
4810
4808
|
var import_i18n56 = require("@wordpress/i18n");
|
|
4809
|
+
var TRACKING_DATA = { target_name: "custom_css", location_l2: "style" };
|
|
4811
4810
|
var CustomCssSection = () => {
|
|
4812
4811
|
const triggerRef = (0, import_react35.useRef)(null);
|
|
4813
4812
|
return /* @__PURE__ */ React82.createElement(
|
|
@@ -4817,7 +4816,7 @@ var CustomCssSection = () => {
|
|
|
4817
4816
|
name: "Custom CSS",
|
|
4818
4817
|
title: (0, import_i18n56.__)("Custom CSS", "elementor"),
|
|
4819
4818
|
action: {
|
|
4820
|
-
component: /* @__PURE__ */ React82.createElement(import_editor_controls50.PromotionTrigger, { ref: triggerRef, promotionKey: "customCss" }),
|
|
4819
|
+
component: /* @__PURE__ */ React82.createElement(import_editor_controls50.PromotionTrigger, { ref: triggerRef, promotionKey: "customCss", trackingData: TRACKING_DATA }),
|
|
4821
4820
|
onClick: () => triggerRef.current?.toggle()
|
|
4822
4821
|
}
|
|
4823
4822
|
}
|
|
@@ -5477,8 +5476,8 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
5477
5476
|
};
|
|
5478
5477
|
|
|
5479
5478
|
// src/dynamics/components/dynamic-selection.tsx
|
|
5480
|
-
var import_react39 = require("react");
|
|
5481
5479
|
var React87 = __toESM(require("react"));
|
|
5480
|
+
var import_react39 = require("react");
|
|
5482
5481
|
var import_editor_controls57 = require("@elementor/editor-controls");
|
|
5483
5482
|
var import_editor_ui8 = require("@elementor/editor-ui");
|
|
5484
5483
|
var import_icons24 = require("@elementor/icons");
|
|
@@ -5498,6 +5497,13 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
|
5498
5497
|
const isCurrentValueDynamic = !!dynamicValue;
|
|
5499
5498
|
const options12 = useFilteredOptions(searchValue);
|
|
5500
5499
|
const hasNoDynamicTags = !options12.length && !searchValue.trim();
|
|
5500
|
+
(0, import_react39.useEffect)(() => {
|
|
5501
|
+
if (hasNoDynamicTags) {
|
|
5502
|
+
(0, import_editor_controls57.trackViewPromotion)({ target_name: "dynamic_tags" });
|
|
5503
|
+
} else if (expired) {
|
|
5504
|
+
(0, import_editor_controls57.trackViewPromotion)({ target_name: "dynamic_tags" });
|
|
5505
|
+
}
|
|
5506
|
+
}, [hasNoDynamicTags, expired]);
|
|
5501
5507
|
const handleSearch = (value) => {
|
|
5502
5508
|
setSearchValue(value);
|
|
5503
5509
|
};
|
|
@@ -5585,7 +5591,14 @@ var NoDynamicTags = () => /* @__PURE__ */ React87.createElement(React87.Fragment
|
|
|
5585
5591
|
/* @__PURE__ */ React87.createElement(import_icons24.DatabaseIcon, { fontSize: "large" }),
|
|
5586
5592
|
/* @__PURE__ */ React87.createElement(import_ui38.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n59.__)("Streamline your workflow with dynamic tags", "elementor")),
|
|
5587
5593
|
/* @__PURE__ */ React87.createElement(import_ui38.Typography, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, (0, import_i18n59.__)("Upgrade now to display your content dynamically.", "elementor")),
|
|
5588
|
-
/* @__PURE__ */ React87.createElement(
|
|
5594
|
+
/* @__PURE__ */ React87.createElement(
|
|
5595
|
+
import_editor_ui8.CtaButton,
|
|
5596
|
+
{
|
|
5597
|
+
size: "small",
|
|
5598
|
+
href: PRO_DYNAMIC_TAGS_URL,
|
|
5599
|
+
onClick: () => (0, import_editor_controls57.trackUpgradePromotionClick)({ target_name: "dynamic_tags" })
|
|
5600
|
+
}
|
|
5601
|
+
)
|
|
5589
5602
|
));
|
|
5590
5603
|
var ExpiredDynamicTags = () => /* @__PURE__ */ React87.createElement(React87.Fragment, null, /* @__PURE__ */ React87.createElement(import_ui38.Divider, null), /* @__PURE__ */ React87.createElement(
|
|
5591
5604
|
import_ui38.Stack,
|
|
@@ -5601,7 +5614,15 @@ var ExpiredDynamicTags = () => /* @__PURE__ */ React87.createElement(React87.Fra
|
|
|
5601
5614
|
/* @__PURE__ */ React87.createElement(import_icons24.DatabaseIcon, { fontSize: "large" }),
|
|
5602
5615
|
/* @__PURE__ */ React87.createElement(import_ui38.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n59.__)("Unlock your Dynamic tags again", "elementor")),
|
|
5603
5616
|
/* @__PURE__ */ React87.createElement(import_ui38.Typography, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, (0, import_i18n59.__)("Dynamic tags need Elementor Pro. Renew now to keep them active.", "elementor")),
|
|
5604
|
-
/* @__PURE__ */ React87.createElement(
|
|
5617
|
+
/* @__PURE__ */ React87.createElement(
|
|
5618
|
+
import_editor_ui8.CtaButton,
|
|
5619
|
+
{
|
|
5620
|
+
size: "small",
|
|
5621
|
+
href: RENEW_DYNAMIC_TAGS_URL,
|
|
5622
|
+
onClick: () => (0, import_editor_controls57.trackUpgradePromotionClick)({ target_name: "dynamic_tags" }),
|
|
5623
|
+
children: (0, import_i18n59.__)("Renew Now", "elementor")
|
|
5624
|
+
}
|
|
5625
|
+
)
|
|
5605
5626
|
));
|
|
5606
5627
|
var useFilteredOptions = (searchValue) => {
|
|
5607
5628
|
const dynamicTags = usePropDynamicTags();
|