@elementor/editor-variables 4.2.0-877 → 4.2.0-879

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-variables",
3
- "version": "4.2.0-877",
3
+ "version": "4.2.0-879",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,22 +39,22 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "4.2.0-877",
43
- "@elementor/editor-canvas": "4.2.0-877",
44
- "@elementor/editor-controls": "4.2.0-877",
45
- "@elementor/editor-current-user": "4.2.0-877",
46
- "@elementor/editor-mcp": "4.2.0-877",
47
- "@elementor/editor-panels": "4.2.0-877",
48
- "@elementor/editor-props": "4.2.0-877",
49
- "@elementor/editor-ui": "4.2.0-877",
50
- "@elementor/editor-v1-adapters": "4.2.0-877",
51
- "@elementor/menus": "4.2.0-877",
52
- "@elementor/http-client": "4.2.0-877",
42
+ "@elementor/editor": "4.2.0-879",
43
+ "@elementor/editor-canvas": "4.2.0-879",
44
+ "@elementor/editor-controls": "4.2.0-879",
45
+ "@elementor/editor-current-user": "4.2.0-879",
46
+ "@elementor/editor-mcp": "4.2.0-879",
47
+ "@elementor/editor-panels": "4.2.0-879",
48
+ "@elementor/editor-props": "4.2.0-879",
49
+ "@elementor/editor-ui": "4.2.0-879",
50
+ "@elementor/editor-v1-adapters": "4.2.0-879",
51
+ "@elementor/menus": "4.2.0-879",
52
+ "@elementor/http-client": "4.2.0-879",
53
53
  "@elementor/icons": "~1.75.1",
54
- "@elementor/events": "4.2.0-877",
55
- "@elementor/schema": "4.2.0-877",
54
+ "@elementor/events": "4.2.0-879",
55
+ "@elementor/schema": "4.2.0-879",
56
56
  "@elementor/ui": "1.37.5",
57
- "@elementor/utils": "4.2.0-877",
57
+ "@elementor/utils": "4.2.0-879",
58
58
  "@wordpress/i18n": "^5.13.0"
59
59
  },
60
60
  "peerDependencies": {
@@ -1,17 +1,24 @@
1
- import { createTransformer } from '@elementor/editor-canvas';
1
+ import { createTransformer, formatGridTrackRepeat, isGridTrackProperty } from '@elementor/editor-canvas';
2
2
 
3
3
  import { service } from '../service';
4
4
  import { type TVariable } from '../storage';
5
5
  import { resolveCssVariable } from './utils/resolve-css-variable';
6
6
 
7
- export const variableTransformer = createTransformer( ( idOrLabel: string ) => {
7
+ export const variableTransformer = createTransformer( ( idOrLabel: string, { key }: { key: string } ) => {
8
8
  const variables = service.variables();
9
9
 
10
10
  const targetVariable: TVariable | null = variables[ idOrLabel ] || service.findVariableByLabel( idOrLabel );
11
+
11
12
  if ( ! targetVariable ) {
12
13
  return null;
13
14
  }
14
- const id = service.findIdByLabel( targetVariable.label );
15
15
 
16
+ if ( isGridTrackProperty( key ) ) {
17
+ const count = parseInt( ( targetVariable.value ?? '' ).trim(), 10 );
18
+
19
+ return formatGridTrackRepeat( count );
20
+ }
21
+
22
+ const id = service.findIdByLabel( targetVariable.label );
16
23
  return resolveCssVariable( id, targetVariable );
17
24
  } );