@elementor/editor-components 4.1.0-767 → 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/dist/index.d.ts
CHANGED
|
@@ -231,8 +231,8 @@ declare const componentInstanceOverridesPropTypeUtil: {
|
|
|
231
231
|
value: {
|
|
232
232
|
override_key: string;
|
|
233
233
|
schema_source: {
|
|
234
|
-
id: number;
|
|
235
234
|
type: "component";
|
|
235
|
+
id: number;
|
|
236
236
|
};
|
|
237
237
|
override_value?: unknown;
|
|
238
238
|
};
|
|
@@ -253,8 +253,8 @@ declare const componentInstanceOverridesPropTypeUtil: {
|
|
|
253
253
|
value: {
|
|
254
254
|
override_key: string;
|
|
255
255
|
schema_source: {
|
|
256
|
-
id: number;
|
|
257
256
|
type: "component";
|
|
257
|
+
id: number;
|
|
258
258
|
};
|
|
259
259
|
override_value?: unknown;
|
|
260
260
|
};
|
|
@@ -276,8 +276,8 @@ declare const componentInstanceOverridesPropTypeUtil: {
|
|
|
276
276
|
value: {
|
|
277
277
|
override_key: string;
|
|
278
278
|
schema_source: {
|
|
279
|
-
id: number;
|
|
280
279
|
type: "component";
|
|
280
|
+
id: number;
|
|
281
281
|
};
|
|
282
282
|
override_value?: unknown;
|
|
283
283
|
};
|
|
@@ -297,8 +297,8 @@ declare const componentInstanceOverridesPropTypeUtil: {
|
|
|
297
297
|
value: {
|
|
298
298
|
override_key: string;
|
|
299
299
|
schema_source: {
|
|
300
|
-
id: number;
|
|
301
300
|
type: "component";
|
|
301
|
+
id: number;
|
|
302
302
|
};
|
|
303
303
|
override_value?: unknown;
|
|
304
304
|
};
|
|
@@ -319,8 +319,8 @@ declare const componentInstanceOverridesPropTypeUtil: {
|
|
|
319
319
|
value: {
|
|
320
320
|
override_key: string;
|
|
321
321
|
schema_source: {
|
|
322
|
-
id: number;
|
|
323
322
|
type: "component";
|
|
323
|
+
id: number;
|
|
324
324
|
};
|
|
325
325
|
override_value?: unknown;
|
|
326
326
|
};
|
|
@@ -340,8 +340,8 @@ declare const componentInstanceOverridesPropTypeUtil: {
|
|
|
340
340
|
value: {
|
|
341
341
|
override_key: string;
|
|
342
342
|
schema_source: {
|
|
343
|
-
id: number;
|
|
344
343
|
type: "component";
|
|
344
|
+
id: number;
|
|
345
345
|
};
|
|
346
346
|
override_value?: unknown;
|
|
347
347
|
};
|
|
@@ -362,8 +362,8 @@ declare const componentInstanceOverridesPropTypeUtil: {
|
|
|
362
362
|
value: {
|
|
363
363
|
override_key: string;
|
|
364
364
|
schema_source: {
|
|
365
|
-
id: number;
|
|
366
365
|
type: "component";
|
|
366
|
+
id: number;
|
|
367
367
|
};
|
|
368
368
|
override_value?: unknown;
|
|
369
369
|
};
|
|
@@ -383,8 +383,8 @@ declare const componentInstanceOverridesPropTypeUtil: {
|
|
|
383
383
|
value: {
|
|
384
384
|
override_key: string;
|
|
385
385
|
schema_source: {
|
|
386
|
-
id: number;
|
|
387
386
|
type: "component";
|
|
387
|
+
id: number;
|
|
388
388
|
};
|
|
389
389
|
override_value?: unknown;
|
|
390
390
|
};
|
|
@@ -404,8 +404,8 @@ declare const componentInstanceOverridesPropTypeUtil: {
|
|
|
404
404
|
value: {
|
|
405
405
|
override_key: string;
|
|
406
406
|
schema_source: {
|
|
407
|
-
id: number;
|
|
408
407
|
type: "component";
|
|
408
|
+
id: number;
|
|
409
409
|
};
|
|
410
410
|
override_value?: unknown;
|
|
411
411
|
};
|
|
@@ -429,8 +429,8 @@ declare const componentInstanceOverridesPropTypeUtil: {
|
|
|
429
429
|
value: {
|
|
430
430
|
override_key: string;
|
|
431
431
|
schema_source: {
|
|
432
|
-
id: number;
|
|
433
432
|
type: "component";
|
|
433
|
+
id: number;
|
|
434
434
|
};
|
|
435
435
|
override_value?: unknown;
|
|
436
436
|
};
|
|
@@ -450,8 +450,8 @@ declare const componentInstanceOverridesPropTypeUtil: {
|
|
|
450
450
|
value: {
|
|
451
451
|
override_key: string;
|
|
452
452
|
schema_source: {
|
|
453
|
-
id: number;
|
|
454
453
|
type: "component";
|
|
454
|
+
id: number;
|
|
455
455
|
};
|
|
456
456
|
override_value?: unknown;
|
|
457
457
|
};
|
|
@@ -475,8 +475,8 @@ declare const componentInstanceOverridesPropTypeUtil: {
|
|
|
475
475
|
value: {
|
|
476
476
|
override_key: string;
|
|
477
477
|
schema_source: {
|
|
478
|
-
id: number;
|
|
479
478
|
type: "component";
|
|
479
|
+
id: number;
|
|
480
480
|
};
|
|
481
481
|
override_value?: unknown;
|
|
482
482
|
};
|
|
@@ -500,8 +500,8 @@ declare const componentInstanceOverridesPropTypeUtil: {
|
|
|
500
500
|
value: {
|
|
501
501
|
override_key: string;
|
|
502
502
|
schema_source: {
|
|
503
|
-
id: number;
|
|
504
503
|
type: "component";
|
|
504
|
+
id: number;
|
|
505
505
|
};
|
|
506
506
|
override_value?: unknown;
|
|
507
507
|
};
|
|
@@ -563,16 +563,16 @@ declare const componentInstanceOverridePropTypeUtil: {
|
|
|
563
563
|
extract: (prop: unknown) => {
|
|
564
564
|
override_key: string;
|
|
565
565
|
schema_source: {
|
|
566
|
-
id: number;
|
|
567
566
|
type: "component";
|
|
567
|
+
id: number;
|
|
568
568
|
};
|
|
569
569
|
override_value?: unknown;
|
|
570
570
|
} | null;
|
|
571
571
|
isValid: (prop: unknown) => prop is _elementor_editor_props.TransformablePropValue<"override", {
|
|
572
572
|
override_key: string;
|
|
573
573
|
schema_source: {
|
|
574
|
-
id: number;
|
|
575
574
|
type: "component";
|
|
575
|
+
id: number;
|
|
576
576
|
};
|
|
577
577
|
override_value?: unknown;
|
|
578
578
|
}>;
|
|
@@ -580,52 +580,52 @@ declare const componentInstanceOverridePropTypeUtil: {
|
|
|
580
580
|
(value: {
|
|
581
581
|
override_key: string;
|
|
582
582
|
schema_source: {
|
|
583
|
-
id: number;
|
|
584
583
|
type: "component";
|
|
584
|
+
id: number;
|
|
585
585
|
};
|
|
586
586
|
override_value?: unknown;
|
|
587
587
|
}): _elementor_editor_props.TransformablePropValue<"override", {
|
|
588
588
|
override_key: string;
|
|
589
589
|
schema_source: {
|
|
590
|
-
id: number;
|
|
591
590
|
type: "component";
|
|
591
|
+
id: number;
|
|
592
592
|
};
|
|
593
593
|
override_value?: unknown;
|
|
594
594
|
}>;
|
|
595
595
|
(value: {
|
|
596
596
|
override_key: string;
|
|
597
597
|
schema_source: {
|
|
598
|
-
id: number;
|
|
599
598
|
type: "component";
|
|
599
|
+
id: number;
|
|
600
600
|
};
|
|
601
601
|
override_value?: unknown;
|
|
602
602
|
}, createOptions?: _elementor_editor_props.CreateOptions): _elementor_editor_props.TransformablePropValue<"override", {
|
|
603
603
|
override_key: string;
|
|
604
604
|
schema_source: {
|
|
605
|
-
id: number;
|
|
606
605
|
type: "component";
|
|
606
|
+
id: number;
|
|
607
607
|
};
|
|
608
608
|
override_value?: unknown;
|
|
609
609
|
}>;
|
|
610
610
|
(value: (prev?: {
|
|
611
611
|
override_key: string;
|
|
612
612
|
schema_source: {
|
|
613
|
-
id: number;
|
|
614
613
|
type: "component";
|
|
614
|
+
id: number;
|
|
615
615
|
};
|
|
616
616
|
override_value?: unknown;
|
|
617
617
|
} | undefined) => {
|
|
618
618
|
override_key: string;
|
|
619
619
|
schema_source: {
|
|
620
|
-
id: number;
|
|
621
620
|
type: "component";
|
|
621
|
+
id: number;
|
|
622
622
|
};
|
|
623
623
|
override_value?: unknown;
|
|
624
624
|
}, createOptions: _elementor_editor_props.CreateOptions): _elementor_editor_props.TransformablePropValue<"override", {
|
|
625
625
|
override_key: string;
|
|
626
626
|
schema_source: {
|
|
627
|
-
id: number;
|
|
628
627
|
type: "component";
|
|
628
|
+
id: number;
|
|
629
629
|
};
|
|
630
630
|
override_value?: unknown;
|
|
631
631
|
}>;
|
|
@@ -635,15 +635,15 @@ declare const componentInstanceOverridePropTypeUtil: {
|
|
|
635
635
|
value: z.ZodType<{
|
|
636
636
|
override_key: string;
|
|
637
637
|
schema_source: {
|
|
638
|
-
id: number;
|
|
639
638
|
type: "component";
|
|
639
|
+
id: number;
|
|
640
640
|
};
|
|
641
641
|
override_value?: unknown;
|
|
642
642
|
}, z.ZodTypeDef, {
|
|
643
643
|
override_key: string;
|
|
644
644
|
schema_source: {
|
|
645
|
-
id: number;
|
|
646
645
|
type: "component";
|
|
646
|
+
id: number;
|
|
647
647
|
};
|
|
648
648
|
override_value?: unknown;
|
|
649
649
|
}>;
|
|
@@ -652,8 +652,8 @@ declare const componentInstanceOverridePropTypeUtil: {
|
|
|
652
652
|
value: {
|
|
653
653
|
override_key: string;
|
|
654
654
|
schema_source: {
|
|
655
|
-
id: number;
|
|
656
655
|
type: "component";
|
|
656
|
+
id: number;
|
|
657
657
|
};
|
|
658
658
|
override_value?: unknown;
|
|
659
659
|
};
|
|
@@ -663,8 +663,8 @@ declare const componentInstanceOverridePropTypeUtil: {
|
|
|
663
663
|
value: {
|
|
664
664
|
override_key: string;
|
|
665
665
|
schema_source: {
|
|
666
|
-
id: number;
|
|
667
666
|
type: "component";
|
|
667
|
+
id: number;
|
|
668
668
|
};
|
|
669
669
|
override_value?: unknown;
|
|
670
670
|
};
|
|
@@ -689,8 +689,8 @@ declare const componentInstancePropTypeUtil: {
|
|
|
689
689
|
value: {
|
|
690
690
|
override_key: string;
|
|
691
691
|
schema_source: {
|
|
692
|
-
id: number;
|
|
693
692
|
type: "component";
|
|
693
|
+
id: number;
|
|
694
694
|
};
|
|
695
695
|
override_value?: unknown;
|
|
696
696
|
};
|
|
@@ -722,8 +722,8 @@ declare const componentInstancePropTypeUtil: {
|
|
|
722
722
|
value: {
|
|
723
723
|
override_key: string;
|
|
724
724
|
schema_source: {
|
|
725
|
-
id: number;
|
|
726
725
|
type: "component";
|
|
726
|
+
id: number;
|
|
727
727
|
};
|
|
728
728
|
override_value?: unknown;
|
|
729
729
|
};
|
|
@@ -756,8 +756,8 @@ declare const componentInstancePropTypeUtil: {
|
|
|
756
756
|
value: {
|
|
757
757
|
override_key: string;
|
|
758
758
|
schema_source: {
|
|
759
|
-
id: number;
|
|
760
759
|
type: "component";
|
|
760
|
+
id: number;
|
|
761
761
|
};
|
|
762
762
|
override_value?: unknown;
|
|
763
763
|
};
|
|
@@ -788,8 +788,8 @@ declare const componentInstancePropTypeUtil: {
|
|
|
788
788
|
value: {
|
|
789
789
|
override_key: string;
|
|
790
790
|
schema_source: {
|
|
791
|
-
id: number;
|
|
792
791
|
type: "component";
|
|
792
|
+
id: number;
|
|
793
793
|
};
|
|
794
794
|
override_value?: unknown;
|
|
795
795
|
};
|
|
@@ -821,8 +821,8 @@ declare const componentInstancePropTypeUtil: {
|
|
|
821
821
|
value: {
|
|
822
822
|
override_key: string;
|
|
823
823
|
schema_source: {
|
|
824
|
-
id: number;
|
|
825
824
|
type: "component";
|
|
825
|
+
id: number;
|
|
826
826
|
};
|
|
827
827
|
override_value?: unknown;
|
|
828
828
|
};
|
|
@@ -853,8 +853,8 @@ declare const componentInstancePropTypeUtil: {
|
|
|
853
853
|
value: {
|
|
854
854
|
override_key: string;
|
|
855
855
|
schema_source: {
|
|
856
|
-
id: number;
|
|
857
856
|
type: "component";
|
|
857
|
+
id: number;
|
|
858
858
|
};
|
|
859
859
|
override_value?: unknown;
|
|
860
860
|
};
|
|
@@ -886,8 +886,8 @@ declare const componentInstancePropTypeUtil: {
|
|
|
886
886
|
value: {
|
|
887
887
|
override_key: string;
|
|
888
888
|
schema_source: {
|
|
889
|
-
id: number;
|
|
890
889
|
type: "component";
|
|
890
|
+
id: number;
|
|
891
891
|
};
|
|
892
892
|
override_value?: unknown;
|
|
893
893
|
};
|
|
@@ -918,8 +918,8 @@ declare const componentInstancePropTypeUtil: {
|
|
|
918
918
|
value: {
|
|
919
919
|
override_key: string;
|
|
920
920
|
schema_source: {
|
|
921
|
-
id: number;
|
|
922
921
|
type: "component";
|
|
922
|
+
id: number;
|
|
923
923
|
};
|
|
924
924
|
override_value?: unknown;
|
|
925
925
|
};
|
|
@@ -950,8 +950,8 @@ declare const componentInstancePropTypeUtil: {
|
|
|
950
950
|
value: {
|
|
951
951
|
override_key: string;
|
|
952
952
|
schema_source: {
|
|
953
|
-
id: number;
|
|
954
953
|
type: "component";
|
|
954
|
+
id: number;
|
|
955
955
|
};
|
|
956
956
|
override_value?: unknown;
|
|
957
957
|
};
|
|
@@ -986,8 +986,8 @@ declare const componentInstancePropTypeUtil: {
|
|
|
986
986
|
value: {
|
|
987
987
|
override_key: string;
|
|
988
988
|
schema_source: {
|
|
989
|
-
id: number;
|
|
990
989
|
type: "component";
|
|
990
|
+
id: number;
|
|
991
991
|
};
|
|
992
992
|
override_value?: unknown;
|
|
993
993
|
};
|
|
@@ -1018,8 +1018,8 @@ declare const componentInstancePropTypeUtil: {
|
|
|
1018
1018
|
value: {
|
|
1019
1019
|
override_key: string;
|
|
1020
1020
|
schema_source: {
|
|
1021
|
-
id: number;
|
|
1022
1021
|
type: "component";
|
|
1022
|
+
id: number;
|
|
1023
1023
|
};
|
|
1024
1024
|
override_value?: unknown;
|
|
1025
1025
|
};
|
|
@@ -1053,8 +1053,8 @@ declare const componentInstancePropTypeUtil: {
|
|
|
1053
1053
|
value: {
|
|
1054
1054
|
override_key: string;
|
|
1055
1055
|
schema_source: {
|
|
1056
|
-
id: number;
|
|
1057
1056
|
type: "component";
|
|
1057
|
+
id: number;
|
|
1058
1058
|
};
|
|
1059
1059
|
override_value?: unknown;
|
|
1060
1060
|
};
|
|
@@ -1089,8 +1089,8 @@ declare const componentInstancePropTypeUtil: {
|
|
|
1089
1089
|
value: {
|
|
1090
1090
|
override_key: string;
|
|
1091
1091
|
schema_source: {
|
|
1092
|
-
id: number;
|
|
1093
1092
|
type: "component";
|
|
1093
|
+
id: number;
|
|
1094
1094
|
};
|
|
1095
1095
|
override_value?: unknown;
|
|
1096
1096
|
};
|
|
@@ -1284,6 +1284,9 @@ declare const baseSlice: _reduxjs_toolkit.Slice<ComponentsState, {
|
|
|
1284
1284
|
addUnpublished: (state: immer_dist_internal_js.WritableDraft<ComponentsState>, { payload }: PayloadAction<UnpublishedComponent>) => void;
|
|
1285
1285
|
removeUnpublished: (state: immer_dist_internal_js.WritableDraft<ComponentsState>, { payload }: PayloadAction<string | string[]>) => void;
|
|
1286
1286
|
resetUnpublished: (state: immer_dist_internal_js.WritableDraft<ComponentsState>) => void;
|
|
1287
|
+
removeStyles(state: immer_dist_internal_js.WritableDraft<ComponentsState>, { payload }: PayloadAction<{
|
|
1288
|
+
id: ComponentId;
|
|
1289
|
+
}>): void;
|
|
1287
1290
|
addStyles: (state: immer_dist_internal_js.WritableDraft<ComponentsState>, { payload }: {
|
|
1288
1291
|
payload: any;
|
|
1289
1292
|
type: string;
|
|
@@ -1334,6 +1337,7 @@ declare const componentsActions: {
|
|
|
1334
1337
|
addUnpublished(component: UnpublishedComponent): void;
|
|
1335
1338
|
removeUnpublished(uids: string | string[]): void;
|
|
1336
1339
|
resetUnpublished(): void;
|
|
1340
|
+
removeStyles(id: ComponentId): void;
|
|
1337
1341
|
addStyles(styles: Record<string, unknown>): void;
|
|
1338
1342
|
addCreatedThisSession(uid: string): void;
|
|
1339
1343
|
removeCreatedThisSession(uid: string): void;
|
package/dist/index.js
CHANGED
|
@@ -94,9 +94,37 @@ var import_editor_editing_panel7 = require("@elementor/editor-editing-panel");
|
|
|
94
94
|
var import_editor_elements_panel = require("@elementor/editor-elements-panel");
|
|
95
95
|
var import_editor_styles_repository2 = require("@elementor/editor-styles-repository");
|
|
96
96
|
var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
97
|
-
var
|
|
97
|
+
var import_store34 = require("@elementor/store");
|
|
98
98
|
var import_i18n16 = require("@wordpress/i18n");
|
|
99
99
|
|
|
100
|
+
// src/component-instance-transformer.ts
|
|
101
|
+
var import_editor_canvas = require("@elementor/editor-canvas");
|
|
102
|
+
var import_store4 = require("@elementor/store");
|
|
103
|
+
|
|
104
|
+
// src/store/store.ts
|
|
105
|
+
var import_store3 = require("@elementor/store");
|
|
106
|
+
|
|
107
|
+
// src/store/store-types.ts
|
|
108
|
+
var initialState = {
|
|
109
|
+
data: [],
|
|
110
|
+
unpublishedData: [],
|
|
111
|
+
loadStatus: "idle",
|
|
112
|
+
styles: {},
|
|
113
|
+
createdThisSession: [],
|
|
114
|
+
archivedThisSession: [],
|
|
115
|
+
path: [],
|
|
116
|
+
currentComponentId: null,
|
|
117
|
+
updatedComponentNames: {},
|
|
118
|
+
sanitized: {}
|
|
119
|
+
};
|
|
120
|
+
var SLICE_NAME = "components";
|
|
121
|
+
|
|
122
|
+
// src/store/extensible-slice.ts
|
|
123
|
+
var import_store2 = require("@elementor/store");
|
|
124
|
+
|
|
125
|
+
// src/store/thunks.ts
|
|
126
|
+
var import_store = require("@elementor/store");
|
|
127
|
+
|
|
100
128
|
// src/api.ts
|
|
101
129
|
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
102
130
|
var import_http_client = require("@elementor/http-client");
|
|
@@ -152,33 +180,7 @@ var apiClient = {
|
|
|
152
180
|
validate: async (payload) => await (0, import_http_client.httpService)().post(`${BASE_URL}/create-validate`, payload).then((res) => res.data)
|
|
153
181
|
};
|
|
154
182
|
|
|
155
|
-
// src/component-instance-transformer.ts
|
|
156
|
-
var import_editor_canvas = require("@elementor/editor-canvas");
|
|
157
|
-
var import_store4 = require("@elementor/store");
|
|
158
|
-
|
|
159
|
-
// src/store/store.ts
|
|
160
|
-
var import_store3 = require("@elementor/store");
|
|
161
|
-
|
|
162
|
-
// src/store/store-types.ts
|
|
163
|
-
var initialState = {
|
|
164
|
-
data: [],
|
|
165
|
-
unpublishedData: [],
|
|
166
|
-
loadStatus: "idle",
|
|
167
|
-
styles: {},
|
|
168
|
-
createdThisSession: [],
|
|
169
|
-
archivedThisSession: [],
|
|
170
|
-
path: [],
|
|
171
|
-
currentComponentId: null,
|
|
172
|
-
updatedComponentNames: {},
|
|
173
|
-
sanitized: {}
|
|
174
|
-
};
|
|
175
|
-
var SLICE_NAME = "components";
|
|
176
|
-
|
|
177
|
-
// src/store/extensible-slice.ts
|
|
178
|
-
var import_store2 = require("@elementor/store");
|
|
179
|
-
|
|
180
183
|
// src/store/thunks.ts
|
|
181
|
-
var import_store = require("@elementor/store");
|
|
182
184
|
var loadComponents = (0, import_store.__createAsyncThunk)("components/load", async () => {
|
|
183
185
|
const response = await apiClient.get();
|
|
184
186
|
return response;
|
|
@@ -227,6 +229,10 @@ var baseSlice = (0, import_store2.__createSlice)({
|
|
|
227
229
|
resetUnpublished: (state) => {
|
|
228
230
|
state.unpublishedData = [];
|
|
229
231
|
},
|
|
232
|
+
removeStyles(state, { payload }) {
|
|
233
|
+
const { [payload.id]: _, ...rest } = state.styles;
|
|
234
|
+
state.styles = rest;
|
|
235
|
+
},
|
|
230
236
|
addStyles: (state, { payload }) => {
|
|
231
237
|
state.styles = { ...state.styles, ...payload };
|
|
232
238
|
},
|
|
@@ -1725,6 +1731,9 @@ var componentsActions = {
|
|
|
1725
1731
|
resetUnpublished() {
|
|
1726
1732
|
(0, import_store12.__dispatch)(slice.actions.resetUnpublished());
|
|
1727
1733
|
},
|
|
1734
|
+
removeStyles(id) {
|
|
1735
|
+
(0, import_store12.__dispatch)(slice.actions.removeStyles({ id }));
|
|
1736
|
+
},
|
|
1728
1737
|
addStyles(styles) {
|
|
1729
1738
|
(0, import_store12.__dispatch)(slice.actions.addStyles(styles));
|
|
1730
1739
|
},
|
|
@@ -3208,14 +3217,21 @@ function blockCircularPaste(args) {
|
|
|
3208
3217
|
return hasCircularComponent;
|
|
3209
3218
|
}
|
|
3210
3219
|
|
|
3220
|
+
// src/store/actions/remove-component-styles.ts
|
|
3221
|
+
var import_store30 = require("@elementor/store");
|
|
3222
|
+
function removeComponentStyles(id) {
|
|
3223
|
+
apiClient.invalidateComponentConfigCache(id);
|
|
3224
|
+
(0, import_store30.__dispatch)(slice.actions.removeStyles({ id }));
|
|
3225
|
+
}
|
|
3226
|
+
|
|
3211
3227
|
// src/store/components-styles-provider.ts
|
|
3212
3228
|
var import_editor_elements10 = require("@elementor/editor-elements");
|
|
3213
3229
|
var import_editor_styles_repository = require("@elementor/editor-styles-repository");
|
|
3214
|
-
var
|
|
3230
|
+
var import_store32 = require("@elementor/store");
|
|
3215
3231
|
var componentsStylesProvider = (0, import_editor_styles_repository.createStylesProvider)({
|
|
3216
3232
|
key: "components-styles",
|
|
3217
3233
|
priority: 100,
|
|
3218
|
-
subscribe: (cb) => (0,
|
|
3234
|
+
subscribe: (cb) => (0, import_store32.__subscribeWithSelector)(
|
|
3219
3235
|
(state) => state[SLICE_NAME],
|
|
3220
3236
|
() => {
|
|
3221
3237
|
cb();
|
|
@@ -3224,10 +3240,10 @@ var componentsStylesProvider = (0, import_editor_styles_repository.createStylesP
|
|
|
3224
3240
|
actions: {
|
|
3225
3241
|
all: () => {
|
|
3226
3242
|
const currentDocumentId = (0, import_editor_elements10.getCurrentDocumentId)();
|
|
3227
|
-
return selectFlatStyles((0,
|
|
3243
|
+
return selectFlatStyles((0, import_store32.__getState)(), currentDocumentId);
|
|
3228
3244
|
},
|
|
3229
3245
|
get: (id) => {
|
|
3230
|
-
return selectFlatStyles((0,
|
|
3246
|
+
return selectFlatStyles((0, import_store32.__getState)()).find((style) => style.id === id) ?? null;
|
|
3231
3247
|
}
|
|
3232
3248
|
}
|
|
3233
3249
|
});
|
|
@@ -3308,7 +3324,7 @@ function load(result) {
|
|
|
3308
3324
|
// src/init.ts
|
|
3309
3325
|
function init() {
|
|
3310
3326
|
import_editor_styles_repository2.stylesRepository.register(componentsStylesProvider);
|
|
3311
|
-
(0,
|
|
3327
|
+
(0, import_store34.__registerSlice)(slice);
|
|
3312
3328
|
(0, import_editor_canvas5.registerElementType)(
|
|
3313
3329
|
COMPONENT_WIDGET_TYPE2,
|
|
3314
3330
|
(options) => createComponentType({
|
|
@@ -3331,7 +3347,7 @@ function init() {
|
|
|
3331
3347
|
(0, import_editor_v1_adapters6.registerDataHook)("after", "editor/documents/attach-preview", async () => {
|
|
3332
3348
|
const { id, config } = (0, import_editor_documents6.getV1CurrentDocument)();
|
|
3333
3349
|
if (id) {
|
|
3334
|
-
|
|
3350
|
+
removeComponentStyles(id);
|
|
3335
3351
|
}
|
|
3336
3352
|
await loadComponentsAssets(config?.elements ?? []);
|
|
3337
3353
|
});
|