@elementor/editor-interactions 4.0.0-573 → 4.0.0-597
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 +37 -16
- package/dist/index.d.ts +37 -16
- package/dist/index.js +353 -260
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +322 -238
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
- package/src/components/controls/easing.tsx +19 -18
- package/src/components/controls/effect.tsx +3 -1
- package/src/components/controls/replay.tsx +9 -2
- package/src/components/controls/trigger.tsx +28 -25
- package/src/components/field.tsx +1 -1
- package/src/components/interaction-details.tsx +48 -19
- package/src/index.ts +4 -2
- package/src/init.ts +15 -0
- package/src/interactions-controls-registry.ts +4 -1
- package/src/providers/document-elements-interactions-provider.ts +1 -4
- package/src/types.ts +6 -9
- package/src/ui/interactions-promotion-chip.tsx +47 -28
- package/src/ui/promotion-select.tsx +75 -0
- package/src/utils/prop-value-utils.ts +7 -1
- package/src/providers/utils/normalize-interactions.ts +0 -65
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { RefObject, ComponentType } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { ElementInteractions } from '@elementor/editor-elements';
|
|
4
|
+
export { InteractionItemPropValue } from '@elementor/editor-elements';
|
|
5
|
+
import { PropValue } from '@elementor/editor-props';
|
|
6
6
|
|
|
7
7
|
declare const EmptyState: ({ onCreateInteraction }: {
|
|
8
8
|
onCreateInteraction: () => void;
|
|
@@ -27,18 +27,15 @@ type InteractionsConfig = {
|
|
|
27
27
|
constants: InteractionConstants;
|
|
28
28
|
animationOptions: AnimationOption[];
|
|
29
29
|
};
|
|
30
|
-
type FieldProps = {
|
|
31
|
-
value:
|
|
32
|
-
onChange: (value:
|
|
30
|
+
type FieldProps<T = string> = {
|
|
31
|
+
value: T;
|
|
32
|
+
onChange: (value: T) => void;
|
|
33
33
|
label?: string;
|
|
34
|
-
};
|
|
35
|
-
type ReplayFieldProps = {
|
|
36
|
-
value: boolean;
|
|
37
|
-
onChange: (value: boolean) => void;
|
|
38
34
|
disabled?: boolean;
|
|
39
35
|
anchorRef?: RefObject<HTMLElement | null>;
|
|
40
36
|
};
|
|
41
|
-
type
|
|
37
|
+
type ReplayFieldProps = FieldProps<boolean>;
|
|
38
|
+
type DirectionFieldProps = FieldProps<string> & {
|
|
42
39
|
interactionType: string;
|
|
43
40
|
};
|
|
44
41
|
type ElementInteractionData = {
|
|
@@ -46,7 +43,6 @@ type ElementInteractionData = {
|
|
|
46
43
|
dataId: string;
|
|
47
44
|
interactions: ElementInteractions;
|
|
48
45
|
};
|
|
49
|
-
type InteractionsCollection = ElementInteractionData[];
|
|
50
46
|
type InteractionsProvider = {
|
|
51
47
|
getKey: () => string;
|
|
52
48
|
priority: number;
|
|
@@ -55,8 +51,6 @@ type InteractionsProvider = {
|
|
|
55
51
|
all: () => ElementInteractionData[];
|
|
56
52
|
};
|
|
57
53
|
};
|
|
58
|
-
type InteractionItemValue = InteractionItemPropValue['value'];
|
|
59
|
-
type SizeStringValue = `${number}${Unit}` | number;
|
|
60
54
|
|
|
61
55
|
declare function getInteractionsConfig(): InteractionsConfig;
|
|
62
56
|
|
|
@@ -82,10 +76,11 @@ declare const ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX = "document-elements-int
|
|
|
82
76
|
|
|
83
77
|
declare function init(): void;
|
|
84
78
|
|
|
85
|
-
type InteractionsControlType = 'trigger' | 'effect' | 'effectType' | 'direction' | 'duration' | 'delay' | 'replay' | 'easing' | 'relativeTo' | 'offsetTop' | 'offsetBottom';
|
|
79
|
+
type InteractionsControlType = 'trigger' | 'effect' | 'effectType' | 'direction' | 'duration' | 'delay' | 'replay' | 'easing' | 'relativeTo' | 'offsetTop' | 'offsetBottom' | 'customEffects';
|
|
86
80
|
type InteractionsControlPropsMap = {
|
|
87
81
|
trigger: FieldProps;
|
|
88
82
|
effect: FieldProps;
|
|
83
|
+
customEffects?: FieldProps<PropValue>;
|
|
89
84
|
effectType: FieldProps;
|
|
90
85
|
direction: DirectionFieldProps;
|
|
91
86
|
duration: FieldProps;
|
|
@@ -103,4 +98,30 @@ type ControlOptions<T extends InteractionsControlType> = {
|
|
|
103
98
|
};
|
|
104
99
|
declare function registerInteractionsControl<T extends InteractionsControlType>({ type, component, options, }: ControlOptions<T>): void;
|
|
105
100
|
|
|
106
|
-
|
|
101
|
+
declare const TRIGGER_OPTIONS: {
|
|
102
|
+
load: string;
|
|
103
|
+
scrollIn: string;
|
|
104
|
+
scrollOn: string;
|
|
105
|
+
hover: string;
|
|
106
|
+
click: string;
|
|
107
|
+
};
|
|
108
|
+
declare const BASE_TRIGGERS: string[];
|
|
109
|
+
|
|
110
|
+
declare const EASING_OPTIONS: {
|
|
111
|
+
easeIn: string;
|
|
112
|
+
easeInOut: string;
|
|
113
|
+
easeOut: string;
|
|
114
|
+
backIn: string;
|
|
115
|
+
backInOut: string;
|
|
116
|
+
backOut: string;
|
|
117
|
+
linear: string;
|
|
118
|
+
};
|
|
119
|
+
declare const BASE_EASINGS: string[];
|
|
120
|
+
|
|
121
|
+
declare const REPLAY_OPTIONS: {
|
|
122
|
+
no: string;
|
|
123
|
+
yes: string;
|
|
124
|
+
};
|
|
125
|
+
declare const BASE_REPLAY: string[];
|
|
126
|
+
|
|
127
|
+
export { BASE_EASINGS, BASE_REPLAY, BASE_TRIGGERS, type CreateInteractionsProviderOptions, EASING_OPTIONS, ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX, EmptyState, type FieldProps, InteractionsTab, REPLAY_OPTIONS, type ReplayFieldProps, TRIGGER_OPTIONS, createInteractionsProvider, getInteractionsConfig, init, interactionsRepository, registerInteractionsControl };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { RefObject, ComponentType } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { ElementInteractions } from '@elementor/editor-elements';
|
|
4
|
+
export { InteractionItemPropValue } from '@elementor/editor-elements';
|
|
5
|
+
import { PropValue } from '@elementor/editor-props';
|
|
6
6
|
|
|
7
7
|
declare const EmptyState: ({ onCreateInteraction }: {
|
|
8
8
|
onCreateInteraction: () => void;
|
|
@@ -27,18 +27,15 @@ type InteractionsConfig = {
|
|
|
27
27
|
constants: InteractionConstants;
|
|
28
28
|
animationOptions: AnimationOption[];
|
|
29
29
|
};
|
|
30
|
-
type FieldProps = {
|
|
31
|
-
value:
|
|
32
|
-
onChange: (value:
|
|
30
|
+
type FieldProps<T = string> = {
|
|
31
|
+
value: T;
|
|
32
|
+
onChange: (value: T) => void;
|
|
33
33
|
label?: string;
|
|
34
|
-
};
|
|
35
|
-
type ReplayFieldProps = {
|
|
36
|
-
value: boolean;
|
|
37
|
-
onChange: (value: boolean) => void;
|
|
38
34
|
disabled?: boolean;
|
|
39
35
|
anchorRef?: RefObject<HTMLElement | null>;
|
|
40
36
|
};
|
|
41
|
-
type
|
|
37
|
+
type ReplayFieldProps = FieldProps<boolean>;
|
|
38
|
+
type DirectionFieldProps = FieldProps<string> & {
|
|
42
39
|
interactionType: string;
|
|
43
40
|
};
|
|
44
41
|
type ElementInteractionData = {
|
|
@@ -46,7 +43,6 @@ type ElementInteractionData = {
|
|
|
46
43
|
dataId: string;
|
|
47
44
|
interactions: ElementInteractions;
|
|
48
45
|
};
|
|
49
|
-
type InteractionsCollection = ElementInteractionData[];
|
|
50
46
|
type InteractionsProvider = {
|
|
51
47
|
getKey: () => string;
|
|
52
48
|
priority: number;
|
|
@@ -55,8 +51,6 @@ type InteractionsProvider = {
|
|
|
55
51
|
all: () => ElementInteractionData[];
|
|
56
52
|
};
|
|
57
53
|
};
|
|
58
|
-
type InteractionItemValue = InteractionItemPropValue['value'];
|
|
59
|
-
type SizeStringValue = `${number}${Unit}` | number;
|
|
60
54
|
|
|
61
55
|
declare function getInteractionsConfig(): InteractionsConfig;
|
|
62
56
|
|
|
@@ -82,10 +76,11 @@ declare const ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX = "document-elements-int
|
|
|
82
76
|
|
|
83
77
|
declare function init(): void;
|
|
84
78
|
|
|
85
|
-
type InteractionsControlType = 'trigger' | 'effect' | 'effectType' | 'direction' | 'duration' | 'delay' | 'replay' | 'easing' | 'relativeTo' | 'offsetTop' | 'offsetBottom';
|
|
79
|
+
type InteractionsControlType = 'trigger' | 'effect' | 'effectType' | 'direction' | 'duration' | 'delay' | 'replay' | 'easing' | 'relativeTo' | 'offsetTop' | 'offsetBottom' | 'customEffects';
|
|
86
80
|
type InteractionsControlPropsMap = {
|
|
87
81
|
trigger: FieldProps;
|
|
88
82
|
effect: FieldProps;
|
|
83
|
+
customEffects?: FieldProps<PropValue>;
|
|
89
84
|
effectType: FieldProps;
|
|
90
85
|
direction: DirectionFieldProps;
|
|
91
86
|
duration: FieldProps;
|
|
@@ -103,4 +98,30 @@ type ControlOptions<T extends InteractionsControlType> = {
|
|
|
103
98
|
};
|
|
104
99
|
declare function registerInteractionsControl<T extends InteractionsControlType>({ type, component, options, }: ControlOptions<T>): void;
|
|
105
100
|
|
|
106
|
-
|
|
101
|
+
declare const TRIGGER_OPTIONS: {
|
|
102
|
+
load: string;
|
|
103
|
+
scrollIn: string;
|
|
104
|
+
scrollOn: string;
|
|
105
|
+
hover: string;
|
|
106
|
+
click: string;
|
|
107
|
+
};
|
|
108
|
+
declare const BASE_TRIGGERS: string[];
|
|
109
|
+
|
|
110
|
+
declare const EASING_OPTIONS: {
|
|
111
|
+
easeIn: string;
|
|
112
|
+
easeInOut: string;
|
|
113
|
+
easeOut: string;
|
|
114
|
+
backIn: string;
|
|
115
|
+
backInOut: string;
|
|
116
|
+
backOut: string;
|
|
117
|
+
linear: string;
|
|
118
|
+
};
|
|
119
|
+
declare const BASE_EASINGS: string[];
|
|
120
|
+
|
|
121
|
+
declare const REPLAY_OPTIONS: {
|
|
122
|
+
no: string;
|
|
123
|
+
yes: string;
|
|
124
|
+
};
|
|
125
|
+
declare const BASE_REPLAY: string[];
|
|
126
|
+
|
|
127
|
+
export { BASE_EASINGS, BASE_REPLAY, BASE_TRIGGERS, type CreateInteractionsProviderOptions, EASING_OPTIONS, ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX, EmptyState, type FieldProps, InteractionsTab, REPLAY_OPTIONS, type ReplayFieldProps, TRIGGER_OPTIONS, createInteractionsProvider, getInteractionsConfig, init, interactionsRepository, registerInteractionsControl };
|