@elementor/editor-global-classes 3.32.0-71 → 3.32.0-73
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/dist/index.js +32 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/class-manager/class-item.tsx +11 -6
- package/src/components/class-manager/global-classes-list.tsx +24 -25
- package/src/components/class-manager/sortable.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-global-classes",
|
|
3
|
-
"version": "3.32.0-
|
|
3
|
+
"version": "3.32.0-73",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -39,22 +39,22 @@
|
|
|
39
39
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@elementor/editor": "3.32.0-
|
|
43
|
-
"@elementor/editor-current-user": "3.32.0-
|
|
44
|
-
"@elementor/editor-documents": "3.32.0-
|
|
45
|
-
"@elementor/editor-editing-panel": "3.32.0-
|
|
46
|
-
"@elementor/editor-panels": "3.32.0-
|
|
47
|
-
"@elementor/editor-props": "3.32.0-
|
|
48
|
-
"@elementor/editor-styles": "3.32.0-
|
|
49
|
-
"@elementor/editor-styles-repository": "3.32.0-
|
|
50
|
-
"@elementor/editor-ui": "3.32.0-
|
|
51
|
-
"@elementor/editor-v1-adapters": "3.32.0-
|
|
52
|
-
"@elementor/http-client": "3.32.0-
|
|
42
|
+
"@elementor/editor": "3.32.0-73",
|
|
43
|
+
"@elementor/editor-current-user": "3.32.0-73",
|
|
44
|
+
"@elementor/editor-documents": "3.32.0-73",
|
|
45
|
+
"@elementor/editor-editing-panel": "3.32.0-73",
|
|
46
|
+
"@elementor/editor-panels": "3.32.0-73",
|
|
47
|
+
"@elementor/editor-props": "3.32.0-73",
|
|
48
|
+
"@elementor/editor-styles": "3.32.0-73",
|
|
49
|
+
"@elementor/editor-styles-repository": "3.32.0-73",
|
|
50
|
+
"@elementor/editor-ui": "3.32.0-73",
|
|
51
|
+
"@elementor/editor-v1-adapters": "3.32.0-73",
|
|
52
|
+
"@elementor/http-client": "3.32.0-73",
|
|
53
53
|
"@elementor/icons": "1.46.0",
|
|
54
|
-
"@elementor/query": "3.32.0-
|
|
55
|
-
"@elementor/store": "3.32.0-
|
|
54
|
+
"@elementor/query": "3.32.0-73",
|
|
55
|
+
"@elementor/store": "3.32.0-73",
|
|
56
56
|
"@elementor/ui": "1.36.8",
|
|
57
|
-
"@elementor/utils": "3.32.0-
|
|
57
|
+
"@elementor/utils": "3.32.0-73",
|
|
58
58
|
"@wordpress/i18n": "^5.13.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
import { __ } from '@wordpress/i18n';
|
|
22
22
|
|
|
23
23
|
import { CssClassUsageTrigger } from '../css-class-usage/components';
|
|
24
|
-
import { useSearchAndFilters } from '../search-and-filter/context';
|
|
25
24
|
import { useDeleteConfirmation } from './delete-confirmation-dialog';
|
|
26
25
|
import { SortableTrigger, type SortableTriggerProps } from './sortable';
|
|
27
26
|
|
|
@@ -32,13 +31,19 @@ type ClassItemProps = React.PropsWithChildren< {
|
|
|
32
31
|
selected?: boolean;
|
|
33
32
|
disabled?: boolean;
|
|
34
33
|
sortableTriggerProps: SortableTriggerProps;
|
|
34
|
+
showSortIndicator?: boolean;
|
|
35
35
|
} >;
|
|
36
36
|
|
|
37
|
-
export const ClassItem = ( {
|
|
37
|
+
export const ClassItem = ( {
|
|
38
|
+
id,
|
|
39
|
+
label,
|
|
40
|
+
renameClass,
|
|
41
|
+
selected,
|
|
42
|
+
disabled,
|
|
43
|
+
sortableTriggerProps,
|
|
44
|
+
showSortIndicator,
|
|
45
|
+
}: ClassItemProps ) => {
|
|
38
46
|
const itemRef = useRef< HTMLElement >( null );
|
|
39
|
-
const {
|
|
40
|
-
search: { inputValue },
|
|
41
|
-
} = useSearchAndFilters();
|
|
42
47
|
const {
|
|
43
48
|
ref: editableRef,
|
|
44
49
|
openEditMode,
|
|
@@ -74,7 +79,7 @@ export const ClassItem = ( { id, label, renameClass, selected, disabled, sortabl
|
|
|
74
79
|
ref={ itemRef }
|
|
75
80
|
dense
|
|
76
81
|
disableGutters
|
|
77
|
-
showSortIndicator={
|
|
82
|
+
showSortIndicator={ showSortIndicator }
|
|
78
83
|
showActions={ isSelected || isEditing }
|
|
79
84
|
shape="rounded"
|
|
80
85
|
onDoubleClick={ openEditMode }
|
|
@@ -62,31 +62,30 @@ export const GlobalClassesList = ( { disabled }: GlobalClassesListProps ) => {
|
|
|
62
62
|
<DeleteConfirmationProvider>
|
|
63
63
|
<List sx={ { display: 'flex', flexDirection: 'column', gap: 0.5 } }>
|
|
64
64
|
<SortableProvider value={ classesOrder } onChange={ reorderClasses }>
|
|
65
|
-
{ filteredCssClasses?.map( ( { id, label } ) =>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
} ) }
|
|
65
|
+
{ filteredCssClasses?.map( ( { id, label } ) => (
|
|
66
|
+
<SortableItem key={ id } id={ id }>
|
|
67
|
+
{ ( { isDragged, isDragPlaceholder, triggerProps, triggerStyle } ) => (
|
|
68
|
+
<ClassItem
|
|
69
|
+
id={ id }
|
|
70
|
+
label={ label }
|
|
71
|
+
renameClass={ ( newLabel: string ) => {
|
|
72
|
+
dispatch(
|
|
73
|
+
slice.actions.update( {
|
|
74
|
+
style: {
|
|
75
|
+
id,
|
|
76
|
+
label: newLabel,
|
|
77
|
+
},
|
|
78
|
+
} )
|
|
79
|
+
);
|
|
80
|
+
} }
|
|
81
|
+
selected={ isDragged }
|
|
82
|
+
disabled={ disabled || isDragPlaceholder }
|
|
83
|
+
sortableTriggerProps={ { ...triggerProps, style: triggerStyle } }
|
|
84
|
+
showSortIndicator={ filteredCssClasses.length > 1 }
|
|
85
|
+
/>
|
|
86
|
+
) }
|
|
87
|
+
</SortableItem>
|
|
88
|
+
) ) }
|
|
90
89
|
</SortableProvider>
|
|
91
90
|
</List>
|
|
92
91
|
</DeleteConfirmationProvider>
|
|
@@ -17,7 +17,7 @@ export const SortableProvider = < T extends string >( props: UnstableSortablePro
|
|
|
17
17
|
export type SortableTriggerProps = React.HTMLAttributes< HTMLDivElement >;
|
|
18
18
|
|
|
19
19
|
export const SortableTrigger = ( props: SortableTriggerProps ) => (
|
|
20
|
-
<StyledSortableTrigger { ...props } role="button" className="class-item-sortable-trigger">
|
|
20
|
+
<StyledSortableTrigger { ...props } role="button" className="class-item-sortable-trigger" aria-label="sort">
|
|
21
21
|
<GripVerticalIcon fontSize="tiny" />
|
|
22
22
|
</StyledSortableTrigger>
|
|
23
23
|
);
|