@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-editing-panel",
3
- "version": "4.0.0-manual",
3
+ "version": "4.1.0-684",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,28 +39,28 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "4.0.0-manual",
43
- "@elementor/editor-canvas": "4.0.0-manual",
44
- "@elementor/editor-controls": "4.0.0-manual",
45
- "@elementor/editor-documents": "4.0.0-manual",
46
- "@elementor/editor-elements": "4.0.0-manual",
47
- "@elementor/editor-interactions": "4.0.0-manual",
48
- "@elementor/editor-panels": "4.0.0-manual",
49
- "@elementor/editor-props": "4.0.0-manual",
50
- "@elementor/editor-responsive": "4.0.0-manual",
51
- "@elementor/editor-styles": "4.0.0-manual",
52
- "@elementor/editor-styles-repository": "4.0.0-manual",
53
- "@elementor/editor-ui": "4.0.0-manual",
54
- "@elementor/editor-v1-adapters": "4.0.0-manual",
42
+ "@elementor/editor": "4.1.0-684",
43
+ "@elementor/editor-canvas": "4.1.0-684",
44
+ "@elementor/editor-controls": "4.1.0-684",
45
+ "@elementor/editor-documents": "4.1.0-684",
46
+ "@elementor/editor-elements": "4.1.0-684",
47
+ "@elementor/editor-interactions": "4.1.0-684",
48
+ "@elementor/editor-panels": "4.1.0-684",
49
+ "@elementor/editor-props": "4.1.0-684",
50
+ "@elementor/editor-responsive": "4.1.0-684",
51
+ "@elementor/editor-styles": "4.1.0-684",
52
+ "@elementor/editor-styles-repository": "4.1.0-684",
53
+ "@elementor/editor-ui": "4.1.0-684",
54
+ "@elementor/editor-v1-adapters": "4.1.0-684",
55
55
  "@elementor/icons": "^1.68.0",
56
- "@elementor/editor-variables": "4.0.0-manual",
57
- "@elementor/locations": "4.0.0-manual",
58
- "@elementor/menus": "4.0.0-manual",
59
- "@elementor/schema": "4.0.0-manual",
60
- "@elementor/session": "4.0.0-manual",
56
+ "@elementor/editor-variables": "4.1.0-684",
57
+ "@elementor/locations": "4.1.0-684",
58
+ "@elementor/menus": "4.1.0-684",
59
+ "@elementor/schema": "4.1.0-684",
60
+ "@elementor/session": "4.1.0-684",
61
61
  "@elementor/ui": "1.36.17",
62
- "@elementor/utils": "4.0.0-manual",
63
- "@elementor/wp-media": "4.0.0-manual",
62
+ "@elementor/utils": "4.1.0-684",
63
+ "@elementor/wp-media": "4.1.0-684",
64
64
  "@wordpress/i18n": "^5.13.0"
65
65
  },
