@elementor/editor-editing-panel 4.0.0-649 → 4.0.0-659

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-649",
3
+ "version": "4.0.0-659",
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-649",
43
- "@elementor/editor-canvas": "4.0.0-649",
44
- "@elementor/editor-controls": "4.0.0-649",
45
- "@elementor/editor-documents": "4.0.0-649",
46
- "@elementor/editor-elements": "4.0.0-649",
47
- "@elementor/editor-interactions": "4.0.0-649",
48
- "@elementor/editor-panels": "4.0.0-649",
49
- "@elementor/editor-props": "4.0.0-649",
50
- "@elementor/editor-responsive": "4.0.0-649",
51
- "@elementor/editor-styles": "4.0.0-649",
52
- "@elementor/editor-styles-repository": "4.0.0-649",
53
- "@elementor/editor-ui": "4.0.0-649",
54
- "@elementor/editor-v1-adapters": "4.0.0-649",
42
+ "@elementor/editor": "4.0.0-659",
43
+ "@elementor/editor-canvas": "4.0.0-659",
44
+ "@elementor/editor-controls": "4.0.0-659",
45
+ "@elementor/editor-documents": "4.0.0-659",
46
+ "@elementor/editor-elements": "4.0.0-659",
47
+ "@elementor/editor-interactions": "4.0.0-659",
48
+ "@elementor/editor-panels": "4.0.0-659",
49
+ "@elementor/editor-props": "4.0.0-659",
50
+ "@elementor/editor-responsive": "4.0.0-659",
51
+ "@elementor/editor-styles": "4.0.0-659",
52
+ "@elementor/editor-styles-repository": "4.0.0-659",
53
+ "@elementor/editor-ui": "4.0.0-659",
54
+ "@elementor/editor-v1-adapters": "4.0.0-659",
55
55
  "@elementor/icons": "^1.68.0",
56
- "@elementor/editor-variables": "4.0.0-649",
57
- "@elementor/locations": "4.0.0-649",
58
- "@elementor/menus": "4.0.0-649",
59
- "@elementor/schema": "4.0.0-649",
60
- "@elementor/session": "4.0.0-649",
56
+ "@elementor/editor-variables": "4.0.0-659",
57
+ "@elementor/locations": "4.0.0-659",
58
+ "@elementor/menus": "4.0.0-659",
59
+ "@elementor/schema": "4.0.0-659",
60
+ "@elementor/session": "4.0.0-659",
61
61
  "@elementor/ui": "1.36.17",
62
- "@elementor/utils": "4.0.0-649",
63
- "@elementor/wp-media": "4.0.0-649",
62
+ "@elementor/utils": "4.0.0-659",
63
+ "@elementor/wp-media": "4.0.0-659",
64
64
  "@wordpress/i18n": "^5.13.0"
65
65
  },
66
66
  "peerDependencies": {
@@ -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,18 +32,6 @@ type SettingsFieldProps = {
27
32
 
28
33
  const HISTORY_DEBOUNCE_WAIT = 800;
29
34
 
30
- const getElementSettingsWithDefaults = ( propsSchema: PropsSchema, elementSettings?: Props ) => {
31
- const elementSettingsWithDefaults = { ...elementSettings };
32
- Object.keys( propsSchema ).forEach( ( key ) => {
33
- if ( ! ( key in elementSettingsWithDefaults ) || elementSettingsWithDefaults[ key ] === null ) {
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
36
  const elementSettingsForDepCheck = getElementSettingsWithDefaults( propsSchema, currentElementSettings );
44
37
  const propType = propsSchema[ bind ];
@@ -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()