@bigbinary/neeto-image-uploader-frontend 1.3.1 → 1.4.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/index.js CHANGED
@@ -17954,7 +17954,7 @@ var Modal = function Modal(_ref) {
17954
17954
  cov_2my1w2udyi().f[3]++;
17955
17955
  cov_2my1w2udyi().s[14]++;
17956
17956
  onUploadComplete({
17957
- url: image.metadata.url,
17957
+ url: image.blobUrl,
17958
17958
  signedId: image.signedId
17959
17959
  });
17960
17960
  },
@@ -18427,7 +18427,7 @@ var ProgressBar = function ProgressBar(_ref) {
18427
18427
 
18428
18428
  function cov_1avu3clziw() {
18429
18429
  var path = "/home/runner/work/neeto-image-uploader-nano/neeto-image-uploader-nano/app/javascript/src/components/ImageUploader/index.jsx";
18430
- var hash = "dfb1bddf6ad2d106cc08375435d345426efb0acc";
18430
+ var hash = "5d7f552e0d851142d8649f86544e6c5b0d4b8ae3";
18431
18431
  var global = new Function("return this")();
18432
18432
  var gcv = "__coverage__";
18433
18433
  var coverageData = {
@@ -18439,7 +18439,7 @@ function cov_1avu3clziw() {
18439
18439
  column: 22
18440
18440
  },
18441
18441
  end: {
18442
- line: 183,
18442
+ line: 186,
18443
18443
  column: 1
18444
18444
  }
18445
18445
  },
@@ -18670,7 +18670,7 @@ function cov_1avu3clziw() {
18670
18670
  },
18671
18671
  end: {
18672
18672
  line: 52,
18673
- column: 32
18673
+ column: 20
18674
18674
  }
18675
18675
  },
18676
18676
  "24": {
@@ -18769,18 +18769,18 @@ function cov_1avu3clziw() {
18769
18769
  column: 4
18770
18770
  },
18771
18771
  end: {
18772
- line: 87,
18772
+ line: 88,
18773
18773
  column: 7
18774
18774
  }
18775
18775
  },
18776
18776
  "34": {
18777
18777
  start: {
18778
- line: 88,
18779
- column: 4
18778
+ line: 86,
18779
+ column: 23
18780
18780
  },
18781
18781
  end: {
18782
- line: 88,
18783
- column: 27
18782
+ line: 86,
18783
+ column: 38
18784
18784
  }
18785
18785
  },
18786
18786
  "35": {
@@ -18819,7 +18819,7 @@ function cov_1avu3clziw() {
18819
18819
  column: 2
18820
18820
  },
18821
18821
  end: {
18822
- line: 182,
18822
+ line: 185,
18823
18823
  column: 4
18824
18824
  }
18825
18825
  },
@@ -18835,31 +18835,31 @@ function cov_1avu3clziw() {
18835
18835
  },
18836
18836
  "40": {
18837
18837
  start: {
18838
- line: 157,
18838
+ line: 160,
18839
18839
  column: 27
18840
18840
  },
18841
18841
  end: {
18842
- line: 157,
18842
+ line: 160,
18843
18843
  column: 49
18844
18844
  }
18845
18845
  },
18846
18846
  "41": {
18847
18847
  start: {
18848
- line: 160,
18848
+ line: 163,
18849
18849
  column: 33
18850
18850
  },
18851
18851
  end: {
18852
- line: 160,
18852
+ line: 163,
18853
18853
  column: 55
18854
18854
  }
18855
18855
  },
18856
18856
  "42": {
18857
18857
  start: {
18858
- line: 178,
18858
+ line: 181,
18859
18859
  column: 23
18860
18860
  },
18861
18861
  end: {
18862
- line: 178,
18862
+ line: 181,
18863
18863
  column: 51
18864
18864
  }
18865
18865
  }
@@ -18883,7 +18883,7 @@ function cov_1avu3clziw() {
18883
18883
  column: 76
18884
18884
  },
18885
18885
  end: {
18886
- line: 183,
18886
+ line: 186,
18887
18887
  column: 1
18888
18888
  }
18889
18889
  },