66
66
  "peerDependencies": {
@@ -5,6 +5,8 @@ import { __ } from '@wordpress/i18n';
5
5
 
6
6
  import { StyleTabSection } from '../style-tab-section';
7
7
 
8
+ const TRACKING_DATA = { target_name: 'custom_css', location_l2: 'style' } as const;
9
+
8
10
  export const CustomCssSection = () => {
9
11
  const triggerRef = useRef< PromotionTriggerRef >( null );
10
12
 
@@ -14,7 +16,9 @@ export const CustomCssSection = () => {
14
16
  name: 'Custom CSS',
15
17
  title: __( 'Custom CSS', 'elementor' ),
16
18
  action: {
17
- component: <PromotionTrigger ref={ triggerRef } promotionKey="customCss" />,
19
+ component: (
20
+ <PromotionTrigger ref={ triggerRef } promotionKey="customCss" trackingData={ TRACKING_DATA } />
21
+ ),
18
22
  onClick: () => triggerRef.current?.toggle(),
19
23
  },
20
24
  } }
@@ -16,7 +16,12 @@ import { undoable } from '@elementor/editor-v1-adapters';
16
16
  import { __ } from '@wordpress/i18n';
17
17
 
18
18
  import { useElement } from '../contexts/element-context';
19
- import { extractOrderedDependencies, getUpdatedValues, type Values } from '../utils/prop-dependency-utils';
19
+ import {
20
+ extractOrderedDependencies,
21
+ getElementSettingsWithDefaults,
22
+ getUpdatedValues,
23
+ type Values,
24
+ } from '../utils/prop-dependency-utils';
20
25
  import { createTopLevelObjectType } from './create-top-level-object-type';
21
26
 
22
27
  type SettingsFieldProps = {
@@ -27,20 +32,8 @@ type SettingsFieldProps = {
27
32
 
28
33
  const HISTORY_DEBOUNCE_WAIT = 800;
29
34
 
30
- const getElementSettigsWithDefaults = ( propsSchema: PropsSchema, elementSettings?: Props ) => {
31
- const elementSettingsWithDefaults = { ...elementSettings };
32
- Object.keys( propsSchema ).forEach( ( key ) => {
33
- if ( ! ( key in elementSettingsWithDefaults ) ) {
34
- if ( propsSchema[ key ].default !== null ) {
35
- elementSettingsWithDefaults[ key ] = propsSchema[ key ].default as Values[ keyof Values ];
36
- }
37
- }
38
- } );
39
- return elementSettingsWithDefaults;
40
- };
41
-
42
35
  const extractDependencyEffect = ( bind: string, propsSchema: PropsSchema, currentElementSettings: Props ) => {
43
- const elementSettingsForDepCheck = getElementSettigsWithDefaults( propsSchema, currentElementSettings );
36
+ const elementSettingsForDepCheck = getElementSettingsWithDefaults( propsSchema, currentElementSettings );
44
37
  const propType = propsSchema[ bind ];
45
38
  const depCheck = isDependencyMet( propType?.dependencies, elementSettingsForDepCheck );
46
39
  const isHidden =
@@ -1,6 +1,6 @@
1
- import { Fragment, useState } from 'react';
2
1
  import * as React from 'react';
3
- import { useBoundProp } from '@elementor/editor-controls';
2
+ import { Fragment, useEffect, useState } from 'react';
3
+ import { trackUpgradePromotionClick, trackViewPromotion, useBoundProp } from '@elementor/editor-controls';
4
4
  import { CtaButton, PopoverHeader, PopoverMenuList, SearchField, SectionPopoverBody } from '@elementor/editor-ui';
5
5
  import { DatabaseIcon } from '@elementor/icons';
6
6
  import { Divider, Link, Stack, Typography, useTheme } from '@elementor/ui';
@@ -50,6 +50,14 @@ export const DynamicSelection = ( { close: closePopover, expired = false }: Dyna
50
50
 
51
51
  const hasNoDynamicTags = ! options.length && ! searchValue.trim();
52
52
 
53
+ useEffect( () => {
54
+ if ( hasNoDynamicTags ) {
55
+ trackViewPromotion( { target_name: 'dynamic_tags' } );
56
+ } else if ( expired ) {
57
+ trackViewPromotion( { target_name: 'dynamic_tags' } );
58
+ }
59
+ }, [ hasNoDynamicTags, expired ] );
60
+
53
61
  const handleSearch = ( value: string ) => {
54
62
  setSearchValue( value );
55
63
  };
@@ -170,7 +178,11 @@ const NoDynamicTags = () => (
170
178
  <Typography align="center" variant="caption" width={ PROMO_TEXT_WIDTH }>
171
179
  { __( 'Upgrade now to display your content dynamically.', 'elementor' ) }
172
180
  </Typography>
173
- <CtaButton size="small" href={ PRO_DYNAMIC_TAGS_URL } />
181
+ <CtaButton
182
+ size="small"
183
+ href={ PRO_DYNAMIC_TAGS_URL }
184
+ onClick={ () => trackUpgradePromotionClick( { target_name: 'dynamic_tags' } ) }
185
+ />
174
186
  </Stack>
175
187
  </>
176
188
  );
@@ -194,7 +206,12 @@ const ExpiredDynamicTags = () => (
194
206
  <Typography align="center" variant="caption" width={ PROMO_TEXT_WIDTH }>
195
207
  { __( 'Dynamic tags need Elementor Pro. Renew now to keep them active.', 'elementor' ) }
196
208
  </Typography>
197
- <CtaButton size="small" href={ RENEW_DYNAMIC_TAGS_URL } children={ __( 'Renew Now', 'elementor' ) } />
209
+ <CtaButton
210
+ size="small"
211
+ href={ RENEW_DYNAMIC_TAGS_URL }
212
+ onClick={ () => trackUpgradePromotionClick( { target_name: 'dynamic_tags' } ) }
213
+ children={ __( 'Renew Now', 'elementor' ) }
214
+ />
198
215
  </Stack>
199
216
  </>
200
217
  );
@@ -3,6 +3,7 @@ import {
3
3
  type DependencyTerm,
4
4
  extractValue,
5
5
  isDependencyMet,
6
+ type Props,
6
7
  type PropsSchema,
7
8
  type PropType,
8
9
  type TransformablePropValue,
@@ -13,6 +14,17 @@ type Value = TransformablePropValue< string > | null;
13
14
 
14
15
  export type Values = Record< string, Value >;
15
16
 
17
+ export function getElementSettingsWithDefaults( propsSchema: PropsSchema, elementSettings?: Props ): Values {
18
+ const elementSettingsWithDefaults = { ...elementSettings };
19
+ Object.keys( propsSchema ).forEach( ( key ) => {
20
+ if ( elementSettingsWithDefaults[ key ] === null && propsSchema[ key ].default !== null ) {
21
+ elementSettingsWithDefaults[ key ] = propsSchema[ key ].default as Values[ keyof Values ];
22
+ }
23
+ } );
24
+
25
+ return elementSettingsWithDefaults as Values;
26
+ }
27
+
16
28
  export function extractOrderedDependencies( dependenciesPerTargetMapping: Record< string, string[] > ): string[] {
17
29
  return Object.values( dependenciesPerTargetMapping )
18
30
  .flat()