@elementor/editor-controls 3.33.0-283 → 3.33.0-285

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": "3.33.0-283",
4
+ "version": "3.33.0-285",
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": "3.33.0-283",
44
- "@elementor/editor-elements": "3.33.0-283",
45
- "@elementor/editor-props": "3.33.0-283",
46
- "@elementor/editor-responsive": "3.33.0-283",
47
- "@elementor/editor-ui": "3.33.0-283",
48
- "@elementor/editor-v1-adapters": "3.33.0-283",
49
- "@elementor/env": "3.33.0-283",
50
- "@elementor/http-client": "3.33.0-283",
43
+ "@elementor/editor-current-user": "3.33.0-285",
44
+ "@elementor/editor-elements": "3.33.0-285",
45
+ "@elementor/editor-props": "3.33.0-285",
46
+ "@elementor/editor-responsive": "3.33.0-285",
47
+ "@elementor/editor-ui": "3.33.0-285",
48
+ "@elementor/editor-v1-adapters": "3.33.0-285",
49
+ "@elementor/env": "3.33.0-285",
50
+ "@elementor/http-client": "3.33.0-285",
51
51
  "@elementor/icons": "^1.61.0",
52
- "@elementor/locations": "3.33.0-283",
53
- "@elementor/mixpanel": "3.33.0-283",
54
- "@elementor/query": "3.33.0-283",
55
- "@elementor/session": "3.33.0-283",
52
+ "@elementor/locations": "3.33.0-285",
53
+ "@elementor/mixpanel": "3.33.0-285",
54
+ "@elementor/query": "3.33.0-285",
55
+ "@elementor/session": "3.33.0-285",
56
56
  "@elementor/ui": "1.36.17",
57
- "@elementor/utils": "3.33.0-283",
58
- "@elementor/wp-media": "3.33.0-283",
57
+ "@elementor/utils": "3.33.0-285",
58
+ "@elementor/wp-media": "3.33.0-285",
59
59
  "@wordpress/i18n": "^5.13.0",
60
60
  "@monaco-editor/react": "^4.7.0",
61
61
  "dayjs": "^1.11.18",
@@ -80,8 +80,7 @@ type Props< TValue > = {
80
80
  onChange: ( value: ExclusiveValue< TValue > ) => void;
81
81
  }
82
82
  );
83
-
84
- export const ControlToggleButtonGroup = < TValue, >( {
83
+ export const ToggleButtonGroupUi = < TValue, >( {
85
84
  justify = 'end',
86
85
  size = 'tiny',
87
86
  value,
@@ -148,55 +147,61 @@ export const ControlToggleButtonGroup = < TValue, >( {
148
147
  const placeholderArray = getPlaceholderArray( placeholder );
149
148
 
150
149
  return (
151
- <ControlActions>
152
- <StyledToggleButtonGroup
153
- justify={ justify }
154
- value={ value }
155
- onChange={ handleChange }
156
- exclusive={ exclusive }
157
- disabled={ disabled }
158
- sx={ {
159
- direction: isRtl ? 'rtl /* @noflip */' : 'ltr /* @noflip */',
160
- display: 'grid',
161
- gridTemplateColumns: getGridTemplateColumns,
162
- width: `100%`,
163
- } }
164
- >
165
- { fixedItems.map( ( { label, value: buttonValue, renderContent: Content, showTooltip } ) => {
166
- const isPlaceholder =
167
- placeholderArray.length > 0 &&
168
- placeholderArray.includes( buttonValue as string ) &&
169
- ( shouldShowExclusivePlaceholder || shouldShowNonExclusivePlaceholder );
170
-
171
- return (
172
- <ConditionalTooltip
173
- key={ buttonValue as string }
174
- label={ label }
175
- showTooltip={ showTooltip || false }
150
+ <StyledToggleButtonGroup
151
+ justify={ justify }
152
+ value={ value }
153
+ onChange={ handleChange }
154
+ exclusive={ exclusive }
155
+ disabled={ disabled }
156
+ sx={ {
157
+ direction: isRtl ? 'rtl /* @noflip */' : 'ltr /* @noflip */',
158
+ display: 'grid',
159
+ gridTemplateColumns: getGridTemplateColumns,
160
+ width: `100%`,
161
+ } }
162
+ >
163
+ { fixedItems.map( ( { label, value: buttonValue, renderContent: Content, showTooltip } ) => {
164
+ const isPlaceholder =
165
+ placeholderArray.length > 0 &&
166
+ placeholderArray.includes( buttonValue as string ) &&
167
+ ( shouldShowExclusivePlaceholder || shouldShowNonExclusivePlaceholder );
168
+
169
+ return (
170
+ <ConditionalTooltip
171
+ key={ buttonValue as string }
172
+ label={ label }
173
+ showTooltip={ showTooltip || false }
174
+ >
175
+ <StyledToggleButton
176
+ value={ buttonValue }
177
+ aria-label={ label }
178
+ size={ size }
179
+ fullWidth={ fullWidth }
180
+ isPlaceholder={ isPlaceholder }
176
181
  >
177
- <StyledToggleButton
178
- value={ buttonValue }
179
- aria-label={ label }
180
- size={ size }
181
- fullWidth={ fullWidth }
182
- isPlaceholder={ isPlaceholder }
183
- >
184
- <Content size={ size } />
185
- </StyledToggleButton>
186
- </ConditionalTooltip>
187
- );
188
- } ) }
189
-
190
- { menuItems.length && exclusive && (
191
- <SplitButtonGroup
192
- size={ size }
193
- value={ ( value as ExclusiveValue< TValue > ) || null }
194
- onChange={ onChange as ( v: ExclusiveValue< TValue > ) => void }
195
- items={ menuItems }
196
- fullWidth={ fullWidth }
197
- />
198
- ) }
199
- </StyledToggleButtonGroup>
182
+ <Content size={ size } />
183
+ </StyledToggleButton>
184
+ </ConditionalTooltip>
185
+ );
186
+ } ) }
187
+
188
+ { menuItems.length && exclusive && (
189
+ <SplitButtonGroup
190
+ size={ size }
191
+ value={ ( value as ExclusiveValue< TValue > ) || null }
192
+ onChange={ onChange as ( v: ExclusiveValue< TValue > ) => void }
193
+ items={ menuItems }
194
+ fullWidth={ fullWidth }
195
+ />
196
+ ) }
197
+ </StyledToggleButtonGroup>
198
+ );
199
+ };
200
+
201
+ export const ControlToggleButtonGroup = < TValue, >( props: Props< TValue > ) => {
202
+ return (
203
+ <ControlActions>
204
+ <ToggleButtonGroupUi { ...props } />
200
205
  </ControlActions>
201
206
  );
202
207
  };
package/src/index.ts CHANGED
@@ -40,6 +40,7 @@ export { InlineEditor } from './components/inline-editor';
40
40
  // components
41
41
  export { ControlFormLabel } from './components/control-form-label';
42
42
  export { ControlToggleButtonGroup } from './components/control-toggle-button-group';
43
+ export { ToggleButtonGroupUi } from './components/control-toggle-button-group';
43
44
  export { ClearIconButton } from './components/icon-buttons/clear-icon-button';
44
45
  export {
45
46
  Repeater,