@@ -19035,6 +19035,30 @@ function cov_1avu3clziw() {
19035
19035
  },
19036
19036
  "7": {
19037
19037
  name: "(anonymous_7)",
19038
+ decl: {
19039
+ start: {
19040
+ line: 86,
19041
+ column: 17
19042
+ },
19043
+ end: {
19044
+ line: 86,
19045
+ column: 18
19046
+ }
19047
+ },
19048
+ loc: {
19049
+ start: {
19050
+ line: 86,
19051
+ column: 23
19052
+ },
19053
+ end: {
19054
+ line: 86,
19055
+ column: 38
19056
+ }
19057
+ },
19058
+ line: 86
19059
+ },
19060
+ "8": {
19061
+ name: "(anonymous_8)",
19038
19062
  decl: {
19039
19063
  start: {
19040
19064
  line: 129,
@@ -19057,77 +19081,77 @@ function cov_1avu3clziw() {
19057
19081
  },
19058
19082
  line: 129
19059
19083
  },
19060
- "8": {
19061
- name: "(anonymous_8)",
19084
+ "9": {
19085
+ name: "(anonymous_9)",
19062
19086
  decl: {
19063
19087
  start: {
19064
- line: 157,
19088
+ line: 160,
19065
19089
  column: 21
19066
19090
  },
19067
19091
  end: {
19068
- line: 157,
19092
+ line: 160,
19069
19093
  column: 22
19070
19094
  }
19071
19095
  },
19072
19096
  loc: {
19073
19097
  start: {
19074
- line: 157,
19098
+ line: 160,
19075
19099
  column: 27
19076
19100
  },
19077
19101
  end: {
19078
- line: 157,
19102
+ line: 160,
19079
19103
  column: 49
19080
19104
  }
19081
19105
  },
19082
- line: 157
19106
+ line: 160
19083
19107
  },
19084
- "9": {
19085
- name: "(anonymous_9)",
19108
+ "10": {
19109
+ name: "(anonymous_10)",
19086
19110
  decl: {
19087
19111
  start: {
19088
- line: 160,
19112
+ line: 163,
19089
19113
  column: 27
19090
19114
  },
19091
19115
  end: {
19092
- line: 160,
19116
+ line: 163,
19093
19117
  column: 28
19094
19118
  }
19095
19119
  },
19096
19120
  loc: {
19097
19121
  start: {
19098
- line: 160,
19122
+ line: 163,
19099
19123
  column: 33
19100
19124
  },
19101
19125
  end: {
19102
- line: 160,
19126
+ line: 163,
19103
19127
  column: 55
19104
19128
  }
19105
19129
  },
19106
- line: 160
19130
+ line: 163
19107
19131
  },
19108
- "10": {
19109
- name: "(anonymous_10)",
19132
+ "11": {
19133
+ name: "(anonymous_11)",
19110
19134
  decl: {
19111
19135
  start: {
19112
- line: 178,
19136
+ line: 181,
19113
19137
  column: 17
19114
19138
  },
19115
19139
  end: {
19116
- line: 178,
19140
+ line: 181,
19117
19141
  column: 18
19118
19142
  }
19119
19143
  },
19120
19144
  loc: {
19121
19145
  start: {
19122
- line: 178,
19146
+ line: 181,
19123
19147
  column: 23
19124
19148
  },
19125
19149
  end: {
19126
- line: 178,
19150
+ line: 181,
19127
19151
  column: 51
19128
19152
  }
19129
19153
  },
19130
- line: 178
19154
+ line: 181
19131
19155
  }
19132
19156
  },
19133
19157
  branchMap: {
@@ -19318,7 +19342,7 @@ function cov_1avu3clziw() {
19318
19342
  column: 7
19319
19343
  },
19320
19344
  end: {
19321
- line: 175,
19345
+ line: 178,
19322
19346
  column: 7
19323
19347
  }
19324
19348
  },
@@ -19329,16 +19353,16 @@ function cov_1avu3clziw() {
19329
19353
  column: 8
19330
19354
  },
19331
19355
  end: {
19332
- line: 168,
19356
+ line: 171,
19333
19357
  column: 14
19334
19358
  }
19335
19359
  }, {
19336
19360
  start: {
19337
- line: 170,
19361
+ line: 173,
19338
19362
  column: 8
19339
19363
  },
19340
19364
  end: {
19341
- line: 174,
19365
+ line: 177,
19342
19366
  column: 10
19343
19367
  }
19344
19368
  }],
@@ -19347,68 +19371,68 @@ function cov_1avu3clziw() {
19347
19371
  "7": {
19348
19372
  loc: {
19349
19373
  start: {
19350
- line: 147,
19351
- column: 24
19374
+ line: 145,
19375
+ column: 13
19352
19376
  },
19353
19377
  end: {
19354
- line: 147,
19355
- column: 73
19378
+ line: 154,
19379
+ column: 13
19356
19380
  }
19357
19381
  },
19358
19382
  type: "binary-expr",
19359
19383
  locations: [{
19360
19384
  start: {
19361
- line: 147,
19362
- column: 24
19385
+ line: 145,
19386
+ column: 13
19363
19387
  },
19364
19388
  end: {
19365
- line: 147,
19366
- column: 52
19389
+ line: 145,
19390
+ column: 33
19367
19391
  }
19368
19392
  }, {
19369
19393
  start: {
19370
- line: 147,
19371
- column: 56
19394
+ line: 146,
19395
+ column: 14
19372
19396
  },
19373
19397
  end: {
19374
- line: 147,
19375
- column: 73
19398
+ line: 153,
19399
+ column: 17
19376
19400
  }
19377
19401
  }],
19378
- line: 147
19402
+ line: 145
19379
19403
  },
19380
19404
  "8": {
19381
19405
  loc: {
19382
19406
  start: {
19383
- line: 164,
19407
+ line: 167,
19384
19408
  column: 16
19385
19409
  },
19386
19410
  end: {
19387
- line: 164,
19411
+ line: 167,
19388
19412
  column: 73
19389
19413
  }
19390
19414
  },
19391
19415
  type: "cond-expr",
19392
19416
  locations: [{
19393
19417
  start: {
19394
- line: 164,
19418
+ line: 167,
19395
19419
  column: 47
19396
19420
  },
19397
19421
  end: {
19398
- line: 164,
19422
+ line: 167,
19399
19423
  column: 60
19400
19424
  }
19401
19425
  }, {
19402
19426
  start: {
19403
- line: 164,
19427
+ line: 167,
19404
19428
  column: 63
19405
19429
  },
19406
19430
  end: {
19407
- line: 164,
19431
+ line: 167,
19408
19432
  column: 73
19409
19433
  }
19410
19434
  }],
19411
- line: 164
19435
+ line: 167
19412
19436
  }
19413
19437
  },
19414
19438
  s: {
@@ -19467,7 +19491,8 @@ function cov_1avu3clziw() {
19467
19491
  "7": 0,
19468
19492
  "8": 0,
19469
19493
  "9": 0,
19470
- "10": 0
19494
+ "10": 0,
19495
+ "11": 0
19471
19496
  },
19472
19497
  b: {
19473
19498
  "0": [0],
@@ -19481,7 +19506,7 @@ function cov_1avu3clziw() {
19481
19506
  "8": [0, 0]
19482
19507
  },
19483
19508
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
19484
- hash: "dfb1bddf6ad2d106cc08375435d345426efb0acc"
19509
+ hash: "5d7f552e0d851142d8649f86544e6c5b0d4b8ae3"
19485
19510
  };
19486
19511
  var coverage = global[gcv] || (global[gcv] = {});
19487
19512
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -19561,7 +19586,7 @@ var ImageUploader = function ImageUploader(_ref) {
19561
19586
  }));
19562
19587
  cov_1avu3clziw().s[17]++;
19563
19588
  onChange({
19564
- url: attachedImage.metadata.url,
19589
+ url: attachedImage.blobUrl,
19565
19590
  signedId: attachedImage.signedId
19566
19591
  });
19567
19592
  cov_1avu3clziw().s[18]++;
@@ -19577,7 +19602,7 @@ var ImageUploader = function ImageUploader(_ref) {
19577
19602
  cov_1avu3clziw().s[22]++;
19578
19603
  onChange(image);
19579
19604
  cov_1avu3clziw().s[23]++;
19580
- setSignedId(image.signedId);
19605
+ setSignedId("");
19581
19606
  cov_1avu3clziw().s[24]++;
19582
19607
  setIsEditorOpen(false);
19583
19608
  };
@@ -19633,11 +19658,14 @@ var ImageUploader = function ImageUploader(_ref) {
19633
19658
  cov_1avu3clziw().s[33]++;
19634
19659
  updateBlob(payload, {
19635
19660
  onSuccess: handleSuccess,
19661
+ onSettled: function onSettled() {
19662
+ cov_1avu3clziw().f[7]++;
19663
+ cov_1avu3clziw().s[34]++;
19664
+ return setSignedId("");
19665
+ },
19636
19666
  onError: Toastr.error
19637
19667
  });
19638
- cov_1avu3clziw().s[34]++;
19639
- setIsEditorOpen(false);
19640
- case 7:
19668
+ case 5:
19641
19669
  case "end":
19642
19670
  return _context.stop();
19643
19671
  }
@@ -19691,7 +19719,7 @@ var ImageUploader = function ImageUploader(_ref) {
19691
19719
  style: "link",
19692
19720
  onClick: function onClick() {
19693
19721
  var _inputRef$current;
19694
- cov_1avu3clziw().f[7]++;
19722
+ cov_1avu3clziw().f[8]++;
19695
19723
  cov_1avu3clziw().s[39]++;
19696
19724
  return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.click();
19697
19725
  }
@@ -19708,25 +19736,24 @@ var ImageUploader = function ImageUploader(_ref) {
19708
19736
  label: t("imageUpload.delete"),
19709
19737
  style: "danger-text",
19710
19738
  onClick: handleDelete
19711
- }), /*#__PURE__*/React.createElement("div", {
19739
+ }), (cov_1avu3clziw().b[7][0]++, isNotEmpty(signedId)) && (cov_1avu3clziw().b[7][1]++, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
19712
19740
  className: "neeto-ui-bg-gray-300 w-px"
19713
19741
  }), /*#__PURE__*/React.createElement(Button, {
19714
- disabled: (cov_1avu3clziw().b[7][0]++, IS_DEVELOPMENT_OR_HEROKU_ENV) && (cov_1avu3clziw().b[7][1]++, isEmpty(signedId)),
19715
19742
  label: t("imageUpload.edit"),
19716
19743
  style: "link",
19717
19744
  onClick: setIsEditorOpen
19718
- })), /*#__PURE__*/React.createElement(Modal$1, {
19745
+ })))), /*#__PURE__*/React.createElement(Modal$1, {
19719
19746
  className: "niu-modal",
19720
19747
  isOpen: isEditorOpen,
19721
19748
  size: "large",
19722
19749
  onClose: function onClose() {
19723
- cov_1avu3clziw().f[8]++;
19750
+ cov_1avu3clziw().f[9]++;
19724
19751
  cov_1avu3clziw().s[40]++;
19725
19752
  return setIsEditorOpen(false);
19726
19753
  }
19727
19754
  }, /*#__PURE__*/React.createElement(ImageEditor, {
19728
19755
  handleReset: function handleReset() {
19729
- cov_1avu3clziw().f[9]++;
19756
+ cov_1avu3clziw().f[10]++;
19730
19757
  cov_1avu3clziw().s[41]++;
19731
19758
  return setIsEditorOpen(false);
19732
19759
  },
@@ -19740,7 +19767,7 @@ var ImageUploader = function ImageUploader(_ref) {
19740
19767
  })), /*#__PURE__*/React.createElement(Modal, {
19741
19768
  isOpen: isAssetLibraryOpen,
19742
19769
  onClose: function onClose() {
19743
- cov_1avu3clziw().f[10]++;
19770
+ cov_1avu3clziw().f[11]++;
19744
19771
  cov_1avu3clziw().s[42]++;
19745
19772
  return setIsAssetLibraryOpen(false);
19746
19773
  },