@elementor/editor-components 3.35.0-452 → 3.35.0-454
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 +10 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -22
- package/src/store/store.ts +10 -16
- package/src/sync/update-archived-component-before-save.ts +3 -5
- package/src/types.ts +1 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-components",
|
|
3
3
|
"description": "Elementor editor components",
|
|
4
|
-
"version": "3.35.0-
|
|
4
|
+
"version": "3.35.0-454",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,30 +40,30 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor": "3.35.0-
|
|
44
|
-
"@elementor/editor-canvas": "3.35.0-
|
|
45
|
-
"@elementor/editor-controls": "3.35.0-
|
|
46
|
-
"@elementor/editor-documents": "3.35.0-
|
|
47
|
-
"@elementor/editor-editing-panel": "3.35.0-
|
|
48
|
-
"@elementor/editor-elements": "3.35.0-
|
|
49
|
-
"@elementor/editor-elements-panel": "3.35.0-
|
|
50
|
-
"@elementor/editor-mcp": "3.35.0-
|
|
51
|
-
"@elementor/editor-panels": "3.35.0-
|
|
52
|
-
"@elementor/editor-props": "3.35.0-
|
|
53
|
-
"@elementor/editor-styles-repository": "3.35.0-
|
|
54
|
-
"@elementor/editor-ui": "3.35.0-
|
|
55
|
-
"@elementor/editor-v1-adapters": "3.35.0-
|
|
56
|
-
"@elementor/http-client": "3.35.0-
|
|
43
|
+
"@elementor/editor": "3.35.0-454",
|
|
44
|
+
"@elementor/editor-canvas": "3.35.0-454",
|
|
45
|
+
"@elementor/editor-controls": "3.35.0-454",
|
|
46
|
+
"@elementor/editor-documents": "3.35.0-454",
|
|
47
|
+
"@elementor/editor-editing-panel": "3.35.0-454",
|
|
48
|
+
"@elementor/editor-elements": "3.35.0-454",
|
|
49
|
+
"@elementor/editor-elements-panel": "3.35.0-454",
|
|
50
|
+
"@elementor/editor-mcp": "3.35.0-454",
|
|
51
|
+
"@elementor/editor-panels": "3.35.0-454",
|
|
52
|
+
"@elementor/editor-props": "3.35.0-454",
|
|
53
|
+
"@elementor/editor-styles-repository": "3.35.0-454",
|
|
54
|
+
"@elementor/editor-ui": "3.35.0-454",
|
|
55
|
+
"@elementor/editor-v1-adapters": "3.35.0-454",
|
|
56
|
+
"@elementor/http-client": "3.35.0-454",
|
|
57
57
|
"@elementor/icons": "^1.63.0",
|
|
58
|
-
"@elementor/mixpanel": "3.35.0-
|
|
59
|
-
"@elementor/query": "3.35.0-
|
|
60
|
-
"@elementor/schema": "3.35.0-
|
|
61
|
-
"@elementor/store": "3.35.0-
|
|
58
|
+
"@elementor/mixpanel": "3.35.0-454",
|
|
59
|
+
"@elementor/query": "3.35.0-454",
|
|
60
|
+
"@elementor/schema": "3.35.0-454",
|
|
61
|
+
"@elementor/store": "3.35.0-454",
|
|
62
62
|
"@elementor/ui": "1.36.17",
|
|
63
|
-
"@elementor/utils": "3.35.0-
|
|
63
|
+
"@elementor/utils": "3.35.0-454",
|
|
64
64
|
"@wordpress/i18n": "^5.13.0",
|
|
65
|
-
"@elementor/editor-notifications": "3.35.0-
|
|
66
|
-
"@elementor/editor-current-user": "3.35.0-
|
|
65
|
+
"@elementor/editor-notifications": "3.35.0-454",
|
|
66
|
+
"@elementor/editor-current-user": "3.35.0-454"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"react": "^18.3.1",
|
package/src/store/store.ts
CHANGED
|
@@ -27,7 +27,7 @@ type ComponentsState = {
|
|
|
27
27
|
loadStatus: Status;
|
|
28
28
|
styles: StylesDefinition;
|
|
29
29
|
createdThisSession: Component[ 'uid' ][];
|
|
30
|
-
|
|
30
|
+
archivedThisSession: ComponentId[];
|
|
31
31
|
path: ComponentsPathItem[];
|
|
32
32
|
currentComponentId: V1Document[ 'id' ] | null;
|
|
33
33
|
updatedComponentNames: Record< number, string >;
|
|
@@ -47,7 +47,7 @@ export const initialState: ComponentsState = {
|
|
|
47
47
|
loadStatus: 'idle',
|
|
48
48
|
styles: {},
|
|
49
49
|
createdThisSession: [],
|
|
50
|
-
|
|
50
|
+
archivedThisSession: [],
|
|
51
51
|
path: [],
|
|
52
52
|
currentComponentId: null,
|
|
53
53
|
updatedComponentNames: {},
|
|
@@ -87,14 +87,12 @@ export const slice = createSlice( {
|
|
|
87
87
|
state.createdThisSession.push( payload );
|
|
88
88
|
},
|
|
89
89
|
archive: ( state, { payload }: PayloadAction< number > ) => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return ! isArchived;
|
|
97
|
-
} );
|
|
90
|
+
const component = state.data.find( ( comp ) => comp.id === payload );
|
|
91
|
+
|
|
92
|
+
if ( component ) {
|
|
93
|
+
component.isArchived = true;
|
|
94
|
+
state.archivedThisSession.push( payload );
|
|
95
|
+
}
|
|
98
96
|
},
|
|
99
97
|
setCurrentComponentId: ( state, { payload }: PayloadAction< V1Document[ 'id' ] | null > ) => {
|
|
100
98
|
state.currentComponentId = payload;
|
|
@@ -144,7 +142,7 @@ export const slice = createSlice( {
|
|
|
144
142
|
} );
|
|
145
143
|
|
|
146
144
|
const selectData = ( state: ComponentsSlice ) => state[ SLICE_NAME ].data;
|
|
147
|
-
const
|
|
145
|
+
export const selectArchivedThisSession = ( state: ComponentsSlice ) => state[ SLICE_NAME ].archivedThisSession;
|
|
148
146
|
const selectLoadStatus = ( state: ComponentsSlice ) => state[ SLICE_NAME ].loadStatus;
|
|
149
147
|
const selectStylesDefinitions = ( state: ComponentsSlice ) => state[ SLICE_NAME ].styles ?? {};
|
|
150
148
|
const selectUnpublishedData = ( state: ComponentsSlice ) => state[ SLICE_NAME ].unpublishedData;
|
|
@@ -170,7 +168,7 @@ export const selectComponents = createSelector(
|
|
|
170
168
|
name: item.name,
|
|
171
169
|
overridableProps: item.overridableProps,
|
|
172
170
|
} ) ),
|
|
173
|
-
...data,
|
|
171
|
+
...data.filter( ( component ) => ! component.isArchived ),
|
|
174
172
|
]
|
|
175
173
|
);
|
|
176
174
|
export const selectUnpublishedComponents = createSelector(
|
|
@@ -226,10 +224,6 @@ export const useCurrentComponentId = () => {
|
|
|
226
224
|
return useSelector( selectCurrentComponentId );
|
|
227
225
|
};
|
|
228
226
|
|
|
229
|
-
export const selectArchivedComponents = createSelector(
|
|
230
|
-
selectArchivedData,
|
|
231
|
-
( archivedData: PublishedComponent[] ) => archivedData
|
|
232
|
-
);
|
|
233
227
|
export const selectUpdatedComponentNames = createSelector(
|
|
234
228
|
( state: ComponentsSlice ) => state[ SLICE_NAME ].updatedComponentNames,
|
|
235
229
|
( updatedComponentNames ) =>
|
|
@@ -2,7 +2,7 @@ import { type NotificationData, notify } from '@elementor/editor-notifications';
|
|
|
2
2
|
import { __getState as getState } from '@elementor/store';
|
|
3
3
|
|
|
4
4
|
import { apiClient } from '../api';
|
|
5
|
-
import {
|
|
5
|
+
import { selectArchivedThisSession } from '../store/store';
|
|
6
6
|
|
|
7
7
|
const failedNotification = ( message: string ): NotificationData => ( {
|
|
8
8
|
type: 'error',
|
|
@@ -12,15 +12,13 @@ const failedNotification = ( message: string ): NotificationData => ( {
|
|
|
12
12
|
|
|
13
13
|
export const updateArchivedComponentBeforeSave = async () => {
|
|
14
14
|
try {
|
|
15
|
-
const archivedComponents =
|
|
15
|
+
const archivedComponents = selectArchivedThisSession( getState() );
|
|
16
16
|
|
|
17
17
|
if ( ! archivedComponents.length ) {
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const result = await apiClient.updateArchivedComponents(
|
|
22
|
-
archivedComponents.map( ( component ) => component.id )
|
|
23
|
-
);
|
|
21
|
+
const result = await apiClient.updateArchivedComponents( archivedComponents );
|
|
24
22
|
|
|
25
23
|
const failedIds = result.failedIds.join( ', ' );
|
|
26
24
|
|