@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.cjs.js CHANGED
@@ -17964,7 +17964,7 @@ var Modal = function Modal(_ref) {
17964
17964
  cov_2my1w2udyi().f[3]++;
17965
17965
  cov_2my1w2udyi().s[14]++;
17966
17966
  onUploadComplete({
17967
- url: image.metadata.url,
17967
+ url: image.blobUrl,
17968
17968
  signedId: image.signedId
17969
17969
  });
17970
17970
  },
@@ -18437,7 +18437,7 @@ var ProgressBar = function ProgressBar(_ref) {
18437
18437
 
18438
18438
  function cov_1avu3clziw() {
18439
18439
  var path = "/home/runner/work/neeto-image-uploader-nano/neeto-image-uploader-nano/app/javascript/src/components/ImageUploader/index.jsx";
18440
- var hash = "dfb1bddf6ad2d106cc08375435d345426efb0acc";
18440
+ var hash = "5d7f552e0d851142d8649f86544e6c5b0d4b8ae3";
18441
18441
  var global = new Function("return this")();
18442
18442
  var gcv = "__coverage__";
18443
18443
  var coverageData = {
@@ -18449,7 +18449,7 @@ function cov_1avu3clziw() {
18449
18449
  column: 22
18450
18450
  },
18451
18451
  end: {
18452
- line: 183,
18452
+ line: 186,
18453
18453
  column: 1
18454
18454
  }
18455
18455
  },
@@ -18680,7 +18680,7 @@ function cov_1avu3clziw() {
18680
18680
  },
18681
18681
  end: {
18682
18682
  line: 52,
18683
- column: 32
18683
+ column: 20
18684
18684
  }
18685
18685
  },
18686
18686
  "24": {
@@ -18779,18 +18779,18 @@ function cov_1avu3clziw() {
18779
18779
  column: 4
18780
18780
  },
18781
18781
  end: {
18782
- line: 87,
18782
+ line: 88,
18783
18783
  column: 7
18784
18784
  }
18785
18785
  },
18786
18786
  "34": {
18787
18787
  start: {
18788
- line: 88,
18789
- column: 4
18788
+ line: 86,
18789
+ column: 23
18790
18790
  },
18791
18791
  end: {
18792
- line: 88,
18793
- column: 27
18792
+ line: 86,
18793
+ column: 38
18794
18794
  }
18795
18795
  },
18796
18796
  "35": {
@@ -18829,7 +18829,7 @@ function cov_1avu3clziw() {
18829
18829
  column: 2
18830
18830
  },
18831
18831
  end: {
18832
- line: 182,
18832
+ line: 185,
18833
18833
  column: 4
18834
18834
  }
18835
18835
  },
@@ -18845,31 +18845,31 @@ function cov_1avu3clziw() {
18845
18845
  },
18846
18846
  "40": {
18847
18847
  start: {
18848
- line: 157,
18848
+ line: 160,
18849
18849
  column: 27
18850
18850
  },
18851
18851
  end: {
18852
- line: 157,
18852
+ line: 160,
18853
18853
  column: 49
18854
18854
  }
18855
18855
  },
18856
18856
  "41": {
18857
18857
  start: {
18858
- line: 160,
18858
+ line: 163,
18859
18859
  column: 33
18860
18860
  },
18861
18861
  end: {
18862
- line: 160,
18862
+ line: 163,
18863
18863
  column: 55
18864
18864
  }
18865
18865
  },
18866
18866
  "42": {
18867
18867
  start: {
18868
- line: 178,
18868
+ line: 181,
18869
18869
  column: 23
18870
18870
  },
18871
18871
  end: {
18872
- line: 178,
18872
+ line: 181,
18873
18873
  column: 51
18874
18874
  }
18875
18875
  }
@@ -18893,7 +18893,7 @@ function cov_1avu3clziw() {
18893
18893
  column: 76
18894
18894
  },
18895
18895
  end: {
18896
- line: 183,
18896
+ line: 186,
18897
18897
  column: 1
18898
18898
  }
18899
18899
  },
@@ -19045,6 +19045,30 @@ function cov_1avu3clziw() {
19045
19045
  },
