@elementor/editor-interactions 4.5.0-1180 → 4.5.0-1181

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-interactions",
3
- "version": "4.5.0-1180",
3
+ "version": "4.5.0-1181",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,19 +39,20 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor-controls": "4.5.0-1180",
43
- "@elementor/editor-elements": "4.5.0-1180",
44
- "@elementor/editor-mcp": "4.5.0-1180",
45
- "@elementor/editor-props": "4.5.0-1180",
46
- "@elementor/editor-responsive": "4.5.0-1180",
47
- "@elementor/editor-ui": "4.5.0-1180",
48
- "@elementor/editor-v1-adapters": "4.5.0-1180",
42
+ "@elementor/editor-controls": "4.5.0-1181",
43
+ "@elementor/editor-elements": "4.5.0-1181",
44
+ "@elementor/editor-mcp": "4.5.0-1181",
45
+ "@elementor/editor-props": "4.5.0-1181",
46
+ "@elementor/editor-responsive": "4.5.0-1181",
47
+ "@elementor/editor-ui": "4.5.0-1181",
48
+ "@elementor/editor-v1-adapters": "4.5.0-1181",
49
+ "@elementor/locations": "4.5.0-1181",
49
50
  "@elementor/icons": "~1.78.1",
50
- "@elementor/schema": "4.5.0-1180",
51
- "@elementor/session": "4.5.0-1180",
51
+ "@elementor/schema": "4.5.0-1181",
52
+ "@elementor/session": "4.5.0-1181",
52
53
  "@elementor/ui": "1.41.4",
53
- "@elementor/utils": "4.5.0-1180",
54
- "@elementor/events": "4.5.0-1180",
54
+ "@elementor/utils": "4.5.0-1181",
55
+ "@elementor/events": "4.5.0-1181",
55
56
  "@wordpress/i18n": "^5.13.0"
56
57
  },
57
58
  "peerDependencies": {
@@ -1,18 +1,28 @@
1
1
  import * as React from 'react';
2
2
  import { SwipeIcon } from '@elementor/icons';
3
- import { Button, Stack, Typography } from '@elementor/ui';
3
+ import { Box, Button, Stack, Typography } from '@elementor/ui';
4
4
  import { __ } from '@wordpress/i18n';
5
5
 
6
- export const EmptyState = ( { onCreateInteraction }: { onCreateInteraction: () => void } ) => {
6
+ import { InteractionsHeaderSlot } from './interactions-header-location';
7
+
8
+ type EmptyStateProps = {
9
+ elementId: string;
10
+ onCreateInteraction: () => void;
11
+ };
12
+
13
+ export const EmptyState = ( { elementId, onCreateInteraction }: EmptyStateProps ) => {
7
14
  return (
8
15
  <Stack
9
16
  alignItems="center"
10
17
  justifyContent="center"
11
18
  height="100%"
12
19
  color="text.secondary"
13
- sx={ { p: 2.5, pt: 8, pb: 5.5 } }
20
+ sx={ { position: 'relative', p: 2.5, pt: 8, pb: 5.5 } }
14
21
  gap={ 1.5 }
15
22
  >
23
+ <Box sx={ { position: 'absolute', top: 8, insetInlineEnd: 8 } }>
24
+ <InteractionsHeaderSlot elementId={ elementId } />
25
+ </Box>
16
26
  <SwipeIcon fontSize="large" />
17
27
 
18
28
  <Typography align="center" variant="subtitle2">
@@ -0,0 +1,12 @@
1
+ import { type ElementID } from '@elementor/editor-elements';
2
+ import { createLocation } from '@elementor/locations';
3
+
4
+ export type InteractionsHeaderProps = {
5
+ elementId: ElementID;
6
+ };
7
+
8
+ export const {
9
+ Slot: InteractionsHeaderSlot,
10
+ inject: injectIntoInteractionsHeader,
11
+ useInjections: useInteractionsHeaderInjections,
12
+ } = createLocation< InteractionsHeaderProps >();
@@ -16,6 +16,7 @@ import {
16
16
  } from '../utils/scroll-interaction-event';
17
17
  import { trackInteractionCreated } from '../utils/tracking';
18
18
  import { DEFAULT_VALUES } from './interaction-details';
19
+ import { InteractionsHeaderSlot } from './interactions-header-location';
19
20
  import { InteractionsListItem } from './interactions-list-item';
20
21
  export const MAX_NUMBER_OF_INTERACTIONS = 5;
21
22
 
@@ -122,6 +123,7 @@ export function InteractionsList( props: InteractionListProps ) {
122
123
  openOnAdd
123
124
  openItem={ triggerCreateOnShowEmpty ? 0 : undefined }
124
125
  label={ __( 'Interactions', 'elementor' ) }
126
+ headerActions={ <InteractionsHeaderSlot elementId={ elementId } /> }
125
127
  values={ interactions.items }
126
128
  setValues={ handleRepeaterChange }
127
129
  showDuplicate={ false }
@@ -31,6 +31,7 @@ function InteractionsTabContent( { elementId }: { elementId: string } ) {
31
31
  </InteractionsProvider>
32
32
  ) : (
33
33
  <EmptyState
34
+ elementId={ elementId }
34
35
  onCreateInteraction={ () => {
35
36
  firstInteractionState[ 1 ]( true );
36
37
  } }
package/src/index.ts CHANGED
@@ -10,6 +10,7 @@ export {
10
10
 
11
11
  export { ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX } from './providers/document-elements-interactions-provider';
12
12
  export { init } from './init';
13
+ export { injectIntoInteractionsHeader, type InteractionsHeaderProps } from './components/interactions-header-location';
13
14
  export { registerInteractionsControl } from './interactions-controls-registry';
14
15
  export type { InteractionItemPropValue, FieldProps, ReplayFieldProps } from './types';
15
16
  export { TRIGGER_OPTIONS, BASE_TRIGGERS } from './components/controls/trigger';