@elementor/editor-interactions 4.0.0-573 → 4.0.0-591

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 CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { RefObject, ComponentType } from 'react';
3
- import { Unit } from '@elementor/editor-controls';
4
- import { ElementInteractions, InteractionItemPropValue } from '@elementor/editor-elements';
5
- export { AnimationPresetPropValue, BooleanPropValue, ConfigPropValue, ElementInteractions, ExcludedBreakpointsPropValue, InteractionBreakpointsPropValue, InteractionItemPropValue, NumberPropValue, StringPropValue, TimingConfigPropValue } from '@elementor/editor-elements';
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: string;
32
- onChange: (value: string) => void;
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 DirectionFieldProps = FieldProps & {
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
- export { type AnimationOption, type CreateInteractionsProviderOptions, type DirectionFieldProps, ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX, type ElementInteractionData, EmptyState, type FieldProps, type InteractionConstants, type InteractionItemValue, type InteractionsCollection, type InteractionsConfig, type InteractionsProvider, InteractionsTab, type ReplayFieldProps, type SizeStringValue, createInteractionsProvider, getInteractionsConfig, init, interactionsRepository, registerInteractionsControl };
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 { Unit } from '@elementor/editor-controls';
4
- import { ElementInteractions, InteractionItemPropValue } from '@elementor/editor-elements';
5
- export { AnimationPresetPropValue, BooleanPropValue, ConfigPropValue, ElementInteractions, ExcludedBreakpointsPropValue, InteractionBreakpointsPropValue, InteractionItemPropValue, NumberPropValue, StringPropValue, TimingConfigPropValue } from '@elementor/editor-elements';
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: string;
32
- onChange: (value: string) => void;
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 DirectionFieldProps = FieldProps & {
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
- export { type AnimationOption, type CreateInteractionsProviderOptions, type DirectionFieldProps, ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX, type ElementInteractionData, EmptyState, type FieldProps, type InteractionConstants, type InteractionItemValue, type InteractionsCollection, type InteractionsConfig, type InteractionsProvider, InteractionsTab, type ReplayFieldProps, type SizeStringValue, createInteractionsProvider, getInteractionsConfig, init, interactionsRepository, registerInteractionsControl };
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 };