@elementor/editor-components 4.1.0-768 → 4.1.0-769
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.d.mts +43 -39
- package/dist/index.d.ts +43 -39
- package/dist/index.js +49 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +23 -23
- package/src/init.ts +2 -2
- package/src/store/actions/remove-component-styles.ts +9 -0
- package/src/store/dispatchers.ts +3 -0
- package/src/store/extensible-slice.ts +5 -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": "4.1.0-
|
|
4
|
+
"version": "4.1.0-769",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,31 +40,31 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor": "4.1.0-
|
|
44
|
-
"@elementor/editor-canvas": "4.1.0-
|
|
45
|
-
"@elementor/editor-controls": "4.1.0-
|
|
46
|
-
"@elementor/editor-documents": "4.1.0-
|
|
47
|
-
"@elementor/editor-editing-panel": "4.1.0-
|
|
48
|
-
"@elementor/editor-elements": "4.1.0-
|
|
49
|
-
"@elementor/editor-elements-panel": "4.1.0-
|
|
50
|
-
"@elementor/editor-mcp": "4.1.0-
|
|
51
|
-
"@elementor/editor-templates": "4.1.0-
|
|
52
|
-
"@elementor/editor-panels": "4.1.0-
|
|
53
|
-
"@elementor/editor-props": "4.1.0-
|
|
54
|
-
"@elementor/editor-styles-repository": "4.1.0-
|
|
55
|
-
"@elementor/editor-ui": "4.1.0-
|
|
56
|
-
"@elementor/editor-v1-adapters": "4.1.0-
|
|
57
|
-
"@elementor/http-client": "4.1.0-
|
|
43
|
+
"@elementor/editor": "4.1.0-769",
|
|
44
|
+
"@elementor/editor-canvas": "4.1.0-769",
|
|
45
|
+
"@elementor/editor-controls": "4.1.0-769",
|
|
46
|
+
"@elementor/editor-documents": "4.1.0-769",
|
|
47
|
+
"@elementor/editor-editing-panel": "4.1.0-769",
|
|
48
|
+
"@elementor/editor-elements": "4.1.0-769",
|
|
49
|
+
"@elementor/editor-elements-panel": "4.1.0-769",
|
|
50
|
+
"@elementor/editor-mcp": "4.1.0-769",
|
|
51
|
+
"@elementor/editor-templates": "4.1.0-769",
|
|
52
|
+
"@elementor/editor-panels": "4.1.0-769",
|
|
53
|
+
"@elementor/editor-props": "4.1.0-769",
|
|
54
|
+
"@elementor/editor-styles-repository": "4.1.0-769",
|
|
55
|
+
"@elementor/editor-ui": "4.1.0-769",
|
|
56
|
+
"@elementor/editor-v1-adapters": "4.1.0-769",
|
|
57
|
+
"@elementor/http-client": "4.1.0-769",
|
|
58
58
|
"@elementor/icons": "^1.68.0",
|
|
59
|
-
"@elementor/events": "4.1.0-
|
|
60
|
-
"@elementor/query": "4.1.0-
|
|
61
|
-
"@elementor/schema": "4.1.0-
|
|
62
|
-
"@elementor/store": "4.1.0-
|
|
59
|
+
"@elementor/events": "4.1.0-769",
|
|
60
|
+
"@elementor/query": "4.1.0-769",
|
|
61
|
+
"@elementor/schema": "4.1.0-769",
|
|
62
|
+
"@elementor/store": "4.1.0-769",
|
|
63
63
|
"@elementor/ui": "1.37.5",
|
|
64
|
-
"@elementor/utils": "4.1.0-
|
|
64
|
+
"@elementor/utils": "4.1.0-769",
|
|
65
65
|
"@wordpress/i18n": "^5.13.0",
|
|
66
|
-
"@elementor/editor-notifications": "4.1.0-
|
|
67
|
-
"@elementor/editor-current-user": "4.1.0-
|
|
66
|
+
"@elementor/editor-notifications": "4.1.0-769",
|
|
67
|
+
"@elementor/editor-current-user": "4.1.0-769"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"react": "^18.3.1",
|
package/src/init.ts
CHANGED
|
@@ -13,7 +13,6 @@ import { registerDataHook } from '@elementor/editor-v1-adapters';
|
|
|
13
13
|
import { __registerSlice as registerSlice } from '@elementor/store';
|
|
14
14
|
import { __ } from '@wordpress/i18n';
|
|
15
15
|
|
|
16
|
-
import { apiClient } from './api';
|
|
17
16
|
import { componentInstanceTransformer } from './component-instance-transformer';
|
|
18
17
|
import { componentOverridableTransformer } from './component-overridable-transformer';
|
|
19
18
|
import { componentOverrideTransformer } from './component-override-transformer';
|
|
@@ -26,6 +25,7 @@ import { COMPONENT_WIDGET_TYPE, createComponentType } from './create-component-t
|
|
|
26
25
|
import { PopulateStore } from './populate-store';
|
|
27
26
|
import { initCircularNestingPrevention } from './prevent-circular-nesting';
|
|
28
27
|
import { loadComponentsAssets } from './store/actions/load-components-assets';
|
|
28
|
+
import { removeComponentStyles } from './store/actions/remove-component-styles';
|
|
29
29
|
import { componentsStylesProvider } from './store/components-styles-provider';
|
|
30
30
|
import { slice } from './store/store';
|
|
31
31
|
import { beforeSave } from './sync/before-save';
|
|
@@ -63,7 +63,7 @@ export function init() {
|
|
|
63
63
|
const { id, config } = getV1CurrentDocument();
|
|
64
64
|
|
|
65
65
|
if ( id ) {
|
|
66
|
-
|
|
66
|
+
removeComponentStyles( id );
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
await loadComponentsAssets( ( config?.elements as V1ElementData[] ) ?? [] );
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { __dispatch as dispatch } from '@elementor/store';
|
|
2
|
+
|
|
3
|
+
import { apiClient } from '../../api';
|
|
4
|
+
import { slice } from '../store';
|
|
5
|
+
|
|
6
|
+
export function removeComponentStyles( id: number ) {
|
|
7
|
+
apiClient.invalidateComponentConfigCache( id );
|
|
8
|
+
dispatch( slice.actions.removeStyles( { id } ) );
|
|
9
|
+
}
|
package/src/store/dispatchers.ts
CHANGED
|
@@ -24,6 +24,9 @@ export const componentsActions = {
|
|
|
24
24
|
resetUnpublished() {
|
|
25
25
|
dispatch( slice.actions.resetUnpublished() );
|
|
26
26
|
},
|
|
27
|
+
removeStyles( id: ComponentId ) {
|
|
28
|
+
dispatch( slice.actions.removeStyles( { id } ) );
|
|
29
|
+
},
|
|
27
30
|
addStyles( styles: Record< string, unknown > ) {
|
|
28
31
|
dispatch( slice.actions.addStyles( styles ) );
|
|
29
32
|
},
|
|
@@ -65,6 +65,11 @@ const baseSlice = createSlice( {
|
|
|
65
65
|
resetUnpublished: ( state ) => {
|
|
66
66
|
state.unpublishedData = [];
|
|
67
67
|
},
|
|
68
|
+
removeStyles( state, { payload }: PayloadAction< { id: ComponentId } > ) {
|
|
69
|
+
const { [ payload.id ]: _, ...rest } = state.styles;
|
|
70
|
+
|
|
71
|
+
state.styles = rest;
|
|
72
|
+
},
|
|
68
73
|
addStyles: ( state, { payload } ) => {
|
|
69
74
|
state.styles = { ...state.styles, ...payload };
|
|
70
75
|
},
|