@elementor/editor-controls 0.29.0 → 0.30.0
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/CHANGELOG.md +12 -0
- package/dist/index.d.mts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
- package/src/components/repeater.tsx +11 -2
- package/src/controls/box-shadow-repeater-control.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/locations.ts +11 -0
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": "0.
|
|
4
|
+
"version": "0.30.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"@elementor/env": "0.3.5",
|
|
48
48
|
"@elementor/http-client": "0.3.0",
|
|
49
49
|
"@elementor/icons": "1.40.1",
|
|
50
|
+
"@elementor/locations": "0.8.0",
|
|
50
51
|
"@elementor/query": "0.2.4",
|
|
51
52
|
"@elementor/session": "0.1.0",
|
|
52
53
|
"@elementor/ui": "1.34.2",
|
|
@@ -19,6 +19,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
19
19
|
|
|
20
20
|
import { ControlAdornments } from '../control-adornments/control-adornments';
|
|
21
21
|
import { useSyncExternalState } from '../hooks/use-sync-external-state';
|
|
22
|
+
import { RepeaterItemIconSlot, RepeaterItemLabelSlot } from '../locations';
|
|
22
23
|
import { SectionContent } from './section-content';
|
|
23
24
|
import { SortableItem, SortableProvider } from './sortable';
|
|
24
25
|
|
|
@@ -175,8 +176,16 @@ export const Repeater = < T, >( {
|
|
|
175
176
|
<SortableItem id={ key } key={ `sortable-${ key }` }>
|
|
176
177
|
<RepeaterItem
|
|
177
178
|
disabled={ value?.disabled }
|
|
178
|
-
label={
|
|
179
|
-
|
|
179
|
+
label={
|
|
180
|
+
<RepeaterItemLabelSlot value={ value }>
|
|
181
|
+
<itemSettings.Label value={ value } />
|
|
182
|
+
</RepeaterItemLabelSlot>
|
|
183
|
+
}
|
|
184
|
+
startIcon={
|
|
185
|
+
<RepeaterItemIconSlot value={ value }>
|
|
186
|
+
<itemSettings.Icon value={ value } />
|
|
187
|
+
</RepeaterItemIconSlot>
|
|
188
|
+
}
|
|
180
189
|
removeItem={ () => removeRepeaterItem( index ) }
|
|
181
190
|
duplicateItem={ () => duplicateRepeaterItem( index ) }
|
|
182
191
|
toggleDisableItem={ () => toggleDisableRepeaterItem( index ) }
|
|
@@ -34,7 +34,7 @@ export const BoxShadowRepeaterControl = createControl( () => {
|
|
|
34
34
|
} );
|
|
35
35
|
|
|
36
36
|
const ItemIcon = ( { value }: { value: ShadowPropValue } ) => (
|
|
37
|
-
<UnstableColorIndicator size="inherit" component="span" value={ value.value.color
|
|
37
|
+
<UnstableColorIndicator size="inherit" component="span" value={ value.value.color?.value } />
|
|
38
38
|
);
|
|
39
39
|
|
|
40
40
|
const ItemContent = ( { anchorEl, bind }: { anchorEl: HTMLElement | null; bind: PropKey } ) => {
|
package/src/index.ts
CHANGED
|
@@ -40,5 +40,7 @@ export { useBoundProp, PropProvider, PropKeyProvider } from './bound-prop-contex
|
|
|
40
40
|
export { ControlAdornmentsProvider } from './control-adornments/control-adornments-context';
|
|
41
41
|
export { ControlAdornments } from './control-adornments/control-adornments';
|
|
42
42
|
|
|
43
|
+
export { injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel } from './locations';
|
|
44
|
+
|
|
43
45
|
// hooks
|
|
44
46
|
export { useSyncExternalState } from './hooks/use-sync-external-state';
|
package/src/locations.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type PropValue } from '@elementor/editor-props';
|
|
2
|
+
import { createReplaceableLocation } from '@elementor/locations';
|
|
3
|
+
|
|
4
|
+
// Repeaters
|
|
5
|
+
export const { Slot: RepeaterItemIconSlot, inject: injectIntoRepeaterItemIcon } = createReplaceableLocation< {
|
|
6
|
+
value: PropValue;
|
|
7
|
+
} >();
|
|
8
|
+
|
|
9
|
+
export const { Slot: RepeaterItemLabelSlot, inject: injectIntoRepeaterItemLabel } = createReplaceableLocation< {
|
|
10
|
+
value: PropValue;
|
|
11
|
+
} >();
|