@elementor/editor-variables 3.33.0-99 → 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.
- package/dist/index.d.mts +17 -4
- package/dist/index.d.ts +17 -4
- package/dist/index.js +1903 -809
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1850 -747
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -14
- package/src/api.ts +24 -0
- package/src/batch-operations.ts +86 -0
- package/src/components/fields/color-field.tsx +1 -0
- package/src/components/fields/font-field.tsx +2 -1
- package/src/components/fields/label-field.tsx +42 -6
- package/src/components/ui/deleted-variable-alert.tsx +14 -10
- package/src/components/ui/{no-variables.tsx → empty-state.tsx} +8 -13
- package/src/components/ui/menu-item-content.tsx +14 -11
- package/src/components/ui/mismatch-variable-alert.tsx +5 -9
- package/src/components/ui/missing-variable-alert.tsx +8 -9
- package/src/components/ui/no-search-results.tsx +1 -2
- package/src/components/ui/tags/assigned-tag.tsx +6 -3
- package/src/components/ui/tags/warning-variable-tag.tsx +44 -0
- package/src/components/ui/variable/deleted-variable.tsx +13 -6
- package/src/components/ui/variable/mismatch-variable.tsx +11 -4
- package/src/components/ui/variable/missing-variable.tsx +2 -2
- package/src/components/variable-creation.tsx +13 -4
- package/src/components/variable-edit.tsx +12 -12
- package/src/components/variable-restore.tsx +3 -2
- package/src/components/variables-manager/hooks/use-auto-edit.ts +21 -0
- package/src/components/variables-manager/hooks/use-error-navigation.ts +49 -0
- package/src/components/variables-manager/hooks/use-variables-manager-state.ts +89 -0
- package/src/components/variables-manager/variable-editable-cell.tsx +131 -67
- package/src/components/variables-manager/variables-manager-create-menu.tsx +118 -0
- package/src/components/variables-manager/variables-manager-panel.tsx +290 -59
- package/src/components/variables-manager/variables-manager-table.tsx +124 -14
- package/src/components/variables-selection.tsx +61 -15
- package/src/controls/variable-control.tsx +1 -1
- package/src/hooks/use-prop-variables.ts +28 -9
- package/src/hooks/use-variable-bound-prop.ts +42 -0
- package/src/index.ts +1 -0
- package/src/init.ts +9 -6
- package/src/mcp/create-variable-tool.ts +70 -0
- package/src/mcp/delete-variable-tool.ts +50 -0
- package/src/mcp/index.ts +17 -0
- package/src/mcp/list-variables-tool.ts +58 -0
- package/src/mcp/update-variable-tool.ts +81 -0
- package/src/mcp/variables-resource.ts +28 -0
- package/src/register-variable-types.tsx +4 -0
- package/src/service.ts +60 -1
- package/src/storage.ts +8 -0
- package/src/types.ts +1 -0
- package/src/utils/filter-by-search.ts +5 -0
- package/src/utils/tracking.ts +37 -22
- package/src/utils/unlink-variable.ts +1 -1
- package/src/utils/validations.ts +72 -3
- package/src/variables-registry/create-variable-type-registry.ts +20 -8
- package/src/variables-registry/variable-type-registry.ts +2 -1
- package/src/components/ui/tags/deleted-tag.tsx +0 -37
- package/src/components/ui/tags/mismatch-tag.tsx +0 -37
- package/src/components/ui/tags/missing-tag.tsx +0 -25
- /package/src/components/variables-manager/{variable-edit-menu.tsx → ui/variable-edit-menu.tsx} +0 -0
- /package/src/components/variables-manager/{variable-table-cell.tsx → ui/variable-table-cell.tsx} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _elementor_editor_props from '@elementor/editor-props';
|
|
2
2
|
import { PropType } from '@elementor/editor-props';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
+
import { RefObject } from 'react';
|
|
4
5
|
import * as _mui_material from '@mui/material';
|
|
5
6
|
|
|
6
7
|
declare function init(): void;
|
|
@@ -17,27 +18,39 @@ type NormalizedVariable = {
|
|
|
17
18
|
key: string;
|
|
18
19
|
label: string;
|
|
19
20
|
value: string;
|
|
21
|
+
order?: number;
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
type ValueFieldProps = {
|
|
23
25
|
value: string;
|
|
24
26
|
onChange: (value: string) => void;
|
|
27
|
+
onPropTypeKeyChange?: (key: string) => void;
|
|
28
|
+
propTypeKey?: string;
|
|
25
29
|
onValidationChange?: (value: string) => void;
|
|
26
30
|
propType?: PropType;
|
|
31
|
+
error?: {
|
|
32
|
+
value: string;
|
|
33
|
+
message: string;
|
|
34
|
+
};
|
|
35
|
+
ref?: RefObject<HTMLElement | null>;
|
|
27
36
|
};
|
|
28
37
|
|
|
29
|
-
declare const registerVariableType: ({ icon, startIcon, valueField, propTypeUtil, variableType, selectionFilter, valueTransformer, fallbackPropTypeUtil, isCompatible, }: {
|
|
38
|
+
declare const registerVariableType: ({ key, icon, startIcon, valueField, propTypeUtil, variableType, defaultValue, selectionFilter, valueTransformer, fallbackPropTypeUtil, isCompatible, }: {
|
|
30
39
|
icon: react.ForwardRefExoticComponent<Omit<_mui_material.SvgIconProps, "ref"> & react.RefAttributes<SVGSVGElement>>;
|
|
31
40
|
startIcon?: ({ value }: {
|
|
32
41
|
value: string;
|
|
33
42
|
}) => react.JSX.Element;
|
|
34
|
-
valueField: (
|
|
43
|
+
valueField: (props: ValueFieldProps) => react.JSX.Element;
|
|
35
44
|
variableType: string;
|
|
45
|
+
key?: string;
|
|
46
|
+
defaultValue?: string;
|
|
36
47
|
fallbackPropTypeUtil: any;
|
|
37
48
|
propTypeUtil: _elementor_editor_props.PropTypeUtil<string, string>;
|
|
38
49
|
selectionFilter?: (variables: NormalizedVariable[], propType: _elementor_editor_props.PropType) => NormalizedVariable[];
|
|
39
|
-
valueTransformer?: (
|
|
50
|
+
valueTransformer?: (variable: Variable) => _elementor_editor_props.PropValue;
|
|
40
51
|
isCompatible?: (propType: _elementor_editor_props.PropType, variable: Variable) => boolean;
|
|
41
52
|
}) => void;
|
|
42
53
|
|
|
43
|
-
|
|
54
|
+
declare function registerVariableTypes(): void;
|
|
55
|
+
|
|
56
|
+
export { init, registerVariableType, registerVariableTypes };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _elementor_editor_props from '@elementor/editor-props';
|
|
2
2
|
import { PropType } from '@elementor/editor-props';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
+
import { RefObject } from 'react';
|
|
4
5
|
import * as _mui_material from '@mui/material';
|
|
5
6
|
|
|
6
7
|
declare function init(): void;
|
|
@@ -17,27 +18,39 @@ type NormalizedVariable = {
|
|
|
17
18
|
key: string;
|
|
18
19
|
label: string;
|
|
19
20
|
value: string;
|
|
21
|
+
order?: number;
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
type ValueFieldProps = {
|
|
23
25
|
value: string;
|
|
24
26
|
onChange: (value: string) => void;
|
|
27
|
+
onPropTypeKeyChange?: (key: string) => void;
|
|
28
|
+
propTypeKey?: string;
|
|
25
29
|
onValidationChange?: (value: string) => void;
|
|
26
30
|
propType?: PropType;
|
|
31
|
+
error?: {
|
|
32
|
+
value: string;
|
|
33
|
+
message: string;
|
|
34
|
+
};
|
|
35
|
+
ref?: RefObject<HTMLElement | null>;
|
|
27
36
|
};
|
|
28
37
|
|
|
29
|
-
declare const registerVariableType: ({ icon, startIcon, valueField, propTypeUtil, variableType, selectionFilter, valueTransformer, fallbackPropTypeUtil, isCompatible, }: {
|
|
38
|
+
declare const registerVariableType: ({ key, icon, startIcon, valueField, propTypeUtil, variableType, defaultValue, selectionFilter, valueTransformer, fallbackPropTypeUtil, isCompatible, }: {
|
|
30
39
|
icon: react.ForwardRefExoticComponent<Omit<_mui_material.SvgIconProps, "ref"> & react.RefAttributes<SVGSVGElement>>;
|
|
31
40
|
startIcon?: ({ value }: {
|
|
32
41
|
value: string;
|
|
33
42
|
}) => react.JSX.Element;
|
|
34
|
-
valueField: (
|
|
43
|
+
valueField: (props: ValueFieldProps) => react.JSX.Element;
|
|
35
44
|
variableType: string;
|
|
45
|
+
key?: string;
|
|
46
|
+
defaultValue?: string;
|
|
36
47
|
fallbackPropTypeUtil: any;
|
|
37
48
|
propTypeUtil: _elementor_editor_props.PropTypeUtil<string, string>;
|
|
38
49
|
selectionFilter?: (variables: NormalizedVariable[], propType: _elementor_editor_props.PropType) => NormalizedVariable[];
|
|
39
|
-
valueTransformer?: (
|
|
50
|
+
valueTransformer?: (variable: Variable) => _elementor_editor_props.PropValue;
|
|
40
51
|
isCompatible?: (propType: _elementor_editor_props.PropType, variable: Variable) => boolean;
|
|
41
52
|
}) => void;
|
|
42
53
|
|
|
43
|
-
|
|
54
|
+
declare function registerVariableTypes(): void;
|
|
55
|
+
|
|
56
|
+
export { init, registerVariableType, registerVariableTypes };
|