19046
19046
  "7": {
19047
19047
  name: "(anonymous_7)",
19048
+ decl: {
19049
+ start: {
19050
+ line: 86,
19051
+ column: 17
19052
+ },
19053
+ end: {
19054
+ line: 86,
19055
+ column: 18
19056
+ }
19057
+ },
19058
+ loc: {
19059
+ start: {
19060
+ line: 86,
19061
+ column: 23
19062
+ },
19063
+ end: {
19064
+ line: 86,
19065
+ column: 38
19066
+ }
19067
+ },
19068
+ line: 86
19069
+ },
19070
+ "8": {
19071
+ name: "(anonymous_8)",
19048
19072
  decl: {
19049
19073
  start: {
19050
19074
  line: 129,
@@ -19067,77 +19091,77 @@ function cov_1avu3clziw() {
19067
19091
  },
19068
19092
  line: 129
19069
19093
  },
19070
- "8": {
19071
- name: "(anonymous_8)",
19094
+ "9": {
19095
+ name: "(anonymous_9)",
19072
19096
  decl: {
19073
19097
  start: {
19074
- line: 157,
19098
+ line: 160,
19075
19099
  column: 21
19076
19100
  },
19077
19101
  end: {
19078
- line: 157,
19102
+ line: 160,
19079
19103
  column: 22
19080
19104
  }
19081
19105
  },
19082
19106
  loc: {
19083
19107
  start: {
19084
- line: 157,
19108
+ line: 160,
19085
19109
  column: 27
19086
19110
  },
19087
19111
  end: {
19088
- line: 157,
19112
+ line: 160,
19089
19113
  column: 49
19090
19114
  }
19091
19115
  },
19092
- line: 157
19116
+ line: 160
19093
19117
  },
19094
- "9": {
19095
- name: "(anonymous_9)",
19118
+ "10": {
19119
+ name: "(anonymous_10)",
19096
19120
  decl: {
19097
19121
  start: {
19098
- line: 160,
19122
+ line: 163,
19099
19123
  column: 27
19100
19124
  },
19101
19125
  end: {
19102
- line: 160,
19126
+ line: 163,
19103
19127
  column: 28
19104
19128
  }
19105
19129
  },
19106
19130
  loc: {
19107
19131
  start: {
19108
- line: 160,
19132
+ line: 163,
19109
19133
  column: 33
19110
19134
  },
19111
19135
  end: {
19112
- line: 160,
19136
+ line: 163,
19113
19137
  column: 55
19114
19138
  }
19115
19139
  },
19116
- line: 160
19140
+ line: 163
19117
19141
  },
19118
- "10": {
19119
- name: "(anonymous_10)",
19142
+ "11": {
19143
+ name: "(anonymous_11)",
19120
19144
  decl: {
19121
19145
  start: {
19122
- line: 178,
19146
+ line: 181,
19123
19147
  column: 17
19124
19148
  },
19125
19149
  end: {
19126
- line: 178,
19150
+ line: 181,
19127
19151
  column: 18
19128
19152
  }
19129
19153
  },
19130
19154
  loc: {
19131
19155
  start: {
19132
- line: 178,
19156
+ line: 181,
19133
19157
  column: 23
19134
19158
  },
19135
19159
  end: {
19136
- line: 178,
19160
+ line: 181,
19137
19161
  column: 51
19138
19162
  }
19139
19163
  },
19140
- line: 178
19164
+ line: 181
19141
19165
  }
19142
19166
  },
19143
19167
  branchMap: {
@@ -19328,7 +19352,7 @@ function cov_1avu3clziw() {
19328
19352
  column: 7
19329
19353
  },
19330
19354
  end: {
19331
- line: 175,
19355
+ line: 178,
19332
19356
  column: 7
19333
19357
  }
19334
19358
  },
@@ -19339,16 +19363,16 @@ function cov_1avu3clziw() {
19339
19363
  column: 8
19340
19364
  },
19341
19365
  end: {
19342
- line: 168,
19366
+ line: 171,
19343
19367
  column: 14
19344
19368
  }
19345
19369
  }, {
19346
19370
  start: {
19347
- line: 170,
19371
+ line: 173,
19348
19372
  column: 8
19349
19373
  },
19350
19374
  end: {
19351
- line: 174,
19375
+ line: 177,
19352
19376
  column: 10
19353
19377
  }
19354
19378
  }],
@@ -19357,68 +19381,68 @@ function cov_1avu3clziw() {
19357
19381
  "7": {
19358
19382
  loc: {
19359
19383
  start: {
19360
- line: 147,
19361
- column: 24
19384
+ line: 145,
19385
+ column: 13
19362
19386
  },
19363
19387
  end: {
19364
- line: 147,
19365
- column: 73
19388
+ line: 154,
19389
+ column: 13
19366
19390
  }
19367
19391
  },
19368
19392
  type: "binary-expr",
19369
19393
  locations: [{
19370
19394
  start: {
19371
- line: 147,
19372
- column: 24
19395
+ line: 145,
19396
+ column: 13
19373
19397
  },
19374
19398
  end: {
19375
- line: 147,
19376
- column: 52
19399
+ line: 145,
19400
+ column: 33
19377
19401
  }
19378
19402
  }, {
19379
19403
  start: {
19380
- line: 147,
19381
- column: 56
19404
+ line: 146,
19405
+ column: 14
19382
19406
  },
19383
19407
  end: {
19384
- line: 147,
19385
- column: 73
19408
+ line: 153,
19409
+ column: 17
19386
19410
  }
19387
19411
  }],
19388
- line: 147
19412
+ line: 145
19389
19413
  },
19390
19414
  "8": {
19391
19415
  loc: {
19392
19416
  start: {
19393
- line: 164,
19417
+ line: 167,
19394
19418
  column: 16
19395
19419
  },
19396
19420
  end: {
19397
- line: 164,
19421
+ line: 167,
19398
19422
  column: 73
19399
19423
  }
19400
19424
  },
19401
19425
  type: "cond-expr",
19402
19426
  locations: [{
19403
19427
  start: {
19404
- line: 164,
19428
+ line: 167,
19405
19429
  column: 47
19406
19430
  },
19407
19431
  end: {
19408
- line: 164,
19432
+ line: 167,
19409
19433
  column: 60
19410
19434
  }
19411
19435
  }, {
19412
19436
  start: {
19413
- line: 164,
19437
+ line: 167,
19414
19438
  column: 63
19415
19439
  },
19416
19440
  end: {
19417
- line: 164,
19441
+ line: 167,
19418
19442
  column: 73
19419
19443
  }
19420
19444
  }],
19421
- line: 164
19445
+ line: 167
19422
19446
  }
19423
19447
  },
19424
19448
  s: {
@@ -19477,7 +19501,8 @@ function cov_1avu3clziw() {
19477
19501
  "7": 0,
19478
19502
  "8": 0,
19479
19503
  "9": 0,
19480
- "10": 0
19504
+ "10": 0,
19505
+ "11": 0
19481
19506
  },
19482
19507
  b: {
19483
19508
  "0": [0],
@@ -19491,7 +19516,7 @@ function cov_1avu3clziw() {
19491
19516
  "8": [0, 0]
19492
19517
  },
19493
19518
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
19494
- hash: "dfb1bddf6ad2d106cc08375435d345426efb0acc"
19519
+ hash: "5d7f552e0d851142d8649f86544e6c5b0d4b8ae3"
19495
19520
  };
19496
19521
  var coverage = global[gcv] || (global[gcv] = {});
19497
19522
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -19571,7 +19596,7 @@ var ImageUploader = function ImageUploader(_ref) {
19571
19596
  }));
19572
19597
  cov_1avu3clziw().s[17]++;
19573
19598
  onChange({
19574
- url: attachedImage.metadata.url,
19599
+ url: attachedImage.blobUrl,
19575
19600
  signedId: attachedImage.signedId
19576
19601
  });
19577
19602
  cov_1avu3clziw().s[18]++;
@@ -19587,7 +19612,7 @@ var ImageUploader = function ImageUploader(_ref) {
19587
19612
  cov_1avu3clziw().s[22]++;
19588
19613
  onChange(image);
19589
19614
  cov_1avu3clziw().s[23]++;
19590
- setSignedId(image.signedId);
19615
+ setSignedId("");
19591
19616
  cov_1avu3clziw().s[24]++;
19592
19617
  setIsEditorOpen(false);
19593
19618
  };
@@ -19643,11 +19668,14 @@ var ImageUploader = function ImageUploader(_ref) {
19643
19668
  cov_1avu3clziw().s[33]++;
19644
19669
  updateBlob(payload, {
19645
19670
  onSuccess: handleSuccess,
19671
+ onSettled: function onSettled() {
19672
+ cov_1avu3clziw().f[7]++;
19673
+ cov_1avu3clziw().s[34]++;
19674
+ return setSignedId("");
19675
+ },
19646
19676
  onError: neetoui.Toastr.error
19647
19677
  });
19648
- cov_1avu3clziw().s[34]++;
19649
- setIsEditorOpen(false);
19650
- case 7:
19678
+ case 5:
19651
19679
  case "end":
19652
19680
  return _context.stop();
19653
19681
  }
@@ -19701,7 +19729,7 @@ var ImageUploader = function ImageUploader(_ref) {
19701
19729
  style: "link",
19702
19730
  onClick: function onClick() {
19703
19731
  var _inputRef$current;
19704
- cov_1avu3clziw().f[7]++;
19732
+ cov_1avu3clziw().f[8]++;
19705
19733
  cov_1avu3clziw().s[39]++;
19706
19734
  return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.click();
19707
19735
  }
@@ -19718,25 +19746,24 @@ var ImageUploader = function ImageUploader(_ref) {
19718
19746
  label: t("imageUpload.delete"),
19719
19747
  style: "danger-text",
19720
19748
  onClick: handleDelete
19721
- }), /*#__PURE__*/React__default["default"].createElement("div", {
19749
+ }), (cov_1avu3clziw().b[7][0]++, pure.isNotEmpty(signedId)) && (cov_1avu3clziw().b[7][1]++, /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
19722
19750
  className: "neeto-ui-bg-gray-300 w-px"
19723
19751
  }), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
