@elementor/editor-controls 4.0.0-501 → 4.0.0-502

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-controls",
3
3
  "description": "This package contains the controls model and utils for the Elementor editor",
4
- "version": "4.0.0-501",
4
+ "version": "4.0.0-502",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,22 +40,22 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor-current-user": "4.0.0-501",
44
- "@elementor/editor-elements": "4.0.0-501",
45
- "@elementor/editor-props": "4.0.0-501",
46
- "@elementor/editor-responsive": "4.0.0-501",
47
- "@elementor/editor-ui": "4.0.0-501",
48
- "@elementor/editor-v1-adapters": "4.0.0-501",
49
- "@elementor/env": "4.0.0-501",
50
- "@elementor/http-client": "4.0.0-501",
43
+ "@elementor/editor-current-user": "4.0.0-502",
44
+ "@elementor/editor-elements": "4.0.0-502",
45
+ "@elementor/editor-props": "4.0.0-502",
46
+ "@elementor/editor-responsive": "4.0.0-502",
47
+ "@elementor/editor-ui": "4.0.0-502",
48
+ "@elementor/editor-v1-adapters": "4.0.0-502",
49
+ "@elementor/env": "4.0.0-502",
50
+ "@elementor/http-client": "4.0.0-502",
51
51
  "@elementor/icons": "^1.63.0",
52
- "@elementor/locations": "4.0.0-501",
53
- "@elementor/mixpanel": "4.0.0-501",
54
- "@elementor/query": "4.0.0-501",
55
- "@elementor/session": "4.0.0-501",
52
+ "@elementor/locations": "4.0.0-502",
53
+ "@elementor/mixpanel": "4.0.0-502",
54
+ "@elementor/query": "4.0.0-502",
55
+ "@elementor/session": "4.0.0-502",
56
56
  "@elementor/ui": "1.36.17",
57
- "@elementor/utils": "4.0.0-501",
58
- "@elementor/wp-media": "4.0.0-501",
57
+ "@elementor/utils": "4.0.0-502",
58
+ "@elementor/wp-media": "4.0.0-502",
59
59
  "@wordpress/i18n": "^5.13.0",
60
60
  "@monaco-editor/react": "^4.7.0",
61
61
  "dayjs": "^1.11.18",
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { type PropsWithChildren } from 'react';
3
+ import { FloatingActionsBar } from '@elementor/editor-ui';
3
4
 
4
5
  import { useBoundProp } from '../bound-prop-context';
5
- import { FloatingActionsBar } from '../components/floating-bar';
6
6
  import { useControlActions } from './control-actions-context';
7
7
 
8
8
  type ControlActionsProps = PropsWithChildren< object >;
package/src/index.ts CHANGED
@@ -47,7 +47,6 @@ export {
47
47
  type ItemsActionPayload,
48
48
  type RepeaterItem,
49
49
  } from './components/repeater/repeater';
50
- export { FloatingActionsBar } from './components/floating-bar';
51
50
  export { PopoverGridContainer } from './components/popover-grid-container';
52
51
  export { InlineEditor } from './components/inline-editor';
53
52
  export { InlineEditorToolbar } from './components/inline-editor-toolbar';
@@ -73,7 +72,6 @@ export {
73
72
  type ControlReplacement,
74
73
  } from './control-replacements';
75
74
  export { ControlActionsProvider, useControlActions } from './control-actions/control-actions-context';
76
- export { useFloatingActionsBar } from './components/floating-bar';
77
75
  export { useBoundProp, PropProvider, PropKeyProvider } from './bound-prop-context';
78
76
  export { ControlAdornmentsProvider } from './control-adornments/control-adornments-context';
79
77
  export { ControlAdornments } from './control-adornments/control-adornments';
@@ -1,45 +0,0 @@
1
- import * as React from 'react';
2
- import { createContext, type PropsWithChildren, type ReactElement, useContext, useState } from 'react';
3
- import { styled, UnstableFloatingActionBar } from '@elementor/ui';
4
-
5
- // CSS hack to hide empty floating bars.
6
- const FloatingBarContainer = styled( 'span' )`
7
- display: contents;
8
-
9
- .MuiFloatingActionBar-popper:has( .MuiFloatingActionBar-actions:empty ) {
10
- display: none;
11
- }
12
-
13
- .MuiFloatingActionBar-popper {
14
- z-index: 1000;
15
- }
16
- `;
17
-
18
- const FloatingActionsContext = createContext< null | {
19
- open: boolean;
20
- setOpen: React.Dispatch< React.SetStateAction< boolean > >;
21
- } >( null );
22
-
23
- export function FloatingActionsBar( { actions, children }: PropsWithChildren< { actions: ReactElement[] } > ) {
24
- const [ open, setOpen ] = useState< boolean >( false );
25
-
26
- return (
27
- <FloatingActionsContext.Provider value={ { open, setOpen } }>
28
- <FloatingBarContainer>
29
- <UnstableFloatingActionBar actions={ actions } open={ open || undefined }>
30
- { children as ReactElement }
31
- </UnstableFloatingActionBar>
32
- </FloatingBarContainer>
33
- </FloatingActionsContext.Provider>
34
- );
35
- }
36
-
37
- export function useFloatingActionsBar() {
38
- const context = useContext( FloatingActionsContext );
39
-
40
- if ( ! context ) {
41
- throw new Error( 'useFloatingActions must be used within a FloatingActionsBar' );
42
- }
43
-
44
- return context;
45
- }