@wix/editor 1.562.0 → 1.563.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.
@@ -638,9 +638,11 @@
638
638
  );
639
639
  }
640
640
  /**
641
- * Retrieves the data item definitions declared in the component's manifest.
641
+ * Lists the data fields defined on the selected component's manifest.
642
642
  *
643
- * @returns Data item definitions keyed by data item key.
643
+ * Each key in the result is a valid **`dataItemKey`** for `getData`, `setData`, and `getResolvedData`.
644
+ *
645
+ * @returns Definitions keyed by `dataItemKey`.
644
646
  *
645
647
  * @example
646
648
  * ```ts
@@ -679,19 +681,21 @@
679
681
  );
680
682
  }
681
683
  /**
682
- * Retrieves the resolved value of a specific data item.
684
+ * Returns one data field from the selected component by **`dataItemKey`**.
685
+ *
686
+ * A **`dataItemKey`** is the property name of a data field in that component's manifest — the same names
687
+ * returned from `getDataDefinitions`. Example: `'heroImage'` for a field declared under `editorElement.data`.
683
688
  *
684
- * Unlike {@link getData}, this method returns the fully resolved value
685
- * for a single data item.
689
+ * `getData` returns all fields at once. This method returns only the field you name.
686
690
  *
687
- * @param options - Object containing the `dataItemKey` to resolve.
688
- * @returns Resolved value for the specified data item.
691
+ * @param options.dataItemKey - Key of the data field to read. Must exist on the component manifest.
692
+ * @returns Value for that data field.
689
693
  *
690
694
  * @example
691
695
  * ```ts
692
696
  * import { reactElements } from '@wix/editor';
693
697
  *
694
- * const resolved = await reactElements.getResolvedData({
698
+ * const hero = await reactElements.getResolvedData({
695
699
  * dataItemKey: 'heroImage',
696
700
  * });
697
701
  * ```
@@ -733,7 +737,7 @@
733
737
  /**
734
738
  * Retrieves the preset definitions declared in the component's manifest.
735
739
  *
736
- * @returns Preset definitions keyed by preset key.
740
+ * @returns An object mapping each preset key to its definition.
737
741
  *
738
742
  * @example
739
743
  * ```ts
@@ -840,7 +844,7 @@
840
844
  );
841
845
  }
842
846
  /**
843
- * Retrieves the currently active state for the component.
847
+ * Retrieves the active state for the component.
844
848
  *
845
849
  * @returns Key of the active state, or `null` if the default state is active.
846
850
  *
@@ -886,7 +890,7 @@
886
890
  /**
887
891
  * Retrieves the state definitions declared in the component's manifest.
888
892
  *
889
- * @returns State definitions keyed by state key.
893
+ * @returns An object mapping each state key to its definition.
890
894
  *
891
895
  * @example
892
896
  * ```ts
@@ -935,22 +939,21 @@
935
939
  );
936
940
  }
937
941
  /**
938
- * Opens the font picker for selecting a font family and weight.
942
+ * Opens the font picker for selecting a font family and weight from a custom panel.
939
943
  *
940
- * Pass `styleItemKey` to bind the picker to a manifest style item,
941
- * or pass manual options to handle the selection via callbacks.
944
+ * Pass `target` and `panelOptions` to position the popup next to the control that opened it.
945
+ * Use `onChange` / `onPreview` to handle the selection; the editor does not write to the manifest for you.
942
946
  *
943
- * @param params - `styleItemKey` for manifest binding, or manual picker options.
947
+ * @param params - Picker options.
944
948
  * @returns Selected font family and weight, or `undefined` if dismissed.
945
949
  *
946
950
  * @example
947
951
  * ```ts
948
952
  * import { reactElements } from '@wix/editor';
949
953
  *
950
- * const font = await reactElements.selectFont({ styleItemKey: 'headingFont' });
951
- *
952
954
  * const font = await reactElements.selectFont({
953
955
  * selectedFontFamily: { family: 'Arial', weight: '400' },
956
+ * target: buttonRef.current,
954
957
  * onChange: (value) => console.log('Selected:', value),
955
958
  * });
956
959
  * ```
@@ -972,21 +975,20 @@
972
975
  }
973
976
  }
974
977
  /**
975
- * Opens the font family picker for selecting a font family without
976
- * weight options. Works the same as {@link selectFont} but without
977
- * the weight selector.
978
+ * Opens the font family picker without weight selection, from a custom panel.
979
+ *
980
+ * Same pattern as {@link selectFont}: `target`, `panelOptions`, and callbacks.
978
981
  *
979
- * @param params - `styleItemKey` for manifest binding, or manual picker options.
982
+ * @param params - Picker options.
980
983
  * @returns Selected font family, or `undefined` if dismissed.
981
984
  *
982
985
  * @example
983
986
  * ```ts
984
987
  * import { reactElements } from '@wix/editor';
985
988
  *
986
- * const font = await reactElements.selectFontFamily({ styleItemKey: 'bodyFont' });
987
- *
988
989
  * const font = await reactElements.selectFontFamily({
989
990
  * selectedFontFamily: { family: 'Helvetica', weight: '400' },
991
+ * target: buttonRef.current,
990
992
  * onChange: (value) => console.log('Selected:', value.family),
991
993
  * });
992
994
  * ```
@@ -1008,21 +1010,15 @@
1008
1010
  }
1009
1011
  }
1010
1012
  /**
1011
- * Opens the media picker for selecting images, videos, or other media
1012
- * from the Wix Media Manager.
1013
- *
1014
- * Pass `dataItemKey` to bind the picker to a manifest data item,
1015
- * or pass manual options to configure the picker.
1013
+ * Opens the media picker for selecting images, videos, or other media from a custom panel.
1016
1014
  *
1017
- * @param params - `dataItemKey` for manifest binding, or manual picker options.
1015
+ * @param params - Picker options.
1018
1016
  * @returns Selected media items.
1019
1017
  *
1020
1018
  * @example
1021
1019
  * ```ts
1022
1020
  * import { reactElements } from '@wix/editor';
1023
1021
  *
1024
- * const media = await reactElements.selectMedia({ dataItemKey: 'heroImage' });
1025
- *
1026
1022
  * const media = await reactElements.selectMedia({
1027
1023
  * isMultiSelect: true,
1028
1024
  * category: 'image',
@@ -1039,20 +1035,15 @@
1039
1035
  );
1040
1036
  }
1041
1037
  /**
1042
- * Opens the link picker for creating or editing a link.
1043
- *
1044
- * Pass `dataItemKey` to bind the picker to a manifest data item,
1045
- * or pass a `value` and optional `linkTypes` to configure manually.
1038
+ * Opens the link picker for creating or editing a link from a custom panel.
1046
1039
  *
1047
- * @param params - `dataItemKey` for manifest binding, or manual picker options.
1040
+ * @param params - Picker options.
1048
1041
  * @returns Selected link, or `null`/`undefined` if dismissed.
1049
1042
  *
1050
1043
  * @example
1051
1044
  * ```ts
1052
1045
  * import { reactElements } from '@wix/editor';
1053
1046
  *
1054
- * const link = await reactElements.selectLink({ dataItemKey: 'buttonLink' });
1055
- *
1056
1047
  * const link = await reactElements.selectLink({
1057
1048
  * value: currentLink,
1058
1049
  * options: { linkTypes: ['ExternalLink', 'PageLink'] },
@@ -1069,20 +1060,15 @@
1069
1060
  );
1070
1061
  }
1071
1062
  /**
1072
- * Opens the color picker for selecting a color.
1073
- *
1074
- * Pass `styleItemKey` to bind the picker to a manifest style item,
1075
- * or pass manual options to configure the picker.
1063
+ * Opens the color picker for selecting a color from a custom panel.
1076
1064
  *
1077
- * @param params - `styleItemKey` for manifest binding, or manual picker options.
1065
+ * @param params - Picker options.
1078
1066
  * @returns Selected color value, or `undefined` if dismissed.
1079
1067
  *
1080
1068
  * @example
1081
1069
  * ```ts
1082
1070
  * import { reactElements } from '@wix/editor';
1083
1071
  *
1084
- * const color = await reactElements.selectColor({ styleItemKey: 'backgroundColor' });
1085
- *
1086
1072
  * const color = await reactElements.selectColor({
1087
1073
  * initialValue: '#ff0000',
1088
1074
  * mode: ['solid', 'gradient'],
@@ -1132,13 +1118,9 @@
1132
1118
  );
1133
1119
  }
1134
1120
  /**
1135
- * Opens the font weight picker for selecting a font weight for a specified
1136
- * font family.
1137
- *
1138
- * Pass manifest style item keys to bind the picker, or pass manual
1139
- * options to handle the selection via callbacks.
1121
+ * Opens the font weight picker for a specified font family, from a custom panel.
1140
1122
  *
1141
- * @param params - Manifest style item keys, or manual picker options.
1123
+ * @param params - Picker options.
1142
1124
  * @returns Selected font weight.
1143
1125
  *
1144
1126
  * @example
@@ -1146,12 +1128,8 @@
1146
1128
  * import { reactElements } from '@wix/editor';
1147
1129
  *
1148
1130
  * const weight = await reactElements.selectFontWeight({
1149
- * fontFamilyStyleItemKey: 'headingFontFamily',
1150
- * fontWeightStyleItemKey: 'headingFontWeight',
1151
- * });
1152
- *
1153
- * const weight = await reactElements.selectFontWeight({
1154
1131
  * fontFamily: { family: 'Arial', weight: '400' },
1132
+ * target: buttonRef.current,
1155
1133
  * onChange: (value) => console.log('Selected weight:', value.weight),
1156
1134
  * });
1157
1135
  * ```
@@ -1168,11 +1146,9 @@
1168
1146
  };
1169
1147
  }
1170
1148
  /**
1171
- * Opens the text theme picker for selecting a predefined text theme
1172
- * (a combination of font and color from the site's theme).
1149
+ * Opens the text theme picker from a custom panel — a site theme combination of font and color.
1173
1150
  *
1174
- * @param params - Text theme picker configuration.
1175
- * @param params.target - HTML element to anchor the picker to.
1151
+ * @param params - Picker options. Pass `target` for the element in your panel that opened the picker.
1176
1152
  * @param params.initialValue - Initial font and color values.
1177
1153
  * @returns Selected text theme.
1178
1154
  *
@@ -1181,6 +1157,7 @@
1181
1157
  * import { reactElements } from '@wix/editor';
1182
1158
  *
1183
1159
  * const theme = await reactElements.selectTextTheme({
1160
+ * target: buttonRef.current,
1184
1161
  * initialValue: { font: 'Heading 1', color: '#333' },
1185
1162
  * });
1186
1163
  * ```