19724
- disabled: (cov_1avu3clziw().b[7][0]++, IS_DEVELOPMENT_OR_HEROKU_ENV) && (cov_1avu3clziw().b[7][1]++, ramda.isEmpty(signedId)),
19725
19752
  label: t("imageUpload.edit"),
19726
19753
  style: "link",
19727
19754
  onClick: setIsEditorOpen
19728
- })), /*#__PURE__*/React__default["default"].createElement(neetoui.Modal, {
19755
+ })))), /*#__PURE__*/React__default["default"].createElement(neetoui.Modal, {
19729
19756
  className: "niu-modal",
19730
19757
  isOpen: isEditorOpen,
19731
19758
  size: "large",
19732
19759
  onClose: function onClose() {
19733
- cov_1avu3clziw().f[8]++;
19760
+ cov_1avu3clziw().f[9]++;
19734
19761
  cov_1avu3clziw().s[40]++;
19735
19762
  return setIsEditorOpen(false);
19736
19763
  }
19737
19764
  }, /*#__PURE__*/React__default["default"].createElement(ImageEditor, {
19738
19765
  handleReset: function handleReset() {
19739
- cov_1avu3clziw().f[9]++;
19766
+ cov_1avu3clziw().f[10]++;
19740
19767
  cov_1avu3clziw().s[41]++;
19741
19768
  return setIsEditorOpen(false);
19742
19769
  },
@@ -19750,7 +19777,7 @@ var ImageUploader = function ImageUploader(_ref) {
19750
19777
  })), /*#__PURE__*/React__default["default"].createElement(Modal, {
19751
19778
  isOpen: isAssetLibraryOpen,
19752
19779
  onClose: function onClose() {
19753
- cov_1avu3clziw().f[10]++;
19780
+ cov_1avu3clziw().f[11]++;
19754
19781
  cov_1avu3clziw().s[42]++;
19755
19782
  return setIsAssetLibraryOpen(false);
19756
19783
  },