@elementor/editor-components 4.0.2 → 4.0.3

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.mjs CHANGED
@@ -278,7 +278,16 @@ var selectUnpublishedComponents = createSelector(
278
278
  var selectLoadIsPending = createSelector(selectLoadStatus, (status) => status === "pending");
279
279
  var selectLoadIsError = createSelector(selectLoadStatus, (status) => status === "error");
280
280
  var selectStyles = (state) => state[SLICE_NAME].styles ?? {};
281
- var selectFlatStyles = createSelector(selectStylesDefinitions, (data) => Object.values(data).flat());
281
+ var selectFlatStyles = createSelector(
282
+ selectStylesDefinitions,
283
+ (_state, excludeComponentId = null) => excludeComponentId,
284
+ (data, excludeComponentId) => {
285
+ if (excludeComponentId === null) {
286
+ return Object.values(data).flat();
287
+ }
288
+ return Object.entries(data).filter(([id]) => id !== String(excludeComponentId)).map(([, styles]) => styles).flat();
289
+ }
290
+ );
282
291
  var selectCreatedThisSession = createSelector(
283
292
  getCreatedThisSession,
284
293
  (createdThisSession) => createdThisSession
@@ -2996,6 +3005,7 @@ function removeComponentStyles(id) {
2996
3005
  }
2997
3006
 
2998
3007
  // src/store/components-styles-provider.ts
3008
+ import { getCurrentDocumentId } from "@elementor/editor-elements";
2999
3009
  import { createStylesProvider } from "@elementor/editor-styles-repository";
3000
3010
  import { __getState as getState10, __subscribeWithSelector as subscribeWithSelector } from "@elementor/store";
3001
3011
  var componentsStylesProvider = createStylesProvider({
@@ -3009,7 +3019,8 @@ var componentsStylesProvider = createStylesProvider({
3009
3019
  ),
3010
3020
  actions: {
3011
3021
  all: () => {
3012
- return selectFlatStyles(getState10());
3022
+ const currentDocumentId = getCurrentDocumentId();
3023
+ return selectFlatStyles(getState10(), currentDocumentId);
3013
3024
  },
3014
3025
  get: (id) => {
3015
3026
  return selectFlatStyles(getState10()).find((style) => style.id === id) ?? null;