@elementor/editor-variables 3.33.0-107 → 3.33.0-108

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": "3.33.0-107",
3
+ "version": "3.33.0-108",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,18 +39,18 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "3.33.0-107",
43
- "@elementor/editor-canvas": "3.33.0-107",
44
- "@elementor/editor-controls": "3.33.0-107",
45
- "@elementor/editor-current-user": "3.33.0-107",
46
- "@elementor/editor-editing-panel": "3.33.0-107",
47
- "@elementor/editor-panels": "3.33.0-107",
48
- "@elementor/editor-props": "3.33.0-107",
49
- "@elementor/editor-ui": "3.33.0-107",
50
- "@elementor/editor-v1-adapters": "3.33.0-107",
51
- "@elementor/http-client": "3.33.0-107",
42
+ "@elementor/editor": "3.33.0-108",
43
+ "@elementor/editor-canvas": "3.33.0-108",
44
+ "@elementor/editor-controls": "3.33.0-108",
45
+ "@elementor/editor-current-user": "3.33.0-108",
46
+ "@elementor/editor-editing-panel": "3.33.0-108",
47
+ "@elementor/editor-panels": "3.33.0-108",
48
+ "@elementor/editor-props": "3.33.0-108",
49
+ "@elementor/editor-ui": "3.33.0-108",
50
+ "@elementor/editor-v1-adapters": "3.33.0-108",
51
+ "@elementor/http-client": "3.33.0-108",
52
52
  "@elementor/icons": "1.46.0",
53
- "@elementor/schema": "3.33.0-107",
53
+ "@elementor/schema": "3.33.0-108",
54
54
  "@elementor/ui": "1.36.12",
55
55
  "@wordpress/i18n": "^5.13.0"
56
56
  },
@@ -0,0 +1,44 @@
1
+ import * as React from 'react';
2
+ import { AlertTriangleFilledIcon } from '@elementor/icons';
3
+ import { Box, Chip, type ChipProps, type Theme, Tooltip, Typography } from '@elementor/ui';
4
+
5
+ interface WarningVariableTagProps extends ChipProps {
6
+ label: string;
7
+ suffix?: string;
8
+ }
9
+
10
+ export const WarningVariableTag = React.forwardRef< HTMLDivElement, WarningVariableTagProps >(
11
+ ( { label, suffix, onClick, icon, ...props }, ref ) => {
12
+ const displayText = suffix ? `${ label } (${ suffix })` : label;
13
+
14
+ return (
15
+ <Chip
16
+ ref={ ref }
17
+ size="tiny"
18
+ color="warning"
19
+ shape="rounded"
20
+ variant="standard"
21
+ onClick={ onClick }
22
+ icon={ <AlertTriangleFilledIcon /> }
23
+ label={
24
+ <Tooltip title={ displayText } placement="top">
25
+ <Box sx={ { display: 'inline-grid', minWidth: 0 } }>
26
+ <Typography variant="caption" noWrap sx={ { lineHeight: 1.34 } }>
27
+ { displayText }
28
+ </Typography>
29
+ </Box>
30
+ </Tooltip>
31
+ }
32
+ sx={ {
33
+ height: ( theme: Theme ) => theme.spacing( 3.5 ),
34
+ borderRadius: ( theme: Theme ) => theme.spacing( 1 ),
35
+ justifyContent: 'flex-start',
36
+ width: '100%',
37
+ } }
38
+ { ...props }
39
+ />
40
+ );
41
+ }
42
+ );
43
+
44
+ WarningVariableTag.displayName = 'WarningVariableTag';
@@ -3,6 +3,7 @@ import { useId, useRef, useState } from 'react';
3
3
  import { useBoundProp } from '@elementor/editor-controls';
4
4
  import { type PropTypeKey } from '@elementor/editor-props';
5
5
  import { Backdrop, bindPopover, Box, Infotip, Popover, usePopupState } from '@elementor/ui';
6
+ import { __ } from '@wordpress/i18n';
6
7
 
7
8
  import { VariableTypeProvider } from '../../../context/variable-type-context';
8
9
  import { usePermissions } from '../../../hooks/use-permissions';
@@ -12,7 +13,7 @@ import { createUnlinkHandler } from '../../../utils/unlink-variable';
12
13
  import { getVariableType } from '../../../variables-registry/variable-type-registry';
13
14
  import { VariableRestore } from '../../variable-restore';
14
15
  import { DeletedVariableAlert } from '../deleted-variable-alert';
15
- import { DeletedTag } from '../tags/deleted-tag';
16
+ import { WarningVariableTag } from '../tags/warning-variable-tag';
16
17
 
17
18
  type Props = {
18
19
  variable: Variable;
@@ -101,7 +102,11 @@ export const DeletedVariable = ( { variable, propTypeKey }: Props ) => {
101
102
  },
102
103
  } }
103
104
  >
104
- <DeletedTag label={ variable.label } onClick={ toggleInfotip } />
105
+ <WarningVariableTag
106
+ label={ variable.label }
107
+ onClick={ toggleInfotip }
108
+ suffix={ __( 'deleted', 'elementor' ) }
109
+ />
105
110
  </Infotip>
106
111
 
107
112
  <Popover
@@ -2,11 +2,12 @@ import * as React from 'react';
2
2
  import { useId, useRef, useState } from 'react';
3
3
  import { useBoundProp } from '@elementor/editor-controls';
4
4
  import { Backdrop, bindPopover, Box, Infotip, Popover, usePopupState } from '@elementor/ui';
5
+ import { __ } from '@wordpress/i18n';
5
6
 
6
7
  import { type Variable } from '../../../types';
7
8
  import { VariableSelectionPopover } from '../../variable-selection-popover';
