@elementor/editor-components 3.35.0-451 → 3.35.0-453
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/dist/index.js
CHANGED
|
@@ -121,7 +121,7 @@ var initialState = {
|
|
|
121
121
|
loadStatus: "idle",
|
|
122
122
|
styles: {},
|
|
123
123
|
createdThisSession: [],
|
|
124
|
-
|
|
124
|
+
archivedThisSession: [],
|
|
125
125
|
path: [],
|
|
126
126
|
currentComponentId: null,
|
|
127
127
|
updatedComponentNames: {}
|
|
@@ -158,13 +158,11 @@ var slice = (0, import_store2.__createSlice)({
|
|
|
158
158
|
state.createdThisSession.push(payload);
|
|
159
159
|
},
|
|
160
160
|
archive: (state, { payload }) => {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
return !isArchived;
|
|
167
|
-
});
|
|
161
|
+
const component = state.data.find((comp) => comp.id === payload);
|
|
162
|
+
if (component) {
|
|
163
|
+
component.isArchived = true;
|
|
164
|
+
state.archivedThisSession.push(payload);
|
|
165
|
+
}
|
|
168
166
|
},
|
|
169
167
|
setCurrentComponentId: (state, { payload }) => {
|
|
170
168
|
state.currentComponentId = payload;
|
|
@@ -207,7 +205,7 @@ var slice = (0, import_store2.__createSlice)({
|
|
|
207
205
|
}
|
|
208
206
|
});
|
|
209
207
|
var selectData = (state) => state[SLICE_NAME].data;
|
|
210
|
-
var
|
|
208
|
+
var selectArchivedThisSession = (state) => state[SLICE_NAME].archivedThisSession;
|
|
211
209
|
var selectLoadStatus = (state) => state[SLICE_NAME].loadStatus;
|
|
212
210
|
var selectStylesDefinitions = (state) => state[SLICE_NAME].styles ?? {};
|
|
213
211
|
var selectUnpublishedData = (state) => state[SLICE_NAME].unpublishedData;
|
|
@@ -228,7 +226,7 @@ var selectComponents = (0, import_store2.__createSelector)(
|
|
|
228
226
|
name: item.name,
|
|
229
227
|
overridableProps: item.overridableProps
|
|
230
228
|
})),
|
|
231
|
-
...data
|
|
229
|
+
...data.filter((component) => !component.isArchived)
|
|
232
230
|
]
|
|
233
231
|
);
|
|
234
232
|
var selectUnpublishedComponents = (0, import_store2.__createSelector)(
|
|
@@ -278,10 +276,6 @@ var selectCurrentComponentId = (0, import_store2.__createSelector)(
|
|
|
278
276
|
var useCurrentComponentId = () => {
|
|
279
277
|
return (0, import_store2.__useSelector)(selectCurrentComponentId);
|
|
280
278
|
};
|
|
281
|
-
var selectArchivedComponents = (0, import_store2.__createSelector)(
|
|
282
|
-
selectArchivedData,
|
|
283
|
-
(archivedData) => archivedData
|
|
284
|
-
);
|
|
285
279
|
var selectUpdatedComponentNames = (0, import_store2.__createSelector)(
|
|
286
280
|
(state) => state[SLICE_NAME].updatedComponentNames,
|
|
287
281
|
(updatedComponentNames) => Object.entries(updatedComponentNames).map(([componentId, title]) => ({
|
|
@@ -4991,13 +4985,11 @@ var failedNotification = (message) => ({
|
|
|
4991
4985
|
});
|
|
4992
4986
|
var updateArchivedComponentBeforeSave = async () => {
|
|
4993
4987
|
try {
|
|
4994
|
-
const archivedComponents =
|
|
4988
|
+
const archivedComponents = selectArchivedThisSession((0, import_store76.__getState)());
|
|
4995
4989
|
if (!archivedComponents.length) {
|
|
4996
4990
|
return;
|
|
4997
4991
|
}
|
|
4998
|
-
const result = await apiClient.updateArchivedComponents(
|
|
4999
|
-
archivedComponents.map((component) => component.id)
|
|
5000
|
-
);
|
|
4992
|
+
const result = await apiClient.updateArchivedComponents(archivedComponents);
|
|
5001
4993
|
const failedIds = result.failedIds.join(", ");
|
|
5002
4994
|
if (failedIds) {
|
|
5003
4995
|
(0, import_editor_notifications5.notify)(failedNotification(failedIds));
|