@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.mjs CHANGED
@@ -2083,6 +2083,15 @@ import {
2083
2083
  isDependencyMet
2084
2084
  } from "@elementor/editor-props";
2085
2085
  import { getSessionStorageItem as getSessionStorageItem2, removeSessionStorageItem, setSessionStorageItem as setSessionStorageItem2 } from "@elementor/session";
2086
+ function getElementSettingsWithDefaults(propsSchema, elementSettings) {
2087
+ const elementSettingsWithDefaults = { ...elementSettings };
2088
+ Object.keys(propsSchema).forEach((key) => {
2089
+ if (elementSettingsWithDefaults[key] === null && propsSchema[key].default !== null) {
2090
+ elementSettingsWithDefaults[key] = propsSchema[key].default;
2091
+ }
2092
+ });
2093
+ return elementSettingsWithDefaults;
2094
+ }
2086
2095
  function extractOrderedDependencies(dependenciesPerTargetMapping) {
2087
2096
  return Object.values(dependenciesPerTargetMapping).flat().filter((dependent, index, self) => self.indexOf(dependent) === index);
2088
2097
  }
@@ -2228,19 +2237,8 @@ var createTopLevelObjectType = ({ schema }) => {
2228
2237
 
2229
2238
  // src/controls-registry/settings-field.tsx
2230
2239
  var HISTORY_DEBOUNCE_WAIT2 = 800;
2231
- var getElementSettigsWithDefaults = (propsSchema, elementSettings) => {
2232
- const elementSettingsWithDefaults = { ...elementSettings };
2233
- Object.keys(propsSchema).forEach((key) => {
2234
- if (!(key in elementSettingsWithDefaults)) {
2235
- if (propsSchema[key].default !== null) {
2236
- elementSettingsWithDefaults[key] = propsSchema[key].default;
2237
- }
2238
- }
2239
- });
2240
- return elementSettingsWithDefaults;
2241
- };
2242
2240
  var extractDependencyEffect = (bind, propsSchema, currentElementSettings) => {
2243
- const elementSettingsForDepCheck = getElementSettigsWithDefaults(propsSchema, currentElementSettings);
2241
+ const elementSettingsForDepCheck = getElementSettingsWithDefaults(propsSchema, currentElementSettings);
2244
2242
  const propType = propsSchema[bind];
2245
2243
  const depCheck = isDependencyMet2(propType?.dependencies, elementSettingsForDepCheck);
2246
2244
  const isHidden = !depCheck.isMet && !isDependency(depCheck.failingDependencies[0]) && depCheck.failingDependencies[0]?.effect === "hide";
@@ -4874,6 +4872,7 @@ import * as React82 from "react";
4874
4872
  import { useRef as useRef15 } from "react";
4875
4873
  import { PromotionTrigger } from "@elementor/editor-controls";
4876
4874
  import { __ as __56 } from "@wordpress/i18n";
4875
+ var TRACKING_DATA = { target_name: "custom_css", location_l2: "style" };
4877
4876
  var CustomCssSection = () => {
4878
4877
  const triggerRef = useRef15(null);
4879
4878
  return /* @__PURE__ */ React82.createElement(
@@ -4883,7 +4882,7 @@ var CustomCssSection = () => {
4883
4882
  name: "Custom CSS",
4884
4883
  title: __56("Custom CSS", "elementor"),
4885
4884
  action: {
4886
- component: /* @__PURE__ */ React82.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "customCss" }),
4885
+ component: /* @__PURE__ */ React82.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "customCss", trackingData: TRACKING_DATA }),
4887
4886
  onClick: () => triggerRef.current?.toggle()
4888
4887
  }
4889
4888
  }
@@ -5586,9 +5585,9 @@ var DynamicControl = ({ bind, children }) => {
5586
5585
  };
5587
5586
 
5588
5587
  // src/dynamics/components/dynamic-selection.tsx
5589
- import { Fragment as Fragment13, useState as useState10 } from "react";
5590
5588
  import * as React87 from "react";
5591
- import { useBoundProp as useBoundProp9 } from "@elementor/editor-controls";
5589
+ import { Fragment as Fragment14, useEffect as useEffect7, useState as useState10 } from "react";
5590
+ import { trackUpgradePromotionClick, trackViewPromotion, useBoundProp as useBoundProp9 } from "@elementor/editor-controls";
5592
5591
  import { CtaButton, PopoverHeader, PopoverMenuList, SearchField, SectionPopoverBody } from "@elementor/editor-ui";
5593
5592
  import { DatabaseIcon as DatabaseIcon2 } from "@elementor/icons";
5594
5593
  import { Divider as Divider7, Link as Link2, Stack as Stack15, Typography as Typography5, useTheme as useTheme3 } from "@elementor/ui";
@@ -5607,6 +5606,13 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
5607
5606
  const isCurrentValueDynamic = !!dynamicValue;
5608
5607
  const options12 = useFilteredOptions(searchValue);
5609
5608
  const hasNoDynamicTags = !options12.length && !searchValue.trim();