8
9
  import { MismatchVariableAlert } from '../mismatch-variable-alert';
9
- import { MismatchTag } from '../tags/mismatch-tag';
10
+ import { WarningVariableTag } from '../tags/warning-variable-tag';
10
11
 
11
12
  type Props = {
12
13
  variable: Variable;
@@ -67,7 +68,11 @@ export const MismatchVariable = ( { variable }: Props ) => {
67
68
  },
68
69
  } }
69
70
  >
70
- <MismatchTag label={ variable.label } onClick={ toggleInfotip } />
71
+ <WarningVariableTag
72
+ label={ variable.label }
73
+ onClick={ toggleInfotip }
74
+ suffix={ __( 'changed', 'elementor' ) }
75
+ />
71
76
  </Infotip>
72
77
 
73
78
  <Popover
@@ -5,7 +5,7 @@ import { Backdrop, Infotip } from '@elementor/ui';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
7
  import { MissingVariableAlert } from '../missing-variable-alert';
8
- import { MissingTag } from '../tags/missing-tag';
8
+ import { WarningVariableTag } from '../tags/warning-variable-tag';
9
9
 
10
10
  export const MissingVariable = () => {
11
11
  const { setValue } = useBoundProp();
@@ -37,7 +37,7 @@ export const MissingVariable = () => {
37
37
  },
38
38
  } }
39
39
  >
40
- <MissingTag label={ __( 'Missing variable', 'elementor' ) } onClick={ toggleInfotip } />
40
+ <WarningVariableTag label={ __( 'Missing variable', 'elementor' ) } onClick={ toggleInfotip } />
41
41
  </Infotip>
42
42
  </>
43
43
  );
@@ -1,37 +0,0 @@
1
- import * as React from 'react';
2
- import { AlertTriangleFilledIcon } from '@elementor/icons';
3
- import { Box, Chip, type ChipProps, type Theme, Tooltip, Typography } from '@elementor/ui';
4
- import { __ } from '@wordpress/i18n';
5
-
6
- export const DeletedTag = React.forwardRef< HTMLDivElement, ChipProps >( ( { label, onClick, ...props }, ref ) => {
7
- return (
8
- <Chip
9
- ref={ ref }
10
- size="tiny"
11
- color="warning"
12
- shape="rounded"
13
- variant="standard"
14
- onClick={ onClick }
15
- icon={ <AlertTriangleFilledIcon /> }
16
- label={
17
- <Tooltip title={ label } placement="top">
18
- <Box sx={ { display: 'flex', gap: 0.5, alignItems: 'center' } }>
19
- <Typography variant="caption" noWrap>
20
- { label }
21
- </Typography>
22
- <Typography variant="caption" noWrap sx={ { textOverflow: 'initial', overflow: 'visible' } }>
23
- ({ __( 'deleted', 'elementor' ) })
24
- </Typography>
25
- </Box>
26
- </Tooltip>
27
- }
28
- sx={ {
29
- height: ( theme: Theme ) => theme.spacing( 3.5 ),
30
- borderRadius: ( theme: Theme ) => theme.spacing( 1 ),
31
- justifyContent: 'flex-start',
32
- width: '100%',
33
- } }
34
- { ...props }
35
- />
36
- );
37
- } );
@@ -1,37 +0,0 @@
1
- import * as React from 'react';
2
- import { AlertTriangleFilledIcon } from '@elementor/icons';
3
- import { Box, Chip, type ChipProps, type Theme, Tooltip, Typography } from '@elementor/ui';
4
- import { __ } from '@wordpress/i18n';
5
-
6
- export const MismatchTag = React.forwardRef< HTMLDivElement, ChipProps >( ( { label, onClick, ...props }, ref ) => {
7
- return (
8
- <Chip
9
- ref={ ref }
10
- size="tiny"
11
- color="warning"
12
- shape="rounded"
13
- variant="standard"
14
- onClick={ onClick }
15
- icon={ <AlertTriangleFilledIcon /> }
16
- label={
17
- <Tooltip title={ label } placement="top">
18
- <Box sx={ { display: 'flex', gap: 0.5, alignItems: 'center' } }>
19
- <Typography variant="caption" noWrap>
20
- { label }
21
- </Typography>
22
- <Typography variant="caption" noWrap sx={ { textOverflow: 'initial', overflow: 'visible' } }>
23
- ({ __( 'changed', 'elementor' ) })
24
- </Typography>
25
- </Box>
26
- </Tooltip>
27
- }
28
- sx={ {
29
- height: ( theme: Theme ) => theme.spacing( 3.5 ),
30
- borderRadius: ( theme: Theme ) => theme.spacing( 1 ),
31
- justifyContent: 'flex-start',
32
- width: '100%',
33
- } }
34
- { ...props }
35
- />
36
- );
37
- } );
@@ -1,25 +0,0 @@
1
- import * as React from 'react';
2
- import { AlertTriangleFilledIcon } from '@elementor/icons';
3
- import { Chip, type ChipProps, type Theme } from '@elementor/ui';
4
-
5
- export const MissingTag = React.forwardRef< HTMLDivElement, ChipProps >( ( { label, onClick, ...props }, ref ) => {
6
- return (
7
- <Chip
8
- ref={ ref }
9
- size="tiny"
10
- color="warning"
11
- shape="rounded"
12
- variant="standard"
13
- onClick={ onClick }
14
- icon={ <AlertTriangleFilledIcon /> }
15
- label={ label }
16
- sx={ {
17
- height: ( theme: Theme ) => theme.spacing( 3.5 ),
18
- borderRadius: ( theme: Theme ) => theme.spacing( 1 ),
19
- justifyContent: 'flex-start',
20
- width: '100%',
21
- } }
22
- { ...props }
23
- />
24
- );
25
- } );