@elementor/editor-variables 0.16.0 → 3.32.0-20

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 (67) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/index.d.mts +19 -1
  3. package/dist/index.d.ts +19 -1
  4. package/dist/index.js +1397 -885
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +1399 -871
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +16 -14
  9. package/src/api.ts +18 -2
  10. package/src/components/fields/color-field.tsx +3 -3
  11. package/src/components/fields/font-field.tsx +21 -10
  12. package/src/components/fields/label-field.tsx +31 -5
  13. package/src/components/ui/delete-confirmation-dialog.tsx +4 -7
  14. package/src/components/ui/deleted-variable-alert.tsx +47 -0
  15. package/src/components/ui/edit-confirmation-dialog.tsx +75 -0
  16. package/src/components/ui/missing-variable-alert.tsx +39 -0
  17. package/src/components/ui/no-variables.tsx +59 -26
  18. package/src/components/ui/tags/assigned-tag.tsx +21 -19
  19. package/src/components/ui/tags/deleted-tag.tsx +29 -18
  20. package/src/components/ui/tags/missing-tag.tsx +25 -0
  21. package/src/components/ui/variable/assigned-variable.tsx +11 -14
  22. package/src/components/ui/variable/deleted-variable.tsx +115 -7
  23. package/src/components/ui/variable/missing-variable.tsx +44 -0
  24. package/src/components/variable-creation.tsx +135 -0
  25. package/src/components/variable-edit.tsx +221 -0
  26. package/src/components/variable-restore.tsx +117 -0
  27. package/src/components/variable-selection-popover.tsx +91 -92
  28. package/src/components/variables-manager/variables-manager-panel.tsx +115 -0
  29. package/src/components/variables-selection.tsx +148 -0
  30. package/src/context/variable-selection-popover.context.tsx +19 -0
  31. package/src/context/variable-type-context.tsx +23 -0
  32. package/src/controls/variable-control.tsx +26 -0
  33. package/src/create-style-variables-repository.ts +44 -5
  34. package/src/hooks/use-initial-value.ts +22 -0
  35. package/src/hooks/use-permissions.ts +15 -0
  36. package/src/hooks/use-prop-variable-action.tsx +53 -0
  37. package/src/hooks/use-prop-variables.ts +6 -0
  38. package/src/index.ts +1 -0
  39. package/src/init.ts +33 -4
  40. package/src/register-variable-types.tsx +29 -0
  41. package/src/renderers/style-variables-renderer.tsx +10 -4
  42. package/src/repeater-injections.ts +5 -1
  43. package/src/service.ts +8 -4
  44. package/src/sync/enqueue-font.ts +7 -0
  45. package/src/sync/types.ts +5 -0
  46. package/src/transformers/inheritance-transformer.tsx +30 -0
  47. package/src/transformers/utils/resolve-css-variable.ts +24 -0
  48. package/src/transformers/variable-transformer.ts +8 -3
  49. package/src/types.ts +1 -1
  50. package/src/utils/tracking.ts +39 -0
  51. package/src/utils/validations.ts +40 -6
  52. package/src/variables-registry/create-variable-type-registry.ts +77 -0
  53. package/src/variables-registry/variable-type-registry.ts +3 -0
  54. package/src/components/color-variable-creation.tsx +0 -86
  55. package/src/components/color-variable-edit.tsx +0 -138
  56. package/src/components/color-variables-selection.tsx +0 -130
  57. package/src/components/font-variable-creation.tsx +0 -86
  58. package/src/components/font-variable-edit.tsx +0 -138
  59. package/src/components/font-variables-selection.tsx +0 -129
  60. package/src/components/variable-selection-popover.context.ts +0 -7
  61. package/src/controls/color-variable-control.tsx +0 -33
  62. package/src/controls/font-variable-control.tsx +0 -31
  63. package/src/hooks/use-prop-color-variable-action.tsx +0 -25
  64. package/src/hooks/use-prop-font-variable-action.tsx +0 -25
  65. package/src/init-color-variables.ts +0 -27
  66. package/src/init-font-variables.ts +0 -24
  67. package/src/utils.ts +0 -20
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @elementor/editor-variables
2
2
 
3
+ ## 0.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f2df660: Fix font variable not rendering on the canvas
8
+ - 5fc23ea: Created an alert popover for deleted variables
9
+ - 0b2145a: Update the text on the delete variable dialog.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [669f39f]
14
+ - Updated dependencies [2e677ee]
15
+ - Updated dependencies [90ec4c6]
16
+ - Updated dependencies [068f659]
17
+ - Updated dependencies [e7cca0a]
18
+ - Updated dependencies [07ca7e9]
19
+ - @elementor/editor-controls@1.4.0
20
+ - @elementor/editor-ui@0.14.1
21
+ - @elementor/editor-editing-panel@1.49.0
22
+ - @elementor/editor-canvas@0.27.0
23
+ - @elementor/editor-props@0.17.0
24
+
3
25
  ## 0.16.0
4
26
 
5
27
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -1,3 +1,21 @@
1
+ import * as _elementor_editor_props from '@elementor/editor-props';
2
+ import * as react from 'react';
3
+ import * as _mui_material from '@mui/material';
4
+
1
5
  declare function init(): void;
2
6
 
3
- export { init };
7
+ declare const registerVariableType: ({ icon, startIcon, valueField, propTypeUtil, variableType, fallbackPropTypeUtil, }: {
8
+ icon: react.ForwardRefExoticComponent<Omit<_mui_material.SvgIconProps, "ref"> & react.RefAttributes<SVGSVGElement>>;
9
+ startIcon?: ({ value }: {
10
+ value: string;
11
+ }) => react.JSX.Element;
12
+ valueField: ({ value, onChange }: {
13
+ value: string;
14
+ onChange: (value: string) => void;
15
+ }) => react.JSX.Element;
16
+ variableType: string;
17
+ fallbackPropTypeUtil: any;
18
+ propTypeUtil: _elementor_editor_props.PropTypeUtil<string, string>;
19
+ }) => void;
20
+
21
+ export { init, registerVariableType };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,21 @@
1
+ import * as _elementor_editor_props from '@elementor/editor-props';
2
+ import * as react from 'react';
3
+ import * as _mui_material from '@mui/material';
4
+
1
5
  declare function init(): void;
2
6
 
3
- export { init };
7
+ declare const registerVariableType: ({ icon, startIcon, valueField, propTypeUtil, variableType, fallbackPropTypeUtil, }: {
8
+ icon: react.ForwardRefExoticComponent<Omit<_mui_material.SvgIconProps, "ref"> & react.RefAttributes<SVGSVGElement>>;
9
+ startIcon?: ({ value }: {
10
+ value: string;
11
+ }) => react.JSX.Element;
12
+ valueField: ({ value, onChange }: {
13
+ value: string;
14
+ onChange: (value: string) => void;
15
+ }) => react.JSX.Element;
16
+ variableType: string;
17
+ fallbackPropTypeUtil: any;
18
+ propTypeUtil: _elementor_editor_props.PropTypeUtil<string, string>;
19
+ }) => void;
20
+
21
+ export { init, registerVariableType };