@micromag/media-gallery 0.4.102 → 0.4.104

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.
Files changed (2) hide show
  1. package/es/index.js +40 -38
  2. package/package.json +2 -2
package/es/index.js CHANGED
@@ -723,7 +723,7 @@ function MediaGallery(t0) {
723
723
  const mediasApi = useMediasApi();
724
724
  let t20;
725
725
  if ($[28] !== createMedia || $[29] !== mediasApi?.create) {
726
- t20 = newMedias => Promise.all(newMedias.map(mediasApi?.create ?? createMedia)).then(_temp4);
726
+ t20 = newMedias => Promise.all(newMedias.map(media => (mediasApi?.create ?? createMedia)(media))).then(_temp4);
727
727
  $[28] = createMedia;
728
728
  $[29] = mediasApi?.create;
729
729
  $[30] = t20;
@@ -880,7 +880,7 @@ function _temp(t) {
880
880
  }
881
881
 
882
882
  function MediaGalleryModal(t0) {
883
- const $ = c(47);
883
+ const $ = c(48);
884
884
  let initialValue;
885
885
  let props;
886
886
  let t1;
@@ -1003,54 +1003,56 @@ function MediaGalleryModal(t0) {
1003
1003
  }
1004
1004
  const onFormClose = t14;
1005
1005
  let t15;
1006
- if ($[22] !== onChange || $[23] !== value) {
1006
+ if ($[22] !== onChange || $[23] !== requestClose || $[24] !== value) {
1007
1007
  t15 = () => {
1008
1008
  if (onChange !== null) {
1009
1009
  onChange(value);
1010
1010
  }
1011
+ requestClose();
1011
1012
  };
1012
1013
  $[22] = onChange;
1013
- $[23] = value;
1014
- $[24] = t15;
1014
+ $[23] = requestClose;
1015
+ $[24] = value;
1016
+ $[25] = t15;
1015
1017
  } else {
1016
- t15 = $[24];
1018
+ t15 = $[25];
1017
1019
  }
1018
1020
  const onClickSubmit = t15;
1019
1021
  const t16 = id ?? "media-gallery";
1020
1022
  let t17;
1021
- if ($[25] !== title) {
1023
+ if ($[26] !== title) {
1022
1024
  t17 = title || /*#__PURE__*/jsx(FormattedMessage, {
1023
1025
  id: "ZpoE9K",
1024
1026
  defaultMessage: "Select media"
1025
1027
  });
1026
- $[25] = title;
1027
- $[26] = t17;
1028
+ $[26] = title;
1029
+ $[27] = t17;
1028
1030
  } else {
1029
- t17 = $[26];
1031
+ t17 = $[27];
1030
1032
  }
1031
1033
  const t18 = visible ?? opened;
1032
1034
  const t19 = !formOpen;
1033
1035
  const t20 = !formOpen;
1034
1036
  let t21;
1035
- if ($[27] !== className) {
1037
+ if ($[28] !== className) {
1036
1038
  t21 = classNames(["modal-fullscreen-lg-down", className]);
1037
- $[27] = className;
1038
- $[28] = t21;
1039
+ $[28] = className;
1040
+ $[29] = t21;
1039
1041
  } else {
1040
- t21 = $[28];
1042
+ t21 = $[29];
1041
1043
  }
1042
1044
  let t22;
1043
- if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
1045
+ if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
1044
1046
  t22 = /*#__PURE__*/jsx(FormattedMessage, {
1045
1047
  id: "rvOVCV",
1046
1048
  defaultMessage: "Confirm selection"
1047
1049
  });
1048
- $[29] = t22;
1050
+ $[30] = t22;
1049
1051
  } else {
1050
- t22 = $[29];
1052
+ t22 = $[30];
1051
1053
  }
1052
1054
  let t23;
1053
- if ($[30] !== multiple || $[31] !== onGalleryChange || $[32] !== props || $[33] !== value) {
1055
+ if ($[31] !== multiple || $[32] !== onGalleryChange || $[33] !== props || $[34] !== value) {
1054
1056
  t23 = /*#__PURE__*/jsx(MediaGallery, {
1055
1057
  isPicker: true,
1056
1058
  multiple: multiple,
@@ -1060,16 +1062,16 @@ function MediaGalleryModal(t0) {
1060
1062
  onMediaFormClose: onFormClose,
1061
1063
  ...props
1062
1064
  });
1063
- $[30] = multiple;
1064
- $[31] = onGalleryChange;
1065
- $[32] = props;
1066
- $[33] = value;
1067
- $[34] = t23;
1065
+ $[31] = multiple;
1066
+ $[32] = onGalleryChange;
1067
+ $[33] = props;
1068
+ $[34] = value;
1069
+ $[35] = t23;
1068
1070
  } else {
1069
- t23 = $[34];
1071
+ t23 = $[35];
1070
1072
  }
1071
1073
  let t24;
1072
- if ($[35] !== onClickSubmit || $[36] !== onClosed || $[37] !== requestClose || $[38] !== size || $[39] !== t16 || $[40] !== t17 || $[41] !== t18 || $[42] !== t19 || $[43] !== t20 || $[44] !== t21 || $[45] !== t23) {
1074
+ if ($[36] !== onClickSubmit || $[37] !== onClosed || $[38] !== requestClose || $[39] !== size || $[40] !== t16 || $[41] !== t17 || $[42] !== t18 || $[43] !== t19 || $[44] !== t20 || $[45] !== t21 || $[46] !== t23) {
1073
1075
  t24 = /*#__PURE__*/jsx(Dialog, {
1074
1076
  id: t16,
1075
1077
  title: t17,
@@ -1084,20 +1086,20 @@ function MediaGalleryModal(t0) {
1084
1086
  submitButtonLabel: t22,
1085
1087
  children: t23
1086
1088
  });
1087
- $[35] = onClickSubmit;
1088
- $[36] = onClosed;
1089
- $[37] = requestClose;
1090
- $[38] = size;
1091
- $[39] = t16;
1092
- $[40] = t17;
1093
- $[41] = t18;
1094
- $[42] = t19;
1095
- $[43] = t20;
1096
- $[44] = t21;
1097
- $[45] = t23;
1098
- $[46] = t24;
1089
+ $[36] = onClickSubmit;
1090
+ $[37] = onClosed;
1091
+ $[38] = requestClose;
1092
+ $[39] = size;
1093
+ $[40] = t16;
1094
+ $[41] = t17;
1095
+ $[42] = t18;
1096
+ $[43] = t19;
1097
+ $[44] = t20;
1098
+ $[45] = t21;
1099
+ $[46] = t23;
1100
+ $[47] = t24;
1099
1101
  } else {
1100
- t24 = $[46];
1102
+ t24 = $[47];
1101
1103
  }
1102
1104
  return t24;
1103
1105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/media-gallery",
3
- "version": "0.4.102",
3
+ "version": "0.4.104",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -85,5 +85,5 @@
85
85
  "access": "public",
86
86
  "registry": "https://registry.npmjs.org/"
87
87
  },
88
- "gitHead": "aeb2771dba059008d2a9228798118c798d532b93"
88
+ "gitHead": "5d1839ecf4a93e46192554846aca2bedbc59a698"
89
89
  }