@wix/editor 1.505.0 → 1.506.0
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/cjs/index.js +68 -68
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +68 -68
- package/dist/esm/index.js.map +1 -1
- package/dist/statics/docs-ts-model.json +211 -211
- package/dist/statics/index.js +68 -68
- package/dist/statics/index.js.map +1 -1
- package/dist/types/index.d.ts +72 -72
- package/package.json +2 -2
package/dist/statics/index.js
CHANGED
|
@@ -543,9 +543,9 @@
|
|
|
543
543
|
*
|
|
544
544
|
* @example
|
|
545
545
|
* ```ts
|
|
546
|
-
* import {
|
|
546
|
+
* import { reactElements } from '@wix/editor';
|
|
547
547
|
*
|
|
548
|
-
* const defs = await
|
|
548
|
+
* const defs = await reactElements.getStyleDefinitions();
|
|
549
549
|
* ```
|
|
550
550
|
*/
|
|
551
551
|
async getStyleDefinitions() {
|
|
@@ -563,9 +563,9 @@
|
|
|
563
563
|
*
|
|
564
564
|
* @example
|
|
565
565
|
* ```ts
|
|
566
|
-
* import {
|
|
566
|
+
* import { reactElements } from '@wix/editor';
|
|
567
567
|
*
|
|
568
|
-
* const styles = await
|
|
568
|
+
* const styles = await reactElements.getStyles();
|
|
569
569
|
* const bgColor = styles.cssProperties.backgroundColor;
|
|
570
570
|
* ```
|
|
571
571
|
*/
|
|
@@ -582,16 +582,16 @@
|
|
|
582
582
|
*
|
|
583
583
|
* @example
|
|
584
584
|
* ```ts
|
|
585
|
-
* import {
|
|
585
|
+
* import { reactElements } from '@wix/editor';
|
|
586
586
|
* import { CssPropertyType } from '@wix/public-editor-platform-sdk';
|
|
587
587
|
*
|
|
588
588
|
* // Using enum (recommended):
|
|
589
|
-
* await
|
|
589
|
+
* await reactElements.setStyles({
|
|
590
590
|
* cssProperties: { [CssPropertyType.color]: '#fff' }
|
|
591
591
|
* });
|
|
592
592
|
*
|
|
593
593
|
* // Using string literal (also works):
|
|
594
|
-
* await
|
|
594
|
+
* await reactElements.setStyles({
|
|
595
595
|
* cssProperties: { 'color': '#fff' }
|
|
596
596
|
* });
|
|
597
597
|
* ```
|
|
@@ -610,16 +610,16 @@
|
|
|
610
610
|
*
|
|
611
611
|
* @example
|
|
612
612
|
* ```ts
|
|
613
|
-
* import {
|
|
613
|
+
* import { reactElements } from '@wix/editor';
|
|
614
614
|
* import { CssPropertyType } from '@wix/public-editor-platform-sdk';
|
|
615
615
|
*
|
|
616
616
|
* // Using enum (recommended):
|
|
617
|
-
* await
|
|
617
|
+
* await reactElements.removeStyles({
|
|
618
618
|
* cssPropertiesKeys: [CssPropertyType.color]
|
|
619
619
|
* });
|
|
620
620
|
*
|
|
621
621
|
* // Using string literal (also works):
|
|
622
|
-
* await
|
|
622
|
+
* await reactElements.removeStyles({
|
|
623
623
|
* cssPropertiesKeys: ['color']
|
|
624
624
|
* });
|
|
625
625
|
* ```
|
|
@@ -640,9 +640,9 @@
|
|
|
640
640
|
*
|
|
641
641
|
* @example
|
|
642
642
|
* ```ts
|
|
643
|
-
* import {
|
|
643
|
+
* import { reactElements } from '@wix/editor';
|
|
644
644
|
*
|
|
645
|
-
* const defs = await
|
|
645
|
+
* const defs = await reactElements.getDataDefinitions();
|
|
646
646
|
* ```
|
|
647
647
|
*/
|
|
648
648
|
async getDataDefinitions() {
|
|
@@ -661,9 +661,9 @@
|
|
|
661
661
|
*
|
|
662
662
|
* @example
|
|
663
663
|
* ```ts
|
|
664
|
-
* import {
|
|
664
|
+
* import { reactElements } from '@wix/editor';
|
|
665
665
|
*
|
|
666
|
-
* const data = await
|
|
666
|
+
* const data = await reactElements.getData();
|
|
667
667
|
* ```
|
|
668
668
|
*/
|
|
669
669
|
async getData() {
|
|
@@ -685,9 +685,9 @@
|
|
|
685
685
|
*
|
|
686
686
|
* @example
|
|
687
687
|
* ```ts
|
|
688
|
-
* import {
|
|
688
|
+
* import { reactElements } from '@wix/editor';
|
|
689
689
|
*
|
|
690
|
-
* const resolved = await
|
|
690
|
+
* const resolved = await reactElements.getResolvedData({
|
|
691
691
|
* dataItemKey: 'heroImage',
|
|
692
692
|
* });
|
|
693
693
|
* ```
|
|
@@ -712,9 +712,9 @@
|
|
|
712
712
|
*
|
|
713
713
|
* @example
|
|
714
714
|
* ```ts
|
|
715
|
-
* import {
|
|
715
|
+
* import { reactElements } from '@wix/editor';
|
|
716
716
|
*
|
|
717
|
-
* await
|
|
717
|
+
* await reactElements.setData({ title: 'New Title', showButton: false });
|
|
718
718
|
* ```
|
|
719
719
|
*/
|
|
720
720
|
async setData(values) {
|
|
@@ -733,9 +733,9 @@
|
|
|
733
733
|
*
|
|
734
734
|
* @example
|
|
735
735
|
* ```ts
|
|
736
|
-
* import {
|
|
736
|
+
* import { reactElements } from '@wix/editor';
|
|
737
737
|
*
|
|
738
|
-
* const presets = await
|
|
738
|
+
* const presets = await reactElements.getPresetDefinitions();
|
|
739
739
|
* ```
|
|
740
740
|
*/
|
|
741
741
|
async getPresetDefinitions() {
|
|
@@ -753,9 +753,9 @@
|
|
|
753
753
|
*
|
|
754
754
|
* @example
|
|
755
755
|
* ```ts
|
|
756
|
-
* import {
|
|
756
|
+
* import { reactElements } from '@wix/editor';
|
|
757
757
|
*
|
|
758
|
-
* const preset = await
|
|
758
|
+
* const preset = await reactElements.getAppliedPreset();
|
|
759
759
|
* ```
|
|
760
760
|
*/
|
|
761
761
|
async getAppliedPreset() {
|
|
@@ -774,9 +774,9 @@
|
|
|
774
774
|
*
|
|
775
775
|
* @example
|
|
776
776
|
* ```ts
|
|
777
|
-
* import {
|
|
777
|
+
* import { reactElements } from '@wix/editor';
|
|
778
778
|
*
|
|
779
|
-
* await
|
|
779
|
+
* await reactElements.applyPreset({ key: 'minimal' });
|
|
780
780
|
* ```
|
|
781
781
|
*/
|
|
782
782
|
async applyPreset(options) {
|
|
@@ -796,11 +796,11 @@
|
|
|
796
796
|
*
|
|
797
797
|
* @example
|
|
798
798
|
* ```ts
|
|
799
|
-
* import {
|
|
799
|
+
* import { reactElements } from '@wix/editor';
|
|
800
800
|
*
|
|
801
|
-
* const groups = await
|
|
801
|
+
* const groups = await reactElements.getDisplayGroupDefinitions();
|
|
802
802
|
*
|
|
803
|
-
* const cssGroups = await
|
|
803
|
+
* const cssGroups = await reactElements.getDisplayGroupDefinitions({
|
|
804
804
|
* filter: { groupType: 'cssDataType' },
|
|
805
805
|
* });
|
|
806
806
|
* ```
|
|
@@ -822,9 +822,9 @@
|
|
|
822
822
|
*
|
|
823
823
|
* @example
|
|
824
824
|
* ```ts
|
|
825
|
-
* import {
|
|
825
|
+
* import { reactElements } from '@wix/editor';
|
|
826
826
|
*
|
|
827
|
-
* const name = await
|
|
827
|
+
* const name = await reactElements.getDisplayName();
|
|
828
828
|
* ```
|
|
829
829
|
*/
|
|
830
830
|
async getDisplayName() {
|
|
@@ -842,9 +842,9 @@
|
|
|
842
842
|
*
|
|
843
843
|
* @example
|
|
844
844
|
* ```ts
|
|
845
|
-
* import {
|
|
845
|
+
* import { reactElements } from '@wix/editor';
|
|
846
846
|
*
|
|
847
|
-
* const state = await
|
|
847
|
+
* const state = await reactElements.getState();
|
|
848
848
|
* ```
|
|
849
849
|
*/
|
|
850
850
|
async getState() {
|
|
@@ -863,11 +863,11 @@
|
|
|
863
863
|
*
|
|
864
864
|
* @example
|
|
865
865
|
* ```ts
|
|
866
|
-
* import {
|
|
866
|
+
* import { reactElements } from '@wix/editor';
|
|
867
867
|
*
|
|
868
|
-
* await
|
|
868
|
+
* await reactElements.setState('hover');
|
|
869
869
|
*
|
|
870
|
-
* await
|
|
870
|
+
* await reactElements.setState(null);
|
|
871
871
|
* ```
|
|
872
872
|
*/
|
|
873
873
|
async setState(stateKey) {
|
|
@@ -886,9 +886,9 @@
|
|
|
886
886
|
*
|
|
887
887
|
* @example
|
|
888
888
|
* ```ts
|
|
889
|
-
* import {
|
|
889
|
+
* import { reactElements } from '@wix/editor';
|
|
890
890
|
*
|
|
891
|
-
* const states = await
|
|
891
|
+
* const states = await reactElements.getStateDefinitions();
|
|
892
892
|
* ```
|
|
893
893
|
*/
|
|
894
894
|
async getStateDefinitions() {
|
|
@@ -910,9 +910,9 @@
|
|
|
910
910
|
*
|
|
911
911
|
* @example
|
|
912
912
|
* ```ts
|
|
913
|
-
* import {
|
|
913
|
+
* import { reactElements } from '@wix/editor';
|
|
914
914
|
*
|
|
915
|
-
* const unsubscribe = await
|
|
915
|
+
* const unsubscribe = await reactElements.onChange((patch) => {
|
|
916
916
|
* if (patch.type === 'data') {
|
|
917
917
|
* console.log('Data changed:', patch.value);
|
|
918
918
|
* }
|
|
@@ -941,11 +941,11 @@
|
|
|
941
941
|
*
|
|
942
942
|
* @example
|
|
943
943
|
* ```ts
|
|
944
|
-
* import {
|
|
944
|
+
* import { reactElements } from '@wix/editor';
|
|
945
945
|
*
|
|
946
|
-
* const font = await
|
|
946
|
+
* const font = await reactElements.selectFont({ styleItemKey: 'headingFont' });
|
|
947
947
|
*
|
|
948
|
-
* const font = await
|
|
948
|
+
* const font = await reactElements.selectFont({
|
|
949
949
|
* selectedFontFamily: { family: 'Arial', weight: '400' },
|
|
950
950
|
* onChange: (value) => console.log('Selected:', value),
|
|
951
951
|
* });
|
|
@@ -977,11 +977,11 @@
|
|
|
977
977
|
*
|
|
978
978
|
* @example
|
|
979
979
|
* ```ts
|
|
980
|
-
* import {
|
|
980
|
+
* import { reactElements } from '@wix/editor';
|
|
981
981
|
*
|
|
982
|
-
* const font = await
|
|
982
|
+
* const font = await reactElements.selectFontFamily({ styleItemKey: 'bodyFont' });
|
|
983
983
|
*
|
|
984
|
-
* const font = await
|
|
984
|
+
* const font = await reactElements.selectFontFamily({
|
|
985
985
|
* selectedFontFamily: { family: 'Helvetica', weight: '400' },
|
|
986
986
|
* onChange: (value) => console.log('Selected:', value.family),
|
|
987
987
|
* });
|
|
@@ -1015,11 +1015,11 @@
|
|
|
1015
1015
|
*
|
|
1016
1016
|
* @example
|
|
1017
1017
|
* ```ts
|
|
1018
|
-
* import {
|
|
1018
|
+
* import { reactElements } from '@wix/editor';
|
|
1019
1019
|
*
|
|
1020
|
-
* const media = await
|
|
1020
|
+
* const media = await reactElements.selectMedia({ dataItemKey: 'heroImage' });
|
|
1021
1021
|
*
|
|
1022
|
-
* const media = await
|
|
1022
|
+
* const media = await reactElements.selectMedia({
|
|
1023
1023
|
* isMultiSelect: true,
|
|
1024
1024
|
* category: 'image',
|
|
1025
1025
|
* });
|
|
@@ -1045,11 +1045,11 @@
|
|
|
1045
1045
|
*
|
|
1046
1046
|
* @example
|
|
1047
1047
|
* ```ts
|
|
1048
|
-
* import {
|
|
1048
|
+
* import { reactElements } from '@wix/editor';
|
|
1049
1049
|
*
|
|
1050
|
-
* const link = await
|
|
1050
|
+
* const link = await reactElements.selectLink({ dataItemKey: 'buttonLink' });
|
|
1051
1051
|
*
|
|
1052
|
-
* const link = await
|
|
1052
|
+
* const link = await reactElements.selectLink({
|
|
1053
1053
|
* value: currentLink,
|
|
1054
1054
|
* options: { linkTypes: ['ExternalLink', 'PageLink'] },
|
|
1055
1055
|
* });
|
|
@@ -1075,11 +1075,11 @@
|
|
|
1075
1075
|
*
|
|
1076
1076
|
* @example
|
|
1077
1077
|
* ```ts
|
|
1078
|
-
* import {
|
|
1078
|
+
* import { reactElements } from '@wix/editor';
|
|
1079
1079
|
*
|
|
1080
|
-
* const color = await
|
|
1080
|
+
* const color = await reactElements.selectColor({ styleItemKey: 'backgroundColor' });
|
|
1081
1081
|
*
|
|
1082
|
-
* const color = await
|
|
1082
|
+
* const color = await reactElements.selectColor({
|
|
1083
1083
|
* initialValue: '#ff0000',
|
|
1084
1084
|
* mode: ['solid', 'gradient'],
|
|
1085
1085
|
* showOpacity: true,
|
|
@@ -1110,9 +1110,9 @@
|
|
|
1110
1110
|
*
|
|
1111
1111
|
* @example
|
|
1112
1112
|
* ```ts
|
|
1113
|
-
* import {
|
|
1113
|
+
* import { reactElements } from '@wix/editor';
|
|
1114
1114
|
*
|
|
1115
|
-
* const bg = await
|
|
1115
|
+
* const bg = await reactElements.selectBackground({
|
|
1116
1116
|
* initialValue: { backgroundColor: '#fff', backgroundImage: '' },
|
|
1117
1117
|
* onChange: (value) => console.log('Preview:', value),
|
|
1118
1118
|
* });
|
|
@@ -1139,14 +1139,14 @@
|
|
|
1139
1139
|
*
|
|
1140
1140
|
* @example
|
|
1141
1141
|
* ```ts
|
|
1142
|
-
* import {
|
|
1142
|
+
* import { reactElements } from '@wix/editor';
|
|
1143
1143
|
*
|
|
1144
|
-
* const weight = await
|
|
1144
|
+
* const weight = await reactElements.selectFontWeight({
|
|
1145
1145
|
* fontFamilyStyleItemKey: 'headingFontFamily',
|
|
1146
1146
|
* fontWeightStyleItemKey: 'headingFontWeight',
|
|
1147
1147
|
* });
|
|
1148
1148
|
*
|
|
1149
|
-
* const weight = await
|
|
1149
|
+
* const weight = await reactElements.selectFontWeight({
|
|
1150
1150
|
* fontFamily: { family: 'Arial', weight: '400' },
|
|
1151
1151
|
* onChange: (value) => console.log('Selected weight:', value.weight),
|
|
1152
1152
|
* });
|
|
@@ -1174,9 +1174,9 @@
|
|
|
1174
1174
|
*
|
|
1175
1175
|
* @example
|
|
1176
1176
|
* ```ts
|
|
1177
|
-
* import {
|
|
1177
|
+
* import { reactElements } from '@wix/editor';
|
|
1178
1178
|
*
|
|
1179
|
-
* const theme = await
|
|
1179
|
+
* const theme = await reactElements.selectTextTheme({
|
|
1180
1180
|
* initialValue: { font: 'Heading 1', color: '#333' },
|
|
1181
1181
|
* });
|
|
1182
1182
|
* ```
|
|
@@ -1198,9 +1198,9 @@
|
|
|
1198
1198
|
*
|
|
1199
1199
|
* @example
|
|
1200
1200
|
* ```ts
|
|
1201
|
-
* import {
|
|
1201
|
+
* import { reactElements } from '@wix/editor';
|
|
1202
1202
|
*
|
|
1203
|
-
* const index = await
|
|
1203
|
+
* const index = await reactElements.getArrayItemsSelectedIndex();
|
|
1204
1204
|
* ```
|
|
1205
1205
|
*/
|
|
1206
1206
|
async getArrayItemsSelectedIndex(options) {
|
|
@@ -1220,9 +1220,9 @@
|
|
|
1220
1220
|
*
|
|
1221
1221
|
* @example
|
|
1222
1222
|
* ```ts
|
|
1223
|
-
* import {
|
|
1223
|
+
* import { reactElements } from '@wix/editor';
|
|
1224
1224
|
*
|
|
1225
|
-
* await
|
|
1225
|
+
* await reactElements.setArrayItemsSelectedIndex({ index: 2 });
|
|
1226
1226
|
* ```
|
|
1227
1227
|
*/
|
|
1228
1228
|
async setArrayItemsSelectedIndex(options) {
|
|
@@ -1242,9 +1242,9 @@
|
|
|
1242
1242
|
*
|
|
1243
1243
|
* @example
|
|
1244
1244
|
* ```ts
|
|
1245
|
-
* import {
|
|
1245
|
+
* import { reactElements } from '@wix/editor';
|
|
1246
1246
|
*
|
|
1247
|
-
* await
|
|
1247
|
+
* await reactElements.resetArrayItemsSelectedIndex();
|
|
1248
1248
|
* ```
|
|
1249
1249
|
*/
|
|
1250
1250
|
async resetArrayItemsSelectedIndex(options) {
|
|
@@ -1263,9 +1263,9 @@
|
|
|
1263
1263
|
*
|
|
1264
1264
|
* @example
|
|
1265
1265
|
* ```ts
|
|
1266
|
-
* import {
|
|
1266
|
+
* import { reactElements } from '@wix/editor';
|
|
1267
1267
|
*
|
|
1268
|
-
* const token = await
|
|
1268
|
+
* const token = await reactElements.getBiToken();
|
|
1269
1269
|
* ```
|
|
1270
1270
|
*/
|
|
1271
1271
|
async getBiToken() {
|