@elementor/editor-elements 3.33.0-273 → 3.33.0-274
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 +34 -4
- package/dist/index.d.ts +34 -4
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
- package/src/hooks/use-element-interactions.ts +4 -3
- package/src/index.ts +1 -7
- package/src/sync/get-element-interactions.ts +4 -3
- package/src/sync/types.ts +13 -1
package/src/index.ts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
// types
|
|
2
|
-
export type {
|
|
3
|
-
V1Element,
|
|
4
|
-
V1ElementConfig,
|
|
5
|
-
V1ElementData,
|
|
6
|
-
V1ElementModelProps,
|
|
7
|
-
V1ElementSettingsProps,
|
|
8
|
-
} from './sync/types';
|
|
9
2
|
export * from './types';
|
|
3
|
+
export type * from './sync/types';
|
|
10
4
|
|
|
11
5
|
// hooks
|
|
12
6
|
export { useElementChildren, type ElementChildren, type ElementModel } from './hooks/use-element-children';
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { type ElementID } from '../types';
|
|
2
2
|
import { getContainer } from './get-container';
|
|
3
|
+
import { type ElementInteractions } from './types';
|
|
3
4
|
|
|
4
|
-
export function getElementInteractions( elementId: ElementID ) {
|
|
5
|
+
export function getElementInteractions( elementId: ElementID ): ElementInteractions | undefined {
|
|
5
6
|
const container = getContainer( elementId );
|
|
6
7
|
|
|
7
8
|
const interactions = container?.model?.get( 'interactions' );
|
|
8
9
|
|
|
9
10
|
if ( typeof interactions === 'string' ) {
|
|
10
|
-
return interactions;
|
|
11
|
+
return JSON.parse( interactions ) as ElementInteractions;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
return
|
|
14
|
+
return interactions;
|
|
14
15
|
}
|
package/src/sync/types.ts
CHANGED
|
@@ -44,6 +44,18 @@ export type V1Element = {
|
|
|
44
44
|
parent?: V1Element;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
+
export type ElementInteractions = {
|
|
48
|
+
version: number;
|
|
49
|
+
items: InteractionItem[];
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type InteractionItem = {
|
|
53
|
+
animation: {
|
|
54
|
+
animation_type: string;
|
|
55
|
+
animation_id: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
|
|
47
59
|
export type V1ElementModelProps = {
|
|
48
60
|
widgetType?: string;
|
|
49
61
|
elType: string;
|
|
@@ -52,7 +64,7 @@ export type V1ElementModelProps = {
|
|
|
52
64
|
elements?: V1Model< V1ElementModelProps >[];
|
|
53
65
|
settings?: V1ElementSettingsProps;
|
|
54
66
|
editor_settings?: V1ElementEditorSettingsProps;
|
|
55
|
-
interactions?: string |
|
|
67
|
+
interactions?: string | ElementInteractions;
|
|
56
68
|
};
|
|
57
69
|
|
|
58
70
|
export type V1ElementData = Omit< V1ElementModelProps, 'elements' > & {
|