@elementor/editor-variables 3.33.0-98 → 3.35.0-324

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.
Files changed (60) hide show
  1. package/dist/index.d.mts +17 -4
  2. package/dist/index.d.ts +17 -4
  3. package/dist/index.js +1903 -809
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +1850 -747
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +16 -14
  8. package/src/api.ts +24 -0
  9. package/src/batch-operations.ts +86 -0
  10. package/src/components/fields/color-field.tsx +1 -0
  11. package/src/components/fields/font-field.tsx +2 -1
  12. package/src/components/fields/label-field.tsx +42 -6
  13. package/src/components/ui/deleted-variable-alert.tsx +14 -10
  14. package/src/components/ui/{no-variables.tsx → empty-state.tsx} +8 -13
  15. package/src/components/ui/menu-item-content.tsx +14 -11
  16. package/src/components/ui/mismatch-variable-alert.tsx +5 -9
  17. package/src/components/ui/missing-variable-alert.tsx +8 -9
  18. package/src/components/ui/no-search-results.tsx +1 -2
  19. package/src/components/ui/tags/assigned-tag.tsx +6 -3
  20. package/src/components/ui/tags/warning-variable-tag.tsx +44 -0
  21. package/src/components/ui/variable/deleted-variable.tsx +13 -6
  22. package/src/components/ui/variable/mismatch-variable.tsx +11 -4
  23. package/src/components/ui/variable/missing-variable.tsx +2 -2
  24. package/src/components/variable-creation.tsx +13 -4
  25. package/src/components/variable-edit.tsx +12 -12
  26. package/src/components/variable-restore.tsx +3 -2
  27. package/src/components/variables-manager/hooks/use-auto-edit.ts +21 -0
  28. package/src/components/variables-manager/hooks/use-error-navigation.ts +49 -0
  29. package/src/components/variables-manager/hooks/use-variables-manager-state.ts +89 -0
  30. package/src/components/variables-manager/variable-editable-cell.tsx +131 -67
  31. package/src/components/variables-manager/variables-manager-create-menu.tsx +118 -0
  32. package/src/components/variables-manager/variables-manager-panel.tsx +290 -59
  33. package/src/components/variables-manager/variables-manager-table.tsx +124 -14
  34. package/src/components/variables-selection.tsx +61 -15
  35. package/src/controls/variable-control.tsx +1 -1
  36. package/src/hooks/use-prop-variables.ts +28 -9
  37. package/src/hooks/use-variable-bound-prop.ts +42 -0
  38. package/src/index.ts +1 -0
  39. package/src/init.ts +9 -6
  40. package/src/mcp/create-variable-tool.ts +70 -0
  41. package/src/mcp/delete-variable-tool.ts +50 -0
  42. package/src/mcp/index.ts +17 -0
  43. package/src/mcp/list-variables-tool.ts +58 -0
  44. package/src/mcp/update-variable-tool.ts +81 -0
  45. package/src/mcp/variables-resource.ts +28 -0
  46. package/src/register-variable-types.tsx +4 -0
  47. package/src/service.ts +60 -1
  48. package/src/storage.ts +8 -0
  49. package/src/types.ts +1 -0
  50. package/src/utils/filter-by-search.ts +5 -0
  51. package/src/utils/tracking.ts +37 -22
  52. package/src/utils/unlink-variable.ts +1 -1
  53. package/src/utils/validations.ts +72 -3
  54. package/src/variables-registry/create-variable-type-registry.ts +20 -8
  55. package/src/variables-registry/variable-type-registry.ts +2 -1
  56. package/src/components/ui/tags/deleted-tag.tsx +0 -37
  57. package/src/components/ui/tags/mismatch-tag.tsx +0 -37
  58. package/src/components/ui/tags/missing-tag.tsx +0 -25
  59. /package/src/components/variables-manager/{variable-edit-menu.tsx → ui/variable-edit-menu.tsx} +0 -0
  60. /package/src/components/variables-manager/{variable-table-cell.tsx → ui/variable-table-cell.tsx} +0 -0
@@ -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
- } );