5609
+ useEffect7(() => {
5610
+ if (hasNoDynamicTags) {
5611
+ trackViewPromotion({ target_name: "dynamic_tags" });
5612
+ } else if (expired) {
5613
+ trackViewPromotion({ target_name: "dynamic_tags" });
5614
+ }
5615
+ }, [hasNoDynamicTags, expired]);
5610
5616
  const handleSearch = (value) => {
5611
5617
  setSearchValue(value);
5612
5618
  };
@@ -5637,7 +5643,7 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
5637
5643
  if (expired) {
5638
5644
  return /* @__PURE__ */ React87.createElement(ExpiredDynamicTags, null);
5639
5645
  }
5640
- return /* @__PURE__ */ React87.createElement(Fragment13, null, /* @__PURE__ */ React87.createElement(
5646
+ return /* @__PURE__ */ React87.createElement(Fragment14, null, /* @__PURE__ */ React87.createElement(
5641
5647
  SearchField,
5642
5648
  {
5643
5649
  value: searchValue,
@@ -5694,7 +5700,14 @@ var NoDynamicTags = () => /* @__PURE__ */ React87.createElement(React87.Fragment
5694
5700
  /* @__PURE__ */ React87.createElement(DatabaseIcon2, { fontSize: "large" }),
5695
5701
  /* @__PURE__ */ React87.createElement(Typography5, { align: "center", variant: "subtitle2" }, __59("Streamline your workflow with dynamic tags", "elementor")),
5696
5702
  /* @__PURE__ */ React87.createElement(Typography5, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, __59("Upgrade now to display your content dynamically.", "elementor")),
5697
- /* @__PURE__ */ React87.createElement(CtaButton, { size: "small", href: PRO_DYNAMIC_TAGS_URL })
5703
+ /* @__PURE__ */ React87.createElement(
5704
+ CtaButton,
5705
+ {
5706
+ size: "small",
5707
+ href: PRO_DYNAMIC_TAGS_URL,
5708
+ onClick: () => trackUpgradePromotionClick({ target_name: "dynamic_tags" })
5709
+ }
5710
+ )
5698
5711
  ));
5699
5712
  var ExpiredDynamicTags = () => /* @__PURE__ */ React87.createElement(React87.Fragment, null, /* @__PURE__ */ React87.createElement(Divider7, null), /* @__PURE__ */ React87.createElement(
5700
5713
  Stack15,
@@ -5710,7 +5723,15 @@ var ExpiredDynamicTags = () => /* @__PURE__ */ React87.createElement(React87.Fra
5710
5723
  /* @__PURE__ */ React87.createElement(DatabaseIcon2, { fontSize: "large" }),
5711
5724
  /* @__PURE__ */ React87.createElement(Typography5, { align: "center", variant: "subtitle2" }, __59("Unlock your Dynamic tags again", "elementor")),
5712
5725
  /* @__PURE__ */ React87.createElement(Typography5, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, __59("Dynamic tags need Elementor Pro. Renew now to keep them active.", "elementor")),
5713
- /* @__PURE__ */ React87.createElement(CtaButton, { size: "small", href: RENEW_DYNAMIC_TAGS_URL, children: __59("Renew Now", "elementor") })
5726
+ /* @__PURE__ */ React87.createElement(
5727
+ CtaButton,
5728
+ {
5729
+ size: "small",
5730
+ href: RENEW_DYNAMIC_TAGS_URL,
5731
+ onClick: () => trackUpgradePromotionClick({ target_name: "dynamic_tags" }),
5732
+ children: __59("Renew Now", "elementor")
5733
+ }
5734
+ )
5714
5735
  ));
5715
5736
  var useFilteredOptions = (searchValue) => {
5716
5737
  const dynamicTags = usePropDynamicTags();
@@ -6108,7 +6129,7 @@ import {
6108
6129
  import { __ as __65 } from "@wordpress/i18n";
6109
6130
 
6110
6131
  // src/styles-inheritance/hooks/use-normalized-inheritance-chain-items.tsx
6111
- import { isValidElement, useEffect as useEffect7, useState as useState11 } from "react";
6132
+ import { isValidElement, useEffect as useEffect8, useState as useState11 } from "react";
6112
6133
  import { UnknownStyleStateError } from "@elementor/editor-canvas";
6113
6134
  import {
6114
6135
  isClassState as isClassState2,
@@ -6119,7 +6140,7 @@ import { __ as __63 } from "@wordpress/i18n";
6119
6140
  var MAXIMUM_ITEMS = 2;
6120
6141
  var useNormalizedInheritanceChainItems = (inheritanceChain, bind, resolve) => {
6121
6142
  const [items3, setItems] = useState11([]);
6122
- useEffect7(() => {
6143
+ useEffect8(() => {
6123
6144
  (async () => {
6124
6145
  const normalizedItems = await Promise.all(
6125
6146
  inheritanceChain.filter(({ style }) => style).map((item, index) => normalizeInheritanceItem(item, index, bind, resolve))