@elementor/editor-components 4.0.2 → 4.0.4
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 +13 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +23 -23
- package/src/store/components-styles-provider.ts +3 -1
- package/src/store/store.ts +14 -1
package/dist/index.js
CHANGED
|
@@ -358,7 +358,16 @@ var selectUnpublishedComponents = (0, import_store3.__createSelector)(
|
|
|
358
358
|
var selectLoadIsPending = (0, import_store3.__createSelector)(selectLoadStatus, (status) => status === "pending");
|
|
359
359
|
var selectLoadIsError = (0, import_store3.__createSelector)(selectLoadStatus, (status) => status === "error");
|
|
360
360
|
var selectStyles = (state) => state[SLICE_NAME].styles ?? {};
|
|
361
|
-
var selectFlatStyles = (0, import_store3.__createSelector)(
|
|
361
|
+
var selectFlatStyles = (0, import_store3.__createSelector)(
|
|
362
|
+
selectStylesDefinitions,
|
|
363
|
+
(_state, excludeComponentId = null) => excludeComponentId,
|
|
364
|
+
(data, excludeComponentId) => {
|
|
365
|
+
if (excludeComponentId === null) {
|
|
366
|
+
return Object.values(data).flat();
|
|
367
|
+
}
|
|
368
|
+
return Object.entries(data).filter(([id]) => id !== String(excludeComponentId)).map(([, styles]) => styles).flat();
|
|
369
|
+
}
|
|
370
|
+
);
|
|
362
371
|
var selectCreatedThisSession = (0, import_store3.__createSelector)(
|
|
363
372
|
getCreatedThisSession,
|
|
364
373
|
(createdThisSession) => createdThisSession
|
|
@@ -3059,6 +3068,7 @@ function removeComponentStyles(id) {
|
|
|
3059
3068
|
}
|
|
3060
3069
|
|
|
3061
3070
|
// src/store/components-styles-provider.ts
|
|
3071
|
+
var import_editor_elements10 = require("@elementor/editor-elements");
|
|
3062
3072
|
var import_editor_styles_repository = require("@elementor/editor-styles-repository");
|
|
3063
3073
|
var import_store34 = require("@elementor/store");
|
|
3064
3074
|
var componentsStylesProvider = (0, import_editor_styles_repository.createStylesProvider)({
|
|
@@ -3072,7 +3082,8 @@ var componentsStylesProvider = (0, import_editor_styles_repository.createStylesP
|
|
|
3072
3082
|
),
|
|
3073
3083
|
actions: {
|
|
3074
3084
|
all: () => {
|
|
3075
|
-
|
|
3085
|
+
const currentDocumentId = (0, import_editor_elements10.getCurrentDocumentId)();
|
|
3086
|
+
return selectFlatStyles((0, import_store34.__getState)(), currentDocumentId);
|
|
3076
3087
|
},
|
|
3077
3088
|
get: (id) => {
|
|
3078
3089
|
return selectFlatStyles((0, import_store34.__getState)()).find((style) => style.id === id) ?? null;
|