@elementor/editor-controls 4.4.0-1146 → 4.4.0-1147

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.4.0-1146",
4
+ "version": "4.4.0-1147",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,23 +40,23 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor-current-user": "4.4.0-1146",
44
- "@elementor/editor-elements": "4.4.0-1146",
45
- "@elementor/editor-props": "4.4.0-1146",
46
- "@elementor/editor-responsive": "4.4.0-1146",
47
- "@elementor/editor-ui": "4.4.0-1146",
48
- "@elementor/editor-v1-adapters": "4.4.0-1146",
49
- "@elementor/env": "4.4.0-1146",
50
- "@elementor/events": "4.4.0-1146",
51
- "@elementor/http-client": "4.4.0-1146",
43
+ "@elementor/editor-current-user": "4.4.0-1147",
44
+ "@elementor/editor-elements": "4.4.0-1147",
45
+ "@elementor/editor-props": "4.4.0-1147",
46
+ "@elementor/editor-responsive": "4.4.0-1147",
47
+ "@elementor/editor-ui": "4.4.0-1147",
48
+ "@elementor/editor-v1-adapters": "4.4.0-1147",
49
+ "@elementor/env": "4.4.0-1147",
50
+ "@elementor/events": "4.4.0-1147",
51
+ "@elementor/http-client": "4.4.0-1147",
52
52
  "@elementor/icons": "~1.78.1",
53
- "@elementor/locations": "4.4.0-1146",
54
- "@elementor/query": "4.4.0-1146",
55
- "@elementor/schema": "4.4.0-1146",
56
- "@elementor/session": "4.4.0-1146",
53
+ "@elementor/locations": "4.4.0-1147",
54
+ "@elementor/query": "4.4.0-1147",
55
+ "@elementor/schema": "4.4.0-1147",
56
+ "@elementor/session": "4.4.0-1147",
57
57
  "@elementor/ui": "1.41.4",
58
- "@elementor/utils": "4.4.0-1146",
59
- "@elementor/wp-media": "4.4.0-1146",
58
+ "@elementor/utils": "4.4.0-1147",
59
+ "@elementor/wp-media": "4.4.0-1147",
60
60
  "@monaco-editor/react": "^4.7.0",
61
61
  "@tanstack/react-virtual": "^3.13.3",
62
62
  "@tiptap/extension-bold": "^3.11.1",
@@ -50,11 +50,10 @@ const MODE_BROWSE: OpenOptions = { mode: 'browse' };
50
50
  const MODE_UPLOAD: OpenOptions = { mode: 'upload' };
51
51
 
52
52
  type SvgMediaControlProps = {
53
- showIconLibrary?: boolean;
54
53
  label?: string;
55
54
  };
56
55
 
57
- export const SvgMediaControl = createControl( ( { showIconLibrary = false, label }: SvgMediaControlProps ) => {
56
+ export const SvgMediaControl = createControl( ( { label }: SvgMediaControlProps ) => {
58
57
  const groupLabel = label ?? __( 'SVG', 'elementor' );
59
58
  const { value: svgValue, setValue: setSvgValue, placeholder: svgPlaceholder } = useBoundProp( svgSrcPropTypeUtil );
60
59
  const { value: iconValue, setValue: setIconValue, placeholder: iconPlaceholder } = useBoundProp( iconPropTypeUtil );
@@ -79,10 +78,9 @@ export const SvgMediaControl = createControl( ( { showIconLibrary = false, label
79
78
  const buttonGroupRef = useRef< HTMLDivElement >( null );
80
79
  const [ iconLibraryAnchor, setIconLibraryAnchor ] = useState< IconLibraryAnchor | null >( null );
81
80
  const { isAdmin } = useCurrentUserCapabilities();
82
- const selectedIconClass =
83
- showIconLibrary && typeof previewIconValue?.value?.value === 'string' ? previewIconValue.value.value : null;
81
+ const selectedIconClass = typeof previewIconValue?.value?.value === 'string' ? previewIconValue.value.value : null;
84
82
  const selectedIconLibrary =
85
- showIconLibrary && typeof previewIconValue?.library?.value === 'string' ? previewIconValue.library.value : null;
83
+ typeof previewIconValue?.library?.value === 'string' ? previewIconValue.library.value : null;
86
84
 
87
85
  const { open } = useWpMediaFrame( {
88
86
  mediaTypes: [ 'svg' ],
@@ -168,7 +166,7 @@ export const SvgMediaControl = createControl( ( { showIconLibrary = false, label
168
166
  return (
169
167
  <Stack gap={ 1 } aria-label={ __( 'SVG control', 'elementor' ) }>
170
168
  <EnableUnfilteredModal open={ unfilteredModalOpenState } onClose={ handleCloseUnfilteredModal } />
171
- { showIconLibrary && iconLibraryAnchor ? (
169
+ { iconLibraryAnchor ? (
172
170
  <Popover
173
171
  disableScrollLock
174
172
  open={ iconLibraryPopoverState.isOpen }
@@ -222,7 +220,6 @@ export const SvgMediaControl = createControl( ( { showIconLibrary = false, label
222
220
  <SvgMediaOverlay
223
221
  label={ groupLabel }
224
222
  isAdmin={ isAdmin }
225
- showIconLibrary={ showIconLibrary }
226
223
  buttonGroupRef={ buttonGroupRef }
227
224
  onSelectSvg={ handleSelectSvg }
228
225
  onUpload={ handleUpload }
@@ -15,7 +15,6 @@ const ICON_LIBRARY_PADDING = 0.625;
15
15
  type SvgMediaOverlayProps = {
16
16
  label: string;
17
17
  isAdmin: boolean;
18
- showIconLibrary: boolean;
19
18
  buttonGroupRef: React.Ref< HTMLDivElement >;
20
19
  onSelectSvg: () => void;
21
20
  onUpload: () => void;
@@ -27,7 +26,6 @@ type SvgMediaOverlayProps = {
27
26
  export const SvgMediaOverlay = ( {
28
27
  label,
29
28
  isAdmin,
30
- showIconLibrary,
31
29
  buttonGroupRef,
32
30
  onSelectSvg,
33
31
  onUpload,
@@ -53,23 +51,21 @@ export const SvgMediaOverlay = ( {
53
51
  </ConditionalControlInfotip>
54
52
  }
55
53
  />
56
- { showIconLibrary ? (
57
- <Button
58
- size="tiny"
59
- color="inherit"
60
- variant="text"
61
- startIcon={ <LibraryIcon sx={ { height: '18px', width: '16px' } } /> }
62
- aria-label={ __( 'Icon library', 'elementor' ) }
63
- onClick={ onOpenIconLibrary }
64
- sx={ {
65
- height: '28px',
66
- p: ICON_LIBRARY_PADDING,
67
- '.MuiButton-icon': { ml: 0 },
68
- } }
69
- >
70
- <Typography>{ __( 'Icon library', 'elementor' ) }</Typography>
71
- </Button>
72
- ) : null }
54
+ <Button
55
+ size="tiny"
56
+ color="inherit"
57
+ variant="text"
58
+ startIcon={ <LibraryIcon sx={ { height: '18px', width: '16px' } } /> }
59
+ aria-label={ __( 'Icon library', 'elementor' ) }
60
+ onClick={ onOpenIconLibrary }
61
+ sx={ {
62
+ height: '28px',
63
+ p: ICON_LIBRARY_PADDING,
64
+ '.MuiButton-icon': { ml: 0 },
65
+ } }
66
+ >
67
+ <Typography>{ __( 'Icon library', 'elementor' ) }</Typography>
68
+ </Button>
73
69
  </Stack>
74
70
  );
75
71